const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-BSwTrgYn.css"])))=>i.map(i=>d[i]);
var __defProp = Object.defineProperty;
var __typeError = (msg) => {
  throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
var __privateWrapper = (obj, member, setter, getter) => ({
  set _(value) {
    __privateSet(obj, member, value, setter);
  },
  get _() {
    return __privateGet(obj, member, getter);
  }
});
let zgt, zu, oi, dxe, ce, rH, cxe, ll, aH, Wgt, Ht, Lgt, rt, qgt, Ur, q1, pDe, L1, Zm, ji, Ugt, iH, $, me, ok, zne, wg, rn, Bre, da, CCe, IF, hu, JCe, Ogt, Jn, GC, Un, zo, lxe, bDe, Ug, Py, rk, Vgt, $gt, kf, Ngt, or;
let __tla = (async () => {
  var _e2, _t2, _a2, _e3, _t3, _n2, _b2, _e4, _t4, _n3, _c, _e5, _d2, _e6, _t5, _n4, _i2, _r2, _s, _a3, __2e_instances, o_fn, _e7, _e8, _t6, _n5, _i3, _r3, _s2, _a4, _o2, _g2, _h2, _f2, _c2, _d3, _l2, _m, _pte_instances, u_fn, p_fn, F_fn, v_fn, __fn, y_fn, b_fn, x_fn, w_fn, _f3, _e9, _t7, _n6, _i4, _C2e_instances, r_fn, _g3, _e10, _t8, _n7, _h3, _e11, _i5, _e12, _t9, _n8, _i6, _r4, _s3, _a5, _o3, _j2, _k2;
  function n7(t, e) {
    for (var n = 0; n < e.length; n++) {
      const r = e[n];
      if (typeof r != "string" && !Array.isArray(r)) {
        for (const i in r) if (i !== "default" && !(i in t)) {
          const a = Object.getOwnPropertyDescriptor(r, i);
          a && Object.defineProperty(t, i, a.get ? a : {
            enumerable: true,
            get: () => r[i]
          });
        }
      }
    }
    return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, {
      value: "Module"
    }));
  }
  (function() {
    const e = document.createElement("link").relList;
    if (e && e.supports && e.supports("modulepreload")) return;
    for (const i of document.querySelectorAll('link[rel="modulepreload"]')) r(i);
    new MutationObserver((i) => {
      for (const a of i) if (a.type === "childList") for (const s of a.addedNodes) s.tagName === "LINK" && s.rel === "modulepreload" && r(s);
    }).observe(document, {
      childList: true,
      subtree: true
    });
    function n(i) {
      const a = {};
      return i.integrity && (a.integrity = i.integrity), i.referrerPolicy && (a.referrerPolicy = i.referrerPolicy), i.crossOrigin === "use-credentials" ? a.credentials = "include" : i.crossOrigin === "anonymous" ? a.credentials = "omit" : a.credentials = "same-origin", a;
    }
    function r(i) {
      if (i.ep) return;
      i.ep = true;
      const a = n(i);
      fetch(i.href, a);
    }
  })();
  var sl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
  da = function(t) {
    return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
  };
  function IQ(t) {
    if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
    var e = t.default;
    if (typeof e == "function") {
      var n = function r() {
        var i = false;
        try {
          i = this instanceof r;
        } catch {
        }
        return i ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
      };
      n.prototype = e.prototype;
    } else n = {};
    return Object.defineProperty(n, "__esModule", {
      value: true
    }), Object.keys(t).forEach(function(r) {
      var i = Object.getOwnPropertyDescriptor(t, r);
      Object.defineProperty(n, r, i.get ? i : {
        enumerable: true,
        get: function() {
          return t[r];
        }
      });
    }), n;
  }
  var pj = {
    exports: {}
  }, Gv = {}, Fj = {
    exports: {}
  }, Ar = {};
  var Nz;
  function x0e() {
    if (Nz) return Ar;
    Nz = 1;
    var t = /* @__PURE__ */ Symbol.for("react.element"), e = /* @__PURE__ */ Symbol.for("react.portal"), n = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), i = /* @__PURE__ */ Symbol.for("react.profiler"), a = /* @__PURE__ */ Symbol.for("react.provider"), s = /* @__PURE__ */ Symbol.for("react.context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), c = /* @__PURE__ */ Symbol.for("react.suspense"), d = /* @__PURE__ */ Symbol.for("react.memo"), u = /* @__PURE__ */ Symbol.for("react.lazy"), h = Symbol.iterator;
    function f(Y) {
      return Y === null || typeof Y != "object" ? null : (Y = h && Y[h] || Y["@@iterator"], typeof Y == "function" ? Y : null);
    }
    var g = {
      isMounted: function() {
        return false;
      },
      enqueueForceUpdate: function() {
      },
      enqueueReplaceState: function() {
      },
      enqueueSetState: function() {
      }
    }, m = Object.assign, v = {};
    function y(Y, oe, ue) {
      this.props = Y, this.context = oe, this.refs = v, this.updater = ue || g;
    }
    y.prototype.isReactComponent = {}, y.prototype.setState = function(Y, oe) {
      if (typeof Y != "object" && typeof Y != "function" && Y != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
      this.updater.enqueueSetState(this, Y, oe, "setState");
    }, y.prototype.forceUpdate = function(Y) {
      this.updater.enqueueForceUpdate(this, Y, "forceUpdate");
    };
    function w() {
    }
    w.prototype = y.prototype;
    function b(Y, oe, ue) {
      this.props = Y, this.context = oe, this.refs = v, this.updater = ue || g;
    }
    var j = b.prototype = new w();
    j.constructor = b, m(j, y.prototype), j.isPureReactComponent = true;
    var k = Array.isArray, C = Object.prototype.hasOwnProperty, x = {
      current: null
    }, S = {
      key: true,
      ref: true,
      __self: true,
      __source: true
    };
    function T(Y, oe, ue) {
      var ie, de = {}, ne = null, ae = null;
      if (oe != null) for (ie in oe.ref !== void 0 && (ae = oe.ref), oe.key !== void 0 && (ne = "" + oe.key), oe) C.call(oe, ie) && !S.hasOwnProperty(ie) && (de[ie] = oe[ie]);
      var X = arguments.length - 2;
      if (X === 1) de.children = ue;
      else if (1 < X) {
        for (var K = Array(X), G = 0; G < X; G++) K[G] = arguments[G + 2];
        de.children = K;
      }
      if (Y && Y.defaultProps) for (ie in X = Y.defaultProps, X) de[ie] === void 0 && (de[ie] = X[ie]);
      return {
        $$typeof: t,
        type: Y,
        key: ne,
        ref: ae,
        props: de,
        _owner: x.current
      };
    }
    function A(Y, oe) {
      return {
        $$typeof: t,
        type: Y.type,
        key: oe,
        ref: Y.ref,
        props: Y.props,
        _owner: Y._owner
      };
    }
    function B(Y) {
      return typeof Y == "object" && Y !== null && Y.$$typeof === t;
    }
    function U(Y) {
      var oe = {
        "=": "=0",
        ":": "=2"
      };
      return "$" + Y.replace(/[=:]/g, function(ue) {
        return oe[ue];
      });
    }
    var z = /\/+/g;
    function O(Y, oe) {
      return typeof Y == "object" && Y !== null && Y.key != null ? U("" + Y.key) : oe.toString(36);
    }
    function M(Y, oe, ue, ie, de) {
      var ne = typeof Y;
      (ne === "undefined" || ne === "boolean") && (Y = null);
      var ae = false;
      if (Y === null) ae = true;
      else switch (ne) {
        case "string":
        case "number":
          ae = true;
          break;
        case "object":
          switch (Y.$$typeof) {
            case t:
            case e:
              ae = true;
          }
      }
      if (ae) return ae = Y, de = de(ae), Y = ie === "" ? "." + O(ae, 0) : ie, k(de) ? (ue = "", Y != null && (ue = Y.replace(z, "$&/") + "/"), M(de, oe, ue, "", function(G) {
        return G;
      })) : de != null && (B(de) && (de = A(de, ue + (!de.key || ae && ae.key === de.key ? "" : ("" + de.key).replace(z, "$&/") + "/") + Y)), oe.push(de)), 1;
      if (ae = 0, ie = ie === "" ? "." : ie + ":", k(Y)) for (var X = 0; X < Y.length; X++) {
        ne = Y[X];
        var K = ie + O(ne, X);
        ae += M(ne, oe, ue, K, de);
      }
      else if (K = f(Y), typeof K == "function") for (Y = K.call(Y), X = 0; !(ne = Y.next()).done; ) ne = ne.value, K = ie + O(ne, X++), ae += M(ne, oe, ue, K, de);
      else if (ne === "object") throw oe = String(Y), Error("Objects are not valid as a React child (found: " + (oe === "[object Object]" ? "object with keys {" + Object.keys(Y).join(", ") + "}" : oe) + "). If you meant to render a collection of children, use an array instead.");
      return ae;
    }
    function I(Y, oe, ue) {
      if (Y == null) return Y;
      var ie = [], de = 0;
      return M(Y, ie, "", "", function(ne) {
        return oe.call(ue, ne, de++);
      }), ie;
    }
    function N(Y) {
      if (Y._status === -1) {
        var oe = Y._result;
        oe = oe(), oe.then(function(ue) {
          (Y._status === 0 || Y._status === -1) && (Y._status = 1, Y._result = ue);
        }, function(ue) {
          (Y._status === 0 || Y._status === -1) && (Y._status = 2, Y._result = ue);
        }), Y._status === -1 && (Y._status = 0, Y._result = oe);
      }
      if (Y._status === 1) return Y._result.default;
      throw Y._result;
    }
    var L = {
      current: null
    }, H = {
      transition: null
    }, V = {
      ReactCurrentDispatcher: L,
      ReactCurrentBatchConfig: H,
      ReactCurrentOwner: x
    };
    function Z() {
      throw Error("act(...) is not supported in production builds of React.");
    }
    return Ar.Children = {
      map: I,
      forEach: function(Y, oe, ue) {
        I(Y, function() {
          oe.apply(this, arguments);
        }, ue);
      },
      count: function(Y) {
        var oe = 0;
        return I(Y, function() {
          oe++;
        }), oe;
      },
      toArray: function(Y) {
        return I(Y, function(oe) {
          return oe;
        }) || [];
      },
      only: function(Y) {
        if (!B(Y)) throw Error("React.Children.only expected to receive a single React element child.");
        return Y;
      }
    }, Ar.Component = y, Ar.Fragment = n, Ar.Profiler = i, Ar.PureComponent = b, Ar.StrictMode = r, Ar.Suspense = c, Ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = V, Ar.act = Z, Ar.cloneElement = function(Y, oe, ue) {
      if (Y == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + Y + ".");
      var ie = m({}, Y.props), de = Y.key, ne = Y.ref, ae = Y._owner;
      if (oe != null) {
        if (oe.ref !== void 0 && (ne = oe.ref, ae = x.current), oe.key !== void 0 && (de = "" + oe.key), Y.type && Y.type.defaultProps) var X = Y.type.defaultProps;
        for (K in oe) C.call(oe, K) && !S.hasOwnProperty(K) && (ie[K] = oe[K] === void 0 && X !== void 0 ? X[K] : oe[K]);
      }
      var K = arguments.length - 2;
      if (K === 1) ie.children = ue;
      else if (1 < K) {
        X = Array(K);
        for (var G = 0; G < K; G++) X[G] = arguments[G + 2];
        ie.children = X;
      }
      return {
        $$typeof: t,
        type: Y.type,
        key: de,
        ref: ne,
        props: ie,
        _owner: ae
      };
    }, Ar.createContext = function(Y) {
      return Y = {
        $$typeof: s,
        _currentValue: Y,
        _currentValue2: Y,
        _threadCount: 0,
        Provider: null,
        Consumer: null,
        _defaultValue: null,
        _globalName: null
      }, Y.Provider = {
        $$typeof: a,
        _context: Y
      }, Y.Consumer = Y;
    }, Ar.createElement = T, Ar.createFactory = function(Y) {
      var oe = T.bind(null, Y);
      return oe.type = Y, oe;
    }, Ar.createRef = function() {
      return {
        current: null
      };
    }, Ar.forwardRef = function(Y) {
      return {
        $$typeof: l,
        render: Y
      };
    }, Ar.isValidElement = B, Ar.lazy = function(Y) {
      return {
        $$typeof: u,
        _payload: {
          _status: -1,
          _result: Y
        },
        _init: N
      };
    }, Ar.memo = function(Y, oe) {
      return {
        $$typeof: d,
        type: Y,
        compare: oe === void 0 ? null : oe
      };
    }, Ar.startTransition = function(Y) {
      var oe = H.transition;
      H.transition = {};
      try {
        Y();
      } finally {
        H.transition = oe;
      }
    }, Ar.unstable_act = Z, Ar.useCallback = function(Y, oe) {
      return L.current.useCallback(Y, oe);
    }, Ar.useContext = function(Y) {
      return L.current.useContext(Y);
    }, Ar.useDebugValue = function() {
    }, Ar.useDeferredValue = function(Y) {
      return L.current.useDeferredValue(Y);
    }, Ar.useEffect = function(Y, oe) {
      return L.current.useEffect(Y, oe);
    }, Ar.useId = function() {
      return L.current.useId();
    }, Ar.useImperativeHandle = function(Y, oe, ue) {
      return L.current.useImperativeHandle(Y, oe, ue);
    }, Ar.useInsertionEffect = function(Y, oe) {
      return L.current.useInsertionEffect(Y, oe);
    }, Ar.useLayoutEffect = function(Y, oe) {
      return L.current.useLayoutEffect(Y, oe);
    }, Ar.useMemo = function(Y, oe) {
      return L.current.useMemo(Y, oe);
    }, Ar.useReducer = function(Y, oe, ue) {
      return L.current.useReducer(Y, oe, ue);
    }, Ar.useRef = function(Y) {
      return L.current.useRef(Y);
    }, Ar.useState = function(Y) {
      return L.current.useState(Y);
    }, Ar.useSyncExternalStore = function(Y, oe, ue) {
      return L.current.useSyncExternalStore(Y, oe, ue);
    }, Ar.useTransition = function() {
      return L.current.useTransition();
    }, Ar.version = "18.3.1", Ar;
  }
  var zz;
  function dh() {
    return zz || (zz = 1, Fj.exports = x0e()), Fj.exports;
  }
  var Uz;
  function w0e() {
    if (Uz) return Gv;
    Uz = 1;
    var t = dh(), e = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = {
      key: true,
      ref: true,
      __self: true,
      __source: true
    };
    function s(l, c, d) {
      var u, h = {}, f = null, g = null;
      d !== void 0 && (f = "" + d), c.key !== void 0 && (f = "" + c.key), c.ref !== void 0 && (g = c.ref);
      for (u in c) r.call(c, u) && !a.hasOwnProperty(u) && (h[u] = c[u]);
      if (l && l.defaultProps) for (u in c = l.defaultProps, c) h[u] === void 0 && (h[u] = c[u]);
      return {
        $$typeof: e,
        type: l,
        key: f,
        ref: g,
        props: h,
        _owner: i.current
      };
    }
    return Gv.Fragment = n, Gv.jsx = s, Gv.jsxs = s, Gv;
  }
  var Vz;
  function D0e() {
    return Vz || (Vz = 1, pj.exports = w0e()), pj.exports;
  }
  var o = D0e();
  const ki = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Nc = globalThis, jy = "10.43.0";
  function bF() {
    return r7(Nc), Nc;
  }
  function r7(t) {
    const e = t.__SENTRY__ = t.__SENTRY__ || {};
    return e.version = e.version || jy, e[jy] = e[jy] || {};
  }
  function xF(t, e, n = Nc) {
    const r = n.__SENTRY__ = n.__SENTRY__ || {}, i = r[jy] = r[jy] || {};
    return i[t] || (i[t] = e());
  }
  const C0e = "Sentry Logger ", Hz = {};
  function Pb(t) {
    if (!("console" in Nc)) return t();
    const e = Nc.console, n = {}, r = Object.keys(Hz);
    r.forEach((i) => {
      const a = Hz[i];
      n[i] = e[i], e[i] = a;
    });
    try {
      return t();
    } finally {
      r.forEach((i) => {
        e[i] = n[i];
      });
    }
  }
  function E0e() {
    o7().enabled = true;
  }
  function k0e() {
    o7().enabled = false;
  }
  function BQ() {
    return o7().enabled;
  }
  function S0e(...t) {
    i7("log", ...t);
  }
  function j0e(...t) {
    i7("warn", ...t);
  }
  function T0e(...t) {
    i7("error", ...t);
  }
  function i7(t, ...e) {
    ki && BQ() && Pb(() => {
      Nc.console[t](`${C0e}[${t}]:`, ...e);
    });
  }
  function o7() {
    return ki ? xF("loggerSettings", () => ({
      enabled: false
    })) : {
      enabled: false
    };
  }
  const mi = {
    enable: E0e,
    disable: k0e,
    isEnabled: BQ,
    log: S0e,
    warn: j0e,
    error: T0e
  }, PQ = Object.prototype.toString;
  function R0e(t) {
    switch (PQ.call(t)) {
      case "[object Error]":
      case "[object Exception]":
      case "[object DOMException]":
      case "[object WebAssembly.Exception]":
        return true;
      default:
        return P0e(t, Error);
    }
  }
  function a7(t, e) {
    return PQ.call(t) === `[object ${e}]`;
  }
  function nR(t) {
    return a7(t, "String");
  }
  function A0e(t) {
    return typeof t == "object" && t !== null && "__sentry_template_string__" in t && "__sentry_template_values__" in t;
  }
  function I0e(t) {
    return a7(t, "Object");
  }
  function B0e(t) {
    return a7(t, "RegExp");
  }
  function MQ(t) {
    return !!((t == null ? void 0 : t.then) && typeof t.then == "function");
  }
  function P0e(t, e) {
    try {
      return t instanceof e;
    } catch {
      return false;
    }
  }
  function S1(t, e, n) {
    try {
      Object.defineProperty(t, e, {
        value: n,
        writable: true,
        configurable: true
      });
    } catch {
      ki && mi.log(`Failed to add non-enumerable property "${e}" to object`, t);
    }
  }
  let o0;
  function UE(t) {
    if (o0 !== void 0) return o0 ? o0(t) : t();
    const e = /* @__PURE__ */ Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"), n = Nc;
    return e in n && typeof n[e] == "function" ? (o0 = n[e], o0(t)) : (o0 = null, t());
  }
  function rR() {
    return UE(() => Math.random());
  }
  function M0e() {
    return UE(() => Date.now());
  }
  function O0e(t, e = 0) {
    return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
  }
  function vj(t, e, n = false) {
    return nR(t) ? B0e(e) ? e.test(t) : nR(e) ? n ? t === e : t.includes(e) : false : false;
  }
  function L0e() {
    const t = Nc;
    return t.crypto || t.msCrypto;
  }
  let _j;
  function N0e() {
    return rR() * 16;
  }
  function n1(t = L0e()) {
    try {
      if (t == null ? void 0 : t.randomUUID) return UE(() => t.randomUUID()).replace(/-/g, "");
    } catch {
    }
    return _j || (_j = "10000000100040008000" + 1e11), _j.replace(/[018]/g, (e) => (e ^ (N0e() & 15) >> e / 4).toString(16));
  }
  const OQ = 1e3;
  function s7() {
    return M0e() / OQ;
  }
  function z0e() {
    const { performance: t } = Nc;
    if (!(t == null ? void 0 : t.now) || !t.timeOrigin) return s7;
    const e = t.timeOrigin;
    return () => (e + UE(() => t.now())) / OQ;
  }
  let $z;
  function j1() {
    return ($z ?? ($z = z0e()))();
  }
  function U0e(t, e = {}) {
    if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp || j1(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : n1()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
    else if (typeof e.duration == "number") t.duration = e.duration;
    else {
      const n = t.timestamp - t.started;
      t.duration = n >= 0 ? n : 0;
    }
    e.release && (t.release = e.release), e.environment && (t.environment = e.environment), !t.ipAddress && e.ipAddress && (t.ipAddress = e.ipAddress), !t.userAgent && e.userAgent && (t.userAgent = e.userAgent), typeof e.errors == "number" && (t.errors = e.errors), e.status && (t.status = e.status);
  }
  function VE(t, e, n = 2) {
    if (!e || typeof e != "object" || n <= 0) return e;
    if (t && Object.keys(e).length === 0) return t;
    const r = {
      ...t
    };
    for (const i in e) Object.prototype.hasOwnProperty.call(e, i) && (r[i] = VE(r[i], e[i], n - 1));
    return r;
  }
  function _C() {
    return n1();
  }
  function HE() {
    return n1().substring(16);
  }
  const iR = "_sentrySpan";
  function yC(t, e) {
    e ? S1(t, iR, e) : delete t[iR];
  }
  function T1(t) {
    return t[iR];
  }
  const V0e = 100;
  class Yu {
    constructor() {
      this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._attributes = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = {
        traceId: _C(),
        sampleRand: rR()
      };
    }
    clone() {
      const e = new Yu();
      return e._breadcrumbs = [
        ...this._breadcrumbs
      ], e._tags = {
        ...this._tags
      }, e._attributes = {
        ...this._attributes
      }, e._extra = {
        ...this._extra
      }, e._contexts = {
        ...this._contexts
      }, this._contexts.flags && (e._contexts.flags = {
        values: [
          ...this._contexts.flags.values
        ]
      }), e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [
        ...this._eventProcessors
      ], e._attachments = [
        ...this._attachments
      ], e._sdkProcessingMetadata = {
        ...this._sdkProcessingMetadata
      }, e._propagationContext = {
        ...this._propagationContext
      }, e._client = this._client, e._lastEventId = this._lastEventId, e._conversationId = this._conversationId, yC(e, T1(this)), e;
    }
    setClient(e) {
      this._client = e;
    }
    setLastEventId(e) {
      this._lastEventId = e;
    }
    getClient() {
      return this._client;
    }
    lastEventId() {
      return this._lastEventId;
    }
    addScopeListener(e) {
      this._scopeListeners.push(e);
    }
    addEventProcessor(e) {
      return this._eventProcessors.push(e), this;
    }
    setUser(e) {
      return this._user = e || {
        email: void 0,
        id: void 0,
        ip_address: void 0,
        username: void 0
      }, this._session && U0e(this._session, {
        user: e
      }), this._notifyScopeListeners(), this;
    }
    getUser() {
      return this._user;
    }
    setConversationId(e) {
      return this._conversationId = e || void 0, this._notifyScopeListeners(), this;
    }
    setTags(e) {
      return this._tags = {
        ...this._tags,
        ...e
      }, this._notifyScopeListeners(), this;
    }
    setTag(e, n) {
      return this.setTags({
        [e]: n
      });
    }
    setAttributes(e) {
      return this._attributes = {
        ...this._attributes,
        ...e
      }, this._notifyScopeListeners(), this;
    }
    setAttribute(e, n) {
      return this.setAttributes({
        [e]: n
      });
    }
    removeAttribute(e) {
      return e in this._attributes && (delete this._attributes[e], this._notifyScopeListeners()), this;
    }
    setExtras(e) {
      return this._extra = {
        ...this._extra,
        ...e
      }, this._notifyScopeListeners(), this;
    }
    setExtra(e, n) {
      return this._extra = {
        ...this._extra,
        [e]: n
      }, this._notifyScopeListeners(), this;
    }
    setFingerprint(e) {
      return this._fingerprint = e, this._notifyScopeListeners(), this;
    }
    setLevel(e) {
      return this._level = e, this._notifyScopeListeners(), this;
    }
    setTransactionName(e) {
      return this._transactionName = e, this._notifyScopeListeners(), this;
    }
    setContext(e, n) {
      return n === null ? delete this._contexts[e] : this._contexts[e] = n, this._notifyScopeListeners(), this;
    }
    setSession(e) {
      return e ? this._session = e : delete this._session, this._notifyScopeListeners(), this;
    }
    getSession() {
      return this._session;
    }
    update(e) {
      if (!e) return this;
      const n = typeof e == "function" ? e(this) : e, r = n instanceof Yu ? n.getScopeData() : I0e(n) ? e : void 0, { tags: i, attributes: a, extra: s, user: l, contexts: c, level: d, fingerprint: u = [], propagationContext: h, conversationId: f } = r || {};
      return this._tags = {
        ...this._tags,
        ...i
      }, this._attributes = {
        ...this._attributes,
        ...a
      }, this._extra = {
        ...this._extra,
        ...s
      }, this._contexts = {
        ...this._contexts,
        ...c
      }, l && Object.keys(l).length && (this._user = l), d && (this._level = d), u.length && (this._fingerprint = u), h && (this._propagationContext = h), f && (this._conversationId = f), this;
    }
    clear() {
      return this._breadcrumbs = [], this._tags = {}, this._attributes = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._session = void 0, this._conversationId = void 0, yC(this, void 0), this._attachments = [], this.setPropagationContext({
        traceId: _C(),
        sampleRand: rR()
      }), this._notifyScopeListeners(), this;
    }
    addBreadcrumb(e, n) {
      var _a6;
      const r = typeof n == "number" ? n : V0e;
      if (r <= 0) return this;
      const i = {
        timestamp: s7(),
        ...e,
        message: e.message ? O0e(e.message, 2048) : e.message
      };
      return this._breadcrumbs.push(i), this._breadcrumbs.length > r && (this._breadcrumbs = this._breadcrumbs.slice(-r), (_a6 = this._client) == null ? void 0 : _a6.recordDroppedEvent("buffer_overflow", "log_item")), this._notifyScopeListeners(), this;
    }
    getLastBreadcrumb() {
      return this._breadcrumbs[this._breadcrumbs.length - 1];
    }
    clearBreadcrumbs() {
      return this._breadcrumbs = [], this._notifyScopeListeners(), this;
    }
    addAttachment(e) {
      return this._attachments.push(e), this;
    }
    clearAttachments() {
      return this._attachments = [], this;
    }
    getScopeData() {
      return {
        breadcrumbs: this._breadcrumbs,
        attachments: this._attachments,
        contexts: this._contexts,
        tags: this._tags,
        attributes: this._attributes,
        extra: this._extra,
        user: this._user,
        level: this._level,
        fingerprint: this._fingerprint || [],
        eventProcessors: this._eventProcessors,
        propagationContext: this._propagationContext,
        sdkProcessingMetadata: this._sdkProcessingMetadata,
        transactionName: this._transactionName,
        span: T1(this),
        conversationId: this._conversationId
      };
    }
    setSDKProcessingMetadata(e) {
      return this._sdkProcessingMetadata = VE(this._sdkProcessingMetadata, e, 2), this;
    }
    setPropagationContext(e) {
      return this._propagationContext = e, this;
    }
    getPropagationContext() {
      return this._propagationContext;
    }
    captureException(e, n) {
      const r = (n == null ? void 0 : n.event_id) || n1();
      if (!this._client) return ki && mi.warn("No client configured on scope - will not capture exception!"), r;
      const i = new Error("Sentry syntheticException");
      return this._client.captureException(e, {
        originalException: e,
        syntheticException: i,
        ...n,
        event_id: r
      }, this), r;
    }
    captureMessage(e, n, r) {
      const i = (r == null ? void 0 : r.event_id) || n1();
      if (!this._client) return ki && mi.warn("No client configured on scope - will not capture message!"), i;
      const a = (r == null ? void 0 : r.syntheticException) ?? new Error(e);
      return this._client.captureMessage(e, n, {
        originalException: e,
        syntheticException: a,
        ...r,
        event_id: i
      }, this), i;
    }
    captureEvent(e, n) {
      const r = e.event_id || (n == null ? void 0 : n.event_id) || n1();
      return this._client ? (this._client.captureEvent(e, {
        ...n,
        event_id: r
      }, this), r) : (ki && mi.warn("No client configured on scope - will not capture event!"), r);
    }
    _notifyScopeListeners() {
      this._notifyingListeners || (this._notifyingListeners = true, this._scopeListeners.forEach((e) => {
        e(this);
      }), this._notifyingListeners = false);
    }
  }
  function H0e() {
    return xF("defaultCurrentScope", () => new Yu());
  }
  function $0e() {
    return xF("defaultIsolationScope", () => new Yu());
  }
  class W0e {
    constructor(e, n) {
      let r;
      e ? r = e : r = new Yu();
      let i;
      n ? i = n : i = new Yu(), this._stack = [
        {
          scope: r
        }
      ], this._isolationScope = i;
    }
    withScope(e) {
      const n = this._pushScope();
      let r;
      try {
        r = e(n);
      } catch (i) {
        throw this._popScope(), i;
      }
      return MQ(r) ? r.then((i) => (this._popScope(), i), (i) => {
        throw this._popScope(), i;
      }) : (this._popScope(), r);
    }
    getClient() {
      return this.getStackTop().client;
    }
    getScope() {
      return this.getStackTop().scope;
    }
    getIsolationScope() {
      return this._isolationScope;
    }
    getStackTop() {
      return this._stack[this._stack.length - 1];
    }
    _pushScope() {
      const e = this.getScope().clone();
      return this._stack.push({
        client: this.getClient(),
        scope: e
      }), e;
    }
    _popScope() {
      return this._stack.length <= 1 ? false : !!this._stack.pop();
    }
  }
  function R1() {
    const t = bF(), e = r7(t);
    return e.stack = e.stack || new W0e(H0e(), $0e());
  }
  function q0e(t) {
    return R1().withScope(t);
  }
  function K0e(t, e) {
    const n = R1();
    return n.withScope(() => (n.getStackTop().scope = t, e(t)));
  }
  function Wz(t) {
    return R1().withScope(() => t(R1().getIsolationScope()));
  }
  function G0e() {
    return {
      withIsolationScope: Wz,
      withScope: q0e,
      withSetScope: K0e,
      withSetIsolationScope: (t, e) => Wz(e),
      getCurrentScope: () => R1().getScope(),
      getIsolationScope: () => R1().getIsolationScope()
    };
  }
  function Mb(t) {
    const e = r7(t);
    return e.acs ? e.acs : G0e();
  }
  function ul() {
    const t = bF();
    return Mb(t).getCurrentScope();
  }
  function Wf() {
    const t = bF();
    return Mb(t).getIsolationScope();
  }
  function Y0e() {
    return xF("globalScope", () => new Yu());
  }
  function wF(...t) {
    const e = bF(), n = Mb(e);
    if (t.length === 2) {
      const [r, i] = t;
      return r ? n.withSetScope(r, i) : n.withScope(i);
    }
    return n.withScope(t[0]);
  }
  function Ms() {
    return ul().getClient();
  }
  function Z0e(t) {
    const e = t.getPropagationContext(), { traceId: n, parentSpanId: r, propagationSpanId: i } = e, a = {
      trace_id: n,
      span_id: i || HE()
    };
    return r && (a.parent_span_id = r), a;
  }
  const bC = "sentry.source", LQ = "sentry.sample_rate", J0e = "sentry.previous_trace_sample_rate", oR = "sentry.op", aR = "sentry.origin", X0e = "sentry.measurement_unit", Q0e = "sentry.measurement_value", qz = "sentry.custom_span_name", e1e = "sentry.profile_id", t1e = "sentry.exclusive_time", n1e = 0, r1e = 1, i1e = 2, NQ = "_sentryScope", zQ = "_sentryIsolationScope";
  function o1e(t) {
    try {
      const e = Nc.WeakRef;
      if (typeof e == "function") return new e(t);
    } catch {
    }
    return t;
  }
  function a1e(t) {
    if (t) {
      if (typeof t == "object" && "deref" in t && typeof t.deref == "function") try {
        return t.deref();
      } catch {
        return;
      }
      return t;
    }
  }
  function s1e(t, e, n) {
    t && (S1(t, zQ, o1e(n)), S1(t, NQ, e));
  }
  function xC(t) {
    const e = t;
    return {
      scope: e[NQ],
      isolationScope: a1e(e[zQ])
    };
  }
  const l1e = "sentry-", c1e = /^sentry-/;
  function d1e(t) {
    const e = u1e(t);
    if (!e) return;
    const n = Object.entries(e).reduce((r, [i, a]) => {
      if (i.match(c1e)) {
        const s = i.slice(l1e.length);
        r[s] = a;
      }
      return r;
    }, {});
    if (Object.keys(n).length > 0) return n;
  }
  function u1e(t) {
    if (!(!t || !nR(t) && !Array.isArray(t))) return Array.isArray(t) ? t.reduce((e, n) => {
      const r = Kz(n);
      return Object.entries(r).forEach(([i, a]) => {
        e[i] = a;
      }), e;
    }, {}) : Kz(t);
  }
  function Kz(t) {
    return t.split(",").map((e) => {
      const n = e.indexOf("=");
      if (n === -1) return [];
      const r = e.slice(0, n), i = e.slice(n + 1);
      return [
        r,
        i
      ].map((a) => {
        try {
          return decodeURIComponent(a.trim());
        } catch {
          return;
        }
      });
    }).reduce((e, [n, r]) => (n && r && (e[n] = r), e), {});
  }
  const h1e = /^o(\d+)\./, f1e = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;
  function m1e(t) {
    return t === "http" || t === "https";
  }
  function $E(t, e = false) {
    const { host: n, path: r, pass: i, port: a, projectId: s, protocol: l, publicKey: c } = t;
    return `${l}://${c}${e && i ? `:${i}` : ""}@${n}${a ? `:${a}` : ""}/${r && `${r}/`}${s}`;
  }
  function g1e(t) {
    const e = f1e.exec(t);
    if (!e) {
      Pb(() => {
        console.error(`Invalid Sentry Dsn: ${t}`);
      });
      return;
    }
    const [n, r, i = "", a = "", s = "", l = ""] = e.slice(1);
    let c = "", d = l;
    const u = d.split("/");
    if (u.length > 1 && (c = u.slice(0, -1).join("/"), d = u.pop()), d) {
      const h = d.match(/^\d+/);
      h && (d = h[0]);
    }
    return UQ({
      host: a,
      pass: i,
      path: c,
      projectId: d,
      port: s,
      protocol: n,
      publicKey: r
    });
  }
  function UQ(t) {
    return {
      protocol: t.protocol,
      publicKey: t.publicKey || "",
      pass: t.pass || "",
      host: t.host,
      port: t.port || "",
      path: t.path || "",
      projectId: t.projectId
    };
  }
  function p1e(t) {
    if (!ki) return true;
    const { port: e, projectId: n, protocol: r } = t;
    return [
      "protocol",
      "publicKey",
      "host",
      "projectId"
    ].find((s) => t[s] ? false : (mi.error(`Invalid Sentry Dsn: ${s} missing`), true)) ? false : n.match(/^\d+$/) ? m1e(r) ? e && isNaN(parseInt(e, 10)) ? (mi.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (mi.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (mi.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
  }
  function F1e(t) {
    var _a6;
    return (_a6 = t.match(h1e)) == null ? void 0 : _a6[1];
  }
  function v1e(t) {
    const e = t.getOptions(), { host: n } = t.getDsn() || {};
    let r;
    return e.orgId ? r = String(e.orgId) : n && (r = F1e(n)), r;
  }
  function _1e(t) {
    const e = typeof t == "string" ? g1e(t) : UQ(t);
    if (!(!e || !p1e(e))) return e;
  }
  function VQ(t) {
    if (typeof t == "boolean") return Number(t);
    const e = typeof t == "string" ? parseFloat(t) : t;
    if (!(typeof e != "number" || isNaN(e) || e < 0 || e > 1)) return e;
  }
  const HQ = 0, l7 = 1;
  let Gz = false;
  function y1e(t) {
    const { spanId: e, traceId: n } = t.spanContext(), { data: r, op: i, parent_span_id: a, status: s, origin: l, links: c } = Ul(t);
    return {
      parent_span_id: a,
      span_id: e,
      trace_id: n,
      data: r,
      op: i,
      status: s,
      origin: l,
      links: c
    };
  }
  function b1e(t) {
    const { spanId: e, traceId: n, isRemote: r } = t.spanContext(), i = r ? e : Ul(t).parent_span_id, a = xC(t).scope, s = r ? (a == null ? void 0 : a.getPropagationContext().propagationSpanId) || HE() : e;
    return {
      parent_span_id: i,
      span_id: s,
      trace_id: n
    };
  }
  function $Q(t) {
    if (t && t.length > 0) return t.map(({ context: { spanId: e, traceId: n, traceFlags: r, ...i }, attributes: a }) => ({
      span_id: e,
      trace_id: n,
      sampled: r === l7,
      attributes: a,
      ...i
    }));
  }
  function r1(t) {
    return typeof t == "number" ? Yz(t) : Array.isArray(t) ? t[0] + t[1] / 1e9 : t instanceof Date ? Yz(t.getTime()) : j1();
  }
  function Yz(t) {
    return t > 9999999999 ? t / 1e3 : t;
  }
  function Ul(t) {
    var _a6;
    if (w1e(t)) return t.getSpanJSON();
    const { spanId: e, traceId: n } = t.spanContext();
    if (x1e(t)) {
      const { attributes: r, startTime: i, name: a, endTime: s, status: l, links: c } = t, d = "parentSpanId" in t ? t.parentSpanId : "parentSpanContext" in t ? (_a6 = t.parentSpanContext) == null ? void 0 : _a6.spanId : void 0;
      return {
        span_id: e,
        trace_id: n,
        data: r,
        description: a,
        parent_span_id: d,
        start_timestamp: r1(i),
        timestamp: r1(s) || void 0,
        status: WQ(l),
        op: r[oR],
        origin: r[aR],
        links: $Q(c)
      };
    }
    return {
      span_id: e,
      trace_id: n,
      start_timestamp: 0,
      data: {}
    };
  }
  function x1e(t) {
    const e = t;
    return !!e.attributes && !!e.startTime && !!e.name && !!e.endTime && !!e.status;
  }
  function w1e(t) {
    return typeof t.getSpanJSON == "function";
  }
  function Ob(t) {
    const { traceFlags: e } = t.spanContext();
    return e === l7;
  }
  function WQ(t) {
    if (!(!t || t.code === n1e)) return t.code === r1e ? "ok" : t.message || "internal_error";
  }
  const Ty = "_sentryChildSpans", sR = "_sentryRootSpan";
  function qQ(t, e) {
    const n = t[sR] || t;
    S1(e, sR, n), t[Ty] ? t[Ty].add(e) : S1(t, Ty, /* @__PURE__ */ new Set([
      e
    ]));
  }
  function D1e(t) {
    const e = /* @__PURE__ */ new Set();
    function n(r) {
      if (!e.has(r) && Ob(r)) {
        e.add(r);
        const i = r[Ty] ? Array.from(r[Ty]) : [];
        for (const a of i) n(a);
      }
    }
    return n(t), Array.from(e);
  }
  function yg(t) {
    return t[sR] || t;
  }
  function C1e() {
    const t = bF(), e = Mb(t);
    return e.getActiveSpan ? e.getActiveSpan() : T1(ul());
  }
  function E1e() {
    Gz || (Pb(() => {
      console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.");
    }), Gz = true);
  }
  function c7(t) {
    var _a6;
    if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return false;
    const e = t || ((_a6 = Ms()) == null ? void 0 : _a6.getOptions());
    return !!e && (e.tracesSampleRate != null || !!e.tracesSampler);
  }
  function Zz(t) {
    mi.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`);
  }
  function k1e(t, e) {
    if (!(e == null ? void 0 : e.length) || !t.description) return false;
    for (const n of e) {
      if (S1e(n)) {
        if (vj(t.description, n)) return ki && Zz(t), true;
        continue;
      }
      if (!n.name && !n.op) continue;
      const r = n.name ? vj(t.description, n.name) : true, i = n.op ? t.op && vj(t.op, n.op) : true;
      if (r && i) return ki && Zz(t), true;
    }
    return false;
  }
  function S1e(t) {
    return typeof t == "string" || t instanceof RegExp;
  }
  const j1e = "production", KQ = "_frozenDsc";
  function yj(t, e) {
    S1(t, KQ, e);
  }
  function GQ(t, e) {
    const n = e.getOptions(), { publicKey: r } = e.getDsn() || {}, i = {
      environment: n.environment || j1e,
      release: n.release,
      public_key: r,
      trace_id: t,
      org_id: v1e(e)
    };
    return e.emit("createDsc", i), i;
  }
  function T1e(t, e) {
    const n = e.getPropagationContext();
    return n.dsc || GQ(n.traceId, t);
  }
  function _2(t) {
    var _a6;
    const e = Ms();
    if (!e) return {};
    const n = yg(t), r = Ul(n), i = r.data, a = n.spanContext().traceState, s = (a == null ? void 0 : a.get("sentry.sample_rate")) ?? i[LQ] ?? i[J0e];
    function l(m) {
      return (typeof s == "number" || typeof s == "string") && (m.sample_rate = `${s}`), m;
    }
    const c = n[KQ];
    if (c) return l(c);
    const d = a == null ? void 0 : a.get("sentry.dsc"), u = d && d1e(d);
    if (u) return l(u);
    const h = GQ(t.spanContext().traceId, e), f = i[bC], g = r.description;
    return f !== "url" && g && (h.transaction = g), c7() && (h.sampled = String(Ob(n)), h.sample_rand = (a == null ? void 0 : a.get("sentry.sample_rand")) ?? ((_a6 = xC(n).scope) == null ? void 0 : _a6.getPropagationContext().sampleRand.toString())), l(h), e.emit("createDsc", h, n), h;
  }
  class WE {
    constructor(e = {}) {
      this._traceId = e.traceId || _C(), this._spanId = e.spanId || HE();
    }
    spanContext() {
      return {
        spanId: this._spanId,
        traceId: this._traceId,
        traceFlags: HQ
      };
    }
    end(e) {
    }
    setAttribute(e, n) {
      return this;
    }
    setAttributes(e) {
      return this;
    }
    setStatus(e) {
      return this;
    }
    updateName(e) {
      return this;
    }
    isRecording() {
      return false;
    }
    addEvent(e, n, r) {
      return this;
    }
    addLink(e) {
      return this;
    }
    addLinks(e) {
      return this;
    }
    recordException(e, n) {
    }
  }
  function d7(t, e = []) {
    return [
      t,
      e
    ];
  }
  function R1e(t) {
    return [
      {
        type: "span"
      },
      t
    ];
  }
  function A1e(t, e) {
    function n(g) {
      return !!g.trace_id && !!g.public_key;
    }
    const r = _2(t[0]), i = e == null ? void 0 : e.getDsn(), a = e == null ? void 0 : e.getOptions().tunnel, s = {
      sent_at: (/* @__PURE__ */ new Date()).toISOString(),
      ...n(r) && {
        trace: r
      },
      ...!!a && i && {
        dsn: $E(i)
      }
    }, { beforeSendSpan: l, ignoreSpans: c } = (e == null ? void 0 : e.getOptions()) || {}, d = (c == null ? void 0 : c.length) ? t.filter((g) => !k1e(Ul(g), c)) : t, u = t.length - d.length;
    u && (e == null ? void 0 : e.recordDroppedEvent("before_send", "span", u));
    const h = l ? (g) => {
      const m = Ul(g), v = l(m);
      return v || (E1e(), m);
    } : Ul, f = [];
    for (const g of d) {
      const m = h(g);
      m && f.push(R1e(m));
    }
    return d7(s, f);
  }
  function I1e(t) {
    if (!ki) return;
    const { description: e = "< unknown name >", op: n = "< unknown op >", parent_span_id: r } = Ul(t), { spanId: i } = t.spanContext(), a = Ob(t), s = yg(t), l = s === t, c = `[Tracing] Starting ${a ? "sampled" : "unsampled"} ${l ? "root " : ""}span`, d = [
      `op: ${n}`,
      `name: ${e}`,
      `ID: ${i}`
    ];
    if (r && d.push(`parent ID: ${r}`), !l) {
      const { op: u, description: h } = Ul(s);
      d.push(`root ID: ${s.spanContext().spanId}`), u && d.push(`root op: ${u}`), h && d.push(`root description: ${h}`);
    }
    mi.log(`${c}
  ${d.join(`
  `)}`);
  }
  function B1e(t) {
    if (!ki) return;
    const { description: e = "< unknown name >", op: n = "< unknown op >" } = Ul(t), { spanId: r } = t.spanContext(), a = yg(t) === t, s = `[Tracing] Finishing "${n}" ${a ? "root " : ""}span "${e}" with ID ${r}`;
    mi.log(s);
  }
  function Jz(t) {
    if (!t || t.length === 0) return;
    const e = {};
    return t.forEach((n) => {
      const r = n.attributes || {}, i = r[X0e], a = r[Q0e];
      typeof i == "string" && typeof a == "number" && (e[n.name] = {
        value: a,
        unit: i
      });
    }), e;
  }
  const Xz = 1e3;
  class u7 {
    constructor(e = {}) {
      this._traceId = e.traceId || _C(), this._spanId = e.spanId || HE(), this._startTime = e.startTimestamp || j1(), this._links = e.links, this._attributes = {}, this.setAttributes({
        [aR]: "manual",
        [oR]: e.op,
        ...e.attributes
      }), this._name = e.name, e.parentSpanId && (this._parentSpanId = e.parentSpanId), "sampled" in e && (this._sampled = e.sampled), e.endTimestamp && (this._endTime = e.endTimestamp), this._events = [], this._isStandaloneSpan = e.isStandalone, this._endTime && this._onSpanEnded();
    }
    addLink(e) {
      return this._links ? this._links.push(e) : this._links = [
        e
      ], this;
    }
    addLinks(e) {
      return this._links ? this._links.push(...e) : this._links = e, this;
    }
    recordException(e, n) {
    }
    spanContext() {
      const { _spanId: e, _traceId: n, _sampled: r } = this;
      return {
        spanId: e,
        traceId: n,
        traceFlags: r ? l7 : HQ
      };
    }
    setAttribute(e, n) {
      return n === void 0 ? delete this._attributes[e] : this._attributes[e] = n, this;
    }
    setAttributes(e) {
      return Object.keys(e).forEach((n) => this.setAttribute(n, e[n])), this;
    }
    updateStartTime(e) {
      this._startTime = r1(e);
    }
    setStatus(e) {
      return this._status = e, this;
    }
    updateName(e) {
      return this._name = e, this.setAttribute(bC, "custom"), this;
    }
    end(e) {
      this._endTime || (this._endTime = r1(e), B1e(this), this._onSpanEnded());
    }
    getSpanJSON() {
      return {
        data: this._attributes,
        description: this._name,
        op: this._attributes[oR],
        parent_span_id: this._parentSpanId,
        span_id: this._spanId,
        start_timestamp: this._startTime,
        status: WQ(this._status),
        timestamp: this._endTime,
        trace_id: this._traceId,
        origin: this._attributes[aR],
        profile_id: this._attributes[e1e],
        exclusive_time: this._attributes[t1e],
        measurements: Jz(this._events),
        is_segment: this._isStandaloneSpan && yg(this) === this || void 0,
        segment_id: this._isStandaloneSpan ? yg(this).spanContext().spanId : void 0,
        links: $Q(this._links)
      };
    }
    isRecording() {
      return !this._endTime && !!this._sampled;
    }
    addEvent(e, n, r) {
      ki && mi.log("[Tracing] Adding an event to span:", e);
      const i = Qz(n) ? n : r || j1(), a = Qz(n) ? {} : n || {}, s = {
        name: e,
        time: r1(i),
        attributes: a
      };
      return this._events.push(s), this;
    }
    isStandaloneSpan() {
      return !!this._isStandaloneSpan;
    }
    _onSpanEnded() {
      const e = Ms();
      if (e && e.emit("spanEnd", this), !(this._isStandaloneSpan || this === yg(this))) return;
      if (this._isStandaloneSpan) {
        this._sampled ? M1e(A1e([
          this
        ], e)) : (ki && mi.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."), e && e.recordDroppedEvent("sample_rate", "span"));
        return;
      }
      const r = this._convertSpanToTransaction();
      r && (xC(this).scope || ul()).captureEvent(r);
    }
    _convertSpanToTransaction() {
      var _a6;
      if (!eU(Ul(this))) return;
      this._name || (ki && mi.warn("Transaction has no name, falling back to `<unlabeled transaction>`."), this._name = "<unlabeled transaction>");
      const { scope: e, isolationScope: n } = xC(this), r = (_a6 = e == null ? void 0 : e.getScopeData().sdkProcessingMetadata) == null ? void 0 : _a6.normalizedRequest;
      if (this._sampled !== true) return;
      const a = D1e(this).filter((u) => u !== this && !P1e(u)).map((u) => Ul(u)).filter(eU), s = this._attributes[bC];
      delete this._attributes[qz], a.forEach((u) => {
        delete u.data[qz];
      });
      const l = {
        contexts: {
          trace: y1e(this)
        },
        spans: a.length > Xz ? a.sort((u, h) => u.start_timestamp - h.start_timestamp).slice(0, Xz) : a,
        start_timestamp: this._startTime,
        timestamp: this._endTime,
        transaction: this._name,
        type: "transaction",
        sdkProcessingMetadata: {
          capturedSpanScope: e,
          capturedSpanIsolationScope: n,
          dynamicSamplingContext: _2(this)
        },
        request: r,
        ...s && {
          transaction_info: {
            source: s
          }
        }
      }, c = Jz(this._events);
      return c && Object.keys(c).length && (ki && mi.log("[Measurements] Adding measurements to transaction event", JSON.stringify(c, void 0, 2)), l.measurements = c), l;
    }
  }
  function Qz(t) {
    return t && typeof t == "number" || t instanceof Date || Array.isArray(t);
  }
  function eU(t) {
    return !!t.start_timestamp && !!t.timestamp && !!t.span_id && !!t.trace_id;
  }
  function P1e(t) {
    return t instanceof u7 && t.isStandaloneSpan();
  }
  function M1e(t) {
    const e = Ms();
    if (!e) return;
    const n = t[1];
    if (!n || n.length === 0) {
      e.recordDroppedEvent("before_send", "span");
      return;
    }
    e.sendEnvelope(t);
  }
  function O1e(t, e, n = () => {
  }, r = () => {
  }) {
    let i;
    try {
      i = t();
    } catch (a) {
      throw e(a), n(), a;
    }
    return L1e(i, e, n, r);
  }
  function L1e(t, e, n, r) {
    return MQ(t) ? t.then((i) => (n(), r(i), i), (i) => {
      throw e(i), n(), i;
    }) : (n(), r(t), t);
  }
  function N1e(t, e, n) {
    if (!c7(t)) return [
      false
    ];
    let r, i;
    typeof t.tracesSampler == "function" ? (i = t.tracesSampler({
      ...e,
      inheritOrSampleWith: (l) => typeof e.parentSampleRate == "number" ? e.parentSampleRate : typeof e.parentSampled == "boolean" ? Number(e.parentSampled) : l
    }), r = true) : e.parentSampled !== void 0 ? i = e.parentSampled : typeof t.tracesSampleRate < "u" && (i = t.tracesSampleRate, r = true);
    const a = VQ(i);
    if (a === void 0) return ki && mi.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`), [
      false
    ];
    if (!a) return ki && mi.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler == "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`), [
      false,
      a,
      r
    ];
    const s = n < a;
    return s || ki && mi.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`), [
      s,
      a,
      r
    ];
  }
  const YQ = "__SENTRY_SUPPRESS_TRACING__";
  function Mg(t, e) {
    const n = h7();
    if (n.startSpan) return n.startSpan(t, e);
    const r = XQ(t), { forceTransaction: i, parentSpan: a, scope: s } = t, l = s == null ? void 0 : s.clone();
    return wF(l, () => V1e(a)(() => {
      const d = ul(), u = QQ(d, a), f = t.onlyIfParent && !u ? new WE() : JQ({
        parentSpan: u,
        spanArguments: r,
        forceTransaction: i,
        scope: d
      });
      return yC(d, f), O1e(() => e(f), () => {
        const { status: g } = Ul(f);
        f.isRecording() && (!g || g === "ok") && f.setStatus({
          code: i1e,
          message: "internal_error"
        });
      }, () => {
        f.end();
      });
    }));
  }
  function z1e(t) {
    const e = h7();
    if (e.startInactiveSpan) return e.startInactiveSpan(t);
    const n = XQ(t), { forceTransaction: r, parentSpan: i } = t;
    return (t.scope ? (s) => wF(t.scope, s) : i !== void 0 ? (s) => ZQ(i, s) : (s) => s())(() => {
      const s = ul(), l = QQ(s, i);
      return t.onlyIfParent && !l ? new WE() : JQ({
        parentSpan: l,
        spanArguments: n,
        forceTransaction: r,
        scope: s
      });
    });
  }
  function ZQ(t, e) {
    const n = h7();
    return n.withActiveSpan ? n.withActiveSpan(t, e) : wF((r) => (yC(r, t || void 0), e(r)));
  }
  function JQ({ parentSpan: t, spanArguments: e, forceTransaction: n, scope: r }) {
    if (!c7()) {
      const s = new WE();
      if (n || !t) {
        const l = {
          sampled: "false",
          sample_rate: "0",
          transaction: e.name,
          ..._2(s)
        };
        yj(s, l);
      }
      return s;
    }
    const i = Wf();
    let a;
    if (t && !n) a = U1e(t, r, e), qQ(t, a);
    else if (t) {
      const s = _2(t), { traceId: l, spanId: c } = t.spanContext(), d = Ob(t);
      a = tU({
        traceId: l,
        parentSpanId: c,
        ...e
      }, r, d), yj(a, s);
    } else {
      const { traceId: s, dsc: l, parentSpanId: c, sampled: d } = {
        ...i.getPropagationContext(),
        ...r.getPropagationContext()
      };
      a = tU({
        traceId: s,
        parentSpanId: c,
        ...e
      }, r, d), l && yj(a, l);
    }
    return I1e(a), s1e(a, r, i), a;
  }
  function XQ(t) {
    const n = {
      isStandalone: (t.experimental || {}).standalone,
      ...t
    };
    if (t.startTime) {
      const r = {
        ...n
      };
      return r.startTimestamp = r1(t.startTime), delete r.startTime, r;
    }
    return n;
  }
  function h7() {
    const t = bF();
    return Mb(t);
  }
  function tU(t, e, n) {
    var _a6;
    const r = Ms(), i = (r == null ? void 0 : r.getOptions()) || {}, { name: a = "" } = t, s = {
      spanAttributes: {
        ...t.attributes
      },
      spanName: a,
      parentSampled: n
    };
    r == null ? void 0 : r.emit("beforeSampling", s, {
      decision: false
    });
    const l = s.parentSampled ?? n, c = s.spanAttributes, d = e.getPropagationContext(), [u, h, f] = e.getScopeData().sdkProcessingMetadata[YQ] ? [
      false
    ] : N1e(i, {
      name: a,
      parentSampled: l,
      attributes: c,
      parentSampleRate: VQ((_a6 = d.dsc) == null ? void 0 : _a6.sample_rate)
    }, d.sampleRand), g = new u7({
      ...t,
      attributes: {
        [bC]: "custom",
        [LQ]: h !== void 0 && f ? h : void 0,
        ...c
      },
      sampled: u
    });
    return !u && r && (ki && mi.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."), r.recordDroppedEvent("sample_rate", "transaction")), r && r.emit("spanStart", g), g;
  }
  function U1e(t, e, n) {
    const { spanId: r, traceId: i } = t.spanContext(), a = e.getScopeData().sdkProcessingMetadata[YQ] ? false : Ob(t), s = a ? new u7({
      ...n,
      parentSpanId: r,
      traceId: i,
      sampled: a
    }) : new WE({
      traceId: i
    });
    qQ(t, s);
    const l = Ms();
    return l && (l.emit("spanStart", s), n.endTimestamp && l.emit("spanEnd", s)), s;
  }
  function QQ(t, e) {
    if (e) return e;
    if (e === null) return;
    const n = T1(t);
    if (!n) return;
    const r = Ms();
    return (r ? r.getOptions() : {}).parentSpanIsAlwaysRootSpan ? yg(n) : n;
  }
  function V1e(t) {
    return t !== void 0 ? (e) => ZQ(t, e) : (e) => e();
  }
  function nU(t, e) {
    const { extra: n, tags: r, attributes: i, user: a, contexts: s, level: l, sdkProcessingMetadata: c, breadcrumbs: d, fingerprint: u, eventProcessors: h, attachments: f, propagationContext: g, transactionName: m, span: v } = e;
    Yv(t, "extra", n), Yv(t, "tags", r), Yv(t, "attributes", i), Yv(t, "user", a), Yv(t, "contexts", s), t.sdkProcessingMetadata = VE(t.sdkProcessingMetadata, c, 2), l && (t.level = l), m && (t.transactionName = m), v && (t.span = v), d.length && (t.breadcrumbs = [
      ...t.breadcrumbs,
      ...d
    ]), u.length && (t.fingerprint = [
      ...t.fingerprint,
      ...u
    ]), h.length && (t.eventProcessors = [
      ...t.eventProcessors,
      ...h
    ]), f.length && (t.attachments = [
      ...t.attachments,
      ...f
    ]), t.propagationContext = {
      ...t.propagationContext,
      ...g
    };
  }
  function Yv(t, e, n) {
    t[e] = VE(t[e], n, 1);
  }
  function eee(t, e) {
    const n = Y0e().getScopeData();
    return t && nU(n, t.getScopeData()), e && nU(n, e.getScopeData()), n;
  }
  function H1e(t) {
    if (t) return $1e(t) ? {
      captureContext: t
    } : q1e(t) ? {
      captureContext: t
    } : t;
  }
  function $1e(t) {
    return t instanceof Yu || typeof t == "function";
  }
  const W1e = [
    "user",
    "level",
    "extra",
    "contexts",
    "tags",
    "fingerprint",
    "propagationContext"
  ];
  function q1e(t) {
    return Object.keys(t).some((e) => W1e.includes(e));
  }
  function y2(t, e) {
    return ul().captureException(t, H1e(e));
  }
  function wC(t, e) {
    const n = typeof e == "string" ? e : void 0, r = typeof e != "string" ? {
      captureContext: e
    } : void 0;
    return ul().captureMessage(t, n, r);
  }
  function A1(t, e) {
    Wf().setContext(t, e);
  }
  function Eo(t, e) {
    Wf().setTag(t, e);
  }
  function rU(t) {
    Wf().setUser(t);
  }
  function K1e() {
    return Wf().lastEventId();
  }
  function tee() {
    return !!Ms();
  }
  function G1e(t) {
    const e = t.protocol ? `${t.protocol}:` : "", n = t.port ? `:${t.port}` : "";
    return `${e}//${t.host}${n}${t.path ? `/${t.path}` : ""}/api/`;
  }
  function Y1e(t, e) {
    const n = _1e(t);
    if (!n) return "";
    const r = `${G1e(n)}embed/error-page/`;
    let i = `dsn=${$E(n)}`;
    for (const a in e) if (a !== "dsn" && a !== "onClose") if (a === "user") {
      const s = e.user;
      if (!s) continue;
      s.name && (i += `&name=${encodeURIComponent(s.name)}`), s.email && (i += `&email=${encodeURIComponent(s.email)}`);
    } else i += `&${encodeURIComponent(a)}=${encodeURIComponent(e[a])}`;
    return `${r}?${i}`;
  }
  function Z1e(t) {
    return typeof t == "object" && t != null && !Array.isArray(t) && Object.keys(t).includes("value");
  }
  function J1e(t, e) {
    const { value: n, unit: r } = Z1e(t) ? t : {
      value: t,
      unit: void 0
    }, i = X1e(n), a = r && typeof r == "string" ? {
      unit: r
    } : {};
    if (i) return {
      ...i,
      ...a
    };
    if (!e || e === "skip-undefined" && n === void 0) return;
    let s = "";
    try {
      s = JSON.stringify(n) ?? "";
    } catch {
    }
    return {
      value: s,
      type: "string",
      ...a
    };
  }
  function DC(t, e = false) {
    const n = {};
    for (const [r, i] of Object.entries(t ?? {})) {
      const a = J1e(i, e);
      a && (n[r] = a);
    }
    return n;
  }
  function X1e(t) {
    const e = typeof t == "string" ? "string" : typeof t == "boolean" ? "boolean" : typeof t == "number" && !Number.isNaN(t) ? Number.isInteger(t) ? "integer" : "double" : null;
    if (e) return {
      value: t,
      type: e
    };
  }
  function nee(t, e) {
    return e ? wF(e, () => {
      const n = C1e(), r = n ? b1e(n) : Z0e(e);
      return [
        n ? _2(n) : T1e(t, e),
        r
      ];
    }) : [
      void 0,
      void 0
    ];
  }
  const Q1e = {
    trace: 1,
    debug: 5,
    info: 9,
    warn: 13,
    error: 17,
    fatal: 21
  };
  function eFe(t) {
    return [
      {
        type: "log",
        item_count: t.length,
        content_type: "application/vnd.sentry.items.log+json"
      },
      {
        items: t
      }
    ];
  }
  function tFe(t, e, n, r) {
    const i = {};
    return (e == null ? void 0 : e.sdk) && (i.sdk = {
      name: e.sdk.name,
      version: e.sdk.version
    }), n && r && (i.dsn = $E(r)), d7(i, [
      eFe(t)
    ]);
  }
  const nFe = 100;
  function cd(t, e, n, r = true) {
    n && (!t[e] || r) && (t[e] = n);
  }
  function rFe(t, e) {
    const n = f7(), r = ree(t);
    r === void 0 ? n.set(t, [
      e
    ]) : r.length >= nFe ? (oFe(t, r), n.set(t, [
      e
    ])) : n.set(t, [
      ...r,
      e
    ]);
  }
  function iFe(t, e = ul(), n = rFe) {
    var _a6;
    const r = (e == null ? void 0 : e.getClient()) ?? Ms();
    if (!r) {
      ki && mi.warn("No client available to capture log.");
      return;
    }
    const { release: i, environment: a, enableLogs: s = false, beforeSendLog: l } = r.getOptions();
    if (!s) {
      ki && mi.warn("logging option not enabled, log will not be captured.");
      return;
    }
    const [, c] = nee(r, e), d = {
      ...t.attributes
    }, { user: { id: u, email: h, username: f }, attributes: g = {} } = eee(Wf(), e);
    cd(d, "user.id", u, false), cd(d, "user.email", h, false), cd(d, "user.name", f, false), cd(d, "sentry.release", i), cd(d, "sentry.environment", a);
    const { name: m, version: v } = ((_a6 = r.getSdkMetadata()) == null ? void 0 : _a6.sdk) ?? {};
    cd(d, "sentry.sdk.name", m), cd(d, "sentry.sdk.version", v);
    const y = r.getIntegrationByName("Replay"), w = y == null ? void 0 : y.getReplayId(true);
    cd(d, "sentry.replay_id", w), w && (y == null ? void 0 : y.getRecordingMode()) === "buffer" && cd(d, "sentry._internal.replay_is_buffering", true);
    const b = t.message;
    if (A0e(b)) {
      const { __sentry_template_string__: U, __sentry_template_values__: z = [] } = b;
      (z == null ? void 0 : z.length) && (d["sentry.message.template"] = U), z.forEach((O, M) => {
        d[`sentry.message.parameter.${M}`] = O;
      });
    }
    const j = T1(e);
    cd(d, "sentry.trace.parent_span_id", j == null ? void 0 : j.spanContext().spanId);
    const k = {
      ...t,
      attributes: d
    };
    r.emit("beforeCaptureLog", k);
    const C = l ? Pb(() => l(k)) : k;
    if (!C) {
      r.recordDroppedEvent("before_send", "log_item", 1), ki && mi.warn("beforeSendLog returned null, log will not be captured.");
      return;
    }
    const { level: x, message: S, attributes: T = {}, severityNumber: A } = C, B = {
      timestamp: j1(),
      level: x,
      body: S,
      trace_id: c == null ? void 0 : c.trace_id,
      severity_number: A ?? Q1e[x],
      attributes: {
        ...DC(g),
        ...DC(T, true)
      }
    };
    n(r, B), r.emit("afterCaptureLog", C);
  }
  function oFe(t, e) {
    const n = e ?? ree(t) ?? [];
    if (n.length === 0) return;
    const r = t.getOptions(), i = tFe(n, r._metadata, r.tunnel, t.getDsn());
    f7().set(t, []), t.emit("flushLogs"), t.sendEnvelope(i);
  }
  function ree(t) {
    return f7().get(t);
  }
  function f7() {
    return xF("clientToLogBufferMap", () => /* @__PURE__ */ new WeakMap());
  }
  function aFe(t) {
    return [
      {
        type: "trace_metric",
        item_count: t.length,
        content_type: "application/vnd.sentry.items.trace-metric+json"
      },
      {
        items: t
      }
    ];
  }
  function sFe(t, e, n, r) {
    const i = {};
    return (e == null ? void 0 : e.sdk) && (i.sdk = {
      name: e.sdk.name,
      version: e.sdk.version
    }), n && r && (i.dsn = $E(r)), d7(i, [
      aFe(t)
    ]);
  }
  const lFe = 1e3;
  function uu(t, e, n, r = true) {
    n && (r || !(e in t)) && (t[e] = n);
  }
  function cFe(t, e) {
    const n = m7(), r = iee(t);
    r === void 0 ? n.set(t, [
      e
    ]) : r.length >= lFe ? (fFe(t, r), n.set(t, [
      e
    ])) : n.set(t, [
      ...r,
      e
    ]);
  }
  function dFe(t, e, n) {
    var _a6;
    const { release: r, environment: i } = e.getOptions(), a = {
      ...t.attributes
    };
    uu(a, "user.id", n.id, false), uu(a, "user.email", n.email, false), uu(a, "user.name", n.username, false), uu(a, "sentry.release", r), uu(a, "sentry.environment", i);
    const { name: s, version: l } = ((_a6 = e.getSdkMetadata()) == null ? void 0 : _a6.sdk) ?? {};
    uu(a, "sentry.sdk.name", s), uu(a, "sentry.sdk.version", l);
    const c = e.getIntegrationByName("Replay"), d = c == null ? void 0 : c.getReplayId(true);
    return uu(a, "sentry.replay_id", d), d && (c == null ? void 0 : c.getRecordingMode()) === "buffer" && uu(a, "sentry._internal.replay_is_buffering", true), {
      ...t,
      attributes: a
    };
  }
  function uFe(t, e, n, r) {
    const [, i] = nee(e, n), a = T1(n), s = a ? a.spanContext().traceId : i == null ? void 0 : i.trace_id, l = a ? a.spanContext().spanId : void 0;
    return {
      timestamp: j1(),
      trace_id: s ?? "",
      span_id: l,
      name: t.name,
      type: t.type,
      unit: t.unit,
      value: t.value,
      attributes: {
        ...DC(r),
        ...DC(t.attributes, "skip-undefined")
      }
    };
  }
  function hFe(t, e) {
    const n = (e == null ? void 0 : e.scope) ?? ul(), r = (e == null ? void 0 : e.captureSerializedMetric) ?? cFe, i = (n == null ? void 0 : n.getClient()) ?? Ms();
    if (!i) {
      ki && mi.warn("No client available to capture metric.");
      return;
    }
    const { _experiments: a, enableMetrics: s, beforeSendMetric: l } = i.getOptions();
    if (!(s ?? (a == null ? void 0 : a.enableMetrics) ?? true)) {
      ki && mi.warn("metrics option not enabled, metric will not be captured.");
      return;
    }
    const { user: d, attributes: u } = eee(Wf(), n), h = dFe(t, i, d);
    i.emit("processMetric", h);
    const f = l || (a == null ? void 0 : a.beforeSendMetric), g = f ? f(h) : h;
    if (!g) {
      ki && mi.log("`beforeSendMetric` returned `null`, will not send metric.");
      return;
    }
    const m = uFe(g, i, n, u);
    ki && mi.log("[Metric]", m), r(i, m), i.emit("afterCaptureMetric", g);
  }
  function fFe(t, e) {
    const n = e ?? iee(t) ?? [];
    if (n.length === 0) return;
    const r = t.getOptions(), i = sFe(n, r._metadata, r.tunnel, t.getDsn());
    m7().set(t, []), t.emit("flushMetrics"), t.sendEnvelope(i);
  }
  function iee(t) {
    return m7().get(t);
  }
  function m7() {
    return xF("clientToMetricBufferMap", () => /* @__PURE__ */ new WeakMap());
  }
  const mFe = 100;
  function wa(t, e) {
    const n = Ms(), r = Wf();
    if (!n) return;
    const { beforeBreadcrumb: i = null, maxBreadcrumbs: a = mFe } = n.getOptions();
    if (a <= 0) return;
    const l = {
      timestamp: s7(),
      ...t
    }, c = i ? Pb(() => i(l, e)) : l;
    c !== null && (n.emit && n.emit("beforeAddBreadcrumb", c, e), r.addBreadcrumb(c, a));
  }
  function gFe(t, e = {}, n = ul()) {
    const { message: r, name: i, email: a, url: s, source: l, associatedEventId: c, tags: d } = t, u = {
      contexts: {
        feedback: {
          contact_email: a,
          name: i,
          message: r,
          url: s,
          source: l,
          associated_event_id: c
        }
      },
      type: "feedback",
      level: "info",
      tags: d
    }, h = (n == null ? void 0 : n.getClient()) || Ms();
    return h && h.emit("beforeSendFeedback", u, e), n.captureEvent(u, e);
  }
  function qE(t, e, n, r, i) {
    iFe({
      level: t,
      message: e,
      attributes: n,
      severityNumber: i
    }, r);
  }
  function pFe(t, e, { scope: n } = {}) {
    qE("debug", t, e, n);
  }
  function FFe(t, e, { scope: n } = {}) {
    qE("info", t, e, n);
  }
  function vFe(t, e, { scope: n } = {}) {
    qE("warn", t, e, n);
  }
  function _Fe(t, e, { scope: n } = {}) {
    qE("error", t, e, n);
  }
  function g7(t, e, n, r) {
    hFe({
      type: t,
      name: e,
      value: n,
      unit: r == null ? void 0 : r.unit,
      attributes: r == null ? void 0 : r.attributes
    }, {
      scope: r == null ? void 0 : r.scope
    });
  }
  function Vr(t, e = 1, n) {
    g7("counter", t, e, n);
  }
  function bg(t, e, n) {
    g7("gauge", t, e, n);
  }
  function oa(t, e, n) {
    g7("distribution", t, e, n);
  }
  const Ox = Nc, iU = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
  function lR(t = {}) {
    var _a6;
    const e = Ox.document, n = (e == null ? void 0 : e.head) || (e == null ? void 0 : e.body);
    if (!n) {
      iU && mi.error("[showReportDialog] Global document not defined");
      return;
    }
    const r = ul(), a = (_a6 = Ms()) == null ? void 0 : _a6.getDsn();
    if (!a) {
      iU && mi.error("[showReportDialog] DSN not configured");
      return;
    }
    const s = {
      ...t,
      user: {
        ...r.getUser(),
        ...t.user
      },
      eventId: t.eventId || K1e()
    }, l = Ox.document.createElement("script");
    l.async = true, l.crossOrigin = "anonymous", l.src = Y1e(a, s);
    const { onLoad: c, onClose: d } = s;
    if (c && (l.onload = c), d) {
      const u = (h) => {
        if (h.data === "__sentry_reportdialog_closed__") try {
          d();
        } finally {
          Ox.removeEventListener("message", u);
        }
      };
      Ox.addEventListener("message", u);
    }
    n.appendChild(l);
  }
  var p = dh();
  const yn = da(p), yFe = n7({
    __proto__: null,
    default: yn
  }, [
    p
  ]);
  function bFe(t) {
    const e = t.match(/^([^.]+)/);
    return e !== null && parseInt(e[0]) >= 17;
  }
  function xFe(t, e) {
    const n = /* @__PURE__ */ new WeakSet();
    function r(i, a) {
      if (!n.has(i)) {
        if (i.cause) return n.add(i), r(i.cause, a);
        i.cause = a;
      }
    }
    r(t, e);
  }
  function wFe(t, { componentStack: e }, n) {
    if (bFe(p.version) && R0e(t) && e) {
      const r = new Error(t.message);
      r.name = `React ErrorBoundary ${t.name}`, r.stack = e, xFe(t, r);
    }
    return wF((r) => (r.setContext("react", {
      componentStack: e
    }), y2(t, n)));
  }
  const DFe = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, bj = {
    componentStack: null,
    error: null,
    eventId: null
  };
  class cR extends p.Component {
    constructor(e) {
      super(e), this.state = bj, this._openFallbackReportDialog = true;
      const n = Ms();
      n && e.showDialog && (this._openFallbackReportDialog = false, this._cleanupHook = n.on("afterSendEvent", (r) => {
        !r.type && this._lastEventId && r.event_id === this._lastEventId && lR({
          ...e.dialogOptions,
          eventId: this._lastEventId
        });
      }));
    }
    componentDidCatch(e, n) {
      const { componentStack: r } = n, { beforeCapture: i, onError: a, showDialog: s, dialogOptions: l } = this.props;
      wF((c) => {
        i && i(c, e, r);
        const d = this.props.handled != null ? this.props.handled : !!this.props.fallback, u = wFe(e, n, {
          mechanism: {
            handled: d,
            type: "auto.function.react.error_boundary"
          }
        });
        a && a(e, r, u), s && (this._lastEventId = u, this._openFallbackReportDialog && lR({
          ...l,
          eventId: u
        })), this.setState({
          error: e,
          componentStack: r,
          eventId: u
        });
      });
    }
    componentDidMount() {
      const { onMount: e } = this.props;
      e && e();
    }
    componentWillUnmount() {
      const { error: e, componentStack: n, eventId: r } = this.state, { onUnmount: i } = this.props;
      i && (this.state === bj ? i(null, null, null) : i(e, n, r)), this._cleanupHook && (this._cleanupHook(), this._cleanupHook = void 0);
    }
    resetErrorBoundary() {
      const { onReset: e } = this.props, { error: n, componentStack: r, eventId: i } = this.state;
      e && e(n, r, i), this.setState(bj);
    }
    render() {
      const { fallback: e, children: n } = this.props, r = this.state;
      if (r.componentStack === null) return typeof n == "function" ? n() : n;
      const i = typeof e == "function" ? p.createElement(e, {
        error: r.error,
        componentStack: r.componentStack,
        resetError: () => this.resetErrorBoundary(),
        eventId: r.eventId
      }) : e;
      return p.isValidElement(i) ? i : (e && DFe && mi.warn("fallback did not produce a valid ReactElement"), null);
    }
  }
  var xj = {
    exports: {}
  }, xs = {}, wj = {
    exports: {}
  }, Dj = {};
  var oU;
  function CFe() {
    return oU || (oU = 1, (function(t) {
      function e(H, V) {
        var Z = H.length;
        H.push(V);
        e: for (; 0 < Z; ) {
          var Y = Z - 1 >>> 1, oe = H[Y];
          if (0 < i(oe, V)) H[Y] = V, H[Z] = oe, Z = Y;
          else break e;
        }
      }
      function n(H) {
        return H.length === 0 ? null : H[0];
      }
      function r(H) {
        if (H.length === 0) return null;
        var V = H[0], Z = H.pop();
        if (Z !== V) {
          H[0] = Z;
          e: for (var Y = 0, oe = H.length, ue = oe >>> 1; Y < ue; ) {
            var ie = 2 * (Y + 1) - 1, de = H[ie], ne = ie + 1, ae = H[ne];
            if (0 > i(de, Z)) ne < oe && 0 > i(ae, de) ? (H[Y] = ae, H[ne] = Z, Y = ne) : (H[Y] = de, H[ie] = Z, Y = ie);
            else if (ne < oe && 0 > i(ae, Z)) H[Y] = ae, H[ne] = Z, Y = ne;
            else break e;
          }
        }
        return V;
      }
      function i(H, V) {
        var Z = H.sortIndex - V.sortIndex;
        return Z !== 0 ? Z : H.id - V.id;
      }
      if (typeof performance == "object" && typeof performance.now == "function") {
        var a = performance;
        t.unstable_now = function() {
          return a.now();
        };
      } else {
        var s = Date, l = s.now();
        t.unstable_now = function() {
          return s.now() - l;
        };
      }
      var c = [], d = [], u = 1, h = null, f = 3, g = false, m = false, v = false, y = typeof setTimeout == "function" ? setTimeout : null, w = typeof clearTimeout == "function" ? clearTimeout : null, b = typeof setImmediate < "u" ? setImmediate : null;
      typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
      function j(H) {
        for (var V = n(d); V !== null; ) {
          if (V.callback === null) r(d);
          else if (V.startTime <= H) r(d), V.sortIndex = V.expirationTime, e(c, V);
          else break;
          V = n(d);
        }
      }
      function k(H) {
        if (v = false, j(H), !m) if (n(c) !== null) m = true, N(C);
        else {
          var V = n(d);
          V !== null && L(k, V.startTime - H);
        }
      }
      function C(H, V) {
        m = false, v && (v = false, w(T), T = -1), g = true;
        var Z = f;
        try {
          for (j(V), h = n(c); h !== null && (!(h.expirationTime > V) || H && !U()); ) {
            var Y = h.callback;
            if (typeof Y == "function") {
              h.callback = null, f = h.priorityLevel;
              var oe = Y(h.expirationTime <= V);
              V = t.unstable_now(), typeof oe == "function" ? h.callback = oe : h === n(c) && r(c), j(V);
            } else r(c);
            h = n(c);
          }
          if (h !== null) var ue = true;
          else {
            var ie = n(d);
            ie !== null && L(k, ie.startTime - V), ue = false;
          }
          return ue;
        } finally {
          h = null, f = Z, g = false;
        }
      }
      var x = false, S = null, T = -1, A = 5, B = -1;
      function U() {
        return !(t.unstable_now() - B < A);
      }
      function z() {
        if (S !== null) {
          var H = t.unstable_now();
          B = H;
          var V = true;
          try {
            V = S(true, H);
          } finally {
            V ? O() : (x = false, S = null);
          }
        } else x = false;
      }
      var O;
      if (typeof b == "function") O = function() {
        b(z);
      };
      else if (typeof MessageChannel < "u") {
        var M = new MessageChannel(), I = M.port2;
        M.port1.onmessage = z, O = function() {
          I.postMessage(null);
        };
      } else O = function() {
        y(z, 0);
      };
      function N(H) {
        S = H, x || (x = true, O());
      }
      function L(H, V) {
        T = y(function() {
          H(t.unstable_now());
        }, V);
      }
      t.unstable_IdlePriority = 5, t.unstable_ImmediatePriority = 1, t.unstable_LowPriority = 4, t.unstable_NormalPriority = 3, t.unstable_Profiling = null, t.unstable_UserBlockingPriority = 2, t.unstable_cancelCallback = function(H) {
        H.callback = null;
      }, t.unstable_continueExecution = function() {
        m || g || (m = true, N(C));
      }, t.unstable_forceFrameRate = function(H) {
        0 > H || 125 < H ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : A = 0 < H ? Math.floor(1e3 / H) : 5;
      }, t.unstable_getCurrentPriorityLevel = function() {
        return f;
      }, t.unstable_getFirstCallbackNode = function() {
        return n(c);
      }, t.unstable_next = function(H) {
        switch (f) {
          case 1:
          case 2:
          case 3:
            var V = 3;
            break;
          default:
            V = f;
        }
        var Z = f;
        f = V;
        try {
          return H();
        } finally {
          f = Z;
        }
      }, t.unstable_pauseExecution = function() {
      }, t.unstable_requestPaint = function() {
      }, t.unstable_runWithPriority = function(H, V) {
        switch (H) {
          case 1:
          case 2:
          case 3:
          case 4:
          case 5:
            break;
          default:
            H = 3;
        }
        var Z = f;
        f = H;
        try {
          return V();
        } finally {
          f = Z;
        }
      }, t.unstable_scheduleCallback = function(H, V, Z) {
        var Y = t.unstable_now();
        switch (typeof Z == "object" && Z !== null ? (Z = Z.delay, Z = typeof Z == "number" && 0 < Z ? Y + Z : Y) : Z = Y, H) {
          case 1:
            var oe = -1;
            break;
          case 2:
            oe = 250;
            break;
          case 5:
            oe = 1073741823;
            break;
          case 4:
            oe = 1e4;
            break;
          default:
            oe = 5e3;
        }
        return oe = Z + oe, H = {
          id: u++,
          callback: V,
          priorityLevel: H,
          startTime: Z,
          expirationTime: oe,
          sortIndex: -1
        }, Z > Y ? (H.sortIndex = Z, e(d, H), n(c) === null && H === n(d) && (v ? (w(T), T = -1) : v = true, L(k, Z - Y))) : (H.sortIndex = oe, e(c, H), m || g || (m = true, N(C))), H;
      }, t.unstable_shouldYield = U, t.unstable_wrapCallback = function(H) {
        var V = f;
        return function() {
          var Z = f;
          f = V;
          try {
            return H.apply(this, arguments);
          } finally {
            f = Z;
          }
        };
      };
    })(Dj)), Dj;
  }
  var aU;
  function EFe() {
    return aU || (aU = 1, wj.exports = CFe()), wj.exports;
  }
  var sU;
  function kFe() {
    if (sU) return xs;
    sU = 1;
    var t = dh(), e = EFe();
    function n(F) {
      for (var _ = "https://reactjs.org/docs/error-decoder.html?invariant=" + F, R = 1; R < arguments.length; R++) _ += "&args[]=" + encodeURIComponent(arguments[R]);
      return "Minified React error #" + F + "; visit " + _ + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
    }
    var r = /* @__PURE__ */ new Set(), i = {};
    function a(F, _) {
      s(F, _), s(F + "Capture", _);
    }
    function s(F, _) {
      for (i[F] = _, F = 0; F < _.length; F++) r.add(_[F]);
    }
    var l = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), c = Object.prototype.hasOwnProperty, d = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, u = {}, h = {};
    function f(F) {
      return c.call(h, F) ? true : c.call(u, F) ? false : d.test(F) ? h[F] = true : (u[F] = true, false);
    }
    function g(F, _, R, P) {
      if (R !== null && R.type === 0) return false;
      switch (typeof _) {
        case "function":
        case "symbol":
          return true;
        case "boolean":
          return P ? false : R !== null ? !R.acceptsBooleans : (F = F.toLowerCase().slice(0, 5), F !== "data-" && F !== "aria-");
        default:
          return false;
      }
    }
    function m(F, _, R, P) {
      if (_ === null || typeof _ > "u" || g(F, _, R, P)) return true;
      if (P) return false;
      if (R !== null) switch (R.type) {
        case 3:
          return !_;
        case 4:
          return _ === false;
        case 5:
          return isNaN(_);
        case 6:
          return isNaN(_) || 1 > _;
      }
      return false;
    }
    function v(F, _, R, P, W, J, pe) {
      this.acceptsBooleans = _ === 2 || _ === 3 || _ === 4, this.attributeName = P, this.attributeNamespace = W, this.mustUseProperty = R, this.propertyName = F, this.type = _, this.sanitizeURL = J, this.removeEmptyString = pe;
    }
    var y = {};
    "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(F) {
      y[F] = new v(F, 0, false, F, null, false, false);
    }), [
      [
        "acceptCharset",
        "accept-charset"
      ],
      [
        "className",
        "class"
      ],
      [
        "htmlFor",
        "for"
      ],
      [
        "httpEquiv",
        "http-equiv"
      ]
    ].forEach(function(F) {
      var _ = F[0];
      y[_] = new v(_, 1, false, F[1], null, false, false);
    }), [
      "contentEditable",
      "draggable",
      "spellCheck",
      "value"
    ].forEach(function(F) {
      y[F] = new v(F, 2, false, F.toLowerCase(), null, false, false);
    }), [
      "autoReverse",
      "externalResourcesRequired",
      "focusable",
      "preserveAlpha"
    ].forEach(function(F) {
      y[F] = new v(F, 2, false, F, null, false, false);
    }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(F) {
      y[F] = new v(F, 3, false, F.toLowerCase(), null, false, false);
    }), [
      "checked",
      "multiple",
      "muted",
      "selected"
    ].forEach(function(F) {
      y[F] = new v(F, 3, true, F, null, false, false);
    }), [
      "capture",
      "download"
    ].forEach(function(F) {
      y[F] = new v(F, 4, false, F, null, false, false);
    }), [
      "cols",
      "rows",
      "size",
      "span"
    ].forEach(function(F) {
      y[F] = new v(F, 6, false, F, null, false, false);
    }), [
      "rowSpan",
      "start"
    ].forEach(function(F) {
      y[F] = new v(F, 5, false, F.toLowerCase(), null, false, false);
    });
    var w = /[\-:]([a-z])/g;
    function b(F) {
      return F[1].toUpperCase();
    }
    "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(F) {
      var _ = F.replace(w, b);
      y[_] = new v(_, 1, false, F, null, false, false);
    }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(F) {
      var _ = F.replace(w, b);
      y[_] = new v(_, 1, false, F, "http://www.w3.org/1999/xlink", false, false);
    }), [
      "xml:base",
      "xml:lang",
      "xml:space"
    ].forEach(function(F) {
      var _ = F.replace(w, b);
      y[_] = new v(_, 1, false, F, "http://www.w3.org/XML/1998/namespace", false, false);
    }), [
      "tabIndex",
      "crossOrigin"
    ].forEach(function(F) {
      y[F] = new v(F, 1, false, F.toLowerCase(), null, false, false);
    }), y.xlinkHref = new v("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false), [
      "src",
      "href",
      "action",
      "formAction"
    ].forEach(function(F) {
      y[F] = new v(F, 1, false, F.toLowerCase(), null, true, true);
    });
    function j(F, _, R, P) {
      var W = y.hasOwnProperty(_) ? y[_] : null;
      (W !== null ? W.type !== 0 : P || !(2 < _.length) || _[0] !== "o" && _[0] !== "O" || _[1] !== "n" && _[1] !== "N") && (m(_, R, W, P) && (R = null), P || W === null ? f(_) && (R === null ? F.removeAttribute(_) : F.setAttribute(_, "" + R)) : W.mustUseProperty ? F[W.propertyName] = R === null ? W.type === 3 ? false : "" : R : (_ = W.attributeName, P = W.attributeNamespace, R === null ? F.removeAttribute(_) : (W = W.type, R = W === 3 || W === 4 && R === true ? "" : "" + R, P ? F.setAttributeNS(P, _, R) : F.setAttribute(_, R))));
    }
    var k = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, C = /* @__PURE__ */ Symbol.for("react.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), S = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), A = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.provider"), U = /* @__PURE__ */ Symbol.for("react.context"), z = /* @__PURE__ */ Symbol.for("react.forward_ref"), O = /* @__PURE__ */ Symbol.for("react.suspense"), M = /* @__PURE__ */ Symbol.for("react.suspense_list"), I = /* @__PURE__ */ Symbol.for("react.memo"), N = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.offscreen"), H = Symbol.iterator;
    function V(F) {
      return F === null || typeof F != "object" ? null : (F = H && F[H] || F["@@iterator"], typeof F == "function" ? F : null);
    }
    var Z = Object.assign, Y;
    function oe(F) {
      if (Y === void 0) try {
        throw Error();
      } catch (R) {
        var _ = R.stack.trim().match(/\n( *(at )?)/);
        Y = _ && _[1] || "";
      }
      return `
` + Y + F;
    }
    var ue = false;
    function ie(F, _) {
      if (!F || ue) return "";
      ue = true;
      var R = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      try {
        if (_) if (_ = function() {
          throw Error();
        }, Object.defineProperty(_.prototype, "props", {
          set: function() {
            throw Error();
          }
        }), typeof Reflect == "object" && Reflect.construct) {
          try {
            Reflect.construct(_, []);
          } catch (at) {
            var P = at;
          }
          Reflect.construct(F, [], _);
        } else {
          try {
            _.call();
          } catch (at) {
            P = at;
          }
          F.call(_.prototype);
        }
        else {
          try {
            throw Error();
          } catch (at) {
            P = at;
          }
          F();
        }
      } catch (at) {
        if (at && P && typeof at.stack == "string") {
          for (var W = at.stack.split(`
`), J = P.stack.split(`
`), pe = W.length - 1, Se = J.length - 1; 1 <= pe && 0 <= Se && W[pe] !== J[Se]; ) Se--;
          for (; 1 <= pe && 0 <= Se; pe--, Se--) if (W[pe] !== J[Se]) {
            if (pe !== 1 || Se !== 1) do
              if (pe--, Se--, 0 > Se || W[pe] !== J[Se]) {
                var Pe = `
` + W[pe].replace(" at new ", " at ");
                return F.displayName && Pe.includes("<anonymous>") && (Pe = Pe.replace("<anonymous>", F.displayName)), Pe;
              }
            while (1 <= pe && 0 <= Se);
            break;
          }
        }
      } finally {
        ue = false, Error.prepareStackTrace = R;
      }
      return (F = F ? F.displayName || F.name : "") ? oe(F) : "";
    }
    function de(F) {
      switch (F.tag) {
        case 5:
          return oe(F.type);
        case 16:
          return oe("Lazy");
        case 13:
          return oe("Suspense");
        case 19:
          return oe("SuspenseList");
        case 0:
        case 2:
        case 15:
          return F = ie(F.type, false), F;
        case 11:
          return F = ie(F.type.render, false), F;
        case 1:
          return F = ie(F.type, true), F;
        default:
          return "";
      }
    }
    function ne(F) {
      if (F == null) return null;
      if (typeof F == "function") return F.displayName || F.name || null;
      if (typeof F == "string") return F;
      switch (F) {
        case S:
          return "Fragment";
        case x:
          return "Portal";
        case A:
          return "Profiler";
        case T:
          return "StrictMode";
        case O:
          return "Suspense";
        case M:
          return "SuspenseList";
      }
      if (typeof F == "object") switch (F.$$typeof) {
        case U:
          return (F.displayName || "Context") + ".Consumer";
        case B:
          return (F._context.displayName || "Context") + ".Provider";
        case z:
          var _ = F.render;
          return F = F.displayName, F || (F = _.displayName || _.name || "", F = F !== "" ? "ForwardRef(" + F + ")" : "ForwardRef"), F;
        case I:
          return _ = F.displayName || null, _ !== null ? _ : ne(F.type) || "Memo";
        case N:
          _ = F._payload, F = F._init;
          try {
            return ne(F(_));
          } catch {
          }
      }
      return null;
    }
    function ae(F) {
      var _ = F.type;
      switch (F.tag) {
        case 24:
          return "Cache";
        case 9:
          return (_.displayName || "Context") + ".Consumer";
        case 10:
          return (_._context.displayName || "Context") + ".Provider";
        case 18:
          return "DehydratedFragment";
        case 11:
          return F = _.render, F = F.displayName || F.name || "", _.displayName || (F !== "" ? "ForwardRef(" + F + ")" : "ForwardRef");
        case 7:
          return "Fragment";
        case 5:
          return _;
        case 4:
          return "Portal";
        case 3:
          return "Root";
        case 6:
          return "Text";
        case 16:
          return ne(_);
        case 8:
          return _ === T ? "StrictMode" : "Mode";
        case 22:
          return "Offscreen";
        case 12:
          return "Profiler";
        case 21:
          return "Scope";
        case 13:
          return "Suspense";
        case 19:
          return "SuspenseList";
        case 25:
          return "TracingMarker";
        case 1:
        case 0:
        case 17:
        case 2:
        case 14:
        case 15:
          if (typeof _ == "function") return _.displayName || _.name || null;
          if (typeof _ == "string") return _;
      }
      return null;
    }
    function X(F) {
      switch (typeof F) {
        case "boolean":
        case "number":
        case "string":
        case "undefined":
          return F;
        case "object":
          return F;
        default:
          return "";
      }
    }
    function K(F) {
      var _ = F.type;
      return (F = F.nodeName) && F.toLowerCase() === "input" && (_ === "checkbox" || _ === "radio");
    }
    function G(F) {
      var _ = K(F) ? "checked" : "value", R = Object.getOwnPropertyDescriptor(F.constructor.prototype, _), P = "" + F[_];
      if (!F.hasOwnProperty(_) && typeof R < "u" && typeof R.get == "function" && typeof R.set == "function") {
        var W = R.get, J = R.set;
        return Object.defineProperty(F, _, {
          configurable: true,
          get: function() {
            return W.call(this);
          },
          set: function(pe) {
            P = "" + pe, J.call(this, pe);
          }
        }), Object.defineProperty(F, _, {
          enumerable: R.enumerable
        }), {
          getValue: function() {
            return P;
          },
          setValue: function(pe) {
            P = "" + pe;
          },
          stopTracking: function() {
            F._valueTracker = null, delete F[_];
          }
        };
      }
    }
    function le(F) {
      F._valueTracker || (F._valueTracker = G(F));
    }
    function te(F) {
      if (!F) return false;
      var _ = F._valueTracker;
      if (!_) return true;
      var R = _.getValue(), P = "";
      return F && (P = K(F) ? F.checked ? "true" : "false" : F.value), F = P, F !== R ? (_.setValue(F), true) : false;
    }
    function re(F) {
      if (F = F || (typeof document < "u" ? document : void 0), typeof F > "u") return null;
      try {
        return F.activeElement || F.body;
      } catch {
        return F.body;
      }
    }
    function he(F, _) {
      var R = _.checked;
      return Z({}, _, {
        defaultChecked: void 0,
        defaultValue: void 0,
        value: void 0,
        checked: R ?? F._wrapperState.initialChecked
      });
    }
    function se(F, _) {
      var R = _.defaultValue == null ? "" : _.defaultValue, P = _.checked != null ? _.checked : _.defaultChecked;
      R = X(_.value != null ? _.value : R), F._wrapperState = {
        initialChecked: P,
        initialValue: R,
        controlled: _.type === "checkbox" || _.type === "radio" ? _.checked != null : _.value != null
      };
    }
    function ye(F, _) {
      _ = _.checked, _ != null && j(F, "checked", _, false);
    }
    function we(F, _) {
      ye(F, _);
      var R = X(_.value), P = _.type;
      if (R != null) P === "number" ? (R === 0 && F.value === "" || F.value != R) && (F.value = "" + R) : F.value !== "" + R && (F.value = "" + R);
      else if (P === "submit" || P === "reset") {
        F.removeAttribute("value");
        return;
      }
      _.hasOwnProperty("value") ? ke(F, _.type, R) : _.hasOwnProperty("defaultValue") && ke(F, _.type, X(_.defaultValue)), _.checked == null && _.defaultChecked != null && (F.defaultChecked = !!_.defaultChecked);
    }
    function Ee(F, _, R) {
      if (_.hasOwnProperty("value") || _.hasOwnProperty("defaultValue")) {
        var P = _.type;
        if (!(P !== "submit" && P !== "reset" || _.value !== void 0 && _.value !== null)) return;
        _ = "" + F._wrapperState.initialValue, R || _ === F.value || (F.value = _), F.defaultValue = _;
      }
      R = F.name, R !== "" && (F.name = ""), F.defaultChecked = !!F._wrapperState.initialChecked, R !== "" && (F.name = R);
    }
    function ke(F, _, R) {
      (_ !== "number" || re(F.ownerDocument) !== F) && (R == null ? F.defaultValue = "" + F._wrapperState.initialValue : F.defaultValue !== "" + R && (F.defaultValue = "" + R));
    }
    var Ne = Array.isArray;
    function lt(F, _, R, P) {
      if (F = F.options, _) {
        _ = {};
        for (var W = 0; W < R.length; W++) _["$" + R[W]] = true;
        for (R = 0; R < F.length; R++) W = _.hasOwnProperty("$" + F[R].value), F[R].selected !== W && (F[R].selected = W), W && P && (F[R].defaultSelected = true);
      } else {
        for (R = "" + X(R), _ = null, W = 0; W < F.length; W++) {
          if (F[W].value === R) {
            F[W].selected = true, P && (F[W].defaultSelected = true);
            return;
          }
          _ !== null || F[W].disabled || (_ = F[W]);
        }
        _ !== null && (_.selected = true);
      }
    }
    function Rt(F, _) {
      if (_.dangerouslySetInnerHTML != null) throw Error(n(91));
      return Z({}, _, {
        value: void 0,
        defaultValue: void 0,
        children: "" + F._wrapperState.initialValue
      });
    }
    function We(F, _) {
      var R = _.value;
      if (R == null) {
        if (R = _.children, _ = _.defaultValue, R != null) {
          if (_ != null) throw Error(n(92));
          if (Ne(R)) {
            if (1 < R.length) throw Error(n(93));
            R = R[0];
          }
          _ = R;
        }
        _ == null && (_ = ""), R = _;
      }
      F._wrapperState = {
        initialValue: X(R)
      };
    }
    function yt(F, _) {
      var R = X(_.value), P = X(_.defaultValue);
      R != null && (R = "" + R, R !== F.value && (F.value = R), _.defaultValue == null && F.defaultValue !== R && (F.defaultValue = R)), P != null && (F.defaultValue = "" + P);
    }
    function Xt(F) {
      var _ = F.textContent;
      _ === F._wrapperState.initialValue && _ !== "" && _ !== null && (F.value = _);
    }
    function nn(F) {
      switch (F) {
        case "svg":
          return "http://www.w3.org/2000/svg";
        case "math":
          return "http://www.w3.org/1998/Math/MathML";
        default:
          return "http://www.w3.org/1999/xhtml";
      }
    }
    function bt(F, _) {
      return F == null || F === "http://www.w3.org/1999/xhtml" ? nn(_) : F === "http://www.w3.org/2000/svg" && _ === "foreignObject" ? "http://www.w3.org/1999/xhtml" : F;
    }
    var At, $t = (function(F) {
      return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(_, R, P, W) {
        MSApp.execUnsafeLocalFunction(function() {
          return F(_, R, P, W);
        });
      } : F;
    })(function(F, _) {
      if (F.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in F) F.innerHTML = _;
      else {
        for (At = At || document.createElement("div"), At.innerHTML = "<svg>" + _.valueOf().toString() + "</svg>", _ = At.firstChild; F.firstChild; ) F.removeChild(F.firstChild);
        for (; _.firstChild; ) F.appendChild(_.firstChild);
      }
    });
    function Lt(F, _) {
      if (_) {
        var R = F.firstChild;
        if (R && R === F.lastChild && R.nodeType === 3) {
          R.nodeValue = _;
          return;
        }
      }
      F.textContent = _;
    }
    var wt = {
      animationIterationCount: true,
      aspectRatio: true,
      borderImageOutset: true,
      borderImageSlice: true,
      borderImageWidth: true,
      boxFlex: true,
      boxFlexGroup: true,
      boxOrdinalGroup: true,
      columnCount: true,
      columns: true,
      flex: true,
      flexGrow: true,
      flexPositive: true,
      flexShrink: true,
      flexNegative: true,
      flexOrder: true,
      gridArea: true,
      gridRow: true,
      gridRowEnd: true,
      gridRowSpan: true,
      gridRowStart: true,
      gridColumn: true,
      gridColumnEnd: true,
      gridColumnSpan: true,
      gridColumnStart: true,
      fontWeight: true,
      lineClamp: true,
      lineHeight: true,
      opacity: true,
      order: true,
      orphans: true,
      tabSize: true,
      widows: true,
      zIndex: true,
      zoom: true,
      fillOpacity: true,
      floodOpacity: true,
      stopOpacity: true,
      strokeDasharray: true,
      strokeDashoffset: true,
      strokeMiterlimit: true,
      strokeOpacity: true,
      strokeWidth: true
    }, st = [
      "Webkit",
      "ms",
      "Moz",
      "O"
    ];
    Object.keys(wt).forEach(function(F) {
      st.forEach(function(_) {
        _ = _ + F.charAt(0).toUpperCase() + F.substring(1), wt[_] = wt[F];
      });
    });
    function Be(F, _, R) {
      return _ == null || typeof _ == "boolean" || _ === "" ? "" : R || typeof _ != "number" || _ === 0 || wt.hasOwnProperty(F) && wt[F] ? ("" + _).trim() : _ + "px";
    }
    function Re(F, _) {
      F = F.style;
      for (var R in _) if (_.hasOwnProperty(R)) {
        var P = R.indexOf("--") === 0, W = Be(R, _[R], P);
        R === "float" && (R = "cssFloat"), P ? F.setProperty(R, W) : F[R] = W;
      }
    }
    var Ue = Z({
      menuitem: true
    }, {
      area: true,
      base: true,
      br: true,
      col: true,
      embed: true,
      hr: true,
      img: true,
      input: true,
      keygen: true,
      link: true,
      meta: true,
      param: true,
      source: true,
      track: true,
      wbr: true
    });
    function qe(F, _) {
      if (_) {
        if (Ue[F] && (_.children != null || _.dangerouslySetInnerHTML != null)) throw Error(n(137, F));
        if (_.dangerouslySetInnerHTML != null) {
          if (_.children != null) throw Error(n(60));
          if (typeof _.dangerouslySetInnerHTML != "object" || !("__html" in _.dangerouslySetInnerHTML)) throw Error(n(61));
        }
        if (_.style != null && typeof _.style != "object") throw Error(n(62));
      }
    }
    function tt(F, _) {
      if (F.indexOf("-") === -1) return typeof _.is == "string";
      switch (F) {
        case "annotation-xml":
        case "color-profile":
        case "font-face":
        case "font-face-src":
        case "font-face-uri":
        case "font-face-format":
        case "font-face-name":
        case "missing-glyph":
          return false;
        default:
          return true;
      }
    }
    var ht = null;
    function $e(F) {
      return F = F.target || F.srcElement || window, F.correspondingUseElement && (F = F.correspondingUseElement), F.nodeType === 3 ? F.parentNode : F;
    }
    var Tt = null, zt = null, Vt = null;
    function bn(F) {
      if (F = Iv(F)) {
        if (typeof Tt != "function") throw Error(n(280));
        var _ = F.stateNode;
        _ && (_ = X3(_), Tt(F.stateNode, F.type, _));
      }
    }
    function Zn(F) {
      zt ? Vt ? Vt.push(F) : Vt = [
        F
      ] : zt = F;
    }
    function Kn() {
      if (zt) {
        var F = zt, _ = Vt;
        if (Vt = zt = null, bn(F), _) for (F = 0; F < _.length; F++) bn(_[F]);
      }
    }
    function Ce(F, _) {
      return F(_);
    }
    function Dt() {
    }
    var Ut = false;
    function Zt(F, _, R) {
      if (Ut) return F(_, R);
      Ut = true;
      try {
        return Ce(F, _, R);
      } finally {
        Ut = false, (zt !== null || Vt !== null) && (Dt(), Kn());
      }
    }
    function ut(F, _) {
      var R = F.stateNode;
      if (R === null) return null;
      var P = X3(R);
      if (P === null) return null;
      R = P[_];
      e: switch (_) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          (P = !P.disabled) || (F = F.type, P = !(F === "button" || F === "input" || F === "select" || F === "textarea")), F = !P;
          break e;
        default:
          F = false;
      }
      if (F) return null;
      if (R && typeof R != "function") throw Error(n(231, _, typeof R));
      return R;
    }
    var De = false;
    if (l) try {
      var Ae = {};
      Object.defineProperty(Ae, "passive", {
        get: function() {
          De = true;
        }
      }), window.addEventListener("test", Ae, Ae), window.removeEventListener("test", Ae, Ae);
    } catch {
      De = false;
    }
    function Ge(F, _, R, P, W, J, pe, Se, Pe) {
      var at = Array.prototype.slice.call(arguments, 3);
      try {
        _.apply(R, at);
      } catch (Nt) {
        this.onError(Nt);
      }
    }
    var ot = false, Mt = null, cn = false, un = null, gn = {
      onError: function(F) {
        ot = true, Mt = F;
      }
    };
    function Ke(F, _, R, P, W, J, pe, Se, Pe) {
      ot = false, Mt = null, Ge.apply(gn, arguments);
    }
    function it(F, _, R, P, W, J, pe, Se, Pe) {
      if (Ke.apply(this, arguments), ot) {
        if (ot) {
          var at = Mt;
          ot = false, Mt = null;
        } else throw Error(n(198));
        cn || (cn = true, un = at);
      }
    }
    function It(F) {
      var _ = F, R = F;
      if (F.alternate) for (; _.return; ) _ = _.return;
      else {
        F = _;
        do
          _ = F, (_.flags & 4098) !== 0 && (R = _.return), F = _.return;
        while (F);
      }
      return _.tag === 3 ? R : null;
    }
    function Pt(F) {
      if (F.tag === 13) {
        var _ = F.memoizedState;
        if (_ === null && (F = F.alternate, F !== null && (_ = F.memoizedState)), _ !== null) return _.dehydrated;
      }
      return null;
    }
    function Sn(F) {
      if (It(F) !== F) throw Error(n(188));
    }
    function Mn(F) {
      var _ = F.alternate;
      if (!_) {
        if (_ = It(F), _ === null) throw Error(n(188));
        return _ !== F ? null : F;
      }
      for (var R = F, P = _; ; ) {
        var W = R.return;
        if (W === null) break;
        var J = W.alternate;
        if (J === null) {
          if (P = W.return, P !== null) {
            R = P;
            continue;
          }
          break;
        }
        if (W.child === J.child) {
          for (J = W.child; J; ) {
            if (J === R) return Sn(W), F;
            if (J === P) return Sn(W), _;
            J = J.sibling;
          }
          throw Error(n(188));
        }
        if (R.return !== P.return) R = W, P = J;
        else {
          for (var pe = false, Se = W.child; Se; ) {
            if (Se === R) {
              pe = true, R = W, P = J;
              break;
            }
            if (Se === P) {
              pe = true, P = W, R = J;
              break;
            }
            Se = Se.sibling;
          }
          if (!pe) {
            for (Se = J.child; Se; ) {
              if (Se === R) {
                pe = true, R = J, P = W;
                break;
              }
              if (Se === P) {
                pe = true, P = J, R = W;
                break;
              }
              Se = Se.sibling;
            }
            if (!pe) throw Error(n(189));
          }
        }
        if (R.alternate !== P) throw Error(n(190));
      }
      if (R.tag !== 3) throw Error(n(188));
      return R.stateNode.current === R ? F : _;
    }
    function on(F) {
      return F = Mn(F), F !== null ? vt(F) : null;
    }
    function vt(F) {
      if (F.tag === 5 || F.tag === 6) return F;
      for (F = F.child; F !== null; ) {
        var _ = vt(F);
        if (_ !== null) return _;
        F = F.sibling;
      }
      return null;
    }
    var je = e.unstable_scheduleCallback, Ve = e.unstable_cancelCallback, St = e.unstable_shouldYield, pt = e.unstable_requestPaint, Ct = e.unstable_now, En = e.unstable_getCurrentPriorityLevel, fn = e.unstable_ImmediatePriority, ur = e.unstable_UserBlockingPriority, Lr = e.unstable_NormalPriority, pn = e.unstable_LowPriority, nt = e.unstable_IdlePriority, an = null, On = null;
    function Qr(F) {
      if (On && typeof On.onCommitFiberRoot == "function") try {
        On.onCommitFiberRoot(an, F, void 0, (F.current.flags & 128) === 128);
      } catch {
      }
    }
    var tr = Math.clz32 ? Math.clz32 : nu, Mi = Math.log, ps = Math.LN2;
    function nu(F) {
      return F >>>= 0, F === 0 ? 32 : 31 - (Mi(F) / ps | 0) | 0;
    }
    var mv = 64, P3 = 4194304;
    function gv(F) {
      switch (F & -F) {
        case 1:
          return 1;
        case 2:
          return 2;
        case 4:
          return 4;
        case 8:
          return 8;
        case 16:
          return 16;
        case 32:
          return 32;
        case 64:
        case 128:
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
          return F & 4194240;
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
        case 67108864:
          return F & 130023424;
        case 134217728:
          return 134217728;
        case 268435456:
          return 268435456;
        case 536870912:
          return 536870912;
        case 1073741824:
          return 1073741824;
        default:
          return F;
      }
    }
    function M3(F, _) {
      var R = F.pendingLanes;
      if (R === 0) return 0;
      var P = 0, W = F.suspendedLanes, J = F.pingedLanes, pe = R & 268435455;
      if (pe !== 0) {
        var Se = pe & ~W;
        Se !== 0 ? P = gv(Se) : (J &= pe, J !== 0 && (P = gv(J)));
      } else pe = R & ~W, pe !== 0 ? P = gv(pe) : J !== 0 && (P = gv(J));
      if (P === 0) return 0;
      if (_ !== 0 && _ !== P && (_ & W) === 0 && (W = P & -P, J = _ & -_, W >= J || W === 16 && (J & 4194240) !== 0)) return _;
      if ((P & 4) !== 0 && (P |= R & 16), _ = F.entangledLanes, _ !== 0) for (F = F.entanglements, _ &= P; 0 < _; ) R = 31 - tr(_), W = 1 << R, P |= F[R], _ &= ~W;
      return P;
    }
    function Uge(F, _) {
      switch (F) {
        case 1:
        case 2:
        case 4:
          return _ + 250;
        case 8:
        case 16:
        case 32:
        case 64:
        case 128:
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
          return _ + 5e3;
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
        case 67108864:
          return -1;
        case 134217728:
        case 268435456:
        case 536870912:
        case 1073741824:
          return -1;
        default:
          return -1;
      }
    }
    function Vge(F, _) {
      for (var R = F.suspendedLanes, P = F.pingedLanes, W = F.expirationTimes, J = F.pendingLanes; 0 < J; ) {
        var pe = 31 - tr(J), Se = 1 << pe, Pe = W[pe];
        Pe === -1 ? ((Se & R) === 0 || (Se & P) !== 0) && (W[pe] = Uge(Se, _)) : Pe <= _ && (F.expiredLanes |= Se), J &= ~Se;
      }
    }
    function OS(F) {
      return F = F.pendingLanes & -1073741825, F !== 0 ? F : F & 1073741824 ? 1073741824 : 0;
    }
    function pL() {
      var F = mv;
      return mv <<= 1, (mv & 4194240) === 0 && (mv = 64), F;
    }
    function LS(F) {
      for (var _ = [], R = 0; 31 > R; R++) _.push(F);
      return _;
    }
    function pv(F, _, R) {
      F.pendingLanes |= _, _ !== 536870912 && (F.suspendedLanes = 0, F.pingedLanes = 0), F = F.eventTimes, _ = 31 - tr(_), F[_] = R;
    }
    function Hge(F, _) {
      var R = F.pendingLanes & ~_;
      F.pendingLanes = _, F.suspendedLanes = 0, F.pingedLanes = 0, F.expiredLanes &= _, F.mutableReadLanes &= _, F.entangledLanes &= _, _ = F.entanglements;
      var P = F.eventTimes;
      for (F = F.expirationTimes; 0 < R; ) {
        var W = 31 - tr(R), J = 1 << W;
        _[W] = 0, P[W] = -1, F[W] = -1, R &= ~J;
      }
    }
    function NS(F, _) {
      var R = F.entangledLanes |= _;
      for (F = F.entanglements; R; ) {
        var P = 31 - tr(R), W = 1 << P;
        W & _ | F[P] & _ && (F[P] |= _), R &= ~W;
      }
    }
    var li = 0;
    function FL(F) {
      return F &= -F, 1 < F ? 4 < F ? (F & 268435455) !== 0 ? 16 : 536870912 : 4 : 1;
    }
    var vL, zS, _L, yL, bL, US = false, O3 = [], Dh = null, Ch = null, Eh = null, Fv = /* @__PURE__ */ new Map(), vv = /* @__PURE__ */ new Map(), kh = [], $ge = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
    function xL(F, _) {
      switch (F) {
        case "focusin":
        case "focusout":
          Dh = null;
          break;
        case "dragenter":
        case "dragleave":
          Ch = null;
          break;
        case "mouseover":
        case "mouseout":
          Eh = null;
          break;
        case "pointerover":
        case "pointerout":
          Fv.delete(_.pointerId);
          break;
        case "gotpointercapture":
        case "lostpointercapture":
          vv.delete(_.pointerId);
      }
    }
    function _v(F, _, R, P, W, J) {
      return F === null || F.nativeEvent !== J ? (F = {
        blockedOn: _,
        domEventName: R,
        eventSystemFlags: P,
        nativeEvent: J,
        targetContainers: [
          W
        ]
      }, _ !== null && (_ = Iv(_), _ !== null && zS(_)), F) : (F.eventSystemFlags |= P, _ = F.targetContainers, W !== null && _.indexOf(W) === -1 && _.push(W), F);
    }
    function Wge(F, _, R, P, W) {
      switch (_) {
        case "focusin":
          return Dh = _v(Dh, F, _, R, P, W), true;
        case "dragenter":
          return Ch = _v(Ch, F, _, R, P, W), true;
        case "mouseover":
          return Eh = _v(Eh, F, _, R, P, W), true;
        case "pointerover":
          var J = W.pointerId;
          return Fv.set(J, _v(Fv.get(J) || null, F, _, R, P, W)), true;
        case "gotpointercapture":
          return J = W.pointerId, vv.set(J, _v(vv.get(J) || null, F, _, R, P, W)), true;
      }
      return false;
    }
    function wL(F) {
      var _ = dm(F.target);
      if (_ !== null) {
        var R = It(_);
        if (R !== null) {
          if (_ = R.tag, _ === 13) {
            if (_ = Pt(R), _ !== null) {
              F.blockedOn = _, bL(F.priority, function() {
                _L(R);
              });
              return;
            }
          } else if (_ === 3 && R.stateNode.current.memoizedState.isDehydrated) {
            F.blockedOn = R.tag === 3 ? R.stateNode.containerInfo : null;
            return;
          }
        }
      }
      F.blockedOn = null;
    }
    function L3(F) {
      if (F.blockedOn !== null) return false;
      for (var _ = F.targetContainers; 0 < _.length; ) {
        var R = HS(F.domEventName, F.eventSystemFlags, _[0], F.nativeEvent);
        if (R === null) {
          R = F.nativeEvent;
          var P = new R.constructor(R.type, R);
          ht = P, R.target.dispatchEvent(P), ht = null;
        } else return _ = Iv(R), _ !== null && zS(_), F.blockedOn = R, false;
        _.shift();
      }
      return true;
    }
    function DL(F, _, R) {
      L3(F) && R.delete(_);
    }
    function qge() {
      US = false, Dh !== null && L3(Dh) && (Dh = null), Ch !== null && L3(Ch) && (Ch = null), Eh !== null && L3(Eh) && (Eh = null), Fv.forEach(DL), vv.forEach(DL);
    }
    function yv(F, _) {
      F.blockedOn === _ && (F.blockedOn = null, US || (US = true, e.unstable_scheduleCallback(e.unstable_NormalPriority, qge)));
    }
    function bv(F) {
      function _(W) {
        return yv(W, F);
      }
      if (0 < O3.length) {
        yv(O3[0], F);
        for (var R = 1; R < O3.length; R++) {
          var P = O3[R];
          P.blockedOn === F && (P.blockedOn = null);
        }
      }
      for (Dh !== null && yv(Dh, F), Ch !== null && yv(Ch, F), Eh !== null && yv(Eh, F), Fv.forEach(_), vv.forEach(_), R = 0; R < kh.length; R++) P = kh[R], P.blockedOn === F && (P.blockedOn = null);
      for (; 0 < kh.length && (R = kh[0], R.blockedOn === null); ) wL(R), R.blockedOn === null && kh.shift();
    }
    var Op = k.ReactCurrentBatchConfig, N3 = true;
    function Kge(F, _, R, P) {
      var W = li, J = Op.transition;
      Op.transition = null;
      try {
        li = 1, VS(F, _, R, P);
      } finally {
        li = W, Op.transition = J;
      }
    }
    function Gge(F, _, R, P) {
      var W = li, J = Op.transition;
      Op.transition = null;
      try {
        li = 4, VS(F, _, R, P);
      } finally {
        li = W, Op.transition = J;
      }
    }
    function VS(F, _, R, P) {
      if (N3) {
        var W = HS(F, _, R, P);
        if (W === null) a6(F, _, P, z3, R), xL(F, P);
        else if (Wge(W, F, _, R, P)) P.stopPropagation();
        else if (xL(F, P), _ & 4 && -1 < $ge.indexOf(F)) {
          for (; W !== null; ) {
            var J = Iv(W);
            if (J !== null && vL(J), J = HS(F, _, R, P), J === null && a6(F, _, P, z3, R), J === W) break;
            W = J;
          }
          W !== null && P.stopPropagation();
        } else a6(F, _, P, null, R);
      }
    }
    var z3 = null;
    function HS(F, _, R, P) {
      if (z3 = null, F = $e(P), F = dm(F), F !== null) if (_ = It(F), _ === null) F = null;
      else if (R = _.tag, R === 13) {
        if (F = Pt(_), F !== null) return F;
        F = null;
      } else if (R === 3) {
        if (_.stateNode.current.memoizedState.isDehydrated) return _.tag === 3 ? _.stateNode.containerInfo : null;
        F = null;
      } else _ !== F && (F = null);
      return z3 = F, null;
    }
    function CL(F) {
      switch (F) {
        case "cancel":
        case "click":
        case "close":
        case "contextmenu":
        case "copy":
        case "cut":
        case "auxclick":
        case "dblclick":
        case "dragend":
        case "dragstart":
        case "drop":
        case "focusin":
        case "focusout":
        case "input":
        case "invalid":
        case "keydown":
        case "keypress":
        case "keyup":
        case "mousedown":
        case "mouseup":
        case "paste":
        case "pause":
        case "play":
        case "pointercancel":
        case "pointerdown":
        case "pointerup":
        case "ratechange":
        case "reset":
        case "resize":
        case "seeked":
        case "submit":
        case "touchcancel":
        case "touchend":
        case "touchstart":
        case "volumechange":
        case "change":
        case "selectionchange":
        case "textInput":
        case "compositionstart":
        case "compositionend":
        case "compositionupdate":
        case "beforeblur":
        case "afterblur":
        case "beforeinput":
        case "blur":
        case "fullscreenchange":
        case "focus":
        case "hashchange":
        case "popstate":
        case "select":
        case "selectstart":
          return 1;
        case "drag":
        case "dragenter":
        case "dragexit":
        case "dragleave":
        case "dragover":
        case "mousemove":
        case "mouseout":
        case "mouseover":
        case "pointermove":
        case "pointerout":
        case "pointerover":
        case "scroll":
        case "toggle":
        case "touchmove":
        case "wheel":
        case "mouseenter":
        case "mouseleave":
        case "pointerenter":
        case "pointerleave":
          return 4;
        case "message":
          switch (En()) {
            case fn:
              return 1;
            case ur:
              return 4;
            case Lr:
            case pn:
              return 16;
            case nt:
              return 536870912;
            default:
              return 16;
          }
        default:
          return 16;
      }
    }
    var Sh = null, $S = null, U3 = null;
    function EL() {
      if (U3) return U3;
      var F, _ = $S, R = _.length, P, W = "value" in Sh ? Sh.value : Sh.textContent, J = W.length;
      for (F = 0; F < R && _[F] === W[F]; F++) ;
      var pe = R - F;
      for (P = 1; P <= pe && _[R - P] === W[J - P]; P++) ;
      return U3 = W.slice(F, 1 < P ? 1 - P : void 0);
    }
    function V3(F) {
      var _ = F.keyCode;
      return "charCode" in F ? (F = F.charCode, F === 0 && _ === 13 && (F = 13)) : F = _, F === 10 && (F = 13), 32 <= F || F === 13 ? F : 0;
    }
    function H3() {
      return true;
    }
    function kL() {
      return false;
    }
    function Ns(F) {
      function _(R, P, W, J, pe) {
        this._reactName = R, this._targetInst = W, this.type = P, this.nativeEvent = J, this.target = pe, this.currentTarget = null;
        for (var Se in F) F.hasOwnProperty(Se) && (R = F[Se], this[Se] = R ? R(J) : J[Se]);
        return this.isDefaultPrevented = (J.defaultPrevented != null ? J.defaultPrevented : J.returnValue === false) ? H3 : kL, this.isPropagationStopped = kL, this;
      }
      return Z(_.prototype, {
        preventDefault: function() {
          this.defaultPrevented = true;
          var R = this.nativeEvent;
          R && (R.preventDefault ? R.preventDefault() : typeof R.returnValue != "unknown" && (R.returnValue = false), this.isDefaultPrevented = H3);
        },
        stopPropagation: function() {
          var R = this.nativeEvent;
          R && (R.stopPropagation ? R.stopPropagation() : typeof R.cancelBubble != "unknown" && (R.cancelBubble = true), this.isPropagationStopped = H3);
        },
        persist: function() {
        },
        isPersistent: H3
      }), _;
    }
    var Lp = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: function(F) {
        return F.timeStamp || Date.now();
      },
      defaultPrevented: 0,
      isTrusted: 0
    }, WS = Ns(Lp), xv = Z({}, Lp, {
      view: 0,
      detail: 0
    }), Yge = Ns(xv), qS, KS, wv, $3 = Z({}, xv, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: YS,
      button: 0,
      buttons: 0,
      relatedTarget: function(F) {
        return F.relatedTarget === void 0 ? F.fromElement === F.srcElement ? F.toElement : F.fromElement : F.relatedTarget;
      },
      movementX: function(F) {
        return "movementX" in F ? F.movementX : (F !== wv && (wv && F.type === "mousemove" ? (qS = F.screenX - wv.screenX, KS = F.screenY - wv.screenY) : KS = qS = 0, wv = F), qS);
      },
      movementY: function(F) {
        return "movementY" in F ? F.movementY : KS;
      }
    }), SL = Ns($3), Zge = Z({}, $3, {
      dataTransfer: 0
    }), Jge = Ns(Zge), Xge = Z({}, xv, {
      relatedTarget: 0
    }), GS = Ns(Xge), Qge = Z({}, Lp, {
      animationName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), epe = Ns(Qge), tpe = Z({}, Lp, {
      clipboardData: function(F) {
        return "clipboardData" in F ? F.clipboardData : window.clipboardData;
      }
    }), npe = Ns(tpe), rpe = Z({}, Lp, {
      data: 0
    }), jL = Ns(rpe), ipe = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified"
    }, ope = {
      8: "Backspace",
      9: "Tab",
      12: "Clear",
      13: "Enter",
      16: "Shift",
      17: "Control",
      18: "Alt",
      19: "Pause",
      20: "CapsLock",
      27: "Escape",
      32: " ",
      33: "PageUp",
      34: "PageDown",
      35: "End",
      36: "Home",
      37: "ArrowLeft",
      38: "ArrowUp",
      39: "ArrowRight",
      40: "ArrowDown",
      45: "Insert",
      46: "Delete",
      112: "F1",
      113: "F2",
      114: "F3",
      115: "F4",
      116: "F5",
      117: "F6",
      118: "F7",
      119: "F8",
      120: "F9",
      121: "F10",
      122: "F11",
      123: "F12",
      144: "NumLock",
      145: "ScrollLock",
      224: "Meta"
    }, ape = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey"
    };
    function spe(F) {
      var _ = this.nativeEvent;
      return _.getModifierState ? _.getModifierState(F) : (F = ape[F]) ? !!_[F] : false;
    }
    function YS() {
      return spe;
    }
    var lpe = Z({}, xv, {
      key: function(F) {
        if (F.key) {
          var _ = ipe[F.key] || F.key;
          if (_ !== "Unidentified") return _;
        }
        return F.type === "keypress" ? (F = V3(F), F === 13 ? "Enter" : String.fromCharCode(F)) : F.type === "keydown" || F.type === "keyup" ? ope[F.keyCode] || "Unidentified" : "";
      },
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: YS,
      charCode: function(F) {
        return F.type === "keypress" ? V3(F) : 0;
      },
      keyCode: function(F) {
        return F.type === "keydown" || F.type === "keyup" ? F.keyCode : 0;
      },
      which: function(F) {
        return F.type === "keypress" ? V3(F) : F.type === "keydown" || F.type === "keyup" ? F.keyCode : 0;
      }
    }), cpe = Ns(lpe), dpe = Z({}, $3, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0
    }), TL = Ns(dpe), upe = Z({}, xv, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: YS
    }), hpe = Ns(upe), fpe = Z({}, Lp, {
      propertyName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), mpe = Ns(fpe), gpe = Z({}, $3, {
      deltaX: function(F) {
        return "deltaX" in F ? F.deltaX : "wheelDeltaX" in F ? -F.wheelDeltaX : 0;
      },
      deltaY: function(F) {
        return "deltaY" in F ? F.deltaY : "wheelDeltaY" in F ? -F.wheelDeltaY : "wheelDelta" in F ? -F.wheelDelta : 0;
      },
      deltaZ: 0,
      deltaMode: 0
    }), ppe = Ns(gpe), Fpe = [
      9,
      13,
      27,
      32
    ], ZS = l && "CompositionEvent" in window, Dv = null;
    l && "documentMode" in document && (Dv = document.documentMode);
    var vpe = l && "TextEvent" in window && !Dv, RL = l && (!ZS || Dv && 8 < Dv && 11 >= Dv), AL = " ", IL = false;
    function BL(F, _) {
      switch (F) {
        case "keyup":
          return Fpe.indexOf(_.keyCode) !== -1;
        case "keydown":
          return _.keyCode !== 229;
        case "keypress":
        case "mousedown":
        case "focusout":
          return true;
        default:
          return false;
      }
    }
    function PL(F) {
      return F = F.detail, typeof F == "object" && "data" in F ? F.data : null;
    }
    var Np = false;
    function _pe(F, _) {
      switch (F) {
        case "compositionend":
          return PL(_);
        case "keypress":
          return _.which !== 32 ? null : (IL = true, AL);
        case "textInput":
          return F = _.data, F === AL && IL ? null : F;
        default:
          return null;
      }
    }
    function ype(F, _) {
      if (Np) return F === "compositionend" || !ZS && BL(F, _) ? (F = EL(), U3 = $S = Sh = null, Np = false, F) : null;
      switch (F) {
        case "paste":
          return null;
        case "keypress":
          if (!(_.ctrlKey || _.altKey || _.metaKey) || _.ctrlKey && _.altKey) {
            if (_.char && 1 < _.char.length) return _.char;
            if (_.which) return String.fromCharCode(_.which);
          }
          return null;
        case "compositionend":
          return RL && _.locale !== "ko" ? null : _.data;
        default:
          return null;
      }
    }
    var bpe = {
      color: true,
      date: true,
      datetime: true,
      "datetime-local": true,
      email: true,
      month: true,
      number: true,
      password: true,
      range: true,
      search: true,
      tel: true,
      text: true,
      time: true,
      url: true,
      week: true
    };
    function ML(F) {
      var _ = F && F.nodeName && F.nodeName.toLowerCase();
      return _ === "input" ? !!bpe[F.type] : _ === "textarea";
    }
    function OL(F, _, R, P) {
      Zn(P), _ = Y3(_, "onChange"), 0 < _.length && (R = new WS("onChange", "change", null, R, P), F.push({
        event: R,
        listeners: _
      }));
    }
    var Cv = null, Ev = null;
    function xpe(F) {
      tN(F, 0);
    }
    function W3(F) {
      var _ = $p(F);
      if (te(_)) return F;
    }
    function wpe(F, _) {
      if (F === "change") return _;
    }
    var LL = false;
    if (l) {
      var JS;
      if (l) {
        var XS = "oninput" in document;
        if (!XS) {
          var NL = document.createElement("div");
          NL.setAttribute("oninput", "return;"), XS = typeof NL.oninput == "function";
        }
        JS = XS;
      } else JS = false;
      LL = JS && (!document.documentMode || 9 < document.documentMode);
    }
    function zL() {
      Cv && (Cv.detachEvent("onpropertychange", UL), Ev = Cv = null);
    }
    function UL(F) {
      if (F.propertyName === "value" && W3(Ev)) {
        var _ = [];
        OL(_, Ev, F, $e(F)), Zt(xpe, _);
      }
    }
    function Dpe(F, _, R) {
      F === "focusin" ? (zL(), Cv = _, Ev = R, Cv.attachEvent("onpropertychange", UL)) : F === "focusout" && zL();
    }
    function Cpe(F) {
      if (F === "selectionchange" || F === "keyup" || F === "keydown") return W3(Ev);
    }
    function Epe(F, _) {
      if (F === "click") return W3(_);
    }
    function kpe(F, _) {
      if (F === "input" || F === "change") return W3(_);
    }
    function Spe(F, _) {
      return F === _ && (F !== 0 || 1 / F === 1 / _) || F !== F && _ !== _;
    }
    var ac = typeof Object.is == "function" ? Object.is : Spe;
    function kv(F, _) {
      if (ac(F, _)) return true;
      if (typeof F != "object" || F === null || typeof _ != "object" || _ === null) return false;
      var R = Object.keys(F), P = Object.keys(_);
      if (R.length !== P.length) return false;
      for (P = 0; P < R.length; P++) {
        var W = R[P];
        if (!c.call(_, W) || !ac(F[W], _[W])) return false;
      }
      return true;
    }
    function VL(F) {
      for (; F && F.firstChild; ) F = F.firstChild;
      return F;
    }
    function HL(F, _) {
      var R = VL(F);
      F = 0;
      for (var P; R; ) {
        if (R.nodeType === 3) {
          if (P = F + R.textContent.length, F <= _ && P >= _) return {
            node: R,
            offset: _ - F
          };
          F = P;
        }
        e: {
          for (; R; ) {
            if (R.nextSibling) {
              R = R.nextSibling;
              break e;
            }
            R = R.parentNode;
          }
          R = void 0;
        }
        R = VL(R);
      }
    }
    function $L(F, _) {
      return F && _ ? F === _ ? true : F && F.nodeType === 3 ? false : _ && _.nodeType === 3 ? $L(F, _.parentNode) : "contains" in F ? F.contains(_) : F.compareDocumentPosition ? !!(F.compareDocumentPosition(_) & 16) : false : false;
    }
    function WL() {
      for (var F = window, _ = re(); _ instanceof F.HTMLIFrameElement; ) {
        try {
          var R = typeof _.contentWindow.location.href == "string";
        } catch {
          R = false;
        }
        if (R) F = _.contentWindow;
        else break;
        _ = re(F.document);
      }
      return _;
    }
    function QS(F) {
      var _ = F && F.nodeName && F.nodeName.toLowerCase();
      return _ && (_ === "input" && (F.type === "text" || F.type === "search" || F.type === "tel" || F.type === "url" || F.type === "password") || _ === "textarea" || F.contentEditable === "true");
    }
    function jpe(F) {
      var _ = WL(), R = F.focusedElem, P = F.selectionRange;
      if (_ !== R && R && R.ownerDocument && $L(R.ownerDocument.documentElement, R)) {
        if (P !== null && QS(R)) {
          if (_ = P.start, F = P.end, F === void 0 && (F = _), "selectionStart" in R) R.selectionStart = _, R.selectionEnd = Math.min(F, R.value.length);
          else if (F = (_ = R.ownerDocument || document) && _.defaultView || window, F.getSelection) {
            F = F.getSelection();
            var W = R.textContent.length, J = Math.min(P.start, W);
            P = P.end === void 0 ? J : Math.min(P.end, W), !F.extend && J > P && (W = P, P = J, J = W), W = HL(R, J);
            var pe = HL(R, P);
            W && pe && (F.rangeCount !== 1 || F.anchorNode !== W.node || F.anchorOffset !== W.offset || F.focusNode !== pe.node || F.focusOffset !== pe.offset) && (_ = _.createRange(), _.setStart(W.node, W.offset), F.removeAllRanges(), J > P ? (F.addRange(_), F.extend(pe.node, pe.offset)) : (_.setEnd(pe.node, pe.offset), F.addRange(_)));
          }
        }
        for (_ = [], F = R; F = F.parentNode; ) F.nodeType === 1 && _.push({
          element: F,
          left: F.scrollLeft,
          top: F.scrollTop
        });
        for (typeof R.focus == "function" && R.focus(), R = 0; R < _.length; R++) F = _[R], F.element.scrollLeft = F.left, F.element.scrollTop = F.top;
      }
    }
    var Tpe = l && "documentMode" in document && 11 >= document.documentMode, zp = null, e6 = null, Sv = null, t6 = false;
    function qL(F, _, R) {
      var P = R.window === R ? R.document : R.nodeType === 9 ? R : R.ownerDocument;
      t6 || zp == null || zp !== re(P) || (P = zp, "selectionStart" in P && QS(P) ? P = {
        start: P.selectionStart,
        end: P.selectionEnd
      } : (P = (P.ownerDocument && P.ownerDocument.defaultView || window).getSelection(), P = {
        anchorNode: P.anchorNode,
        anchorOffset: P.anchorOffset,
        focusNode: P.focusNode,
        focusOffset: P.focusOffset
      }), Sv && kv(Sv, P) || (Sv = P, P = Y3(e6, "onSelect"), 0 < P.length && (_ = new WS("onSelect", "select", null, _, R), F.push({
        event: _,
        listeners: P
      }), _.target = zp)));
    }
    function q3(F, _) {
      var R = {};
      return R[F.toLowerCase()] = _.toLowerCase(), R["Webkit" + F] = "webkit" + _, R["Moz" + F] = "moz" + _, R;
    }
    var Up = {
      animationend: q3("Animation", "AnimationEnd"),
      animationiteration: q3("Animation", "AnimationIteration"),
      animationstart: q3("Animation", "AnimationStart"),
      transitionend: q3("Transition", "TransitionEnd")
    }, n6 = {}, KL = {};
    l && (KL = document.createElement("div").style, "AnimationEvent" in window || (delete Up.animationend.animation, delete Up.animationiteration.animation, delete Up.animationstart.animation), "TransitionEvent" in window || delete Up.transitionend.transition);
    function K3(F) {
      if (n6[F]) return n6[F];
      if (!Up[F]) return F;
      var _ = Up[F], R;
      for (R in _) if (_.hasOwnProperty(R) && R in KL) return n6[F] = _[R];
      return F;
    }
    var GL = K3("animationend"), YL = K3("animationiteration"), ZL = K3("animationstart"), JL = K3("transitionend"), XL = /* @__PURE__ */ new Map(), QL = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
    function jh(F, _) {
      XL.set(F, _), a(_, [
        F
      ]);
    }
    for (var r6 = 0; r6 < QL.length; r6++) {
      var i6 = QL[r6], Rpe = i6.toLowerCase(), Ape = i6[0].toUpperCase() + i6.slice(1);
      jh(Rpe, "on" + Ape);
    }
    jh(GL, "onAnimationEnd"), jh(YL, "onAnimationIteration"), jh(ZL, "onAnimationStart"), jh("dblclick", "onDoubleClick"), jh("focusin", "onFocus"), jh("focusout", "onBlur"), jh(JL, "onTransitionEnd"), s("onMouseEnter", [
      "mouseout",
      "mouseover"
    ]), s("onMouseLeave", [
      "mouseout",
      "mouseover"
    ]), s("onPointerEnter", [
      "pointerout",
      "pointerover"
    ]), s("onPointerLeave", [
      "pointerout",
      "pointerover"
    ]), a("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), a("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), a("onBeforeInput", [
      "compositionend",
      "keypress",
      "textInput",
      "paste"
    ]), a("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), a("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), a("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
    var jv = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), Ipe = new Set("cancel close invalid load scroll toggle".split(" ").concat(jv));
    function eN(F, _, R) {
      var P = F.type || "unknown-event";
      F.currentTarget = R, it(P, _, void 0, F), F.currentTarget = null;
    }
    function tN(F, _) {
      _ = (_ & 4) !== 0;
      for (var R = 0; R < F.length; R++) {
        var P = F[R], W = P.event;
        P = P.listeners;
        e: {
          var J = void 0;
          if (_) for (var pe = P.length - 1; 0 <= pe; pe--) {
            var Se = P[pe], Pe = Se.instance, at = Se.currentTarget;
            if (Se = Se.listener, Pe !== J && W.isPropagationStopped()) break e;
            eN(W, Se, at), J = Pe;
          }
          else for (pe = 0; pe < P.length; pe++) {
            if (Se = P[pe], Pe = Se.instance, at = Se.currentTarget, Se = Se.listener, Pe !== J && W.isPropagationStopped()) break e;
            eN(W, Se, at), J = Pe;
          }
        }
      }
      if (cn) throw F = un, cn = false, un = null, F;
    }
    function Ti(F, _) {
      var R = _[h6];
      R === void 0 && (R = _[h6] = /* @__PURE__ */ new Set());
      var P = F + "__bubble";
      R.has(P) || (nN(_, F, 2, false), R.add(P));
    }
    function o6(F, _, R) {
      var P = 0;
      _ && (P |= 4), nN(R, F, P, _);
    }
    var G3 = "_reactListening" + Math.random().toString(36).slice(2);
    function Tv(F) {
      if (!F[G3]) {
        F[G3] = true, r.forEach(function(R) {
          R !== "selectionchange" && (Ipe.has(R) || o6(R, false, F), o6(R, true, F));
        });
        var _ = F.nodeType === 9 ? F : F.ownerDocument;
        _ === null || _[G3] || (_[G3] = true, o6("selectionchange", false, _));
      }
    }
    function nN(F, _, R, P) {
      switch (CL(_)) {
        case 1:
          var W = Kge;
          break;
        case 4:
          W = Gge;
          break;
        default:
          W = VS;
      }
      R = W.bind(null, _, R, F), W = void 0, !De || _ !== "touchstart" && _ !== "touchmove" && _ !== "wheel" || (W = true), P ? W !== void 0 ? F.addEventListener(_, R, {
        capture: true,
        passive: W
      }) : F.addEventListener(_, R, true) : W !== void 0 ? F.addEventListener(_, R, {
        passive: W
      }) : F.addEventListener(_, R, false);
    }
    function a6(F, _, R, P, W) {
      var J = P;
      if ((_ & 1) === 0 && (_ & 2) === 0 && P !== null) e: for (; ; ) {
        if (P === null) return;
        var pe = P.tag;
        if (pe === 3 || pe === 4) {
          var Se = P.stateNode.containerInfo;
          if (Se === W || Se.nodeType === 8 && Se.parentNode === W) break;
          if (pe === 4) for (pe = P.return; pe !== null; ) {
            var Pe = pe.tag;
            if ((Pe === 3 || Pe === 4) && (Pe = pe.stateNode.containerInfo, Pe === W || Pe.nodeType === 8 && Pe.parentNode === W)) return;
            pe = pe.return;
          }
          for (; Se !== null; ) {
            if (pe = dm(Se), pe === null) return;
            if (Pe = pe.tag, Pe === 5 || Pe === 6) {
              P = J = pe;
              continue e;
            }
            Se = Se.parentNode;
          }
        }
        P = P.return;
      }
      Zt(function() {
        var at = J, Nt = $e(R), Wt = [];
        e: {
          var Ot = XL.get(F);
          if (Ot !== void 0) {
            var Dn = WS, An = F;
            switch (F) {
              case "keypress":
                if (V3(R) === 0) break e;
              case "keydown":
              case "keyup":
                Dn = cpe;
                break;
              case "focusin":
                An = "focus", Dn = GS;
                break;
              case "focusout":
                An = "blur", Dn = GS;
                break;
              case "beforeblur":
              case "afterblur":
                Dn = GS;
                break;
              case "click":
                if (R.button === 2) break e;
              case "auxclick":
              case "dblclick":
              case "mousedown":
              case "mousemove":
              case "mouseup":
              case "mouseout":
              case "mouseover":
              case "contextmenu":
                Dn = SL;
                break;
              case "drag":
              case "dragend":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "dragstart":
              case "drop":
                Dn = Jge;
                break;
              case "touchcancel":
              case "touchend":
              case "touchmove":
              case "touchstart":
                Dn = hpe;
                break;
              case GL:
              case YL:
              case ZL:
                Dn = epe;
                break;
              case JL:
                Dn = mpe;
                break;
              case "scroll":
                Dn = Yge;
                break;
              case "wheel":
                Dn = ppe;
                break;
              case "copy":
              case "cut":
              case "paste":
                Dn = npe;
                break;
              case "gotpointercapture":
              case "lostpointercapture":
              case "pointercancel":
              case "pointerdown":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "pointerup":
                Dn = TL;
            }
            var Ln = (_ & 4) !== 0, mo = !Ln && F === "scroll", Je = Ln ? Ot !== null ? Ot + "Capture" : null : Ot;
            Ln = [];
            for (var ze = at, et; ze !== null; ) {
              et = ze;
              var Qt = et.stateNode;
              if (et.tag === 5 && Qt !== null && (et = Qt, Je !== null && (Qt = ut(ze, Je), Qt != null && Ln.push(Rv(ze, Qt, et)))), mo) break;
              ze = ze.return;
            }
            0 < Ln.length && (Ot = new Dn(Ot, An, null, R, Nt), Wt.push({
              event: Ot,
              listeners: Ln
            }));
          }
        }
        if ((_ & 7) === 0) {
          e: {
            if (Ot = F === "mouseover" || F === "pointerover", Dn = F === "mouseout" || F === "pointerout", Ot && R !== ht && (An = R.relatedTarget || R.fromElement) && (dm(An) || An[ru])) break e;
            if ((Dn || Ot) && (Ot = Nt.window === Nt ? Nt : (Ot = Nt.ownerDocument) ? Ot.defaultView || Ot.parentWindow : window, Dn ? (An = R.relatedTarget || R.toElement, Dn = at, An = An ? dm(An) : null, An !== null && (mo = It(An), An !== mo || An.tag !== 5 && An.tag !== 6) && (An = null)) : (Dn = null, An = at), Dn !== An)) {
              if (Ln = SL, Qt = "onMouseLeave", Je = "onMouseEnter", ze = "mouse", (F === "pointerout" || F === "pointerover") && (Ln = TL, Qt = "onPointerLeave", Je = "onPointerEnter", ze = "pointer"), mo = Dn == null ? Ot : $p(Dn), et = An == null ? Ot : $p(An), Ot = new Ln(Qt, ze + "leave", Dn, R, Nt), Ot.target = mo, Ot.relatedTarget = et, Qt = null, dm(Nt) === at && (Ln = new Ln(Je, ze + "enter", An, R, Nt), Ln.target = et, Ln.relatedTarget = mo, Qt = Ln), mo = Qt, Dn && An) t: {
                for (Ln = Dn, Je = An, ze = 0, et = Ln; et; et = Vp(et)) ze++;
                for (et = 0, Qt = Je; Qt; Qt = Vp(Qt)) et++;
                for (; 0 < ze - et; ) Ln = Vp(Ln), ze--;
                for (; 0 < et - ze; ) Je = Vp(Je), et--;
                for (; ze--; ) {
                  if (Ln === Je || Je !== null && Ln === Je.alternate) break t;
                  Ln = Vp(Ln), Je = Vp(Je);
                }
                Ln = null;
              }
              else Ln = null;
              Dn !== null && rN(Wt, Ot, Dn, Ln, false), An !== null && mo !== null && rN(Wt, mo, An, Ln, true);
            }
          }
          e: {
            if (Ot = at ? $p(at) : window, Dn = Ot.nodeName && Ot.nodeName.toLowerCase(), Dn === "select" || Dn === "input" && Ot.type === "file") var zn = wpe;
            else if (ML(Ot)) if (LL) zn = kpe;
            else {
              zn = Cpe;
              var Gn = Dpe;
            }
            else (Dn = Ot.nodeName) && Dn.toLowerCase() === "input" && (Ot.type === "checkbox" || Ot.type === "radio") && (zn = Epe);
            if (zn && (zn = zn(F, at))) {
              OL(Wt, zn, R, Nt);
              break e;
            }
            Gn && Gn(F, Ot, at), F === "focusout" && (Gn = Ot._wrapperState) && Gn.controlled && Ot.type === "number" && ke(Ot, "number", Ot.value);
          }
          switch (Gn = at ? $p(at) : window, F) {
            case "focusin":
              (ML(Gn) || Gn.contentEditable === "true") && (zp = Gn, e6 = at, Sv = null);
              break;
            case "focusout":
              Sv = e6 = zp = null;
              break;
            case "mousedown":
              t6 = true;
              break;
            case "contextmenu":
            case "mouseup":
            case "dragend":
              t6 = false, qL(Wt, R, Nt);
              break;
            case "selectionchange":
              if (Tpe) break;
            case "keydown":
            case "keyup":
              qL(Wt, R, Nt);
          }
          var Yn;
          if (ZS) e: {
            switch (F) {
              case "compositionstart":
                var rr = "onCompositionStart";
                break e;
              case "compositionend":
                rr = "onCompositionEnd";
                break e;
              case "compositionupdate":
                rr = "onCompositionUpdate";
                break e;
            }
            rr = void 0;
          }
          else Np ? BL(F, R) && (rr = "onCompositionEnd") : F === "keydown" && R.keyCode === 229 && (rr = "onCompositionStart");
          rr && (RL && R.locale !== "ko" && (Np || rr !== "onCompositionStart" ? rr === "onCompositionEnd" && Np && (Yn = EL()) : (Sh = Nt, $S = "value" in Sh ? Sh.value : Sh.textContent, Np = true)), Gn = Y3(at, rr), 0 < Gn.length && (rr = new jL(rr, F, null, R, Nt), Wt.push({
            event: rr,
            listeners: Gn
          }), Yn ? rr.data = Yn : (Yn = PL(R), Yn !== null && (rr.data = Yn)))), (Yn = vpe ? _pe(F, R) : ype(F, R)) && (at = Y3(at, "onBeforeInput"), 0 < at.length && (Nt = new jL("onBeforeInput", "beforeinput", null, R, Nt), Wt.push({
            event: Nt,
            listeners: at
          }), Nt.data = Yn));
        }
        tN(Wt, _);
      });
    }
    function Rv(F, _, R) {
      return {
        instance: F,
        listener: _,
        currentTarget: R
      };
    }
    function Y3(F, _) {
      for (var R = _ + "Capture", P = []; F !== null; ) {
        var W = F, J = W.stateNode;
        W.tag === 5 && J !== null && (W = J, J = ut(F, R), J != null && P.unshift(Rv(F, J, W)), J = ut(F, _), J != null && P.push(Rv(F, J, W))), F = F.return;
      }
      return P;
    }
    function Vp(F) {
      if (F === null) return null;
      do
        F = F.return;
      while (F && F.tag !== 5);
      return F || null;
    }
    function rN(F, _, R, P, W) {
      for (var J = _._reactName, pe = []; R !== null && R !== P; ) {
        var Se = R, Pe = Se.alternate, at = Se.stateNode;
        if (Pe !== null && Pe === P) break;
        Se.tag === 5 && at !== null && (Se = at, W ? (Pe = ut(R, J), Pe != null && pe.unshift(Rv(R, Pe, Se))) : W || (Pe = ut(R, J), Pe != null && pe.push(Rv(R, Pe, Se)))), R = R.return;
      }
      pe.length !== 0 && F.push({
        event: _,
        listeners: pe
      });
    }
    var Bpe = /\r\n?/g, Ppe = /\u0000|\uFFFD/g;
    function iN(F) {
      return (typeof F == "string" ? F : "" + F).replace(Bpe, `
`).replace(Ppe, "");
    }
    function Z3(F, _, R) {
      if (_ = iN(_), iN(F) !== _ && R) throw Error(n(425));
    }
    function J3() {
    }
    var s6 = null, l6 = null;
    function c6(F, _) {
      return F === "textarea" || F === "noscript" || typeof _.children == "string" || typeof _.children == "number" || typeof _.dangerouslySetInnerHTML == "object" && _.dangerouslySetInnerHTML !== null && _.dangerouslySetInnerHTML.__html != null;
    }
    var d6 = typeof setTimeout == "function" ? setTimeout : void 0, Mpe = typeof clearTimeout == "function" ? clearTimeout : void 0, oN = typeof Promise == "function" ? Promise : void 0, Ope = typeof queueMicrotask == "function" ? queueMicrotask : typeof oN < "u" ? function(F) {
      return oN.resolve(null).then(F).catch(Lpe);
    } : d6;
    function Lpe(F) {
      setTimeout(function() {
        throw F;
      });
    }
    function u6(F, _) {
      var R = _, P = 0;
      do {
        var W = R.nextSibling;
        if (F.removeChild(R), W && W.nodeType === 8) if (R = W.data, R === "/$") {
          if (P === 0) {
            F.removeChild(W), bv(_);
            return;
          }
          P--;
        } else R !== "$" && R !== "$?" && R !== "$!" || P++;
        R = W;
      } while (R);
      bv(_);
    }
    function Th(F) {
      for (; F != null; F = F.nextSibling) {
        var _ = F.nodeType;
        if (_ === 1 || _ === 3) break;
        if (_ === 8) {
          if (_ = F.data, _ === "$" || _ === "$!" || _ === "$?") break;
          if (_ === "/$") return null;
        }
      }
      return F;
    }
    function aN(F) {
      F = F.previousSibling;
      for (var _ = 0; F; ) {
        if (F.nodeType === 8) {
          var R = F.data;
          if (R === "$" || R === "$!" || R === "$?") {
            if (_ === 0) return F;
            _--;
          } else R === "/$" && _++;
        }
        F = F.previousSibling;
      }
      return null;
    }
    var Hp = Math.random().toString(36).slice(2), od = "__reactFiber$" + Hp, Av = "__reactProps$" + Hp, ru = "__reactContainer$" + Hp, h6 = "__reactEvents$" + Hp, Npe = "__reactListeners$" + Hp, zpe = "__reactHandles$" + Hp;
    function dm(F) {
      var _ = F[od];
      if (_) return _;
      for (var R = F.parentNode; R; ) {
        if (_ = R[ru] || R[od]) {
          if (R = _.alternate, _.child !== null || R !== null && R.child !== null) for (F = aN(F); F !== null; ) {
            if (R = F[od]) return R;
            F = aN(F);
          }
          return _;
        }
        F = R, R = F.parentNode;
      }
      return null;
    }
    function Iv(F) {
      return F = F[od] || F[ru], !F || F.tag !== 5 && F.tag !== 6 && F.tag !== 13 && F.tag !== 3 ? null : F;
    }
    function $p(F) {
      if (F.tag === 5 || F.tag === 6) return F.stateNode;
      throw Error(n(33));
    }
    function X3(F) {
      return F[Av] || null;
    }
    var f6 = [], Wp = -1;
    function Rh(F) {
      return {
        current: F
      };
    }
    function Ri(F) {
      0 > Wp || (F.current = f6[Wp], f6[Wp] = null, Wp--);
    }
    function Ci(F, _) {
      Wp++, f6[Wp] = F.current, F.current = _;
    }
    var Ah = {}, Ta = Rh(Ah), Fs = Rh(false), um = Ah;
    function qp(F, _) {
      var R = F.type.contextTypes;
      if (!R) return Ah;
      var P = F.stateNode;
      if (P && P.__reactInternalMemoizedUnmaskedChildContext === _) return P.__reactInternalMemoizedMaskedChildContext;
      var W = {}, J;
      for (J in R) W[J] = _[J];
      return P && (F = F.stateNode, F.__reactInternalMemoizedUnmaskedChildContext = _, F.__reactInternalMemoizedMaskedChildContext = W), W;
    }
    function vs(F) {
      return F = F.childContextTypes, F != null;
    }
    function Q3() {
      Ri(Fs), Ri(Ta);
    }
    function sN(F, _, R) {
      if (Ta.current !== Ah) throw Error(n(168));
      Ci(Ta, _), Ci(Fs, R);
    }
    function lN(F, _, R) {
      var P = F.stateNode;
      if (_ = _.childContextTypes, typeof P.getChildContext != "function") return R;
      P = P.getChildContext();
      for (var W in P) if (!(W in _)) throw Error(n(108, ae(F) || "Unknown", W));
      return Z({}, R, P);
    }
    function ex(F) {
      return F = (F = F.stateNode) && F.__reactInternalMemoizedMergedChildContext || Ah, um = Ta.current, Ci(Ta, F), Ci(Fs, Fs.current), true;
    }
    function cN(F, _, R) {
      var P = F.stateNode;
      if (!P) throw Error(n(169));
      R ? (F = lN(F, _, um), P.__reactInternalMemoizedMergedChildContext = F, Ri(Fs), Ri(Ta), Ci(Ta, F)) : Ri(Fs), Ci(Fs, R);
    }
    var iu = null, tx = false, m6 = false;
    function dN(F) {
      iu === null ? iu = [
        F
      ] : iu.push(F);
    }
    function Upe(F) {
      tx = true, dN(F);
    }
    function Ih() {
      if (!m6 && iu !== null) {
        m6 = true;
        var F = 0, _ = li;
        try {
          var R = iu;
          for (li = 1; F < R.length; F++) {
            var P = R[F];
            do
              P = P(true);
            while (P !== null);
          }
          iu = null, tx = false;
        } catch (W) {
          throw iu !== null && (iu = iu.slice(F + 1)), je(fn, Ih), W;
        } finally {
          li = _, m6 = false;
        }
      }
      return null;
    }
    var Kp = [], Gp = 0, nx = null, rx = 0, yl = [], bl = 0, hm = null, ou = 1, au = "";
    function fm(F, _) {
      Kp[Gp++] = rx, Kp[Gp++] = nx, nx = F, rx = _;
    }
    function uN(F, _, R) {
      yl[bl++] = ou, yl[bl++] = au, yl[bl++] = hm, hm = F;
      var P = ou;
      F = au;
      var W = 32 - tr(P) - 1;
      P &= ~(1 << W), R += 1;
      var J = 32 - tr(_) + W;
      if (30 < J) {
        var pe = W - W % 5;
        J = (P & (1 << pe) - 1).toString(32), P >>= pe, W -= pe, ou = 1 << 32 - tr(_) + W | R << W | P, au = J + F;
      } else ou = 1 << J | R << W | P, au = F;
    }
    function g6(F) {
      F.return !== null && (fm(F, 1), uN(F, 1, 0));
    }
    function p6(F) {
      for (; F === nx; ) nx = Kp[--Gp], Kp[Gp] = null, rx = Kp[--Gp], Kp[Gp] = null;
      for (; F === hm; ) hm = yl[--bl], yl[bl] = null, au = yl[--bl], yl[bl] = null, ou = yl[--bl], yl[bl] = null;
    }
    var zs = null, Us = null, Oi = false, sc = null;
    function hN(F, _) {
      var R = Cl(5, null, null, 0);
      R.elementType = "DELETED", R.stateNode = _, R.return = F, _ = F.deletions, _ === null ? (F.deletions = [
        R
      ], F.flags |= 16) : _.push(R);
    }
    function fN(F, _) {
      switch (F.tag) {
        case 5:
          var R = F.type;
          return _ = _.nodeType !== 1 || R.toLowerCase() !== _.nodeName.toLowerCase() ? null : _, _ !== null ? (F.stateNode = _, zs = F, Us = Th(_.firstChild), true) : false;
        case 6:
          return _ = F.pendingProps === "" || _.nodeType !== 3 ? null : _, _ !== null ? (F.stateNode = _, zs = F, Us = null, true) : false;
        case 13:
          return _ = _.nodeType !== 8 ? null : _, _ !== null ? (R = hm !== null ? {
            id: ou,
            overflow: au
          } : null, F.memoizedState = {
            dehydrated: _,
            treeContext: R,
            retryLane: 1073741824
          }, R = Cl(18, null, null, 0), R.stateNode = _, R.return = F, F.child = R, zs = F, Us = null, true) : false;
        default:
          return false;
      }
    }
    function F6(F) {
      return (F.mode & 1) !== 0 && (F.flags & 128) === 0;
    }
    function v6(F) {
      if (Oi) {
        var _ = Us;
        if (_) {
          var R = _;
          if (!fN(F, _)) {
            if (F6(F)) throw Error(n(418));
            _ = Th(R.nextSibling);
            var P = zs;
            _ && fN(F, _) ? hN(P, R) : (F.flags = F.flags & -4097 | 2, Oi = false, zs = F);
          }
        } else {
          if (F6(F)) throw Error(n(418));
          F.flags = F.flags & -4097 | 2, Oi = false, zs = F;
        }
      }
    }
    function mN(F) {
      for (F = F.return; F !== null && F.tag !== 5 && F.tag !== 3 && F.tag !== 13; ) F = F.return;
      zs = F;
    }
    function ix(F) {
      if (F !== zs) return false;
      if (!Oi) return mN(F), Oi = true, false;
      var _;
      if ((_ = F.tag !== 3) && !(_ = F.tag !== 5) && (_ = F.type, _ = _ !== "head" && _ !== "body" && !c6(F.type, F.memoizedProps)), _ && (_ = Us)) {
        if (F6(F)) throw gN(), Error(n(418));
        for (; _; ) hN(F, _), _ = Th(_.nextSibling);
      }
      if (mN(F), F.tag === 13) {
        if (F = F.memoizedState, F = F !== null ? F.dehydrated : null, !F) throw Error(n(317));
        e: {
          for (F = F.nextSibling, _ = 0; F; ) {
            if (F.nodeType === 8) {
              var R = F.data;
              if (R === "/$") {
                if (_ === 0) {
                  Us = Th(F.nextSibling);
                  break e;
                }
                _--;
              } else R !== "$" && R !== "$!" && R !== "$?" || _++;
            }
            F = F.nextSibling;
          }
          Us = null;
        }
      } else Us = zs ? Th(F.stateNode.nextSibling) : null;
      return true;
    }
    function gN() {
      for (var F = Us; F; ) F = Th(F.nextSibling);
    }
    function Yp() {
      Us = zs = null, Oi = false;
    }
    function _6(F) {
      sc === null ? sc = [
        F
      ] : sc.push(F);
    }
    var Vpe = k.ReactCurrentBatchConfig;
    function Bv(F, _, R) {
      if (F = R.ref, F !== null && typeof F != "function" && typeof F != "object") {
        if (R._owner) {
          if (R = R._owner, R) {
            if (R.tag !== 1) throw Error(n(309));
            var P = R.stateNode;
          }
          if (!P) throw Error(n(147, F));
          var W = P, J = "" + F;
          return _ !== null && _.ref !== null && typeof _.ref == "function" && _.ref._stringRef === J ? _.ref : (_ = function(pe) {
            var Se = W.refs;
            pe === null ? delete Se[J] : Se[J] = pe;
          }, _._stringRef = J, _);
        }
        if (typeof F != "string") throw Error(n(284));
        if (!R._owner) throw Error(n(290, F));
      }
      return F;
    }
    function ox(F, _) {
      throw F = Object.prototype.toString.call(_), Error(n(31, F === "[object Object]" ? "object with keys {" + Object.keys(_).join(", ") + "}" : F));
    }
    function pN(F) {
      var _ = F._init;
      return _(F._payload);
    }
    function FN(F) {
      function _(Je, ze) {
        if (F) {
          var et = Je.deletions;
          et === null ? (Je.deletions = [
            ze
          ], Je.flags |= 16) : et.push(ze);
        }
      }
      function R(Je, ze) {
        if (!F) return null;
        for (; ze !== null; ) _(Je, ze), ze = ze.sibling;
        return null;
      }
      function P(Je, ze) {
        for (Je = /* @__PURE__ */ new Map(); ze !== null; ) ze.key !== null ? Je.set(ze.key, ze) : Je.set(ze.index, ze), ze = ze.sibling;
        return Je;
      }
      function W(Je, ze) {
        return Je = Uh(Je, ze), Je.index = 0, Je.sibling = null, Je;
      }
      function J(Je, ze, et) {
        return Je.index = et, F ? (et = Je.alternate, et !== null ? (et = et.index, et < ze ? (Je.flags |= 2, ze) : et) : (Je.flags |= 2, ze)) : (Je.flags |= 1048576, ze);
      }
      function pe(Je) {
        return F && Je.alternate === null && (Je.flags |= 2), Je;
      }
      function Se(Je, ze, et, Qt) {
        return ze === null || ze.tag !== 6 ? (ze = dj(et, Je.mode, Qt), ze.return = Je, ze) : (ze = W(ze, et), ze.return = Je, ze);
      }
      function Pe(Je, ze, et, Qt) {
        var zn = et.type;
        return zn === S ? Nt(Je, ze, et.props.children, Qt, et.key) : ze !== null && (ze.elementType === zn || typeof zn == "object" && zn !== null && zn.$$typeof === N && pN(zn) === ze.type) ? (Qt = W(ze, et.props), Qt.ref = Bv(Je, ze, et), Qt.return = Je, Qt) : (Qt = jx(et.type, et.key, et.props, null, Je.mode, Qt), Qt.ref = Bv(Je, ze, et), Qt.return = Je, Qt);
      }
      function at(Je, ze, et, Qt) {
        return ze === null || ze.tag !== 4 || ze.stateNode.containerInfo !== et.containerInfo || ze.stateNode.implementation !== et.implementation ? (ze = uj(et, Je.mode, Qt), ze.return = Je, ze) : (ze = W(ze, et.children || []), ze.return = Je, ze);
      }
      function Nt(Je, ze, et, Qt, zn) {
        return ze === null || ze.tag !== 7 ? (ze = bm(et, Je.mode, Qt, zn), ze.return = Je, ze) : (ze = W(ze, et), ze.return = Je, ze);
      }
      function Wt(Je, ze, et) {
        if (typeof ze == "string" && ze !== "" || typeof ze == "number") return ze = dj("" + ze, Je.mode, et), ze.return = Je, ze;
        if (typeof ze == "object" && ze !== null) {
          switch (ze.$$typeof) {
            case C:
              return et = jx(ze.type, ze.key, ze.props, null, Je.mode, et), et.ref = Bv(Je, null, ze), et.return = Je, et;
            case x:
              return ze = uj(ze, Je.mode, et), ze.return = Je, ze;
            case N:
              var Qt = ze._init;
              return Wt(Je, Qt(ze._payload), et);
          }
          if (Ne(ze) || V(ze)) return ze = bm(ze, Je.mode, et, null), ze.return = Je, ze;
          ox(Je, ze);
        }
        return null;
      }
      function Ot(Je, ze, et, Qt) {
        var zn = ze !== null ? ze.key : null;
        if (typeof et == "string" && et !== "" || typeof et == "number") return zn !== null ? null : Se(Je, ze, "" + et, Qt);
        if (typeof et == "object" && et !== null) {
          switch (et.$$typeof) {
            case C:
              return et.key === zn ? Pe(Je, ze, et, Qt) : null;
            case x:
              return et.key === zn ? at(Je, ze, et, Qt) : null;
            case N:
              return zn = et._init, Ot(Je, ze, zn(et._payload), Qt);
          }
          if (Ne(et) || V(et)) return zn !== null ? null : Nt(Je, ze, et, Qt, null);
          ox(Je, et);
        }
        return null;
      }
      function Dn(Je, ze, et, Qt, zn) {
        if (typeof Qt == "string" && Qt !== "" || typeof Qt == "number") return Je = Je.get(et) || null, Se(ze, Je, "" + Qt, zn);
        if (typeof Qt == "object" && Qt !== null) {
          switch (Qt.$$typeof) {
            case C:
              return Je = Je.get(Qt.key === null ? et : Qt.key) || null, Pe(ze, Je, Qt, zn);
            case x:
              return Je = Je.get(Qt.key === null ? et : Qt.key) || null, at(ze, Je, Qt, zn);
            case N:
              var Gn = Qt._init;
              return Dn(Je, ze, et, Gn(Qt._payload), zn);
          }
          if (Ne(Qt) || V(Qt)) return Je = Je.get(et) || null, Nt(ze, Je, Qt, zn, null);
          ox(ze, Qt);
        }
        return null;
      }
      function An(Je, ze, et, Qt) {
        for (var zn = null, Gn = null, Yn = ze, rr = ze = 0, ea = null; Yn !== null && rr < et.length; rr++) {
          Yn.index > rr ? (ea = Yn, Yn = null) : ea = Yn.sibling;
          var Gr = Ot(Je, Yn, et[rr], Qt);
          if (Gr === null) {
            Yn === null && (Yn = ea);
            break;
          }
          F && Yn && Gr.alternate === null && _(Je, Yn), ze = J(Gr, ze, rr), Gn === null ? zn = Gr : Gn.sibling = Gr, Gn = Gr, Yn = ea;
        }
        if (rr === et.length) return R(Je, Yn), Oi && fm(Je, rr), zn;
        if (Yn === null) {
          for (; rr < et.length; rr++) Yn = Wt(Je, et[rr], Qt), Yn !== null && (ze = J(Yn, ze, rr), Gn === null ? zn = Yn : Gn.sibling = Yn, Gn = Yn);
          return Oi && fm(Je, rr), zn;
        }
        for (Yn = P(Je, Yn); rr < et.length; rr++) ea = Dn(Yn, Je, rr, et[rr], Qt), ea !== null && (F && ea.alternate !== null && Yn.delete(ea.key === null ? rr : ea.key), ze = J(ea, ze, rr), Gn === null ? zn = ea : Gn.sibling = ea, Gn = ea);
        return F && Yn.forEach(function(Vh) {
          return _(Je, Vh);
        }), Oi && fm(Je, rr), zn;
      }
      function Ln(Je, ze, et, Qt) {
        var zn = V(et);
        if (typeof zn != "function") throw Error(n(150));
        if (et = zn.call(et), et == null) throw Error(n(151));
        for (var Gn = zn = null, Yn = ze, rr = ze = 0, ea = null, Gr = et.next(); Yn !== null && !Gr.done; rr++, Gr = et.next()) {
          Yn.index > rr ? (ea = Yn, Yn = null) : ea = Yn.sibling;
          var Vh = Ot(Je, Yn, Gr.value, Qt);
          if (Vh === null) {
            Yn === null && (Yn = ea);
            break;
          }
          F && Yn && Vh.alternate === null && _(Je, Yn), ze = J(Vh, ze, rr), Gn === null ? zn = Vh : Gn.sibling = Vh, Gn = Vh, Yn = ea;
        }
        if (Gr.done) return R(Je, Yn), Oi && fm(Je, rr), zn;
        if (Yn === null) {
          for (; !Gr.done; rr++, Gr = et.next()) Gr = Wt(Je, Gr.value, Qt), Gr !== null && (ze = J(Gr, ze, rr), Gn === null ? zn = Gr : Gn.sibling = Gr, Gn = Gr);
          return Oi && fm(Je, rr), zn;
        }
        for (Yn = P(Je, Yn); !Gr.done; rr++, Gr = et.next()) Gr = Dn(Yn, Je, rr, Gr.value, Qt), Gr !== null && (F && Gr.alternate !== null && Yn.delete(Gr.key === null ? rr : Gr.key), ze = J(Gr, ze, rr), Gn === null ? zn = Gr : Gn.sibling = Gr, Gn = Gr);
        return F && Yn.forEach(function(b0e) {
          return _(Je, b0e);
        }), Oi && fm(Je, rr), zn;
      }
      function mo(Je, ze, et, Qt) {
        if (typeof et == "object" && et !== null && et.type === S && et.key === null && (et = et.props.children), typeof et == "object" && et !== null) {
          switch (et.$$typeof) {
            case C:
              e: {
                for (var zn = et.key, Gn = ze; Gn !== null; ) {
                  if (Gn.key === zn) {
                    if (zn = et.type, zn === S) {
                      if (Gn.tag === 7) {
                        R(Je, Gn.sibling), ze = W(Gn, et.props.children), ze.return = Je, Je = ze;
                        break e;
                      }
                    } else if (Gn.elementType === zn || typeof zn == "object" && zn !== null && zn.$$typeof === N && pN(zn) === Gn.type) {
                      R(Je, Gn.sibling), ze = W(Gn, et.props), ze.ref = Bv(Je, Gn, et), ze.return = Je, Je = ze;
                      break e;
                    }
                    R(Je, Gn);
                    break;
                  } else _(Je, Gn);
                  Gn = Gn.sibling;
                }
                et.type === S ? (ze = bm(et.props.children, Je.mode, Qt, et.key), ze.return = Je, Je = ze) : (Qt = jx(et.type, et.key, et.props, null, Je.mode, Qt), Qt.ref = Bv(Je, ze, et), Qt.return = Je, Je = Qt);
              }
              return pe(Je);
            case x:
              e: {
                for (Gn = et.key; ze !== null; ) {
                  if (ze.key === Gn) if (ze.tag === 4 && ze.stateNode.containerInfo === et.containerInfo && ze.stateNode.implementation === et.implementation) {
                    R(Je, ze.sibling), ze = W(ze, et.children || []), ze.return = Je, Je = ze;
                    break e;
                  } else {
                    R(Je, ze);
                    break;
                  }
                  else _(Je, ze);
                  ze = ze.sibling;
                }
                ze = uj(et, Je.mode, Qt), ze.return = Je, Je = ze;
              }
              return pe(Je);
            case N:
              return Gn = et._init, mo(Je, ze, Gn(et._payload), Qt);
          }
          if (Ne(et)) return An(Je, ze, et, Qt);
          if (V(et)) return Ln(Je, ze, et, Qt);
          ox(Je, et);
        }
        return typeof et == "string" && et !== "" || typeof et == "number" ? (et = "" + et, ze !== null && ze.tag === 6 ? (R(Je, ze.sibling), ze = W(ze, et), ze.return = Je, Je = ze) : (R(Je, ze), ze = dj(et, Je.mode, Qt), ze.return = Je, Je = ze), pe(Je)) : R(Je, ze);
      }
      return mo;
    }
    var Zp = FN(true), vN = FN(false), ax = Rh(null), sx = null, Jp = null, y6 = null;
    function b6() {
      y6 = Jp = sx = null;
    }
    function x6(F) {
      var _ = ax.current;
      Ri(ax), F._currentValue = _;
    }
    function w6(F, _, R) {
      for (; F !== null; ) {
        var P = F.alternate;
        if ((F.childLanes & _) !== _ ? (F.childLanes |= _, P !== null && (P.childLanes |= _)) : P !== null && (P.childLanes & _) !== _ && (P.childLanes |= _), F === R) break;
        F = F.return;
      }
    }
    function Xp(F, _) {
      sx = F, y6 = Jp = null, F = F.dependencies, F !== null && F.firstContext !== null && ((F.lanes & _) !== 0 && (_s4 = true), F.firstContext = null);
    }
    function xl(F) {
      var _ = F._currentValue;
      if (y6 !== F) if (F = {
        context: F,
        memoizedValue: _,
        next: null
      }, Jp === null) {
        if (sx === null) throw Error(n(308));
        Jp = F, sx.dependencies = {
          lanes: 0,
          firstContext: F
        };
      } else Jp = Jp.next = F;
      return _;
    }
    var mm = null;
    function D6(F) {
      mm === null ? mm = [
        F
      ] : mm.push(F);
    }
    function _N(F, _, R, P) {
      var W = _.interleaved;
      return W === null ? (R.next = R, D6(_)) : (R.next = W.next, W.next = R), _.interleaved = R, su(F, P);
    }
    function su(F, _) {
      F.lanes |= _;
      var R = F.alternate;
      for (R !== null && (R.lanes |= _), R = F, F = F.return; F !== null; ) F.childLanes |= _, R = F.alternate, R !== null && (R.childLanes |= _), R = F, F = F.return;
      return R.tag === 3 ? R.stateNode : null;
    }
    var Bh = false;
    function C6(F) {
      F.updateQueue = {
        baseState: F.memoizedState,
        firstBaseUpdate: null,
        lastBaseUpdate: null,
        shared: {
          pending: null,
          interleaved: null,
          lanes: 0
        },
        effects: null
      };
    }
    function yN(F, _) {
      F = F.updateQueue, _.updateQueue === F && (_.updateQueue = {
        baseState: F.baseState,
        firstBaseUpdate: F.firstBaseUpdate,
        lastBaseUpdate: F.lastBaseUpdate,
        shared: F.shared,
        effects: F.effects
      });
    }
    function lu(F, _) {
      return {
        eventTime: F,
        lane: _,
        tag: 0,
        payload: null,
        callback: null,
        next: null
      };
    }
    function Ph(F, _, R) {
      var P = F.updateQueue;
      if (P === null) return null;
      if (P = P.shared, (Wr & 2) !== 0) {
        var W = P.pending;
        return W === null ? _.next = _ : (_.next = W.next, W.next = _), P.pending = _, su(F, R);
      }
      return W = P.interleaved, W === null ? (_.next = _, D6(P)) : (_.next = W.next, W.next = _), P.interleaved = _, su(F, R);
    }
    function lx(F, _, R) {
      if (_ = _.updateQueue, _ !== null && (_ = _.shared, (R & 4194240) !== 0)) {
        var P = _.lanes;
        P &= F.pendingLanes, R |= P, _.lanes = R, NS(F, R);
      }
    }
    function bN(F, _) {
      var R = F.updateQueue, P = F.alternate;
      if (P !== null && (P = P.updateQueue, R === P)) {
        var W = null, J = null;
        if (R = R.firstBaseUpdate, R !== null) {
          do {
            var pe = {
              eventTime: R.eventTime,
              lane: R.lane,
              tag: R.tag,
              payload: R.payload,
              callback: R.callback,
              next: null
            };
            J === null ? W = J = pe : J = J.next = pe, R = R.next;
          } while (R !== null);
          J === null ? W = J = _ : J = J.next = _;
        } else W = J = _;
        R = {
          baseState: P.baseState,
          firstBaseUpdate: W,
          lastBaseUpdate: J,
          shared: P.shared,
          effects: P.effects
        }, F.updateQueue = R;
        return;
      }
      F = R.lastBaseUpdate, F === null ? R.firstBaseUpdate = _ : F.next = _, R.lastBaseUpdate = _;
    }
    function cx(F, _, R, P) {
      var W = F.updateQueue;
      Bh = false;
      var J = W.firstBaseUpdate, pe = W.lastBaseUpdate, Se = W.shared.pending;
      if (Se !== null) {
        W.shared.pending = null;
        var Pe = Se, at = Pe.next;
        Pe.next = null, pe === null ? J = at : pe.next = at, pe = Pe;
        var Nt = F.alternate;
        Nt !== null && (Nt = Nt.updateQueue, Se = Nt.lastBaseUpdate, Se !== pe && (Se === null ? Nt.firstBaseUpdate = at : Se.next = at, Nt.lastBaseUpdate = Pe));
      }
      if (J !== null) {
        var Wt = W.baseState;
        pe = 0, Nt = at = Pe = null, Se = J;
        do {
          var Ot = Se.lane, Dn = Se.eventTime;
          if ((P & Ot) === Ot) {
            Nt !== null && (Nt = Nt.next = {
              eventTime: Dn,
              lane: 0,
              tag: Se.tag,
              payload: Se.payload,
              callback: Se.callback,
              next: null
            });
            e: {
              var An = F, Ln = Se;
              switch (Ot = _, Dn = R, Ln.tag) {
                case 1:
                  if (An = Ln.payload, typeof An == "function") {
                    Wt = An.call(Dn, Wt, Ot);
                    break e;
                  }
                  Wt = An;
                  break e;
                case 3:
                  An.flags = An.flags & -65537 | 128;
                case 0:
                  if (An = Ln.payload, Ot = typeof An == "function" ? An.call(Dn, Wt, Ot) : An, Ot == null) break e;
                  Wt = Z({}, Wt, Ot);
                  break e;
                case 2:
                  Bh = true;
              }
            }
            Se.callback !== null && Se.lane !== 0 && (F.flags |= 64, Ot = W.effects, Ot === null ? W.effects = [
              Se
            ] : Ot.push(Se));
          } else Dn = {
            eventTime: Dn,
            lane: Ot,
            tag: Se.tag,
            payload: Se.payload,
            callback: Se.callback,
            next: null
          }, Nt === null ? (at = Nt = Dn, Pe = Wt) : Nt = Nt.next = Dn, pe |= Ot;
          if (Se = Se.next, Se === null) {
            if (Se = W.shared.pending, Se === null) break;
            Ot = Se, Se = Ot.next, Ot.next = null, W.lastBaseUpdate = Ot, W.shared.pending = null;
          }
        } while (true);
        if (Nt === null && (Pe = Wt), W.baseState = Pe, W.firstBaseUpdate = at, W.lastBaseUpdate = Nt, _ = W.shared.interleaved, _ !== null) {
          W = _;
          do
            pe |= W.lane, W = W.next;
          while (W !== _);
        } else J === null && (W.shared.lanes = 0);
        Fm |= pe, F.lanes = pe, F.memoizedState = Wt;
      }
    }
    function xN(F, _, R) {
      if (F = _.effects, _.effects = null, F !== null) for (_ = 0; _ < F.length; _++) {
        var P = F[_], W = P.callback;
        if (W !== null) {
          if (P.callback = null, P = R, typeof W != "function") throw Error(n(191, W));
          W.call(P);
        }
      }
    }
    var Pv = {}, ad = Rh(Pv), Mv = Rh(Pv), Ov = Rh(Pv);
    function gm(F) {
      if (F === Pv) throw Error(n(174));
      return F;
    }
    function E6(F, _) {
      switch (Ci(Ov, _), Ci(Mv, F), Ci(ad, Pv), F = _.nodeType, F) {
        case 9:
        case 11:
          _ = (_ = _.documentElement) ? _.namespaceURI : bt(null, "");
          break;
        default:
          F = F === 8 ? _.parentNode : _, _ = F.namespaceURI || null, F = F.tagName, _ = bt(_, F);
      }
      Ri(ad), Ci(ad, _);
    }
    function Qp() {
      Ri(ad), Ri(Mv), Ri(Ov);
    }
    function wN(F) {
      gm(Ov.current);
      var _ = gm(ad.current), R = bt(_, F.type);
      _ !== R && (Ci(Mv, F), Ci(ad, R));
    }
    function k6(F) {
      Mv.current === F && (Ri(ad), Ri(Mv));
    }
    var Gi = Rh(0);
    function dx(F) {
      for (var _ = F; _ !== null; ) {
        if (_.tag === 13) {
          var R = _.memoizedState;
          if (R !== null && (R = R.dehydrated, R === null || R.data === "$?" || R.data === "$!")) return _;
        } else if (_.tag === 19 && _.memoizedProps.revealOrder !== void 0) {
          if ((_.flags & 128) !== 0) return _;
        } else if (_.child !== null) {
          _.child.return = _, _ = _.child;
          continue;
        }
        if (_ === F) break;
        for (; _.sibling === null; ) {
          if (_.return === null || _.return === F) return null;
          _ = _.return;
        }
        _.sibling.return = _.return, _ = _.sibling;
      }
      return null;
    }
    var S6 = [];
    function j6() {
      for (var F = 0; F < S6.length; F++) S6[F]._workInProgressVersionPrimary = null;
      S6.length = 0;
    }
    var ux = k.ReactCurrentDispatcher, T6 = k.ReactCurrentBatchConfig, pm = 0, Yi = null, Oo = null, Xo = null, hx = false, Lv = false, Nv = 0, Hpe = 0;
    function Ra() {
      throw Error(n(321));
    }
    function R6(F, _) {
      if (_ === null) return false;
      for (var R = 0; R < _.length && R < F.length; R++) if (!ac(F[R], _[R])) return false;
      return true;
    }
    function A6(F, _, R, P, W, J) {
      if (pm = J, Yi = _, _.memoizedState = null, _.updateQueue = null, _.lanes = 0, ux.current = F === null || F.memoizedState === null ? Kpe : Gpe, F = R(P, W), Lv) {
        J = 0;
        do {
          if (Lv = false, Nv = 0, 25 <= J) throw Error(n(301));
          J += 1, Xo = Oo = null, _.updateQueue = null, ux.current = Ype, F = R(P, W);
        } while (Lv);
      }
      if (ux.current = gx, _ = Oo !== null && Oo.next !== null, pm = 0, Xo = Oo = Yi = null, hx = false, _) throw Error(n(300));
      return F;
    }
    function I6() {
      var F = Nv !== 0;
      return Nv = 0, F;
    }
    function sd() {
      var F = {
        memoizedState: null,
        baseState: null,
        baseQueue: null,
        queue: null,
        next: null
      };
      return Xo === null ? Yi.memoizedState = Xo = F : Xo = Xo.next = F, Xo;
    }
    function wl() {
      if (Oo === null) {
        var F = Yi.alternate;
        F = F !== null ? F.memoizedState : null;
      } else F = Oo.next;
      var _ = Xo === null ? Yi.memoizedState : Xo.next;
      if (_ !== null) Xo = _, Oo = F;
      else {
        if (F === null) throw Error(n(310));
        Oo = F, F = {
          memoizedState: Oo.memoizedState,
          baseState: Oo.baseState,
          baseQueue: Oo.baseQueue,
          queue: Oo.queue,
          next: null
        }, Xo === null ? Yi.memoizedState = Xo = F : Xo = Xo.next = F;
      }
      return Xo;
    }
    function zv(F, _) {
      return typeof _ == "function" ? _(F) : _;
    }
    function B6(F) {
      var _ = wl(), R = _.queue;
      if (R === null) throw Error(n(311));
      R.lastRenderedReducer = F;
      var P = Oo, W = P.baseQueue, J = R.pending;
      if (J !== null) {
        if (W !== null) {
          var pe = W.next;
          W.next = J.next, J.next = pe;
        }
        P.baseQueue = W = J, R.pending = null;
      }
      if (W !== null) {
        J = W.next, P = P.baseState;
        var Se = pe = null, Pe = null, at = J;
        do {
          var Nt = at.lane;
          if ((pm & Nt) === Nt) Pe !== null && (Pe = Pe.next = {
            lane: 0,
            action: at.action,
            hasEagerState: at.hasEagerState,
            eagerState: at.eagerState,
            next: null
          }), P = at.hasEagerState ? at.eagerState : F(P, at.action);
          else {
            var Wt = {
              lane: Nt,
              action: at.action,
              hasEagerState: at.hasEagerState,
              eagerState: at.eagerState,
              next: null
            };
            Pe === null ? (Se = Pe = Wt, pe = P) : Pe = Pe.next = Wt, Yi.lanes |= Nt, Fm |= Nt;
          }
          at = at.next;
        } while (at !== null && at !== J);
        Pe === null ? pe = P : Pe.next = Se, ac(P, _.memoizedState) || (_s4 = true), _.memoizedState = P, _.baseState = pe, _.baseQueue = Pe, R.lastRenderedState = P;
      }
      if (F = R.interleaved, F !== null) {
        W = F;
        do
          J = W.lane, Yi.lanes |= J, Fm |= J, W = W.next;
        while (W !== F);
      } else W === null && (R.lanes = 0);
      return [
        _.memoizedState,
        R.dispatch
      ];
    }
    function P6(F) {
      var _ = wl(), R = _.queue;
      if (R === null) throw Error(n(311));
      R.lastRenderedReducer = F;
      var P = R.dispatch, W = R.pending, J = _.memoizedState;
      if (W !== null) {
        R.pending = null;
        var pe = W = W.next;
        do
          J = F(J, pe.action), pe = pe.next;
        while (pe !== W);
        ac(J, _.memoizedState) || (_s4 = true), _.memoizedState = J, _.baseQueue === null && (_.baseState = J), R.lastRenderedState = J;
      }
      return [
        J,
        P
      ];
    }
    function DN() {
    }
    function CN(F, _) {
      var R = Yi, P = wl(), W = _(), J = !ac(P.memoizedState, W);
      if (J && (P.memoizedState = W, _s4 = true), P = P.queue, M6(SN.bind(null, R, P, F), [
        F
      ]), P.getSnapshot !== _ || J || Xo !== null && Xo.memoizedState.tag & 1) {
        if (R.flags |= 2048, Uv(9, kN.bind(null, R, P, W, _), void 0, null), Qo === null) throw Error(n(349));
        (pm & 30) !== 0 || EN(R, _, W);
      }
      return W;
    }
    function EN(F, _, R) {
      F.flags |= 16384, F = {
        getSnapshot: _,
        value: R
      }, _ = Yi.updateQueue, _ === null ? (_ = {
        lastEffect: null,
        stores: null
      }, Yi.updateQueue = _, _.stores = [
        F
      ]) : (R = _.stores, R === null ? _.stores = [
        F
      ] : R.push(F));
    }
    function kN(F, _, R, P) {
      _.value = R, _.getSnapshot = P, jN(_) && TN(F);
    }
    function SN(F, _, R) {
      return R(function() {
        jN(_) && TN(F);
      });
    }
    function jN(F) {
      var _ = F.getSnapshot;
      F = F.value;
      try {
        var R = _();
        return !ac(F, R);
      } catch {
        return true;
      }
    }
    function TN(F) {
      var _ = su(F, 1);
      _ !== null && uc(_, F, 1, -1);
    }
    function RN(F) {
      var _ = sd();
      return typeof F == "function" && (F = F()), _.memoizedState = _.baseState = F, F = {
        pending: null,
        interleaved: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: zv,
        lastRenderedState: F
      }, _.queue = F, F = F.dispatch = qpe.bind(null, Yi, F), [
        _.memoizedState,
        F
      ];
    }
    function Uv(F, _, R, P) {
      return F = {
        tag: F,
        create: _,
        destroy: R,
        deps: P,
        next: null
      }, _ = Yi.updateQueue, _ === null ? (_ = {
        lastEffect: null,
        stores: null
      }, Yi.updateQueue = _, _.lastEffect = F.next = F) : (R = _.lastEffect, R === null ? _.lastEffect = F.next = F : (P = R.next, R.next = F, F.next = P, _.lastEffect = F)), F;
    }
    function AN() {
      return wl().memoizedState;
    }
    function fx(F, _, R, P) {
      var W = sd();
      Yi.flags |= F, W.memoizedState = Uv(1 | _, R, void 0, P === void 0 ? null : P);
    }
    function mx(F, _, R, P) {
      var W = wl();
      P = P === void 0 ? null : P;
      var J = void 0;
      if (Oo !== null) {
        var pe = Oo.memoizedState;
        if (J = pe.destroy, P !== null && R6(P, pe.deps)) {
          W.memoizedState = Uv(_, R, J, P);
          return;
        }
      }
      Yi.flags |= F, W.memoizedState = Uv(1 | _, R, J, P);
    }
    function IN(F, _) {
      return fx(8390656, 8, F, _);
    }
    function M6(F, _) {
      return mx(2048, 8, F, _);
    }
    function BN(F, _) {
      return mx(4, 2, F, _);
    }
    function PN(F, _) {
      return mx(4, 4, F, _);
    }
    function MN(F, _) {
      if (typeof _ == "function") return F = F(), _(F), function() {
        _(null);
      };
      if (_ != null) return F = F(), _.current = F, function() {
        _.current = null;
      };
    }
    function ON(F, _, R) {
      return R = R != null ? R.concat([
        F
      ]) : null, mx(4, 4, MN.bind(null, _, F), R);
    }
    function O6() {
    }
    function LN(F, _) {
      var R = wl();
      _ = _ === void 0 ? null : _;
      var P = R.memoizedState;
      return P !== null && _ !== null && R6(_, P[1]) ? P[0] : (R.memoizedState = [
        F,
        _
      ], F);
    }
    function NN(F, _) {
      var R = wl();
      _ = _ === void 0 ? null : _;
      var P = R.memoizedState;
      return P !== null && _ !== null && R6(_, P[1]) ? P[0] : (F = F(), R.memoizedState = [
        F,
        _
      ], F);
    }
    function zN(F, _, R) {
      return (pm & 21) === 0 ? (F.baseState && (F.baseState = false, _s4 = true), F.memoizedState = R) : (ac(R, _) || (R = pL(), Yi.lanes |= R, Fm |= R, F.baseState = true), _);
    }
    function $pe(F, _) {
      var R = li;
      li = R !== 0 && 4 > R ? R : 4, F(true);
      var P = T6.transition;
      T6.transition = {};
      try {
        F(false), _();
      } finally {
        li = R, T6.transition = P;
      }
    }
    function UN() {
      return wl().memoizedState;
    }
    function Wpe(F, _, R) {
      var P = Nh(F);
      if (R = {
        lane: P,
        action: R,
        hasEagerState: false,
        eagerState: null,
        next: null
      }, VN(F)) HN(_, R);
      else if (R = _N(F, _, R, P), R !== null) {
        var W = Xa();
        uc(R, F, P, W), $N(R, _, P);
      }
    }
    function qpe(F, _, R) {
      var P = Nh(F), W = {
        lane: P,
        action: R,
        hasEagerState: false,
        eagerState: null,
        next: null
      };
      if (VN(F)) HN(_, W);
      else {
        var J = F.alternate;
        if (F.lanes === 0 && (J === null || J.lanes === 0) && (J = _.lastRenderedReducer, J !== null)) try {
          var pe = _.lastRenderedState, Se = J(pe, R);
          if (W.hasEagerState = true, W.eagerState = Se, ac(Se, pe)) {
            var Pe = _.interleaved;
            Pe === null ? (W.next = W, D6(_)) : (W.next = Pe.next, Pe.next = W), _.interleaved = W;
            return;
          }
        } catch {
        }
        R = _N(F, _, W, P), R !== null && (W = Xa(), uc(R, F, P, W), $N(R, _, P));
      }
    }
    function VN(F) {
      var _ = F.alternate;
      return F === Yi || _ !== null && _ === Yi;
    }
    function HN(F, _) {
      Lv = hx = true;
      var R = F.pending;
      R === null ? _.next = _ : (_.next = R.next, R.next = _), F.pending = _;
    }
    function $N(F, _, R) {
      if ((R & 4194240) !== 0) {
        var P = _.lanes;
        P &= F.pendingLanes, R |= P, _.lanes = R, NS(F, R);
      }
    }
    var gx = {
      readContext: xl,
      useCallback: Ra,
      useContext: Ra,
      useEffect: Ra,
      useImperativeHandle: Ra,
      useInsertionEffect: Ra,
      useLayoutEffect: Ra,
      useMemo: Ra,
      useReducer: Ra,
      useRef: Ra,
      useState: Ra,
      useDebugValue: Ra,
      useDeferredValue: Ra,
      useTransition: Ra,
      useMutableSource: Ra,
      useSyncExternalStore: Ra,
      useId: Ra,
      unstable_isNewReconciler: false
    }, Kpe = {
      readContext: xl,
      useCallback: function(F, _) {
        return sd().memoizedState = [
          F,
          _ === void 0 ? null : _
        ], F;
      },
      useContext: xl,
      useEffect: IN,
      useImperativeHandle: function(F, _, R) {
        return R = R != null ? R.concat([
          F
        ]) : null, fx(4194308, 4, MN.bind(null, _, F), R);
      },
      useLayoutEffect: function(F, _) {
        return fx(4194308, 4, F, _);
      },
      useInsertionEffect: function(F, _) {
        return fx(4, 2, F, _);
      },
      useMemo: function(F, _) {
        var R = sd();
        return _ = _ === void 0 ? null : _, F = F(), R.memoizedState = [
          F,
          _
        ], F;
      },
      useReducer: function(F, _, R) {
        var P = sd();
        return _ = R !== void 0 ? R(_) : _, P.memoizedState = P.baseState = _, F = {
          pending: null,
          interleaved: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: F,
          lastRenderedState: _
        }, P.queue = F, F = F.dispatch = Wpe.bind(null, Yi, F), [
          P.memoizedState,
          F
        ];
      },
      useRef: function(F) {
        var _ = sd();
        return F = {
          current: F
        }, _.memoizedState = F;
      },
      useState: RN,
      useDebugValue: O6,
      useDeferredValue: function(F) {
        return sd().memoizedState = F;
      },
      useTransition: function() {
        var F = RN(false), _ = F[0];
        return F = $pe.bind(null, F[1]), sd().memoizedState = F, [
          _,
          F
        ];
      },
      useMutableSource: function() {
      },
      useSyncExternalStore: function(F, _, R) {
        var P = Yi, W = sd();
        if (Oi) {
          if (R === void 0) throw Error(n(407));
          R = R();
        } else {
          if (R = _(), Qo === null) throw Error(n(349));
          (pm & 30) !== 0 || EN(P, _, R);
        }
        W.memoizedState = R;
        var J = {
          value: R,
          getSnapshot: _
        };
        return W.queue = J, IN(SN.bind(null, P, J, F), [
          F
        ]), P.flags |= 2048, Uv(9, kN.bind(null, P, J, R, _), void 0, null), R;
      },
      useId: function() {
        var F = sd(), _ = Qo.identifierPrefix;
        if (Oi) {
          var R = au, P = ou;
          R = (P & ~(1 << 32 - tr(P) - 1)).toString(32) + R, _ = ":" + _ + "R" + R, R = Nv++, 0 < R && (_ += "H" + R.toString(32)), _ += ":";
        } else R = Hpe++, _ = ":" + _ + "r" + R.toString(32) + ":";
        return F.memoizedState = _;
      },
      unstable_isNewReconciler: false
    }, Gpe = {
      readContext: xl,
      useCallback: LN,
      useContext: xl,
      useEffect: M6,
      useImperativeHandle: ON,
      useInsertionEffect: BN,
      useLayoutEffect: PN,
      useMemo: NN,
      useReducer: B6,
      useRef: AN,
      useState: function() {
        return B6(zv);
      },
      useDebugValue: O6,
      useDeferredValue: function(F) {
        var _ = wl();
        return zN(_, Oo.memoizedState, F);
      },
      useTransition: function() {
        var F = B6(zv)[0], _ = wl().memoizedState;
        return [
          F,
          _
        ];
      },
      useMutableSource: DN,
      useSyncExternalStore: CN,
      useId: UN,
      unstable_isNewReconciler: false
    }, Ype = {
      readContext: xl,
      useCallback: LN,
      useContext: xl,
      useEffect: M6,
      useImperativeHandle: ON,
      useInsertionEffect: BN,
      useLayoutEffect: PN,
      useMemo: NN,
      useReducer: P6,
      useRef: AN,
      useState: function() {
        return P6(zv);
      },
      useDebugValue: O6,
      useDeferredValue: function(F) {
        var _ = wl();
        return Oo === null ? _.memoizedState = F : zN(_, Oo.memoizedState, F);
      },
      useTransition: function() {
        var F = P6(zv)[0], _ = wl().memoizedState;
        return [
          F,
          _
        ];
      },
      useMutableSource: DN,
      useSyncExternalStore: CN,
      useId: UN,
      unstable_isNewReconciler: false
    };
    function lc(F, _) {
      if (F && F.defaultProps) {
        _ = Z({}, _), F = F.defaultProps;
        for (var R in F) _[R] === void 0 && (_[R] = F[R]);
        return _;
      }
      return _;
    }
    function L6(F, _, R, P) {
      _ = F.memoizedState, R = R(P, _), R = R == null ? _ : Z({}, _, R), F.memoizedState = R, F.lanes === 0 && (F.updateQueue.baseState = R);
    }
    var px = {
      isMounted: function(F) {
        return (F = F._reactInternals) ? It(F) === F : false;
      },
      enqueueSetState: function(F, _, R) {
        F = F._reactInternals;
        var P = Xa(), W = Nh(F), J = lu(P, W);
        J.payload = _, R != null && (J.callback = R), _ = Ph(F, J, W), _ !== null && (uc(_, F, W, P), lx(_, F, W));
      },
      enqueueReplaceState: function(F, _, R) {
        F = F._reactInternals;
        var P = Xa(), W = Nh(F), J = lu(P, W);
        J.tag = 1, J.payload = _, R != null && (J.callback = R), _ = Ph(F, J, W), _ !== null && (uc(_, F, W, P), lx(_, F, W));
      },
      enqueueForceUpdate: function(F, _) {
        F = F._reactInternals;
        var R = Xa(), P = Nh(F), W = lu(R, P);
        W.tag = 2, _ != null && (W.callback = _), _ = Ph(F, W, P), _ !== null && (uc(_, F, P, R), lx(_, F, P));
      }
    };
    function WN(F, _, R, P, W, J, pe) {
      return F = F.stateNode, typeof F.shouldComponentUpdate == "function" ? F.shouldComponentUpdate(P, J, pe) : _.prototype && _.prototype.isPureReactComponent ? !kv(R, P) || !kv(W, J) : true;
    }
    function qN(F, _, R) {
      var P = false, W = Ah, J = _.contextType;
      return typeof J == "object" && J !== null ? J = xl(J) : (W = vs(_) ? um : Ta.current, P = _.contextTypes, J = (P = P != null) ? qp(F, W) : Ah), _ = new _(R, J), F.memoizedState = _.state !== null && _.state !== void 0 ? _.state : null, _.updater = px, F.stateNode = _, _._reactInternals = F, P && (F = F.stateNode, F.__reactInternalMemoizedUnmaskedChildContext = W, F.__reactInternalMemoizedMaskedChildContext = J), _;
    }
    function KN(F, _, R, P) {
      F = _.state, typeof _.componentWillReceiveProps == "function" && _.componentWillReceiveProps(R, P), typeof _.UNSAFE_componentWillReceiveProps == "function" && _.UNSAFE_componentWillReceiveProps(R, P), _.state !== F && px.enqueueReplaceState(_, _.state, null);
    }
    function N6(F, _, R, P) {
      var W = F.stateNode;
      W.props = R, W.state = F.memoizedState, W.refs = {}, C6(F);
      var J = _.contextType;
      typeof J == "object" && J !== null ? W.context = xl(J) : (J = vs(_) ? um : Ta.current, W.context = qp(F, J)), W.state = F.memoizedState, J = _.getDerivedStateFromProps, typeof J == "function" && (L6(F, _, J, R), W.state = F.memoizedState), typeof _.getDerivedStateFromProps == "function" || typeof W.getSnapshotBeforeUpdate == "function" || typeof W.UNSAFE_componentWillMount != "function" && typeof W.componentWillMount != "function" || (_ = W.state, typeof W.componentWillMount == "function" && W.componentWillMount(), typeof W.UNSAFE_componentWillMount == "function" && W.UNSAFE_componentWillMount(), _ !== W.state && px.enqueueReplaceState(W, W.state, null), cx(F, R, W, P), W.state = F.memoizedState), typeof W.componentDidMount == "function" && (F.flags |= 4194308);
    }
    function e0(F, _) {
      try {
        var R = "", P = _;
        do
          R += de(P), P = P.return;
        while (P);
        var W = R;
      } catch (J) {
        W = `
Error generating stack: ` + J.message + `
` + J.stack;
      }
      return {
        value: F,
        source: _,
        stack: W,
        digest: null
      };
    }
    function z6(F, _, R) {
      return {
        value: F,
        source: null,
        stack: R ?? null,
        digest: _ ?? null
      };
    }
    function U6(F, _) {
      try {
        console.error(_.value);
      } catch (R) {
        setTimeout(function() {
          throw R;
        });
      }
    }
    var Zpe = typeof WeakMap == "function" ? WeakMap : Map;
    function GN(F, _, R) {
      R = lu(-1, R), R.tag = 3, R.payload = {
        element: null
      };
      var P = _.value;
      return R.callback = function() {
        wx || (wx = true, nj = P), U6(F, _);
      }, R;
    }
    function YN(F, _, R) {
      R = lu(-1, R), R.tag = 3;
      var P = F.type.getDerivedStateFromError;
      if (typeof P == "function") {
        var W = _.value;
        R.payload = function() {
          return P(W);
        }, R.callback = function() {
          U6(F, _);
        };
      }
      var J = F.stateNode;
      return J !== null && typeof J.componentDidCatch == "function" && (R.callback = function() {
        U6(F, _), typeof P != "function" && (Oh === null ? Oh = /* @__PURE__ */ new Set([
          this
        ]) : Oh.add(this));
        var pe = _.stack;
        this.componentDidCatch(_.value, {
          componentStack: pe !== null ? pe : ""
        });
      }), R;
    }
    function ZN(F, _, R) {
      var P = F.pingCache;
      if (P === null) {
        P = F.pingCache = new Zpe();
        var W = /* @__PURE__ */ new Set();
        P.set(_, W);
      } else W = P.get(_), W === void 0 && (W = /* @__PURE__ */ new Set(), P.set(_, W));
      W.has(R) || (W.add(R), F = d0e.bind(null, F, _, R), _.then(F, F));
    }
    function JN(F) {
      do {
        var _;
        if ((_ = F.tag === 13) && (_ = F.memoizedState, _ = _ !== null ? _.dehydrated !== null : true), _) return F;
        F = F.return;
      } while (F !== null);
      return null;
    }
    function XN(F, _, R, P, W) {
      return (F.mode & 1) === 0 ? (F === _ ? F.flags |= 65536 : (F.flags |= 128, R.flags |= 131072, R.flags &= -52805, R.tag === 1 && (R.alternate === null ? R.tag = 17 : (_ = lu(-1, 1), _.tag = 2, Ph(R, _, 1))), R.lanes |= 1), F) : (F.flags |= 65536, F.lanes = W, F);
    }
    var Jpe = k.ReactCurrentOwner, _s4 = false;
    function Ja(F, _, R, P) {
      _.child = F === null ? vN(_, null, R, P) : Zp(_, F.child, R, P);
    }
    function QN(F, _, R, P, W) {
      R = R.render;
      var J = _.ref;
      return Xp(_, W), P = A6(F, _, R, P, J, W), R = I6(), F !== null && !_s4 ? (_.updateQueue = F.updateQueue, _.flags &= -2053, F.lanes &= ~W, cu(F, _, W)) : (Oi && R && g6(_), _.flags |= 1, Ja(F, _, P, W), _.child);
    }
    function ez(F, _, R, P, W) {
      if (F === null) {
        var J = R.type;
        return typeof J == "function" && !cj(J) && J.defaultProps === void 0 && R.compare === null && R.defaultProps === void 0 ? (_.tag = 15, _.type = J, tz(F, _, J, P, W)) : (F = jx(R.type, null, P, _, _.mode, W), F.ref = _.ref, F.return = _, _.child = F);
      }
      if (J = F.child, (F.lanes & W) === 0) {
        var pe = J.memoizedProps;
        if (R = R.compare, R = R !== null ? R : kv, R(pe, P) && F.ref === _.ref) return cu(F, _, W);
      }
      return _.flags |= 1, F = Uh(J, P), F.ref = _.ref, F.return = _, _.child = F;
    }
    function tz(F, _, R, P, W) {
      if (F !== null) {
        var J = F.memoizedProps;
        if (kv(J, P) && F.ref === _.ref) if (_s4 = false, _.pendingProps = P = J, (F.lanes & W) !== 0) (F.flags & 131072) !== 0 && (_s4 = true);
        else return _.lanes = F.lanes, cu(F, _, W);
      }
      return V6(F, _, R, P, W);
    }
    function nz(F, _, R) {
      var P = _.pendingProps, W = P.children, J = F !== null ? F.memoizedState : null;
      if (P.mode === "hidden") if ((_.mode & 1) === 0) _.memoizedState = {
        baseLanes: 0,
        cachePool: null,
        transitions: null
      }, Ci(n0, Vs), Vs |= R;
      else {
        if ((R & 1073741824) === 0) return F = J !== null ? J.baseLanes | R : R, _.lanes = _.childLanes = 1073741824, _.memoizedState = {
          baseLanes: F,
          cachePool: null,
          transitions: null
        }, _.updateQueue = null, Ci(n0, Vs), Vs |= F, null;
        _.memoizedState = {
          baseLanes: 0,
          cachePool: null,
          transitions: null
        }, P = J !== null ? J.baseLanes : R, Ci(n0, Vs), Vs |= P;
      }
      else J !== null ? (P = J.baseLanes | R, _.memoizedState = null) : P = R, Ci(n0, Vs), Vs |= P;
      return Ja(F, _, W, R), _.child;
    }
    function rz(F, _) {
      var R = _.ref;
      (F === null && R !== null || F !== null && F.ref !== R) && (_.flags |= 512, _.flags |= 2097152);
    }
    function V6(F, _, R, P, W) {
      var J = vs(R) ? um : Ta.current;
      return J = qp(_, J), Xp(_, W), R = A6(F, _, R, P, J, W), P = I6(), F !== null && !_s4 ? (_.updateQueue = F.updateQueue, _.flags &= -2053, F.lanes &= ~W, cu(F, _, W)) : (Oi && P && g6(_), _.flags |= 1, Ja(F, _, R, W), _.child);
    }
    function iz(F, _, R, P, W) {
      if (vs(R)) {
        var J = true;
        ex(_);
      } else J = false;
      if (Xp(_, W), _.stateNode === null) vx(F, _), qN(_, R, P), N6(_, R, P, W), P = true;
      else if (F === null) {
        var pe = _.stateNode, Se = _.memoizedProps;
        pe.props = Se;
        var Pe = pe.context, at = R.contextType;
        typeof at == "object" && at !== null ? at = xl(at) : (at = vs(R) ? um : Ta.current, at = qp(_, at));
        var Nt = R.getDerivedStateFromProps, Wt = typeof Nt == "function" || typeof pe.getSnapshotBeforeUpdate == "function";
        Wt || typeof pe.UNSAFE_componentWillReceiveProps != "function" && typeof pe.componentWillReceiveProps != "function" || (Se !== P || Pe !== at) && KN(_, pe, P, at), Bh = false;
        var Ot = _.memoizedState;
        pe.state = Ot, cx(_, P, pe, W), Pe = _.memoizedState, Se !== P || Ot !== Pe || Fs.current || Bh ? (typeof Nt == "function" && (L6(_, R, Nt, P), Pe = _.memoizedState), (Se = Bh || WN(_, R, Se, P, Ot, Pe, at)) ? (Wt || typeof pe.UNSAFE_componentWillMount != "function" && typeof pe.componentWillMount != "function" || (typeof pe.componentWillMount == "function" && pe.componentWillMount(), typeof pe.UNSAFE_componentWillMount == "function" && pe.UNSAFE_componentWillMount()), typeof pe.componentDidMount == "function" && (_.flags |= 4194308)) : (typeof pe.componentDidMount == "function" && (_.flags |= 4194308), _.memoizedProps = P, _.memoizedState = Pe), pe.props = P, pe.state = Pe, pe.context = at, P = Se) : (typeof pe.componentDidMount == "function" && (_.flags |= 4194308), P = false);
      } else {
        pe = _.stateNode, yN(F, _), Se = _.memoizedProps, at = _.type === _.elementType ? Se : lc(_.type, Se), pe.props = at, Wt = _.pendingProps, Ot = pe.context, Pe = R.contextType, typeof Pe == "object" && Pe !== null ? Pe = xl(Pe) : (Pe = vs(R) ? um : Ta.current, Pe = qp(_, Pe));
        var Dn = R.getDerivedStateFromProps;
        (Nt = typeof Dn == "function" || typeof pe.getSnapshotBeforeUpdate == "function") || typeof pe.UNSAFE_componentWillReceiveProps != "function" && typeof pe.componentWillReceiveProps != "function" || (Se !== Wt || Ot !== Pe) && KN(_, pe, P, Pe), Bh = false, Ot = _.memoizedState, pe.state = Ot, cx(_, P, pe, W);
        var An = _.memoizedState;
        Se !== Wt || Ot !== An || Fs.current || Bh ? (typeof Dn == "function" && (L6(_, R, Dn, P), An = _.memoizedState), (at = Bh || WN(_, R, at, P, Ot, An, Pe) || false) ? (Nt || typeof pe.UNSAFE_componentWillUpdate != "function" && typeof pe.componentWillUpdate != "function" || (typeof pe.componentWillUpdate == "function" && pe.componentWillUpdate(P, An, Pe), typeof pe.UNSAFE_componentWillUpdate == "function" && pe.UNSAFE_componentWillUpdate(P, An, Pe)), typeof pe.componentDidUpdate == "function" && (_.flags |= 4), typeof pe.getSnapshotBeforeUpdate == "function" && (_.flags |= 1024)) : (typeof pe.componentDidUpdate != "function" || Se === F.memoizedProps && Ot === F.memoizedState || (_.flags |= 4), typeof pe.getSnapshotBeforeUpdate != "function" || Se === F.memoizedProps && Ot === F.memoizedState || (_.flags |= 1024), _.memoizedProps = P, _.memoizedState = An), pe.props = P, pe.state = An, pe.context = Pe, P = at) : (typeof pe.componentDidUpdate != "function" || Se === F.memoizedProps && Ot === F.memoizedState || (_.flags |= 4), typeof pe.getSnapshotBeforeUpdate != "function" || Se === F.memoizedProps && Ot === F.memoizedState || (_.flags |= 1024), P = false);
      }
      return H6(F, _, R, P, J, W);
    }
    function H6(F, _, R, P, W, J) {
      rz(F, _);
      var pe = (_.flags & 128) !== 0;
      if (!P && !pe) return W && cN(_, R, false), cu(F, _, J);
      P = _.stateNode, Jpe.current = _;
      var Se = pe && typeof R.getDerivedStateFromError != "function" ? null : P.render();
      return _.flags |= 1, F !== null && pe ? (_.child = Zp(_, F.child, null, J), _.child = Zp(_, null, Se, J)) : Ja(F, _, Se, J), _.memoizedState = P.state, W && cN(_, R, true), _.child;
    }
    function oz(F) {
      var _ = F.stateNode;
      _.pendingContext ? sN(F, _.pendingContext, _.pendingContext !== _.context) : _.context && sN(F, _.context, false), E6(F, _.containerInfo);
    }
    function az(F, _, R, P, W) {
      return Yp(), _6(W), _.flags |= 256, Ja(F, _, R, P), _.child;
    }
    var $6 = {
      dehydrated: null,
      treeContext: null,
      retryLane: 0
    };
    function W6(F) {
      return {
        baseLanes: F,
        cachePool: null,
        transitions: null
      };
    }
    function sz(F, _, R) {
      var P = _.pendingProps, W = Gi.current, J = false, pe = (_.flags & 128) !== 0, Se;
      if ((Se = pe) || (Se = F !== null && F.memoizedState === null ? false : (W & 2) !== 0), Se ? (J = true, _.flags &= -129) : (F === null || F.memoizedState !== null) && (W |= 1), Ci(Gi, W & 1), F === null) return v6(_), F = _.memoizedState, F !== null && (F = F.dehydrated, F !== null) ? ((_.mode & 1) === 0 ? _.lanes = 1 : F.data === "$!" ? _.lanes = 8 : _.lanes = 1073741824, null) : (pe = P.children, F = P.fallback, J ? (P = _.mode, J = _.child, pe = {
        mode: "hidden",
        children: pe
      }, (P & 1) === 0 && J !== null ? (J.childLanes = 0, J.pendingProps = pe) : J = Tx(pe, P, 0, null), F = bm(F, P, R, null), J.return = _, F.return = _, J.sibling = F, _.child = J, _.child.memoizedState = W6(R), _.memoizedState = $6, F) : q6(_, pe));
      if (W = F.memoizedState, W !== null && (Se = W.dehydrated, Se !== null)) return Xpe(F, _, pe, P, Se, W, R);
      if (J) {
        J = P.fallback, pe = _.mode, W = F.child, Se = W.sibling;
        var Pe = {
          mode: "hidden",
          children: P.children
        };
        return (pe & 1) === 0 && _.child !== W ? (P = _.child, P.childLanes = 0, P.pendingProps = Pe, _.deletions = null) : (P = Uh(W, Pe), P.subtreeFlags = W.subtreeFlags & 14680064), Se !== null ? J = Uh(Se, J) : (J = bm(J, pe, R, null), J.flags |= 2), J.return = _, P.return = _, P.sibling = J, _.child = P, P = J, J = _.child, pe = F.child.memoizedState, pe = pe === null ? W6(R) : {
          baseLanes: pe.baseLanes | R,
          cachePool: null,
          transitions: pe.transitions
        }, J.memoizedState = pe, J.childLanes = F.childLanes & ~R, _.memoizedState = $6, P;
      }
      return J = F.child, F = J.sibling, P = Uh(J, {
        mode: "visible",
        children: P.children
      }), (_.mode & 1) === 0 && (P.lanes = R), P.return = _, P.sibling = null, F !== null && (R = _.deletions, R === null ? (_.deletions = [
        F
      ], _.flags |= 16) : R.push(F)), _.child = P, _.memoizedState = null, P;
    }
    function q6(F, _) {
      return _ = Tx({
        mode: "visible",
        children: _
      }, F.mode, 0, null), _.return = F, F.child = _;
    }
    function Fx(F, _, R, P) {
      return P !== null && _6(P), Zp(_, F.child, null, R), F = q6(_, _.pendingProps.children), F.flags |= 2, _.memoizedState = null, F;
    }
    function Xpe(F, _, R, P, W, J, pe) {
      if (R) return _.flags & 256 ? (_.flags &= -257, P = z6(Error(n(422))), Fx(F, _, pe, P)) : _.memoizedState !== null ? (_.child = F.child, _.flags |= 128, null) : (J = P.fallback, W = _.mode, P = Tx({
        mode: "visible",
        children: P.children
      }, W, 0, null), J = bm(J, W, pe, null), J.flags |= 2, P.return = _, J.return = _, P.sibling = J, _.child = P, (_.mode & 1) !== 0 && Zp(_, F.child, null, pe), _.child.memoizedState = W6(pe), _.memoizedState = $6, J);
      if ((_.mode & 1) === 0) return Fx(F, _, pe, null);
      if (W.data === "$!") {
        if (P = W.nextSibling && W.nextSibling.dataset, P) var Se = P.dgst;
        return P = Se, J = Error(n(419)), P = z6(J, P, void 0), Fx(F, _, pe, P);
      }
      if (Se = (pe & F.childLanes) !== 0, _s4 || Se) {
        if (P = Qo, P !== null) {
          switch (pe & -pe) {
            case 4:
              W = 2;
              break;
            case 16:
              W = 8;
              break;
            case 64:
            case 128:
            case 256:
            case 512:
            case 1024:
            case 2048:
            case 4096:
            case 8192:
            case 16384:
            case 32768:
            case 65536:
            case 131072:
            case 262144:
            case 524288:
            case 1048576:
            case 2097152:
            case 4194304:
            case 8388608:
            case 16777216:
            case 33554432:
            case 67108864:
              W = 32;
              break;
            case 536870912:
              W = 268435456;
              break;
            default:
              W = 0;
          }
          W = (W & (P.suspendedLanes | pe)) !== 0 ? 0 : W, W !== 0 && W !== J.retryLane && (J.retryLane = W, su(F, W), uc(P, F, W, -1));
        }
        return lj(), P = z6(Error(n(421))), Fx(F, _, pe, P);
      }
      return W.data === "$?" ? (_.flags |= 128, _.child = F.child, _ = u0e.bind(null, F), W._reactRetry = _, null) : (F = J.treeContext, Us = Th(W.nextSibling), zs = _, Oi = true, sc = null, F !== null && (yl[bl++] = ou, yl[bl++] = au, yl[bl++] = hm, ou = F.id, au = F.overflow, hm = _), _ = q6(_, P.children), _.flags |= 4096, _);
    }
    function lz(F, _, R) {
      F.lanes |= _;
      var P = F.alternate;
      P !== null && (P.lanes |= _), w6(F.return, _, R);
    }
    function K6(F, _, R, P, W) {
      var J = F.memoizedState;
      J === null ? F.memoizedState = {
        isBackwards: _,
        rendering: null,
        renderingStartTime: 0,
        last: P,
        tail: R,
        tailMode: W
      } : (J.isBackwards = _, J.rendering = null, J.renderingStartTime = 0, J.last = P, J.tail = R, J.tailMode = W);
    }
    function cz(F, _, R) {
      var P = _.pendingProps, W = P.revealOrder, J = P.tail;
      if (Ja(F, _, P.children, R), P = Gi.current, (P & 2) !== 0) P = P & 1 | 2, _.flags |= 128;
      else {
        if (F !== null && (F.flags & 128) !== 0) e: for (F = _.child; F !== null; ) {
          if (F.tag === 13) F.memoizedState !== null && lz(F, R, _);
          else if (F.tag === 19) lz(F, R, _);
          else if (F.child !== null) {
            F.child.return = F, F = F.child;
            continue;
          }
          if (F === _) break e;
          for (; F.sibling === null; ) {
            if (F.return === null || F.return === _) break e;
            F = F.return;
          }
          F.sibling.return = F.return, F = F.sibling;
        }
        P &= 1;
      }
      if (Ci(Gi, P), (_.mode & 1) === 0) _.memoizedState = null;
      else switch (W) {
        case "forwards":
          for (R = _.child, W = null; R !== null; ) F = R.alternate, F !== null && dx(F) === null && (W = R), R = R.sibling;
          R = W, R === null ? (W = _.child, _.child = null) : (W = R.sibling, R.sibling = null), K6(_, false, W, R, J);
          break;
        case "backwards":
          for (R = null, W = _.child, _.child = null; W !== null; ) {
            if (F = W.alternate, F !== null && dx(F) === null) {
              _.child = W;
              break;
            }
            F = W.sibling, W.sibling = R, R = W, W = F;
          }
          K6(_, true, R, null, J);
          break;
        case "together":
          K6(_, false, null, null, void 0);
          break;
        default:
          _.memoizedState = null;
      }
      return _.child;
    }
    function vx(F, _) {
      (_.mode & 1) === 0 && F !== null && (F.alternate = null, _.alternate = null, _.flags |= 2);
    }
    function cu(F, _, R) {
      if (F !== null && (_.dependencies = F.dependencies), Fm |= _.lanes, (R & _.childLanes) === 0) return null;
      if (F !== null && _.child !== F.child) throw Error(n(153));
      if (_.child !== null) {
        for (F = _.child, R = Uh(F, F.pendingProps), _.child = R, R.return = _; F.sibling !== null; ) F = F.sibling, R = R.sibling = Uh(F, F.pendingProps), R.return = _;
        R.sibling = null;
      }
      return _.child;
    }
    function Qpe(F, _, R) {
      switch (_.tag) {
        case 3:
          oz(_), Yp();
          break;
        case 5:
          wN(_);
          break;
        case 1:
          vs(_.type) && ex(_);
          break;
        case 4:
          E6(_, _.stateNode.containerInfo);
          break;
        case 10:
          var P = _.type._context, W = _.memoizedProps.value;
          Ci(ax, P._currentValue), P._currentValue = W;
          break;
        case 13:
          if (P = _.memoizedState, P !== null) return P.dehydrated !== null ? (Ci(Gi, Gi.current & 1), _.flags |= 128, null) : (R & _.child.childLanes) !== 0 ? sz(F, _, R) : (Ci(Gi, Gi.current & 1), F = cu(F, _, R), F !== null ? F.sibling : null);
          Ci(Gi, Gi.current & 1);
          break;
        case 19:
          if (P = (R & _.childLanes) !== 0, (F.flags & 128) !== 0) {
            if (P) return cz(F, _, R);
            _.flags |= 128;
          }
          if (W = _.memoizedState, W !== null && (W.rendering = null, W.tail = null, W.lastEffect = null), Ci(Gi, Gi.current), P) break;
          return null;
        case 22:
        case 23:
          return _.lanes = 0, nz(F, _, R);
      }
      return cu(F, _, R);
    }
    var dz, G6, uz, hz;
    dz = function(F, _) {
      for (var R = _.child; R !== null; ) {
        if (R.tag === 5 || R.tag === 6) F.appendChild(R.stateNode);
        else if (R.tag !== 4 && R.child !== null) {
          R.child.return = R, R = R.child;
          continue;
        }
        if (R === _) break;
        for (; R.sibling === null; ) {
          if (R.return === null || R.return === _) return;
          R = R.return;
        }
        R.sibling.return = R.return, R = R.sibling;
      }
    }, G6 = function() {
    }, uz = function(F, _, R, P) {
      var W = F.memoizedProps;
      if (W !== P) {
        F = _.stateNode, gm(ad.current);
        var J = null;
        switch (R) {
          case "input":
            W = he(F, W), P = he(F, P), J = [];
            break;
          case "select":
            W = Z({}, W, {
              value: void 0
            }), P = Z({}, P, {
              value: void 0
            }), J = [];
            break;
          case "textarea":
            W = Rt(F, W), P = Rt(F, P), J = [];
            break;
          default:
            typeof W.onClick != "function" && typeof P.onClick == "function" && (F.onclick = J3);
        }
        qe(R, P);
        var pe;
        R = null;
        for (at in W) if (!P.hasOwnProperty(at) && W.hasOwnProperty(at) && W[at] != null) if (at === "style") {
          var Se = W[at];
          for (pe in Se) Se.hasOwnProperty(pe) && (R || (R = {}), R[pe] = "");
        } else at !== "dangerouslySetInnerHTML" && at !== "children" && at !== "suppressContentEditableWarning" && at !== "suppressHydrationWarning" && at !== "autoFocus" && (i.hasOwnProperty(at) ? J || (J = []) : (J = J || []).push(at, null));
        for (at in P) {
          var Pe = P[at];
          if (Se = W == null ? void 0 : W[at], P.hasOwnProperty(at) && Pe !== Se && (Pe != null || Se != null)) if (at === "style") if (Se) {
            for (pe in Se) !Se.hasOwnProperty(pe) || Pe && Pe.hasOwnProperty(pe) || (R || (R = {}), R[pe] = "");
            for (pe in Pe) Pe.hasOwnProperty(pe) && Se[pe] !== Pe[pe] && (R || (R = {}), R[pe] = Pe[pe]);
          } else R || (J || (J = []), J.push(at, R)), R = Pe;
          else at === "dangerouslySetInnerHTML" ? (Pe = Pe ? Pe.__html : void 0, Se = Se ? Se.__html : void 0, Pe != null && Se !== Pe && (J = J || []).push(at, Pe)) : at === "children" ? typeof Pe != "string" && typeof Pe != "number" || (J = J || []).push(at, "" + Pe) : at !== "suppressContentEditableWarning" && at !== "suppressHydrationWarning" && (i.hasOwnProperty(at) ? (Pe != null && at === "onScroll" && Ti("scroll", F), J || Se === Pe || (J = [])) : (J = J || []).push(at, Pe));
        }
        R && (J = J || []).push("style", R);
        var at = J;
        (_.updateQueue = at) && (_.flags |= 4);
      }
    }, hz = function(F, _, R, P) {
      R !== P && (_.flags |= 4);
    };
    function Vv(F, _) {
      if (!Oi) switch (F.tailMode) {
        case "hidden":
          _ = F.tail;
          for (var R = null; _ !== null; ) _.alternate !== null && (R = _), _ = _.sibling;
          R === null ? F.tail = null : R.sibling = null;
          break;
        case "collapsed":
          R = F.tail;
          for (var P = null; R !== null; ) R.alternate !== null && (P = R), R = R.sibling;
          P === null ? _ || F.tail === null ? F.tail = null : F.tail.sibling = null : P.sibling = null;
      }
    }
    function Aa(F) {
      var _ = F.alternate !== null && F.alternate.child === F.child, R = 0, P = 0;
      if (_) for (var W = F.child; W !== null; ) R |= W.lanes | W.childLanes, P |= W.subtreeFlags & 14680064, P |= W.flags & 14680064, W.return = F, W = W.sibling;
      else for (W = F.child; W !== null; ) R |= W.lanes | W.childLanes, P |= W.subtreeFlags, P |= W.flags, W.return = F, W = W.sibling;
      return F.subtreeFlags |= P, F.childLanes = R, _;
    }
    function e0e(F, _, R) {
      var P = _.pendingProps;
      switch (p6(_), _.tag) {
        case 2:
        case 16:
        case 15:
        case 0:
        case 11:
        case 7:
        case 8:
        case 12:
        case 9:
        case 14:
          return Aa(_), null;
        case 1:
          return vs(_.type) && Q3(), Aa(_), null;
        case 3:
          return P = _.stateNode, Qp(), Ri(Fs), Ri(Ta), j6(), P.pendingContext && (P.context = P.pendingContext, P.pendingContext = null), (F === null || F.child === null) && (ix(_) ? _.flags |= 4 : F === null || F.memoizedState.isDehydrated && (_.flags & 256) === 0 || (_.flags |= 1024, sc !== null && (oj(sc), sc = null))), G6(F, _), Aa(_), null;
        case 5:
          k6(_);
          var W = gm(Ov.current);
          if (R = _.type, F !== null && _.stateNode != null) uz(F, _, R, P, W), F.ref !== _.ref && (_.flags |= 512, _.flags |= 2097152);
          else {
            if (!P) {
              if (_.stateNode === null) throw Error(n(166));
              return Aa(_), null;
            }
            if (F = gm(ad.current), ix(_)) {
              P = _.stateNode, R = _.type;
              var J = _.memoizedProps;
              switch (P[od] = _, P[Av] = J, F = (_.mode & 1) !== 0, R) {
                case "dialog":
                  Ti("cancel", P), Ti("close", P);
                  break;
                case "iframe":
                case "object":
                case "embed":
                  Ti("load", P);
                  break;
                case "video":
                case "audio":
                  for (W = 0; W < jv.length; W++) Ti(jv[W], P);
                  break;
                case "source":
                  Ti("error", P);
                  break;
                case "img":
                case "image":
                case "link":
                  Ti("error", P), Ti("load", P);
                  break;
                case "details":
                  Ti("toggle", P);
                  break;
                case "input":
                  se(P, J), Ti("invalid", P);
                  break;
                case "select":
                  P._wrapperState = {
                    wasMultiple: !!J.multiple
                  }, Ti("invalid", P);
                  break;
                case "textarea":
                  We(P, J), Ti("invalid", P);
              }
              qe(R, J), W = null;
              for (var pe in J) if (J.hasOwnProperty(pe)) {
                var Se = J[pe];
                pe === "children" ? typeof Se == "string" ? P.textContent !== Se && (J.suppressHydrationWarning !== true && Z3(P.textContent, Se, F), W = [
                  "children",
                  Se
                ]) : typeof Se == "number" && P.textContent !== "" + Se && (J.suppressHydrationWarning !== true && Z3(P.textContent, Se, F), W = [
                  "children",
                  "" + Se
                ]) : i.hasOwnProperty(pe) && Se != null && pe === "onScroll" && Ti("scroll", P);
              }
              switch (R) {
                case "input":
                  le(P), Ee(P, J, true);
                  break;
                case "textarea":
                  le(P), Xt(P);
                  break;
                case "select":
                case "option":
                  break;
                default:
                  typeof J.onClick == "function" && (P.onclick = J3);
              }
              P = W, _.updateQueue = P, P !== null && (_.flags |= 4);
            } else {
              pe = W.nodeType === 9 ? W : W.ownerDocument, F === "http://www.w3.org/1999/xhtml" && (F = nn(R)), F === "http://www.w3.org/1999/xhtml" ? R === "script" ? (F = pe.createElement("div"), F.innerHTML = "<script><\/script>", F = F.removeChild(F.firstChild)) : typeof P.is == "string" ? F = pe.createElement(R, {
                is: P.is
              }) : (F = pe.createElement(R), R === "select" && (pe = F, P.multiple ? pe.multiple = true : P.size && (pe.size = P.size))) : F = pe.createElementNS(F, R), F[od] = _, F[Av] = P, dz(F, _, false, false), _.stateNode = F;
              e: {
                switch (pe = tt(R, P), R) {
                  case "dialog":
                    Ti("cancel", F), Ti("close", F), W = P;
                    break;
                  case "iframe":
                  case "object":
                  case "embed":
                    Ti("load", F), W = P;
                    break;
                  case "video":
                  case "audio":
                    for (W = 0; W < jv.length; W++) Ti(jv[W], F);
                    W = P;
                    break;
                  case "source":
                    Ti("error", F), W = P;
                    break;
                  case "img":
                  case "image":
                  case "link":
                    Ti("error", F), Ti("load", F), W = P;
                    break;
                  case "details":
                    Ti("toggle", F), W = P;
                    break;
                  case "input":
                    se(F, P), W = he(F, P), Ti("invalid", F);
                    break;
                  case "option":
                    W = P;
                    break;
                  case "select":
                    F._wrapperState = {
                      wasMultiple: !!P.multiple
                    }, W = Z({}, P, {
                      value: void 0
                    }), Ti("invalid", F);
                    break;
                  case "textarea":
                    We(F, P), W = Rt(F, P), Ti("invalid", F);
                    break;
                  default:
                    W = P;
                }
                qe(R, W), Se = W;
                for (J in Se) if (Se.hasOwnProperty(J)) {
                  var Pe = Se[J];
                  J === "style" ? Re(F, Pe) : J === "dangerouslySetInnerHTML" ? (Pe = Pe ? Pe.__html : void 0, Pe != null && $t(F, Pe)) : J === "children" ? typeof Pe == "string" ? (R !== "textarea" || Pe !== "") && Lt(F, Pe) : typeof Pe == "number" && Lt(F, "" + Pe) : J !== "suppressContentEditableWarning" && J !== "suppressHydrationWarning" && J !== "autoFocus" && (i.hasOwnProperty(J) ? Pe != null && J === "onScroll" && Ti("scroll", F) : Pe != null && j(F, J, Pe, pe));
                }
                switch (R) {
                  case "input":
                    le(F), Ee(F, P, false);
                    break;
                  case "textarea":
                    le(F), Xt(F);
                    break;
                  case "option":
                    P.value != null && F.setAttribute("value", "" + X(P.value));
                    break;
                  case "select":
                    F.multiple = !!P.multiple, J = P.value, J != null ? lt(F, !!P.multiple, J, false) : P.defaultValue != null && lt(F, !!P.multiple, P.defaultValue, true);
                    break;
                  default:
                    typeof W.onClick == "function" && (F.onclick = J3);
                }
                switch (R) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    P = !!P.autoFocus;
                    break e;
                  case "img":
                    P = true;
                    break e;
                  default:
                    P = false;
                }
              }
              P && (_.flags |= 4);
            }
            _.ref !== null && (_.flags |= 512, _.flags |= 2097152);
          }
          return Aa(_), null;
        case 6:
          if (F && _.stateNode != null) hz(F, _, F.memoizedProps, P);
          else {
            if (typeof P != "string" && _.stateNode === null) throw Error(n(166));
            if (R = gm(Ov.current), gm(ad.current), ix(_)) {
              if (P = _.stateNode, R = _.memoizedProps, P[od] = _, (J = P.nodeValue !== R) && (F = zs, F !== null)) switch (F.tag) {
                case 3:
                  Z3(P.nodeValue, R, (F.mode & 1) !== 0);
                  break;
                case 5:
                  F.memoizedProps.suppressHydrationWarning !== true && Z3(P.nodeValue, R, (F.mode & 1) !== 0);
              }
              J && (_.flags |= 4);
            } else P = (R.nodeType === 9 ? R : R.ownerDocument).createTextNode(P), P[od] = _, _.stateNode = P;
          }
          return Aa(_), null;
        case 13:
          if (Ri(Gi), P = _.memoizedState, F === null || F.memoizedState !== null && F.memoizedState.dehydrated !== null) {
            if (Oi && Us !== null && (_.mode & 1) !== 0 && (_.flags & 128) === 0) gN(), Yp(), _.flags |= 98560, J = false;
            else if (J = ix(_), P !== null && P.dehydrated !== null) {
              if (F === null) {
                if (!J) throw Error(n(318));
                if (J = _.memoizedState, J = J !== null ? J.dehydrated : null, !J) throw Error(n(317));
                J[od] = _;
              } else Yp(), (_.flags & 128) === 0 && (_.memoizedState = null), _.flags |= 4;
              Aa(_), J = false;
            } else sc !== null && (oj(sc), sc = null), J = true;
            if (!J) return _.flags & 65536 ? _ : null;
          }
          return (_.flags & 128) !== 0 ? (_.lanes = R, _) : (P = P !== null, P !== (F !== null && F.memoizedState !== null) && P && (_.child.flags |= 8192, (_.mode & 1) !== 0 && (F === null || (Gi.current & 1) !== 0 ? Lo === 0 && (Lo = 3) : lj())), _.updateQueue !== null && (_.flags |= 4), Aa(_), null);
        case 4:
          return Qp(), G6(F, _), F === null && Tv(_.stateNode.containerInfo), Aa(_), null;
        case 10:
          return x6(_.type._context), Aa(_), null;
        case 17:
          return vs(_.type) && Q3(), Aa(_), null;
        case 19:
          if (Ri(Gi), J = _.memoizedState, J === null) return Aa(_), null;
          if (P = (_.flags & 128) !== 0, pe = J.rendering, pe === null) if (P) Vv(J, false);
          else {
            if (Lo !== 0 || F !== null && (F.flags & 128) !== 0) for (F = _.child; F !== null; ) {
              if (pe = dx(F), pe !== null) {
                for (_.flags |= 128, Vv(J, false), P = pe.updateQueue, P !== null && (_.updateQueue = P, _.flags |= 4), _.subtreeFlags = 0, P = R, R = _.child; R !== null; ) J = R, F = P, J.flags &= 14680066, pe = J.alternate, pe === null ? (J.childLanes = 0, J.lanes = F, J.child = null, J.subtreeFlags = 0, J.memoizedProps = null, J.memoizedState = null, J.updateQueue = null, J.dependencies = null, J.stateNode = null) : (J.childLanes = pe.childLanes, J.lanes = pe.lanes, J.child = pe.child, J.subtreeFlags = 0, J.deletions = null, J.memoizedProps = pe.memoizedProps, J.memoizedState = pe.memoizedState, J.updateQueue = pe.updateQueue, J.type = pe.type, F = pe.dependencies, J.dependencies = F === null ? null : {
                  lanes: F.lanes,
                  firstContext: F.firstContext
                }), R = R.sibling;
                return Ci(Gi, Gi.current & 1 | 2), _.child;
              }
              F = F.sibling;
            }
            J.tail !== null && Ct() > r0 && (_.flags |= 128, P = true, Vv(J, false), _.lanes = 4194304);
          }
          else {
            if (!P) if (F = dx(pe), F !== null) {
              if (_.flags |= 128, P = true, R = F.updateQueue, R !== null && (_.updateQueue = R, _.flags |= 4), Vv(J, true), J.tail === null && J.tailMode === "hidden" && !pe.alternate && !Oi) return Aa(_), null;
            } else 2 * Ct() - J.renderingStartTime > r0 && R !== 1073741824 && (_.flags |= 128, P = true, Vv(J, false), _.lanes = 4194304);
            J.isBackwards ? (pe.sibling = _.child, _.child = pe) : (R = J.last, R !== null ? R.sibling = pe : _.child = pe, J.last = pe);
          }
          return J.tail !== null ? (_ = J.tail, J.rendering = _, J.tail = _.sibling, J.renderingStartTime = Ct(), _.sibling = null, R = Gi.current, Ci(Gi, P ? R & 1 | 2 : R & 1), _) : (Aa(_), null);
        case 22:
        case 23:
          return sj(), P = _.memoizedState !== null, F !== null && F.memoizedState !== null !== P && (_.flags |= 8192), P && (_.mode & 1) !== 0 ? (Vs & 1073741824) !== 0 && (Aa(_), _.subtreeFlags & 6 && (_.flags |= 8192)) : Aa(_), null;
        case 24:
          return null;
        case 25:
          return null;
      }
      throw Error(n(156, _.tag));
    }
    function t0e(F, _) {
      switch (p6(_), _.tag) {
        case 1:
          return vs(_.type) && Q3(), F = _.flags, F & 65536 ? (_.flags = F & -65537 | 128, _) : null;
        case 3:
          return Qp(), Ri(Fs), Ri(Ta), j6(), F = _.flags, (F & 65536) !== 0 && (F & 128) === 0 ? (_.flags = F & -65537 | 128, _) : null;
        case 5:
          return k6(_), null;
        case 13:
          if (Ri(Gi), F = _.memoizedState, F !== null && F.dehydrated !== null) {
            if (_.alternate === null) throw Error(n(340));
            Yp();
          }
          return F = _.flags, F & 65536 ? (_.flags = F & -65537 | 128, _) : null;
        case 19:
          return Ri(Gi), null;
        case 4:
          return Qp(), null;
        case 10:
          return x6(_.type._context), null;
        case 22:
        case 23:
          return sj(), null;
        case 24:
          return null;
        default:
          return null;
      }
    }
    var _x = false, Ia = false, n0e = typeof WeakSet == "function" ? WeakSet : Set, jn = null;
    function t0(F, _) {
      var R = F.ref;
      if (R !== null) if (typeof R == "function") try {
        R(null);
      } catch (P) {
        oo(F, _, P);
      }
      else R.current = null;
    }
    function Y6(F, _, R) {
      try {
        R();
      } catch (P) {
        oo(F, _, P);
      }
    }
    var fz = false;
    function r0e(F, _) {
      if (s6 = N3, F = WL(), QS(F)) {
        if ("selectionStart" in F) var R = {
          start: F.selectionStart,
          end: F.selectionEnd
        };
        else e: {
          R = (R = F.ownerDocument) && R.defaultView || window;
          var P = R.getSelection && R.getSelection();
          if (P && P.rangeCount !== 0) {
            R = P.anchorNode;
            var W = P.anchorOffset, J = P.focusNode;
            P = P.focusOffset;
            try {
              R.nodeType, J.nodeType;
            } catch {
              R = null;
              break e;
            }
            var pe = 0, Se = -1, Pe = -1, at = 0, Nt = 0, Wt = F, Ot = null;
            t: for (; ; ) {
              for (var Dn; Wt !== R || W !== 0 && Wt.nodeType !== 3 || (Se = pe + W), Wt !== J || P !== 0 && Wt.nodeType !== 3 || (Pe = pe + P), Wt.nodeType === 3 && (pe += Wt.nodeValue.length), (Dn = Wt.firstChild) !== null; ) Ot = Wt, Wt = Dn;
              for (; ; ) {
                if (Wt === F) break t;
                if (Ot === R && ++at === W && (Se = pe), Ot === J && ++Nt === P && (Pe = pe), (Dn = Wt.nextSibling) !== null) break;
                Wt = Ot, Ot = Wt.parentNode;
              }
              Wt = Dn;
            }
            R = Se === -1 || Pe === -1 ? null : {
              start: Se,
              end: Pe
            };
          } else R = null;
        }
        R = R || {
          start: 0,
          end: 0
        };
      } else R = null;
      for (l6 = {
        focusedElem: F,
        selectionRange: R
      }, N3 = false, jn = _; jn !== null; ) if (_ = jn, F = _.child, (_.subtreeFlags & 1028) !== 0 && F !== null) F.return = _, jn = F;
      else for (; jn !== null; ) {
        _ = jn;
        try {
          var An = _.alternate;
          if ((_.flags & 1024) !== 0) switch (_.tag) {
            case 0:
            case 11:
            case 15:
              break;
            case 1:
              if (An !== null) {
                var Ln = An.memoizedProps, mo = An.memoizedState, Je = _.stateNode, ze = Je.getSnapshotBeforeUpdate(_.elementType === _.type ? Ln : lc(_.type, Ln), mo);
                Je.__reactInternalSnapshotBeforeUpdate = ze;
              }
              break;
            case 3:
              var et = _.stateNode.containerInfo;
              et.nodeType === 1 ? et.textContent = "" : et.nodeType === 9 && et.documentElement && et.removeChild(et.documentElement);
              break;
            case 5:
            case 6:
            case 4:
            case 17:
              break;
            default:
              throw Error(n(163));
          }
        } catch (Qt) {
          oo(_, _.return, Qt);
        }
        if (F = _.sibling, F !== null) {
          F.return = _.return, jn = F;
          break;
        }
        jn = _.return;
      }
      return An = fz, fz = false, An;
    }
    function Hv(F, _, R) {
      var P = _.updateQueue;
      if (P = P !== null ? P.lastEffect : null, P !== null) {
        var W = P = P.next;
        do {
          if ((W.tag & F) === F) {
            var J = W.destroy;
            W.destroy = void 0, J !== void 0 && Y6(_, R, J);
          }
          W = W.next;
        } while (W !== P);
      }
    }
    function yx(F, _) {
      if (_ = _.updateQueue, _ = _ !== null ? _.lastEffect : null, _ !== null) {
        var R = _ = _.next;
        do {
          if ((R.tag & F) === F) {
            var P = R.create;
            R.destroy = P();
          }
          R = R.next;
        } while (R !== _);
      }
    }
    function Z6(F) {
      var _ = F.ref;
      if (_ !== null) {
        var R = F.stateNode;
        F.tag, F = R, typeof _ == "function" ? _(F) : _.current = F;
      }
    }
    function mz(F) {
      var _ = F.alternate;
      _ !== null && (F.alternate = null, mz(_)), F.child = null, F.deletions = null, F.sibling = null, F.tag === 5 && (_ = F.stateNode, _ !== null && (delete _[od], delete _[Av], delete _[h6], delete _[Npe], delete _[zpe])), F.stateNode = null, F.return = null, F.dependencies = null, F.memoizedProps = null, F.memoizedState = null, F.pendingProps = null, F.stateNode = null, F.updateQueue = null;
    }
    function gz(F) {
      return F.tag === 5 || F.tag === 3 || F.tag === 4;
    }
    function pz(F) {
      e: for (; ; ) {
        for (; F.sibling === null; ) {
          if (F.return === null || gz(F.return)) return null;
          F = F.return;
        }
        for (F.sibling.return = F.return, F = F.sibling; F.tag !== 5 && F.tag !== 6 && F.tag !== 18; ) {
          if (F.flags & 2 || F.child === null || F.tag === 4) continue e;
          F.child.return = F, F = F.child;
        }
        if (!(F.flags & 2)) return F.stateNode;
      }
    }
    function J6(F, _, R) {
      var P = F.tag;
      if (P === 5 || P === 6) F = F.stateNode, _ ? R.nodeType === 8 ? R.parentNode.insertBefore(F, _) : R.insertBefore(F, _) : (R.nodeType === 8 ? (_ = R.parentNode, _.insertBefore(F, R)) : (_ = R, _.appendChild(F)), R = R._reactRootContainer, R != null || _.onclick !== null || (_.onclick = J3));
      else if (P !== 4 && (F = F.child, F !== null)) for (J6(F, _, R), F = F.sibling; F !== null; ) J6(F, _, R), F = F.sibling;
    }
    function X6(F, _, R) {
      var P = F.tag;
      if (P === 5 || P === 6) F = F.stateNode, _ ? R.insertBefore(F, _) : R.appendChild(F);
      else if (P !== 4 && (F = F.child, F !== null)) for (X6(F, _, R), F = F.sibling; F !== null; ) X6(F, _, R), F = F.sibling;
    }
    var ha = null, cc = false;
    function Mh(F, _, R) {
      for (R = R.child; R !== null; ) Fz(F, _, R), R = R.sibling;
    }
    function Fz(F, _, R) {
      if (On && typeof On.onCommitFiberUnmount == "function") try {
        On.onCommitFiberUnmount(an, R);
      } catch {
      }
      switch (R.tag) {
        case 5:
          Ia || t0(R, _);
        case 6:
          var P = ha, W = cc;
          ha = null, Mh(F, _, R), ha = P, cc = W, ha !== null && (cc ? (F = ha, R = R.stateNode, F.nodeType === 8 ? F.parentNode.removeChild(R) : F.removeChild(R)) : ha.removeChild(R.stateNode));
          break;
        case 18:
          ha !== null && (cc ? (F = ha, R = R.stateNode, F.nodeType === 8 ? u6(F.parentNode, R) : F.nodeType === 1 && u6(F, R), bv(F)) : u6(ha, R.stateNode));
          break;
        case 4:
          P = ha, W = cc, ha = R.stateNode.containerInfo, cc = true, Mh(F, _, R), ha = P, cc = W;
          break;
        case 0:
        case 11:
        case 14:
        case 15:
          if (!Ia && (P = R.updateQueue, P !== null && (P = P.lastEffect, P !== null))) {
            W = P = P.next;
            do {
              var J = W, pe = J.destroy;
              J = J.tag, pe !== void 0 && ((J & 2) !== 0 || (J & 4) !== 0) && Y6(R, _, pe), W = W.next;
            } while (W !== P);
          }
          Mh(F, _, R);
          break;
        case 1:
          if (!Ia && (t0(R, _), P = R.stateNode, typeof P.componentWillUnmount == "function")) try {
            P.props = R.memoizedProps, P.state = R.memoizedState, P.componentWillUnmount();
          } catch (Se) {
            oo(R, _, Se);
          }
          Mh(F, _, R);
          break;
        case 21:
          Mh(F, _, R);
          break;
        case 22:
          R.mode & 1 ? (Ia = (P = Ia) || R.memoizedState !== null, Mh(F, _, R), Ia = P) : Mh(F, _, R);
          break;
        default:
          Mh(F, _, R);
      }
    }
    function vz(F) {
      var _ = F.updateQueue;
      if (_ !== null) {
        F.updateQueue = null;
        var R = F.stateNode;
        R === null && (R = F.stateNode = new n0e()), _.forEach(function(P) {
          var W = h0e.bind(null, F, P);
          R.has(P) || (R.add(P), P.then(W, W));
        });
      }
    }
    function dc(F, _) {
      var R = _.deletions;
      if (R !== null) for (var P = 0; P < R.length; P++) {
        var W = R[P];
        try {
          var J = F, pe = _, Se = pe;
          e: for (; Se !== null; ) {
            switch (Se.tag) {
              case 5:
                ha = Se.stateNode, cc = false;
                break e;
              case 3:
                ha = Se.stateNode.containerInfo, cc = true;
                break e;
              case 4:
                ha = Se.stateNode.containerInfo, cc = true;
                break e;
            }
            Se = Se.return;
          }
          if (ha === null) throw Error(n(160));
          Fz(J, pe, W), ha = null, cc = false;
          var Pe = W.alternate;
          Pe !== null && (Pe.return = null), W.return = null;
        } catch (at) {
          oo(W, _, at);
        }
      }
      if (_.subtreeFlags & 12854) for (_ = _.child; _ !== null; ) _z(_, F), _ = _.sibling;
    }
    function _z(F, _) {
      var R = F.alternate, P = F.flags;
      switch (F.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          if (dc(_, F), ld(F), P & 4) {
            try {
              Hv(3, F, F.return), yx(3, F);
            } catch (Ln) {
              oo(F, F.return, Ln);
            }
            try {
              Hv(5, F, F.return);
            } catch (Ln) {
              oo(F, F.return, Ln);
            }
          }
          break;
        case 1:
          dc(_, F), ld(F), P & 512 && R !== null && t0(R, R.return);
          break;
        case 5:
          if (dc(_, F), ld(F), P & 512 && R !== null && t0(R, R.return), F.flags & 32) {
            var W = F.stateNode;
            try {
              Lt(W, "");
            } catch (Ln) {
              oo(F, F.return, Ln);
            }
          }
          if (P & 4 && (W = F.stateNode, W != null)) {
            var J = F.memoizedProps, pe = R !== null ? R.memoizedProps : J, Se = F.type, Pe = F.updateQueue;
            if (F.updateQueue = null, Pe !== null) try {
              Se === "input" && J.type === "radio" && J.name != null && ye(W, J), tt(Se, pe);
              var at = tt(Se, J);
              for (pe = 0; pe < Pe.length; pe += 2) {
                var Nt = Pe[pe], Wt = Pe[pe + 1];
                Nt === "style" ? Re(W, Wt) : Nt === "dangerouslySetInnerHTML" ? $t(W, Wt) : Nt === "children" ? Lt(W, Wt) : j(W, Nt, Wt, at);
              }
              switch (Se) {
                case "input":
                  we(W, J);
                  break;
                case "textarea":
                  yt(W, J);
                  break;
                case "select":
                  var Ot = W._wrapperState.wasMultiple;
                  W._wrapperState.wasMultiple = !!J.multiple;
                  var Dn = J.value;
                  Dn != null ? lt(W, !!J.multiple, Dn, false) : Ot !== !!J.multiple && (J.defaultValue != null ? lt(W, !!J.multiple, J.defaultValue, true) : lt(W, !!J.multiple, J.multiple ? [] : "", false));
              }
              W[Av] = J;
            } catch (Ln) {
              oo(F, F.return, Ln);
            }
          }
          break;
        case 6:
          if (dc(_, F), ld(F), P & 4) {
            if (F.stateNode === null) throw Error(n(162));
            W = F.stateNode, J = F.memoizedProps;
            try {
              W.nodeValue = J;
            } catch (Ln) {
              oo(F, F.return, Ln);
            }
          }
          break;
        case 3:
          if (dc(_, F), ld(F), P & 4 && R !== null && R.memoizedState.isDehydrated) try {
            bv(_.containerInfo);
          } catch (Ln) {
            oo(F, F.return, Ln);
          }
          break;
        case 4:
          dc(_, F), ld(F);
          break;
        case 13:
          dc(_, F), ld(F), W = F.child, W.flags & 8192 && (J = W.memoizedState !== null, W.stateNode.isHidden = J, !J || W.alternate !== null && W.alternate.memoizedState !== null || (tj = Ct())), P & 4 && vz(F);
          break;
        case 22:
          if (Nt = R !== null && R.memoizedState !== null, F.mode & 1 ? (Ia = (at = Ia) || Nt, dc(_, F), Ia = at) : dc(_, F), ld(F), P & 8192) {
            if (at = F.memoizedState !== null, (F.stateNode.isHidden = at) && !Nt && (F.mode & 1) !== 0) for (jn = F, Nt = F.child; Nt !== null; ) {
              for (Wt = jn = Nt; jn !== null; ) {
                switch (Ot = jn, Dn = Ot.child, Ot.tag) {
                  case 0:
                  case 11:
                  case 14:
                  case 15:
                    Hv(4, Ot, Ot.return);
                    break;
                  case 1:
                    t0(Ot, Ot.return);
                    var An = Ot.stateNode;
                    if (typeof An.componentWillUnmount == "function") {
                      P = Ot, R = Ot.return;
                      try {
                        _ = P, An.props = _.memoizedProps, An.state = _.memoizedState, An.componentWillUnmount();
                      } catch (Ln) {
                        oo(P, R, Ln);
                      }
                    }
                    break;
                  case 5:
                    t0(Ot, Ot.return);
                    break;
                  case 22:
                    if (Ot.memoizedState !== null) {
                      xz(Wt);
                      continue;
                    }
                }
                Dn !== null ? (Dn.return = Ot, jn = Dn) : xz(Wt);
              }
              Nt = Nt.sibling;
            }
            e: for (Nt = null, Wt = F; ; ) {
              if (Wt.tag === 5) {
                if (Nt === null) {
                  Nt = Wt;
                  try {
                    W = Wt.stateNode, at ? (J = W.style, typeof J.setProperty == "function" ? J.setProperty("display", "none", "important") : J.display = "none") : (Se = Wt.stateNode, Pe = Wt.memoizedProps.style, pe = Pe != null && Pe.hasOwnProperty("display") ? Pe.display : null, Se.style.display = Be("display", pe));
                  } catch (Ln) {
                    oo(F, F.return, Ln);
                  }
                }
              } else if (Wt.tag === 6) {
                if (Nt === null) try {
                  Wt.stateNode.nodeValue = at ? "" : Wt.memoizedProps;
                } catch (Ln) {
                  oo(F, F.return, Ln);
                }
              } else if ((Wt.tag !== 22 && Wt.tag !== 23 || Wt.memoizedState === null || Wt === F) && Wt.child !== null) {
                Wt.child.return = Wt, Wt = Wt.child;
                continue;
              }
              if (Wt === F) break e;
              for (; Wt.sibling === null; ) {
                if (Wt.return === null || Wt.return === F) break e;
                Nt === Wt && (Nt = null), Wt = Wt.return;
              }
              Nt === Wt && (Nt = null), Wt.sibling.return = Wt.return, Wt = Wt.sibling;
            }
          }
          break;
        case 19:
          dc(_, F), ld(F), P & 4 && vz(F);
          break;
        case 21:
          break;
        default:
          dc(_, F), ld(F);
      }
    }
    function ld(F) {
      var _ = F.flags;
      if (_ & 2) {
        try {
          e: {
            for (var R = F.return; R !== null; ) {
              if (gz(R)) {
                var P = R;
                break e;
              }
              R = R.return;
            }
            throw Error(n(160));
          }
          switch (P.tag) {
            case 5:
              var W = P.stateNode;
              P.flags & 32 && (Lt(W, ""), P.flags &= -33);
              var J = pz(F);
              X6(F, J, W);
              break;
            case 3:
            case 4:
              var pe = P.stateNode.containerInfo, Se = pz(F);
              J6(F, Se, pe);
              break;
            default:
              throw Error(n(161));
          }
        } catch (Pe) {
          oo(F, F.return, Pe);
        }
        F.flags &= -3;
      }
      _ & 4096 && (F.flags &= -4097);
    }
    function i0e(F, _, R) {
      jn = F, yz(F);
    }
    function yz(F, _, R) {
      for (var P = (F.mode & 1) !== 0; jn !== null; ) {
        var W = jn, J = W.child;
        if (W.tag === 22 && P) {
          var pe = W.memoizedState !== null || _x;
          if (!pe) {
            var Se = W.alternate, Pe = Se !== null && Se.memoizedState !== null || Ia;
            Se = _x;
            var at = Ia;
            if (_x = pe, (Ia = Pe) && !at) for (jn = W; jn !== null; ) pe = jn, Pe = pe.child, pe.tag === 22 && pe.memoizedState !== null ? wz(W) : Pe !== null ? (Pe.return = pe, jn = Pe) : wz(W);
            for (; J !== null; ) jn = J, yz(J), J = J.sibling;
            jn = W, _x = Se, Ia = at;
          }
          bz(F);
        } else (W.subtreeFlags & 8772) !== 0 && J !== null ? (J.return = W, jn = J) : bz(F);
      }
    }
    function bz(F) {
      for (; jn !== null; ) {
        var _ = jn;
        if ((_.flags & 8772) !== 0) {
          var R = _.alternate;
          try {
            if ((_.flags & 8772) !== 0) switch (_.tag) {
              case 0:
              case 11:
              case 15:
                Ia || yx(5, _);
                break;
              case 1:
                var P = _.stateNode;
                if (_.flags & 4 && !Ia) if (R === null) P.componentDidMount();
                else {
                  var W = _.elementType === _.type ? R.memoizedProps : lc(_.type, R.memoizedProps);
                  P.componentDidUpdate(W, R.memoizedState, P.__reactInternalSnapshotBeforeUpdate);
                }
                var J = _.updateQueue;
                J !== null && xN(_, J, P);
                break;
              case 3:
                var pe = _.updateQueue;
                if (pe !== null) {
                  if (R = null, _.child !== null) switch (_.child.tag) {
                    case 5:
                      R = _.child.stateNode;
                      break;
                    case 1:
                      R = _.child.stateNode;
                  }
                  xN(_, pe, R);
                }
                break;
              case 5:
                var Se = _.stateNode;
                if (R === null && _.flags & 4) {
                  R = Se;
                  var Pe = _.memoizedProps;
                  switch (_.type) {
                    case "button":
                    case "input":
                    case "select":
                    case "textarea":
                      Pe.autoFocus && R.focus();
                      break;
                    case "img":
                      Pe.src && (R.src = Pe.src);
                  }
                }
                break;
              case 6:
                break;
              case 4:
                break;
              case 12:
                break;
              case 13:
                if (_.memoizedState === null) {
                  var at = _.alternate;
                  if (at !== null) {
                    var Nt = at.memoizedState;
                    if (Nt !== null) {
                      var Wt = Nt.dehydrated;
                      Wt !== null && bv(Wt);
                    }
                  }
                }
                break;
              case 19:
              case 17:
              case 21:
              case 22:
              case 23:
              case 25:
                break;
              default:
                throw Error(n(163));
            }
            Ia || _.flags & 512 && Z6(_);
          } catch (Ot) {
            oo(_, _.return, Ot);
          }
        }
        if (_ === F) {
          jn = null;
          break;
        }
        if (R = _.sibling, R !== null) {
          R.return = _.return, jn = R;
          break;
        }
        jn = _.return;
      }
    }
    function xz(F) {
      for (; jn !== null; ) {
        var _ = jn;
        if (_ === F) {
          jn = null;
          break;
        }
        var R = _.sibling;
        if (R !== null) {
          R.return = _.return, jn = R;
          break;
        }
        jn = _.return;
      }
    }
    function wz(F) {
      for (; jn !== null; ) {
        var _ = jn;
        try {
          switch (_.tag) {
            case 0:
            case 11:
            case 15:
              var R = _.return;
              try {
                yx(4, _);
              } catch (Pe) {
                oo(_, R, Pe);
              }
              break;
            case 1:
              var P = _.stateNode;
              if (typeof P.componentDidMount == "function") {
                var W = _.return;
                try {
                  P.componentDidMount();
                } catch (Pe) {
                  oo(_, W, Pe);
                }
              }
              var J = _.return;
              try {
                Z6(_);
              } catch (Pe) {
                oo(_, J, Pe);
              }
              break;
            case 5:
              var pe = _.return;
              try {
                Z6(_);
              } catch (Pe) {
                oo(_, pe, Pe);
              }
          }
        } catch (Pe) {
          oo(_, _.return, Pe);
        }
        if (_ === F) {
          jn = null;
          break;
        }
        var Se = _.sibling;
        if (Se !== null) {
          Se.return = _.return, jn = Se;
          break;
        }
        jn = _.return;
      }
    }
    var o0e = Math.ceil, bx = k.ReactCurrentDispatcher, Q6 = k.ReactCurrentOwner, Dl = k.ReactCurrentBatchConfig, Wr = 0, Qo = null, wo = null, fa = 0, Vs = 0, n0 = Rh(0), Lo = 0, $v = null, Fm = 0, xx = 0, ej = 0, Wv = null, ys = null, tj = 0, r0 = 1 / 0, du = null, wx = false, nj = null, Oh = null, Dx = false, Lh = null, Cx = 0, qv = 0, rj = null, Ex = -1, kx = 0;
    function Xa() {
      return (Wr & 6) !== 0 ? Ct() : Ex !== -1 ? Ex : Ex = Ct();
    }
    function Nh(F) {
      return (F.mode & 1) === 0 ? 1 : (Wr & 2) !== 0 && fa !== 0 ? fa & -fa : Vpe.transition !== null ? (kx === 0 && (kx = pL()), kx) : (F = li, F !== 0 || (F = window.event, F = F === void 0 ? 16 : CL(F.type)), F);
    }
    function uc(F, _, R, P) {
      if (50 < qv) throw qv = 0, rj = null, Error(n(185));
      pv(F, R, P), ((Wr & 2) === 0 || F !== Qo) && (F === Qo && ((Wr & 2) === 0 && (xx |= R), Lo === 4 && zh(F, fa)), bs(F, P), R === 1 && Wr === 0 && (_.mode & 1) === 0 && (r0 = Ct() + 500, tx && Ih()));
    }
    function bs(F, _) {
      var R = F.callbackNode;
      Vge(F, _);
      var P = M3(F, F === Qo ? fa : 0);
      if (P === 0) R !== null && Ve(R), F.callbackNode = null, F.callbackPriority = 0;
      else if (_ = P & -P, F.callbackPriority !== _) {
        if (R != null && Ve(R), _ === 1) F.tag === 0 ? Upe(Cz.bind(null, F)) : dN(Cz.bind(null, F)), Ope(function() {
          (Wr & 6) === 0 && Ih();
        }), R = null;
        else {
          switch (FL(P)) {
            case 1:
              R = fn;
              break;
            case 4:
              R = ur;
              break;
            case 16:
              R = Lr;
              break;
            case 536870912:
              R = nt;
              break;
            default:
              R = Lr;
          }
          R = Iz(R, Dz.bind(null, F));
        }
        F.callbackPriority = _, F.callbackNode = R;
      }
    }
    function Dz(F, _) {
      if (Ex = -1, kx = 0, (Wr & 6) !== 0) throw Error(n(327));
      var R = F.callbackNode;
      if (i0() && F.callbackNode !== R) return null;
      var P = M3(F, F === Qo ? fa : 0);
      if (P === 0) return null;
      if ((P & 30) !== 0 || (P & F.expiredLanes) !== 0 || _) _ = Sx(F, P);
      else {
        _ = P;
        var W = Wr;
        Wr |= 2;
        var J = kz();
        (Qo !== F || fa !== _) && (du = null, r0 = Ct() + 500, _m2(F, _));
        do
          try {
            l0e();
            break;
          } catch (Se) {
            Ez(F, Se);
          }
        while (true);
        b6(), bx.current = J, Wr = W, wo !== null ? _ = 0 : (Qo = null, fa = 0, _ = Lo);
      }
      if (_ !== 0) {
        if (_ === 2 && (W = OS(F), W !== 0 && (P = W, _ = ij(F, W))), _ === 1) throw R = $v, _m2(F, 0), zh(F, P), bs(F, Ct()), R;
        if (_ === 6) zh(F, P);
        else {
          if (W = F.current.alternate, (P & 30) === 0 && !a0e(W) && (_ = Sx(F, P), _ === 2 && (J = OS(F), J !== 0 && (P = J, _ = ij(F, J))), _ === 1)) throw R = $v, _m2(F, 0), zh(F, P), bs(F, Ct()), R;
          switch (F.finishedWork = W, F.finishedLanes = P, _) {
            case 0:
            case 1:
              throw Error(n(345));
            case 2:
              ym(F, ys, du);
              break;
            case 3:
              if (zh(F, P), (P & 130023424) === P && (_ = tj + 500 - Ct(), 10 < _)) {
                if (M3(F, 0) !== 0) break;
                if (W = F.suspendedLanes, (W & P) !== P) {
                  Xa(), F.pingedLanes |= F.suspendedLanes & W;
                  break;
                }
                F.timeoutHandle = d6(ym.bind(null, F, ys, du), _);
                break;
              }
              ym(F, ys, du);
              break;
            case 4:
              if (zh(F, P), (P & 4194240) === P) break;
              for (_ = F.eventTimes, W = -1; 0 < P; ) {
                var pe = 31 - tr(P);
                J = 1 << pe, pe = _[pe], pe > W && (W = pe), P &= ~J;
              }
              if (P = W, P = Ct() - P, P = (120 > P ? 120 : 480 > P ? 480 : 1080 > P ? 1080 : 1920 > P ? 1920 : 3e3 > P ? 3e3 : 4320 > P ? 4320 : 1960 * o0e(P / 1960)) - P, 10 < P) {
                F.timeoutHandle = d6(ym.bind(null, F, ys, du), P);
                break;
              }
              ym(F, ys, du);
              break;
            case 5:
              ym(F, ys, du);
              break;
            default:
              throw Error(n(329));
          }
        }
      }
      return bs(F, Ct()), F.callbackNode === R ? Dz.bind(null, F) : null;
    }
    function ij(F, _) {
      var R = Wv;
      return F.current.memoizedState.isDehydrated && (_m2(F, _).flags |= 256), F = Sx(F, _), F !== 2 && (_ = ys, ys = R, _ !== null && oj(_)), F;
    }
    function oj(F) {
      ys === null ? ys = F : ys.push.apply(ys, F);
    }
    function a0e(F) {
      for (var _ = F; ; ) {
        if (_.flags & 16384) {
          var R = _.updateQueue;
          if (R !== null && (R = R.stores, R !== null)) for (var P = 0; P < R.length; P++) {
            var W = R[P], J = W.getSnapshot;
            W = W.value;
            try {
              if (!ac(J(), W)) return false;
            } catch {
              return false;
            }
          }
        }
        if (R = _.child, _.subtreeFlags & 16384 && R !== null) R.return = _, _ = R;
        else {
          if (_ === F) break;
          for (; _.sibling === null; ) {
            if (_.return === null || _.return === F) return true;
            _ = _.return;
          }
          _.sibling.return = _.return, _ = _.sibling;
        }
      }
      return true;
    }
    function zh(F, _) {
      for (_ &= ~ej, _ &= ~xx, F.suspendedLanes |= _, F.pingedLanes &= ~_, F = F.expirationTimes; 0 < _; ) {
        var R = 31 - tr(_), P = 1 << R;
        F[R] = -1, _ &= ~P;
      }
    }
    function Cz(F) {
      if ((Wr & 6) !== 0) throw Error(n(327));
      i0();
      var _ = M3(F, 0);
      if ((_ & 1) === 0) return bs(F, Ct()), null;
      var R = Sx(F, _);
      if (F.tag !== 0 && R === 2) {
        var P = OS(F);
        P !== 0 && (_ = P, R = ij(F, P));
      }
      if (R === 1) throw R = $v, _m2(F, 0), zh(F, _), bs(F, Ct()), R;
      if (R === 6) throw Error(n(345));
      return F.finishedWork = F.current.alternate, F.finishedLanes = _, ym(F, ys, du), bs(F, Ct()), null;
    }
    function aj(F, _) {
      var R = Wr;
      Wr |= 1;
      try {
        return F(_);
      } finally {
        Wr = R, Wr === 0 && (r0 = Ct() + 500, tx && Ih());
      }
    }
    function vm(F) {
      Lh !== null && Lh.tag === 0 && (Wr & 6) === 0 && i0();
      var _ = Wr;
      Wr |= 1;
      var R = Dl.transition, P = li;
      try {
        if (Dl.transition = null, li = 1, F) return F();
      } finally {
        li = P, Dl.transition = R, Wr = _, (Wr & 6) === 0 && Ih();
      }
    }
    function sj() {
      Vs = n0.current, Ri(n0);
    }
    function _m2(F, _) {
      F.finishedWork = null, F.finishedLanes = 0;
      var R = F.timeoutHandle;
      if (R !== -1 && (F.timeoutHandle = -1, Mpe(R)), wo !== null) for (R = wo.return; R !== null; ) {
        var P = R;
        switch (p6(P), P.tag) {
          case 1:
            P = P.type.childContextTypes, P != null && Q3();
            break;
          case 3:
            Qp(), Ri(Fs), Ri(Ta), j6();
            break;
          case 5:
            k6(P);
            break;
          case 4:
            Qp();
            break;
          case 13:
            Ri(Gi);
            break;
          case 19:
            Ri(Gi);
            break;
          case 10:
            x6(P.type._context);
            break;
          case 22:
          case 23:
            sj();
        }
        R = R.return;
      }
      if (Qo = F, wo = F = Uh(F.current, null), fa = Vs = _, Lo = 0, $v = null, ej = xx = Fm = 0, ys = Wv = null, mm !== null) {
        for (_ = 0; _ < mm.length; _++) if (R = mm[_], P = R.interleaved, P !== null) {
          R.interleaved = null;
          var W = P.next, J = R.pending;
          if (J !== null) {
            var pe = J.next;
            J.next = W, P.next = pe;
          }
          R.pending = P;
        }
        mm = null;
      }
      return F;
    }
    function Ez(F, _) {
      do {
        var R = wo;
        try {
          if (b6(), ux.current = gx, hx) {
            for (var P = Yi.memoizedState; P !== null; ) {
              var W = P.queue;
              W !== null && (W.pending = null), P = P.next;
            }
            hx = false;
          }
          if (pm = 0, Xo = Oo = Yi = null, Lv = false, Nv = 0, Q6.current = null, R === null || R.return === null) {
            Lo = 1, $v = _, wo = null;
            break;
          }
          e: {
            var J = F, pe = R.return, Se = R, Pe = _;
            if (_ = fa, Se.flags |= 32768, Pe !== null && typeof Pe == "object" && typeof Pe.then == "function") {
              var at = Pe, Nt = Se, Wt = Nt.tag;
              if ((Nt.mode & 1) === 0 && (Wt === 0 || Wt === 11 || Wt === 15)) {
                var Ot = Nt.alternate;
                Ot ? (Nt.updateQueue = Ot.updateQueue, Nt.memoizedState = Ot.memoizedState, Nt.lanes = Ot.lanes) : (Nt.updateQueue = null, Nt.memoizedState = null);
              }
              var Dn = JN(pe);
              if (Dn !== null) {
                Dn.flags &= -257, XN(Dn, pe, Se, J, _), Dn.mode & 1 && ZN(J, at, _), _ = Dn, Pe = at;
                var An = _.updateQueue;
                if (An === null) {
                  var Ln = /* @__PURE__ */ new Set();
                  Ln.add(Pe), _.updateQueue = Ln;
                } else An.add(Pe);
                break e;
              } else {
                if ((_ & 1) === 0) {
                  ZN(J, at, _), lj();
                  break e;
                }
                Pe = Error(n(426));
              }
            } else if (Oi && Se.mode & 1) {
              var mo = JN(pe);
              if (mo !== null) {
                (mo.flags & 65536) === 0 && (mo.flags |= 256), XN(mo, pe, Se, J, _), _6(e0(Pe, Se));
                break e;
              }
            }
            J = Pe = e0(Pe, Se), Lo !== 4 && (Lo = 2), Wv === null ? Wv = [
              J
            ] : Wv.push(J), J = pe;
            do {
              switch (J.tag) {
                case 3:
                  J.flags |= 65536, _ &= -_, J.lanes |= _;
                  var Je = GN(J, Pe, _);
                  bN(J, Je);
                  break e;
                case 1:
                  Se = Pe;
                  var ze = J.type, et = J.stateNode;
                  if ((J.flags & 128) === 0 && (typeof ze.getDerivedStateFromError == "function" || et !== null && typeof et.componentDidCatch == "function" && (Oh === null || !Oh.has(et)))) {
                    J.flags |= 65536, _ &= -_, J.lanes |= _;
                    var Qt = YN(J, Se, _);
                    bN(J, Qt);
                    break e;
                  }
              }
              J = J.return;
            } while (J !== null);
          }
          jz(R);
        } catch (zn) {
          _ = zn, wo === R && R !== null && (wo = R = R.return);
          continue;
        }
        break;
      } while (true);
    }
    function kz() {
      var F = bx.current;
      return bx.current = gx, F === null ? gx : F;
    }
    function lj() {
      (Lo === 0 || Lo === 3 || Lo === 2) && (Lo = 4), Qo === null || (Fm & 268435455) === 0 && (xx & 268435455) === 0 || zh(Qo, fa);
    }
    function Sx(F, _) {
      var R = Wr;
      Wr |= 2;
      var P = kz();
      (Qo !== F || fa !== _) && (du = null, _m2(F, _));
      do
        try {
          s0e();
          break;
        } catch (W) {
          Ez(F, W);
        }
      while (true);
      if (b6(), Wr = R, bx.current = P, wo !== null) throw Error(n(261));
      return Qo = null, fa = 0, Lo;
    }
    function s0e() {
      for (; wo !== null; ) Sz(wo);
    }
    function l0e() {
      for (; wo !== null && !St(); ) Sz(wo);
    }
    function Sz(F) {
      var _ = Az(F.alternate, F, Vs);
      F.memoizedProps = F.pendingProps, _ === null ? jz(F) : wo = _, Q6.current = null;
    }
    function jz(F) {
      var _ = F;
      do {
        var R = _.alternate;
        if (F = _.return, (_.flags & 32768) === 0) {
          if (R = e0e(R, _, Vs), R !== null) {
            wo = R;
            return;
          }
        } else {
          if (R = t0e(R, _), R !== null) {
            R.flags &= 32767, wo = R;
            return;
          }
          if (F !== null) F.flags |= 32768, F.subtreeFlags = 0, F.deletions = null;
          else {
            Lo = 6, wo = null;
            return;
          }
        }
        if (_ = _.sibling, _ !== null) {
          wo = _;
          return;
        }
        wo = _ = F;
      } while (_ !== null);
      Lo === 0 && (Lo = 5);
    }
    function ym(F, _, R) {
      var P = li, W = Dl.transition;
      try {
        Dl.transition = null, li = 1, c0e(F, _, R, P);
      } finally {
        Dl.transition = W, li = P;
      }
      return null;
    }
    function c0e(F, _, R, P) {
      do
        i0();
      while (Lh !== null);
      if ((Wr & 6) !== 0) throw Error(n(327));
      R = F.finishedWork;
      var W = F.finishedLanes;
      if (R === null) return null;
      if (F.finishedWork = null, F.finishedLanes = 0, R === F.current) throw Error(n(177));
      F.callbackNode = null, F.callbackPriority = 0;
      var J = R.lanes | R.childLanes;
      if (Hge(F, J), F === Qo && (wo = Qo = null, fa = 0), (R.subtreeFlags & 2064) === 0 && (R.flags & 2064) === 0 || Dx || (Dx = true, Iz(Lr, function() {
        return i0(), null;
      })), J = (R.flags & 15990) !== 0, (R.subtreeFlags & 15990) !== 0 || J) {
        J = Dl.transition, Dl.transition = null;
        var pe = li;
        li = 1;
        var Se = Wr;
        Wr |= 4, Q6.current = null, r0e(F, R), _z(R, F), jpe(l6), N3 = !!s6, l6 = s6 = null, F.current = R, i0e(R), pt(), Wr = Se, li = pe, Dl.transition = J;
      } else F.current = R;
      if (Dx && (Dx = false, Lh = F, Cx = W), J = F.pendingLanes, J === 0 && (Oh = null), Qr(R.stateNode), bs(F, Ct()), _ !== null) for (P = F.onRecoverableError, R = 0; R < _.length; R++) W = _[R], P(W.value, {
        componentStack: W.stack,
        digest: W.digest
      });
      if (wx) throw wx = false, F = nj, nj = null, F;
      return (Cx & 1) !== 0 && F.tag !== 0 && i0(), J = F.pendingLanes, (J & 1) !== 0 ? F === rj ? qv++ : (qv = 0, rj = F) : qv = 0, Ih(), null;
    }
    function i0() {
      if (Lh !== null) {
        var F = FL(Cx), _ = Dl.transition, R = li;
        try {
          if (Dl.transition = null, li = 16 > F ? 16 : F, Lh === null) var P = false;
          else {
            if (F = Lh, Lh = null, Cx = 0, (Wr & 6) !== 0) throw Error(n(331));
            var W = Wr;
            for (Wr |= 4, jn = F.current; jn !== null; ) {
              var J = jn, pe = J.child;
              if ((jn.flags & 16) !== 0) {
                var Se = J.deletions;
                if (Se !== null) {
                  for (var Pe = 0; Pe < Se.length; Pe++) {
                    var at = Se[Pe];
                    for (jn = at; jn !== null; ) {
                      var Nt = jn;
                      switch (Nt.tag) {
                        case 0:
                        case 11:
                        case 15:
                          Hv(8, Nt, J);
                      }
                      var Wt = Nt.child;
                      if (Wt !== null) Wt.return = Nt, jn = Wt;
                      else for (; jn !== null; ) {
                        Nt = jn;
                        var Ot = Nt.sibling, Dn = Nt.return;
                        if (mz(Nt), Nt === at) {
                          jn = null;
                          break;
                        }
                        if (Ot !== null) {
                          Ot.return = Dn, jn = Ot;
                          break;
                        }
                        jn = Dn;
                      }
                    }
                  }
                  var An = J.alternate;
                  if (An !== null) {
                    var Ln = An.child;
                    if (Ln !== null) {
                      An.child = null;
                      do {
                        var mo = Ln.sibling;
                        Ln.sibling = null, Ln = mo;
                      } while (Ln !== null);
                    }
                  }
                  jn = J;
                }
              }
              if ((J.subtreeFlags & 2064) !== 0 && pe !== null) pe.return = J, jn = pe;
              else e: for (; jn !== null; ) {
                if (J = jn, (J.flags & 2048) !== 0) switch (J.tag) {
                  case 0:
                  case 11:
                  case 15:
                    Hv(9, J, J.return);
                }
                var Je = J.sibling;
                if (Je !== null) {
                  Je.return = J.return, jn = Je;
                  break e;
                }
                jn = J.return;
              }
            }
            var ze = F.current;
            for (jn = ze; jn !== null; ) {
              pe = jn;
              var et = pe.child;
              if ((pe.subtreeFlags & 2064) !== 0 && et !== null) et.return = pe, jn = et;
              else e: for (pe = ze; jn !== null; ) {
                if (Se = jn, (Se.flags & 2048) !== 0) try {
                  switch (Se.tag) {
                    case 0:
                    case 11:
                    case 15:
                      yx(9, Se);
                  }
                } catch (zn) {
                  oo(Se, Se.return, zn);
                }
                if (Se === pe) {
                  jn = null;
                  break e;
                }
                var Qt = Se.sibling;
                if (Qt !== null) {
                  Qt.return = Se.return, jn = Qt;
                  break e;
                }
                jn = Se.return;
              }
            }
            if (Wr = W, Ih(), On && typeof On.onPostCommitFiberRoot == "function") try {
              On.onPostCommitFiberRoot(an, F);
            } catch {
            }
            P = true;
          }
          return P;
        } finally {
          li = R, Dl.transition = _;
        }
      }
      return false;
    }
    function Tz(F, _, R) {
      _ = e0(R, _), _ = GN(F, _, 1), F = Ph(F, _, 1), _ = Xa(), F !== null && (pv(F, 1, _), bs(F, _));
    }
    function oo(F, _, R) {
      if (F.tag === 3) Tz(F, F, R);
      else for (; _ !== null; ) {
        if (_.tag === 3) {
          Tz(_, F, R);
          break;
        } else if (_.tag === 1) {
          var P = _.stateNode;
          if (typeof _.type.getDerivedStateFromError == "function" || typeof P.componentDidCatch == "function" && (Oh === null || !Oh.has(P))) {
            F = e0(R, F), F = YN(_, F, 1), _ = Ph(_, F, 1), F = Xa(), _ !== null && (pv(_, 1, F), bs(_, F));
            break;
          }
        }
        _ = _.return;
      }
    }
    function d0e(F, _, R) {
      var P = F.pingCache;
      P !== null && P.delete(_), _ = Xa(), F.pingedLanes |= F.suspendedLanes & R, Qo === F && (fa & R) === R && (Lo === 4 || Lo === 3 && (fa & 130023424) === fa && 500 > Ct() - tj ? _m2(F, 0) : ej |= R), bs(F, _);
    }
    function Rz(F, _) {
      _ === 0 && ((F.mode & 1) === 0 ? _ = 1 : (_ = P3, P3 <<= 1, (P3 & 130023424) === 0 && (P3 = 4194304)));
      var R = Xa();
      F = su(F, _), F !== null && (pv(F, _, R), bs(F, R));
    }
    function u0e(F) {
      var _ = F.memoizedState, R = 0;
      _ !== null && (R = _.retryLane), Rz(F, R);
    }
    function h0e(F, _) {
      var R = 0;
      switch (F.tag) {
        case 13:
          var P = F.stateNode, W = F.memoizedState;
          W !== null && (R = W.retryLane);
          break;
        case 19:
          P = F.stateNode;
          break;
        default:
          throw Error(n(314));
      }
      P !== null && P.delete(_), Rz(F, R);
    }
    var Az;
    Az = function(F, _, R) {
      if (F !== null) if (F.memoizedProps !== _.pendingProps || Fs.current) _s4 = true;
      else {
        if ((F.lanes & R) === 0 && (_.flags & 128) === 0) return _s4 = false, Qpe(F, _, R);
        _s4 = (F.flags & 131072) !== 0;
      }
      else _s4 = false, Oi && (_.flags & 1048576) !== 0 && uN(_, rx, _.index);
      switch (_.lanes = 0, _.tag) {
        case 2:
          var P = _.type;
          vx(F, _), F = _.pendingProps;
          var W = qp(_, Ta.current);
          Xp(_, R), W = A6(null, _, P, F, W, R);
          var J = I6();
          return _.flags |= 1, typeof W == "object" && W !== null && typeof W.render == "function" && W.$$typeof === void 0 ? (_.tag = 1, _.memoizedState = null, _.updateQueue = null, vs(P) ? (J = true, ex(_)) : J = false, _.memoizedState = W.state !== null && W.state !== void 0 ? W.state : null, C6(_), W.updater = px, _.stateNode = W, W._reactInternals = _, N6(_, P, F, R), _ = H6(null, _, P, true, J, R)) : (_.tag = 0, Oi && J && g6(_), Ja(null, _, W, R), _ = _.child), _;
        case 16:
          P = _.elementType;
          e: {
            switch (vx(F, _), F = _.pendingProps, W = P._init, P = W(P._payload), _.type = P, W = _.tag = m0e(P), F = lc(P, F), W) {
              case 0:
                _ = V6(null, _, P, F, R);
                break e;
              case 1:
                _ = iz(null, _, P, F, R);
                break e;
              case 11:
                _ = QN(null, _, P, F, R);
                break e;
              case 14:
                _ = ez(null, _, P, lc(P.type, F), R);
                break e;
            }
            throw Error(n(306, P, ""));
          }
          return _;
        case 0:
          return P = _.type, W = _.pendingProps, W = _.elementType === P ? W : lc(P, W), V6(F, _, P, W, R);
        case 1:
          return P = _.type, W = _.pendingProps, W = _.elementType === P ? W : lc(P, W), iz(F, _, P, W, R);
        case 3:
          e: {
            if (oz(_), F === null) throw Error(n(387));
            P = _.pendingProps, J = _.memoizedState, W = J.element, yN(F, _), cx(_, P, null, R);
            var pe = _.memoizedState;
            if (P = pe.element, J.isDehydrated) if (J = {
              element: P,
              isDehydrated: false,
              cache: pe.cache,
              pendingSuspenseBoundaries: pe.pendingSuspenseBoundaries,
              transitions: pe.transitions
            }, _.updateQueue.baseState = J, _.memoizedState = J, _.flags & 256) {
              W = e0(Error(n(423)), _), _ = az(F, _, P, R, W);
              break e;
            } else if (P !== W) {
              W = e0(Error(n(424)), _), _ = az(F, _, P, R, W);
              break e;
            } else for (Us = Th(_.stateNode.containerInfo.firstChild), zs = _, Oi = true, sc = null, R = vN(_, null, P, R), _.child = R; R; ) R.flags = R.flags & -3 | 4096, R = R.sibling;
            else {
              if (Yp(), P === W) {
                _ = cu(F, _, R);
                break e;
              }
              Ja(F, _, P, R);
            }
            _ = _.child;
          }
          return _;
        case 5:
          return wN(_), F === null && v6(_), P = _.type, W = _.pendingProps, J = F !== null ? F.memoizedProps : null, pe = W.children, c6(P, W) ? pe = null : J !== null && c6(P, J) && (_.flags |= 32), rz(F, _), Ja(F, _, pe, R), _.child;
        case 6:
          return F === null && v6(_), null;
        case 13:
          return sz(F, _, R);
        case 4:
          return E6(_, _.stateNode.containerInfo), P = _.pendingProps, F === null ? _.child = Zp(_, null, P, R) : Ja(F, _, P, R), _.child;
        case 11:
          return P = _.type, W = _.pendingProps, W = _.elementType === P ? W : lc(P, W), QN(F, _, P, W, R);
        case 7:
          return Ja(F, _, _.pendingProps, R), _.child;
        case 8:
          return Ja(F, _, _.pendingProps.children, R), _.child;
        case 12:
          return Ja(F, _, _.pendingProps.children, R), _.child;
        case 10:
          e: {
            if (P = _.type._context, W = _.pendingProps, J = _.memoizedProps, pe = W.value, Ci(ax, P._currentValue), P._currentValue = pe, J !== null) if (ac(J.value, pe)) {
              if (J.children === W.children && !Fs.current) {
                _ = cu(F, _, R);
                break e;
              }
            } else for (J = _.child, J !== null && (J.return = _); J !== null; ) {
              var Se = J.dependencies;
              if (Se !== null) {
                pe = J.child;
                for (var Pe = Se.firstContext; Pe !== null; ) {
                  if (Pe.context === P) {
                    if (J.tag === 1) {
                      Pe = lu(-1, R & -R), Pe.tag = 2;
                      var at = J.updateQueue;
                      if (at !== null) {
                        at = at.shared;
                        var Nt = at.pending;
                        Nt === null ? Pe.next = Pe : (Pe.next = Nt.next, Nt.next = Pe), at.pending = Pe;
                      }
                    }
                    J.lanes |= R, Pe = J.alternate, Pe !== null && (Pe.lanes |= R), w6(J.return, R, _), Se.lanes |= R;
                    break;
                  }
                  Pe = Pe.next;
                }
              } else if (J.tag === 10) pe = J.type === _.type ? null : J.child;
              else if (J.tag === 18) {
                if (pe = J.return, pe === null) throw Error(n(341));
                pe.lanes |= R, Se = pe.alternate, Se !== null && (Se.lanes |= R), w6(pe, R, _), pe = J.sibling;
              } else pe = J.child;
              if (pe !== null) pe.return = J;
              else for (pe = J; pe !== null; ) {
                if (pe === _) {
                  pe = null;
                  break;
                }
                if (J = pe.sibling, J !== null) {
                  J.return = pe.return, pe = J;
                  break;
                }
                pe = pe.return;
              }
              J = pe;
            }
            Ja(F, _, W.children, R), _ = _.child;
          }
          return _;
        case 9:
          return W = _.type, P = _.pendingProps.children, Xp(_, R), W = xl(W), P = P(W), _.flags |= 1, Ja(F, _, P, R), _.child;
        case 14:
          return P = _.type, W = lc(P, _.pendingProps), W = lc(P.type, W), ez(F, _, P, W, R);
        case 15:
          return tz(F, _, _.type, _.pendingProps, R);
        case 17:
          return P = _.type, W = _.pendingProps, W = _.elementType === P ? W : lc(P, W), vx(F, _), _.tag = 1, vs(P) ? (F = true, ex(_)) : F = false, Xp(_, R), qN(_, P, W), N6(_, P, W, R), H6(null, _, P, true, F, R);
        case 19:
          return cz(F, _, R);
        case 22:
          return nz(F, _, R);
      }
      throw Error(n(156, _.tag));
    };
    function Iz(F, _) {
      return je(F, _);
    }
    function f0e(F, _, R, P) {
      this.tag = F, this.key = R, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = _, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = P, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
    }
    function Cl(F, _, R, P) {
      return new f0e(F, _, R, P);
    }
    function cj(F) {
      return F = F.prototype, !(!F || !F.isReactComponent);
    }
    function m0e(F) {
      if (typeof F == "function") return cj(F) ? 1 : 0;
      if (F != null) {
        if (F = F.$$typeof, F === z) return 11;
        if (F === I) return 14;
      }
      return 2;
    }
    function Uh(F, _) {
      var R = F.alternate;
      return R === null ? (R = Cl(F.tag, _, F.key, F.mode), R.elementType = F.elementType, R.type = F.type, R.stateNode = F.stateNode, R.alternate = F, F.alternate = R) : (R.pendingProps = _, R.type = F.type, R.flags = 0, R.subtreeFlags = 0, R.deletions = null), R.flags = F.flags & 14680064, R.childLanes = F.childLanes, R.lanes = F.lanes, R.child = F.child, R.memoizedProps = F.memoizedProps, R.memoizedState = F.memoizedState, R.updateQueue = F.updateQueue, _ = F.dependencies, R.dependencies = _ === null ? null : {
        lanes: _.lanes,
        firstContext: _.firstContext
      }, R.sibling = F.sibling, R.index = F.index, R.ref = F.ref, R;
    }
    function jx(F, _, R, P, W, J) {
      var pe = 2;
      if (P = F, typeof F == "function") cj(F) && (pe = 1);
      else if (typeof F == "string") pe = 5;
      else e: switch (F) {
        case S:
          return bm(R.children, W, J, _);
        case T:
          pe = 8, W |= 8;
          break;
        case A:
          return F = Cl(12, R, _, W | 2), F.elementType = A, F.lanes = J, F;
        case O:
          return F = Cl(13, R, _, W), F.elementType = O, F.lanes = J, F;
        case M:
          return F = Cl(19, R, _, W), F.elementType = M, F.lanes = J, F;
        case L:
          return Tx(R, W, J, _);
        default:
          if (typeof F == "object" && F !== null) switch (F.$$typeof) {
            case B:
              pe = 10;
              break e;
            case U:
              pe = 9;
              break e;
            case z:
              pe = 11;
              break e;
            case I:
              pe = 14;
              break e;
            case N:
              pe = 16, P = null;
              break e;
          }
          throw Error(n(130, F == null ? F : typeof F, ""));
      }
      return _ = Cl(pe, R, _, W), _.elementType = F, _.type = P, _.lanes = J, _;
    }
    function bm(F, _, R, P) {
      return F = Cl(7, F, P, _), F.lanes = R, F;
    }
    function Tx(F, _, R, P) {
      return F = Cl(22, F, P, _), F.elementType = L, F.lanes = R, F.stateNode = {
        isHidden: false
      }, F;
    }
    function dj(F, _, R) {
      return F = Cl(6, F, null, _), F.lanes = R, F;
    }
    function uj(F, _, R) {
      return _ = Cl(4, F.children !== null ? F.children : [], F.key, _), _.lanes = R, _.stateNode = {
        containerInfo: F.containerInfo,
        pendingChildren: null,
        implementation: F.implementation
      }, _;
    }
    function g0e(F, _, R, P, W) {
      this.tag = _, this.containerInfo = F, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = LS(0), this.expirationTimes = LS(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = LS(0), this.identifierPrefix = P, this.onRecoverableError = W, this.mutableSourceEagerHydrationData = null;
    }
    function hj(F, _, R, P, W, J, pe, Se, Pe) {
      return F = new g0e(F, _, R, Se, Pe), _ === 1 ? (_ = 1, J === true && (_ |= 8)) : _ = 0, J = Cl(3, null, null, _), F.current = J, J.stateNode = F, J.memoizedState = {
        element: P,
        isDehydrated: R,
        cache: null,
        transitions: null,
        pendingSuspenseBoundaries: null
      }, C6(J), F;
    }
    function p0e(F, _, R) {
      var P = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
      return {
        $$typeof: x,
        key: P == null ? null : "" + P,
        children: F,
        containerInfo: _,
        implementation: R
      };
    }
    function Bz(F) {
      if (!F) return Ah;
      F = F._reactInternals;
      e: {
        if (It(F) !== F || F.tag !== 1) throw Error(n(170));
        var _ = F;
        do {
          switch (_.tag) {
            case 3:
              _ = _.stateNode.context;
              break e;
            case 1:
              if (vs(_.type)) {
                _ = _.stateNode.__reactInternalMemoizedMergedChildContext;
                break e;
              }
          }
          _ = _.return;
        } while (_ !== null);
        throw Error(n(171));
      }
      if (F.tag === 1) {
        var R = F.type;
        if (vs(R)) return lN(F, R, _);
      }
      return _;
    }
    function Pz(F, _, R, P, W, J, pe, Se, Pe) {
      return F = hj(R, P, true, F, W, J, pe, Se, Pe), F.context = Bz(null), R = F.current, P = Xa(), W = Nh(R), J = lu(P, W), J.callback = _ ?? null, Ph(R, J, W), F.current.lanes = W, pv(F, W, P), bs(F, P), F;
    }
    function Rx(F, _, R, P) {
      var W = _.current, J = Xa(), pe = Nh(W);
      return R = Bz(R), _.context === null ? _.context = R : _.pendingContext = R, _ = lu(J, pe), _.payload = {
        element: F
      }, P = P === void 0 ? null : P, P !== null && (_.callback = P), F = Ph(W, _, pe), F !== null && (uc(F, W, pe, J), lx(F, W, pe)), pe;
    }
    function Ax(F) {
      return F = F.current, F.child ? (F.child.tag === 5, F.child.stateNode) : null;
    }
    function Mz(F, _) {
      if (F = F.memoizedState, F !== null && F.dehydrated !== null) {
        var R = F.retryLane;
        F.retryLane = R !== 0 && R < _ ? R : _;
      }
    }
    function fj(F, _) {
      Mz(F, _), (F = F.alternate) && Mz(F, _);
    }
    function F0e() {
      return null;
    }
    var Oz = typeof reportError == "function" ? reportError : function(F) {
      console.error(F);
    };
    function mj(F) {
      this._internalRoot = F;
    }
    Ix.prototype.render = mj.prototype.render = function(F) {
      var _ = this._internalRoot;
      if (_ === null) throw Error(n(409));
      Rx(F, _, null, null);
    }, Ix.prototype.unmount = mj.prototype.unmount = function() {
      var F = this._internalRoot;
      if (F !== null) {
        this._internalRoot = null;
        var _ = F.containerInfo;
        vm(function() {
          Rx(null, F, null, null);
        }), _[ru] = null;
      }
    };
    function Ix(F) {
      this._internalRoot = F;
    }
    Ix.prototype.unstable_scheduleHydration = function(F) {
      if (F) {
        var _ = yL();
        F = {
          blockedOn: null,
          target: F,
          priority: _
        };
        for (var R = 0; R < kh.length && _ !== 0 && _ < kh[R].priority; R++) ;
        kh.splice(R, 0, F), R === 0 && wL(F);
      }
    };
    function gj(F) {
      return !(!F || F.nodeType !== 1 && F.nodeType !== 9 && F.nodeType !== 11);
    }
    function Bx(F) {
      return !(!F || F.nodeType !== 1 && F.nodeType !== 9 && F.nodeType !== 11 && (F.nodeType !== 8 || F.nodeValue !== " react-mount-point-unstable "));
    }
    function Lz() {
    }
    function v0e(F, _, R, P, W) {
      if (W) {
        if (typeof P == "function") {
          var J = P;
          P = function() {
            var at = Ax(pe);
            J.call(at);
          };
        }
        var pe = Pz(_, P, F, 0, null, false, false, "", Lz);
        return F._reactRootContainer = pe, F[ru] = pe.current, Tv(F.nodeType === 8 ? F.parentNode : F), vm(), pe;
      }
      for (; W = F.lastChild; ) F.removeChild(W);
      if (typeof P == "function") {
        var Se = P;
        P = function() {
          var at = Ax(Pe);
          Se.call(at);
        };
      }
      var Pe = hj(F, 0, false, null, null, false, false, "", Lz);
      return F._reactRootContainer = Pe, F[ru] = Pe.current, Tv(F.nodeType === 8 ? F.parentNode : F), vm(function() {
        Rx(_, Pe, R, P);
      }), Pe;
    }
    function Px(F, _, R, P, W) {
      var J = R._reactRootContainer;
      if (J) {
        var pe = J;
        if (typeof W == "function") {
          var Se = W;
          W = function() {
            var Pe = Ax(pe);
            Se.call(Pe);
          };
        }
        Rx(_, pe, F, W);
      } else pe = v0e(R, _, F, W, P);
      return Ax(pe);
    }
    vL = function(F) {
      switch (F.tag) {
        case 3:
          var _ = F.stateNode;
          if (_.current.memoizedState.isDehydrated) {
            var R = gv(_.pendingLanes);
            R !== 0 && (NS(_, R | 1), bs(_, Ct()), (Wr & 6) === 0 && (r0 = Ct() + 500, Ih()));
          }
          break;
        case 13:
          vm(function() {
            var P = su(F, 1);
            if (P !== null) {
              var W = Xa();
              uc(P, F, 1, W);
            }
          }), fj(F, 1);
      }
    }, zS = function(F) {
      if (F.tag === 13) {
        var _ = su(F, 134217728);
        if (_ !== null) {
          var R = Xa();
          uc(_, F, 134217728, R);
        }
        fj(F, 134217728);
      }
    }, _L = function(F) {
      if (F.tag === 13) {
        var _ = Nh(F), R = su(F, _);
        if (R !== null) {
          var P = Xa();
          uc(R, F, _, P);
        }
        fj(F, _);
      }
    }, yL = function() {
      return li;
    }, bL = function(F, _) {
      var R = li;
      try {
        return li = F, _();
      } finally {
        li = R;
      }
    }, Tt = function(F, _, R) {
      switch (_) {
        case "input":
          if (we(F, R), _ = R.name, R.type === "radio" && _ != null) {
            for (R = F; R.parentNode; ) R = R.parentNode;
            for (R = R.querySelectorAll("input[name=" + JSON.stringify("" + _) + '][type="radio"]'), _ = 0; _ < R.length; _++) {
              var P = R[_];
              if (P !== F && P.form === F.form) {
                var W = X3(P);
                if (!W) throw Error(n(90));
                te(P), we(P, W);
              }
            }
          }
          break;
        case "textarea":
          yt(F, R);
          break;
        case "select":
          _ = R.value, _ != null && lt(F, !!R.multiple, _, false);
      }
    }, Ce = aj, Dt = vm;
    var _0e = {
      usingClientEntryPoint: false,
      Events: [
        Iv,
        $p,
        X3,
        Zn,
        Kn,
        aj
      ]
    }, Kv = {
      findFiberByHostInstance: dm,
      bundleType: 0,
      version: "18.3.1",
      rendererPackageName: "react-dom"
    }, y0e = {
      bundleType: Kv.bundleType,
      version: Kv.version,
      rendererPackageName: Kv.rendererPackageName,
      rendererConfig: Kv.rendererConfig,
      overrideHookState: null,
      overrideHookStateDeletePath: null,
      overrideHookStateRenamePath: null,
      overrideProps: null,
      overridePropsDeletePath: null,
      overridePropsRenamePath: null,
      setErrorHandler: null,
      setSuspenseHandler: null,
      scheduleUpdate: null,
      currentDispatcherRef: k.ReactCurrentDispatcher,
      findHostInstanceByFiber: function(F) {
        return F = on(F), F === null ? null : F.stateNode;
      },
      findFiberByHostInstance: Kv.findFiberByHostInstance || F0e,
      findHostInstancesForRefresh: null,
      scheduleRefresh: null,
      scheduleRoot: null,
      setRefreshHandler: null,
      getCurrentFiber: null,
      reconcilerVersion: "18.3.1-next-f1338f8080-20240426"
    };
    if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
      var Mx = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (!Mx.isDisabled && Mx.supportsFiber) try {
        an = Mx.inject(y0e), On = Mx;
      } catch {
      }
    }
    return xs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = _0e, xs.createPortal = function(F, _) {
      var R = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
      if (!gj(_)) throw Error(n(200));
      return p0e(F, _, null, R);
    }, xs.createRoot = function(F, _) {
      if (!gj(F)) throw Error(n(299));
      var R = false, P = "", W = Oz;
      return _ != null && (_.unstable_strictMode === true && (R = true), _.identifierPrefix !== void 0 && (P = _.identifierPrefix), _.onRecoverableError !== void 0 && (W = _.onRecoverableError)), _ = hj(F, 1, false, null, null, R, false, P, W), F[ru] = _.current, Tv(F.nodeType === 8 ? F.parentNode : F), new mj(_);
    }, xs.findDOMNode = function(F) {
      if (F == null) return null;
      if (F.nodeType === 1) return F;
      var _ = F._reactInternals;
      if (_ === void 0) throw typeof F.render == "function" ? Error(n(188)) : (F = Object.keys(F).join(","), Error(n(268, F)));
      return F = on(_), F = F === null ? null : F.stateNode, F;
    }, xs.flushSync = function(F) {
      return vm(F);
    }, xs.hydrate = function(F, _, R) {
      if (!Bx(_)) throw Error(n(200));
      return Px(null, F, _, true, R);
    }, xs.hydrateRoot = function(F, _, R) {
      if (!gj(F)) throw Error(n(405));
      var P = R != null && R.hydratedSources || null, W = false, J = "", pe = Oz;
      if (R != null && (R.unstable_strictMode === true && (W = true), R.identifierPrefix !== void 0 && (J = R.identifierPrefix), R.onRecoverableError !== void 0 && (pe = R.onRecoverableError)), _ = Pz(_, null, F, 1, R ?? null, W, false, J, pe), F[ru] = _.current, Tv(F), P) for (F = 0; F < P.length; F++) R = P[F], W = R._getVersion, W = W(R._source), _.mutableSourceEagerHydrationData == null ? _.mutableSourceEagerHydrationData = [
        R,
        W
      ] : _.mutableSourceEagerHydrationData.push(R, W);
      return new Ix(_);
    }, xs.render = function(F, _, R) {
      if (!Bx(_)) throw Error(n(200));
      return Px(null, F, _, false, R);
    }, xs.unmountComponentAtNode = function(F) {
      if (!Bx(F)) throw Error(n(40));
      return F._reactRootContainer ? (vm(function() {
        Px(null, null, F, false, function() {
          F._reactRootContainer = null, F[ru] = null;
        });
      }), true) : false;
    }, xs.unstable_batchedUpdates = aj, xs.unstable_renderSubtreeIntoContainer = function(F, _, R, P) {
      if (!Bx(R)) throw Error(n(200));
      if (F == null || F._reactInternals === void 0) throw Error(n(38));
      return Px(F, _, R, false, P);
    }, xs.version = "18.3.1-next-f1338f8080-20240426", xs;
  }
  var lU;
  function oee() {
    if (lU) return xj.exports;
    lU = 1;
    function t() {
      if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t);
      } catch (e) {
        console.error(e);
      }
    }
    return t(), xj.exports = kFe(), xj.exports;
  }
  var DF = oee();
  const aee = da(DF), SFe = n7({
    __proto__: null,
    default: aee
  }, [
    DF
  ]);
  function Ai() {
    return Ai = Object.assign ? Object.assign.bind() : function(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e];
        for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
      }
      return t;
    }, Ai.apply(this, arguments);
  }
  var ko;
  (function(t) {
    t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
  })(ko || (ko = {}));
  const cU = "popstate";
  function jFe(t) {
    t === void 0 && (t = {});
    function e(r, i) {
      let { pathname: a, search: s, hash: l } = r.location;
      return I1("", {
        pathname: a,
        search: s,
        hash: l
      }, i.state && i.state.usr || null, i.state && i.state.key || "default");
    }
    function n(r, i) {
      return typeof i == "string" ? i : Af(i);
    }
    return see(e, n, null, t);
  }
  function TFe(t) {
    t === void 0 && (t = {});
    function e(i, a) {
      let { pathname: s = "/", search: l = "", hash: c = "" } = uh(i.location.hash.substr(1));
      return !s.startsWith("/") && !s.startsWith(".") && (s = "/" + s), I1("", {
        pathname: s,
        search: l,
        hash: c
      }, a.state && a.state.usr || null, a.state && a.state.key || "default");
    }
    function n(i, a) {
      let s = i.document.querySelector("base"), l = "";
      if (s && s.getAttribute("href")) {
        let c = i.location.href, d = c.indexOf("#");
        l = d === -1 ? c : c.slice(0, d);
      }
      return l + "#" + (typeof a == "string" ? a : Af(a));
    }
    function r(i, a) {
      Zu(i.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(a) + ")");
    }
    return see(e, n, r, t);
  }
  function Sr(t, e) {
    if (t === false || t === null || typeof t > "u") throw new Error(e);
  }
  function Zu(t, e) {
    if (!t) {
      typeof console < "u" && console.warn(e);
      try {
        throw new Error(e);
      } catch {
      }
    }
  }
  function RFe() {
    return Math.random().toString(36).substr(2, 8);
  }
  function dU(t, e) {
    return {
      usr: t.state,
      key: t.key,
      idx: e
    };
  }
  function I1(t, e, n, r) {
    return n === void 0 && (n = null), Ai({
      pathname: typeof t == "string" ? t : t.pathname,
      search: "",
      hash: ""
    }, typeof e == "string" ? uh(e) : e, {
      state: n,
      key: e && e.key || r || RFe()
    });
  }
  function Af(t) {
    let { pathname: e = "/", search: n = "", hash: r = "" } = t;
    return n && n !== "?" && (e += n.charAt(0) === "?" ? n : "?" + n), r && r !== "#" && (e += r.charAt(0) === "#" ? r : "#" + r), e;
  }
  function uh(t) {
    let e = {};
    if (t) {
      let n = t.indexOf("#");
      n >= 0 && (e.hash = t.substr(n), t = t.substr(0, n));
      let r = t.indexOf("?");
      r >= 0 && (e.search = t.substr(r), t = t.substr(0, r)), t && (e.pathname = t);
    }
    return e;
  }
  function see(t, e, n, r) {
    r === void 0 && (r = {});
    let { window: i = document.defaultView, v5Compat: a = false } = r, s = i.history, l = ko.Pop, c = null, d = u();
    d == null && (d = 0, s.replaceState(Ai({}, s.state, {
      idx: d
    }), ""));
    function u() {
      return (s.state || {
        idx: null
      }).idx;
    }
    function h() {
      l = ko.Pop;
      let y = u(), w = y == null ? null : y - d;
      d = y, c && c({
        action: l,
        location: v.location,
        delta: w
      });
    }
    function f(y, w) {
      l = ko.Push;
      let b = I1(v.location, y, w);
      n && n(b, y), d = u() + 1;
      let j = dU(b, d), k = v.createHref(b);
      try {
        s.pushState(j, "", k);
      } catch (C) {
        if (C instanceof DOMException && C.name === "DataCloneError") throw C;
        i.location.assign(k);
      }
      a && c && c({
        action: l,
        location: v.location,
        delta: 1
      });
    }
    function g(y, w) {
      l = ko.Replace;
      let b = I1(v.location, y, w);
      n && n(b, y), d = u();
      let j = dU(b, d), k = v.createHref(b);
      s.replaceState(j, "", k), a && c && c({
        action: l,
        location: v.location,
        delta: 0
      });
    }
    function m(y) {
      let w = i.location.origin !== "null" ? i.location.origin : i.location.href, b = typeof y == "string" ? y : Af(y);
      return b = b.replace(/ $/, "%20"), Sr(w, "No window.location.(origin|href) available to create URL for href: " + b), new URL(b, w);
    }
    let v = {
      get action() {
        return l;
      },
      get location() {
        return t(i, s);
      },
      listen(y) {
        if (c) throw new Error("A history only accepts one active listener");
        return i.addEventListener(cU, h), c = y, () => {
          i.removeEventListener(cU, h), c = null;
        };
      },
      createHref(y) {
        return e(i, y);
      },
      createURL: m,
      encodeLocation(y) {
        let w = m(y);
        return {
          pathname: w.pathname,
          search: w.search,
          hash: w.hash
        };
      },
      push: f,
      replace: g,
      go(y) {
        return s.go(y);
      }
    };
    return v;
  }
  var ui;
  (function(t) {
    t.data = "data", t.deferred = "deferred", t.redirect = "redirect", t.error = "error";
  })(ui || (ui = {}));
  const AFe = /* @__PURE__ */ new Set([
    "lazy",
    "caseSensitive",
    "path",
    "id",
    "index",
    "children"
  ]);
  function IFe(t) {
    return t.index === true;
  }
  function CC(t, e, n, r) {
    return n === void 0 && (n = []), r === void 0 && (r = {}), t.map((i, a) => {
      let s = [
        ...n,
        String(a)
      ], l = typeof i.id == "string" ? i.id : s.join("-");
      if (Sr(i.index !== true || !i.children, "Cannot specify children on an index route"), Sr(!r[l], 'Found a route id collision on id "' + l + `".  Route id's must be globally unique within Data Router usages`), IFe(i)) {
        let c = Ai({}, i, e(i), {
          id: l
        });
        return r[l] = c, c;
      } else {
        let c = Ai({}, i, e(i), {
          id: l,
          children: void 0
        });
        return r[l] = c, i.children && (c.children = CC(i.children, e, s, r)), c;
      }
    });
  }
  function ng(t, e, n) {
    return n === void 0 && (n = "/"), yD(t, e, n, false);
  }
  function yD(t, e, n, r) {
    let i = typeof e == "string" ? uh(e) : e, a = CF(i.pathname || "/", n);
    if (a == null) return null;
    let s = lee(t);
    PFe(s);
    let l = null;
    for (let c = 0; l == null && c < s.length; ++c) {
      let d = dee(a);
      l = $Fe(s[c], d, r);
    }
    return l;
  }
  function BFe(t, e) {
    let { route: n, pathname: r, params: i } = t;
    return {
      id: n.id,
      pathname: r,
      params: i,
      data: e[n.id],
      handle: n.handle
    };
  }
  function lee(t, e, n, r) {
    e === void 0 && (e = []), n === void 0 && (n = []), r === void 0 && (r = "");
    let i = (a, s, l) => {
      let c = {
        relativePath: l === void 0 ? a.path || "" : l,
        caseSensitive: a.caseSensitive === true,
        childrenIndex: s,
        route: a
      };
      c.relativePath.startsWith("/") && (Sr(c.relativePath.startsWith(r), 'Absolute route path "' + c.relativePath + '" nested under path ' + ('"' + r + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."), c.relativePath = c.relativePath.slice(r.length));
      let d = Nu([
        r,
        c.relativePath
      ]), u = n.concat(c);
      a.children && a.children.length > 0 && (Sr(a.index !== true, "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + d + '".')), lee(a.children, e, u, d)), !(a.path == null && !a.index) && e.push({
        path: d,
        score: VFe(d, a.index),
        routesMeta: u
      });
    };
    return t.forEach((a, s) => {
      var l;
      if (a.path === "" || !((l = a.path) != null && l.includes("?"))) i(a, s);
      else for (let c of cee(a.path)) i(a, s, c);
    }), e;
  }
  function cee(t) {
    let e = t.split("/");
    if (e.length === 0) return [];
    let [n, ...r] = e, i = n.endsWith("?"), a = n.replace(/\?$/, "");
    if (r.length === 0) return i ? [
      a,
      ""
    ] : [
      a
    ];
    let s = cee(r.join("/")), l = [];
    return l.push(...s.map((c) => c === "" ? a : [
      a,
      c
    ].join("/"))), i && l.push(...s), l.map((c) => t.startsWith("/") && c === "" ? "/" : c);
  }
  function PFe(t) {
    t.sort((e, n) => e.score !== n.score ? n.score - e.score : HFe(e.routesMeta.map((r) => r.childrenIndex), n.routesMeta.map((r) => r.childrenIndex)));
  }
  const MFe = /^:[\w-]+$/, OFe = 3, LFe = 2, NFe = 1, zFe = 10, UFe = -2, uU = (t) => t === "*";
  function VFe(t, e) {
    let n = t.split("/"), r = n.length;
    return n.some(uU) && (r += UFe), e && (r += LFe), n.filter((i) => !uU(i)).reduce((i, a) => i + (MFe.test(a) ? OFe : a === "" ? NFe : zFe), r);
  }
  function HFe(t, e) {
    return t.length === e.length && t.slice(0, -1).every((r, i) => r === e[i]) ? t[t.length - 1] - e[e.length - 1] : 0;
  }
  function $Fe(t, e, n) {
    n === void 0 && (n = false);
    let { routesMeta: r } = t, i = {}, a = "/", s = [];
    for (let l = 0; l < r.length; ++l) {
      let c = r[l], d = l === r.length - 1, u = a === "/" ? e : e.slice(a.length) || "/", h = Wo({
        path: c.relativePath,
        caseSensitive: c.caseSensitive,
        end: d
      }, u), f = c.route;
      if (!h && d && n && !r[r.length - 1].route.index && (h = Wo({
        path: c.relativePath,
        caseSensitive: c.caseSensitive,
        end: false
      }, u)), !h) return null;
      Object.assign(i, h.params), s.push({
        params: i,
        pathname: Nu([
          a,
          h.pathname
        ]),
        pathnameBase: YFe(Nu([
          a,
          h.pathnameBase
        ])),
        route: f
      }), h.pathnameBase !== "/" && (a = Nu([
        a,
        h.pathnameBase
      ]));
    }
    return s;
  }
  function hl(t, e) {
    e === void 0 && (e = {});
    let n = t;
    n.endsWith("*") && n !== "*" && !n.endsWith("/*") && (Zu(false, 'Route path "' + n + '" will be treated as if it were ' + ('"' + n.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + n.replace(/\*$/, "/*") + '".')), n = n.replace(/\*$/, "/*"));
    const r = n.startsWith("/") ? "/" : "", i = (s) => s == null ? "" : typeof s == "string" ? s : String(s), a = n.split(/\/+/).map((s, l, c) => {
      if (l === c.length - 1 && s === "*") return i(e["*"]);
      const u = s.match(/^:([\w-]+)(\??)$/);
      if (u) {
        const [, h, f] = u;
        let g = e[h];
        return Sr(f === "?" || g != null, 'Missing ":' + h + '" param'), i(g);
      }
      return s.replace(/\?$/g, "");
    }).filter((s) => !!s);
    return r + a.join("/");
  }
  function Wo(t, e) {
    typeof t == "string" && (t = {
      path: t,
      caseSensitive: false,
      end: true
    });
    let [n, r] = WFe(t.path, t.caseSensitive, t.end), i = e.match(n);
    if (!i) return null;
    let a = i[0], s = a.replace(/(.)\/+$/, "$1"), l = i.slice(1);
    return {
      params: r.reduce((d, u, h) => {
        let { paramName: f, isOptional: g } = u;
        if (f === "*") {
          let v = l[h] || "";
          s = a.slice(0, a.length - v.length).replace(/(.)\/+$/, "$1");
        }
        const m = l[h];
        return g && !m ? d[f] = void 0 : d[f] = (m || "").replace(/%2F/g, "/"), d;
      }, {}),
      pathname: a,
      pathnameBase: s,
      pattern: t
    };
  }
  function WFe(t, e, n) {
    e === void 0 && (e = false), n === void 0 && (n = true), Zu(t === "*" || !t.endsWith("*") || t.endsWith("/*"), 'Route path "' + t + '" will be treated as if it were ' + ('"' + t.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + t.replace(/\*$/, "/*") + '".'));
    let r = [], i = "^" + t.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (s, l, c) => (r.push({
      paramName: l,
      isOptional: c != null
    }), c ? "/?([^\\/]+)?" : "/([^\\/]+)"));
    return t.endsWith("*") ? (r.push({
      paramName: "*"
    }), i += t === "*" || t === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : t !== "" && t !== "/" && (i += "(?:(?=\\/|$))"), [
      new RegExp(i, e ? void 0 : "i"),
      r
    ];
  }
  function dee(t) {
    try {
      return t.split("/").map((e) => decodeURIComponent(e).replace(/\//g, "%2F")).join("/");
    } catch (e) {
      return Zu(false, 'The URL path "' + t + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + e + ").")), t;
    }
  }
  function CF(t, e) {
    if (e === "/") return t;
    if (!t.toLowerCase().startsWith(e.toLowerCase())) return null;
    let n = e.endsWith("/") ? e.length - 1 : e.length, r = t.charAt(n);
    return r && r !== "/" ? null : t.slice(n) || "/";
  }
  const qFe = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, KFe = (t) => qFe.test(t);
  function GFe(t, e) {
    e === void 0 && (e = "/");
    let { pathname: n, search: r = "", hash: i = "" } = typeof t == "string" ? uh(t) : t, a;
    if (n) if (KFe(n)) a = n;
    else {
      if (n.includes("//")) {
        let s = n;
        n = n.replace(/\/\/+/g, "/"), Zu(false, "Pathnames cannot have embedded double slashes - normalizing " + (s + " -> " + n));
      }
      n.startsWith("/") ? a = hU(n.substring(1), "/") : a = hU(n, e);
    }
    else a = e;
    return {
      pathname: a,
      search: ZFe(r),
      hash: JFe(i)
    };
  }
  function hU(t, e) {
    let n = e.replace(/\/+$/, "").split("/");
    return t.split("/").forEach((i) => {
      i === ".." ? n.length > 1 && n.pop() : i !== "." && n.push(i);
    }), n.length > 1 ? n.join("/") : "/";
  }
  function Cj(t, e, n, r) {
    return "Cannot include a '" + t + "' character in a manually specified " + ("`to." + e + "` field [" + JSON.stringify(r) + "].  Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
  }
  function uee(t) {
    return t.filter((e, n) => n === 0 || e.route.path && e.route.path.length > 0);
  }
  function p7(t, e) {
    let n = uee(t);
    return e ? n.map((r, i) => i === n.length - 1 ? r.pathname : r.pathnameBase) : n.map((r) => r.pathnameBase);
  }
  function F7(t, e, n, r) {
    r === void 0 && (r = false);
    let i;
    typeof t == "string" ? i = uh(t) : (i = Ai({}, t), Sr(!i.pathname || !i.pathname.includes("?"), Cj("?", "pathname", "search", i)), Sr(!i.pathname || !i.pathname.includes("#"), Cj("#", "pathname", "hash", i)), Sr(!i.search || !i.search.includes("#"), Cj("#", "search", "hash", i)));
    let a = t === "" || i.pathname === "", s = a ? "/" : i.pathname, l;
    if (s == null) l = n;
    else {
      let h = e.length - 1;
      if (!r && s.startsWith("..")) {
        let f = s.split("/");
        for (; f[0] === ".."; ) f.shift(), h -= 1;
        i.pathname = f.join("/");
      }
      l = h >= 0 ? e[h] : "/";
    }
    let c = GFe(i, l), d = s && s !== "/" && s.endsWith("/"), u = (a || s === ".") && n.endsWith("/");
    return !c.pathname.endsWith("/") && (d || u) && (c.pathname += "/"), c;
  }
  const Nu = (t) => t.join("/").replace(/\/\/+/g, "/"), YFe = (t) => t.replace(/\/+$/, "").replace(/^\/*/, "/"), ZFe = (t) => !t || t === "?" ? "" : t.startsWith("?") ? t : "?" + t, JFe = (t) => !t || t === "#" ? "" : t.startsWith("#") ? t : "#" + t, xm = function(e, n) {
    n === void 0 && (n = 302);
    let r = n;
    typeof r == "number" ? r = {
      status: r
    } : typeof r.status > "u" && (r.status = 302);
    let i = new Headers(r.headers);
    return i.set("Location", e), new Response(null, Ai({}, r, {
      headers: i
    }));
  };
  class EC {
    constructor(e, n, r, i) {
      i === void 0 && (i = false), this.status = e, this.statusText = n || "", this.internal = i, r instanceof Error ? (this.data = r.toString(), this.error = r) : this.data = r;
    }
  }
  function b2(t) {
    return t != null && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.internal == "boolean" && "data" in t;
  }
  const hee = [
    "post",
    "put",
    "patch",
    "delete"
  ], XFe = new Set(hee), QFe = [
    "get",
    ...hee
  ], eve = new Set(QFe), tve = /* @__PURE__ */ new Set([
    301,
    302,
    303,
    307,
    308
  ]), nve = /* @__PURE__ */ new Set([
    307,
    308
  ]), Ej = {
    state: "idle",
    location: void 0,
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0
  }, rve = {
    state: "idle",
    data: void 0,
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0
  }, Zv = {
    state: "unblocked",
    proceed: void 0,
    reset: void 0,
    location: void 0
  }, v7 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ive = (t) => ({
    hasErrorBoundary: !!t.hasErrorBoundary
  }), fee = "remix-router-transitions";
  function mee(t) {
    const e = t.window ? t.window : typeof window < "u" ? window : void 0, n = typeof e < "u" && typeof e.document < "u" && typeof e.document.createElement < "u", r = !n;
    Sr(t.routes.length > 0, "You must provide a non-empty routes array to createRouter");
    let i;
    if (t.mapRouteProperties) i = t.mapRouteProperties;
    else if (t.detectErrorBoundary) {
      let De = t.detectErrorBoundary;
      i = (Ae) => ({
        hasErrorBoundary: De(Ae)
      });
    } else i = ive;
    let a = {}, s = CC(t.routes, i, void 0, a), l, c = t.basename || "/", d = t.dataStrategy || lve, u = t.patchRoutesOnNavigation, h = Ai({
      v7_fetcherPersist: false,
      v7_normalizeFormMethod: false,
      v7_partialHydration: false,
      v7_prependBasename: false,
      v7_relativeSplatPath: false,
      v7_skipActionErrorRevalidation: false
    }, t.future), f = null, g = /* @__PURE__ */ new Set(), m = null, v = null, y = null, w = t.hydrationData != null, b = ng(s, t.history.location, c), j = false, k = null;
    if (b == null && !u) {
      let De = Cs(404, {
        pathname: t.history.location.pathname
      }), { matches: Ae, route: Ge } = wU(s);
      b = Ae, k = {
        [Ge.id]: De
      };
    }
    b && !t.hydrationData && Dt(b, s, t.history.location.pathname).active && (b = null);
    let C;
    if (b) if (b.some((De) => De.route.lazy)) C = false;
    else if (!b.some((De) => De.route.loader)) C = true;
    else if (h.v7_partialHydration) {
      let De = t.hydrationData ? t.hydrationData.loaderData : null, Ae = t.hydrationData ? t.hydrationData.errors : null;
      if (Ae) {
        let Ge = b.findIndex((ot) => Ae[ot.route.id] !== void 0);
        C = b.slice(0, Ge + 1).every((ot) => !uR(ot.route, De, Ae));
      } else C = b.every((Ge) => !uR(Ge.route, De, Ae));
    } else C = t.hydrationData != null;
    else if (C = false, b = [], h.v7_partialHydration) {
      let De = Dt(null, s, t.history.location.pathname);
      De.active && De.matches && (j = true, b = De.matches);
    }
    let x, S = {
      historyAction: t.history.action,
      location: t.history.location,
      matches: b,
      initialized: C,
      navigation: Ej,
      restoreScrollPosition: t.hydrationData != null ? false : null,
      preventScrollReset: false,
      revalidation: "idle",
      loaderData: t.hydrationData && t.hydrationData.loaderData || {},
      actionData: t.hydrationData && t.hydrationData.actionData || null,
      errors: t.hydrationData && t.hydrationData.errors || k,
      fetchers: /* @__PURE__ */ new Map(),
      blockers: /* @__PURE__ */ new Map()
    }, T = ko.Pop, A = false, B, U = false, z = /* @__PURE__ */ new Map(), O = null, M = false, I = false, N = [], L = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Map(), V = 0, Z = -1, Y = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Set(), ue = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Set(), ne = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map(), X;
    function K() {
      if (f = t.history.listen((De) => {
        let { action: Ae, location: Ge, delta: ot } = De;
        if (X) {
          X(), X = void 0;
          return;
        }
        Zu(ae.size === 0 || ot != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");
        let Mt = Tt({
          currentLocation: S.location,
          nextLocation: Ge,
          historyAction: Ae
        });
        if (Mt && ot != null) {
          let cn = new Promise((un) => {
            X = un;
          });
          t.history.go(ot * -1), $e(Mt, {
            state: "blocked",
            location: Ge,
            proceed() {
              $e(Mt, {
                state: "proceeding",
                proceed: void 0,
                reset: void 0,
                location: Ge
              }), cn.then(() => t.history.go(ot));
            },
            reset() {
              let un = new Map(S.blockers);
              un.set(Mt, Zv), te({
                blockers: un
              });
            }
          });
          return;
        }
        return ye(Ae, Ge);
      }), n) {
        xve(e, z);
        let De = () => wve(e, z);
        e.addEventListener("pagehide", De), O = () => e.removeEventListener("pagehide", De);
      }
      return S.initialized || ye(ko.Pop, S.location, {
        initialHydration: true
      }), x;
    }
    function G() {
      f && f(), O && O(), g.clear(), B && B.abort(), S.fetchers.forEach((De, Ae) => wt(Ae)), S.blockers.forEach((De, Ae) => ht(Ae));
    }
    function le(De) {
      return g.add(De), () => g.delete(De);
    }
    function te(De, Ae) {
      Ae === void 0 && (Ae = {}), S = Ai({}, S, De);
      let Ge = [], ot = [];
      h.v7_fetcherPersist && S.fetchers.forEach((Mt, cn) => {
        Mt.state === "idle" && (de.has(cn) ? ot.push(cn) : Ge.push(cn));
      }), de.forEach((Mt) => {
        !S.fetchers.has(Mt) && !H.has(Mt) && ot.push(Mt);
      }), [
        ...g
      ].forEach((Mt) => Mt(S, {
        deletedFetchers: ot,
        viewTransitionOpts: Ae.viewTransitionOpts,
        flushSync: Ae.flushSync === true
      })), h.v7_fetcherPersist ? (Ge.forEach((Mt) => S.fetchers.delete(Mt)), ot.forEach((Mt) => wt(Mt))) : ot.forEach((Mt) => de.delete(Mt));
    }
    function re(De, Ae, Ge) {
      var ot, Mt;
      let { flushSync: cn } = Ge === void 0 ? {} : Ge, un = S.actionData != null && S.navigation.formMethod != null && wc(S.navigation.formMethod) && S.navigation.state === "loading" && ((ot = De.state) == null ? void 0 : ot._isRedirect) !== true, gn;
      Ae.actionData ? Object.keys(Ae.actionData).length > 0 ? gn = Ae.actionData : gn = null : un ? gn = S.actionData : gn = null;
      let Ke = Ae.loaderData ? bU(S.loaderData, Ae.loaderData, Ae.matches || [], Ae.errors) : S.loaderData, it = S.blockers;
      it.size > 0 && (it = new Map(it), it.forEach((Sn, Mn) => it.set(Mn, Zv)));
      let It = A === true || S.navigation.formMethod != null && wc(S.navigation.formMethod) && ((Mt = De.state) == null ? void 0 : Mt._isRedirect) !== true;
      l && (s = l, l = void 0), M || T === ko.Pop || (T === ko.Push ? t.history.push(De, De.state) : T === ko.Replace && t.history.replace(De, De.state));
      let Pt;
      if (T === ko.Pop) {
        let Sn = z.get(S.location.pathname);
        Sn && Sn.has(De.pathname) ? Pt = {
          currentLocation: S.location,
          nextLocation: De
        } : z.has(De.pathname) && (Pt = {
          currentLocation: De,
          nextLocation: S.location
        });
      } else if (U) {
        let Sn = z.get(S.location.pathname);
        Sn ? Sn.add(De.pathname) : (Sn = /* @__PURE__ */ new Set([
          De.pathname
        ]), z.set(S.location.pathname, Sn)), Pt = {
          currentLocation: S.location,
          nextLocation: De
        };
      }
      te(Ai({}, Ae, {
        actionData: gn,
        loaderData: Ke,
        historyAction: T,
        location: De,
        initialized: true,
        navigation: Ej,
        revalidation: "idle",
        restoreScrollPosition: Ce(De, Ae.matches || S.matches),
        preventScrollReset: It,
        blockers: it
      }), {
        viewTransitionOpts: Pt,
        flushSync: cn === true
      }), T = ko.Pop, A = false, U = false, M = false, I = false, N = [];
    }
    async function he(De, Ae) {
      if (typeof De == "number") {
        t.history.go(De);
        return;
      }
      let Ge = dR(S.location, S.matches, c, h.v7_prependBasename, De, h.v7_relativeSplatPath, Ae == null ? void 0 : Ae.fromRouteId, Ae == null ? void 0 : Ae.relative), { path: ot, submission: Mt, error: cn } = fU(h.v7_normalizeFormMethod, false, Ge, Ae), un = S.location, gn = I1(S.location, ot, Ae && Ae.state);
      gn = Ai({}, gn, t.history.encodeLocation(gn));
      let Ke = Ae && Ae.replace != null ? Ae.replace : void 0, it = ko.Push;
      Ke === true ? it = ko.Replace : Ke === false || Mt != null && wc(Mt.formMethod) && Mt.formAction === S.location.pathname + S.location.search && (it = ko.Replace);
      let It = Ae && "preventScrollReset" in Ae ? Ae.preventScrollReset === true : void 0, Pt = (Ae && Ae.flushSync) === true, Sn = Tt({
        currentLocation: un,
        nextLocation: gn,
        historyAction: it
      });
      if (Sn) {
        $e(Sn, {
          state: "blocked",
          location: gn,
          proceed() {
            $e(Sn, {
              state: "proceeding",
              proceed: void 0,
              reset: void 0,
              location: gn
            }), he(De, Ae);
          },
          reset() {
            let Mn = new Map(S.blockers);
            Mn.set(Sn, Zv), te({
              blockers: Mn
            });
          }
        });
        return;
      }
      return await ye(it, gn, {
        submission: Mt,
        pendingError: cn,
        preventScrollReset: It,
        replace: Ae && Ae.replace,
        enableViewTransition: Ae && Ae.viewTransition,
        flushSync: Pt
      });
    }
    function se() {
      if (bt(), te({
        revalidation: "loading"
      }), S.navigation.state !== "submitting") {
        if (S.navigation.state === "idle") {
          ye(S.historyAction, S.location, {
            startUninterruptedRevalidation: true
          });
          return;
        }
        ye(T || S.historyAction, S.navigation.location, {
          overrideNavigation: S.navigation,
          enableViewTransition: U === true
        });
      }
    }
    async function ye(De, Ae, Ge) {
      B && B.abort(), B = null, T = De, M = (Ge && Ge.startUninterruptedRevalidation) === true, Kn(S.location, S.matches), A = (Ge && Ge.preventScrollReset) === true, U = (Ge && Ge.enableViewTransition) === true;
      let ot = l || s, Mt = Ge && Ge.overrideNavigation, cn = Ge != null && Ge.initialHydration && S.matches && S.matches.length > 0 && !j ? S.matches : ng(ot, Ae, c), un = (Ge && Ge.flushSync) === true;
      if (cn && S.initialized && !I && mve(S.location, Ae) && !(Ge && Ge.submission && wc(Ge.submission.formMethod))) {
        re(Ae, {
          matches: cn
        }, {
          flushSync: un
        });
        return;
      }
      let gn = Dt(cn, ot, Ae.pathname);
      if (gn.active && gn.matches && (cn = gn.matches), !cn) {
        let { error: on, notFoundMatches: vt, route: je } = zt(Ae.pathname);
        re(Ae, {
          matches: vt,
          loaderData: {},
          errors: {
            [je.id]: on
          }
        }, {
          flushSync: un
        });
        return;
      }
      B = new AbortController();
      let Ke = a0(t.history, Ae, B.signal, Ge && Ge.submission), it;
      if (Ge && Ge.pendingError) it = [
        rg(cn).route.id,
        {
          type: ui.error,
          error: Ge.pendingError
        }
      ];
      else if (Ge && Ge.submission && wc(Ge.submission.formMethod)) {
        let on = await we(Ke, Ae, Ge.submission, cn, gn.active, {
          replace: Ge.replace,
          flushSync: un
        });
        if (on.shortCircuited) return;
        if (on.pendingActionResult) {
          let [vt, je] = on.pendingActionResult;
          if (el(je) && b2(je.error) && je.error.status === 404) {
            B = null, re(Ae, {
              matches: on.matches,
              loaderData: {},
              errors: {
                [vt]: je.error
              }
            });
            return;
          }
        }
        cn = on.matches || cn, it = on.pendingActionResult, Mt = kj(Ae, Ge.submission), un = false, gn.active = false, Ke = a0(t.history, Ke.url, Ke.signal);
      }
      let { shortCircuited: It, matches: Pt, loaderData: Sn, errors: Mn } = await Ee(Ke, Ae, cn, gn.active, Mt, Ge && Ge.submission, Ge && Ge.fetcherSubmission, Ge && Ge.replace, Ge && Ge.initialHydration === true, un, it);
      It || (B = null, re(Ae, Ai({
        matches: Pt || cn
      }, xU(it), {
        loaderData: Sn,
        errors: Mn
      })));
    }
    async function we(De, Ae, Ge, ot, Mt, cn) {
      cn === void 0 && (cn = {}), bt();
      let un = yve(Ae, Ge);
      if (te({
        navigation: un
      }, {
        flushSync: cn.flushSync === true
      }), Mt) {
        let it = await Ut(ot, Ae.pathname, De.signal);
        if (it.type === "aborted") return {
          shortCircuited: true
        };
        if (it.type === "error") {
          let It = rg(it.partialMatches).route.id;
          return {
            matches: it.partialMatches,
            pendingActionResult: [
              It,
              {
                type: ui.error,
                error: it.error
              }
            ]
          };
        } else if (it.matches) ot = it.matches;
        else {
          let { notFoundMatches: It, error: Pt, route: Sn } = zt(Ae.pathname);
          return {
            matches: It,
            pendingActionResult: [
              Sn.id,
              {
                type: ui.error,
                error: Pt
              }
            ]
          };
        }
      }
      let gn, Ke = cy(ot, Ae);
      if (!Ke.route.action && !Ke.route.lazy) gn = {
        type: ui.error,
        error: Cs(405, {
          method: De.method,
          pathname: Ae.pathname,
          routeId: Ke.route.id
        })
      };
      else if (gn = (await Xt("action", S, De, [
        Ke
      ], ot, null))[Ke.route.id], De.signal.aborted) return {
        shortCircuited: true
      };
      if (lg(gn)) {
        let it;
        return cn && cn.replace != null ? it = cn.replace : it = vU(gn.response.headers.get("Location"), new URL(De.url), c, t.history) === S.location.pathname + S.location.search, await yt(De, gn, true, {
          submission: Ge,
          replace: it
        }), {
          shortCircuited: true
        };
      }
      if (mf(gn)) throw Cs(400, {
        type: "defer-action"
      });
      if (el(gn)) {
        let it = rg(ot, Ke.route.id);
        return (cn && cn.replace) !== true && (T = ko.Push), {
          matches: ot,
          pendingActionResult: [
            it.route.id,
            gn
          ]
        };
      }
      return {
        matches: ot,
        pendingActionResult: [
          Ke.route.id,
          gn
        ]
      };
    }
    async function Ee(De, Ae, Ge, ot, Mt, cn, un, gn, Ke, it, It) {
      let Pt = Mt || kj(Ae, cn), Sn = cn || un || CU(Pt), Mn = !M && (!h.v7_partialHydration || !Ke);
      if (ot) {
        if (Mn) {
          let an = ke(It);
          te(Ai({
            navigation: Pt
          }, an !== void 0 ? {
            actionData: an
          } : {}), {
            flushSync: it
          });
        }
        let nt = await Ut(Ge, Ae.pathname, De.signal);
        if (nt.type === "aborted") return {
          shortCircuited: true
        };
        if (nt.type === "error") {
          let an = rg(nt.partialMatches).route.id;
          return {
            matches: nt.partialMatches,
            loaderData: {},
            errors: {
              [an]: nt.error
            }
          };
        } else if (nt.matches) Ge = nt.matches;
        else {
          let { error: an, notFoundMatches: On, route: Qr } = zt(Ae.pathname);
          return {
            matches: On,
            loaderData: {},
            errors: {
              [Qr.id]: an
            }
          };
        }
      }
      let on = l || s, [vt, je] = gU(t.history, S, Ge, Sn, Ae, h.v7_partialHydration && Ke === true, h.v7_skipActionErrorRevalidation, I, N, L, de, ue, oe, on, c, It);
      if (Vt((nt) => !(Ge && Ge.some((an) => an.route.id === nt)) || vt && vt.some((an) => an.route.id === nt)), Z = ++V, vt.length === 0 && je.length === 0) {
        let nt = Ue();
        return re(Ae, Ai({
          matches: Ge,
          loaderData: {},
          errors: It && el(It[1]) ? {
            [It[0]]: It[1].error
          } : null
        }, xU(It), nt ? {
          fetchers: new Map(S.fetchers)
        } : {}), {
          flushSync: it
        }), {
          shortCircuited: true
        };
      }
      if (Mn) {
        let nt = {};
        if (!ot) {
          nt.navigation = Pt;
          let an = ke(It);
          an !== void 0 && (nt.actionData = an);
        }
        je.length > 0 && (nt.fetchers = Ne(je)), te(nt, {
          flushSync: it
        });
      }
      je.forEach((nt) => {
        Be(nt.key), nt.controller && H.set(nt.key, nt.controller);
      });
      let Ve = () => je.forEach((nt) => Be(nt.key));
      B && B.signal.addEventListener("abort", Ve);
      let { loaderResults: St, fetcherResults: pt } = await nn(S, Ge, vt, je, De);
      if (De.signal.aborted) return {
        shortCircuited: true
      };
      B && B.signal.removeEventListener("abort", Ve), je.forEach((nt) => H.delete(nt.key));
      let Ct = Lx(St);
      if (Ct) return await yt(De, Ct.result, true, {
        replace: gn
      }), {
        shortCircuited: true
      };
      if (Ct = Lx(pt), Ct) return oe.add(Ct.key), await yt(De, Ct.result, true, {
        replace: gn
      }), {
        shortCircuited: true
      };
      let { loaderData: En, errors: fn } = yU(S, Ge, St, It, je, pt, ne);
      ne.forEach((nt, an) => {
        nt.subscribe((On) => {
          (On || nt.done) && ne.delete(an);
        });
      }), h.v7_partialHydration && Ke && S.errors && (fn = Ai({}, S.errors, fn));
      let ur = Ue(), Lr = qe(Z), pn = ur || Lr || je.length > 0;
      return Ai({
        matches: Ge,
        loaderData: En,
        errors: fn
      }, pn ? {
        fetchers: new Map(S.fetchers)
      } : {});
    }
    function ke(De) {
      if (De && !el(De[1])) return {
        [De[0]]: De[1].data
      };
      if (S.actionData) return Object.keys(S.actionData).length === 0 ? null : S.actionData;
    }
    function Ne(De) {
      return De.forEach((Ae) => {
        let Ge = S.fetchers.get(Ae.key), ot = Jv(void 0, Ge ? Ge.data : void 0);
        S.fetchers.set(Ae.key, ot);
      }), new Map(S.fetchers);
    }
    function lt(De, Ae, Ge, ot) {
      if (r) throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");
      Be(De);
      let Mt = (ot && ot.flushSync) === true, cn = l || s, un = dR(S.location, S.matches, c, h.v7_prependBasename, Ge, h.v7_relativeSplatPath, Ae, ot == null ? void 0 : ot.relative), gn = ng(cn, un, c), Ke = Dt(gn, cn, un);
      if (Ke.active && Ke.matches && (gn = Ke.matches), !gn) {
        $t(De, Ae, Cs(404, {
          pathname: un
        }), {
          flushSync: Mt
        });
        return;
      }
      let { path: it, submission: It, error: Pt } = fU(h.v7_normalizeFormMethod, true, un, ot);
      if (Pt) {
        $t(De, Ae, Pt, {
          flushSync: Mt
        });
        return;
      }
      let Sn = cy(gn, it), Mn = (ot && ot.preventScrollReset) === true;
      if (It && wc(It.formMethod)) {
        Rt(De, Ae, it, Sn, gn, Ke.active, Mt, Mn, It);
        return;
      }
      ue.set(De, {
        routeId: Ae,
        path: it
      }), We(De, Ae, it, Sn, gn, Ke.active, Mt, Mn, It);
    }
    async function Rt(De, Ae, Ge, ot, Mt, cn, un, gn, Ke) {
      bt(), ue.delete(De);
      function it(tr) {
        if (!tr.route.action && !tr.route.lazy) {
          let Mi = Cs(405, {
            method: Ke.formMethod,
            pathname: Ge,
            routeId: Ae
          });
          return $t(De, Ae, Mi, {
            flushSync: un
          }), true;
        }
        return false;
      }
      if (!cn && it(ot)) return;
      let It = S.fetchers.get(De);
      At(De, bve(Ke, It), {
        flushSync: un
      });
      let Pt = new AbortController(), Sn = a0(t.history, Ge, Pt.signal, Ke);
      if (cn) {
        let tr = await Ut(Mt, new URL(Sn.url).pathname, Sn.signal, De);
        if (tr.type === "aborted") return;
        if (tr.type === "error") {
          $t(De, Ae, tr.error, {
            flushSync: un
          });
          return;
        } else if (tr.matches) {
          if (Mt = tr.matches, ot = cy(Mt, Ge), it(ot)) return;
        } else {
          $t(De, Ae, Cs(404, {
            pathname: Ge
          }), {
            flushSync: un
          });
          return;
        }
      }
      H.set(De, Pt);
      let Mn = V, vt = (await Xt("action", S, Sn, [
        ot
      ], Mt, De))[ot.route.id];
      if (Sn.signal.aborted) {
        H.get(De) === Pt && H.delete(De);
        return;
      }
      if (h.v7_fetcherPersist && de.has(De)) {
        if (lg(vt) || el(vt)) {
          At(De, Xh(void 0));
          return;
        }
      } else {
        if (lg(vt)) if (H.delete(De), Z > Mn) {
          At(De, Xh(void 0));
          return;
        } else return oe.add(De), At(De, Jv(Ke)), yt(Sn, vt, false, {
          fetcherSubmission: Ke,
          preventScrollReset: gn
        });
        if (el(vt)) {
          $t(De, Ae, vt.error);
          return;
        }
      }
      if (mf(vt)) throw Cs(400, {
        type: "defer-action"
      });
      let je = S.navigation.location || S.location, Ve = a0(t.history, je, Pt.signal), St = l || s, pt = S.navigation.state !== "idle" ? ng(St, S.navigation.location, c) : S.matches;
      Sr(pt, "Didn't find any matches after fetcher action");
      let Ct = ++V;
      Y.set(De, Ct);
      let En = Jv(Ke, vt.data);
      S.fetchers.set(De, En);
      let [fn, ur] = gU(t.history, S, pt, Ke, je, false, h.v7_skipActionErrorRevalidation, I, N, L, de, ue, oe, St, c, [
        ot.route.id,
        vt
      ]);
      ur.filter((tr) => tr.key !== De).forEach((tr) => {
        let Mi = tr.key, ps = S.fetchers.get(Mi), nu = Jv(void 0, ps ? ps.data : void 0);
        S.fetchers.set(Mi, nu), Be(Mi), tr.controller && H.set(Mi, tr.controller);
      }), te({
        fetchers: new Map(S.fetchers)
      });
      let Lr = () => ur.forEach((tr) => Be(tr.key));
      Pt.signal.addEventListener("abort", Lr);
      let { loaderResults: pn, fetcherResults: nt } = await nn(S, pt, fn, ur, Ve);
      if (Pt.signal.aborted) return;
      Pt.signal.removeEventListener("abort", Lr), Y.delete(De), H.delete(De), ur.forEach((tr) => H.delete(tr.key));
      let an = Lx(pn);
      if (an) return yt(Ve, an.result, false, {
        preventScrollReset: gn
      });
      if (an = Lx(nt), an) return oe.add(an.key), yt(Ve, an.result, false, {
        preventScrollReset: gn
      });
      let { loaderData: On, errors: Qr } = yU(S, pt, pn, void 0, ur, nt, ne);
      if (S.fetchers.has(De)) {
        let tr = Xh(vt.data);
        S.fetchers.set(De, tr);
      }
      qe(Ct), S.navigation.state === "loading" && Ct > Z ? (Sr(T, "Expected pending action"), B && B.abort(), re(S.navigation.location, {
        matches: pt,
        loaderData: On,
        errors: Qr,
        fetchers: new Map(S.fetchers)
      })) : (te({
        errors: Qr,
        loaderData: bU(S.loaderData, On, pt, Qr),
        fetchers: new Map(S.fetchers)
      }), I = false);
    }
    async function We(De, Ae, Ge, ot, Mt, cn, un, gn, Ke) {
      let it = S.fetchers.get(De);
      At(De, Jv(Ke, it ? it.data : void 0), {
        flushSync: un
      });
      let It = new AbortController(), Pt = a0(t.history, Ge, It.signal);
      if (cn) {
        let vt = await Ut(Mt, new URL(Pt.url).pathname, Pt.signal, De);
        if (vt.type === "aborted") return;
        if (vt.type === "error") {
          $t(De, Ae, vt.error, {
            flushSync: un
          });
          return;
        } else if (vt.matches) Mt = vt.matches, ot = cy(Mt, Ge);
        else {
          $t(De, Ae, Cs(404, {
            pathname: Ge
          }), {
            flushSync: un
          });
          return;
        }
      }
      H.set(De, It);
      let Sn = V, on = (await Xt("loader", S, Pt, [
        ot
      ], Mt, De))[ot.route.id];
      if (mf(on) && (on = await _7(on, Pt.signal, true) || on), H.get(De) === It && H.delete(De), !Pt.signal.aborted) {
        if (de.has(De)) {
          At(De, Xh(void 0));
          return;
        }
        if (lg(on)) if (Z > Sn) {
          At(De, Xh(void 0));
          return;
        } else {
          oe.add(De), await yt(Pt, on, false, {
            preventScrollReset: gn
          });
          return;
        }
        if (el(on)) {
          $t(De, Ae, on.error);
          return;
        }
        Sr(!mf(on), "Unhandled fetcher deferred data"), At(De, Xh(on.data));
      }
    }
    async function yt(De, Ae, Ge, ot) {
      let { submission: Mt, fetcherSubmission: cn, preventScrollReset: un, replace: gn } = ot === void 0 ? {} : ot;
      Ae.response.headers.has("X-Remix-Revalidate") && (I = true);
      let Ke = Ae.response.headers.get("Location");
      Sr(Ke, "Expected a Location header on the redirect Response"), Ke = vU(Ke, new URL(De.url), c, t.history);
      let it = I1(S.location, Ke, {
        _isRedirect: true
      });
      if (n) {
        let vt = false;
        if (Ae.response.headers.has("X-Remix-Reload-Document")) vt = true;
        else if (v7.test(Ke)) {
          const je = t.history.createURL(Ke);
          vt = je.origin !== e.location.origin || CF(je.pathname, c) == null;
        }
        if (vt) {
          gn ? e.location.replace(Ke) : e.location.assign(Ke);
          return;
        }
      }
      B = null;
      let It = gn === true || Ae.response.headers.has("X-Remix-Replace") ? ko.Replace : ko.Push, { formMethod: Pt, formAction: Sn, formEncType: Mn } = S.navigation;
      !Mt && !cn && Pt && Sn && Mn && (Mt = CU(S.navigation));
      let on = Mt || cn;
      if (nve.has(Ae.response.status) && on && wc(on.formMethod)) await ye(It, it, {
        submission: Ai({}, on, {
          formAction: Ke
        }),
        preventScrollReset: un || A,
        enableViewTransition: Ge ? U : void 0
      });
      else {
        let vt = kj(it, Mt);
        await ye(It, it, {
          overrideNavigation: vt,
          fetcherSubmission: cn,
          preventScrollReset: un || A,
          enableViewTransition: Ge ? U : void 0
        });
      }
    }
    async function Xt(De, Ae, Ge, ot, Mt, cn) {
      let un, gn = {};
      try {
        un = await cve(d, De, Ae, Ge, ot, Mt, cn, a, i);
      } catch (Ke) {
        return ot.forEach((it) => {
          gn[it.route.id] = {
            type: ui.error,
            error: Ke
          };
        }), gn;
      }
      for (let [Ke, it] of Object.entries(un)) if (gve(it)) {
        let It = it.result;
        gn[Ke] = {
          type: ui.redirect,
          response: hve(It, Ge, Ke, Mt, c, h.v7_relativeSplatPath)
        };
      } else gn[Ke] = await uve(it);
      return gn;
    }
    async function nn(De, Ae, Ge, ot, Mt) {
      let cn = De.matches, un = Xt("loader", De, Mt, Ge, Ae, null), gn = Promise.all(ot.map(async (It) => {
        if (It.matches && It.match && It.controller) {
          let Sn = (await Xt("loader", De, a0(t.history, It.path, It.controller.signal), [
            It.match
          ], It.matches, It.key))[It.match.route.id];
          return {
            [It.key]: Sn
          };
        } else return Promise.resolve({
          [It.key]: {
            type: ui.error,
            error: Cs(404, {
              pathname: It.path
            })
          }
        });
      })), Ke = await un, it = (await gn).reduce((It, Pt) => Object.assign(It, Pt), {});
      return await Promise.all([
        vve(Ae, Ke, Mt.signal, cn, De.loaderData),
        _ve(Ae, it, ot)
      ]), {
        loaderResults: Ke,
        fetcherResults: it
      };
    }
    function bt() {
      I = true, N.push(...Vt()), ue.forEach((De, Ae) => {
        H.has(Ae) && L.add(Ae), Be(Ae);
      });
    }
    function At(De, Ae, Ge) {
      Ge === void 0 && (Ge = {}), S.fetchers.set(De, Ae), te({
        fetchers: new Map(S.fetchers)
      }, {
        flushSync: (Ge && Ge.flushSync) === true
      });
    }
    function $t(De, Ae, Ge, ot) {
      ot === void 0 && (ot = {});
      let Mt = rg(S.matches, Ae);
      wt(De), te({
        errors: {
          [Mt.route.id]: Ge
        },
        fetchers: new Map(S.fetchers)
      }, {
        flushSync: (ot && ot.flushSync) === true
      });
    }
    function Lt(De) {
      return ie.set(De, (ie.get(De) || 0) + 1), de.has(De) && de.delete(De), S.fetchers.get(De) || rve;
    }
    function wt(De) {
      let Ae = S.fetchers.get(De);
      H.has(De) && !(Ae && Ae.state === "loading" && Y.has(De)) && Be(De), ue.delete(De), Y.delete(De), oe.delete(De), h.v7_fetcherPersist && de.delete(De), L.delete(De), S.fetchers.delete(De);
    }
    function st(De) {
      let Ae = (ie.get(De) || 0) - 1;
      Ae <= 0 ? (ie.delete(De), de.add(De), h.v7_fetcherPersist || wt(De)) : ie.set(De, Ae), te({
        fetchers: new Map(S.fetchers)
      });
    }
    function Be(De) {
      let Ae = H.get(De);
      Ae && (Ae.abort(), H.delete(De));
    }
    function Re(De) {
      for (let Ae of De) {
        let Ge = Lt(Ae), ot = Xh(Ge.data);
        S.fetchers.set(Ae, ot);
      }
    }
    function Ue() {
      let De = [], Ae = false;
      for (let Ge of oe) {
        let ot = S.fetchers.get(Ge);
        Sr(ot, "Expected fetcher: " + Ge), ot.state === "loading" && (oe.delete(Ge), De.push(Ge), Ae = true);
      }
      return Re(De), Ae;
    }
    function qe(De) {
      let Ae = [];
      for (let [Ge, ot] of Y) if (ot < De) {
        let Mt = S.fetchers.get(Ge);
        Sr(Mt, "Expected fetcher: " + Ge), Mt.state === "loading" && (Be(Ge), Y.delete(Ge), Ae.push(Ge));
      }
      return Re(Ae), Ae.length > 0;
    }
    function tt(De, Ae) {
      let Ge = S.blockers.get(De) || Zv;
      return ae.get(De) !== Ae && ae.set(De, Ae), Ge;
    }
    function ht(De) {
      S.blockers.delete(De), ae.delete(De);
    }
    function $e(De, Ae) {
      let Ge = S.blockers.get(De) || Zv;
      Sr(Ge.state === "unblocked" && Ae.state === "blocked" || Ge.state === "blocked" && Ae.state === "blocked" || Ge.state === "blocked" && Ae.state === "proceeding" || Ge.state === "blocked" && Ae.state === "unblocked" || Ge.state === "proceeding" && Ae.state === "unblocked", "Invalid blocker state transition: " + Ge.state + " -> " + Ae.state);
      let ot = new Map(S.blockers);
      ot.set(De, Ae), te({
        blockers: ot
      });
    }
    function Tt(De) {
      let { currentLocation: Ae, nextLocation: Ge, historyAction: ot } = De;
      if (ae.size === 0) return;
      ae.size > 1 && Zu(false, "A router only supports one blocker at a time");
      let Mt = Array.from(ae.entries()), [cn, un] = Mt[Mt.length - 1], gn = S.blockers.get(cn);
      if (!(gn && gn.state === "proceeding") && un({
        currentLocation: Ae,
        nextLocation: Ge,
        historyAction: ot
      })) return cn;
    }
    function zt(De) {
      let Ae = Cs(404, {
        pathname: De
      }), Ge = l || s, { matches: ot, route: Mt } = wU(Ge);
      return Vt(), {
        notFoundMatches: ot,
        route: Mt,
        error: Ae
      };
    }
    function Vt(De) {
      let Ae = [];
      return ne.forEach((Ge, ot) => {
        (!De || De(ot)) && (Ge.cancel(), Ae.push(ot), ne.delete(ot));
      }), Ae;
    }
    function bn(De, Ae, Ge) {
      if (m = De, y = Ae, v = Ge || null, !w && S.navigation === Ej) {
        w = true;
        let ot = Ce(S.location, S.matches);
        ot != null && te({
          restoreScrollPosition: ot
        });
      }
      return () => {
        m = null, y = null, v = null;
      };
    }
    function Zn(De, Ae) {
      return v && v(De, Ae.map((ot) => BFe(ot, S.loaderData))) || De.key;
    }
    function Kn(De, Ae) {
      if (m && y) {
        let Ge = Zn(De, Ae);
        m[Ge] = y();
      }
    }
    function Ce(De, Ae) {
      if (m) {
        let Ge = Zn(De, Ae), ot = m[Ge];
        if (typeof ot == "number") return ot;
      }
      return null;
    }
    function Dt(De, Ae, Ge) {
      if (u) if (De) {
        if (Object.keys(De[0].params).length > 0) return {
          active: true,
          matches: yD(Ae, Ge, c, true)
        };
      } else return {
        active: true,
        matches: yD(Ae, Ge, c, true) || []
      };
      return {
        active: false,
        matches: null
      };
    }
    async function Ut(De, Ae, Ge, ot) {
      if (!u) return {
        type: "success",
        matches: De
      };
      let Mt = De;
      for (; ; ) {
        let cn = l == null, un = l || s, gn = a;
        try {
          await u({
            signal: Ge,
            path: Ae,
            matches: Mt,
            fetcherKey: ot,
            patch: (It, Pt) => {
              Ge.aborted || FU(It, Pt, un, gn, i);
            }
          });
        } catch (It) {
          return {
            type: "error",
            error: It,
            partialMatches: Mt
          };
        } finally {
          cn && !Ge.aborted && (s = [
            ...s
          ]);
        }
        if (Ge.aborted) return {
          type: "aborted"
        };
        let Ke = ng(un, Ae, c);
        if (Ke) return {
          type: "success",
          matches: Ke
        };
        let it = yD(un, Ae, c, true);
        if (!it || Mt.length === it.length && Mt.every((It, Pt) => It.route.id === it[Pt].route.id)) return {
          type: "success",
          matches: null
        };
        Mt = it;
      }
    }
    function Zt(De) {
      a = {}, l = CC(De, i, void 0, a);
    }
    function ut(De, Ae) {
      let Ge = l == null;
      FU(De, Ae, l || s, a, i), Ge && (s = [
        ...s
      ], te({}));
    }
    return x = {
      get basename() {
        return c;
      },
      get future() {
        return h;
      },
      get state() {
        return S;
      },
      get routes() {
        return s;
      },
      get window() {
        return e;
      },
      initialize: K,
      subscribe: le,
      enableScrollRestoration: bn,
      navigate: he,
      fetch: lt,
      revalidate: se,
      createHref: (De) => t.history.createHref(De),
      encodeLocation: (De) => t.history.encodeLocation(De),
      getFetcher: Lt,
      deleteFetcher: st,
      dispose: G,
      getBlocker: tt,
      deleteBlocker: ht,
      patchRoutes: ut,
      _internalFetchControllers: H,
      _internalActiveDeferreds: ne,
      _internalSetRoutes: Zt
    }, x;
  }
  function ove(t) {
    return t != null && ("formData" in t && t.formData != null || "body" in t && t.body !== void 0);
  }
  function dR(t, e, n, r, i, a, s, l) {
    let c, d;
    if (s) {
      c = [];
      for (let h of e) if (c.push(h), h.route.id === s) {
        d = h;
        break;
      }
    } else c = e, d = e[e.length - 1];
    let u = F7(i || ".", p7(c, a), CF(t.pathname, n) || t.pathname, l === "path");
    if (i == null && (u.search = t.search, u.hash = t.hash), (i == null || i === "" || i === ".") && d) {
      let h = y7(u.search);
      if (d.route.index && !h) u.search = u.search ? u.search.replace(/^\?/, "?index&") : "?index";
      else if (!d.route.index && h) {
        let f = new URLSearchParams(u.search), g = f.getAll("index");
        f.delete("index"), g.filter((v) => v).forEach((v) => f.append("index", v));
        let m = f.toString();
        u.search = m ? "?" + m : "";
      }
    }
    return r && n !== "/" && (u.pathname = u.pathname === "/" ? n : Nu([
      n,
      u.pathname
    ])), Af(u);
  }
  function fU(t, e, n, r) {
    if (!r || !ove(r)) return {
      path: n
    };
    if (r.formMethod && !Fve(r.formMethod)) return {
      path: n,
      error: Cs(405, {
        method: r.formMethod
      })
    };
    let i = () => ({
      path: n,
      error: Cs(400, {
        type: "invalid-body"
      })
    }), a = r.formMethod || "get", s = t ? a.toUpperCase() : a.toLowerCase(), l = Fee(n);
    if (r.body !== void 0) {
      if (r.formEncType === "text/plain") {
        if (!wc(s)) return i();
        let f = typeof r.body == "string" ? r.body : r.body instanceof FormData || r.body instanceof URLSearchParams ? Array.from(r.body.entries()).reduce((g, m) => {
          let [v, y] = m;
          return "" + g + v + "=" + y + `
`;
        }, "") : String(r.body);
        return {
          path: n,
          submission: {
            formMethod: s,
            formAction: l,
            formEncType: r.formEncType,
            formData: void 0,
            json: void 0,
            text: f
          }
        };
      } else if (r.formEncType === "application/json") {
        if (!wc(s)) return i();
        try {
          let f = typeof r.body == "string" ? JSON.parse(r.body) : r.body;
          return {
            path: n,
            submission: {
              formMethod: s,
              formAction: l,
              formEncType: r.formEncType,
              formData: void 0,
              json: f,
              text: void 0
            }
          };
        } catch {
          return i();
        }
      }
    }
    Sr(typeof FormData == "function", "FormData is not available in this environment");
    let c, d;
    if (r.formData) c = hR(r.formData), d = r.formData;
    else if (r.body instanceof FormData) c = hR(r.body), d = r.body;
    else if (r.body instanceof URLSearchParams) c = r.body, d = _U(c);
    else if (r.body == null) c = new URLSearchParams(), d = new FormData();
    else try {
      c = new URLSearchParams(r.body), d = _U(c);
    } catch {
      return i();
    }
    let u = {
      formMethod: s,
      formAction: l,
      formEncType: r && r.formEncType || "application/x-www-form-urlencoded",
      formData: d,
      json: void 0,
      text: void 0
    };
    if (wc(u.formMethod)) return {
      path: n,
      submission: u
    };
    let h = uh(n);
    return e && h.search && y7(h.search) && c.append("index", ""), h.search = "?" + c, {
      path: Af(h),
      submission: u
    };
  }
  function mU(t, e, n) {
    n === void 0 && (n = false);
    let r = t.findIndex((i) => i.route.id === e);
    return r >= 0 ? t.slice(0, n ? r + 1 : r) : t;
  }
  function gU(t, e, n, r, i, a, s, l, c, d, u, h, f, g, m, v) {
    let y = v ? el(v[1]) ? v[1].error : v[1].data : void 0, w = t.createURL(e.location), b = t.createURL(i), j = n;
    a && e.errors ? j = mU(n, Object.keys(e.errors)[0], true) : v && el(v[1]) && (j = mU(n, v[0]));
    let k = v ? v[1].statusCode : void 0, C = s && k && k >= 400, x = j.filter((T, A) => {
      let { route: B } = T;
      if (B.lazy) return true;
      if (B.loader == null) return false;
      if (a) return uR(B, e.loaderData, e.errors);
      if (ave(e.loaderData, e.matches[A], T) || c.some((O) => O === T.route.id)) return true;
      let U = e.matches[A], z = T;
      return pU(T, Ai({
        currentUrl: w,
        currentParams: U.params,
        nextUrl: b,
        nextParams: z.params
      }, r, {
        actionResult: y,
        actionStatus: k,
        defaultShouldRevalidate: C ? false : l || w.pathname + w.search === b.pathname + b.search || w.search !== b.search || gee(U, z)
      }));
    }), S = [];
    return h.forEach((T, A) => {
      if (a || !n.some((M) => M.route.id === T.routeId) || u.has(A)) return;
      let B = ng(g, T.path, m);
      if (!B) {
        S.push({
          key: A,
          routeId: T.routeId,
          path: T.path,
          matches: null,
          match: null,
          controller: null
        });
        return;
      }
      let U = e.fetchers.get(A), z = cy(B, T.path), O = false;
      f.has(A) ? O = false : d.has(A) ? (d.delete(A), O = true) : U && U.state !== "idle" && U.data === void 0 ? O = l : O = pU(z, Ai({
        currentUrl: w,
        currentParams: e.matches[e.matches.length - 1].params,
        nextUrl: b,
        nextParams: n[n.length - 1].params
      }, r, {
        actionResult: y,
        actionStatus: k,
        defaultShouldRevalidate: C ? false : l
      })), O && S.push({
        key: A,
        routeId: T.routeId,
        path: T.path,
        matches: B,
        match: z,
        controller: new AbortController()
      });
    }), [
      x,
      S
    ];
  }
  function uR(t, e, n) {
    if (t.lazy) return true;
    if (!t.loader) return false;
    let r = e != null && e[t.id] !== void 0, i = n != null && n[t.id] !== void 0;
    return !r && i ? false : typeof t.loader == "function" && t.loader.hydrate === true ? true : !r && !i;
  }
  function ave(t, e, n) {
    let r = !e || n.route.id !== e.route.id, i = t[n.route.id] === void 0;
    return r || i;
  }
  function gee(t, e) {
    let n = t.route.path;
    return t.pathname !== e.pathname || n != null && n.endsWith("*") && t.params["*"] !== e.params["*"];
  }
  function pU(t, e) {
    if (t.route.shouldRevalidate) {
      let n = t.route.shouldRevalidate(e);
      if (typeof n == "boolean") return n;
    }
    return e.defaultShouldRevalidate;
  }
  function FU(t, e, n, r, i) {
    var a;
    let s;
    if (t) {
      let d = r[t];
      Sr(d, "No route found to patch children into: routeId = " + t), d.children || (d.children = []), s = d.children;
    } else s = n;
    let l = e.filter((d) => !s.some((u) => pee(d, u))), c = CC(l, i, [
      t || "_",
      "patch",
      String(((a = s) == null ? void 0 : a.length) || "0")
    ], r);
    s.push(...c);
  }
  function pee(t, e) {
    return "id" in t && "id" in e && t.id === e.id ? true : t.index === e.index && t.path === e.path && t.caseSensitive === e.caseSensitive ? (!t.children || t.children.length === 0) && (!e.children || e.children.length === 0) ? true : t.children.every((n, r) => {
      var i;
      return (i = e.children) == null ? void 0 : i.some((a) => pee(n, a));
    }) : false;
  }
  async function sve(t, e, n) {
    if (!t.lazy) return;
    let r = await t.lazy();
    if (!t.lazy) return;
    let i = n[t.id];
    Sr(i, "No route found in manifest");
    let a = {};
    for (let s in r) {
      let c = i[s] !== void 0 && s !== "hasErrorBoundary";
      Zu(!c, 'Route "' + i.id + '" has a static property "' + s + '" defined but its lazy function is also returning a value for this property. ' + ('The lazy route property "' + s + '" will be ignored.')), !c && !AFe.has(s) && (a[s] = r[s]);
    }
    Object.assign(i, a), Object.assign(i, Ai({}, e(i), {
      lazy: void 0
    }));
  }
  async function lve(t) {
    let { matches: e } = t, n = e.filter((i) => i.shouldLoad);
    return (await Promise.all(n.map((i) => i.resolve()))).reduce((i, a, s) => Object.assign(i, {
      [n[s].route.id]: a
    }), {});
  }
  async function cve(t, e, n, r, i, a, s, l, c, d) {
    let u = a.map((g) => g.route.lazy ? sve(g.route, c, l) : void 0), h = a.map((g, m) => {
      let v = u[m], y = i.some((b) => b.route.id === g.route.id);
      return Ai({}, g, {
        shouldLoad: y,
        resolve: async (b) => (b && r.method === "GET" && (g.route.lazy || g.route.loader) && (y = true), y ? dve(e, r, g, v, b, d) : Promise.resolve({
          type: ui.data,
          result: void 0
        }))
      });
    }), f = await t({
      matches: h,
      request: r,
      params: a[0].params,
      fetcherKey: s,
      context: d
    });
    try {
      await Promise.all(u);
    } catch {
    }
    return f;
  }
  async function dve(t, e, n, r, i, a) {
    let s, l, c = (d) => {
      let u, h = new Promise((m, v) => u = v);
      l = () => u(), e.signal.addEventListener("abort", l);
      let f = (m) => typeof d != "function" ? Promise.reject(new Error("You cannot call the handler for a route which defines a boolean " + ('"' + t + '" [routeId: ' + n.route.id + "]"))) : d({
        request: e,
        params: n.params,
        context: a
      }, ...m !== void 0 ? [
        m
      ] : []), g = (async () => {
        try {
          return {
            type: "data",
            result: await (i ? i((v) => f(v)) : f())
          };
        } catch (m) {
          return {
            type: "error",
            result: m
          };
        }
      })();
      return Promise.race([
        g,
        h
      ]);
    };
    try {
      let d = n.route[t];
      if (r) if (d) {
        let u, [h] = await Promise.all([
          c(d).catch((f) => {
            u = f;
          }),
          r
        ]);
        if (u !== void 0) throw u;
        s = h;
      } else if (await r, d = n.route[t], d) s = await c(d);
      else if (t === "action") {
        let u = new URL(e.url), h = u.pathname + u.search;
        throw Cs(405, {
          method: e.method,
          pathname: h,
          routeId: n.route.id
        });
      } else return {
        type: ui.data,
        result: void 0
      };
      else if (d) s = await c(d);
      else {
        let u = new URL(e.url), h = u.pathname + u.search;
        throw Cs(404, {
          pathname: h
        });
      }
      Sr(s.result !== void 0, "You defined " + (t === "action" ? "an action" : "a loader") + " for route " + ('"' + n.route.id + "\" but didn't return anything from your `" + t + "` ") + "function. Please return a value or `null`.");
    } catch (d) {
      return {
        type: ui.error,
        result: d
      };
    } finally {
      l && e.signal.removeEventListener("abort", l);
    }
    return s;
  }
  async function uve(t) {
    let { result: e, type: n } = t;
    if (vee(e)) {
      let h;
      try {
        let f = e.headers.get("Content-Type");
        f && /\bapplication\/json\b/.test(f) ? e.body == null ? h = null : h = await e.json() : h = await e.text();
      } catch (f) {
        return {
          type: ui.error,
          error: f
        };
      }
      return n === ui.error ? {
        type: ui.error,
        error: new EC(e.status, e.statusText, h),
        statusCode: e.status,
        headers: e.headers
      } : {
        type: ui.data,
        data: h,
        statusCode: e.status,
        headers: e.headers
      };
    }
    if (n === ui.error) {
      if (DU(e)) {
        var r, i;
        if (e.data instanceof Error) {
          var a, s;
          return {
            type: ui.error,
            error: e.data,
            statusCode: (a = e.init) == null ? void 0 : a.status,
            headers: (s = e.init) != null && s.headers ? new Headers(e.init.headers) : void 0
          };
        }
        return {
          type: ui.error,
          error: new EC(((r = e.init) == null ? void 0 : r.status) || 500, void 0, e.data),
          statusCode: b2(e) ? e.status : void 0,
          headers: (i = e.init) != null && i.headers ? new Headers(e.init.headers) : void 0
        };
      }
      return {
        type: ui.error,
        error: e,
        statusCode: b2(e) ? e.status : void 0
      };
    }
    if (pve(e)) {
      var l, c;
      return {
        type: ui.deferred,
        deferredData: e,
        statusCode: (l = e.init) == null ? void 0 : l.status,
        headers: ((c = e.init) == null ? void 0 : c.headers) && new Headers(e.init.headers)
      };
    }
    if (DU(e)) {
      var d, u;
      return {
        type: ui.data,
        data: e.data,
        statusCode: (d = e.init) == null ? void 0 : d.status,
        headers: (u = e.init) != null && u.headers ? new Headers(e.init.headers) : void 0
      };
    }
    return {
      type: ui.data,
      data: e
    };
  }
  function hve(t, e, n, r, i, a) {
    let s = t.headers.get("Location");
    if (Sr(s, "Redirects returned/thrown from loaders/actions must have a Location header"), !v7.test(s)) {
      let l = r.slice(0, r.findIndex((c) => c.route.id === n) + 1);
      s = dR(new URL(e.url), l, i, true, s, a), t.headers.set("Location", s);
    }
    return t;
  }
  function vU(t, e, n, r) {
    let i = [
      "about:",
      "blob:",
      "chrome:",
      "chrome-untrusted:",
      "content:",
      "data:",
      "devtools:",
      "file:",
      "filesystem:",
      "javascript:"
    ];
    if (v7.test(t)) {
      let a = t, s = a.startsWith("//") ? new URL(e.protocol + a) : new URL(a);
      if (i.includes(s.protocol)) throw new Error("Invalid redirect location");
      let l = CF(s.pathname, n) != null;
      if (s.origin === e.origin && l) return s.pathname + s.search + s.hash;
    }
    try {
      let a = r.createURL(t);
      if (i.includes(a.protocol)) throw new Error("Invalid redirect location");
    } catch {
    }
    return t;
  }
  function a0(t, e, n, r) {
    let i = t.createURL(Fee(e)).toString(), a = {
      signal: n
    };
    if (r && wc(r.formMethod)) {
      let { formMethod: s, formEncType: l } = r;
      a.method = s.toUpperCase(), l === "application/json" ? (a.headers = new Headers({
        "Content-Type": l
      }), a.body = JSON.stringify(r.json)) : l === "text/plain" ? a.body = r.text : l === "application/x-www-form-urlencoded" && r.formData ? a.body = hR(r.formData) : a.body = r.formData;
    }
    return new Request(i, a);
  }
  function hR(t) {
    let e = new URLSearchParams();
    for (let [n, r] of t.entries()) e.append(n, typeof r == "string" ? r : r.name);
    return e;
  }
  function _U(t) {
    let e = new FormData();
    for (let [n, r] of t.entries()) e.append(n, r);
    return e;
  }
  function fve(t, e, n, r, i) {
    let a = {}, s = null, l, c = false, d = {}, u = n && el(n[1]) ? n[1].error : void 0;
    return t.forEach((h) => {
      if (!(h.route.id in e)) return;
      let f = h.route.id, g = e[f];
      if (Sr(!lg(g), "Cannot handle redirect results in processLoaderData"), el(g)) {
        let m = g.error;
        u !== void 0 && (m = u, u = void 0), s = s || {};
        {
          let v = rg(t, f);
          s[v.route.id] == null && (s[v.route.id] = m);
        }
        a[f] = void 0, c || (c = true, l = b2(g.error) ? g.error.status : 500), g.headers && (d[f] = g.headers);
      } else mf(g) ? (r.set(f, g.deferredData), a[f] = g.deferredData.data, g.statusCode != null && g.statusCode !== 200 && !c && (l = g.statusCode), g.headers && (d[f] = g.headers)) : (a[f] = g.data, g.statusCode && g.statusCode !== 200 && !c && (l = g.statusCode), g.headers && (d[f] = g.headers));
    }), u !== void 0 && n && (s = {
      [n[0]]: u
    }, a[n[0]] = void 0), {
      loaderData: a,
      errors: s,
      statusCode: l || 200,
      loaderHeaders: d
    };
  }
  function yU(t, e, n, r, i, a, s) {
    let { loaderData: l, errors: c } = fve(e, n, r, s);
    return i.forEach((d) => {
      let { key: u, match: h, controller: f } = d, g = a[u];
      if (Sr(g, "Did not find corresponding fetcher result"), !(f && f.signal.aborted)) if (el(g)) {
        let m = rg(t.matches, h == null ? void 0 : h.route.id);
        c && c[m.route.id] || (c = Ai({}, c, {
          [m.route.id]: g.error
        })), t.fetchers.delete(u);
      } else if (lg(g)) Sr(false, "Unhandled fetcher revalidation redirect");
      else if (mf(g)) Sr(false, "Unhandled fetcher deferred data");
      else {
        let m = Xh(g.data);
        t.fetchers.set(u, m);
      }
    }), {
      loaderData: l,
      errors: c
    };
  }
  function bU(t, e, n, r) {
    let i = Ai({}, e);
    for (let a of n) {
      let s = a.route.id;
      if (e.hasOwnProperty(s) ? e[s] !== void 0 && (i[s] = e[s]) : t[s] !== void 0 && a.route.loader && (i[s] = t[s]), r && r.hasOwnProperty(s)) break;
    }
    return i;
  }
  function xU(t) {
    return t ? el(t[1]) ? {
      actionData: {}
    } : {
      actionData: {
        [t[0]]: t[1].data
      }
    } : {};
  }
  function rg(t, e) {
    return (e ? t.slice(0, t.findIndex((r) => r.route.id === e) + 1) : [
      ...t
    ]).reverse().find((r) => r.route.hasErrorBoundary === true) || t[0];
  }
  function wU(t) {
    let e = t.length === 1 ? t[0] : t.find((n) => n.index || !n.path || n.path === "/") || {
      id: "__shim-error-route__"
    };
    return {
      matches: [
        {
          params: {},
          pathname: "",
          pathnameBase: "",
          route: e
        }
      ],
      route: e
    };
  }
  function Cs(t, e) {
    let { pathname: n, routeId: r, method: i, type: a, message: s } = e === void 0 ? {} : e, l = "Unknown Server Error", c = "Unknown @remix-run/router error";
    return t === 400 ? (l = "Bad Request", i && n && r ? c = "You made a " + i + ' request to "' + n + '" but ' + ('did not provide a `loader` for route "' + r + '", ') + "so there is no way to handle the request." : a === "defer-action" ? c = "defer() is not supported in actions" : a === "invalid-body" && (c = "Unable to encode submission body")) : t === 403 ? (l = "Forbidden", c = 'Route "' + r + '" does not match URL "' + n + '"') : t === 404 ? (l = "Not Found", c = 'No route matches URL "' + n + '"') : t === 405 && (l = "Method Not Allowed", i && n && r ? c = "You made a " + i.toUpperCase() + ' request to "' + n + '" but ' + ('did not provide an `action` for route "' + r + '", ') + "so there is no way to handle the request." : i && (c = 'Invalid request method "' + i.toUpperCase() + '"')), new EC(t || 500, l, new Error(c), true);
  }
  function Lx(t) {
    let e = Object.entries(t);
    for (let n = e.length - 1; n >= 0; n--) {
      let [r, i] = e[n];
      if (lg(i)) return {
        key: r,
        result: i
      };
    }
  }
  function Fee(t) {
    let e = typeof t == "string" ? uh(t) : t;
    return Af(Ai({}, e, {
      hash: ""
    }));
  }
  function mve(t, e) {
    return t.pathname !== e.pathname || t.search !== e.search ? false : t.hash === "" ? e.hash !== "" : t.hash === e.hash ? true : e.hash !== "";
  }
  function gve(t) {
    return vee(t.result) && tve.has(t.result.status);
  }
  function mf(t) {
    return t.type === ui.deferred;
  }
  function el(t) {
    return t.type === ui.error;
  }
  function lg(t) {
    return (t && t.type) === ui.redirect;
  }
  function DU(t) {
    return typeof t == "object" && t != null && "type" in t && "data" in t && "init" in t && t.type === "DataWithResponseInit";
  }
  function pve(t) {
    let e = t;
    return e && typeof e == "object" && typeof e.data == "object" && typeof e.subscribe == "function" && typeof e.cancel == "function" && typeof e.resolveData == "function";
  }
  function vee(t) {
    return t != null && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.headers == "object" && typeof t.body < "u";
  }
  function Fve(t) {
    return eve.has(t.toLowerCase());
  }
  function wc(t) {
    return XFe.has(t.toLowerCase());
  }
  async function vve(t, e, n, r, i) {
    let a = Object.entries(e);
    for (let s = 0; s < a.length; s++) {
      let [l, c] = a[s], d = t.find((f) => (f == null ? void 0 : f.route.id) === l);
      if (!d) continue;
      let u = r.find((f) => f.route.id === d.route.id), h = u != null && !gee(u, d) && (i && i[d.route.id]) !== void 0;
      mf(c) && h && await _7(c, n, false).then((f) => {
        f && (e[l] = f);
      });
    }
  }
  async function _ve(t, e, n) {
    for (let r = 0; r < n.length; r++) {
      let { key: i, routeId: a, controller: s } = n[r], l = e[i];
      t.find((d) => (d == null ? void 0 : d.route.id) === a) && mf(l) && (Sr(s, "Expected an AbortController for revalidating fetcher deferred result"), await _7(l, s.signal, true).then((d) => {
        d && (e[i] = d);
      }));
    }
  }
  async function _7(t, e, n) {
    if (n === void 0 && (n = false), !await t.deferredData.resolveData(e)) {
      if (n) try {
        return {
          type: ui.data,
          data: t.deferredData.unwrappedData
        };
      } catch (i) {
        return {
          type: ui.error,
          error: i
        };
      }
      return {
        type: ui.data,
        data: t.deferredData.data
      };
    }
  }
  function y7(t) {
    return new URLSearchParams(t).getAll("index").some((e) => e === "");
  }
  function cy(t, e) {
    let n = typeof e == "string" ? uh(e).search : e.search;
    if (t[t.length - 1].route.index && y7(n || "")) return t[t.length - 1];
    let r = uee(t);
    return r[r.length - 1];
  }
  function CU(t) {
    let { formMethod: e, formAction: n, formEncType: r, text: i, formData: a, json: s } = t;
    if (!(!e || !n || !r)) {
      if (i != null) return {
        formMethod: e,
        formAction: n,
        formEncType: r,
        formData: void 0,
        json: void 0,
        text: i
      };
      if (a != null) return {
        formMethod: e,
        formAction: n,
        formEncType: r,
        formData: a,
        json: void 0,
        text: void 0
      };
      if (s !== void 0) return {
        formMethod: e,
        formAction: n,
        formEncType: r,
        formData: void 0,
        json: s,
        text: void 0
      };
    }
  }
  function kj(t, e) {
    return e ? {
      state: "loading",
      location: t,
      formMethod: e.formMethod,
      formAction: e.formAction,
      formEncType: e.formEncType,
      formData: e.formData,
      json: e.json,
      text: e.text
    } : {
      state: "loading",
      location: t,
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0
    };
  }
  function yve(t, e) {
    return {
      state: "submitting",
      location: t,
      formMethod: e.formMethod,
      formAction: e.formAction,
      formEncType: e.formEncType,
      formData: e.formData,
      json: e.json,
      text: e.text
    };
  }
  function Jv(t, e) {
    return t ? {
      state: "loading",
      formMethod: t.formMethod,
      formAction: t.formAction,
      formEncType: t.formEncType,
      formData: t.formData,
      json: t.json,
      text: t.text,
      data: e
    } : {
      state: "loading",
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0,
      data: e
    };
  }
  function bve(t, e) {
    return {
      state: "submitting",
      formMethod: t.formMethod,
      formAction: t.formAction,
      formEncType: t.formEncType,
      formData: t.formData,
      json: t.json,
      text: t.text,
      data: e ? e.data : void 0
    };
  }
  function Xh(t) {
    return {
      state: "idle",
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0,
      data: t
    };
  }
  function xve(t, e) {
    try {
      let n = t.sessionStorage.getItem(fee);
      if (n) {
        let r = JSON.parse(n);
        for (let [i, a] of Object.entries(r || {})) a && Array.isArray(a) && e.set(i, new Set(a || []));
      }
    } catch {
    }
  }
  function wve(t, e) {
    if (e.size > 0) {
      let n = {};
      for (let [r, i] of e) n[r] = [
        ...i
      ];
      try {
        t.sessionStorage.setItem(fee, JSON.stringify(n));
      } catch (r) {
        Zu(false, "Failed to save applied view transitions in sessionStorage (" + r + ").");
      }
    }
  }
  function kC() {
    return kC = Object.assign ? Object.assign.bind() : function(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e];
        for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
      }
      return t;
    }, kC.apply(this, arguments);
  }
  const KE = p.createContext(null), _ee = p.createContext(null), fp = p.createContext(null), b7 = p.createContext(null), hh = p.createContext({
    outlet: null,
    matches: [],
    isDataRoute: false
  }), yee = p.createContext(null);
  function Dve(t, e) {
    let { relative: n } = e === void 0 ? {} : e;
    EF() || Sr(false);
    let { basename: r, navigator: i } = p.useContext(fp), { hash: a, pathname: s, search: l } = wee(t, {
      relative: n
    }), c = s;
    return r !== "/" && (c = s === "/" ? r : Nu([
      r,
      s
    ])), i.createHref({
      pathname: c,
      search: l,
      hash: a
    });
  }
  function EF() {
    return p.useContext(b7) != null;
  }
  function Za() {
    return EF() || Sr(false), p.useContext(b7).location;
  }
  function Ko(t) {
    EF() || Sr(false);
    let { pathname: e } = Za();
    return p.useMemo(() => Wo(t, dee(e)), [
      e,
      t
    ]);
  }
  function bee(t) {
    p.useContext(fp).static || p.useLayoutEffect(t);
  }
  function br() {
    let { isDataRoute: t } = p.useContext(hh);
    return t ? Ove() : Cve();
  }
  function Cve() {
    EF() || Sr(false);
    let t = p.useContext(KE), { basename: e, future: n, navigator: r } = p.useContext(fp), { matches: i } = p.useContext(hh), { pathname: a } = Za(), s = JSON.stringify(p7(i, n.v7_relativeSplatPath)), l = p.useRef(false);
    return bee(() => {
      l.current = true;
    }), p.useCallback(function(d, u) {
      if (u === void 0 && (u = {}), !l.current) return;
      if (typeof d == "number") {
        r.go(d);
        return;
      }
      let h = F7(d, JSON.parse(s), a, u.relative === "path");
      t == null && e !== "/" && (h.pathname = h.pathname === "/" ? e : Nu([
        e,
        h.pathname
      ])), (u.replace ? r.replace : r.push)(h, u.state, u);
    }, [
      e,
      r,
      s,
      a,
      t
    ]);
  }
  const Eve = p.createContext(null);
  function xee(t) {
    let e = p.useContext(hh).outlet;
    return e && p.createElement(Eve.Provider, {
      value: t
    }, e);
  }
  function Fl() {
    let { matches: t } = p.useContext(hh), e = t[t.length - 1];
    return e ? e.params : {};
  }
  function wee(t, e) {
    let { relative: n } = e === void 0 ? {} : e, { future: r } = p.useContext(fp), { matches: i } = p.useContext(hh), { pathname: a } = Za(), s = JSON.stringify(p7(i, r.v7_relativeSplatPath));
    return p.useMemo(() => F7(t, JSON.parse(s), a, n === "path"), [
      t,
      s,
      a,
      n
    ]);
  }
  function kve(t, e, n, r) {
    EF() || Sr(false);
    let { navigator: i } = p.useContext(fp), { matches: a } = p.useContext(hh), s = a[a.length - 1], l = s ? s.params : {};
    s && s.pathname;
    let c = s ? s.pathnameBase : "/";
    s && s.route;
    let d = Za(), u;
    u = d;
    let h = u.pathname || "/", f = h;
    if (c !== "/") {
      let v = c.replace(/^\//, "").split("/");
      f = "/" + h.replace(/^\//, "").split("/").slice(v.length).join("/");
    }
    let g = ng(t, {
      pathname: f
    });
    return Ave(g && g.map((v) => Object.assign({}, v, {
      params: Object.assign({}, l, v.params),
      pathname: Nu([
        c,
        i.encodeLocation ? i.encodeLocation(v.pathname).pathname : v.pathname
      ]),
      pathnameBase: v.pathnameBase === "/" ? c : Nu([
        c,
        i.encodeLocation ? i.encodeLocation(v.pathnameBase).pathname : v.pathnameBase
      ])
    })), a, n, r);
  }
  function Sve() {
    let t = Mve(), e = b2(t) ? t.status + " " + t.statusText : t instanceof Error ? t.message : JSON.stringify(t), n = t instanceof Error ? t.stack : null, i = {
      padding: "0.5rem",
      backgroundColor: "rgba(200,200,200, 0.5)"
    };
    return p.createElement(p.Fragment, null, p.createElement("h2", null, "Unexpected Application Error!"), p.createElement("h3", {
      style: {
        fontStyle: "italic"
      }
    }, e), n ? p.createElement("pre", {
      style: i
    }, n) : null, null);
  }
  const jve = p.createElement(Sve, null);
  class Tve extends p.Component {
    constructor(e) {
      super(e), this.state = {
        location: e.location,
        revalidation: e.revalidation,
        error: e.error
      };
    }
    static getDerivedStateFromError(e) {
      return {
        error: e
      };
    }
    static getDerivedStateFromProps(e, n) {
      return n.location !== e.location || n.revalidation !== "idle" && e.revalidation === "idle" ? {
        error: e.error,
        location: e.location,
        revalidation: e.revalidation
      } : {
        error: e.error !== void 0 ? e.error : n.error,
        location: n.location,
        revalidation: e.revalidation || n.revalidation
      };
    }
    componentDidCatch(e, n) {
      console.error("React Router caught the following error during render", e, n);
    }
    render() {
      return this.state.error !== void 0 ? p.createElement(hh.Provider, {
        value: this.props.routeContext
      }, p.createElement(yee.Provider, {
        value: this.state.error,
        children: this.props.component
      })) : this.props.children;
    }
  }
  function Rve(t) {
    let { routeContext: e, match: n, children: r } = t, i = p.useContext(KE);
    return i && i.static && i.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (i.staticContext._deepestRenderedBoundaryId = n.route.id), p.createElement(hh.Provider, {
      value: e
    }, r);
  }
  function Ave(t, e, n, r) {
    var i;
    if (e === void 0 && (e = []), n === void 0 && (n = null), r === void 0 && (r = null), t == null) {
      var a;
      if (!n) return null;
      if (n.errors) t = n.matches;
      else if ((a = r) != null && a.v7_partialHydration && e.length === 0 && !n.initialized && n.matches.length > 0) t = n.matches;
      else return null;
    }
    let s = t, l = (i = n) == null ? void 0 : i.errors;
    if (l != null) {
      let u = s.findIndex((h) => h.route.id && (l == null ? void 0 : l[h.route.id]) !== void 0);
      u >= 0 || Sr(false), s = s.slice(0, Math.min(s.length, u + 1));
    }
    let c = false, d = -1;
    if (n && r && r.v7_partialHydration) for (let u = 0; u < s.length; u++) {
      let h = s[u];
      if ((h.route.HydrateFallback || h.route.hydrateFallbackElement) && (d = u), h.route.id) {
        let { loaderData: f, errors: g } = n, m = h.route.loader && f[h.route.id] === void 0 && (!g || g[h.route.id] === void 0);
        if (h.route.lazy || m) {
          c = true, d >= 0 ? s = s.slice(0, d + 1) : s = [
            s[0]
          ];
          break;
        }
      }
    }
    return s.reduceRight((u, h, f) => {
      let g, m = false, v = null, y = null;
      n && (g = l && h.route.id ? l[h.route.id] : void 0, v = h.route.errorElement || jve, c && (d < 0 && f === 0 ? (Lve("route-fallback"), m = true, y = null) : d === f && (m = true, y = h.route.hydrateFallbackElement || null)));
      let w = e.concat(s.slice(0, f + 1)), b = () => {
        let j;
        return g ? j = v : m ? j = y : h.route.Component ? j = p.createElement(h.route.Component, null) : h.route.element ? j = h.route.element : j = u, p.createElement(Rve, {
          match: h,
          routeContext: {
            outlet: u,
            matches: w,
            isDataRoute: n != null
          },
          children: j
        });
      };
      return n && (h.route.ErrorBoundary || h.route.errorElement || f === 0) ? p.createElement(Tve, {
        location: n.location,
        revalidation: n.revalidation,
        component: v,
        error: g,
        children: b(),
        routeContext: {
          outlet: null,
          matches: w,
          isDataRoute: true
        }
      }) : b();
    }, null);
  }
  var Dee = (function(t) {
    return t.UseBlocker = "useBlocker", t.UseRevalidator = "useRevalidator", t.UseNavigateStable = "useNavigate", t;
  })(Dee || {}), Cee = (function(t) {
    return t.UseBlocker = "useBlocker", t.UseLoaderData = "useLoaderData", t.UseActionData = "useActionData", t.UseRouteError = "useRouteError", t.UseNavigation = "useNavigation", t.UseRouteLoaderData = "useRouteLoaderData", t.UseMatches = "useMatches", t.UseRevalidator = "useRevalidator", t.UseNavigateStable = "useNavigate", t.UseRouteId = "useRouteId", t;
  })(Cee || {});
  function Ive(t) {
    let e = p.useContext(KE);
    return e || Sr(false), e;
  }
  function Bve(t) {
    let e = p.useContext(_ee);
    return e || Sr(false), e;
  }
  function Pve(t) {
    let e = p.useContext(hh);
    return e || Sr(false), e;
  }
  function Eee(t) {
    let e = Pve(), n = e.matches[e.matches.length - 1];
    return n.route.id || Sr(false), n.route.id;
  }
  function Mve() {
    var t;
    let e = p.useContext(yee), n = Bve(), r = Eee();
    return e !== void 0 ? e : (t = n.errors) == null ? void 0 : t[r];
  }
  function Ove() {
    let { router: t } = Ive(Dee.UseNavigateStable), e = Eee(Cee.UseNavigateStable), n = p.useRef(false);
    return bee(() => {
      n.current = true;
    }), p.useCallback(function(i, a) {
      a === void 0 && (a = {}), n.current && (typeof i == "number" ? t.navigate(i) : t.navigate(i, kC({
        fromRouteId: e
      }, a)));
    }, [
      t,
      e
    ]);
  }
  const EU = {};
  function Lve(t, e, n) {
    EU[t] || (EU[t] = true);
  }
  function Nve(t, e) {
    t == null ? void 0 : t.v7_startTransition, (t == null ? void 0 : t.v7_relativeSplatPath) === void 0 && (!e || e.v7_relativeSplatPath), e && (e.v7_fetcherPersist, e.v7_normalizeFormMethod, e.v7_partialHydration, e.v7_skipActionErrorRevalidation);
  }
  function I0(t) {
    return xee(t.context);
  }
  function Nr(t) {
    Sr(false);
  }
  function zve(t) {
    let { basename: e = "/", children: n = null, location: r, navigationType: i = ko.Pop, navigator: a, static: s = false, future: l } = t;
    EF() && Sr(false);
    let c = e.replace(/^\/*/, "/"), d = p.useMemo(() => ({
      basename: c,
      navigator: a,
      static: s,
      future: kC({
        v7_relativeSplatPath: false
      }, l)
    }), [
      c,
      l,
      a,
      s
    ]);
    typeof r == "string" && (r = uh(r));
    let { pathname: u = "/", search: h = "", hash: f = "", state: g = null, key: m = "default" } = r, v = p.useMemo(() => {
      let y = CF(u, c);
      return y == null ? null : {
        location: {
          pathname: y,
          search: h,
          hash: f,
          state: g,
          key: m
        },
        navigationType: i
      };
    }, [
      c,
      u,
      h,
      f,
      g,
      m,
      i
    ]);
    return v == null ? null : p.createElement(fp.Provider, {
      value: d
    }, p.createElement(b7.Provider, {
      children: n,
      value: v
    }));
  }
  new Promise(() => {
  });
  function fR(t, e) {
    e === void 0 && (e = []);
    let n = [];
    return p.Children.forEach(t, (r, i) => {
      if (!p.isValidElement(r)) return;
      let a = [
        ...e,
        i
      ];
      if (r.type === p.Fragment) {
        n.push.apply(n, fR(r.props.children, a));
        return;
      }
      r.type !== Nr && Sr(false), !r.props.index || !r.props.children || Sr(false);
      let s = {
        id: r.props.id || a.join("-"),
        caseSensitive: r.props.caseSensitive,
        element: r.props.element,
        Component: r.props.Component,
        index: r.props.index,
        path: r.props.path,
        loader: r.props.loader,
        action: r.props.action,
        errorElement: r.props.errorElement,
        ErrorBoundary: r.props.ErrorBoundary,
        hasErrorBoundary: r.props.ErrorBoundary != null || r.props.errorElement != null,
        shouldRevalidate: r.props.shouldRevalidate,
        handle: r.props.handle,
        lazy: r.props.lazy
      };
      r.props.children && (s.children = fR(r.props.children, a)), n.push(s);
    }), n;
  }
  function kee(t) {
    let e = {
      hasErrorBoundary: t.ErrorBoundary != null || t.errorElement != null
    };
    return t.Component && Object.assign(e, {
      element: p.createElement(t.Component),
      Component: void 0
    }), t.HydrateFallback && Object.assign(e, {
      hydrateFallbackElement: p.createElement(t.HydrateFallback),
      HydrateFallback: void 0
    }), t.ErrorBoundary && Object.assign(e, {
      errorElement: p.createElement(t.ErrorBoundary),
      ErrorBoundary: void 0
    }), e;
  }
  function B1() {
    return B1 = Object.assign ? Object.assign.bind() : function(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e];
        for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
      }
      return t;
    }, B1.apply(this, arguments);
  }
  function Uve(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function Vve(t) {
    return !!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey);
  }
  function Hve(t, e) {
    return t.button === 0 && (!e || e === "_self") && !Vve(t);
  }
  function mR(t) {
    return t === void 0 && (t = ""), new URLSearchParams(typeof t == "string" || Array.isArray(t) || t instanceof URLSearchParams ? t : Object.keys(t).reduce((e, n) => {
      let r = t[n];
      return e.concat(Array.isArray(r) ? r.map((i) => [
        n,
        i
      ]) : [
        [
          n,
          r
        ]
      ]);
    }, []));
  }
  function $ve(t, e) {
    let n = mR(t);
    return e && e.forEach((r, i) => {
      n.has(i) || e.getAll(i).forEach((a) => {
        n.append(i, a);
      });
    }), n;
  }
  const Wve = [
    "onClick",
    "relative",
    "reloadDocument",
    "replace",
    "state",
    "target",
    "to",
    "preventScrollReset",
    "viewTransition"
  ], qve = "6";
  try {
    window.__reactRouterVersion = qve;
  } catch {
  }
  function Kve(t, e) {
    return mee({
      basename: e == null ? void 0 : e.basename,
      future: B1({}, e == null ? void 0 : e.future, {
        v7_prependBasename: true
      }),
      history: jFe({
        window: e == null ? void 0 : e.window
      }),
      hydrationData: (e == null ? void 0 : e.hydrationData) || See(),
      routes: t,
      mapRouteProperties: kee,
      dataStrategy: e == null ? void 0 : e.dataStrategy,
      patchRoutesOnNavigation: e == null ? void 0 : e.patchRoutesOnNavigation,
      window: e == null ? void 0 : e.window
    }).initialize();
  }
  function Gve(t, e) {
    return mee({
      basename: e == null ? void 0 : e.basename,
      future: B1({}, e == null ? void 0 : e.future, {
        v7_prependBasename: true
      }),
      history: TFe({
        window: e == null ? void 0 : e.window
      }),
      hydrationData: (e == null ? void 0 : e.hydrationData) || See(),
      routes: t,
      mapRouteProperties: kee,
      dataStrategy: e == null ? void 0 : e.dataStrategy,
      patchRoutesOnNavigation: e == null ? void 0 : e.patchRoutesOnNavigation,
      window: e == null ? void 0 : e.window
    }).initialize();
  }
  function See() {
    var t;
    let e = (t = window) == null ? void 0 : t.__staticRouterHydrationData;
    return e && e.errors && (e = B1({}, e, {
      errors: Yve(e.errors)
    })), e;
  }
  function Yve(t) {
    if (!t) return null;
    let e = Object.entries(t), n = {};
    for (let [r, i] of e) if (i && i.__type === "RouteErrorResponse") n[r] = new EC(i.status, i.statusText, i.data, i.internal === true);
    else if (i && i.__type === "Error") {
      if (i.__subType) {
        let a = window[i.__subType];
        if (typeof a == "function") try {
          let s = new a(i.message);
          s.stack = "", n[r] = s;
        } catch {
        }
      }
      if (n[r] == null) {
        let a = new Error(i.message);
        a.stack = "", n[r] = a;
      }
    } else n[r] = i;
    return n;
  }
  const Zve = p.createContext({
    isTransitioning: false
  }), Jve = p.createContext(/* @__PURE__ */ new Map()), Xve = "startTransition", kU = yFe[Xve], Qve = "flushSync", SU = SFe[Qve];
  function e_e(t) {
    kU ? kU(t) : t();
  }
  function Xv(t) {
    SU ? SU(t) : t();
  }
  class t_e {
    constructor() {
      this.status = "pending", this.promise = new Promise((e, n) => {
        this.resolve = (r) => {
          this.status === "pending" && (this.status = "resolved", e(r));
        }, this.reject = (r) => {
          this.status === "pending" && (this.status = "rejected", n(r));
        };
      });
    }
  }
  function n_e(t) {
    let { fallbackElement: e, router: n, future: r } = t, [i, a] = p.useState(n.state), [s, l] = p.useState(), [c, d] = p.useState({
      isTransitioning: false
    }), [u, h] = p.useState(), [f, g] = p.useState(), [m, v] = p.useState(), y = p.useRef(/* @__PURE__ */ new Map()), { v7_startTransition: w } = r || {}, b = p.useCallback((T) => {
      w ? e_e(T) : T();
    }, [
      w
    ]), j = p.useCallback((T, A) => {
      let { deletedFetchers: B, flushSync: U, viewTransitionOpts: z } = A;
      T.fetchers.forEach((M, I) => {
        M.data !== void 0 && y.current.set(I, M.data);
      }), B.forEach((M) => y.current.delete(M));
      let O = n.window == null || n.window.document == null || typeof n.window.document.startViewTransition != "function";
      if (!z || O) {
        U ? Xv(() => a(T)) : b(() => a(T));
        return;
      }
      if (U) {
        Xv(() => {
          f && (u && u.resolve(), f.skipTransition()), d({
            isTransitioning: true,
            flushSync: true,
            currentLocation: z.currentLocation,
            nextLocation: z.nextLocation
          });
        });
        let M = n.window.document.startViewTransition(() => {
          Xv(() => a(T));
        });
        M.finished.finally(() => {
          Xv(() => {
            h(void 0), g(void 0), l(void 0), d({
              isTransitioning: false
            });
          });
        }), Xv(() => g(M));
        return;
      }
      f ? (u && u.resolve(), f.skipTransition(), v({
        state: T,
        currentLocation: z.currentLocation,
        nextLocation: z.nextLocation
      })) : (l(T), d({
        isTransitioning: true,
        flushSync: false,
        currentLocation: z.currentLocation,
        nextLocation: z.nextLocation
      }));
    }, [
      n.window,
      f,
      u,
      y,
      b
    ]);
    p.useLayoutEffect(() => n.subscribe(j), [
      n,
      j
    ]), p.useEffect(() => {
      c.isTransitioning && !c.flushSync && h(new t_e());
    }, [
      c
    ]), p.useEffect(() => {
      if (u && s && n.window) {
        let T = s, A = u.promise, B = n.window.document.startViewTransition(async () => {
          b(() => a(T)), await A;
        });
        B.finished.finally(() => {
          h(void 0), g(void 0), l(void 0), d({
            isTransitioning: false
          });
        }), g(B);
      }
    }, [
      b,
      s,
      u,
      n.window
    ]), p.useEffect(() => {
      u && s && i.location.key === s.location.key && u.resolve();
    }, [
      u,
      f,
      i.location,
      s
    ]), p.useEffect(() => {
      !c.isTransitioning && m && (l(m.state), d({
        isTransitioning: true,
        flushSync: false,
        currentLocation: m.currentLocation,
        nextLocation: m.nextLocation
      }), v(void 0));
    }, [
      c.isTransitioning,
      m
    ]), p.useEffect(() => {
    }, []);
    let k = p.useMemo(() => ({
      createHref: n.createHref,
      encodeLocation: n.encodeLocation,
      go: (T) => n.navigate(T),
      push: (T, A, B) => n.navigate(T, {
        state: A,
        preventScrollReset: B == null ? void 0 : B.preventScrollReset
      }),
      replace: (T, A, B) => n.navigate(T, {
        replace: true,
        state: A,
        preventScrollReset: B == null ? void 0 : B.preventScrollReset
      })
    }), [
      n
    ]), C = n.basename || "/", x = p.useMemo(() => ({
      router: n,
      navigator: k,
      static: false,
      basename: C
    }), [
      n,
      k,
      C
    ]), S = p.useMemo(() => ({
      v7_relativeSplatPath: n.future.v7_relativeSplatPath
    }), [
      n.future.v7_relativeSplatPath
    ]);
    return p.useEffect(() => Nve(r, n.future), [
      r,
      n.future
    ]), p.createElement(p.Fragment, null, p.createElement(KE.Provider, {
      value: x
    }, p.createElement(_ee.Provider, {
      value: i
    }, p.createElement(Jve.Provider, {
      value: y.current
    }, p.createElement(Zve.Provider, {
      value: c
    }, p.createElement(zve, {
      basename: C,
      location: i.location,
      navigationType: i.historyAction,
      navigator: k,
      future: S
    }, i.initialized || n.future.v7_partialHydration ? p.createElement(r_e, {
      routes: n.routes,
      future: n.future,
      state: i
    }) : e))))), null);
  }
  const r_e = p.memo(i_e);
  function i_e(t) {
    let { routes: e, future: n, state: r } = t;
    return kve(e, void 0, r, n);
  }
  const o_e = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", a_e = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Lb = p.forwardRef(function(e, n) {
    let { onClick: r, relative: i, reloadDocument: a, replace: s, state: l, target: c, to: d, preventScrollReset: u, viewTransition: h } = e, f = Uve(e, Wve), { basename: g } = p.useContext(fp), m, v = false;
    if (typeof d == "string" && a_e.test(d) && (m = d, o_e)) try {
      let j = new URL(window.location.href), k = d.startsWith("//") ? new URL(j.protocol + d) : new URL(d), C = CF(k.pathname, g);
      k.origin === j.origin && C != null ? d = C + k.search + k.hash : v = true;
    } catch {
    }
    let y = Dve(d, {
      relative: i
    }), w = s_e(d, {
      replace: s,
      state: l,
      target: c,
      preventScrollReset: u,
      relative: i,
      viewTransition: h
    });
    function b(j) {
      r && r(j), j.defaultPrevented || w(j);
    }
    return p.createElement("a", B1({}, f, {
      href: m || y,
      onClick: v || a ? r : b,
      ref: n,
      target: c
    }));
  });
  var jU;
  (function(t) {
    t.UseScrollRestoration = "useScrollRestoration", t.UseSubmit = "useSubmit", t.UseSubmitFetcher = "useSubmitFetcher", t.UseFetcher = "useFetcher", t.useViewTransitionState = "useViewTransitionState";
  })(jU || (jU = {}));
  var TU;
  (function(t) {
    t.UseFetcher = "useFetcher", t.UseFetchers = "useFetchers", t.UseScrollRestoration = "useScrollRestoration";
  })(TU || (TU = {}));
  function s_e(t, e) {
    let { target: n, replace: r, state: i, preventScrollReset: a, relative: s, viewTransition: l } = e === void 0 ? {} : e, c = br(), d = Za(), u = wee(t, {
      relative: s
    });
    return p.useCallback((h) => {
      if (Hve(h, n)) {
        h.preventDefault();
        let f = r !== void 0 ? r : Af(d) === Af(u);
        c(t, {
          replace: f,
          state: i,
          preventScrollReset: a,
          relative: s,
          viewTransition: l
        });
      }
    }, [
      d,
      c,
      u,
      r,
      i,
      n,
      t,
      a,
      s,
      l
    ]);
  }
  function fh(t) {
    let e = p.useRef(mR(t)), n = p.useRef(false), r = Za(), i = p.useMemo(() => $ve(r.search, n.current ? null : e.current), [
      r.search
    ]), a = br(), s = p.useCallback((l, c) => {
      const d = mR(typeof l == "function" ? l(i) : l);
      n.current = true, a("?" + d, c);
    }, [
      a,
      i
    ]);
    return [
      i,
      s
    ];
  }
  const l_e = localStorage.getItem("sable_sentry_enabled") === "true";
  localStorage.getItem("sable_sentry_replay_enabled");
  console.info(l_e ? "[Sentry] Disabled - no DSN provided" : "[Sentry] Disabled by user preference");
  var Nx = {}, RU;
  function c_e() {
    if (RU) return Nx;
    RU = 1;
    var t = oee();
    return Nx.createRoot = t.createRoot, Nx.hydrateRoot = t.hydrateRoot, Nx;
  }
  var d_e = c_e();
  function Ml(t) {
    for (var e = arguments.length, n = Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r];
    throw Error("[Immer] minified error nr: " + t + (n.length ? " " + n.map((function(i) {
      return "'" + i + "'";
    })).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
  }
  function P1(t) {
    return !!t && !!t[ai];
  }
  function Ju(t) {
    var e;
    return !!t && ((function(n) {
      if (!n || typeof n != "object") return false;
      var r = Object.getPrototypeOf(n);
      if (r === null) return true;
      var i = Object.hasOwnProperty.call(r, "constructor") && r.constructor;
      return i === Object || typeof i == "function" && Function.toString.call(i) === y_e;
    })(t) || Array.isArray(t) || !!t[LU] || !!(!((e = t.constructor) === null || e === void 0) && e[LU]) || x7(t) || w7(t));
  }
  function M1(t, e, n) {
    n === void 0 && (n = false), kF(t) === 0 ? (n ? Object.keys : S7)(t).forEach((function(r) {
      n && typeof r == "symbol" || e(r, t[r], t);
    })) : t.forEach((function(r, i) {
      return e(i, r, t);
    }));
  }
  function kF(t) {
    var e = t[ai];
    return e ? e.i > 3 ? e.i - 4 : e.i : Array.isArray(t) ? 1 : x7(t) ? 2 : w7(t) ? 3 : 0;
  }
  function gR(t, e) {
    return kF(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
  }
  function u_e(t, e) {
    return kF(t) === 2 ? t.get(e) : t[e];
  }
  function jee(t, e, n) {
    var r = kF(t);
    r === 2 ? t.set(e, n) : r === 3 ? t.add(n) : t[e] = n;
  }
  function h_e(t, e) {
    return t === e ? t !== 0 || 1 / t == 1 / e : t != t && e != e;
  }
  function x7(t) {
    return v_e && t instanceof Map;
  }
  function w7(t) {
    return __e && t instanceof Set;
  }
  function ta(t) {
    return t.o || t.t;
  }
  function D7(t) {
    if (Array.isArray(t)) return Array.prototype.slice.call(t);
    var e = b_e(t);
    delete e[ai];
    for (var n = S7(e), r = 0; r < n.length; r++) {
      var i = n[r], a = e[i];
      a.writable === false && (a.writable = true, a.configurable = true), (a.get || a.set) && (e[i] = {
        configurable: true,
        writable: true,
        enumerable: a.enumerable,
        value: t[i]
      });
    }
    return Object.create(Object.getPrototypeOf(t), e);
  }
  function C7(t, e) {
    return e === void 0 && (e = false), E7(t) || P1(t) || !Ju(t) || (kF(t) > 1 && (t.set = t.add = t.clear = t.delete = f_e), Object.freeze(t), e && M1(t, (function(n, r) {
      return C7(r, true);
    }), true)), t;
  }
  function f_e() {
    Ml(2);
  }
  function E7(t) {
    return t == null || typeof t != "object" || Object.isFrozen(t);
  }
  function Pd(t) {
    var e = FR[t];
    return e || Ml(18, t), e;
  }
  function m_e(t, e) {
    FR[t] || (FR[t] = e);
  }
  function SC() {
    return w2;
  }
  function Sj(t, e) {
    e && (Pd("Patches"), t.u = [], t.s = [], t.v = e);
  }
  function jC(t) {
    pR(t), t.p.forEach(g_e), t.p = null;
  }
  function pR(t) {
    t === w2 && (w2 = t.l);
  }
  function AU(t) {
    return w2 = {
      p: [],
      l: w2,
      h: t,
      m: true,
      _: 0
    };
  }
  function g_e(t) {
    var e = t[ai];
    e.i === 0 || e.i === 1 ? e.j() : e.g = true;
  }
  function jj(t, e) {
    e._ = e.p.length;
    var n = e.p[0], r = t !== void 0 && t !== n;
    return e.h.O || Pd("ES5").S(e, t, r), r ? (n[ai].P && (jC(e), Ml(4)), Ju(t) && (t = TC(e, t), e.l || RC(e, t)), e.u && Pd("Patches").M(n[ai].t, t, e.u, e.s)) : t = TC(e, n, []), jC(e), e.u && e.v(e.u, e.s), t !== Tee ? t : void 0;
  }
  function TC(t, e, n) {
    if (E7(e)) return e;
    var r = e[ai];
    if (!r) return M1(e, (function(l, c) {
      return IU(t, r, e, l, c, n);
    }), true), e;
    if (r.A !== t) return e;
    if (!r.P) return RC(t, r.t, true), r.t;
    if (!r.I) {
      r.I = true, r.A._--;
      var i = r.i === 4 || r.i === 5 ? r.o = D7(r.k) : r.o, a = i, s = false;
      r.i === 3 && (a = new Set(i), i.clear(), s = true), M1(a, (function(l, c) {
        return IU(t, r, i, l, c, n, s);
      })), RC(t, i, false), n && t.u && Pd("Patches").N(r, n, t.u, t.s);
    }
    return r.o;
  }
  function IU(t, e, n, r, i, a, s) {
    if (P1(i)) {
      var l = TC(t, i, a && e && e.i !== 3 && !gR(e.R, r) ? a.concat(r) : void 0);
      if (jee(n, r, l), !P1(l)) return;
      t.m = false;
    } else s && n.add(i);
    if (Ju(i) && !E7(i)) {
      if (!t.h.D && t._ < 1) return;
      TC(t, i), e && e.A.l || RC(t, i);
    }
  }
  function RC(t, e, n) {
    n === void 0 && (n = false), !t.l && t.h.D && t.m && C7(e, n);
  }
  function Tj(t, e) {
    var n = t[ai];
    return (n ? ta(n) : t)[e];
  }
  function BU(t, e) {
    if (e in t) for (var n = Object.getPrototypeOf(t); n; ) {
      var r = Object.getOwnPropertyDescriptor(n, e);
      if (r) return r;
      n = Object.getPrototypeOf(n);
    }
  }
  function Du(t) {
    t.P || (t.P = true, t.l && Du(t.l));
  }
  function Rj(t) {
    t.o || (t.o = D7(t.t));
  }
  function x2(t, e, n) {
    var r = x7(e) ? Pd("MapSet").F(e, n) : w7(e) ? Pd("MapSet").T(e, n) : t.O ? (function(i, a) {
      var s = Array.isArray(i), l = {
        i: s ? 1 : 0,
        A: a ? a.A : SC(),
        P: false,
        I: false,
        R: {},
        l: a,
        t: i,
        k: null,
        o: null,
        j: null,
        C: false
      }, c = l, d = vR;
      s && (c = [
        l
      ], d = dy);
      var u = Proxy.revocable(c, d), h = u.revoke, f = u.proxy;
      return l.k = f, l.j = h, f;
    })(e, n) : Pd("ES5").J(e, n);
    return (n ? n.A : SC()).p.push(r), r;
  }
  function p_e(t) {
    return P1(t) || Ml(22, t), (function e(n) {
      if (!Ju(n)) return n;
      var r, i = n[ai], a = kF(n);
      if (i) {
        if (!i.P && (i.i < 4 || !Pd("ES5").K(i))) return i.t;
        i.I = true, r = PU(n, a), i.I = false;
      } else r = PU(n, a);
      return M1(r, (function(s, l) {
        i && u_e(i.t, s) === l || jee(r, s, e(l));
      })), a === 3 ? new Set(r) : r;
    })(t);
  }
  function PU(t, e) {
    switch (e) {
      case 2:
        return new Map(t);
      case 3:
        return Array.from(t);
    }
    return D7(t);
  }
  function F_e() {
    function t(l, c) {
      function d() {
        this.constructor = l;
      }
      i(l, c), l.prototype = (d.prototype = c.prototype, new d());
    }
    function e(l) {
      l.o || (l.R = /* @__PURE__ */ new Map(), l.o = new Map(l.t));
    }
    function n(l) {
      l.o || (l.o = /* @__PURE__ */ new Set(), l.t.forEach((function(c) {
        if (Ju(c)) {
          var d = x2(l.A.h, c, l);
          l.p.set(c, d), l.o.add(d);
        } else l.o.add(c);
      })));
    }
    function r(l) {
      l.g && Ml(3, JSON.stringify(ta(l)));
    }
    var i = function(l, c) {
      return (i = Object.setPrototypeOf || {
        __proto__: []
      } instanceof Array && function(d, u) {
        d.__proto__ = u;
      } || function(d, u) {
        for (var h in u) u.hasOwnProperty(h) && (d[h] = u[h]);
      })(l, c);
    }, a = (function() {
      function l(d, u) {
        return this[ai] = {
          i: 2,
          l: u,
          A: u ? u.A : SC(),
          P: false,
          I: false,
          o: void 0,
          R: void 0,
          t: d,
          k: this,
          C: false,
          g: false
        }, this;
      }
      t(l, Map);
      var c = l.prototype;
      return Object.defineProperty(c, "size", {
        get: function() {
          return ta(this[ai]).size;
        }
      }), c.has = function(d) {
        return ta(this[ai]).has(d);
      }, c.set = function(d, u) {
        var h = this[ai];
        return r(h), ta(h).has(d) && ta(h).get(d) === u || (e(h), Du(h), h.R.set(d, true), h.o.set(d, u), h.R.set(d, true)), this;
      }, c.delete = function(d) {
        if (!this.has(d)) return false;
        var u = this[ai];
        return r(u), e(u), Du(u), u.t.has(d) ? u.R.set(d, false) : u.R.delete(d), u.o.delete(d), true;
      }, c.clear = function() {
        var d = this[ai];
        r(d), ta(d).size && (e(d), Du(d), d.R = /* @__PURE__ */ new Map(), M1(d.t, (function(u) {
          d.R.set(u, false);
        })), d.o.clear());
      }, c.forEach = function(d, u) {
        var h = this;
        ta(this[ai]).forEach((function(f, g) {
          d.call(u, h.get(g), g, h);
        }));
      }, c.get = function(d) {
        var u = this[ai];
        r(u);
        var h = ta(u).get(d);
        if (u.I || !Ju(h) || h !== u.t.get(d)) return h;
        var f = x2(u.A.h, h, u);
        return e(u), u.o.set(d, f), f;
      }, c.keys = function() {
        return ta(this[ai]).keys();
      }, c.values = function() {
        var d, u = this, h = this.keys();
        return (d = {})[zx] = function() {
          return u.values();
        }, d.next = function() {
          var f = h.next();
          return f.done ? f : {
            done: false,
            value: u.get(f.value)
          };
        }, d;
      }, c.entries = function() {
        var d, u = this, h = this.keys();
        return (d = {})[zx] = function() {
          return u.entries();
        }, d.next = function() {
          var f = h.next();
          if (f.done) return f;
          var g = u.get(f.value);
          return {
            done: false,
            value: [
              f.value,
              g
            ]
          };
        }, d;
      }, c[zx] = function() {
        return this.entries();
      }, l;
    })(), s = (function() {
      function l(d, u) {
        return this[ai] = {
          i: 3,
          l: u,
          A: u ? u.A : SC(),
          P: false,
          I: false,
          o: void 0,
          t: d,
          k: this,
          p: /* @__PURE__ */ new Map(),
          g: false,
          C: false
        }, this;
      }
      t(l, Set);
      var c = l.prototype;
      return Object.defineProperty(c, "size", {
        get: function() {
          return ta(this[ai]).size;
        }
      }), c.has = function(d) {
        var u = this[ai];
        return r(u), u.o ? !!u.o.has(d) || !(!u.p.has(d) || !u.o.has(u.p.get(d))) : u.t.has(d);
      }, c.add = function(d) {
        var u = this[ai];
        return r(u), this.has(d) || (n(u), Du(u), u.o.add(d)), this;
      }, c.delete = function(d) {
        if (!this.has(d)) return false;
        var u = this[ai];
        return r(u), n(u), Du(u), u.o.delete(d) || !!u.p.has(d) && u.o.delete(u.p.get(d));
      }, c.clear = function() {
        var d = this[ai];
        r(d), ta(d).size && (n(d), Du(d), d.o.clear());
      }, c.values = function() {
        var d = this[ai];
        return r(d), n(d), d.o.values();
      }, c.entries = function() {
        var d = this[ai];
        return r(d), n(d), d.o.entries();
      }, c.keys = function() {
        return this.values();
      }, c[zx] = function() {
        return this.values();
      }, c.forEach = function(d, u) {
        for (var h = this.values(), f = h.next(); !f.done; ) d.call(u, f.value, f.value, this), f = h.next();
      }, l;
    })();
    m_e("MapSet", {
      F: function(l, c) {
        return new a(l, c);
      },
      T: function(l, c) {
        return new s(l, c);
      }
    });
  }
  var MU, w2, k7 = typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol("x") == "symbol", v_e = typeof Map < "u", __e = typeof Set < "u", OU = typeof Proxy < "u" && Proxy.revocable !== void 0 && typeof Reflect < "u", Tee = k7 ? /* @__PURE__ */ Symbol.for("immer-nothing") : ((MU = {})["immer-nothing"] = true, MU), LU = k7 ? /* @__PURE__ */ Symbol.for("immer-draftable") : "__$immer_draftable", ai = k7 ? /* @__PURE__ */ Symbol.for("immer-state") : "__$immer_state", zx = typeof Symbol < "u" && Symbol.iterator || "@@iterator", y_e = "" + Object.prototype.constructor, S7 = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(t) {
    return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));
  } : Object.getOwnPropertyNames, b_e = Object.getOwnPropertyDescriptors || function(t) {
    var e = {};
    return S7(t).forEach((function(n) {
      e[n] = Object.getOwnPropertyDescriptor(t, n);
    })), e;
  }, FR = {}, vR = {
    get: function(t, e) {
      if (e === ai) return t;
      var n = ta(t);
      if (!gR(n, e)) return (function(i, a, s) {
        var l, c = BU(a, s);
        return c ? "value" in c ? c.value : (l = c.get) === null || l === void 0 ? void 0 : l.call(i.k) : void 0;
      })(t, n, e);
      var r = n[e];
      return t.I || !Ju(r) ? r : r === Tj(t.t, e) ? (Rj(t), t.o[e] = x2(t.A.h, r, t)) : r;
    },
    has: function(t, e) {
      return e in ta(t);
    },
    ownKeys: function(t) {
      return Reflect.ownKeys(ta(t));
    },
    set: function(t, e, n) {
      var r = BU(ta(t), e);
      if (r == null ? void 0 : r.set) return r.set.call(t.k, n), true;
      if (!t.P) {
        var i = Tj(ta(t), e), a = i == null ? void 0 : i[ai];
        if (a && a.t === n) return t.o[e] = n, t.R[e] = false, true;
        if (h_e(n, i) && (n !== void 0 || gR(t.t, e))) return true;
        Rj(t), Du(t);
      }
      return t.o[e] === n && (n !== void 0 || e in t.o) || Number.isNaN(n) && Number.isNaN(t.o[e]) || (t.o[e] = n, t.R[e] = true), true;
    },
    deleteProperty: function(t, e) {
      return Tj(t.t, e) !== void 0 || e in t.t ? (t.R[e] = false, Rj(t), Du(t)) : delete t.R[e], t.o && delete t.o[e], true;
    },
    getOwnPropertyDescriptor: function(t, e) {
      var n = ta(t), r = Reflect.getOwnPropertyDescriptor(n, e);
      return r && {
        writable: true,
        configurable: t.i !== 1 || e !== "length",
        enumerable: r.enumerable,
        value: n[e]
      };
    },
    defineProperty: function() {
      Ml(11);
    },
    getPrototypeOf: function(t) {
      return Object.getPrototypeOf(t.t);
    },
    setPrototypeOf: function() {
      Ml(12);
    }
  }, dy = {};
  M1(vR, (function(t, e) {
    dy[t] = function() {
      return arguments[0] = arguments[0][0], e.apply(this, arguments);
    };
  })), dy.deleteProperty = function(t, e) {
    return dy.set.call(this, t, e, void 0);
  }, dy.set = function(t, e, n) {
    return vR.set.call(this, t[0], e, n, t[0]);
  };
  var x_e = (function() {
    function t(n) {
      var r = this;
      this.O = OU, this.D = true, this.produce = function(i, a, s) {
        if (typeof i == "function" && typeof a != "function") {
          var l = a;
          a = i;
          var c = r;
          return function(v) {
            var y = this;
            v === void 0 && (v = l);
            for (var w = arguments.length, b = Array(w > 1 ? w - 1 : 0), j = 1; j < w; j++) b[j - 1] = arguments[j];
            return c.produce(v, (function(k) {
              var C;
              return (C = a).call.apply(C, [
                y,
                k
              ].concat(b));
            }));
          };
        }
        var d;
        if (typeof a != "function" && Ml(6), s !== void 0 && typeof s != "function" && Ml(7), Ju(i)) {
          var u = AU(r), h = x2(r, i, void 0), f = true;
          try {
            d = a(h), f = false;
          } finally {
            f ? jC(u) : pR(u);
          }
          return typeof Promise < "u" && d instanceof Promise ? d.then((function(v) {
            return Sj(u, s), jj(v, u);
          }), (function(v) {
            throw jC(u), v;
          })) : (Sj(u, s), jj(d, u));
        }
        if (!i || typeof i != "object") {
          if ((d = a(i)) === void 0 && (d = i), d === Tee && (d = void 0), r.D && C7(d, true), s) {
            var g = [], m = [];
            Pd("Patches").M(i, d, g, m), s(g, m);
          }
          return d;
        }
        Ml(21, i);
      }, this.produceWithPatches = function(i, a) {
        if (typeof i == "function") return function(d) {
          for (var u = arguments.length, h = Array(u > 1 ? u - 1 : 0), f = 1; f < u; f++) h[f - 1] = arguments[f];
          return r.produceWithPatches(d, (function(g) {
            return i.apply(void 0, [
              g
            ].concat(h));
          }));
        };
        var s, l, c = r.produce(i, a, (function(d, u) {
          s = d, l = u;
        }));
        return typeof Promise < "u" && c instanceof Promise ? c.then((function(d) {
          return [
            d,
            s,
            l
          ];
        })) : [
          c,
          s,
          l
        ];
      }, typeof (n == null ? void 0 : n.useProxies) == "boolean" && this.setUseProxies(n.useProxies), typeof (n == null ? void 0 : n.autoFreeze) == "boolean" && this.setAutoFreeze(n.autoFreeze);
    }
    var e = t.prototype;
    return e.createDraft = function(n) {
      Ju(n) || Ml(8), P1(n) && (n = p_e(n));
      var r = AU(this), i = x2(this, n, void 0);
      return i[ai].C = true, pR(r), i;
    }, e.finishDraft = function(n, r) {
      var i = n && n[ai], a = i.A;
      return Sj(a, r), jj(void 0, a);
    }, e.setAutoFreeze = function(n) {
      this.D = n;
    }, e.setUseProxies = function(n) {
      n && !OU && Ml(20), this.O = n;
    }, e.applyPatches = function(n, r) {
      var i;
      for (i = r.length - 1; i >= 0; i--) {
        var a = r[i];
        if (a.path.length === 0 && a.op === "replace") {
          n = a.value;
          break;
        }
      }
      i > -1 && (r = r.slice(i + 1));
      var s = Pd("Patches").$;
      return P1(n) ? s(n, r) : this.produce(n, (function(l) {
        return s(l, r);
      }));
    }, t;
  })(), fl = new x_e(), uo = fl.produce;
  fl.produceWithPatches.bind(fl);
  fl.setAutoFreeze.bind(fl);
  fl.setUseProxies.bind(fl);
  fl.applyPatches.bind(fl);
  fl.createDraft.bind(fl);
  fl.finishDraft.bind(fl);
  var Aj = {
    exports: {}
  };
  var NU;
  function w_e() {
    return NU || (NU = 1, (function(t) {
      (function() {
        var e = {}.hasOwnProperty;
        function n() {
          for (var a = "", s = 0; s < arguments.length; s++) {
            var l = arguments[s];
            l && (a = i(a, r(l)));
          }
          return a;
        }
        function r(a) {
          if (typeof a == "string" || typeof a == "number") return a;
          if (typeof a != "object") return "";
          if (Array.isArray(a)) return n.apply(null, a);
          if (a.toString !== Object.prototype.toString && !a.toString.toString().includes("[native code]")) return a.toString();
          var s = "";
          for (var l in a) e.call(a, l) && a[l] && (s = i(s, l));
          return s;
        }
        function i(a, s) {
          return s ? a ? a + " " + s : a + s : a;
        }
        t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
      })();
    })(Aj)), Aj.exports;
  }
  var D_e = w_e();
  const gt = da(D_e);
  var ct = {
    Background: {
      Container: "var(--oq6d070)",
      ContainerHover: "var(--oq6d071)",
      ContainerActive: "var(--oq6d072)",
      ContainerLine: "var(--oq6d073)",
      OnContainer: "var(--oq6d074)"
    },
    Surface: {
      Container: "var(--oq6d075)",
      ContainerHover: "var(--oq6d076)",
      ContainerActive: "var(--oq6d077)",
      ContainerLine: "var(--oq6d078)",
      OnContainer: "var(--oq6d079)"
    },
    SurfaceVariant: {
      Container: "var(--oq6d07a)",
      ContainerHover: "var(--oq6d07b)",
      ContainerActive: "var(--oq6d07c)",
      ContainerLine: "var(--oq6d07d)",
      OnContainer: "var(--oq6d07e)"
    },
    Primary: {
      Main: "var(--oq6d07f)",
      MainHover: "var(--oq6d07g)",
      MainActive: "var(--oq6d07h)",
      MainLine: "var(--oq6d07i)",
      OnMain: "var(--oq6d07j)",
      Container: "var(--oq6d07k)",
      ContainerHover: "var(--oq6d07l)",
      ContainerActive: "var(--oq6d07m)",
      ContainerLine: "var(--oq6d07n)",
      OnContainer: "var(--oq6d07o)"
    },
    Secondary: {
      Main: "var(--oq6d07p)",
      MainHover: "var(--oq6d07q)",
      MainActive: "var(--oq6d07r)",
      MainLine: "var(--oq6d07s)",
      OnMain: "var(--oq6d07t)",
      Container: "var(--oq6d07u)",
      ContainerHover: "var(--oq6d07v)",
      ContainerActive: "var(--oq6d07w)",
      ContainerLine: "var(--oq6d07x)",
      OnContainer: "var(--oq6d07y)"
    },
    Success: {
      Main: "var(--oq6d07z)",
      MainHover: "var(--oq6d0710)",
      MainActive: "var(--oq6d0711)",
      MainLine: "var(--oq6d0712)",
      OnMain: "var(--oq6d0713)",
      Container: "var(--oq6d0714)",
      ContainerHover: "var(--oq6d0715)",
      ContainerActive: "var(--oq6d0716)",
      ContainerLine: "var(--oq6d0717)",
      OnContainer: "var(--oq6d0718)"
    },
    Warning: {
      Main: "var(--oq6d0719)",
      MainHover: "var(--oq6d071a)",
      MainActive: "var(--oq6d071b)",
      MainLine: "var(--oq6d071c)",
      OnMain: "var(--oq6d071d)",
      Container: "var(--oq6d071e)",
      ContainerHover: "var(--oq6d071f)",
      ContainerActive: "var(--oq6d071g)",
      ContainerLine: "var(--oq6d071h)",
      OnContainer: "var(--oq6d071i)"
    },
    Critical: {
      Main: "var(--oq6d071j)",
      MainHover: "var(--oq6d071k)",
      MainActive: "var(--oq6d071l)",
      MainLine: "var(--oq6d071m)",
      OnMain: "var(--oq6d071n)",
      Container: "var(--oq6d071o)",
      ContainerHover: "var(--oq6d071p)",
      ContainerActive: "var(--oq6d071q)",
      ContainerLine: "var(--oq6d071r)",
      OnContainer: "var(--oq6d071s)"
    },
    Other: {
      FocusRing: "var(--oq6d071t)",
      Shadow: "var(--oq6d071u)",
      Overlay: "var(--oq6d071v)"
    }
  }, ee = {
    fontWeight: {
      W600: "var(--_164xfge1m)"
    },
    space: {
      S0: "var(--_164xfge1q)",
      S100: "var(--_164xfge1r)",
      S200: "var(--_164xfge1s)",
      S300: "var(--_164xfge1t)",
      S400: "var(--_164xfge1u)",
      S500: "var(--_164xfge1v)",
      S600: "var(--_164xfge1w)",
      S700: "var(--_164xfge1x)"
    },
    radii: {
      R300: "var(--_164xfge1z)",
      R400: "var(--_164xfge20)",
      R500: "var(--_164xfge21)",
      Pill: "var(--_164xfge23)"
    },
    borderWidth: {
      B300: "var(--_164xfge25)",
      B700: "var(--_164xfge29)"
    },
    opacity: {
      P500: "var(--_164xfge2z)",
      P300: "var(--_164xfge31)"
    }
  }, j7 = "_164xfge0", T7 = "dw378b0";
  const C_e = (t) => parseFloat((t / 16).toFixed(4)), He = (t) => `${C_e(t)}rem`, Ree = (t, e, n) => t.x + n + e.width <= document.documentElement.clientWidth, Aee = (t, e, n) => {
    const i = t.x + t.width / 2 - e.width / 2;
    return i < 0 ? false : i + n + e.width <= document.documentElement.clientWidth;
  }, Iee = (t, e, n) => t.x + t.width - (e.width + n) >= 0, Bee = (t, e, n) => t.y + n + e.height <= document.documentElement.clientHeight, Pee = (t, e, n) => {
    const i = t.y + t.height / 2 - e.height / 2;
    return i < 0 ? false : i + n + e.height <= document.documentElement.clientHeight;
  }, Mee = (t, e, n) => t.y + t.height - (e.height + n) >= 0, Oee = (t, e) => ({
    left: `${t.x + e}px`
  }), Lee = (t, e, n) => ({
    left: `${t.x + t.width / 2 - e.width / 2 + n}px`
  }), Nee = (t, e) => {
    const n = t.x + t.width;
    return {
      right: `${document.documentElement.clientWidth - n + e}px`
    };
  }, E_e = (t, e, n) => {
    if (Aee(t, e, n)) return Lee(t, e, n);
    if (Ree(t, e, n)) return Oee(t, n);
    if (Iee(t, e, n)) return Nee(t, n);
  }, Ry = (t, e, n, r) => t === "Start" && Ree(e, n, r) ? Oee(e, r) : t === "Center" && Aee(e, n, r) ? Lee(e, n, r) : t === "End" && Iee(e, n, r) ? Nee(e, r) : E_e(e, n, r), zee = (t, e) => ({
    top: `${t.y + e}px`
  }), Uee = (t, e, n) => ({
    top: `${t.y + t.height / 2 - e.height / 2 + n}px`
  }), Vee = (t, e) => {
    const n = t.y + t.height;
    return {
      bottom: `${document.documentElement.clientHeight - n + e}px`
    };
  }, k_e = (t, e, n) => {
    if (Pee(t, e, n)) return Uee(t, e, n);
    if (Bee(t, e, n)) return zee(t, n);
    if (Mee(t, e, n)) return Vee(t, n);
  }, AC = (t, e, n, r) => t === "Start" && Bee(e, n, r) ? zee(e, r) : t === "Center" && Pee(e, n, r) ? Uee(e, n, r) : t === "End" && Mee(e, n, r) ? Vee(e, r) : k_e(e, n, r), Hee = (t, e, n) => e.height + n <= t.y, $ee = (t, e, n) => t.x + t.width + n + e.width <= document.documentElement.clientWidth, Wee = (t, e, n) => t.y + t.height + n + e.height <= document.documentElement.clientHeight, qee = (t, e, n) => e.width + n <= t.x, Kee = (t, e) => ({
    bottom: `${document.documentElement.clientHeight - t.y + e}px`
  }), Gee = (t, e) => ({
    left: `${t.x + t.width + e}px`
  }), Yee = (t, e) => ({
    top: `${t.y + t.height + e}px`
  }), Zee = (t, e) => ({
    right: `${document.documentElement.clientWidth - t.x + e}px`
  }), S_e = (t, e, n, r, i) => $ee(e, n, r) ? {
    ...Gee(e, r),
    ...AC(t, e, n, i)
  } : Wee(e, n, r) ? {
    ...Yee(e, r),
    ...Ry(t, e, n, i)
  } : qee(e, n, r) ? {
    ...Zee(e, r),
    ...AC(t, e, n, i)
  } : Hee(e, n, r) ? {
    ...Kee(e, r),
    ...Ry(t, e, n, i)
  } : {
    ...Ry(t, e, n, i)
  }, Jee = (t, e, n, r, i, a) => n === "Top" && Hee(t, e, i) ? {
    ...Kee(t, i),
    ...Ry(r, t, e, a)
  } : n === "Right" && $ee(t, e, i) ? {
    ...Gee(t, i),
    ...AC(r, t, e, a)
  } : n === "Bottom" && Wee(t, e, i) ? {
    ...Yee(t, i),
    ...Ry(r, t, e, a)
  } : n === "Left" && qee(t, e, i) ? {
    ...Zee(t, i),
    ...AC(r, t, e, a)
  } : S_e(r, t, e, i, a), Nb = (t, e, n) => (n - t) / (e - t) * 100, ft = (t) => p.forwardRef(t);
  function j_e(t, e, n) {
    return e in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function zU(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function UU(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? zU(Object(n), true).forEach(function(r) {
        j_e(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : zU(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var T_e = (t, e, n) => {
    for (var r of Object.keys(t)) {
      var i;
      if (t[r] !== ((i = e[r]) !== null && i !== void 0 ? i : n[r])) return false;
    }
    return true;
  }, io = (t) => (e) => {
    var n = t.defaultClassName, r = UU(UU({}, t.defaultVariants), e);
    for (var i in r) {
      var a, s = (a = r[i]) !== null && a !== void 0 ? a : t.defaultVariants[i];
      if (s != null) {
        var l = s;
        typeof l == "boolean" && (l = l === true ? "true" : "false");
        var c = t.variantClassNames[i][l];
        c && (n += " " + c);
      }
    }
    for (var [d, u] of t.compoundVariants) T_e(d, r, t.defaultVariants) && (n += " " + u);
    return n;
  }, R_e = io({
    defaultClassName: "_1684mq51 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      size: {
        200: "_1684mq52",
        300: "_1684mq53",
        400: "_1684mq54",
        500: "_1684mq55"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      size: "400",
      radii: "400"
    },
    compoundVariants: []
  }), A_e = "_1684mq5d _1mqalmd1 _1mqalmd0", I_e = "_1684mq5c _1mqalmd1 _1mqalmd0";
  const xn = ft(({ as: t = "span", size: e, radii: n, className: r, ...i }, a) => o.jsx(t, {
    className: gt(R_e({
      size: e,
      radii: n
    }), r),
    ...i,
    ref: a
  })), Xu = ft(({ as: t = "img", className: e, ...n }, r) => o.jsx(t, {
    className: gt(I_e, e),
    ...n,
    ref: r
  })), mp = ft(({ as: t = "span", className: e, ...n }, r) => o.jsx(t, {
    className: gt(A_e, e),
    ...n,
    ref: r
  }));
  var B_e = io({
    defaultClassName: "_13qe89m6 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      size: {
        200: "_13qe89m7",
        300: "_13qe89m8",
        400: "_13qe89m9",
        500: "_13qe89ma"
      },
      variant: {
        Primary: "_13qe89mb",
        Secondary: "_13qe89mc",
        Success: "_13qe89md",
        Warning: "_13qe89me",
        Critical: "_13qe89mf"
      },
      fill: {
        Solid: "_13qe89mg",
        Soft: "_13qe89mh",
        None: "_13qe89mi"
      },
      outlined: {
        true: "_13qe89mj"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      size: "400",
      variant: "Primary",
      fill: "Soft",
      radii: "300"
    },
    compoundVariants: []
  });
  const Rn = ft(({ as: t = "span", className: e, size: n, variant: r, fill: i, radii: a, outlined: s, ...l }, c) => o.jsx(t, {
    className: gt(B_e({
      size: n,
      variant: r,
      fill: i,
      radii: a,
      outlined: s
    }), e),
    ...l,
    ref: c
  }));
  var P_e = io({
    defaultClassName: "prxiv40 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      display: {
        Flex: "prxiv41",
        InlineFlex: "prxiv42"
      },
      direction: {
        Inherit: "prxiv43",
        Row: "prxiv44",
        RowReverse: "prxiv45",
        Column: "prxiv46",
        ColumnReverse: "prxiv47"
      },
      wrap: {
        Inherit: "prxiv48",
        NoWrap: "prxiv49",
        Wrap: "prxiv4a",
        WrapReverse: "prxiv4b"
      },
      justifyContent: {
        Inherit: "prxiv4c",
        Start: "prxiv4d",
        End: "prxiv4e",
        Stretch: "prxiv4f",
        Center: "prxiv4g",
        Baseline: "prxiv4h",
        SpaceBetween: "prxiv4i",
        SpaceAround: "prxiv4j",
        SpaceEvenly: "prxiv4k"
      },
      justifyItems: {
        Inherit: "prxiv4l",
        Start: "prxiv4m",
        End: "prxiv4n",
        Stretch: "prxiv4o",
        Center: "prxiv4p",
        Baseline: "prxiv4q"
      },
      justifySelf: {
        Inherit: "prxiv4r",
        Start: "prxiv4s",
        End: "prxiv4t",
        Stretch: "prxiv4u",
        Center: "prxiv4v",
        Baseline: "prxiv4w"
      },
      alignContent: {
        Inherit: "prxiv4x",
        Start: "prxiv4y",
        End: "prxiv4z",
        Stretch: "prxiv410",
        Center: "prxiv411",
        Baseline: "prxiv412",
        SpaceBetween: "prxiv413",
        SpaceAround: "prxiv414",
        SpaceEvenly: "prxiv415"
      },
      alignItems: {
        Inherit: "prxiv416",
        Start: "prxiv417",
        End: "prxiv418",
        Stretch: "prxiv419",
        Center: "prxiv41a",
        Baseline: "prxiv41b"
      },
      alignSelf: {
        Inherit: "prxiv41c",
        Start: "prxiv41d",
        End: "prxiv41e",
        Stretch: "prxiv41f",
        Center: "prxiv41g",
        Baseline: "prxiv41h"
      },
      gap: {
        0: "prxiv41i",
        100: "prxiv41j",
        200: "prxiv41k",
        300: "prxiv41l",
        400: "prxiv41m",
        500: "prxiv41n",
        600: "prxiv41o",
        700: "prxiv41p",
        Inherit: "prxiv41q"
      },
      grow: {
        No: "prxiv41r",
        Yes: "prxiv41s"
      },
      shrink: {
        No: "prxiv41t",
        Yes: "prxiv41u"
      },
      basis: {
        No: "prxiv41v",
        Yes: "prxiv41w"
      }
    },
    defaultVariants: {
      display: "Flex"
    },
    compoundVariants: []
  });
  const E = ft(({ as: t = "div", className: e, display: n, direction: r, wrap: i, justifyContent: a, justifyItems: s, justifySelf: l, alignContent: c, alignItems: d, alignSelf: u, gap: h, grow: f, shrink: g, basis: m, ...v }, y) => o.jsx(t, {
    className: gt(P_e({
      display: n,
      direction: r,
      wrap: i,
      justifyContent: a,
      justifyItems: s,
      justifySelf: l,
      alignContent: c,
      alignItems: d,
      alignSelf: u,
      gap: h,
      grow: f,
      shrink: g,
      basis: m
    }), e),
    ...v,
    ref: y
  }));
  var M_e = io({
    defaultClassName: "epr39zd _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      size: {
        300: "epr39ze",
        400: "epr39zf",
        500: "epr39zg"
      },
      variant: {
        Primary: "epr39zh",
        Secondary: "epr39zi",
        Success: "epr39zj",
        Warning: "epr39zk",
        Critical: "epr39zl"
      },
      fill: {
        Solid: "epr39zm",
        Soft: "epr39zn",
        None: "epr39zo"
      },
      outlined: {
        true: "epr39zp"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      size: "400",
      variant: "Primary",
      fill: "Solid",
      radii: "400"
    },
    compoundVariants: []
  });
  const xe = ft(({ as: t = "button", className: e, size: n, variant: r, fill: i, outlined: a, radii: s, before: l, after: c, children: d, ...u }, h) => o.jsxs(t, {
    className: gt(M_e({
      size: n,
      variant: r,
      fill: i,
      outlined: a,
      radii: s
    }), e),
    "data-ui-before": l ? true : void 0,
    "data-ui-after": c ? true : void 0,
    ...u,
    ref: h,
    children: [
      l,
      d,
      c
    ]
  }));
  var O_e = io({
    defaultClassName: "_19nrl2w0 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      size: {
        50: "cpipac7",
        100: "cpipac8",
        200: "cpipac9",
        300: "cpipaca",
        400: "cpipacb",
        500: "cpipacc",
        600: "cpipacd",
        Inherit: "cpipac6"
      }
    },
    defaultVariants: {
      size: "400"
    },
    compoundVariants: []
  });
  const Q = p.forwardRef(({ className: t, size: e, filled: n = false, src: r, ...i }, a) => o.jsx("svg", {
    className: gt(O_e({
      size: e
    }), t),
    focusable: "false",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    ...i,
    ref: a,
    children: r(n)
  })), q = {
    Home: (t) => t ? o.jsx("path", {
      d: "M3 10V21H9V18.5C9 16.8431 10.3431 15.5 12 15.5C13.6569 15.5 15 16.8431 15 18.5V21H21V10L12 2L3 10Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M4.5 10.6736V19.5H8.5V17.5C8.5 15.567 10.067 14 12 14C13.933 14 15.5 15.567 15.5 17.5V19.5H19.5V10.6736L12 4.00693L4.5 10.6736ZM3 10V21H10V17.5C10 16.3954 10.8954 15.5 12 15.5C13.1046 15.5 14 16.3954 14 17.5V21H21V10L12 2L3 10Z",
      fill: "currentColor"
    }),
    User: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("circle", {
          cx: "12",
          cy: "7",
          r: "4",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4 18C4 15.2386 6.23858 13 9 13H15C17.7614 13 20 15.2386 20 18V21H4V18Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 9.5C13.3807 9.5 14.5 8.38071 14.5 7C14.5 5.61929 13.3807 4.5 12 4.5C10.6193 4.5 9.5 5.61929 9.5 7C9.5 8.38071 10.6193 9.5 12 9.5ZM12 11C14.2091 11 16 9.20914 16 7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7C8 9.20914 9.79086 11 12 11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M15 14.5H9C7.067 14.5 5.5 16.067 5.5 18V19.5H18.5V18C18.5 16.067 16.933 14.5 15 14.5ZM9 13C6.23858 13 4 15.2386 4 18V21H20V18C20 15.2386 17.7614 13 15 13H9Z",
          fill: "currentColor"
        })
      ]
    }),
    UserPlus: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("circle", {
          cx: "14",
          cy: "7",
          r: "4",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5 3H3V6H0V8H3V11H5V8H8V6H5V3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M6 18C6 15.2386 8.23858 13 11 13H17C19.7614 13 22 15.2386 22 18V21H6V18Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M14 9.5C15.3807 9.5 16.5 8.38071 16.5 7C16.5 5.61929 15.3807 4.5 14 4.5C12.6193 4.5 11.5 5.61929 11.5 7C11.5 8.38071 12.6193 9.5 14 9.5ZM14 11C16.2091 11 18 9.20914 18 7C18 4.79086 16.2091 3 14 3C11.7909 3 10 4.79086 10 7C10 9.20914 11.7909 11 14 11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M17 14.5H11C9.067 14.5 7.5 16.067 7.5 18V19.5H20.5V18C20.5 16.067 18.933 14.5 17 14.5ZM11 13C8.23858 13 6 15.2386 6 18V21H22V18C22 15.2386 19.7614 13 17 13H11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5 3H3V6H0V8H3V11H5V8H8V6H5V3Z",
          fill: "currentColor"
        })
      ]
    }),
    Mail: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M22 6.76393V4H2V6.76393L12 11.7639L22 6.76393Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2 9V20H22V9L12 14L2 9Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M2 4H22V20H2V4ZM3.5 8.07295L12 12.3229L20.5 8.07295V5.5H3.5V8.07295ZM20.5 9.75L12 14L3.5 9.75V18.5H20.5V9.75Z",
      fill: "currentColor"
    }),
    MailPlus: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M22 6.76393V4H2V6.76393L12 11.7639L22 6.76393Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2 9V20H14C14 16.6863 16.6863 14 20 14C20.7013 14 21.3744 14.1203 22 14.3414V9L12 14L2 9Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M19 16H21V24H19V16Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M24 19L24 21L16 21L16 19L24 19Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M19 16H21V24H19V16Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M24 19L24 21L16 21L16 19L24 19Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M22 4H2V20H14V18.5H3.5V9.75L12 14L20.5 9.75V14H22V4ZM12 12.3229L3.5 8.07295V5.5H20.5V8.07295L12 12.3229Z",
          fill: "currentColor"
        })
      ]
    }),
    Star: (t) => t ? o.jsx("path", {
      d: "M12 2L14.9095 8.99537L22.4616 9.60081L16.7077 14.5296L18.4656 21.8992L12 17.95L5.53437 21.8992L7.29228 14.5296L1.53839 9.60081L9.09048 8.99537L12 2Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M14.9095 8.99537L12 2L9.09048 8.99537L1.53839 9.60081L7.29228 14.5296L5.53437 21.8992L12 17.95L18.4656 21.8992L16.7077 14.5296L22.4616 9.60081L14.9095 8.99537ZM18.7469 10.8078L13.8764 10.4174L12 5.90594L10.1236 10.4174L5.25316 10.8078L8.96393 13.9865L7.83023 18.7392L12 16.1923L16.1698 18.7392L15.0361 13.9865L18.7469 10.8078Z",
      fill: "currentColor"
    }),
    PlusCircle: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2ZM11 7H13V11H17V13H13V17H11V13H7V11H11V7Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 3.5C7.32843 3.5 3.5 7.32843 3.5 12C3.5 16.6716 7.32843 20.5 12 20.5C16.6716 20.5 20.5 16.6716 20.5 12C20.5 7.32843 16.6716 3.5 12 3.5ZM2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "7",
          width: "2",
          height: "10",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "7",
          y: "11",
          width: "10",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    Explore: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12ZM9.87866 9.87866L7.05023 16.9497L14.1213 14.1213L16.9497 7.05023L9.87866 9.87866ZM13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 3.5C7.32843 3.5 3.5 7.32843 3.5 12C3.5 16.6716 7.32843 20.5 12 20.5C16.6716 20.5 20.5 16.6716 20.5 12C20.5 7.32843 16.6716 3.5 12 3.5ZM2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M7.05023 16.9497L9.87866 9.87866L16.9497 7.05023L14.1213 14.1213L7.05023 16.9497ZM12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",
          fill: "currentColor"
        })
      ]
    }),
    Smile: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12ZM8.5 11C9.32843 11 10 10.3284 10 9.5C10 8.67157 9.32843 8 8.5 8C7.67157 8 7 8.67157 7 9.5C7 10.3284 7.67157 11 8.5 11ZM15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11ZM7 14C7 16.2 9.25 18 12 18C14.75 18 17 16.2 17 14H7Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 3.5C7.32843 3.5 3.5 7.32843 3.5 12C3.5 16.6716 7.32843 20.5 12 20.5C16.6716 20.5 20.5 16.6716 20.5 12C20.5 7.32843 16.6716 3.5 12 3.5ZM2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8.5 11C9.32843 11 10 10.3284 10 9.5C10 8.67157 9.32843 8 8.5 8C7.67157 8 7 8.67157 7 9.5C7 10.3284 7.67157 11 8.5 11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M17 14H7C7 16.2 9.25 18 12 18C14.75 18 17 16.2 17 14Z",
          fill: "currentColor"
        })
      ]
    }),
    SmilePlus: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M14.2566 2.25849C14.0897 2.80965 14 3.39435 14 4C14 5.53683 14.5778 6.93872 15.528 8.00026C15.5187 8.00009 15.5094 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11C16.3284 11 17 10.3284 17 9.5C17 9.3891 16.988 9.28102 16.9651 9.17698C17.8555 9.70005 18.8927 10 20 10C20.6057 10 21.1903 9.91026 21.7415 9.74336C21.9106 10.4692 22 11.2246 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2C12.7754 2 13.5308 2.08943 14.2566 2.25849ZM10 9.5C10 10.3284 9.32843 11 8.5 11C7.67157 11 7 10.3284 7 9.5C7 8.67157 7.67157 8 8.5 8C9.32843 8 10 8.67157 10 9.5ZM12 18C9.25 18 7 16.2 7 14H17C17 16.2 14.75 18 12 18Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M19 0H21V8H19V0Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M24 3L24 5L16 5L16 3L24 3Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M14 2.2023C13.3533 2.06968 12.6844 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22C17.5 22 22 17.5 22 12C22 11.3156 21.9303 10.6467 21.7977 10H20.2603C20.4169 10.642 20.5 11.3119 20.5 12C20.5 16.6716 16.6716 20.5 12 20.5C7.32843 20.5 3.5 16.6716 3.5 12C3.5 7.32843 7.32843 3.5 12 3.5C12.6881 3.5 13.358 3.58307 14 3.73967V2.2023Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8.5 11C9.32843 11 10 10.3284 10 9.5C10 8.67157 9.32843 8 8.5 8C7.67157 8 7 8.67157 7 9.5C7 10.3284 7.67157 11 8.5 11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M17 14H7C7 16.2 9.25 18 12 18C14.75 18 17 16.2 17 14Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M19 0H21V8H19V0Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M24 3L24 5L16 5L16 3L24 3Z",
          fill: "currentColor"
        })
      ]
    }),
    Leaf: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M4 15V18.9393L2.46967 20.4697L3.53033 21.5303L5.06065 20H9C15.6274 20 21 14.6274 21 8V3H16C9.37258 3 4 8.37258 4 15ZM7.53033 17.5303L16.5303 8.53033L15.4697 7.46967L6.46967 16.4697L7.53033 17.5303Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M4 18.9393V15C4 8.37258 9.37258 3 16 3H21V8C21 14.6274 15.6274 20 9 20H5.06065L3.53033 21.5303L2.46967 20.4697L4 18.9393ZM5.5 17.4393V15C5.5 9.20101 10.201 4.5 16 4.5H19.5V8C19.5 13.799 14.799 18.5 9 18.5H6.56065L16.5303 8.53033L15.4697 7.46967L5.5 17.4393Z",
      fill: "currentColor"
    }),
    Sticker: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M14 3H3V21H21V10H14V3ZM15 13C15 14.1046 13.6569 15 12 15C10.3431 15 9 14.1046 9 13H7C7 15.2091 9.23858 17 12 17C14.7614 17 17 15.2091 17 13H15Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M21 8L16 8V3L21 8Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M17 13H15C15 14.1046 13.6569 15 12 15C10.3431 15 9 14.1046 9 13H7C7 15.2091 9.23858 17 12 17C14.7614 17 17 15.2091 17 13Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M16 3L21 8V21H3V3H16ZM19.5 9H15V4.5H4.5V19.5H19.5V9Z",
          fill: "currentColor"
        })
      ]
    }),
    Delete: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M16 2H8V4H3V5.5H5V22H19V5.5H21V4H16V2ZM11 9H9V17H11V9ZM15 9H13V17H15V9Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "9",
          y: "9",
          width: "2",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "13",
          y: "9",
          width: "2",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M16 2H8V4H3V5.5H5V22H19V5.5H21V4H16V2ZM17.5 5.5V20.5H6.5V5.5H17.5Z",
          fill: "currentColor"
        })
      ]
    }),
    Phone: (t) => t ? o.jsx("path", {
      d: "M13.1213 8.05022L6.75735 1.68626C6.75735 1.68626 -2.43506 6.63599 7.46446 16.5355C17.364 26.435 22.3137 17.2426 22.3137 17.2426L15.9497 10.8786L13.1213 13.7071L10.2929 10.8786L13.1213 8.05022Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      d: "M8.1715 10.8786L10.9999 8.05016L6.58808 3.63831C6.54757 3.67226 6.50562 3.70668 6.46379 3.74328C5.8629 4.26905 5.19159 5.02407 4.77751 5.99027C4.37648 6.92628 4.18938 8.11882 4.62007 9.62664C5.05966 11.1652 6.16859 13.1182 8.52507 15.4748C10.8818 17.8315 12.8353 18.9409 14.3739 19.3805C15.8817 19.8112 17.0743 19.6241 18.0103 19.2231C18.9765 18.809 19.7315 18.1377 20.2573 17.5368C20.2939 17.4949 20.3276 17.4523 20.3616 17.4118L15.9497 12.9999L13.1213 15.8284L8.1715 10.8786ZM13.1213 13.707L15.9497 10.8786L22.3137 17.2426C22.3137 17.2426 17.364 26.435 7.46441 16.5355C-2.41399 6.65674 6.71915 1.70676 6.75726 1.68617L13.1213 8.05017L10.2928 10.8786L13.1213 13.707Z",
      fill: "currentColor"
    }),
    PhoneDown: (t) => t ? o.jsx("path", {
      d: "M8.05028 13.1213L1.68632 6.75735C1.68632 6.75735 6.63606 -2.43504 16.5356 7.46445C26.4351 17.3639 17.2427 22.3137 17.2427 22.3137L10.8787 15.9497L13.7071 13.1213L10.8787 10.2929L8.05028 13.1213Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      d: "M10.8786 8.1715L8.05022 10.9999L3.63837 6.58808C3.67232 6.54757 3.70674 6.50561 3.74333 6.46378C4.26911 5.86289 5.02413 5.19159 5.99033 4.7775C6.92633 4.37648 8.11888 4.18938 9.62669 4.62007C11.1652 5.05966 13.1183 6.16859 15.4749 8.52507C17.8316 10.8818 18.9409 12.8353 19.3805 14.3739C19.8112 15.8817 19.6241 17.0743 19.2231 18.0103C18.809 18.9765 18.1377 19.7315 17.5368 20.2573C17.495 20.2939 17.4524 20.3276 17.4118 20.3616L13 15.9497L15.8284 13.1213L10.8786 8.1715ZM13.7071 13.1213L10.8787 15.9497L17.2427 22.3137C17.2427 22.3137 26.4351 17.364 16.5355 7.46441C6.65669 -2.4141 1.70669 6.71938 1.68623 6.75726L8.05022 13.1213L10.8787 10.2928L13.7071 13.1213Z",
      fill: "currentColor"
    }),
    Headphone: (t) => t ? o.jsx("path", {
      d: "M19.5 12C19.5 7.85786 16.1421 4.5 12 4.5C7.85786 4.5 4.5 7.85786 4.5 12V13H10V21H3V12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12V21H14V13H19.5V12Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M19.5 12C19.5 7.85786 16.1421 4.5 12 4.5C7.85786 4.5 4.5 7.85786 4.5 12V13H10V21H3V12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12V21H14V13H19.5V12ZM4.5 14.5H8.5V19.5H4.5V14.5ZM19.5 14.5V19.5H15.5V14.5H19.5Z",
      fill: "currentColor"
    }),
    HeadphoneMute: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M6.30762 7.11816C5.18136 8.43019 4.5 10.1353 4.5 12V13H10V21H3V12C3 9.72099 3.84765 7.64033 5.24414 6.05469L6.30762 7.11816Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M20.1895 21H14V14.8105L20.1895 21Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 3C16.9706 3 21 7.02944 21 12V18.2754L15.7246 13H19.5V12C19.5 7.85786 16.1421 4.5 12 4.5C10.6283 4.5 9.34351 4.8697 8.2373 5.5127L7.14648 4.42188C8.54711 3.52296 10.2121 3 12 3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2.67371 4.89856L3.73437 3.8379L21.0585 21.162L19.9978 22.2227L2.67371 4.89856Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6.30762 7.11816C5.18136 8.43019 4.5 10.1353 4.5 12V13H10V21H3V12C3 9.72099 3.84765 7.64033 5.24414 6.05469L6.30762 7.11816ZM4.5 19.5H8.5V14.5H4.5V19.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M15.5 16.3105V19.5H18.6895L20.1895 21H14V14.8105L15.5 16.3105Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 3C16.9706 3 21 7.02944 21 12V18.2754L19.5 16.7754V14.5H17.2246L15.7246 13H19.5V12C19.5 7.85786 16.1421 4.5 12 4.5C10.6283 4.5 9.34351 4.8697 8.2373 5.5127L7.14648 4.42188C8.54711 3.52296 10.2121 3 12 3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2.67371 4.89868L3.73437 3.83802L21.0585 21.1621L19.9978 22.2228L2.67371 4.89868Z",
          fill: "currentColor"
        })
      ]
    }),
    Send: (t) => t ? o.jsx("path", {
      d: "M3 22L23 12L3 2V11H11V13H3V22Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M23 12L3 2V22L23 12ZM19.6459 12L4.5 4.42705V19.5729L19.6459 12Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "3",
          y: "11",
          width: "8",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    Bell: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M6 9C6 5.68629 8.68629 3 12 3C15.3137 3 18 5.68629 18 9V16.5H20V18H4V16.5H6V9Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M10 20H14C14 21.1046 13.1046 22 12 22C10.8954 22 10 21.1046 10 20Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 16.5H4V18H20V16.5H18V9C18 5.68629 15.3137 3 12 3C8.68629 3 6 5.68629 6 9V16.5ZM16.5 16.5V9C16.5 6.51472 14.4853 4.5 12 4.5C9.51472 4.5 7.5 6.51472 7.5 9V16.5H16.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M10 20H14C14 21.1046 13.1046 22 12 22C10.8954 22 10 21.1046 10 20Z",
          fill: "currentColor"
        })
      ]
    }),
    BellRing: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 16.571H4V18.071H20V16.571H18V9.07104C18 5.75734 15.3137 3.07104 12 3.07104C8.68629 3.07104 6 5.75734 6 9.07104V16.571Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M10 20.071H14C14 21.1756 13.1046 22.071 12 22.071C10.8954 22.071 10 21.1756 10 20.071Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.98959 3.06066C4.4514 4.59886 3.5 6.72386 3.5 9.07107H2C2 6.30964 3.11929 3.80964 4.92893 2L5.98959 3.06066Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18.0104 3.06066C19.5486 4.59886 20.5 6.72386 20.5 9.07107H22C22 6.30964 20.8807 3.80964 19.0711 2L18.0104 3.06066Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 16.571H4V18.071H20V16.571H18V9.07104C18 5.75734 15.3137 3.07104 12 3.07104C8.68629 3.07104 6 5.75734 6 9.07104V16.571ZM16.5 16.571V9.07104C16.5 6.58576 14.4853 4.57104 12 4.57104C9.51472 4.57104 7.5 6.58576 7.5 9.07104V16.571H16.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M10 20.071H14C14 21.1756 13.1046 22.071 12 22.071C10.8954 22.071 10 21.1756 10 20.071Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.98959 3.06066C4.4514 4.59886 3.5 6.72386 3.5 9.07107H2C2 6.30964 3.11929 3.80964 4.92893 2L5.98959 3.06066Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18.0104 3.06066C19.5486 4.59886 20.5 6.72386 20.5 9.07107H22C22 6.30964 20.8807 3.80964 19.0711 2L18.0104 3.06066Z",
          fill: "currentColor"
        })
      ]
    }),
    BellPing: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M10 20.071H14C14 21.1756 13.1046 22.071 12 22.071C10.8954 22.071 10 21.1756 10 20.071Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.98959 3.06066C4.4514 4.59886 3.5 6.72386 3.5 9.07107H2C2 6.30964 3.11929 3.80964 4.92893 2L5.98959 3.06066Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M21 6C21 7.65685 19.6569 9 18 9C16.3431 9 15 7.65685 15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13.7681 3.33582C13.2092 3.1637 12.6154 3.07104 12 3.07104C8.68629 3.07104 6 5.75734 6 9.07104V16.571H4V18.071H20V16.571H18V11C15.2386 11 13 8.76142 13 6C13 5.02067 13.2816 4.1071 13.7681 3.33582Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M10 20H14C14 21.1046 13.1046 22 12 22C10.8954 22 10 21.1046 10 20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.98959 2.98962C4.4514 4.52781 3.5 6.65281 3.5 9.00002H2C2 6.2386 3.11929 3.7386 4.92893 1.92896L5.98959 2.98962Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M21 6C21 7.65685 19.6569 9 18 9C16.3431 9 15 7.65685 15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13.8061 3.2766C13.2361 3.0969 12.6294 3 12 3C8.68629 3 6 5.68629 6 9V16.5H4V18H20V16.5H18V11C17.4774 11 16.9735 10.9198 16.5 10.7711V16.5H7.5V9C7.5 6.51472 9.51472 4.5 12 4.5C12.4092 4.5 12.8056 4.55462 13.1824 4.65696C13.3202 4.16162 13.5324 3.69724 13.8061 3.2766Z",
          fill: "currentColor"
        })
      ]
    }),
    BellMute: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M10 20H14C14 21.1046 13.1046 22 12 22C10.8954 22 10 21.1046 10 20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 9V14.111L8.22509 4.33605C9.25608 3.50055 10.5696 3 12 3C15.3137 3 18 5.68629 18 9Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M20.3085 19.2479L19.2478 20.3085L16.9393 18H4V16.5H6V9C6 8.41093 6.08489 7.84169 6.24311 7.30384L3.69147 4.7522L4.75213 3.69154L20.3085 19.2479Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M10 20H14C14 21.1046 13.1046 22 12 22C10.8954 22 10 21.1046 10 20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M16.5 9V12.611L18 14.111V9C18 5.68629 15.3137 3 12 3C10.5696 3 9.25608 3.50055 8.22509 4.33605L9.29356 5.40452C10.0468 4.83667 10.9841 4.5 12 4.5C14.4853 4.5 16.5 6.51472 16.5 9Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M20.3085 19.2479L19.2478 20.3085L16.9393 18H4V16.5H6V9C6 8.41093 6.08489 7.84169 6.24311 7.30384L3.69147 4.7522L4.75213 3.69154L20.3085 19.2479ZM7.51934 8.58007C7.50654 8.71833 7.5 8.8584 7.5 9V16.5H15.4393L7.51934 8.58007Z",
          fill: "currentColor"
        })
      ]
    }),
    Message: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M3 4V18H16L21 21V4H3ZM7 8H17V10H7V8ZM7 12H17V14H7V12Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M16.4155 16.5L19.5 18.3507V5.5H4.5V16.5H16.4155ZM3 18V4H21V21L16 18H3Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "7",
          y: "8",
          width: "10",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "7",
          y: "12",
          width: "10",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    MessageUnread: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M13.416 4H3V18H16L21 21V10.0004C20.1643 10.6281 19.1256 11 18 11C16.8742 11 15.8353 10.6279 14.9995 10H7V8H13.416C13.1484 7.38754 13 6.7111 13 6C13 5.2889 13.1484 4.61246 13.416 4ZM17 12H7V14H17V12Z",
          fill: "currentColor"
        }),
        o.jsx("circle", {
          cx: "18",
          cy: "6",
          r: "3",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M21 10.0004V21L16 18H3V4H13.416C13.2119 4.46712 13.0772 4.97145 13.0247 5.5H4.5V16.5H16.4155L19.5 18.3507V10.7711C20.0464 10.5995 20.5523 10.3366 21 10.0004Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13.416 8C13.7639 8.79625 14.3132 9.48438 14.9995 10H7V8H13.416Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M17 12H7V14H17V12Z",
          fill: "currentColor"
        }),
        o.jsx("circle", {
          cx: "18",
          cy: "6",
          r: "3",
          fill: "currentColor"
        })
      ]
    }),
    Setting: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M9.00001 2H15V4.58152C15.6948 4.86278 16.3411 5.23882 16.9229 5.69361L19.1603 4.40186L22.1603 9.59801L19.9235 10.8894C19.9739 11.2524 20 11.6231 20 12C20 12.3768 19.9739 12.7475 19.9235 13.1105L22.1603 14.4019L19.1603 19.598L16.923 18.3063C16.3412 18.7611 15.6949 19.1372 15 19.4185V22H9.00001V19.4185C8.30516 19.1372 7.65881 18.7612 7.07702 18.3063L4.83978 19.598L1.83978 14.4019L4.07646 13.1105C4.02605 12.7476 4 12.3768 4 12C4 11.6231 4.02606 11.2524 4.07647 10.8894L1.83978 9.59801L4.83978 4.40186L7.07712 5.69358C7.65889 5.2388 8.3052 4.86276 9.00001 4.58151V2ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M15 4.58152V2H9.00001V4.58151C8.3052 4.86276 7.65889 5.2388 7.07712 5.69358L4.83978 4.40186L1.83978 9.59801L4.07647 10.8894C4.02606 11.2524 4 11.6231 4 12C4 12.3768 4.02605 12.7476 4.07646 13.1105L1.83978 14.4019L4.83978 19.598L7.07702 18.3063C7.65881 18.7612 8.30516 19.1372 9.00001 19.4185V22H15V19.4185C15.6949 19.1372 16.3412 18.7611 16.923 18.3063L19.1603 19.598L22.1603 14.4019L19.9235 13.1105C19.9739 12.7475 20 12.3768 20 12C20 11.6231 19.9739 11.2524 19.9235 10.8894L22.1603 9.59801L19.1603 4.40186L16.9229 5.69361C16.3411 5.23882 15.6948 4.86278 15 4.58152ZM18.6113 6.45089L16.7964 7.49868L15.9991 6.87537C15.5259 6.50544 15.0008 6.20008 14.4372 5.97193L13.5 5.59257V3.5H10.5V5.59256L9.56283 5.97192C8.99921 6.20007 8.47415 6.50542 8.00093 6.87535L7.20358 7.49865L5.38882 6.4509L3.88882 9.04897L5.70115 10.0953L5.56221 11.0957C5.52127 11.3905 5.5 11.6924 5.5 12C5.5 12.3076 5.52126 12.6094 5.5622 12.9042L5.70112 13.9046L3.88882 14.9509L5.38882 17.549L7.2035 16.5013L8.00085 17.1246C8.47409 17.4945 8.99918 17.7999 9.56283 18.0281L10.5 18.4074V20.5H13.5V18.4074L14.4372 18.0281C15.0008 17.7999 15.5259 17.4945 15.9992 17.1246L16.7965 16.5012L18.6113 17.549L20.1113 14.9509L18.2989 13.9045L18.4378 12.9042C18.4787 12.6094 18.5 12.3076 18.5 12C18.5 11.6924 18.4787 11.3906 18.4378 11.0957L18.2989 10.0954L20.1113 9.04897L18.6113 6.45089Z",
          fill: "currentColor"
        }),
        o.jsx("circle", {
          cx: "12",
          cy: "12",
          r: "3",
          fill: "currentColor"
        })
      ]
    }),
    Search: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("circle", {
          cx: "10",
          cy: "10",
          r: "4",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.41015 13.5899 3.5 10 3.5C6.41015 3.5 3.5 6.41015 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5ZM10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "15.4142",
          y: "14",
          width: "9",
          height: "1.5",
          transform: "rotate(45 15.4142 14)",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.41015 13.5899 3.5 10 3.5C6.41015 3.5 3.5 6.41015 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5ZM10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "15.4142",
          y: "14",
          width: "9",
          height: "1.5",
          transform: "rotate(45 15.4142 14)",
          fill: "currentColor"
        })
      ]
    }),
    Heart: (t) => t ? o.jsx("path", {
      d: "M12.0208 5.48522L11.6673 5.13166C9.5194 2.98378 6.03699 2.98378 3.88911 5.13166C1.74123 7.27955 1.74123 10.762 3.88911 12.9098L12.0208 21.0416L20.1526 12.9098C22.3005 10.762 22.3005 7.27955 20.1526 5.13166C18.0047 2.98378 14.5223 2.98378 12.3744 5.13166L12.0208 5.48522Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12.0208 7.60654L10.6066 6.19232C9.04453 4.63023 6.51187 4.63023 4.94977 6.19232C3.38767 7.75442 3.38767 10.2871 4.94977 11.8492L12.0208 18.9202L19.0919 11.8492C20.654 10.2871 20.654 7.75442 19.0919 6.19232C17.5298 4.63023 14.9971 4.63023 13.4351 6.19232L12.0208 7.60654ZM11.6673 5.13166C9.5194 2.98378 6.03699 2.98378 3.88911 5.13166C1.74123 7.27955 1.74123 10.762 3.88911 12.9098L12.0208 21.0416L20.1526 12.9098C22.3005 10.762 22.3005 7.27955 20.1526 5.13166C18.0047 2.98378 14.5223 2.98378 12.3744 5.13166L12.0208 5.48522L11.6673 5.13166Z",
      fill: "currentColor"
    }),
    Play: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12ZM16 12L10 8V16L16 12Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 3.5C7.32843 3.5 3.5 7.32843 3.5 12C3.5 16.6716 7.32843 20.5 12 20.5C16.6716 20.5 20.5 16.6716 20.5 12C20.5 7.32843 16.6716 3.5 12 3.5ZM2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M10 16V8L16 12L10 16Z",
          fill: "currentColor"
        })
      ]
    }),
    Pause: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12ZM9 8H11V16H9V8ZM13 8H15V16H13V8Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 3.5C7.32843 3.5 3.5 7.32843 3.5 12C3.5 16.6716 7.32843 20.5 12 20.5C16.6716 20.5 20.5 16.6716 20.5 12C20.5 7.32843 16.6716 3.5 12 3.5ZM2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "9",
          y: "8",
          width: "2",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "13",
          y: "8",
          width: "2",
          height: "8",
          fill: "currentColor"
        })
      ]
    }),
    Sun: (t) => o.jsxs(o.Fragment, {
      children: [
        t ? o.jsx("path", {
          d: "M12 7C9.2 7 7 9.2 7 12C7 14.8 9.2 17 12 17C14.8 17 17 14.8 17 12C17 9.2 14.8 7 12 7Z",
          fill: "currentColor"
        }) : o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 8.5C10.0284 8.5 8.5 10.0284 8.5 12C8.5 13.9716 10.0284 15.5 12 15.5C13.9716 15.5 15.5 13.9716 15.5 12C15.5 10.0284 13.9716 8.5 12 8.5ZM7 12C7 9.2 9.2 7 12 7C14.8 7 17 9.2 17 12C17 14.8 14.8 17 12 17C9.2 17 7 14.8 7 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M11 2H13V5H11V2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M19 11H22V13H19V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13 19H11V22H13V19Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2 11H5V13H2V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M7.58059 6.52L5.45927 4.39868L4.39861 5.45934L6.51992 7.58066L7.58059 6.52Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M6.51996 16.4195L4.39856 18.5409L5.45922 19.6016L7.58062 17.4802L6.51996 16.4195Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M16.4194 17.4802L18.5407 19.6015L19.6014 18.5408L17.4801 16.4195L16.4194 17.4802Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M17.4801 7.5807L19.6014 5.45946L18.5407 4.3988L16.4195 6.52004L17.4801 7.5807Z",
          fill: "currentColor"
        })
      ]
    }),
    Photo: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("circle", {
          cx: "14.5",
          cy: "8.5",
          r: "1.5",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M3 3H21V21H3V3ZM4.5 4.5H19.5V19.5L10.5 10.5L4.5 16.5V4.5Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("circle", {
          cx: "14.5",
          cy: "8.5",
          r: "1.5",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M3 3H21V21H3V3ZM4.5 4.5H19.5V19.5L10.5 10.5L4.5 16.5V4.5ZM4.5 18.6213V19.5H17.3787L10.5 12.6213L4.5 18.6213Z",
          fill: "currentColor"
        })
      ]
    }),
    Lock: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M7 9V7C7 4.23858 9.23858 2 12 2C14.7614 2 17 4.23858 17 7V9H20V21H4V9H7ZM15.5 7V9H8.5V7C8.5 5.067 10.067 3.5 12 3.5C13.933 3.5 15.5 5.067 15.5 7ZM12 17C13.1046 17 14 16.1046 14 15C14 13.8954 13.1046 13 12 13C10.8954 13 10 13.8954 10 15C10 16.1046 10.8954 17 12 17Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M7 9V7C7 4.23858 9.23858 2 12 2C14.7614 2 17 4.23858 17 7V9H20V21H4V9H7ZM15.5 7V9H8.5V7C8.5 5.067 10.067 3.5 12 3.5C13.933 3.5 15.5 5.067 15.5 7ZM5.5 10.5V19.5H18.5V10.5H5.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 17C13.1046 17 14 16.1046 14 15C14 13.8954 13.1046 13 12 13C10.8954 13 10 13.8954 10 15C10 16.1046 10.8954 17 12 17Z",
          fill: "currentColor"
        })
      ]
    }),
    Vlc: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M2 20.5V22H22V20.5H20L18.8649 17H5.13514L4 20.5H2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.78378 15H18.2162L17.2432 12H6.75676L5.78378 15Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M7.40541 10H16.5946L14 2H10L7.40541 10Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M14 2L20 20.5H22V22H2V20.5H4L10 2H14ZM18.4231 20.5H5.57692L6.71205 17H17.2879L18.4231 20.5ZM16.6393 15H7.3607L8.33367 12H15.6663L16.6393 15ZM11.0904 3.5L8.98232 10H15.0177L12.9096 3.5H11.0904Z",
      fill: "currentColor"
    }),
    Flag: (t) => t ? o.jsx("path", {
      d: "M3 3H21V5L17 9L21 13V15H4.5V21H3V3Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M21 5V3H3V21H4.5V15H21V13L17 9L21 5ZM19.3787 13.5L14.8787 9L19.3787 4.5H4.5V13.5H19.3787Z",
      fill: "currentColor"
    }),
    Ball: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M5.5 19.5996C7.64233 17.7655 9 15.0413 9 12C9 8.9587 7.64233 6.2345 5.5 4.40041C7.24803 2.9039 9.51846 2 12 2C14.4815 2 16.752 2.9039 18.5 4.40041C16.3577 6.2345 15 8.9587 15 12C15 15.0413 16.3577 17.7655 18.5 19.5996C16.752 21.0961 14.4815 22 12 22C9.51846 22 7.24803 21.0961 5.5 19.5996Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4.11517 5.84871C2.78981 7.54518 2 9.68035 2 12C2 14.3196 2.78981 16.4548 4.11517 18.1513C5.87794 16.6838 7 14.4729 7 12C7 9.52705 5.87794 7.31618 4.11517 5.84871Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M19.8848 5.84871C21.2102 7.54518 22 9.68035 22 12C22 14.3196 21.2102 16.4548 19.8848 18.1513C18.1221 16.6838 17 14.4729 17 12C17 9.52705 18.1221 7.31618 19.8848 5.84871Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM18.5 17.4775C19.7479 15.9982 20.5 14.0869 20.5 12C20.5 9.91309 19.7479 8.00184 18.5 6.5225C17.2521 8.00184 16.5 9.9131 16.5 12C16.5 14.0869 17.2521 15.9982 18.5 17.4775ZM17.4327 18.5375C15.9597 19.763 14.0659 20.5 12 20.5C9.93412 20.5 8.04038 19.763 6.56736 18.5376C8.08313 16.7846 9.00003 14.4994 9.00003 12.0001C9.00003 9.50072 8.08309 7.21551 6.56725 5.46249C8.0403 4.23703 9.93408 3.5 12 3.5C14.0659 3.5 15.9597 4.23702 17.4327 5.46248C15.9169 7.21548 15 9.50067 15 12C15 14.4994 15.9169 16.7845 17.4327 18.5375ZM3.5 12C3.5 9.9131 4.25207 8.00186 5.49997 6.52252C6.74792 8.00187 7.50003 9.91316 7.50003 12.0001C7.50003 14.087 6.74796 15.9982 5.50006 17.4776C4.25211 15.9982 3.5 14.0869 3.5 12Z",
      fill: "currentColor"
    }),
    Bulb: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M20 10C20 12.9611 18.3912 15.5465 16 16.9297V22H8V16.9297C5.60879 15.5465 4 12.9611 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10ZM9.91421 8.08569L8.5 9.49991L11 11.9999V13.9999H13V12.071L15.5711 9.49991L14.1569 8.08569L12.0355 10.207L9.91421 8.08569Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M14.5 16.0646L15.2489 15.6313C17.1957 14.5052 18.5 12.404 18.5 10C18.5 6.41015 15.5899 3.5 12 3.5C8.41015 3.5 5.5 6.41015 5.5 10C5.5 12.404 6.80432 14.5052 8.75109 15.6313L9.5 16.0646V20.5H14.5V16.0646ZM16 16.9297C18.3912 15.5465 20 12.9611 20 10C20 5.58172 16.4183 2 12 2C7.58172 2 4 5.58172 4 10C4 12.9611 5.60879 15.5465 8 16.9297V22H16V16.9297Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8.5 9.49991L9.91421 8.08569L12.0355 10.207L14.1569 8.08569L15.5711 9.49991L13 12.071V13.9999H11V11.9999L8.5 9.49991Z",
          fill: "currentColor"
        })
      ]
    }),
    Terminal: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M22 4H2V20H22V4ZM7.74264 7.75732L6.32843 9.17154L9.15686 12L6.32843 14.8284L7.74264 16.2426L11.9853 12L7.74264 7.75732ZM13 14H18V16H13V14Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M20.5 5.5H3.5V18.5H20.5V5.5ZM2 4V20H22V4H2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13 14H18V16H13V14Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M7.74264 7.75736L6.32843 9.17157L9.15685 12L6.32843 14.8284L7.74264 16.2426L11.9853 12L7.74264 7.75736Z",
          fill: "currentColor"
        })
      ]
    }),
    Pencil: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3 17V21H7L17.2929 10.7071L13.2929 6.70709L3 17Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14.7071 5.29288L18.7071 9.29288L22.5 5.5L18.5 1.5L14.7071 5.29288Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M3 16V21H8L23 6L18 1L3 16ZM16.7322 10.1465L7.37868 19.5H4.5V16.6213L13.8535 7.26781L16.7322 10.1465ZM18.1464 8.73228L20.8787 6L18 3.12132L15.2677 5.8536L18.1464 8.73228Z",
      fill: "currentColor"
    }),
    Info: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12ZM11 8V6H13V8H11ZM13 15V10H10V11.5H11V15H9.5V17H14.5L14.5 15H13Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 3.5C7.32843 3.5 3.5 7.32843 3.5 12C3.5 16.6716 7.32843 20.5 12 20.5C16.6716 20.5 20.5 16.6716 20.5 12C20.5 7.32843 16.6716 3.5 12 3.5ZM2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13 15.5V10H10V11.5H11V15.5H9.5V17H14.5L14.5 15.5H13Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "6",
          width: "2",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    Shield: (t) => t ? o.jsx("path", {
      d: "M12 2L3 7V13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13V7L12 2Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M4.5 7.88261V13C4.5 17.1421 7.85786 20.5 12 20.5C16.1421 20.5 19.5 17.1421 19.5 13V7.88261L12 3.71594L4.5 7.88261ZM12 2L3 7V13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13V7L12 2Z",
      fill: "currentColor"
    }),
    ShieldUser: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M3 7L12 2L21 7V13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13V7ZM12 12C13.1046 12 14 11.1046 14 10C14 8.89543 13.1046 8 12 8C10.8954 8 10 8.89543 10 10C10 11.1046 10.8954 12 12 12ZM9 16C9 14.3431 10.3431 13 12 13C13.6569 13 15 14.3431 15 16V17H9V16Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M12 12C13.1046 12 14 11.1046 14 10C14 8.89543 13.1046 8 12 8C10.8954 8 10 8.89543 10 10C10 11.1046 10.8954 12 12 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M4.5 7.88261V13C4.5 17.1421 7.85786 20.5 12 20.5C16.1421 20.5 19.5 17.1421 19.5 13V7.88261L12 3.71594L4.5 7.88261ZM12 2L3 7V13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13V7L12 2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M9 16C9 14.3431 10.3431 13 12 13C13.6569 13 15 14.3431 15 16V17H9V16Z",
          fill: "currentColor"
        })
      ]
    }),
    Cup: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M19 3H3V15C3 18.3137 5.68629 21 9 21H13C16.3137 21 19 18.3137 19 15C21.2091 15 23 13.2091 23 11V7H19V3ZM19 8.5V13.5C20.3807 13.5 21.5 12.3807 21.5 11V8.5H19Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M19 15C19 18.3137 16.3137 21 13 21H9C5.68629 21 3 18.3137 3 15V3H19V7H23V11C23 13.2091 21.2091 15 19 15ZM4.5 4.5H17.5V15C17.5 17.4853 15.4853 19.5 13 19.5H9C6.51472 19.5 4.5 17.4853 4.5 15V4.5ZM19 8.5V13.5C20.3807 13.5 21.5 12.3807 21.5 11V8.5H19Z",
      fill: "currentColor"
    }),
    Pin: (t) => t ? o.jsx("path", {
      d: "M9.05547 13.884L5.34316 10.1717L6.40382 9.11099L7.11093 9.8181L12.0607 8.40389L15.2427 5.22191L14.182 4.16125L15.2427 3.10059L20.8995 8.75744L19.8389 9.8181L18.7782 8.75744L15.5962 11.9394L14.182 16.8892L14.8891 17.5963L13.8284 18.6569L10.1161 14.9446L4.45928 20.6015L3.39862 19.5408L9.05547 13.884Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12.9686 15.6758L14.2607 11.1536L17.7175 7.69678L16.3033 6.28257L12.8465 9.73939L8.32428 11.0315L12.9686 15.6758ZM20.8995 8.75744L19.8389 9.8181L18.7782 8.75744L15.5962 11.9394L14.182 16.8892L14.8891 17.5963L13.8284 18.6569L10.1161 14.9446L4.45928 20.6015L3.39862 19.5408L9.05547 13.884L5.34316 10.1717L6.40382 9.11099L7.11093 9.8181L12.0607 8.40389L15.2427 5.22191L14.182 4.16125L15.2427 3.10059L20.8995 8.75744Z",
      fill: "currentColor"
    }),
    VolumeHigh: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M2 16V8H6L12 3V21L6 16H2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14 16C16.2091 16 18 14.2091 18 12C18 9.79086 16.2091 8 14 8V9.5C15.3807 9.5 16.5 10.6193 16.5 12C16.5 13.3807 15.3807 14.5 14 14.5V16Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14 20C18.4183 20 22 16.4183 22 12C22 7.58172 18.4183 4 14 4V5.5C17.5899 5.5 20.5 8.41015 20.5 12C20.5 15.5899 17.5899 18.5 14 18.5V20Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 8H2V16H6L12 21V3L6 8ZM10.5 6.20256L6.54308 9.5H3.5V14.5H6.54308L10.5 17.7974V6.20256Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14 16C16.2091 16 18 14.2091 18 12C18 9.79086 16.2091 8 14 8V9.5C15.3807 9.5 16.5 10.6193 16.5 12C16.5 13.3807 15.3807 14.5 14 14.5V16Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14 20C18.4183 20 22 16.4183 22 12C22 7.58172 18.4183 4 14 4V5.5C17.5899 5.5 20.5 8.41015 20.5 12C20.5 15.5899 17.5899 18.5 14 18.5V20Z",
          fill: "currentColor"
        })
      ]
    }),
    VolumeHighLock: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 8H2V16H6L12 21V3L6 8Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M22 12C22 16.4183 18.4183 20 14 20V18.5C17.5899 18.5 20.5 15.5899 20.5 12H22Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 12C18 14.2091 16.2091 16 14 16V14.5C15.3807 14.5 16.5 13.3807 16.5 12H18Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M15 4V3C15 1.34315 16.3431 0 18 0C19.6569 0 21 1.34315 21 3V4H22V10H14V4H15ZM19.5 3V4H16.5V3C16.5 2.17157 17.1716 1.5 18 1.5C18.8284 1.5 19.5 2.17157 19.5 3Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 8H2V16H6L12 21V3L6 8ZM10.5 6.20256L6.54308 9.5H3.5V14.5H6.54308L10.5 17.7974V6.20256Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M22 12C22 16.4183 18.4183 20 14 20V18.5C17.5899 18.5 20.5 15.5899 20.5 12H22Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 12C18 14.2091 16.2091 16 14 16V14.5C15.3807 14.5 16.5 13.3807 16.5 12H18Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M15 4V3C15 1.34315 16.3431 0 18 0C19.6569 0 21 1.34315 21 3V4H22V10H14V4H15ZM19.5 3V4H16.5V3C16.5 2.17157 17.1716 1.5 18 1.5C18.8284 1.5 19.5 2.17157 19.5 3Z",
          fill: "currentColor"
        })
      ]
    }),
    VolumeHighGlobe: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 8H2V16H6L12 21V3L6 8Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M22 12C22 16.4183 18.4183 20 14 20V18.5C17.5899 18.5 20.5 15.5899 20.5 12H22Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 12C18 14.2091 16.2091 16 14 16V14.5C15.3807 14.5 16.5 13.3807 16.5 12H18Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M24 5C24 7.76142 21.7614 10 19 10C16.2386 10 14 7.76142 14 5C14 2.23858 16.2386 0 19 0C21.7614 0 24 2.23858 24 5ZM17 7.87266V5L15.7354 3.73543C15.5834 4.12764 15.5 4.55408 15.5 5C15.5 6.18937 16.0933 7.24018 17 7.87266ZM22.5 5C22.5 6.18937 21.9067 7.24018 21 7.87266V6.5H19V5H20V3.5H21V2.12734C21.9067 2.75982 22.5 3.81063 22.5 5Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 8H2V16H6L12 21V3L6 8ZM10.5 6.20256L6.54308 9.5H3.5V14.5H6.54308L10.5 17.7974V6.20256Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M22 12C22 16.4183 18.4183 20 14 20V18.5C17.5899 18.5 20.5 15.5899 20.5 12H22Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 12C18 14.2091 16.2091 16 14 16V14.5C15.3807 14.5 16.5 13.3807 16.5 12H18Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M24 5C24 7.76142 21.7614 10 19 10C16.2386 10 14 7.76142 14 5C14 2.23858 16.2386 0 19 0C21.7614 0 24 2.23858 24 5ZM17 7.87266V5L15.7354 3.73543C15.5834 4.12764 15.5 4.55408 15.5 5C15.5 6.18937 16.0933 7.24018 17 7.87266ZM22.5 5C22.5 6.18937 21.9067 7.24018 21 7.87266V6.5H19V5H20V3.5H21V2.12734C21.9067 2.75982 22.5 3.81063 22.5 5Z",
          fill: "currentColor"
        })
      ]
    }),
    VolumeMute: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M2 16V8H6L12 3V21L6 16H2Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "20.2981",
          y: "8.64111",
          width: "1.5",
          height: "8",
          transform: "rotate(45 20.2981 8.64111)",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "21.3588",
          y: "14.2983",
          width: "1.5",
          height: "8",
          transform: "rotate(135 21.3588 14.2983)",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M6 8H2V16H6L12 21V3L6 8ZM10.5 6.20256L6.54308 9.5H3.5V14.5H6.54308L10.5 17.7974V6.20256Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "20.2981",
          y: "8.64111",
          width: "1.5",
          height: "8",
          transform: "rotate(45 20.2981 8.64111)",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "21.3588",
          y: "14.2983",
          width: "1.5",
          height: "8",
          transform: "rotate(135 21.3588 14.2983)",
          fill: "currentColor"
        })
      ]
    }),
    File: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M12 2H4V22H20V10H12V2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M20 8L14 8V2L20 8Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M14 2L20 8V22H4V2H14ZM18.5 10H12V3.5H5.5V20.5H18.5V10Z",
      fill: "currentColor"
    }),
    Category: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "3",
          y: "3",
          width: "8",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "3",
          y: "13",
          width: "8",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "13",
          y: "3",
          width: "8",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "13",
          y: "13",
          width: "8",
          height: "8",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M9.5 4.5H4.5V9.5H9.5V4.5ZM3 3V11H11V3H3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M9.5 14.5H4.5V19.5H9.5V14.5ZM3 13V21H11V13H3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M19.5 4.5H14.5V9.5H19.5V4.5ZM13 3V11H21V3H13Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M19.5 14.5H14.5V19.5H19.5V14.5ZM13 13V21H21V13H13Z",
          fill: "currentColor"
        })
      ]
    }),
    Peace: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M11.25 2.02783C6.07745 2.41136 2 6.72957 2 12.0001C2 14.236 2.73379 16.3005 3.97368 17.9659L11.25 10.6896V2.02783Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4.95939 19.1015C6.60053 20.7287 8.8027 21.791 11.25 21.9724V12.8109L4.95939 19.1015Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12.75 21.9724C15.1973 21.791 17.3995 20.7287 19.0406 19.1015L12.75 12.8109V21.9724Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M20.0263 17.9659L12.75 10.6896V2.02783C17.9226 2.41136 22 6.72958 22 12.0001C22 14.236 21.2662 16.3005 20.0263 17.9659Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM11.25 12.8108V20.4674C9.2171 20.2896 7.38933 19.3963 6.02005 18.0407L11.25 12.8108ZM11.25 10.6894L5.04777 16.8917C4.07268 15.5084 3.5 13.8211 3.5 12C3.5 7.55831 6.90686 3.91233 11.25 3.53263V10.6894ZM12.75 12.8108V20.4674C14.7829 20.2896 16.6107 19.3963 17.9799 18.0407L12.75 12.8108ZM18.9522 16.8917L12.75 10.6895V3.53263C17.0931 3.91233 20.5 7.55831 20.5 12C20.5 13.8211 19.9273 15.5084 18.9522 16.8917Z",
      fill: "currentColor"
    }),
    Eye: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 19C18.0751 19 23 12 23 12C23 12 18.0751 5 12 5C5.92487 5 1 12 1 12C1 12 5.92487 19 12 19ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M1 12C1 12 5.92487 19 12 19C18.0751 19 23 12 23 12C23 12 18.0751 5 12 5C5.92487 5 1 12 1 12ZM2.90443 12C2.93793 12.0401 2.97258 12.0813 3.00836 12.1235C3.53083 12.7395 4.28523 13.5585 5.21221 14.3734C7.11461 16.0459 9.51515 17.5 12 17.5C14.4849 17.5 16.8854 16.0459 18.7878 14.3734C19.7148 13.5585 20.4692 12.7395 20.9916 12.1235C21.0274 12.0813 21.0621 12.0401 21.0956 12C21.0621 11.9599 21.0274 11.9187 20.9916 11.8765C20.4692 11.2605 19.7148 10.4415 18.7878 9.62656C16.8854 7.9541 14.4849 6.5 12 6.5C9.51515 6.5 7.11461 7.9541 5.21221 9.62656C4.28523 10.4415 3.53083 11.2605 3.00836 11.8765C2.97258 11.9187 2.93793 11.9599 2.90443 12ZM2.22578 11.1354C2.22576 11.1354 2.22572 11.1354 2.22578 11.1354Z",
          fill: "currentColor"
        })
      ]
    }),
    EyeBlind: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M4.75213 3.69141L3.69147 4.75207L6.02989 7.09048C3.00297 9.15318 1 12.0001 1 12.0001C1 12.0001 5.92487 19.0001 12 19.0001C13.663 19.0001 15.2399 18.4756 16.6531 17.7137L19.2478 20.3084L20.3085 19.2478L4.75213 3.69141ZM13.5241 14.5847L9.41543 10.476C9.15147 10.9227 9 11.4437 9 12.0001C9 13.657 10.3431 15.0001 12 15.0001C12.5564 15.0001 13.0774 14.8486 13.5241 14.5847Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13.0954 9.2064C13.8712 9.5108 14.4893 10.129 14.7937 10.9047L19.5699 15.6808C21.6825 13.8727 23 12.0001 23 12.0001C23 12.0001 18.0751 5.00011 12 5.00011C11.0772 5.00011 10.181 5.16161 9.32458 5.43554L13.0954 9.2064Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M4.75213 3.69141L3.69147 4.75207L6.02989 7.09049C3.00297 9.15318 1 12.0001 1 12.0001C1 12.0001 5.92487 19.0001 12 19.0001C13.663 19.0001 15.2399 18.4756 16.6531 17.7137L19.2478 20.3084L20.3085 19.2478L4.75213 3.69141ZM15.5394 16.6L13.5242 14.5848C13.0775 14.8488 12.5565 15.0003 12 15.0003C10.3431 15.0003 9 13.6572 9 12.0003C9 11.4439 9.1515 10.9228 9.4155 10.4761L7.11135 8.17195C6.4387 8.61141 5.80156 9.10856 5.21221 9.62667C4.28523 10.4416 3.53083 11.2607 3.00836 11.8766C2.97258 11.9188 2.93793 11.96 2.90443 12.0001C2.93793 12.0402 2.97258 12.0814 3.00836 12.1236C3.53083 12.7396 4.28523 13.5586 5.21221 14.3736C7.11461 16.046 9.51515 17.5001 12 17.5001C13.2162 17.5001 14.4122 17.1518 15.5394 16.6ZM18.5058 14.6167C18.6009 14.5363 18.6949 14.4552 18.7878 14.3736C19.7148 13.5586 20.4692 12.7396 20.9916 12.1236C21.0274 12.0814 21.0621 12.0402 21.0956 12.0001C21.0621 11.96 21.0274 11.9188 20.9916 11.8766C20.4692 11.2607 19.7148 10.4416 18.7878 9.62667C16.8854 7.95422 14.4849 6.50011 12 6.50011C11.5118 6.50011 11.0268 6.55625 10.5482 6.65915L9.32458 5.43554C10.181 5.16161 11.0772 5.00011 12 5.00011C18.0751 5.00011 23 12.0001 23 12.0001C23 12.0001 21.6825 13.8727 19.5699 15.6808L18.5058 14.6167Z",
      fill: "currentColor"
    }),
    Warning: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM11 14V6H13V14H11ZM11 18V16H13V18H11Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "6",
          width: "2",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "16",
          width: "2",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    Funnel: (t) => t ? o.jsx("path", {
      d: "M2 4H22V5.5L14 13.5V21H10V13.5L2 5.5V4Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M15 12.5L22 5.5V4H2V5.5L9 12.5V21H15V12.5ZM13.5 19.5V11.8787L19.8787 5.5H4.12132L10.5 11.8787V19.5H13.5Z",
      fill: "currentColor"
    }),
    Inbox: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M19 3V14H21V21H3V14H5V3H19ZM6.5 14V4.5H17.5V14H15C15 15.6569 13.6569 17 12 17C10.3431 17 9 15.6569 9 14H6.5Z",
      fill: "currentColor"
    }) : o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M19 3V14H21V21H3V14H5V3H19ZM6.5 14V4.5H17.5V14H14C14 15.1046 13.1046 16 12 16C10.8954 16 10 15.1046 10 14H6.5ZM19.5 15.5V19.5H4.5V15.5H6.5L8.83682 15.5C9.39855 16.6825 10.6038 17.5 12 17.5C13.3962 17.5 14.6015 16.6825 15.1632 15.5L17.5 15.5H19.5Z",
      fill: "currentColor"
    }),
    Thread: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M16 2C18.7614 2 21 4.23858 21 7V22L16 20H8C5.23858 20 3 17.7614 3 15V7C3 4.23858 5.23858 2 8 2H16ZM8 12V14H16V12H8ZM8 10H16V8H8V10Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M16 20H8C5.23858 20 3 17.7614 3 15V7C3 4.23858 5.23858 2 8 2H16C18.7614 2 21 4.23858 21 7V22L16 20ZM19.5 19.7845L16.2889 18.5H8C6.067 18.5 4.5 16.933 4.5 15V7C4.5 5.067 6.067 3.5 8 3.5H16C17.933 3.5 19.5 5.067 19.5 7V19.7845Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "8",
          y: "8",
          width: "8",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "8",
          y: "12",
          width: "8",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    ThreadPlus: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M16 2C18.7614 2 21 4.23858 21 7V22L16 20H8C5.23858 20 3 17.7614 3 15V7C3 4.23858 5.23858 2 8 2H16ZM11 7V10H8V12H11V15H13V12H16V10H13V7H11Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M16 20H8C5.23858 20 3 17.7614 3 15V7C3 4.23858 5.23858 2 8 2H16C18.7614 2 21 4.23858 21 7V22L16 20ZM19.5 19.7845L16.2889 18.5H8C6.067 18.5 4.5 16.933 4.5 15V7C4.5 5.067 6.067 3.5 8 3.5H16C17.933 3.5 19.5 5.067 19.5 7V19.7845Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "7",
          width: "2",
          height: "8",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "16",
          y: "10",
          width: "2",
          height: "8",
          transform: "rotate(90 16 10)",
          fill: "currentColor"
        })
      ]
    }),
    ThreadReply: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M16 2C18.7614 2 21 4.23858 21 7V22L16 20H8C5.23858 20 3 17.7614 3 15V7C3 4.23858 5.23858 2 8 2H16ZM7.58594 11L11.293 14.707L12.707 13.293L11.4141 12H13C14.1046 12 15 12.8954 15 14H17C17 11.7909 15.2091 10 13 10H11.4141L12.707 8.70703L11.293 7.29297L7.58594 11Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M16 20H8C5.23858 20 3 17.7614 3 15V7C3 4.23858 5.23858 2 8 2H16C18.7614 2 21 4.23858 21 7V22L16 20ZM19.5 19.7845L16.2889 18.5H8C6.067 18.5 4.5 16.933 4.5 15V7C4.5 5.067 6.067 3.5 8 3.5H16C17.933 3.5 19.5 5.067 19.5 7V19.7845Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12.707 8.70703L11.4141 10H13C15.2091 10 17 11.7909 17 14H15C15 12.8954 14.1046 12 13 12H11.4141L12.707 13.293L11.293 14.707L7.58594 11L11.293 7.29297L12.707 8.70703Z",
          fill: "currentColor"
        })
      ]
    }),
    Monitor: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "8",
          y: "20",
          width: "8",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M18 3C20.2091 3 22 4.79086 22 7V15C22 17.2091 20.2091 19 18 19H6C3.79086 19 2 17.2091 2 15V7C2 4.79086 3.79086 3 6 3H18ZM12 14C11.4477 14 11 14.4477 11 15C11 15.5523 11.4477 16 12 16C12.5523 16 13 15.5523 13 15C13 14.4477 12.5523 14 12 14Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "8",
          y: "19",
          width: "8",
          height: "3",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 17.5V19H6V17.5H18ZM20.5 15V7C20.5 5.61929 19.3807 4.5 18 4.5H6C4.61929 4.5 3.5 5.61929 3.5 7V15C3.5 16.3807 4.61929 17.5 6 17.5V19L5.79395 18.9951C3.68056 18.8879 2 17.14 2 15V7C2 4.79086 3.79086 3 6 3H18C20.2091 3 22 4.79086 22 7V15C22 17.2091 20.2091 19 18 19V17.5C19.3807 17.5 20.5 16.3807 20.5 15Z",
          fill: "currentColor"
        }),
        o.jsx("circle", {
          cx: "12",
          cy: "15",
          r: "1",
          fill: "currentColor"
        })
      ]
    }),
    ScreenShare: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "8",
          y: "20",
          width: "8",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M18 3C20.2091 3 22 4.79086 22 7V15C22 17.2091 20.2091 19 18 19H6C3.79086 19 2 17.2091 2 15V7C2 4.79086 3.79086 3 6 3H18ZM7.29297 11.293L8.70703 12.707L11 10.4141V15H13V10.4141L15.293 12.707L16.707 11.293L12 6.58594L7.29297 11.293Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "8",
          y: "19",
          width: "8",
          height: "3",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18 17.5V19H6V17.5H18ZM20.5 15V7C20.5 5.61929 19.3807 4.5 18 4.5H6C4.61929 4.5 3.5 5.61929 3.5 7V15C3.5 16.3807 4.61929 17.5 6 17.5V19L5.79395 18.9951C3.68056 18.8879 2 17.14 2 15V7C2 4.79086 3.79086 3 6 3H18C20.2091 3 22 4.79086 22 7V15C22 17.2091 20.2091 19 18 19V17.5C19.3807 17.5 20.5 16.3807 20.5 15Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M16.707 11.293L15.293 12.707L13 10.4141V15H11V10.4141L8.70703 12.707L7.29297 11.293L12 6.58594L16.707 11.293Z",
          fill: "currentColor"
        })
      ]
    }),
    Server: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M22 11H2V3H22V11ZM5 6V8H7V6H5ZM13 8H19V6H13V8Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M22 21H2V13H22V21ZM5 16V18H7V16H5ZM13 18H19V16H13V18Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M2 13L22 13L22 21L2 21L2 13ZM20.5 19.5L20.5 14.5L3.5 14.5L3.5 19.5L20.5 19.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2 3L22 3L22 11L2 11L2 3ZM20.5 9.5L20.5 4.5L3.5 4.5L3.5 9.5L20.5 9.5Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "5",
          y: "6",
          width: "2",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "13",
          y: "6",
          width: "6",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "5",
          y: "16",
          width: "2",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "13",
          y: "16",
          width: "6",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    Prohibited: (t) => t ? o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM5.63574 7.0498L16.9502 18.3643L18.3643 16.9502L7.0498 5.63574L5.63574 7.0498Z",
      fill: "currentColor"
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M20.5 12C20.5 7.30558 16.6944 3.5 12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5V22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22V20.5C16.6944 20.5 20.5 16.6944 20.5 12Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "6.34314",
          y: "4.92871",
          width: "18",
          height: "2",
          transform: "rotate(45 6.34314 4.92871)",
          fill: "currentColor"
        })
      ]
    }),
    Mic: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M12 18.5C8.41015 18.5 5.5 15.5899 5.5 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12H18.5C18.5 15.5899 15.5899 18.5 12 18.5Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "19",
          width: "2",
          height: "3",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8 6C8 3.79086 9.79086 2 12 2C14.2091 2 16 3.79086 16 6V12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12V6Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M14.5 12V6C14.5 4.61929 13.3807 3.5 12 3.5C10.6193 3.5 9.5 4.61929 9.5 6V12C9.5 13.3807 10.6193 14.5 12 14.5V16C9.85996 16 8.11211 14.3194 8.00488 12.2061L8 12V6C8 3.79086 9.79086 2 12 2C14.2091 2 16 3.79086 16 6V12C16 14.2091 14.2091 16 12 16V14.5C13.3807 14.5 14.5 13.3807 14.5 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 18.5C8.41015 18.5 5.5 15.5899 5.5 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12H18.5C18.5 15.5899 15.5899 18.5 12 18.5Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "19",
          width: "2",
          height: "3",
          fill: "currentColor"
        })
      ]
    }),
    MicMute: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "11",
          y: "19",
          width: "2",
          height: "3",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14.668 14.9785C13.96 15.6131 13.0255 16 12 16C9.79086 16 8 14.2091 8 12V8.31055L14.668 14.9785Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 2C14.2091 2 16 3.79086 16 6V12C16 12.2427 15.977 12.4801 15.9355 12.7109L8.14746 4.92285C8.61782 3.237 10.1641 2 12 2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.5 12C5.5 15.5899 8.41015 18.5 12 18.5C13.7159 18.5 15.2748 17.8333 16.4365 16.7471L17.4971 17.8076C16.0635 19.165 14.1301 20 12 20C7.58172 20 4 16.4183 4 12H5.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M20 12C20 13.3797 19.6501 14.6776 19.0352 15.8105L17.916 14.6914C18.2898 13.8711 18.5 12.9603 18.5 12H20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M3.73438 5.45947L4.79504 4.39881L20.3514 19.9552L19.2907 21.0158L3.73438 5.45947Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "11",
          y: "19",
          width: "2",
          height: "3",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M9.5 9.81055V12C9.5 13.3807 10.6193 14.5 12 14.5C12.6112 14.5 13.1702 14.2793 13.6045 13.915L14.668 14.9785C13.96 15.6131 13.0255 16 12 16C9.85996 16 8.11211 14.3194 8.00488 12.2061L8 12V8.31055L9.5 9.81055Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 2C14.2091 2 16 3.79086 16 6V12C16 12.2427 15.977 12.4801 15.9355 12.7109L14.5 11.2754V6C14.5 4.61929 13.3807 3.5 12 3.5C10.6193 3.5 9.5 4.61929 9.5 6V6.27539L8.14746 4.92285C8.61782 3.237 10.1641 2 12 2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5.5 12C5.5 15.5899 8.41015 18.5 12 18.5C13.7159 18.5 15.2748 17.8333 16.4365 16.7471L17.4971 17.8076C16.0635 19.165 14.1301 20 12 20C7.58172 20 4 16.4183 4 12H5.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M20 12C20 13.3797 19.6501 14.6776 19.0352 15.8105L17.916 14.6914C18.2898 13.8711 18.5 12.9603 18.5 12H20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M3.73438 5.45947L4.79504 4.39881L20.3514 19.9552L19.2907 21.0158L3.73438 5.45947Z",
          fill: "currentColor"
        })
      ]
    }),
    VideoCamera: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M15 4C16.6569 4 18 5.34315 18 7L18 17C18 18.6569 16.6569 20 15 20L5 20C3.34315 20 2 18.6569 2 17L2 7C2 5.34315 3.34315 4 5 4L15 4Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M22 7L18 11V13L22 17V7Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3.5 17L2 17L2 7L3.5 7L3.5 17ZM5 18.5L15 18.5C15.8284 18.5 16.5 17.8284 16.5 17L16.5 7C16.5 6.17157 15.8284 5.5 15 5.5L5 5.5C4.17157 5.5 3.5 6.17157 3.5 7L2 7L2.00391 6.8457C2.08163 5.31166 3.31166 4.08163 4.8457 4.00391L5 4L15 4C16.6569 4 18 5.34315 18 7L18 17C18 18.6569 16.6569 20 15 20L5 20L4.8457 19.9961C3.31166 19.9184 2.08163 18.6883 2.00391 17.1543L2 17L3.5 17C3.5 17.8284 4.17157 18.5 5 18.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M22 7L18 11V13L22 17V7Z",
          fill: "currentColor"
        })
      ]
    }),
    VideoCameraMute: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M22 7L18 11V13L22 17V7Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M17.6992 18.3027C17.214 19.3063 16.1894 20 15 20H5C3.34315 20 2 18.6569 2 17V7C2 5.81074 2.69298 4.78512 3.69629 4.2998L17.6992 18.3027Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M15 4C16.6569 4 18 5.34315 18 7V15.7754L6.22461 4H15Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "2.33795",
          y: "2.94141",
          width: "24",
          height: "1.5",
          transform: "rotate(45 2.33795 2.94141)",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M22 7L18 11V13L22 17V7Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M3.5 17C3.5 17.8284 4.17157 18.5 5 18.5H15C15.7956 18.5 16.4437 17.8805 16.4941 17.0977L17.6992 18.3027C17.214 19.3063 16.1894 20 15 20H5L4.8457 19.9961C3.31166 19.9184 2.08163 18.6883 2.00391 17.1543L2 17V7L2.00391 6.8457C2.06082 5.72233 2.73664 4.764 3.69629 4.2998L4.90137 5.50488C4.11897 5.55573 3.5 6.20475 3.5 7V17Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M15 4C16.6569 4 18 5.34315 18 7V15.7754L16.5 14.2754V7C16.5 6.17157 15.8284 5.5 15 5.5H7.72461L6.22461 4H15Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "2.33795",
          y: "2.94141",
          width: "24",
          height: "1.5",
          transform: "rotate(45 2.33795 2.94141)",
          fill: "currentColor"
        })
      ]
    }),
    BlockQuote: (t) => t ? o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M2 20H11V11H3.5C3.5 7.96243 5.96243 5.5 9 5.5H11V4H9C5.13401 4 2 7.13401 2 11V20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M13 20H22V11H14.5C14.5 7.96243 16.9624 5.5 20 5.5H22V4H20C16.134 4 13 7.13401 13 11V20Z",
          fill: "currentColor"
        })
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M2 20H11V11H3.5C3.5 7.96243 5.96243 5.5 9 5.5H11V4H9C5.13401 4 2 7.13401 2 11V20ZM9.5 12.5H3.5V18.5H9.5V12.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M13 20H22V11H14.5C14.5 7.96243 16.9624 5.5 20 5.5H22V4H20C16.134 4 13 7.13401 13 11V20ZM20.5 12.5H14.5V18.5H20.5V12.5Z",
          fill: "currentColor"
        })
      ]
    }),
    Hash: () => o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M9.5 3H8V8L3 8V9.5H8V14.5H3V16H8V21H9.5V16L14.5 16V21H16V16H21V14.5H16V9.5H21V8L16 8V3H14.5V8H9.5V3ZM14.5 14.5V9.5L9.5 9.5V14.5L14.5 14.5Z",
      fill: "currentColor"
    }),
    HashLock: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M12 8L9.5 8V3H8V8L3 8V9.5H8V14.5H3V16H8V21H9.5V16L14.5 16V21H16V16H21V14.5H16V12H14.5V14.5L9.5 14.5V9.5L12 9.5V8Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M15 4V3C15 1.34315 16.3431 0 18 0C19.6569 0 21 1.34315 21 3V4H22V10H14V4H15ZM19.5 3V4H16.5V3C16.5 2.17157 17.1716 1.5 18 1.5C18.8284 1.5 19.5 2.17157 19.5 3Z",
          fill: "currentColor"
        })
      ]
    }),
    HashGlobe: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M24 5C24 7.76142 21.7614 10 19 10C16.2386 10 14 7.76142 14 5C14 2.23858 16.2386 0 19 0C21.7614 0 24 2.23858 24 5ZM17 7.87266V5L15.7354 3.73543C15.5834 4.12764 15.5 4.55408 15.5 5C15.5 6.18937 16.0933 7.24018 17 7.87266ZM22.5 5C22.5 6.18937 21.9067 7.24018 21 7.87266V6.5H19V5H20V3.5H21V2.12734C21.9067 2.75982 22.5 3.81063 22.5 5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 8L9.5 8V3H8V8L3 8V9.5H8V14.5H3V16H8V21H9.5V16L14.5 16V21H16V16H21V14.5H16V12H14.5V14.5L9.5 14.5V9.5L12 9.5V8Z",
          fill: "currentColor"
        })
      ]
    }),
    Space: () => o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M14.4055 9.59452L14.2338 8.5223C13.9568 6.79272 13.4927 5.41447 12.9703 4.51403C12.4033 3.53675 12.013 3.5 12 3.5C11.987 3.5 11.5967 3.53675 11.0297 4.51403C10.5073 5.41447 10.0432 6.79272 9.76623 8.5223L9.59452 9.59452L8.5223 9.76623C6.79272 10.0432 5.41447 10.5073 4.51403 11.0297C3.53675 11.5967 3.5 11.987 3.5 12C3.5 12.013 3.53675 12.4033 4.51403 12.9703C5.41447 13.4927 6.79272 13.9568 8.5223 14.2338L9.59452 14.4055L9.76623 15.4777C10.0432 17.2073 10.5073 18.5855 11.0297 19.486C11.5967 20.4633 11.987 20.5 12 20.5C12.013 20.5 12.4033 20.4633 12.9703 19.486C13.4927 18.5855 13.9568 17.2073 14.2338 15.4777L14.4055 14.4055L15.4777 14.2338C17.2073 13.9568 18.5855 13.4927 19.486 12.9703C20.4633 12.4033 20.5 12.013 20.5 12C20.5 11.987 20.4633 11.5967 19.486 11.0297C18.5855 10.5073 17.2073 10.0432 15.4777 9.76623L14.4055 9.59452ZM15.7149 15.7149C19.3983 15.125 22 13.684 22 12C22 10.316 19.3983 8.87498 15.7149 8.28511C15.125 4.60173 13.684 2 12 2C10.316 2 8.87498 4.60173 8.28511 8.28511C4.60173 8.87498 2 10.316 2 12C2 13.684 4.60173 15.125 8.28511 15.7149C8.87498 19.3983 10.316 22 12 22C13.684 22 15.125 19.3983 15.7149 15.7149Z",
      fill: "currentColor"
    }),
    SpaceLock: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M12 2C10.316 2 8.87498 4.60173 8.28511 8.28511C4.60173 8.87498 2 10.316 2 12C2 13.684 4.60173 15.125 8.28511 15.7149C8.87498 19.3983 10.316 22 12 22C13.684 22 15.125 19.3983 15.7149 15.7149C19.3983 15.125 22 13.684 22 12H20.5C20.5 12.013 20.4633 12.4033 19.486 12.9703C18.5855 13.4927 17.2073 13.9568 15.4777 14.2338L14.4055 14.4055L14.2338 15.4777C13.9568 17.2073 13.4927 18.5855 12.9703 19.486C12.4033 20.4633 12.013 20.5 12 20.5C11.987 20.5 11.5967 20.4633 11.0297 19.486C10.5073 18.5855 10.0432 17.2073 9.76623 15.4777L9.59452 14.4055L8.5223 14.2338C6.79272 13.9568 5.41447 13.4927 4.51403 12.9703C3.53675 12.4033 3.5 12.013 3.5 12C3.5 11.987 3.53675 11.5967 4.51403 11.0297C5.41447 10.5073 6.79272 10.0432 8.5223 9.76623L9.59452 9.59452L9.76623 8.5223C10.0432 6.79272 10.5073 5.41447 11.0297 4.51403C11.5967 3.53675 11.987 3.5 12 3.5V2Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M15 4V3C15 1.34315 16.3431 0 18 0C19.6569 0 21 1.34315 21 3V4H22V10H14V4H15ZM19.5 3V4H16.5V3C16.5 2.17157 17.1716 1.5 18 1.5C18.8284 1.5 19.5 2.17157 19.5 3Z",
          fill: "currentColor"
        })
      ]
    }),
    SpaceGlobe: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M24 5C24 7.76142 21.7614 10 19 10C16.2386 10 14 7.76142 14 5C14 2.23858 16.2386 0 19 0C21.7614 0 24 2.23858 24 5ZM17 7.87266V5L15.7354 3.73543C15.5834 4.12764 15.5 4.55408 15.5 5C15.5 6.18937 16.0933 7.24018 17 7.87266ZM22.5 5C22.5 6.18937 21.9067 7.24018 21 7.87266V6.5H19V5H20V3.5H21V2.12734C21.9067 2.75982 22.5 3.81063 22.5 5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12 2C10.316 2 8.87498 4.60173 8.28511 8.28511C4.60173 8.87498 2 10.316 2 12C2 13.684 4.60173 15.125 8.28511 15.7149C8.87498 19.3983 10.316 22 12 22C13.684 22 15.125 19.3983 15.7149 15.7149C19.3983 15.125 22 13.684 22 12H20.5C20.5 12.013 20.4633 12.4033 19.486 12.9703C18.5855 13.4927 17.2073 13.9568 15.4777 14.2338L14.4055 14.4055L14.2338 15.4777C13.9568 17.2073 13.4927 18.5855 12.9703 19.486C12.4033 20.4633 12.013 20.5 12 20.5C11.987 20.5 11.5967 20.4633 11.0297 19.486C10.5073 18.5855 10.0432 17.2073 9.76623 15.4777L9.59452 14.4055L8.5223 14.2338C6.79272 13.9568 5.41447 13.4927 4.51403 12.9703C3.53675 12.4033 3.5 12.013 3.5 12C3.5 11.987 3.53675 11.5967 4.51403 11.0297C5.41447 10.5073 6.79272 10.0432 8.5223 9.76623L9.59452 9.59452L9.76623 8.5223C10.0432 6.79272 10.5073 5.41447 11.0297 4.51403C11.5967 3.53675 11.987 3.5 12 3.5V2Z",
          fill: "currentColor"
        })
      ]
    }),
    ChevronRight: () => o.jsx("path", {
      d: "M16.1421 12L9.07107 4.92893L8.01041 5.98959L14.0208 12L8.01041 18.0104L9.07107 19.0711L16.1421 12Z",
      fill: "currentColor"
    }),
    ChevronLeft: () => o.jsx("path", {
      d: "M6.85786 12L13.9289 19.0711L14.9896 18.0104L8.97918 12L14.9896 5.98959L13.9289 4.92893L6.85786 12Z",
      fill: "currentColor"
    }),
    ChevronTop: () => o.jsx("path", {
      d: "M12 6.85786L4.92893 13.9289L5.98959 14.9896L12 8.97918L18.0104 14.9896L19.0711 13.9289L12 6.85786Z",
      fill: "currentColor"
    }),
    ChevronBottom: () => o.jsx("path", {
      d: "M12 17.1421L19.0711 10.0711L18.0104 9.01041L12 15.0208L5.98959 9.01041L4.92893 10.0711L12 17.1421Z",
      fill: "currentColor"
    }),
    Plus: () => o.jsx("path", {
      d: "M13 5H11V11H5V13H11V19H13V13H19V11H13V5Z",
      fill: "currentColor"
    }),
    Minus: () => o.jsx("rect", {
      x: "5",
      y: "11",
      width: "14",
      height: "2",
      fill: "currentColor"
    }),
    Cross: () => o.jsx("path", {
      d: "M7.58056 6.51993L6.5199 7.58059L10.9393 12L6.5199 16.4194L7.58056 17.4801L12 13.0607L16.4194 17.4801L17.4801 16.4194L13.0606 12L17.4801 7.58059L16.4194 6.51993L12 10.9393L7.58056 6.51993Z",
      fill: "currentColor"
    }),
    VerticalDots: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "10",
          y: "3",
          width: "4",
          height: "4",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "10",
          y: "10",
          width: "4",
          height: "4",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "10",
          y: "17",
          width: "4",
          height: "4",
          fill: "currentColor"
        })
      ]
    }),
    HorizontalDots: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "3",
          y: "10",
          width: "4",
          height: "4",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "10",
          y: "10",
          width: "4",
          height: "4",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "17",
          y: "10",
          width: "4",
          height: "4",
          fill: "currentColor"
        })
      ]
    }),
    Check: () => o.jsx("path", {
      d: "M9.52513 17.9246L4.57538 12.9749L5.63604 11.9142L9.52513 15.8033L18.364 6.96448L19.4246 8.02514L9.52513 17.9246Z",
      fill: "currentColor"
    }),
    CheckTwice: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M2.95404 12.4749L7.90379 17.4246L8.96445 16.364L4.0147 11.4142L2.95404 12.4749Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M11.0858 12.1213L12.1464 13.182L17.8033 7.52514L16.7426 6.46448L11.0858 12.1213Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12.1465 17.4246L7.19672 12.4749L8.25738 11.4142L12.1465 15.3033L20.9853 6.46448L22.046 7.52514L12.1465 17.4246Z",
          fill: "currentColor"
        })
      ]
    }),
    Download: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3 14H4.5V19.5H19.5V14H21V21H3V14Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M11.25 3H12.75V15H11.25V3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8.82067 11.6993L7.76001 12.76L12.0027 17.0027L16.2453 12.76L15.1846 11.6993L12.0027 14.8813L8.82067 11.6993Z",
          fill: "currentColor"
        })
      ]
    }),
    External: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M12 3H3V21H21V12H19.5V19.5H4.5V4.5H12V3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14 4.5V3H21V10L19.5 10V4.5H14Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11.9341",
          y: "11.0052",
          width: "10",
          height: "1.5",
          transform: "rotate(-45 11.9341 11.0052)",
          fill: "currentColor"
        })
      ]
    }),
    Clock: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M20.5 12C20.5 7.30558 16.6944 3.5 12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5V22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22V20.5C16.6944 20.5 20.5 16.6944 20.5 12Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "10",
          y: "7",
          width: "2",
          height: "7",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M10 14L10 12L17 12L17 14L10 14Z",
          fill: "currentColor"
        })
      ]
    }),
    RecentClock: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M20.5 12C20.5 16.6944 16.6944 20.5 12 20.5C7.30558 20.5 3.5 16.6944 3.5 12H2C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C8.29859 2 5.06687 4.01099 3.33782 7H5.1254C6.67093 4.87867 9.17446 3.5 12 3.5C16.6944 3.5 20.5 7.30558 20.5 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4.5 3H3V8H8V6.5H4.5V3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M11 7L13 6.99997L13 11.5858L16.9498 15.5355L15.5355 16.9497L11 12.4142L11 7Z",
          fill: "currentColor"
        })
      ]
    }),
    Power: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M17.3033 6.69671C18.6605 8.05394 19.5 9.92894 19.5 12C19.5 16.1421 16.1421 19.5 12 19.5C7.85786 19.5 4.5 16.1421 4.5 12C4.5 9.92894 5.33947 8.05394 6.6967 6.69671L5.63604 5.63605C4.00736 7.26473 3 9.51473 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 9.51473 19.9926 7.26473 18.364 5.63605L17.3033 6.69671Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "11",
          y: "2",
          width: "2",
          height: "10",
          fill: "currentColor"
        })
      ]
    }),
    ReplyArrow: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M21 9.5V8H7V16H8.5V9.5H21Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4.56066 12.6993L3.5 13.76L7.74264 18.0027L11.9853 13.76L10.9246 12.6993L7.74264 15.8813L4.56066 12.6993Z",
          fill: "currentColor"
        })
      ]
    }),
    ArrowGoRight: () => o.jsx("path", {
      d: "M18.124 13H8C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3V4.5C6.067 4.5 4.5 6.067 4.5 8C4.5 9.933 6.067 11.5 8 11.5H18.1387L15.6993 9.06067L16.76 8.00001L21.0027 12.2427L16.76 16.4853L15.6993 15.4246L18.124 13Z",
      fill: "currentColor"
    }),
    ArrowGoRightPlus: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M18.124 13H8C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3V4.5C6.067 4.5 4.5 6.067 4.5 8C4.5 9.933 6.067 11.5 8 11.5H18.1387L15.6993 9.06067L16.76 8.00001L21.0027 12.2427L16.76 16.4853L15.6993 15.4246L18.124 13Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4 15H6V23H4V15Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M9 18L9 20L1 20L1 18L9 18Z",
          fill: "currentColor"
        })
      ]
    }),
    ArrowGoRightCross: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M2.7019 14.6412L1.64124 15.7019L3.93933 18L1.64124 20.2981L2.7019 21.3587L4.99999 19.0607L7.29809 21.3587L8.35875 20.2981L6.06065 18L8.35875 15.7019L7.29809 14.6412L4.99999 16.9393L2.7019 14.6412Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18.124 13H8C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3V4.5C6.067 4.5 4.5 6.067 4.5 8C4.5 9.933 6.067 11.5 8 11.5H18.1387L15.6993 9.06067L16.76 8.00001L21.0027 12.2427L16.76 16.4853L15.6993 15.4246L18.124 13Z",
          fill: "currentColor"
        })
      ]
    }),
    ArrowGoLeft: () => o.jsx("path", {
      d: "M5.87871 13H16.0027C18.7641 13 21.0027 10.7614 21.0027 8C21.0027 5.23858 18.7641 3 16.0027 3V4.5C17.9357 4.5 19.5027 6.067 19.5027 8C19.5027 9.933 17.9357 11.5 16.0027 11.5H5.86401L8.30334 9.06067L7.24268 8.00001L3.00003 12.2427L7.24268 16.4853L8.30334 15.4246L5.87871 13Z",
      fill: "currentColor"
    }),
    Alphabet: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M3 18L7 5H9L13 18H11.5L10.4348 14.5H5.56522L4.5 18H3ZM6.02174 13H9.97826L8 6.5L6.02174 13Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M16.9773 18.0455C16.4242 18.0455 15.9223 17.9413 15.4716 17.733C15.0208 17.5208 14.6629 17.2159 14.3977 16.8182C14.1326 16.4167 14 15.9318 14 15.3636C14 14.8636 14.0985 14.4583 14.2955 14.1477C14.4924 13.8333 14.7557 13.5871 15.0852 13.4091C15.4148 13.2311 15.7784 13.0985 16.1761 13.0114C16.5777 12.9205 16.9811 12.8485 17.3864 12.7955C17.9167 12.7273 18.3466 12.6761 18.6761 12.642C19.0095 12.6042 19.2519 12.5417 19.4034 12.4545C19.5587 12.3674 19.6364 12.2159 19.6364 12V11.9545C19.6364 11.3939 19.483 10.9583 19.1761 10.6477C18.8731 10.3371 18.4129 10.1818 17.7955 10.1818C17.1553 10.1818 16.6534 10.322 16.2898 10.6023C15.9261 10.8826 15.6705 11.1818 15.5227 11.5L14.25 11.0455C14.4773 10.5152 14.7803 10.1023 15.1591 9.80682C15.5417 9.50758 15.9583 9.29924 16.4091 9.18182C16.8636 9.06061 17.3106 9 17.75 9C18.0303 9 18.3523 9.03409 18.7159 9.10227C19.0833 9.16667 19.4375 9.30114 19.7784 9.50568C20.1231 9.71023 20.4091 10.0189 20.6364 10.4318C20.8636 10.8447 20.9773 11.3977 20.9773 12.0909V17.8409H19.6364V16.6591H19.5682C19.4773 16.8485 19.3258 17.0511 19.1136 17.267C18.9015 17.483 18.6193 17.6667 18.267 17.8182C17.9148 17.9697 17.4848 18.0455 16.9773 18.0455ZM17.1818 16.8409C17.7121 16.8409 18.1591 16.7367 18.5227 16.5284C18.8902 16.3201 19.1667 16.0511 19.3523 15.7216C19.5417 15.392 19.6364 15.0455 19.6364 14.6818V13.4545C19.5795 13.5227 19.4545 13.5852 19.2614 13.642C19.072 13.6951 18.8523 13.7424 18.6023 13.7841C18.3561 13.822 18.1155 13.8561 17.8807 13.8864C17.6496 13.9129 17.4621 13.9356 17.3182 13.9545C16.9697 14 16.6439 14.0739 16.3409 14.1761C16.0417 14.2746 15.7992 14.4242 15.6136 14.625C15.4318 14.822 15.3409 15.0909 15.3409 15.4318C15.3409 15.8977 15.5133 16.25 15.858 16.4886C16.2064 16.7235 16.6477 16.8409 17.1818 16.8409Z",
          fill: "currentColor"
        })
      ]
    }),
    AlphabetUnderline: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M3 17L7 4H9L13 17H11.5L10.4348 13.5H5.56522L4.5 17H3ZM6.02174 12H9.97826L8 5.5L6.02174 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M16.9773 17.0455C16.4242 17.0455 15.9223 16.9413 15.4716 16.733C15.0208 16.5208 14.6629 16.2159 14.3977 15.8182C14.1326 15.4167 14 14.9318 14 14.3636C14 13.8636 14.0985 13.4583 14.2955 13.1477C14.4924 12.8333 14.7557 12.5871 15.0852 12.4091C15.4148 12.2311 15.7784 12.0985 16.1761 12.0114C16.5777 11.9205 16.9811 11.8485 17.3864 11.7955C17.9167 11.7273 18.3466 11.6761 18.6761 11.642C19.0095 11.6042 19.2519 11.5417 19.4034 11.4545C19.5587 11.3674 19.6364 11.2159 19.6364 11V10.9545C19.6364 10.3939 19.483 9.95833 19.1761 9.64773C18.8731 9.33712 18.4129 9.18182 17.7955 9.18182C17.1553 9.18182 16.6534 9.32197 16.2898 9.60227C15.9261 9.88258 15.6705 10.1818 15.5227 10.5L14.25 10.0455C14.4773 9.51515 14.7803 9.10227 15.1591 8.80682C15.5417 8.50758 15.9583 8.29924 16.4091 8.18182C16.8636 8.06061 17.3106 8 17.75 8C18.0303 8 18.3523 8.03409 18.7159 8.10227C19.0833 8.16667 19.4375 8.30114 19.7784 8.50568C20.1231 8.71023 20.4091 9.01894 20.6364 9.43182C20.8636 9.8447 20.9773 10.3977 20.9773 11.0909V16.8409H19.6364V15.6591H19.5682C19.4773 15.8485 19.3258 16.0511 19.1136 16.267C18.9015 16.483 18.6193 16.6667 18.267 16.8182C17.9148 16.9697 17.4848 17.0455 16.9773 17.0455ZM17.1818 15.8409C17.7121 15.8409 18.1591 15.7367 18.5227 15.5284C18.8902 15.3201 19.1667 15.0511 19.3523 14.7216C19.5417 14.392 19.6364 14.0455 19.6364 13.6818V12.4545C19.5795 12.5227 19.4545 12.5852 19.2614 12.642C19.072 12.6951 18.8523 12.7424 18.6023 12.7841C18.3561 12.822 18.1155 12.8561 17.8807 12.8864C17.6496 12.9129 17.4621 12.9356 17.3182 12.9545C16.9697 13 16.6439 13.0739 16.3409 13.1761C16.0417 13.2746 15.7992 13.4242 15.6136 13.625C15.4318 13.822 15.3409 14.0909 15.3409 14.4318C15.3409 14.8977 15.5133 15.25 15.858 15.4886C16.2064 15.7235 16.6477 15.8409 17.1818 15.8409Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M2 18.5H22V20H2V18.5Z",
          fill: "currentColor"
        })
      ]
    }),
    Heading1: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M20 20H18.5V13H17V12L20 11V20Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M3 20V4H4.5V11H12.5V4H14V20H12.5V12.5H4.5V20H3Z",
          fill: "currentColor"
        })
      ]
    }),
    Heading2: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3 20V4H4.5V11H12.5V4H14V20H12.5V12.5H4.5V20H3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M21 20V18.5H18L20.0072 16.1583C20.6478 15.4109 21 14.4589 21 13.4744C21 12.1078 19.8794 11 18.5129 11C17.1321 11 16 12.1193 16 13.5V14H17.5V13.5C17.5 12.9477 17.9477 12.5 18.5 12.5C19.0523 12.5 19.5 12.9477 19.5 13.5V13.7485C19.5 14.233 19.3242 14.701 19.0052 15.0655L16 18.5V20H21Z",
          fill: "currentColor"
        })
      ]
    }),
    Heading3: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3 20V4H4.5V11H12.5V4H14V20H12.5V12.5H4.5V20H3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M18.5 11C17.2905 11 16.2816 11.8589 16.05 13L17.6338 13C17.8067 12.7011 18.1298 12.5 18.5 12.5C19.0523 12.5 19.5 12.9477 19.5 13.5V13.75C19.5 14.3023 19.0523 14.75 18.5 14.75H18V16.25H18.5C19.0523 16.25 19.5 16.6977 19.5 17.25V17.5C19.5 18.0523 19.0523 18.5 18.5 18.5C18.1298 18.5 17.8067 18.2989 17.6338 18L16.05 18C16.2816 19.1411 17.2905 20 18.5 20C19.8807 20 21 18.8807 21 17.5V17.25C21 16.5686 20.7274 15.9509 20.2853 15.5C20.7274 15.0491 21 14.4314 21 13.75V13.5C21 12.1193 19.8807 11 18.5 11Z",
          fill: "currentColor"
        })
      ]
    }),
    Bold: () => o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M14.5013 11.6717C15.4198 10.8697 16 9.69009 16 8.375C16 5.95875 14.0412 4 11.625 4H7V20H12.625C15.0412 20 17 18.0412 17 15.625C17 13.8803 15.9787 12.3741 14.5013 11.6717ZM8.5 5.5H11.625C13.2128 5.5 14.5 6.78718 14.5 8.375C14.5 9.96282 13.2128 11.25 11.625 11.25H8.5V5.5ZM8.5 12.75V18.5H12.625C14.2128 18.5 15.5 17.2128 15.5 15.625C15.5 14.0372 14.2128 12.75 12.625 12.75H8.5Z",
      fill: "currentColor"
    }),
    Italic: () => o.jsx("path", {
      d: "M18 4H10V5.5H13.5L9 18.5H6V20H14V18.5H10.5L15 5.5H18V4Z",
      fill: "currentColor"
    }),
    Underline: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M8.5 5H7V12C7 14.7614 9.23858 17 12 17C14.7614 17 17 14.7614 17 12V5H15.5V12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12V5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M5 18.5V20H19V18.5H5Z",
          fill: "currentColor"
        })
      ]
    }),
    Strike: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M6.75 8.25C6.75 5.90279 8.65279 4 11 4H12.75C14.6622 4 16.2794 5.26283 16.8132 7H15.2001C14.745 6.10958 13.8187 5.5 12.75 5.5H11C9.48122 5.5 8.25 6.73122 8.25 8.25C8.25 9.76878 9.48122 11 11 11H20V12.5H4V11H7.75952C7.12987 10.2588 6.75 9.29875 6.75 8.25Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M14.8714 14H16.6241C16.8656 14.5337 17 15.1261 17 15.75C17 18.0972 15.0972 20 12.75 20H11C9.08782 20 7.47058 18.7372 6.9368 17H8.54985C9.00503 17.8904 9.93133 18.5 11 18.5H12.75C14.2688 18.5 15.5 17.2688 15.5 15.75C15.5 15.0852 15.2641 14.4755 14.8714 14Z",
          fill: "currentColor"
        })
      ]
    }),
    Link: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("rect", {
          x: "8",
          y: "11",
          width: "8",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M11 7H8C5.23858 7 3 9.23858 3 12C3 14.7614 5.23858 17 8 17H11V15.5H8C6.067 15.5 4.5 13.933 4.5 12C4.5 10.067 6.067 8.5 8 8.5H11V7Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13 15.5H16C17.933 15.5 19.5 13.933 19.5 12C19.5 10.067 17.933 8.5 16 8.5H13V7H16C18.7614 7 21 9.23858 21 12C21 14.7614 18.7614 17 16 17H13V15.5Z",
          fill: "currentColor"
        })
      ]
    }),
    Code: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M8.30334 8.82067L7.24268 7.76001L3.00004 12.0027L7.24268 16.2453L8.30334 15.1846L5.12136 12.0027L8.30334 8.82067Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M15.6993 8.82067L16.76 7.76001L21.0027 12.0027L16.76 16.2453L15.6993 15.1846L18.8813 12.0027L15.6993 8.82067Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M12.5 6L10 18H11.5L14 6H12.5Z",
          fill: "currentColor"
        })
      ]
    }),
    BlockCode: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M10 3H7C5.34315 3 4 4.34315 4 6V10C4 10.5523 3.55228 11 3 11H2V12.5H3C3.55228 12.5 4 12.9477 4 13.5V17.5C4 19.1569 5.34315 20.5 7 20.5H10V19H7C6.17157 19 5.5 18.3284 5.5 17.5V13.5C5.5 12.8186 5.22742 12.2009 4.78536 11.75C5.22742 11.2991 5.5 10.6814 5.5 10V6C5.5 5.17157 6.17157 4.5 7 4.5H10V3Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M13 3H16C17.6569 3 19 4.34315 19 6V10C19 10.5523 19.4477 11 20 11H21V12.5H20C19.4477 12.5 19 12.9477 19 13.5V17.5C19 19.1569 17.6569 20.5 16 20.5H13V19H16C16.8284 19 17.5 18.3284 17.5 17.5V13.5C17.5 12.8186 17.7726 12.2009 18.2146 11.75C17.7726 11.2991 17.5 10.6814 17.5 10V6C17.5 5.17157 16.8284 4.5 16 4.5H13V3Z",
          fill: "currentColor"
        })
      ]
    }),
    OrderList: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M8 5H22V6.5H8V5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8 11H22V12.5H8V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8 17.5H22V19H8V17.5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4 11H3V5.55556H2V4.77778L4 4V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M6 20V18.8333H3.6L5.20573 17.012C5.71827 16.4307 6 15.6902 6 14.9245C6 13.8617 5.10355 13 4.01028 13C2.90571 13 2 13.8706 2 14.9444V15.3333H3.2V14.9444C3.2 14.5149 3.55817 14.1667 4 14.1667C4.44183 14.1667 4.8 14.5149 4.8 14.9444V15.1377C4.8 15.5145 4.65933 15.8785 4.40412 16.1621L2 18.8333V20H6Z",
          fill: "currentColor"
        })
      ]
    }),
    UnorderList: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M8 5H22V6.5H8V5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8 11H22V12.5H8V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M8 17.5H22V19H8V17.5Z",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "3",
          y: "5",
          width: "2",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "3",
          y: "11",
          width: "2",
          height: "2",
          fill: "currentColor"
        }),
        o.jsx("rect", {
          x: "3",
          y: "17",
          width: "2",
          height: "2",
          fill: "currentColor"
        })
      ]
    }),
    Mention: () => o.jsx("path", {
      d: "M12.4105 21.527C10.8892 21.527 9.54441 21.3182 8.37608 20.9006C7.20776 20.488 6.22587 19.8789 5.43041 19.0735C4.63496 18.2681 4.0334 17.2813 3.62573 16.113C3.21806 14.9446 3.01422 13.6073 3.01422 12.1009C3.01422 10.6442 3.22054 9.34165 3.63318 8.19321C4.0508 7.04478 4.65485 6.07035 5.44533 5.26992C6.24078 4.46452 7.20527 3.85053 8.3388 3.42795C9.47729 3.00536 10.7649 2.79407 12.2017 2.79407C13.5987 2.79407 14.8217 3.02276 15.8708 3.48015C16.9247 3.93256 17.8047 4.54655 18.5107 5.32212C19.2216 6.09272 19.7536 6.96026 20.1066 7.92475C20.4645 8.88924 20.6435 9.88356 20.6435 10.9077C20.6435 11.6286 20.6087 12.3594 20.5391 13.1002C20.4695 13.8409 20.3228 14.5221 20.0991 15.1435C19.8754 15.76 19.5298 16.2571 19.0625 16.635C18.6002 17.0128 17.9737 17.2017 17.1833 17.2017C16.8352 17.2017 16.4524 17.1471 16.0348 17.0377C15.6172 16.9283 15.2468 16.7468 14.9237 16.4933C14.6005 16.2397 14.4091 15.8992 14.3494 15.4716H14.26C14.1406 15.76 13.9567 16.0334 13.7081 16.2919C13.4645 16.5505 13.1438 16.7568 12.7461 16.9109C12.3534 17.065 11.8736 17.1321 11.3068 17.1122C10.6605 17.0874 10.0913 16.9432 9.59909 16.6797C9.10691 16.4113 8.69426 16.0483 8.36117 15.5909C8.03304 15.1286 7.78446 14.5941 7.61543 13.9876C7.45137 13.3761 7.36933 12.7174 7.36933 12.0114C7.36933 11.3402 7.46877 10.7262 7.66763 10.1694C7.86649 9.6126 8.14242 9.12539 8.4954 8.70777C8.85336 8.29016 9.27097 7.95706 9.74824 7.70849C10.2305 7.45493 10.75 7.29833 11.3068 7.23867C11.804 7.18895 12.2564 7.21133 12.6641 7.30579C13.0717 7.39528 13.4073 7.53199 13.6708 7.71594C13.9343 7.89492 14.1009 8.09378 14.1705 8.31253H14.26V7.47731H15.8409V14.2188C15.8409 14.6364 15.9578 15.0043 16.1914 15.3225C16.4251 15.6407 16.7656 15.7997 17.2131 15.7997C17.7202 15.7997 18.108 15.6257 18.3764 15.2777C18.6499 14.9297 18.8363 14.3928 18.9357 13.6669C19.0401 12.9411 19.0923 12.0114 19.0923 10.8779C19.0923 10.2117 19.0004 9.55543 18.8164 8.90912C18.6374 8.25785 18.364 7.64883 17.9961 7.08207C17.6332 6.5153 17.1733 6.01566 16.6165 5.58313C16.0597 5.1506 15.4059 4.81253 14.6552 4.56893C13.9095 4.32035 13.0618 4.19606 12.1122 4.19606C10.9439 4.19606 9.89739 4.37752 8.97267 4.74045C8.05293 5.0984 7.2699 5.6229 6.6236 6.31395C5.98226 7.00003 5.49256 7.83526 5.15449 8.81964C4.82139 9.79904 4.65485 10.9127 4.65485 12.1605C4.65485 13.4283 4.82139 14.5544 5.15449 15.5387C5.49256 16.5231 5.98972 17.3534 6.64597 18.0295C7.30719 18.7056 8.12502 19.2177 9.09945 19.5657C10.0739 19.9187 11.1975 20.0952 12.4702 20.0952C13.0171 20.0952 13.5565 20.043 14.0884 19.9386C14.6204 19.8342 15.0902 19.7198 15.4979 19.5956C15.9056 19.4713 16.1989 19.3793 16.3779 19.3196L16.7955 20.6918C16.4872 20.8211 16.0845 20.9503 15.5874 21.0796C15.0952 21.2088 14.5682 21.3157 14.0064 21.4002C13.4496 21.4848 12.9176 21.527 12.4105 21.527ZM11.5455 15.5909C12.2117 15.5909 12.7511 15.4567 13.1637 15.1882C13.5764 14.9198 13.8771 14.5146 14.0661 13.9727C14.255 13.4308 14.3494 12.7472 14.3494 11.9219C14.3494 11.0867 14.245 10.4354 14.0362 9.96807C13.8274 9.50074 13.5192 9.17262 13.1115 8.9837C12.7039 8.79478 12.2017 8.70032 11.6051 8.70032C11.0384 8.70032 10.5536 8.84947 10.1509 9.14776C9.75321 9.44108 9.44746 9.83384 9.23368 10.326C9.02488 10.8132 8.92047 11.3452 8.92047 11.9219C8.92047 12.5583 9.00499 13.1573 9.17402 13.7191C9.34306 14.276 9.61898 14.7284 10.0018 15.0764C10.3846 15.4194 10.8992 15.5909 11.5455 15.5909Z",
      fill: "currentColor"
    }),
    Filter: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3 5H21V6.5H3V5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M6 11H18V12.5H6V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M9 17.5H15V19H9V17.5Z",
          fill: "currentColor"
        })
      ]
    }),
    Sort: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M3 5H21V6.5H3V5Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M3 11H15V12.5H3V11Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M3 17.5H9V19H3V17.5Z",
          fill: "currentColor"
        })
      ]
    }),
    ArrowRight: () => o.jsx("path", {
      d: "M18.124 12.6993H3.00002L3 11.1993L18.1387 11.1993L13 6.06064L14.0607 4.99998L21.0027 11.942L14.0607 18.8839L13 17.8233L18.124 12.6993Z",
      fill: "currentColor"
    }),
    ArrowLeft: () => o.jsx("path", {
      d: "M5.8787 11.244L21.0027 11.244L21.0027 12.744L5.864 12.744L11.0027 17.8827L9.94203 18.9434L3.00003 12.0014L9.94203 5.05943L11.0027 6.12009L5.8787 11.244Z",
      fill: "currentColor"
    }),
    ArrowTop: () => o.jsx("path", {
      d: "M12.7587 5.81938L12.7587 20.9433L11.2587 20.9434L11.2587 5.80467L6.12003 10.9434L5.05937 9.8827L12.0014 2.94071L18.9433 9.8827L17.8827 10.9434L12.7587 5.81938Z",
      fill: "currentColor"
    }),
    ArrowBottom: () => o.jsx("path", {
      d: "M11.244 18.124L11.244 3.00002L12.744 3L12.744 18.1387L17.8827 13L18.9433 14.0607L12.0013 21.0027L5.05936 14.0607L6.12003 13L11.244 18.124Z",
      fill: "currentColor"
    }),
    Reload: () => o.jsxs(o.Fragment, {
      children: [
        o.jsx("path", {
          d: "M20.5 12C20.5 16.6944 16.6944 20.5 12 20.5C7.30558 20.5 3.5 16.6944 3.5 12H2C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C8.29859 2 5.06687 4.01099 3.33782 7H5.1254C6.67093 4.87867 9.17446 3.5 12 3.5C16.6944 3.5 20.5 7.30558 20.5 12Z",
          fill: "currentColor"
        }),
        o.jsx("path", {
          d: "M4.5 3H3V8H8V6.5H4.5V3Z",
          fill: "currentColor"
        })
      ]
    }),
    Globe: () => o.jsx("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM3.53418 12.7451C3.83448 16.2022 6.2028 19.065 9.39648 20.0918C9.24751 19.9488 9.09595 19.7956 8.94531 19.6299C7.67231 18.2296 6.43398 16.0283 6.26953 12.7451H3.53418ZM17.7305 12.7451C17.566 16.0283 16.3277 18.2296 15.0547 19.6299C14.9042 19.7954 14.7523 19.9479 14.6035 20.0908C17.7971 19.064 20.1655 16.2021 20.4658 12.7451H17.7305ZM7.77344 12.7451C7.93424 15.617 9.00957 17.4704 10.0547 18.6201C10.4728 19.0801 10.8906 19.4317 11.25 19.6924V12.7451H7.77344ZM12.75 12.7451V19.6924C13.1094 19.4317 13.5272 19.0801 13.9453 18.6201C14.9904 17.4704 16.0658 15.617 16.2266 12.7451H12.75ZM9.39648 3.90723C6.20567 4.93294 3.83908 7.79235 3.53516 11.2451H6.26953C6.43594 7.96737 7.67357 5.76904 8.94531 4.37012C9.09612 4.20425 9.24735 4.05038 9.39648 3.90723ZM11.25 4.30664C10.8905 4.56736 10.473 4.91975 10.0547 5.37988C9.01075 6.52835 7.93613 8.37883 7.77344 11.2451H11.25V4.30664ZM12.75 11.2451H16.2266C16.0639 8.37883 14.9893 6.52835 13.9453 5.37988C13.527 4.91975 13.1095 4.56736 12.75 4.30664V11.2451ZM14.6025 3.90723C14.7518 4.05052 14.9037 4.20406 15.0547 4.37012C16.3264 5.76904 17.5641 7.96737 17.7305 11.2451H20.4648C20.1609 7.79203 17.7938 4.93269 14.6025 3.90723Z",
      fill: "currentColor"
    })
  };
  var L_e = io({
    defaultClassName: "_1ke4j9q2 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      size: {
        50: "cpipac7",
        100: "cpipac8",
        200: "cpipac9",
        300: "cpipaca",
        400: "cpipacb",
        500: "cpipacc",
        600: "cpipacd",
        Inherit: "cpipac6"
      },
      variant: {
        Primary: "_1ke4j9qb",
        Secondary: "_1ke4j9qc",
        Success: "_1ke4j9qd",
        Warning: "_1ke4j9qe",
        Critical: "_1ke4j9qf"
      }
    },
    defaultVariants: {
      size: "400",
      variant: "Secondary"
    },
    compoundVariants: []
  }), N_e = "_1ke4j9qh", z_e = "_1ke4j9qg _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91";
  const Rd = p.forwardRef(({ className: t, variant: e, size: n, style: r, ...i }, a) => o.jsxs("span", {
    className: gt(L_e({
      variant: e,
      size: n
    }), t),
    style: r,
    children: [
      o.jsx("input", {
        className: z_e,
        type: "checkbox",
        ...i,
        ref: a
      }),
      o.jsx(Q, {
        className: N_e,
        "aria-hidden": true,
        size: n,
        src: q.Check
      })
    ]
  }));
  var U_e = io({
    defaultClassName: "_1bv8u1w6 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      variant: {
        Background: "_1bv8u1w7",
        Surface: "_1bv8u1w8",
        SurfaceVariant: "_1bv8u1w9",
        Primary: "_1bv8u1wa",
        Secondary: "_1bv8u1wb",
        Success: "_1bv8u1wc",
        Warning: "_1bv8u1wd",
        Critical: "_1bv8u1we"
      },
      size: {
        400: "_1bv8u1wf",
        500: "_1bv8u1wg"
      },
      fill: {
        Soft: "_1bv8u1wh",
        None: "_1bv8u1wi"
      },
      outlined: {
        true: "_1bv8u1wj"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      variant: "Surface",
      fill: "Soft",
      size: "400",
      radii: "400"
    },
    compoundVariants: []
  });
  const Qe = ft(({ as: t = "button", className: e, variant: n, fill: r, size: i, outlined: a, radii: s, before: l, after: c, children: d, ...u }, h) => o.jsxs(t, {
    className: gt(U_e({
      variant: n,
      fill: r,
      size: i,
      outlined: a,
      radii: s
    }), e),
    "data-ui-before": l ? true : void 0,
    "data-ui-after": c ? true : void 0,
    ...u,
    ref: h,
    children: [
      l,
      d,
      c
    ]
  }));
  var V_e = io({
    defaultClassName: "_5z5e2h1 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "_5z5e2h2",
        Surface: "_5z5e2h3",
        SurfaceVariant: "_5z5e2h4",
        Primary: "_5z5e2h5",
        Secondary: "_5z5e2h6",
        Success: "_5z5e2h7",
        Warning: "_5z5e2h8",
        Critical: "_5z5e2h9"
      }
    },
    defaultVariants: {
      variant: "Surface"
    },
    compoundVariants: []
  });
  const lr = ft(({ as: t = "div", className: e, variant: n, ...r }, i) => o.jsx(t, {
    className: gt(V_e({
      variant: n
    }), e),
    ...r,
    ref: i
  }));
  var H_e = io({
    defaultClassName: "hru6be0 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "hru6be1",
        Surface: "hru6be2",
        SurfaceVariant: "hru6be3",
        Primary: "hru6be4",
        Secondary: "hru6be5",
        Success: "hru6be6",
        Warning: "hru6be7",
        Critical: "hru6be8"
      },
      size: {
        300: "hru6be9",
        400: "hru6bea",
        500: "hru6beb",
        600: "hru6bec",
        700: "hru6bed"
      }
    },
    defaultVariants: {
      variant: "Surface",
      size: "400"
    },
    compoundVariants: []
  });
  const wn = ft(({ as: t = "header", className: e, variant: n, size: r, ...i }, a) => o.jsx(t, {
    className: gt(H_e({
      variant: n,
      size: r
    }), e),
    ...i,
    ref: a
  }));
  var $_e = io({
    defaultClassName: "brs7ce5 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      size: {
        300: "brs7ce6",
        400: "brs7ce7",
        500: "brs7ce8",
        600: "brs7ce9"
      },
      variant: {
        Background: "brs7cea",
        Surface: "brs7ceb",
        SurfaceVariant: "brs7cec",
        Primary: "brs7ced",
        Secondary: "brs7cee",
        Success: "brs7cef",
        Warning: "brs7ceg",
        Critical: "brs7ceh"
      },
      fill: {
        Soft: "brs7cei",
        None: "brs7cej"
      },
      outlined: {
        true: "brs7cek"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      size: "400",
      variant: "Surface",
      fill: "Soft",
      radii: "400"
    },
    compoundVariants: []
  });
  const Oe = ft(({ as: t = "button", className: e, size: n, variant: r, fill: i, radii: a, outlined: s, ...l }, c) => o.jsx(t, {
    className: gt($_e({
      variant: r,
      fill: i,
      size: n,
      radii: a,
      outlined: s
    }), e),
    ...l,
    ref: c
  }));
  var W_e = io({
    defaultClassName: "_1rrvnjm8 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "_1rrvnjm9",
        Surface: "_1rrvnjma",
        SurfaceVariant: "_1rrvnjmb",
        Primary: "_1rrvnjmc",
        Secondary: "_1rrvnjmd",
        Success: "_1rrvnjme",
        Warning: "_1rrvnjmf",
        Critical: "_1rrvnjmg"
      },
      size: {
        300: "_1rrvnjmh",
        400: "_1rrvnjmi",
        500: "_1rrvnjmj"
      },
      outlined: {
        true: "_1rrvnjmk"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      variant: "Background",
      size: "400",
      radii: "400"
    },
    compoundVariants: []
  }), q_e = "_1rrvnjmr _1mqalmd1 _1mqalmd0 _1bugis91";
  const mn = p.forwardRef(({ className: t, style: e, variant: n, size: r, inputSize: i = 1, outlined: a, radii: s, before: l, after: c, ...d }, u) => o.jsxs("div", {
    className: gt(W_e({
      variant: n,
      size: r,
      outlined: a,
      radii: s
    }), t),
    style: e,
    "data-ui-before": l ? true : void 0,
    "data-ui-after": c ? true : void 0,
    children: [
      l,
      o.jsx("input", {
        className: q_e,
        size: i,
        ...d,
        ref: u
      }),
      c
    ]
  }));
  var K_e = io({
    defaultClassName: "_1yan8dd1 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Inherit: "_1yan8dd2",
        Background: "_1yan8dd3",
        Surface: "_1yan8dd4",
        SurfaceVariant: "_1yan8dd5",
        Primary: "_1yan8dd6",
        Secondary: "_1yan8dd7",
        Success: "_1yan8dd8",
        Warning: "_1yan8dd9",
        Critical: "_1yan8dda"
      },
      direction: {
        Horizontal: "_1yan8ddb",
        Vertical: "_1yan8ddc"
      },
      size: {
        300: "_1yan8ddd",
        400: "_1yan8dde",
        500: "_1yan8ddf",
        600: "_1yan8ddg",
        700: "_1yan8ddh"
      }
    },
    defaultVariants: {
      variant: "Surface",
      direction: "Horizontal",
      size: "400"
    },
    compoundVariants: []
  });
  const nr = ft(({ as: t = "div", className: e, variant: n, direction: r, size: i, ...a }, s) => o.jsx(t, {
    className: gt(K_e({
      variant: n,
      direction: r,
      size: i
    }), e),
    ...a,
    ref: s
  }));
  var G_e = io({
    defaultClassName: "_13tt0gb6 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      variant: {
        Background: "_13tt0gb7",
        Surface: "_13tt0gb8",
        SurfaceVariant: "_13tt0gb9",
        Primary: "_13tt0gba",
        Secondary: "_13tt0gbb",
        Success: "_13tt0gbc",
        Warning: "_13tt0gbd",
        Critical: "_13tt0gbe"
      },
      fill: {
        Soft: "_13tt0gbf",
        None: "_13tt0gbg"
      },
      size: {
        300: "_13tt0gbh",
        400: "_13tt0gbi"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      variant: "Surface",
      fill: "Soft",
      size: "400",
      radii: "0"
    },
    compoundVariants: []
  });
  const Ye = ft(({ as: t = "button", className: e, variant: n, fill: r, size: i, radii: a, before: s, after: l, children: c, ...d }, u) => o.jsxs(t, {
    className: gt(G_e({
      variant: n,
      fill: r,
      size: i,
      radii: a
    }), e),
    "data-ui-before": s ? true : void 0,
    "data-ui-after": l ? true : void 0,
    ...d,
    ref: u,
    children: [
      s,
      c,
      l
    ]
  }));
  var Y_e = io({
    defaultClassName: "_1fptcza0 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "_1fptcza1",
        Surface: "_1fptcza2",
        SurfaceVariant: "_1fptcza3",
        Primary: "_1fptcza4",
        Secondary: "_1fptcza5",
        Success: "_1fptcza6",
        Warning: "_1fptcza7",
        Critical: "_1fptcza8"
      }
    },
    defaultVariants: {
      variant: "Surface"
    },
    compoundVariants: []
  });
  const tn = ft(({ as: t = "div", className: e, variant: n, ...r }, i) => o.jsx(t, {
    className: gt(Y_e({
      variant: n
    }), e),
    ...r,
    ref: i
  }));
  var Z_e = io({
    defaultClassName: "_1fc5sz51 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "_1fc5sz52",
        Surface: "_1fc5sz53",
        SurfaceVariant: "_1fc5sz54",
        Primary: "_1fc5sz55",
        Secondary: "_1fc5sz56",
        Success: "_1fc5sz57",
        Warning: "_1fc5sz58",
        Critical: "_1fc5sz59"
      },
      size: {
        300: "_1fc5sz5a",
        400: "_1fc5sz5b",
        500: "_1fc5sz5c"
      },
      flexHeight: {
        true: "_1fc5sz5d"
      }
    },
    defaultVariants: {
      variant: "Surface",
      size: "400"
    },
    compoundVariants: []
  });
  const Go = ft(({ as: t = "div", className: e, variant: n, size: r, flexHeight: i, ...a }, s) => o.jsx(t, {
    className: gt(Z_e({
      variant: n,
      size: r,
      flexHeight: i
    }), e),
    ...a,
    ref: s
  }));
  var J_e = "_1oc5jl80 _1mqalmd1 _1mqalmd0", X_e = "_1oc5jl82 _1mqalmd1 _1mqalmd0", Q_e = "_1oc5jl83 _1mqalmd1 _1mqalmd0";
  const R7 = ({ container: t, children: e }) => o.jsx(o.Fragment, {
    children: DF.createPortal(e, t ?? document.body)
  }), Xee = p.createContext(void 0), eye = Xee.Provider, tye = () => p.useContext(Xee), Hn = ft(({ as: t = "div", className: e, open: n, container: r, backdrop: i, children: a, ...s }, l) => {
    const c = tye();
    return o.jsx(R7, {
      container: r ?? c,
      children: n ? o.jsxs(t, {
        className: gt(J_e, e),
        ...s,
        ref: l,
        children: [
          i,
          a
        ]
      }) : null
    });
  }), $n = ft(({ as: t = "div", className: e, ...n }, r) => o.jsx(t, {
    className: gt(X_e, e),
    ...n,
    ref: r
  })), Wn = ft(({ as: t = "div", className: e, ...n }, r) => o.jsx(t, {
    className: gt(Q_e, e),
    ...n,
    ref: r
  }));
  var nye = "_1v6ozra0", rye = "_1v6ozra1";
  const Qee = p.createContext(void 0), iye = Qee.Provider, oye = () => p.useContext(Qee), ln = ft(({ as: t = "div", className: e, anchor: n, position: r = "Bottom", align: i = "Center", offset: a = 10, alignOffset: s = 0, content: l, children: c, container: d, ...u }, h) => {
    const f = p.useRef(null), g = oye(), m = p.useCallback(() => {
      const v = f.current;
      if (!v || !n) return;
      const y = Jee(n, v.getBoundingClientRect(), r, i, a, s);
      v.style.top = y.top ?? "unset", v.style.bottom = y.bottom ?? "unset", v.style.left = y.left ?? "unset", v.style.right = y.right ?? "unset";
    }, [
      n,
      r,
      i,
      a,
      s
    ]);
    return p.useEffect(() => (window.addEventListener("resize", m), () => {
      window.removeEventListener("resize", m);
    }), [
      m
    ]), p.useLayoutEffect(() => {
      m();
    }, [
      m
    ]), o.jsxs(o.Fragment, {
      children: [
        c,
        n && o.jsx(R7, {
          container: d ?? g,
          children: o.jsx(t, {
            className: gt(nye, e),
            ...u,
            ref: h,
            children: o.jsx("div", {
              ref: f,
              className: rye,
              children: l
            })
          })
        })
      ]
    });
  });
  var aye = io({
    defaultClassName: "w2djj94 _1mqalmd1 _1mqalmd0 _1bugis91",
    variantClassNames: {
      size: {
        300: "w2djj95",
        400: "w2djj96",
        500: "w2djj97"
      },
      variant: {
        Primary: "w2djj98",
        Secondary: "w2djj99",
        Success: "w2djj9a",
        Warning: "w2djj9b",
        Critical: "w2djj9c"
      },
      fill: {
        Solid: "w2djj9d",
        Soft: "w2djj9e",
        None: "w2djj9f"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      },
      outlined: {
        true: "w2djj9m"
      }
    },
    defaultVariants: {
      variant: "Secondary",
      size: "400",
      fill: "Soft",
      radii: "Pill"
    },
    compoundVariants: []
  }), sye = "w2djj9n _1mqalmd1 _1mqalmd0";
  const O1 = ft(({ as: t = "span", className: e, variant: n, size: r, fill: i, radii: a, outlined: s, value: l, min: c = 0, max: d, ...u }, h) => o.jsx(t, {
    className: gt(aye({
      variant: n,
      size: r,
      fill: i,
      radii: a,
      outlined: s
    }), e),
    role: "progressbar",
    "aria-valuenow": l,
    "aria-valuemin": c,
    "aria-valuemax": d,
    ...u,
    ref: h,
    children: o.jsx("span", {
      className: sye,
      style: {
        width: `${Nb(c, d, l)}%`
      }
    })
  }));
  var lye = io({
    defaultClassName: "_1agxj9w0 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91",
    variantClassNames: {
      variant: {
        Primary: "_1agxj9w1",
        Secondary: "_1agxj9w2",
        Success: "_1agxj9w3",
        Warning: "_1agxj9w4",
        Critical: "_1agxj9w5"
      },
      size: {
        50: "cpipac7",
        100: "cpipac8",
        200: "cpipac9",
        300: "cpipaca",
        400: "cpipacb",
        500: "cpipacc",
        600: "cpipacd",
        Inherit: "cpipac6"
      }
    },
    defaultVariants: {
      variant: "Secondary",
      size: "400"
    },
    compoundVariants: []
  });
  p.forwardRef(({ className: t, variant: e, size: n, ...r }, i) => o.jsx("input", {
    className: gt(lye({
      variant: e,
      size: n
    }), t),
    ...r,
    type: "radio",
    ref: i
  }));
  var cye = io({
    defaultClassName: "_4yxtfd2 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "_4yxtfd3",
        Surface: "_4yxtfd4",
        SurfaceVariant: "_4yxtfd5",
        Primary: "_4yxtfd6",
        Secondary: "_4yxtfd7",
        Success: "_4yxtfd8",
        Warning: "_4yxtfd9",
        Critical: "_4yxtfda"
      },
      visibility: {
        Always: "_4yxtfdb",
        Hover: "_4yxtfdc"
      },
      hideTrack: {
        true: "_4yxtfdd"
      },
      size: {
        0: "_4yxtfde",
        300: "_4yxtfdf",
        400: "_4yxtfdg"
      },
      direction: {
        Horizontal: "_4yxtfdh",
        Vertical: "_4yxtfdi",
        Both: "_4yxtfdj"
      }
    },
    defaultVariants: {
      variant: "Surface",
      visibility: "Always",
      size: "400",
      direction: "Vertical"
    },
    compoundVariants: [
      [
        {
          direction: "Horizontal",
          size: "300"
        },
        "_4yxtfdk"
      ],
      [
        {
          direction: "Horizontal",
          size: "400"
        },
        "_4yxtfdl"
      ],
      [
        {
          direction: "Vertical",
          size: "300"
        },
        "_4yxtfdm"
      ],
      [
        {
          direction: "Vertical",
          size: "400"
        },
        "_4yxtfdn"
      ],
      [
        {
          direction: "Both",
          size: "300"
        },
        "_4yxtfdo"
      ],
      [
        {
          direction: "Both",
          size: "400"
        },
        "_4yxtfdp"
      ]
    ]
  });
  const dn = ft(({ as: t = "div", className: e, variant: n, visibility: r, hideTrack: i, size: a, direction: s, ...l }, c) => {
    const d = p.useRef();
    return p.useLayoutEffect(() => {
      if (d.current) {
        const u = d.current;
        if (a === "0") u.setAttribute("data-x-scrollbar-width", "0"), u.setAttribute("data-y-scrollbar-width", "0");
        else {
          const h = u.offsetHeight - u.clientHeight, f = u.offsetWidth - u.clientWidth;
          u.setAttribute("data-x-scrollbar-width", `${h}`), u.setAttribute("data-y-scrollbar-width", `${f}`);
        }
      }
    }, [
      a
    ]), o.jsx(t, {
      className: gt(cye({
        variant: n,
        visibility: r,
        hideTrack: i,
        size: a,
        direction: s
      }), e),
      ...l,
      ref: (u) => {
        if (u && (d.current = u), c) {
          if ("current" in c) {
            const h = c;
            h.current = u;
          }
          typeof c == "function" && c(u);
        }
      }
    });
  });
  var dye = io({
    defaultClassName: "_31czpk7 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      size: {
        50: "cpipac7",
        100: "cpipac8",
        200: "cpipac9",
        300: "cpipaca",
        400: "cpipacb",
        500: "cpipacc",
        600: "cpipacd",
        Inherit: "cpipac6"
      },
      variant: {
        Primary: "_31czpkg",
        Secondary: "_31czpkh",
        Success: "_31czpki",
        Warning: "_31czpkj",
        Critical: "_31czpkk"
      },
      fill: {
        Solid: "_31czpkl",
        Soft: "_31czpkm"
      }
    },
    defaultVariants: {
      size: "400",
      variant: "Secondary",
      fill: "Soft"
    },
    compoundVariants: []
  }), uye = "_31czpkp", hye = "_31czpko", fye = "_31czpkn _1mqalmd1 _1mqalmd0";
  const mye = () => o.jsxs("svg", {
    className: fye,
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      o.jsx("path", {
        className: hye,
        d: "M5.98986 18.0104C7.52806 19.5486 9.65306 20.5 12.0003 20.5C16.6947 20.5 20.5003 16.6944 20.5003 12C20.5003 7.30558 16.6947 3.5 12.0003 3.5C9.65306 3.5 7.52806 4.45139 5.98986 5.98959L4.9292 4.92893C6.73884 3.11929 9.23884 2 12.0003 2C17.5231 2 22.0003 6.47715 22.0003 12C22.0003 17.5228 17.5231 22 12.0003 22C9.23884 22 6.73884 20.8807 4.9292 19.0711L5.98986 18.0104Z"
      }),
      o.jsx("path", {
        className: uye,
        d: "M4.92908 19.0711C3.1204 17.2624 2.00134 14.7641 2.00015 12.0044L2.00015 11.9956C2.00134 9.23593 3.1204 6.73763 4.92909 4.92896L5.98975 5.98962C4.45155 7.52781 3.50015 9.65281 3.50015 12C3.50015 14.3472 4.45155 16.4722 5.98975 18.0104L4.92908 19.0711Z"
      })
    ]
  }), dt = ft(({ as: t = "span", className: e, size: n, variant: r, fill: i, ...a }, s) => o.jsx(t, {
    className: gt(dye({
      size: n,
      variant: r,
      fill: i
    }), e),
    ...a,
    ref: s,
    children: o.jsx(mye, {})
  }));
  var gye = io({
    defaultClassName: "_1mqalmd1 _1mqalmd0 _1gp7uix2 _1bugis90 _1bugis91",
    variantClassNames: {
      variant: {
        Primary: "_1gp7uix4",
        Secondary: "_1gp7uix5",
        Success: "_1gp7uix6",
        Warning: "_1gp7uix7",
        Critical: "_1gp7uix8"
      }
    },
    defaultVariants: {
      variant: "Primary"
    },
    compoundVariants: []
  }), pye = "_1gp7uix9 _1mqalmd1 _1mqalmd0";
  const Jt = p.forwardRef(({ className: t, variant: e, value: n = false, onChange: r, ...i }, a) => {
    const s = () => r == null ? void 0 : r(!n);
    return o.jsx("button", {
      className: gt(gye({
        variant: e
      }), t),
      role: "switch",
      type: "button",
      "aria-checked": n,
      onClick: s,
      ...i,
      ref: a,
      children: o.jsx("span", {
        className: pye,
        "aria-hidden": true,
        children: o.jsx(Q, {
          src: q.Check,
          size: "100"
        })
      })
    });
  });
  var Fye = io({
    defaultClassName: "_1xny9xl0 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      size: {
        Inherit: "_1xny9xl1",
        D400: "_1xny9xl2",
        H1: "_1xny9xl3",
        H2: "_1xny9xl4",
        H3: "_1xny9xl5",
        H4: "_1xny9xl6",
        H5: "_1xny9xl7",
        H6: "_1xny9xl8",
        T500: "_1xny9xl9",
        T400: "_1xny9xla",
        T300: "_1xny9xlb",
        T200: "_1xny9xlc",
        B500: "_1xny9xld",
        B400: "_1xny9xle",
        B300: "_1xny9xlf",
        L400: "_1xny9xlg",
        O400: "_1xny9xlh",
        C400: "_1xny9xli"
      },
      align: {
        Left: "_1xny9xlj",
        Center: "_1xny9xlk",
        Right: "_1xny9xll",
        Justify: "_1xny9xlm"
      },
      truncate: {
        true: "_1xny9xln"
      },
      priority: {
        300: "_1xny9xlo",
        400: "_1xny9xlp",
        500: "_1xny9xlq",
        Inherit: "_1xny9xlr",
        Initial: "_1xny9xls"
      }
    },
    defaultVariants: {
      size: "T400",
      priority: "Inherit"
    },
    compoundVariants: []
  });
  const D = ft(({ as: t = "p", className: e, size: n, truncate: r, align: i, priority: a, ...s }, l) => o.jsx(t, {
    className: gt(Fye({
      size: n,
      truncate: r,
      align: i,
      priority: a
    }), e),
    ...s,
    ref: l
  }));
  var vye = io({
    defaultClassName: "ay20pp9 _1mqalmd1 _1mqalmd0 _1bugis91",
    variantClassNames: {
      variant: {
        Background: "ay20ppa",
        Surface: "ay20ppb",
        SurfaceVariant: "ay20ppc",
        Primary: "ay20ppd",
        Secondary: "ay20ppe",
        Success: "ay20ppf",
        Warning: "ay20ppg",
        Critical: "ay20pph"
      },
      size: {
        300: "ay20ppi",
        400: "ay20ppj",
        500: "ay20ppk"
      },
      outlined: {
        true: "ay20ppl"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      },
      resize: {
        Vertical: "ay20pps",
        Horizontal: "ay20ppt",
        Both: "ay20ppu",
        None: "ay20ppv",
        Block: "ay20ppw",
        Inline: "ay20ppx"
      }
    },
    defaultVariants: {
      variant: "Background",
      size: "400",
      radii: "400",
      resize: "Vertical"
    },
    compoundVariants: []
  });
  const js = p.forwardRef(({ className: t, variant: e, size: n, outlined: r, radii: i, resize: a, ...s }, l) => o.jsx("textarea", {
    className: gt(vye({
      variant: e,
      size: n,
      outlined: r,
      radii: i,
      resize: a
    }), t),
    ...s,
    ref: l
  }));
  var _ye = io({
    defaultClassName: "_6plmi21 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "_6plmi22",
        Surface: "_6plmi23",
        SurfaceVariant: "_6plmi24",
        Primary: "_6plmi25",
        Secondary: "_6plmi26",
        Success: "_6plmi27",
        Warning: "_6plmi28",
        Critical: "_6plmi29"
      },
      radii: {
        0: "cpipac1",
        300: "cpipac2",
        400: "cpipac3",
        500: "cpipac4",
        Inherit: "cpipac0",
        Pill: "cpipac5"
      }
    },
    defaultVariants: {
      variant: "Surface",
      radii: "400"
    },
    compoundVariants: []
  }), yye = "_6plmi2g";
  let ete, bye, xye, pr, wye, ar, Wl, Dye, A7, VU, tte, _R, bD, Cye, i1, GE, Eye, kye, Sye, Ay, ho, Ij, Vi, nte, yR, Og, ga, jye, Tye, HU, Td;
  ete = p.createContext(void 0);
  bye = ete.Provider;
  xye = () => p.useContext(ete);
  pr = ft(({ as: t = "div", className: e, variant: n, radii: r, ...i }, a) => o.jsx(t, {
    className: gt(_ye({
      variant: n,
      radii: r
    }), e),
    ...i,
    ref: a
  }));
  wye = (t, e, n, r, i) => {
    const a = p.useRef(null), s = p.useRef(null), [l, c] = p.useState(false), d = p.useCallback(() => {
      const f = a.current, g = s.current;
      if (!f || !g) return;
      const m = Jee(f.getBoundingClientRect(), g.getBoundingClientRect(), t, e, n, r);
      g.style.top = m.top ?? "unset", g.style.bottom = m.bottom ?? "unset", g.style.left = m.left ?? "unset", g.style.right = m.right ?? "unset";
    }, [
      t,
      e,
      n,
      r
    ]);
    p.useEffect(() => {
      const f = a.current;
      let g;
      const m = (b, j) => {
        if (clearTimeout(g), j) {
          c(true);
          return;
        }
        g = window.setTimeout(() => {
          c(true), g = void 0;
        }, i);
      }, v = (b, j) => {
        if (clearTimeout(g), j) {
          c(false);
          return;
        }
        g = window.setTimeout(() => {
          c(false), g = void 0;
        }, i < 100 ? i : 100);
      }, y = (b) => {
        const { key: j } = b;
        if (j === "Escape" || j === "Enter" || j === " ") {
          v(void 0, true);
          return;
        }
        m(void 0, true);
      }, w = () => {
        v(void 0, true);
      };
      return f == null ? void 0 : f.addEventListener("mouseenter", m), f == null ? void 0 : f.addEventListener("keyup", y), f == null ? void 0 : f.addEventListener("mouseleave", v), f == null ? void 0 : f.addEventListener("blur", w), f == null ? void 0 : f.addEventListener("click", v), () => {
        clearTimeout(g), f == null ? void 0 : f.removeEventListener("mouseenter", m), f == null ? void 0 : f.removeEventListener("keyup", y), f == null ? void 0 : f.removeEventListener("mouseleave", v), f == null ? void 0 : f.removeEventListener("blur", w), f == null ? void 0 : f.removeEventListener("click", v);
      };
    }, [
      t,
      e,
      n,
      r,
      i
    ]), p.useLayoutEffect(() => {
      l && d();
    }, [
      l,
      d
    ]);
    const u = p.useCallback((f) => {
      a.current = f;
    }, []), h = p.useCallback((f) => {
      s.current = f;
    }, []);
    return {
      triggerRef: u,
      baseRef: h,
      open: l
    };
  };
  ar = ft(({ as: t = "div", className: e, position: n = "Top", align: r = "Center", offset: i = 10, alignOffset: a = 0, delay: s = 200, tooltip: l, children: c, container: d, ...u }, h) => {
    const f = xye(), { open: g, triggerRef: m, baseRef: v } = wye(n, r, i, a, s);
    return o.jsxs(o.Fragment, {
      children: [
        c(m),
        g && o.jsx(R7, {
          container: d ?? f,
          children: o.jsx(t, {
            role: "tooltip",
            className: gt(yye, e),
            ...u,
            ref: (y) => {
              v(y), h && (typeof h == "function" ? h(y) : h.current = y);
            },
            children: l
          })
        })
      ]
    });
  });
  Wl = (t) => {
    const e = [
      "Bytes",
      "KB",
      "MB",
      "GB",
      "TB"
    ];
    if (t === 0) return "0KB";
    let n = Math.floor(Math.log(t) / Math.log(1e3));
    return n === 0 && (n = 1), `${(t / 1e3 ** n).toFixed(1)} ${e[n]}`;
  };
  Dye = (t) => {
    const e = Math.floor(t / 1e3), n = Math.floor(e / 60), r = Math.round(e % 60);
    return `${n}:${r < 10 ? "0" : ""}${r}`;
  };
  A7 = (t) => {
    const e = Math.floor(t / 1e3);
    return Math.floor(e / 60).toString();
  };
  VU = (t) => {
    const e = Math.floor(t / 60), n = Math.round(t % 60);
    return `${e}:${n < 10 ? "0" : ""}${n}`;
  };
  tte = (t, e) => {
    const n = e.toLowerCase();
    return n.startsWith("audio") ? t.Play : n.startsWith("video") ? t.Vlc : n.startsWith("image") ? t.Photo : t.File;
  };
  _R = (t) => t.reduce((e, n) => (n.status === "fulfilled" && e.push(n.value), e), []);
  bD = (t) => {
    if (t.status === "fulfilled") return t.value;
  };
  Cye = (t) => {
    if (t.status === "rejected") return t.reason;
  };
  i1 = (t, e) => Math.floor(Math.random() * (e - t + 1)) + t;
  GE = (t, e, n) => e / t * n;
  Eye = (t) => {
    if (!t) return;
    const [, e] = t.split(":");
    if (!e) return;
    const [n] = e.split(";");
    if (!n) return;
    const [r, i] = n.split(",");
    if (!(!r || !i)) return {
      latitude: r,
      longitude: i
    };
  };
  kye = /^\/+/g;
  Sye = /\/+$/g;
  Ay = (t) => t.replace(kye, "");
  ho = (t) => t.replace(Sye, "");
  Ij = (t) => Ay(ho(t));
  Vi = (t, e = 1) => t && Array.from(t).slice(0, e).join("") || "";
  nte = (t = 12) => {
    let e = "";
    for (let i = 0; i < t; i += 1) {
      const a = Math.floor(Math.random() * 26 + 65);
      e += String.fromCharCode(a);
    }
    return e;
  };
  yR = (t, e) => {
    let n = 1, r = t;
    do
      r = t + n, n += 1;
    while (e(r));
    return r;
  };
  Og = (t) => t.replace(/ /g, "-");
  ga = (t) => {
    const e = t.trim();
    return e === "" ? [] : e.split(" ");
  };
  jye = "modulepreload";
  Tye = function(t) {
    return "/sable/" + t;
  };
  HU = {};
  L1 = function(e, n, r) {
    let i = Promise.resolve();
    if (n && n.length > 0) {
      let c = function(d) {
        return Promise.all(d.map((u) => Promise.resolve(u).then((h) => ({
          status: "fulfilled",
          value: h
        }), (h) => ({
          status: "rejected",
          reason: h
        }))));
      };
      document.getElementsByTagName("link");
      const s = document.querySelector("meta[property=csp-nonce]"), l = (s == null ? void 0 : s.nonce) || (s == null ? void 0 : s.getAttribute("nonce"));
      i = c(n.map((d) => {
        if (d = Tye(d), d in HU) return;
        HU[d] = true;
        const u = d.endsWith(".css"), h = u ? '[rel="stylesheet"]' : "";
        if (document.querySelector(`link[href="${d}"]${h}`)) return;
        const f = document.createElement("link");
        if (f.rel = u ? "stylesheet" : jye, u || (f.as = "script"), f.crossOrigin = "", f.href = d, l && f.setAttribute("nonce", l), document.head.appendChild(f), u) return new Promise((g, m) => {
          f.addEventListener("load", g), f.addEventListener("error", () => m(new Error(`Unable to preload CSS for ${d}`)));
        });
      }));
    }
    function a(s) {
      const l = new Event("vite:preloadError", {
        cancelable: true
      });
      if (l.payload = s, window.dispatchEvent(l), !l.defaultPrevented) throw s;
    }
    return i.then((s) => {
      for (const l of s || []) l.status === "rejected" && a(l.reason);
      return e().catch(a);
    });
  };
  Td = {
    BASE_URL: "/sable",
    DEV: false,
    MODE: "production",
    PROD: true,
    SSR: false,
    VITE_BUILD_HASH: "",
    VITE_IS_RELEASE_TAG: "false"
  };
  function rte(t) {
    return "init" in t;
  }
  function bR(t) {
    return !!t.write;
  }
  function $U(t) {
    return "v" in t || "e" in t;
  }
  function IC(t) {
    if ("e" in t) throw t.e;
    if ((Td ? "production" : void 0) !== "production" && !("v" in t)) throw new Error("[Bug] atom state is not initialized");
    return t.v;
  }
  function BC(t) {
    return typeof (t == null ? void 0 : t.then) == "function";
  }
  function ite(t, e, n) {
    if (!n.p.has(t)) {
      n.p.add(t);
      const r = () => n.p.delete(t);
      e.then(r, r);
    }
  }
  function ote(t, e, n) {
    var r;
    const i = /* @__PURE__ */ new Set();
    for (const a of ((r = n.get(t)) == null ? void 0 : r.t) || []) i.add(a);
    for (const a of e.p) i.add(a);
    return i;
  }
  const Rye = (t, e, ...n) => e.read(...n), Aye = (t, e, ...n) => e.write(...n), Iye = (t, e) => {
    var n;
    return (n = e.INTERNAL_onInit) == null ? void 0 : n.call(e, t);
  }, Bye = (t, e, n) => {
    var r;
    return (r = e.onMount) == null ? void 0 : r.call(e, n);
  }, Pye = (t, e) => {
    var n;
    const r = Yo(t), i = r[0], a = r[6], s = r[9];
    if ((Td ? "production" : void 0) !== "production" && !e) throw new Error("Atom is undefined or null");
    let l = i.get(e);
    return l || (l = {
      d: /* @__PURE__ */ new Map(),
      p: /* @__PURE__ */ new Set(),
      n: 0
    }, i.set(e, l), (n = a.i) == null || n.call(a, e), s == null ? void 0 : s(t, e)), l;
  }, Mye = (t) => {
    const e = Yo(t), n = e[1], r = e[3], i = e[4], a = e[5], s = e[6], l = e[13], c = [], d = (u) => {
      try {
        u();
      } catch (h) {
        c.push(h);
      }
    };
    do {
      s.f && d(s.f);
      const u = /* @__PURE__ */ new Set(), h = u.add.bind(u);
      r.forEach((f) => {
        var g;
        return (g = n.get(f)) == null ? void 0 : g.l.forEach(h);
      }), r.clear(), a.forEach(h), a.clear(), i.forEach(h), i.clear(), u.forEach(d), r.size && l(t);
    } while (r.size || a.size || i.size);
    if (c.length) throw new AggregateError(c);
  }, Oye = (t) => {
    const e = Yo(t), n = e[1], r = e[2], i = e[3], a = e[11], s = e[14], l = e[17], c = [], d = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakSet(), h = Array.from(i);
    for (; h.length; ) {
      const f = h[h.length - 1], g = a(t, f);
      if (u.has(f)) {
        h.pop();
        continue;
      }
      if (d.has(f)) {
        if (r.get(f) === g.n) c.push([
          f,
          g
        ]);
        else if ((Td ? "production" : void 0) !== "production" && r.has(f)) throw new Error("[Bug] invalidated atom exists");
        u.add(f), h.pop();
        continue;
      }
      d.add(f);
      for (const m of ote(f, g, n)) d.has(m) || h.push(m);
    }
    for (let f = c.length - 1; f >= 0; --f) {
      const [g, m] = c[f];
      let v = false;
      for (const y of m.d.keys()) if (y !== g && i.has(y)) {
        v = true;
        break;
      }
      v && (r.set(g, m.n), s(t, g), l(t, g)), r.delete(g);
    }
  }, xR = /* @__PURE__ */ new WeakSet(), Lye = (t, e) => {
    var n, r;
    const i = Yo(t), a = i[1], s = i[2], l = i[3], c = i[6], d = i[7], u = i[11], h = i[12], f = i[13], g = i[14], m = i[16], v = i[17], y = i[20], w = i[26], b = u(t, e);
    if ($U(b)) {
      if (a.has(e) && s.get(e) !== b.n) return b;
      let M = false;
      for (const [I, N] of b.d) if (g(t, I).n !== N) {
        M = true;
        break;
      }
      if (!M) return b;
    }
    let j = true;
    const k = new Set(b.d.keys()), C = /* @__PURE__ */ new Map(), x = () => {
      for (const M of k) C.has(M) || b.d.delete(M);
    }, S = () => {
      if (a.has(e)) {
        const M = !l.size;
        v(t, e), M && (f(t), h(t));
      }
    }, T = (M) => {
      var I;
      if (M === e) {
        const L = u(t, M);
        if (!$U(L)) if (rte(M)) y(t, M, M.init);
        else throw new Error("no atom init");
        return IC(L);
      }
      const N = g(t, M);
      try {
        return IC(N);
      } finally {
        C.set(M, N.n), b.d.set(M, N.n), BC(b.v) && ite(e, b.v, N), a.has(e) && ((I = a.get(M)) == null || I.t.add(e)), j || S();
      }
    };
    let A, B;
    const U = {
      get signal() {
        return A || (A = new AbortController()), A.signal;
      },
      get setSelf() {
        return (Td ? "production" : void 0) !== "production" && console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."), (Td ? "production" : void 0) !== "production" && !bR(e) && console.warn("setSelf function cannot be used with read-only atom"), !B && bR(e) && (B = (...M) => {
          if ((Td ? "production" : void 0) !== "production" && j && console.warn("setSelf function cannot be called in sync"), !j) try {
            return m(t, e, ...M);
          } finally {
            f(t), h(t);
          }
        }), B;
      }
    }, z = b.n, O = s.get(e) === z;
    try {
      (Td ? "production" : void 0) !== "production" && xR.delete(t);
      const M = d(t, e, T, U);
      if ((Td ? "production" : void 0) !== "production" && xR.has(t) && console.warn("Detected store mutation during atom read. This is not supported."), y(t, e, M), BC(M)) {
        w(t, M, () => A == null ? void 0 : A.abort());
        const I = () => {
          x(), S();
        };
        M.then(I, I);
      } else x();
      return (n = c.r) == null || n.call(c, e), b;
    } catch (M) {
      return delete b.v, b.e = M, ++b.n, b;
    } finally {
      j = false, b.n !== z && O && (s.set(e, b.n), l.add(e), (r = c.c) == null || r.call(c, e));
    }
  }, Nye = (t, e) => {
    const n = Yo(t), r = n[1], i = n[2], a = n[11], s = [
      e
    ];
    for (; s.length; ) {
      const l = s.pop(), c = a(t, l);
      for (const d of ote(l, c, r)) {
        const u = a(t, d);
        i.get(d) !== u.n && (i.set(d, u.n), s.push(d));
      }
    }
  }, zye = (t, e, ...n) => {
    const r = Yo(t), i = r[3], a = r[6], s = r[8], l = r[11], c = r[12], d = r[13], u = r[14], h = r[15], f = r[16], g = r[17], m = r[20];
    let v = true;
    const y = (b) => IC(u(t, b)), w = (b, ...j) => {
      var k;
      const C = l(t, b);
      try {
        if (b === e) {
          if (!rte(b)) throw new Error("atom not writable");
          (Td ? "production" : void 0) !== "production" && xR.add(t);
          const x = C.n, S = j[0];
          m(t, b, S), g(t, b), x !== C.n && (i.add(b), h(t, b), (k = a.c) == null || k.call(a, b));
          return;
        } else return f(t, b, ...j);
      } finally {
        v || (d(t), c(t));
      }
    };
    try {
      return s(t, e, y, w, ...n);
    } finally {
      v = false;
    }
  }, Uye = (t, e) => {
    var n;
    const r = Yo(t), i = r[1], a = r[3], s = r[6], l = r[11], c = r[15], d = r[18], u = r[19], h = l(t, e), f = i.get(e);
    if (f) {
      for (const [g, m] of h.d) if (!f.d.has(g)) {
        const v = l(t, g);
        d(t, g).t.add(e), f.d.add(g), m !== v.n && (a.add(g), c(t, g), (n = s.c) == null || n.call(s, g));
      }
      for (const g of f.d) if (!h.d.has(g)) {
        f.d.delete(g);
        const m = u(t, g);
        m == null ? void 0 : m.t.delete(e);
      }
    }
  }, Vye = (t, e) => {
    var n;
    const r = Yo(t), i = r[1], a = r[4], s = r[6], l = r[10], c = r[11], d = r[12], u = r[13], h = r[14], f = r[16], g = r[18], m = c(t, e);
    let v = i.get(e);
    if (!v) {
      h(t, e);
      for (const y of m.d.keys()) g(t, y).t.add(e);
      if (v = {
        l: /* @__PURE__ */ new Set(),
        d: new Set(m.d.keys()),
        t: /* @__PURE__ */ new Set()
      }, i.set(e, v), bR(e)) {
        const y = () => {
          let w = true;
          const b = (...j) => {
            try {
              return f(t, e, ...j);
            } finally {
              w || (u(t), d(t));
            }
          };
          try {
            const j = l(t, e, b);
            j && (v.u = () => {
              w = true;
              try {
                j();
              } finally {
                w = false;
              }
            });
          } finally {
            w = false;
          }
        };
        a.add(y);
      }
      (n = s.m) == null || n.call(s, e);
    }
    return v;
  }, Hye = (t, e) => {
    var n, r;
    const i = Yo(t), a = i[1], s = i[5], l = i[6], c = i[11], d = i[19], u = c(t, e);
    let h = a.get(e);
    if (!h || h.l.size) return h;
    let f = false;
    for (const g of h.t) if ((n = a.get(g)) != null && n.d.has(e)) {
      f = true;
      break;
    }
    if (!f) {
      h.u && s.add(h.u), h = void 0, a.delete(e);
      for (const g of u.d.keys()) {
        const m = d(t, g);
        m == null ? void 0 : m.t.delete(e);
      }
      (r = l.u) == null || r.call(l, e);
      return;
    }
    return h;
  }, $ye = (t, e, n) => {
    const r = Yo(t), i = r[11], a = r[27], s = i(t, e), l = "v" in s, c = s.v;
    if (BC(n)) for (const d of s.d.keys()) ite(e, n, i(t, d));
    s.v = n, delete s.e, (!l || !Object.is(c, s.v)) && (++s.n, BC(c) && a(t, c));
  }, Wye = (t, e) => {
    const n = Yo(t)[14];
    return IC(n(t, e));
  }, qye = (t, e, ...n) => {
    const r = Yo(t), i = r[3], a = r[12], s = r[13], l = r[16], c = i.size;
    try {
      return l(t, e, ...n);
    } finally {
      i.size !== c && (s(t), a(t));
    }
  }, Kye = (t, e, n) => {
    const r = Yo(t), i = r[12], a = r[18], s = r[19], c = a(t, e).l;
    return c.add(n), i(t), () => {
      c.delete(n), s(t, e), i(t);
    };
  }, Gye = (t, e, n) => {
    const i = Yo(t)[25];
    let a = i.get(e);
    if (!a) {
      a = /* @__PURE__ */ new Set(), i.set(e, a);
      const s = () => i.delete(e);
      e.then(s, s);
    }
    a.add(n);
  }, Yye = (t, e) => {
    const i = Yo(t)[25].get(e);
    i == null ? void 0 : i.forEach((a) => a());
  }, ate = /* @__PURE__ */ new WeakMap(), Yo = (t) => {
    const e = ate.get(t);
    if ((Td ? "production" : void 0) !== "production" && !e) throw new Error("Store must be created by buildStore to read its building blocks");
    return e;
  };
  function Zye(t) {
    const e = Yo(t), n = e[24];
    return n ? n(e) : e;
  }
  function Jye(...t) {
    const e = {
      get(r) {
        const i = Yo(e)[21];
        return i(e, r);
      },
      set(r, ...i) {
        const a = Yo(e)[22];
        return a(e, r, ...i);
      },
      sub(r, i) {
        const a = Yo(e)[23];
        return a(e, r, i);
      }
    }, n = [
      /* @__PURE__ */ new WeakMap(),
      /* @__PURE__ */ new WeakMap(),
      /* @__PURE__ */ new WeakMap(),
      /* @__PURE__ */ new Set(),
      /* @__PURE__ */ new Set(),
      /* @__PURE__ */ new Set(),
      {},
      Rye,
      Aye,
      Iye,
      Bye,
      Pye,
      Mye,
      Oye,
      Lye,
      Nye,
      zye,
      Uye,
      Vye,
      Hye,
      $ye,
      Wye,
      qye,
      Kye,
      void 0,
      /* @__PURE__ */ new WeakMap(),
      Gye,
      Yye
    ].map((r, i) => t[i] || r);
    return ate.set(e, Object.freeze(n)), e;
  }
  const ste = {};
  let Xye = 0;
  function vn(t, e) {
    const n = `atom${++Xye}`, r = {
      toString() {
        return (ste ? "production" : void 0) !== "production" && this.debugLabel ? n + ":" + this.debugLabel : n;
      }
    };
    return typeof t == "function" ? r.read = t : (r.init = t, r.read = Qye, r.write = e2e), e && (r.write = e), r;
  }
  function Qye(t) {
    return t(this);
  }
  function e2e(t, e, n) {
    return e(this, typeof n == "function" ? n(t(this)) : n);
  }
  function I7() {
    return Jye();
  }
  let Qv;
  function t2e() {
    return Qv || (Qv = I7(), (ste ? "production" : void 0) !== "production" && (globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = Qv), globalThis.__JOTAI_DEFAULT_STORE__ !== Qv && console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))), Qv;
  }
  const n2e = {}, wR = p.createContext(void 0);
  function SF(t) {
    return p.useContext(wR) || t2e();
  }
  function r2e({ children: t, store: e }) {
    const n = p.useRef(null);
    return e ? p.createElement(wR.Provider, {
      value: e
    }, t) : (n.current === null && (n.current = I7()), p.createElement(wR.Provider, {
      value: n.current
    }, t));
  }
  const DR = (t) => typeof (t == null ? void 0 : t.then) == "function", CR = (t) => {
    t.status || (t.status = "pending", t.then((e) => {
      t.status = "fulfilled", t.value = e;
    }, (e) => {
      t.status = "rejected", t.reason = e;
    }));
  }, i2e = yn.use || ((t) => {
    if (t.status === "pending") throw t;
    if (t.status === "fulfilled") return t.value;
    throw t.status === "rejected" ? t.reason : (CR(t), t);
  }), Bj = /* @__PURE__ */ new WeakMap(), WU = (t, e, n) => {
    const i = Zye(t)[26];
    let a = Bj.get(e);
    return a || (a = new Promise((s, l) => {
      let c = e;
      const d = (f) => (g) => {
        c === f && s(g);
      }, u = (f) => (g) => {
        c === f && l(g);
      }, h = () => {
        try {
          const f = n();
          DR(f) ? (Bj.set(f, a), c = f, f.then(d(f), u(f)), i(t, f, h)) : s(f);
        } catch (f) {
          l(f);
        }
      };
      e.then(d(e), u(e)), i(t, e, h);
    }), Bj.set(e, a)), a;
  };
  function Ze(t, e) {
    const { delay: n, unstable_promiseStatus: r = !yn.use } = {}, i = SF(), [[a, s, l], c] = p.useReducer((u) => {
      const h = i.get(t);
      return Object.is(u[0], h) && u[1] === i && u[2] === t ? u : [
        h,
        i,
        t
      ];
    }, void 0, () => [
      i.get(t),
      i,
      t
    ]);
    let d = a;
    if ((s !== i || l !== t) && (c(), d = i.get(t)), p.useEffect(() => {
      const u = i.sub(t, () => {
        if (r) try {
          const h = i.get(t);
          DR(h) && CR(WU(i, h, () => i.get(t)));
        } catch {
        }
        if (typeof n == "number") {
          setTimeout(c, n);
          return;
        }
        c();
      });
      return c(), u;
    }, [
      i,
      t,
      n,
      r
    ]), p.useDebugValue(d), DR(d)) {
      const u = WU(i, d, () => i.get(t));
      return r && CR(u), i2e(u);
    }
    return d;
  }
  function Fn(t, e) {
    const n = SF();
    return p.useCallback((...i) => {
      if ((n2e ? "production" : void 0) !== "production" && !("write" in t)) throw new Error("not writable atom");
      return n.set(t, ...i);
    }, [
      n,
      t
    ]);
  }
  function Fr(t, e) {
    return [
      Ze(t),
      Fn(t)
    ];
  }
  var zb = class {
    constructor() {
      this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
    }
    subscribe(t) {
      return this.listeners.add(t), this.onSubscribe(), () => {
        this.listeners.delete(t), this.onUnsubscribe();
      };
    }
    hasListeners() {
      return this.listeners.size > 0;
    }
    onSubscribe() {
    }
    onUnsubscribe() {
    }
  }, o2e = {
    setTimeout: (t, e) => setTimeout(t, e),
    clearTimeout: (t) => clearTimeout(t),
    setInterval: (t, e) => setInterval(t, e),
    clearInterval: (t) => clearInterval(t)
  }, a2e = (_a2 = class {
    constructor() {
      __privateAdd(this, _e2, o2e);
      __privateAdd(this, _t2, false);
    }
    setTimeoutProvider(t) {
      __privateSet(this, _e2, t);
    }
    setTimeout(t, e) {
      return __privateGet(this, _e2).setTimeout(t, e);
    }
    clearTimeout(t) {
      __privateGet(this, _e2).clearTimeout(t);
    }
    setInterval(t, e) {
      return __privateGet(this, _e2).setInterval(t, e);
    }
    clearInterval(t) {
      __privateGet(this, _e2).clearInterval(t);
    }
  }, _e2 = new WeakMap(), _t2 = new WeakMap(), _a2), cg = new a2e();
  function s2e(t) {
    setTimeout(t, 0);
  }
  var Lg = typeof window > "u" || "Deno" in globalThis;
  function ks() {
  }
  function l2e(t, e) {
    return typeof t == "function" ? t(e) : t;
  }
  function ER(t) {
    return typeof t == "number" && t >= 0 && t !== 1 / 0;
  }
  function lte(t, e) {
    return Math.max(t + (e || 0) - Date.now(), 0);
  }
  function Ef(t, e) {
    return typeof t == "function" ? t(e) : t;
  }
  function Al(t, e) {
    return typeof t == "function" ? t(e) : t;
  }
  function qU(t, e) {
    const { type: n = "all", exact: r, fetchStatus: i, predicate: a, queryKey: s, stale: l } = t;
    if (s) {
      if (r) {
        if (e.queryHash !== B7(s, e.options)) return false;
      } else if (!C2(e.queryKey, s)) return false;
    }
    if (n !== "all") {
      const c = e.isActive();
      if (n === "active" && !c || n === "inactive" && c) return false;
    }
    return !(typeof l == "boolean" && e.isStale() !== l || i && i !== e.state.fetchStatus || a && !a(e));
  }
  function KU(t, e) {
    const { exact: n, status: r, predicate: i, mutationKey: a } = t;
    if (a) {
      if (!e.options.mutationKey) return false;
      if (n) {
        if (D2(e.options.mutationKey) !== D2(a)) return false;
      } else if (!C2(e.options.mutationKey, a)) return false;
    }
    return !(r && e.state.status !== r || i && !i(e));
  }
  function B7(t, e) {
    return ((e == null ? void 0 : e.queryKeyHashFn) || D2)(t);
  }
  function D2(t) {
    return JSON.stringify(t, (e, n) => SR(n) ? Object.keys(n).sort().reduce((r, i) => (r[i] = n[i], r), {}) : n);
  }
  function C2(t, e) {
    return t === e ? true : typeof t != typeof e ? false : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((n) => C2(t[n], e[n])) : false;
  }
  var c2e = Object.prototype.hasOwnProperty;
  function cte(t, e, n = 0) {
    if (t === e) return t;
    if (n > 500) return e;
    const r = GU(t) && GU(e);
    if (!r && !(SR(t) && SR(e))) return e;
    const a = (r ? t : Object.keys(t)).length, s = r ? e : Object.keys(e), l = s.length, c = r ? new Array(l) : {};
    let d = 0;
    for (let u = 0; u < l; u++) {
      const h = r ? u : s[u], f = t[h], g = e[h];
      if (f === g) {
        c[h] = f, (r ? u < a : c2e.call(t, h)) && d++;
        continue;
      }
      if (f === null || g === null || typeof f != "object" || typeof g != "object") {
        c[h] = g;
        continue;
      }
      const m = cte(f, g, n + 1);
      c[h] = m, m === f && d++;
    }
    return a === l && d === a ? t : c;
  }
  function kR(t, e) {
    if (!e || Object.keys(t).length !== Object.keys(e).length) return false;
    for (const n in t) if (t[n] !== e[n]) return false;
    return true;
  }
  function GU(t) {
    return Array.isArray(t) && t.length === Object.keys(t).length;
  }
  function SR(t) {
    if (!YU(t)) return false;
    const e = t.constructor;
    if (e === void 0) return true;
    const n = e.prototype;
    return !(!YU(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
  }
  function YU(t) {
    return Object.prototype.toString.call(t) === "[object Object]";
  }
  function d2e(t) {
    return new Promise((e) => {
      cg.setTimeout(e, t);
    });
  }
  function jR(t, e, n) {
    return typeof n.structuralSharing == "function" ? n.structuralSharing(t, e) : n.structuralSharing !== false ? cte(t, e) : e;
  }
  function u2e(t, e, n = 0) {
    const r = [
      ...t,
      e
    ];
    return n && r.length > n ? r.slice(1) : r;
  }
  function h2e(t, e, n = 0) {
    const r = [
      e,
      ...t
    ];
    return n && r.length > n ? r.slice(0, -1) : r;
  }
  var P7 = /* @__PURE__ */ Symbol();
  function dte(t, e) {
    return !t.queryFn && (e == null ? void 0 : e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === P7 ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
  }
  function ute(t, e) {
    return typeof t == "function" ? t(...e) : !!t;
  }
  function f2e(t, e, n) {
    let r = false, i;
    return Object.defineProperty(t, "signal", {
      enumerable: true,
      get: () => (i ?? (i = e()), r || (r = true, i.aborted ? n() : i.addEventListener("abort", n, {
        once: true
      })), i)
    }), t;
  }
  var m2e = (_b2 = class extends zb {
    constructor() {
      super();
      __privateAdd(this, _e3);
      __privateAdd(this, _t3);
      __privateAdd(this, _n2);
      __privateSet(this, _n2, (t) => {
        if (!Lg && window.addEventListener) {
          const e = () => t();
          return window.addEventListener("visibilitychange", e, false), () => {
            window.removeEventListener("visibilitychange", e);
          };
        }
      });
    }
    onSubscribe() {
      __privateGet(this, _t3) || this.setEventListener(__privateGet(this, _n2));
    }
    onUnsubscribe() {
      var _a6;
      this.hasListeners() || ((_a6 = __privateGet(this, _t3)) == null ? void 0 : _a6.call(this), __privateSet(this, _t3, void 0));
    }
    setEventListener(t) {
      var _a6;
      __privateSet(this, _n2, t), (_a6 = __privateGet(this, _t3)) == null ? void 0 : _a6.call(this), __privateSet(this, _t3, t((e) => {
        typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
      }));
    }
    setFocused(t) {
      __privateGet(this, _e3) !== t && (__privateSet(this, _e3, t), this.onFocus());
    }
    onFocus() {
      const t = this.isFocused();
      this.listeners.forEach((e) => {
        e(t);
      });
    }
    isFocused() {
      var _a6;
      return typeof __privateGet(this, _e3) == "boolean" ? __privateGet(this, _e3) : ((_a6 = globalThis.document) == null ? void 0 : _a6.visibilityState) !== "hidden";
    }
  }, _e3 = new WeakMap(), _t3 = new WeakMap(), _n2 = new WeakMap(), _b2), M7 = new m2e();
  function TR() {
    let t, e;
    const n = new Promise((i, a) => {
      t = i, e = a;
    });
    n.status = "pending", n.catch(() => {
    });
    function r(i) {
      Object.assign(n, i), delete n.resolve, delete n.reject;
    }
    return n.resolve = (i) => {
      r({
        status: "fulfilled",
        value: i
      }), t(i);
    }, n.reject = (i) => {
      r({
        status: "rejected",
        reason: i
      }), e(i);
    }, n;
  }
  var g2e = s2e;
  function p2e() {
    let t = [], e = 0, n = (l) => {
      l();
    }, r = (l) => {
      l();
    }, i = g2e;
    const a = (l) => {
      e ? t.push(l) : i(() => {
        n(l);
      });
    }, s = () => {
      const l = t;
      t = [], l.length && i(() => {
        r(() => {
          l.forEach((c) => {
            n(c);
          });
        });
      });
    };
    return {
      batch: (l) => {
        let c;
        e++;
        try {
          c = l();
        } finally {
          e--, e || s();
        }
        return c;
      },
      batchCalls: (l) => (...c) => {
        a(() => {
          l(...c);
        });
      },
      schedule: a,
      setNotifyFunction: (l) => {
        n = l;
      },
      setBatchNotifyFunction: (l) => {
        r = l;
      },
      setScheduler: (l) => {
        i = l;
      }
    };
  }
  var ya = p2e(), F2e = (_c = class extends zb {
    constructor() {
      super();
      __privateAdd(this, _e4, true);
      __privateAdd(this, _t4);
      __privateAdd(this, _n3);
      __privateSet(this, _n3, (t) => {
        if (!Lg && window.addEventListener) {
          const e = () => t(true), n = () => t(false);
          return window.addEventListener("online", e, false), window.addEventListener("offline", n, false), () => {
            window.removeEventListener("online", e), window.removeEventListener("offline", n);
          };
        }
      });
    }
    onSubscribe() {
      __privateGet(this, _t4) || this.setEventListener(__privateGet(this, _n3));
    }
    onUnsubscribe() {
      var _a6;
      this.hasListeners() || ((_a6 = __privateGet(this, _t4)) == null ? void 0 : _a6.call(this), __privateSet(this, _t4, void 0));
    }
    setEventListener(t) {
      var _a6;
      __privateSet(this, _n3, t), (_a6 = __privateGet(this, _t4)) == null ? void 0 : _a6.call(this), __privateSet(this, _t4, t(this.setOnline.bind(this)));
    }
    setOnline(t) {
      __privateGet(this, _e4) !== t && (__privateSet(this, _e4, t), this.listeners.forEach((n) => {
        n(t);
      }));
    }
    isOnline() {
      return __privateGet(this, _e4);
    }
  }, _e4 = new WeakMap(), _t4 = new WeakMap(), _n3 = new WeakMap(), _c), PC = new F2e();
  function v2e(t) {
    return Math.min(1e3 * 2 ** t, 3e4);
  }
  function hte(t) {
    return (t ?? "online") === "online" ? PC.isOnline() : true;
  }
  var RR = class extends Error {
    constructor(t) {
      super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
    }
  };
  function fte(t) {
    let e = false, n = 0, r;
    const i = TR(), a = () => i.status !== "pending", s = (v) => {
      var _a6;
      if (!a()) {
        const y = new RR(v);
        f(y), (_a6 = t.onCancel) == null ? void 0 : _a6.call(t, y);
      }
    }, l = () => {
      e = true;
    }, c = () => {
      e = false;
    }, d = () => M7.isFocused() && (t.networkMode === "always" || PC.isOnline()) && t.canRun(), u = () => hte(t.networkMode) && t.canRun(), h = (v) => {
      a() || (r == null ? void 0 : r(), i.resolve(v));
    }, f = (v) => {
      a() || (r == null ? void 0 : r(), i.reject(v));
    }, g = () => new Promise((v) => {
      var _a6;
      r = (y) => {
        (a() || d()) && v(y);
      }, (_a6 = t.onPause) == null ? void 0 : _a6.call(t);
    }).then(() => {
      var _a6;
      r = void 0, a() || ((_a6 = t.onContinue) == null ? void 0 : _a6.call(t));
    }), m = () => {
      if (a()) return;
      let v;
      const y = n === 0 ? t.initialPromise : void 0;
      try {
        v = y ?? t.fn();
      } catch (w) {
        v = Promise.reject(w);
      }
      Promise.resolve(v).then(h).catch((w) => {
        var _a6;
        if (a()) return;
        const b = t.retry ?? (Lg ? 0 : 3), j = t.retryDelay ?? v2e, k = typeof j == "function" ? j(n, w) : j, C = b === true || typeof b == "number" && n < b || typeof b == "function" && b(n, w);
        if (e || !C) {
          f(w);
          return;
        }
        n++, (_a6 = t.onFail) == null ? void 0 : _a6.call(t, n, w), d2e(k).then(() => d() ? void 0 : g()).then(() => {
          e ? f(w) : m();
        });
      });
    };
    return {
      promise: i,
      status: () => i.status,
      cancel: s,
      continue: () => (r == null ? void 0 : r(), i),
      cancelRetry: l,
      continueRetry: c,
      canStart: u,
      start: () => (u() ? m() : g().then(m), i)
    };
  }
  var mte = (_d2 = class {
    constructor() {
      __privateAdd(this, _e5);
    }
    destroy() {
      this.clearGcTimeout();
    }
    scheduleGc() {
      this.clearGcTimeout(), ER(this.gcTime) && __privateSet(this, _e5, cg.setTimeout(() => {
        this.optionalRemove();
      }, this.gcTime));
    }
    updateGcTime(t) {
      this.gcTime = Math.max(this.gcTime || 0, t ?? (Lg ? 1 / 0 : 300 * 1e3));
    }
    clearGcTimeout() {
      __privateGet(this, _e5) && (cg.clearTimeout(__privateGet(this, _e5)), __privateSet(this, _e5, void 0));
    }
  }, _e5 = new WeakMap(), _d2), _2e = (_e7 = class extends mte {
    constructor(t) {
      super();
      __privateAdd(this, __2e_instances);
      __privateAdd(this, _e6);
      __privateAdd(this, _t5);
      __privateAdd(this, _n4);
      __privateAdd(this, _i2);
      __privateAdd(this, _r2);
      __privateAdd(this, _s);
      __privateAdd(this, _a3);
      __privateSet(this, _a3, false), __privateSet(this, _s, t.defaultOptions), this.setOptions(t.options), this.observers = [], __privateSet(this, _i2, t.client), __privateSet(this, _n4, __privateGet(this, _i2).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, __privateSet(this, _e6, JU(this.options)), this.state = t.state ?? __privateGet(this, _e6), this.scheduleGc();
    }
    get meta() {
      return this.options.meta;
    }
    get promise() {
      var _a6;
      return (_a6 = __privateGet(this, _r2)) == null ? void 0 : _a6.promise;
    }
    setOptions(t) {
      if (this.options = {
        ...__privateGet(this, _s),
        ...t
      }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
        const e = JU(this.options);
        e.data !== void 0 && (this.setState(ZU(e.data, e.dataUpdatedAt)), __privateSet(this, _e6, e));
      }
    }
    optionalRemove() {
      !this.observers.length && this.state.fetchStatus === "idle" && __privateGet(this, _n4).remove(this);
    }
    setData(t, e) {
      const n = jR(this.state.data, t, this.options);
      return __privateMethod(this, __2e_instances, o_fn).call(this, {
        data: n,
        type: "success",
        dataUpdatedAt: e == null ? void 0 : e.updatedAt,
        manual: e == null ? void 0 : e.manual
      }), n;
    }
    setState(t, e) {
      __privateMethod(this, __2e_instances, o_fn).call(this, {
        type: "setState",
        state: t,
        setStateOptions: e
      });
    }
    cancel(t) {
      var _a6, _b3;
      const e = (_a6 = __privateGet(this, _r2)) == null ? void 0 : _a6.promise;
      return (_b3 = __privateGet(this, _r2)) == null ? void 0 : _b3.cancel(t), e ? e.then(ks).catch(ks) : Promise.resolve();
    }
    destroy() {
      super.destroy(), this.cancel({
        silent: true
      });
    }
    reset() {
      this.destroy(), this.setState(__privateGet(this, _e6));
    }
    isActive() {
      return this.observers.some((t) => Al(t.options.enabled, this) !== false);
    }
    isDisabled() {
      return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === P7 || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
    }
    isStatic() {
      return this.getObserversCount() > 0 ? this.observers.some((t) => Ef(t.options.staleTime, this) === "static") : false;
    }
    isStale() {
      return this.getObserversCount() > 0 ? this.observers.some((t) => t.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
    }
    isStaleByTime(t = 0) {
      return this.state.data === void 0 ? true : t === "static" ? false : this.state.isInvalidated ? true : !lte(this.state.dataUpdatedAt, t);
    }
    onFocus() {
      var _a6, _b3;
      (_a6 = this.observers.find((e) => e.shouldFetchOnWindowFocus())) == null ? void 0 : _a6.refetch({
        cancelRefetch: false
      }), (_b3 = __privateGet(this, _r2)) == null ? void 0 : _b3.continue();
    }
    onOnline() {
      var _a6, _b3;
      (_a6 = this.observers.find((e) => e.shouldFetchOnReconnect())) == null ? void 0 : _a6.refetch({
        cancelRefetch: false
      }), (_b3 = __privateGet(this, _r2)) == null ? void 0 : _b3.continue();
    }
    addObserver(t) {
      this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), __privateGet(this, _n4).notify({
        type: "observerAdded",
        query: this,
        observer: t
      }));
    }
    removeObserver(t) {
      this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), this.observers.length || (__privateGet(this, _r2) && (__privateGet(this, _a3) ? __privateGet(this, _r2).cancel({
        revert: true
      }) : __privateGet(this, _r2).cancelRetry()), this.scheduleGc()), __privateGet(this, _n4).notify({
        type: "observerRemoved",
        query: this,
        observer: t
      }));
    }
    getObserversCount() {
      return this.observers.length;
    }
    invalidate() {
      this.state.isInvalidated || __privateMethod(this, __2e_instances, o_fn).call(this, {
        type: "invalidate"
      });
    }
    async fetch(t, e) {
      var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3, _l3;
      if (this.state.fetchStatus !== "idle" && ((_a6 = __privateGet(this, _r2)) == null ? void 0 : _a6.status()) !== "rejected") {
        if (this.state.data !== void 0 && (e == null ? void 0 : e.cancelRefetch)) this.cancel({
          silent: true
        });
        else if (__privateGet(this, _r2)) return __privateGet(this, _r2).continueRetry(), __privateGet(this, _r2).promise;
      }
      if (t && this.setOptions(t), !this.options.queryFn) {
        const l = this.observers.find((c) => c.options.queryFn);
        l && this.setOptions(l.options);
      }
      const n = new AbortController(), r = (l) => {
        Object.defineProperty(l, "signal", {
          enumerable: true,
          get: () => (__privateSet(this, _a3, true), n.signal)
        });
      }, i = () => {
        const l = dte(this.options, e), d = (() => {
          const u = {
            client: __privateGet(this, _i2),
            queryKey: this.queryKey,
            meta: this.meta
          };
          return r(u), u;
        })();
        return __privateSet(this, _a3, false), this.options.persister ? this.options.persister(l, d, this) : l(d);
      }, s = (() => {
        const l = {
          fetchOptions: e,
          options: this.options,
          queryKey: this.queryKey,
          client: __privateGet(this, _i2),
          state: this.state,
          fetchFn: i
        };
        return r(l), l;
      })();
      (_b3 = this.options.behavior) == null ? void 0 : _b3.onFetch(s, this), __privateSet(this, _t5, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_c3 = s.fetchOptions) == null ? void 0 : _c3.meta)) && __privateMethod(this, __2e_instances, o_fn).call(this, {
        type: "fetch",
        meta: (_d4 = s.fetchOptions) == null ? void 0 : _d4.meta
      }), __privateSet(this, _r2, fte({
        initialPromise: e == null ? void 0 : e.initialPromise,
        fn: s.fetchFn,
        onCancel: (l) => {
          l instanceof RR && l.revert && this.setState({
            ...__privateGet(this, _t5),
            fetchStatus: "idle"
          }), n.abort();
        },
        onFail: (l, c) => {
          __privateMethod(this, __2e_instances, o_fn).call(this, {
            type: "failed",
            failureCount: l,
            error: c
          });
        },
        onPause: () => {
          __privateMethod(this, __2e_instances, o_fn).call(this, {
            type: "pause"
          });
        },
        onContinue: () => {
          __privateMethod(this, __2e_instances, o_fn).call(this, {
            type: "continue"
          });
        },
        retry: s.options.retry,
        retryDelay: s.options.retryDelay,
        networkMode: s.options.networkMode,
        canRun: () => true
      }));
      try {
        const l = await __privateGet(this, _r2).start();
        if (l === void 0) throw new Error(`${this.queryHash} data is undefined`);
        return this.setData(l), (_f4 = (_e13 = __privateGet(this, _n4).config).onSuccess) == null ? void 0 : _f4.call(_e13, l, this), (_h4 = (_g4 = __privateGet(this, _n4).config).onSettled) == null ? void 0 : _h4.call(_g4, l, this.state.error, this), l;
      } catch (l) {
        if (l instanceof RR) {
          if (l.silent) return __privateGet(this, _r2).promise;
          if (l.revert) {
            if (this.state.data === void 0) throw l;
            return this.state.data;
          }
        }
        throw __privateMethod(this, __2e_instances, o_fn).call(this, {
          type: "error",
          error: l
        }), (_j3 = (_i7 = __privateGet(this, _n4).config).onError) == null ? void 0 : _j3.call(_i7, l, this), (_l3 = (_k3 = __privateGet(this, _n4).config).onSettled) == null ? void 0 : _l3.call(_k3, this.state.data, l, this), l;
      } finally {
        this.scheduleGc();
      }
    }
  }, _e6 = new WeakMap(), _t5 = new WeakMap(), _n4 = new WeakMap(), _i2 = new WeakMap(), _r2 = new WeakMap(), _s = new WeakMap(), _a3 = new WeakMap(), __2e_instances = new WeakSet(), o_fn = function(t) {
    const e = (n) => {
      switch (t.type) {
        case "failed":
          return {
            ...n,
            fetchFailureCount: t.failureCount,
            fetchFailureReason: t.error
          };
        case "pause":
          return {
            ...n,
            fetchStatus: "paused"
          };
        case "continue":
          return {
            ...n,
            fetchStatus: "fetching"
          };
        case "fetch":
          return {
            ...n,
            ...gte(n.data, this.options),
            fetchMeta: t.meta ?? null
          };
        case "success":
          const r = {
            ...n,
            ...ZU(t.data, t.dataUpdatedAt),
            dataUpdateCount: n.dataUpdateCount + 1,
            ...!t.manual && {
              fetchStatus: "idle",
              fetchFailureCount: 0,
              fetchFailureReason: null
            }
          };
          return __privateSet(this, _t5, t.manual ? r : void 0), r;
        case "error":
          const i = t.error;
          return {
            ...n,
            error: i,
            errorUpdateCount: n.errorUpdateCount + 1,
            errorUpdatedAt: Date.now(),
            fetchFailureCount: n.fetchFailureCount + 1,
            fetchFailureReason: i,
            fetchStatus: "idle",
            status: "error",
            isInvalidated: true
          };
        case "invalidate":
          return {
            ...n,
            isInvalidated: true
          };
        case "setState":
          return {
            ...n,
            ...t.state
          };
      }
    };
    this.state = e(this.state), ya.batch(() => {
      this.observers.forEach((n) => {
        n.onQueryUpdate();
      }), __privateGet(this, _n4).notify({
        query: this,
        type: "updated",
        action: t
      });
    });
  }, _e7);
  function gte(t, e) {
    return {
      fetchFailureCount: 0,
      fetchFailureReason: null,
      fetchStatus: hte(e.networkMode) ? "fetching" : "paused",
      ...t === void 0 && {
        error: null,
        status: "pending"
      }
    };
  }
  function ZU(t, e) {
    return {
      data: t,
      dataUpdatedAt: e ?? Date.now(),
      error: null,
      isInvalidated: false,
      status: "success"
    };
  }
  function JU(t) {
    const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, n = e !== void 0, r = n ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
    return {
      data: e,
      dataUpdateCount: 0,
      dataUpdatedAt: n ? r ?? Date.now() : 0,
      error: null,
      errorUpdateCount: 0,
      errorUpdatedAt: 0,
      fetchFailureCount: 0,
      fetchFailureReason: null,
      fetchMeta: null,
      isInvalidated: false,
      status: n ? "success" : "pending",
      fetchStatus: "idle"
    };
  }
  var pte = (_f3 = class extends zb {
    constructor(t, e) {
      super();
      __privateAdd(this, _pte_instances);
      __privateAdd(this, _e8);
      __privateAdd(this, _t6);
      __privateAdd(this, _n5);
      __privateAdd(this, _i3);
      __privateAdd(this, _r3);
      __privateAdd(this, _s2);
      __privateAdd(this, _a4);
      __privateAdd(this, _o2);
      __privateAdd(this, _g2);
      __privateAdd(this, _h2);
      __privateAdd(this, _f2);
      __privateAdd(this, _c2);
      __privateAdd(this, _d3);
      __privateAdd(this, _l2);
      __privateAdd(this, _m, /* @__PURE__ */ new Set());
      this.options = e, __privateSet(this, _e8, t), __privateSet(this, _o2, null), __privateSet(this, _a4, TR()), this.bindMethods(), this.setOptions(e);
    }
    bindMethods() {
      this.refetch = this.refetch.bind(this);
    }
    onSubscribe() {
      this.listeners.size === 1 && (__privateGet(this, _t6).addObserver(this), XU(__privateGet(this, _t6), this.options) ? __privateMethod(this, _pte_instances, u_fn).call(this) : this.updateResult(), __privateMethod(this, _pte_instances, __fn).call(this));
    }
    onUnsubscribe() {
      this.hasListeners() || this.destroy();
    }
    shouldFetchOnReconnect() {
      return AR(__privateGet(this, _t6), this.options, this.options.refetchOnReconnect);
    }
    shouldFetchOnWindowFocus() {
      return AR(__privateGet(this, _t6), this.options, this.options.refetchOnWindowFocus);
    }
    destroy() {
      this.listeners = /* @__PURE__ */ new Set(), __privateMethod(this, _pte_instances, y_fn).call(this), __privateMethod(this, _pte_instances, b_fn).call(this), __privateGet(this, _t6).removeObserver(this);
    }
    setOptions(t) {
      const e = this.options, n = __privateGet(this, _t6);
      if (this.options = __privateGet(this, _e8).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof Al(this.options.enabled, __privateGet(this, _t6)) != "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
      __privateMethod(this, _pte_instances, x_fn).call(this), __privateGet(this, _t6).setOptions(this.options), e._defaulted && !kR(this.options, e) && __privateGet(this, _e8).getQueryCache().notify({
        type: "observerOptionsUpdated",
        query: __privateGet(this, _t6),
        observer: this
      });
      const r = this.hasListeners();
      r && QU(__privateGet(this, _t6), n, this.options, e) && __privateMethod(this, _pte_instances, u_fn).call(this), this.updateResult(), r && (__privateGet(this, _t6) !== n || Al(this.options.enabled, __privateGet(this, _t6)) !== Al(e.enabled, __privateGet(this, _t6)) || Ef(this.options.staleTime, __privateGet(this, _t6)) !== Ef(e.staleTime, __privateGet(this, _t6))) && __privateMethod(this, _pte_instances, p_fn).call(this);
      const i = __privateMethod(this, _pte_instances, F_fn).call(this);
      r && (__privateGet(this, _t6) !== n || Al(this.options.enabled, __privateGet(this, _t6)) !== Al(e.enabled, __privateGet(this, _t6)) || i !== __privateGet(this, _l2)) && __privateMethod(this, _pte_instances, v_fn).call(this, i);
    }
    getOptimisticResult(t) {
      const e = __privateGet(this, _e8).getQueryCache().build(__privateGet(this, _e8), t), n = this.createResult(e, t);
      return b2e(this, n) && (__privateSet(this, _i3, n), __privateSet(this, _s2, this.options), __privateSet(this, _r3, __privateGet(this, _t6).state)), n;
    }
    getCurrentResult() {
      return __privateGet(this, _i3);
    }
    trackResult(t, e) {
      return new Proxy(t, {
        get: (n, r) => (this.trackProp(r), e == null ? void 0 : e(r), r === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && __privateGet(this, _a4).status === "pending" && __privateGet(this, _a4).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))), Reflect.get(n, r))
      });
    }
    trackProp(t) {
      __privateGet(this, _m).add(t);
    }
    getCurrentQuery() {
      return __privateGet(this, _t6);
    }
    refetch({ ...t } = {}) {
      return this.fetch({
        ...t
      });
    }
    fetchOptimistic(t) {
      const e = __privateGet(this, _e8).defaultQueryOptions(t), n = __privateGet(this, _e8).getQueryCache().build(__privateGet(this, _e8), e);
      return n.fetch().then(() => this.createResult(n, e));
    }
    fetch(t) {
      return __privateMethod(this, _pte_instances, u_fn).call(this, {
        ...t,
        cancelRefetch: t.cancelRefetch ?? true
      }).then(() => (this.updateResult(), __privateGet(this, _i3)));
    }
    createResult(t, e) {
      var _a6;
      const n = __privateGet(this, _t6), r = this.options, i = __privateGet(this, _i3), a = __privateGet(this, _r3), s = __privateGet(this, _s2), c = t !== n ? t.state : __privateGet(this, _n5), { state: d } = t;
      let u = {
        ...d
      }, h = false, f;
      if (e._optimisticResults) {
        const T = this.hasListeners(), A = !T && XU(t, e), B = T && QU(t, n, e, r);
        (A || B) && (u = {
          ...u,
          ...gte(d.data, t.options)
        }), e._optimisticResults === "isRestoring" && (u.fetchStatus = "idle");
      }
      let { error: g, errorUpdatedAt: m, status: v } = u;
      f = u.data;
      let y = false;
      if (e.placeholderData !== void 0 && f === void 0 && v === "pending") {
        let T;
        (i == null ? void 0 : i.isPlaceholderData) && e.placeholderData === (s == null ? void 0 : s.placeholderData) ? (T = i.data, y = true) : T = typeof e.placeholderData == "function" ? e.placeholderData((_a6 = __privateGet(this, _f2)) == null ? void 0 : _a6.state.data, __privateGet(this, _f2)) : e.placeholderData, T !== void 0 && (v = "success", f = jR(i == null ? void 0 : i.data, T, e), h = true);
      }
      if (e.select && f !== void 0 && !y) if (i && f === (a == null ? void 0 : a.data) && e.select === __privateGet(this, _g2)) f = __privateGet(this, _h2);
      else try {
        __privateSet(this, _g2, e.select), f = e.select(f), f = jR(i == null ? void 0 : i.data, f, e), __privateSet(this, _h2, f), __privateSet(this, _o2, null);
      } catch (T) {
        __privateSet(this, _o2, T);
      }
      __privateGet(this, _o2) && (g = __privateGet(this, _o2), f = __privateGet(this, _h2), m = Date.now(), v = "error");
      const w = u.fetchStatus === "fetching", b = v === "pending", j = v === "error", k = b && w, C = f !== void 0, S = {
        status: v,
        fetchStatus: u.fetchStatus,
        isPending: b,
        isSuccess: v === "success",
        isError: j,
        isInitialLoading: k,
        isLoading: k,
        data: f,
        dataUpdatedAt: u.dataUpdatedAt,
        error: g,
        errorUpdatedAt: m,
        failureCount: u.fetchFailureCount,
        failureReason: u.fetchFailureReason,
        errorUpdateCount: u.errorUpdateCount,
        isFetched: u.dataUpdateCount > 0 || u.errorUpdateCount > 0,
        isFetchedAfterMount: u.dataUpdateCount > c.dataUpdateCount || u.errorUpdateCount > c.errorUpdateCount,
        isFetching: w,
        isRefetching: w && !b,
        isLoadingError: j && !C,
        isPaused: u.fetchStatus === "paused",
        isPlaceholderData: h,
        isRefetchError: j && C,
        isStale: O7(t, e),
        refetch: this.refetch,
        promise: __privateGet(this, _a4),
        isEnabled: Al(e.enabled, t) !== false
      };
      if (this.options.experimental_prefetchInRender) {
        const T = S.data !== void 0, A = S.status === "error" && !T, B = (O) => {
          A ? O.reject(S.error) : T && O.resolve(S.data);
        }, U = () => {
          const O = __privateSet(this, _a4, S.promise = TR());
          B(O);
        }, z = __privateGet(this, _a4);
        switch (z.status) {
          case "pending":
            t.queryHash === n.queryHash && B(z);
            break;
          case "fulfilled":
            (A || S.data !== z.value) && U();
            break;
          case "rejected":
            (!A || S.error !== z.reason) && U();
            break;
        }
      }
      return S;
    }
    updateResult() {
      const t = __privateGet(this, _i3), e = this.createResult(__privateGet(this, _t6), this.options);
      if (__privateSet(this, _r3, __privateGet(this, _t6).state), __privateSet(this, _s2, this.options), __privateGet(this, _r3).data !== void 0 && __privateSet(this, _f2, __privateGet(this, _t6)), kR(e, t)) return;
      __privateSet(this, _i3, e);
      const n = () => {
        if (!t) return true;
        const { notifyOnChangeProps: r } = this.options, i = typeof r == "function" ? r() : r;
        if (i === "all" || !i && !__privateGet(this, _m).size) return true;
        const a = new Set(i ?? __privateGet(this, _m));
        return this.options.throwOnError && a.add("error"), Object.keys(__privateGet(this, _i3)).some((s) => {
          const l = s;
          return __privateGet(this, _i3)[l] !== t[l] && a.has(l);
        });
      };
      __privateMethod(this, _pte_instances, w_fn).call(this, {
        listeners: n()
      });
    }
    onQueryUpdate() {
      this.updateResult(), this.hasListeners() && __privateMethod(this, _pte_instances, __fn).call(this);
    }
  }, _e8 = new WeakMap(), _t6 = new WeakMap(), _n5 = new WeakMap(), _i3 = new WeakMap(), _r3 = new WeakMap(), _s2 = new WeakMap(), _a4 = new WeakMap(), _o2 = new WeakMap(), _g2 = new WeakMap(), _h2 = new WeakMap(), _f2 = new WeakMap(), _c2 = new WeakMap(), _d3 = new WeakMap(), _l2 = new WeakMap(), _m = new WeakMap(), _pte_instances = new WeakSet(), u_fn = function(t) {
    __privateMethod(this, _pte_instances, x_fn).call(this);
    let e = __privateGet(this, _t6).fetch(this.options, t);
    return (t == null ? void 0 : t.throwOnError) || (e = e.catch(ks)), e;
  }, p_fn = function() {
    __privateMethod(this, _pte_instances, y_fn).call(this);
    const t = Ef(this.options.staleTime, __privateGet(this, _t6));
    if (Lg || __privateGet(this, _i3).isStale || !ER(t)) return;
    const n = lte(__privateGet(this, _i3).dataUpdatedAt, t) + 1;
    __privateSet(this, _c2, cg.setTimeout(() => {
      __privateGet(this, _i3).isStale || this.updateResult();
    }, n));
  }, F_fn = function() {
    return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(__privateGet(this, _t6)) : this.options.refetchInterval) ?? false;
  }, v_fn = function(t) {
    __privateMethod(this, _pte_instances, b_fn).call(this), __privateSet(this, _l2, t), !(Lg || Al(this.options.enabled, __privateGet(this, _t6)) === false || !ER(__privateGet(this, _l2)) || __privateGet(this, _l2) === 0) && __privateSet(this, _d3, cg.setInterval(() => {
      (this.options.refetchIntervalInBackground || M7.isFocused()) && __privateMethod(this, _pte_instances, u_fn).call(this);
    }, __privateGet(this, _l2)));
  }, __fn = function() {
    __privateMethod(this, _pte_instances, p_fn).call(this), __privateMethod(this, _pte_instances, v_fn).call(this, __privateMethod(this, _pte_instances, F_fn).call(this));
  }, y_fn = function() {
    __privateGet(this, _c2) && (cg.clearTimeout(__privateGet(this, _c2)), __privateSet(this, _c2, void 0));
  }, b_fn = function() {
    __privateGet(this, _d3) && (cg.clearInterval(__privateGet(this, _d3)), __privateSet(this, _d3, void 0));
  }, x_fn = function() {
    const t = __privateGet(this, _e8).getQueryCache().build(__privateGet(this, _e8), this.options);
    if (t === __privateGet(this, _t6)) return;
    const e = __privateGet(this, _t6);
    __privateSet(this, _t6, t), __privateSet(this, _n5, t.state), this.hasListeners() && (e == null ? void 0 : e.removeObserver(this), t.addObserver(this));
  }, w_fn = function(t) {
    ya.batch(() => {
      t.listeners && this.listeners.forEach((e) => {
        e(__privateGet(this, _i3));
      }), __privateGet(this, _e8).getQueryCache().notify({
        query: __privateGet(this, _t6),
        type: "observerResultsUpdated"
      });
    });
  }, _f3);
  function y2e(t, e) {
    return Al(e.enabled, t) !== false && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === false);
  }
  function XU(t, e) {
    return y2e(t, e) || t.state.data !== void 0 && AR(t, e, e.refetchOnMount);
  }
  function AR(t, e, n) {
    if (Al(e.enabled, t) !== false && Ef(e.staleTime, t) !== "static") {
      const r = typeof n == "function" ? n(t) : n;
      return r === "always" || r !== false && O7(t, e);
    }
    return false;
  }
  function QU(t, e, n, r) {
    return (t !== e || Al(r.enabled, t) === false) && (!n.suspense || t.state.status !== "error") && O7(t, n);
  }
  function O7(t, e) {
    return Al(e.enabled, t) !== false && t.isStaleByTime(Ef(e.staleTime, t));
  }
  function b2e(t, e) {
    return !kR(t.getCurrentResult(), e);
  }
  function MC(t) {
    return {
      onFetch: (e, n) => {
        var _a6, _b3, _c3, _d4, _e13;
        const r = e.options, i = (_c3 = (_b3 = (_a6 = e.fetchOptions) == null ? void 0 : _a6.meta) == null ? void 0 : _b3.fetchMore) == null ? void 0 : _c3.direction, a = ((_d4 = e.state.data) == null ? void 0 : _d4.pages) || [], s = ((_e13 = e.state.data) == null ? void 0 : _e13.pageParams) || [];
        let l = {
          pages: [],
          pageParams: []
        }, c = 0;
        const d = async () => {
          let u = false;
          const h = (m) => {
            f2e(m, () => e.signal, () => u = true);
          }, f = dte(e.options, e.fetchOptions), g = async (m, v, y) => {
            if (u) return Promise.reject();
            if (v == null && m.pages.length) return Promise.resolve(m);
            const b = (() => {
              const x = {
                client: e.client,
                queryKey: e.queryKey,
                pageParam: v,
                direction: y ? "backward" : "forward",
                meta: e.options.meta
              };
              return h(x), x;
            })(), j = await f(b), { maxPages: k } = e.options, C = y ? h2e : u2e;
            return {
              pages: C(m.pages, j, k),
              pageParams: C(m.pageParams, v, k)
            };
          };
          if (i && a.length) {
            const m = i === "backward", v = m ? Fte : IR, y = {
              pages: a,
              pageParams: s
            }, w = v(r, y);
            l = await g(y, w, m);
          } else {
            const m = t ?? a.length;
            do {
              const v = c === 0 ? s[0] ?? r.initialPageParam : IR(r, l);
              if (c > 0 && v == null) break;
              l = await g(l, v), c++;
            } while (c < m);
          }
          return l;
        };
        e.options.persister ? e.fetchFn = () => {
          var _a7, _b4;
          return (_b4 = (_a7 = e.options).persister) == null ? void 0 : _b4.call(_a7, d, {
            client: e.client,
            queryKey: e.queryKey,
            meta: e.options.meta,
            signal: e.signal
          }, n);
        } : e.fetchFn = d;
      }
    };
  }
  function IR(t, { pages: e, pageParams: n }) {
    const r = e.length - 1;
    return e.length > 0 ? t.getNextPageParam(e[r], e, n[r], n) : void 0;
  }
  function Fte(t, { pages: e, pageParams: n }) {
    var _a6;
    return e.length > 0 ? (_a6 = t.getPreviousPageParam) == null ? void 0 : _a6.call(t, e[0], e, n[0], n) : void 0;
  }
  function x2e(t, e) {
    return e ? IR(t, e) != null : false;
  }
  function w2e(t, e) {
    return !e || !t.getPreviousPageParam ? false : Fte(t, e) != null;
  }
  var D2e = class extends pte {
    constructor(t, e) {
      super(t, e);
    }
    bindMethods() {
      super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
    }
    setOptions(t) {
      super.setOptions({
        ...t,
        behavior: MC()
      });
    }
    getOptimisticResult(t) {
      return t.behavior = MC(), super.getOptimisticResult(t);
    }
    fetchNextPage(t) {
      return this.fetch({
        ...t,
        meta: {
          fetchMore: {
            direction: "forward"
          }
        }
      });
    }
    fetchPreviousPage(t) {
      return this.fetch({
        ...t,
        meta: {
          fetchMore: {
            direction: "backward"
          }
        }
      });
    }
    createResult(t, e) {
      var _a6, _b3;
      const { state: n } = t, r = super.createResult(t, e), { isFetching: i, isRefetching: a, isError: s, isRefetchError: l } = r, c = (_b3 = (_a6 = n.fetchMeta) == null ? void 0 : _a6.fetchMore) == null ? void 0 : _b3.direction, d = s && c === "forward", u = i && c === "forward", h = s && c === "backward", f = i && c === "backward";
      return {
        ...r,
        fetchNextPage: this.fetchNextPage,
        fetchPreviousPage: this.fetchPreviousPage,
        hasNextPage: x2e(e, n.data),
        hasPreviousPage: w2e(e, n.data),
        isFetchNextPageError: d,
        isFetchingNextPage: u,
        isFetchPreviousPageError: h,
        isFetchingPreviousPage: f,
        isRefetchError: l && !d && !h,
        isRefetching: a && !u && !f
      };
    }
  }, C2e = (_g3 = class extends mte {
    constructor(t) {
      super();
      __privateAdd(this, _C2e_instances);
      __privateAdd(this, _e9);
      __privateAdd(this, _t7);
      __privateAdd(this, _n6);
      __privateAdd(this, _i4);
      __privateSet(this, _e9, t.client), this.mutationId = t.mutationId, __privateSet(this, _n6, t.mutationCache), __privateSet(this, _t7, []), this.state = t.state || E2e(), this.setOptions(t.options), this.scheduleGc();
    }
    setOptions(t) {
      this.options = t, this.updateGcTime(this.options.gcTime);
    }
    get meta() {
      return this.options.meta;
    }
    addObserver(t) {
      __privateGet(this, _t7).includes(t) || (__privateGet(this, _t7).push(t), this.clearGcTimeout(), __privateGet(this, _n6).notify({
        type: "observerAdded",
        mutation: this,
        observer: t
      }));
    }
    removeObserver(t) {
      __privateSet(this, _t7, __privateGet(this, _t7).filter((e) => e !== t)), this.scheduleGc(), __privateGet(this, _n6).notify({
        type: "observerRemoved",
        mutation: this,
        observer: t
      });
    }
    optionalRemove() {
      __privateGet(this, _t7).length || (this.state.status === "pending" ? this.scheduleGc() : __privateGet(this, _n6).remove(this));
    }
    continue() {
      var _a6;
      return ((_a6 = __privateGet(this, _i4)) == null ? void 0 : _a6.continue()) ?? this.execute(this.state.variables);
    }
    async execute(t) {
      var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3, _l3, _m2, _n9, _o4, _p2, _q2, _r5;
      const e = () => {
        __privateMethod(this, _C2e_instances, r_fn).call(this, {
          type: "continue"
        });
      }, n = {
        client: __privateGet(this, _e9),
        meta: this.options.meta,
        mutationKey: this.options.mutationKey
      };
      __privateSet(this, _i4, fte({
        fn: () => this.options.mutationFn ? this.options.mutationFn(t, n) : Promise.reject(new Error("No mutationFn found")),
        onFail: (a, s) => {
          __privateMethod(this, _C2e_instances, r_fn).call(this, {
            type: "failed",
            failureCount: a,
            error: s
          });
        },
        onPause: () => {
          __privateMethod(this, _C2e_instances, r_fn).call(this, {
            type: "pause"
          });
        },
        onContinue: e,
        retry: this.options.retry ?? 0,
        retryDelay: this.options.retryDelay,
        networkMode: this.options.networkMode,
        canRun: () => __privateGet(this, _n6).canRun(this)
      }));
      const r = this.state.status === "pending", i = !__privateGet(this, _i4).canStart();
      try {
        if (r) e();
        else {
          __privateMethod(this, _C2e_instances, r_fn).call(this, {
            type: "pending",
            variables: t,
            isPaused: i
          }), __privateGet(this, _n6).config.onMutate && await __privateGet(this, _n6).config.onMutate(t, this, n);
          const s = await ((_b3 = (_a6 = this.options).onMutate) == null ? void 0 : _b3.call(_a6, t, n));
          s !== this.state.context && __privateMethod(this, _C2e_instances, r_fn).call(this, {
            type: "pending",
            context: s,
            variables: t,
            isPaused: i
          });
        }
        const a = await __privateGet(this, _i4).start();
        return await ((_d4 = (_c3 = __privateGet(this, _n6).config).onSuccess) == null ? void 0 : _d4.call(_c3, a, t, this.state.context, this, n)), await ((_f4 = (_e13 = this.options).onSuccess) == null ? void 0 : _f4.call(_e13, a, t, this.state.context, n)), await ((_h4 = (_g4 = __privateGet(this, _n6).config).onSettled) == null ? void 0 : _h4.call(_g4, a, null, this.state.variables, this.state.context, this, n)), await ((_j3 = (_i7 = this.options).onSettled) == null ? void 0 : _j3.call(_i7, a, null, t, this.state.context, n)), __privateMethod(this, _C2e_instances, r_fn).call(this, {
          type: "success",
          data: a
        }), a;
      } catch (a) {
        try {
          await ((_l3 = (_k3 = __privateGet(this, _n6).config).onError) == null ? void 0 : _l3.call(_k3, a, t, this.state.context, this, n));
        } catch (s) {
          Promise.reject(s);
        }
        try {
          await ((_n9 = (_m2 = this.options).onError) == null ? void 0 : _n9.call(_m2, a, t, this.state.context, n));
        } catch (s) {
          Promise.reject(s);
        }
        try {
          await ((_p2 = (_o4 = __privateGet(this, _n6).config).onSettled) == null ? void 0 : _p2.call(_o4, void 0, a, this.state.variables, this.state.context, this, n));
        } catch (s) {
          Promise.reject(s);
        }
        try {
          await ((_r5 = (_q2 = this.options).onSettled) == null ? void 0 : _r5.call(_q2, void 0, a, t, this.state.context, n));
        } catch (s) {
          Promise.reject(s);
        }
        throw __privateMethod(this, _C2e_instances, r_fn).call(this, {
          type: "error",
          error: a
        }), a;
      } finally {
        __privateGet(this, _n6).runNext(this);
      }
    }
  }, _e9 = new WeakMap(), _t7 = new WeakMap(), _n6 = new WeakMap(), _i4 = new WeakMap(), _C2e_instances = new WeakSet(), r_fn = function(t) {
    const e = (n) => {
      switch (t.type) {
        case "failed":
          return {
            ...n,
            failureCount: t.failureCount,
            failureReason: t.error
          };
        case "pause":
          return {
            ...n,
            isPaused: true
          };
        case "continue":
          return {
            ...n,
            isPaused: false
          };
        case "pending":
          return {
            ...n,
            context: t.context,
            data: void 0,
            failureCount: 0,
            failureReason: null,
            error: null,
            isPaused: t.isPaused,
            status: "pending",
            variables: t.variables,
            submittedAt: Date.now()
          };
        case "success":
          return {
            ...n,
            data: t.data,
            failureCount: 0,
            failureReason: null,
            error: null,
            status: "success",
            isPaused: false
          };
        case "error":
          return {
            ...n,
            data: void 0,
            error: t.error,
            failureCount: n.failureCount + 1,
            failureReason: t.error,
            isPaused: false,
            status: "error"
          };
      }
    };
    this.state = e(this.state), ya.batch(() => {
      __privateGet(this, _t7).forEach((n) => {
        n.onMutationUpdate(t);
      }), __privateGet(this, _n6).notify({
        mutation: this,
        type: "updated",
        action: t
      });
    });
  }, _g3);
  function E2e() {
    return {
      context: void 0,
      data: void 0,
      error: null,
      failureCount: 0,
      failureReason: null,
      isPaused: false,
      status: "idle",
      variables: void 0,
      submittedAt: 0
    };
  }
  var k2e = (_h3 = class extends zb {
    constructor(t = {}) {
      super();
      __privateAdd(this, _e10);
      __privateAdd(this, _t8);
      __privateAdd(this, _n7);
      this.config = t, __privateSet(this, _e10, /* @__PURE__ */ new Set()), __privateSet(this, _t8, /* @__PURE__ */ new Map()), __privateSet(this, _n7, 0);
    }
    build(t, e, n) {
      const r = new C2e({
        client: t,
        mutationCache: this,
        mutationId: ++__privateWrapper(this, _n7)._,
        options: t.defaultMutationOptions(e),
        state: n
      });
      return this.add(r), r;
    }
    add(t) {
      __privateGet(this, _e10).add(t);
      const e = Ux(t);
      if (typeof e == "string") {
        const n = __privateGet(this, _t8).get(e);
        n ? n.push(t) : __privateGet(this, _t8).set(e, [
          t
        ]);
      }
      this.notify({
        type: "added",
        mutation: t
      });
    }
    remove(t) {
      if (__privateGet(this, _e10).delete(t)) {
        const e = Ux(t);
        if (typeof e == "string") {
          const n = __privateGet(this, _t8).get(e);
          if (n) if (n.length > 1) {
            const r = n.indexOf(t);
            r !== -1 && n.splice(r, 1);
          } else n[0] === t && __privateGet(this, _t8).delete(e);
        }
      }
      this.notify({
        type: "removed",
        mutation: t
      });
    }
    canRun(t) {
      var _a6;
      const e = Ux(t);
      if (typeof e == "string") {
        const r = (_a6 = __privateGet(this, _t8).get(e)) == null ? void 0 : _a6.find((i) => i.state.status === "pending");
        return !r || r === t;
      } else return true;
    }
    runNext(t) {
      var _a6, _b3;
      const e = Ux(t);
      return typeof e == "string" ? ((_b3 = (_a6 = __privateGet(this, _t8).get(e)) == null ? void 0 : _a6.find((r) => r !== t && r.state.isPaused)) == null ? void 0 : _b3.continue()) ?? Promise.resolve() : Promise.resolve();
    }
    clear() {
      ya.batch(() => {
        __privateGet(this, _e10).forEach((t) => {
          this.notify({
            type: "removed",
            mutation: t
          });
        }), __privateGet(this, _e10).clear(), __privateGet(this, _t8).clear();
      });
    }
    getAll() {
      return Array.from(__privateGet(this, _e10));
    }
    find(t) {
      const e = {
        exact: true,
        ...t
      };
      return this.getAll().find((n) => KU(e, n));
    }
    findAll(t = {}) {
      return this.getAll().filter((e) => KU(t, e));
    }
    notify(t) {
      ya.batch(() => {
        this.listeners.forEach((e) => {
          e(t);
        });
      });
    }
    resumePausedMutations() {
      const t = this.getAll().filter((e) => e.state.isPaused);
      return ya.batch(() => Promise.all(t.map((e) => e.continue().catch(ks))));
    }
  }, _e10 = new WeakMap(), _t8 = new WeakMap(), _n7 = new WeakMap(), _h3);
  function Ux(t) {
    var _a6;
    return (_a6 = t.options.scope) == null ? void 0 : _a6.id;
  }
  var S2e = (_i5 = class extends zb {
    constructor(t = {}) {
      super();
      __privateAdd(this, _e11);
      this.config = t, __privateSet(this, _e11, /* @__PURE__ */ new Map());
    }
    build(t, e, n) {
      const r = e.queryKey, i = e.queryHash ?? B7(r, e);
      let a = this.get(i);
      return a || (a = new _2e({
        client: t,
        queryKey: r,
        queryHash: i,
        options: t.defaultQueryOptions(e),
        state: n,
        defaultOptions: t.getQueryDefaults(r)
      }), this.add(a)), a;
    }
    add(t) {
      __privateGet(this, _e11).has(t.queryHash) || (__privateGet(this, _e11).set(t.queryHash, t), this.notify({
        type: "added",
        query: t
      }));
    }
    remove(t) {
      const e = __privateGet(this, _e11).get(t.queryHash);
      e && (t.destroy(), e === t && __privateGet(this, _e11).delete(t.queryHash), this.notify({
        type: "removed",
        query: t
      }));
    }
    clear() {
      ya.batch(() => {
        this.getAll().forEach((t) => {
          this.remove(t);
        });
      });
    }
    get(t) {
      return __privateGet(this, _e11).get(t);
    }
    getAll() {
      return [
        ...__privateGet(this, _e11).values()
      ];
    }
    find(t) {
      const e = {
        exact: true,
        ...t
      };
      return this.getAll().find((n) => qU(e, n));
    }
    findAll(t = {}) {
      const e = this.getAll();
      return Object.keys(t).length > 0 ? e.filter((n) => qU(t, n)) : e;
    }
    notify(t) {
      ya.batch(() => {
        this.listeners.forEach((e) => {
          e(t);
        });
      });
    }
    onFocus() {
      ya.batch(() => {
        this.getAll().forEach((t) => {
          t.onFocus();
        });
      });
    }
    onOnline() {
      ya.batch(() => {
        this.getAll().forEach((t) => {
          t.onOnline();
        });
      });
    }
  }, _e11 = new WeakMap(), _i5), j2e = (_j2 = class {
    constructor(t = {}) {
      __privateAdd(this, _e12);
      __privateAdd(this, _t9);
      __privateAdd(this, _n8);
      __privateAdd(this, _i6);
      __privateAdd(this, _r4);
      __privateAdd(this, _s3);
      __privateAdd(this, _a5);
      __privateAdd(this, _o3);
      __privateSet(this, _e12, t.queryCache || new S2e()), __privateSet(this, _t9, t.mutationCache || new k2e()), __privateSet(this, _n8, t.defaultOptions || {}), __privateSet(this, _i6, /* @__PURE__ */ new Map()), __privateSet(this, _r4, /* @__PURE__ */ new Map()), __privateSet(this, _s3, 0);
    }
    mount() {
      __privateWrapper(this, _s3)._++, __privateGet(this, _s3) === 1 && (__privateSet(this, _a5, M7.subscribe(async (t) => {
        t && (await this.resumePausedMutations(), __privateGet(this, _e12).onFocus());
      })), __privateSet(this, _o3, PC.subscribe(async (t) => {
        t && (await this.resumePausedMutations(), __privateGet(this, _e12).onOnline());
      })));
    }
    unmount() {
      var _a6, _b3;
      __privateWrapper(this, _s3)._--, __privateGet(this, _s3) === 0 && ((_a6 = __privateGet(this, _a5)) == null ? void 0 : _a6.call(this), __privateSet(this, _a5, void 0), (_b3 = __privateGet(this, _o3)) == null ? void 0 : _b3.call(this), __privateSet(this, _o3, void 0));
    }
    isFetching(t) {
      return __privateGet(this, _e12).findAll({
        ...t,
        fetchStatus: "fetching"
      }).length;
    }
    isMutating(t) {
      return __privateGet(this, _t9).findAll({
        ...t,
        status: "pending"
      }).length;
    }
    getQueryData(t) {
      var _a6;
      const e = this.defaultQueryOptions({
        queryKey: t
      });
      return (_a6 = __privateGet(this, _e12).get(e.queryHash)) == null ? void 0 : _a6.state.data;
    }
    ensureQueryData(t) {
      const e = this.defaultQueryOptions(t), n = __privateGet(this, _e12).build(this, e), r = n.state.data;
      return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && n.isStaleByTime(Ef(e.staleTime, n)) && this.prefetchQuery(e), Promise.resolve(r));
    }
    getQueriesData(t) {
      return __privateGet(this, _e12).findAll(t).map(({ queryKey: e, state: n }) => {
        const r = n.data;
        return [
          e,
          r
        ];
      });
    }
    setQueryData(t, e, n) {
      var _a6;
      const r = this.defaultQueryOptions({
        queryKey: t
      }), a = (_a6 = __privateGet(this, _e12).get(r.queryHash)) == null ? void 0 : _a6.state.data, s = l2e(e, a);
      if (s !== void 0) return __privateGet(this, _e12).build(this, r).setData(s, {
        ...n,
        manual: true
      });
    }
    setQueriesData(t, e, n) {
      return ya.batch(() => __privateGet(this, _e12).findAll(t).map(({ queryKey: r }) => [
        r,
        this.setQueryData(r, e, n)
      ]));
    }
    getQueryState(t) {
      var _a6;
      const e = this.defaultQueryOptions({
        queryKey: t
      });
      return (_a6 = __privateGet(this, _e12).get(e.queryHash)) == null ? void 0 : _a6.state;
    }
    removeQueries(t) {
      const e = __privateGet(this, _e12);
      ya.batch(() => {
        e.findAll(t).forEach((n) => {
          e.remove(n);
        });
      });
    }
    resetQueries(t, e) {
      const n = __privateGet(this, _e12);
      return ya.batch(() => (n.findAll(t).forEach((r) => {
        r.reset();
      }), this.refetchQueries({
        type: "active",
        ...t
      }, e)));
    }
    cancelQueries(t, e = {}) {
      const n = {
        revert: true,
        ...e
      }, r = ya.batch(() => __privateGet(this, _e12).findAll(t).map((i) => i.cancel(n)));
      return Promise.all(r).then(ks).catch(ks);
    }
    invalidateQueries(t, e = {}) {
      return ya.batch(() => (__privateGet(this, _e12).findAll(t).forEach((n) => {
        n.invalidate();
      }), (t == null ? void 0 : t.refetchType) === "none" ? Promise.resolve() : this.refetchQueries({
        ...t,
        type: (t == null ? void 0 : t.refetchType) ?? (t == null ? void 0 : t.type) ?? "active"
      }, e)));
    }
    refetchQueries(t, e = {}) {
      const n = {
        ...e,
        cancelRefetch: e.cancelRefetch ?? true
      }, r = ya.batch(() => __privateGet(this, _e12).findAll(t).filter((i) => !i.isDisabled() && !i.isStatic()).map((i) => {
        let a = i.fetch(void 0, n);
        return n.throwOnError || (a = a.catch(ks)), i.state.fetchStatus === "paused" ? Promise.resolve() : a;
      }));
      return Promise.all(r).then(ks);
    }
    fetchQuery(t) {
      const e = this.defaultQueryOptions(t);
      e.retry === void 0 && (e.retry = false);
      const n = __privateGet(this, _e12).build(this, e);
      return n.isStaleByTime(Ef(e.staleTime, n)) ? n.fetch(e) : Promise.resolve(n.state.data);
    }
    prefetchQuery(t) {
      return this.fetchQuery(t).then(ks).catch(ks);
    }
    fetchInfiniteQuery(t) {
      return t.behavior = MC(t.pages), this.fetchQuery(t);
    }
    prefetchInfiniteQuery(t) {
      return this.fetchInfiniteQuery(t).then(ks).catch(ks);
    }
    ensureInfiniteQueryData(t) {
      return t.behavior = MC(t.pages), this.ensureQueryData(t);
    }
    resumePausedMutations() {
      return PC.isOnline() ? __privateGet(this, _t9).resumePausedMutations() : Promise.resolve();
    }
    getQueryCache() {
      return __privateGet(this, _e12);
    }
    getMutationCache() {
      return __privateGet(this, _t9);
    }
    getDefaultOptions() {
      return __privateGet(this, _n8);
    }
    setDefaultOptions(t) {
      __privateSet(this, _n8, t);
    }
    setQueryDefaults(t, e) {
      __privateGet(this, _i6).set(D2(t), {
        queryKey: t,
        defaultOptions: e
      });
    }
    getQueryDefaults(t) {
      const e = [
        ...__privateGet(this, _i6).values()
      ], n = {};
      return e.forEach((r) => {
        C2(t, r.queryKey) && Object.assign(n, r.defaultOptions);
      }), n;
    }
    setMutationDefaults(t, e) {
      __privateGet(this, _r4).set(D2(t), {
        mutationKey: t,
        defaultOptions: e
      });
    }
    getMutationDefaults(t) {
      const e = [
        ...__privateGet(this, _r4).values()
      ], n = {};
      return e.forEach((r) => {
        C2(t, r.mutationKey) && Object.assign(n, r.defaultOptions);
      }), n;
    }
    defaultQueryOptions(t) {
      if (t._defaulted) return t;
      const e = {
        ...__privateGet(this, _n8).queries,
        ...this.getQueryDefaults(t.queryKey),
        ...t,
        _defaulted: true
      };
      return e.queryHash || (e.queryHash = B7(e.queryKey, e)), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === P7 && (e.enabled = false), e;
    }
    defaultMutationOptions(t) {
      return (t == null ? void 0 : t._defaulted) ? t : {
        ...__privateGet(this, _n8).mutations,
        ...(t == null ? void 0 : t.mutationKey) && this.getMutationDefaults(t.mutationKey),
        ...t,
        _defaulted: true
      };
    }
    clear() {
      __privateGet(this, _e12).clear(), __privateGet(this, _t9).clear();
    }
  }, _e12 = new WeakMap(), _t9 = new WeakMap(), _n8 = new WeakMap(), _i6 = new WeakMap(), _r4 = new WeakMap(), _s3 = new WeakMap(), _a5 = new WeakMap(), _o3 = new WeakMap(), _j2), vte = p.createContext(void 0), Ub = (t) => {
    const e = p.useContext(vte);
    if (!e) throw new Error("No QueryClient set, use QueryClientProvider to set one");
    return e;
  }, T2e = ({ client: t, children: e }) => (p.useEffect(() => (t.mount(), () => {
    t.unmount();
  }), [
    t
  ]), o.jsx(vte.Provider, {
    value: t,
    children: e
  })), _te = p.createContext(false), R2e = () => p.useContext(_te);
  _te.Provider;
  function A2e() {
    let t = false;
    return {
      clearReset: () => {
        t = false;
      },
      reset: () => {
        t = true;
      },
      isReset: () => t
    };
  }
  var I2e = p.createContext(A2e()), B2e = () => p.useContext(I2e), P2e = (t, e, n) => {
    const r = (n == null ? void 0 : n.state.error) && typeof t.throwOnError == "function" ? ute(t.throwOnError, [
      n.state.error,
      n
    ]) : t.throwOnError;
    (t.suspense || t.experimental_prefetchInRender || r) && (e.isReset() || (t.retryOnMount = false));
  }, M2e = (t) => {
    p.useEffect(() => {
      t.clearReset();
    }, [
      t
    ]);
  }, O2e = ({ result: t, errorResetBoundary: e, throwOnError: n, query: r, suspense: i }) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || ute(n, [
    t.error,
    r
  ])), L2e = (t) => {
    if (t.suspense) {
      const n = (i) => i === "static" ? i : Math.max(i ?? 1e3, 1e3), r = t.staleTime;
      t.staleTime = typeof r == "function" ? (...i) => n(r(...i)) : n(r), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3));
    }
  }, N2e = (t, e) => t.isLoading && t.isFetching && !e, z2e = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, eV = (t, e, n) => e.fetchOptimistic(t).catch(() => {
    n.clearReset();
  });
  function yte(t, e, n) {
    var _a6, _b3, _c3, _d4, _e13;
    const r = R2e(), i = B2e(), a = Ub(), s = a.defaultQueryOptions(t);
    (_b3 = (_a6 = a.getDefaultOptions().queries) == null ? void 0 : _a6._experimental_beforeQuery) == null ? void 0 : _b3.call(_a6, s);
    const l = a.getQueryCache().get(s.queryHash);
    s._optimisticResults = r ? "isRestoring" : "optimistic", L2e(s), P2e(s, i, l), M2e(i);
    const c = !a.getQueryCache().get(s.queryHash), [d] = p.useState(() => new e(a, s)), u = d.getOptimisticResult(s), h = !r && t.subscribed !== false;
    if (p.useSyncExternalStore(p.useCallback((f) => {
      const g = h ? d.subscribe(ya.batchCalls(f)) : ks;
      return d.updateResult(), g;
    }, [
      d,
      h
    ]), () => d.getCurrentResult(), () => d.getCurrentResult()), p.useEffect(() => {
      d.setOptions(s);
    }, [
      s,
      d
    ]), z2e(s, u)) throw eV(s, d, i);
    if (O2e({
      result: u,
      errorResetBoundary: i,
      throwOnError: s.throwOnError,
      query: l,
      suspense: s.suspense
    })) throw u.error;
    return (_d4 = (_c3 = a.getDefaultOptions().queries) == null ? void 0 : _c3._experimental_afterQuery) == null ? void 0 : _d4.call(_c3, s, u), s.experimental_prefetchInRender && !Lg && N2e(u, r) && ((_e13 = c ? eV(s, d, i) : l == null ? void 0 : l.promise) == null ? void 0 : _e13.catch(ks).finally(() => {
      d.updateResult();
    })), s.notifyOnChangeProps ? u : d.trackResult(u);
  }
  function ol(t, e) {
    return yte(t, pte);
  }
  function bte(t, e) {
    return yte(t, D2e);
  }
  const Kr = () => {
    const t = p.useRef(true);
    return p.useEffect(() => (t.current = true, () => {
      t.current = false;
    }), []), p.useCallback(() => t.current, []);
  };
  var ve = ((t) => (t.Idle = "idle", t.Loading = "loading", t.Success = "success", t.Error = "error", t))(ve || {});
  const YE = (t, e) => {
    const n = Kr(), r = p.useRef(0);
    return p.useCallback(async (...i) => {
      queueMicrotask(() => {
        DF.flushSync(() => {
          e({
            status: "loading"
          });
        });
      }), r.current += 1;
      const a = r.current;
      let s;
      try {
        s = await t(...i);
      } catch (l) {
        if (a !== r.current) return;
        throw n() && queueMicrotask(() => {
          e({
            status: "error",
            error: l
          });
        }), l;
      }
      if (a === r.current) return n() && queueMicrotask(() => {
        e({
          status: "success",
          data: s
        });
      }), s;
    }, [
      t,
      n,
      e
    ]);
  }, Et = (t) => {
    const [e, n] = p.useState({
      status: "idle"
    }), r = YE(t, n);
    return [
      e,
      r,
      n
    ];
  }, ZE = (t) => {
    const [e, n] = Et(t);
    return p.useEffect(() => {
      n();
    }, [
      n
    ]), [
      e,
      n
    ];
  }, U2e = async () => {
    const t = `${ho("/sable")}/config.json`;
    return (await fetch(t, {
      method: "GET"
    })).json();
  };
  function V2e({ fallback: t, error: e, children: n }) {
    const [r, i] = Et(U2e), [a, s] = p.useState(false), l = p.useCallback(() => s(true), []);
    if (p.useEffect(() => {
      i();
    }, [
      i
    ]), r.status === ve.Idle || r.status === ve.Loading) return t == null ? void 0 : t();
    if (!a && r.status === ve.Error) return e == null ? void 0 : e(r.error, i, l);
    const c = r.status === ve.Success ? r.data : {};
    return n(c);
  }
  const L7 = p.createContext(null), H2e = L7.Provider;
  function la() {
    const t = p.useContext(L7);
    if (!t) throw new Error("Client config are not provided!");
    return t;
  }
  function $2e() {
    return p.useContext(L7);
  }
  const W2e = (t) => {
    var _a6;
    return ((_a6 = t.homeserverList) == null ? void 0 : _a6[t.defaultHomeserver ?? 0]) ?? "matrix.org";
  }, xte = (t, e) => {
    const { homeserverList: n, allowCustomHomeservers: r } = t;
    return r ? true : (n == null ? void 0 : n.includes(e)) === true;
  };
  let jc = "https://matrix.to/";
  const q2e = (t) => {
    jc = t ? t.replace(/\/?$/, "/") : "https://matrix.to/";
  }, K2e = (t) => `${jc}#/${t}`, wte = (t, e) => `${t}?${e.map((n) => `via=${n}`).join("&")}`, JE = (t, e) => {
    let n = t;
    return Array.isArray(e) && e.length > 0 && (n = wte(n, e)), `${jc}#/${n}`;
  }, Dte = (t, e, n) => {
    let r = `${t}/${e}`;
    return Array.isArray(n) && n.length > 0 && (r = wte(r, n)), `${jc}#/${r}`;
  }, tV = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  let nV = "", Vx = null;
  const XE = () => {
    if (nV === jc && Vx) return Vx;
    nV = jc;
    const t = `https?://${tV("matrix.to/")}`, e = jc !== "https://matrix.to/" ? `(?:${t}|${tV(jc)})` : t;
    return Vx = {
      any: new RegExp(`^${e}\\S*$`),
      user: new RegExp(`^${e}#/(@[^:\\s]+:[^?/\\s]+)\\/?$`),
      room: new RegExp(`^${e}#/([#!][^?/\\s]+)\\/?(\\?[\\S]*)?$`),
      event: new RegExp(`^${e}#/([#!][^?/\\s]+)/(\\$[^?/\\s]+)\\/?([?\\S]*)?$`)
    }, Vx;
  }, zc = (t) => XE().any.test(t), G2e = (t) => {
    const e = t.trim();
    return zc(e) ? !!(N7(e) ?? QE(e) ?? ek(e)) : false;
  }, N7 = (t) => {
    const e = t.match(XE().user);
    if (e) return e[1];
  }, QE = (t) => {
    const e = t.match(XE().room);
    if (!e) return;
    const n = e[1], r = e[2];
    if (!n) return;
    const i = r ? new URLSearchParams(r).getAll("via") : [];
    return {
      roomIdOrAlias: n,
      viaServers: i.length === 0 ? void 0 : i
    };
  }, ek = (t) => {
    const e = t.match(XE().event);
    if (!e) return;
    const n = e[1], r = e[2], i = e[3];
    if (!n || !r) return;
    const a = i ? new URLSearchParams(i).getAll("via") : [];
    return {
      roomIdOrAlias: n,
      eventId: r,
      viaServers: a.length === 0 ? void 0 : a
    };
  }, Cte = (t) => {
    try {
      return decodeURIComponent(t);
    } catch {
      return t;
    }
  }, Pj = (t) => {
    const e = t.trim(), n = Cte(e), r = zc(e) ? e : zc(n) ? n : void 0;
    if (r) try {
      const i = new URL(r);
      return (i.hash.startsWith("#") ? i.hash.slice(1) : "").replace(/^\/+/u, "").replace(/\/+$/u, "").toLowerCase() || void 0;
    } catch {
      return;
    }
  }, Y2e = (t, e) => {
    if (e == null || e.trim() === "") return true;
    const n = Pj(t);
    if (!n) return false;
    const r = e.trim(), i = Pj(r) ?? Pj(Cte(r));
    return i ? n === i : false;
  }, Z2e = (t, e) => e.find((n) => n.target === t), Ete = (t, e) => {
    const n = p.useMemo(() => new ResizeObserver(t), [
      t
    ]);
    return p.useEffect(() => () => n == null ? void 0 : n.disconnect(), [
      n
    ]), p.useEffect(() => {
      const r = typeof e == "function" ? e() : e;
      return r && n.observe(r), () => {
        r && n.unobserve(r);
      };
    }, [
      n,
      e
    ]), n;
  }, gp = (t, e) => {
    Ete(p.useCallback((n) => {
      const r = t();
      if (!r) return;
      const i = Z2e(r, n);
      if (i) {
        const { clientWidth: a, clientHeight: s } = i.target;
        e(a, s, r);
      }
    }, [
      t,
      e
    ]), t);
  }, J2e = 1124, X2e = 750;
  var sn = ((t) => (t.Desktop = "Desktop", t.Tablet = "Tablet", t.Mobile = "Mobile", t))(sn || {});
  const rV = (t) => t > J2e ? "Desktop" : t > X2e ? "Tablet" : "Mobile", kte = () => {
    const [t, e] = p.useState(rV(document.body.clientWidth));
    return gp(p.useCallback(() => document.body, []), p.useCallback((n) => e(rV(n)), [])), t;
  }, Ste = p.createContext(null), Q2e = Ste.Provider, fr = () => {
    const t = p.useContext(Ste);
    if (t === null) throw new Error("Screen size not provided!");
    return t;
  }, jte = vn(void 0);
  function ebe() {
    const t = Fn(jte), e = p.useCallback((n) => {
      t(n.timeStamp);
    }, [
      t
    ]);
    p.useEffect(() => (window.addEventListener("compositionend", e, {
      capture: true
    }), () => {
      window.removeEventListener("compositionend", e, {
        capture: true
      });
    }));
  }
  function Tte({ compositionEndThreshold: t = 500 } = {}) {
    const e = Ze(jte);
    return p.useCallback((n) => n.nativeEvent.isComposing || n.keyCode === 229 && typeof e < "u" && n.timeStamp - e < t, [
      t,
      e
    ]);
  }
  var Rte = "Patterns_BackgroundDotPattern__1tzpb230", tbe = "SplashScreen_SplashScreen__1t0rkm30", nbe = "SplashScreen_SplashScreenFooter__1t0rkm31";
  function If({ children: t }) {
    return o.jsxs(E, {
      className: gt(tbe, Rte),
      direction: "Column",
      children: [
        t,
        o.jsx(E, {
          className: nbe,
          shrink: "No",
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(D, {
            size: "H2",
            align: "Center",
            children: "Sable"
          })
        })
      ]
    });
  }
  var Mj = {
    exports: {}
  }, Oj, iV;
  function rbe() {
    if (iV) return Oj;
    iV = 1;
    var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
    return Oj = t, Oj;
  }
  var Lj, oV;
  function ibe() {
    if (oV) return Lj;
    oV = 1;
    var t = rbe();
    function e() {
    }
    function n() {
    }
    return n.resetWarningCache = e, Lj = function() {
      function r(s, l, c, d, u, h) {
        if (h !== t) {
          var f = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
          throw f.name = "Invariant Violation", f;
        }
      }
      r.isRequired = r;
      function i() {
        return r;
      }
      var a = {
        array: r,
        bigint: r,
        bool: r,
        func: r,
        number: r,
        object: r,
        string: r,
        symbol: r,
        any: r,
        arrayOf: i,
        element: r,
        elementType: r,
        instanceOf: i,
        node: r,
        objectOf: i,
        oneOf: i,
        oneOfType: i,
        shape: i,
        exact: i,
        checkPropTypes: n,
        resetWarningCache: e
      };
      return a.PropTypes = a, a;
    }, Lj;
  }
  var aV;
  function Ate() {
    return aV || (aV = 1, Mj.exports = ibe()()), Mj.exports;
  }
  var Ite = [
    "input:not([inert]):not([inert] *)",
    "select:not([inert]):not([inert] *)",
    "textarea:not([inert]):not([inert] *)",
    "a[href]:not([inert]):not([inert] *)",
    "button:not([inert]):not([inert] *)",
    "[tabindex]:not(slot):not([inert]):not([inert] *)",
    "audio[controls]:not([inert]):not([inert] *)",
    "video[controls]:not([inert]):not([inert] *)",
    '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',
    "details>summary:first-of-type:not([inert]):not([inert] *)",
    "details:not([inert]):not([inert] *)"
  ], OC = Ite.join(","), Bte = typeof Element > "u", Ng = Bte ? function() {
  } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, LC = !Bte && Element.prototype.getRootNode ? function(t) {
    var e;
    return t == null || (e = t.getRootNode) === null || e === void 0 ? void 0 : e.call(t);
  } : function(t) {
    return t == null ? void 0 : t.ownerDocument;
  }, NC = function(e, n) {
    var r;
    n === void 0 && (n = true);
    var i = e == null || (r = e.getAttribute) === null || r === void 0 ? void 0 : r.call(e, "inert"), a = i === "" || i === "true", s = a || n && e && (typeof e.closest == "function" ? e.closest("[inert]") : NC(e.parentNode));
    return s;
  }, obe = function(e) {
    var n, r = e == null || (n = e.getAttribute) === null || n === void 0 ? void 0 : n.call(e, "contenteditable");
    return r === "" || r === "true";
  }, Pte = function(e, n, r) {
    if (NC(e)) return [];
    var i = Array.prototype.slice.apply(e.querySelectorAll(OC));
    return n && Ng.call(e, OC) && i.unshift(e), i = i.filter(r), i;
  }, zC = function(e, n, r) {
    for (var i = [], a = Array.from(e); a.length; ) {
      var s = a.shift();
      if (!NC(s, false)) if (s.tagName === "SLOT") {
        var l = s.assignedElements(), c = l.length ? l : s.children, d = zC(c, true, r);
        r.flatten ? i.push.apply(i, d) : i.push({
          scopeParent: s,
          candidates: d
        });
      } else {
        var u = Ng.call(s, OC);
        u && r.filter(s) && (n || !e.includes(s)) && i.push(s);
        var h = s.shadowRoot || typeof r.getShadowRoot == "function" && r.getShadowRoot(s), f = !NC(h, false) && (!r.shadowRootFilter || r.shadowRootFilter(s));
        if (h && f) {
          var g = zC(h === true ? s.children : h.children, true, r);
          r.flatten ? i.push.apply(i, g) : i.push({
            scopeParent: s,
            candidates: g
          });
        } else a.unshift.apply(a, s.children);
      }
    }
    return i;
  }, Mte = function(e) {
    return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
  }, cf = function(e) {
    if (!e) throw new Error("No node provided");
    return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || obe(e)) && !Mte(e) ? 0 : e.tabIndex;
  }, abe = function(e, n) {
    var r = cf(e);
    return r < 0 && n && !Mte(e) ? 0 : r;
  }, sbe = function(e, n) {
    return e.tabIndex === n.tabIndex ? e.documentOrder - n.documentOrder : e.tabIndex - n.tabIndex;
  }, Ote = function(e) {
    return e.tagName === "INPUT";
  }, lbe = function(e) {
    return Ote(e) && e.type === "hidden";
  }, cbe = function(e) {
    var n = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(r) {
      return r.tagName === "SUMMARY";
    });
    return n;
  }, dbe = function(e, n) {
    for (var r = 0; r < e.length; r++) if (e[r].checked && e[r].form === n) return e[r];
  }, ube = function(e) {
    if (!e.name) return true;
    var n = e.form || LC(e), r = function(l) {
      return n.querySelectorAll('input[type="radio"][name="' + l + '"]');
    }, i;
    if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function") i = r(window.CSS.escape(e.name));
    else try {
      i = r(e.name);
    } catch (s) {
      return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), false;
    }
    var a = dbe(i, e.form);
    return !a || a === e;
  }, hbe = function(e) {
    return Ote(e) && e.type === "radio";
  }, fbe = function(e) {
    return hbe(e) && !ube(e);
  }, mbe = function(e) {
    var n, r = e && LC(e), i = (n = r) === null || n === void 0 ? void 0 : n.host, a = false;
    if (r && r !== e) {
      var s, l, c;
      for (a = !!((s = i) !== null && s !== void 0 && (l = s.ownerDocument) !== null && l !== void 0 && l.contains(i) || e != null && (c = e.ownerDocument) !== null && c !== void 0 && c.contains(e)); !a && i; ) {
        var d, u, h;
        r = LC(i), i = (d = r) === null || d === void 0 ? void 0 : d.host, a = !!((u = i) !== null && u !== void 0 && (h = u.ownerDocument) !== null && h !== void 0 && h.contains(i));
      }
    }
    return a;
  }, sV = function(e) {
    var n = e.getBoundingClientRect(), r = n.width, i = n.height;
    return r === 0 && i === 0;
  }, gbe = function(e, n) {
    var r = n.displayCheck, i = n.getShadowRoot;
    if (r === "full-native" && "checkVisibility" in e) {
      var a = e.checkVisibility({
        checkOpacity: false,
        opacityProperty: false,
        contentVisibilityAuto: true,
        visibilityProperty: true,
        checkVisibilityCSS: true
      });
      return !a;
    }
    if (getComputedStyle(e).visibility === "hidden") return true;
    var s = Ng.call(e, "details>summary:first-of-type"), l = s ? e.parentElement : e;
    if (Ng.call(l, "details:not([open]) *")) return true;
    if (!r || r === "full" || r === "full-native" || r === "legacy-full") {
      if (typeof i == "function") {
        for (var c = e; e; ) {
          var d = e.parentElement, u = LC(e);
          if (d && !d.shadowRoot && i(d) === true) return sV(e);
          e.assignedSlot ? e = e.assignedSlot : !d && u !== e.ownerDocument ? e = u.host : e = d;
        }
        e = c;
      }
      if (mbe(e)) return !e.getClientRects().length;
      if (r !== "legacy-full") return true;
    } else if (r === "non-zero-area") return sV(e);
    return false;
  }, pbe = function(e) {
    if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) for (var n = e.parentElement; n; ) {
      if (n.tagName === "FIELDSET" && n.disabled) {
        for (var r = 0; r < n.children.length; r++) {
          var i = n.children.item(r);
          if (i.tagName === "LEGEND") return Ng.call(n, "fieldset[disabled] *") ? true : !i.contains(e);
        }
        return true;
      }
      n = n.parentElement;
    }
    return false;
  }, UC = function(e, n) {
    return !(n.disabled || lbe(n) || gbe(n, e) || cbe(n) || pbe(n));
  }, BR = function(e, n) {
    return !(fbe(n) || cf(n) < 0 || !UC(e, n));
  }, Fbe = function(e) {
    var n = parseInt(e.getAttribute("tabindex"), 10);
    return !!(isNaN(n) || n >= 0);
  }, Lte = function(e) {
    var n = [], r = [];
    return e.forEach(function(i, a) {
      var s = !!i.scopeParent, l = s ? i.scopeParent : i, c = abe(l, s), d = s ? Lte(i.candidates) : l;
      c === 0 ? s ? n.push.apply(n, d) : n.push(l) : r.push({
        documentOrder: a,
        tabIndex: c,
        item: i,
        isScope: s,
        content: d
      });
    }), r.sort(sbe).reduce(function(i, a) {
      return a.isScope ? i.push.apply(i, a.content) : i.push(a.content), i;
    }, []).concat(n);
  }, Nte = function(e, n) {
    n = n || {};
    var r;
    return n.getShadowRoot ? r = zC([
      e
    ], n.includeContainer, {
      filter: BR.bind(null, n),
      flatten: false,
      getShadowRoot: n.getShadowRoot,
      shadowRootFilter: Fbe
    }) : r = Pte(e, n.includeContainer, BR.bind(null, n)), Lte(r);
  }, zte = function(e, n) {
    n = n || {};
    var r;
    return n.getShadowRoot ? r = zC([
      e
    ], n.includeContainer, {
      filter: UC.bind(null, n),
      flatten: true,
      getShadowRoot: n.getShadowRoot
    }) : r = Pte(e, n.includeContainer, UC.bind(null, n)), r;
  }, qm = function(e, n) {
    if (n = n || {}, !e) throw new Error("No node provided");
    return Ng.call(e, OC) === false ? false : BR(n, e);
  }, vbe = Ite.concat("iframe:not([inert]):not([inert] *)").join(","), xD = function(e, n) {
    if (n = n || {}, !e) throw new Error("No node provided");
    return Ng.call(e, vbe) === false ? false : UC(n, e);
  };
  const _be = Object.freeze(Object.defineProperty({
    __proto__: null,
    focusable: zte,
    getTabIndex: cf,
    isFocusable: xD,
    isTabbable: qm,
    tabbable: Nte
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  function PR(t, e) {
    (e == null || e > t.length) && (e = t.length);
    for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
    return r;
  }
  function ybe(t) {
    if (Array.isArray(t)) return PR(t);
  }
  function lV(t, e) {
    var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
    if (!n) {
      if (Array.isArray(t) || (n = Ute(t)) || e) {
        n && (t = n);
        var r = 0, i = function() {
        };
        return {
          s: i,
          n: function() {
            return r >= t.length ? {
              done: true
            } : {
              done: false,
              value: t[r++]
            };
          },
          e: function(c) {
            throw c;
          },
          f: i
        };
      }
      throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
    }
    var a, s = true, l = false;
    return {
      s: function() {
        n = n.call(t);
      },
      n: function() {
        var c = n.next();
        return s = c.done, c;
      },
      e: function(c) {
        l = true, a = c;
      },
      f: function() {
        try {
          s || n.return == null || n.return();
        } finally {
          if (l) throw a;
        }
      }
    };
  }
  function bbe(t, e, n) {
    return (e = Ebe(e)) in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function xbe(t) {
    if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
  }
  function wbe() {
    throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  function cV(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function dV(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? cV(Object(n), true).forEach(function(r) {
        bbe(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : cV(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function Dbe(t) {
    return ybe(t) || xbe(t) || Ute(t) || wbe();
  }
  function Cbe(t, e) {
    if (typeof t != "object" || !t) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (typeof r != "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function Ebe(t) {
    var e = Cbe(t, "string");
    return typeof e == "symbol" ? e : e + "";
  }
  function Ute(t, e) {
    if (t) {
      if (typeof t == "string") return PR(t, e);
      var n = {}.toString.call(t).slice(8, -1);
      return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? PR(t, e) : void 0;
    }
  }
  var ku = {
    getActiveTrap: function(e) {
      return (e == null ? void 0 : e.length) > 0 ? e[e.length - 1] : null;
    },
    activateTrap: function(e, n) {
      var r = ku.getActiveTrap(e);
      n !== r && ku.pauseTrap(e);
      var i = e.indexOf(n);
      i === -1 || e.splice(i, 1), e.push(n);
    },
    deactivateTrap: function(e, n) {
      var r = e.indexOf(n);
      r !== -1 && e.splice(r, 1), ku.unpauseTrap(e);
    },
    pauseTrap: function(e) {
      var n = ku.getActiveTrap(e);
      n == null ? void 0 : n._setPausedState(true);
    },
    unpauseTrap: function(e) {
      var n = ku.getActiveTrap(e);
      n && !n._isManuallyPaused() && n._setPausedState(false);
    }
  }, kbe = function(e) {
    return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
  }, Sbe = function(e) {
    return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
  }, Iy = function(e) {
    return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
  }, jbe = function(e) {
    return Iy(e) && !e.shiftKey;
  }, Tbe = function(e) {
    return Iy(e) && e.shiftKey;
  }, uV = function(e) {
    return setTimeout(e, 0);
  }, e_ = function(e) {
    for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
    return typeof e == "function" ? e.apply(void 0, r) : e;
  }, Hx = function(e) {
    return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
  }, Rbe = [], Abe = function(e, n) {
    var r = (n == null ? void 0 : n.document) || document, i = (n == null ? void 0 : n.trapStack) || Rbe, a = dV({
      returnFocusOnDeactivate: true,
      escapeDeactivates: true,
      delayInitialFocus: true,
      isolateSubtrees: false,
      isKeyForward: jbe,
      isKeyBackward: Tbe
    }, n), s = {
      containers: [],
      containerGroups: [],
      tabbableGroups: [],
      adjacentElements: /* @__PURE__ */ new Set(),
      alreadySilent: /* @__PURE__ */ new Set(),
      nodeFocusedBeforeActivation: null,
      mostRecentlyFocusedNode: null,
      active: false,
      paused: false,
      manuallyPaused: false,
      delayInitialFocusTimer: void 0,
      recentNavEvent: void 0
    }, l, c = function(M, I, N) {
      return M && M[I] !== void 0 ? M[I] : a[N || I];
    }, d = function(M, I) {
      var N = typeof (I == null ? void 0 : I.composedPath) == "function" ? I.composedPath() : void 0;
      return s.containerGroups.findIndex(function(L) {
        var H = L.container, V = L.tabbableNodes;
        return H.contains(M) || (N == null ? void 0 : N.includes(H)) || V.find(function(Z) {
          return Z === M;
        });
      });
    }, u = function(M) {
      var I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, N = I.hasFallback, L = N === void 0 ? false : N, H = I.params, V = H === void 0 ? [] : H, Z = a[M];
      if (typeof Z == "function" && (Z = Z.apply(void 0, Dbe(V))), Z === true && (Z = void 0), !Z) {
        if (Z === void 0 || Z === false) return Z;
        throw new Error("`".concat(M, "` was specified but was not a node, or did not return a node"));
      }
      var Y = Z;
      if (typeof Z == "string") {
        try {
          Y = r.querySelector(Z);
        } catch (oe) {
          throw new Error("`".concat(M, '` appears to be an invalid selector; error="').concat(oe.message, '"'));
        }
        if (!Y && !L) throw new Error("`".concat(M, "` as selector refers to no known node"));
      }
      return Y;
    }, h = function() {
      var M = u("initialFocus", {
        hasFallback: true
      });
      if (M === false) return false;
      if (M === void 0 || M && !xD(M, a.tabbableOptions)) if (d(r.activeElement) >= 0) M = r.activeElement;
      else {
        var I = s.tabbableGroups[0], N = I && I.firstTabbableNode;
        M = N || u("fallbackFocus");
      }
      else M === null && (M = u("fallbackFocus"));
      if (!M) throw new Error("Your focus-trap needs to have at least one focusable element");
      return M;
    }, f = function() {
      if (s.containerGroups = s.containers.map(function(M) {
        var I = Nte(M, a.tabbableOptions), N = zte(M, a.tabbableOptions), L = I.length > 0 ? I[0] : void 0, H = I.length > 0 ? I[I.length - 1] : void 0, V = N.find(function(oe) {
          return qm(oe);
        }), Z = N.slice().reverse().find(function(oe) {
          return qm(oe);
        }), Y = !!I.find(function(oe) {
          return cf(oe) > 0;
        });
        return {
          container: M,
          tabbableNodes: I,
          focusableNodes: N,
          posTabIndexesFound: Y,
          firstTabbableNode: L,
          lastTabbableNode: H,
          firstDomTabbableNode: V,
          lastDomTabbableNode: Z,
          nextTabbableNode: function(ue) {
            var ie = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, de = I.indexOf(ue);
            return de < 0 ? ie ? N.slice(N.indexOf(ue) + 1).find(function(ne) {
              return qm(ne);
            }) : N.slice(0, N.indexOf(ue)).reverse().find(function(ne) {
              return qm(ne);
            }) : I[de + (ie ? 1 : -1)];
          }
        };
      }), s.tabbableGroups = s.containerGroups.filter(function(M) {
        return M.tabbableNodes.length > 0;
      }), s.tabbableGroups.length <= 0 && !u("fallbackFocus")) throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
      if (s.containerGroups.find(function(M) {
        return M.posTabIndexesFound;
      }) && s.containerGroups.length > 1) throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
    }, g = function(M) {
      var I = M.activeElement;
      if (I) return I.shadowRoot && I.shadowRoot.activeElement !== null ? g(I.shadowRoot) : I;
    }, m = function(M) {
      if (M !== false && M !== g(document)) {
        if (!M || !M.focus) {
          m(h());
          return;
        }
        M.focus({
          preventScroll: !!a.preventScroll
        }), s.mostRecentlyFocusedNode = M, kbe(M) && M.select();
      }
    }, v = function(M) {
      var I = u("setReturnFocus", {
        params: [
          M
        ]
      });
      return I || (I === false ? false : M);
    }, y = function(M) {
      var I = M.target, N = M.event, L = M.isBackward, H = L === void 0 ? false : L;
      I = I || Hx(N), f();
      var V = null;
      if (s.tabbableGroups.length > 0) {
        var Z = d(I, N), Y = Z >= 0 ? s.containerGroups[Z] : void 0;
        if (Z < 0) H ? V = s.tabbableGroups[s.tabbableGroups.length - 1].lastTabbableNode : V = s.tabbableGroups[0].firstTabbableNode;
        else if (H) {
          var oe = s.tabbableGroups.findIndex(function(X) {
            var K = X.firstTabbableNode;
            return I === K;
          });
          if (oe < 0 && (Y.container === I || xD(I, a.tabbableOptions) && !qm(I, a.tabbableOptions) && !Y.nextTabbableNode(I, false)) && (oe = Z), oe >= 0) {
            var ue = oe === 0 ? s.tabbableGroups.length - 1 : oe - 1, ie = s.tabbableGroups[ue];
            V = cf(I) >= 0 ? ie.lastTabbableNode : ie.lastDomTabbableNode;
          } else Iy(N) || (V = Y.nextTabbableNode(I, false));
        } else {
          var de = s.tabbableGroups.findIndex(function(X) {
            var K = X.lastTabbableNode;
            return I === K;
          });
          if (de < 0 && (Y.container === I || xD(I, a.tabbableOptions) && !qm(I, a.tabbableOptions) && !Y.nextTabbableNode(I)) && (de = Z), de >= 0) {
            var ne = de === s.tabbableGroups.length - 1 ? 0 : de + 1, ae = s.tabbableGroups[ne];
            V = cf(I) >= 0 ? ae.firstTabbableNode : ae.firstDomTabbableNode;
          } else Iy(N) || (V = Y.nextTabbableNode(I));
        }
      } else V = u("fallbackFocus");
      return V;
    }, w = function(M) {
      var I = Hx(M);
      if (!(d(I, M) >= 0)) {
        if (e_(a.clickOutsideDeactivates, M)) {
          l.deactivate({
            returnFocus: a.returnFocusOnDeactivate
          });
          return;
        }
        e_(a.allowOutsideClick, M) || M.preventDefault();
      }
    }, b = function(M) {
      var I = Hx(M), N = d(I, M) >= 0;
      if (N || I instanceof Document) N && (s.mostRecentlyFocusedNode = I);
      else {
        M.stopImmediatePropagation();
        var L, H = true;
        if (s.mostRecentlyFocusedNode) if (cf(s.mostRecentlyFocusedNode) > 0) {
          var V = d(s.mostRecentlyFocusedNode), Z = s.containerGroups[V].tabbableNodes;
          if (Z.length > 0) {
            var Y = Z.findIndex(function(oe) {
              return oe === s.mostRecentlyFocusedNode;
            });
            Y >= 0 && (a.isKeyForward(s.recentNavEvent) ? Y + 1 < Z.length && (L = Z[Y + 1], H = false) : Y - 1 >= 0 && (L = Z[Y - 1], H = false));
          }
        } else s.containerGroups.some(function(oe) {
          return oe.tabbableNodes.some(function(ue) {
            return cf(ue) > 0;
          });
        }) || (H = false);
        else H = false;
        H && (L = y({
          target: s.mostRecentlyFocusedNode,
          isBackward: a.isKeyBackward(s.recentNavEvent)
        })), m(L || s.mostRecentlyFocusedNode || h());
      }
      s.recentNavEvent = void 0;
    }, j = function(M) {
      var I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      s.recentNavEvent = M;
      var N = y({
        event: M,
        isBackward: I
      });
      N && (Iy(M) && M.preventDefault(), m(N));
    }, k = function(M) {
      (a.isKeyForward(M) || a.isKeyBackward(M)) && j(M, a.isKeyBackward(M));
    }, C = function(M) {
      Sbe(M) && e_(a.escapeDeactivates, M) !== false && (M.preventDefault(), l.deactivate());
    }, x = function(M) {
      var I = Hx(M);
      d(I, M) >= 0 || e_(a.clickOutsideDeactivates, M) || e_(a.allowOutsideClick, M) || (M.preventDefault(), M.stopImmediatePropagation());
    }, S = function() {
      if (s.active) return ku.activateTrap(i, l), s.delayInitialFocusTimer = a.delayInitialFocus ? uV(function() {
        m(h());
      }) : m(h()), r.addEventListener("focusin", b, true), r.addEventListener("mousedown", w, {
        capture: true,
        passive: false
      }), r.addEventListener("touchstart", w, {
        capture: true,
        passive: false
      }), r.addEventListener("click", x, {
        capture: true,
        passive: false
      }), r.addEventListener("keydown", k, {
        capture: true,
        passive: false
      }), r.addEventListener("keydown", C), l;
    }, T = function(M) {
      s.active && !s.paused && l._setSubtreeIsolation(false), s.adjacentElements.clear(), s.alreadySilent.clear();
      var I = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set(), L = lV(M), H;
      try {
        for (L.s(); !(H = L.n()).done; ) {
          var V = H.value;
          I.add(V);
          for (var Z = typeof ShadowRoot < "u" && V.getRootNode() instanceof ShadowRoot, Y = V; Y; ) {
            I.add(Y);
            var oe = Y.parentElement, ue = [];
            oe ? ue = oe.children : !oe && Z && (ue = Y.getRootNode().children, oe = Y.getRootNode().host, Z = typeof ShadowRoot < "u" && oe.getRootNode() instanceof ShadowRoot);
            var ie = lV(ue), de;
            try {
              for (ie.s(); !(de = ie.n()).done; ) {
                var ne = de.value;
                N.add(ne);
              }
            } catch (ae) {
              ie.e(ae);
            } finally {
              ie.f();
            }
            Y = oe;
          }
        }
      } catch (ae) {
        L.e(ae);
      } finally {
        L.f();
      }
      I.forEach(function(ae) {
        N.delete(ae);
      }), s.adjacentElements = N;
    }, A = function() {
      if (s.active) return r.removeEventListener("focusin", b, true), r.removeEventListener("mousedown", w, true), r.removeEventListener("touchstart", w, true), r.removeEventListener("click", x, true), r.removeEventListener("keydown", k, true), r.removeEventListener("keydown", C), l;
    }, B = function(M) {
      var I = M.some(function(N) {
        var L = Array.from(N.removedNodes);
        return L.some(function(H) {
          return H === s.mostRecentlyFocusedNode;
        });
      });
      I && m(h());
    }, U = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(B) : void 0, z = function() {
      U && (U.disconnect(), s.active && !s.paused && s.containers.map(function(M) {
        U.observe(M, {
          subtree: true,
          childList: true
        });
      }));
    };
    return l = {
      get active() {
        return s.active;
      },
      get paused() {
        return s.paused;
      },
      activate: function(M) {
        if (s.active) return this;
        var I = c(M, "onActivate"), N = c(M, "onPostActivate"), L = c(M, "checkCanFocusTrap"), H = ku.getActiveTrap(i), V = false;
        if (H && !H.paused) {
          var Z;
          (Z = H._setSubtreeIsolation) === null || Z === void 0 || Z.call(H, false), V = true;
        }
        try {
          L || f(), s.active = true, s.paused = false, s.nodeFocusedBeforeActivation = g(r), I == null ? void 0 : I();
          var Y = function() {
            L && f(), S(), z(), a.isolateSubtrees && l._setSubtreeIsolation(true), N == null ? void 0 : N();
          };
          if (L) return L(s.containers.concat()).then(Y, Y), this;
          Y();
        } catch (ue) {
          if (H === ku.getActiveTrap(i) && V) {
            var oe;
            (oe = H._setSubtreeIsolation) === null || oe === void 0 || oe.call(H, true);
          }
          throw ue;
        }
        return this;
      },
      deactivate: function(M) {
        if (!s.active) return this;
        var I = dV({
          onDeactivate: a.onDeactivate,
          onPostDeactivate: a.onPostDeactivate,
          checkCanReturnFocus: a.checkCanReturnFocus
        }, M);
        clearTimeout(s.delayInitialFocusTimer), s.delayInitialFocusTimer = void 0, s.paused || l._setSubtreeIsolation(false), s.alreadySilent.clear(), A(), s.active = false, s.paused = false, z(), ku.deactivateTrap(i, l);
        var N = c(I, "onDeactivate"), L = c(I, "onPostDeactivate"), H = c(I, "checkCanReturnFocus"), V = c(I, "returnFocus", "returnFocusOnDeactivate");
        N == null ? void 0 : N();
        var Z = function() {
          uV(function() {
            V && m(v(s.nodeFocusedBeforeActivation)), L == null ? void 0 : L();
          });
        };
        return V && H ? (H(v(s.nodeFocusedBeforeActivation)).then(Z, Z), this) : (Z(), this);
      },
      pause: function(M) {
        return s.active ? (s.manuallyPaused = true, this._setPausedState(true, M)) : this;
      },
      unpause: function(M) {
        return s.active ? (s.manuallyPaused = false, i[i.length - 1] !== this ? this : this._setPausedState(false, M)) : this;
      },
      updateContainerElements: function(M) {
        var I = [].concat(M).filter(Boolean);
        return s.containers = I.map(function(N) {
          return typeof N == "string" ? r.querySelector(N) : N;
        }), a.isolateSubtrees && T(s.containers), s.active && (f(), a.isolateSubtrees && !s.paused && l._setSubtreeIsolation(true)), z(), this;
      }
    }, Object.defineProperties(l, {
      _isManuallyPaused: {
        value: function() {
          return s.manuallyPaused;
        }
      },
      _setPausedState: {
        value: function(M, I) {
          if (s.paused === M) return this;
          if (s.paused = M, M) {
            var N = c(I, "onPause"), L = c(I, "onPostPause");
            N == null ? void 0 : N(), A(), z(), l._setSubtreeIsolation(false), L == null ? void 0 : L();
          } else {
            var H = c(I, "onUnpause"), V = c(I, "onPostUnpause");
            H == null ? void 0 : H(), l._setSubtreeIsolation(true), f(), S(), z(), V == null ? void 0 : V();
          }
          return this;
        }
      },
      _setSubtreeIsolation: {
        value: function(M) {
          a.isolateSubtrees && s.adjacentElements.forEach(function(I) {
            var N;
            M ? a.isolateSubtrees === "aria-hidden" ? ((I.ariaHidden === "true" || ((N = I.getAttribute("aria-hidden")) === null || N === void 0 ? void 0 : N.toLowerCase()) === "true") && s.alreadySilent.add(I), I.setAttribute("aria-hidden", "true")) : ((I.inert || I.hasAttribute("inert")) && s.alreadySilent.add(I), I.setAttribute("inert", true)) : s.alreadySilent.has(I) || (a.isolateSubtrees === "aria-hidden" ? I.removeAttribute("aria-hidden") : I.removeAttribute("inert"));
          });
        }
      }
    }), l.updateContainerElements(e), l;
  };
  const Ibe = Object.freeze(Object.defineProperty({
    __proto__: null,
    createFocusTrap: Abe
  }, Symbol.toStringTag, {
    value: "Module"
  })), Bbe = IQ(Ibe), Pbe = IQ(_be);
  var Nj, hV;
  function Mbe() {
    if (hV) return Nj;
    hV = 1;
    function t(x) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
        return typeof S;
      } : function(S) {
        return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
      }, t(x);
    }
    function e(x, S) {
      if (!(x instanceof S)) throw new TypeError("Cannot call a class as a function");
    }
    function n(x, S) {
      for (var T = 0; T < S.length; T++) {
        var A = S[T];
        A.enumerable = A.enumerable || false, A.configurable = true, "value" in A && (A.writable = true), Object.defineProperty(x, f(A.key), A);
      }
    }
    function r(x, S, T) {
      return S && n(x.prototype, S), Object.defineProperty(x, "prototype", {
        writable: false
      }), x;
    }
    function i(x, S, T) {
      return S = c(S), a(x, l() ? Reflect.construct(S, T || [], c(x).constructor) : S.apply(x, T));
    }
    function a(x, S) {
      if (S && (t(S) == "object" || typeof S == "function")) return S;
      if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return s(x);
    }
    function s(x) {
      if (x === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return x;
    }
    function l() {
      try {
        var x = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
      } catch {
      }
      return (l = function() {
        return !!x;
      })();
    }
    function c(x) {
      return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(S) {
        return S.__proto__ || Object.getPrototypeOf(S);
      }, c(x);
    }
    function d(x, S) {
      if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function");
      x.prototype = Object.create(S && S.prototype, {
        constructor: {
          value: x,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(x, "prototype", {
        writable: false
      }), S && u(x, S);
    }
    function u(x, S) {
      return u = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(T, A) {
        return T.__proto__ = A, T;
      }, u(x, S);
    }
    function h(x, S, T) {
      return (S = f(S)) in x ? Object.defineProperty(x, S, {
        value: T,
        enumerable: true,
        configurable: true,
        writable: true
      }) : x[S] = T, x;
    }
    function f(x) {
      var S = g(x, "string");
      return t(S) == "symbol" ? S : S + "";
    }
    function g(x, S) {
      if (t(x) != "object" || !x) return x;
      var T = x[Symbol.toPrimitive];
      if (T !== void 0) {
        var A = T.call(x, S);
        if (t(A) != "object") return A;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (S === "string" ? String : Number)(x);
    }
    var m = dh(), v = Ate(), y = Bbe, w = y.createFocusTrap, b = Pbe, j = b.isFocusable, k = (function(x) {
      function S(T) {
        var A;
        e(this, S), A = i(this, S, [
          T
        ]), h(A, "getNodeForOption", function(z) {
          var O, M = (O = this.internalOptions[z]) !== null && O !== void 0 ? O : this.originalOptions[z];
          if (typeof M == "function") {
            for (var I = arguments.length, N = new Array(I > 1 ? I - 1 : 0), L = 1; L < I; L++) N[L - 1] = arguments[L];
            M = M.apply(void 0, N);
          }
          if (M === true && (M = void 0), !M) {
            if (M === void 0 || M === false) return M;
            throw new Error("`".concat(z, "` was specified but was not a node, or did not return a node"));
          }
          var H = M;
          if (typeof M == "string") {
            var V;
            if (H = (V = this.getDocument()) === null || V === void 0 ? void 0 : V.querySelector(M), !H) throw new Error("`".concat(z, "` as selector refers to no known node"));
          }
          return H;
        }), A.handleDeactivate = A.handleDeactivate.bind(A), A.handlePostDeactivate = A.handlePostDeactivate.bind(A), A.handleClickOutsideDeactivates = A.handleClickOutsideDeactivates.bind(A), A.internalOptions = {
          returnFocusOnDeactivate: false,
          checkCanReturnFocus: null,
          onDeactivate: A.handleDeactivate,
          onPostDeactivate: A.handlePostDeactivate,
          clickOutsideDeactivates: A.handleClickOutsideDeactivates
        }, A.originalOptions = {
          returnFocusOnDeactivate: true,
          onDeactivate: null,
          onPostDeactivate: null,
          checkCanReturnFocus: null,
          clickOutsideDeactivates: false
        };
        var B = T.focusTrapOptions;
        for (var U in B) if (Object.prototype.hasOwnProperty.call(B, U)) {
          if (U === "returnFocusOnDeactivate" || U === "onDeactivate" || U === "onPostDeactivate" || U === "checkCanReturnFocus" || U === "clickOutsideDeactivates") {
            A.originalOptions[U] = B[U];
            continue;
          }
          A.internalOptions[U] = B[U];
        }
        return A.outsideClick = null, A.focusTrapElements = T.containerElements || [], A.updatePreviousElement(), A;
      }
      return d(S, x), r(S, [
        {
          key: "getDocument",
          value: function() {
            return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
          }
        },
        {
          key: "getReturnFocusNode",
          value: function() {
            var A = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
            return A || (A === false ? false : this.previouslyFocusedElement);
          }
        },
        {
          key: "updatePreviousElement",
          value: function() {
            var A = this.getDocument();
            A && (this.previouslyFocusedElement = A.activeElement);
          }
        },
        {
          key: "deactivateTrap",
          value: function() {
            !this.focusTrap || !this.focusTrap.active || this.focusTrap.deactivate({
              returnFocus: false,
              checkCanReturnFocus: null,
              onDeactivate: this.originalOptions.onDeactivate
            });
          }
        },
        {
          key: "handleClickOutsideDeactivates",
          value: function(A) {
            var B = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, A) : this.originalOptions.clickOutsideDeactivates;
            return B && (this.outsideClick = {
              target: A.target,
              allowDeactivation: B
            }), B;
          }
        },
        {
          key: "handleDeactivate",
          value: function() {
            this.originalOptions.onDeactivate && this.originalOptions.onDeactivate.call(null), this.deactivateTrap();
          }
        },
        {
          key: "handlePostDeactivate",
          value: function() {
            var A = this, B = function() {
              var z = A.getReturnFocusNode(), O = !!(A.originalOptions.returnFocusOnDeactivate && z !== null && z !== void 0 && z.focus && (!A.outsideClick || A.outsideClick.allowDeactivation && !j(A.outsideClick.target, A.internalOptions.tabbableOptions))), M = A.internalOptions.preventScroll, I = M === void 0 ? false : M;
              O && z.focus({
                preventScroll: I
              }), A.originalOptions.onPostDeactivate && A.originalOptions.onPostDeactivate.call(null), A.outsideClick = null;
            };
            this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(B, B) : B();
          }
        },
        {
          key: "setupFocusTrap",
          value: function() {
            if (this.focusTrap) this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
            else {
              var A = this.focusTrapElements.some(Boolean);
              A && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
            }
          }
        },
        {
          key: "componentDidMount",
          value: function() {
            this.props.active && this.setupFocusTrap();
          }
        },
        {
          key: "componentDidUpdate",
          value: function(A) {
            if (this.focusTrap) {
              A.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
              var B = !A.active && this.props.active, U = A.active && !this.props.active, z = !A.paused && this.props.paused, O = A.paused && !this.props.paused;
              if (B && (this.updatePreviousElement(), this.focusTrap.activate()), U) {
                this.deactivateTrap();
                return;
              }
              z && this.focusTrap.pause(), O && this.focusTrap.unpause();
            } else A.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
          }
        },
        {
          key: "componentWillUnmount",
          value: function() {
            this.deactivateTrap();
          }
        },
        {
          key: "render",
          value: function() {
            var A = this, B = this.props.children ? m.Children.only(this.props.children) : void 0;
            if (B) {
              if (B.type && B.type === m.Fragment) throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
              var U = function(M) {
                var I = A.props.containerElements;
                B && (typeof B.ref == "function" ? B.ref(M) : B.ref && (B.ref.current = M)), A.focusTrapElements = I || [
                  M
                ];
              }, z = m.cloneElement(B, {
                ref: U
              });
              return z;
            }
            return null;
          }
        }
      ]);
    })(m.Component), C = typeof Element > "u" ? Function : Element;
    return k.propTypes = {
      active: v.bool,
      paused: v.bool,
      focusTrapOptions: v.shape({
        document: v.object,
        onActivate: v.func,
        onPostActivate: v.func,
        checkCanFocusTrap: v.func,
        onPause: v.func,
        onPostPause: v.func,
        onUnpause: v.func,
        onPostUnpause: v.func,
        onDeactivate: v.func,
        onPostDeactivate: v.func,
        checkCanReturnFocus: v.func,
        initialFocus: v.oneOfType([
          v.instanceOf(C),
          v.string,
          v.bool,
          v.func
        ]),
        fallbackFocus: v.oneOfType([
          v.instanceOf(C),
          v.string,
          v.func
        ]),
        escapeDeactivates: v.oneOfType([
          v.bool,
          v.func
        ]),
        clickOutsideDeactivates: v.oneOfType([
          v.bool,
          v.func
        ]),
        returnFocusOnDeactivate: v.bool,
        setReturnFocus: v.oneOfType([
          v.instanceOf(C),
          v.string,
          v.bool,
          v.func
        ]),
        allowOutsideClick: v.oneOfType([
          v.bool,
          v.func
        ]),
        preventScroll: v.bool,
        tabbableOptions: v.shape({
          displayCheck: v.oneOf([
            "full",
            "legacy-full",
            "non-zero-area",
            "none"
          ]),
          getShadowRoot: v.oneOfType([
            v.bool,
            v.func
          ])
        }),
        trapStack: v.array,
        isKeyForward: v.func,
        isKeyBackward: v.func
      }),
      containerElements: v.arrayOf(v.instanceOf(C)),
      children: v.oneOfType([
        v.element,
        v.instanceOf(C)
      ])
    }, k.defaultProps = {
      active: true,
      paused: false,
      focusTrapOptions: {},
      _createFocusTrap: w
    }, Nj = k, Nj;
  }
  var Obe = Mbe();
  const Ft = da(Obe), z7 = vn(false), Lbe = () => Ze(z7), Vte = () => {
    const t = Fn(z7);
    return p.useCallback(() => t(true), [
      t
    ]);
  }, Nbe = () => {
    const t = Fn(z7);
    return p.useCallback(() => t(false), [
      t
    ]);
  };
  var hc = {}, fV;
  function zbe() {
    if (fV) return hc;
    fV = 1, Object.defineProperty(hc, "__esModule", {
      value: true
    });
    for (var t = typeof window < "u" && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform), e = {
      alt: "altKey",
      control: "ctrlKey",
      meta: "metaKey",
      shift: "shiftKey"
    }, n = {
      add: "+",
      break: "pause",
      cmd: "meta",
      command: "meta",
      ctl: "control",
      ctrl: "control",
      del: "delete",
      down: "arrowdown",
      esc: "escape",
      ins: "insert",
      left: "arrowleft",
      mod: t ? "meta" : "control",
      opt: "alt",
      option: "alt",
      return: "enter",
      right: "arrowright",
      space: " ",
      spacebar: " ",
      up: "arrowup",
      win: "meta",
      windows: "meta"
    }, r = {
      backspace: 8,
      tab: 9,
      enter: 13,
      shift: 16,
      control: 17,
      alt: 18,
      pause: 19,
      capslock: 20,
      escape: 27,
      " ": 32,
      pageup: 33,
      pagedown: 34,
      end: 35,
      home: 36,
      arrowleft: 37,
      arrowup: 38,
      arrowright: 39,
      arrowdown: 40,
      insert: 45,
      delete: 46,
      meta: 91,
      numlock: 144,
      scrolllock: 145,
      ";": 186,
      "=": 187,
      ",": 188,
      "-": 189,
      ".": 190,
      "/": 191,
      "`": 192,
      "[": 219,
      "\\": 220,
      "]": 221,
      "'": 222
    }, i = 1; i < 20; i++) r["f" + i] = 111 + i;
    function a(f, g, m) {
      g && !("byKey" in g) && (m = g, g = null), Array.isArray(f) || (f = [
        f
      ]);
      var v = f.map(function(b) {
        return c(b, g);
      }), y = function(j) {
        return v.some(function(k) {
          return d(k, j);
        });
      }, w = m == null ? y : y(m);
      return w;
    }
    function s(f, g) {
      return a(f, g);
    }
    function l(f, g) {
      return a(f, {
        byKey: true
      }, g);
    }
    function c(f, g) {
      var m = g && g.byKey, v = {};
      f = f.replace("++", "+add");
      var y = f.split("+"), w = y.length;
      for (var b in e) v[e[b]] = false;
      var j = true, k = false, C = void 0;
      try {
        for (var x = y[Symbol.iterator](), S; !(j = (S = x.next()).done); j = true) {
          var T = S.value, A = T.endsWith("?") && T.length > 1;
          A && (T = T.slice(0, -1));
          var B = h(T), U = e[B];
          if (T.length > 1 && !U && !n[T] && !r[B]) throw new TypeError('Unknown modifier: "' + T + '"');
          (w === 1 || !U) && (m ? v.key = B : v.which = u(T)), U && (v[U] = A ? null : true);
        }
      } catch (z) {
        k = true, C = z;
      } finally {
        try {
          !j && x.return && x.return();
        } finally {
          if (k) throw C;
        }
      }
      return v;
    }
    function d(f, g) {
      for (var m in f) {
        var v = f[m], y = void 0;
        if (v != null && (m === "key" && g.key != null ? y = g.key.toLowerCase() : m === "which" ? y = v === 91 && g.which === 93 ? 91 : g.which : y = g[m], !(y == null && v === false) && y !== v)) return false;
      }
      return true;
    }
    function u(f) {
      f = h(f);
      var g = r[f] || f.toUpperCase().charCodeAt(0);
      return g;
    }
    function h(f) {
      return f = f.toLowerCase(), f = n[f] || f, f;
    }
    return hc.default = a, hc.isHotkey = a, hc.isCodeHotkey = s, hc.isKeyHotkey = l, hc.parseHotkey = c, hc.compareHotkey = d, hc.toKeyCode = u, hc.toKeyName = h, hc;
  }
  var Yt = zbe();
  const zd = (t, e) => {
    Yt.isKeyHotkey("tab", t) && (t.preventDefault(), e());
  }, Hte = (t) => {
    Yt.isKeyHotkey([
      "arrowup",
      "arrowright",
      "arrowdown",
      "arrowleft"
    ], t) && t.preventDefault();
  }, Vb = (t) => (e) => {
    (Yt.isKeyHotkey("enter", e) || Yt.isKeyHotkey("space", e)) && (e.preventDefault(), t(e));
  }, kt = (t) => {
    const e = document.activeElement;
    return (e ? e.nodeName.toLowerCase() === "input" || e.nodeName.toLowerCase() === "textarea" || e.getAttribute("contenteditable") === "true" : false) ? false : (t.stopPropagation(), true);
  }, zj = "sable_sentry_breadcrumb_disabled";
  class Ube {
    constructor() {
      __publicField(this, "logs", []);
      __publicField(this, "maxLogs", 1e3);
      __publicField(this, "enabled", false);
      __publicField(this, "listeners", /* @__PURE__ */ new Set());
      __publicField(this, "disabledBreadcrumbCategories");
      __publicField(this, "sentryStats", {
        errors: 0,
        warnings: 0
      });
      this.enabled = localStorage.getItem("sable_internal_debug") === "1";
      try {
        const e = localStorage.getItem(zj);
        this.disabledBreadcrumbCategories = new Set(e ? JSON.parse(e) : []);
      } catch {
        this.disabledBreadcrumbCategories = /* @__PURE__ */ new Set();
      }
    }
    isEnabled() {
      return this.enabled;
    }
    setEnabled(e) {
      this.enabled = e, e ? localStorage.setItem("sable_internal_debug", "1") : localStorage.removeItem("sable_internal_debug");
    }
    addListener(e) {
      return this.listeners.add(e), () => this.listeners.delete(e);
    }
    notifyListeners(e) {
      this.listeners.forEach((n) => {
        try {
          n(e);
        } catch (r) {
          console.error("[DebugLogger] Listener error:", r);
        }
      });
    }
    log(e, n, r, i, a) {
      if (!this.enabled && e !== "error") return;
      const s = {
        timestamp: Date.now(),
        level: e,
        category: n,
        namespace: r,
        message: i,
        data: a
      };
      this.logs.length >= this.maxLogs && this.logs.shift(), this.logs.push(s), this.notifyListeners(s), this.sendToSentry(s);
      const l = `[sable:${n}:${r}]`;
      console[e === "debug" ? "log" : e](l, i, a !== void 0 ? a : "");
    }
    getBreadcrumbCategoryEnabled(e) {
      return !this.disabledBreadcrumbCategories.has(e);
    }
    setBreadcrumbCategoryEnabled(e, n) {
      n ? this.disabledBreadcrumbCategories.delete(e) : this.disabledBreadcrumbCategories.add(e);
      const r = Array.from(this.disabledBreadcrumbCategories);
      r.length > 0 ? localStorage.setItem(zj, JSON.stringify(r)) : localStorage.removeItem(zj);
    }
    getSentryStats() {
      return {
        ...this.sentryStats
      };
    }
    sendToSentry(e) {
      const r = {
        debug: "debug",
        info: "info",
        warn: "warning",
        error: "error"
      }[e.level] ?? "error";
      this.disabledBreadcrumbCategories.has(e.category) || wa({
        category: `${e.category}.${e.namespace}`,
        message: e.message,
        level: r,
        data: e.data ? {
          data: e.data
        } : void 0,
        timestamp: e.timestamp / 1e3
      });
      const i = `[${e.category}:${e.namespace}] ${e.message}`, a = {};
      e.data && typeof e.data == "object" && !(e.data instanceof Error) && Object.entries(e.data).forEach(([l, c]) => {
        (typeof c == "string" || typeof c == "number" || typeof c == "boolean") && (a[l] = c);
      });
      const s = {
        category: e.category,
        namespace: e.namespace,
        ...a
      };
      e.level === "debug" ? pFe(i, s) : e.level === "info" ? FFe(i, s) : e.level === "warn" ? vFe(i, s) : _Fe(i, s), (e.level === "error" || e.level === "warn") && Vr(`sable.${e.level}s`, 1, {
        attributes: {
          category: e.category,
          namespace: e.namespace
        }
      }), e.level === "error" ? (this.sentryStats.errors += 1, e.data instanceof Error ? y2(e.data, {
        level: "error",
        tags: {
          category: e.category,
          namespace: e.namespace
        },
        contexts: {
          debugLog: {
            message: e.message,
            timestamp: new Date(e.timestamp).toISOString()
          }
        }
      }) : wC(`[${e.category}:${e.namespace}] ${e.message}`, {
        level: "error",
        tags: {
          category: e.category,
          namespace: e.namespace
        },
        contexts: {
          debugLog: {
            data: e.data,
            timestamp: new Date(e.timestamp).toISOString()
          }
        }
      })) : e.level === "warn" && Math.random() < 0.1 && (this.sentryStats.warnings += 1, wC(`[${e.category}:${e.namespace}] ${e.message}`, {
        level: "warning",
        tags: {
          category: e.category,
          namespace: e.namespace
        },
        contexts: {
          debugLog: {
            data: e.data,
            timestamp: new Date(e.timestamp).toISOString()
          }
        }
      }));
    }
    getLogs() {
      return [
        ...this.logs
      ];
    }
    getFilteredLogs(e) {
      let n = [
        ...this.logs
      ];
      if ((e == null ? void 0 : e.level) && (n = n.filter((r) => r.level === e.level)), (e == null ? void 0 : e.category) && (n = n.filter((r) => r.category === e.category)), e == null ? void 0 : e.since) {
        const { since: r } = e;
        n = n.filter((i) => i.timestamp >= r);
      }
      return n;
    }
    clear() {
      this.logs = [];
    }
    exportLogs() {
      return JSON.stringify({
        exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
        build: "v1.17.0",
        logsCount: this.logs.length,
        logs: this.logs.map((e) => ({
          ...e,
          timestamp: new Date(e.timestamp).toISOString()
        }))
      }, null, 2);
    }
    exportLogsForSentry() {
      return this.logs.map((e) => ({
        timestamp: new Date(e.timestamp).toISOString(),
        level: e.level,
        category: e.category,
        namespace: e.namespace,
        message: e.message,
        data: e.data
      }));
    }
    attachLogsToSentry(e = 100) {
      const n = this.logs.slice(-e), r = n.map((a) => ({
        time: new Date(a.timestamp).toISOString(),
        level: a.level,
        category: a.category,
        namespace: a.namespace,
        message: a.message,
        ...a.level === "error" || a.level === "warn" ? {
          data: a.data
        } : {}
      }));
      A1("recentLogs", {
        count: n.length,
        logs: r
      }), ul().setExtra("debugLogs", r);
      const i = JSON.stringify(r, null, 2);
      ul().addAttachment({
        filename: "debug-logs.json",
        data: i,
        contentType: "application/json"
      });
    }
  }
  const uy = new Ube(), Sc = () => uy, fo = (t) => ({
    debug: (e, n, r) => uy.log("debug", e, t, n, r),
    info: (e, n, r) => uy.log("info", e, t, n, r),
    warn: (e, n, r) => uy.log("warn", e, t, n, r),
    error: (e, n, r) => uy.log("error", e, t, n, r)
  }), $te = "SableClient/Sable";
  async function Vbe(t, e) {
    const n = t.split(/[\s\-_/]+/).map((l) => l.replace(/[^\w]/g, "")).filter((l) => l.length >= 3);
    if (n.length === 0) return [];
    const r = `${n.join(" OR ")} repo:${$te} is:issue is:open`, i = new URLSearchParams({
      q: r,
      per_page: "5"
    }), a = await fetch(`https://api.github.com/search/issues?${i}`, {
      signal: e
    });
    return a.ok ? (await a.json()).items ?? [] : [];
  }
  function Wte(t, e, n) {
    const a = "v1.17.0-dev", s = {
      title: e
    };
    return t === "bug" ? (s.template = "bug_report.yml", n.description && (s.description = n.description), n.reproduction && (s.reproduction = n.reproduction), n["expected-behavior"] && (s["expected-behavior"] = n["expected-behavior"]), s.info = `- OS: ${navigator.platform || "unknown"}
- Browser: ${navigator.userAgent}
- Sable: ${a}`, n.context && (s.context = n.context)) : (s.template = "feature_request.yml", n.problem && (s.problem = n.problem), n.solution && (s.solution = n.solution), n.alternatives && (s.alternatives = n.alternatives), n.context && (s.context = n.context)), `https://github.com/${$te}/issues/new?${new URLSearchParams(s)}`;
  }
  function Hbe() {
    const t = Nbe(), e = tee(), [n, r] = p.useState("bug"), [i, a] = p.useState(""), [s, l] = p.useState(""), [c, d] = p.useState(""), [u, h] = p.useState(""), [f, g] = p.useState(""), [m, v] = p.useState(""), [y, w] = p.useState(""), [b, j] = p.useState(""), [k, C] = p.useState(true), [x, S] = p.useState(true), [T, A] = p.useState(!e), [B, U] = p.useState([]), [z, O] = p.useState(false);
    p.useEffect(() => {
      const N = i.trim(), L = new AbortController();
      let H = false, V;
      return N.length >= 3 ? V = setTimeout(async () => {
        O(true);
        try {
          const Z = await Vbe(N, L.signal);
          H || U(Z);
        } catch {
        } finally {
          H || O(false);
        }
      }, 600) : (U([]), O(false)), () => {
        H = true, V !== void 0 && clearTimeout(V), L.abort();
      };
    }, [
      i
    ]);
    const M = i.trim().length > 0 && (n === "bug" ? s.trim().length > 0 : f.trim().length > 0 && m.trim().length > 0), I = () => {
      if (!M) return;
      const N = n === "bug" ? {
        description: s,
        reproduction: c,
        "expected-behavior": u,
        context: b
      } : {
        problem: f,
        solution: m,
        alternatives: y,
        context: b
      };
      if (k && n === "bug") {
        const H = Sc();
        x && H.attachLogsToSentry(100);
        const V = "v1.17.0-dev", Z = [
          `[Bug Report] ${i.trim()}`,
          "",
          `Description:
${s}`,
          c ? `
Steps to Reproduce:
${c}` : "",
          u ? `
Expected Behavior:
${u}` : "",
          b ? `
Additional Context:
${b}` : "",
          `
Environment: ${V} \xB7 ${navigator.platform}`
        ].filter(Boolean).join(`
`), Y = wC(Z, {
          level: "info",
          fingerprint: [
            "bug-report-modal"
          ],
          tags: {
            source: "bug-report-modal",
            reportType: n
          },
          extra: {
            title: i.trim(),
            description: s,
            reproduction: c || "(not provided)",
            expectedBehavior: u || "(not provided)",
            context: b || "(not provided)",
            userAgent: navigator.userAgent,
            platform: navigator.platform,
            version: V
          }
        });
        Y && gFe({
          message: Z,
          name: "User Bug Report",
          associatedEventId: Y
        });
      }
      if (n === "feature" || !e || T) {
        const H = Wte(n, i.trim(), N);
        window.open(H, "_blank", "noopener,noreferrer");
      }
      t();
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            clickOutsideDeactivates: true,
            onDeactivate: t,
            escapeDeactivates: kt
          },
          children: o.jsx(Go, {
            size: "500",
            flexHeight: true,
            variant: "Surface",
            style: {
              maxHeight: "90vh"
            },
            children: o.jsxs(E, {
              direction: "Column",
              style: {
                maxHeight: "90vh",
                overflow: "hidden"
              },
              children: [
                o.jsxs(wn, {
                  size: "500",
                  style: {
                    padding: ee.space.S200,
                    paddingLeft: ee.space.S400
                  },
                  children: [
                    o.jsx(E, {
                      grow: "Yes",
                      children: o.jsx(D, {
                        size: "H4",
                        children: "Report an Issue"
                      })
                    }),
                    o.jsx(Oe, {
                      size: "300",
                      radii: "300",
                      onClick: t,
                      children: o.jsx(Q, {
                        src: q.Cross
                      })
                    })
                  ]
                }),
                o.jsx(dn, {
                  size: "300",
                  hideTrack: true,
                  children: o.jsxs(E, {
                    style: {
                      padding: ee.space.S400,
                      paddingRight: ee.space.S200
                    },
                    direction: "Column",
                    gap: "500",
                    children: [
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Type"
                          }),
                          o.jsxs(E, {
                            gap: "200",
                            children: [
                              o.jsx(Qe, {
                                radii: "Pill",
                                variant: n === "bug" ? "Primary" : "SurfaceVariant",
                                "aria-pressed": n === "bug",
                                onClick: () => r("bug"),
                                children: o.jsx(D, {
                                  size: "T300",
                                  children: "Bug Report"
                                })
                              }),
                              o.jsx(Qe, {
                                radii: "Pill",
                                variant: n === "feature" ? "Primary" : "SurfaceVariant",
                                "aria-pressed": n === "feature",
                                onClick: () => r("feature"),
                                children: o.jsx(D, {
                                  size: "T300",
                                  children: "Feature Request"
                                })
                              })
                            ]
                          })
                        ]
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Title *"
                          }),
                          o.jsx(mn, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            autoFocus: true,
                            placeholder: "Brief description",
                            value: i,
                            onChange: (N) => a(N.target.value)
                          }),
                          z && o.jsxs(E, {
                            gap: "200",
                            alignItems: "Center",
                            children: [
                              o.jsx(dt, {
                                size: "100",
                                variant: "Secondary"
                              }),
                              o.jsx(D, {
                                size: "T200",
                                children: "Searching for similar issues\u2026"
                              })
                            ]
                          }),
                          !z && B.length > 0 && o.jsxs(E, {
                            direction: "Column",
                            gap: "100",
                            children: [
                              o.jsx(D, {
                                size: "T200",
                                children: "Similar open issues \u2014 please check before submitting:"
                              }),
                              B.map((N) => o.jsxs(D, {
                                size: "T200",
                                children: [
                                  "\u2192 ",
                                  o.jsxs("a", {
                                    href: N.html_url,
                                    target: "_blank",
                                    rel: "noopener noreferrer",
                                    children: [
                                      "#",
                                      N.number,
                                      ": ",
                                      N.title
                                    ]
                                  })
                                ]
                              }, N.number))
                            ]
                          })
                        ]
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: n === "bug" ? "Describe the bug *" : "Describe the problem *"
                          }),
                          o.jsx(js, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            rows: 4,
                            placeholder: n === "bug" ? "A clear description of what the bug is." : "A clear description of the problem this feature would solve.",
                            value: n === "bug" ? s : f,
                            onChange: (N) => n === "bug" ? l(N.target.value) : g(N.target.value)
                          })
                        ]
                      }),
                      n === "bug" && o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Steps to reproduce (optional)"
                          }),
                          o.jsx(js, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            rows: 3,
                            placeholder: `1. Go to\u2026
2. Click on\u2026
3. See error`,
                            value: c,
                            onChange: (N) => d(N.target.value)
                          })
                        ]
                      }),
                      n === "bug" && o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Expected behavior (optional)"
                          }),
                          o.jsx(js, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            rows: 2,
                            placeholder: "A clear description of what you expected to happen.",
                            value: u,
                            onChange: (N) => h(N.target.value)
                          })
                        ]
                      }),
                      n === "feature" && o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Describe the solution you'd like *"
                          }),
                          o.jsx(js, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            rows: 3,
                            placeholder: "I would like to\u2026",
                            value: m,
                            onChange: (N) => v(N.target.value)
                          })
                        ]
                      }),
                      n === "feature" && o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Alternatives considered (optional)"
                          }),
                          o.jsx(js, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            rows: 2,
                            placeholder: "Any alternative solutions or features you've considered.",
                            value: y,
                            onChange: (N) => w(N.target.value)
                          })
                        ]
                      }),
                      n === "bug" && o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Platform info (auto-included)"
                          }),
                          o.jsx(D, {
                            size: "T200",
                            style: {
                              opacity: 0.7,
                              wordBreak: "break-all"
                            },
                            children: `Sable v1.17.0-dev \u2022 ${navigator.userAgent}`
                          })
                        ]
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Additional context (optional)"
                          }),
                          o.jsx(js, {
                            size: "500",
                            variant: "SurfaceVariant",
                            radii: "400",
                            rows: 2,
                            placeholder: "Any other context or screenshots.",
                            value: b,
                            onChange: (N) => j(N.target.value)
                          })
                        ]
                      }),
                      n === "bug" && e && o.jsxs(E, {
                        direction: "Column",
                        gap: "200",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Error Tracking"
                          }),
                          o.jsxs(E, {
                            as: "label",
                            gap: "200",
                            alignItems: "Center",
                            style: {
                              cursor: "pointer"
                            },
                            children: [
                              o.jsx(Rd, {
                                variant: "Primary",
                                checked: k,
                                onClick: () => C((N) => !N)
                              }),
                              o.jsxs(E, {
                                direction: "Column",
                                gap: "100",
                                grow: "Yes",
                                children: [
                                  o.jsx(D, {
                                    size: "T300",
                                    children: "Send anonymous report to Sentry for error tracking"
                                  }),
                                  o.jsx(D, {
                                    size: "T200",
                                    style: {
                                      opacity: 0.7
                                    },
                                    children: "Helps developers identify and fix issues faster. No personal data is sent."
                                  })
                                ]
                              })
                            ]
                          }),
                          k && o.jsxs(E, {
                            as: "label",
                            gap: "200",
                            alignItems: "Center",
                            style: {
                              cursor: "pointer",
                              paddingLeft: ee.space.S400
                            },
                            children: [
                              o.jsx(Rd, {
                                variant: "Primary",
                                checked: x,
                                onClick: () => S((N) => !N)
                              }),
                              o.jsxs(E, {
                                direction: "Column",
                                gap: "100",
                                grow: "Yes",
                                children: [
                                  o.jsx(D, {
                                    size: "T300",
                                    children: "Include recent debug logs (last 100 entries)"
                                  }),
                                  o.jsx(D, {
                                    size: "T200",
                                    style: {
                                      opacity: 0.7
                                    },
                                    children: "Provides additional context to help diagnose the issue. Logs are filtered for sensitive data."
                                  })
                                ]
                              })
                            ]
                          }),
                          o.jsxs(E, {
                            as: "label",
                            gap: "200",
                            alignItems: "Center",
                            style: {
                              cursor: "pointer"
                            },
                            children: [
                              o.jsx(Rd, {
                                variant: "Primary",
                                checked: T,
                                onClick: () => A((N) => !N)
                              }),
                              o.jsxs(E, {
                                direction: "Column",
                                gap: "100",
                                grow: "Yes",
                                children: [
                                  o.jsx(D, {
                                    size: "T300",
                                    children: "Also create a GitHub issue"
                                  }),
                                  o.jsx(D, {
                                    size: "T200",
                                    style: {
                                      opacity: 0.7
                                    },
                                    children: "Opens a pre-filled GitHub issue in addition to the Sentry report."
                                  })
                                ]
                              })
                            ]
                          })
                        ]
                      }),
                      o.jsxs(E, {
                        gap: "300",
                        justifyContent: "End",
                        children: [
                          o.jsx(xe, {
                            size: "400",
                            variant: "Secondary",
                            fill: "None",
                            radii: "400",
                            onClick: t,
                            children: o.jsx(D, {
                              size: "B400",
                              children: "Cancel"
                            })
                          }),
                          o.jsx(xe, {
                            size: "400",
                            variant: "Primary",
                            radii: "400",
                            disabled: !M,
                            onClick: I,
                            after: o.jsx(Q, {
                              src: q.ArrowRight,
                              size: "100"
                            }),
                            children: o.jsx(D, {
                              size: "B400",
                              children: e && n === "bug" ? "Submit Report" : "Open on GitHub"
                            })
                          })
                        ]
                      })
                    ]
                  })
                })
              ]
            })
          })
        })
      })
    });
  }
  function $be() {
    return Lbe() ? o.jsx(Hbe, {}) : null;
  }
  function mV(t) {
    const e = t.stack || "No stacktrace available", n = `# Automated Bug Report
Error occurred in the application.

## Error Message
\`\`\`
${t.message}
\`\`\`

## Stacktrace
\`\`\`
${e}
\`\`\``;
    return Wte("bug", `Error: ${t.message}`, {
      context: n
    });
  }
  function MR({ error: t, eventId: e }) {
    const r = tee() && !!e;
    return o.jsx(If, {
      children: o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        gap: "400",
        alignItems: "Center",
        justifyContent: "Center",
        children: o.jsx(lr, {
          style: {
            maxWidth: "600px",
            minWidth: "300px",
            padding: ee.space.S400
          },
          children: o.jsxs(E, {
            style: {
              padding: ee.space.S400
            },
            direction: "Column",
            gap: "400",
            children: [
              o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsxs(E, {
                    alignItems: "Center",
                    gap: "200",
                    children: [
                      o.jsx(Q, {
                        size: "300",
                        src: q.Warning,
                        filled: true,
                        style: {
                          color: ct.Critical.Main
                        }
                      }),
                      o.jsx(D, {
                        size: "H2",
                        children: "Oops! Something went wrong"
                      })
                    ]
                  }),
                  o.jsx(D, {
                    size: "T300",
                    children: r ? "An unexpected error occurred. This crash has been automatically reported to our team. You can add more details to help us investigate." : "An unexpected error occurred. Please try again. If it continues, report the issue on our GitHub using the button below, it will include error details to help us investigate. Thank you for helping improve the app."
                  }),
                  r ? o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(xe, {
                        variant: "Primary",
                        onClick: () => lR({
                          eventId: e
                        }),
                        fill: "Solid",
                        title: "Opens a short form so you can describe what you were doing before the crash. This helps our team fix the issue faster.",
                        children: o.jsx(D, {
                          as: "span",
                          size: "B400",
                          children: "Add Details to Report"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Secondary",
                        onClick: () => window.open(mV(t), "_blank", "noopener noreferrer"),
                        fill: "None",
                        title: "Opens a pre-filled GitHub issue as an alternative reporting method.",
                        children: o.jsx(D, {
                          as: "span",
                          size: "B400",
                          children: "Also Report on GitHub"
                        })
                      })
                    ]
                  }) : o.jsx(xe, {
                    variant: "Secondary",
                    onClick: () => window.open(mV(t), "_blank", "noopener noreferrer"),
                    fill: "Solid",
                    title: "Clicking this button will open a new issue on our GitHub repository with the error details pre-filled. Please review the information before submitting.",
                    children: o.jsx(D, {
                      as: "span",
                      size: "B400",
                      children: "Report Issue"
                    })
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "300",
                    style: {
                      padding: ee.space.S300,
                      backgroundColor: ct.Surface.Container,
                      borderRadius: ee.radii.R300
                    },
                    children: [
                      o.jsx(D, {
                        size: "T300",
                        style: {
                          color: ct.Critical.Main
                        },
                        children: t.message
                      }),
                      o.jsx(E, {
                        style: {
                          padding: ee.space.S200,
                          backgroundColor: ct.Surface.Container,
                          borderRadius: ee.radii.R300,
                          overflow: "auto",
                          maxHeight: "200px",
                          minHeight: "100px"
                        },
                        children: o.jsx(D, {
                          as: "pre",
                          size: "T200",
                          style: {
                            whiteSpace: "pre-wrap",
                            wordBreak: "break-word"
                          },
                          children: t.stack
                        })
                      })
                    ]
                  })
                ]
              }),
              o.jsx(xe, {
                variant: "Primary",
                onClick: () => window.location.reload(),
                fill: "Solid",
                title: "clicking this will reload the page and hopefully lead to a functioning app again :)",
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Reload Page"
                })
              })
            ]
          })
        })
      })
    });
  }
  function Wbe() {
    return o.jsx(If, {
      children: o.jsxs(E, {
        grow: "Yes",
        direction: "Column",
        gap: "400",
        alignItems: "Center",
        justifyContent: "Center",
        children: [
          o.jsx(dt, {
            variant: "Secondary",
            size: "600"
          }),
          o.jsx(D, {
            children: "Petting cats"
          })
        ]
      })
    });
  }
  function qbe({ error: t, retry: e, ignore: n }) {
    return o.jsx(If, {
      children: o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        gap: "400",
        alignItems: "Center",
        justifyContent: "Center",
        children: o.jsx(lr, {
          children: o.jsxs(E, {
            style: {
              padding: ee.space.S400
            },
            direction: "Column",
            gap: "400",
            children: [
              o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    children: "Failed to load client configuration file."
                  }),
                  typeof t == "object" && t && "message" in t && typeof t.message == "string" && o.jsx(D, {
                    size: "T300",
                    style: {
                      color: ct.Critical.Main
                    },
                    children: t.message
                  })
                ]
              }),
              o.jsx(xe, {
                variant: "Critical",
                onClick: e,
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Retry"
                })
              }),
              o.jsx(xe, {
                variant: "Critical",
                onClick: n,
                fill: "Soft",
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Continue"
                })
              })
            ]
          })
        })
      })
    });
  }
  const Kbe = async () => {
    const e = `checkIndexedDBSupport-${(/* @__PURE__ */ new Date()).getTime()}`;
    return new Promise((n) => {
      let r;
      try {
        r = indexedDB.open(e);
      } catch {
        n(false);
        return;
      }
      r.addEventListener("success", () => {
        n(true), indexedDB.deleteDatabase(e);
      }), r.addEventListener("error", () => {
        n(false), indexedDB.deleteDatabase(e);
      });
    });
  };
  function Gbe({ children: t }) {
    const [e, n] = Et(Kbe);
    return p.useEffect(() => {
      n();
    }, [
      n
    ]), e.status === ve.Success && !e.data ? o.jsx(If, {
      children: o.jsx(E, {
        grow: "Yes",
        alignItems: "Center",
        justifyContent: "Center",
        children: o.jsx(lr, {
          children: o.jsxs(E, {
            style: {
              padding: ee.space.S400
            },
            direction: "Column",
            gap: "400",
            children: [
              o.jsx(D, {
                children: "Missing Browser Feature"
              }),
              o.jsx(D, {
                size: "T300",
                priority: "400",
                children: "This app needs IndexedDB to save sessions, but your browser doesn't support it or it's disabled. Please ensure IndexedDB is enabled, restart your browser, check settings/extensions or privacy mode, free up disk space, or try updating/using another browser."
              }),
              o.jsx(D, {
                size: "T200",
                children: o.jsx("a", {
                  href: "https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API",
                  rel: "noreferrer noopener",
                  target: "_blank",
                  children: "What is IndexedDB?"
                })
              })
            ]
          })
        })
      })
    }) : t;
  }
  function Ybe(t, e) {
    if (typeof t != "object" || !t) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (typeof r != "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function Zbe(t) {
    var e = Ybe(t, "string");
    return typeof e == "symbol" ? e : String(e);
  }
  function Jbe(t, e, n) {
    return e = Zbe(e), e in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function gV(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function pV(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? gV(Object(n), true).forEach(function(r) {
        Jbe(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : gV(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function FV(t, e) {
    var n = {};
    for (var r in t) n[r] = e(t[r], r);
    return n;
  }
  var Xbe = (t, e, n) => {
    for (var r of Object.keys(t)) {
      var i;
      if (t[r] !== ((i = e[r]) !== null && i !== void 0 ? i : n[r])) return false;
    }
    return true;
  }, Jr = (t) => {
    var e = (n) => {
      var r = t.defaultClassName, i = pV(pV({}, t.defaultVariants), n);
      for (var a in i) {
        var s, l = (s = i[a]) !== null && s !== void 0 ? s : t.defaultVariants[a];
        if (l != null) {
          var c = l;
          typeof c == "boolean" && (c = c === true ? "true" : "false");
          var d = t.variantClassNames[a][c];
          d && (r += " " + d);
        }
      }
      for (var [u, h] of t.compoundVariants) Xbe(u, i, t.defaultVariants) && (r += " " + h);
      return r;
    };
    return e.variants = () => Object.keys(t.variantClassNames), e.classNames = {
      get base() {
        return t.defaultClassName.split(" ")[0];
      },
      get variants() {
        return FV(t.variantClassNames, (n) => FV(n, (r) => r.split(" ")[0]));
      }
    }, e;
  }, ro = Jr({
    defaultClassName: "ContainerColor_ContainerColor__15396tl0 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "ContainerColor_ContainerColor_variant_Background__15396tl1",
        Surface: "ContainerColor_ContainerColor_variant_Surface__15396tl2",
        SurfaceVariant: "ContainerColor_ContainerColor_variant_SurfaceVariant__15396tl3",
        Primary: "ContainerColor_ContainerColor_variant_Primary__15396tl4",
        Secondary: "ContainerColor_ContainerColor_variant_Secondary__15396tl5",
        Success: "ContainerColor_ContainerColor_variant_Success__15396tl6",
        Warning: "ContainerColor_ContainerColor_variant_Warning__15396tl7",
        Critical: "ContainerColor_ContainerColor_variant_Critical__15396tl8"
      }
    },
    defaultVariants: {
      variant: "Surface"
    },
    compoundVariants: []
  }), Qbe = Jr({
    defaultClassName: "style__1co06gj0",
    variantClassNames: {
      size: {
        300: "style_PageNav_size_300__1co06gj1",
        400: "style_PageNav_size_400__1co06gj2",
        "100%": "style_PageNav_size_100%__1co06gj3"
      }
    },
    defaultVariants: {
      size: "100%"
    },
    compoundVariants: []
  }), e3e = Jr({
    defaultClassName: "style_PageNavHeader__1co06gj4",
    variantClassNames: {
      outlined: {
        true: "style_PageNavHeader_outlined_true__1co06gj5"
      }
    },
    defaultVariants: {
      outlined: true
    },
    compoundVariants: []
  }), t3e = "style_PageNavContent__1co06gj6", n3e = Jr({
    defaultClassName: "style_PageHeader__1co06gj7",
    variantClassNames: {
      balance: {
        true: "style_PageHeader_balance_true__1co06gj8"
      },
      outlined: {
        true: "style_PageHeader_outlined_true__1co06gj9"
      }
    },
    defaultVariants: {
      outlined: true
    },
    compoundVariants: []
  }), r3e = "style_PageContent__1co06gja _1mqalmd1 _1mqalmd0", i3e = "style_PageHeroEmpty__1co06gjb _1mqalmd1 _1mqalmd0", o3e = "style_PageHeroSection__1co06gjc _1mqalmd1 _1mqalmd0", a3e = "style_PageContentCenter__1co06gjd _1mqalmd1 _1mqalmd0";
  function df({ nav: t, children: e }) {
    const n = fr();
    return o.jsxs(E, {
      grow: "Yes",
      className: ro({
        variant: "Background"
      }),
      children: [
        t,
        n !== sn.Mobile && o.jsx(nr, {
          variant: "Background",
          size: "300",
          direction: "Vertical"
        }),
        e
      ]
    });
  }
  function qf({ size: t, children: e }) {
    const r = fr() === sn.Mobile;
    return o.jsx(E, {
      grow: r ? "Yes" : void 0,
      className: Qbe({
        size: t
      }),
      shrink: r ? "Yes" : "No",
      children: o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        children: e
      })
    });
  }
  const Kf = ft(({ className: t, outlined: e, ...n }, r) => o.jsx(wn, {
    className: gt(e3e({
      outlined: e
    }), t),
    variant: "Background",
    ...n,
    ref: r
  }));
  function mh({ scrollRef: t, children: e }) {
    return o.jsx(E, {
      grow: "Yes",
      direction: "Column",
      children: o.jsx(dn, {
        ref: t,
        variant: "Background",
        direction: "Vertical",
        size: "300",
        hideTrack: true,
        visibility: "Hover",
        children: o.jsx("div", {
          className: t3e,
          children: e
        })
      })
    });
  }
  const si = ft(({ className: t, ...e }, n) => o.jsx(E, {
    grow: "Yes",
    direction: "Column",
    className: gt(ro({
      variant: "Surface"
    }), t),
    ...e,
    ref: n
  })), _i = ft(({ className: t, outlined: e, balance: n, ...r }, i) => o.jsx(wn, {
    as: "header",
    size: "600",
    className: gt(n3e({
      balance: n,
      outlined: e
    }), t),
    ...r,
    ref: i
  })), Xr = ft(({ className: t, ...e }, n) => o.jsx("div", {
    className: gt(r3e, t),
    ...e,
    ref: n
  }));
  function tk({ children: t }) {
    return o.jsx(E, {
      className: gt(ro({
        variant: "SurfaceVariant"
      }), i3e),
      direction: "Column",
      alignItems: "Center",
      justifyContent: "Center",
      gap: "200",
      children: t
    });
  }
  const Uc = ft(({ className: t, ...e }, n) => o.jsx(E, {
    direction: "Column",
    className: gt(o3e, t),
    ...e,
    ref: n
  }));
  function Vc({ icon: t, title: e, subTitle: n, children: r }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(E, {
          direction: "Column",
          alignItems: "Center",
          gap: "200",
          children: t
        }),
        o.jsxs(E, {
          as: "h2",
          direction: "Column",
          gap: "200",
          alignItems: "Center",
          children: [
            o.jsx(D, {
              align: "Center",
              size: "H2",
              children: e
            }),
            o.jsx(D, {
              align: "Center",
              priority: "400",
              children: n
            })
          ]
        }),
        r
      ]
    });
  }
  const qd = ft(({ className: t, ...e }, n) => o.jsx("div", {
    className: gt(a3e, t),
    ...e,
    ref: n
  })), VC = {};
  let vV = false;
  function Gf(t, e) {
    (VC ? "production" : void 0) !== "production" && !vV && (console.warn("[DEPRECATED] atomFamily is deprecated and will be removed in v3. Please use the `jotai-family` package instead: https://github.com/jotaijs/jotai-family"), vV = true);
    let n = null;
    const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = (l) => {
      let c;
      if (c = r.get(l), c !== void 0) if (n == null ? void 0 : n(c[1], l)) a.remove(l);
      else return c[0];
      const d = t(l);
      return r.set(l, [
        d,
        Date.now()
      ]), s("CREATE", l, d), d;
    }, s = (l, c, d) => {
      for (const u of i) u({
        type: l,
        param: c,
        atom: d
      });
    };
    return a.unstable_listen = (l) => (i.add(l), () => {
      i.delete(l);
    }), a.getParams = () => r.keys(), a.remove = (l) => {
      {
        if (!r.has(l)) return;
        const [c] = r.get(l);
        r.delete(l), s("REMOVE", l, c);
      }
    }, a.setShouldRemove = (l) => {
      if (n = l, !!n) for (const [c, [d, u]] of r) n(u, c) && (r.delete(c), s("REMOVE", c, d));
    }, a;
  }
  const Uj = (t, e, n) => (e.has(n) ? e : e.set(n, t())).get(n), s3e = /* @__PURE__ */ new WeakMap(), l3e = (t, e, n, r) => {
    const i = Uj(() => /* @__PURE__ */ new WeakMap(), s3e, e), a = Uj(() => /* @__PURE__ */ new WeakMap(), i, n);
    return Uj(t, a, r);
  };
  function jF(t, e, n = Object.is) {
    return l3e(() => {
      const r = /* @__PURE__ */ Symbol(), i = ([s, l]) => {
        if (l === r) return e(s);
        const c = e(s, l);
        return n(l, c) ? l : c;
      }, a = vn((s) => {
        const l = s(a), c = s(t);
        return i([
          c,
          l
        ]);
      });
      return a.init = r, a;
    }, t, e, n);
  }
  const c3e = (t) => typeof (t == null ? void 0 : t.then) == "function";
  function d3e(t = () => {
    try {
      return window.localStorage;
    } catch (n) {
      (VC ? "production" : void 0) !== "production" && typeof window < "u" && console.warn(n);
      return;
    }
  }, e) {
    var n;
    let r, i;
    const a = {
      getItem: (c, d) => {
        var u, h;
        const f = (m) => {
          if (m = m || "", r !== m) {
            try {
              i = JSON.parse(m, e == null ? void 0 : e.reviver);
            } catch {
              return d;
            }
            r = m;
          }
          return i;
        }, g = (h = (u = t()) == null ? void 0 : u.getItem(c)) != null ? h : null;
        return c3e(g) ? g.then(f) : f(g);
      },
      setItem: (c, d) => {
        var u;
        return (u = t()) == null ? void 0 : u.setItem(c, JSON.stringify(d, void 0));
      },
      removeItem: (c) => {
        var d;
        return (d = t()) == null ? void 0 : d.removeItem(c);
      }
    }, s = (c) => (d, u, h) => c(d, (f) => {
      let g;
      try {
        g = JSON.parse(f || "");
      } catch {
        g = h;
      }
      u(g);
    });
    let l;
    try {
      l = (n = t()) == null ? void 0 : n.subscribe;
    } catch {
    }
    return !l && typeof window < "u" && typeof window.addEventListener == "function" && window.Storage && (l = (c, d) => {
      if (!(t() instanceof window.Storage)) return () => {
      };
      const u = (h) => {
        h.storageArea === t() && h.key === c && d(h.newValue);
      };
      return window.addEventListener("storage", u), () => {
        window.removeEventListener("storage", u);
      };
    }), l && (a.subscribe = s(l)), a;
  }
  d3e();
  function u3e(t, e) {
    const n = vn(0);
    return (VC ? "production" : void 0) !== "production" && (n.debugPrivate = true), vn((r, i) => (r(n), t(r, i)), (r, i, ...a) => {
      if (a.length === 0) i(n, (s) => s + 1);
      else if ((VC ? "production" : void 0) !== "production") throw new Error("refresh must be called without arguments");
    });
  }
  function h3e(t, e) {
    if (t == null) return {};
    var n = {};
    for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
      if (e.indexOf(r) !== -1) continue;
      n[r] = t[r];
    }
    return n;
  }
  function qte(t, e) {
    if (t == null) return {};
    var n, r, i = h3e(t, e);
    if (Object.getOwnPropertySymbols) {
      var a = Object.getOwnPropertySymbols(t);
      for (r = 0; r < a.length; r++) n = a[r], e.indexOf(n) === -1 && {}.propertyIsEnumerable.call(t, n) && (i[n] = t[n]);
    }
    return i;
  }
  function _V(t, e, n, r, i, a, s) {
    try {
      var l = t[a](s), c = l.value;
    } catch (d) {
      return void n(d);
    }
    l.done ? e(c) : Promise.resolve(c).then(r, i);
  }
  me = function(t) {
    return function() {
      var e = this, n = arguments;
      return new Promise(function(r, i) {
        var a = t.apply(e, n);
        function s(c) {
          _V(a, r, i, s, l, "next", c);
        }
        function l(c) {
          _V(a, r, i, s, l, "throw", c);
        }
        s(void 0);
      });
    };
  };
  function E2(t) {
    "@babel/helpers - typeof";
    return E2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, E2(t);
  }
  function f3e(t, e) {
    if (E2(t) != "object" || !t) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (E2(r) != "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function m3e(t) {
    var e = f3e(t, "string");
    return E2(e) == "symbol" ? e : e + "";
  }
  $ = function(t, e, n) {
    return (e = m3e(e)) in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  };
  var $x = {
    exports: {}
  }, yV;
  function nk() {
    if (yV) return $x.exports;
    yV = 1;
    var t = typeof Reflect == "object" ? Reflect : null, e = t && typeof t.apply == "function" ? t.apply : function(C, x, S) {
      return Function.prototype.apply.call(C, x, S);
    }, n;
    t && typeof t.ownKeys == "function" ? n = t.ownKeys : Object.getOwnPropertySymbols ? n = function(C) {
      return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C));
    } : n = function(C) {
      return Object.getOwnPropertyNames(C);
    };
    function r(k) {
      console && console.warn && console.warn(k);
    }
    var i = Number.isNaN || function(C) {
      return C !== C;
    };
    function a() {
      a.init.call(this);
    }
    $x.exports = a, $x.exports.once = w, a.EventEmitter = a, a.prototype._events = void 0, a.prototype._eventsCount = 0, a.prototype._maxListeners = void 0;
    var s = 10;
    function l(k) {
      if (typeof k != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof k);
    }
    Object.defineProperty(a, "defaultMaxListeners", {
      enumerable: true,
      get: function() {
        return s;
      },
      set: function(k) {
        if (typeof k != "number" || k < 0 || i(k)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + k + ".");
        s = k;
      }
    }), a.init = function() {
      (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
    }, a.prototype.setMaxListeners = function(C) {
      if (typeof C != "number" || C < 0 || i(C)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + C + ".");
      return this._maxListeners = C, this;
    };
    function c(k) {
      return k._maxListeners === void 0 ? a.defaultMaxListeners : k._maxListeners;
    }
    a.prototype.getMaxListeners = function() {
      return c(this);
    }, a.prototype.emit = function(C) {
      for (var x = [], S = 1; S < arguments.length; S++) x.push(arguments[S]);
      var T = C === "error", A = this._events;
      if (A !== void 0) T = T && A.error === void 0;
      else if (!T) return false;
      if (T) {
        var B;
        if (x.length > 0 && (B = x[0]), B instanceof Error) throw B;
        var U = new Error("Unhandled error." + (B ? " (" + B.message + ")" : ""));
        throw U.context = B, U;
      }
      var z = A[C];
      if (z === void 0) return false;
      if (typeof z == "function") e(z, this, x);
      else for (var O = z.length, M = m(z, O), S = 0; S < O; ++S) e(M[S], this, x);
      return true;
    };
    function d(k, C, x, S) {
      var T, A, B;
      if (l(x), A = k._events, A === void 0 ? (A = k._events = /* @__PURE__ */ Object.create(null), k._eventsCount = 0) : (A.newListener !== void 0 && (k.emit("newListener", C, x.listener ? x.listener : x), A = k._events), B = A[C]), B === void 0) B = A[C] = x, ++k._eventsCount;
      else if (typeof B == "function" ? B = A[C] = S ? [
        x,
        B
      ] : [
        B,
        x
      ] : S ? B.unshift(x) : B.push(x), T = c(k), T > 0 && B.length > T && !B.warned) {
        B.warned = true;
        var U = new Error("Possible EventEmitter memory leak detected. " + B.length + " " + String(C) + " listeners added. Use emitter.setMaxListeners() to increase limit");
        U.name = "MaxListenersExceededWarning", U.emitter = k, U.type = C, U.count = B.length, r(U);
      }
      return k;
    }
    a.prototype.addListener = function(C, x) {
      return d(this, C, x, false);
    }, a.prototype.on = a.prototype.addListener, a.prototype.prependListener = function(C, x) {
      return d(this, C, x, true);
    };
    function u() {
      if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = true, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
    }
    function h(k, C, x) {
      var S = {
        fired: false,
        wrapFn: void 0,
        target: k,
        type: C,
        listener: x
      }, T = u.bind(S);
      return T.listener = x, S.wrapFn = T, T;
    }
    a.prototype.once = function(C, x) {
      return l(x), this.on(C, h(this, C, x)), this;
    }, a.prototype.prependOnceListener = function(C, x) {
      return l(x), this.prependListener(C, h(this, C, x)), this;
    }, a.prototype.removeListener = function(C, x) {
      var S, T, A, B, U;
      if (l(x), T = this._events, T === void 0) return this;
      if (S = T[C], S === void 0) return this;
      if (S === x || S.listener === x) --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete T[C], T.removeListener && this.emit("removeListener", C, S.listener || x));
      else if (typeof S != "function") {
        for (A = -1, B = S.length - 1; B >= 0; B--) if (S[B] === x || S[B].listener === x) {
          U = S[B].listener, A = B;
          break;
        }
        if (A < 0) return this;
        A === 0 ? S.shift() : v(S, A), S.length === 1 && (T[C] = S[0]), T.removeListener !== void 0 && this.emit("removeListener", C, U || x);
      }
      return this;
    }, a.prototype.off = a.prototype.removeListener, a.prototype.removeAllListeners = function(C) {
      var x, S, T;
      if (S = this._events, S === void 0) return this;
      if (S.removeListener === void 0) return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : S[C] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete S[C]), this;
      if (arguments.length === 0) {
        var A = Object.keys(S), B;
        for (T = 0; T < A.length; ++T) B = A[T], B !== "removeListener" && this.removeAllListeners(B);
        return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
      }
      if (x = S[C], typeof x == "function") this.removeListener(C, x);
      else if (x !== void 0) for (T = x.length - 1; T >= 0; T--) this.removeListener(C, x[T]);
      return this;
    };
    function f(k, C, x) {
      var S = k._events;
      if (S === void 0) return [];
      var T = S[C];
      return T === void 0 ? [] : typeof T == "function" ? x ? [
        T.listener || T
      ] : [
        T
      ] : x ? y(T) : m(T, T.length);
    }
    a.prototype.listeners = function(C) {
      return f(this, C, true);
    }, a.prototype.rawListeners = function(C) {
      return f(this, C, false);
    }, a.listenerCount = function(k, C) {
      return typeof k.listenerCount == "function" ? k.listenerCount(C) : g.call(k, C);
    }, a.prototype.listenerCount = g;
    function g(k) {
      var C = this._events;
      if (C !== void 0) {
        var x = C[k];
        if (typeof x == "function") return 1;
        if (x !== void 0) return x.length;
      }
      return 0;
    }
    a.prototype.eventNames = function() {
      return this._eventsCount > 0 ? n(this._events) : [];
    };
    function m(k, C) {
      for (var x = new Array(C), S = 0; S < C; ++S) x[S] = k[S];
      return x;
    }
    function v(k, C) {
      for (; C + 1 < k.length; C++) k[C] = k[C + 1];
      k.pop();
    }
    function y(k) {
      for (var C = new Array(k.length), x = 0; x < C.length; ++x) C[x] = k[x].listener || k[x];
      return C;
    }
    function w(k, C) {
      return new Promise(function(x, S) {
        function T(B) {
          k.removeListener(C, A), S(B);
        }
        function A() {
          typeof k.removeListener == "function" && k.removeListener("error", T), x([].slice.call(arguments));
        }
        j(k, C, A, {
          once: true
        }), C !== "error" && b(k, T, {
          once: true
        });
      });
    }
    function b(k, C, x) {
      typeof k.on == "function" && j(k, "error", C, x);
    }
    function j(k, C, x, S) {
      if (typeof k.on == "function") S.once ? k.once(C, x) : k.on(C, x);
      else if (typeof k.addEventListener == "function") k.addEventListener(C, function T(A) {
        S.once && k.removeEventListener(C, T), x(A);
      });
      else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof k);
    }
    return $x.exports;
  }
  var g3e = nk(), Kte = (function(t) {
    return t.NewListener = "newListener", t.RemoveListener = "removeListener", t.Error = "error", t;
  })({});
  ji = class extends g3e.EventEmitter {
    addListener(e, n) {
      return super.addListener(e, n);
    }
    emit(e) {
      for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
      return super.emit(e, ...r);
    }
    emitPromised(e) {
      var n = arguments, r = this;
      return me(function* () {
        for (var i = n.length, a = new Array(i > 1 ? i - 1 : 0), s = 1; s < i; s++) a[s - 1] = n[s];
        var l = r.listeners(e);
        return Promise.allSettled(l.map((c) => c(...a))).then(() => l.length > 0);
      })();
    }
    listenerCount(e) {
      return super.listenerCount(e);
    }
    listeners(e) {
      return super.listeners(e);
    }
    off(e, n) {
      return super.off(e, n);
    }
    on(e, n) {
      return super.on(e, n);
    }
    once(e, n) {
      return super.once(e, n);
    }
    prependListener(e, n) {
      return super.prependListener(e, n);
    }
    prependOnceListener(e, n) {
      return super.prependOnceListener(e, n);
    }
    removeAllListeners(e) {
      return e === void 0 ? super.removeAllListeners() : super.removeAllListeners(e);
    }
    removeListener(e, n) {
      return super.removeListener(e, n);
    }
    rawListeners(e) {
      return super.rawListeners(e);
    }
  };
  var Vo = (function(t) {
    return t.DisplayName = "User.displayName", t.AvatarUrl = "User.avatarUrl", t.Presence = "User.presence", t.CurrentlyActive = "User.currentlyActive", t.LastPresenceTs = "User.lastPresenceTs", t;
  })({});
  class Md extends ji {
    constructor(e) {
      super(), this.userId = e, $(this, "modified", -1), $(this, "displayName", void 0), $(this, "rawDisplayName", void 0), $(this, "avatarUrl", void 0), $(this, "presenceStatusMsg", void 0), $(this, "presence", "offline"), $(this, "lastActiveAgo", 0), $(this, "lastPresenceTs", 0), $(this, "currentlyActive", false), $(this, "events", {}), this.displayName = e, this.rawDisplayName = e, this.updateModifiedTime();
    }
    static createUser(e, n) {
      var r = new Md(e);
      return n.reEmitter.reEmit(r, [
        Vo.AvatarUrl,
        Vo.DisplayName,
        Vo.Presence,
        Vo.CurrentlyActive,
        Vo.LastPresenceTs
      ]), r;
    }
    setPresenceEvent(e) {
      if (e.getType() === "m.presence") {
        var n = this.events.presence === null;
        this.events.presence = e;
        var r = [];
        (e.getContent().presence !== this.presence || n) && r.push(Vo.Presence), e.getContent().avatar_url && e.getContent().avatar_url !== this.avatarUrl && r.push(Vo.AvatarUrl), e.getContent().displayname && e.getContent().displayname !== this.displayName && r.push(Vo.DisplayName), e.getContent().currently_active !== void 0 && e.getContent().currently_active !== this.currentlyActive && r.push(Vo.CurrentlyActive), this.presence = e.getContent().presence, r.push(Vo.LastPresenceTs), e.getContent().status_msg && (this.presenceStatusMsg = e.getContent().status_msg), e.getContent().displayname && (this.displayName = e.getContent().displayname), e.getContent().avatar_url && (this.avatarUrl = e.getContent().avatar_url), this.lastActiveAgo = e.getContent().last_active_ago, this.lastPresenceTs = Date.now(), this.currentlyActive = e.getContent().currently_active, this.updateModifiedTime();
        for (var i of r) this.emit(i, e, this);
      }
    }
    setDisplayName(e) {
      var n = this.displayName;
      this.displayName = e, e !== n && this.updateModifiedTime();
    }
    setRawDisplayName(e) {
      this.rawDisplayName = e;
    }
    setAvatarUrl(e) {
      var n = this.avatarUrl;
      this.avatarUrl = e, e !== n && this.updateModifiedTime();
    }
    updateModifiedTime() {
      this.modified = Date.now();
    }
    getLastModifiedTime() {
      return this.modified;
    }
    getLastActiveTs() {
      return this.lastPresenceTs - this.lastActiveAgo;
    }
  }
  var Vj = {}, t_ = {}, n_ = {}, bV;
  function Gte() {
    if (bV) return n_;
    bV = 1, Object.defineProperty(n_, "__esModule", {
      value: true
    }), n_.NamespacedMap = void 0;
    function t(c, d) {
      var u = typeof Symbol < "u" && c[Symbol.iterator] || c["@@iterator"];
      if (!u) {
        if (Array.isArray(c) || (u = e(c)) || d) {
          u && (c = u);
          var h = 0, f = function() {
          };
          return {
            s: f,
            n: function() {
              return h >= c.length ? {
                done: true
              } : {
                done: false,
                value: c[h++]
              };
            },
            e: function(w) {
              throw w;
            },
            f
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var g = true, m = false, v;
      return {
        s: function() {
          u = u.call(c);
        },
        n: function() {
          var w = u.next();
          return g = w.done, w;
        },
        e: function(w) {
          m = true, v = w;
        },
        f: function() {
          try {
            !g && u.return != null && u.return();
          } finally {
            if (m) throw v;
          }
        }
      };
    }
    function e(c, d) {
      if (c) {
        if (typeof c == "string") return n(c, d);
        var u = Object.prototype.toString.call(c).slice(8, -1);
        if (u === "Object" && c.constructor && (u = c.constructor.name), u === "Map" || u === "Set") return Array.from(c);
        if (u === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)) return n(c, d);
      }
    }
    function n(c, d) {
      (d == null || d > c.length) && (d = c.length);
      for (var u = 0, h = new Array(d); u < d; u++) h[u] = c[u];
      return h;
    }
    function r(c, d) {
      if (!(c instanceof d)) throw new TypeError("Cannot call a class as a function");
    }
    function i(c, d) {
      for (var u = 0; u < d.length; u++) {
        var h = d[u];
        h.enumerable = h.enumerable || false, h.configurable = true, "value" in h && (h.writable = true), Object.defineProperty(c, h.key, h);
      }
    }
    function a(c, d, u) {
      return d && i(c.prototype, d), Object.defineProperty(c, "prototype", {
        writable: false
      }), c;
    }
    function s(c, d, u) {
      return d in c ? Object.defineProperty(c, d, {
        value: u,
        enumerable: true,
        configurable: true,
        writable: true
      }) : c[d] = u, c;
    }
    var l = (function() {
      function c(d) {
        if (r(this, c), s(this, "internalMap", /* @__PURE__ */ new Map()), d) {
          var u = t(d), h;
          try {
            for (u.s(); !(h = u.n()).done; ) {
              var f = h.value;
              this.set(f[0], f[1]);
            }
          } catch (g) {
            u.e(g);
          } finally {
            u.f();
          }
        }
      }
      return a(c, [
        {
          key: "get",
          value: function(u) {
            return u.name && this.internalMap.has(u.name) ? this.internalMap.get(u.name) : u.altName && this.internalMap.has(u.altName) ? this.internalMap.get(u.altName) : null;
          }
        },
        {
          key: "set",
          value: function(u, h) {
            u.name && this.internalMap.set(u.name, h), u.altName && this.internalMap.set(u.altName, h);
          }
        },
        {
          key: "has",
          value: function(u) {
            return !!this.get(u);
          }
        },
        {
          key: "delete",
          value: function(u) {
            u.name && this.internalMap.delete(u.name), u.altName && this.internalMap.delete(u.altName);
          }
        },
        {
          key: "hasNamespaced",
          value: function(u) {
            return this.internalMap.has(u);
          }
        },
        {
          key: "getNamespaced",
          value: function(u) {
            return this.internalMap.get(u);
          }
        }
      ]), c;
    })();
    return n_.NamespacedMap = l, n_;
  }
  var r_ = {}, xV;
  function TF() {
    if (xV) return r_;
    xV = 1;
    function t(m) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
        return typeof v;
      } : function(v) {
        return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
      }, t(m);
    }
    Object.defineProperty(r_, "__esModule", {
      value: true
    }), r_.InvalidEventError = void 0;
    function e(m, v, y) {
      return Object.defineProperty(m, "prototype", {
        writable: false
      }), m;
    }
    function n(m, v) {
      if (!(m instanceof v)) throw new TypeError("Cannot call a class as a function");
    }
    function r(m, v) {
      if (typeof v != "function" && v !== null) throw new TypeError("Super expression must either be null or a function");
      m.prototype = Object.create(v && v.prototype, {
        constructor: {
          value: m,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(m, "prototype", {
        writable: false
      }), v && h(m, v);
    }
    function i(m) {
      var v = d();
      return function() {
        var w = f(m), b;
        if (v) {
          var j = f(this).constructor;
          b = Reflect.construct(w, arguments, j);
        } else b = w.apply(this, arguments);
        return a(this, b);
      };
    }
    function a(m, v) {
      if (v && (t(v) === "object" || typeof v == "function")) return v;
      if (v !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return s(m);
    }
    function s(m) {
      if (m === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return m;
    }
    function l(m) {
      var v = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
      return l = function(w) {
        if (w === null || !u(w)) return w;
        if (typeof w != "function") throw new TypeError("Super expression must either be null or a function");
        if (typeof v < "u") {
          if (v.has(w)) return v.get(w);
          v.set(w, b);
        }
        function b() {
          return c(w, arguments, f(this).constructor);
        }
        return b.prototype = Object.create(w.prototype, {
          constructor: {
            value: b,
            enumerable: false,
            writable: true,
            configurable: true
          }
        }), h(b, w);
      }, l(m);
    }
    function c(m, v, y) {
      return d() ? c = Reflect.construct : c = function(b, j, k) {
        var C = [
          null
        ];
        C.push.apply(C, j);
        var x = Function.bind.apply(b, C), S = new x();
        return k && h(S, k.prototype), S;
      }, c.apply(null, arguments);
    }
    function d() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function u(m) {
      return Function.toString.call(m).indexOf("[native code]") !== -1;
    }
    function h(m, v) {
      return h = Object.setPrototypeOf || function(w, b) {
        return w.__proto__ = b, w;
      }, h(m, v);
    }
    function f(m) {
      return f = Object.setPrototypeOf ? Object.getPrototypeOf : function(y) {
        return y.__proto__ || Object.getPrototypeOf(y);
      }, f(m);
    }
    var g = (function(m) {
      r(y, m);
      var v = i(y);
      function y(w) {
        return n(this, y), v.call(this, w);
      }
      return e(y);
    })(l(Error));
    return r_.InvalidEventError = g, r_;
  }
  var s0 = {}, i_ = {}, o_ = {}, wV;
  function Hb() {
    if (wV) return o_;
    wV = 1, Object.defineProperty(o_, "__esModule", {
      value: true
    }), o_.ExtensibleEvent = void 0;
    function t(i, a) {
      if (!(i instanceof a)) throw new TypeError("Cannot call a class as a function");
    }
    function e(i, a) {
      for (var s = 0; s < a.length; s++) {
        var l = a[s];
        l.enumerable = l.enumerable || false, l.configurable = true, "value" in l && (l.writable = true), Object.defineProperty(i, l.key, l);
      }
    }
    function n(i, a, s) {
      return a && e(i.prototype, a), Object.defineProperty(i, "prototype", {
        writable: false
      }), i;
    }
    var r = (function() {
      function i(a) {
        t(this, i), this.wireFormat = a;
      }
      return n(i, [
        {
          key: "wireContent",
          get: function() {
            return this.wireFormat.content;
          }
        }
      ]), i;
    })();
    return o_.ExtensibleEvent = r, o_;
  }
  var a_ = {}, DV;
  function Yte() {
    if (DV) return a_;
    DV = 1, Object.defineProperty(a_, "__esModule", {
      value: true
    }), a_.isOptionalAString = t, a_.isProvided = e;
    function t(n) {
      return e(n) && typeof n == "string";
    }
    function e(n) {
      return n != null;
    }
    return a_;
  }
  var Hs = {}, wm = {}, CV;
  function RF() {
    if (CV) return wm;
    CV = 1;
    function t(g) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) {
        return typeof m;
      } : function(m) {
        return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m;
      }, t(g);
    }
    Object.defineProperty(wm, "__esModule", {
      value: true
    }), wm.UnstableValue = wm.NamespacedValue = void 0;
    function e(g, m) {
      if (typeof m != "function" && m !== null) throw new TypeError("Super expression must either be null or a function");
      g.prototype = Object.create(m && m.prototype, {
        constructor: {
          value: g,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(g, "prototype", {
        writable: false
      }), m && n(g, m);
    }
    function n(g, m) {
      return n = Object.setPrototypeOf || function(y, w) {
        return y.__proto__ = w, y;
      }, n(g, m);
    }
    function r(g) {
      var m = s();
      return function() {
        var y = l(g), w;
        if (m) {
          var b = l(this).constructor;
          w = Reflect.construct(y, arguments, b);
        } else w = y.apply(this, arguments);
        return i(this, w);
      };
    }
    function i(g, m) {
      if (m && (t(m) === "object" || typeof m == "function")) return m;
      if (m !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return a(g);
    }
    function a(g) {
      if (g === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return g;
    }
    function s() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function l(g) {
      return l = Object.setPrototypeOf ? Object.getPrototypeOf : function(v) {
        return v.__proto__ || Object.getPrototypeOf(v);
      }, l(g);
    }
    function c(g, m) {
      if (!(g instanceof m)) throw new TypeError("Cannot call a class as a function");
    }
    function d(g, m) {
      for (var v = 0; v < m.length; v++) {
        var y = m[v];
        y.enumerable = y.enumerable || false, y.configurable = true, "value" in y && (y.writable = true), Object.defineProperty(g, y.key, y);
      }
    }
    function u(g, m, v) {
      return m && d(g.prototype, m), Object.defineProperty(g, "prototype", {
        writable: false
      }), g;
    }
    var h = (function() {
      function g(m, v) {
        if (c(this, g), this.stable = m, this.unstable = v, !this.unstable && !this.stable) throw new Error("One of stable or unstable values must be supplied");
      }
      return u(g, [
        {
          key: "name",
          get: function() {
            return this.stable ? this.stable : this.unstable;
          }
        },
        {
          key: "altName",
          get: function() {
            return this.stable ? this.unstable : null;
          }
        },
        {
          key: "matches",
          value: function(v) {
            return !!this.name && this.name === v || !!this.altName && this.altName === v;
          }
        },
        {
          key: "findIn",
          value: function(v) {
            var y;
            return this.name && (y = v == null ? void 0 : v[this.name]), !y && this.altName && (y = v == null ? void 0 : v[this.altName]), y;
          }
        },
        {
          key: "includedIn",
          value: function(v) {
            var y = false;
            return this.name && (y = v.includes(this.name)), !y && this.altName && (y = v.includes(this.altName)), y;
          }
        }
      ]), g;
    })();
    wm.NamespacedValue = h;
    var f = (function(g) {
      e(v, g);
      var m = r(v);
      function v(y, w) {
        var b;
        if (c(this, v), b = m.call(this, y, w), !b.unstable) throw new Error("Unstable value must be supplied");
        return b;
      }
      return u(v, [
        {
          key: "name",
          get: function() {
            return this.unstable;
          }
        },
        {
          key: "altName",
          get: function() {
            return this.stable;
          }
        }
      ]), v;
    })(h);
    return wm.UnstableValue = f, wm;
  }
  var EV;
  function Kd() {
    if (EV) return Hs;
    EV = 1, Object.defineProperty(Hs, "__esModule", {
      value: true
    }), Hs.M_TEXT = Hs.M_NOTICE = Hs.M_MESSAGE = Hs.M_HTML = Hs.M_EMOTE = void 0;
    var t = RF(), e = new t.UnstableValue("m.message", "org.matrix.msc1767.message");
    Hs.M_MESSAGE = e;
    var n = new t.UnstableValue("m.text", "org.matrix.msc1767.text");
    Hs.M_TEXT = n;
    var r = new t.UnstableValue("m.html", "org.matrix.msc1767.html");
    Hs.M_HTML = r;
    var i = new t.UnstableValue("m.emote", "org.matrix.msc1767.emote");
    Hs.M_EMOTE = i;
    var a = new t.UnstableValue("m.notice", "org.matrix.msc1767.notice");
    return Hs.M_NOTICE = a, Hs;
  }
  var Wx = {}, kV;
  function pp() {
    if (kV) return Wx;
    kV = 1, Object.defineProperty(Wx, "__esModule", {
      value: true
    }), Wx.isEventTypeSame = t;
    function t(e, n) {
      if (typeof e == "string") return typeof n == "string" ? n === e : n.matches(e);
      if (typeof n == "string") return e.matches(n);
      var r = n, i = e;
      return r.matches(i.name) || r.matches(i.altName);
    }
    return Wx;
  }
  var SV;
  function Fp() {
    if (SV) return i_;
    SV = 1;
    function t(k) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(C) {
        return typeof C;
      } : function(C) {
        return C && typeof Symbol == "function" && C.constructor === Symbol && C !== Symbol.prototype ? "symbol" : typeof C;
      }, t(k);
    }
    Object.defineProperty(i_, "__esModule", {
      value: true
    }), i_.MessageEvent = void 0;
    var e = Hb(), n = Yte(), r = TF(), i = Kd(), a = pp();
    function s(k, C) {
      var x = Object.keys(k);
      if (Object.getOwnPropertySymbols) {
        var S = Object.getOwnPropertySymbols(k);
        C && (S = S.filter(function(T) {
          return Object.getOwnPropertyDescriptor(k, T).enumerable;
        })), x.push.apply(x, S);
      }
      return x;
    }
    function l(k) {
      for (var C = 1; C < arguments.length; C++) {
        var x = arguments[C] != null ? arguments[C] : {};
        C % 2 ? s(Object(x), true).forEach(function(S) {
          b(k, S, x[S]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(k, Object.getOwnPropertyDescriptors(x)) : s(Object(x)).forEach(function(S) {
          Object.defineProperty(k, S, Object.getOwnPropertyDescriptor(x, S));
        });
      }
      return k;
    }
    function c(k, C) {
      if (!(k instanceof C)) throw new TypeError("Cannot call a class as a function");
    }
    function d(k, C) {
      for (var x = 0; x < C.length; x++) {
        var S = C[x];
        S.enumerable = S.enumerable || false, S.configurable = true, "value" in S && (S.writable = true), Object.defineProperty(k, S.key, S);
      }
    }
    function u(k, C, x) {
      return C && d(k.prototype, C), x && d(k, x), Object.defineProperty(k, "prototype", {
        writable: false
      }), k;
    }
    function h(k, C) {
      if (typeof C != "function" && C !== null) throw new TypeError("Super expression must either be null or a function");
      k.prototype = Object.create(C && C.prototype, {
        constructor: {
          value: k,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(k, "prototype", {
        writable: false
      }), C && f(k, C);
    }
    function f(k, C) {
      return f = Object.setPrototypeOf || function(S, T) {
        return S.__proto__ = T, S;
      }, f(k, C);
    }
    function g(k) {
      var C = y();
      return function() {
        var S = w(k), T;
        if (C) {
          var A = w(this).constructor;
          T = Reflect.construct(S, arguments, A);
        } else T = S.apply(this, arguments);
        return m(this, T);
      };
    }
    function m(k, C) {
      if (C && (t(C) === "object" || typeof C == "function")) return C;
      if (C !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return v(k);
    }
    function v(k) {
      if (k === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return k;
    }
    function y() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function w(k) {
      return w = Object.setPrototypeOf ? Object.getPrototypeOf : function(x) {
        return x.__proto__ || Object.getPrototypeOf(x);
      }, w(k);
    }
    function b(k, C, x) {
      return C in k ? Object.defineProperty(k, C, {
        value: x,
        enumerable: true,
        configurable: true,
        writable: true
      }) : k[C] = x, k;
    }
    var j = (function(k) {
      h(x, k);
      var C = g(x);
      function x(S) {
        var T;
        c(this, x), T = C.call(this, S), b(v(T), "text", void 0), b(v(T), "html", void 0), b(v(T), "renderings", void 0);
        var A = i.M_MESSAGE.findIn(T.wireContent), B = i.M_TEXT.findIn(T.wireContent), U = i.M_HTML.findIn(T.wireContent);
        if ((0, n.isProvided)(A)) {
          if (!Array.isArray(A)) throw new r.InvalidEventError("m.message contents must be an array");
          var z = A.find(function(M) {
            return !(0, n.isProvided)(M.mimetype) || M.mimetype === "text/plain";
          }), O = A.find(function(M) {
            return M.mimetype === "text/html";
          });
          if (!z) throw new r.InvalidEventError("m.message is missing a plain text representation");
          T.text = z.body, T.html = O == null ? void 0 : O.body, T.renderings = A;
        } else if ((0, n.isOptionalAString)(B)) T.text = B, T.html = U, T.renderings = [
          {
            body: B,
            mimetype: "text/plain"
          }
        ], T.html && T.renderings.push({
          body: T.html,
          mimetype: "text/html"
        });
        else throw new r.InvalidEventError("Missing textual representation for event");
        return T;
      }
      return u(x, [
        {
          key: "isEmote",
          get: function() {
            return i.M_EMOTE.matches(this.wireFormat.type) || (0, n.isProvided)(i.M_EMOTE.findIn(this.wireFormat.content));
          }
        },
        {
          key: "isNotice",
          get: function() {
            return i.M_NOTICE.matches(this.wireFormat.type) || (0, n.isProvided)(i.M_NOTICE.findIn(this.wireFormat.content));
          }
        },
        {
          key: "isEquivalentTo",
          value: function(T) {
            return (0, a.isEventTypeSame)(T, i.M_MESSAGE);
          }
        },
        {
          key: "serializeMMessageOnly",
          value: function() {
            var T = b({}, i.M_MESSAGE.name, this.renderings);
            if (this.renderings.length === 1) {
              var A = this.renderings[0].mimetype;
              (A === void 0 || A === "text/plain") && (T = b({}, i.M_TEXT.name, this.renderings[0].body));
            }
            return T;
          }
        },
        {
          key: "serialize",
          value: function() {
            var T;
            return {
              type: "m.room.message",
              content: l(l({}, this.serializeMMessageOnly()), {}, {
                body: this.text,
                msgtype: "m.text",
                format: this.html ? "org.matrix.custom.html" : void 0,
                formatted_body: (T = this.html) !== null && T !== void 0 ? T : void 0
              })
            };
          }
        }
      ], [
        {
          key: "from",
          value: function(T, A) {
            var B;
            return new x({
              type: i.M_MESSAGE.name,
              content: (B = {}, b(B, i.M_TEXT.name, T), b(B, i.M_HTML.name, A), B)
            });
          }
        }
      ]), x;
    })(e.ExtensibleEvent);
    return i_.MessageEvent = j, i_;
  }
  var s_ = {}, jV;
  function U7() {
    if (jV) return s_;
    jV = 1;
    function t(b) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(j) {
        return typeof j;
      } : function(j) {
        return j && typeof Symbol == "function" && j.constructor === Symbol && j !== Symbol.prototype ? "symbol" : typeof j;
      }, t(b);
    }
    Object.defineProperty(s_, "__esModule", {
      value: true
    }), s_.NoticeEvent = void 0;
    var e = Fp(), n = Kd(), r = pp();
    function i(b, j, k) {
      return j in b ? Object.defineProperty(b, j, {
        value: k,
        enumerable: true,
        configurable: true,
        writable: true
      }) : b[j] = k, b;
    }
    function a(b, j) {
      if (!(b instanceof j)) throw new TypeError("Cannot call a class as a function");
    }
    function s(b, j) {
      for (var k = 0; k < j.length; k++) {
        var C = j[k];
        C.enumerable = C.enumerable || false, C.configurable = true, "value" in C && (C.writable = true), Object.defineProperty(b, C.key, C);
      }
    }
    function l(b, j, k) {
      return j && s(b.prototype, j), k && s(b, k), Object.defineProperty(b, "prototype", {
        writable: false
      }), b;
    }
    function c() {
      return typeof Reflect < "u" && Reflect.get ? c = Reflect.get : c = function(j, k, C) {
        var x = d(j, k);
        if (x) {
          var S = Object.getOwnPropertyDescriptor(x, k);
          return S.get ? S.get.call(arguments.length < 3 ? j : C) : S.value;
        }
      }, c.apply(this, arguments);
    }
    function d(b, j) {
      for (; !Object.prototype.hasOwnProperty.call(b, j) && (b = y(b), b !== null); ) ;
      return b;
    }
    function u(b, j) {
      if (typeof j != "function" && j !== null) throw new TypeError("Super expression must either be null or a function");
      b.prototype = Object.create(j && j.prototype, {
        constructor: {
          value: b,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(b, "prototype", {
        writable: false
      }), j && h(b, j);
    }
    function h(b, j) {
      return h = Object.setPrototypeOf || function(C, x) {
        return C.__proto__ = x, C;
      }, h(b, j);
    }
    function f(b) {
      var j = v();
      return function() {
        var C = y(b), x;
        if (j) {
          var S = y(this).constructor;
          x = Reflect.construct(C, arguments, S);
        } else x = C.apply(this, arguments);
        return g(this, x);
      };
    }
    function g(b, j) {
      if (j && (t(j) === "object" || typeof j == "function")) return j;
      if (j !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return m(b);
    }
    function m(b) {
      if (b === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return b;
    }
    function v() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function y(b) {
      return y = Object.setPrototypeOf ? Object.getPrototypeOf : function(k) {
        return k.__proto__ || Object.getPrototypeOf(k);
      }, y(b);
    }
    var w = (function(b) {
      u(k, b);
      var j = f(k);
      function k(C) {
        return a(this, k), j.call(this, C);
      }
      return l(k, [
        {
          key: "isNotice",
          get: function() {
            return true;
          }
        },
        {
          key: "isEquivalentTo",
          value: function(x) {
            return (0, r.isEventTypeSame)(x, n.M_NOTICE) || c(y(k.prototype), "isEquivalentTo", this).call(this, x);
          }
        },
        {
          key: "serialize",
          value: function() {
            var x = c(y(k.prototype), "serialize", this).call(this);
            return x.content.msgtype = "m.notice", x;
          }
        }
      ], [
        {
          key: "from",
          value: function(x, S) {
            var T;
            return new k({
              type: n.M_NOTICE.name,
              content: (T = {}, i(T, n.M_TEXT.name, x), i(T, n.M_HTML.name, S), T)
            });
          }
        }
      ]), k;
    })(e.MessageEvent);
    return s_.NoticeEvent = w, s_;
  }
  var l_ = {}, TV;
  function V7() {
    if (TV) return l_;
    TV = 1;
    function t(b) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(j) {
        return typeof j;
      } : function(j) {
        return j && typeof Symbol == "function" && j.constructor === Symbol && j !== Symbol.prototype ? "symbol" : typeof j;
      }, t(b);
    }
    Object.defineProperty(l_, "__esModule", {
      value: true
    }), l_.EmoteEvent = void 0;
    var e = Fp(), n = Kd(), r = pp();
    function i(b, j, k) {
      return j in b ? Object.defineProperty(b, j, {
        value: k,
        enumerable: true,
        configurable: true,
        writable: true
      }) : b[j] = k, b;
    }
    function a(b, j) {
      if (!(b instanceof j)) throw new TypeError("Cannot call a class as a function");
    }
    function s(b, j) {
      for (var k = 0; k < j.length; k++) {
        var C = j[k];
        C.enumerable = C.enumerable || false, C.configurable = true, "value" in C && (C.writable = true), Object.defineProperty(b, C.key, C);
      }
    }
    function l(b, j, k) {
      return j && s(b.prototype, j), k && s(b, k), Object.defineProperty(b, "prototype", {
        writable: false
      }), b;
    }
    function c() {
      return typeof Reflect < "u" && Reflect.get ? c = Reflect.get : c = function(j, k, C) {
        var x = d(j, k);
        if (x) {
          var S = Object.getOwnPropertyDescriptor(x, k);
          return S.get ? S.get.call(arguments.length < 3 ? j : C) : S.value;
        }
      }, c.apply(this, arguments);
    }
    function d(b, j) {
      for (; !Object.prototype.hasOwnProperty.call(b, j) && (b = y(b), b !== null); ) ;
      return b;
    }
    function u(b, j) {
      if (typeof j != "function" && j !== null) throw new TypeError("Super expression must either be null or a function");
      b.prototype = Object.create(j && j.prototype, {
        constructor: {
          value: b,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(b, "prototype", {
        writable: false
      }), j && h(b, j);
    }
    function h(b, j) {
      return h = Object.setPrototypeOf || function(C, x) {
        return C.__proto__ = x, C;
      }, h(b, j);
    }
    function f(b) {
      var j = v();
      return function() {
        var C = y(b), x;
        if (j) {
          var S = y(this).constructor;
          x = Reflect.construct(C, arguments, S);
        } else x = C.apply(this, arguments);
        return g(this, x);
      };
    }
    function g(b, j) {
      if (j && (t(j) === "object" || typeof j == "function")) return j;
      if (j !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return m(b);
    }
    function m(b) {
      if (b === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return b;
    }
    function v() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function y(b) {
      return y = Object.setPrototypeOf ? Object.getPrototypeOf : function(k) {
        return k.__proto__ || Object.getPrototypeOf(k);
      }, y(b);
    }
    var w = (function(b) {
      u(k, b);
      var j = f(k);
      function k(C) {
        return a(this, k), j.call(this, C);
      }
      return l(k, [
        {
          key: "isEmote",
          get: function() {
            return true;
          }
        },
        {
          key: "isEquivalentTo",
          value: function(x) {
            return (0, r.isEventTypeSame)(x, n.M_EMOTE) || c(y(k.prototype), "isEquivalentTo", this).call(this, x);
          }
        },
        {
          key: "serialize",
          value: function() {
            var x = c(y(k.prototype), "serialize", this).call(this);
            return x.content.msgtype = "m.emote", x;
          }
        }
      ], [
        {
          key: "from",
          value: function(x, S) {
            var T;
            return new k({
              type: n.M_EMOTE.name,
              content: (T = {}, i(T, n.M_TEXT.name, x), i(T, n.M_HTML.name, S), T)
            });
          }
        }
      ]), k;
    })(e.MessageEvent);
    return l_.EmoteEvent = w, l_;
  }
  var RV;
  function Zte() {
    if (RV) return s0;
    RV = 1, Object.defineProperty(s0, "__esModule", {
      value: true
    }), s0.LEGACY_M_ROOM_MESSAGE = void 0, s0.parseMRoomMessage = d;
    var t = Fp(), e = U7(), n = V7(), r = RF(), i = Kd();
    function a(u, h) {
      var f = Object.keys(u);
      if (Object.getOwnPropertySymbols) {
        var g = Object.getOwnPropertySymbols(u);
        h && (g = g.filter(function(m) {
          return Object.getOwnPropertyDescriptor(u, m).enumerable;
        })), f.push.apply(f, g);
      }
      return f;
    }
    function s(u) {
      for (var h = 1; h < arguments.length; h++) {
        var f = arguments[h] != null ? arguments[h] : {};
        h % 2 ? a(Object(f), true).forEach(function(g) {
          l(u, g, f[g]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(u, Object.getOwnPropertyDescriptors(f)) : a(Object(f)).forEach(function(g) {
          Object.defineProperty(u, g, Object.getOwnPropertyDescriptor(f, g));
        });
      }
      return u;
    }
    function l(u, h, f) {
      return h in u ? Object.defineProperty(u, h, {
        value: f,
        enumerable: true,
        configurable: true,
        writable: true
      }) : u[h] = f, u;
    }
    var c = new r.NamespacedValue("m.room.message");
    s0.LEGACY_M_ROOM_MESSAGE = c;
    function d(u) {
      var h, f, g;
      if (i.M_MESSAGE.findIn(u.content) || i.M_TEXT.findIn(u.content)) return new t.MessageEvent(u);
      var m = (h = u.content) === null || h === void 0 ? void 0 : h.msgtype, v = (f = u.content) === null || f === void 0 ? void 0 : f.body, y = ((g = u.content) === null || g === void 0 ? void 0 : g.format) === "org.matrix.custom.html" ? u.content.formatted_body : null;
      if (m === "m.text") {
        var w;
        return new t.MessageEvent(s(s({}, u), {}, {
          content: s(s({}, u.content), {}, (w = {}, l(w, i.M_TEXT.name, v), l(w, i.M_HTML.name, y), w))
        }));
      } else if (m === "m.notice") {
        var b;
        return new e.NoticeEvent(s(s({}, u), {}, {
          content: s(s({}, u.content), {}, (b = {}, l(b, i.M_TEXT.name, v), l(b, i.M_HTML.name, y), b))
        }));
      } else if (m === "m.emote") {
        var j;
        return new n.EmoteEvent(s(s({}, u), {}, {
          content: s(s({}, u.content), {}, (j = {}, l(j, i.M_TEXT.name, v), l(j, i.M_HTML.name, y), j))
        }));
      } else return null;
    }
    return s0;
  }
  var qx = {}, AV;
  function Jte() {
    if (AV) return qx;
    AV = 1, Object.defineProperty(qx, "__esModule", {
      value: true
    }), qx.parseMMessage = i;
    var t = Fp(), e = Kd(), n = V7(), r = U7();
    function i(a) {
      return e.M_EMOTE.matches(a.type) ? new n.EmoteEvent(a) : e.M_NOTICE.matches(a.type) ? new r.NoticeEvent(a) : new t.MessageEvent(a);
    }
    return qx;
  }
  var $s = {}, IV;
  function AF() {
    if (IV) return $s;
    IV = 1, Object.defineProperty($s, "__esModule", {
      value: true
    }), $s.M_POLL_START = $s.M_POLL_RESPONSE = $s.M_POLL_KIND_UNDISCLOSED = $s.M_POLL_KIND_DISCLOSED = $s.M_POLL_END = void 0;
    var t = RF(), e = new t.UnstableValue("m.poll.disclosed", "org.matrix.msc3381.poll.disclosed");
    $s.M_POLL_KIND_DISCLOSED = e;
    var n = new t.UnstableValue("m.poll.undisclosed", "org.matrix.msc3381.poll.undisclosed");
    $s.M_POLL_KIND_UNDISCLOSED = n;
    var r = new t.UnstableValue("m.poll.start", "org.matrix.msc3381.poll.start");
    $s.M_POLL_START = r;
    var i = new t.UnstableValue("m.poll.response", "org.matrix.msc3381.poll.response");
    $s.M_POLL_RESPONSE = i;
    var a = new t.UnstableValue("m.poll.end", "org.matrix.msc3381.poll.end");
    return $s.M_POLL_END = a, $s;
  }
  var Kx = {}, Dm = {}, BV;
  function Xte() {
    if (BV) return Dm;
    BV = 1;
    function t(I) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(N) {
        return typeof N;
      } : function(N) {
        return N && typeof Symbol == "function" && N.constructor === Symbol && N !== Symbol.prototype ? "symbol" : typeof N;
      }, t(I);
    }
    Object.defineProperty(Dm, "__esModule", {
      value: true
    }), Dm.PollStartEvent = Dm.PollAnswerSubevent = void 0;
    var e = AF(), n = Fp(), r = Kd(), i = TF(), a = RF(), s = pp(), l = Hb();
    function c(I) {
      return f(I) || h(I) || u(I) || d();
    }
    function d() {
      throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
    }
    function u(I, N) {
      if (I) {
        if (typeof I == "string") return g(I, N);
        var L = Object.prototype.toString.call(I).slice(8, -1);
        if (L === "Object" && I.constructor && (L = I.constructor.name), L === "Map" || L === "Set") return Array.from(I);
        if (L === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)) return g(I, N);
      }
    }
    function h(I) {
      if (typeof Symbol < "u" && I[Symbol.iterator] != null || I["@@iterator"] != null) return Array.from(I);
    }
    function f(I) {
      if (Array.isArray(I)) return g(I);
    }
    function g(I, N) {
      (N == null || N > I.length) && (N = I.length);
      for (var L = 0, H = new Array(N); L < N; L++) H[L] = I[L];
      return H;
    }
    function m(I, N) {
      var L = Object.keys(I);
      if (Object.getOwnPropertySymbols) {
        var H = Object.getOwnPropertySymbols(I);
        N && (H = H.filter(function(V) {
          return Object.getOwnPropertyDescriptor(I, V).enumerable;
        })), L.push.apply(L, H);
      }
      return L;
    }
    function v(I) {
      for (var N = 1; N < arguments.length; N++) {
        var L = arguments[N] != null ? arguments[N] : {};
        N % 2 ? m(Object(L), true).forEach(function(H) {
          B(I, H, L[H]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(I, Object.getOwnPropertyDescriptors(L)) : m(Object(L)).forEach(function(H) {
          Object.defineProperty(I, H, Object.getOwnPropertyDescriptor(L, H));
        });
      }
      return I;
    }
    function y(I, N) {
      if (!(I instanceof N)) throw new TypeError("Cannot call a class as a function");
    }
    function w(I, N) {
      for (var L = 0; L < N.length; L++) {
        var H = N[L];
        H.enumerable = H.enumerable || false, H.configurable = true, "value" in H && (H.writable = true), Object.defineProperty(I, H.key, H);
      }
    }
    function b(I, N, L) {
      return N && w(I.prototype, N), L && w(I, L), Object.defineProperty(I, "prototype", {
        writable: false
      }), I;
    }
    function j(I, N) {
      if (typeof N != "function" && N !== null) throw new TypeError("Super expression must either be null or a function");
      I.prototype = Object.create(N && N.prototype, {
        constructor: {
          value: I,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(I, "prototype", {
        writable: false
      }), N && k(I, N);
    }
    function k(I, N) {
      return k = Object.setPrototypeOf || function(H, V) {
        return H.__proto__ = V, H;
      }, k(I, N);
    }
    function C(I) {
      var N = T();
      return function() {
        var H = A(I), V;
        if (N) {
          var Z = A(this).constructor;
          V = Reflect.construct(H, arguments, Z);
        } else V = H.apply(this, arguments);
        return x(this, V);
      };
    }
    function x(I, N) {
      if (N && (t(N) === "object" || typeof N == "function")) return N;
      if (N !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return S(I);
    }
    function S(I) {
      if (I === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return I;
    }
    function T() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function A(I) {
      return A = Object.setPrototypeOf ? Object.getPrototypeOf : function(L) {
        return L.__proto__ || Object.getPrototypeOf(L);
      }, A(I);
    }
    function B(I, N, L) {
      return N in I ? Object.defineProperty(I, N, {
        value: L,
        enumerable: true,
        configurable: true,
        writable: true
      }) : I[N] = L, I;
    }
    var U = (function(I) {
      j(L, I);
      var N = C(L);
      function L(H) {
        var V;
        y(this, L), V = N.call(this, H), B(S(V), "id", void 0);
        var Z = H.content.id;
        if (!Z || typeof Z != "string") throw new i.InvalidEventError("Answer ID must be a non-empty string");
        return V.id = Z, V;
      }
      return b(L, [
        {
          key: "serialize",
          value: function() {
            return {
              type: "org.matrix.sdk.poll.answer",
              content: v({
                id: this.id
              }, this.serializeMMessageOnly())
            };
          }
        }
      ], [
        {
          key: "from",
          value: function(V, Z) {
            return new L({
              type: "org.matrix.sdk.poll.answer",
              content: B({
                id: V
              }, r.M_TEXT.name, Z)
            });
          }
        }
      ]), L;
    })(n.MessageEvent);
    Dm.PollAnswerSubevent = U;
    var z = (function(I) {
      j(L, I);
      var N = C(L);
      function L(H) {
        var V;
        y(this, L), V = N.call(this, H), B(S(V), "question", void 0), B(S(V), "kind", void 0), B(S(V), "rawKind", void 0), B(S(V), "maxSelections", void 0), B(S(V), "answers", void 0);
        var Z = e.M_POLL_START.findIn(V.wireContent);
        if (!Z.question) throw new i.InvalidEventError("A question is required");
        if (V.question = new n.MessageEvent({
          type: "org.matrix.sdk.poll.question",
          content: Z.question
        }), V.rawKind = Z.kind, e.M_POLL_KIND_DISCLOSED.matches(V.rawKind) ? V.kind = e.M_POLL_KIND_DISCLOSED : V.kind = e.M_POLL_KIND_UNDISCLOSED, V.maxSelections = Number.isFinite(Z.max_selections) && Z.max_selections > 0 ? Z.max_selections : 1, !Array.isArray(Z.answers)) throw new i.InvalidEventError("Poll answers must be an array");
        var Y = Z.answers.slice(0, 20).map(function(oe) {
          return new U({
            type: "org.matrix.sdk.poll.answer",
            content: oe
          });
        });
        if (Y.length <= 0) throw new i.InvalidEventError("No answers available");
        return V.answers = Y, V;
      }
      return b(L, [
        {
          key: "isEquivalentTo",
          value: function(V) {
            return (0, s.isEventTypeSame)(V, e.M_POLL_START);
          }
        },
        {
          key: "serialize",
          value: function() {
            var V;
            return {
              type: e.M_POLL_START.name,
              content: (V = {}, B(V, e.M_POLL_START.name, {
                question: this.question.serialize().content,
                kind: this.rawKind,
                max_selections: this.maxSelections,
                answers: this.answers.map(function(Z) {
                  return Z.serialize().content;
                })
              }), B(V, r.M_TEXT.name, "".concat(this.question.text, `
`).concat(this.answers.map(function(Z, Y) {
                return "".concat(Y + 1, ". ").concat(Z.text);
              }).join(`
`))), V)
            };
          }
        }
      ], [
        {
          key: "from",
          value: function(V, Z, Y) {
            var oe, ue = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
            return new L({
              type: e.M_POLL_START.name,
              content: (oe = {}, B(oe, r.M_TEXT.name, V), B(oe, e.M_POLL_START.name, {
                question: B({}, r.M_TEXT.name, V),
                kind: Y instanceof a.NamespacedValue ? Y.name : Y,
                max_selections: ue,
                answers: Z.map(function(ie) {
                  return B({
                    id: M()
                  }, r.M_TEXT.name, ie);
                })
              }), oe)
            });
          }
        }
      ]), L;
    })(l.ExtensibleEvent);
    Dm.PollStartEvent = z;
    var O = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    function M() {
      return c(Array(16)).map(function() {
        return O.charAt(Math.floor(Math.random() * O.length));
      }).join("");
    }
    return Dm;
  }
  var c_ = {}, d_ = {}, PV;
  function H7() {
    if (PV) return d_;
    PV = 1, Object.defineProperty(d_, "__esModule", {
      value: true
    }), d_.REFERENCE_RELATION = void 0;
    var t = RF(), e = new t.NamespacedValue("m.reference");
    return d_.REFERENCE_RELATION = e, d_;
  }
  var MV;
  function Qte() {
    if (MV) return c_;
    MV = 1;
    function t(b) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(j) {
        return typeof j;
      } : function(j) {
        return j && typeof Symbol == "function" && j.constructor === Symbol && j !== Symbol.prototype ? "symbol" : typeof j;
      }, t(b);
    }
    Object.defineProperty(c_, "__esModule", {
      value: true
    }), c_.PollResponseEvent = void 0;
    var e = Hb(), n = AF(), r = TF(), i = H7(), a = pp();
    function s(b, j) {
      if (!(b instanceof j)) throw new TypeError("Cannot call a class as a function");
    }
    function l(b, j) {
      for (var k = 0; k < j.length; k++) {
        var C = j[k];
        C.enumerable = C.enumerable || false, C.configurable = true, "value" in C && (C.writable = true), Object.defineProperty(b, C.key, C);
      }
    }
    function c(b, j, k) {
      return j && l(b.prototype, j), k && l(b, k), Object.defineProperty(b, "prototype", {
        writable: false
      }), b;
    }
    function d(b, j) {
      if (typeof j != "function" && j !== null) throw new TypeError("Super expression must either be null or a function");
      b.prototype = Object.create(j && j.prototype, {
        constructor: {
          value: b,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(b, "prototype", {
        writable: false
      }), j && u(b, j);
    }
    function u(b, j) {
      return u = Object.setPrototypeOf || function(C, x) {
        return C.__proto__ = x, C;
      }, u(b, j);
    }
    function h(b) {
      var j = m();
      return function() {
        var C = v(b), x;
        if (j) {
          var S = v(this).constructor;
          x = Reflect.construct(C, arguments, S);
        } else x = C.apply(this, arguments);
        return f(this, x);
      };
    }
    function f(b, j) {
      if (j && (t(j) === "object" || typeof j == "function")) return j;
      if (j !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return g(b);
    }
    function g(b) {
      if (b === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return b;
    }
    function m() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function v(b) {
      return v = Object.setPrototypeOf ? Object.getPrototypeOf : function(k) {
        return k.__proto__ || Object.getPrototypeOf(k);
      }, v(b);
    }
    function y(b, j, k) {
      return j in b ? Object.defineProperty(b, j, {
        value: k,
        enumerable: true,
        configurable: true,
        writable: true
      }) : b[j] = k, b;
    }
    var w = (function(b) {
      d(k, b);
      var j = h(k);
      function k(C) {
        var x;
        s(this, k), x = j.call(this, C), y(g(x), "internalAnswerIds", void 0), y(g(x), "internalSpoiled", void 0), y(g(x), "pollEventId", void 0);
        var S = x.wireContent["m.relates_to"];
        if (!i.REFERENCE_RELATION.matches(S == null ? void 0 : S.rel_type) || typeof (S == null ? void 0 : S.event_id) != "string") throw new r.InvalidEventError("Relationship must be a reference to an event");
        return x.pollEventId = S.event_id, x.validateAgainst(null), x;
      }
      return c(k, [
        {
          key: "answerIds",
          get: function() {
            return this.internalAnswerIds;
          }
        },
        {
          key: "spoiled",
          get: function() {
            return this.internalSpoiled;
          }
        },
        {
          key: "validateAgainst",
          value: function(x) {
            var S = n.M_POLL_RESPONSE.findIn(this.wireContent);
            if (!Array.isArray(S == null ? void 0 : S.answers)) {
              this.internalSpoiled = true, this.internalAnswerIds = [];
              return;
            }
            var T = S.answers;
            if (T.some(function(A) {
              return typeof A != "string";
            }) || T.length === 0) {
              this.internalSpoiled = true, this.internalAnswerIds = [];
              return;
            }
            if (x) {
              if (T.some(function(A) {
                return !x.answers.some(function(B) {
                  return B.id === A;
                });
              })) {
                this.internalSpoiled = true, this.internalAnswerIds = [];
                return;
              }
              T = T.slice(0, x.maxSelections);
            }
            this.internalAnswerIds = T, this.internalSpoiled = false;
          }
        },
        {
          key: "isEquivalentTo",
          value: function(x) {
            return (0, a.isEventTypeSame)(x, n.M_POLL_RESPONSE);
          }
        },
        {
          key: "serialize",
          value: function() {
            return {
              type: n.M_POLL_RESPONSE.name,
              content: y({
                "m.relates_to": {
                  rel_type: i.REFERENCE_RELATION.name,
                  event_id: this.pollEventId
                }
              }, n.M_POLL_RESPONSE.name, {
                answers: this.spoiled ? void 0 : this.answerIds
              })
            };
          }
        }
      ], [
        {
          key: "from",
          value: function(x, S) {
            return new k({
              type: n.M_POLL_RESPONSE.name,
              content: y({
                "m.relates_to": {
                  rel_type: i.REFERENCE_RELATION.name,
                  event_id: S
                }
              }, n.M_POLL_RESPONSE.name, {
                answers: x
              })
            });
          }
        }
      ]), k;
    })(e.ExtensibleEvent);
    return c_.PollResponseEvent = w, c_;
  }
  var u_ = {}, OV;
  function ene() {
    if (OV) return u_;
    OV = 1;
    function t(x) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
        return typeof S;
      } : function(S) {
        return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
      }, t(x);
    }
    Object.defineProperty(u_, "__esModule", {
      value: true
    }), u_.PollEndEvent = void 0;
    var e = AF(), n = TF(), r = H7(), i = Fp(), a = Kd(), s = pp(), l = Hb();
    function c(x, S) {
      var T = Object.keys(x);
      if (Object.getOwnPropertySymbols) {
        var A = Object.getOwnPropertySymbols(x);
        S && (A = A.filter(function(B) {
          return Object.getOwnPropertyDescriptor(x, B).enumerable;
        })), T.push.apply(T, A);
      }
      return T;
    }
    function d(x) {
      for (var S = 1; S < arguments.length; S++) {
        var T = arguments[S] != null ? arguments[S] : {};
        S % 2 ? c(Object(T), true).forEach(function(A) {
          k(x, A, T[A]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(x, Object.getOwnPropertyDescriptors(T)) : c(Object(T)).forEach(function(A) {
          Object.defineProperty(x, A, Object.getOwnPropertyDescriptor(T, A));
        });
      }
      return x;
    }
    function u(x, S) {
      if (!(x instanceof S)) throw new TypeError("Cannot call a class as a function");
    }
    function h(x, S) {
      for (var T = 0; T < S.length; T++) {
        var A = S[T];
        A.enumerable = A.enumerable || false, A.configurable = true, "value" in A && (A.writable = true), Object.defineProperty(x, A.key, A);
      }
    }
    function f(x, S, T) {
      return S && h(x.prototype, S), T && h(x, T), Object.defineProperty(x, "prototype", {
        writable: false
      }), x;
    }
    function g(x, S) {
      if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function");
      x.prototype = Object.create(S && S.prototype, {
        constructor: {
          value: x,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(x, "prototype", {
        writable: false
      }), S && m(x, S);
    }
    function m(x, S) {
      return m = Object.setPrototypeOf || function(A, B) {
        return A.__proto__ = B, A;
      }, m(x, S);
    }
    function v(x) {
      var S = b();
      return function() {
        var A = j(x), B;
        if (S) {
          var U = j(this).constructor;
          B = Reflect.construct(A, arguments, U);
        } else B = A.apply(this, arguments);
        return y(this, B);
      };
    }
    function y(x, S) {
      if (S && (t(S) === "object" || typeof S == "function")) return S;
      if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return w(x);
    }
    function w(x) {
      if (x === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return x;
    }
    function b() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function j(x) {
      return j = Object.setPrototypeOf ? Object.getPrototypeOf : function(T) {
        return T.__proto__ || Object.getPrototypeOf(T);
      }, j(x);
    }
    function k(x, S, T) {
      return S in x ? Object.defineProperty(x, S, {
        value: T,
        enumerable: true,
        configurable: true,
        writable: true
      }) : x[S] = T, x;
    }
    var C = (function(x) {
      g(T, x);
      var S = v(T);
      function T(A) {
        var B;
        u(this, T), B = S.call(this, A), k(w(B), "pollEventId", void 0), k(w(B), "closingMessage", void 0);
        var U = B.wireContent["m.relates_to"];
        if (!r.REFERENCE_RELATION.matches(U == null ? void 0 : U.rel_type) || typeof (U == null ? void 0 : U.event_id) != "string") throw new n.InvalidEventError("Relationship must be a reference to an event");
        return B.pollEventId = U.event_id, B.closingMessage = new i.MessageEvent(B.wireFormat), B;
      }
      return f(T, [
        {
          key: "isEquivalentTo",
          value: function(B) {
            return (0, s.isEventTypeSame)(B, e.M_POLL_END);
          }
        },
        {
          key: "serialize",
          value: function() {
            return {
              type: e.M_POLL_END.name,
              content: d(k({
                "m.relates_to": {
                  rel_type: r.REFERENCE_RELATION.name,
                  event_id: this.pollEventId
                }
              }, e.M_POLL_END.name, {}), this.closingMessage.serialize().content)
            };
          }
        }
      ], [
        {
          key: "from",
          value: function(B, U) {
            var z;
            return new T({
              type: e.M_POLL_END.name,
              content: (z = {
                "m.relates_to": {
                  rel_type: r.REFERENCE_RELATION.name,
                  event_id: B
                }
              }, k(z, e.M_POLL_END.name, {}), k(z, a.M_TEXT.name, U), z)
            });
          }
        }
      ]), T;
    })(l.ExtensibleEvent);
    return u_.PollEndEvent = C, u_;
  }
  var LV;
  function tne() {
    if (LV) return Kx;
    LV = 1, Object.defineProperty(Kx, "__esModule", {
      value: true
    }), Kx.parseMPoll = i;
    var t = AF(), e = Xte(), n = Qte(), r = ene();
    function i(a) {
      return t.M_POLL_START.matches(a.type) ? new e.PollStartEvent(a) : t.M_POLL_RESPONSE.matches(a.type) ? new n.PollResponseEvent(a) : t.M_POLL_END.matches(a.type) ? new r.PollEndEvent(a) : null;
    }
    return Kx;
  }
  var NV;
  function p3e() {
    if (NV) return t_;
    NV = 1, Object.defineProperty(t_, "__esModule", {
      value: true
    }), t_.ExtensibleEvents = void 0;
    var t = Gte(), e = TF(), n = Zte(), r = Jte(), i = Kd(), a = AF(), s = tne();
    function l(v, y) {
      var w = typeof Symbol < "u" && v[Symbol.iterator] || v["@@iterator"];
      if (!w) {
        if (Array.isArray(v) || (w = c(v)) || y) {
          w && (v = w);
          var b = 0, j = function() {
          };
          return {
            s: j,
            n: function() {
              return b >= v.length ? {
                done: true
              } : {
                done: false,
                value: v[b++]
              };
            },
            e: function(T) {
              throw T;
            },
            f: j
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var k = true, C = false, x;
      return {
        s: function() {
          w = w.call(v);
        },
        n: function() {
          var T = w.next();
          return k = T.done, T;
        },
        e: function(T) {
          C = true, x = T;
        },
        f: function() {
          try {
            !k && w.return != null && w.return();
          } finally {
            if (C) throw x;
          }
        }
      };
    }
    function c(v, y) {
      if (v) {
        if (typeof v == "string") return d(v, y);
        var w = Object.prototype.toString.call(v).slice(8, -1);
        if (w === "Object" && v.constructor && (w = v.constructor.name), w === "Map" || w === "Set") return Array.from(v);
        if (w === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w)) return d(v, y);
      }
    }
    function d(v, y) {
      (y == null || y > v.length) && (y = v.length);
      for (var w = 0, b = new Array(y); w < y; w++) b[w] = v[w];
      return b;
    }
    function u(v, y) {
      if (!(v instanceof y)) throw new TypeError("Cannot call a class as a function");
    }
    function h(v, y) {
      for (var w = 0; w < y.length; w++) {
        var b = y[w];
        b.enumerable = b.enumerable || false, b.configurable = true, "value" in b && (b.writable = true), Object.defineProperty(v, b.key, b);
      }
    }
    function f(v, y, w) {
      return y && h(v.prototype, y), w && h(v, w), Object.defineProperty(v, "prototype", {
        writable: false
      }), v;
    }
    function g(v, y, w) {
      return y in v ? Object.defineProperty(v, y, {
        value: w,
        enumerable: true,
        configurable: true,
        writable: true
      }) : v[y] = w, v;
    }
    var m = (function() {
      function v() {
        u(this, v), g(this, "interpreters", new t.NamespacedMap([
          [
            n.LEGACY_M_ROOM_MESSAGE,
            n.parseMRoomMessage
          ],
          [
            i.M_MESSAGE,
            r.parseMMessage
          ],
          [
            i.M_EMOTE,
            r.parseMMessage
          ],
          [
            i.M_NOTICE,
            r.parseMMessage
          ],
          [
            a.M_POLL_START,
            s.parseMPoll
          ],
          [
            a.M_POLL_RESPONSE,
            s.parseMPoll
          ],
          [
            a.M_POLL_END,
            s.parseMPoll
          ]
        ])), g(this, "_unknownInterpretOrder", [
          i.M_MESSAGE
        ]);
      }
      return f(v, [
        {
          key: "unknownInterpretOrder",
          get: function() {
            var w;
            return (w = this._unknownInterpretOrder) !== null && w !== void 0 ? w : [];
          },
          set: function(w) {
            this._unknownInterpretOrder = w;
          }
        },
        {
          key: "registerInterpreter",
          value: function(w, b) {
            this.interpreters.set(w, b);
          }
        },
        {
          key: "parse",
          value: function(w) {
            try {
              if (this.interpreters.hasNamespaced(w.type)) return this.interpreters.getNamespaced(w.type)(w);
              var b = l(this.unknownInterpretOrder), j;
              try {
                for (b.s(); !(j = b.n()).done; ) {
                  var k = j.value;
                  if (this.interpreters.has(k)) {
                    var C = this.interpreters.get(k)(w);
                    if (C) return C;
                  }
                }
              } catch (x) {
                b.e(x);
              } finally {
                b.f();
              }
              return null;
            } catch (x) {
              if (x instanceof e.InvalidEventError) return null;
              throw x;
            }
          }
        }
      ], [
        {
          key: "defaultInstance",
          get: function() {
            return v._defaultInstance;
          }
        },
        {
          key: "unknownInterpretOrder",
          get: function() {
            return v.defaultInstance.unknownInterpretOrder;
          },
          set: function(w) {
            v.defaultInstance.unknownInterpretOrder = w;
          }
        },
        {
          key: "registerInterpreter",
          value: function(w, b) {
            v.defaultInstance.registerInterpreter(w, b);
          }
        },
        {
          key: "parse",
          value: function(w) {
            return v.defaultInstance.parse(w);
          }
        }
      ]), v;
    })();
    return t_.ExtensibleEvents = m, g(m, "_defaultInstance", new m()), t_;
  }
  var Hj = {}, zV;
  function F3e() {
    return zV || (zV = 1, Object.defineProperty(Hj, "__esModule", {
      value: true
    })), Hj;
  }
  var Cm = {}, UV;
  function v3e() {
    if (UV) return Cm;
    UV = 1, Object.defineProperty(Cm, "__esModule", {
      value: true
    }), Cm.LegacyMsgType = void 0, Cm.isEventLike = n;
    var t = Kd(), e;
    Cm.LegacyMsgType = e, (function(r) {
      r.Text = "m.text", r.Notice = "m.notice", r.Emote = "m.emote";
    })(e || (Cm.LegacyMsgType = e = {}));
    function n(r, i) {
      var a = r.content;
      return i === e.Text ? t.M_MESSAGE.matches(r.type) || r.type === "m.room.message" && (a == null ? void 0 : a.msgtype) === "m.text" : i === e.Emote ? t.M_EMOTE.matches(r.type) || r.type === "m.room.message" && (a == null ? void 0 : a.msgtype) === "m.emote" : i === e.Notice ? t.M_NOTICE.matches(r.type) || r.type === "m.room.message" && (a == null ? void 0 : a.msgtype) === "m.notice" : false;
    }
    return Cm;
  }
  var VV;
  function _3e() {
    return VV || (VV = 1, (function(t) {
      Object.defineProperty(t, "__esModule", {
        value: true
      });
      var e = p3e();
      Object.keys(e).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === e[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return e[x];
          }
        });
      });
      var n = F3e();
      Object.keys(n).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === n[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return n[x];
          }
        });
      });
      var r = TF();
      Object.keys(r).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === r[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return r[x];
          }
        });
      });
      var i = RF();
      Object.keys(i).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === i[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return i[x];
          }
        });
      });
      var a = Gte();
      Object.keys(a).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === a[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return a[x];
          }
        });
      });
      var s = Yte();
      Object.keys(s).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === s[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return s[x];
          }
        });
      });
      var l = v3e();
      Object.keys(l).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === l[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return l[x];
          }
        });
      });
      var c = pp();
      Object.keys(c).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === c[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return c[x];
          }
        });
      });
      var d = Zte();
      Object.keys(d).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === d[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return d[x];
          }
        });
      });
      var u = Jte();
      Object.keys(u).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === u[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return u[x];
          }
        });
      });
      var h = tne();
      Object.keys(h).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === h[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return h[x];
          }
        });
      });
      var f = H7();
      Object.keys(f).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === f[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return f[x];
          }
        });
      });
      var g = Hb();
      Object.keys(g).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === g[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return g[x];
          }
        });
      });
      var m = Kd();
      Object.keys(m).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === m[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return m[x];
          }
        });
      });
      var v = Fp();
      Object.keys(v).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === v[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return v[x];
          }
        });
      });
      var y = V7();
      Object.keys(y).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === y[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return y[x];
          }
        });
      });
      var w = U7();
      Object.keys(w).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === w[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return w[x];
          }
        });
      });
      var b = AF();
      Object.keys(b).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === b[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return b[x];
          }
        });
      });
      var j = Xte();
      Object.keys(j).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === j[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return j[x];
          }
        });
      });
      var k = Qte();
      Object.keys(k).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === k[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return k[x];
          }
        });
      });
      var C = ene();
      Object.keys(C).forEach(function(x) {
        x === "default" || x === "__esModule" || x in t && t[x] === C[x] || Object.defineProperty(t, x, {
          enumerable: true,
          get: function() {
            return C[x];
          }
        });
      });
    })(Vj)), Vj;
  }
  var Os = _3e(), y3e = /^(?:(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:\[[\dA-Fa-f:.]{2,45}])|(?:[A-Za-z\d\-.]{1,255}))(?::\d{1,5})?$/;
  function b3e(t) {
    var e = y3e.exec(t);
    return (e == null ? void 0 : e[0]) === t;
  }
  var x3e = /^[\w-]+$/;
  function w3e(t) {
    var e = x3e.exec(t);
    return (e == null ? void 0 : e[0]) === t;
  }
  rk = function(t, e, n, r, i) {
    var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false, s = arguments.length > 6 ? arguments[6] : void 0, l = arguments.length > 7 ? arguments[7] : void 0;
    if (typeof e != "string" || !e) return "";
    if (!e.startsWith("mxc://")) return a ? e : "";
    var [c, d, ...u] = e.slice(6).split("/");
    if (u.length > 0 || !b3e(c) || !w3e(d)) return "";
    l && (s = true);
    var h, f = !!n || !!r || !!i, g = f ? "thumbnail" : "download";
    l ? h = "/_matrix/client/v1/media/".concat(g) : h = "/_matrix/media/v3/".concat(g);
    var m = new URL("".concat(h, "/").concat(c, "/").concat(d), t);
    return n && m.searchParams.set("width", Math.round(n).toString()), r && m.searchParams.set("height", Math.round(r).toString()), i && m.searchParams.set("method", i), typeof s == "boolean" && m.searchParams.set("allow_redirect", JSON.stringify(s)), m.href;
  };
  const D3e = "l", C3e = "rn", E3e = {
    0: "O",
    1: "l",
    "\u05AD": "\u0596",
    "\u05AE": "\u0598",
    "\u05A8": "\u0599",
    "\u05A4": "\u059A",
    "\u1AB4": "\u06DB",
    "\u20DB": "\u06DB",
    "\u0619": "\u0313",
    "\u08F3": "\u0313",
    "\u0343": "\u0313",
    "\u0315": "\u0313",
    "\u064F": "\u0313",
    "\u065D": "\u0314",
    "\u059C": "\u0301",
    "\u059D": "\u0301",
    "\u0618": "\u0301",
    "\u0747": "\u0301",
    "\u0341": "\u0301",
    "\u0954": "\u0301",
    "\u064E": "\u0301",
    "\u0340": "\u0300",
    "\u0953": "\u0300",
    "\u030C": "\u0306",
    "\uA67C": "\u0306",
    "\u0658": "\u0306",
    "\u065A": "\u0306",
    "\u036E": "\u0306",
    "\u06E8": "\u0306\u0307",
    "\u0310": "\u0306\u0307",
    "\u0901": "\u0306\u0307",
    "\u0981": "\u0306\u0307",
    "\u0A81": "\u0306\u0307",
    "\u0B01": "\u0306\u0307",
    "\u0C00": "\u0306\u0307",
    "\u0C81": "\u0306\u0307",
    "\u0D01": "\u0306\u0307",
    "\u{114BF}": "\u0306\u0307",
    "\u1CD0": "\u0302",
    "\u0311": "\u0302",
    "\u065B": "\u0302",
    "\u07EE": "\u0302",
    "\uA6F0": "\u0302",
    "\u05AF": "\u030A",
    "\u06DF": "\u030A",
    "\u17D3": "\u030A",
    "\u309A": "\u030A",
    "\u0652": "\u030A",
    "\u0B82": "\u030A",
    "\u1036": "\u030A",
    "\u17C6": "\u030A",
    "\u{11300}": "\u030A",
    "\u0E4D": "\u030A",
    "\u0ECD": "\u030A",
    "\u0366": "\u030A",
    "\u2DEA": "\u030A",
    "\u08EB": "\u0308",
    "\u07F3": "\u0308",
    "\u064B": "\u030B",
    "\u08F0": "\u030B",
    "\u0342": "\u0303",
    "\u0653": "\u0303",
    "\u05C4": "\u0307",
    "\u06EC": "\u0307",
    "\u0740": "\u0307",
    "\u08EA": "\u0307",
    "\u0741": "\u0307",
    "\u0358": "\u0307",
    "\u05B9": "\u0307",
    "\u05BA": "\u0307",
    "\u05C2": "\u0307",
    "\u05C1": "\u0307",
    "\u07ED": "\u0307",
    "\u0902": "\u0307",
    "\u0A02": "\u0307",
    "\u0A82": "\u0307",
    "\u0BCD": "\u0307",
    "\u0337": "\u0338",
    "\u1AB7": "\u0328",
    "\u0322": "\u0328",
    "\u0345": "\u0328",
    "\u1CD2": "\u0304",
    "\u0305": "\u0304",
    "\u0659": "\u0304",
    "\u07EB": "\u0304",
    "\uA6F1": "\u0304",
    "\u1CDA": "\u030E",
    "\u0657": "\u0312",
    "\u0357": "\u0350",
    "\u08FF": "\u0350",
    "\u08F8": "\u0350",
    "\u0900": "\u0352",
    "\u1CED": "\u0316",
    "\u1CDC": "\u0329",
    "\u0656": "\u0329",
    "\u1CD5": "\u032B",
    "\u0347": "\u0333",
    "\u08F9": "\u0354",
    "\u08FA": "\u0355",
    "\u309B": "\uFF9E",
    "\u309C": "\uFF9F",
    "\u0336": "\u0335",
    "\u302C": "\u0309",
    "\u05C5": "\u0323",
    "\u08ED": "\u0323",
    "\u1CDD": "\u0323",
    "\u05B4": "\u0323",
    "\u065C": "\u0323",
    "\u093C": "\u0323",
    "\u09BC": "\u0323",
    "\u0A3C": "\u0323",
    "\u0ABC": "\u0323",
    "\u0B3C": "\u0323",
    "\u{111CA}": "\u0323",
    "\u{114C3}": "\u0323",
    "\u{10A3A}": "\u0323",
    "\u08EE": "\u0324",
    "\u1CDE": "\u0324",
    "\u0F37": "\u0325",
    "\u302D": "\u0325",
    "\u0327": "\u0326",
    "\u0321": "\u0326",
    "\u0339": "\u0326",
    "\u1CD9": "\u032D",
    "\u1CD8": "\u032E",
    "\u0952": "\u0331",
    "\u0320": "\u0331",
    "\u08F1": "\u064C",
    "\u08E8": "\u064C",
    "\u08E5": "\u064C",
    \uFC5E: "\uFE72\u0651",
    "\u08F2": "\u064D",
    \uFC5F: "\uFE74\u0651",
    \uFCF2: "\uFE77\u0651",
    \uFC60: "\uFE76\u0651",
    \uFCF3: "\uFE79\u0651",
    \uFC61: "\uFE78\u0651",
    "\u061A": "\u0650",
    "\u0317": "\u0650",
    \uFCF4: "\uFE7B\u0651",
    \uFC62: "\uFE7A\u0651",
    \uFC63: "\uFE7C\u0670",
    "\u065F": "\u0655",
    "\u030D": "\u0670",
    "\u0742": "\u073C",
    "\u0A03": "\u0983",
    "\u0C03": "\u0983",
    "\u0C83": "\u0983",
    "\u0D03": "\u0983",
    "\u0D83": "\u0983",
    "\u1038": "\u0983",
    "\u{114C1}": "\u0983",
    "\u17CB": "\u0E48",
    "\u0EC8": "\u0E48",
    "\u0EC9": "\u0E49",
    "\u0ECA": "\u0E4A",
    "\u0ECB": "\u0E4B",
    "\uA66F": "\u20E9",
    "\u2028": " ",
    "\u2029": " ",
    "\u1680": " ",
    "\u2000": " ",
    "\u2001": " ",
    "\u2002": " ",
    "\u2003": " ",
    "\u2004": " ",
    "\u2005": " ",
    "\u2006": " ",
    "\u2008": " ",
    "\u2009": " ",
    "\u200A": " ",
    "\u205F": " ",
    "\xA0": " ",
    "\u2007": " ",
    "\u202F": " ",
    "\u07FA": "_",
    "\uFE4D": "_",
    "\uFE4E": "_",
    "\uFE4F": "_",
    "\u2010": "-",
    "\u2011": "-",
    "\u2012": "-",
    "\u2013": "-",
    "\uFE58": "-",
    "\u06D4": "-",
    "\u2043": "-",
    "\u02D7": "-",
    "\u2212": "-",
    "\u2796": "-",
    "\u2CBA": "-",
    "\u2A29": "-\u0313",
    "\u2E1A": "-\u0308",
    "\uFB29": "-\u0307",
    "\u2238": "-\u0307",
    "\u2A2A": "-\u0323",
    "\uA4FE": "-.",
    "\uFF5E": "\u301C",
    "\u060D": ",",
    "\u066B": ",",
    "\u201A": ",",
    "\xB8": ",",
    "\uA4F9": ",",
    "\u2E32": "\u060C",
    "\u066C": "\u060C",
    "\u037E": ";",
    "\u2E35": "\u061B",
    "\u0903": ":",
    "\u0A83": ":",
    "\uFF1A": ":",
    "\u0589": ":",
    "\u0703": ":",
    "\u0704": ":",
    "\u16EC": ":",
    "\uFE30": ":",
    "\u1803": ":",
    "\u1809": ":",
    "\u205A": ":",
    "\u05C3": ":",
    "\u02F8": ":",
    "\uA789": ":",
    "\u2236": ":",
    \u02D0: ":",
    "\uA4FD": ":",
    "\u2A74": "::=",
    "\u29F4": ":\u2192",
    "\uFF01": "!",
    \u01C3: "!",
    "\u2D51": "!",
    "\u203C": "!!",
    "\u2049": "!?",
    \u0294: "?",
    "\u0241": "?",
    "\u097D": "?",
    \u13AE: "?",
    "\uA6EB": "?",
    "\u2048": "?!",
    "\u2047": "??",
    "\u2E2E": "\u061F",
    "\u{1D16D}": ".",
    "\u2024": ".",
    "\u0701": ".",
    "\u0702": ".",
    "\uA60E": ".",
    "\u{10A50}": ".",
    "\u0660": ".",
    "\u06F0": ".",
    "\uA4F8": ".",
    "\uA4FB": ".,",
    "\u2025": "..",
    "\uA4FA": "..",
    "\u2026": "...",
    "\uA6F4": "\uA6F3\uA6F3",
    "\u30FB": "\xB7",
    "\uFF65": "\xB7",
    "\u16EB": "\xB7",
    "\u0387": "\xB7",
    "\u2E31": "\xB7",
    "\u{10101}": "\xB7",
    "\u2022": "\xB7",
    "\u2027": "\xB7",
    "\u2219": "\xB7",
    "\u22C5": "\xB7",
    "\uA78F": "\xB7",
    \u1427: "\xB7",
    "\u22EF": "\xB7\xB7\xB7",
    "\u2D48": "\xB7\xB7\xB7",
    \u1444: "\xB7<",
    "\u22D7": "\xB7>",
    \u1437: "\xB7>",
    \u1440: "\xB7>",
    \u152F: "\xB74",
    \u147E: "\xB7b",
    \u1480: "\xB7b\u0307",
    \u147A: "\xB7d",
    \u1498: "\xB7J",
    \u14B6: "\xB7L",
    \u1476: "\xB7P",
    \u1457: "\xB7U",
    \u143A: "\xB7V",
    \u143C: "\xB7\u0245",
    \u14AE: "\xB7\u0393",
    \u140E: "\xB7\u0394",
    \u1459: "\xB7\u0548",
    \u140C: "\xB7\u1401",
    \u1410: "\xB7\u1404",
    \u1412: "\xB7\u1405",
    \u1414: "\xB7\u1406",
    \u1417: "\xB7\u140A",
    \u1419: "\xB7\u140B",
    \u143E: "\xB7\u1432",
    \u1442: "\xB7\u1434",
    \u1446: "\xB7\u1439",
    \u145B: "\xB7\u144F",
    \u1454: "\xB7\u1450",
    \u145D: "\xB7\u1450",
    \u145F: "\xB7\u1451",
    \u1461: "\xB7\u1455",
    \u1463: "\xB7\u1456",
    \u1474: "\xB7\u146B",
    \u1478: "\xB7\u146E",
    \u147C: "\xB7\u1470",
    \u1492: "\xB7\u1489",
    \u1494: "\xB7\u148B",
    \u1496: "\xB7\u148C",
    \u149A: "\xB7\u148E",
    \u149C: "\xB7\u1490",
    \u149E: "\xB7\u1491",
    \u14AC: "\xB7\u14A3",
    \u14B0: "\xB7\u14A6",
    \u14B2: "\xB7\u14A7",
    \u14B4: "\xB7\u14A8",
    \u14B8: "\xB7\u14AB",
    \u14C9: "\xB7\u14C0",
    "\u18C6": "\xB7\u14C2",
    "\u18C8": "\xB7\u14C3",
    "\u18CA": "\xB7\u14C4",
    "\u18CC": "\xB7\u14C5",
    \u14CB: "\xB7\u14C7",
    \u14CD: "\xB7\u14C8",
    \u14DC: "\xB7\u14D3",
    \u14DE: "\xB7\u14D5",
    \u14E0: "\xB7\u14D6",
    \u14E2: "\xB7\u14D7",
    \u14E4: "\xB7\u14D8",
    \u14E6: "\xB7\u14DA",
    \u14E8: "\xB7\u14DB",
    \u14F6: "\xB7\u14ED",
    \u14F8: "\xB7\u14EF",
    \u14FA: "\xB7\u14F0",
    \u14FC: "\xB7\u14F1",
    \u14FE: "\xB7\u14F2",
    \u1500: "\xB7\u14F4",
    \u1502: "\xB7\u14F5",
    \u1517: "\xB7\u1510",
    \u1519: "\xB7\u1511",
    \u151B: "\xB7\u1512",
    \u151D: "\xB7\u1513",
    \u151F: "\xB7\u1514",
    \u1521: "\xB7\u1515",
    \u1523: "\xB7\u1516",
    \u1531: "\xB7\u1528",
    \u1533: "\xB7\u1529",
    \u1535: "\xB7\u152A",
    \u1537: "\xB7\u152B",
    \u1539: "\xB7\u152D",
    \u153B: "\xB7\u152E",
    "\u18CE": "\xB7\u1543",
    "\u18CF": "\xB7\u1546",
    "\u18D0": "\xB7\u1547",
    "\u18D1": "\xB7\u1548",
    "\u18D2": "\xB7\u1549",
    "\u18D3": "\xB7\u154B",
    \u154E: "\xB7\u154C",
    \u155B: "\xB7\u155A",
    \u1568: "\xB7\u1567",
    "\u18B3": "\xB7\u18B1",
    "\u18B6": "\xB7\u18B4",
    "\u18B9": "\xB7\u18B8",
    "\u18C2": "\xB7\u18C0",
    "\uA830": "\u0964",
    "\u0965": "\u0964\u0964",
    "\u1C3C": "\u1C3B\u1C3B",
    "\u104B": "\u104A\u104A",
    "\u1AA9": "\u1AA8\u1AA8",
    "\u1AAB": "\u1AAA\u1AA8",
    "\u1B5F": "\u1B5E\u1B5E",
    "\u{10A57}": "\u{10A56}\u{10A56}",
    "\u{1144C}": "\u{1144B}\u{1144B}",
    "\u{11642}": "\u{11641}\u{11641}",
    "\u{11C42}": "\u{11C41}\u{11C41}",
    "\u1C7F": "\u1C7E\u1C7E",
    "\u055D": "'",
    "\uFF07": "'",
    "\u2018": "'",
    "\u2019": "'",
    "\u201B": "'",
    "\u2032": "'",
    "\u2035": "'",
    "\u055A": "'",
    "\u05F3": "'",
    "`": "'",
    "\u1FEF": "'",
    "\uFF40": "'",
    "\xB4": "'",
    "\u0384": "'",
    "\u1FFD": "'",
    "\u1FBD": "'",
    "\u1FBF": "'",
    "\u1FFE": "'",
    "\u02B9": "'",
    "\u0374": "'",
    "\u02C8": "'",
    "\u02CA": "'",
    "\u02CB": "'",
    "\u02F4": "'",
    \u02BB: "'",
    \u02BD: "'",
    \u02BC: "'",
    \u02BE: "'",
    "\uA78C": "'",
    \u05D9: "'",
    "\u07F4": "'",
    "\u07F5": "'",
    \u144A: "'",
    \u16CC: "'",
    "\u{16F51}": "'",
    "\u{16F52}": "'",
    "\u1CD3": "''",
    '"': "''",
    "\uFF02": "''",
    "\u201C": "''",
    "\u201D": "''",
    "\u201F": "''",
    "\u2033": "''",
    "\u2036": "''",
    "\u3003": "''",
    "\u05F4": "''",
    "\u02DD": "''",
    "\u02BA": "''",
    "\u02F6": "''",
    \u02EE: "''",
    \u05F2: "''",
    "\u2034": "'''",
    "\u2037": "'''",
    "\u2057": "''''",
    \u0181: "'B",
    \u018A: "'D",
    \u0149: "'n",
    \u01A4: "'P",
    \u01AC: "'T",
    \u01B3: "'Y",
    "\uFF3B": "(",
    "\u2768": "(",
    "\u2772": "(",
    "\u3014": "(",
    "\uFD3E": "(",
    "\u2E28": "((",
    "\u3220": "(\u30FC)",
    "\u2475": "(2)",
    "\u2487": "(2O)",
    "\u2476": "(3)",
    "\u2477": "(4)",
    "\u2478": "(5)",
    "\u2479": "(6)",
    "\u247A": "(7)",
    "\u247B": "(8)",
    "\u247C": "(9)",
    "\u249C": "(a)",
    "\u{1F110}": "(A)",
    "\u249D": "(b)",
    "\u{1F111}": "(B)",
    "\u249E": "(c)",
    "\u{1F112}": "(C)",
    "\u249F": "(d)",
    "\u{1F113}": "(D)",
    "\u24A0": "(e)",
    "\u{1F114}": "(E)",
    "\u24A1": "(f)",
    "\u{1F115}": "(F)",
    "\u24A2": "(g)",
    "\u{1F116}": "(G)",
    "\u24A3": "(h)",
    "\u{1F117}": "(H)",
    "\u24A4": "(i)",
    "\u24A5": "(j)",
    "\u{1F119}": "(J)",
    "\u24A6": "(k)",
    "\u{1F11A}": "(K)",
    "\u2474": "(l)",
    "\u{1F118}": "(l)",
    "\u24A7": "(l)",
    "\u{1F11B}": "(L)",
    "\u247F": "(l2)",
    "\u2480": "(l3)",
    "\u2481": "(l4)",
    "\u2482": "(l5)",
    "\u2483": "(l6)",
    "\u2484": "(l7)",
    "\u2485": "(l8)",
    "\u2486": "(l9)",
    "\u247E": "(ll)",
    "\u247D": "(lO)",
    "\u{1F11C}": "(M)",
    "\u24A9": "(n)",
    "\u{1F11D}": "(N)",
    "\u24AA": "(o)",
    "\u{1F11E}": "(O)",
    "\u24AB": "(p)",
    "\u{1F11F}": "(P)",
    "\u24AC": "(q)",
    "\u{1F120}": "(Q)",
    "\u24AD": "(r)",
    "\u{1F121}": "(R)",
    "\u24A8": "(rn)",
    "\u24AE": "(s)",
    "\u{1F122}": "(S)",
    "\u{1F12A}": "(S)",
    "\u24AF": "(t)",
    "\u{1F123}": "(T)",
    "\u24B0": "(u)",
    "\u{1F124}": "(U)",
    "\u24B1": "(v)",
    "\u{1F125}": "(V)",
    "\u24B2": "(w)",
    "\u{1F126}": "(W)",
    "\u24B3": "(x)",
    "\u{1F127}": "(X)",
    "\u24B4": "(y)",
    "\u{1F128}": "(Y)",
    "\u24B5": "(z)",
    "\u{1F129}": "(Z)",
    "\u3200": "(\u1100)",
    "\u320E": "(\uAC00)",
    "\u3201": "(\u1102)",
    "\u320F": "(\uB098)",
    "\u3202": "(\u1103)",
    "\u3210": "(\uB2E4)",
    "\u3203": "(\u1105)",
    "\u3211": "(\uB77C)",
    "\u3204": "(\u1106)",
    "\u3212": "(\uB9C8)",
    "\u3205": "(\u1107)",
    "\u3213": "(\uBC14)",
    "\u3206": "(\u1109)",
    "\u3214": "(\uC0AC)",
    "\u3207": "(\u110B)",
    "\u3215": "(\uC544)",
    "\u321D": "(\uC624\uC804)",
    "\u321E": "(\uC624\uD6C4)",
    "\u3208": "(\u110C)",
    "\u3216": "(\uC790)",
    "\u321C": "(\uC8FC)",
    "\u3209": "(\u110E)",
    "\u3217": "(\uCC28)",
    "\u320A": "(\u110F)",
    "\u3218": "(\uCE74)",
    "\u320B": "(\u1110)",
    "\u3219": "(\uD0C0)",
    "\u320C": "(\u1111)",
    "\u321A": "(\uD30C)",
    "\u320D": "(\u1112)",
    "\u321B": "(\uD558)",
    "\u3226": "(\u4E03)",
    "\u3222": "(\u4E09)",
    "\u{1F241}": "(\u4E09)",
    "\u3228": "(\u4E5D)",
    "\u3221": "(\u4E8C)",
    "\u{1F242}": "(\u4E8C)",
    "\u3224": "(\u4E94)",
    "\u3239": "(\u4EE3)",
    "\u323D": "(\u4F01)",
    "\u3241": "(\u4F11)",
    "\u3227": "(\u516B)",
    "\u3225": "(\u516D)",
    "\u3238": "(\u52B4)",
    "\u{1F247}": "(\u52DD)",
    "\u3229": "(\u5341)",
    "\u323F": "(\u5354)",
    "\u3234": "(\u540D)",
    "\u323A": "(\u547C)",
    "\u3223": "(\u56DB)",
    "\u322F": "(\u571F)",
    "\u323B": "(\u5B66)",
    "\u{1F243}": "(\u5B89)",
    "\u{1F245}": "(\u6253)",
    "\u{1F248}": "(\u6557)",
    "\u3230": "(\u65E5)",
    "\u322A": "(\u6708)",
    "\u3232": "(\u6709)",
    "\u322D": "(\u6728)",
    "\u{1F240}": "(\u672C)",
    "\u3231": "(\u682A)",
    "\u322C": "(\u6C34)",
    "\u322B": "(\u706B)",
    "\u{1F244}": "(\u70B9)",
    "\u3235": "(\u7279)",
    "\u{1F246}": "(\u76D7)",
    "\u323C": "(\u76E3)",
    "\u3233": "(\u793E)",
    "\u3237": "(\u795D)",
    "\u3240": "(\u796D)",
    "\u3242": "(\u81EA)",
    "\u3243": "(\u81F3)",
    "\u3236": "(\u8CA1)",
    "\u323E": "(\u8CC7)",
    "\u322E": "(\u91D1)",
    "\uFF3D": ")",
    "\u2769": ")",
    "\u2773": ")",
    "\u3015": ")",
    "\uFD3F": ")",
    "\u2E29": "))",
    "\u2774": "{",
    "\u{1D114}": "{",
    "\u2775": "}",
    "\u301A": "\u27E6",
    "\u301B": "\u27E7",
    "\u27E8": "\u276C",
    "\u2329": "\u276C",
    "\u3008": "\u276C",
    "\u31DB": "\u276C",
    \u304F: "\u276C",
    "\u{21FE8}": "\u276C",
    "\u27E9": "\u276D",
    "\u232A": "\u276D",
    "\u3009": "\u276D",
    "\uFF3E": "\uFE3F",
    "\u2E3F": "\xB6",
    "\u204E": "*",
    "\u066D": "*",
    "\u2217": "*",
    "\u{1031F}": "*",
    "\u1735": "/",
    "\u2041": "/",
    "\u2215": "/",
    "\u2044": "/",
    "\u2571": "/",
    "\u27CB": "/",
    "\u29F8": "/",
    "\u{1D23A}": "/",
    "\u31D3": "/",
    \u3033: "/",
    "\u2CC6": "/",
    \u30CE: "/",
    \u4E3F: "/",
    "\u2F03": "/",
    "\u29F6": "/\u0304",
    "\u2AFD": "//",
    "\u2AFB": "///",
    "\uFF3C": "\\",
    "\uFE68": "\\",
    "\u2216": "\\",
    "\u27CD": "\\",
    "\u29F5": "\\",
    "\u29F9": "\\",
    "\u{1D20F}": "\\",
    "\u{1D23B}": "\\",
    "\u31D4": "\\",
    \u4E36: "\\",
    "\u2F02": "\\",
    "\u2CF9": "\\\\",
    "\u244A": "\\\\",
    "\u27C8": "\\\u1455",
    "\uA778": "&",
    "\u0AF0": "\u0970",
    "\u{110BB}": "\u0970",
    "\u{111C7}": "\u0970",
    "\u26AC": "\u0970",
    "\u{111DB}": "\uA8FC",
    "\u17D9": "\u0E4F",
    "\u17D5": "\u0E5A",
    "\u17DA": "\u0E5B",
    "\u0F0C": "\u0F0B",
    "\u0F0E": "\u0F0D\u0F0D",
    "\u02C4": "^",
    "\u02C6": "^",
    "\uA67E": "\u02C7",
    "\u02D8": "\u02C7",
    "\u203E": "\u02C9",
    "\uFE49": "\u02C9",
    "\uFE4A": "\u02C9",
    "\uFE4B": "\u02C9",
    "\uFE4C": "\u02C9",
    "\xAF": "\u02C9",
    "\uFFE3": "\u02C9",
    "\u2594": "\u02C9",
    \u044A: "\u02C9b",
    "\uA651": "\u02C9bi",
    "\u0375": "\u02CF",
    "\u02FB": "\u02EA",
    "\uA716": "\u02EA",
    "\uA714": "\u02EB",
    "\u3002": "\u02F3",
    "\u2E30": "\xB0",
    "\u02DA": "\xB0",
    "\u2218": "\xB0",
    "\u25CB": "\xB0",
    "\u25E6": "\xB0",
    "\u235C": "\xB0\u0332",
    "\u2364": "\xB0\u0308",
    "\u2103": "\xB0C",
    "\u2109": "\xB0F",
    "\u0BF5": "\u0BF3",
    "\u0F1B": "\u0F1A\u0F1A",
    "\u0F1F": "\u0F1A\u0F1D",
    "\u0FCE": "\u0F1D\u0F1A",
    "\u0F1E": "\u0F1D\u0F1D",
    "\u24B8": "\xA9",
    "\u24C7": "\xAE",
    "\u24C5": "\u2117",
    "\u{1D21B}": "\u2144",
    "\u2BEC": "\u219E",
    "\u2BED": "\u219F",
    "\u2BEE": "\u21A0",
    "\u2BEF": "\u21A1",
    "\u21B5": "\u21B2",
    "\u2965": "\u21C3\u21C2",
    "\u296F": "\u21C3\u16DA",
    "\u{1D6DB}": "\u2202",
    "\u{1D715}": "\u2202",
    "\u{1D74F}": "\u2202",
    "\u{1D789}": "\u2202",
    "\u{1D7C3}": "\u2202",
    "\u{1E8CC}": "\u2202",
    "\u{1E8CD}": "\u2202\u0335",
    \u00F0: "\u2202\u0335",
    "\u2300": "\u2205",
    "\u{1D6C1}": "\u2207",
    "\u{1D6FB}": "\u2207",
    "\u{1D735}": "\u2207",
    "\u{1D76F}": "\u2207",
    "\u{1D7A9}": "\u2207",
    "\u{118A8}": "\u2207",
    "\u2362": "\u2207\u0308",
    "\u236B": "\u2207\u0334",
    "\u2588": "\u220E",
    "\u25A0": "\u220E",
    "\u2A3F": "\u2210",
    "\u16ED": "+",
    "\u2795": "+",
    "\u{1029B}": "+",
    "\u2A23": "+\u0302",
    "\u2A22": "+\u030A",
    "\u2A24": "+\u0303",
    "\u2214": "+\u0307",
    "\u2A25": "+\u0323",
    "\u2A26": "+\u0330",
    "\u2A27": "+\u2082",
    "\u2797": "\xF7",
    "\u2039": "<",
    "\u276E": "<",
    "\u02C2": "<",
    "\u{1D236}": "<",
    \u1438: "<",
    \u16B2: "<",
    "\u22D6": "<\xB7",
    "\u2CB4": "<\xB7",
    \u1445: "<\xB7",
    "\u226A": "<<",
    "\u22D8": "<<<",
    "\u1400": "=",
    "\u2E40": "=",
    "\u30A0": "=",
    "\uA4FF": "=",
    "\u225A": "=\u0306",
    "\u2259": "=\u0302",
    "\u2257": "=\u030A",
    "\u2250": "=\u0307",
    "\u2251": "=\u0307\u0323",
    "\u2A6E": "=\u20F0",
    "\u2A75": "==",
    "\u2A76": "===",
    "\u225E": "=\u036B",
    "\u203A": ">",
    "\u276F": ">",
    "\u02C3": ">",
    "\u{1D237}": ">",
    \u1433: ">",
    "\u{16F3F}": ">",
    \u1441: ">\xB7",
    "\u2AA5": "><",
    "\u226B": ">>",
    "\u2A20": ">>",
    "\u22D9": ">>>",
    "\u2053": "~",
    "\u02DC": "~",
    "\u1FC0": "~",
    "\u223C": "~",
    "\u2368": "~\u0308",
    "\u2E1E": "~\u0307",
    "\u2A6A": "~\u0307",
    "\u2E1F": "~\u0323",
    "\u{1E8C8}": "\u2220",
    "\u22C0": "\u2227",
    "\u222F": "\u222E\u222E",
    "\u2230": "\u222E\u222E\u222E",
    "\u2E2B": "\u2234",
    "\u2E2A": "\u2235",
    "\u2E2C": "\u2237",
    "\u{111DE}": "\u2248",
    "\u264E": "\u224F",
    "\u{1F75E}": "\u224F",
    "\u2263": "\u2261",
    "\u2A03": "\u228D",
    "\u2A04": "\u228E",
    "\u{1D238}": "\u228F",
    "\u{1D239}": "\u2290",
    "\u2A05": "\u2293",
    "\u2A06": "\u2294",
    "\u2A02": "\u2297",
    "\u235F": "\u229B",
    "\u{1F771}": "\u22A0",
    "\u{1F755}": "\u22A1",
    "\u25C1": "\u22B2",
    "\u25B7": "\u22B3",
    "\u2363": "\u22C6\u0308",
    "\uFE34": "\u2307",
    "\u25E0": "\u2312",
    "\u2A3D": "\u2319",
    "\u2325": "\u2324",
    "\u29C7": "\u233B",
    "\u25CE": "\u233E",
    "\u29BE": "\u233E",
    "\u29C5": "\u2342",
    "\u29B0": "\u2349",
    "\u23C3": "\u234B",
    "\u23C2": "\u234E",
    "\u23C1": "\u2355",
    "\u23C6": "\u236D",
    "\u2638": "\u2388",
    "\uFE35": "\u23DC",
    "\uFE36": "\u23DD",
    "\uFE37": "\u23DE",
    "\uFE38": "\u23DF",
    "\uFE39": "\u23E0",
    "\uFE3A": "\u23E1",
    "\u25B1": "\u23E5",
    "\u23FC": "\u23FB",
    "\uFE31": "\u2502",
    "\uFF5C": "\u2502",
    "\u2503": "\u2502",
    "\u250F": "\u250C",
    "\u2523": "\u251C",
    "\u2590": "\u258C",
    "\u2597": "\u2596",
    "\u259D": "\u2598",
    "\u2610": "\u25A1",
    "\uFFED": "\u25AA",
    "\u25B8": "\u25B6",
    "\u25BA": "\u25B6",
    "\u2CE9": "\u2627",
    "\u{1F70A}": "\u2629",
    "\u{1F312}": "\u263D",
    "\u{1F319}": "\u263D",
    "\u23FE": "\u263E",
    "\u{1F318}": "\u263E",
    "\u29D9": "\u299A",
    "\u{1F73A}": "\u29DF",
    "\u2A3E": "\u2A1F",
    "\u{101A0}": "\u2CE8",
    "\u2669": "\u{1D158}\u{1D165}",
    "\u266A": "\u{1D158}\u{1D165}\u{1D16E}",
    "\u24EA": "\u{1F10D}",
    "\u21BA": "\u{1F10E}",
    "\u02D9": "\u0971",
    "\u0D4E": "\u0971",
    "\uFF0D": "\u30FC",
    "\u2014": "\u30FC",
    "\u2015": "\u30FC",
    "\u2500": "\u30FC",
    "\u2501": "\u30FC",
    "\u31D0": "\u30FC",
    "\uA7F7": "\u30FC",
    \u1173: "\u30FC",
    \u3161: "\u30FC",
    \u4E00: "\u30FC",
    "\u2F00": "\u30FC",
    \u1196: "\u30FC\u30FC",
    "\uD7B9": "\u30FC\u1161",
    "\uD7BA": "\u30FC\u1165",
    "\uD7BB": "\u30FC\u1165\u4E28",
    "\uD7BC": "\u30FC\u1169",
    \u1195: "\u30FC\u116E",
    \u1174: "\u30FC\u4E28",
    \u3162: "\u30FC\u4E28",
    \u1197: "\u30FC\u4E28\u116E",
    "\u{1F10F}": "$\u20E0",
    "\u20A4": "\xA3",
    "\u3012": "\u20B8",
    "\u3036": "\u20B8",
    "\u1B5C": "\u1B50",
    "\uA9C6": "\uA9D0",
    "\u{114D1}": "\u09E7",
    "\u0CE7": "\u0C67",
    "\u1065": "\u1041",
    "\u2460": "\u2780",
    "\u2469": "\u2789",
    "\u23E8": "\u2081\u2080",
    "\u{1D7D0}": "2",
    "\u{1D7DA}": "2",
    "\u{1D7E4}": "2",
    "\u{1D7EE}": "2",
    "\u{1D7F8}": "2",
    "\u{1FBF2}": "2",
    "\uA75A": "2",
    \u01A7: "2",
    \u03E8: "2",
    "\uA644": "2",
    \u14BF: "2",
    "\uA6EF": "2",
    "\uA9CF": "\u0662",
    "\u06F2": "\u0662",
    "\u0AE8": "\u0968",
    "\u{114D2}": "\u09E8",
    "\u0CE8": "\u0C68",
    "\u2461": "\u2781",
    \u01BB: "2\u0335",
    "\u{1F103}": "2,",
    "\u2489": "2.",
    "\u33F5": "22\u65E5",
    "\u336E": "22\u70B9",
    "\u33F6": "23\u65E5",
    "\u336F": "23\u70B9",
    "\u33F7": "24\u65E5",
    "\u3370": "24\u70B9",
    "\u33F8": "25\u65E5",
    "\u33F9": "26\u65E5",
    "\u33FA": "27\u65E5",
    "\u33FB": "28\u65E5",
    "\u33FC": "29\u65E5",
    "\u33F4": "2l\u65E5",
    "\u336D": "2l\u70B9",
    "\u249B": "2O.",
    "\u33F3": "2O\u65E5",
    "\u336C": "2O\u70B9",
    "\u0DE9": "\u0DE8\u0DCF",
    "\u0DEF": "\u0DE8\u0DD3",
    "\u33E1": "2\u65E5",
    "\u32C1": "2\u6708",
    "\u335A": "2\u70B9",
    "\u{1D206}": "3",
    "\u{1D7D1}": "3",
    "\u{1D7DB}": "3",
    "\u{1D7E5}": "3",
    "\u{1D7EF}": "3",
    "\u{1D7F9}": "3",
    "\u{1FBF3}": "3",
    "\uA7AB": "3",
    \u021C: "3",
    \u01B7: "3",
    "\uA76A": "3",
    "\u2CCC": "3",
    \u0417: "3",
    \u04E0: "3",
    "\u{16F3B}": "3",
    "\u{118CA}": "3",
    "\u06F3": "\u0663",
    "\u{1E8C9}": "\u0663",
    "\u0AE9": "\u0969",
    "\u2462": "\u2782",
    \u0498: "3\u0326",
    "\u{1F104}": "3,",
    "\u248A": "3.",
    "\u33FE": "3l\u65E5",
    "\u33FD": "3O\u65E5",
    "\u33E2": "3\u65E5",
    "\u32C2": "3\u6708",
    "\u335B": "3\u70B9",
    "\u{1D7D2}": "4",
    "\u{1D7DC}": "4",
    "\u{1D7E6}": "4",
    "\u{1D7F0}": "4",
    "\u{1D7FA}": "4",
    "\u{1FBF4}": "4",
    \u13CE: "4",
    "\u{118AF}": "4",
    "\u06F4": "\u0664",
    "\u0AEA": "\u096A",
    "\u2463": "\u2783",
    "\u{1F105}": "4,",
    "\u248B": "4.",
    \u1530: "4\xB7",
    "\u33E3": "4\u65E5",
    "\u32C3": "4\u6708",
    "\u335C": "4\u70B9",
    "\u{1D7D3}": "5",
    "\u{1D7DD}": "5",
    "\u{1D7E7}": "5",
    "\u{1D7F1}": "5",
    "\u{1D7FB}": "5",
    "\u{1FBF5}": "5",
    \u01BC: "5",
    "\u{118BB}": "5",
    "\u2464": "\u2784",
    "\u{1F106}": "5,",
    "\u248C": "5.",
    "\u33E4": "5\u65E5",
    "\u32C4": "5\u6708",
    "\u335D": "5\u70B9",
    "\u{1D7D4}": "6",
    "\u{1D7DE}": "6",
    "\u{1D7E8}": "6",
    "\u{1D7F2}": "6",
    "\u{1D7FC}": "6",
    "\u{1FBF6}": "6",
    "\u2CD2": "6",
    \u0431: "6",
    \u13EE: "6",
    "\u{118D5}": "6",
    "\u06F6": "\u0666",
    "\u{114D6}": "\u09EC",
    "\u2465": "\u2785",
    "\u{1F107}": "6,",
    "\u248D": "6.",
    "\u33E5": "6\u65E5",
    "\u32C5": "6\u6708",
    "\u335E": "6\u70B9",
    "\u{1D212}": "7",
    "\u{1D7D5}": "7",
    "\u{1D7DF}": "7",
    "\u{1D7E9}": "7",
    "\u{1D7F3}": "7",
    "\u{1D7FD}": "7",
    "\u{1FBF7}": "7",
    "\u{104D2}": "7",
    "\u{118C6}": "7",
    "\u2466": "\u2786",
    "\u{1F108}": "7,",
    "\u248E": "7.",
    "\u33E6": "7\u65E5",
    "\u32C6": "7\u6708",
    "\u335F": "7\u70B9",
    "\u0B03": "8",
    "\u09EA": "8",
    "\u0A6A": "8",
    "\u{1E8CB}": "8",
    "\u{1D7D6}": "8",
    "\u{1D7E0}": "8",
    "\u{1D7EA}": "8",
    "\u{1D7F4}": "8",
    "\u{1D7FE}": "8",
    "\u{1FBF8}": "8",
    \u0223: "8",
    \u0222: "8",
    "\u{1031A}": "8",
    "\u0AEE": "\u096E",
    "\u2467": "\u2787",
    "\u{1F109}": "8,",
    "\u248F": "8.",
    "\u33E7": "8\u65E5",
    "\u32C7": "8\u6708",
    "\u3360": "8\u70B9",
    "\u0A67": "9",
    "\u0B68": "9",
    "\u09ED": "9",
    "\u0D6D": "9",
    "\u{1D7D7}": "9",
    "\u{1D7E1}": "9",
    "\u{1D7EB}": "9",
    "\u{1D7F5}": "9",
    "\u{1D7FF}": "9",
    "\u{1FBF9}": "9",
    "\uA76E": "9",
    "\u2CCA": "9",
    "\u{118CC}": "9",
    "\u{118AC}": "9",
    "\u{118D6}": "9",
    "\u0967": "\u0669",
    "\u{118E4}": "\u0669",
    "\u06F9": "\u0669",
    "\u0CEF": "\u0C6F",
    "\u2468": "\u2788",
    "\u{1F10A}": "9,",
    "\u2490": "9.",
    "\u33E8": "9\u65E5",
    "\u32C8": "9\u6708",
    "\u3361": "9\u70B9",
    "\u237A": "a",
    \uFF41: "a",
    "\u{1D41A}": "a",
    "\u{1D44E}": "a",
    "\u{1D482}": "a",
    "\u{1D4B6}": "a",
    "\u{1D4EA}": "a",
    "\u{1D51E}": "a",
    "\u{1D552}": "a",
    "\u{1D586}": "a",
    "\u{1D5BA}": "a",
    "\u{1D5EE}": "a",
    "\u{1D622}": "a",
    "\u{1D656}": "a",
    "\u{1D68A}": "a",
    \u0251: "a",
    \u03B1: "a",
    "\u{1D6C2}": "a",
    "\u{1D6FC}": "a",
    "\u{1D736}": "a",
    "\u{1D770}": "a",
    "\u{1D7AA}": "a",
    \u0430: "a",
    "\u2DF6": "\u0363",
    \uFF21: "A",
    "\u{1D400}": "A",
    "\u{1D434}": "A",
    "\u{1D468}": "A",
    "\u{1D49C}": "A",
    "\u{1D4D0}": "A",
    "\u{1D504}": "A",
    "\u{1D538}": "A",
    "\u{1D56C}": "A",
    "\u{1D5A0}": "A",
    "\u{1D5D4}": "A",
    "\u{1D608}": "A",
    "\u{1D63C}": "A",
    "\u{1D670}": "A",
    \u0391: "A",
    "\u{1D6A8}": "A",
    "\u{1D6E2}": "A",
    "\u{1D71C}": "A",
    "\u{1D756}": "A",
    "\u{1D790}": "A",
    \u0410: "A",
    \u13AA: "A",
    \u15C5: "A",
    "\uA4EE": "A",
    "\u{16F40}": "A",
    "\u{102A0}": "A",
    "\u2376": "a\u0332",
    \u01CE: "\u0103",
    \u01CD: "\u0102",
    \u0227: "\xE5",
    \u0226: "\xC5",
    \u1E9A: "\u1EA3",
    "\u2100": "a/c",
    "\u2101": "a/s",
    "\uA733": "aa",
    "\uA732": "AA",
    \u00E6: "ae",
    \u04D5: "ae",
    \u00C6: "AE",
    \u04D4: "AE",
    "\uA735": "ao",
    "\uA734": "AO",
    "\u{1F707}": "AR",
    "\uA737": "au",
    "\uA736": "AU",
    "\uA739": "av",
    "\uA73B": "av",
    "\uA738": "AV",
    "\uA73A": "AV",
    "\uA73D": "ay",
    "\uA73C": "AY",
    "\uAB7A": "\u1D00",
    "\u2200": "\u2C6F",
    "\u{1D217}": "\u2C6F",
    \u15C4: "\u2C6F",
    "\uA4EF": "\u2C6F",
    "\u{1041F}": "\u2C70",
    "\u{1D41B}": "b",
    "\u{1D44F}": "b",
    "\u{1D483}": "b",
    "\u{1D4B7}": "b",
    "\u{1D4EB}": "b",
    "\u{1D51F}": "b",
    "\u{1D553}": "b",
    "\u{1D587}": "b",
    "\u{1D5BB}": "b",
    "\u{1D5EF}": "b",
    "\u{1D623}": "b",
    "\u{1D657}": "b",
    "\u{1D68B}": "b",
    \u0184: "b",
    \u042C: "b",
    \u13CF: "b",
    \u1472: "b",
    \u15AF: "b",
    \uFF22: "B",
    \u212C: "B",
    "\u{1D401}": "B",
    "\u{1D435}": "B",
    "\u{1D469}": "B",
    "\u{1D4D1}": "B",
    "\u{1D505}": "B",
    "\u{1D539}": "B",
    "\u{1D56D}": "B",
    "\u{1D5A1}": "B",
    "\u{1D5D5}": "B",
    "\u{1D609}": "B",
    "\u{1D63D}": "B",
    "\u{1D671}": "B",
    "\uA7B4": "B",
    \u0392: "B",
    "\u{1D6A9}": "B",
    "\u{1D6E3}": "B",
    "\u{1D71D}": "B",
    "\u{1D757}": "B",
    "\u{1D791}": "B",
    \u0412: "B",
    \u13F4: "B",
    \u15F7: "B",
    "\uA4D0": "B",
    "\u{10282}": "B",
    "\u{102A1}": "B",
    "\u{10301}": "B",
    \u0253: "b\u0314",
    \u1473: "b\u0307",
    \u0183: "b\u0304",
    \u0182: "b\u0304",
    \u0411: "b\u0304",
    \u0180: "b\u0335",
    \u048D: "b\u0335",
    \u048C: "b\u0335",
    \u0463: "b\u0335",
    \u0462: "b\u0335",
    \u147F: "b\xB7",
    \u1481: "b\u0307\xB7",
    \u1488: "b'",
    \u042B: "bl",
    \u0432: "\u0299",
    "\u13FC": "\u0299",
    \uFF43: "c",
    "\u217D": "c",
    "\u{1D41C}": "c",
    "\u{1D450}": "c",
    "\u{1D484}": "c",
    "\u{1D4B8}": "c",
    "\u{1D4EC}": "c",
    "\u{1D520}": "c",
    "\u{1D554}": "c",
    "\u{1D588}": "c",
    "\u{1D5BC}": "c",
    "\u{1D5F0}": "c",
    "\u{1D624}": "c",
    "\u{1D658}": "c",
    "\u{1D68C}": "c",
    "\u1D04": "c",
    \u03F2: "c",
    "\u2CA5": "c",
    \u0441: "c",
    "\uABAF": "c",
    "\u{1043D}": "c",
    "\u2DED": "\u0368",
    "\u{1F74C}": "C",
    "\u{118F2}": "C",
    "\u{118E9}": "C",
    \uFF23: "C",
    "\u216D": "C",
    \u2102: "C",
    \u212D: "C",
    "\u{1D402}": "C",
    "\u{1D436}": "C",
    "\u{1D46A}": "C",
    "\u{1D49E}": "C",
    "\u{1D4D2}": "C",
    "\u{1D56E}": "C",
    "\u{1D5A2}": "C",
    "\u{1D5D6}": "C",
    "\u{1D60A}": "C",
    "\u{1D63E}": "C",
    "\u{1D672}": "C",
    "\u03F9": "C",
    "\u2CA4": "C",
    \u0421: "C",
    \u13DF: "C",
    "\uA4DA": "C",
    "\u{102A2}": "C",
    "\u{10302}": "C",
    "\u{10415}": "C",
    "\u{1051C}": "C",
    "\xA2": "c\u0338",
    "\u023C": "c\u0338",
    "\u20A1": "C\u20EB",
    "\u{1F16E}": "C\u20E0",
    \u00E7: "c\u0326",
    \u04AB: "c\u0326",
    \u00C7: "C\u0326",
    \u04AA: "C\u0326",
    \u0187: "C'",
    "\u2105": "c/o",
    "\u2106": "c/u",
    "\u{1F16D}": "\u33C4	\u20DD",
    "\u22F4": "\uA793",
    \u025B: "\uA793",
    \u03B5: "\uA793",
    "\u03F5": "\uA793",
    "\u{1D6C6}": "\uA793",
    "\u{1D6DC}": "\uA793",
    "\u{1D700}": "\uA793",
    "\u{1D716}": "\uA793",
    "\u{1D73A}": "\uA793",
    "\u{1D750}": "\uA793",
    "\u{1D774}": "\uA793",
    "\u{1D78A}": "\uA793",
    "\u{1D7AE}": "\uA793",
    "\u{1D7C4}": "\uA793",
    "\u2C89": "\uA793",
    \u0454: "\uA793",
    "\u0511": "\uA793",
    "\uAB9B": "\uA793",
    "\u{118CE}": "\uA793",
    "\u{10429}": "\uA793",
    "\u20AC": "\uA792",
    "\u2C88": "\uA792",
    \u0404: "\uA792",
    "\u2377": "\uA793\u0332",
    "\u037D": "\uA73F",
    "\u03FF": "\uA73E",
    "\u217E": "d",
    "\u2146": "d",
    "\u{1D41D}": "d",
    "\u{1D451}": "d",
    "\u{1D485}": "d",
    "\u{1D4B9}": "d",
    "\u{1D4ED}": "d",
    "\u{1D521}": "d",
    "\u{1D555}": "d",
    "\u{1D589}": "d",
    "\u{1D5BD}": "d",
    "\u{1D5F1}": "d",
    "\u{1D625}": "d",
    "\u{1D659}": "d",
    "\u{1D68D}": "d",
    "\u0501": "d",
    \u13E7: "d",
    \u146F: "d",
    "\uA4D2": "d",
    "\u216E": "D",
    "\u2145": "D",
    "\u{1D403}": "D",
    "\u{1D437}": "D",
    "\u{1D46B}": "D",
    "\u{1D49F}": "D",
    "\u{1D4D3}": "D",
    "\u{1D507}": "D",
    "\u{1D53B}": "D",
    "\u{1D56F}": "D",
    "\u{1D5A3}": "D",
    "\u{1D5D7}": "D",
    "\u{1D60B}": "D",
    "\u{1D63F}": "D",
    "\u{1D673}": "D",
    \u13A0: "D",
    \u15DE: "D",
    \u15EA: "D",
    "\uA4D3": "D",
    \u0257: "d\u0314",
    \u0256: "d\u0328",
    \u018C: "d\u0304",
    \u0111: "d\u0335",
    \u0110: "D\u0335",
    \u00D0: "D\u0335",
    \u0189: "D\u0335",
    "\u20AB": "d\u0335\u0331",
    "\uA77A": "\uA779",
    \u147B: "d\xB7",
    \u1487: "d'",
    \u02A4: "d\u021D",
    \u01F3: "dz",
    \u02A3: "dz",
    \u01F2: "Dz",
    \u01F1: "DZ",
    \u01C6: "d\u017E",
    \u01C5: "D\u017E",
    \u01C4: "D\u017D",
    \u02A5: "d\u0291",
    "\uAB70": "\u1D05",
    "\u2E39": "\u1E9F",
    \u03B4: "\u1E9F",
    "\u{1D6C5}": "\u1E9F",
    "\u{1D6FF}": "\u1E9F",
    "\u{1D739}": "\u1E9F",
    "\u{1D773}": "\u1E9F",
    "\u{1D7AD}": "\u1E9F",
    \u056E: "\u1E9F",
    \u1577: "\u1E9F",
    "\u212E": "e",
    \uFF45: "e",
    \u212F: "e",
    "\u2147": "e",
    "\u{1D41E}": "e",
    "\u{1D452}": "e",
    "\u{1D486}": "e",
    "\u{1D4EE}": "e",
    "\u{1D522}": "e",
    "\u{1D556}": "e",
    "\u{1D58A}": "e",
    "\u{1D5BE}": "e",
    "\u{1D5F2}": "e",
    "\u{1D626}": "e",
    "\u{1D65A}": "e",
    "\u{1D68E}": "e",
    "\uAB32": "e",
    \u0435: "e",
    \u04BD: "e",
    "\u2DF7": "\u0364",
    "\u22FF": "E",
    \uFF25: "E",
    \u2130: "E",
    "\u{1D404}": "E",
    "\u{1D438}": "E",
    "\u{1D46C}": "E",
    "\u{1D4D4}": "E",
    "\u{1D508}": "E",
    "\u{1D53C}": "E",
    "\u{1D570}": "E",
    "\u{1D5A4}": "E",
    "\u{1D5D8}": "E",
    "\u{1D60C}": "E",
    "\u{1D640}": "E",
    "\u{1D674}": "E",
    \u0395: "E",
    "\u{1D6AC}": "E",
    "\u{1D6E6}": "E",
    "\u{1D720}": "E",
    "\u{1D75A}": "E",
    "\u{1D794}": "E",
    \u0415: "E",
    "\u2D39": "E",
    \u13AC: "E",
    "\uA4F0": "E",
    "\u{118A6}": "E",
    "\u{118AE}": "E",
    "\u{10286}": "E",
    \u011B: "\u0115",
    \u011A: "\u0114",
    "\u0247": "e\u0338",
    "\u0246": "E\u0338",
    \u04BF: "e\u0328",
    "\uAB7C": "\u1D07",
    \u0259: "\u01DD",
    \u04D9: "\u01DD",
    "\u2203": "\u018E",
    "\u2D3A": "\u018E",
    "\uA4F1": "\u018E",
    \u025A: "\u01DD\u02DE",
    "\u1D14": "\u01DDo",
    "\uAB41": "\u01DDo\u0338",
    "\uAB42": "\u01DDo\u0335",
    \u04D8: "\u018F",
    "\u{1D221}": "\u0190",
    \u2107: "\u0190",
    "\u0510": "\u0190",
    \u13CB: "\u0190",
    "\u{16F2D}": "\u0190",
    "\u{10401}": "\u0190",
    "\u1D9F": "\u1D4B",
    "\u1D08": "\u025C",
    \u0437: "\u025C",
    \u0499: "\u025C\u0326",
    "\u{10442}": "\u025E",
    "\uA79D": "\u029A",
    "\u{1042A}": "\u029A",
    "\u{1D41F}": "f",
    "\u{1D453}": "f",
    "\u{1D487}": "f",
    "\u{1D4BB}": "f",
    "\u{1D4EF}": "f",
    "\u{1D523}": "f",
    "\u{1D557}": "f",
    "\u{1D58B}": "f",
    "\u{1D5BF}": "f",
    "\u{1D5F3}": "f",
    "\u{1D627}": "f",
    "\u{1D65B}": "f",
    "\u{1D68F}": "f",
    "\uAB35": "f",
    "\uA799": "f",
    \u017F: "f",
    "\u1E9D": "f",
    \u0584: "f",
    "\u{1D213}": "F",
    \u2131: "F",
    "\u{1D405}": "F",
    "\u{1D439}": "F",
    "\u{1D46D}": "F",
    "\u{1D4D5}": "F",
    "\u{1D509}": "F",
    "\u{1D53D}": "F",
    "\u{1D571}": "F",
    "\u{1D5A5}": "F",
    "\u{1D5D9}": "F",
    "\u{1D60D}": "F",
    "\u{1D641}": "F",
    "\u{1D675}": "F",
    "\uA798": "F",
    \u03DC: "F",
    "\u{1D7CA}": "F",
    \u15B4: "F",
    "\uA4DD": "F",
    "\u{118C2}": "F",
    "\u{118A2}": "F",
    "\u{10287}": "F",
    "\u{102A5}": "F",
    "\u{10525}": "F",
    \u0192: "f\u0326",
    \u0191: "F\u0326",
    "\u1D6E": "f\u0334",
    "\u213B": "FAX",
    \uFB00: "ff",
    \uFB03: "ffi",
    \uFB04: "ffl",
    \uFB01: "fi",
    \uFB02: "fl",
    \u02A9: "f\u014B",
    \u15B5: "\u2132",
    "\uA4DE": "\u2132",
    "\u{1D230}": "\uA7FB",
    \u15B7: "\uA7FB",
    \uFF47: "g",
    \u210A: "g",
    "\u{1D420}": "g",
    "\u{1D454}": "g",
    "\u{1D488}": "g",
    "\u{1D4F0}": "g",
    "\u{1D524}": "g",
    "\u{1D558}": "g",
    "\u{1D58C}": "g",
    "\u{1D5C0}": "g",
    "\u{1D5F4}": "g",
    "\u{1D628}": "g",
    "\u{1D65C}": "g",
    "\u{1D690}": "g",
    \u0261: "g",
    "\u1D83": "g",
    \u018D: "g",
    \u0581: "g",
    "\u{1D406}": "G",
    "\u{1D43A}": "G",
    "\u{1D46E}": "G",
    "\u{1D4A2}": "G",
    "\u{1D4D6}": "G",
    "\u{1D50A}": "G",
    "\u{1D53E}": "G",
    "\u{1D572}": "G",
    "\u{1D5A6}": "G",
    "\u{1D5DA}": "G",
    "\u{1D60E}": "G",
    "\u{1D642}": "G",
    "\u{1D676}": "G",
    "\u050C": "G",
    \u13C0: "G",
    \u13F3: "G",
    "\uA4D6": "G",
    "\u1DA2": "\u1D4D",
    \u0260: "g\u0314",
    \u01E7: "\u011F",
    \u01E6: "\u011E",
    \u01F5: "\u0123",
    \u01E5: "g\u0335",
    \u01E4: "G\u0335",
    \u0193: "G'",
    "\u050D": "\u0262",
    "\uAB90": "\u0262",
    "\u13FB": "\u0262",
    \uFF48: "h",
    \u210E: "h",
    "\u{1D421}": "h",
    "\u{1D489}": "h",
    "\u{1D4BD}": "h",
    "\u{1D4F1}": "h",
    "\u{1D525}": "h",
    "\u{1D559}": "h",
    "\u{1D58D}": "h",
    "\u{1D5C1}": "h",
    "\u{1D5F5}": "h",
    "\u{1D629}": "h",
    "\u{1D65D}": "h",
    "\u{1D691}": "h",
    \u04BB: "h",
    \u0570: "h",
    \u13C2: "h",
    \uFF28: "H",
    \u210B: "H",
    \u210C: "H",
    \u210D: "H",
    "\u{1D407}": "H",
    "\u{1D43B}": "H",
    "\u{1D46F}": "H",
    "\u{1D4D7}": "H",
    "\u{1D573}": "H",
    "\u{1D5A7}": "H",
    "\u{1D5DB}": "H",
    "\u{1D60F}": "H",
    "\u{1D643}": "H",
    "\u{1D677}": "H",
    \u0397: "H",
    "\u{1D6AE}": "H",
    "\u{1D6E8}": "H",
    "\u{1D722}": "H",
    "\u{1D75C}": "H",
    "\u{1D796}": "H",
    "\u2C8E": "H",
    \u041D: "H",
    \u13BB: "H",
    \u157C: "H",
    "\uA4E7": "H",
    "\u{102CF}": "H",
    "\u1D78": "\u1D34",
    \u0266: "h\u0314",
    "\uA695": "h\u0314",
    \u13F2: "h\u0314",
    "\u2C67": "H\u0329",
    \u04A2: "H\u0329",
    \u0127: "h\u0335",
    \u210F: "h\u0335",
    \u045B: "h\u0335",
    \u0126: "H\u0335",
    "\u04C9": "H\u0326",
    \u04C7: "H\u0326",
    \u043D: "\u029C",
    "\uAB8B": "\u029C",
    \u04A3: "\u029C\u0329",
    "\u04CA": "\u029C\u0326",
    \u04C8: "\u029C\u0326",
    "\u050A": "\u01F6",
    "\uAB80": "\u2C76",
    "\u0370": "\u2C75",
    \u13A8: "\u2C75",
    \u13B0: "\u2C75",
    "\uA6B1": "\u2C75",
    "\uA795": "\uA727",
    "\u02DB": "i",
    "\u2373": "i",
    \uFF49: "i",
    "\u2170": "i",
    \u2139: "i",
    "\u2148": "i",
    "\u{1D422}": "i",
    "\u{1D456}": "i",
    "\u{1D48A}": "i",
    "\u{1D4BE}": "i",
    "\u{1D4F2}": "i",
    "\u{1D526}": "i",
    "\u{1D55A}": "i",
    "\u{1D58E}": "i",
    "\u{1D5C2}": "i",
    "\u{1D5F6}": "i",
    "\u{1D62A}": "i",
    "\u{1D65E}": "i",
    "\u{1D692}": "i",
    \u0131: "i",
    "\u{1D6A4}": "i",
    \u026A: "i",
    \u0269: "i",
    \u03B9: "i",
    \u1FBE: "i",
    \u037A: "i",
    "\u{1D6CA}": "i",
    "\u{1D704}": "i",
    "\u{1D73E}": "i",
    "\u{1D778}": "i",
    "\u{1D7B2}": "i",
    \u0456: "i",
    "\uA647": "i",
    "\u04CF": "i",
    "\uAB75": "i",
    \u13A5: "i",
    "\u{118C3}": "i",
    "\u24DB": "\u24BE",
    "\u2378": "i\u0332",
    \u01D0: "\u012D",
    \u01CF: "\u012C",
    \u0268: "i\u0335",
    "\u1D7B": "i\u0335",
    "\u1D7C": "i\u0335",
    "\u2171": "ii",
    "\u2172": "iii",
    \u0133: "ij",
    "\u2173": "iv",
    "\u2178": "ix",
    \uFF4A: "j",
    "\u2149": "j",
    "\u{1D423}": "j",
    "\u{1D457}": "j",
    "\u{1D48B}": "j",
    "\u{1D4BF}": "j",
    "\u{1D4F3}": "j",
    "\u{1D527}": "j",
    "\u{1D55B}": "j",
    "\u{1D58F}": "j",
    "\u{1D5C3}": "j",
    "\u{1D5F7}": "j",
    "\u{1D62B}": "j",
    "\u{1D65F}": "j",
    "\u{1D693}": "j",
    \u03F3: "j",
    \u0458: "j",
    \uFF2A: "J",
    "\u{1D409}": "J",
    "\u{1D43D}": "J",
    "\u{1D471}": "J",
    "\u{1D4A5}": "J",
    "\u{1D4D9}": "J",
    "\u{1D50D}": "J",
    "\u{1D541}": "J",
    "\u{1D575}": "J",
    "\u{1D5A9}": "J",
    "\u{1D5DD}": "J",
    "\u{1D611}": "J",
    "\u{1D645}": "J",
    "\u{1D679}": "J",
    "\uA7B2": "J",
    "\u037F": "J",
    \u0408: "J",
    \u13AB: "J",
    \u148D: "J",
    "\uA4D9": "J",
    "\u0249": "j\u0335",
    "\u0248": "J\u0335",
    \u1499: "J\xB7",
    "\u{1D6A5}": "\u0237",
    \u0575: "\u0237",
    "\uAB7B": "\u1D0A",
    "\u{1D424}": "k",
    "\u{1D458}": "k",
    "\u{1D48C}": "k",
    "\u{1D4C0}": "k",
    "\u{1D4F4}": "k",
    "\u{1D528}": "k",
    "\u{1D55C}": "k",
    "\u{1D590}": "k",
    "\u{1D5C4}": "k",
    "\u{1D5F8}": "k",
    "\u{1D62C}": "k",
    "\u{1D660}": "k",
    "\u{1D694}": "k",
    \u212A: "K",
    \uFF2B: "K",
    "\u{1D40A}": "K",
    "\u{1D43E}": "K",
    "\u{1D472}": "K",
    "\u{1D4A6}": "K",
    "\u{1D4DA}": "K",
    "\u{1D50E}": "K",
    "\u{1D542}": "K",
    "\u{1D576}": "K",
    "\u{1D5AA}": "K",
    "\u{1D5DE}": "K",
    "\u{1D612}": "K",
    "\u{1D646}": "K",
    "\u{1D67A}": "K",
    \u039A: "K",
    "\u{1D6B1}": "K",
    "\u{1D6EB}": "K",
    "\u{1D725}": "K",
    "\u{1D75F}": "K",
    "\u{1D799}": "K",
    "\u2C94": "K",
    \u041A: "K",
    \u13E6: "K",
    \u16D5: "K",
    "\uA4D7": "K",
    "\u{10518}": "K",
    \u0199: "k\u0314",
    "\u2C69": "K\u0329",
    \u049A: "K\u0329",
    "\u20AD": "K\u0335",
    "\uA740": "K\u0335",
    \u049E: "K\u0335",
    \u0198: "K'",
    "\u05C0": "l",
    "|": "l",
    "\u2223": "l",
    "\u23FD": "l",
    "\uFFE8": "l",
    "\u0661": "l",
    "\u06F1": "l",
    "\u{10320}": "l",
    "\u{1E8C7}": "l",
    "\u{1D7CF}": "l",
    "\u{1D7D9}": "l",
    "\u{1D7E3}": "l",
    "\u{1D7ED}": "l",
    "\u{1D7F7}": "l",
    "\u{1FBF1}": "l",
    I: D3e,
    \uFF29: "l",
    "\u2160": "l",
    \u2110: "l",
    \u2111: "l",
    "\u{1D408}": "l",
    "\u{1D43C}": "l",
    "\u{1D470}": "l",
    "\u{1D4D8}": "l",
    "\u{1D540}": "l",
    "\u{1D574}": "l",
    "\u{1D5A8}": "l",
    "\u{1D5DC}": "l",
    "\u{1D610}": "l",
    "\u{1D644}": "l",
    "\u{1D678}": "l",
    \u0196: "l",
    \uFF4C: "l",
    "\u217C": "l",
    \u2113: "l",
    "\u{1D425}": "l",
    "\u{1D459}": "l",
    "\u{1D48D}": "l",
    "\u{1D4C1}": "l",
    "\u{1D4F5}": "l",
    "\u{1D529}": "l",
    "\u{1D55D}": "l",
    "\u{1D591}": "l",
    "\u{1D5C5}": "l",
    "\u{1D5F9}": "l",
    "\u{1D62D}": "l",
    "\u{1D661}": "l",
    "\u{1D695}": "l",
    \u01C0: "l",
    \u0399: "l",
    "\u{1D6B0}": "l",
    "\u{1D6EA}": "l",
    "\u{1D724}": "l",
    "\u{1D75E}": "l",
    "\u{1D798}": "l",
    "\u2C92": "l",
    \u0406: "l",
    \u04C0: "l",
    \u05D5: "l",
    \u05DF: "l",
    \u0627: "l",
    "\u{1EE00}": "l",
    "\u{1EE80}": "l",
    \uFE8E: "l",
    \uFE8D: "l",
    "\u07CA": "l",
    "\u2D4F": "l",
    \u16C1: "l",
    "\uA4F2": "l",
    "\u{16F28}": "l",
    "\u{1028A}": "l",
    "\u{10309}": "l",
    "\u{1D22A}": "L",
    "\u216C": "L",
    \u2112: "L",
    "\u{1D40B}": "L",
    "\u{1D43F}": "L",
    "\u{1D473}": "L",
    "\u{1D4DB}": "L",
    "\u{1D50F}": "L",
    "\u{1D543}": "L",
    "\u{1D577}": "L",
    "\u{1D5AB}": "L",
    "\u{1D5DF}": "L",
    "\u{1D613}": "L",
    "\u{1D647}": "L",
    "\u{1D67B}": "L",
    "\u2CD0": "L",
    \u13DE: "L",
    \u14AA: "L",
    "\uA4E1": "L",
    "\u{16F16}": "L",
    "\u{118A3}": "L",
    "\u{118B2}": "L",
    "\u{1041B}": "L",
    "\u{10526}": "L",
    \uFD3C: "l\u030B",
    \uFD3D: "l\u030B",
    \u0142: "l\u0338",
    \u0141: "L\u0338",
    \u026D: "l\u0328",
    \u0197: "l\u0335",
    \u019A: "l\u0335",
    \u026B: "l\u0334",
    \u0625: "l\u0655",
    \uFE88: "l\u0655",
    \uFE87: "l\u0655",
    \u0673: "l\u0655",
    \u0140: "l\xB7",
    \u013F: "l\xB7",
    \u14B7: "l\xB7",
    "\u{1F102}": "l,",
    "\u2488": "l.",
    \u05F1: "l'",
    "\u2493": "l2.",
    "\u33EB": "l2\u65E5",
    "\u32CB": "l2\u6708",
    "\u3364": "l2\u70B9",
    "\u2494": "l3.",
    "\u33EC": "l3\u65E5",
    "\u3365": "l3\u70B9",
    "\u2495": "l4.",
    "\u33ED": "l4\u65E5",
    "\u3366": "l4\u70B9",
    "\u2496": "l5.",
    "\u33EE": "l5\u65E5",
    "\u3367": "l5\u70B9",
    "\u2497": "l6.",
    "\u33EF": "l6\u65E5",
    "\u3368": "l6\u70B9",
    "\u2498": "l7.",
    "\u33F0": "l7\u65E5",
    "\u3369": "l7\u70B9",
    "\u2499": "l8.",
    "\u33F1": "l8\u65E5",
    "\u336A": "l8\u70B9",
    "\u249A": "l9.",
    "\u33F2": "l9\u65E5",
    "\u336B": "l9\u70B9",
    \u01C9: "lj",
    \u0132: "lJ",
    \u01C8: "Lj",
    \u01C7: "LJ",
    "\u2016": "ll",
    "\u2225": "ll",
    "\u2161": "ll",
    \u01C1: "ll",
    \u05F0: "ll",
    "\u{10199}": "l\u0335l\u0335",
    "\u2492": "ll.",
    "\u2162": "lll",
    "\u{10198}": "l\u0335l\u0335S\u0335",
    "\u33EA": "ll\u65E5",
    "\u32CA": "ll\u6708",
    "\u3363": "ll\u70B9",
    \u042E: "lO",
    "\u2491": "lO.",
    "\u33E9": "lO\u65E5",
    "\u32C9": "lO\u6708",
    "\u3362": "lO\u70B9",
    \u02AA: "ls",
    "\u20B6": "lt",
    "\u2163": "lV",
    "\u2168": "lX",
    \u026E: "l\u021D",
    \u02AB: "lz",
    \u0623: "l\u0674",
    \uFE84: "l\u0674",
    \uFE83: "l\u0674",
    \u0672: "l\u0674",
    \u0675: "l\u0674",
    \uFDF3: "l\u0643\u0628\u0631",
    \uFDF2: "l\u0644\u0644\u0651\u0670o",
    "\u33E0": "l\u65E5",
    "\u32C0": "l\u6708",
    "\u3359": "l\u70B9",
    "\u2CD1": "\u029F",
    "\uABAE": "\u029F",
    "\u{10443}": "\u029F",
    \uFF2D: "M",
    "\u216F": "M",
    \u2133: "M",
    "\u{1D40C}": "M",
    "\u{1D440}": "M",
    "\u{1D474}": "M",
    "\u{1D4DC}": "M",
    "\u{1D510}": "M",
    "\u{1D544}": "M",
    "\u{1D578}": "M",
    "\u{1D5AC}": "M",
    "\u{1D5E0}": "M",
    "\u{1D614}": "M",
    "\u{1D648}": "M",
    "\u{1D67C}": "M",
    \u039C: "M",
    "\u{1D6B3}": "M",
    "\u{1D6ED}": "M",
    "\u{1D727}": "M",
    "\u{1D761}": "M",
    "\u{1D79B}": "M",
    "\u03FA": "M",
    "\u2C98": "M",
    \u041C: "M",
    \u13B7: "M",
    \u15F0: "M",
    \u16D6: "M",
    "\uA4DF": "M",
    "\u{102B0}": "M",
    "\u{10311}": "M",
    "\u04CD": "M\u0326",
    "\u{1F76B}": "MB",
    "\u2DE8": "\u1DDF",
    "\u{1D427}": "n",
    "\u{1D45B}": "n",
    "\u{1D48F}": "n",
    "\u{1D4C3}": "n",
    "\u{1D4F7}": "n",
    "\u{1D52B}": "n",
    "\u{1D55F}": "n",
    "\u{1D593}": "n",
    "\u{1D5C7}": "n",
    "\u{1D5FB}": "n",
    "\u{1D62F}": "n",
    "\u{1D663}": "n",
    "\u{1D697}": "n",
    \u0578: "n",
    \u057C: "n",
    \uFF2E: "N",
    \u2115: "N",
    "\u{1D40D}": "N",
    "\u{1D441}": "N",
    "\u{1D475}": "N",
    "\u{1D4A9}": "N",
    "\u{1D4DD}": "N",
    "\u{1D511}": "N",
    "\u{1D579}": "N",
    "\u{1D5AD}": "N",
    "\u{1D5E1}": "N",
    "\u{1D615}": "N",
    "\u{1D649}": "N",
    "\u{1D67D}": "N",
    \u039D: "N",
    "\u{1D6B4}": "N",
    "\u{1D6EE}": "N",
    "\u{1D728}": "N",
    "\u{1D762}": "N",
    "\u{1D79C}": "N",
    "\u2C9A": "N",
    "\uA4E0": "N",
    "\u{10513}": "N",
    "\u{1018E}": "N\u030A",
    \u0273: "n\u0328",
    \u019E: "n\u0329",
    \u03B7: "n\u0329",
    "\u{1D6C8}": "n\u0329",
    "\u{1D702}": "n\u0329",
    "\u{1D73C}": "n\u0329",
    "\u{1D776}": "n\u0329",
    "\u{1D7B0}": "n\u0329",
    \u019D: "N\u0326",
    "\u1D70": "n\u0334",
    \u01CC: "nj",
    \u01CB: "Nj",
    \u01CA: "NJ",
    "\u2116": "No",
    "\u0377": "\u1D0E",
    \u0438: "\u1D0E",
    "\u{1044D}": "\u1D0E",
    \u0146: "\u0272",
    "\u0C02": "o",
    "\u0C82": "o",
    "\u0D02": "o",
    "\u0D82": "o",
    "\u0966": "o",
    "\u0A66": "o",
    "\u0AE6": "o",
    "\u0BE6": "o",
    "\u0C66": "o",
    "\u0CE6": "o",
    "\u0D66": "o",
    "\u0E50": "o",
    "\u0ED0": "o",
    "\u1040": "o",
    "\u0665": "o",
    "\u06F5": "o",
    \uFF4F: "o",
    \u2134: "o",
    "\u{1D428}": "o",
    "\u{1D45C}": "o",
    "\u{1D490}": "o",
    "\u{1D4F8}": "o",
    "\u{1D52C}": "o",
    "\u{1D560}": "o",
    "\u{1D594}": "o",
    "\u{1D5C8}": "o",
    "\u{1D5FC}": "o",
    "\u{1D630}": "o",
    "\u{1D664}": "o",
    "\u{1D698}": "o",
    "\u1D0F": "o",
    "\u1D11": "o",
    "\uAB3D": "o",
    \u03BF: "o",
    "\u{1D6D0}": "o",
    "\u{1D70A}": "o",
    "\u{1D744}": "o",
    "\u{1D77E}": "o",
    "\u{1D7B8}": "o",
    \u03C3: "o",
    "\u{1D6D4}": "o",
    "\u{1D70E}": "o",
    "\u{1D748}": "o",
    "\u{1D782}": "o",
    "\u{1D7BC}": "o",
    "\u2C9F": "o",
    \u043E: "o",
    "\u10FF": "o",
    \u0585: "o",
    \u05E1: "o",
    \u0647: "o",
    "\u{1EE24}": "o",
    "\u{1EE64}": "o",
    "\u{1EE84}": "o",
    \uFEEB: "o",
    \uFEEC: "o",
    \uFEEA: "o",
    \uFEE9: "o",
    \u06BE: "o",
    \uFBAC: "o",
    \uFBAD: "o",
    \uFBAB: "o",
    \uFBAA: "o",
    \u06C1: "o",
    \uFBA8: "o",
    \uFBA9: "o",
    \uFBA7: "o",
    \uFBA6: "o",
    \u06D5: "o",
    \u0D20: "o",
    \u101D: "o",
    "\u{104EA}": "o",
    "\u{118C8}": "o",
    "\u{118D7}": "o",
    "\u{1042C}": "o",
    "\u07C0": "O",
    "\u09E6": "O",
    "\u0B66": "O",
    "\u3007": "O",
    "\u{114D0}": "O",
    "\u{118E0}": "O",
    "\u{1D7CE}": "O",
    "\u{1D7D8}": "O",
    "\u{1D7E2}": "O",
    "\u{1D7EC}": "O",
    "\u{1D7F6}": "O",
    "\u{1FBF0}": "O",
    \uFF2F: "O",
    "\u{1D40E}": "O",
    "\u{1D442}": "O",
    "\u{1D476}": "O",
    "\u{1D4AA}": "O",
    "\u{1D4DE}": "O",
    "\u{1D512}": "O",
    "\u{1D546}": "O",
    "\u{1D57A}": "O",
    "\u{1D5AE}": "O",
    "\u{1D5E2}": "O",
    "\u{1D616}": "O",
    "\u{1D64A}": "O",
    "\u{1D67E}": "O",
    \u039F: "O",
    "\u{1D6B6}": "O",
    "\u{1D6F0}": "O",
    "\u{1D72A}": "O",
    "\u{1D764}": "O",
    "\u{1D79E}": "O",
    "\u2C9E": "O",
    \u041E: "O",
    \u0555: "O",
    "\u2D54": "O",
    \u12D0: "O",
    \u0B20: "O",
    "\u{104C2}": "O",
    "\uA4F3": "O",
    "\u{118B5}": "O",
    "\u{10292}": "O",
    "\u{102AB}": "O",
    "\u{10404}": "O",
    "\u{10516}": "O",
    "\u2070": "\xBA",
    "\u1D52": "\xBA",
    \u01D2: "\u014F",
    \u01D1: "\u014E",
    "\u06FF": "o\u0302",
    \u0150: "\xD6",
    \u00F8: "o\u0338",
    "\uAB3E": "o\u0338",
    \u00D8: "O\u0338",
    "\u2D41": "O\u0338",
    \u01FE: "O\u0338\u0301",
    \u0275: "o\u0335",
    "\uA74B": "o\u0335",
    \u04E9: "o\u0335",
    \u0473: "o\u0335",
    "\uAB8E": "o\u0335",
    "\uABBB": "o\u0335",
    "\u2296": "O\u0335",
    "\u229D": "O\u0335",
    "\u236C": "O\u0335",
    "\u{1D21A}": "O\u0335",
    "\u{1F714}": "O\u0335",
    \u019F: "O\u0335",
    "\uA74A": "O\u0335",
    \u03B8: "O\u0335",
    \u03D1: "O\u0335",
    "\u{1D6C9}": "O\u0335",
    "\u{1D6DD}": "O\u0335",
    "\u{1D703}": "O\u0335",
    "\u{1D717}": "O\u0335",
    "\u{1D73D}": "O\u0335",
    "\u{1D751}": "O\u0335",
    "\u{1D777}": "O\u0335",
    "\u{1D78B}": "O\u0335",
    "\u{1D7B1}": "O\u0335",
    "\u{1D7C5}": "O\u0335",
    \u0398: "O\u0335",
    "\u03F4": "O\u0335",
    "\u{1D6AF}": "O\u0335",
    "\u{1D6B9}": "O\u0335",
    "\u{1D6E9}": "O\u0335",
    "\u{1D6F3}": "O\u0335",
    "\u{1D723}": "O\u0335",
    "\u{1D72D}": "O\u0335",
    "\u{1D75D}": "O\u0335",
    "\u{1D767}": "O\u0335",
    "\u{1D797}": "O\u0335",
    "\u{1D7A1}": "O\u0335",
    \u04E8: "O\u0335",
    \u0472: "O\u0335",
    "\u2D31": "O\u0335",
    \u13BE: "O\u0335",
    \u13EB: "O\u0335",
    "\uAB74": "o\u031B",
    \uFCD9: "o\u0670",
    "\u{1F101}": "O,",
    "\u{1F100}": "O.",
    \u01A1: "o'",
    \u01A0: "O'",
    \u13A4: "O'",
    "%": "\xBA/\u2080",
    "\u066A": "\xBA/\u2080",
    "\u2052": "\xBA/\u2080",
    "\u2030": "\xBA/\u2080\u2080",
    "\u0609": "\xBA/\u2080\u2080",
    "\u2031": "\xBA/\u2080\u2080\u2080",
    "\u060A": "\xBA/\u2080\u2080\u2080",
    \u0153: "oe",
    \u0152: "OE",
    \u0276: "o\u1D07",
    "\u221E": "oo",
    "\uA74F": "oo",
    "\uA699": "oo",
    "\uA74E": "OO",
    "\uA698": "OO",
    \uFCD7: "o\u062C",
    \uFC51: "o\u062C",
    \uFCD8: "o\u0645",
    \uFC52: "o\u0645",
    \uFD93: "o\u0645\u062C",
    \uFD94: "o\u0645\u0645",
    \uFC53: "o\u0649",
    \uFC54: "o\u0649",
    "\u0D5F": "o\u0D30o",
    \u1010: "o\u102C",
    "\u3358": "O\u70B9",
    "\u2184": "\u0254",
    "\u1D10": "\u0254",
    "\u037B": "\u0254",
    "\u{1044B}": "\u0254",
    "\u2183": "\u0186",
    "\u03FD": "\u0186",
    "\uA4DB": "\u0186",
    "\u{10423}": "\u0186",
    "\uAB3F": "\u0254\u0338",
    "\uAB62": "\u0254e",
    "\u{1043F}": "\u0277",
    "\u2374": "p",
    \uFF50: "p",
    "\u{1D429}": "p",
    "\u{1D45D}": "p",
    "\u{1D491}": "p",
    "\u{1D4C5}": "p",
    "\u{1D4F9}": "p",
    "\u{1D52D}": "p",
    "\u{1D561}": "p",
    "\u{1D595}": "p",
    "\u{1D5C9}": "p",
    "\u{1D5FD}": "p",
    "\u{1D631}": "p",
    "\u{1D665}": "p",
    "\u{1D699}": "p",
    \u03C1: "p",
    \u03F1: "p",
    "\u{1D6D2}": "p",
    "\u{1D6E0}": "p",
    "\u{1D70C}": "p",
    "\u{1D71A}": "p",
    "\u{1D746}": "p",
    "\u{1D754}": "p",
    "\u{1D780}": "p",
    "\u{1D78E}": "p",
    "\u{1D7BA}": "p",
    "\u{1D7C8}": "p",
    "\u2CA3": "p",
    \u0440: "p",
    \uFF30: "P",
    \u2119: "P",
    "\u{1D40F}": "P",
    "\u{1D443}": "P",
    "\u{1D477}": "P",
    "\u{1D4AB}": "P",
    "\u{1D4DF}": "P",
    "\u{1D513}": "P",
    "\u{1D57B}": "P",
    "\u{1D5AF}": "P",
    "\u{1D5E3}": "P",
    "\u{1D617}": "P",
    "\u{1D64B}": "P",
    "\u{1D67F}": "P",
    \u03A1: "P",
    "\u{1D6B8}": "P",
    "\u{1D6F2}": "P",
    "\u{1D72C}": "P",
    "\u{1D766}": "P",
    "\u{1D7A0}": "P",
    "\u2CA2": "P",
    \u0420: "P",
    \u13E2: "P",
    \u146D: "P",
    "\uA4D1": "P",
    "\u{10295}": "P",
    \u01A5: "p\u0314",
    "\u1D7D": "p\u0335",
    \u1477: "p\xB7",
    \u1486: "P'",
    "\u1D29": "\u1D18",
    "\uABB2": "\u1D18",
    \u03C6: "\u0278",
    \u03D5: "\u0278",
    "\u{1D6D7}": "\u0278",
    "\u{1D6DF}": "\u0278",
    "\u{1D711}": "\u0278",
    "\u{1D719}": "\u0278",
    "\u{1D74B}": "\u0278",
    "\u{1D753}": "\u0278",
    "\u{1D785}": "\u0278",
    "\u{1D78D}": "\u0278",
    "\u{1D7BF}": "\u0278",
    "\u{1D7C7}": "\u0278",
    "\u2CAB": "\u0278",
    \u0444: "\u0278",
    "\u{1D42A}": "q",
    "\u{1D45E}": "q",
    "\u{1D492}": "q",
    "\u{1D4C6}": "q",
    "\u{1D4FA}": "q",
    "\u{1D52E}": "q",
    "\u{1D562}": "q",
    "\u{1D596}": "q",
    "\u{1D5CA}": "q",
    "\u{1D5FE}": "q",
    "\u{1D632}": "q",
    "\u{1D666}": "q",
    "\u{1D69A}": "q",
    "\u051B": "q",
    \u0563: "q",
    \u0566: "q",
    \u211A: "Q",
    "\u{1D410}": "Q",
    "\u{1D444}": "Q",
    "\u{1D478}": "Q",
    "\u{1D4AC}": "Q",
    "\u{1D4E0}": "Q",
    "\u{1D514}": "Q",
    "\u{1D57C}": "Q",
    "\u{1D5B0}": "Q",
    "\u{1D5E4}": "Q",
    "\u{1D618}": "Q",
    "\u{1D64C}": "Q",
    "\u{1D680}": "Q",
    "\u2D55": "Q",
    \u02A0: "q\u0314",
    "\u{1F700}": "QE",
    "\u1D90": "\u024B",
    "\u1D0B": "\u0138",
    \u03BA: "\u0138",
    \u03F0: "\u0138",
    "\u{1D6CB}": "\u0138",
    "\u{1D6DE}": "\u0138",
    "\u{1D705}": "\u0138",
    "\u{1D718}": "\u0138",
    "\u{1D73F}": "\u0138",
    "\u{1D752}": "\u0138",
    "\u{1D779}": "\u0138",
    "\u{1D78C}": "\u0138",
    "\u{1D7B3}": "\u0138",
    "\u{1D7C6}": "\u0138",
    "\u2C95": "\u0138",
    \u043A: "\u0138",
    "\uABB6": "\u0138",
    \u049B: "\u0138\u0329",
    \u049F: "\u0138\u0335",
    "\u{1D42B}": "r",
    "\u{1D45F}": "r",
    "\u{1D493}": "r",
    "\u{1D4C7}": "r",
    "\u{1D4FB}": "r",
    "\u{1D52F}": "r",
    "\u{1D563}": "r",
    "\u{1D597}": "r",
    "\u{1D5CB}": "r",
    "\u{1D5FF}": "r",
    "\u{1D633}": "r",
    "\u{1D667}": "r",
    "\u{1D69B}": "r",
    "\uAB47": "r",
    "\uAB48": "r",
    "\u1D26": "r",
    "\u2C85": "r",
    \u0433: "r",
    "\uAB81": "r",
    "\u{1D216}": "R",
    \u211B: "R",
    \u211C: "R",
    \u211D: "R",
    "\u{1D411}": "R",
    "\u{1D445}": "R",
    "\u{1D479}": "R",
    "\u{1D4E1}": "R",
    "\u{1D57D}": "R",
    "\u{1D5B1}": "R",
    "\u{1D5E5}": "R",
    "\u{1D619}": "R",
    "\u{1D64D}": "R",
    "\u{1D681}": "R",
    \u01A6: "R",
    \u13A1: "R",
    \u13D2: "R",
    "\u{104B4}": "R",
    \u1587: "R",
    "\uA4E3": "R",
    "\u{16F35}": "R",
    \u027D: "r\u0328",
    \u027C: "r\u0329",
    "\u024D": "r\u0335",
    \u0493: "r\u0335",
    "\u1D72": "r\u0334",
    \u0491: "r'",
    "\u{118E3}": "rn",
    m: C3e,
    "\u217F": "rn",
    "\u{1D426}": "rn",
    "\u{1D45A}": "rn",
    "\u{1D48E}": "rn",
    "\u{1D4C2}": "rn",
    "\u{1D4F6}": "rn",
    "\u{1D52A}": "rn",
    "\u{1D55E}": "rn",
    "\u{1D592}": "rn",
    "\u{1D5C6}": "rn",
    "\u{1D5FA}": "rn",
    "\u{1D62E}": "rn",
    "\u{1D662}": "rn",
    "\u{1D696}": "rn",
    "\u{11700}": "rn",
    "\u20A5": "rn\u0338",
    \u0271: "rn\u0326",
    "\u1D6F": "rn\u0334",
    "\u20A8": "Rs",
    "\uAB71": "\u0280",
    "\uABA2": "\u0280",
    \u044F: "\u1D19",
    "\u1D73": "\u027E\u0334",
    "\u2129": "\u027F",
    \uFF53: "s",
    "\u{1D42C}": "s",
    "\u{1D460}": "s",
    "\u{1D494}": "s",
    "\u{1D4C8}": "s",
    "\u{1D4FC}": "s",
    "\u{1D530}": "s",
    "\u{1D564}": "s",
    "\u{1D598}": "s",
    "\u{1D5CC}": "s",
    "\u{1D600}": "s",
    "\u{1D634}": "s",
    "\u{1D668}": "s",
    "\u{1D69C}": "s",
    "\uA731": "s",
    \u01BD: "s",
    \u0455: "s",
    "\uABAA": "s",
    "\u{118C1}": "s",
    "\u{10448}": "s",
    \uFF33: "S",
    "\u{1D412}": "S",
    "\u{1D446}": "S",
    "\u{1D47A}": "S",
    "\u{1D4AE}": "S",
    "\u{1D4E2}": "S",
    "\u{1D516}": "S",
    "\u{1D54A}": "S",
    "\u{1D57E}": "S",
    "\u{1D5B2}": "S",
    "\u{1D5E6}": "S",
    "\u{1D61A}": "S",
    "\u{1D64E}": "S",
    "\u{1D682}": "S",
    \u0405: "S",
    \u054F: "S",
    \u13D5: "S",
    \u13DA: "S",
    "\uA4E2": "S",
    "\u{16F3A}": "S",
    "\u{10296}": "S",
    "\u{10420}": "S",
    \u0282: "s\u0328",
    "\u1D74": "s\u0334",
    "\uA7B5": "\xDF",
    \u03B2: "\xDF",
    \u03D0: "\xDF",
    "\u{1D6C3}": "\xDF",
    "\u{1D6FD}": "\xDF",
    "\u{1D737}": "\xDF",
    "\u{1D771}": "\xDF",
    "\u{1D7AB}": "\xDF",
    \u13F0: "\xDF",
    "\u{1F75C}": "sss",
    \uFB06: "st",
    "\u222B": "\u0283",
    "\uAB4D": "\u0283",
    "\u2211": "\u01A9",
    "\u2140": "\u01A9",
    \u03A3: "\u01A9",
    "\u{1D6BA}": "\u01A9",
    "\u{1D6F4}": "\u01A9",
    "\u{1D72E}": "\u01A9",
    "\u{1D768}": "\u01A9",
    "\u{1D7A2}": "\u01A9",
    "\u2D49": "\u01A9",
    "\u222C": "\u0283\u0283",
    "\u222D": "\u0283\u0283\u0283",
    "\u2A0C": "\u0283\u0283\u0283\u0283",
    "\u{1D42D}": "t",
    "\u{1D461}": "t",
    "\u{1D495}": "t",
    "\u{1D4C9}": "t",
    "\u{1D4FD}": "t",
    "\u{1D531}": "t",
    "\u{1D565}": "t",
    "\u{1D599}": "t",
    "\u{1D5CD}": "t",
    "\u{1D601}": "t",
    "\u{1D635}": "t",
    "\u{1D669}": "t",
    "\u{1D69D}": "t",
    "\u22A4": "T",
    "\u27D9": "T",
    "\u{1F768}": "T",
    \uFF34: "T",
    "\u{1D413}": "T",
    "\u{1D447}": "T",
    "\u{1D47B}": "T",
    "\u{1D4AF}": "T",
    "\u{1D4E3}": "T",
    "\u{1D517}": "T",
    "\u{1D54B}": "T",
    "\u{1D57F}": "T",
    "\u{1D5B3}": "T",
    "\u{1D5E7}": "T",
    "\u{1D61B}": "T",
    "\u{1D64F}": "T",
    "\u{1D683}": "T",
    \u03A4: "T",
    "\u{1D6BB}": "T",
    "\u{1D6F5}": "T",
    "\u{1D72F}": "T",
    "\u{1D769}": "T",
    "\u{1D7A3}": "T",
    "\u2CA6": "T",
    \u0422: "T",
    \u13A2: "T",
    "\uA4D4": "T",
    "\u{16F0A}": "T",
    "\u{118BC}": "T",
    "\u{10297}": "T",
    "\u{102B1}": "T",
    "\u{10315}": "T",
    \u01AD: "t\u0314",
    "\u2361": "T\u0308",
    "\u023E": "T\u0338",
    \u021A: "\u0162",
    \u01AE: "T\u0328",
    \u04AC: "T\u0329",
    "\u20AE": "T\u20EB",
    \u0167: "t\u0335",
    \u0166: "T\u0335",
    "\u1D75": "t\u0334",
    \u10A0: "\uA786",
    "\uA728": "T3",
    \u02A8: "t\u0255",
    "\u2121": "TEL",
    "\uA777": "tf",
    \u02A6: "ts",
    \u02A7: "t\u0283",
    "\uA729": "t\u021D",
    \u03C4: "\u1D1B",
    "\u{1D6D5}": "\u1D1B",
    "\u{1D70F}": "\u1D1B",
    "\u{1D749}": "\u1D1B",
    "\u{1D783}": "\u1D1B",
    "\u{1D7BD}": "\u1D1B",
    \u0442: "\u1D1B",
    "\uAB72": "\u1D1B",
    \u04AD: "\u1D1B\u0329",
    \u0163: "\u01AB",
    \u021B: "\u01AB",
    \u13BF: "\u01AB",
    "\u{1D42E}": "u",
    "\u{1D462}": "u",
    "\u{1D496}": "u",
    "\u{1D4CA}": "u",
    "\u{1D4FE}": "u",
    "\u{1D532}": "u",
    "\u{1D566}": "u",
    "\u{1D59A}": "u",
    "\u{1D5CE}": "u",
    "\u{1D602}": "u",
    "\u{1D636}": "u",
    "\u{1D66A}": "u",
    "\u{1D69E}": "u",
    "\uA79F": "u",
    "\u1D1C": "u",
    "\uAB4E": "u",
    "\uAB52": "u",
    \u028B: "u",
    \u03C5: "u",
    "\u{1D6D6}": "u",
    "\u{1D710}": "u",
    "\u{1D74A}": "u",
    "\u{1D784}": "u",
    "\u{1D7BE}": "u",
    \u057D: "u",
    "\u{104F6}": "u",
    "\u{118D8}": "u",
    "\u222A": "U",
    "\u22C3": "U",
    "\u{1D414}": "U",
    "\u{1D448}": "U",
    "\u{1D47C}": "U",
    "\u{1D4B0}": "U",
    "\u{1D4E4}": "U",
    "\u{1D518}": "U",
    "\u{1D54C}": "U",
    "\u{1D580}": "U",
    "\u{1D5B4}": "U",
    "\u{1D5E8}": "U",
    "\u{1D61C}": "U",
    "\u{1D650}": "U",
    "\u{1D684}": "U",
    \u054D: "U",
    \u1200: "U",
    "\u{104CE}": "U",
    \u144C: "U",
    "\uA4F4": "U",
    "\u{16F42}": "U",
    "\u{118B8}": "U",
    \u01D4: "\u016D",
    \u01D3: "\u016C",
    "\u1D7E": "u\u0335",
    "\uAB9C": "u\u0335",
    "\u0244": "U\u0335",
    \u13CC: "U\u0335",
    \u1458: "U\xB7",
    \u1467: "U'",
    "\u1D6B": "ue",
    "\uAB63": "uo",
    \u1E43: "\uAB51",
    \u057A: "\u0270",
    \u1223: "\u0270",
    "\u2127": "\u01B1",
    \u162E: "\u01B1",
    \u1634: "\u01B1",
    "\u1D7F": "\u028A\u0335",
    "\u2228": "v",
    "\u22C1": "v",
    \uFF56: "v",
    "\u2174": "v",
    "\u{1D42F}": "v",
    "\u{1D463}": "v",
    "\u{1D497}": "v",
    "\u{1D4CB}": "v",
    "\u{1D4FF}": "v",
    "\u{1D533}": "v",
    "\u{1D567}": "v",
    "\u{1D59B}": "v",
    "\u{1D5CF}": "v",
    "\u{1D603}": "v",
    "\u{1D637}": "v",
    "\u{1D66B}": "v",
    "\u{1D69F}": "v",
    "\u1D20": "v",
    \u03BD: "v",
    "\u{1D6CE}": "v",
    "\u{1D708}": "v",
    "\u{1D742}": "v",
    "\u{1D77C}": "v",
    "\u{1D7B6}": "v",
    \u0475: "v",
    \u05D8: "v",
    "\u{11706}": "v",
    "\uABA9": "v",
    "\u{118C0}": "v",
    "\u{1D20D}": "V",
    "\u0667": "V",
    "\u06F7": "V",
    "\u2164": "V",
    "\u{1D415}": "V",
    "\u{1D449}": "V",
    "\u{1D47D}": "V",
    "\u{1D4B1}": "V",
    "\u{1D4E5}": "V",
    "\u{1D519}": "V",
    "\u{1D54D}": "V",
    "\u{1D581}": "V",
    "\u{1D5B5}": "V",
    "\u{1D5E9}": "V",
    "\u{1D61D}": "V",
    "\u{1D651}": "V",
    "\u{1D685}": "V",
    \u0474: "V",
    "\u2D38": "V",
    \u13D9: "V",
    \u142F: "V",
    "\uA6DF": "V",
    "\uA4E6": "V",
    "\u{16F08}": "V",
    "\u{118A0}": "V",
    "\u{1051D}": "V",
    "\u{10197}": "V\u0335",
    \u143B: "V\xB7",
    "\u{1F76C}": "VB",
    "\u2175": "vi",
    "\u2176": "vii",
    "\u2177": "viii",
    "\u2165": "Vl",
    "\u2166": "Vll",
    "\u2167": "Vlll",
    "\u{1F708}": "V\u1DE4",
    "\u1D27": "\u028C",
    "\u{104D8}": "\u028C",
    "\u0668": "\u0245",
    "\u06F8": "\u0245",
    \u039B: "\u0245",
    "\u{1D6B2}": "\u0245",
    "\u{1D6EC}": "\u0245",
    "\u{1D726}": "\u0245",
    "\u{1D760}": "\u0245",
    "\u{1D79A}": "\u0245",
    \u041B: "\u0245",
    "\u2D37": "\u0245",
    "\u{104B0}": "\u0245",
    \u1431: "\u0245",
    "\uA6CE": "\u0245",
    "\uA4E5": "\u0245",
    "\u{16F3D}": "\u0245",
    "\u{1028D}": "\u0245",
    "\u04C5": "\u0245\u0326",
    \u143D: "\u0245\xB7",
    \u026F: "w",
    "\u{1D430}": "w",
    "\u{1D464}": "w",
    "\u{1D498}": "w",
    "\u{1D4CC}": "w",
    "\u{1D500}": "w",
    "\u{1D534}": "w",
    "\u{1D568}": "w",
    "\u{1D59C}": "w",
    "\u{1D5D0}": "w",
    "\u{1D604}": "w",
    "\u{1D638}": "w",
    "\u{1D66C}": "w",
    "\u{1D6A0}": "w",
    "\u1D21": "w",
    \u0461: "w",
    "\u051D": "w",
    \u0561: "w",
    "\u{1170A}": "w",
    "\u{1170E}": "w",
    "\u{1170F}": "w",
    "\uAB83": "w",
    "\u{118EF}": "W",
    "\u{118E6}": "W",
    "\u{1D416}": "W",
    "\u{1D44A}": "W",
    "\u{1D47E}": "W",
    "\u{1D4B2}": "W",
    "\u{1D4E6}": "W",
    "\u{1D51A}": "W",
    "\u{1D54E}": "W",
    "\u{1D582}": "W",
    "\u{1D5B6}": "W",
    "\u{1D5EA}": "W",
    "\u{1D61E}": "W",
    "\u{1D652}": "W",
    "\u{1D686}": "W",
    "\u051C": "W",
    \u13B3: "W",
    \u13D4: "W",
    "\uA4EA": "W",
    \u047D: "w\u0486\u0487",
    "\u{114C5}": "w\u0307",
    "\u20A9": "W\u0335",
    "\uA761": "w\u0326",
    "\u1D0D": "\u028D",
    \u043C: "\u028D",
    "\uAB87": "\u028D",
    "\u04CE": "\u028D\u0326",
    "\u166E": "x",
    "\xD7": "x",
    "\u292B": "x",
    "\u292C": "x",
    "\u2A2F": "x",
    \uFF58: "x",
    "\u2179": "x",
    "\u{1D431}": "x",
    "\u{1D465}": "x",
    "\u{1D499}": "x",
    "\u{1D4CD}": "x",
    "\u{1D501}": "x",
    "\u{1D535}": "x",
    "\u{1D569}": "x",
    "\u{1D59D}": "x",
    "\u{1D5D1}": "x",
    "\u{1D605}": "x",
    "\u{1D639}": "x",
    "\u{1D66D}": "x",
    "\u{1D6A1}": "x",
    \u0445: "x",
    \u1541: "x",
    \u157D: "x",
    "\u2DEF": "\u036F",
    "\u166D": "X",
    "\u2573": "X",
    "\u{10322}": "X",
    "\u{118EC}": "X",
    \uFF38: "X",
    "\u2169": "X",
    "\u{1D417}": "X",
    "\u{1D44B}": "X",
    "\u{1D47F}": "X",
    "\u{1D4B3}": "X",
    "\u{1D4E7}": "X",
    "\u{1D51B}": "X",
    "\u{1D54F}": "X",
    "\u{1D583}": "X",
    "\u{1D5B7}": "X",
    "\u{1D5EB}": "X",
    "\u{1D61F}": "X",
    "\u{1D653}": "X",
    "\u{1D687}": "X",
    "\uA7B3": "X",
    \u03A7: "X",
    "\u{1D6BE}": "X",
    "\u{1D6F8}": "X",
    "\u{1D732}": "X",
    "\u{1D76C}": "X",
    "\u{1D7A6}": "X",
    "\u2CAC": "X",
    \u0425: "X",
    "\u2D5D": "X",
    \u16B7: "X",
    "\uA4EB": "X",
    "\u{10290}": "X",
    "\u{102B4}": "X",
    "\u{10317}": "X",
    "\u{10527}": "X",
    "\u2A30": "x\u0307",
    \u04B2: "X\u0329",
    "\u{10196}": "X\u0335",
    "\u217A": "xi",
    "\u217B": "xii",
    "\u216A": "Xl",
    "\u216B": "Xll",
    \u0263: "y",
    "\u1D8C": "y",
    \uFF59: "y",
    "\u{1D432}": "y",
    "\u{1D466}": "y",
    "\u{1D49A}": "y",
    "\u{1D4CE}": "y",
    "\u{1D502}": "y",
    "\u{1D536}": "y",
    "\u{1D56A}": "y",
    "\u{1D59E}": "y",
    "\u{1D5D2}": "y",
    "\u{1D606}": "y",
    "\u{1D63A}": "y",
    "\u{1D66E}": "y",
    "\u{1D6A2}": "y",
    \u028F: "y",
    "\u1EFF": "y",
    "\uAB5A": "y",
    \u03B3: "y",
    "\u213D": "y",
    "\u{1D6C4}": "y",
    "\u{1D6FE}": "y",
    "\u{1D738}": "y",
    "\u{1D772}": "y",
    "\u{1D7AC}": "y",
    \u0443: "y",
    \u04AF: "y",
    \u10E7: "y",
    "\u{118DC}": "y",
    \uFF39: "Y",
    "\u{1D418}": "Y",
    "\u{1D44C}": "Y",
    "\u{1D480}": "Y",
    "\u{1D4B4}": "Y",
    "\u{1D4E8}": "Y",
    "\u{1D51C}": "Y",
    "\u{1D550}": "Y",
    "\u{1D584}": "Y",
    "\u{1D5B8}": "Y",
    "\u{1D5EC}": "Y",
    "\u{1D620}": "Y",
    "\u{1D654}": "Y",
    "\u{1D688}": "Y",
    \u03A5: "Y",
    \u03D2: "Y",
    "\u{1D6BC}": "Y",
    "\u{1D6F6}": "Y",
    "\u{1D730}": "Y",
    "\u{1D76A}": "Y",
    "\u{1D7A4}": "Y",
    "\u2CA8": "Y",
    \u0423: "Y",
    \u04AE: "Y",
    \u13A9: "Y",
    \u13BD: "Y",
    "\uA4EC": "Y",
    "\u{16F43}": "Y",
    "\u{118A4}": "Y",
    "\u{102B2}": "Y",
    \u01B4: "y\u0314",
    "\u024F": "y\u0335",
    \u04B1: "y\u0335",
    "\xA5": "Y\u0335",
    "\u024E": "Y\u0335",
    \u04B0: "Y\u0335",
    \u0292: "\u021D",
    "\uA76B": "\u021D",
    "\u2CCD": "\u021D",
    \u04E1: "\u021D",
    \u10F3: "\u021D",
    "\u{1D433}": "z",
    "\u{1D467}": "z",
    "\u{1D49B}": "z",
    "\u{1D4CF}": "z",
    "\u{1D503}": "z",
    "\u{1D537}": "z",
    "\u{1D56B}": "z",
    "\u{1D59F}": "z",
    "\u{1D5D3}": "z",
    "\u{1D607}": "z",
    "\u{1D63B}": "z",
    "\u{1D66F}": "z",
    "\u{1D6A3}": "z",
    "\u1D22": "z",
    "\uAB93": "z",
    "\u{118C4}": "z",
    "\u{102F5}": "Z",
    "\u{118E5}": "Z",
    \uFF3A: "Z",
    \u2124: "Z",
    \u2128: "Z",
    "\u{1D419}": "Z",
    "\u{1D44D}": "Z",
    "\u{1D481}": "Z",
    "\u{1D4B5}": "Z",
    "\u{1D4E9}": "Z",
    "\u{1D585}": "Z",
    "\u{1D5B9}": "Z",
    "\u{1D5ED}": "Z",
    "\u{1D621}": "Z",
    "\u{1D655}": "Z",
    "\u{1D689}": "Z",
    \u0396: "Z",
    "\u{1D6AD}": "Z",
    "\u{1D6E7}": "Z",
    "\u{1D721}": "Z",
    "\u{1D75B}": "Z",
    "\u{1D795}": "Z",
    \u13C3: "Z",
    "\uA4DC": "Z",
    "\u{118A9}": "Z",
    \u0290: "z\u0328",
    \u01B6: "z\u0335",
    \u01B5: "Z\u0335",
    \u0225: "z\u0326",
    \u0224: "Z\u0326",
    "\u1D76": "z\u0334",
    \u01BF: "\xFE",
    "\u03F8": "\xFE",
    "\u03F7": "\xDE",
    "\u{104C4}": "\xDE",
    "\u2079": "\uA770",
    "\u1D24": "\u01A8",
    \u03E9: "\u01A8",
    "\uA645": "\u01A8",
    \u044C: "\u0185",
    "\uAB9F": "\u0185",
    \u044B: "\u0185i",
    "\uAB7E": "\u0242",
    \u02E4: "\u02C1",
    "\uA6CD": "\u02A1",
    "\u2299": "\u0298",
    "\u2609": "\u0298",
    "\u2A00": "\u0298",
    "\uA668": "\u0298",
    "\u2D59": "\u0298",
    "\u{104C3}": "\u0298",
    "\u213E": "\u0393",
    "\u{1D6AA}": "\u0393",
    "\u{1D6E4}": "\u0393",
    "\u{1D71E}": "\u0393",
    "\u{1D758}": "\u0393",
    "\u{1D792}": "\u0393",
    "\u2C84": "\u0393",
    \u0413: "\u0393",
    \u13B1: "\u0393",
    \u14A5: "\u0393",
    "\u{16F07}": "\u0393",
    \u0492: "\u0393\u0335",
    \u14AF: "\u0393\xB7",
    \u0490: "\u0393'",
    "\u2206": "\u0394",
    "\u25B3": "\u0394",
    "\u{1F702}": "\u0394",
    "\u{1D6AB}": "\u0394",
    "\u{1D6E5}": "\u0394",
    "\u{1D71F}": "\u0394",
    "\u{1D759}": "\u0394",
    "\u{1D793}": "\u0394",
    "\u2C86": "\u0394",
    "\u2D60": "\u0394",
    \u1403: "\u0394",
    "\u{16F1A}": "\u0394",
    "\u{10285}": "\u0394",
    "\u{102A3}": "\u0394",
    "\u2359": "\u0394\u0332",
    \u140F: "\u0394\xB7",
    \u142C: "\u0394\u1420",
    "\u{1D7CB}": "\u03DD",
    "\u{1D6C7}": "\u03B6",
    "\u{1D701}": "\u03B6",
    "\u{1D73B}": "\u03B6",
    "\u{1D775}": "\u03B6",
    "\u{1D7AF}": "\u03B6",
    "\u2CE4": "\u03D7",
    "\u{1D6CC}": "\u03BB",
    "\u{1D706}": "\u03BB",
    "\u{1D740}": "\u03BB",
    "\u{1D77A}": "\u03BB",
    "\u{1D7B4}": "\u03BB",
    "\u2C96": "\u03BB",
    "\u{104DB}": "\u03BB",
    \u00B5: "\u03BC",
    "\u{1D6CD}": "\u03BC",
    "\u{1D707}": "\u03BC",
    "\u{1D741}": "\u03BC",
    "\u{1D77B}": "\u03BC",
    "\u{1D7B5}": "\u03BC",
    "\u{1D6CF}": "\u03BE",
    "\u{1D709}": "\u03BE",
    "\u{1D743}": "\u03BE",
    "\u{1D77D}": "\u03BE",
    "\u{1D7B7}": "\u03BE",
    "\u{1D6B5}": "\u039E",
    "\u{1D6EF}": "\u039E",
    "\u{1D729}": "\u039E",
    "\u{1D763}": "\u039E",
    "\u{1D79D}": "\u039E",
    \u03D6: "\u03C0",
    "\u213C": "\u03C0",
    "\u{1D6D1}": "\u03C0",
    "\u{1D6E1}": "\u03C0",
    "\u{1D70B}": "\u03C0",
    "\u{1D71B}": "\u03C0",
    "\u{1D745}": "\u03C0",
    "\u{1D755}": "\u03C0",
    "\u{1D77F}": "\u03C0",
    "\u{1D78F}": "\u03C0",
    "\u{1D7B9}": "\u03C0",
    "\u{1D7C9}": "\u03C0",
    "\u1D28": "\u03C0",
    \u043F: "\u03C0",
    "\u220F": "\u03A0",
    "\u213F": "\u03A0",
    "\u{1D6B7}": "\u03A0",
    "\u{1D6F1}": "\u03A0",
    "\u{1D72B}": "\u03A0",
    "\u{1D765}": "\u03A0",
    "\u{1D79F}": "\u03A0",
    "\u2CA0": "\u03A0",
    \u041F: "\u03A0",
    "\uA6DB": "\u03A0",
    "\u{102AD}": "\u03D8",
    "\u{10312}": "\u03D8",
    \u03DB: "\u03C2",
    "\u{1D6D3}": "\u03C2",
    "\u{1D70D}": "\u03C2",
    "\u{1D747}": "\u03C2",
    "\u{1D781}": "\u03C2",
    "\u{1D7BB}": "\u03C2",
    "\u{1D6BD}": "\u03A6",
    "\u{1D6F7}": "\u03A6",
    "\u{1D731}": "\u03A6",
    "\u{1D76B}": "\u03A6",
    "\u{1D7A5}": "\u03A6",
    "\u2CAA": "\u03A6",
    \u0424: "\u03A6",
    \u0553: "\u03A6",
    \u1240: "\u03A6",
    "\u16F0": "\u03A6",
    "\u{102B3}": "\u03A6",
    "\uAB53": "\u03C7",
    "\uAB55": "\u03C7",
    "\u{1D6D8}": "\u03C7",
    "\u{1D712}": "\u03C7",
    "\u{1D74C}": "\u03C7",
    "\u{1D786}": "\u03C7",
    "\u{1D7C0}": "\u03C7",
    "\u2CAD": "\u03C7",
    "\u{1D6D9}": "\u03C8",
    "\u{1D713}": "\u03C8",
    "\u{1D74D}": "\u03C8",
    "\u{1D787}": "\u03C8",
    "\u{1D7C1}": "\u03C8",
    \u0471: "\u03C8",
    "\u{104F9}": "\u03C8",
    "\u{1D6BF}": "\u03A8",
    "\u{1D6F9}": "\u03A8",
    "\u{1D733}": "\u03A8",
    "\u{1D76D}": "\u03A8",
    "\u{1D7A7}": "\u03A8",
    "\u2CAE": "\u03A8",
    \u0470: "\u03A8",
    "\u{104D1}": "\u03A8",
    \u16D8: "\u03A8",
    "\u{102B5}": "\u03A8",
    "\u2375": "\u03C9",
    "\uA7B7": "\u03C9",
    "\u{1D6DA}": "\u03C9",
    "\u{1D714}": "\u03C9",
    "\u{1D74E}": "\u03C9",
    "\u{1D788}": "\u03C9",
    "\u{1D7C2}": "\u03C9",
    "\u2CB1": "\u03C9",
    "\uA64D": "\u03C9",
    \u2126: "\u03A9",
    "\u{1D6C0}": "\u03A9",
    "\u{1D6FA}": "\u03A9",
    "\u{1D734}": "\u03A9",
    "\u{1D76E}": "\u03A9",
    "\u{1D7A8}": "\u03A9",
    \u162F: "\u03A9",
    \u1635: "\u03A9",
    "\u{102B6}": "\u03A9",
    "\u2379": "\u03C9\u0332",
    \u1F7D: "\u1FF4",
    "\u2630": "\u2CB6",
    "\u2CDC": "\u03EC",
    \u0497: "\u0436\u0329",
    \u0496: "\u0416\u0329",
    "\u{1D20B}": "\u0418",
    "\u0376": "\u0418",
    "\uA6A1": "\u0418",
    "\u{10425}": "\u0418",
    \u0419: "\u040D",
    "\u048A": "\u040D\u0326",
    \u045D: "\u0439",
    "\u048B": "\u0439\u0326",
    "\u{104BC}": "\u04C3",
    "\u1D2B": "\u043B",
    "\u04C6": "\u043B\u0326",
    "\uAB60": "\u0459",
    "\u{104EB}": "\uA669",
    "\u1DEE": "\u2DEC",
    "\u{104CD}": "\u040B",
    "\u{1D202}": "\u04FE",
    "\u{1D222}": "\u0460",
    \u13C7: "\u0460",
    \u15EF: "\u0460",
    \u047C: "\u0460\u0486\u0487",
    "\u18ED": "\u0460\xB7",
    "\uA7B6": "\uA64C",
    \u04CC: "\u04B7",
    \u04CB: "\u04B6",
    \u04BE: "\u04BC\u0328",
    "\u2CBD": "\u0448",
    "\u2CBC": "\u0428",
    "\uA650": "\u042Al",
    "\u2108": "\u042D",
    "\u{1F701}": "\uA658",
    "\u{16F1C}": "\uA658",
    "\uA992": "\u2C3F",
    \u0587: "\u0565\u0582",
    \u1294: "\u0571",
    \uFB14: "\u0574\u0565",
    \uFB15: "\u0574\u056B",
    \uFB17: "\u0574\u056D",
    \uFB13: "\u0574\u0576",
    "\u2229": "\u0548",
    "\u22C2": "\u0548",
    "\u{1D245}": "\u0548",
    \u1260: "\u0548",
    \u144E: "\u0548",
    "\uA4F5": "\u0548",
    \u145A: "\u0548\xB7",
    \u1468: "\u0548'",
    \uFB16: "\u057E\u0576",
    "\u20BD": "\u0554",
    "\u02D3": "\u0559",
    \u02BF: "\u0559",
    \u2135: "\u05D0",
    \uFB21: "\u05D0",
    \uFB2F: "\uFB2E",
    \uFB30: "\uFB2E",
    \uFB4F: "\u05D0\u05DC",
    \u2136: "\u05D1",
    \u2137: "\u05D2",
    \u2138: "\u05D3",
    \uFB22: "\u05D3",
    \uFB23: "\u05D4",
    \uFB39: "\uFB1D",
    \uFB24: "\u05DB",
    \uFB25: "\u05DC",
    \uFB26: "\u05DD",
    \uFB20: "\u05E2",
    \uFB27: "\u05E8",
    \uFB2B: "\uFB2A",
    \uFB49: "\uFB2A",
    \uFB2D: "\uFB2C",
    \uFB28: "\u05EA",
    \uFE80: "\u0621",
    "\u06FD": "\u0621\u0348",
    \uFE82: "\u0622",
    \uFE81: "\u0622",
    \uFB51: "\u0671",
    \uFB50: "\u0671",
    "\u{1EE01}": "\u0628",
    "\u{1EE21}": "\u0628",
    "\u{1EE61}": "\u0628",
    "\u{1EE81}": "\u0628",
    "\u{1EEA1}": "\u0628",
    \uFE91: "\u0628",
    \uFE92: "\u0628",
    \uFE90: "\u0628",
    \uFE8F: "\u0628",
    "\u0751": "\u0628\u06DB",
    "\u08B6": "\u0628\u06E2",
    "\u08A1": "\u0628\u0654",
    \uFCA0: "\u0628o",
    \uFCE2: "\u0628o",
    \uFC9C: "\u0628\u062C",
    \uFC05: "\u0628\u062C",
    \uFC9D: "\u0628\u062D",
    \uFC06: "\u0628\u062D",
    \uFDC2: "\u0628\u062D\u0649",
    \uFC9E: "\u0628\u062E",
    \uFC07: "\u0628\u062E",
    \uFCD2: "\u0628\u062E",
    \uFC4B: "\u0628\u062E",
    \uFD9E: "\u0628\u062E\u0649",
    \uFC6A: "\u0628\u0631",
    \uFC6B: "\u0628\u0632",
    \uFC9F: "\u0628\u0645",
    \uFCE1: "\u0628\u0645",
    \uFC6C: "\u0628\u0645",
    \uFC08: "\u0628\u0645",
    \uFC6D: "\u0628\u0646",
    \uFC6E: "\u0628\u0649",
    \uFC09: "\u0628\u0649",
    \uFC6F: "\u0628\u0649",
    \uFC0A: "\u0628\u0649",
    \uFB54: "\u067B",
    \uFB55: "\u067B",
    \uFB53: "\u067B",
    \uFB52: "\u067B",
    \u06D0: "\u067B",
    \uFBE6: "\u067B",
    \uFBE7: "\u067B",
    \uFBE5: "\u067B",
    \uFBE4: "\u067B",
    \uFB5C: "\u0680",
    \uFB5D: "\u0680",
    \uFB5B: "\u0680",
    \uFB5A: "\u0680",
    "\u08A9": "\u0754",
    "\u0767": "\u0754",
    "\u2365": "\u0629",
    \u00F6: "\u0629",
    \uFE94: "\u0629",
    \uFE93: "\u0629",
    \u06C3: "\u0629",
    "\u{1EE15}": "\u062A",
    "\u{1EE35}": "\u062A",
    "\u{1EE75}": "\u062A",
    "\u{1EE95}": "\u062A",
    "\u{1EEB5}": "\u062A",
    \uFE97: "\u062A",
    \uFE98: "\u062A",
    \uFE96: "\u062A",
    \uFE95: "\u062A",
    \uFCA5: "\u062Ao",
    \uFCE4: "\u062Ao",
    \uFCA1: "\u062A\u062C",
    \uFC0B: "\u062A\u062C",
    \uFD50: "\u062A\u062C\u0645",
    \uFDA0: "\u062A\u062C\u0649",
    \uFD9F: "\u062A\u062C\u0649",
    \uFCA2: "\u062A\u062D",
    \uFC0C: "\u062A\u062D",
    \uFD52: "\u062A\u062D\u062C",
    \uFD51: "\u062A\u062D\u062C",
    \uFD53: "\u062A\u062D\u0645",
    \uFCA3: "\u062A\u062E",
    \uFC0D: "\u062A\u062E",
    \uFD54: "\u062A\u062E\u0645",
    \uFDA2: "\u062A\u062E\u0649",
    \uFDA1: "\u062A\u062E\u0649",
    \uFC70: "\u062A\u0631",
    \uFC71: "\u062A\u0632",
    \uFCA4: "\u062A\u0645",
    \uFCE3: "\u062A\u0645",
    \uFC72: "\u062A\u0645",
    \uFC0E: "\u062A\u0645",
    \uFD55: "\u062A\u0645\u062C",
    \uFD56: "\u062A\u0645\u062D",
    \uFD57: "\u062A\u0645\u062E",
    \uFDA4: "\u062A\u0645\u0649",
    \uFDA3: "\u062A\u0645\u0649",
    \uFC73: "\u062A\u0646",
    \uFC74: "\u062A\u0649",
    \uFC0F: "\u062A\u0649",
    \uFC75: "\u062A\u0649",
    \uFC10: "\u062A\u0649",
    \uFB60: "\u067A",
    \uFB61: "\u067A",
    \uFB5F: "\u067A",
    \uFB5E: "\u067A",
    \uFB64: "\u067F",
    \uFB65: "\u067F",
    \uFB63: "\u067F",
    \uFB62: "\u067F",
    "\u{1EE02}": "\u062C",
    "\u{1EE22}": "\u062C",
    "\u{1EE42}": "\u062C",
    "\u{1EE62}": "\u062C",
    "\u{1EE82}": "\u062C",
    "\u{1EEA2}": "\u062C",
    \uFE9F: "\u062C",
    \uFEA0: "\u062C",
    \uFE9E: "\u062C",
    \uFE9D: "\u062C",
    \uFCA7: "\u062C\u062D",
    \uFC15: "\u062C\u062D",
    \uFDA6: "\u062C\u062D\u0649",
    \uFDBE: "\u062C\u062D\u0649",
    \uFDFB: "\u062C\u0644 \u062C\u0644l\u0644o",
    \uFCA8: "\u062C\u0645",
    \uFC16: "\u062C\u0645",
    \uFD59: "\u062C\u0645\u062D",
    \uFD58: "\u062C\u0645\u062D",
    \uFDA7: "\u062C\u0645\u0649",
    \uFDA5: "\u062C\u0645\u0649",
    \uFD1D: "\u062C\u0649",
    \uFD01: "\u062C\u0649",
    \uFD1E: "\u062C\u0649",
    \uFD02: "\u062C\u0649",
    \uFB78: "\u0683",
    \uFB79: "\u0683",
    \uFB77: "\u0683",
    \uFB76: "\u0683",
    \uFB74: "\u0684",
    \uFB75: "\u0684",
    \uFB73: "\u0684",
    \uFB72: "\u0684",
    \uFB7C: "\u0686",
    \uFB7D: "\u0686",
    \uFB7B: "\u0686",
    \uFB7A: "\u0686",
    \uFB80: "\u0687",
    \uFB81: "\u0687",
    \uFB7F: "\u0687",
    \uFB7E: "\u0687",
    "\u{1EE07}": "\u062D",
    "\u{1EE27}": "\u062D",
    "\u{1EE47}": "\u062D",
    "\u{1EE67}": "\u062D",
    "\u{1EE87}": "\u062D",
    "\u{1EEA7}": "\u062D",
    \uFEA3: "\u062D",
    \uFEA4: "\u062D",
    \uFEA2: "\u062D",
    \uFEA1: "\u062D",
    \u0685: "\u062D\u06DB",
    \u0681: "\u062D\u0654",
    "\u0772": "\u062D\u0654",
    \uFCA9: "\u062D\u062C",
    \uFC17: "\u062D\u062C",
    \uFDBF: "\u062D\u062C\u0649",
    \uFCAA: "\u062D\u0645",
    \uFC18: "\u062D\u0645",
    \uFD5B: "\u062D\u0645\u0649",
    \uFD5A: "\u062D\u0645\u0649",
    \uFD1B: "\u062D\u0649",
    \uFCFF: "\u062D\u0649",
    \uFD1C: "\u062D\u0649",
    \uFD00: "\u062D\u0649",
    "\u{1EE17}": "\u062E",
    "\u{1EE37}": "\u062E",
    "\u{1EE57}": "\u062E",
    "\u{1EE77}": "\u062E",
    "\u{1EE97}": "\u062E",
    "\u{1EEB7}": "\u062E",
    \uFEA7: "\u062E",
    \uFEA8: "\u062E",
    \uFEA6: "\u062E",
    \uFEA5: "\u062E",
    \uFCAB: "\u062E\u062C",
    \uFC19: "\u062E\u062C",
    \uFC1A: "\u062E\u062D",
    \uFCAC: "\u062E\u0645",
    \uFC1B: "\u062E\u0645",
    \uFD1F: "\u062E\u0649",
    \uFD03: "\u062E\u0649",
    \uFD20: "\u062E\u0649",
    \uFD04: "\u062E\u0649",
    "\u{102E1}": "\u062F",
    "\u{1EE03}": "\u062F",
    "\u{1EE83}": "\u062F",
    "\u{1EEA3}": "\u062F",
    \uFEAA: "\u062F",
    \uFEA9: "\u062F",
    \u0688: "\u062F\u0615",
    \uFB89: "\u062F\u0615",
    \uFB88: "\u062F\u0615",
    \u068E: "\u062F\u06DB",
    \uFB87: "\u062F\u06DB",
    \uFB86: "\u062F\u06DB",
    "\u06EE": "\u062F\u0302",
    "\u08AE": "\u062F\u0324\u0323",
    "\u{1EE18}": "\u0630",
    "\u{1EE98}": "\u0630",
    "\u{1EEB8}": "\u0630",
    \uFEAC: "\u0630",
    \uFEAB: "\u0630",
    \uFC5B: "\u0630\u0670",
    \u068B: "\u068A\u0615",
    \uFB85: "\u068C",
    \uFB84: "\u068C",
    \uFB83: "\u068D",
    \uFB82: "\u068D",
    "\u{1EE13}": "\u0631",
    "\u{1EE93}": "\u0631",
    "\u{1EEB3}": "\u0631",
    \uFEAE: "\u0631",
    \uFEAD: "\u0631",
    \u0691: "\u0631\u0615",
    \uFB8D: "\u0631\u0615",
    \uFB8C: "\u0631\u0615",
    \u0698: "\u0631\u06DB",
    \uFB8B: "\u0631\u06DB",
    \uFB8A: "\u0631\u06DB",
    \u0692: "\u0631\u0306",
    "\u08B9": "\u0631\u0306\u0307",
    "\u06EF": "\u0631\u0302",
    "\u076C": "\u0631\u0654",
    \uFC5C: "\u0631\u0670",
    \uFDF6: "\u0631\u0633\u0648\u0644",
    "\uFDFC": "\u0631\u0649l\u0644",
    "\u{1EE06}": "\u0632",
    "\u{1EE86}": "\u0632",
    "\u{1EEA6}": "\u0632",
    \uFEB0: "\u0632",
    \uFEAF: "\u0632",
    "\u08B2": "\u0632\u0302",
    "\u0771": "\u0697\u0615",
    "\u{1EE0E}": "\u0633",
    "\u{1EE2E}": "\u0633",
    "\u{1EE4E}": "\u0633",
    "\u{1EE6E}": "\u0633",
    "\u{1EE8E}": "\u0633",
    "\u{1EEAE}": "\u0633",
    \uFEB3: "\u0633",
    \uFEB4: "\u0633",
    \uFEB2: "\u0633",
    \uFEB1: "\u0633",
    \u0634: "\u0633\u06DB",
    "\u{1EE14}": "\u0633\u06DB",
    "\u{1EE34}": "\u0633\u06DB",
    "\u{1EE54}": "\u0633\u06DB",
    "\u{1EE74}": "\u0633\u06DB",
    "\u{1EE94}": "\u0633\u06DB",
    "\u{1EEB4}": "\u0633\u06DB",
    \uFEB7: "\u0633\u06DB",
    \uFEB8: "\u0633\u06DB",
    \uFEB6: "\u0633\u06DB",
    \uFEB5: "\u0633\u06DB",
    "\u077E": "\u0633\u0302",
    \uFD31: "\u0633o",
    \uFCE8: "\u0633o",
    \uFD32: "\u0633\u06DBo",
    \uFCEA: "\u0633\u06DBo",
    \uFCAD: "\u0633\u062C",
    \uFD34: "\u0633\u062C",
    \uFC1C: "\u0633\u062C",
    \uFD2D: "\u0633\u06DB\u062C",
    \uFD37: "\u0633\u06DB\u062C",
    \uFD25: "\u0633\u06DB\u062C",
    \uFD09: "\u0633\u06DB\u062C",
    \uFD5D: "\u0633\u062C\u062D",
    \uFD5E: "\u0633\u062C\u0649",
    \uFD69: "\u0633\u06DB\u062C\u0649",
    \uFCAE: "\u0633\u062D",
    \uFD35: "\u0633\u062D",
    \uFC1D: "\u0633\u062D",
    \uFD2E: "\u0633\u06DB\u062D",
    \uFD38: "\u0633\u06DB\u062D",
    \uFD26: "\u0633\u06DB\u062D",
    \uFD0A: "\u0633\u06DB\u062D",
    \uFD5C: "\u0633\u062D\u062C",
    \uFD68: "\u0633\u06DB\u062D\u0645",
    \uFD67: "\u0633\u06DB\u062D\u0645",
    \uFDAA: "\u0633\u06DB\u062D\u0649",
    \uFCAF: "\u0633\u062E",
    \uFD36: "\u0633\u062E",
    \uFC1E: "\u0633\u062E",
    \uFD2F: "\u0633\u06DB\u062E",
    \uFD39: "\u0633\u06DB\u062E",
    \uFD27: "\u0633\u06DB\u062E",
    \uFD0B: "\u0633\u06DB\u062E",
    \uFDA8: "\u0633\u062E\u0649",
    \uFDC6: "\u0633\u062E\u0649",
    \uFD2A: "\u0633\u0631",
    \uFD0E: "\u0633\u0631",
    \uFD29: "\u0633\u06DB\u0631",
    \uFD0D: "\u0633\u06DB\u0631",
    \uFCB0: "\u0633\u0645",
    \uFCE7: "\u0633\u0645",
    \uFC1F: "\u0633\u0645",
    \uFD30: "\u0633\u06DB\u0645",
    \uFCE9: "\u0633\u06DB\u0645",
    \uFD28: "\u0633\u06DB\u0645",
    \uFD0C: "\u0633\u06DB\u0645",
    \uFD61: "\u0633\u0645\u062C",
    \uFD60: "\u0633\u0645\u062D",
    \uFD5F: "\u0633\u0645\u062D",
    \uFD6B: "\u0633\u06DB\u0645\u062E",
    \uFD6A: "\u0633\u06DB\u0645\u062E",
    \uFD63: "\u0633\u0645\u0645",
    \uFD62: "\u0633\u0645\u0645",
    \uFD6D: "\u0633\u06DB\u0645\u0645",
    \uFD6C: "\u0633\u06DB\u0645\u0645",
    \uFD17: "\u0633\u0649",
    \uFCFB: "\u0633\u0649",
    \uFD18: "\u0633\u0649",
    \uFCFC: "\u0633\u0649",
    \uFD19: "\u0633\u06DB\u0649",
    \uFCFD: "\u0633\u06DB\u0649",
    \uFD1A: "\u0633\u06DB\u0649",
    \uFCFE: "\u0633\u06DB\u0649",
    "\u{102F2}": "\u0635",
    "\u{1EE11}": "\u0635",
    "\u{1EE31}": "\u0635",
    "\u{1EE51}": "\u0635",
    "\u{1EE71}": "\u0635",
    "\u{1EE91}": "\u0635",
    "\u{1EEB1}": "\u0635",
    \uFEBB: "\u0635",
    \uFEBC: "\u0635",
    \uFEBA: "\u0635",
    \uFEB9: "\u0635",
    \u069E: "\u0635\u06DB",
    "\u08AF": "\u0635\u0324\u0323",
    \uFCB1: "\u0635\u062D",
    \uFC20: "\u0635\u062D",
    \uFD65: "\u0635\u062D\u062D",
    \uFD64: "\u0635\u062D\u062D",
    \uFDA9: "\u0635\u062D\u0649",
    \uFCB2: "\u0635\u062E",
    \uFD2B: "\u0635\u0631",
    \uFD0F: "\u0635\u0631",
    \uFDF5: "\u0635\u0644\u0639\u0645",
    \uFDF9: "\u0635\u0644\u0649",
    \uFDF0: "\u0635\u0644\u0649",
    \uFDFA: "\u0635\u0644\u0649 l\u0644\u0644o \u0639\u0644\u0649o \u0648\u0633\u0644\u0645",
    \uFCB3: "\u0635\u0645",
    \uFC21: "\u0635\u0645",
    \uFDC5: "\u0635\u0645\u0645",
    \uFD66: "\u0635\u0645\u0645",
    \uFD21: "\u0635\u0649",
    \uFD05: "\u0635\u0649",
    \uFD22: "\u0635\u0649",
    \uFD06: "\u0635\u0649",
    "\u{1EE19}": "\u0636",
    "\u{1EE39}": "\u0636",
    "\u{1EE59}": "\u0636",
    "\u{1EE79}": "\u0636",
    "\u{1EE99}": "\u0636",
    "\u{1EEB9}": "\u0636",
    \uFEBF: "\u0636",
    \uFEC0: "\u0636",
    \uFEBE: "\u0636",
    \uFEBD: "\u0636",
    \uFCB4: "\u0636\u062C",
    \uFC22: "\u0636\u062C",
    \uFCB5: "\u0636\u062D",
    \uFC23: "\u0636\u062D",
    \uFD6E: "\u0636\u062D\u0649",
    \uFDAB: "\u0636\u062D\u0649",
    \uFCB6: "\u0636\u062E",
    \uFC24: "\u0636\u062E",
    \uFD70: "\u0636\u062E\u0645",
    \uFD6F: "\u0636\u062E\u0645",
    \uFD2C: "\u0636\u0631",
    \uFD10: "\u0636\u0631",
    \uFCB7: "\u0636\u0645",
    \uFC25: "\u0636\u0645",
    \uFD23: "\u0636\u0649",
    \uFD07: "\u0636\u0649",
    \uFD24: "\u0636\u0649",
    \uFD08: "\u0636\u0649",
    "\u{102E8}": "\u0637",
    "\u{1EE08}": "\u0637",
    "\u{1EE68}": "\u0637",
    "\u{1EE88}": "\u0637",
    "\u{1EEA8}": "\u0637",
    \uFEC3: "\u0637",
    \uFEC4: "\u0637",
    \uFEC2: "\u0637",
    \uFEC1: "\u0637",
    \u069F: "\u0637\u06DB",
    \uFCB8: "\u0637\u062D",
    \uFC26: "\u0637\u062D",
    \uFD33: "\u0637\u0645",
    \uFD3A: "\u0637\u0645",
    \uFC27: "\u0637\u0645",
    \uFD72: "\u0637\u0645\u062D",
    \uFD71: "\u0637\u0645\u062D",
    \uFD73: "\u0637\u0645\u0645",
    \uFD74: "\u0637\u0645\u0649",
    \uFD11: "\u0637\u0649",
    \uFCF5: "\u0637\u0649",
    \uFD12: "\u0637\u0649",
    \uFCF6: "\u0637\u0649",
    "\u{1EE1A}": "\u0638",
    "\u{1EE7A}": "\u0638",
    "\u{1EE9A}": "\u0638",
    "\u{1EEBA}": "\u0638",
    \uFEC7: "\u0638",
    \uFEC8: "\u0638",
    \uFEC6: "\u0638",
    \uFEC5: "\u0638",
    \uFCB9: "\u0638\u0645",
    \uFD3B: "\u0638\u0645",
    \uFC28: "\u0638\u0645",
    "\u060F": "\u0639",
    "\u{1EE0F}": "\u0639",
    "\u{1EE2F}": "\u0639",
    "\u{1EE4F}": "\u0639",
    "\u{1EE6F}": "\u0639",
    "\u{1EE8F}": "\u0639",
    "\u{1EEAF}": "\u0639",
    \uFECB: "\u0639",
    \uFECC: "\u0639",
    \uFECA: "\u0639",
    \uFEC9: "\u0639",
    \uFCBA: "\u0639\u062C",
    \uFC29: "\u0639\u062C",
    \uFDC4: "\u0639\u062C\u0645",
    \uFD75: "\u0639\u062C\u0645",
    \uFDF7: "\u0639\u0644\u0649o",
    \uFCBB: "\u0639\u0645",
    \uFC2A: "\u0639\u0645",
    \uFD77: "\u0639\u0645\u0645",
    \uFD76: "\u0639\u0645\u0645",
    \uFD78: "\u0639\u0645\u0649",
    \uFDB6: "\u0639\u0645\u0649",
    \uFD13: "\u0639\u0649",
    \uFCF7: "\u0639\u0649",
    \uFD14: "\u0639\u0649",
    \uFCF8: "\u0639\u0649",
    "\u{1EE1B}": "\u063A",
    "\u{1EE3B}": "\u063A",
    "\u{1EE5B}": "\u063A",
    "\u{1EE7B}": "\u063A",
    "\u{1EE9B}": "\u063A",
    "\u{1EEBB}": "\u063A",
    \uFECF: "\u063A",
    \uFED0: "\u063A",
    \uFECE: "\u063A",
    \uFECD: "\u063A",
    \uFCBC: "\u063A\u062C",
    \uFC2B: "\u063A\u062C",
    \uFCBD: "\u063A\u0645",
    \uFC2C: "\u063A\u0645",
    \uFD79: "\u063A\u0645\u0645",
    \uFD7B: "\u063A\u0645\u0649",
    \uFD7A: "\u063A\u0645\u0649",
    \uFD15: "\u063A\u0649",
    \uFCF9: "\u063A\u0649",
    \uFD16: "\u063A\u0649",
    \uFCFA: "\u063A\u0649",
    "\u{1EE10}": "\u0641",
    "\u{1EE30}": "\u0641",
    "\u{1EE70}": "\u0641",
    "\u{1EE90}": "\u0641",
    "\u{1EEB0}": "\u0641",
    \uFED3: "\u0641",
    \uFED4: "\u0641",
    \uFED2: "\u0641",
    \uFED1: "\u0641",
    \u06A7: "\u0641",
    \uFCBE: "\u0641\u062C",
    \uFC2D: "\u0641\u062C",
    \uFCBF: "\u0641\u062D",
    \uFC2E: "\u0641\u062D",
    \uFCC0: "\u0641\u062E",
    \uFC2F: "\u0641\u062E",
    \uFD7D: "\u0641\u062E\u0645",
    \uFD7C: "\u0641\u062E\u0645",
    \uFCC1: "\u0641\u0645",
    \uFC30: "\u0641\u0645",
    \uFDC1: "\u0641\u0645\u0649",
    \uFC7C: "\u0641\u0649",
    \uFC31: "\u0641\u0649",
    \uFC7D: "\u0641\u0649",
    \uFC32: "\u0641\u0649",
    "\u{1EE1E}": "\u06A1",
    "\u{1EE7E}": "\u06A1",
    "\u08BB": "\u06A1",
    "\u066F": "\u06A1",
    "\u{1EE1F}": "\u06A1",
    "\u{1EE5F}": "\u06A1",
    "\u08BC": "\u06A1",
    \u06A4: "\u06A1\u06DB",
    \uFB6C: "\u06A1\u06DB",
    \uFB6D: "\u06A1\u06DB",
    \uFB6B: "\u06A1\u06DB",
    \uFB6A: "\u06A1\u06DB",
    \u06A8: "\u06A1\u06DB",
    "\u08A4": "\u06A2\u06DB",
    \uFB70: "\u06A6",
    \uFB71: "\u06A6",
    \uFB6F: "\u06A6",
    \uFB6E: "\u06A6",
    "\u{1EE12}": "\u0642",
    "\u{1EE32}": "\u0642",
    "\u{1EE52}": "\u0642",
    "\u{1EE72}": "\u0642",
    "\u{1EE92}": "\u0642",
    "\u{1EEB2}": "\u0642",
    \uFED7: "\u0642",
    \uFED8: "\u0642",
    \uFED6: "\u0642",
    \uFED5: "\u0642",
    \uFCC2: "\u0642\u062D",
    \uFC33: "\u0642\u062D",
    \uFDF1: "\u0642\u0644\u0649",
    \uFCC3: "\u0642\u0645",
    \uFC34: "\u0642\u0645",
    \uFDB4: "\u0642\u0645\u062D",
    \uFD7E: "\u0642\u0645\u062D",
    \uFD7F: "\u0642\u0645\u0645",
    \uFDB2: "\u0642\u0645\u0649",
    \uFC7E: "\u0642\u0649",
    \uFC35: "\u0642\u0649",
    \uFC7F: "\u0642\u0649",
    \uFC36: "\u0642\u0649",
    "\u{1EE0A}": "\u0643",
    "\u{1EE2A}": "\u0643",
    "\u{1EE6A}": "\u0643",
    \uFEDB: "\u0643",
    \uFEDC: "\u0643",
    \uFEDA: "\u0643",
    \uFED9: "\u0643",
    \u06A9: "\u0643",
    \uFB90: "\u0643",
    \uFB91: "\u0643",
    \uFB8F: "\u0643",
    \uFB8E: "\u0643",
    \u06AA: "\u0643",
    \u06AD: "\u0643\u06DB",
    \uFBD5: "\u0643\u06DB",
    \uFBD6: "\u0643\u06DB",
    \uFBD4: "\u0643\u06DB",
    \uFBD3: "\u0643\u06DB",
    "\u0763": "\u0643\u06DB",
    \uFC80: "\u0643l",
    \uFC37: "\u0643l",
    \uFCC4: "\u0643\u062C",
    \uFC38: "\u0643\u062C",
    \uFCC5: "\u0643\u062D",
    \uFC39: "\u0643\u062D",
    \uFCC6: "\u0643\u062E",
    \uFC3A: "\u0643\u062E",
    \uFCC7: "\u0643\u0644",
    \uFCEB: "\u0643\u0644",
    \uFC81: "\u0643\u0644",
    \uFC3B: "\u0643\u0644",
    \uFCC8: "\u0643\u0645",
    \uFCEC: "\u0643\u0645",
    \uFC82: "\u0643\u0645",
    \uFC3C: "\u0643\u0645",
    \uFDC3: "\u0643\u0645\u0645",
    \uFDBB: "\u0643\u0645\u0645",
    \uFDB7: "\u0643\u0645\u0649",
    \uFC83: "\u0643\u0649",
    \uFC3D: "\u0643\u0649",
    \uFC84: "\u0643\u0649",
    \uFC3E: "\u0643\u0649",
    "\u0762": "\u06AC",
    \uFB94: "\u06AF",
    \uFB95: "\u06AF",
    \uFB93: "\u06AF",
    \uFB92: "\u06AF",
    "\u08B0": "\u06AF",
    \u06B4: "\u06AF\u06DB",
    \uFB9C: "\u06B1",
    \uFB9D: "\u06B1",
    \uFB9B: "\u06B1",
    \uFB9A: "\u06B1",
    \uFB98: "\u06B3",
    \uFB99: "\u06B3",
    \uFB97: "\u06B3",
    \uFB96: "\u06B3",
    "\u{1EE0B}": "\u0644",
    "\u{1EE2B}": "\u0644",
    "\u{1EE4B}": "\u0644",
    "\u{1EE8B}": "\u0644",
    "\u{1EEAB}": "\u0644",
    \uFEDF: "\u0644",
    \uFEE0: "\u0644",
    \uFEDE: "\u0644",
    \uFEDD: "\u0644",
    \u06B7: "\u0644\u06DB",
    \u06B5: "\u0644\u0306",
    \uFEFC: "\u0644l",
    \uFEFB: "\u0644l",
    \uFEFA: "\u0644l\u0655",
    \uFEF9: "\u0644l\u0655",
    \uFEF8: "\u0644l\u0674",
    \uFEF7: "\u0644l\u0674",
    \uFCCD: "\u0644o",
    \uFEF6: "\u0644\u0622",
    \uFEF5: "\u0644\u0622",
    \uFCC9: "\u0644\u062C",
    \uFC3F: "\u0644\u062C",
    \uFD83: "\u0644\u062C\u062C",
    \uFD84: "\u0644\u062C\u062C",
    \uFDBA: "\u0644\u062C\u0645",
    \uFDBC: "\u0644\u062C\u0645",
    \uFDAC: "\u0644\u062C\u0649",
    \uFCCA: "\u0644\u062D",
    \uFC40: "\u0644\u062D",
    \uFDB5: "\u0644\u062D\u0645",
    \uFD80: "\u0644\u062D\u0645",
    \uFD82: "\u0644\u062D\u0649",
    \uFD81: "\u0644\u062D\u0649",
    \uFCCB: "\u0644\u062E",
    \uFC41: "\u0644\u062E",
    \uFD86: "\u0644\u062E\u0645",
    \uFD85: "\u0644\u062E\u0645",
    \uFCCC: "\u0644\u0645",
    \uFCED: "\u0644\u0645",
    \uFC85: "\u0644\u0645",
    \uFC42: "\u0644\u0645",
    \uFD88: "\u0644\u0645\u062D",
    \uFD87: "\u0644\u0645\u062D",
    \uFDAD: "\u0644\u0645\u0649",
    \uFC86: "\u0644\u0649",
    \uFC43: "\u0644\u0649",
    \uFC87: "\u0644\u0649",
    \uFC44: "\u0644\u0649",
    "\u{1EE0C}": "\u0645",
    "\u{1EE2C}": "\u0645",
    "\u{1EE6C}": "\u0645",
    "\u{1EE8C}": "\u0645",
    "\u{1EEAC}": "\u0645",
    \uFEE3: "\u0645",
    \uFEE4: "\u0645",
    \uFEE2: "\u0645",
    \uFEE1: "\u0645",
    "\u08A7": "\u0645\u06DB",
    "\u06FE": "\u0645\u0348",
    \uFC88: "\u0645l",
    \uFCCE: "\u0645\u062C",
    \uFC45: "\u0645\u062C",
    \uFD8C: "\u0645\u062C\u062D",
    \uFD92: "\u0645\u062C\u062E",
    \uFD8D: "\u0645\u062C\u0645",
    \uFDC0: "\u0645\u062C\u0649",
    \uFCCF: "\u0645\u062D",
    \uFC46: "\u0645\u062D",
    \uFD89: "\u0645\u062D\u062C",
    \uFD8A: "\u0645\u062D\u0645",
    \uFDF4: "\u0645\u062D\u0645\u062F",
    \uFD8B: "\u0645\u062D\u0649",
    \uFCD0: "\u0645\u062E",
    \uFC47: "\u0645\u062E",
    \uFD8E: "\u0645\u062E\u062C",
    \uFD8F: "\u0645\u062E\u0645",
    \uFDB9: "\u0645\u062E\u0649",
    \uFCD1: "\u0645\u0645",
    \uFC89: "\u0645\u0645",
    \uFC48: "\u0645\u0645",
    \uFDB1: "\u0645\u0645\u0649",
    \uFC49: "\u0645\u0649",
    \uFC4A: "\u0645\u0649",
    "\u{1EE0D}": "\u0646",
    "\u{1EE2D}": "\u0646",
    "\u{1EE4D}": "\u0646",
    "\u{1EE6D}": "\u0646",
    "\u{1EE8D}": "\u0646",
    "\u{1EEAD}": "\u0646",
    \uFEE7: "\u0646",
    \uFEE8: "\u0646",
    \uFEE6: "\u0646",
    \uFEE5: "\u0646",
    "\u0768": "\u0646\u0615",
    "\u0769": "\u0646\u0306",
    \uFCD6: "\u0646o",
    \uFCEF: "\u0646o",
    \uFDB8: "\u0646\u062C\u062D",
    \uFDBD: "\u0646\u062C\u062D",
    \uFD98: "\u0646\u062C\u0645",
    \uFD97: "\u0646\u062C\u0645",
    \uFD99: "\u0646\u062C\u0649",
    \uFDC7: "\u0646\u062C\u0649",
    \uFCD3: "\u0646\u062D",
    \uFC4C: "\u0646\u062D",
    \uFD95: "\u0646\u062D\u0645",
    \uFD96: "\u0646\u062D\u0649",
    \uFDB3: "\u0646\u062D\u0649",
    \uFCD4: "\u0646\u062E",
    \uFC4D: "\u0646\u062E",
    \uFC8A: "\u0646\u0631",
    \uFC8B: "\u0646\u0632",
    \uFCD5: "\u0646\u0645",
    \uFCEE: "\u0646\u0645",
    \uFC8C: "\u0646\u0645",
    \uFC4E: "\u0646\u0645",
    \uFD9B: "\u0646\u0645\u0649",
    \uFD9A: "\u0646\u0645\u0649",
    \uFC8D: "\u0646\u0646",
    \uFC8E: "\u0646\u0649",
    \uFC4F: "\u0646\u0649",
    \uFC8F: "\u0646\u0649",
    \uFC50: "\u0646\u0649",
    \u06C2: "\u06C0",
    \uFBA5: "\u06C0",
    \uFBA4: "\u06C0",
    "\u{102E4}": "\u0648",
    "\u{1EE05}": "\u0648",
    "\u{1EE85}": "\u0648",
    "\u{1EEA5}": "\u0648",
    \uFEEE: "\u0648",
    \uFEED: "\u0648",
    "\u08B1": "\u0648",
    \u06CB: "\u0648\u06DB",
    \uFBDF: "\u0648\u06DB",
    \uFBDE: "\u0648\u06DB",
    \u06C7: "\u0648\u0313",
    \uFBD8: "\u0648\u0313",
    \uFBD7: "\u0648\u0313",
    \u06C6: "\u0648\u0306",
    \uFBDA: "\u0648\u0306",
    \uFBD9: "\u0648\u0306",
    \u06C9: "\u0648\u0302",
    \uFBE3: "\u0648\u0302",
    \uFBE2: "\u0648\u0302",
    \u06C8: "\u0648\u0670",
    \uFBDC: "\u0648\u0670",
    \uFBDB: "\u0648\u0670",
    \u0624: "\u0648\u0674",
    \uFE86: "\u0648\u0674",
    \uFE85: "\u0648\u0674",
    \u0676: "\u0648\u0674",
    \u0677: "\u0648\u0313\u0674",
    \uFBDD: "\u0648\u0313\u0674",
    \uFDF8: "\u0648\u0633\u0644\u0645",
    \uFBE1: "\u06C5",
    \uFBE0: "\u06C5",
    "\u066E": "\u0649",
    "\u{1EE1C}": "\u0649",
    "\u{1EE7C}": "\u0649",
    \u06BA: "\u0649",
    "\u{1EE1D}": "\u0649",
    "\u{1EE5D}": "\u0649",
    \uFB9F: "\u0649",
    \uFB9E: "\u0649",
    "\u08BD": "\u0649",
    \uFBE8: "\u0649",
    \uFBE9: "\u0649",
    \uFEF0: "\u0649",
    \uFEEF: "\u0649",
    \u064A: "\u0649",
    "\u{1EE09}": "\u0649",
    "\u{1EE29}": "\u0649",
    "\u{1EE49}": "\u0649",
    "\u{1EE69}": "\u0649",
    "\u{1EE89}": "\u0649",
    "\u{1EEA9}": "\u0649",
    \uFEF3: "\u0649",
    \uFEF4: "\u0649",
    \uFEF2: "\u0649",
    \uFEF1: "\u0649",
    \u06CC: "\u0649",
    \uFBFE: "\u0649",
    \uFBFF: "\u0649",
    \uFBFD: "\u0649",
    \uFBFC: "\u0649",
    \u06D2: "\u0649",
    \uFBAF: "\u0649",
    \uFBAE: "\u0649",
    \u0679: "\u0649\u0615",
    \uFB68: "\u0649\u0615",
    \uFB69: "\u0649\u0615",
    \uFB67: "\u0649\u0615",
    \uFB66: "\u0649\u0615",
    \u06BB: "\u0649\u0615",
    \uFBA2: "\u0649\u0615",
    \uFBA3: "\u0649\u0615",
    \uFBA1: "\u0649\u0615",
    \uFBA0: "\u0649\u0615",
    \u067E: "\u0649\u06DB",
    \uFB58: "\u0649\u06DB",
    \uFB59: "\u0649\u06DB",
    \uFB57: "\u0649\u06DB",
    \uFB56: "\u0649\u06DB",
    \u062B: "\u0649\u06DB",
    "\u{1EE16}": "\u0649\u06DB",
    "\u{1EE36}": "\u0649\u06DB",
    "\u{1EE76}": "\u0649\u06DB",
    "\u{1EE96}": "\u0649\u06DB",
    "\u{1EEB6}": "\u0649\u06DB",
    \uFE9B: "\u0649\u06DB",
    \uFE9C: "\u0649\u06DB",
    \uFE9A: "\u0649\u06DB",
    \uFE99: "\u0649\u06DB",
    \u06BD: "\u0649\u06DB",
    \u06D1: "\u0649\u06DB",
    "\u063F": "\u0649\u06DB",
    "\u08B7": "\u0649\u06DB\u06E2",
    "\u0756": "\u0649\u0306",
    \u06CE: "\u0649\u0306",
    "\u08BA": "\u0649\u0306\u0307",
    "\u063D": "\u0649\u0302",
    "\u08A8": "\u0649\u0654",
    \uFC90: "\u0649\u0670",
    \uFC5D: "\u0649\u0670",
    \uFCDE: "\u0649o",
    \uFCF1: "\u0649o",
    \uFCE6: "\u0649\u06DBo",
    \u0626: "\u0649\u0674",
    \uFE8B: "\u0649\u0674",
    \uFE8C: "\u0649\u0674",
    \uFE8A: "\u0649\u0674",
    \uFE89: "\u0649\u0674",
    \u0678: "\u0649\u0674",
    \uFBEB: "\u0649\u0674l",
    \uFBEA: "\u0649\u0674l",
    \uFC9B: "\u0649\u0674o",
    \uFCE0: "\u0649\u0674o",
    \uFBED: "\u0649\u0674o",
    \uFBEC: "\u0649\u0674o",
    \uFBF8: "\u0649\u0674\u067B",
    \uFBF7: "\u0649\u0674\u067B",
    \uFBF6: "\u0649\u0674\u067B",
    \uFC97: "\u0649\u0674\u062C",
    \uFC00: "\u0649\u0674\u062C",
    \uFC98: "\u0649\u0674\u062D",
    \uFC01: "\u0649\u0674\u062D",
    \uFC99: "\u0649\u0674\u062E",
    \uFC64: "\u0649\u0674\u0631",
    \uFC65: "\u0649\u0674\u0632",
    \uFC9A: "\u0649\u0674\u0645",
    \uFCDF: "\u0649\u0674\u0645",
    \uFC66: "\u0649\u0674\u0645",
    \uFC02: "\u0649\u0674\u0645",
    \uFC67: "\u0649\u0674\u0646",
    \uFBEF: "\u0649\u0674\u0648",
    \uFBEE: "\u0649\u0674\u0648",
    \uFBF1: "\u0649\u0674\u0648\u0313",
    \uFBF0: "\u0649\u0674\u0648\u0313",
    \uFBF3: "\u0649\u0674\u0648\u0306",
    \uFBF2: "\u0649\u0674\u0648\u0306",
    \uFBF5: "\u0649\u0674\u0648\u0670",
    \uFBF4: "\u0649\u0674\u0648\u0670",
    \uFBFB: "\u0649\u0674\u0649",
    \uFBFA: "\u0649\u0674\u0649",
    \uFC68: "\u0649\u0674\u0649",
    \uFBF9: "\u0649\u0674\u0649",
    \uFC03: "\u0649\u0674\u0649",
    \uFC69: "\u0649\u0674\u0649",
    \uFC04: "\u0649\u0674\u0649",
    \uFCDA: "\u0649\u062C",
    \uFC55: "\u0649\u062C",
    \uFC11: "\u0649\u06DB\u062C",
    \uFDAF: "\u0649\u062C\u0649",
    \uFCDB: "\u0649\u062D",
    \uFC56: "\u0649\u062D",
    \uFDAE: "\u0649\u062D\u0649",
    \uFCDC: "\u0649\u062E",
    \uFC57: "\u0649\u062E",
    \uFC91: "\u0649\u0631",
    \uFC76: "\u0649\u06DB\u0631",
    \uFC92: "\u0649\u0632",
    \uFC77: "\u0649\u06DB\u0632",
    \uFCDD: "\u0649\u0645",
    \uFCF0: "\u0649\u0645",
    \uFC93: "\u0649\u0645",
    \uFC58: "\u0649\u0645",
    \uFCA6: "\u0649\u06DB\u0645",
    \uFCE5: "\u0649\u06DB\u0645",
    \uFC78: "\u0649\u06DB\u0645",
    \uFC12: "\u0649\u06DB\u0645",
    \uFD9D: "\u0649\u0645\u0645",
    \uFD9C: "\u0649\u0645\u0645",
    \uFDB0: "\u0649\u0645\u0649",
    \uFC94: "\u0649\u0646",
    \uFC79: "\u0649\u06DB\u0646",
    \uFC95: "\u0649\u0649",
    \uFC59: "\u0649\u0649",
    \uFC96: "\u0649\u0649",
    \uFC5A: "\u0649\u0649",
    \uFC7A: "\u0649\u06DB\u0649",
    \uFC13: "\u0649\u06DB\u0649",
    \uFC7B: "\u0649\u06DB\u0649",
    \uFC14: "\u0649\u06DB\u0649",
    \uFBB1: "\u06D3",
    \uFBB0: "\u06D3",
    "\u{102B8}": "\u2D40",
    "\u205E": "\u2D42",
    "\u2E3D": "\u2D42",
    "\u2999": "\u2D42",
    "\uFE19": "\u2D57",
    "\u205D": "\u2D57",
    "\u22EE": "\u2D57",
    \u0544: "\u1206",
    \u054C: "\u1261",
    \u053B: "\u12AE",
    \u054A: "\u1323",
    \u0906: "\u0905\u093E",
    \u0912: "\u0905\u093E\u0946",
    \u0913: "\u0905\u093E\u0947",
    \u0914: "\u0905\u093E\u0948",
    "\u0904": "\u0905\u0946",
    \u0911: "\u0905\u0949",
    \u090D: "\u090F\u0945",
    \u090E: "\u090F\u0946",
    \u0910: "\u090F\u0947",
    \u0908: "\u0930\u094D\u0907",
    \u0ABD: "\u093D",
    "\u{111DC}": "\uA8FB",
    "\u{111CB}": "\u093A",
    "\u0AC1": "\u0941",
    "\u0AC2": "\u0942",
    "\u0A4B": "\u0946",
    "\u0A4D": "\u094D",
    "\u0ACD": "\u094D",
    \u0986: "\u0985\u09BE",
    \u09E0: "\u098B\u09C3",
    \u09E1: "\u098B\u09C3",
    "\u{11492}": "\u0998",
    "\u{11494}": "\u099A",
    "\u{11496}": "\u099C",
    "\u{11498}": "\u099E",
    "\u{11499}": "\u099F",
    "\u{1149B}": "\u09A1",
    "\u{114AA}": "\u09A3",
    "\u{1149E}": "\u09A4",
    "\u{1149F}": "\u09A5",
    "\u{114A0}": "\u09A6",
    "\u{114A1}": "\u09A7",
    "\u{114A2}": "\u09A8",
    "\u{114A3}": "\u09AA",
    "\u{114A9}": "\u09AC",
    "\u{114A7}": "\u09AE",
    "\u{114A8}": "\u09AF",
    "\u{114AB}": "\u09B0",
    "\u{1149D}": "\u09B2",
    "\u{114AD}": "\u09B7",
    "\u{114AE}": "\u09B8",
    "\u{114C4}": "\u09BD",
    "\u{114B0}": "\u09BE",
    "\u{114B1}": "\u09BF",
    "\u{114B9}": "\u09C7",
    "\u{114BC}": "\u09CB",
    "\u{114BE}": "\u09CC",
    "\u{114C2}": "\u09CD",
    "\u{114BD}": "\u09D7",
    \u0A09: "\u0A73\u0A41",
    \u0A0A: "\u0A73\u0A42",
    \u0A06: "\u0A05\u0A3E",
    \u0A10: "\u0A05\u0A48",
    \u0A14: "\u0A05\u0A4C",
    \u0A07: "\u0A72\u0A3F",
    \u0A08: "\u0A72\u0A40",
    \u0A0F: "\u0A72\u0A47",
    \u0A86: "\u0A85\u0ABE",
    \u0A91: "\u0A85\u0ABE\u0AC5",
    \u0A93: "\u0A85\u0ABE\u0AC7",
    \u0A94: "\u0A85\u0ABE\u0AC8",
    \u0A8D: "\u0A85\u0AC5",
    \u0A8F: "\u0A85\u0AC7",
    \u0A90: "\u0A85\u0AC8",
    \u0B06: "\u0B05\u0B3E",
    "\u0BEE": "\u0B85",
    \u0BB0: "\u0B88",
    "\u0BBE": "\u0B88",
    "\u0BEB": "\u0B88\u0BC1",
    "\u0BE8": "\u0B89",
    \u0D09: "\u0B89",
    \u0B8A: "\u0B89\u0BB3",
    \u0D0A: "\u0B89\u0D57",
    "\u0BED": "\u0B8E",
    "\u0BF7": "\u0B8E\u0BB5",
    \u0B9C: "\u0B90",
    \u0D1C: "\u0B90",
    "\u0BE7": "\u0B95",
    "\u0BEA": "\u0B9A",
    "\u0BEC": "\u0B9A\u0BC1",
    "\u0BF2": "\u0B9A\u0BC2",
    "\u0D3A": "\u0B9F\u0BBF",
    \u0D23: "\u0BA3",
    "\u0BFA": "\u0BA8\u0BC0",
    "\u0BF4": "\u0BAE\u0BC0",
    "\u0BF0": "\u0BAF",
    \u0D34: "\u0BB4",
    "\u0BD7": "\u0BB3",
    "\u0BC8": "\u0BA9",
    \u0D36: "\u0BB6",
    "\u0BF8": "\u0BB7",
    "\u0D3F": "\u0BBF",
    "\u0D40": "\u0BBF",
    "\u0BCA": "\u0BC6\u0B88",
    "\u0BCC": "\u0BC6\u0BB3",
    "\u0BCB": "\u0BC7\u0B88",
    \u0C85: "\u0C05",
    \u0C86: "\u0C06",
    \u0C87: "\u0C07",
    \u0C60: "\u0C0B\u0C3E",
    \u0C61: "\u0C0C\u0C3E",
    \u0C92: "\u0C12",
    \u0C14: "\u0C12\u0C4C",
    \u0C94: "\u0C12\u0C4C",
    \u0C13: "\u0C12\u0C55",
    \u0C93: "\u0C12\u0C55",
    \u0C9C: "\u0C1C",
    \u0C9E: "\u0C1E",
    \u0C22: "\u0C21\u0323",
    \u0CA3: "\u0C23",
    \u0C25: "\u0C27\u05BC",
    \u0C2D: "\u0C2C\u0323",
    \u0CAF: "\u0C2F",
    \u0C20: "\u0C30\u05BC",
    \u0CB1: "\u0C31",
    \u0CB2: "\u0C32",
    \u0C37: "\u0C35\u0323",
    \u0C39: "\u0C35\u0C3E",
    \u0C2E: "\u0C35\u0C41",
    "\u0C42": "\u0C41\u0C3E",
    "\u0C44": "\u0C43\u0C3E",
    \u0CE1: "\u0C8C\u0CBE",
    \u0D08: "\u0D07\u0D57",
    \u0D10: "\u0D0E\u0D46",
    \u0D13: "\u0D12\u0D3E",
    \u0D14: "\u0D12\u0D57",
    \u0D61: "\u0D1E",
    "\u0D6B": "\u0D26\u0D4D\u0D30",
    "\u0D79": "\u0D28\u0D41",
    \u0D0C: "\u0D28\u0D41",
    \u0D19: "\u0D28\u0D41",
    "\u0D6F": "\u0D28\u0D4D",
    "\u0D7B": "\u0D28\u0D4D",
    "\u0D6C": "\u0D28\u0D4D\u0D28",
    "\u0D5A": "\u0D28\u0D4D\u0D2E",
    \u0D31: "\u0D30",
    "\u0D6A": "\u0D30\u0D4D",
    "\u0D7C": "\u0D30\u0D4D",
    "\u0D6E": "\u0D35\u0D4D\u0D30",
    "\u0D76": "\u0D39\u0D4D\u0D2E",
    "\u0D42": "\u0D41",
    "\u0D43": "\u0D41",
    "\u0D48": "\u0D46\u0D46",
    "\u0DEA": "\u0DA2",
    "\u0DEB": "\u0DAF",
    "\u{11413}": "\u{11434}\u{11442}\u{11412}",
    "\u{11419}": "\u{11434}\u{11442}\u{11418}",
    "\u{11424}": "\u{11434}\u{11442}\u{11423}",
    "\u{1142A}": "\u{11434}\u{11442}\u{11429}",
    "\u{1142D}": "\u{11434}\u{11442}\u{1142C}",
    "\u{1142F}": "\u{11434}\u{11442}\u{1142E}",
    "\u{115D8}": "\u{11582}",
    "\u{115D9}": "\u{11582}",
    "\u{115DA}": "\u{11583}",
    "\u{115DB}": "\u{11584}",
    "\u{115DC}": "\u{115B2}",
    "\u{115DD}": "\u{115B3}",
    \u0E03: "\u0E02",
    \u0E14: "\u0E04",
    \u0E15: "\u0E04",
    \u0E21: "\u0E06",
    \u0E88: "\u0E08",
    \u0E0B: "\u0E0A",
    \u0E0F: "\u0E0E",
    \u0E17: "\u0E11",
    \u0E9A: "\u0E1A",
    \u0E9B: "\u0E1B",
    \u0E9D: "\u0E1D",
    \u0E9E: "\u0E1E",
    \u0E9F: "\u0E1F",
    \u0E26: "\u0E20",
    \u0E8D: "\u0E22",
    "\u17D4": "\u0E2F",
    \u0E45: "\u0E32",
    \u0E33: "\u030A\u0E32",
    "\u17B7": "\u0E34",
    "\u17B8": "\u0E35",
    "\u17B9": "\u0E36",
    "\u17BA": "\u0E37",
    "\u0EB8": "\u0E38",
    "\u0EB9": "\u0E39",
    \u0E41: "\u0E40\u0E40",
    \u0EDC: "\u0EAB\u0E99",
    \u0EDD: "\u0EAB\u0EA1",
    \u0EB3: "\u030A\u0EB2",
    "\u0F02": "\u0F60\u0F74\u0F82\u0F7F",
    "\u0F03": "\u0F60\u0F74\u0F82\u0F14",
    \u0F6A: "\u0F62",
    \u0F00: "\u0F68\u0F7C\u0F7E",
    "\u0F77": "\u0FB2\u0F71\u0F80",
    "\u0F79": "\u0FB3\u0F71\u0F80",
    "\u{11CB2}": "\u{11CAA}",
    "\u1081": "\u1002\u103E",
    \u1000: "\u1002\u102C",
    "\u1070": "\u1003\u103E",
    "\u1066": "\u1015\u103E",
    \u101F: "\u1015\u102C",
    "\u106F": "\u1015\u102C\u103E",
    "\u107E": "\u107D\u103E",
    \u1029: "\u101E\u103C",
    \u102A: "\u101E\u103C\u1031\u102C\u103A",
    "\u109E": "\u1083\u030A",
    \u17A3: "\u17A2",
    "\u19D0": "\u199E",
    "\u19D1": "\u19B1",
    "\u1A80": "\u1A45",
    "\u1A90": "\u1A45",
    "\uAA53": "\uAA01",
    "\uAA56": "\uAA23",
    "\u1B52": "\u1B0D",
    "\u1B53": "\u1B11",
    "\u1B58": "\u1B28",
    "\uA9A3": "\uA99D",
    \u1896: "\u185C",
    \u1855: "\u1835",
    \u1FF6: "\u13EF",
    \u140D: "\u1401\xB7",
    \u142B: "\u1401\u1420",
    \u1411: "\u1404\xB7",
    \u1413: "\u1405\xB7",
    \u142D: "\u1405\u1420",
    \u1415: "\u1406\xB7",
    \u1418: "\u140A\xB7",
    \u142E: "\u140A\u1420",
    \u141A: "\u140B\xB7",
    "\u18DD": "\u141E\u18DF",
    \u14D1: "\u1421",
    \u1540: "\u1429",
    \u143F: "\u1432\xB7",
    \u1443: "\u1434\xB7",
    "\u2369": "\u1435",
    \u1447: "\u1439\xB7",
    \u145C: "\u144F\xB7",
    "\u2E27": "\u1450",
    "\u2283": "\u1450",
    \u145E: "\u1450\xB7",
    \u1469: "\u1450'",
    "\u27C9": "\u1450/",
    "\u2AD7": "\u1450\u1455",
    \u1460: "\u1451\xB7",
    "\u2E26": "\u1455",
    "\u2282": "\u1455",
    \u1462: "\u1455\xB7",
    \u146A: "\u1455'",
    \u1464: "\u1456\xB7",
    \u1475: "\u146B\xB7",
    \u1485: "\u146B'",
    \u1479: "\u146E\xB7",
    \u147D: "\u1470\xB7",
    \u1603: "\u1489",
    \u1493: "\u1489\xB7",
    \u1495: "\u148B\xB7",
    \u1497: "\u148C\xB7",
    \u149B: "\u148E\xB7",
    \u1602: "\u1490",
    \u149D: "\u1490\xB7",
    \u149F: "\u1491\xB7",
    \u14AD: "\u14A3\xB7",
    \u14B1: "\u14A6\xB7",
    \u14B3: "\u14A7\xB7",
    \u14B5: "\u14A8\xB7",
    \u14B9: "\u14AB\xB7",
    \u14CA: "\u14C0\xB7",
    "\u18C7": "\u14C2\xB7",
    "\u18C9": "\u14C3\xB7",
    "\u18CB": "\u14C4\xB7",
    "\u18CD": "\u14C5\xB7",
    \u14CC: "\u14C7\xB7",
    \u14CE: "\u14C8\xB7",
    \u1604: "\u14D3",
    \u14DD: "\u14D3\xB7",
    \u14DF: "\u14D5\xB7",
    \u14E1: "\u14D6\xB7",
    \u14E3: "\u14D7\xB7",
    \u14E5: "\u14D8\xB7",
    \u1607: "\u14DA",
    \u14E7: "\u14DA\xB7",
    \u14E9: "\u14DB\xB7",
    \u14F7: "\u14ED\xB7",
    \u14F9: "\u14EF\xB7",
    \u14FB: "\u14F0\xB7",
    \u14FD: "\u14F1\xB7",
    \u14FF: "\u14F2\xB7",
    \u1501: "\u14F4\xB7",
    \u1503: "\u14F5\xB7",
    \u150C: "\u150B<",
    \u150E: "\u150Bb",
    \u150D: "\u150B\u1455",
    \u150F: "\u150B\u1490",
    \u1518: "\u1510\xB7",
    \u151A: "\u1511\xB7",
    \u151C: "\u1512\xB7",
    \u151E: "\u1513\xB7",
    \u1520: "\u1514\xB7",
    \u1522: "\u1515\xB7",
    \u1524: "\u1516\xB7",
    \u1532: "\u1528\xB7",
    \u1534: "\u1529\xB7",
    \u1536: "\u152A\xB7",
    \u1538: "\u152B\xB7",
    \u153A: "\u152D\xB7",
    \u153C: "\u152E\xB7",
    \u1622: "\u1543",
    "\u18E0": "\u1543\xB7",
    \u1623: "\u1546",
    \u1624: "\u154A",
    \u154F: "\u154C\xB7",
    \u1583: "\u1550b",
    \u1584: "\u1550b\u0307",
    \u1581: "\u1550d",
    \u157F: "\u1550P",
    \u166F: "\u1550\u146B",
    \u157E: "\u1550\u146C",
    \u1580: "\u1550\u146E",
    \u1582: "\u1550\u1470",
    \u1585: "\u1550\u1483",
    \u155C: "\u155A\xB7",
    "\u18E3": "\u155E\xB7",
    "\u18E4": "\u1566\xB7",
    \u1569: "\u1567\xB7",
    "\u18E5": "\u156B\xB7",
    "\u18E8": "\u1586\xB7",
    \u1591: "\u1595J",
    \u1670: "\u1595\u1489",
    \u158E: "\u1595\u148A",
    \u158F: "\u1595\u148B",
    \u1590: "\u1595\u148C",
    \u1592: "\u1595\u148E",
    \u1593: "\u1595\u1490",
    \u1594: "\u1595\u1491",
    \u1673: "\u1596J",
    \u1671: "\u1596\u148B",
    \u1672: "\u1596\u148C",
    \u1674: "\u1596\u148E",
    \u1675: "\u1596\u1490",
    \u1676: "\u1596\u1491",
    "\u18EA": "\u1597\xB7",
    "\u1677": "\u15A7\xB7",
    "\u1678": "\u15A8\xB7",
    "\u1679": "\u15A9\xB7",
    "\u167A": "\u15AA\xB7",
    "\u167B": "\u15AB\xB7",
    "\u167C": "\u15AC\xB7",
    "\u167D": "\u15AD\xB7",
    "\u2AAB": "\u15D2",
    "\u2AAA": "\u15D5",
    "\uA4F7": "\u15E1",
    "\u18F0": "\u15F4\xB7",
    "\u18F2": "\u161B\xB7",
    "\u1DBB": "\u1646",
    "\uA4ED": "\u1660",
    "\u1DBA": "\u18D4",
    "\u1D3E": "\u18D6",
    "\u18DC": "\u18DF\u141E",
    \u02E1: "\u18F3",
    \u02B3: "\u18F4",
    \u02E2: "\u18F5",
    "\u18DB": "\u18F5",
    "\uA6B0": "\u16B9",
    \u16E1: "\u16BC",
    "\u237F": "\u16BD",
    \u16C2: "\u16BD",
    "\u{1D23F}": "\u16CB",
    "\u2191": "\u16CF",
    "\u21BF": "\u16D0",
    "\u296E": "\u16D0\u21C2",
    "\u2963": "\u16D0\u16DA",
    "\u2D63": "\u16EF",
    "\u21BE": "\u16DA",
    "\u2A21": "\u16DA",
    "\u22C4": "\u16DC",
    "\u25C7": "\u16DC",
    "\u25CA": "\u16DC",
    "\u2662": "\u16DC",
    "\u{1F754}": "\u16DC",
    "\u{118B7}": "\u16DC",
    "\u{10294}": "\u16DC",
    "\u235A": "\u16DC\u0332",
    "\u22C8": "\u16DE",
    "\u2A1D": "\u16DE",
    "\u{104D0}": "\u16E6",
    "\u2195": "\u16E8",
    "\u{10CFC}": "\u{10C82}",
    "\u{10CFA}": "\u{10CA5}",
    \u3131: "\u1100",
    \u11A8: "\u1100",
    \u1101: "\u1100\u1100",
    \u3132: "\u1100\u1100",
    \u11A9: "\u1100\u1100",
    "\u11FA": "\u1100\u1102",
    "\u115A": "\u1100\u1103",
    \u11C3: "\u1100\u1105",
    "\u11FB": "\u1100\u1107",
    \u11AA: "\u1100\u1109",
    \u3133: "\u1100\u1109",
    \u11C4: "\u1100\u1109\u1100",
    "\u11FC": "\u1100\u110E",
    "\u11FD": "\u1100\u110F",
    "\u11FE": "\u1100\u1112",
    \u3134: "\u1102",
    \u11AB: "\u1102",
    \u1113: "\u1102\u1100",
    \u11C5: "\u1102\u1100",
    \u1114: "\u1102\u1102",
    \u3165: "\u1102\u1102",
    "\u11FF": "\u1102\u1102",
    \u1115: "\u1102\u1103",
    \u3166: "\u1102\u1103",
    \u11C6: "\u1102\u1103",
    "\uD7CB": "\u1102\u1105",
    \u1116: "\u1102\u1107",
    "\u115B": "\u1102\u1109",
    \u11C7: "\u1102\u1109",
    \u3167: "\u1102\u1109",
    "\u115C": "\u1102\u110C",
    \u11AC: "\u1102\u110C",
    \u3135: "\u1102\u110C",
    "\uD7CC": "\u1102\u110E",
    \u11C9: "\u1102\u1110",
    "\u115D": "\u1102\u1112",
    \u11AD: "\u1102\u1112",
    \u3136: "\u1102\u1112",
    \u11C8: "\u1102\u1140",
    \u3168: "\u1102\u1140",
    \u3137: "\u1103",
    \u11AE: "\u1103",
    \u1117: "\u1103\u1100",
    \u11CA: "\u1103\u1100",
    \u1104: "\u1103\u1103",
    \u3138: "\u1103\u1103",
    "\uD7CD": "\u1103\u1103",
    "\uD7CE": "\u1103\u1103\u1107",
    "\u115E": "\u1103\u1105",
    \u11CB: "\u1103\u1105",
    "\uA960": "\u1103\u1106",
    "\uA961": "\u1103\u1107",
    "\uD7CF": "\u1103\u1107",
    "\uA962": "\u1103\u1109",
    "\uD7D0": "\u1103\u1109",
    "\uD7D1": "\u1103\u1109\u1100",
    "\uA963": "\u1103\u110C",
    "\uD7D2": "\u1103\u110C",
    "\uD7D3": "\u1103\u110E",
    "\uD7D4": "\u1103\u1110",
    \u3139: "\u1105",
    \u11AF: "\u1105",
    "\uA964": "\u1105\u1100",
    \u11B0: "\u1105\u1100",
    \u313A: "\u1105\u1100",
    "\uA965": "\u1105\u1100\u1100",
    "\uD7D5": "\u1105\u1100\u1100",
    \u11CC: "\u1105\u1100\u1109",
    \u3169: "\u1105\u1100\u1109",
    "\uD7D6": "\u1105\u1100\u1112",
    \u1118: "\u1105\u1102",
    \u11CD: "\u1105\u1102",
    "\uA966": "\u1105\u1103",
    \u11CE: "\u1105\u1103",
    \u316A: "\u1105\u1103",
    "\uA967": "\u1105\u1103\u1103",
    \u11CF: "\u1105\u1103\u1112",
    \u1119: "\u1105\u1105",
    \u11D0: "\u1105\u1105",
    "\uD7D7": "\u1105\u1105\u110F",
    "\uA968": "\u1105\u1106",
    \u11B1: "\u1105\u1106",
    \u313B: "\u1105\u1106",
    \u11D1: "\u1105\u1106\u1100",
    \u11D2: "\u1105\u1106\u1109",
    "\uD7D8": "\u1105\u1106\u1112",
    "\uA969": "\u1105\u1107",
    \u11B2: "\u1105\u1107",
    \u313C: "\u1105\u1107",
    "\uD7D9": "\u1105\u1107\u1103",
    "\uA96A": "\u1105\u1107\u1107",
    \u11D3: "\u1105\u1107\u1109",
    \u316B: "\u1105\u1107\u1109",
    "\uA96B": "\u1105\u1107\u110B",
    \u11D5: "\u1105\u1107\u110B",
    "\uD7DA": "\u1105\u1107\u1111",
    \u11D4: "\u1105\u1107\u1112",
    "\uA96C": "\u1105\u1109",
    \u11B3: "\u1105\u1109",
    \u313D: "\u1105\u1109",
    \u11D6: "\u1105\u1109\u1109",
    \u111B: "\u1105\u110B",
    "\uD7DD": "\u1105\u110B",
    "\uA96D": "\u1105\u110C",
    "\uA96E": "\u1105\u110F",
    \u11D8: "\u1105\u110F",
    \u11B4: "\u1105\u1110",
    \u313E: "\u1105\u1110",
    \u11B5: "\u1105\u1111",
    \u313F: "\u1105\u1111",
    \u111A: "\u1105\u1112",
    \u3140: "\u1105\u1112",
    \u113B: "\u1105\u1112",
    \u11B6: "\u1105\u1112",
    "\uD7F2": "\u1105\u1112",
    \u11D7: "\u1105\u1140",
    \u316C: "\u1105\u1140",
    "\uD7DB": "\u1105\u114C",
    \u11D9: "\u1105\u1159",
    \u316D: "\u1105\u1159",
    "\uD7DC": "\u1105\u1159\u1112",
    \u3141: "\u1106",
    \u11B7: "\u1106",
    "\uA96F": "\u1106\u1100",
    \u11DA: "\u1106\u1100",
    "\uD7DE": "\u1106\u1102",
    "\uD7DF": "\u1106\u1102\u1102",
    "\uA970": "\u1106\u1103",
    \u11DB: "\u1106\u1105",
    "\uD7E0": "\u1106\u1106",
    \u111C: "\u1106\u1107",
    \u316E: "\u1106\u1107",
    \u11DC: "\u1106\u1107",
    "\uD7E1": "\u1106\u1107\u1109",
    "\uA971": "\u1106\u1109",
    \u11DD: "\u1106\u1109",
    \u316F: "\u1106\u1109",
    \u11DE: "\u1106\u1109\u1109",
    \u111D: "\u1106\u110B",
    \u3171: "\u1106\u110B",
    \u11E2: "\u1106\u110B",
    "\uD7E2": "\u1106\u110C",
    \u11E0: "\u1106\u110E",
    \u11E1: "\u1106\u1112",
    \u11DF: "\u1106\u1140",
    \u3170: "\u1106\u1140",
    \u3142: "\u1107",
    \u11B8: "\u1107",
    \u111E: "\u1107\u1100",
    \u3172: "\u1107\u1100",
    \u111F: "\u1107\u1102",
    \u1120: "\u1107\u1103",
    \u3173: "\u1107\u1103",
    "\uD7E3": "\u1107\u1103",
    \u11E3: "\u1107\u1105",
    "\uD7E4": "\u1107\u1105\u1111",
    "\uD7E5": "\u1107\u1106",
    \u1108: "\u1107\u1107",
    \u3143: "\u1107\u1107",
    "\uD7E6": "\u1107\u1107",
    \u112C: "\u1107\u1107\u110B",
    \u3179: "\u1107\u1107\u110B",
    \u1121: "\u1107\u1109",
    \u3144: "\u1107\u1109",
    \u11B9: "\u1107\u1109",
    \u1122: "\u1107\u1109\u1100",
    \u3174: "\u1107\u1109\u1100",
    \u1123: "\u1107\u1109\u1103",
    \u3175: "\u1107\u1109\u1103",
    "\uD7E7": "\u1107\u1109\u1103",
    \u1124: "\u1107\u1109\u1107",
    \u1125: "\u1107\u1109\u1109",
    \u1126: "\u1107\u1109\u110C",
    "\uA972": "\u1107\u1109\u1110",
    \u112B: "\u1107\u110B",
    \u3178: "\u1107\u110B",
    \u11E6: "\u1107\u110B",
    \u1127: "\u1107\u110C",
    \u3176: "\u1107\u110C",
    "\uD7E8": "\u1107\u110C",
    \u1128: "\u1107\u110E",
    "\uD7E9": "\u1107\u110E",
    "\uA973": "\u1107\u110F",
    \u1129: "\u1107\u1110",
    \u3177: "\u1107\u1110",
    \u112A: "\u1107\u1111",
    \u11E4: "\u1107\u1111",
    "\uA974": "\u1107\u1112",
    \u11E5: "\u1107\u1112",
    \u3145: "\u1109",
    \u11BA: "\u1109",
    \u112D: "\u1109\u1100",
    \u317A: "\u1109\u1100",
    \u11E7: "\u1109\u1100",
    \u112E: "\u1109\u1102",
    \u317B: "\u1109\u1102",
    \u112F: "\u1109\u1103",
    \u317C: "\u1109\u1103",
    \u11E8: "\u1109\u1103",
    \u1130: "\u1109\u1105",
    \u11E9: "\u1109\u1105",
    \u1131: "\u1109\u1106",
    "\uD7EA": "\u1109\u1106",
    \u1132: "\u1109\u1107",
    \u317D: "\u1109\u1107",
    \u11EA: "\u1109\u1107",
    \u1133: "\u1109\u1107\u1100",
    "\uD7EB": "\u1109\u1107\u110B",
    \u110A: "\u1109\u1109",
    \u3146: "\u1109\u1109",
    \u11BB: "\u1109\u1109",
    "\uD7EC": "\u1109\u1109\u1100",
    "\uD7ED": "\u1109\u1109\u1103",
    "\uA975": "\u1109\u1109\u1107",
    \u1134: "\u1109\u1109\u1109",
    \u1135: "\u1109\u110B",
    \u1136: "\u1109\u110C",
    \u317E: "\u1109\u110C",
    "\uD7EF": "\u1109\u110C",
    \u1137: "\u1109\u110E",
    "\uD7F0": "\u1109\u110E",
    \u1138: "\u1109\u110F",
    \u1139: "\u1109\u1110",
    "\uD7F1": "\u1109\u1110",
    \u113A: "\u1109\u1111",
    "\uD7EE": "\u1109\u1140",
    \u3147: "\u110B",
    \u11BC: "\u110B",
    \u1141: "\u110B\u1100",
    \u11EC: "\u110B\u1100",
    \u11ED: "\u110B\u1100\u1100",
    \u1142: "\u110B\u1103",
    "\uA976": "\u110B\u1105",
    \u1143: "\u110B\u1106",
    \u1144: "\u110B\u1107",
    \u1145: "\u110B\u1109",
    \u11F1: "\u110B\u1109",
    \u3182: "\u110B\u1109",
    \u1147: "\u110B\u110B",
    \u3180: "\u110B\u110B",
    \u11EE: "\u110B\u110B",
    \u1148: "\u110B\u110C",
    \u1149: "\u110B\u110E",
    \u11EF: "\u110B\u110F",
    \u114A: "\u110B\u1110",
    \u114B: "\u110B\u1111",
    "\uA977": "\u110B\u1112",
    \u1146: "\u110B\u1140",
    \u11F2: "\u110B\u1140",
    \u3183: "\u110B\u1140",
    \u3148: "\u110C",
    \u11BD: "\u110C",
    "\uD7F7": "\u110C\u1107",
    "\uD7F8": "\u110C\u1107\u1107",
    \u114D: "\u110C\u110B",
    \u110D: "\u110C\u110C",
    \u3149: "\u110C\u110C",
    "\uD7F9": "\u110C\u110C",
    "\uA978": "\u110C\u110C\u1112",
    \u314A: "\u110E",
    \u11BE: "\u110E",
    \u1152: "\u110E\u110F",
    \u1153: "\u110E\u1112",
    \u314B: "\u110F",
    \u11BF: "\u110F",
    \u314C: "\u1110",
    \u11C0: "\u1110",
    "\uA979": "\u1110\u1110",
    \u314D: "\u1111",
    \u11C1: "\u1111",
    \u1156: "\u1111\u1107",
    \u11F3: "\u1111\u1107",
    "\uD7FA": "\u1111\u1109",
    \u1157: "\u1111\u110B",
    \u3184: "\u1111\u110B",
    \u11F4: "\u1111\u110B",
    "\uD7FB": "\u1111\u1110",
    "\uA97A": "\u1111\u1112",
    \u314E: "\u1112",
    \u11C2: "\u1112",
    \u11F5: "\u1112\u1102",
    \u11F6: "\u1112\u1105",
    \u11F7: "\u1112\u1106",
    \u11F8: "\u1112\u1107",
    "\uA97B": "\u1112\u1109",
    \u1158: "\u1112\u1112",
    \u3185: "\u1112\u1112",
    \u113D: "\u113C\u113C",
    \u113F: "\u113E\u113E",
    \u317F: "\u1140",
    \u11EB: "\u1140",
    "\uD7F3": "\u1140\u1107",
    "\uD7F4": "\u1140\u1107\u110B",
    \u3181: "\u114C",
    \u11F0: "\u114C",
    "\uD7F5": "\u114C\u1106",
    "\uD7F6": "\u114C\u1112",
    \u114F: "\u114E\u114E",
    \u1151: "\u1150\u1150",
    \u3186: "\u1159",
    \u11F9: "\u1159",
    "\uA97C": "\u1159\u1159",
    \u3164: "\u1160",
    \u314F: "\u1161",
    "\u11A3": "\u1161\u30FC",
    \u1176: "\u1161\u1169",
    \u1177: "\u1161\u116E",
    \u1162: "\u1161\u4E28",
    \u3150: "\u1161\u4E28",
    \u3151: "\u1163",
    \u1178: "\u1163\u1169",
    \u1179: "\u1163\u116D",
    "\u11A4": "\u1163\u116E",
    \u1164: "\u1163\u4E28",
    \u3152: "\u1163\u4E28",
    \u3153: "\u1165",
    \u117C: "\u1165\u30FC",
    \u117A: "\u1165\u1169",
    \u117B: "\u1165\u116E",
    \u1166: "\u1165\u4E28",
    \u3154: "\u1165\u4E28",
    \u3155: "\u1167",
    "\u11A5": "\u1167\u1163",
    \u117D: "\u1167\u1169",
    \u117E: "\u1167\u116E",
    \u1168: "\u1167\u4E28",
    \u3156: "\u1167\u4E28",
    \u3157: "\u1169",
    \u116A: "\u1169\u1161",
    \u3158: "\u1169\u1161",
    \u116B: "\u1169\u1161\u4E28",
    \u3159: "\u1169\u1161\u4E28",
    "\u11A6": "\u1169\u1163",
    "\u11A7": "\u1169\u1163\u4E28",
    \u117F: "\u1169\u1165",
    \u1180: "\u1169\u1165\u4E28",
    "\uD7B0": "\u1169\u1167",
    \u1181: "\u1169\u1167\u4E28",
    \u1182: "\u1169\u1169",
    "\uD7B1": "\u1169\u1169\u4E28",
    \u1183: "\u1169\u116E",
    \u116C: "\u1169\u4E28",
    \u315A: "\u1169\u4E28",
    \u315B: "\u116D",
    "\uD7B2": "\u116D\u1161",
    "\uD7B3": "\u116D\u1161\u4E28",
    \u1184: "\u116D\u1163",
    \u3187: "\u116D\u1163",
    \u1186: "\u116D\u1163",
    \u1185: "\u116D\u1163\u4E28",
    \u3188: "\u116D\u1163\u4E28",
    "\uD7B4": "\u116D\u1165",
    \u1187: "\u116D\u1169",
    \u1188: "\u116D\u4E28",
    \u3189: "\u116D\u4E28",
    \u315C: "\u116E",
    \u1189: "\u116E\u1161",
    \u118A: "\u116E\u1161\u4E28",
    \u116F: "\u116E\u1165",
    \u315D: "\u116E\u1165",
    \u118B: "\u116E\u1165\u30FC",
    \u1170: "\u116E\u1165\u4E28",
    \u315E: "\u116E\u1165\u4E28",
    "\uD7B5": "\u116E\u1167",
    \u118C: "\u116E\u1167\u4E28",
    \u118D: "\u116E\u116E",
    \u1171: "\u116E\u4E28",
    \u315F: "\u116E\u4E28",
    "\uD7B6": "\u116E\u4E28\u4E28",
    \u3160: "\u1172",
    \u118E: "\u1172\u1161",
    "\uD7B7": "\u1172\u1161\u4E28",
    \u118F: "\u1172\u1165",
    \u1190: "\u1172\u1165\u4E28",
    \u1191: "\u1172\u1167",
    \u318A: "\u1172\u1167",
    \u1192: "\u1172\u1167\u4E28",
    \u318B: "\u1172\u1167\u4E28",
    "\uD7B8": "\u1172\u1169",
    \u1193: "\u1172\u116E",
    \u1194: "\u1172\u4E28",
    \u318C: "\u1172\u4E28",
    \u318D: "\u119E",
    "\uD7C5": "\u119E\u1161",
    \u119F: "\u119E\u1165",
    "\uD7C6": "\u119E\u1165\u4E28",
    \u11A0: "\u119E\u116E",
    \u11A2: "\u119E\u119E",
    \u11A1: "\u119E\u4E28",
    \u318E: "\u119E\u4E28",
    \u30D8: "\u3078",
    "\u2341": "\u303C",
    "\u29C4": "\u303C",
    "\uA49E": "\uA04A",
    "\uA4AC": "\uA050",
    "\uA49C": "\uA0C0",
    "\uA4A8": "\uA132",
    "\uA4BF": "\uA259",
    "\uA4BE": "\uA2B1",
    "\uA494": "\uA2CD",
    "\uA4C0": "\uA3AB",
    "\uA4C2": "\uA3B5",
    "\uA4BA": "\uA3BF",
    "\uA4B0": "\uA3C2",
    "\uA4A7": "\uA458",
    "\u22A5": "\uA4D5",
    "\u27C2": "\uA4D5",
    "\u{1D21C}": "\uA4D5",
    "\uA7B1": "\uA4D5",
    "\uA79E": "\uA4E4",
    "\u2141": "\uA4E8",
    "\u2142": "\uA4F6",
    "\u{1D215}": "\uA4F6",
    "\u{1D22B}": "\uA4F6",
    "\u{16F26}": "\uA4F6",
    "\u{10411}": "\uA4F6",
    "\u2143": "\u{16F00}",
    "\u{11AE6}": "\u{11AE5}\u{11AEF}",
    "\u{11AE8}": "\u{11AE5}\u{11AE5}",
    "\u{11AE9}": "\u{11AE5}\u{11AE5}\u{11AEF}",
    "\u{11AEA}": "\u{11AE5}\u{11AE5}\u{11AF0}",
    "\u{11AE7}": "\u{11AE5}\u{11AF0}",
    "\u{11AF4}": "\u{11AF3}\u{11AEF}",
    "\u{11AF6}": "\u{11AF3}\u{11AF3}",
    "\u{11AF7}": "\u{11AF3}\u{11AF3}\u{11AEF}",
    "\u{11AF8}": "\u{11AF3}\u{11AF3}\u{11AF0}",
    "\u{11AF5}": "\u{11AF3}\u{11AF0}",
    "\u{11AEC}": "\u{11AEB}\u{11AEF}",
    "\u{11AED}": "\u{11AEB}\u{11AEB}",
    "\u{11AEE}": "\u{11AEB}\u{11AEB}\u{11AEF}",
    "\u2295": "\u{102A8}",
    "\u2A01": "\u{102A8}",
    "\u{1F728}": "\u{102A8}",
    "\uA69A": "\u{102A8}",
    "\u25BD": "\u{102BC}",
    "\u{1D214}": "\u{102BC}",
    "\u{1F704}": "\u{102BC}",
    "\u29D6": "\u{102C0}",
    "\uA79B": "\u{1043A}",
    "\uA79A": "\u{10412}",
    "\u{104A0}": "\u{10486}",
    "\u{103D1}": "\u{10382}",
    "\u{103D3}": "\u{10393}",
    "\u{12038}": "\u{1039A}",
    "\u2625": "\u{1099E}",
    "\u{132F9}": "\u{1099E}",
    "\u3039": "\u5344",
    \uF967: "\u4E0D",
    "\u{2F800}": "\u4E3D",
    "\uFA70": "\u4E26",
    "\u239C": "\u4E28",
    "\u239F": "\u4E28",
    "\u23A2": "\u4E28",
    "\u23A5": "\u4E28",
    "\u23AA": "\u4E28",
    "\u23AE": "\u4E28",
    "\u31D1": "\u4E28",
    \u1175: "\u4E28",
    \u3163: "\u4E28",
    "\u2F01": "\u4E28",
    \u119C: "\u4E28\u30FC",
    \u1198: "\u4E28\u1161",
    \u1199: "\u4E28\u1163",
    "\uD7BD": "\u4E28\u1163\u1169",
    "\uD7BE": "\u4E28\u1163\u4E28",
    "\uD7BF": "\u4E28\u1167",
    "\uD7C0": "\u4E28\u1167\u4E28",
    \u119A: "\u4E28\u1169",
    "\uD7C1": "\u4E28\u1169\u4E28",
    "\uD7C2": "\u4E28\u116D",
    \u119B: "\u4E28\u116E",
    "\uD7C3": "\u4E28\u1172",
    \u119D: "\u4E28\u119E",
    "\uD7C4": "\u4E28\u4E28",
    \uF905: "\u4E32",
    "\u{2F801}": "\u4E38",
    \uF95E: "\u4E39",
    "\u{2F802}": "\u4E41",
    "\u31E0": "\u4E59",
    "\u2F04": "\u4E59",
    "\u31DF": "\u4E5A",
    "\u2E83": "\u4E5A",
    "\u31D6": "\u4E5B",
    "\u2E82": "\u4E5B",
    "\u2EF2": "\u4E80",
    \uF91B: "\u4E82",
    "\u31DA": "\u4E85",
    "\u2F05": "\u4E85",
    \uF9BA: "\u4E86",
    \u30CB: "\u4E8C",
    "\u2F06": "\u4E8C",
    "\u{2F803}": "\u{20122}",
    "\u2F07": "\u4EA0",
    \uF977: "\u4EAE",
    "\u2F08": "\u4EBA",
    \u30A4: "\u4EBB",
    "\u2E85": "\u4EBB",
    \uF9FD: "\u4EC0",
    "\u{2F819}": "\u4ECC",
    \uF9A8: "\u4EE4",
    "\u{2F804}": "\u4F60",
    \u5002: "\u4F75",
    "\u{2F807}": "\u4F75",
    "\uFA73": "\u4F80",
    \uF92D: "\u4F86",
    \uF9B5: "\u4F8B",
    "\uFA30": "\u4FAE",
    "\u{2F805}": "\u4FAE",
    "\u{2F806}": "\u4FBB",
    \uF965: "\u4FBF",
    \u503C: "\u5024",
    \uF9D4: "\u502B",
    "\u{2F808}": "\u507A",
    "\u{2F809}": "\u5099",
    "\u{2F80B}": "\u50CF",
    \uF9BB: "\u50DA",
    "\uFA31": "\u50E7",
    "\u{2F80A}": "\u50E7",
    "\u{2F80C}": "\u349E",
    "\u2F09": "\u513F",
    \uFA0C: "\u5140",
    "\u2E8E": "\u5140",
    "\uFA74": "\u5145",
    "\uFA32": "\u514D",
    "\u{2F80E}": "\u514D",
    "\u{2F80F}": "\u5154",
    "\u{2F810}": "\u5164",
    "\u2F0A": "\u5165",
    "\u{2F814}": "\u5167",
    "\uFA72": "\u5168",
    \uF978: "\u5169",
    \u30CF: "\u516B",
    "\u2F0B": "\u516B",
    \uF9D1: "\u516D",
    "\u{2F811}": "\u5177",
    "\u{2F812}": "\u{2051C}",
    "\u{2F91B}": "\u{20525}",
    "\uFA75": "\u5180",
    "\u{2F813}": "\u34B9",
    "\u2F0C": "\u5182",
    "\u{2F815}": "\u518D",
    "\u{2F816}": "\u{2054B}",
    "\u{2F8D2}": "\u5192",
    "\u{2F8D3}": "\u5195",
    "\u{2F9CA}": "\u34BB",
    "\u{2F8D4}": "\u6700",
    "\u2F0D": "\u5196",
    "\u{2F817}": "\u5197",
    "\u{2F818}": "\u51A4",
    "\u2F0E": "\u51AB",
    "\u{2F81A}": "\u51AC",
    "\uFA71": "\u51B5",
    "\u{2F81B}": "\u51B5",
    \uF92E: "\u51B7",
    \uF979: "\u51C9",
    \uF955: "\u51CC",
    \uF954: "\u51DC",
    \uFA15: "\u51DE",
    "\u2F0F": "\u51E0",
    "\u{2F80D}": "\u{2063A}",
    "\u{2F81D}": "\u51F5",
    "\u2F10": "\u51F5",
    "\u2F11": "\u5200",
    "\u2E89": "\u5202",
    "\u{2F81E}": "\u5203",
    \uFA00: "\u5207",
    "\u{2F850}": "\u5207",
    \uF99C: "\u5217",
    \uF9DD: "\u5229",
    "\u{2F81F}": "\u34DF",
    \uF9FF: "\u523A",
    "\u{2F820}": "\u523B",
    "\u{2F821}": "\u5246",
    "\u{2F822}": "\u5272",
    "\u{2F823}": "\u5277",
    \uF9C7: "\u5289",
    "\u{2F9D9}": "\u{20804}",
    \u30AB: "\u529B",
    \uF98A: "\u529B",
    "\u2F12": "\u529B",
    \uF99D: "\u52A3",
    "\u{2F824}": "\u3515",
    "\u{2F992}": "\u52B3",
    "\uFA76": "\u52C7",
    "\u{2F825}": "\u52C7",
    "\uFA33": "\u52C9",
    "\u{2F826}": "\u52C9",
    \uF952: "\u52D2",
    \uF92F: "\u52DE",
    "\uFA34": "\u52E4",
    "\u{2F827}": "\u52E4",
    \uF97F: "\u52F5",
    "\u2F13": "\u52F9",
    "\uFA77": "\u52FA",
    "\u{2F828}": "\u52FA",
    "\u{2F829}": "\u5305",
    "\u{2F82A}": "\u5306",
    "\u{2F9DD}": "\u{208DE}",
    "\u2F14": "\u5315",
    \uF963: "\u5317",
    "\u{2F82B}": "\u5317",
    "\u2F15": "\u531A",
    "\u2F16": "\u5338",
    \uF9EB: "\u533F",
    "\u2F17": "\u5341",
    "\u3038": "\u5341",
    "\u303A": "\u5345",
    "\u{2F82C}": "\u5349",
    "\u0FD6": "\u534D",
    "\u0FD5": "\u5350",
    "\uFA35": "\u5351",
    "\u{2F82D}": "\u5351",
    "\u{2F82E}": "\u535A",
    \u30C8: "\u535C",
    "\u2F18": "\u535C",
    "\u2F19": "\u5369",
    "\u2E8B": "\u353E",
    "\u{2F82F}": "\u5373",
    \uF91C: "\u5375",
    "\u{2F830}": "\u537D",
    "\u{2F831}": "\u537F",
    "\u{2F832}": "\u537F",
    "\u{2F833}": "\u537F",
    "\u2F1A": "\u5382",
    "\u{2F834}": "\u{20A2C}",
    "\u2F1B": "\u53B6",
    \uF96B: "\u53C3",
    "\u2F1C": "\u53C8",
    "\u{2F836}": "\u53CA",
    "\u{2F837}": "\u53DF",
    "\u{2F838}": "\u{20B63}",
    \u30ED: "\u53E3",
    "\u2F1D": "\u53E3",
    \u56D7: "\u53E3",
    "\u2F1E": "\u53E3",
    \uF906: "\u53E5",
    "\u{2F839}": "\u53EB",
    "\u{2F83A}": "\u53F1",
    "\u{2F83B}": "\u5406",
    \uF9DE: "\u540F",
    \uF9ED: "\u541D",
    "\u{2F83D}": "\u5438",
    \uF980: "\u5442",
    "\u{2F83E}": "\u5448",
    "\u{2F83F}": "\u5468",
    "\u{2F83C}": "\u549E",
    "\u{2F840}": "\u54A2",
    \uF99E: "\u54BD",
    \u439B: "\u3588",
    "\u{2F841}": "\u54F6",
    "\u{2F842}": "\u5510",
    "\u{2F843}": "\u5553",
    \u555F: "\u5553",
    "\uFA79": "\u5555",
    "\u{2F844}": "\u5563",
    "\u{2F845}": "\u5584",
    "\u{2F846}": "\u5584",
    \uF90B: "\u5587",
    "\uFA7A": "\u5599",
    "\u{2F847}": "\u5599",
    "\uFA36": "\u559D",
    "\uFA78": "\u559D",
    "\u{2F848}": "\u55AB",
    "\u{2F849}": "\u55B3",
    \uFA0D: "\u55C0",
    "\u{2F84A}": "\u55C2",
    "\uFA7B": "\u55E2",
    "\uFA37": "\u5606",
    "\u{2F84C}": "\u5606",
    "\u{2F84E}": "\u5651",
    "\u{2F84F}": "\u5674",
    "\uFA38": "\u5668",
    \uF9A9: "\u56F9",
    "\u{2F84B}": "\u5716",
    "\u{2F84D}": "\u5717",
    "\u2F1F": "\u571F",
    \u58EB: "\u571F",
    "\u2F20": "\u571F",
    "\u{2F855}": "\u578B",
    "\u{2F852}": "\u57CE",
    \u39B3: "\u363D",
    "\u{2F853}": "\u57F4",
    "\u{2F854}": "\u580D",
    "\u{2F857}": "\u5831",
    "\u{2F856}": "\u5832",
    "\uFA39": "\u5840",
    \uFA10: "\u585A",
    "\uFA7C": "\u585A",
    \uF96C: "\u585E",
    \u586B: "\u5861",
    \u58FF: "\u58AB",
    "\u{2F858}": "\u58AC",
    "\uFA7D": "\u58B3",
    \uF94A: "\u58D8",
    \uF942: "\u58DF",
    "\u{2F859}": "\u{214E4}",
    "\u{2F851}": "\u58EE",
    "\u{2F85A}": "\u58F2",
    "\u{2F85B}": "\u58F7",
    "\u2F21": "\u5902",
    "\u{2F85C}": "\u5906",
    "\u2F22": "\u590A",
    \u30BF: "\u5915",
    "\u2F23": "\u5915",
    "\u{2F85D}": "\u591A",
    "\u{2F85E}": "\u5922",
    "\u2F24": "\u5927",
    "\uFA7E": "\u5944",
    \uF90C: "\u5948",
    \uF909: "\u5951",
    "\uFA7F": "\u5954",
    "\u{2F85F}": "\u5962",
    \uF981: "\u5973",
    "\u2F25": "\u5973",
    "\u{2F860}": "\u{216A8}",
    "\u{2F861}": "\u{216EA}",
    "\u{2F865}": "\u59D8",
    "\u{2F862}": "\u59EC",
    "\u{2F863}": "\u5A1B",
    "\u{2F864}": "\u5A27",
    "\uFA80": "\u5A62",
    "\u{2F866}": "\u5A66",
    \u5B00: "\u5AAF",
    "\u{2F867}": "\u36EE",
    "\u{2F868}": "\u36FC",
    "\u{2F986}": "\u5AB5",
    "\u{2F869}": "\u5B08",
    "\uFA81": "\u5B28",
    "\u{2F86A}": "\u5B3E",
    "\u{2F86B}": "\u5B3E",
    "\u2F26": "\u5B50",
    "\u2F27": "\u5B80",
    \uFA04: "\u5B85",
    "\u{2F86C}": "\u{219C8}",
    "\u{2F86D}": "\u5BC3",
    "\u{2F86E}": "\u5BD8",
    \uF95F: "\u5BE7",
    \uF9AA: "\u5BE7",
    "\u{2F86F}": "\u5BE7",
    \uF9BC: "\u5BEE",
    "\u{2F870}": "\u5BF3",
    "\u{2F871}": "\u{21B18}",
    "\u2F28": "\u5BF8",
    "\u{2F872}": "\u5BFF",
    "\u{2F873}": "\u5C06",
    "\u2F29": "\u5C0F",
    "\u{2F875}": "\u5C22",
    "\u2E90": "\u5C22",
    "\u2F2A": "\u5C22",
    "\u2E8F": "\u5C23",
    "\u{2F876}": "\u3781",
    "\u2F2B": "\u5C38",
    \uF9BD: "\u5C3F",
    "\u{2F877}": "\u5C60",
    \uF94B: "\u5C62",
    "\uFA3B": "\u5C64",
    \uF9DF: "\u5C65",
    "\uFA3C": "\u5C6E",
    "\u{2F878}": "\u5C6E",
    "\u2F2C": "\u5C6E",
    "\u{2F8F8}": "\u{21D0B}",
    "\u2F2D": "\u5C71",
    "\u{2F879}": "\u5CC0",
    "\u{2F87A}": "\u5C8D",
    "\u{2F87B}": "\u{21DE4}",
    "\u{2F87D}": "\u{21DE6}",
    \uF9D5: "\u5D19",
    "\u{2F87C}": "\u5D43",
    \uF921: "\u5D50",
    "\u{2F87F}": "\u5D6B",
    "\u{2F87E}": "\u5D6E",
    "\u{2F880}": "\u5D7C",
    "\u{2F9F4}": "\u5DB2",
    \uF9AB: "\u5DBA",
    "\u2F2E": "\u5DDB",
    "\u{2F882}": "\u5DE2",
    \u30A8: "\u5DE5",
    "\u2F2F": "\u5DE5",
    "\u2F30": "\u5DF1",
    "\u2E92": "\u5DF3",
    "\u{2F883}": "\u382F",
    "\u{2F884}": "\u5DFD",
    "\u2F31": "\u5DFE",
    \u5E32: "\u5E21",
    "\u{2F885}": "\u5E28",
    "\u{2F886}": "\u5E3D",
    "\u{2F887}": "\u5E69",
    "\u{2F888}": "\u3862",
    "\u{2F889}": "\u{22183}",
    "\u2F32": "\u5E72",
    \uF98E: "\u5E74",
    "\u{2F939}": "\u{2219F}",
    "\u2E93": "\u5E7A",
    "\u2F33": "\u5E7A",
    "\u2F34": "\u5E7F",
    \uFA01: "\u5EA6",
    "\u{2F88A}": "\u387C",
    "\u{2F88B}": "\u5EB0",
    "\u{2F88C}": "\u5EB3",
    "\u{2F88D}": "\u5EB6",
    \uF928: "\u5ECA",
    "\u{2F88E}": "\u5ECA",
    \uF9A2: "\u5EC9",
    "\uFA82": "\u5ED2",
    \uFA0B: "\u5ED3",
    "\uFA83": "\u5ED9",
    \uF982: "\u5EEC",
    "\u2F35": "\u5EF4",
    "\u{2F890}": "\u5EFE",
    "\u2F36": "\u5EFE",
    "\u{2F891}": "\u{22331}",
    "\u{2F892}": "\u{22331}",
    \uF943: "\u5F04",
    "\u2F37": "\u5F0B",
    "\u2F38": "\u5F13",
    "\u{2F894}": "\u5F22",
    "\u{2F895}": "\u5F22",
    "\u2F39": "\u5F50",
    "\u2E94": "\u5F51",
    "\u{2F874}": "\u5F53",
    "\u{2F896}": "\u38C7",
    "\u2F3A": "\u5F61",
    "\u{2F899}": "\u5F62",
    "\uFA84": "\u5F69",
    "\u{2F89A}": "\u5F6B",
    "\u2F3B": "\u5F73",
    \uF9D8: "\u5F8B",
    "\u{2F89B}": "\u38E3",
    "\u{2F89C}": "\u5F9A",
    \uF966: "\u5FA9",
    "\uFA85": "\u5FAD",
    "\u2F3C": "\u5FC3",
    "\u2E96": "\u5FC4",
    "\u2E97": "\u38FA",
    "\u{2F89D}": "\u5FCD",
    "\u{2F89E}": "\u5FD7",
    \uF9A3: "\u5FF5",
    "\u{2F89F}": "\u5FF9",
    \uF960: "\u6012",
    \uF9AC: "\u601C",
    "\uFA6B": "\u6075",
    "\u{2F8A2}": "\u391C",
    "\u{2F8A1}": "\u393A",
    "\u{2F8A0}": "\u6081",
    "\uFA3D": "\u6094",
    "\u{2F8A3}": "\u6094",
    "\u{2F8A5}": "\u60C7",
    "\uFA86": "\u60D8",
    \uF9B9: "\u60E1",
    "\u{2F8A4}": "\u{226D4}",
    "\uFA88": "\u6108",
    "\uFA3E": "\u6168",
    \uF9D9: "\u6144",
    "\u{2F8A6}": "\u6148",
    "\u{2F8A7}": "\u614C",
    "\u{2F8A9}": "\u614C",
    "\uFA87": "\u614E",
    "\u{2F8A8}": "\u614E",
    "\uFA8A": "\u6160",
    "\u{2F8AA}": "\u617A",
    "\uFA3F": "\u618E",
    "\uFA89": "\u618E",
    "\u{2F8AB}": "\u618E",
    \uF98F: "\u6190",
    "\u{2F8AD}": "\u61A4",
    "\u{2F8AE}": "\u61AF",
    "\u{2F8AC}": "\u61B2",
    "\uFAD0": "\u{22844}",
    "\uFACF": "\u{2284A}",
    "\u{2F8AF}": "\u61DE",
    "\uFA40": "\u61F2",
    "\uFA8B": "\u61F2",
    "\u{2F8B0}": "\u61F2",
    \uF90D: "\u61F6",
    "\u{2F8B1}": "\u61F6",
    \uF990: "\u6200",
    "\u2F3D": "\u6208",
    "\u{2F8B2}": "\u6210",
    "\u{2F8B3}": "\u621B",
    \uF9D2: "\u622E",
    "\uFA8C": "\u6234",
    "\u2F3E": "\u6236",
    \u6238: "\u6236",
    "\u2F3F": "\u624B",
    "\u2E98": "\u624C",
    "\u{2F8B4}": "\u625D",
    "\u{2F8B5}": "\u62B1",
    \uF925: "\u62C9",
    \uF95B: "\u62CF",
    \uFA02: "\u62D3",
    "\u{2F8B6}": "\u62D4",
    "\u{2F8BA}": "\u62FC",
    \uF973: "\u62FE",
    "\u{2F8B8}": "\u{22B0C}",
    "\u{2F8B9}": "\u633D",
    "\u{2F8B7}": "\u6350",
    "\u{2F8BB}": "\u6368",
    \uF9A4: "\u637B",
    "\u{2F8BC}": "\u6383",
    \uF975: "\u63A0",
    "\u{2F8C1}": "\u63A9",
    "\uFA8D": "\u63C4",
    "\u{2F8BD}": "\u63E4",
    "\uFA8F": "\u6452",
    "\u{2F8BE}": "\u{22BF1}",
    "\uFA8E": "\u641C",
    "\u{2F8BF}": "\u6422",
    "\u{2F8C0}": "\u63C5",
    "\u{2F8C3}": "\u6469",
    "\u{2F8C6}": "\u6477",
    "\u{2F8C4}": "\u647E",
    "\u{2F8C2}": "\u3A2E",
    \u6409: "\u3A41",
    \uF991: "\u649A",
    "\u{2F8C5}": "\u649D",
    \uF930: "\u64C4",
    "\u{2F8C7}": "\u3A6C",
    "\u2F40": "\u652F",
    "\u2F41": "\u6534",
    "\u2E99": "\u6535",
    "\uFA41": "\u654F",
    "\u{2F8C8}": "\u654F",
    "\uFA90": "\u6556",
    "\u{2F8C9}": "\u656C",
    \uF969: "\u6578",
    "\u{2F8CA}": "\u{2300A}",
    "\u2F42": "\u6587",
    "\u2EEB": "\u6589",
    "\u2F43": "\u6597",
    \uF9BE: "\u6599",
    "\u2F44": "\u65A4",
    "\u2F45": "\u65B9",
    \uF983: "\u65C5",
    "\u2F46": "\u65E0",
    "\u2E9B": "\u65E1",
    "\uFA42": "\u65E2",
    "\u{2F8CB}": "\u65E3",
    "\u2F47": "\u65E5",
    \uF9E0: "\u6613",
    \u66F6: "\u3ADA",
    "\u{2F8D1}": "\u3AE4",
    "\u{2F8CD}": "\u6649",
    \u6669: "\u665A",
    \uFA12: "\u6674",
    "\uFA91": "\u6674",
    "\uFA43": "\u6691",
    "\u{2F8CF}": "\u6691",
    \uF9C5: "\u6688",
    "\u{2F8D0}": "\u3B08",
    "\u{2F8D5}": "\u669C",
    \uFA06: "\u66B4",
    \uF98B: "\u66C6",
    "\u{2F8CE}": "\u3B19",
    "\u{2F897}": "\u{232B8}",
    "\u2F48": "\u66F0",
    \uF901: "\u66F4",
    "\u{2F8CC}": "\u66F8",
    "\u2F49": "\u6708",
    "\u{2F980}": "\u{2335F}",
    \u80A6: "\u670C",
    \u80D0: "\u670F",
    \u80CA: "\u6710",
    \u8101: "\u6713",
    \u80F6: "\u3B35",
    \uF929: "\u6717",
    "\uFA92": "\u6717",
    "\u{2F8D8}": "\u6717",
    \u8127: "\u6718",
    "\uFA93": "\u671B",
    "\u{2F8D9}": "\u671B",
    \u5E50: "\u3B3A",
    \u4420: "\u3B3B",
    "\u{2F989}": "\u{23393}",
    \u81A7: "\u6723",
    "\u{2F98A}": "\u{2339C}",
    "\u2F4A": "\u6728",
    \uF9E1: "\u674E",
    "\u{2F8DC}": "\u6753",
    "\uFA94": "\u6756",
    "\u{2F8DB}": "\u675E",
    "\u{2F8DD}": "\u{233C3}",
    \u67FF: "\u676E",
    \uF9C8: "\u677B",
    "\u{2F8E0}": "\u6785",
    \uF9F4: "\u6797",
    "\u{2F8DE}": "\u3B49",
    "\uFAD1": "\u{233D5}",
    \uF9C9: "\u67F3",
    "\u{2F8DF}": "\u67FA",
    \uF9DA: "\u6817",
    "\u{2F8E5}": "\u681F",
    "\u{2F8E1}": "\u6852",
    "\u{2F8E3}": "\u{2346D}",
    \uF97A: "\u6881",
    "\uFA44": "\u6885",
    "\u{2F8E2}": "\u6885",
    "\u{2F8E4}": "\u688E",
    \uF9E2: "\u68A8",
    "\u{2F8E6}": "\u6914",
    "\u{2F8E8}": "\u6942",
    "\uFAD2": "\u3B9D",
    "\u{2F8E7}": "\u3B9D",
    \u69E9: "\u3BA3",
    \u6A27: "\u699D",
    "\u{2F8E9}": "\u69A3",
    "\u{2F8EA}": "\u69EA",
    \uF914: "\u6A02",
    \uF95C: "\u6A02",
    \uF9BF: "\u6A02",
    \uF94C: "\u6A13",
    "\u{2F8EC}": "\u{236A3}",
    "\u{2F8EB}": "\u6AA8",
    \uF931: "\u6AD3",
    "\u{2F8ED}": "\u6ADB",
    \uF91D: "\u6B04",
    "\u{2F8EE}": "\u3C18",
    "\u2F4B": "\u6B20",
    "\u{2F8EF}": "\u6B21",
    "\u{2F8F0}": "\u{238A7}",
    "\u{2F8F1}": "\u6B54",
    "\u{2F8F2}": "\u3C4E",
    "\u2F4C": "\u6B62",
    "\u2EED": "\u6B6F",
    "\u{2F8F3}": "\u6B72",
    \uF98C: "\u6B77",
    "\uFA95": "\u6B79",
    "\u2F4D": "\u6B79",
    "\u2E9E": "\u6B7A",
    "\u{2F8F4}": "\u6B9F",
    \uF9A5: "\u6BAE",
    "\u2F4E": "\u6BB3",
    \uF970: "\u6BBA",
    "\uFA96": "\u6BBA",
    "\u{2F8F5}": "\u6BBA",
    "\u{2F8F6}": "\u6BBB",
    "\u{2F8F7}": "\u{23A8D}",
    "\u2F4F": "\u6BCB",
    "\u2E9F": "\u6BCD",
    "\u{2F8F9}": "\u{23AFA}",
    "\u2F50": "\u6BD4",
    "\u2F51": "\u6BDB",
    "\u2F52": "\u6C0F",
    "\u2EA0": "\u6C11",
    "\u2F53": "\u6C14",
    "\u2F54": "\u6C34",
    "\u2EA1": "\u6C35",
    "\u2EA2": "\u6C3A",
    "\u{2F8FA}": "\u6C4E",
    "\u{2F8FE}": "\u6C67",
    \uF972: "\u6C88",
    "\u{2F8FC}": "\u6CBF",
    \uF968: "\u6CCC",
    "\u{2F8FD}": "\u6CCD",
    \uF9E3: "\u6CE5",
    "\u{2F8FB}": "\u{23CBC}",
    \uF915: "\u6D1B",
    \uFA05: "\u6D1E",
    "\u{2F907}": "\u6D34",
    "\u{2F900}": "\u6D3E",
    \uF9CA: "\u6D41",
    "\uFA97": "\u6D41",
    "\u{2F902}": "\u6D41",
    "\u{2F8FF}": "\u6D16",
    "\u{2F903}": "\u6D69",
    \uF92A: "\u6D6A",
    "\uFA45": "\u6D77",
    "\u{2F901}": "\u6D77",
    "\u{2F904}": "\u6D78",
    "\u{2F905}": "\u6D85",
    "\u{2F906}": "\u{23D1E}",
    \uF9F5: "\u6DCB",
    \uF94D: "\u6DDA",
    \uF9D6: "\u6DEA",
    "\u{2F90E}": "\u6DF9",
    "\uFA46": "\u6E1A",
    "\u{2F908}": "\u6E2F",
    "\u{2F909}": "\u6E6E",
    \u6F59: "\u6E88",
    "\uFA99": "\u6ECB",
    "\u{2F90B}": "\u6ECB",
    \uF9CB: "\u6E9C",
    \uF9EC: "\u6EBA",
    "\u{2F90C}": "\u6EC7",
    \uF904: "\u6ED1",
    "\uFA98": "\u6EDB",
    "\u{2F90A}": "\u3D33",
    \uF94E: "\u6F0F",
    "\uFA47": "\u6F22",
    "\uFA9A": "\u6F22",
    \uF992: "\u6F23",
    "\u{2F90D}": "\u{23ED1}",
    "\u{2F90F}": "\u6F6E",
    "\u{2F910}": "\u{23F5E}",
    "\u{2F911}": "\u{23F8E}",
    "\u{2F912}": "\u6FC6",
    \uF922: "\u6FEB",
    \uF984: "\u6FFE",
    "\u{2F915}": "\u701B",
    "\uFA9B": "\u701E",
    "\u{2F914}": "\u701E",
    "\u{2F913}": "\u7039",
    "\u{2F917}": "\u704A",
    "\u{2F916}": "\u3D96",
    "\u2F55": "\u706B",
    "\u2EA3": "\u706C",
    "\u{2F835}": "\u7070",
    "\u{2F919}": "\u7077",
    "\u{2F918}": "\u707D",
    \uF9FB: "\u7099",
    "\u{2F91A}": "\u70AD",
    \uF99F: "\u70C8",
    \uF916: "\u70D9",
    "\uFA48": "\u716E",
    "\uFA9C": "\u716E",
    "\u{2F91D}": "\u{24263}",
    "\u{2F91C}": "\u7145",
    \uF993: "\u7149",
    "\uFA6C": "\u{242EE}",
    "\u{2F91E}": "\u719C",
    \uF9C0: "\u71CE",
    \uF9EE: "\u71D0",
    "\u{2F91F}": "\u{243AB}",
    \uF932: "\u7210",
    \uF91E: "\u721B",
    "\u{2F920}": "\u7228",
    "\u2F56": "\u722A",
    "\uFA49": "\u722B",
    "\u2EA4": "\u722B",
    "\uFA9E": "\u7235",
    "\u{2F921}": "\u7235",
    "\u2F57": "\u7236",
    "\u2F58": "\u723B",
    "\u2EA6": "\u4E2C",
    "\u2F59": "\u723F",
    "\u2F5A": "\u7247",
    "\u{2F922}": "\u7250",
    "\u2F5B": "\u7259",
    "\u{2F923}": "\u{24608}",
    "\u2F5C": "\u725B",
    \uF946: "\u7262",
    "\u{2F924}": "\u7280",
    "\u{2F925}": "\u7295",
    "\u2F5D": "\u72AC",
    "\u2EA8": "\u72AD",
    "\uFA9F": "\u72AF",
    \uF9FA: "\u72C0",
    "\u{2F926}": "\u{24735}",
    \uF92B: "\u72FC",
    \uFA16: "\u732A",
    "\uFAA0": "\u732A",
    "\u{2F927}": "\u{24814}",
    \uF9A7: "\u7375",
    "\u{2F928}": "\u737A",
    "\u2F5E": "\u7384",
    \uF961: "\u7387",
    \uF9DB: "\u7387",
    "\u2F5F": "\u7389",
    "\u{2F929}": "\u738B",
    "\u{2F92A}": "\u3EAC",
    "\u{2F92B}": "\u73A5",
    \uF9AD: "\u73B2",
    "\u{2F92C}": "\u3EB8",
    "\u{2F92D}": "\u3EB8",
    \uF917: "\u73DE",
    \uF9CC: "\u7409",
    \uF9E4: "\u7406",
    "\uFA4A": "\u7422",
    "\u{2F92E}": "\u7447",
    "\u{2F92F}": "\u745C",
    \uF9AE: "\u7469",
    "\uFAA1": "\u7471",
    "\u{2F930}": "\u7471",
    "\u{2F931}": "\u7485",
    \uF994: "\u7489",
    \uF9EF: "\u7498",
    "\u{2F932}": "\u74CA",
    "\u2F60": "\u74DC",
    "\u2F61": "\u74E6",
    "\u{2F933}": "\u3F1B",
    "\uFAA2": "\u7506",
    "\u2F62": "\u7518",
    "\u2F63": "\u751F",
    "\u{2F934}": "\u7524",
    "\u2F64": "\u7528",
    "\u2F65": "\u7530",
    "\uFAA3": "\u753B",
    "\u{2F936}": "\u753E",
    "\u{2F935}": "\u{24C36}",
    \uF9CD: "\u7559",
    \uF976: "\u7565",
    \uF962: "\u7570",
    "\u{2F938}": "\u7570",
    "\u{2F937}": "\u{24C92}",
    "\u2F66": "\u758B",
    "\u2F67": "\u7592",
    \uF9E5: "\u75E2",
    "\u{2F93A}": "\u7610",
    "\uFAA5": "\u761F",
    "\uFAA4": "\u761D",
    \uF9C1: "\u7642",
    \uF90E: "\u7669",
    "\u2F68": "\u7676",
    "\u2F69": "\u767D",
    "\u{2F93B}": "\u{24FA1}",
    "\u{2F93C}": "\u{24FB8}",
    "\u2F6A": "\u76AE",
    "\u2F6B": "\u76BF",
    "\u{2F93D}": "\u{25044}",
    "\u{2F93E}": "\u3FFC",
    \uFA17: "\u76CA",
    "\uFAA6": "\u76CA",
    "\uFAA7": "\u76DB",
    \uF933: "\u76E7",
    "\u{2F93F}": "\u4008",
    "\u2F6C": "\u76EE",
    "\uFAA8": "\u76F4",
    "\u{2F940}": "\u76F4",
    "\u{2F942}": "\u{250F2}",
    "\u{2F941}": "\u{250F3}",
    \uF96D: "\u7701",
    "\uFAD3": "\u4018",
    "\u{2F943}": "\u{25119}",
    "\u{2F945}": "\u771E",
    "\u{2F946}": "\u771F",
    "\u{2F947}": "\u771F",
    "\u{2F944}": "\u{25133}",
    "\uFAAA": "\u7740",
    "\uFAA9": "\u774A",
    "\u{2F948}": "\u774A",
    "\u9FC3": "\u4039",
    "\uFAD4": "\u4039",
    "\u{2F949}": "\u4039",
    \u6663: "\u403F",
    "\u{2F94B}": "\u4046",
    "\u{2F94A}": "\u778B",
    "\uFAD5": "\u{25249}",
    "\uFA9D": "\u77A7",
    "\u2F6D": "\u77DB",
    "\u2F6E": "\u77E2",
    "\u2F6F": "\u77F3",
    "\u{2F94C}": "\u4096",
    "\u{2F94D}": "\u{2541D}",
    \u784F: "\u7814",
    "\u{2F94E}": "\u784E",
    \uF9CE: "\u786B",
    \uF93B: "\u788C",
    "\u{2F94F}": "\u788C",
    "\uFA4B": "\u7891",
    \uF947: "\u78CA",
    "\uFAAB": "\u78CC",
    "\u{2F950}": "\u78CC",
    \uF964: "\u78FB",
    "\u{2F951}": "\u40E3",
    \uF985: "\u792A",
    "\u2F70": "\u793A",
    "\u2EAD": "\u793B",
    \uFA18: "\u793C",
    "\uFA4C": "\u793E",
    "\uFA4E": "\u7948",
    "\uFA4D": "\u7949",
    "\u{2F952}": "\u{25626}",
    "\uFA4F": "\u7950",
    "\uFA50": "\u7956",
    "\u{2F953}": "\u7956",
    "\uFA51": "\u795D",
    \uFA19: "\u795E",
    \uFA1A: "\u7965",
    "\uFA61": "\u8996",
    "\uFAB8": "\u8996",
    \uF93C: "\u797F",
    "\u{2F954}": "\u{2569A}",
    "\uFA52": "\u798D",
    "\uFA53": "\u798E",
    \uFA1B: "\u798F",
    "\u{2F956}": "\u798F",
    "\u{2F955}": "\u{256C5}",
    \uF9B6: "\u79AE",
    "\u2F71": "\u79B8",
    "\u2F72": "\u79BE",
    \uF995: "\u79CA",
    "\u{2F958}": "\u412F",
    "\u{2F957}": "\u79EB",
    \uF956: "\u7A1C",
    "\u{2F95A}": "\u7A4A",
    "\uFA54": "\u7A40",
    "\u{2F959}": "\u7A40",
    "\u{2F95B}": "\u7A4F",
    "\u2F73": "\u7A74",
    "\uFA55": "\u7A81",
    "\u{2F95C}": "\u{2597C}",
    "\uFAAC": "\u7AB1",
    \uF9F7: "\u7ACB",
    "\u2F74": "\u7ACB",
    "\u2EEF": "\u7ADC",
    "\u{2F95D}": "\u{25AA7}",
    "\u{2F95E}": "\u{25AA7}",
    "\u{2F95F}": "\u7AEE",
    "\u2F75": "\u7AF9",
    \uF9F8: "\u7B20",
    "\uFA56": "\u7BC0",
    "\uFAAD": "\u7BC0",
    "\u{2F960}": "\u4202",
    "\u{2F961}": "\u{25BAB}",
    "\u{2F962}": "\u7BC6",
    "\u{2F964}": "\u4227",
    "\u{2F963}": "\u7BC9",
    "\u{2F965}": "\u{25C80}",
    "\uFAD6": "\u{25CD0}",
    \uF9A6: "\u7C3E",
    \uF944: "\u7C60",
    "\u2F76": "\u7C73",
    "\uFAAE": "\u7C7B",
    \uF9F9: "\u7C92",
    \uFA1D: "\u7CBE",
    "\u{2F966}": "\u7CD2",
    \uFA03: "\u7CD6",
    "\u{2F968}": "\u7CE8",
    "\u{2F967}": "\u42A0",
    "\u{2F969}": "\u7CE3",
    \uF97B: "\u7CE7",
    "\u2F77": "\u7CF8",
    "\u2EAF": "\u7CF9",
    "\u{2F96B}": "\u{25F86}",
    "\u{2F96A}": "\u7D00",
    \uF9CF: "\u7D10",
    \uF96A: "\u7D22",
    \uF94F: "\u7D2F",
    \u7D76: "\u7D55",
    "\u{2F96C}": "\u7D63",
    "\uFAAF": "\u7D5B",
    \uF93D: "\u7DA0",
    \uF957: "\u7DBE",
    "\u{2F96E}": "\u7DC7",
    \uF996: "\u7DF4",
    "\uFA57": "\u7DF4",
    "\uFAB0": "\u7DF4",
    "\u{2F96F}": "\u7E02",
    "\u{2F96D}": "\u4301",
    "\uFA58": "\u7E09",
    \uF950: "\u7E37",
    "\uFA59": "\u7E41",
    "\u{2F970}": "\u7E45",
    "\u{2F898}": "\u{261DA}",
    "\u{2F971}": "\u4334",
    "\u2F78": "\u7F36",
    "\u{2F972}": "\u{26228}",
    "\uFAB1": "\u7F3E",
    "\u{2F973}": "\u{26247}",
    "\u2F79": "\u7F51",
    "\u2EAB": "\u7F52",
    "\u2EB2": "\u7F52",
    "\u2EB1": "\u7F53",
    "\u{2F974}": "\u4359",
    "\uFA5A": "\u7F72",
    "\u{2F975}": "\u{262D9}",
    \uF9E6: "\u7F79",
    "\u{2F976}": "\u7F7A",
    \uF90F: "\u7F85",
    "\u{2F977}": "\u{2633E}",
    "\u2F7A": "\u7F8A",
    "\u{2F978}": "\u7F95",
    \uF9AF: "\u7F9A",
    \uFA1E: "\u7FBD",
    "\u2F7B": "\u7FBD",
    "\u{2F979}": "\u7FFA",
    \uF934: "\u8001",
    "\u2F7C": "\u8001",
    "\u2EB9": "\u8002",
    "\uFA5B": "\u8005",
    "\uFAB2": "\u8005",
    "\u{2F97A}": "\u8005",
    "\u2F7D": "\u800C",
    "\u{2F97B}": "\u{264DA}",
    "\u2F7E": "\u8012",
    "\u{2F97C}": "\u{26523}",
    "\u2F7F": "\u8033",
    \uF9B0: "\u8046",
    "\u{2F97D}": "\u8060",
    "\u{2F97E}": "\u{265A8}",
    \uF997: "\u806F",
    "\u{2F97F}": "\u8070",
    \uF945: "\u807E",
    "\u2F80": "\u807F",
    "\u2EBA": "\u8080",
    "\u2F81": "\u8089",
    \uF953: "\u808B",
    "\u{2F8D6}": "\u80AD",
    "\u{2F982}": "\u80B2",
    "\u{2F981}": "\u43D5",
    "\u{2F8D7}": "\u43D9",
    \u8141: "\u80FC",
    "\u{2F983}": "\u8103",
    "\u{2F985}": "\u813E",
    "\u{2F984}": "\u440B",
    "\u{2F8DA}": "\u6721",
    "\u{2F987}": "\u{267A7}",
    "\u{2F988}": "\u{267B5}",
    \u6726: "\u4443",
    \uF926: "\u81D8",
    "\u2F82": "\u81E3",
    \uF9F6: "\u81E8",
    "\u2F83": "\u81EA",
    "\uFA5C": "\u81ED",
    "\u2F84": "\u81F3",
    "\u2F85": "\u81FC",
    "\u{2F893}": "\u8201",
    "\u{2F98B}": "\u8201",
    "\u{2F98C}": "\u8204",
    "\u2F86": "\u820C",
    "\uFA6D": "\u8218",
    "\u2F87": "\u821B",
    "\u2F88": "\u821F",
    "\u{2F98E}": "\u446B",
    "\u2F89": "\u826E",
    \uF97C: "\u826F",
    "\u2F8A": "\u8272",
    "\u2F8B": "\u8278",
    "\uFA5D": "\u8279",
    "\uFA5E": "\u8279",
    "\u2EBE": "\u8279",
    "\u2EBF": "\u8279",
    "\u2EC0": "\u8279",
    "\u{2F990}": "\u828B",
    "\u{2F98F}": "\u8291",
    "\u{2F991}": "\u829D",
    "\u{2F993}": "\u82B1",
    "\u{2F994}": "\u82B3",
    "\u{2F995}": "\u82BD",
    \uF974: "\u82E5",
    "\u{2F998}": "\u82E5",
    "\u{2F996}": "\u82E6",
    "\u{2F997}": "\u{26B3C}",
    \uF9FE: "\u8336",
    "\uFAB3": "\u8352",
    "\u{2F99A}": "\u8363",
    "\u{2F999}": "\u831D",
    "\u{2F99C}": "\u8323",
    "\u{2F99D}": "\u83BD",
    "\u{2F9A0}": "\u8353",
    \uF93E: "\u83C9",
    "\u{2F9A1}": "\u83CA",
    "\u{2F9A2}": "\u83CC",
    "\u{2F9A3}": "\u83DC",
    "\u{2F99E}": "\u83E7",
    "\uFAB4": "\u83EF",
    \uF958: "\u83F1",
    "\uFA5F": "\u8457",
    "\u{2F99F}": "\u8457",
    "\u{2F9A4}": "\u{26C36}",
    "\u{2F99B}": "\u83AD",
    \uF918: "\u843D",
    \uF96E: "\u8449",
    \u853F: "\u848D",
    "\u{2F9A6}": "\u{26CD5}",
    "\u{2F9A5}": "\u{26D6B}",
    \uF999: "\u84EE",
    "\u{2F9A8}": "\u84F1",
    "\u{2F9A9}": "\u84F3",
    \uF9C2: "\u84FC",
    "\u{2F9AA}": "\u8516",
    "\u{2F9A7}": "\u452B",
    "\u{2F9AC}": "\u8564",
    "\u{2F9AD}": "\u{26F2C}",
    \uF923: "\u85CD",
    "\u{2F9AE}": "\u455D",
    "\u{2F9B0}": "\u{26FB1}",
    "\u{2F9AF}": "\u4561",
    \uF9F0: "\u85FA",
    \uF935: "\u8606",
    "\u{2F9B2}": "\u456B",
    \uFA20: "\u8612",
    \uF91F: "\u862D",
    "\u{2F9B1}": "\u{270D2}",
    \u8641: "\u8637",
    \uF910: "\u863F",
    "\u2F8C": "\u864D",
    "\u2EC1": "\u864E",
    "\u{2F9B3}": "\u8650",
    \uF936: "\u865C",
    "\u{2F9B4}": "\u865C",
    "\u{2F9B5}": "\u8667",
    "\u{2F9B6}": "\u8669",
    "\u2F8D": "\u866B",
    "\u{2F9B7}": "\u86A9",
    "\u{2F9B8}": "\u8688",
    "\u{2F9BA}": "\u86E2",
    "\u{2F9B9}": "\u870E",
    "\u{2F9BC}": "\u8728",
    "\u{2F9BD}": "\u876B",
    "\u{2F9C0}": "\u87E1",
    "\uFAB5": "\u8779",
    "\u{2F9BB}": "\u8779",
    "\u{2F9BE}": "\u8786",
    "\u{2F9BF}": "\u45D7",
    "\u{2F9AB}": "\u{273CA}",
    \uF911: "\u87BA",
    "\u{2F9C1}": "\u8801",
    "\u{2F9C2}": "\u45F9",
    \uF927: "\u881F",
    "\u2F8E": "\u8840",
    \uFA08: "\u884C",
    "\u2F8F": "\u884C",
    "\u{2F9C3}": "\u8860",
    "\u{2F9C4}": "\u8863",
    "\u2F90": "\u8863",
    "\u2EC2": "\u8864",
    \uF9A0: "\u88C2",
    "\u{2F9C5}": "\u{27667}",
    \uF9E7: "\u88CF",
    "\u{2F9C6}": "\u88D7",
    "\u{2F9C7}": "\u88DE",
    \uF9E8: "\u88E1",
    \uF912: "\u88F8",
    "\u{2F9C9}": "\u88FA",
    "\u{2F9C8}": "\u4635",
    "\uFA60": "\u8910",
    "\uFAB6": "\u8941",
    \uF924: "\u8964",
    "\u2F91": "\u897E",
    "\u2EC4": "\u897F",
    "\u2EC3": "\u8980",
    "\uFAB7": "\u8986",
    \uFA0A: "\u898B",
    "\u2F92": "\u898B",
    "\u{2F9CB}": "\u{278AE}",
    "\u2EC5": "\u89C1",
    "\u2F93": "\u89D2",
    "\u2F94": "\u8A00",
    "\u{2F9CC}": "\u{27966}",
    \u8A7D: "\u8A2E",
    \u8A1E: "\u46B6",
    "\u{2F9CD}": "\u46BE",
    "\u{2F9CE}": "\u46C7",
    "\u{2F9CF}": "\u8AA0",
    \uF96F: "\u8AAA",
    \uF9A1: "\u8AAA",
    "\uFAB9": "\u8ABF",
    "\uFABB": "\u8ACB",
    \uF97D: "\u8AD2",
    \uF941: "\u8AD6",
    "\uFABE": "\u8AED",
    "\u{2F9D0}": "\u8AED",
    \uFA22: "\u8AF8",
    "\uFABA": "\u8AF8",
    \uF95D: "\u8AFE",
    "\uFABD": "\u8AFE",
    "\uFA62": "\u8B01",
    "\uFABC": "\u8B01",
    "\uFA63": "\u8B39",
    "\uFABF": "\u8B39",
    \uF9FC: "\u8B58",
    \uF95A: "\u8B80",
    \u8B8F: "\u8B86",
    "\uFAC0": "\u8B8A",
    "\u{2F9D1}": "\u8B8A",
    "\u2EC8": "\u8BA0",
    "\u2F95": "\u8C37",
    "\u2F96": "\u8C46",
    \uF900: "\u8C48",
    "\u{2F9D2}": "\u8C55",
    "\u2F97": "\u8C55",
    \u8C63: "\u8C5C",
    "\u2F98": "\u8C78",
    "\u{2F9D3}": "\u{27CA8}",
    "\u2F99": "\u8C9D",
    "\u{2F9D4}": "\u8CAB",
    "\u{2F9D5}": "\u8CC1",
    \uF948: "\u8CC2",
    \uF903: "\u8CC8",
    "\uFA64": "\u8CD3",
    "\uFA65": "\u8D08",
    "\uFAC1": "\u8D08",
    "\u{2F9D6}": "\u8D1B",
    "\u2EC9": "\u8D1D",
    "\u2F9A": "\u8D64",
    "\u2F9B": "\u8D70",
    "\u{2F9D7}": "\u8D77",
    \u8D86: "\u8D7F",
    "\uFAD7": "\u{27ED3}",
    "\u{2F9D8}": "\u{27F2F}",
    "\u2F9C": "\u8DB3",
    "\u{2F9DA}": "\u8DCB",
    "\u{2F9DB}": "\u8DBC",
    \u8DFA: "\u8DE5",
    \uF937: "\u8DEF",
    "\u{2F9DC}": "\u8DF0",
    \u8E9B: "\u8E97",
    "\u2F9D": "\u8EAB",
    \uF902: "\u8ECA",
    "\u2F9E": "\u8ECA",
    "\u{2F9DE}": "\u8ED4",
    \u8F27: "\u8EFF",
    \uF998: "\u8F26",
    \uF9D7: "\u8F2A",
    "\uFAC2": "\u8F38",
    "\u{2F9DF}": "\u8F38",
    \uFA07: "\u8F3B",
    \uF98D: "\u8F62",
    "\u2ECB": "\u8F66",
    "\u2F9F": "\u8F9B",
    "\u{2F98D}": "\u8F9E",
    \uF971: "\u8FB0",
    "\u2FA0": "\u8FB0",
    "\u2FA1": "\u8FB5",
    "\uFA66": "\u8FB6",
    "\u2ECC": "\u8FB6",
    "\u2ECD": "\u8FB6",
    "\u{2F881}": "\u5DE1",
    \uF99A: "\u9023",
    \uFA25: "\u9038",
    "\uFA67": "\u9038",
    "\uFAC3": "\u9072",
    \uF9C3: "\u907C",
    "\u{2F9E0}": "\u{285D2}",
    "\u{2F9E1}": "\u{285ED}",
    \uF913: "\u908F",
    "\u2FA2": "\u9091",
    "\u{2F9E2}": "\u9094",
    \uF92C: "\u90CE",
    \u90DE: "\u90CE",
    "\uFA2E": "\u90CE",
    "\u{2F9E3}": "\u90F1",
    \uFA26: "\u90FD",
    "\u{2F9E5}": "\u{2872E}",
    "\u{2F9E4}": "\u9111",
    "\u{2F9E6}": "\u911B",
    "\u2FA3": "\u9149",
    \uF919: "\u916A",
    "\uFAC4": "\u9199",
    \uF9B7: "\u91B4",
    "\u2FA4": "\u91C6",
    \uF9E9: "\u91CC",
    "\u2FA5": "\u91CC",
    \uF97E: "\u91CF",
    \uF90A: "\u91D1",
    "\u2FA6": "\u91D1",
    \uF9B1: "\u9234",
    "\u{2F9E7}": "\u9238",
    "\uFAC5": "\u9276",
    "\u{2F9E8}": "\u92D7",
    "\u{2F9E9}": "\u92D8",
    "\u{2F9EA}": "\u927C",
    \uF93F: "\u9304",
    \uF99B: "\u934A",
    \u93AE: "\u93AD",
    "\u{2F9EB}": "\u93F9",
    "\u{2F9EC}": "\u9415",
    "\u{2F9ED}": "\u{28BFA}",
    "\u2ED0": "\u9485",
    "\u2ED1": "\u9577",
    "\u2FA7": "\u9577",
    "\u2ED2": "\u9578",
    "\u2ED3": "\u957F",
    "\u2FA8": "\u9580",
    "\u{2F9EE}": "\u958B",
    "\u{2F9EF}": "\u4995",
    \uF986: "\u95AD",
    "\u{2F9F0}": "\u95B7",
    "\u{2F9F1}": "\u{28D77}",
    "\u2ED4": "\u95E8",
    "\u2FA9": "\u961C",
    "\u2ECF": "\u961D",
    "\u2ED6": "\u961D",
    \uF9C6: "\u962E",
    \uF951: "\u964B",
    \uFA09: "\u964D",
    \uF959: "\u9675",
    \uF9D3: "\u9678",
    "\uFAC6": "\u967C",
    \uF9DC: "\u9686",
    \uF9F1: "\u96A3",
    "\u{2F9F2}": "\u49E6",
    "\u2FAA": "\u96B6",
    "\uFA2F": "\u96B7",
    \u96B8: "\u96B7",
    \uF9B8: "\u96B7",
    "\u2FAB": "\u96B9",
    "\u{2F9F3}": "\u96C3",
    \uF9EA: "\u96E2",
    "\uFA68": "\u96E3",
    "\uFAC7": "\u96E3",
    "\u2FAC": "\u96E8",
    \uF9B2: "\u96F6",
    \uF949: "\u96F7",
    "\u{2F9F5}": "\u9723",
    "\u{2F9F6}": "\u{29145}",
    \uF938: "\u9732",
    \uF9B3: "\u9748",
    "\u2FAD": "\u9751",
    "\u2ED8": "\u9752",
    \uFA1C: "\u9756",
    "\uFAC8": "\u9756",
    "\u{2F81C}": "\u{291DF}",
    "\u2FAE": "\u975E",
    "\u2FAF": "\u9762",
    "\u{2F9F7}": "\u{2921A}",
    "\u2FB0": "\u9769",
    "\u{2F9F8}": "\u4A6E",
    "\u{2F9F9}": "\u4A76",
    "\u2FB1": "\u97CB",
    "\uFAC9": "\u97DB",
    "\u{2F9FA}": "\u97E0",
    "\u2ED9": "\u97E6",
    "\u2FB2": "\u97ED",
    "\u{2F9FB}": "\u{2940A}",
    "\u2FB3": "\u97F3",
    "\uFA69": "\u97FF",
    "\uFACA": "\u97FF",
    "\u2FB4": "\u9801",
    "\u{2F9FC}": "\u4AB2",
    "\uFACB": "\u980B",
    "\u{2F9FE}": "\u980B",
    "\u{2F9FF}": "\u980B",
    \uF9B4: "\u9818",
    "\u{2FA00}": "\u9829",
    "\u{2F9FD}": "\u{29496}",
    "\uFA6A": "\u983B",
    "\uFACC": "\u983B",
    \uF9D0: "\u985E",
    "\u2EDA": "\u9875",
    "\u2FB5": "\u98A8",
    "\u{2FA01}": "\u{295B6}",
    "\u2EDB": "\u98CE",
    "\u2FB6": "\u98DB",
    "\u2EDC": "\u98DE",
    "\u2EDD": "\u98DF",
    "\u2FB7": "\u98DF",
    "\u2EDF": "\u98E0",
    "\u{2FA02}": "\u98E2",
    \uFA2A: "\u98EF",
    \uFA2B: "\u98FC",
    "\u{2FA03}": "\u4B33",
    \uFA2C: "\u9928",
    "\u{2FA04}": "\u9929",
    "\u2EE0": "\u9963",
    "\u2FB8": "\u9996",
    "\u2FB9": "\u9999",
    "\u{2FA05}": "\u99A7",
    "\u2FBA": "\u99AC",
    "\u{2FA06}": "\u99C2",
    \uF91A: "\u99F1",
    "\u{2FA07}": "\u99FE",
    \uF987: "\u9A6A",
    "\u2EE2": "\u9A6C",
    "\u2FBB": "\u9AA8",
    "\u{2FA08}": "\u4BCE",
    "\u2FBC": "\u9AD8",
    "\u2FBD": "\u9ADF",
    "\u{2FA09}": "\u{29B30}",
    "\uFACD": "\u9B12",
    "\u{2FA0A}": "\u9B12",
    "\u2FBE": "\u9B25",
    "\u2FBF": "\u9B2F",
    "\u2FC0": "\u9B32",
    "\u2FC1": "\u9B3C",
    "\u2EE4": "\u9B3C",
    "\u2FC2": "\u9B5A",
    \uF939: "\u9B6F",
    "\u{2FA0B}": "\u9C40",
    \uF9F2: "\u9C57",
    "\u2EE5": "\u9C7C",
    "\u2FC3": "\u9CE5",
    "\u{2FA0C}": "\u9CFD",
    "\u{2FA0D}": "\u4CCE",
    "\u{2FA0F}": "\u9D67",
    "\u{2FA0E}": "\u4CED",
    "\u{2FA10}": "\u{2A0CE}",
    \uFA2D: "\u9DB4",
    "\u{2FA12}": "\u{2A105}",
    "\u{2FA11}": "\u4CF8",
    \uF93A: "\u9DFA",
    "\u{2FA13}": "\u{2A20E}",
    \uF920: "\u9E1E",
    \u9E43: "\u9E42",
    "\u2FC4": "\u9E75",
    \uF940: "\u9E7F",
    "\u2FC5": "\u9E7F",
    "\u{2FA14}": "\u{2A291}",
    \uF988: "\u9E97",
    \uF9F3: "\u9E9F",
    "\u2FC6": "\u9EA5",
    "\u2EE8": "\u9EA6",
    "\u{2FA15}": "\u9EBB",
    "\u2FC7": "\u9EBB",
    "\u{2F88F}": "\u{2A392}",
    "\u2FC8": "\u9EC3",
    "\u2EE9": "\u9EC4",
    "\u2FC9": "\u9ECD",
    \uF989: "\u9ECE",
    "\u{2FA16}": "\u4D56",
    "\u2FCA": "\u9ED1",
    \u9ED2: "\u9ED1",
    "\uFA3A": "\u58A8",
    "\u{2FA17}": "\u9EF9",
    "\u2FCB": "\u9EF9",
    "\u2FCC": "\u9EFD",
    "\u{2FA19}": "\u9F05",
    "\u{2FA18}": "\u9EFE",
    "\u2FCD": "\u9F0E",
    "\u{2FA1A}": "\u9F0F",
    "\u2FCE": "\u9F13",
    "\u{2FA1B}": "\u9F16",
    "\u2FCF": "\u9F20",
    "\u{2FA1C}": "\u9F3B",
    "\u2FD0": "\u9F3B",
    "\uFAD8": "\u9F43",
    "\u2FD1": "\u9F4A",
    "\u2EEC": "\u9F50",
    "\u2FD2": "\u9F52",
    "\u{2FA1D}": "\u{2A600}",
    "\u2EEE": "\u9F7F",
    \uF9C4: "\u9F8D",
    "\u2FD3": "\u9F8D",
    "\uFAD9": "\u9F8E",
    "\u2EF0": "\u9F99",
    \uF907: "\u9F9C",
    \uF908: "\u9F9C",
    "\uFACE": "\u9F9C",
    "\u2FD4": "\u9F9C",
    "\u2EF3": "\u9F9F",
    "\u2FD5": "\u9FA0"
  };
  var $j, HV;
  function k3e() {
    if (HV) return $j;
    HV = 1;
    var t = E3e;
    function e(a) {
      return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
    }
    var n = RegExp(Object.keys(t).map(e).join("|"), "g");
    function r(a) {
      return t[a];
    }
    function i(a) {
      return a.replace(n, r);
    }
    return $j = i, $j;
  }
  var S3e = k3e();
  const j3e = da(S3e), T3e = Object.prototype.toString, R3e = (t) => T3e.call(t) === "[object Error]", A3e = /* @__PURE__ */ new Set([
    "network error",
    "NetworkError when attempting to fetch resource.",
    "The Internet connection appears to be offline.",
    "Network request failed",
    "fetch failed",
    "terminated",
    " A network error occurred.",
    "Network connection lost"
  ]);
  function I3e(t) {
    if (!(t && R3e(t) && t.name === "TypeError" && typeof t.message == "string")) return false;
    const { message: n, stack: r } = t;
    return n === "Load failed" ? r === void 0 || "__sentry_captured__" in t : n.startsWith("error sending request for url") || n === "Failed to fetch" || n.startsWith("Failed to fetch (") && n.endsWith(")") ? true : A3e.has(n);
  }
  function B3e(t) {
    if (typeof t == "number") {
      if (t < 0) throw new TypeError("Expected `retries` to be a non-negative number.");
      if (Number.isNaN(t)) throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.");
    } else if (t !== void 0) throw new TypeError("Expected `retries` to be a number or Infinity.");
  }
  function Gx(t, e, { min: n = 0, allowInfinity: r = false } = {}) {
    if (e !== void 0) {
      if (typeof e != "number" || Number.isNaN(e)) throw new TypeError(`Expected \`${t}\` to be a number${r ? " or Infinity" : ""}.`);
      if (!r && !Number.isFinite(e)) throw new TypeError(`Expected \`${t}\` to be a finite number.`);
      if (e < n) throw new TypeError(`Expected \`${t}\` to be \u2265 ${n}.`);
    }
  }
  class nne extends Error {
    constructor(e) {
      super(), e instanceof Error ? (this.originalError = e, { message: e } = e) : (this.originalError = new Error(e), this.originalError.stack = this.stack), this.name = "AbortError", this.message = e;
    }
  }
  function P3e(t, e) {
    const n = Math.max(1, t + 1), r = e.randomize ? Math.random() + 1 : 1;
    let i = Math.round(r * e.minTimeout * e.factor ** (n - 1));
    return i = Math.min(i, e.maxTimeout), i;
  }
  function $V(t, e) {
    return Number.isFinite(e) ? e - (performance.now() - t) : e;
  }
  async function M3e({ error: t, attemptNumber: e, retriesConsumed: n, startTime: r, options: i }) {
    var _a6, _b3, _c3, _d4;
    const a = t instanceof Error ? t : new TypeError(`Non-error was thrown: "${t}". You should only throw errors.`);
    if (a instanceof nne) throw a.originalError;
    const s = Number.isFinite(i.retries) ? Math.max(0, i.retries - n) : i.retries, l = i.maxRetryTime ?? Number.POSITIVE_INFINITY, c = Object.freeze({
      error: a,
      attemptNumber: e,
      retriesLeft: s,
      retriesConsumed: n
    });
    if (await i.onFailedAttempt(c), $V(r, l) <= 0) throw a;
    const d = await i.shouldConsumeRetry(c), u = $V(r, l);
    if (u <= 0 || s <= 0) throw a;
    if (a instanceof TypeError && !I3e(a)) {
      if (d) throw a;
      return (_a6 = i.signal) == null ? void 0 : _a6.throwIfAborted(), false;
    }
    if (!await i.shouldRetry(c)) throw a;
    if (!d) return (_b3 = i.signal) == null ? void 0 : _b3.throwIfAborted(), false;
    const h = P3e(n, i), f = Math.min(h, u);
    return (_c3 = i.signal) == null ? void 0 : _c3.throwIfAborted(), f > 0 && await new Promise((g, m) => {
      var _a7, _b4;
      const v = () => {
        var _a8;
        clearTimeout(y), (_a8 = i.signal) == null ? void 0 : _a8.removeEventListener("abort", v), m(i.signal.reason);
      }, y = setTimeout(() => {
        var _a8;
        (_a8 = i.signal) == null ? void 0 : _a8.removeEventListener("abort", v), g();
      }, f);
      i.unref && ((_a7 = y.unref) == null ? void 0 : _a7.call(y)), (_b4 = i.signal) == null ? void 0 : _b4.addEventListener("abort", v, {
        once: true
      });
    }), (_d4 = i.signal) == null ? void 0 : _d4.throwIfAborted(), true;
  }
  async function O3e(t, e = {}) {
    var _a6, _b3, _c3;
    if (e = {
      ...e
    }, B3e(e.retries), Object.hasOwn(e, "forever")) throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");
    e.retries ?? (e.retries = 10), e.factor ?? (e.factor = 2), e.minTimeout ?? (e.minTimeout = 1e3), e.maxTimeout ?? (e.maxTimeout = Number.POSITIVE_INFINITY), e.maxRetryTime ?? (e.maxRetryTime = Number.POSITIVE_INFINITY), e.randomize ?? (e.randomize = false), e.onFailedAttempt ?? (e.onFailedAttempt = () => {
    }), e.shouldRetry ?? (e.shouldRetry = () => true), e.shouldConsumeRetry ?? (e.shouldConsumeRetry = () => true), Gx("factor", e.factor, {
      min: 0,
      allowInfinity: false
    }), Gx("minTimeout", e.minTimeout, {
      min: 0,
      allowInfinity: false
    }), Gx("maxTimeout", e.maxTimeout, {
      min: 0,
      allowInfinity: true
    }), Gx("maxRetryTime", e.maxRetryTime, {
      min: 0,
      allowInfinity: true
    }), e.factor > 0 || (e.factor = 1), (_a6 = e.signal) == null ? void 0 : _a6.throwIfAborted();
    let n = 0, r = 0;
    const i = performance.now();
    for (; !Number.isFinite(e.retries) || r <= e.retries; ) {
      n++;
      try {
        (_b3 = e.signal) == null ? void 0 : _b3.throwIfAborted();
        const a = await t(n);
        return (_c3 = e.signal) == null ? void 0 : _c3.throwIfAborted(), a;
      } catch (a) {
        await M3e({
          error: a,
          attemptNumber: n,
          retriesConsumed: r,
          startTime: i,
          options: e
        }) && r++;
      }
    }
    throw new Error("Retry attempts exhausted without throwing an error.");
  }
  class $b {
    constructor(e, n) {
      if (this.stable = e, this.unstable = n, !this.unstable && !this.stable) throw new Error("One of stable or unstable values must be supplied");
    }
    get name() {
      return this.stable ? this.stable : this.unstable;
    }
    get altName() {
      return this.stable ? this.unstable : null;
    }
    get names() {
      var e = [
        this.name
      ], n = this.altName;
      return n && e.push(n), e;
    }
    matches(e) {
      return this.name === e || this.altName === e;
    }
    findIn(e) {
      var n = void 0;
      return this.name && (n = e == null ? void 0 : e[this.name]), !n && this.altName && (n = e == null ? void 0 : e[this.altName]), n;
    }
    includedIn(e) {
      var n = false;
      return this.name && (n = e.includes(this.name)), !n && this.altName && (n = e.includes(this.altName)), n;
    }
  }
  class ik extends $b {
    constructor() {
      super(...arguments), $(this, "preferUnstable", false);
    }
    setPreferUnstable(e) {
      this.preferUnstable = e;
    }
    get name() {
      return this.stable && !this.preferUnstable ? this.stable : this.unstable;
    }
  }
  class xo extends $b {
    constructor(e, n) {
      if (super(e, n), !this.unstable) throw new Error("Unstable value must be supplied");
    }
    get name() {
      return this.unstable;
    }
    get altName() {
      return this.stable;
    }
  }
  var N1 = (function(t) {
    return t.Self = "m.self", t.Pin = "m.pin", t;
  })({}), Wb = new xo("m.asset", "org.matrix.msc3488.asset"), Yf = new xo("m.ts", "org.matrix.msc3488.ts"), qb = new xo("m.location", "org.matrix.msc3488.location"), ia = (function(t) {
    return t.Read = "m.read", t.FullyRead = "m.fully_read", t.ReadPrivate = "m.read.private", t;
  })({}), Kb = "main";
  function WV(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function qV(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? WV(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : WV(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Wj = /* @__PURE__ */ new Map();
  function qj(t) {
    return t instanceof String && (t = t.toString()), Wj.has(t) || Wj.set(t, t), Wj.get(t);
  }
  function OR(t, e) {
    var n = e ?? new URLSearchParams(), r = function(l) {
      a != null && (Array.isArray(a) ? a.forEach((c) => {
        n.append(l, String(c));
      }) : n.append(l, String(a)));
    };
    for (var [i, a] of Object.entries(t)) r(i);
    return n;
  }
  function KV(t, e, n) {
    var r = qV(qV({}, n), {}, {
      [e]: n[t]
    });
    return delete r[t], r;
  }
  rn = function(t, e) {
    for (var n in e) if (e.hasOwnProperty(n)) {
      var r = e[n];
      r != null && (t = t.replace(n, encodeURIComponent(r)));
    }
    return t;
  };
  function HC(t, e, n) {
    var r;
    if (n) {
      for (r = t.length - 1; r >= 0; r--) if (e(t[r], r, t)) return t.splice(r, 1), true;
    } else for (r = 0; r < t.length; r++) if (e(t[r], r, t)) return t.splice(r, 1), true;
    return false;
  }
  function rne(t, e) {
    for (var n of e) if (!t.hasOwnProperty(n)) throw new Error("Missing required key: " + n);
  }
  function Gb(t) {
    return JSON.parse(JSON.stringify(t));
  }
  function zg(t, e) {
    if (t === e) return true;
    if (typeof t != typeof e) return false;
    if (typeof t == "number" && isNaN(t) && isNaN(e)) return true;
    if (t === null || e === null) return t === e;
    if (!(t instanceof Object) || t.constructor !== e.constructor || t.prototype !== e.prototype) return false;
    if (t instanceof RegExp || t instanceof Date) return t.toString() === e.toString();
    if (Array.isArray(t)) {
      if (t.length !== e.length) return false;
      for (var n = 0; n < t.length; n++) if (!zg(t[n], e[n])) return false;
    } else {
      for (var r in e) if (e.hasOwnProperty(r) !== t.hasOwnProperty(r)) return false;
      for (var i in t) if (e.hasOwnProperty(i) !== t.hasOwnProperty(i) || !zg(t[i], e[i])) return false;
    }
    return true;
  }
  function LR(t) {
    if (typeof t != "object" || t == null || Array.isArray(t)) return t;
    var e = [];
    for (var [n, r] of Object.entries(t)) e.push([
      n,
      LR(r)
    ]);
    return e.sort((i, a) => wD(i[0], a[0])), e;
  }
  function GV(t) {
    return typeof t == "number" && isFinite(t);
  }
  function xg(t) {
    return typeof t == "string" ? j3e(t.normalize("NFD").replace(N3e, "")) : "";
  }
  function NR(t) {
    return typeof t == "string" ? t.replace(/[\u202d-\u202e]/g, "") : "";
  }
  function L3e(t) {
    return xg(t.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g, "").toLowerCase();
  }
  var N3e = /[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\u2800\u2062-\u2063\s]/g;
  function ine(t) {
    return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  }
  function one(t) {
    return ine(t).replace(/\\\*/g, ".*").replace(/\?/g, ".");
  }
  function Kj(t) {
    return t != null && t.endsWith("/") ? t.slice(0, -1) : t;
  }
  Ug = function(t, e) {
    return new Promise((n) => {
      setTimeout(n, t, e);
    });
  };
  Ogt = function(t, e, n) {
    return zR.apply(this, arguments);
  };
  function zR() {
    return zR = me(function* (t, e, n) {
      var r = Date.now();
      try {
        return yield n();
      } finally {
        var i = Date.now();
        t.debug("[Perf]: ".concat(e, " took ").concat(i - r, "ms"));
      }
    }), zR.apply(this, arguments);
  }
  function z3e(t, e, n) {
    var r = Date.now();
    try {
      return n();
    } finally {
      var i = Date.now();
      t.debug("[Perf]: ".concat(e, " took ").concat(i - r, "ms"));
    }
  }
  function ane(t) {
    return t == null;
  }
  function V0(t, e) {
    return UR.apply(this, arguments);
  }
  function UR() {
    return UR = me(function* (t, e) {
      for (var n of t) yield e(yield n);
    }), UR.apply(this, arguments);
  }
  function l0(t) {
    return Promise.resolve(t());
  }
  function U3e(t, e) {
    return O3e((n) => t(n), {
      retries: 1 / 0,
      shouldRetry: e ? (n) => {
        var { error: r } = n;
        return e(r);
      } : void 0,
      factor: 2,
      minTimeout: 3e3,
      maxTimeout: 15e3
    });
  }
  var Bf = (() => {
    for (var t = "", e = 32; e <= 126; e++) t += String.fromCharCode(e);
    return t;
  })();
  function YV(t, e) {
    var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Bf;
    return t.padEnd(e, n[0]);
  }
  function k2(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bf, n = BigInt(e.length);
    if (t <= n) {
      var r;
      return (r = e[Number(t) - 1]) !== null && r !== void 0 ? r : "";
    }
    var i = t / n, a = Number(t % n) - 1;
    return a < 0 && (i -= BigInt(Math.abs(a)), a = Number(n) - 1), k2(i, e) + e[a];
  }
  function $C(t) {
    for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bf, n = BigInt(e.length), r = BigInt(0), i = t.length - 1, a = BigInt(0); i >= 0; i--, a++) {
      var s = t.charCodeAt(i) - e.charCodeAt(0);
      r += BigInt(1 + s) * n ** a;
    }
    return r;
  }
  function V3e(t, e) {
    var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Bf, r = Math.max(t.length, e.length), i = $C(YV(t, r, n), n), a = $C(YV(e, r, n), n), s = (i + a) / BigInt(2);
    return s === i || s == a ? k2(s, n) + n[0] : k2(s, n);
  }
  function h_(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bf;
    return k2($C(t, e) + BigInt(1), e);
  }
  function ZV(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bf;
    return k2($C(t, e) - BigInt(1), e);
  }
  function wD(t, e) {
    return t < e ? -1 : t > e ? 1 : 0;
  }
  function sne(t, e) {
    var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    for (var [r, i] of Object.entries(e)) {
      if (t[r] instanceof Object && i) {
        sne(t[r], i);
        continue;
      }
      if (i != null || !n) {
        WC(t, r, i);
        continue;
      }
    }
    return t;
  }
  function JV(t) {
    var e;
    return (e = Yf.findIn(t.getContent())) !== null && e !== void 0 ? e : -1;
  }
  function H3e(t, e) {
    return JV(e) - JV(t);
  }
  function $7(t) {
    return [
      ia.Read,
      ia.ReadPrivate
    ].includes(t);
  }
  function XV(t, e) {
    var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : (s, l) => s === l;
    if (t.size !== e.size) return false;
    for (var [r, i] of t) {
      var a = e.get(r);
      if (a === void 0 || !n(i, a)) return false;
    }
    return true;
  }
  function lne(t) {
    return t instanceof Map ? dg(t) : Array.isArray(t) ? t.map((e) => lne(e)) : t;
  }
  function dg(t) {
    var e = /* @__PURE__ */ new Map();
    for (var [n, r] of t) e.set(n, lne(r));
    return Object.fromEntries(e.entries());
  }
  function By(t) {
    return t === "__proto__" || t === "prototype" || t === "constructor";
  }
  function WC(t, e, n) {
    if (By(e)) throw new Error("Trying to modify prototype or constructor");
    t[e] = n;
  }
  function Dc(t) {
    return !(By(t.room_id) || By(t.sender) || By(t.event_id));
  }
  zu = class extends Map {
    constructor(e) {
      super(), this.createDefault = e;
    }
    getOrCreate(e) {
      return this.has(e) || this.set(e, this.createDefault()), this.get(e);
    }
  };
  var DD = {
    exports: {}
  }, $3e = DD.exports, QV;
  function W3e() {
    return QV || (QV = 1, (function(t) {
      (function(e, n) {
        t.exports ? t.exports = n() : e.log = n();
      })($3e, function() {
        var e = function() {
        }, n = "undefined", r = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), i = [
          "trace",
          "debug",
          "info",
          "warn",
          "error"
        ], a = {}, s = null;
        function l(v, y) {
          var w = v[y];
          if (typeof w.bind == "function") return w.bind(v);
          try {
            return Function.prototype.bind.call(w, v);
          } catch {
            return function() {
              return Function.prototype.apply.apply(w, [
                v,
                arguments
              ]);
            };
          }
        }
        function c() {
          console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [
            console,
            arguments
          ])), console.trace && console.trace();
        }
        function d(v) {
          return v === "debug" && (v = "log"), typeof console === n ? false : v === "trace" && r ? c : console[v] !== void 0 ? l(console, v) : console.log !== void 0 ? l(console, "log") : e;
        }
        function u() {
          for (var v = this.getLevel(), y = 0; y < i.length; y++) {
            var w = i[y];
            this[w] = y < v ? e : this.methodFactory(w, v, this.name);
          }
          if (this.log = this.debug, typeof console === n && v < this.levels.SILENT) return "No console available for logging";
        }
        function h(v) {
          return function() {
            typeof console !== n && (u.call(this), this[v].apply(this, arguments));
          };
        }
        function f(v, y, w) {
          return d(v) || h.apply(this, arguments);
        }
        function g(v, y) {
          var w = this, b, j, k, C = "loglevel";
          typeof v == "string" ? C += ":" + v : typeof v == "symbol" && (C = void 0);
          function x(U) {
            var z = (i[U] || "silent").toUpperCase();
            if (!(typeof window === n || !C)) {
              try {
                window.localStorage[C] = z;
                return;
              } catch {
              }
              try {
                window.document.cookie = encodeURIComponent(C) + "=" + z + ";";
              } catch {
              }
            }
          }
          function S() {
            var U;
            if (!(typeof window === n || !C)) {
              try {
                U = window.localStorage[C];
              } catch {
              }
              if (typeof U === n) try {
                var z = window.document.cookie, O = encodeURIComponent(C), M = z.indexOf(O + "=");
                M !== -1 && (U = /^([^;]+)/.exec(z.slice(M + O.length + 1))[1]);
              } catch {
              }
              return w.levels[U] === void 0 && (U = void 0), U;
            }
          }
          function T() {
            if (!(typeof window === n || !C)) {
              try {
                window.localStorage.removeItem(C);
              } catch {
              }
              try {
                window.document.cookie = encodeURIComponent(C) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
              } catch {
              }
            }
          }
          function A(U) {
            var z = U;
            if (typeof z == "string" && w.levels[z.toUpperCase()] !== void 0 && (z = w.levels[z.toUpperCase()]), typeof z == "number" && z >= 0 && z <= w.levels.SILENT) return z;
            throw new TypeError("log.setLevel() called with invalid level: " + U);
          }
          w.name = v, w.levels = {
            TRACE: 0,
            DEBUG: 1,
            INFO: 2,
            WARN: 3,
            ERROR: 4,
            SILENT: 5
          }, w.methodFactory = y || f, w.getLevel = function() {
            return k ?? j ?? b;
          }, w.setLevel = function(U, z) {
            return k = A(U), z !== false && x(k), u.call(w);
          }, w.setDefaultLevel = function(U) {
            j = A(U), S() || w.setLevel(U, false);
          }, w.resetLevel = function() {
            k = null, T(), u.call(w);
          }, w.enableAll = function(U) {
            w.setLevel(w.levels.TRACE, U);
          }, w.disableAll = function(U) {
            w.setLevel(w.levels.SILENT, U);
          }, w.rebuild = function() {
            if (s !== w && (b = A(s.getLevel())), u.call(w), s === w) for (var U in a) a[U].rebuild();
          }, b = A(s ? s.getLevel() : "WARN");
          var B = S();
          B != null && (k = A(B)), u.call(w);
        }
        s = new g(), s.getLogger = function(y) {
          if (typeof y != "symbol" && typeof y != "string" || y === "") throw new TypeError("You must supply a name when creating a logger.");
          var w = a[y];
          return w || (w = a[y] = new g(y, s.methodFactory)), w;
        };
        var m = typeof window !== n ? window.log : void 0;
        return s.noConflict = function() {
          return typeof window !== n && window.log === s && (window.log = m), s;
        }, s.getLoggers = function() {
          return a;
        }, s.default = s, s;
      });
    })(DD)), DD.exports;
  }
  var q3e = W3e();
  const VR = da(q3e);
  var K3e = "matrix";
  VR.methodFactory = function(t, e, n) {
    return function() {
      for (var r = arguments.length, i = new Array(r), a = 0; a < r; a++) i[a] = arguments[a];
      this.prefix && i.unshift(this.prefix);
      var s = t === "error" || t === "warn" || t === "trace" || t === "info" || t === "debug";
      return s ? console[t](...i) : console.log(...i);
    };
  };
  function cne(t) {
    var e = K3e + (t === void 0 ? "" : "-".concat(t)), n = VR.getLogger(e);
    return n.getChild === void 0 && (n.prefix = t, n.getChild = (r) => {
      var i = cne((t ?? "") + r);
      return i.methodFactory = n.methodFactory, i.rebuild(), i;
    }, n.setLevel(VR.levels.DEBUG, false)), n;
  }
  var _e = cne();
  Lgt = class {
    constructor(e, n) {
      this.parent = e, $(this, "name", void 0), this.name = n + ":";
    }
    trace() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.parent.trace(this.name, ...n);
    }
    debug() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.parent.debug(this.name, ...n);
    }
    info() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.parent.info(this.name, ...n);
    }
    warn() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.parent.warn(this.name, ...n);
    }
    error() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.parent.error(this.name, ...n);
    }
  };
  class W7 {
    constructor(e) {
      this.debugInstance = e;
    }
    trace() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.debugWithPrefix("[TRACE]", ...n);
    }
    debug() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.debugWithPrefix("[DEBUG]", ...n);
    }
    info() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.debugWithPrefix("[INFO]", ...n);
    }
    warn() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.debugWithPrefix("[WARN]", ...n);
    }
    error() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      this.debugWithPrefix("[ERROR]", ...n);
    }
    getChild(e) {
      return new W7(this.debugInstance.extend(e));
    }
    debugWithPrefix(e) {
      for (var n, r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++) i[a - 1] = arguments[a];
      if (i.length === 0) n = "";
      else if (i[0] instanceof Error) {
        var s = i.shift();
        n = s.stack || s.message;
      } else typeof i[0] == "string" ? n = i.shift() : n = "%O";
      this.debugInstance(e + " " + n, ...i);
    }
  }
  let Xn, qC, Bo, HR, $R, WR, dne, Su, une, qR, hne, ug, KR, G3e, fne, KC, mne, Ui;
  ce = (function(t) {
    return t.RoomCanonicalAlias = "m.room.canonical_alias", t.RoomCreate = "m.room.create", t.RoomJoinRules = "m.room.join_rules", t.RoomMember = "m.room.member", t.RoomThirdPartyInvite = "m.room.third_party_invite", t.RoomPowerLevels = "m.room.power_levels", t.RoomName = "m.room.name", t.RoomTopic = "m.room.topic", t.RoomAvatar = "m.room.avatar", t.RoomPinnedEvents = "m.room.pinned_events", t.RoomEncryption = "m.room.encryption", t.RoomHistoryVisibility = "m.room.history_visibility", t.RoomGuestAccess = "m.room.guest_access", t.RoomServerAcl = "m.room.server_acl", t.RoomTombstone = "m.room.tombstone", t.RoomPredecessor = "org.matrix.msc3946.room_predecessor", t.PolicyRuleUser = "m.policy.rule.user", t.PolicyRuleRoom = "m.policy.rule.room", t.PolicyRuleServer = "m.policy.rule.server", t.SpaceChild = "m.space.child", t.SpaceParent = "m.space.parent", t.RoomRedaction = "m.room.redaction", t.RoomMessage = "m.room.message", t.RoomMessageEncrypted = "m.room.encrypted", t.Sticker = "m.sticker", t.CallInvite = "m.call.invite", t.CallCandidates = "m.call.candidates", t.CallAnswer = "m.call.answer", t.CallHangup = "m.call.hangup", t.CallReject = "m.call.reject", t.CallSelectAnswer = "m.call.select_answer", t.CallNegotiate = "m.call.negotiate", t.CallSDPStreamMetadataChanged = "m.call.sdp_stream_metadata_changed", t.CallSDPStreamMetadataChangedPrefix = "org.matrix.call.sdp_stream_metadata_changed", t.CallReplaces = "m.call.replaces", t.CallAssertedIdentity = "m.call.asserted_identity", t.CallAssertedIdentityPrefix = "org.matrix.call.asserted_identity", t.CallEncryptionKeysPrefix = "io.element.call.encryption_keys", t.KeyVerificationRequest = "m.key.verification.request", t.KeyVerificationStart = "m.key.verification.start", t.KeyVerificationCancel = "m.key.verification.cancel", t.KeyVerificationMac = "m.key.verification.mac", t.KeyVerificationDone = "m.key.verification.done", t.KeyVerificationKey = "m.key.verification.key", t.KeyVerificationAccept = "m.key.verification.accept", t.KeyVerificationReady = "m.key.verification.ready", t.RoomMessageFeedback = "m.room.message.feedback", t.Reaction = "m.reaction", t.PollStart = "org.matrix.msc3381.poll.start", t.Typing = "m.typing", t.Receipt = "m.receipt", t.Presence = "m.presence", t.FullyRead = "m.fully_read", t.Tag = "m.tag", t.SpaceOrder = "org.matrix.msc3230.space_order", t.PushRules = "m.push_rules", t.Direct = "m.direct", t.IgnoredUserList = "m.ignored_user_list", t.RoomKey = "m.room_key", t.RoomKeyRequest = "m.room_key_request", t.ForwardedRoomKey = "m.forwarded_room_key", t.Dummy = "m.dummy", t.SecretRequest = "m.secret.request", t.SecretSend = "m.secret.send", t.GroupCallPrefix = "org.matrix.msc3401.call", t.GroupCallMemberPrefix = "org.matrix.msc3401.call.member", t.CallNotify = "org.matrix.msc4075.call.notify", t.RTCNotification = "org.matrix.msc4075.rtc.notification", t.RTCDecline = "org.matrix.msc4310.rtc.decline", t;
  })({});
  Xn = (function(t) {
    return t.Annotation = "m.annotation", t.Replace = "m.replace", t.Reference = "m.reference", t.Thread = "m.thread", t;
  })({});
  Jn = (function(t) {
    return t.Text = "m.text", t.Emote = "m.emote", t.Notice = "m.notice", t.Image = "m.image", t.File = "m.file", t.Audio = "m.audio", t.Location = "m.location", t.Video = "m.video", t.KeyVerificationRequest = "m.key.verification.request", t;
  })({});
  qC = "type";
  Bo = (function(t) {
    return t.Space = "m.space", t.UnstableCall = "org.matrix.msc3417.call", t.ElementVideo = "io.element.video", t;
  })({});
  ok = "org.matrix.msgid";
  HR = new xo("m.room.purpose", "org.matrix.msc3088.purpose");
  $R = new xo("m.enabled", "org.matrix.msc3088.enabled");
  WR = new xo("m.data_tree", "org.matrix.msc3089.data_tree");
  dne = new xo("m.leaf", "org.matrix.msc3089.leaf");
  Su = new xo("m.branch", "org.matrix.msc3089.branch");
  une = new xo("m.room.marker", "org.matrix.msc2716.marker");
  qR = new xo("with_rel_types", "org.matrix.msc3912.with_relations");
  hne = new xo("io.element.functional_members", "io.element.functional_members");
  ug = new xo("m.visibility", "org.matrix.msc3531.visibility");
  KR = new xo("enabled", "org.matrix.msc3881.enabled");
  G3e = new xo("device_id", "org.matrix.msc3881.device_id");
  fne = new xo("m.local_notification_settings", "org.matrix.msc3890.local_notification_settings");
  KC = new xo("thread_id", "org.matrix.msc4023.thread_id");
  mne = new $b("membership", "io.element.msc4115.membership");
  Ht = (function(t) {
    return t.Ban = "ban", t.Invite = "invite", t.Join = "join", t.Knock = "knock", t.Leave = "leave", t;
  })({});
  Ui = (function(t) {
    return t.Membership = "RoomMember.membership", t.Name = "RoomMember.name", t.PowerLevel = "RoomMember.powerLevel", t.Typing = "RoomMember.typing", t;
  })({});
  class S2 extends ji {
    constructor(e, n) {
      super(), this.roomId = e, this.userId = n, $(this, "_isOutOfBand", false), $(this, "modified", -1), $(this, "requestedProfileInfo", false), $(this, "typing", false), $(this, "name", void 0), $(this, "rawDisplayName", void 0), $(this, "powerLevel", 0), $(this, "user", void 0), $(this, "membership", void 0), $(this, "disambiguate", false), $(this, "events", {}), this.name = n, this.rawDisplayName = n, this.updateModifiedTime();
    }
    markOutOfBand() {
      this._isOutOfBand = true;
    }
    isOutOfBand() {
      return this._isOutOfBand;
    }
    setMembershipEvent(e, n) {
      var r, i, a = (r = e.getDirectionalContent().displayname) !== null && r !== void 0 ? r : "";
      if (e.getType() === ce.RoomMember) {
        this._isOutOfBand = false, this.events.member = e;
        var s = this.membership;
        this.membership = e.getDirectionalContent().membership, this.membership === void 0 && _e.trace("membership event with membership undefined (forwardLooking: ".concat(e.forwardLooking, ")!"), e.getContent(), "prevcontent is ", e.getPrevContent()), this.disambiguate = J3e(this.userId, a, n);
        var l = this.name;
        this.name = X3e(this.userId, a, this.disambiguate), this.rawDisplayName = NR((i = e.getDirectionalContent().displayname) !== null && i !== void 0 ? i : ""), (!this.rawDisplayName || !xg(this.rawDisplayName)) && (this.rawDisplayName = this.userId), s !== this.membership && (this.updateModifiedTime(), this.emit(Ui.Membership, e, this, s)), l !== this.name && (this.updateModifiedTime(), this.emit(Ui.Name, e, this, l));
      }
    }
    setPowerLevel(e, n) {
      var r = this.powerLevel;
      this.powerLevel = e, r !== this.powerLevel && (this.updateModifiedTime(), this.emit(Ui.PowerLevel, n, this));
    }
    setTypingEvent(e) {
      if (e.getType() === "m.typing") {
        var n = this.typing;
        this.typing = false;
        var r = e.getContent().user_ids;
        Array.isArray(r) && (r.indexOf(this.userId) !== -1 && (this.typing = true), n !== this.typing && (this.updateModifiedTime(), this.emit(Ui.Typing, e, this)));
      }
    }
    updateModifiedTime() {
      this.modified = Date.now();
    }
    getLastModifiedTime() {
      return this.modified;
    }
    isKicked() {
      return this.membership === Ht.Leave && this.events.member !== void 0 && this.events.member.getSender() !== this.events.member.getStateKey();
    }
    getDMInviter() {
      if (this.events.member) {
        var e = this.events.member, n = e.getContent(), r = e.getSender();
        if (n.membership === Ht.Join && (n = e.getPrevContent(), r = e.getUnsigned().prev_sender), n.membership === Ht.Invite && n.is_direct) return r;
      }
    }
    getAvatarUrl(e, n, r, i) {
      var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, s = arguments.length > 5 ? arguments[5] : void 0, l = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false, c = this.getMxcAvatarUrl();
      if (!c && !a) return null;
      var d = rk(e, c, n, r, i, s, void 0, l);
      return d || null;
    }
    getMxcAvatarUrl() {
      if (this.events.member) return this.events.member.getDirectionalContent().avatar_url;
      if (this.user) return this.user.avatarUrl;
    }
  }
  var Y3e = /@.+:.+/, Z3e = /[\u200E\u200F\u202A-\u202F]/;
  function J3e(t, e, n) {
    if (!e || e === t || !n) return false;
    var r = xg(e);
    if (!r) return false;
    if (Y3e.test(r) || Z3e.test(e)) return true;
    var i = n.getUserIdsWithDisplayName(e);
    return !!i.some((a) => a !== t);
  }
  function X3e(t, e, n) {
    return !e || e === t ? t : n ? NR(e) + " (" + t + ")" : xg(e) ? NR(e) : t;
  }
  class gne {
    constructor(e) {
      this.target = e, $(this, "reEmitters", /* @__PURE__ */ new WeakMap());
    }
    reEmit(e, n) {
      var r = this, i = this.reEmitters.get(e);
      i || (i = /* @__PURE__ */ new Map(), this.reEmitters.set(e, i));
      var a = function(c) {
        if (i.has(c)) return 1;
        var d = function() {
          if (!(c === "error" && r.target.listenerCount("error") === 0)) {
            for (var h = arguments.length, f = new Array(h), g = 0; g < h; g++) f[g] = arguments[g];
            r.target.emit(c, ...f, e);
          }
        };
        e.on(c, d), i.set(c, d);
      };
      for (var s of n) a(s);
    }
    stopReEmitting(e, n) {
      var r = this.reEmitters.get(e);
      if (r) {
        for (var i of n) e.off(i, r.get(i)), r.delete(i);
        r.size === 0 && this.reEmitters.delete(e);
      }
    }
  }
  IF = class extends gne {
    constructor(e) {
      super(e);
    }
    reEmit(e, n) {
      super.reEmit(e, n);
    }
    stopReEmitting(e, n) {
      super.stopReEmitting(e, n);
    }
  };
  function eH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Q3e(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? eH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : eH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function pne(t, e, n) {
    var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
    return new to({
      content: {
        [e.getId()]: {
          [n]: {
            [t]: Q3e({
              ts: e.getTs()
            }, !r && {
              thread_id: W1(e)
            })
          }
        }
      },
      type: ce.Receipt,
      room_id: e.getRoomId()
    });
  }
  var c0 = 0, d0 = 1;
  class Fne extends ji {
    constructor() {
      super(...arguments), $(this, "receipts", new zu(() => /* @__PURE__ */ new Map())), $(this, "receiptCacheByEventId", /* @__PURE__ */ new Map());
    }
    getReadReceiptForUserId(e) {
      var n, r, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ia.Read, [s, l] = (n = (r = this.receipts.get(a)) === null || r === void 0 ? void 0 : r.get(e)) !== null && n !== void 0 ? n : [
        null,
        null
      ];
      return i ? s : l ?? s;
    }
    compareReceipts(e, n) {
      var r;
      return (r = this.getUnfilteredTimelineSet().compareEventOrdering(e.eventId, n.eventId)) !== null && r !== void 0 ? r : e.data.ts - n.data.ts;
    }
    getEventReadUpTo(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, r = this.getLatestReceipt(e, n);
      return r && this.receiptPointsAtConsistentEvent(r) ? r.eventId : null;
    }
    receiptPointsAtConsistentEvent(e) {
      var n, r = this.findEventById(e.eventId);
      if (!r) return false;
      if (!((n = e.data) !== null && n !== void 0 && n.thread_id)) return true;
      if (e.data.thread_id === Kb) {
        var i = N2(r);
        if (i) return true;
      } else if (r.threadRootId === e.data.thread_id) return true;
      return _e.warn("Ignoring receipt because its thread_id (".concat(e.data.thread_id, ") disagrees ") + "with the thread root (".concat(r.threadRootId, ") of the referenced event ") + "(event ID = ".concat(e.eventId, ")")), false;
    }
    getLatestReceipt(e, n) {
      var r, i, a = this.getReadReceiptForUserId(e, n, ia.Read), s = this.getReadReceiptForUserId(e, n, ia.ReadPrivate), l;
      return a != null && a.eventId && s !== null && s !== void 0 && s.eventId && (l = this.compareReceipts(a, s)), l ? (i = l < 0 ? s : a) !== null && i !== void 0 ? i : null : (r = s ?? a) !== null && r !== void 0 ? r : null;
    }
    addReceiptToStructure(e, n, r, i, a) {
      var s, l, c = this.receipts.getOrCreate(n), d = c.get(r);
      d || (d = [
        null,
        null
      ], c.set(r, d));
      var u = d[c0];
      if (a) {
        var h;
        u = (h = d[d0]) !== null && h !== void 0 ? h : d[c0];
      }
      var f = {
        eventId: e,
        data: i
      };
      if (u) {
        var g = this.compareReceipts(u, f);
        if (g >= 0) return;
      }
      var m = a ? d[c0] : f, v = a ? f : d[d0], y = null;
      m && v && (y = this.getUnfilteredTimelineSet().compareEventOrdering(m.eventId, v.eventId));
      var w = y === null || y < 0, b = (s = d[d0]) !== null && s !== void 0 ? s : d[c0];
      a && w ? d[d0] = f : a || (d[c0] = f, w || (d[d0] = null));
      var j = (l = d[d0]) !== null && l !== void 0 ? l : d[c0];
      if (b !== j) {
        if (b && this.receiptCacheByEventId.get(b.eventId)) {
          var k = b.eventId;
          this.receiptCacheByEventId.set(k, this.receiptCacheByEventId.get(k).filter((C) => C.type !== n || C.userId !== r)), this.receiptCacheByEventId.get(k).length < 1 && this.receiptCacheByEventId.delete(k);
        }
        this.receiptCacheByEventId.get(e) || this.receiptCacheByEventId.set(e, []), this.receiptCacheByEventId.get(e).push({
          userId: r,
          type: n,
          data: i
        });
      }
    }
    getReceiptsForEvent(e) {
      return this.receiptCacheByEventId.get(e.getId()) || [];
    }
    fixupNotifications(e) {
      var n = this.getReadReceiptForUserId(e, false), r = this.timeline[this.timeline.length - 1];
      r && (n == null ? void 0 : n.eventId) === r.getId() && e === r.getSender() && (this.setUnread(ir.Total, 0), this.setUnread(ir.Highlight, 0));
    }
    addLocalEchoReceipt(e, n, r) {
      var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
      this.addReceipt(pne(e, n, r, i), true);
    }
    getUsersReadUpTo(e) {
      return this.getReceiptsForEvent(e).filter(function(n) {
        return $7(n.type);
      }).map(function(n) {
        return n.userId;
      });
    }
  }
  var Ho = (function(t) {
    return t[t.Stable = 0] = "Stable", t[t.Unstable = 1] = "Unstable", t[t.Unsupported = 2] = "Unsupported", t;
  })({}), $o = (function(t) {
    return t.Thread = "Thread", t.ThreadUnreadNotifications = "ThreadUnreadNotifications", t.LoginTokenRequest = "LoginTokenRequest", t.RelationBasedRedactions = "RelationBasedRedactions", t.AccountDataDeletion = "AccountDataDeletion", t.RelationsRecursion = "RelationsRecursion", t.IntentionalMentions = "IntentionalMentions", t;
  })({}), exe = {
    [$o.Thread]: {
      unstablePrefixes: [
        "org.matrix.msc3440"
      ],
      matrixVersion: "v1.3"
    },
    [$o.ThreadUnreadNotifications]: {
      unstablePrefixes: [
        "org.matrix.msc3771",
        "org.matrix.msc3773"
      ],
      matrixVersion: "v1.4"
    },
    [$o.LoginTokenRequest]: {
      unstablePrefixes: [
        "org.matrix.msc3882"
      ]
    },
    [$o.RelationBasedRedactions]: {
      unstablePrefixes: [
        "org.matrix.msc3912"
      ]
    },
    [$o.AccountDataDeletion]: {
      unstablePrefixes: [
        "org.matrix.msc3391"
      ]
    },
    [$o.RelationsRecursion]: {
      unstablePrefixes: [
        "org.matrix.msc3981"
      ],
      matrixVersion: "v1.10"
    },
    [$o.IntentionalMentions]: {
      unstablePrefixes: [
        "org.matrix.msc3952_intentional_mentions"
      ],
      matrixVersion: "v1.7"
    }
  };
  function txe(t) {
    return GR.apply(this, arguments);
  }
  function GR() {
    return GR = me(function* (t) {
      var e = /* @__PURE__ */ new Map();
      for (var [n, r] of Object.entries(exe)) {
        var i, a, s, l, c = (i = (a = t.versions) === null || a === void 0 ? void 0 : a.includes(r.matrixVersion || "")) !== null && i !== void 0 ? i : false, d = (s = (l = r.unstablePrefixes) === null || l === void 0 ? void 0 : l.every((u) => {
          var h;
          return ((h = t.unstable_features) === null || h === void 0 ? void 0 : h[u]) === true;
        })) !== null && s !== void 0 ? s : false;
        c ? e.set(n, Ho.Stable) : d ? e.set(n, Ho.Unstable) : e.set(n, Ho.Unsupported);
      }
      return e;
    }), GR.apply(this, arguments);
  }
  function tH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function nH(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? tH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : tH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var jr = (function(t) {
    return t.New = "Thread.new", t.Update = "Thread.update", t.NewReply = "Thread.newReply", t.ViewThread = "Thread.viewThread", t.Delete = "Thread.delete", t;
  })({}), Pa = (function(t) {
    return t[t.None = 0] = "None", t[t.Experimental = 1] = "Experimental", t[t.Stable = 2] = "Stable", t;
  })({});
  function CD(t, e) {
    return t ? Pa.Stable : e ? Pa.Experimental : Pa.None;
  }
  class Ei extends Fne {
    constructor(e, n, r) {
      var i, a;
      if (super(), i = this, this.id = e, this.rootEvent = n, $(this, "timelineSet", void 0), $(this, "_currentUserParticipated", false), $(this, "reEmitter", void 0), $(this, "lastEvent", void 0), $(this, "replyCount", 0), $(this, "lastPendingEvent", void 0), $(this, "pendingReplyCount", 0), $(this, "room", void 0), $(this, "client", void 0), $(this, "pendingEventOrdering", void 0), $(this, "processRootEventPromise", void 0), $(this, "initialEventsFetched", !Ei.hasServerSideSupport), $(this, "initalEventFetchProm", void 0), $(this, "replayEvents", []), $(this, "onTimelineReset", me(function* () {
        yield i.processRootEventPromise, i.processRootEventPromise = void 0;
      })), $(this, "onBeforeRedaction", (s, l) => {
        s != null && s.isRelation(pi.name) && this.room.eventShouldLiveIn(s).threadId === this.id && s.getId() !== this.id && !l.status && (this.replyCount--, this.updatePendingReplyCount(), this.emit(jr.Update, this));
      }), $(this, "onRedaction", (function() {
        var s = me(function* (l, c, d) {
          if (d === i.id) if (i.replyCount <= 0) {
            for (var u of i.timeline) i.clearEventMetadata(u);
            i.lastEvent = i.rootEvent, i._currentUserParticipated = false, i.emit(jr.Delete, i);
          } else {
            var h;
            ((h = i.lastEvent) === null || h === void 0 ? void 0 : h.getId()) === l.getAssociatedId() && (yield i.processRootEventPromise, i.processRootEventPromise = void 0), yield i.updateThreadMetadata();
          }
        });
        return function(l, c, d) {
          return s.apply(this, arguments);
        };
      })()), $(this, "onTimelineEvent", (s, l, c) => {
        if (!c) {
          var d = s.getSender();
          d && l && this.shouldSendLocalEchoReceipt(d, s) && l.addLocalEchoReceipt(d, s, ia.Read), s.getId() !== this.id && s.isRelation(pi.name) && this.replyCount++;
        }
        this.onEcho(s, c ?? false);
      }), $(this, "onLocalEcho", (s) => {
        this.onEcho(s, false);
      }), $(this, "onEcho", (function() {
        var s = me(function* (l, c) {
          l.threadRootId === i.id && i.lastEvent !== l && (yield i.updateThreadMetadata(), l.isRelation(pi.name) && (c || (i.lastEvent = void 0, i.emit(jr.NewReply, i, l))));
        });
        return function(l, c) {
          return s.apply(this, arguments);
        };
      })()), this.setMaxListeners(1e3), !(r != null && r.room)) throw new Error("element-web#22141: A thread requires a room in order to function");
      this.room = r.room, this.client = r.client, this.pendingEventOrdering = (a = r.pendingEventOrdering) !== null && a !== void 0 ? a : $1.Chronological, this.timelineSet = new H0(this.room, {
        timelineSupport: true,
        pendingEvents: true
      }, this.client, this), this.reEmitter = new IF(this), this.reEmitter.reEmit(this.timelineSet, [
        mt.Timeline,
        mt.TimelineReset
      ]), this.room.on(or.BeforeRedaction, this.onBeforeRedaction), this.room.on(mt.Redaction, this.onRedaction), this.room.on(mt.LocalEchoUpdated, this.onLocalEcho), this.room.on(mt.TimelineReset, this.onTimelineReset), this.timelineSet.on(mt.Timeline, this.onTimelineEvent), this.processReceipts(r.receipts), this.updateThreadMetadata(), this.setEventMetadata(this.rootEvent);
    }
    fetchRootEvent() {
      var e = this;
      return me(function* () {
        try {
          var n = yield e.client.fetchRoomEvent(e.roomId, e.id), r = e.client.getEventMapper();
          e.rootEvent = r(n);
        } catch (i) {
          _e.error("Failed to fetch thread root to construct thread with", i);
        }
        yield e.processEvent(e.rootEvent);
      })();
    }
    static setServerSideSupport(e) {
      Ei.hasServerSideSupport = e, e !== Pa.Stable && (o1.setPreferUnstable(true), a1.setPreferUnstable(true), pi.setPreferUnstable(true));
    }
    static setServerSideListSupport(e) {
      Ei.hasServerSideListSupport = e;
    }
    static setServerSideFwdPaginationSupport(e) {
      Ei.hasServerSideFwdPaginationSupport = e;
    }
    shouldSendLocalEchoReceipt(e, n) {
      var r, i = (r = this.client.canSupport.get($o.RelationsRecursion)) !== null && r !== void 0 ? r : Ho.Unsupported;
      if (i === Ho.Unsupported) {
        var a, s = (a = this.getReadReceiptForUserId(e)) === null || a === void 0 ? void 0 : a.eventId;
        if (s) {
          var l = this.findEventById(s);
          if (l && l.getTs() > n.getTs()) return false;
        }
      }
      return true;
    }
    get roomState() {
      return this.room.getLiveTimeline().getState(en.FORWARDS);
    }
    addEventToTimeline(e, n) {
      this.findEventById(e.getId()) || this.timelineSet.addEventToTimeline(e, this.liveTimeline, {
        toStartOfTimeline: n,
        fromCache: false,
        roomState: this.roomState,
        addToState: false
      });
    }
    insertEventIntoTimeline(e) {
      var n = e.getId();
      n && (this.findEventById(n) || this.timelineSet.insertEventIntoTimeline(e, this.liveTimeline, this.roomState, false));
    }
    addEvents(e, n) {
      e.forEach((r) => this.addEvent(r, n, false)), this.updateThreadMetadata();
    }
    addEvent(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
      this.setEventMetadata(e);
      var i = this.lastReply(), a = !i || e.localTimestamp >= i.localTimestamp;
      if (!Ei.hasServerSideSupport) this.addEventToTimeline(e, n), this.client.decryptEventIfNeeded(e);
      else if (e.isRelation(Xn.Annotation) || e.isRelation(Xn.Replace)) {
        this.addRelatedThreadEvent(e, n);
        return;
      } else !n && a ? (this.addEventToTimeline(e, false), this.fetchEditsWhereNeeded(e)) : n ? this.addEventToTimeline(e, n) : this.insertEventIntoTimeline(e);
      e.getId() !== this.id && e.isRelation(pi.name) && !n && a && (this.lastEvent = void 0), r && (this.emit(jr.NewReply, this, e), this.updateThreadMetadata());
    }
    addRelatedThreadEvent(e, n) {
      if (this.initialEventsFetched) {
        var a, s = (a = this.client.canSupport.get($o.RelationsRecursion)) !== null && a !== void 0 ? a : Ho.Unsupported;
        s === Ho.Unsupported ? this.insertEventIntoTimeline(e) : this.addEventToTimeline(e, n);
      } else {
        var r;
        if ((r = this.replayEvents) === null || r === void 0 || r.push(e), e.isRelation(Xn.Annotation)) {
          var i;
          (i = this.timelineSet.relations) === null || i === void 0 || i.aggregateChildEvent(e, this.timelineSet);
        }
      }
    }
    processEvent(e) {
      var n = this;
      return me(function* () {
        e && (n.setEventMetadata(e), yield n.fetchEditsWhereNeeded(e));
      })();
    }
    processReceipts() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      for (var { eventId: n, receiptType: r, userId: i, receipt: a, synthetic: s } of e) this.addReceiptToStructure(n, r, i, a, s);
    }
    getRootEventBundledRelationship() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.rootEvent;
      return e == null ? void 0 : e.getServerAggregatedRelation(pi.name);
    }
    processRootEvent() {
      var e = this;
      return me(function* () {
        var n = e.getRootEventBundledRelationship();
        if (Ei.hasServerSideSupport && n) {
          e.replyCount = n.count, e._currentUserParticipated = !!n.current_user_participated;
          var r = e.client.getEventMapper();
          e.lastEvent = r(nH(nH({}, n.latest_event), {}, {
            room_id: e.roomId
          })), e.updatePendingReplyCount(), yield e.processEvent(e.lastEvent);
        }
      })();
    }
    updatePendingReplyCount() {
      var e = this.pendingEventOrdering === $1.Detached ? this.room.getPendingEvents() : this.events, n = e.filter((r) => {
        var i;
        return r.threadRootId === this.id && r.isRelation(pi.name) && r.status !== null && r.getId() !== ((i = this.lastEvent) === null || i === void 0 ? void 0 : i.getId());
      });
      this.lastPendingEvent = n.length ? n[n.length - 1] : void 0, this.pendingReplyCount = n.length;
    }
    resetLiveTimeline(e, n) {
      var r = this;
      return me(function* () {
        var i = r.liveTimeline;
        r.timelineSet.resetLiveTimeline(e ?? void 0, n ?? void 0);
        var a = r.liveTimeline, s, l;
        if (e) {
          var c = yield r.client.createMessagesRequest(r.roomId, e, 1, Tn.Forward);
          s = c.end;
        }
        if (n) {
          var d = yield r.client.createMessagesRequest(r.roomId, n, 1, Tn.Backward);
          l = d.start;
        }
        n && i.getPaginationToken(Tn.Forward) === n && i.setPaginationToken(l ?? null, Tn.Forward), e && a.getPaginationToken(Tn.Backward) === e && a.setPaginationToken(s ?? null, Tn.Backward);
      })();
    }
    updateThreadFromRootEvent() {
      var e = this;
      return me(function* () {
        Ei.hasServerSideSupport && (!e.initialEventsFetched && !e.lastEvent && (yield e.processRootEvent()), yield e.fetchRootEvent()), yield e.processRootEvent();
      })();
    }
    updateThreadMetadata() {
      var e = this;
      return me(function* () {
        if (e.updatePendingReplyCount(), e.processRootEventPromise || (e.processRootEventPromise = e.updateThreadFromRootEvent()), yield e.processRootEventPromise, !e.initialEventsFetched) if (e.initalEventFetchProm) yield e.initalEventFetchProm;
        else try {
          e.timelineSet.resetLiveTimeline(), e.replyCount === 0 && e.rootEvent ? (e.timelineSet.addEventsToTimeline([
            e.rootEvent
          ], true, false, e.liveTimeline, null), e.liveTimeline.setPaginationToken(null, Tn.Backward)) : (e.initalEventFetchProm = e.client.paginateEventTimeline(e.liveTimeline, {
            backwards: true
          }), yield e.initalEventFetchProm), e.initialEventsFetched = true;
          for (var n of e.replayEvents) e.addEvent(n, false);
          e.replayEvents = null, e.emit(mt.TimelineReset, e.room, e.timelineSet, true);
        } catch (r) {
          _e.error("Failed to load start of newly created thread: ", r), e.initialEventsFetched = false;
        }
        e.emit(jr.Update, e);
      })();
    }
    fetchEditsWhereNeeded() {
      var e = arguments, n = this;
      return me(function* () {
        var r, i = (r = n.client.canSupport.get($o.RelationsRecursion)) !== null && r !== void 0 ? r : Ho.Unsupported;
        if (i === Ho.Unsupported) {
          for (var a = e.length, s = new Array(a), l = 0; l < a; l++) s[l] = e[l];
          return Promise.all(s.filter(nxe).map((function() {
            var c = me(function* (d) {
              try {
                var u = yield n.client.relations(n.roomId, d.getId(), Xn.Replace, d.getType(), {
                  limit: 1
                });
                if (u.events.length) {
                  var h = u.events[0];
                  d.makeReplaced(h), n.insertEventIntoTimeline(h);
                }
              } catch (f) {
                _e.error("Failed to load edits for encrypted thread event", f);
              }
            });
            return function(d) {
              return c.apply(this, arguments);
            };
          })()));
        }
      })();
    }
    setEventMetadata(e) {
      e && (en.setEventMetadata(e, this.roomState, false), e.setThread(this));
    }
    clearEventMetadata(e) {
      if (e) {
        var n;
        e.setThread(void 0), (n = e.event) === null || n === void 0 || (n = n.unsigned) === null || n === void 0 || (n = n["m.relations"]) === null || n === void 0 || delete n[pi.name];
      }
    }
    findEventById(e) {
      return this.timelineSet.findEventById(e);
    }
    lastReply() {
      for (var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : (i) => i.isRelation(pi.name), n = this.timeline.length - 1; n >= 0; n--) {
        var r = this.timeline[n];
        if (e(r)) return r;
      }
      return null;
    }
    get roomId() {
      return this.room.roomId;
    }
    get length() {
      return this.replyCount + this.pendingReplyCount;
    }
    get replyToEvent() {
      var e, n;
      return (e = (n = this.lastPendingEvent) !== null && n !== void 0 ? n : this.lastEvent) !== null && e !== void 0 ? e : this.lastReply();
    }
    get timeline() {
      return this.events;
    }
    get events() {
      return this.liveTimeline.getEvents();
    }
    has(e) {
      return this.timelineSet.findEventById(e) instanceof to;
    }
    get hasCurrentUserParticipated() {
      return this._currentUserParticipated;
    }
    get liveTimeline() {
      return this.timelineSet.getLiveTimeline();
    }
    getUnfilteredTimelineSet() {
      return this.timelineSet;
    }
    addReceipt(e, n) {
      throw new Error("Unsupported function on the thread model");
    }
    getEventReadUpTo(e, n) {
      var r = e === this.client.getUserId(), i = this.timeline[this.timeline.length - 1];
      if (r && i) {
        var a = i.getTs() < this.room.getOldestThreadedReceiptTs(), s = i.getId();
        if (a && s) return s;
      }
      var l = super.getEventReadUpTo(e, n);
      if (i) {
        var c = this.room.getLastUnthreadedReceiptFor(e);
        if (!c) return l;
        for (var d = ((u = this.timeline) === null || u === void 0 ? void 0 : u.length) - 1; d >= 0; --d) {
          var u, h, f = this.timeline[d];
          if (f.getId() === l) return l;
          if (f.getTs() < c.ts) return (h = f.getId()) !== null && h !== void 0 ? h : l;
        }
      }
      return l;
    }
    hasUserReadEvent(e, n) {
      if (e === this.client.getUserId()) {
        var r, i, a, s, l, c, d = ((r = (i = this.lastReply()) === null || i === void 0 ? void 0 : i.getTs()) !== null && r !== void 0 ? r : 0) < this.room.getOldestThreadedReceiptTs(), u = (a = (s = this.room.getLastUnthreadedReceiptFor(e)) === null || s === void 0 ? void 0 : s.ts) !== null && a !== void 0 ? a : 0, h = ((l = this === null || this === void 0 || (c = this.lastReply()) === null || c === void 0 ? void 0 : c.getTs()) !== null && l !== void 0 ? l : 0) < u;
        if (d || h) return true;
      }
      return this.room.hasUserReadEvent(e, n);
    }
    setUnread(e, n) {
      return this.room.setThreadUnreadNotificationCount(this.id, e, n);
    }
    getLastUnthreadedReceiptFor(e) {
      return this.room.getLastUnthreadedReceiptFor(e);
    }
  }
  $(Ei, "hasServerSideSupport", Pa.None);
  $(Ei, "hasServerSideListSupport", Pa.None);
  $(Ei, "hasServerSideFwdPaginationSupport", Pa.None);
  function nxe(t) {
    return t.isEncrypted() && (t.isRelation(pi.name) || t.isThreadRoot);
  }
  var o1 = new ik("related_by_senders", "io.element.relation_senders"), a1 = new ik("related_by_rel_types", "io.element.relation_types"), pi = new ik("m.thread", "io.element.thread"), xc = (function(t) {
    return t[t.My = 0] = "My", t[t.All = 1] = "All", t;
  })({});
  function vne(t) {
    return t === xc.My ? "participated" : "all";
  }
  rH = class extends Error {
    constructor(e, n, r) {
      super(n), this.code = e, $(this, "detailedString", void 0), this.name = "DecryptionError", this.detailedString = rxe(this, r);
    }
  };
  function rxe(t, e) {
    var n = t.name + "[msg: " + t.message;
    return e && (n += ", " + Object.keys(e).map((r) => r + ": " + e[r]).join(", ")), n += "]", n;
  }
  iH = (function(t) {
    return t.Change = "change", t;
  })({});
  hu = (function(t) {
    return t[t.Unsent = 1] = "Unsent", t[t.Requested = 2] = "Requested", t[t.Ready = 3] = "Ready", t[t.Started = 4] = "Started", t[t.Cancelled = 5] = "Cancelled", t[t.Done = 6] = "Done", t;
  })({});
  GC = (function(t) {
    return t.Cancel = "cancel", t.ShowSas = "show_sas", t.ShowReciprocateQr = "show_reciprocate_qr", t;
  })({});
  function ixe(t) {
    if (t.length >= 255) throw new TypeError("Alphabet too long");
    const e = new Uint8Array(256);
    for (let d = 0; d < e.length; d++) e[d] = 255;
    for (let d = 0; d < t.length; d++) {
      const u = t.charAt(d), h = u.charCodeAt(0);
      if (e[h] !== 255) throw new TypeError(u + " is ambiguous");
      e[h] = d;
    }
    const n = t.length, r = t.charAt(0), i = Math.log(n) / Math.log(256), a = Math.log(256) / Math.log(n);
    function s(d) {
      if (d instanceof Uint8Array || (ArrayBuffer.isView(d) ? d = new Uint8Array(d.buffer, d.byteOffset, d.byteLength) : Array.isArray(d) && (d = Uint8Array.from(d))), !(d instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
      if (d.length === 0) return "";
      let u = 0, h = 0, f = 0;
      const g = d.length;
      for (; f !== g && d[f] === 0; ) f++, u++;
      const m = (g - f) * a + 1 >>> 0, v = new Uint8Array(m);
      for (; f !== g; ) {
        let b = d[f], j = 0;
        for (let k = m - 1; (b !== 0 || j < h) && k !== -1; k--, j++) b += 256 * v[k] >>> 0, v[k] = b % n >>> 0, b = b / n >>> 0;
        if (b !== 0) throw new Error("Non-zero carry");
        h = j, f++;
      }
      let y = m - h;
      for (; y !== m && v[y] === 0; ) y++;
      let w = r.repeat(u);
      for (; y < m; ++y) w += t.charAt(v[y]);
      return w;
    }
    function l(d) {
      if (typeof d != "string") throw new TypeError("Expected String");
      if (d.length === 0) return new Uint8Array();
      let u = 0, h = 0, f = 0;
      for (; d[u] === r; ) h++, u++;
      const g = (d.length - u) * i + 1 >>> 0, m = new Uint8Array(g);
      for (; u < d.length; ) {
        const b = d.charCodeAt(u);
        if (b > 255) return;
        let j = e[b];
        if (j === 255) return;
        let k = 0;
        for (let C = g - 1; (j !== 0 || k < f) && C !== -1; C--, k++) j += n * m[C] >>> 0, m[C] = j % 256 >>> 0, j = j / 256 >>> 0;
        if (j !== 0) throw new Error("Non-zero carry");
        f = k, u++;
      }
      let v = g - f;
      for (; v !== g && m[v] === 0; ) v++;
      const y = new Uint8Array(h + (g - v));
      let w = h;
      for (; v !== g; ) y[w++] = m[v++];
      return y;
    }
    function c(d) {
      const u = l(d);
      if (u) return u;
      throw new Error("Non-base" + n + " character");
    }
    return {
      encode: s,
      decodeUnsafe: l,
      decode: c
    };
  }
  var oxe = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
  const _ne = ixe(oxe);
  var uf = [
    139,
    1
  ], oH = 32;
  Ngt = function(t) {
    var e, n = new Uint8Array(uf.length + t.length + 1);
    n.set(uf, 0), n.set(t, uf.length);
    for (var r = 0, i = 0; i < n.length - 1; ++i) r ^= n[i];
    n[n.length - 1] = r;
    var a = _ne.encode(n);
    return (e = a.match(/.{1,4}/g)) === null || e === void 0 ? void 0 : e.join(" ");
  };
  function axe(t) {
    var e = _ne.decode(t.replace(/ /g, "")), n = 0;
    for (var r of e) n ^= r;
    if (n !== 0) throw new Error("Incorrect parity");
    for (var i = 0; i < uf.length; ++i) if (e[i] !== uf[i]) throw new Error("Incorrect prefix");
    if (e.length !== uf.length + oH + 1) throw new Error("Incorrect length");
    return Uint8Array.from(e.slice(uf.length, uf.length + oH));
  }
  var sxe = 256;
  lxe = function(t, e, n) {
    return YR.apply(this, arguments);
  };
  function YR() {
    return YR = me(function* (t, e, n) {
      var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : sxe;
      if (!globalThis.crypto.subtle || !TextEncoder) throw new Error("Password-based backup is not available on this platform");
      var i = yield globalThis.crypto.subtle.importKey("raw", new TextEncoder().encode(t), {
        name: "PBKDF2"
      }, false, [
        "deriveBits"
      ]), a = yield globalThis.crypto.subtle.deriveBits({
        name: "PBKDF2",
        salt: new TextEncoder().encode(e),
        iterations: n,
        hash: "SHA-512"
      }, i, r);
      return new Uint8Array(a);
    }), YR.apply(this, arguments);
  }
  oi = (function(t) {
    return t.UserTrustStatusChanged = "userTrustStatusChanged", t.KeyBackupStatus = "crypto.keyBackupStatus", t.KeyBackupFailed = "crypto.keyBackupFailed", t.KeyBackupSessionsRemaining = "crypto.keyBackupSessionsRemaining", t.KeyBackupDecryptionKeyCached = "crypto.keyBackupDecryptionKeyCached", t.VerificationRequestReceived = "crypto.verificationRequestReceived", t.WillUpdateDevices = "crypto.willUpdateDevices", t.DevicesUpdated = "crypto.devicesUpdated", t.KeysChanged = "crossSigning.keysChanged", t.LegacyCryptoStoreMigrationProgress = "crypto.legacyCryptoStoreMigrationProgress", t.DehydratedDeviceCreated = "dehydration.DehydratedDeviceCreated", t.DehydratedDeviceUploaded = "dehydration.DehydratedDeviceUploaded", t.RehydrationStarted = "dehydration.RehydrationStarted", t.RehydrationProgress = "dehydration.RehydrationProgress", t.RehydrationCompleted = "dehydration.RehydrationCompleted", t.RehydrationError = "dehydration.RehydrationError", t.DehydrationKeyCached = "dehydration.DehydrationKeyCached", t.DehydratedDeviceRotationError = "dehydration.DehydratedDeviceRotationError", t;
  })({});
  cxe = (function(t) {
    return t.MEGOLM_UNKNOWN_INBOUND_SESSION_ID = "MEGOLM_UNKNOWN_INBOUND_SESSION_ID", t.MEGOLM_KEY_WITHHELD = "MEGOLM_KEY_WITHHELD", t.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE = "MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE", t.OLM_UNKNOWN_MESSAGE_INDEX = "OLM_UNKNOWN_MESSAGE_INDEX", t.HISTORICAL_MESSAGE_NO_KEY_BACKUP = "HISTORICAL_MESSAGE_NO_KEY_BACKUP", t.HISTORICAL_MESSAGE_BACKUP_UNCONFIGURED = "HISTORICAL_MESSAGE_BACKUP_UNCONFIGURED", t.HISTORICAL_MESSAGE_WORKING_BACKUP = "HISTORICAL_MESSAGE_WORKING_BACKUP", t.HISTORICAL_MESSAGE_USER_NOT_JOINED = "HISTORICAL_MESSAGE_USER_NOT_JOINED", t.SENDER_IDENTITY_PREVIOUSLY_VERIFIED = "SENDER_IDENTITY_PREVIOUSLY_VERIFIED", t.UNSIGNED_SENDER_DEVICE = "UNSIGNED_SENDER_DEVICE", t.UNKNOWN_SENDER_DEVICE = "UNKNOWN_SENDER_DEVICE", t.UNKNOWN_ERROR = "UNKNOWN_ERROR", t;
  })({});
  dxe = (function(t) {
    return t[t.AllDevicesIsolationMode = 0] = "AllDevicesIsolationMode", t[t.OnlySignedDevicesIsolationMode = 1] = "OnlySignedDevicesIsolationMode", t;
  })({});
  zgt = class {
    constructor(e) {
      this.errorOnVerifiedUserProblems = e, $(this, "kind", dxe.AllDevicesIsolationMode);
    }
  };
  Ugt = class {
    constructor(e, n, r) {
      var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
      this.crossSigningVerified = e, this.crossSigningVerifiedBefore = n, this.tofu = r, $(this, "needsUserApproval", void 0), this.needsUserApproval = i;
    }
    isVerified() {
      return this.isCrossSigningVerified();
    }
    isCrossSigningVerified() {
      return this.crossSigningVerified;
    }
    wasCrossSigningVerified() {
      return this.crossSigningVerifiedBefore;
    }
    isTofu() {
      return this.tofu;
    }
  };
  Vgt = class {
    constructor(e) {
      var n, r, i, a, s;
      $(this, "signedByOwner", void 0), $(this, "crossSigningVerified", void 0), $(this, "tofu", void 0), $(this, "localVerified", void 0), $(this, "trustCrossSignedDevices", void 0), this.signedByOwner = (n = e.signedByOwner) !== null && n !== void 0 ? n : false, this.crossSigningVerified = (r = e.crossSigningVerified) !== null && r !== void 0 ? r : false, this.tofu = (i = e.tofu) !== null && i !== void 0 ? i : false, this.localVerified = (a = e.localVerified) !== null && a !== void 0 ? a : false, this.trustCrossSignedDevices = (s = e.trustCrossSignedDevices) !== null && s !== void 0 ? s : false;
    }
    isVerified() {
      return this.localVerified || this.trustCrossSignedDevices && this.crossSigningVerified;
    }
  };
  let Vn, sH;
  aH = (function(t) {
    return t.Fetch = "fetch", t.LoadKeys = "load_keys", t;
  })({});
  $gt = (function(t) {
    return t.Master = "master", t.SelfSigning = "self_signing", t.UserSigning = "user_signing", t;
  })({});
  Wgt = (function(t) {
    return t[t.NONE = 0] = "NONE", t[t.GREY = 1] = "GREY", t[t.RED = 2] = "RED", t;
  })({});
  qgt = (function(t) {
    return t[t.UNKNOWN = 0] = "UNKNOWN", t[t.UNVERIFIED_IDENTITY = 1] = "UNVERIFIED_IDENTITY", t[t.UNSIGNED_DEVICE = 2] = "UNSIGNED_DEVICE", t[t.UNKNOWN_DEVICE = 3] = "UNKNOWN_DEVICE", t[t.AUTHENTICITY_NOT_GUARANTEED = 4] = "AUTHENTICITY_NOT_GUARANTEED", t[t.MISMATCHED_SENDER_KEY = 5] = "MISMATCHED_SENDER_KEY", t[t.SENT_IN_CLEAR = 6] = "SENT_IN_CLEAR", t[t.VERIFICATION_VIOLATION = 7] = "VERIFICATION_VIOLATION", t[t.MISMATCHED_SENDER = 8] = "MISMATCHED_SENDER", t;
  })({});
  Vn = (function(t) {
    return t.NOT_SENT = "not_sent", t.ENCRYPTING = "encrypting", t.SENDING = "sending", t.QUEUED = "queued", t.SENT = "sent", t.CANCELLED = "cancelled", t;
  })({});
  sH = Object.freeze({
    visible: true
  });
  or = (function(t) {
    return t.Decrypted = "Event.decrypted", t.BeforeRedaction = "Event.beforeRedaction", t.VisibilityChange = "Event.visibilityChange", t.LocalEventIdReplaced = "Event.localEventIdReplaced", t.Status = "Event.status", t.Replaced = "Event.replaced", t.RelationsCreated = "Event.relationsCreated", t.SentinelUpdated = "Event.sentinelUpdated", t;
  })({});
  class to extends ji {
    setMetadata(e, n) {
      var r, i, a = this.isState() && this.getType() === ce.RoomMember && this.getSender() === this.getStateKey(), s = false;
      if (a || !((r = this.sender) !== null && r !== void 0 && (r = r.events) !== null && r !== void 0 && r.member)) {
        var l = e.getSentinelMember(this.getSender());
        l !== this.sender && (s = true), this.sender = l;
      }
      if (a || !((i = this.target) !== null && i !== void 0 && (i = i.events) !== null && i !== void 0 && i.member) && this.getType() === ce.RoomMember) {
        var c = e.getSentinelMember(this.getStateKey());
        c !== this.target && (s = true), this.target = c;
      }
      this.isState() && n && (this.forwardLooking = false), s && this.emit(or.SentinelUpdated);
    }
    constructor() {
      var e, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      super(), this.event = n, $(this, "pushDetails", {}), $(this, "_replacingEvent", null), $(this, "_localRedactionEvent", null), $(this, "_isCancelled", false), $(this, "clearEvent", void 0), $(this, "visibility", sH), $(this, "_hasCachedExtEv", false), $(this, "_cachedExtEv", void 0), $(this, "_decryptionFailureReason", null), $(this, "senderCurve25519Key", null), $(this, "claimedEd25519Key", null), $(this, "forwardingCurve25519KeyChain", []), $(this, "untrusted", null), $(this, "decryptionPromise", null), $(this, "retryDecryption", false), $(this, "txnId", void 0), $(this, "thread", void 0), $(this, "threadId", void 0), $(this, "localTimestamp", void 0), $(this, "sender", null), $(this, "target", null), $(this, "status", null), $(this, "error", null), $(this, "forwardLooking", true), $(this, "reEmitter", void 0), [
        "state_key",
        "type",
        "sender",
        "room_id",
        "membership"
      ].forEach((i) => {
        typeof n[i] == "string" && (n[i] = qj(n[i]));
      }), [
        "membership",
        "avatar_url",
        "displayname"
      ].forEach((i) => {
        var a;
        typeof ((a = n.content) === null || a === void 0 ? void 0 : a[i]) == "string" && (n.content[i] = qj(n.content[i]));
      }), [
        "rel_type"
      ].forEach((i) => {
        var a;
        typeof ((a = n.content) === null || a === void 0 || (a = a["m.relates_to"]) === null || a === void 0 ? void 0 : a[i]) == "string" && (n.content["m.relates_to"][i] = qj(n.content["m.relates_to"][i]));
      }), this.txnId = n.txn_id;
      var r = this.getAge();
      this.localTimestamp = r !== void 0 ? Date.now() - r : (e = this.getTs()) !== null && e !== void 0 ? e : Date.now(), this.reEmitter = new IF(this);
    }
    get unstableExtensibleEvent() {
      return this._hasCachedExtEv || (this._cachedExtEv = Os.ExtensibleEvents.parse(this.getEffectiveEvent())), this._cachedExtEv;
    }
    invalidateExtensibleEvent() {
      this._hasCachedExtEv = false;
    }
    getEffectiveEvent() {
      var e = Object.assign({}, this.getContent());
      if (this.getWireType() === ce.RoomMessageEncrypted) for (var [n, r] of Object.entries(this.getWireContent())) [
        "algorithm",
        "ciphertext",
        "device_id",
        "sender_key",
        "session_id"
      ].includes(n) || e[n] === void 0 && (e[n] = r);
      return Object.assign({}, this.event, this.clearEvent, {
        content: e
      });
    }
    getId() {
      return this.event.event_id;
    }
    getSender() {
      return this.event.sender;
    }
    getType() {
      return this.clearEvent ? this.clearEvent.type : this.event.type;
    }
    getWireType() {
      return this.event.type;
    }
    getRoomId() {
      return this.event.room_id;
    }
    getTs() {
      return this.event.origin_server_ts;
    }
    getDate() {
      return this.event.origin_server_ts ? new Date(this.event.origin_server_ts) : null;
    }
    getDetails() {
      var e = this.getRoomId();
      if (e) {
        var n;
        return "id=".concat(this.getId(), " type=").concat(this.getWireType(), " sender=").concat(this.getSender(), " room=").concat(e, " ts=").concat((n = this.getDate()) === null || n === void 0 ? void 0 : n.toISOString());
      } else {
        var r = this.getContent()[ok];
        return "msgid=".concat(r, " type=").concat(this.getWireType(), " sender=").concat(this.getSender());
      }
    }
    getOriginalContent() {
      var e;
      if (this._localRedactionEvent) return {};
      if (this.clearEvent) {
        var n;
        return (n = this.clearEvent.content) !== null && n !== void 0 ? n : {};
      }
      return (e = this.event.content) !== null && e !== void 0 ? e : {};
    }
    getContent() {
      if (this._localRedactionEvent) return {};
      if (this._replacingEvent) {
        var e;
        return (e = this._replacingEvent.getContent()["m.new_content"]) !== null && e !== void 0 ? e : {};
      } else return this.getOriginalContent();
    }
    getWireContent() {
      return this.event.content || {};
    }
    get threadRootId() {
      var e;
      if (!this.isState()) {
        var n = (e = this.getWireContent()) === null || e === void 0 ? void 0 : e["m.relates_to"];
        if ((n == null ? void 0 : n.rel_type) === pi.name) return n.event_id;
        if (this.thread) return this.thread.id;
        if (this.threadId !== void 0) return this.threadId;
        var r = this.getUnsigned();
        if (typeof r[KC.name] == "string") return r[KC.name];
      }
    }
    get isThreadRoot() {
      if (this.isState()) return false;
      var e = this.getServerAggregatedRelation(pi.name);
      return !!e || this.threadRootId === this.getId();
    }
    get replyEventId() {
      var e;
      return (e = this.getWireContent()["m.relates_to"]) === null || e === void 0 || (e = e["m.in_reply_to"]) === null || e === void 0 ? void 0 : e.event_id;
    }
    get relationEventId() {
      var e;
      return (e = this.getWireContent()) === null || e === void 0 || (e = e["m.relates_to"]) === null || e === void 0 ? void 0 : e.event_id;
    }
    getPrevContent() {
      return this.getUnsigned().prev_content || {};
    }
    getDirectionalContent() {
      return this.forwardLooking ? this.getContent() : this.getPrevContent();
    }
    getAge() {
      return this.getUnsigned().age;
    }
    getLocalAge() {
      return Date.now() - this.localTimestamp;
    }
    getStateKey() {
      return this.clearEvent ? this.clearEvent.state_key : this.event.state_key;
    }
    getWireStateKey() {
      return this.event.state_key;
    }
    isState() {
      return this.event.state_key !== void 0;
    }
    getMembershipAtEvent() {
      var e = this.getUnsigned();
      return mne.findIn(e);
    }
    makeEncrypted(e, n, r, i) {
      this.clearEvent = {
        type: this.event.type,
        content: this.event.content,
        state_key: this.event.state_key
      }, this.event.type = e, this.event.content = n, this.senderCurve25519Key = r, this.claimedEd25519Key = i, this.isState() && (this.event.state_key = "".concat(this.clearEvent.type, ":").concat(this.clearEvent.state_key));
    }
    isBeingDecrypted() {
      return this.decryptionPromise != null;
    }
    getDecryptionPromise() {
      return this.decryptionPromise;
    }
    isDecryptionFailure() {
      return this._decryptionFailureReason !== null;
    }
    get decryptionFailureReason() {
      return this._decryptionFailureReason;
    }
    shouldAttemptDecryption() {
      return !(this.isRedacted() || this.isBeingDecrypted() || this.clearEvent || !this.isEncrypted());
    }
    attemptDecryption(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : {};
        if (!r.isEncrypted()) throw new Error("Attempt to decrypt event which isn't encrypted");
        var a = r.clearEvent && !r.isDecryptionFailure(), s = i.forceRedecryptIfUntrusted && r.isKeySourceUntrusted();
        if (a && !s) throw new Error("Attempt to decrypt event which has already been decrypted");
        return r.decryptionPromise ? (_e.log("Event ".concat(r.getId(), " already being decrypted; queueing a retry")), r.retryDecryption = true, r.decryptionPromise) : (r.decryptionPromise = r.decryptionLoop(e, i), r.decryptionPromise);
      })();
    }
    getKeyRequestRecipients(e) {
      var n = [
        {
          userId: e,
          deviceId: "*"
        }
      ];
      return n;
    }
    decryptionLoop(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : {};
        for (yield Promise.resolve(); ; ) {
          r.retryDecryption = false;
          var a = void 0;
          try {
            var s = yield e.decryptEvent(r);
            i.isRetry === true && _e.info("Decrypted event on retry (".concat(r.getDetails(), ")")), r.setClearData(s), r._decryptionFailureReason = null;
          } catch (c) {
            var l = c instanceof rH ? c.detailedString : String(c);
            if (a = c, r.retryDecryption) {
              _e.log("Error decrypting event (".concat(r.getDetails(), "), but retrying: ").concat(l));
              continue;
            }
            _e.warn("Error decrypting event (".concat(r.getDetails(), "): ").concat(l)), r.setClearDataForDecryptionFailure(String(c)), r._decryptionFailureReason = c instanceof rH ? c.code : cxe.UNKNOWN_ERROR;
          }
          r.decryptionPromise = null, r.retryDecryption = false, r.setPushDetails(), i.emit !== false && r.emit(or.Decrypted, r, a);
          return;
        }
      })();
    }
    setClearData(e) {
      var n, r;
      this.clearEvent = e.clearEvent, this.senderCurve25519Key = (n = e.senderCurve25519Key) !== null && n !== void 0 ? n : null, this.claimedEd25519Key = (r = e.claimedEd25519Key) !== null && r !== void 0 ? r : null, this.forwardingCurve25519KeyChain = e.forwardingCurve25519KeyChain || [], this.untrusted = e.untrusted || false, this.invalidateExtensibleEvent();
    }
    setClearDataForDecryptionFailure(e) {
      this.clearEvent = {
        type: ce.RoomMessage,
        content: {
          msgtype: "m.bad.encrypted",
          body: "** Unable to decrypt: ".concat(e, " **")
        }
      }, this.senderCurve25519Key = null, this.claimedEd25519Key = null, this.forwardingCurve25519KeyChain = [], this.untrusted = false, this.invalidateExtensibleEvent();
    }
    getClearContent() {
      return this.clearEvent ? this.clearEvent.content : null;
    }
    isEncrypted() {
      return this.event.type === ce.RoomMessageEncrypted;
    }
    getSenderKey() {
      return this.senderCurve25519Key;
    }
    getKeysClaimed() {
      return this.claimedEd25519Key ? {
        ed25519: this.claimedEd25519Key
      } : {};
    }
    getClaimedEd25519Key() {
      return this.claimedEd25519Key;
    }
    getForwardingCurve25519KeyChain() {
      return this.forwardingCurve25519KeyChain;
    }
    isKeySourceUntrusted() {
      return !!this.untrusted;
    }
    getUnsigned() {
      return this.event.unsigned || {};
    }
    setUnsigned(e) {
      this.event.unsigned = e;
    }
    unmarkLocallyRedacted() {
      var e = this._localRedactionEvent;
      return this._localRedactionEvent = null, this.event.unsigned && (this.event.unsigned.redacted_because = void 0), !!e;
    }
    markLocallyRedacted(e) {
      this._localRedactionEvent || (this.emit(or.BeforeRedaction, this, e), this._localRedactionEvent = e, this.event.unsigned || (this.event.unsigned = {}), this.event.unsigned.redacted_because = e.event);
    }
    applyVisibilityEvent(e) {
      var n, r, i = (n = e == null ? void 0 : e.visible) !== null && n !== void 0 ? n : true, a = (r = e == null ? void 0 : e.reason) !== null && r !== void 0 ? r : null, s = false;
      (this.visibility.visible !== i || !this.visibility.visible && this.visibility.reason !== a) && (s = true), s && (i ? this.visibility = sH : this.visibility = Object.freeze({
        visible: false,
        reason: a
      }), this.emit(or.VisibilityChange, this, i));
    }
    messageVisibility() {
      return this.visibility;
    }
    makeRedacted(e, n) {
      if (!e.event) throw new Error("invalid redactionEvent in makeRedacted");
      this._localRedactionEvent = null, this.emit(or.BeforeRedaction, this, e), this._replacingEvent = null, this.event.unsigned || (this.event.unsigned = {}), this.event.unsigned.redacted_because = e.event;
      for (var r in this.event) this.event.hasOwnProperty(r) && !uxe.has(r) && delete this.event[r];
      this.isEncrypted() && (this.clearEvent = void 0);
      var i = this.getType() in lH ? lH[this.getType()] : {}, a = this.getContent();
      for (var s in a) a.hasOwnProperty(s) && !i[s] && delete a[s];
      !this.isThreadRoot && this.threadRootId && this.threadRootId !== this.getId() && (this.moveAllRelatedToMainTimeline(n), e.moveToMainTimeline(n)), this.invalidateExtensibleEvent();
    }
    moveAllRelatedToMainTimeline(e) {
      var n = this.thread;
      if (this.moveToMainTimeline(e), n) for (var r of n.events) {
        var i;
        ((i = r.getRelation()) === null || i === void 0 ? void 0 : i.event_id) === this.getId() && r.moveAllRelatedToMainTimeline(e);
      }
    }
    moveToMainTimeline(e) {
      var n;
      (n = this.thread) === null || n === void 0 || n.timelineSet.removeEvent(this.getId()), this.setThread(void 0);
      var r = e.getLiveTimeline();
      r.getTimelineSet().insertEventIntoTimeline(this, r, r.getState(en.FORWARDS), false);
    }
    isRedacted() {
      return !!this.getUnsigned().redacted_because;
    }
    isRedaction() {
      return this.getType() === ce.RoomRedaction;
    }
    asVisibilityChange() {
      if (!ug.matches(this.getType())) return null;
      var e = this.getRelation();
      if (!e || e.rel_type != "m.reference") return null;
      var n = e.event_id;
      if (!n) return null;
      var r = this.getWireContent(), i = !!r.visible, a = r.reason;
      return a && typeof a != "string" ? null : {
        visible: i,
        reason: a,
        eventId: n
      };
    }
    isVisibilityEvent() {
      return ug.matches(this.getType());
    }
    getRedactionEvent() {
      var e, n;
      if (!this.isRedacted()) return null;
      if ((e = this.clearEvent) !== null && e !== void 0 && e.unsigned) {
        var r, i;
        return (r = (i = this.clearEvent) === null || i === void 0 ? void 0 : i.unsigned.redacted_because) !== null && r !== void 0 ? r : null;
      } else return (n = this.event.unsigned) !== null && n !== void 0 && n.redacted_because ? this.event.unsigned.redacted_because : {};
    }
    getPushActions() {
      return this.pushDetails.actions || null;
    }
    getPushDetails() {
      return this.pushDetails;
    }
    setPushDetails(e, n) {
      this.pushDetails = {
        actions: e,
        rule: n
      };
    }
    handleRemoteEcho(e) {
      var n, r = this.getUnsigned(), i = this.getId();
      this.event = e, r.redacted_because && (this.event.unsigned || (this.event.unsigned = {}), this.event.unsigned.redacted_because = r.redacted_because), this.setStatus(null), this.getId() !== i && this.emit(or.LocalEventIdReplaced, this), this.localTimestamp = Date.now() - ((n = this.getAge()) !== null && n !== void 0 ? n : 0);
    }
    isSending() {
      return !!this.status;
    }
    setStatus(e) {
      this.status = e, this.emit(or.Status, this, e);
    }
    replaceLocalEventId(e) {
      this.event.event_id = e, this.emit(or.LocalEventIdReplaced, this);
    }
    isRelation(e) {
      var n, r = (n = this.getWireContent()) === null || n === void 0 ? void 0 : n["m.relates_to"];
      return this.isState() && (r != null && r.rel_type) && [
        Xn.Replace,
        Xn.Thread
      ].includes(r.rel_type) ? false : !!(r != null && r.rel_type && r.event_id && (!e || r.rel_type === e));
    }
    getRelation() {
      var e;
      return this.isRelation() && (e = this.getWireContent()["m.relates_to"]) !== null && e !== void 0 ? e : null;
    }
    makeReplaced(e) {
      this.isRedacted() && e || this.isState() || this._replacingEvent !== e && (this._replacingEvent = e ?? null, this.emit(or.Replaced, this), this.invalidateExtensibleEvent());
    }
    getAssociatedStatus() {
      return this._replacingEvent ? this._replacingEvent.status : this._localRedactionEvent ? this._localRedactionEvent.status : this.status;
    }
    getServerAggregatedRelation(e) {
      var n;
      return (n = this.getUnsigned()["m.relations"]) === null || n === void 0 ? void 0 : n[e];
    }
    replacingEventId() {
      var e = this.getServerAggregatedRelation(Xn.Replace);
      if (e) return e.event_id;
      if (this._replacingEvent) return this._replacingEvent.getId();
    }
    replacingEvent() {
      return this._replacingEvent;
    }
    replacingEventDate() {
      var e = this.getServerAggregatedRelation(Xn.Replace);
      if (e) {
        var n = e.origin_server_ts;
        if (Number.isFinite(n)) return new Date(n);
      } else if (this._replacingEvent) {
        var r;
        return (r = this._replacingEvent.getDate()) !== null && r !== void 0 ? r : void 0;
      }
    }
    localRedactionEvent() {
      return this._localRedactionEvent;
    }
    getAssociatedId() {
      var e = this.getRelation();
      if (this.replyEventId) return this.replyEventId;
      if (e) return e.event_id;
      if (this.isRedaction()) return this.event.redacts;
    }
    hasAssociation() {
      return !!this.getAssociatedId();
    }
    updateAssociatedId(e) {
      var n = this.getRelation();
      n ? n.event_id = e : this.isRedaction() && (this.event.redacts = e);
    }
    flagCancelled() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
      this._isCancelled = e;
    }
    isCancelled() {
      return this._isCancelled;
    }
    toSnapshot() {
      var e = new to(JSON.parse(JSON.stringify(this.event)));
      for (var [n, r] of Object.entries(this)) n !== "event" && (e[n] = r);
      return e;
    }
    isEquivalentTo(e) {
      if (!e) return false;
      if (e === this) return true;
      var n = LR(this.event), r = LR(e.event);
      return JSON.stringify(n) === JSON.stringify(r);
    }
    toJSON() {
      var e = this.getEffectiveEvent();
      return this.isEncrypted() ? {
        decrypted: e,
        encrypted: this.event
      } : e;
    }
    setTxnId(e) {
      this.txnId = e;
    }
    getTxnId() {
      return this.txnId;
    }
    setThread(e) {
      this.isState() || (this.thread && this.reEmitter.stopReEmitting(this.thread, [
        jr.Update
      ]), this.thread = e, this.setThreadId(e == null ? void 0 : e.id), e && this.reEmitter.reEmit(e, [
        jr.Update
      ]));
    }
    getThread() {
      return this.thread;
    }
    setThreadId(e) {
      this.threadId = e;
    }
  }
  let uxe, lH, s1, Yb, kn, ak, j2;
  uxe = /* @__PURE__ */ new Set([
    "event_id",
    "type",
    "room_id",
    "user_id",
    "sender",
    "state_key",
    "prev_state",
    "content",
    "unsigned",
    "origin_server_ts"
  ]);
  lH = {
    [ce.RoomMember]: {
      membership: 1
    },
    [ce.RoomJoinRules]: {
      join_rule: 1
    },
    [ce.RoomPowerLevels]: {
      ban: 1,
      events: 1,
      events_default: 1,
      kick: 1,
      redact: 1,
      state_default: 1,
      users: 1,
      users_default: 1
    }
  };
  s1 = (function(t) {
    return t.Public = "public", t.Private = "private", t;
  })({});
  Yb = (function(t) {
    return t.PrivateChat = "private_chat", t.TrustedPrivateChat = "trusted_private_chat", t.PublicChat = "public_chat", t;
  })({});
  kn = (function(t) {
    return t.Public = "public", t.Invite = "invite", t.Private = "private", t.Knock = "knock", t.Restricted = "restricted", t;
  })({});
  ak = (function(t) {
    return t.RoomMembership = "m.room_membership", t;
  })({});
  j2 = (function(t) {
    return t.CanJoin = "can_join", t.Forbidden = "forbidden", t;
  })({});
  ll = (function(t) {
    return t.Invited = "invited", t.Joined = "joined", t.Shared = "shared", t.WorldReadable = "world_readable", t;
  })({});
  function YC(t) {
    return t != null;
  }
  var hxe = new Os.UnstableValue("m.message", "org.matrix.msc1767.message"), q7 = new Os.UnstableValue("m.text", "org.matrix.msc1767.text"), fxe = new Os.UnstableValue("m.html", "org.matrix.msc1767.html"), yne = new Os.NamespacedValue("m.reference");
  function mxe(t, e) {
    if (typeof t == "string") return typeof e == "string" ? e === t : e.matches(t);
    if (typeof e == "string") return t.matches(e);
    var n = e, r = t;
    return n.matches(r.name) || YC(r.altName) && n.matches(r.altName);
  }
  var K7 = new $b("m.topic");
  function cH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function gxe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? cH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : cH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function bne(t, e) {
    return {
      msgtype: Jn.Text,
      format: "org.matrix.custom.html",
      body: t,
      formatted_body: e
    };
  }
  function xne(t, e) {
    return {
      msgtype: Jn.Notice,
      format: "org.matrix.custom.html",
      body: t,
      formatted_body: e
    };
  }
  function wne(t, e) {
    return {
      msgtype: Jn.Emote,
      format: "org.matrix.custom.html",
      body: t,
      formatted_body: e
    };
  }
  function Dne(t) {
    return {
      msgtype: Jn.Text,
      body: t
    };
  }
  function Cne(t) {
    return {
      msgtype: Jn.Notice,
      body: t
    };
  }
  function Ene(t) {
    return {
      msgtype: Jn.Emote,
      body: t
    };
  }
  var kne = (t, e, n, r) => {
    var i = "at ".concat(new Date(n).toISOString()), a = e === N1.Self ? "User" : void 0, s = r ? '"'.concat(r, '"') : void 0;
    return [
      a,
      "Location",
      s,
      t,
      i
    ].filter(Boolean).join(" ");
  }, Sne = (t, e, n, r, i) => {
    var a = t ?? kne(e, i || N1.Self, n, r), s = n ? {
      [Yf.name]: n
    } : {};
    return gxe({
      msgtype: Jn.Location,
      body: a,
      geo_uri: e,
      [qb.name]: {
        description: r,
        uri: e
      },
      [Wb.name]: {
        type: i || N1.Self
      },
      [q7.name]: a
    }, s);
  }, pxe = (t) => {
    var e, n, r = qb.findIn(t), i = Wb.findIn(t), a = Yf.findIn(t), s = q7.findIn(t), l = (e = r == null ? void 0 : r.uri) !== null && e !== void 0 ? e : t == null ? void 0 : t.geo_uri, c = r == null ? void 0 : r.description, d = (n = i == null ? void 0 : i.type) !== null && n !== void 0 ? n : N1.Self, u = s ?? t.body;
    return Sne(u, l, a ?? void 0, c, d);
  }, jne = (t, e) => {
    var n = [];
    return YC(e) && n.push({
      body: e,
      mimetype: "text/html"
    }), YC(t) && n.push({
      body: t,
      mimetype: "text/plain"
    }), {
      topic: t,
      [K7.name]: {
        "m.text": n
      }
    };
  }, Fxe = (t) => {
    var e, n, r, i, a = K7.findIn(t), s = Array.isArray(a) ? a : a == null ? void 0 : a["m.text"];
    if (!Array.isArray(s)) {
      var l;
      return {
        text: (l = t.topic) !== null && l !== void 0 ? l : void 0
      };
    }
    var c = (e = (n = s == null || (r = s.find((u) => !YC(u.mimetype) || u.mimetype === "text/plain")) === null || r === void 0 ? void 0 : r.body) !== null && n !== void 0 ? n : t.topic) !== null && e !== void 0 ? e : void 0, d = s == null || (i = s.find((u) => u.mimetype === "text/html")) === null || i === void 0 ? void 0 : i.body;
    return {
      text: c,
      html: d
    };
  }, vxe = (t, e, n, r, i) => ({
    description: n,
    timeout: t,
    live: e,
    [Yf.name]: i || Date.now(),
    [Wb.name]: {
      type: r ?? N1.Self
    }
  }), Tne = (t) => {
    var e, { description: n, timeout: r, live: i } = t, a = (e = Yf.findIn(t)) !== null && e !== void 0 ? e : void 0, s = Wb.findIn(t);
    return {
      description: n,
      timeout: r,
      live: i,
      assetType: s == null ? void 0 : s.type,
      timestamp: a
    };
  }, _xe = (t, e, n, r) => ({
    [qb.name]: {
      description: r,
      uri: t
    },
    [Yf.name]: e,
    "m.relates_to": {
      rel_type: yne.name,
      event_id: n
    }
  }), ZR = (t) => {
    var e, n = qb.findIn(t), r = (e = Yf.findIn(t)) !== null && e !== void 0 ? e : void 0;
    return {
      description: n == null ? void 0 : n.description,
      uri: n == null ? void 0 : n.uri,
      timestamp: r
    };
  };
  const yxe = Object.freeze(Object.defineProperty({
    __proto__: null,
    getTextForLocationEvent: kne,
    makeBeaconContent: _xe,
    makeBeaconInfoContent: vxe,
    makeEmoteMessage: Ene,
    makeHtmlEmote: wne,
    makeHtmlMessage: bne,
    makeHtmlNotice: xne,
    makeLocationContent: Sne,
    makeNotice: Cne,
    makeTextMessage: Dne,
    makeTopicContent: jne,
    parseBeaconContent: ZR,
    parseBeaconInfoContent: Tne,
    parseLocationEvent: pxe,
    parseTopicContent: Fxe
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  var Ii = (function(t) {
    return t.New = "Beacon.new", t.Update = "Beacon.update", t.LivenessChange = "Beacon.LivenessChange", t.Destroy = "Beacon.Destroy", t.LocationUpdate = "Beacon.LocationUpdate", t;
  })({}), JR = (t, e, n) => n >= t && t + e >= n, ZC = (t) => "".concat(t.getRoomId(), "_").concat(t.getStateKey());
  class Rne extends ji {
    constructor(e) {
      super(), this.rootEvent = e, $(this, "roomId", void 0), $(this, "_beaconInfo", void 0), $(this, "_isLive", void 0), $(this, "livenessWatchTimeout", void 0), $(this, "_latestLocationEvent", void 0), $(this, "clearLatestLocation", () => {
        this._latestLocationEvent = void 0, this.emit(Ii.LocationUpdate, this.latestLocationState);
      }), this.roomId = this.rootEvent.getRoomId(), this.setBeaconInfo(this.rootEvent);
    }
    get isLive() {
      return !!this._isLive;
    }
    get identifier() {
      return ZC(this.rootEvent);
    }
    get beaconInfoId() {
      return this.rootEvent.getId();
    }
    get beaconInfoOwner() {
      return this.rootEvent.getStateKey();
    }
    get beaconInfoEventType() {
      return this.rootEvent.getType();
    }
    get beaconInfo() {
      return this._beaconInfo;
    }
    get latestLocationState() {
      return this._latestLocationEvent && ZR(this._latestLocationEvent.getContent());
    }
    get latestLocationEvent() {
      return this._latestLocationEvent;
    }
    update(e) {
      if (ZC(e) !== this.identifier) throw new Error("Invalid updating event");
      e.getTs() < this.rootEvent.getTs() || (this.rootEvent = e, this.setBeaconInfo(this.rootEvent), this.emit(Ii.Update, e, this), this.clearLatestLocation());
    }
    destroy() {
      this.livenessWatchTimeout && clearTimeout(this.livenessWatchTimeout), this._isLive = false, this.emit(Ii.Destroy, this.identifier);
    }
    monitorLiveness() {
      if (this.livenessWatchTimeout && clearTimeout(this.livenessWatchTimeout), this.checkLiveness(), !!this.beaconInfo) if (this.isLive) {
        var e = this.beaconInfo.timestamp + this.beaconInfo.timeout - Date.now();
        e > 1 && (this.livenessWatchTimeout = setTimeout(() => {
          this.monitorLiveness();
        }, e));
      } else this.beaconInfo.timestamp > Date.now() && (this.livenessWatchTimeout = setTimeout(() => {
        this.monitorLiveness();
      }, this.beaconInfo.timestamp - Date.now()));
    }
    addLocations(e) {
      var n;
      if (this.isLive) {
        var r = e.filter((a) => {
          var s = a.getContent(), l = ZR(s);
          if (!l.uri || !l.timestamp) return false;
          var { timestamp: c } = l;
          return this._beaconInfo.timestamp && JR(this._beaconInfo.timestamp, this._beaconInfo.timeout, c) && (!this.latestLocationState || c > this.latestLocationState.timestamp);
        }), i = (n = r.sort(H3e)) === null || n === void 0 ? void 0 : n[0];
        i && (this._latestLocationEvent = i, this.emit(Ii.LocationUpdate, this.latestLocationState));
      }
    }
    setBeaconInfo(e) {
      this._beaconInfo = Tne(e.getContent()), this.checkLiveness();
    }
    checkLiveness() {
      var e = this.isLive;
      if (this.beaconInfo) {
        var n = this.beaconInfo.timestamp > Date.now() ? this.beaconInfo.timestamp - 36e4 : this.beaconInfo.timestamp;
        this._isLive = !!this._beaconInfo.live && !!n && JR(n, this._beaconInfo.timeout, Date.now()), e !== this.isLive && this.emit(Ii.LivenessChange, this.isLive, this);
      }
    }
  }
  var G7 = new xo("m.beacon_info", "org.matrix.msc3672.beacon_info"), XR = new xo("m.beacon", "org.matrix.msc3672.beacon"), bxe = [
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "10",
    "11"
  ];
  function xxe(t) {
    return !bxe.includes(t);
  }
  var Ws = (function(t) {
    return t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t;
  })(Ws || {}), qn = (function(t) {
    return t.Events = "RoomState.events", t.Members = "RoomState.members", t.NewMember = "RoomState.newMember", t.Update = "RoomState.update", t.BeaconLiveness = "RoomState.BeaconLiveness", t.Marker = "RoomState.Marker", t;
  })({});
  class T2 extends ji {
    constructor(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        status: Ws.NotStarted
      };
      super(), this.roomId = e, this.oobMemberFlags = n, $(this, "reEmitter", new IF(this)), $(this, "sentinels", {}), $(this, "displayNameToUserIds", /* @__PURE__ */ new Map()), $(this, "userIdsToDisplayNames", {}), $(this, "tokenToInvite", {}), $(this, "joinedMemberCount", null), $(this, "summaryJoinedMemberCount", null), $(this, "invitedMemberCount", null), $(this, "summaryInvitedMemberCount", null), $(this, "modified", -1), $(this, "members", {}), $(this, "events", /* @__PURE__ */ new Map()), $(this, "paginationToken", null), $(this, "beacons", /* @__PURE__ */ new Map()), $(this, "_liveBeaconIds", []), $(this, "getVersionWarning", false), this.updateModifiedTime();
    }
    getRoomVersion() {
      var e, n = this.getStateEvents(ce.RoomCreate, "");
      return n ? (e = n.getContent().room_version) !== null && e !== void 0 ? e : "1" : (this.getVersionWarning || (_e.warn("[getVersion] Room " + this.roomId + " does not have an m.room.create event"), this.getVersionWarning = true), "1");
    }
    getJoinedMemberCount() {
      return this.summaryJoinedMemberCount !== null ? this.summaryJoinedMemberCount : (this.joinedMemberCount === null && (this.joinedMemberCount = this.getMembers().reduce((e, n) => n.membership === Ht.Join ? e + 1 : e, 0)), this.joinedMemberCount);
    }
    setJoinedMemberCount(e) {
      this.summaryJoinedMemberCount = e;
    }
    getInvitedMemberCount() {
      return this.summaryInvitedMemberCount !== null ? this.summaryInvitedMemberCount : (this.invitedMemberCount === null && (this.invitedMemberCount = this.getMembers().reduce((e, n) => n.membership === Ht.Invite ? e + 1 : e, 0)), this.invitedMemberCount);
    }
    setInvitedMemberCount(e) {
      this.summaryInvitedMemberCount = e;
    }
    getMembers() {
      return Object.values(this.members);
    }
    getMembersExcept(e) {
      return this.getMembers().filter((n) => !e.includes(n.userId));
    }
    getMember(e) {
      return this.members[e] || null;
    }
    getSentinelMember(e) {
      if (!e) return null;
      var n = this.sentinels[e];
      if (n === void 0) {
        n = new S2(this.roomId, e);
        var r = this.members[e];
        r != null && r.events.member && n.setMembershipEvent(r.events.member, this), this.sentinels[e] = n;
      }
      return n;
    }
    getStateEvents(e, n) {
      if (!this.events.has(e)) return n === void 0 ? [] : null;
      if (n === void 0) return Array.from(this.events.get(e).values());
      var r = this.events.get(e).get(n);
      return r || null;
    }
    get hasLiveBeacons() {
      var e;
      return !!((e = this.liveBeaconIds) !== null && e !== void 0 && e.length);
    }
    get liveBeaconIds() {
      return this._liveBeaconIds;
    }
    clone() {
      var e = new T2(this.roomId, this.oobMemberFlags), n = this.oobMemberFlags.status;
      return this.oobMemberFlags.status = Ws.NotStarted, Array.from(this.events.values()).forEach((r) => {
        e.setStateEvents(Array.from(r.values()));
      }), this.oobMemberFlags.status = n, this.summaryInvitedMemberCount !== null && e.setInvitedMemberCount(this.getInvitedMemberCount()), this.summaryJoinedMemberCount !== null && e.setJoinedMemberCount(this.getJoinedMemberCount()), this.oobMemberFlags.status == Ws.Finished && this.getMembers().forEach((r) => {
        if (r.isOutOfBand()) {
          var i;
          (i = e.getMember(r.userId)) === null || i === void 0 || i.markOutOfBand();
        }
      }), e;
    }
    setUnknownStateEvents(e) {
      var n = e.filter((r) => !this.events.has(r.getType()) || !this.events.get(r.getType()).has(r.getStateKey()));
      this.setStateEvents(n);
    }
    setStateEvents(e, n) {
      this.updateModifiedTime(), e.forEach((r) => {
        if (!(r.getRoomId() !== this.roomId || !r.isState())) {
          G7.matches(r.getType()) && this.setBeacon(r);
          var i = this.getStateEventMatching(r);
          if (this.setStateEvent(r), r.getType() === ce.RoomMember) {
            var a;
            this.updateDisplayNameCache(r.getStateKey(), (a = r.getContent().displayname) !== null && a !== void 0 ? a : ""), this.updateThirdPartyTokenCache(r);
          }
          this.emit(qn.Events, r, this, i);
        }
      }), this.onBeaconLivenessChange(), e.forEach((r) => {
        if (!(r.getRoomId() !== this.roomId || !r.isState())) if (r.getType() === ce.RoomMember) {
          var i = r.getStateKey();
          (r.getContent().membership === Ht.Leave || r.getContent().membership === Ht.Ban) && (r.getContent().avatar_url = r.getContent().avatar_url || r.getPrevContent().avatar_url, r.getContent().displayname = r.getContent().displayname || r.getPrevContent().displayname);
          var a = this.getOrCreateMember(i, r);
          a.setMembershipEvent(r, this), this.updateMember(a), this.emit(qn.Members, r, this, a);
        } else if (r.getType() === ce.RoomPowerLevels) {
          if (r.getStateKey() !== "") return;
          var s = Object.values(this.members), l = this.getStateEvents(ce.RoomCreate, ""), c = dH(this.getRoomVersion(), l);
          s.forEach((d) => {
            var u = d.getLastModifiedTime();
            if (l) {
              var h = uH(d.userId, r, c);
              d.setPowerLevel(h, r);
            }
            u !== d.getLastModifiedTime() && this.emit(qn.Members, r, this, d);
          }), this.sentinels = {};
        } else une.matches(r.getType()) && this.emit(qn.Marker, r, n);
      }), this.emit(qn.Update, this);
    }
    processBeaconEvents(e, n) {
      var r = this;
      return me(function* () {
        if (!(!e.length || !r.beacons.size)) {
          var i = [
            ...r.beacons.values()
          ].reduce((d, u) => (d[u.beaconInfoId] = u, d), {}), a = (d, u) => {
            if (XR.matches(u.getType())) {
              var h = i[d];
              h && h.addLocations([
                u
              ]);
            }
          }, s = function* (u) {
            var h, f = (h = u.getRelation()) === null || h === void 0 ? void 0 : h.event_id;
            if (!f || !i[f]) return {
              v: void 0
            };
            if (!XR.matches(u.getType()) && !u.isEncrypted()) return {
              v: void 0
            };
            try {
              yield n.decryptEventIfNeeded(u), a(f, u);
            } catch {
              u.isDecryptionFailure() && u.once(or.Decrypted, me(function* () {
                a(f, u);
              }));
            }
          }, l;
          for (var c of e) if (l = yield* s(c), l) return l.v;
        }
      })();
    }
    getOrCreateMember(e, n) {
      var r = this.members[e];
      return r || (r = new S2(this.roomId, e), this.members[e] = r, this.emit(qn.NewMember, n, this, r)), r;
    }
    setStateEvent(e) {
      this.events.has(e.getType()) || this.events.set(e.getType(), /* @__PURE__ */ new Map()), this.events.get(e.getType()).set(e.getStateKey(), e);
    }
    setBeacon(e) {
      var n = ZC(e);
      if (this.beacons.has(n)) {
        var r = this.beacons.get(n);
        if (e.isRedacted()) {
          var i;
          r.beaconInfoId === ((i = e.getRedactionEvent()) === null || i === void 0 ? void 0 : i.redacts) && (r.destroy(), this.beacons.delete(n));
          return;
        }
        return r.update(e);
      }
      if (!e.isRedacted()) {
        var a = new Rne(e);
        this.reEmitter.reEmit(a, [
          Ii.New,
          Ii.Update,
          Ii.Destroy,
          Ii.LivenessChange
        ]), this.emit(Ii.New, e, a), a.on(Ii.LivenessChange, this.onBeaconLivenessChange.bind(this)), a.on(Ii.Destroy, this.onBeaconLivenessChange.bind(this)), this.beacons.set(a.identifier, a);
      }
    }
    onBeaconLivenessChange() {
      this._liveBeaconIds = Array.from(this.beacons.values()).filter((e) => e.isLive).map((e) => e.identifier), this.emit(qn.BeaconLiveness, this, this.hasLiveBeacons);
    }
    getStateEventMatching(e) {
      var n, r;
      return (n = (r = this.events.get(e.getType())) === null || r === void 0 ? void 0 : r.get(e.getStateKey())) !== null && n !== void 0 ? n : null;
    }
    updateMember(e) {
      var n = this.getStateEvents(ce.RoomCreate, ""), r = this.getStateEvents(ce.RoomPowerLevels, "");
      if (r && n) {
        var i = uH(e.userId, r, dH(this.getRoomVersion(), n));
        e.setPowerLevel(i, r);
      }
      delete this.sentinels[e.userId], this.members[e.userId] = e, this.joinedMemberCount = null, this.invitedMemberCount = null;
    }
    needsOutOfBandMembers() {
      return this.oobMemberFlags.status === Ws.NotStarted;
    }
    outOfBandMembersReady() {
      return this.oobMemberFlags.status === Ws.Finished;
    }
    markOutOfBandMembersStarted() {
      this.oobMemberFlags.status === Ws.NotStarted && (this.oobMemberFlags.status = Ws.InProgress);
    }
    markOutOfBandMembersFailed() {
      this.oobMemberFlags.status === Ws.InProgress && (this.oobMemberFlags.status = Ws.NotStarted);
    }
    clearOutOfBandMembers() {
      var e = 0;
      Object.keys(this.members).forEach((n) => {
        var r = this.members[n];
        r.isOutOfBand() && (++e, delete this.members[n]);
      }), _e.log("LL: RoomState removed ".concat(e, " members...")), this.oobMemberFlags.status = Ws.NotStarted;
    }
    setOutOfBandMembers(e) {
      _e.log("LL: RoomState about to set ".concat(e.length, " OOB members ...")), this.oobMemberFlags.status === Ws.InProgress && (_e.log("LL: RoomState put in finished state ..."), this.oobMemberFlags.status = Ws.Finished, e.forEach((n) => this.setOutOfBandMember(n)), this.emit(qn.Update, this));
    }
    setOutOfBandMember(e) {
      if (e.getType() === ce.RoomMember) {
        var n = e.getStateKey(), r = this.getMember(n);
        if (!(r && !r.isOutOfBand())) {
          var i = this.getOrCreateMember(n, e);
          i.setMembershipEvent(e, this), i.markOutOfBand(), this.updateDisplayNameCache(i.userId, i.name), this.setStateEvent(e), this.updateMember(i), this.emit(qn.Members, e, this, i);
        }
      }
    }
    setTypingEvent(e) {
      Object.values(this.members).forEach(function(n) {
        n.setTypingEvent(e);
      });
    }
    getInviteForThreePidToken(e) {
      return this.tokenToInvite[e] || null;
    }
    updateModifiedTime() {
      this.modified = Date.now();
    }
    getLastModifiedTime() {
      return this.modified;
    }
    getUserIdsWithDisplayName(e) {
      var n;
      return (n = this.displayNameToUserIds.get(xg(e))) !== null && n !== void 0 ? n : [];
    }
    maySendRedactionForEvent(e, n) {
      var r = this.getMember(n);
      if (!r || r.membership === Ht.Leave || e.status || e.isRedacted()) return false;
      var i = this.maySendEvent(ce.RoomRedaction, n);
      return i ? e.getSender() === n ? true : this.hasSufficientPowerLevelFor("redact", r.powerLevel) : false;
    }
    hasSufficientPowerLevelFor(e, n) {
      var r = this.getStateEvents(ce.RoomPowerLevels, ""), i = {};
      r && (i = r.getContent());
      var a = 50;
      return GV(i[e]) && (a = i[e]), n >= a;
    }
    maySendMessage(e) {
      return this.maySendEventOfType(ce.RoomMessage, e, false);
    }
    maySendEvent(e, n) {
      return this.maySendEventOfType(e, n, false);
    }
    mayClientSendStateEvent(e, n) {
      return n.isGuest() || !n.credentials.userId ? false : this.maySendStateEvent(e, n.credentials.userId);
    }
    maySendStateEvent(e, n) {
      return this.maySendEventOfType(e, n, true);
    }
    maySendEventOfType(e, n, r) {
      var i, a = this.getStateEvents(ce.RoomPowerLevels, ""), s, l = {}, c = 0, d = 0;
      a && (s = a.getContent(), l = s.events || {}, Number.isSafeInteger(s.state_default) ? c = s.state_default : c = 50, Number.isSafeInteger(s.events_default) && (d = s.events_default));
      var u = r ? c : d;
      Number.isSafeInteger(l[e]) && (u = l[e]);
      var h = this.getMember(n), f = (i = h == null ? void 0 : h.powerLevel) !== null && i !== void 0 ? i : 0;
      return f >= u;
    }
    mayTriggerNotifOfType(e, n) {
      var r = this.getMember(n);
      if (!r) return false;
      var i = this.getStateEvents(ce.RoomPowerLevels, ""), a = 50;
      return i && i.getContent() && i.getContent().notifications && GV(i.getContent().notifications[e]) && (a = i.getContent().notifications[e]), r.powerLevel >= a;
    }
    getJoinRule() {
      var e, n = this.getStateEvents(ce.RoomJoinRules, ""), r = (e = n == null ? void 0 : n.getContent()) !== null && e !== void 0 ? e : {};
      return r.join_rule || kn.Invite;
    }
    getHistoryVisibility() {
      var e, n = this.getStateEvents(ce.RoomHistoryVisibility, ""), r = (e = n == null ? void 0 : n.getContent()) !== null && e !== void 0 ? e : {};
      return r.history_visibility || ll.Shared;
    }
    getGuestAccess() {
      var e, n = this.getStateEvents(ce.RoomGuestAccess, ""), r = (e = n == null ? void 0 : n.getContent()) !== null && e !== void 0 ? e : {};
      return r.guest_access || j2.Forbidden;
    }
    findPredecessor() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      if (e) {
        var n = this.getStateEvents(ce.RoomPredecessor, "");
        if (n) {
          var r = n.getContent(), i = r.predecessor_room_id, a = r.last_known_event_id;
          typeof a != "string" && (a = void 0);
          var s = r.via_servers;
          if (Array.isArray(s) || (s = void 0), typeof i == "string") return {
            roomId: i,
            eventId: a,
            viaServers: s
          };
        }
      }
      var l = this.getStateEvents(ce.RoomCreate, "");
      if (l) {
        var c = l.getContent().predecessor;
        if (c) {
          var d = c.room_id;
          if (typeof d == "string") {
            var u = c.event_id;
            return (typeof u != "string" || u === "") && (u = void 0), {
              roomId: d,
              eventId: u
            };
          }
        }
      }
      return null;
    }
    updateThirdPartyTokenCache(e) {
      if (e.getContent().third_party_invite) {
        var n = (e.getContent().third_party_invite.signed || {}).token;
        if (n) {
          var r = this.getStateEvents(ce.RoomThirdPartyInvite, n);
          r && (this.tokenToInvite[n] = e);
        }
      }
    }
    updateDisplayNameCache(e, n) {
      var r = this.userIdsToDisplayNames[e];
      if (delete this.userIdsToDisplayNames[e], r) {
        var i = xg(r), a = this.displayNameToUserIds.get(i);
        if (a) {
          var s = a.filter((u) => u !== e);
          this.displayNameToUserIds.set(i, s);
        }
      }
      this.userIdsToDisplayNames[e] = n;
      var l = n && xg(n);
      if (l) {
        var c, d = (c = this.displayNameToUserIds.get(l)) !== null && c !== void 0 ? c : [];
        d.push(e), this.displayNameToUserIds.set(l, d);
      }
    }
  }
  function dH(t, e) {
    var n = /* @__PURE__ */ new Set();
    if (xxe(t) && e) {
      var r = e.getSender();
      r && n.add(r);
      var i = e.getDirectionalContent().additional_creators;
      Array.isArray(i) && i.forEach((a) => n.add(a));
    }
    return n;
  }
  function uH(t, e, n) {
    if (n.has(t)) return 1 / 0;
    var r = e.getDirectionalContent(), i = r.users || {};
    return i[t] !== void 0 && Number.isInteger(i[t]) ? i[t] : r.users_default !== void 0 ? r.users_default : 0;
  }
  var Tn = (function(t) {
    return t.Backward = "b", t.Forward = "f", t;
  })({});
  class en {
    static setEventMetadata(e, n, r) {
      e.setMetadata(n, r);
    }
    constructor(e) {
      var n, r;
      this.eventTimelineSet = e, $(this, "roomId", void 0), $(this, "name", void 0), $(this, "events", []), $(this, "baseIndex", 0), $(this, "startState", void 0), $(this, "endState", void 0), $(this, "startToken", null), $(this, "endToken", null), $(this, "prevTimeline", null), $(this, "nextTimeline", null), $(this, "paginationRequests", {
        [Tn.Backward]: null,
        [Tn.Forward]: null
      }), this.roomId = (n = (r = e.room) === null || r === void 0 ? void 0 : r.roomId) !== null && n !== void 0 ? n : null, this.roomId && (this.startState = new T2(this.roomId), this.endState = new T2(this.roomId)), this.paginationRequests = {
        b: null,
        f: null
      }, this.name = this.roomId + ":" + (/* @__PURE__ */ new Date()).toISOString();
    }
    initialiseState(e) {
      var n, r, { timelineWasEmpty: i } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (this.events.length > 0) throw new Error("Cannot initialise state after events are added");
      (n = this.startState) === null || n === void 0 || n.setStateEvents(e, {
        timelineWasEmpty: i
      }), (r = this.endState) === null || r === void 0 || r.setStateEvents(e, {
        timelineWasEmpty: i
      });
    }
    forkLive(e) {
      var n = this.getState(e), r = new en(this.eventTimelineSet);
      return r.startState = n == null ? void 0 : n.clone(), r.endState = n, this.endState = n == null ? void 0 : n.clone(), r;
    }
    fork(e) {
      var n = this.getState(e), r = new en(this.eventTimelineSet);
      return r.startState = n == null ? void 0 : n.clone(), r.endState = n == null ? void 0 : n.clone(), r;
    }
    getRoomId() {
      return this.roomId;
    }
    getFilter() {
      return this.eventTimelineSet.getFilter();
    }
    getTimelineSet() {
      return this.eventTimelineSet;
    }
    getBaseIndex() {
      return this.baseIndex;
    }
    getEvents() {
      return this.events;
    }
    getState(e) {
      if (e == en.BACKWARDS) return this.startState;
      if (e == en.FORWARDS) return this.endState;
      throw new Error("Invalid direction '" + e + "'");
    }
    getPaginationToken(e) {
      return this.roomId ? this.getState(e).paginationToken : e === Tn.Backward ? this.startToken : this.endToken;
    }
    setPaginationToken(e, n) {
      this.roomId ? this.getState(n).paginationToken = e : n === Tn.Backward ? this.startToken = e : this.endToken = e;
    }
    getNeighbouringTimeline(e) {
      if (e == en.BACKWARDS) return this.prevTimeline;
      if (e == en.FORWARDS) return this.nextTimeline;
      throw new Error("Invalid direction '" + e + "'");
    }
    setNeighbouringTimeline(e, n) {
      if (this.getNeighbouringTimeline(n)) throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: " + n + ")");
      if (n == en.BACKWARDS) this.prevTimeline = e;
      else if (n == en.FORWARDS) this.nextTimeline = e;
      else throw new Error("Invalid direction '" + n + "'");
      this.setPaginationToken(null, n);
    }
    addEvent(e, n) {
      var { toStartOfTimeline: r, roomState: i, timelineWasEmpty: a, addToState: s } = n;
      i || (i = r ? this.startState : this.endState);
      var l = this.getTimelineSet();
      if (l.room && (en.setEventMetadata(e, i, r), s && e.isState() && l.room.getUnfilteredTimelineSet() === l)) {
        var c;
        (c = i) === null || c === void 0 || c.setStateEvents([
          e
        ], {
          timelineWasEmpty: a
        }), (!e.sender || e.getType() === ce.RoomMember && !r) && en.setEventMetadata(e, i, r);
      }
      var d;
      r ? d = 0 : d = this.events.length, this.events.splice(d, 0, e), r && this.baseIndex++;
    }
    insertEvent(e, n, r, i) {
      var a = this.getTimelineSet();
      a.room && (en.setEventMetadata(e, r, false), i && e.isState() && a.room.getUnfilteredTimelineSet() === a && (r.setStateEvents([
        e
      ], {}), (!e.sender || e.getType() === ce.RoomMember) && en.setEventMetadata(e, r, false))), this.events.splice(n, 0, e);
    }
    removeEvent(e) {
      for (var n = this.events.length - 1; n >= 0; n--) {
        var r = this.events[n];
        if (r.getId() == e) return this.events.splice(n, 1), n < this.baseIndex && this.baseIndex--, r;
      }
      return null;
    }
    toString() {
      return this.name;
    }
  }
  $(en, "BACKWARDS", Tn.Backward);
  $(en, "FORWARDS", Tn.Forward);
  var Ed = (function(t) {
    return t.Add = "Relations.add", t.Remove = "Relations.remove", t.Redaction = "Relations.redaction", t;
  })({}), wxe = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
    return [
      n,
      ...r
    ].includes(e);
  };
  class Y7 extends ji {
    constructor(e, n, r, i) {
      var a;
      super(), a = this, this.relationType = e, this.eventType = n, this.altEventTypes = i, $(this, "relationEventIds", /* @__PURE__ */ new Set()), $(this, "relations", /* @__PURE__ */ new Set()), $(this, "annotationsByKey", {}), $(this, "annotationsBySender", {}), $(this, "sortedAnnotationsByKey", []), $(this, "targetEvent", null), $(this, "creationEmitted", false), $(this, "client", void 0), $(this, "onEventStatus", (s, l) => {
        if (!s.isSending()) {
          s.removeListener(or.Status, this.onEventStatus);
          return;
        }
        l === Vn.CANCELLED && (s.removeListener(or.Status, this.onEventStatus), this.removeEvent(s));
      }), $(this, "onBeforeRedaction", (function() {
        var s = me(function* (l) {
          if (a.relations.has(l)) {
            if (a.relations.delete(l), a.relationType === Xn.Annotation) a.removeAnnotationFromAggregation(l);
            else if (a.relationType === Xn.Replace && a.targetEvent && !a.targetEvent.isState()) {
              var c = yield a.getLastReplacement();
              a.targetEvent.makeReplaced(c);
            }
            l.removeListener(or.BeforeRedaction, a.onBeforeRedaction), a.emit(Ed.Redaction, l);
          }
        });
        return function(l) {
          return s.apply(this, arguments);
        };
      })()), this.client = r instanceof lk ? r.client : r;
    }
    addEvent(e) {
      var n = this;
      return me(function* () {
        if (!n.relationEventIds.has(e.getId())) {
          var r = e.getRelation();
          if (!r) {
            _e.error("Event must have relation info");
            return;
          }
          var i = r.rel_type, a = e.getType();
          if (n.relationType !== i || !wxe(a, n.eventType, n.altEventTypes)) {
            _e.error("Event relation info doesn't match this container");
            return;
          }
          if (e.isSending() && e.on(or.Status, n.onEventStatus), n.relations.add(e), n.relationEventIds.add(e.getId()), n.relationType === Xn.Annotation) n.addAnnotationToAggregation(e);
          else if (n.relationType === Xn.Replace && n.targetEvent && !n.targetEvent.isState()) {
            var s = yield n.getLastReplacement();
            n.targetEvent.makeReplaced(s);
          }
          e.on(or.BeforeRedaction, n.onBeforeRedaction), n.emit(Ed.Add, e), n.maybeEmitCreated();
        }
      })();
    }
    removeEvent(e) {
      var n = this;
      return me(function* () {
        if (n.relations.has(e)) {
          if (n.relations.delete(e), n.relationType === Xn.Annotation) n.removeAnnotationFromAggregation(e);
          else if (n.relationType === Xn.Replace && n.targetEvent && !n.targetEvent.isState()) {
            var r = yield n.getLastReplacement();
            n.targetEvent.makeReplaced(r);
          }
          n.emit(Ed.Remove, e);
        }
      })();
    }
    getRelations() {
      return [
        ...this.relations
      ];
    }
    addAnnotationToAggregation(e) {
      var n, { key: r } = (n = e.getRelation()) !== null && n !== void 0 ? n : {};
      if (r) {
        var i = this.annotationsByKey[r];
        i || (i = this.annotationsByKey[r] = /* @__PURE__ */ new Set(), this.sortedAnnotationsByKey.push([
          r,
          i
        ])), i.add(e), this.sortedAnnotationsByKey.sort((l, c) => {
          var d = l[1], u = c[1];
          return u.size - d.size;
        });
        var a = e.getSender(), s = this.annotationsBySender[a];
        s || (s = this.annotationsBySender[a] = /* @__PURE__ */ new Set()), s.add(e);
      }
    }
    removeAnnotationFromAggregation(e) {
      var n, { key: r } = (n = e.getRelation()) !== null && n !== void 0 ? n : {};
      if (r) {
        var i = this.annotationsByKey[r];
        i && (i.delete(e), this.sortedAnnotationsByKey.sort((l, c) => {
          var d = l[1], u = c[1];
          return u.size - d.size;
        }));
        var a = e.getSender(), s = this.annotationsBySender[a];
        s && s.delete(e);
      }
    }
    getSortedAnnotationsByKey() {
      return this.relationType !== Xn.Annotation ? null : this.sortedAnnotationsByKey;
    }
    getAnnotationsBySender() {
      return this.relationType !== Xn.Annotation ? null : this.annotationsBySender;
    }
    getLastReplacement() {
      var e = this;
      return me(function* () {
        if (e.relationType !== Xn.Replace || !e.targetEvent) return null;
        var n = e.targetEvent.getServerAggregatedRelation(Xn.Replace), r = n == null ? void 0 : n.origin_server_ts, i = e.getRelations().reduce((a, s) => s.getSender() !== e.targetEvent.getSender() || r && r > s.getTs() || a && a.getTs() > s.getTs() ? a : s, null);
        return i != null && i.shouldAttemptDecryption() && e.client.getCrypto() ? yield i.attemptDecryption(e.client.getCrypto()) : i != null && i.isBeingDecrypted() && (yield i.getDecryptionPromise()), i;
      })();
    }
    setTargetEvent(e) {
      var n = this;
      return me(function* () {
        if (!n.targetEvent) {
          if (n.targetEvent = e, n.relationType === Xn.Replace && !n.targetEvent.isState()) {
            var r = yield n.getLastReplacement();
            r && n.targetEvent.makeReplaced(r);
          }
          n.maybeEmitCreated();
        }
      })();
    }
    maybeEmitCreated() {
      this.creationEmitted || !this.targetEvent || !this.relations.size || (this.creationEmitted = true, this.targetEvent.emit(or.RelationsCreated, this.relationType, this.eventType));
    }
  }
  class Ane {
    constructor(e, n) {
      this.client = e, this.room = n, $(this, "relations", /* @__PURE__ */ new Map());
    }
    getChildEventsForEvent(e, n, r) {
      var i;
      return (i = this.relations.get(e)) === null || i === void 0 || (i = i.get(n)) === null || i === void 0 ? void 0 : i.get(r);
    }
    getAllChildEventsForEvent(e) {
      var n, r = (n = this.relations.get(e)) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), i = [];
      for (var a of r.values()) for (var s of a.values()) i.push(...s.getRelations());
      return i;
    }
    aggregateParentEvent(e) {
      var n = this.relations.get(e.getId());
      if (n) for (var r of n.values()) for (var i of r.values()) i.setTargetEvent(e);
    }
    aggregateChildEvent(e, n) {
      if (!(e.isRedacted() || e.status === Vn.CANCELLED)) {
        var r = e.getRelation();
        if (r) {
          var i = () => {
            if (e.isDecryptionFailure()) {
              e.once(or.Decrypted, i);
              return;
            }
            this.aggregateChildEvent(e, n);
          };
          if (e.isBeingDecrypted() || e.shouldAttemptDecryption()) {
            e.once(or.Decrypted, i);
            return;
          }
          var { event_id: a, rel_type: s } = r, l = e.getType(), c = this.relations.get(a);
          c || (c = /* @__PURE__ */ new Map(), this.relations.set(a, c));
          var d = c.get(s);
          d || (d = /* @__PURE__ */ new Map(), c.set(s, d));
          var u = d.get(l);
          if (!u) {
            var h, f, g;
            u = new Y7(s, l, this.client), d.set(l, u);
            var m = (h = this.room) !== null && h !== void 0 ? h : n == null ? void 0 : n.room, v = (f = (g = n == null ? void 0 : n.findEventById(a)) !== null && g !== void 0 ? g : m == null ? void 0 : m.findEventById(a)) !== null && f !== void 0 ? f : m == null ? void 0 : m.getPendingEvent(a);
            v && u.setTargetEvent(v);
          }
          u.addEvent(e);
        }
      }
    }
  }
  var B0;
  B0 = _e.log.bind(_e);
  var l1 = (function(t) {
    return t.Ignore = "ignore", t.Replace = "replace", t;
  })({});
  class H0 extends ji {
    constructor(e) {
      var n, r, i, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 ? arguments[2] : void 0, l = arguments.length > 3 ? arguments[3] : void 0, c = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null;
      super(), this.room = e, this.thread = l, this.threadListType = c, $(this, "relations", void 0), $(this, "timelineSupport", void 0), $(this, "displayPendingEvents", void 0), $(this, "liveTimeline", void 0), $(this, "timelines", void 0), $(this, "_eventIdToTimeline", /* @__PURE__ */ new Map()), $(this, "filter", void 0), this.timelineSupport = !!a.timelineSupport, this.liveTimeline = new en(this), this.displayPendingEvents = a.pendingEvents !== false, this.timelines = [
        this.liveTimeline
      ], this._eventIdToTimeline = /* @__PURE__ */ new Map(), this.filter = a.filter, this.relations = (n = (r = this.room) === null || r === void 0 ? void 0 : r.relations) !== null && n !== void 0 ? n : new Ane((i = e == null ? void 0 : e.client) !== null && i !== void 0 ? i : s);
    }
    getTimelines() {
      return this.timelines;
    }
    getFilter() {
      return this.filter;
    }
    setFilter(e) {
      this.filter = e;
    }
    getPendingEvents() {
      return !this.room || !this.displayPendingEvents ? [] : this.room.getPendingEvents();
    }
    getLiveTimeline() {
      return this.liveTimeline;
    }
    setLiveTimeline(e) {
      this.liveTimeline = e;
    }
    eventIdToTimeline(e) {
      return this._eventIdToTimeline.get(e);
    }
    replaceEventId(e, n) {
      var r = this._eventIdToTimeline.get(e);
      r && (this._eventIdToTimeline.delete(e), this._eventIdToTimeline.set(n, r));
    }
    resetLiveTimeline(e, n) {
      var r = !this.timelineSupport || !n, i = this.liveTimeline, a = r ? i.forkLive(en.FORWARDS) : i.fork(en.FORWARDS);
      r ? (this.timelines = [
        a
      ], this._eventIdToTimeline = /* @__PURE__ */ new Map()) : this.timelines.push(a), n && i.setPaginationToken(n, en.FORWARDS), a.setPaginationToken(e ?? null, en.BACKWARDS), this.liveTimeline = a, this.emit(mt.TimelineReset, this.room, this, r);
    }
    getTimelineForEvent(e) {
      if (e == null) return null;
      var n = this._eventIdToTimeline.get(e);
      return n === void 0 ? null : n;
    }
    findEventById(e) {
      var n = this.getTimelineForEvent(e);
      if (n) return n.getEvents().find(function(r) {
        return r.getId() == e;
      });
    }
    addTimeline() {
      if (!this.timelineSupport) throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");
      var e = new en(this);
      return this.timelines.push(e), e;
    }
    addEventsToTimeline(e, n, r, i, a) {
      if (!i) throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");
      if (!n && i == this.liveTimeline) throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");
      if (!(this.filter && (e = this.filter.filterRoomTimeline(e), !e.length))) {
        var s = n ? en.BACKWARDS : en.FORWARDS, l = n ? en.FORWARDS : en.BACKWARDS, c = false, d = false;
        for (var u of e) {
          var h = u.getId(), f = this._eventIdToTimeline.get(h);
          if (!f) {
            this.addEventToTimeline(u, i, {
              toStartOfTimeline: n,
              addToState: r
            }), d = true, c = true;
            continue;
          }
          if (d = false, f == i) {
            B0("Event " + h + " already in timeline " + i);
            continue;
          }
          var g = i.getNeighbouringTimeline(s);
          if (g) {
            f == g ? B0("Event " + h + " in neighbouring timeline - switching to " + f) : B0("Event " + h + " already in a different timeline " + f), i = f;
            continue;
          }
          _e.info("Already have timeline for " + h + " - joining timeline " + i + " to " + f);
          var m = f === this.liveTimeline, v = i === this.liveTimeline, y = s === en.BACKWARDS && m, w = s === en.FORWARDS && v;
          if (y || w) {
            y && _e.warn("Refusing to set a preceding existingTimeLine on our timeline as the existingTimeLine is live (" + f + ")"), w && _e.warn("Refusing to set our preceding timeline on a existingTimeLine as our timeline is live (" + i + ")");
            continue;
          }
          i.setNeighbouringTimeline(f, s), f.setNeighbouringTimeline(i, l), i = f, c = true;
        }
        if (d || !c) {
          if (s === en.FORWARDS && i === this.liveTimeline) {
            _e.warn({
              lastEventWasNew: d,
              didUpdate: c
            }), _e.warn("Refusing to set forwards pagination token of live timeline " + "".concat(i, " to ").concat(a));
            return;
          }
          i.setPaginationToken(a ?? null, s);
        }
      }
    }
    addLiveEvent(e, n) {
      var { duplicateStrategy: r, fromCache: i, roomState: a, timelineWasEmpty: s, addToState: l } = n;
      if (this.filter) {
        var c = this.filter.filterRoomTimeline([
          e
        ]);
        if (!c.length) return;
      }
      var d = this._eventIdToTimeline.get(e.getId());
      if (d) {
        if (r === l1.Replace) {
          B0("EventTimelineSet.addLiveEvent: replacing duplicate event " + e.getId());
          for (var u = d.getEvents(), h = 0; h < u.length; h++) if (u[h].getId() === e.getId()) {
            a || (a = d.getState(en.FORWARDS)), en.setEventMetadata(e, a, false), u[h] = e;
            break;
          }
        } else B0("EventTimelineSet.addLiveEvent: ignoring duplicate event " + e.getId());
        return;
      }
      this.addEventToTimeline(e, this.liveTimeline, {
        toStartOfTimeline: false,
        fromCache: i,
        roomState: a,
        timelineWasEmpty: s,
        addToState: l
      });
    }
    addEventToTimeline(e, n, r) {
      var { toStartOfTimeline: i, fromCache: a = false, roomState: s, timelineWasEmpty: l, addToState: c } = r;
      if (n.getTimelineSet() !== this) {
        var d;
        throw new Error("EventTimelineSet.addEventToTimeline: Timeline=".concat(n.toString(), ` does not belong " +
                "in timelineSet(threadId=`).concat((d = this.thread) === null || d === void 0 ? void 0 : d.id, ")"));
      }
      var u = e.getId();
      if (this.relations.aggregateParentEvent(e), this.relations.aggregateChildEvent(e, this), this.room && !this.canContain(e)) {
        var h, f = "event=".concat(u);
        e.threadRootId && (f += "(belongs to thread=".concat(e.threadRootId, ")")), _e.warn("EventTimelineSet.addEventToTimeline: Ignoring ".concat(f, " that does not belong ") + "in timeline=".concat(n.toString(), " timelineSet(threadId=").concat((h = this.thread) === null || h === void 0 ? void 0 : h.id, ")"));
        return;
      }
      n.addEvent(e, {
        toStartOfTimeline: i,
        roomState: s,
        timelineWasEmpty: l,
        addToState: c
      }), this._eventIdToTimeline.set(u, n);
      var g = {
        timeline: n,
        liveEvent: !i && n == this.liveTimeline && !a
      };
      this.emit(mt.Timeline, e, this.room, !!i, false, g);
    }
    insertEventIntoTimeline(e, n, r, i) {
      if (n.getTimelineSet() !== this) {
        var a;
        throw new Error("EventTimelineSet.insertEventIntoTimeline: Timeline=".concat(n.toString(), ` does not belong " +
                "in timelineSet(threadId=`).concat((a = this.thread) === null || a === void 0 ? void 0 : a.id, ")"));
      }
      var s = e.getId();
      if (this.relations.aggregateParentEvent(e), this.relations.aggregateChildEvent(e, this), this.room && !this.canContain(e)) {
        var l, c = "event=".concat(s);
        e.threadRootId && (c += "(belongs to thread=".concat(e.threadRootId, ")")), _e.warn("EventTimelineSet.insertEventIntoTimeline: Ignoring ".concat(c, " that does not belong ") + "in timeline=".concat(n.toString(), " timelineSet(threadId=").concat((l = this.thread) === null || l === void 0 ? void 0 : l.id, ")"));
        return;
      }
      var d = e.relationEventId;
      if (!d) {
        this.addEventToTimeline(e, n, {
          toStartOfTimeline: false,
          fromCache: false,
          timelineWasEmpty: false,
          roomState: r,
          addToState: i
        });
        return;
      }
      for (var u = this.findEventById(d), h = n.getEvents(), f = u !== void 0 ? h.indexOf(u) : 0, g = f; g < h.length; g++) {
        var m = h[g];
        if (m.getTs() > e.getTs()) break;
      }
      n.insertEvent(e, g, r, i), this._eventIdToTimeline.set(s, n);
      var v = {
        timeline: n,
        liveEvent: false
      };
      this.emit(mt.Timeline, e, this.room, false, false, v);
    }
    handleRemoteEcho(e, n, r) {
      var i = this._eventIdToTimeline.get(n);
      i ? (this._eventIdToTimeline.delete(n), this._eventIdToTimeline.set(r, i)) : (!this.filter || this.filter.filterRoomTimeline([
        e
      ]).length) && this.addEventToTimeline(e, this.liveTimeline, {
        toStartOfTimeline: false,
        addToState: false
      });
    }
    removeEvent(e) {
      var n = this._eventIdToTimeline.get(e);
      if (!n) return null;
      var r = n.removeEvent(e);
      if (r) {
        this._eventIdToTimeline.delete(e);
        var i = {
          timeline: n
        };
        this.emit(mt.Timeline, r, this.room, void 0, true, i);
      }
      return r;
    }
    compareEventOrdering(e, n) {
      if (e == n) return 0;
      var r = this._eventIdToTimeline.get(e), i = this._eventIdToTimeline.get(n);
      if (r === void 0 || i === void 0) return null;
      if (r === i) {
        for (var a = void 0, s = void 0, l = r.getEvents(), c = 0; c < l.length && (a === void 0 || s === void 0); c++) {
          var d = l[c].getId();
          d == e && (a = c), d == n && (s = c);
        }
        var u = a - s;
        return u < 0 ? -1 : u > 0 ? 1 : 0;
      }
      for (var h = r; h; ) {
        if (h === i) return -1;
        h = h.getNeighbouringTimeline(en.FORWARDS);
      }
      for (h = r; h; ) {
        if (h === i) return 1;
        h = h.getNeighbouringTimeline(en.BACKWARDS);
      }
      return null;
    }
    canContain(e) {
      if (!this.room) throw new Error("Cannot call `EventTimelineSet::canContain without a `room` set. Set the room when creating the EventTimelineSet to call this method.");
      var { threadId: n, shouldLiveInRoom: r, shouldLiveInThread: i } = this.room.eventShouldLiveIn(e);
      if (this.thread) return this.thread.id === n;
      if (!r && !i) {
        var a;
        _e.warn("EventTimelineSet:canContain event encountered which cannot be added to any timeline roomId=".concat((a = this.room) === null || a === void 0 ? void 0 : a.roomId, " eventId=").concat(e.getId(), " threadId=").concat(e.threadRootId));
      }
      return r;
    }
  }
  class Ine {
    constructor(e, n) {
      this.roomId = e;
    }
  }
  var R2 = new ik("unread_thread_notifications", "org.matrix.msc3773.unread_thread_notifications");
  function Dxe(t, e) {
    if (e.endsWith("*")) {
      var n = e.slice(0, -1);
      return t.slice(0, n.length) === n;
    } else return t === e;
  }
  class hH {
    constructor(e, n) {
      this.filterJson = e, this.userId = n;
    }
    check(e) {
      var n, r, i = ((n = e.getUnsigned()) === null || n === void 0 ? void 0 : n["m.relations"]) || {}, a = Object.keys(i), s = [];
      return this.userId && i !== null && i !== void 0 && (r = i[pi.name]) !== null && r !== void 0 && r.current_user_participated && s.push(this.userId), this.checkFields(e.getRoomId(), e.getSender(), e.getType(), e.getContent() ? e.getContent().url !== void 0 : false, a, s);
    }
    toJSON() {
      return Object.fromEntries(Object.entries({
        types: this.filterJson.types,
        not_types: this.filterJson.not_types,
        rooms: this.filterJson.rooms,
        not_rooms: this.filterJson.not_rooms,
        senders: this.filterJson.senders,
        not_senders: this.filterJson.not_senders,
        contains_url: this.filterJson.contains_url,
        [o1.name]: this.filterJson[o1.name],
        [a1.name]: this.filterJson[a1.name]
      }).filter((e) => {
        var [n, r] = e;
        return r;
      }));
    }
    checkFields(e, n, r, i, a, s) {
      var l = {
        rooms: function(w) {
          return e === w;
        },
        senders: function(w) {
          return n === w;
        },
        types: function(w) {
          return Dxe(r, w);
        }
      };
      for (var c in l) {
        var d = l[c], u = "not_" + c, h = this.filterJson[u];
        if (h != null && h.some(d)) return false;
        var f = this.filterJson[c];
        if (f && !f.some(d)) return false;
      }
      var g = this.filterJson.contains_url;
      if (g !== void 0 && g !== i) return false;
      var m = this.filterJson[a1.name];
      if (m !== void 0 && !this.arrayMatchesFilter(m, a)) return false;
      var v = this.filterJson[o1.name];
      return !(v !== void 0 && !this.arrayMatchesFilter(v, s));
    }
    arrayMatchesFilter(e, n) {
      return n.length > 0 && e.every((r) => n.includes(r));
    }
    filter(e) {
      return e.filter(this.check, this);
    }
    limit() {
      return this.filterJson.limit !== void 0 ? this.filterJson.limit : 10;
    }
  }
  function fH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function u0(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? fH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : fH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function Gj(t, e, n) {
    for (var r = e.split("."), i = t, a = 0; a < r.length - 1; a++) i[r[a]] || (i[r[a]] = {}), i = i[r[a]];
    i[r[r.length - 1]] = n;
  }
  class ns {
    static fromJson(e, n, r) {
      var i = new ns(e, n);
      return i.setDefinition(r), i;
    }
    constructor(e, n) {
      this.userId = e, this.filterId = n, $(this, "definition", {}), $(this, "roomFilter", void 0), $(this, "roomTimelineFilter", void 0);
    }
    getFilterId() {
      return this.filterId;
    }
    getDefinition() {
      return this.definition;
    }
    setDefinition(e) {
      this.definition = e;
      var n = e.room, r = {};
      n && (n.rooms && (r.rooms = n.rooms), n.rooms && (r.not_rooms = n.not_rooms)), this.roomFilter = new hH(r, this.userId), this.roomTimelineFilter = new hH((n == null ? void 0 : n.timeline) || {}, this.userId);
    }
    getRoomTimelineFilterComponent() {
      return this.roomTimelineFilter;
    }
    filterRoomTimeline(e) {
      return this.roomFilter && (e = this.roomFilter.filter(e)), this.roomTimelineFilter && (e = this.roomTimelineFilter.filter(e)), e;
    }
    setTimelineLimit(e) {
      Gj(this.definition, "room.timeline.limit", e);
    }
    setUnreadThreadNotifications(e) {
      var n, r;
      this.definition = u0(u0({}, this.definition), {}, {
        room: u0(u0({}, (n = this.definition) === null || n === void 0 ? void 0 : n.room), {}, {
          timeline: u0(u0({}, (r = this.definition) === null || r === void 0 || (r = r.room) === null || r === void 0 ? void 0 : r.timeline), {}, {
            [R2.name]: e
          })
        })
      });
    }
    setLazyLoadMembers(e) {
      Gj(this.definition, "room.state.lazy_load_members", e);
    }
    setIncludeLeaveRooms(e) {
      Gj(this.definition, "room.include_leave", e);
    }
  }
  $(ns, "LAZY_LOADING_MESSAGES_FILTER", {
    lazy_load_members: true
  });
  var Cxe = new Os.UnstableValue("m.poll.disclosed", "org.matrix.msc3381.poll.disclosed"), Exe = new Os.UnstableValue("m.poll.undisclosed", "org.matrix.msc3381.poll.undisclosed"), kxe = new Os.UnstableValue("m.poll.start", "org.matrix.msc3381.poll.start"), A2 = new Os.UnstableValue("m.poll.response", "org.matrix.msc3381.poll.response"), JC = new Os.UnstableValue("m.poll.end", "org.matrix.msc3381.poll.end"), tf = (function(t) {
    return t.New = "Poll.new", t.End = "Poll.end", t.Update = "Poll.update", t.Responses = "Poll.Responses", t.Destroy = "Poll.Destroy", t.UndecryptableRelations = "Poll.UndecryptableRelations", t;
  })({}), mH = (t, e) => {
    var n = t.filter((r) => {
      if (!r.isDecryptionFailure()) return A2.matches(r.getType()) && r.getTs() <= e;
    });
    return {
      responseEvents: n
    };
  };
  class Bne extends ji {
    constructor(e, n, r) {
      if (super(), this.rootEvent = e, this.matrixClient = n, this.room = r, $(this, "roomId", void 0), $(this, "pollEvent", void 0), $(this, "_isFetchingResponses", false), $(this, "relationsNextBatch", void 0), $(this, "responses", null), $(this, "endEvent", void 0), $(this, "undecryptableRelationEventIds", /* @__PURE__ */ new Set()), $(this, "countUndecryptableEvents", (i) => {
        var a = i.filter((l) => l.isDecryptionFailure()).map((l) => l.getId()), s = this.undecryptableRelationsCount;
        this.undecryptableRelationEventIds = /* @__PURE__ */ new Set([
          ...this.undecryptableRelationEventIds,
          ...a
        ]), this.undecryptableRelationsCount !== s && this.emit(tf.UndecryptableRelations, this.undecryptableRelationsCount);
      }), !this.rootEvent.getRoomId() || !this.rootEvent.getId()) throw new Error("Invalid poll start event.");
      this.roomId = this.rootEvent.getRoomId(), this.pollEvent = this.rootEvent.unstableExtensibleEvent;
    }
    get pollId() {
      return this.rootEvent.getId();
    }
    get endEventId() {
      var e;
      return (e = this.endEvent) === null || e === void 0 ? void 0 : e.getId();
    }
    get isEnded() {
      return !!this.endEvent;
    }
    get isFetchingResponses() {
      return this._isFetchingResponses;
    }
    get undecryptableRelationsCount() {
      return this.undecryptableRelationEventIds.size;
    }
    getResponses() {
      var e = this;
      return me(function* () {
        return e.responses || e.isFetchingResponses || (yield e.fetchResponses()), e.responses;
      })();
    }
    onNewRelation(e) {
      var n;
      if (JC.matches(e.getType()) && this.validateEndEvent(e) && (this.endEvent = e, this.refilterResponsesOnEnd(), this.emit(tf.End)), !!this.responses) {
        var r = ((n = this.endEvent) === null || n === void 0 ? void 0 : n.getTs()) || Number.MAX_SAFE_INTEGER, { responseEvents: i } = mH([
          e
        ], r);
        this.countUndecryptableEvents([
          e
        ]), i.length && (i.forEach((a) => {
          this.responses.addEvent(a);
        }), this.emit(tf.Responses, this.responses));
      }
    }
    fetchResponses() {
      var e = this;
      return me(function* () {
        var n, r;
        e._isFetchingResponses = true;
        var i = yield e.matrixClient.relations(e.roomId, e.rootEvent.getId(), "m.reference", void 0, {
          from: e.relationsNextBatch || void 0
        });
        yield Promise.all(i.events.map((d) => e.matrixClient.decryptEventIfNeeded(d)));
        var a = e.responses || new Y7("m.reference", A2.name, e.matrixClient, [
          A2.altName
        ]), s = i.events.find((d) => JC.matches(d.getType()));
        e.validateEndEvent(s) && (e.endEvent = s, e.refilterResponsesOnEnd(), e.emit(tf.End));
        var l = ((n = e.endEvent) === null || n === void 0 ? void 0 : n.getTs()) || Number.MAX_SAFE_INTEGER, { responseEvents: c } = mH(i.events, l);
        c.forEach((d) => {
          a.addEvent(d);
        }), e.relationsNextBatch = (r = i.nextBatch) !== null && r !== void 0 ? r : void 0, e.responses = a, e.countUndecryptableEvents(i.events), e.relationsNextBatch ? e.fetchResponses() : e._isFetchingResponses = false, e.emit(tf.Responses, e.responses);
      })();
    }
    refilterResponsesOnEnd() {
      var e;
      if (this.responses) {
        var n = ((e = this.endEvent) === null || e === void 0 ? void 0 : e.getTs()) || Number.MAX_SAFE_INTEGER;
        this.responses.getRelations().forEach((r) => {
          if (r.getTs() > n) {
            var i;
            (i = this.responses) === null || i === void 0 || i.removeEvent(r);
          }
        }), this.emit(tf.Responses, this.responses);
      }
    }
    validateEndEvent(e) {
      if (!e || this.endEvent && this.endEvent.getTs() < e.getTs()) return false;
      var n = this.room.currentState, r = e.getSender();
      return !!r && (r === this.rootEvent.getSender() || n.maySendRedactionForEvent(this.rootEvent, r));
    }
  }
  var Pne = (t) => {
    var e = t.getType();
    return Os.M_POLL_START.matches(e) || A2.matches(e) || JC.matches(e);
  };
  class Sxe {
    constructor(e) {
      $(this, "room", void 0), $(this, "threadedReceipts", void 0), $(this, "unthreadedReceipts", void 0), $(this, "danglingReceipts", void 0), $(this, "onTimelineEvent", (n) => {
        var r = n.getId();
        if (r) {
          var i = this.danglingReceipts.remove(r);
          i == null ? void 0 : i.forEach((a) => {
            a.receipt.thread_id ? this.threadedReceipts.set(a.receipt.thread_id, a.eventId, a.receiptType, a.userId, a.receipt.ts, a.synthetic) : this.unthreadedReceipts.set(r, a.receiptType, a.userId, a.receipt.ts, a.synthetic);
          });
        }
      }), this.room = e, this.threadedReceipts = new Axe(e), this.unthreadedReceipts = new Mne(e), this.danglingReceipts = new Ixe(), e.on(mt.Timeline, this.onTimelineEvent);
    }
    add(e, n) {
      for (var [r, i] of Object.entries(e)) for (var [a, s] of Object.entries(i)) for (var [l, c] of Object.entries(s)) {
        var d = this.room.findEventById(r);
        d ? c.thread_id ? this.threadedReceipts.set(c.thread_id, r, a, l, c.ts, n) : this.unthreadedReceipts.set(r, a, l, c.ts, n) : this.danglingReceipts.add(new Txe(r, a, l, c, n));
      }
    }
    hasUserReadEvent(e, n) {
      var r = this.unthreadedReceipts.get(e);
      if (r && QR(r.eventId, n, this.room)) return true;
      var i = this.room.findEventById(n);
      if (!i) return _e.warn("hasUserReadEvent event ID ".concat(n, " not found in room ").concat(this.room.roomId, ": this shouldn't happen!")), false;
      var a = W1(i), s = this.threadedReceipts.get(a, e);
      return !!(s && QR(s.eventId, n, this.room) || this.userSentLatestEventInThread(a, e));
    }
    userSentLatestEventInThread(e, n) {
      var r, i = e === Kb ? this.room.getLiveTimeline().getEvents() : (r = this.room.getThread(e)) === null || r === void 0 ? void 0 : r.timeline;
      return !!(i && i.length > 0 && i[i.length - 1].getSender() === n);
    }
  }
  class jxe {
    constructor(e, n, r) {
      this.eventId = e, this.receiptType = n, this.ts = r;
    }
  }
  class Txe {
    constructor(e, n, r, i, a) {
      this.eventId = e, this.receiptType = n, this.userId = r, this.receipt = i, this.synthetic = a;
    }
  }
  class Rxe {
    constructor(e) {
      $(this, "room", void 0), $(this, "real", void 0), $(this, "synthetic", void 0), this.room = e, this.real = void 0, this.synthetic = void 0;
    }
    set(e, n) {
      e ? this.synthetic = n : this.real = n, this.synthetic && this.real && QR(this.real.eventId, this.synthetic.eventId, this.room) && (this.synthetic = void 0);
    }
    get() {
      var e;
      return (e = this.synthetic) !== null && e !== void 0 ? e : this.real;
    }
    getByType(e) {
      return e ? this.synthetic : this.real;
    }
  }
  class Mne {
    constructor(e) {
      $(this, "room", void 0), $(this, "data", void 0), this.room = e, this.data = /* @__PURE__ */ new Map();
    }
    set(e, n, r, i, a) {
      var s = Z7(this.data, r, () => new Rxe(this.room)), l = s.getByType(a);
      l && Bxe(l.eventId, e, this.room) || s.set(a, new jxe(e, n, i));
    }
    get(e) {
      var n;
      return (n = this.data.get(e)) === null || n === void 0 ? void 0 : n.get();
    }
  }
  class Axe {
    constructor(e) {
      $(this, "room", void 0), $(this, "data", void 0), this.room = e, this.data = /* @__PURE__ */ new Map();
    }
    set(e, n, r, i, a, s) {
      var l = Z7(this.data, e, () => new Mne(this.room));
      l.set(n, r, i, a, s);
    }
    get(e, n) {
      var r;
      return (r = this.data.get(e)) === null || r === void 0 ? void 0 : r.get(n);
    }
  }
  class Ixe {
    constructor() {
      $(this, "data", /* @__PURE__ */ new Map());
    }
    add(e) {
      var n = Z7(this.data, e.eventId, () => []);
      n.push(e);
    }
    remove(e) {
      var n = this.data.get(e);
      return this.data.delete(e), n;
    }
  }
  function Z7(t, e, n) {
    var r = t.get(e);
    if (r) return r;
    var i = n();
    return t.set(e, i), i;
  }
  function QR(t, e, n) {
    var r = n.compareEventOrdering(t, e);
    return r !== null && r >= 0;
  }
  function Bxe(t, e, n) {
    var r = n.compareEventOrdering(t, e);
    return r !== null && r > 0;
  }
  function Pxe(t, e, n) {
    var r = t.findEventById(e), i = t.findEventById(n);
    if (!r || !i) return null;
    var a = N2(r), s = N2(i);
    return a && s ? Mxe(t, e, n, r, i) : Oxe(e, n, r, i);
  }
  function Mxe(t, e, n, r, i) {
    var a = t.getUnfilteredTimelineSet(), s = a.compareEventOrdering(e, n);
    if (s !== null) return s;
    var l = a.getTimelineForEvent(e);
    if (l === a.getLiveTimeline()) return 1;
    var c = a.getTimelineForEvent(n);
    return c === a.getLiveTimeline() ? -1 : One(r, i);
  }
  function Oxe(t, e, n, r) {
    var i = W1(n), a = W1(r), s = n.getThread();
    return s && i === a ? s.timelineSet.compareEventOrdering(t, e) : One(n, r);
  }
  function One(t, e) {
    var n = t.getTs(), r = e.getTs();
    return n < r ? -1 : n > r ? 1 : 0;
  }
  rt = (function(t) {
    return t.Get = "GET", t.Put = "PUT", t.Post = "POST", t.Delete = "DELETE", t.Options = "OPTIONS", t.Head = "HEAD", t.Patch = "PATCH", t;
  })({});
  function gH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Lxe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? gH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : gH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  class Vg extends Error {
    constructor(e, n, r) {
      super(e), this.httpStatus = n, this.httpHeaders = r;
    }
    isRateLimitError() {
      return this.httpStatus === 429;
    }
    getRetryAfterMs() {
      var e, n = (e = this.httpHeaders) === null || e === void 0 ? void 0 : e.get("Retry-After");
      if (n != null) {
        if (/^\d+$/.test(n)) {
          var r = Number.parseInt(n) * 1e3;
          if (!Number.isFinite(r)) throw new Error("Retry-After header integer value is too large");
          return r;
        }
        var i = new Date(n);
        if (i.toUTCString() !== n) throw new Error("Retry-After header value is not a valid HTTP-date or non-negative decimal integer");
        return i.getTime() - Date.now();
      }
      return null;
    }
  }
  Un = class extends Vg {
    constructor() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0, i = arguments.length > 3 ? arguments[3] : void 0, a = arguments.length > 4 ? arguments[4] : void 0, s = e.error || "Unknown message";
      n && (s = "[".concat(n, "] ").concat(s)), r && (s = "".concat(s, " (").concat(r, ")")), super("MatrixError: ".concat(s), n, a), this.url = r, this.event = i, $(this, "errcode", void 0), $(this, "data", void 0), this.errcode = e.errcode, this.name = e.errcode || "Unknown error code", this.data = e;
    }
    isRateLimitError() {
      return this.errcode === "M_LIMIT_EXCEEDED" || (this.errcode === "M_UNKNOWN" || this.errcode === void 0) && super.isRateLimitError();
    }
    getRetryAfterMs() {
      var e = super.getRetryAfterMs();
      if (e !== null) return e;
      if (this.errcode === "M_LIMIT_EXCEEDED" && "retry_after_ms" in this.data) {
        if (!Number.isInteger(this.data.retry_after_ms)) throw new Error("retry_after_ms is not an integer");
        return this.data.retry_after_ms;
      }
      return null;
    }
    asWidgetApiErrorData() {
      var e, n, r, i, a = {};
      if (this.httpHeaders) for (var [s, l] of this.httpHeaders) a[s] = l;
      return {
        http_status: (e = this.httpStatus) !== null && e !== void 0 ? e : 400,
        http_headers: a,
        url: (n = this.url) !== null && n !== void 0 ? n : "",
        response: Lxe({
          errcode: (r = this.errcode) !== null && r !== void 0 ? r : "M_UNKNOWN",
          error: (i = this.data.error) !== null && i !== void 0 ? i : "Unknown message"
        }, this.data)
      };
    }
    static fromWidgetApiErrorData(e) {
      return new Un(e.response, e.http_status, e.url, void 0, new Headers(e.http_headers));
    }
  };
  function J7(t, e) {
    if (!(t instanceof Vg) || !t.isRateLimitError()) return e;
    try {
      var n;
      return (n = t.getRetryAfterMs()) !== null && n !== void 0 ? n : e;
    } catch {
      return e;
    }
  }
  class vp extends Error {
    constructor(e, n) {
      super(e + (n ? ": ".concat(n.message) : ""));
    }
    get name() {
      return "ConnectionError";
    }
  }
  class Lne extends Error {
    constructor(e) {
      var n;
      super((n = e == null ? void 0 : e.message) !== null && n !== void 0 ? n : "");
    }
    get name() {
      return "TokenRefreshError";
    }
  }
  class X7 extends Error {
    constructor(e) {
      var n;
      super((n = e == null ? void 0 : e.message) !== null && n !== void 0 ? n : "");
    }
    get name() {
      return "TokenRefreshLogoutError";
    }
  }
  var I2 = (function(t) {
    return t.SessionLoggedOut = "Session.logged_out", t.NoConsent = "no_consent", t;
  })({}), Yx = {};
  var pH;
  function Nxe() {
    if (pH) return Yx;
    pH = 1;
    var t = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g, e = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/, n = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/, r = /\\([\u000b\u0020-\u00ff])/g, i = /([\\"])/g, a = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
    Yx.format = s, Yx.parse = l;
    function s(h) {
      if (!h || typeof h != "object") throw new TypeError("argument obj is required");
      var f = h.parameters, g = h.type;
      if (!g || !a.test(g)) throw new TypeError("invalid type");
      var m = g;
      if (f && typeof f == "object") for (var v, y = Object.keys(f).sort(), w = 0; w < y.length; w++) {
        if (v = y[w], !n.test(v)) throw new TypeError("invalid parameter name");
        m += "; " + v + "=" + d(f[v]);
      }
      return m;
    }
    function l(h) {
      if (!h) throw new TypeError("argument string is required");
      var f = typeof h == "object" ? c(h) : h;
      if (typeof f != "string") throw new TypeError("argument string is required to be a string");
      var g = f.indexOf(";"), m = g !== -1 ? f.slice(0, g).trim() : f.trim();
      if (!a.test(m)) throw new TypeError("invalid media type");
      var v = new u(m.toLowerCase());
      if (g !== -1) {
        var y, w, b;
        for (t.lastIndex = g; w = t.exec(f); ) {
          if (w.index !== g) throw new TypeError("invalid parameter format");
          g += w[0].length, y = w[1].toLowerCase(), b = w[2], b.charCodeAt(0) === 34 && (b = b.slice(1, -1), b.indexOf("\\") !== -1 && (b = b.replace(r, "$1"))), v.parameters[y] = b;
        }
        if (g !== f.length) throw new TypeError("invalid parameter format");
      }
      return v;
    }
    function c(h) {
      var f;
      if (typeof h.getHeader == "function" ? f = h.getHeader("content-type") : typeof h.headers == "object" && (f = h.headers && h.headers["content-type"]), typeof f != "string") throw new TypeError("content-type header is missing from object");
      return f;
    }
    function d(h) {
      var f = String(h);
      if (n.test(f)) return f;
      if (f.length > 0 && !e.test(f)) throw new TypeError("invalid parameter value");
      return '"' + f.replace(i, "\\$1") + '"';
    }
    function u(h) {
      this.parameters = /* @__PURE__ */ Object.create(null), this.type = h;
    }
    return Yx;
  }
  var zxe = Nxe();
  function sk(t) {
    var e = new AbortController();
    return setTimeout(() => {
      e.abort();
    }, t), e.signal;
  }
  function Nne(t) {
    var e = new AbortController();
    function n() {
      for (var a of t) a.removeEventListener("abort", r);
    }
    function r() {
      e.abort(), n();
    }
    for (var i of t) {
      if (i.aborted) {
        r();
        break;
      }
      i.addEventListener("abort", r);
    }
    return {
      signal: e.signal,
      cleanup: n
    };
  }
  function Q7(t, e) {
    var n, r, i = FH(t) ? new Headers(t.getAllResponseHeaders().trim().split(/[\r\n]+/).map((s) => {
      var l = s.indexOf(":");
      return [
        s.substring(0, l),
        s.substring(l + 1)
      ];
    })) : t.headers, a;
    try {
      a = Uxe(i);
    } catch (s) {
      return s;
    }
    return ((n = a) === null || n === void 0 ? void 0 : n.type) === "application/json" && e ? new Un(JSON.parse(e), t.status, FH(t) ? t.responseURL : t.url, void 0, i) : ((r = a) === null || r === void 0 ? void 0 : r.type) === "text/plain" ? new Vg("Server returned ".concat(t.status, " error: ").concat(e), t.status, i) : new Vg("Server returned ".concat(t.status, " error"), t.status, i);
  }
  function FH(t) {
    return "getResponseHeader" in t;
  }
  function Uxe(t) {
    var e = t.get("Content-Type");
    if (e === null) return null;
    try {
      return zxe.parse(e);
    } catch (n) {
      throw new Error("Error parsing Content-Type '".concat(e, "': ").concat(n));
    }
  }
  function eA(t, e) {
    return tA.apply(this, arguments);
  }
  function tA() {
    return tA = me(function* (t, e) {
      for (var n = 0, r = null; n < t; ) try {
        if (n > 0) {
          var i = 1e3 * Math.pow(2, n);
          _e.log("network operation failed ".concat(n, " times, retrying in ").concat(i, "ms...")), yield Ug(i);
        }
        return yield e();
      } catch (a) {
        if (a instanceof vp) n += 1, r = a;
        else throw a;
      }
      throw r;
    }), tA.apply(this, arguments);
  }
  zne = function(t, e, n) {
    return e > 4 || t instanceof vp && !n || t.httpStatus && Math.floor(t.httpStatus / 100) === 4 && t.httpStatus !== 429 || t.name === "AbortError" || t.name === "M_TOO_LARGE" ? -1 : J7(t, 1e3 * Math.pow(2, e));
  };
  var nf = (function(t) {
    return t.Success = "success", t.Failure = "failure", t.Logout = "logout", t;
  })({}), Vxe = 500, Hxe = 60 * 1e3;
  class $xe {
    constructor(e) {
      this.opts = e, $(this, "tokenRefreshPromise", void 0), $(this, "latestTokenRefreshExpiry", void 0);
    }
    prepareForRequest() {
      var e = this;
      return me(function* () {
        return yield e.refreshIfNeeded(), {
          accessToken: e.opts.accessToken,
          refreshToken: e.opts.refreshToken,
          expiry: e.latestTokenRefreshExpiry
        };
      })();
    }
    refreshIfNeeded() {
      var e = this;
      return me(function* () {
        if (e.tokenRefreshPromise) return e.tokenRefreshPromise;
        if (e.latestTokenRefreshExpiry) {
          var n = e.latestTokenRefreshExpiry.getTime() - Date.now();
          n <= Vxe && (yield e._handleUnknownToken());
        }
      })();
    }
    handleUnknownToken(e, n) {
      var r = this;
      return me(function* () {
        return r._handleUnknownToken(e, n);
      })();
    }
    _handleUnknownToken(e, n) {
      var r = this;
      return me(function* () {
        if (e != null && e.expiry) {
          var i = e.expiry.getTime() - Date.now();
          if (i >= Hxe) return nf.Logout;
        }
        if (!e || (e == null ? void 0 : e.accessToken) === r.opts.accessToken) {
          var a;
          (a = r.tokenRefreshPromise) !== null && a !== void 0 || (r.tokenRefreshPromise = r.doTokenRefresh(n));
          try {
            return yield r.tokenRefreshPromise;
          } finally {
            r.tokenRefreshPromise = void 0;
          }
        }
        return nf.Success;
      })();
    }
    doTokenRefresh(e) {
      var n = this;
      return me(function* () {
        if (!n.opts.refreshToken || !n.opts.tokenRefreshFunction) {
          var r;
          return (r = n.opts.logger) === null || r === void 0 || r.error("Unable to refresh token - no refresh token or refresh function"), nf.Logout;
        }
        e && e > 1 && (yield Ug(1e3 * Math.min(32, 2 ** e)));
        try {
          var i, a;
          (i = n.opts.logger) === null || i === void 0 || i.debug("Attempting to refresh token");
          var { accessToken: s, refreshToken: l, expiry: c } = yield n.opts.tokenRefreshFunction(n.opts.refreshToken);
          return n.opts.accessToken = s, n.opts.refreshToken = l, n.latestTokenRefreshExpiry = c, (a = n.opts.logger) === null || a === void 0 || a.debug("... token refresh complete, new token expiry:", c), nf.Success;
        } catch (h) {
          var d;
          if (h instanceof X7 || h instanceof Un) {
            var u;
            return (u = n.opts.logger) === null || u === void 0 || u.error("Failed to refresh token", h), nf.Logout;
          }
          return (d = n.opts.logger) === null || d === void 0 || d.warn("Failed to refresh token", h), nf.Failure;
        }
      })();
    }
  }
  function vH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function _H(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? vH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : vH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  class Wxe {
    constructor(e, n) {
      var r;
      if (this.eventEmitter = e, this.opts = n, $(this, "abortController", new AbortController()), $(this, "tokenRefresher", void 0), rne(n, [
        "baseUrl",
        "prefix"
      ]), !n.onlyData) throw new Error("Constructing FetchHttpApi without `onlyData=true` is no longer supported.");
      n.useAuthorizationHeader = (r = n.useAuthorizationHeader) !== null && r !== void 0 ? r : true, this.tokenRefresher = new $xe(n);
    }
    abort() {
      this.abortController.abort(), this.abortController = new AbortController();
    }
    fetch(e, n) {
      return this.opts.fetchFn ? this.opts.fetchFn(e, n) : globalThis.fetch(e, n);
    }
    setIdBaseUrl(e) {
      this.opts.idBaseUrl = e;
    }
    idServerRequest(e, n, r, i, a) {
      if (!this.opts.idBaseUrl) throw new Error("No identity server base URL set");
      var s = void 0, l = void 0;
      e === rt.Get ? s = r : l = r;
      var c = this.getUrl(n, s, i, this.opts.idBaseUrl), d = {
        json: true,
        headers: {}
      };
      return a && (d.headers.Authorization = "Bearer ".concat(a)), this.requestOtherUrl(e, c, l, d);
    }
    authedRequest(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {};
      return this.doAuthedRequest(1, e, n, r, i, a);
    }
    doAuthedRequest(e, n, r, i, a) {
      var s = arguments, l = this;
      return me(function* () {
        var c = s.length > 5 && s[5] !== void 0 ? s[5] : {}, d = Gb(c);
        d.abortSignal = c.abortSignal;
        var u = yield l.tokenRefresher.prepareForRequest();
        u.accessToken && (l.opts.useAuthorizationHeader ? (d.headers || (d.headers = {}), d.headers.Authorization || (d.headers.Authorization = "Bearer ".concat(u.accessToken)), i.access_token && delete i.access_token) : i.access_token || (i.access_token = u.accessToken));
        try {
          var h = yield l.request(n, r, i, a, d);
          return h;
        } catch (g) {
          if (!(g instanceof Un)) throw g;
          if (g.errcode === "M_UNKNOWN_TOKEN") {
            var f = yield l.tokenRefresher.handleUnknownToken(u, e);
            if (f === nf.Success) return l.doAuthedRequest(e + 1, n, r, i, a, c);
            if (f === nf.Failure) throw new Lne(g);
            d != null && d.inhibitLogoutEmit || l.eventEmitter.emit(I2.SessionLoggedOut, g);
          } else g.errcode == "M_CONSENT_NOT_GIVEN" && l.eventEmitter.emit(I2.NoConsent, g.message, g.data.consent_uri);
          throw g;
        }
      })();
    }
    request(e, n, r, i, a) {
      var s = this.getUrl(n, r, a == null ? void 0 : a.prefix, a == null ? void 0 : a.baseUrl);
      return this.requestOtherUrl(e, s, i, a);
    }
    requestOtherUrl(e, n, r) {
      var i = arguments, a = this;
      return me(function* () {
        var s, l, c, d, u = i.length > 3 && i[3] !== void 0 ? i[3] : {};
        if (u.json !== void 0 && u.rawResponseBody !== void 0) throw new Error("Invalid call to `FetchHttpApi` sets both `opts.json` and `opts.rawResponseBody`");
        var h = a.sanitizeUrlForLogs(n);
        (s = a.opts.logger) === null || s === void 0 || s.debug("FetchHttpApi: --> ".concat(e, " ").concat(h));
        var f = Object.assign({}, u.headers || {}), g = !u.rawResponseBody && u.json !== false;
        g && (f.Accept || (f.Accept = "application/json"));
        var m = (l = u.localTimeoutMs) !== null && l !== void 0 ? l : a.opts.localTimeoutMs, v = (c = u.keepAlive) !== null && c !== void 0 ? c : false, y = [
          a.abortController.signal
        ];
        m !== void 0 && y.push(sk(m)), u.abortSignal && y.push(u.abortSignal);
        var w;
        u.json !== false && (r == null || (d = r.constructor) === null || d === void 0 ? void 0 : d.name) === Object.name ? (w = JSON.stringify(r), f["Content-Type"] || (f["Content-Type"] = "application/json")) : w = r;
        var { signal: b, cleanup: j } = Nne(y), k, C = Date.now();
        try {
          var x;
          k = yield a.fetch(n, {
            signal: b,
            method: e,
            body: w,
            headers: f,
            mode: "cors",
            redirect: "follow",
            referrer: "",
            referrerPolicy: "no-referrer",
            cache: "no-cache",
            credentials: "omit",
            keepalive: v,
            priority: u.priority
          }), (x = a.opts.logger) === null || x === void 0 || x.debug("FetchHttpApi: <-- ".concat(e, " ").concat(h, " [").concat(Date.now() - C, "ms ").concat(k.status, "]"));
        } catch (T) {
          var S;
          throw (S = a.opts.logger) === null || S === void 0 || S.debug("FetchHttpApi: <-- ".concat(e, " ").concat(h, " [").concat(Date.now() - C, "ms ").concat(T, "]")), T.name === "AbortError" ? T : new vp("fetch failed", T);
        } finally {
          j();
        }
        if (!k.ok) throw Q7(k, yield k.text());
        return u.rawResponseBody ? yield k.blob() : g ? yield k.json() : yield k.text();
      })();
    }
    sanitizeUrlForLogs(e) {
      try {
        var n;
        typeof e == "string" ? n = new URL(e) : n = e;
        var r = new URLSearchParams();
        for (var i of n.searchParams.keys()) r.append(i, "xxx");
        var a = r.toString(), s = a ? "?".concat(a) : "";
        return n.origin + n.pathname + s;
      } catch {
        return "??";
      }
    }
    getUrl(e, n, r, i) {
      var a = i ?? this.opts.baseUrl, s = a.endsWith("/") ? a.slice(0, -1) : a, l = new URL(s + (r ?? this.opts.prefix) + e);
      if (this.opts.extraParams || n) {
        var c = _H(_H({}, this.opts.extraParams), n);
        OR(c, l.searchParams);
      }
      return l;
    }
  }
  let _u, c1, qxe, Kxe, Yj, Ru, Gxe;
  zo = (function(t) {
    return t.V1 = "/_matrix/client/v1", t.V3 = "/_matrix/client/v3", t.Unstable = "/_matrix/client/unstable", t;
  })({});
  _u = (function(t) {
    return t.V2 = "/_matrix/identity/v2", t;
  })({});
  c1 = (function(t) {
    return t.V1 = "/_matrix/media/v1", t.V3 = "/_matrix/media/v3", t;
  })({});
  qxe = 1e3;
  Kxe = 0;
  Ru = [];
  Gxe = function() {
  };
  function yH(t, e) {
    for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++) r[i - 2] = arguments[i];
    e = e || 0, e < 0 && (e = 0);
    var a = Date.now() + e, s = Kxe++, l = {
      runAt: a,
      func: t,
      params: r,
      key: s
    }, c = Zxe(Ru, function(d) {
      return d.runAt - a;
    });
    return Ru.splice(c, 0, l), eB(), s;
  }
  function bH(t) {
    if (Ru.length !== 0) {
      var e;
      for (e = 0; e < Ru.length; e++) {
        var n = Ru[e];
        if (n.key == t) {
          Ru.splice(e, 1);
          break;
        }
      }
      e === 0 && eB();
    }
  }
  function eB() {
    Yj && globalThis.clearTimeout(Yj);
    var t = Ru[0];
    if (t) {
      var e = Date.now(), n = Math.min(t.runAt - e, qxe);
      Yj = globalThis.setTimeout(Yxe, n);
    }
  }
  function Yxe() {
    for (var t = Date.now(), e = []; ; ) {
      var n = Ru[0];
      if (!n || n.runAt > t) break;
      var r = Ru.shift();
      Gxe("runCallbacks: popping", r.key), e.push(r);
    }
    eB();
    for (var i of e) try {
      i.func.apply(globalThis, i.params);
    } catch (a) {
      _e.error("Uncaught exception in callback function", a);
    }
  }
  function Zxe(t, e) {
    for (var n = 0, r = t.length; n < r; ) {
      var i = n + r >> 1, a = e(t[i]);
      a > 0 ? r = i : n = i + 1;
    }
    return n;
  }
  class Une extends Wxe {
    constructor() {
      super(...arguments), $(this, "uploads", []);
    }
    uploadContent(e) {
      var n, r, i, a, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = (n = s.includeFilename) !== null && n !== void 0 ? n : true, c = (r = s.abortController) !== null && r !== void 0 ? r : new AbortController(), d = ((i = s.type) !== null && i !== void 0 ? i : e.type) || "application/octet-stream", u = (a = s.name) !== null && a !== void 0 ? a : e.name, h = {
        loaded: 0,
        total: 0,
        abortController: c
      }, f = Promise.withResolvers();
      if (globalThis.XMLHttpRequest) {
        var g = new globalThis.XMLHttpRequest(), m = function() {
          g.abort(), f.reject(new Error("Timeout"));
        }, v = yH(m, 3e4);
        g.onreadystatechange = function() {
          switch (g.readyState) {
            case globalThis.XMLHttpRequest.DONE:
              bH(v);
              try {
                if (g.status === 0) throw new DOMException(g.statusText, "AbortError");
                if (!g.responseText) throw new Error("No response body.");
                g.status >= 400 ? f.reject(Q7(g, g.responseText)) : f.resolve(JSON.parse(g.responseText));
              } catch (j) {
                if (j.name === "AbortError") {
                  f.reject(j);
                  return;
                }
                f.reject(new vp("request failed", j));
              }
              break;
          }
        }, g.upload.onprogress = (j) => {
          var k;
          bH(v), h.loaded = j.loaded, h.total = j.total, v = yH(m, 3e4), (k = s.progressHandler) === null || k === void 0 || k.call(s, {
            loaded: j.loaded,
            total: j.total
          });
        };
        var y = this.getUrl("/upload", void 0, c1.V3);
        l && u && y.searchParams.set("filename", encodeURIComponent(u)), !this.opts.useAuthorizationHeader && this.opts.accessToken && y.searchParams.set("access_token", encodeURIComponent(this.opts.accessToken)), g.open(rt.Post, y.href), this.opts.useAuthorizationHeader && this.opts.accessToken && g.setRequestHeader("Authorization", "Bearer " + this.opts.accessToken), g.setRequestHeader("Content-Type", d), g.send(e), c.signal.addEventListener("abort", () => {
          g.abort();
        });
      } else {
        var w = {};
        l && u && (w.filename = u);
        var b = {
          "Content-Type": d
        };
        this.authedRequest(rt.Post, "/upload", w, e, {
          prefix: c1.V3,
          headers: b,
          abortSignal: c.signal
        }).then(f.resolve, f.reject);
      }
      return h.promise = f.promise.finally(() => {
        HC(this.uploads, (j) => j === h);
      }), c.signal.addEventListener("abort", () => {
        HC(this.uploads, (j) => j === h), f.reject(new DOMException("Aborted", "AbortError"));
      }), this.uploads.push(h), h.promise;
    }
    cancelUpload(e) {
      var n = this.uploads.find((r) => r.promise === e);
      return n ? (n.abortController.abort(), true) : false;
    }
    getCurrentUploads() {
      return this.uploads;
    }
    getContentUri() {
      return {
        base: this.opts.baseUrl,
        path: c1.V3 + "/upload",
        params: {
          access_token: this.opts.accessToken
        }
      };
    }
  }
  var Jxe = 360 * 60 * 1e3, Xxe = 30 * 1e3, Vne = (function(t) {
    return t.Stable = "stable", t.Unstable = "unstable", t;
  })({});
  class Hne {
    constructor(e, n) {
      var r = this;
      this.logger = e, this.http = n, $(this, "capabilities", void 0), $(this, "retryTimeout", void 0), $(this, "refreshTimeout", void 0), $(this, "fetchCapabilities", me(function* () {
        var i = yield r.http.authedRequest(rt.Get, "/capabilities");
        return r.capabilities = i.capabilities, r.capabilities;
      })), $(this, "poll", me(function* () {
        try {
          yield r.fetchCapabilities(), r.clearTimeouts(), r.refreshTimeout = setTimeout(r.poll, Jxe), r.logger.debug("Fetched new server capabilities");
        } catch (a) {
          r.clearTimeouts();
          var i = Math.floor(Xxe + Math.random() * 5e3);
          r.retryTimeout = setTimeout(r.poll, i), r.logger.warn("Failed to refresh capabilities: retrying in ".concat(i, "ms"), a);
        }
      }));
    }
    start() {
      this.poll().then();
    }
    stop() {
      this.clearTimeouts();
    }
    getCachedCapabilities() {
      return this.capabilities;
    }
    clearTimeouts() {
      this.refreshTimeout && (clearInterval(this.refreshTimeout), this.refreshTimeout = void 0), this.retryTimeout && (clearTimeout(this.retryTimeout), this.retryTimeout = void 0);
    }
  }
  function xH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function f_(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? xH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : xH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var $ne = "10", Qxe = [
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "10"
  ], ewe = 30, ir = (function(t) {
    return t.Highlight = "highlight", t.Total = "total", t;
  })({}), mt = (function(t) {
    return t.MyMembership = "Room.myMembership", t.Tags = "Room.tags", t.AccountData = "Room.accountData", t.Receipt = "Room.receipt", t.Name = "Room.name", t.Redaction = "Room.redaction", t.RedactionCancelled = "Room.redactionCancelled", t.LocalEchoUpdated = "Room.localEchoUpdated", t.Timeline = "Room.timeline", t.TimelineReset = "Room.timelineReset", t.TimelineRefresh = "Room.TimelineRefresh", t.OldStateUpdated = "Room.OldStateUpdated", t.CurrentStateUpdated = "Room.CurrentStateUpdated", t.HistoryImportedWithinTimeline = "Room.historyImportedWithinTimeline", t.UnreadNotifications = "Room.UnreadNotifications", t.Summary = "Room.Summary", t;
  })({});
  let lk = class extends Fne {
    constructor(e, n, r) {
      var i, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
      super(), i = this, this.roomId = e, this.client = n, this.myUserId = r, this.opts = a, $(this, "reEmitter", void 0), $(this, "txnToEvent", /* @__PURE__ */ new Map()), $(this, "notificationCounts", {}), $(this, "bumpStamp", void 0), $(this, "threadNotifications", /* @__PURE__ */ new Map()), $(this, "cachedThreadReadReceipts", /* @__PURE__ */ new Map()), $(this, "oldestThreadedReceiptTs", 1 / 0), $(this, "unthreadedReceipts", /* @__PURE__ */ new Map()), $(this, "timelineSets", void 0), $(this, "polls", /* @__PURE__ */ new Map()), $(this, "threadsTimelineSets", []), $(this, "filteredTimelineSets", {}), $(this, "timelineNeedsRefresh", false), $(this, "pendingEventList", void 0), $(this, "blacklistUnverifiedDevices", void 0), $(this, "selfMembership", void 0), $(this, "heroes", null), $(this, "getTypeWarning", false), $(this, "membersPromise", void 0), $(this, "name", void 0), $(this, "normalizedName", void 0), $(this, "tags", {}), $(this, "accountData", /* @__PURE__ */ new Map()), $(this, "summary", null), $(this, "oldState", void 0), $(this, "currentState", void 0), $(this, "relations", void 0), $(this, "threads", /* @__PURE__ */ new Map()), $(this, "visibilityEvents", /* @__PURE__ */ new Map()), $(this, "roomReceipts", new Sxe(this)), $(this, "threadTimelineSetsPromise", null), $(this, "threadsReady", false), $(this, "updateThreadRootEvents", (s, l, c) => {
        if (s.length) {
          var d;
          if (this.updateThreadRootEvent((d = this.threadsTimelineSets) === null || d === void 0 ? void 0 : d[0], s, l, c), s.hasCurrentUserParticipated) {
            var u;
            this.updateThreadRootEvent((u = this.threadsTimelineSets) === null || u === void 0 ? void 0 : u[1], s, l, c);
          }
        }
      }), $(this, "updateThreadRootEvent", (s, l, c, d) => {
        s && l.rootEvent && (d && s.removeEvent(l.id), Ei.hasServerSideSupport ? s.addLiveEvent(l.rootEvent, {
          duplicateStrategy: l1.Replace,
          fromCache: false,
          roomState: this.currentState,
          addToState: false
        }) : s.addEventToTimeline(l.rootEvent, s.getLiveTimeline(), {
          toStartOfTimeline: c,
          addToState: false
        }));
      }), $(this, "tryApplyRedaction", (s) => {
        if (s.isRedaction()) {
          var l = s.event.redacts, c = l ? this.findEventById(l) : void 0;
          c && this.applyEventAsRedaction(s, c);
        } else if (s.getType() === ce.RoomMember) {
          var d = s.getContent().membership;
          if (d !== Ht.Ban && !(d === Ht.Leave && s.getStateKey() !== s.getSender())) return;
          var u = s.getContent()["org.matrix.msc4293.redact_events"];
          if (u !== true) return;
          var h = this.getLiveTimeline().getState(Tn.Forward);
          if (!h.maySendRedactionForEvent(s, s.getSender())) return;
          var f = this.getTimelineSets().map((m) => m.getTimelines()).reduce((m, v) => (m.push(...v), m), []).map((m) => m.getEvents().filter((v) => v.getSender() === s.getStateKey())).reduce((m, v) => (m.push(...v), v), []);
          for (var g of f) this.applyEventAsRedaction(s, g);
        }
      }), this.setMaxListeners(100), this.reEmitter = new IF(this), a.pendingEventOrdering = a.pendingEventOrdering || $1.Chronological, this.name = e, this.normalizedName = e, this.relations = new Ane(this.client, this), this.on(mt.Receipt, this.onReceipt), this.timelineSets = [
        new H0(this, a)
      ], this.reEmitter.reEmit(this.getUnfilteredTimelineSet(), [
        mt.Timeline,
        mt.TimelineReset
      ]), this.fixUpLegacyTimelineFields(), this.opts.pendingEventOrdering === $1.Detached && (this.pendingEventList = [], this.client.store.getPendingEvents(this.roomId).then((s) => {
        var l = this.client.getEventMapper({
          decrypt: false
        });
        s.forEach((function() {
          var c = me(function* (d) {
            var u = l(d);
            yield n.decryptEventIfNeeded(u), u.setStatus(Vn.NOT_SENT), i.addPendingEvent(u, u.getTxnId());
          });
          return function(d) {
            return c.apply(this, arguments);
          };
        })());
      })), this.opts.lazyLoadMembers ? this.membersPromise = void 0 : this.membersPromise = Promise.resolve(false);
    }
    createThreadsTimelineSets() {
      var e = this;
      return me(function* () {
        var n;
        if (e.threadTimelineSetsPromise) return e.threadTimelineSetsPromise;
        if ((n = e.client) !== null && n !== void 0 && n.supportsThreads()) try {
          e.threadTimelineSetsPromise = Promise.all([
            e.createThreadTimelineSet(),
            e.createThreadTimelineSet(xc.My)
          ]);
          var r = yield e.threadTimelineSetsPromise;
          return e.threadsTimelineSets[0] = r[0], e.threadsTimelineSets[1] = r[1], r;
        } catch {
          return e.threadTimelineSetsPromise = null, null;
        }
        return null;
      })();
    }
    decryptCriticalEvents() {
      var e = this;
      return me(function* () {
        if (e.client.getCrypto()) {
          var n = e.getEventReadUpTo(e.client.getUserId(), true), r = e.getLiveTimeline().getEvents(), i = r.findIndex((s) => s.event.event_id === n), a = r.slice(i).reverse().map((s) => e.client.decryptEventIfNeeded(s));
          yield Promise.allSettled(a);
        }
      })();
    }
    decryptAllEvents() {
      var e = this;
      return me(function* () {
        if (e.client.getCrypto()) {
          var n = e.getUnfilteredTimelineSet().getLiveTimeline().getEvents().slice(0).reverse().map((r) => e.client.decryptEventIfNeeded(r));
          yield Promise.allSettled(n);
        }
      })();
    }
    getCreator() {
      var e, n = this.currentState.getStateEvents(ce.RoomCreate, "");
      return (e = n == null ? void 0 : n.getSender()) !== null && e !== void 0 ? e : null;
    }
    getVersion() {
      return this.currentState.getRoomVersion();
    }
    getRecommendedVersion() {
      var e = this;
      return me(function* () {
        var n = {};
        try {
          n = yield e.client.getCapabilities();
        } catch {
        }
        var r = n["m.room_versions"];
        if (!r) {
          r = {
            default: $ne,
            available: {}
          };
          for (var i of Qxe) r.available[i] = Vne.Stable;
        }
        var a = e.checkVersionAgainstCapability(r);
        if (a.urgent && a.needsUpgrade) {
          _e.warn("Refreshing room version capability because the server looks to be supporting a newer room version we don't know about.");
          try {
            n = yield e.client.fetchCapabilities();
          } catch (s) {
            _e.warn("Failed to refresh room version capabilities", s);
          }
          if (r = n["m.room_versions"], r) a = e.checkVersionAgainstCapability(r);
          else return _e.warn("No room version capability - assuming upgrade required."), a;
        }
        return a;
      })();
    }
    checkVersionAgainstCapability(e) {
      var n = this.getVersion();
      _e.log("[".concat(this.roomId, "] Current version: ").concat(n)), _e.log("[".concat(this.roomId, "] Version capability: "), e);
      var r = {
        version: n,
        needsUpgrade: false,
        urgent: false
      };
      if (n === e.default) return r;
      var i = Object.keys(e.available).filter((a) => e.available[a] === "stable");
      return i.includes(n) || (r.version = e.default, r.needsUpgrade = true, r.urgent = !!this.getVersion().match(/^[0-9]+[0-9.]*$/g), r.urgent ? _e.warn("URGENT upgrade required on ".concat(this.roomId)) : _e.warn("Non-urgent upgrade required on ".concat(this.roomId))), r;
    }
    userMayUpgradeRoom(e) {
      return this.currentState.maySendStateEvent(ce.RoomTombstone, e);
    }
    getPendingEvents() {
      if (!this.pendingEventList) throw new Error("Cannot call getPendingEvents with pendingEventOrdering == " + this.opts.pendingEventOrdering);
      return this.pendingEventList;
    }
    removePendingEvent(e) {
      if (!this.pendingEventList) throw new Error("Cannot call removePendingEvent with pendingEventOrdering == " + this.opts.pendingEventOrdering);
      var n = HC(this.pendingEventList, function(r) {
        return r.getId() == e;
      }, false);
      return this.savePendingEvents(), n;
    }
    hasPendingEvent(e) {
      var n, r;
      return (n = (r = this.pendingEventList) === null || r === void 0 ? void 0 : r.some((i) => i.getId() === e)) !== null && n !== void 0 ? n : false;
    }
    getPendingEvent(e) {
      var n, r;
      return (n = (r = this.pendingEventList) === null || r === void 0 ? void 0 : r.find((i) => i.getId() === e)) !== null && n !== void 0 ? n : null;
    }
    getLiveTimeline() {
      return this.getUnfilteredTimelineSet().getLiveTimeline();
    }
    get timeline() {
      return this.getLiveTimeline().getEvents();
    }
    getLastActiveTimestamp() {
      var e = this.getLiveTimeline(), n = e.getEvents();
      if (n.length) {
        var r = n[n.length - 1];
        return r.getTs();
      } else return Number.MIN_SAFE_INTEGER;
    }
    getLastLiveEvent() {
      var e, n, r = this.getLiveTimeline().getEvents(), i = r[r.length - 1], a = this.getLastThread();
      if (!a) return i;
      var s = a.events[a.events.length - 1];
      return ((e = i == null ? void 0 : i.getTs()) !== null && e !== void 0 ? e : 0) > ((n = s == null ? void 0 : s.getTs()) !== null && n !== void 0 ? n : 0) ? i : s;
    }
    getLastThread() {
      return this.getThreads().reduce((e, n) => {
        var r, i;
        if (!e) return n;
        var a = n.events[n.events.length - 1], s = e.events[e.events.length - 1];
        return ((r = a == null ? void 0 : a.getTs()) !== null && r !== void 0 ? r : 0) >= ((i = s == null ? void 0 : s.getTs()) !== null && i !== void 0 ? i : 0) ? n : e;
      }, void 0);
    }
    getMyMembership() {
      var e;
      return (e = this.selfMembership) !== null && e !== void 0 ? e : Ht.Leave;
    }
    getDMInviter() {
      var e = this.getMember(this.myUserId);
      if (e) return e.getDMInviter();
      if (this.selfMembership === Ht.Invite) {
        var n = this.getInvitedAndJoinedMemberCount();
        if (n === 2) {
          var r;
          return (r = this.heroes) === null || r === void 0 || (r = r[0]) === null || r === void 0 ? void 0 : r.userId;
        }
      }
    }
    guessDMUserId() {
      var e = this.getMember(this.myUserId);
      if (e) {
        var n = e.getDMInviter();
        if (n) return n;
      }
      if (Array.isArray(this.heroes) && this.heroes.length) return this.heroes[0].userId;
      var r = this.currentState.getMembers(), i = r.find((a) => a.userId !== this.myUserId);
      return i ? i.userId : this.myUserId;
    }
    getFunctionalMembers() {
      var e = this.currentState.getStateEvents(hne.name, "");
      return Array.isArray(e == null ? void 0 : e.getContent().service_members) ? e.getContent().service_members : [];
    }
    getAvatarFallbackMember() {
      var e, n = this.getFunctionalMembers(), r = 0;
      if (this.getMembers().forEach((v) => {
        v.membership !== "join" && v.membership !== "invite" || n.includes(v.userId) || r++;
      }), !(r > 2)) {
        var i = (e = this.heroes) === null || e === void 0 ? void 0 : e.filter((v) => !n.includes(v.userId)), a = Array.isArray(i) && i.length;
        if (a) {
          for (var s of i) if (s.fromMSC4186) {
            var c = new S2(this.roomId, s.userId);
            return c.setMembershipEvent(new to({
              event_id: "$" + this.roomId + s.userId + (/* @__PURE__ */ new Date()).getTime(),
              type: ce.RoomMember,
              state_key: s.userId,
              content: {
                displayname: s.displayName,
                avatar_url: s.avatarUrl
              }
            })), c;
          } else {
            var l = this.getMember(s.userId);
            if (l) return l;
          }
          var d = i.map((v) => this.getMember(v.userId)).find((v) => !!v);
          if (d) return d;
        }
        var u = this.getMembers(), h = u == null ? void 0 : u.filter((v) => !n.includes(v.userId));
        if (h.length <= 2) {
          var f = h.find((v) => v.userId !== this.myUserId);
          if (f) return f;
        }
        if (a) {
          var g = i.map((v) => this.client.getUser(v.userId)).find((v) => !!v);
          if (g) {
            var m = new S2(this.roomId, g.userId);
            return m.user = g, m;
          }
        }
      }
    }
    updateMyMembership(e) {
      var n = this.selfMembership;
      this.selfMembership = e, n !== e && (e === Ht.Leave && this.cleanupAfterLeaving(), this.emit(mt.MyMembership, this, e, n));
    }
    loadMembersFromServer() {
      var e = this;
      return me(function* () {
        var n = e.client.store.getSyncToken(), r = yield e.client.members(e.roomId, void 0, Ht.Leave, n ?? void 0);
        return r.chunk;
      })();
    }
    loadMembers() {
      var e = this;
      return me(function* () {
        var n = false, r = yield e.client.store.getOutOfBandMembers(e.roomId);
        (r === null || e.hasEncryptionStateEvent()) && (n = true, r = yield e.loadMembersFromServer(), _e.log("LL: got ".concat(r.length, " ") + "members from server for room ".concat(e.roomId)));
        var i = r.filter(Dc).map(e.client.getEventMapper());
        return {
          memberEvents: i,
          fromServer: n
        };
      })();
    }
    membersLoaded() {
      return this.opts.lazyLoadMembers ? this.currentState.outOfBandMembersReady() : true;
    }
    loadMembersIfNeeded() {
      if (this.membersPromise) return this.membersPromise;
      this.currentState.markOutOfBandMembersStarted();
      var e = this.loadMembers().then((n) => (this.currentState.setOutOfBandMembers(n.memberEvents), n.fromServer)).catch((n) => {
        throw this.membersPromise = void 0, this.currentState.markOutOfBandMembersFailed(), n;
      });
      return e.then((n) => {
        if (n) {
          var r = this.currentState.getMembers().filter((a) => a.isOutOfBand()).map((a) => {
            var s;
            return (s = a.events.member) === null || s === void 0 ? void 0 : s.event;
          });
          _e.log("LL: telling store to write ".concat(r.length) + " members for room ".concat(this.roomId));
          var i = this.client.store;
          return i.setOutOfBandMembers(this.roomId, r).catch((a) => {
            _e.log("LL: storing OOB room members failed, oh well", a);
          });
        }
      }).catch((n) => {
        _e.error(n);
      }), this.membersPromise = e, this.membersPromise;
    }
    clearLoadedMembersIfNeeded() {
      var e = this;
      return me(function* () {
        e.opts.lazyLoadMembers && e.membersPromise && (yield e.loadMembersIfNeeded(), yield e.client.store.clearOutOfBandMembers(e.roomId), e.currentState.clearOutOfBandMembers(), e.membersPromise = void 0);
      })();
    }
    cleanupAfterLeaving() {
      this.clearLoadedMembersIfNeeded().catch((e) => {
        _e.error("error after clearing loaded members from " + "room ".concat(this.roomId, " after leaving")), _e.log(e);
      });
    }
    refreshLiveTimeline() {
      var e = this;
      return me(function* () {
        var n = e.getLiveTimeline(), r = n.getPaginationToken(en.FORWARDS), i = n.getPaginationToken(en.BACKWARDS), a = n.getEvents(), s = a[a.length - 1];
        _e.log("[refreshLiveTimeline for ".concat(e.roomId, "] at ") + "mostRecentEventInTimeline=".concat(s && s.getId(), " ") + "liveTimelineBefore=".concat(n.toString(), " ") + "forwardPaginationToken=".concat(r, " ") + "backwardPaginationToken=".concat(i));
        var l = e.getUnfilteredTimelineSet(), c;
        s ? (e.resetLiveTimeline(null, null), e.emit(mt.TimelineRefresh, e, l), c = yield e.client.getEventTimeline(l, s.getId())) : c = yield e.client.getLatestTimeline(l);
        var d = l.getLiveTimeline();
        !d || d.getPaginationToken(Tn.Forward) === null && d.getPaginationToken(Tn.Backward) === null && d.getEvents().length === 0 ? (_e.log("[refreshLiveTimeline for ".concat(e.roomId, "] using our new live timeline")), c.setPaginationToken(r, en.FORWARDS), l.setLiveTimeline(c), e.fixUpLegacyTimelineFields()) : _e.log("[refreshLiveTimeline for ".concat(e.roomId, "] `/sync` or some other request beat us to creating a new ") + "live timeline after we reset it. We'll use that instead since any events in the scrollback from this timeline will include the history."), e.setTimelineNeedsRefresh(false), e.emit(mt.TimelineRefresh, e, l);
      })();
    }
    resetLiveTimeline(e, n) {
      for (var r of this.timelineSets) r.resetLiveTimeline(e ?? void 0, n ?? void 0);
      for (var i of this.threads.values()) i.resetLiveTimeline(e, n);
      this.fixUpLegacyTimelineFields();
    }
    fixUpLegacyTimelineFields() {
      var e = this.oldState, n = this.currentState;
      this.oldState = this.getLiveTimeline().getState(en.BACKWARDS), this.currentState = this.getLiveTimeline().getState(en.FORWARDS), e !== this.oldState && this.emit(mt.OldStateUpdated, this, e, this.oldState), n !== this.currentState && (this.emit(mt.CurrentStateUpdated, this, n, this.currentState), this.reEmitter.stopReEmitting(n, [
        qn.Events,
        qn.Members,
        qn.NewMember,
        qn.Update,
        qn.Marker,
        Ii.New,
        Ii.Update,
        Ii.Destroy,
        Ii.LivenessChange
      ]), this.reEmitter.reEmit(this.currentState, [
        qn.Events,
        qn.Members,
        qn.NewMember,
        qn.Update,
        qn.Marker,
        Ii.New,
        Ii.Update,
        Ii.Destroy,
        Ii.LivenessChange
      ]));
    }
    onReceipt(e) {
      this.hasEncryptionStateEvent() && this.clearNotificationsOnReceipt(e);
    }
    clearNotificationsOnReceipt(e) {
      var n = [], r = false, i = e.getContent();
      for (var a of Object.values(i)) for (var [s, l] of Object.entries(a)) if ($7(s) && l) {
        for (var [c, d] of Object.entries(l)) if (!(!d || typeof d != "object")) {
          var u = d;
          c === this.client.getUserId() && (u.thread_id === void 0 ? r = true : typeof u.thread_id == "string" && n.push(u.thread_id));
        }
      }
      r && (n = this.getThreads().filter((C) => this.getThreadUnreadNotificationCount(C.id, ir.Total) > 0 || this.getThreadUnreadNotificationCount(C.id, ir.Highlight) > 0).map((C) => C.id), n.push("main"));
      for (var h of n) {
        var f, g = 20, m = h === "main" ? this.getLiveTimeline() : (f = this.getThread(h)) === null || f === void 0 ? void 0 : f.liveTimeline;
        if (!m) {
          _e.warn("Couldn't find timeline for thread ID ".concat(h, " in room ").concat(this.roomId));
          continue;
        }
        for (var v = m.getEvents(), y = 0, w = v.length - 1; w >= 0; w--) {
          var b;
          if (w === v.length - g) return;
          var j = v[w];
          if (this.hasUserReadEvent(this.client.getUserId(), j.getId())) break;
          var k = this.client.getPushActionsForEvent(j);
          y += k != null && (b = k.tweaks) !== null && b !== void 0 && b.highlight ? 1 : 0;
        }
        h === "main" ? this.setUnreadNotificationCount(ir.Highlight, y) : this.setThreadUnreadNotificationCount(h, ir.Highlight, y);
      }
    }
    getTimelineSets() {
      return this.timelineSets;
    }
    getUnfilteredTimelineSet() {
      return this.timelineSets[0];
    }
    getTimelineForEvent(e) {
      var n = this.findEventById(e), r = this.findThreadForEvent(n);
      return r ? r.timelineSet.getTimelineForEvent(e) : this.getUnfilteredTimelineSet().getTimelineForEvent(e);
    }
    addTimeline() {
      return this.getUnfilteredTimelineSet().addTimeline();
    }
    setTimelineNeedsRefresh(e) {
      this.timelineNeedsRefresh = e;
    }
    getTimelineNeedsRefresh() {
      return this.timelineNeedsRefresh;
    }
    findEventById(e) {
      var n = this.getUnfilteredTimelineSet().findEventById(e);
      if (!n) for (var r = this.getThreads(), i = 0; i < r.length; i++) {
        var a = r[i];
        if (n = a.findEventById(e), n) return n;
      }
      return n;
    }
    getUnreadNotificationCount() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ir.Total, n = this.getRoomUnreadNotificationCount(e);
      for (var r of this.threadNotifications.values()) {
        var i;
        n += (i = r[e]) !== null && i !== void 0 ? i : 0;
      }
      return n;
    }
    getUnreadCountForEventContext() {
      var e, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ir.Total, r = arguments.length > 1 ? arguments[1] : void 0, i = !!r.threadRootId && !r.isThreadRoot;
      return (e = i ? this.getThreadUnreadNotificationCount(r.threadRootId, n) : this.getRoomUnreadNotificationCount(n)) !== null && e !== void 0 ? e : 0;
    }
    getRoomUnreadNotificationCount() {
      var e, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ir.Total;
      return (e = this.notificationCounts[n]) !== null && e !== void 0 ? e : 0;
    }
    getThreadUnreadNotificationCount(e) {
      var n, r, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ir.Total;
      return (n = (r = this.threadNotifications.get(e)) === null || r === void 0 ? void 0 : r[i]) !== null && n !== void 0 ? n : 0;
    }
    hasThreadUnreadNotification() {
      for (var e of this.threadNotifications.values()) {
        var n, r;
        if (((n = e.highlight) !== null && n !== void 0 ? n : 0) > 0 || ((r = e.total) !== null && r !== void 0 ? r : 0) > 0) return true;
      }
      return false;
    }
    setThreadUnreadNotificationCount(e, n, r) {
      var i, a, s = f_({
        highlight: (i = this.threadNotifications.get(e)) === null || i === void 0 ? void 0 : i.highlight,
        total: (a = this.threadNotifications.get(e)) === null || a === void 0 ? void 0 : a.total
      }, {
        [n]: r
      });
      this.threadNotifications.set(e, s), this.emit(mt.UnreadNotifications, s, e);
    }
    get threadsAggregateNotificationType() {
      var e = null;
      for (var n of this.threadNotifications.values()) {
        var r, i;
        if (((r = n.highlight) !== null && r !== void 0 ? r : 0) > 0) return ir.Highlight;
        ((i = n.total) !== null && i !== void 0 ? i : 0) > 0 && !e && (e = ir.Total);
      }
      return e;
    }
    resetThreadUnreadNotificationCountFromSync() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], n = this.hasEncryptionStateEvent();
      for (var [r, i] of this.threadNotifications) e.includes(r) || (i.total = 0, n || (i.highlight = 0));
      this.emit(mt.UnreadNotifications);
    }
    setBumpStamp(e) {
      this.bumpStamp = e;
    }
    getBumpStamp() {
      return this.bumpStamp;
    }
    setUnreadNotificationCount(e, n) {
      this.notificationCounts[e] = n, this.emit(mt.UnreadNotifications, this.notificationCounts);
    }
    setUnread(e, n) {
      return this.setUnreadNotificationCount(e, n);
    }
    setSummary(e) {
      var n, r = (n = e["m.heroes"]) === null || n === void 0 ? void 0 : n.map((s) => ({
        userId: s,
        fromMSC4186: false
      })), i = e["m.joined_member_count"], a = e["m.invited_member_count"];
      Number.isInteger(i) && this.currentState.setJoinedMemberCount(i), Number.isInteger(a) && this.currentState.setInvitedMemberCount(a), Array.isArray(r) && (this.heroes = r.filter((s) => s.userId != this.myUserId)), this.emit(mt.Summary, e);
    }
    setMSC4186SummaryData(e, n, r) {
      e && (this.heroes = e.filter((i) => i.user_id !== this.myUserId).map((i) => ({
        userId: i.user_id,
        displayName: i.displayname,
        avatarUrl: i.avatar_url,
        fromMSC4186: true
      }))), n !== void 0 && Number.isInteger(n) && this.currentState.setJoinedMemberCount(n), r !== void 0 && Number.isInteger(r) && this.currentState.setInvitedMemberCount(r), this.emit(mt.Summary, {
        "m.heroes": this.heroes ? this.heroes.map((i) => i.userId) : [],
        "m.joined_member_count": n,
        "m.invited_member_count": r
      });
    }
    setBlacklistUnverifiedDevices(e) {
      this.blacklistUnverifiedDevices = e;
    }
    getBlacklistUnverifiedDevices() {
      return this.blacklistUnverifiedDevices === void 0 ? null : this.blacklistUnverifiedDevices;
    }
    getAvatarUrl(e, n, r, i) {
      var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, s = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false, l = this.currentState.getStateEvents(ce.RoomAvatar, "");
      if (!l && !a) return null;
      var c = l ? l.getContent().url : null;
      return c ? rk(e, c, n, r, i, void 0, void 0, s) : null;
    }
    getMxcAvatarUrl() {
      var e;
      return ((e = this.currentState.getStateEvents(ce.RoomAvatar, "")) === null || e === void 0 || (e = e.getContent()) === null || e === void 0 ? void 0 : e.url) || null;
    }
    getCanonicalAlias() {
      var e = this.currentState.getStateEvents(ce.RoomCanonicalAlias, "");
      return e && e.getContent().alias || null;
    }
    getAltAliases() {
      var e = this.currentState.getStateEvents(ce.RoomCanonicalAlias, "");
      return e ? e.getContent().alt_aliases || [] : [];
    }
    addEventsToTimeline(e, n, r, i, a) {
      i.getTimelineSet().addEventsToTimeline(e, n, r, i, a);
    }
    getThread(e) {
      var n;
      return (n = this.threads.get(e)) !== null && n !== void 0 ? n : null;
    }
    getThreads() {
      return Array.from(this.threads.values());
    }
    getMember(e) {
      return this.currentState.getMember(e);
    }
    getMembers() {
      return this.currentState.getMembers();
    }
    getJoinedMembers() {
      return this.getMembersWithMembership(Ht.Join);
    }
    getJoinedMemberCount() {
      return this.currentState.getJoinedMemberCount();
    }
    getInvitedMemberCount() {
      return this.currentState.getInvitedMemberCount();
    }
    getInvitedAndJoinedMemberCount() {
      return this.getInvitedMemberCount() + this.getJoinedMemberCount();
    }
    getMembersWithMembership(e) {
      return this.currentState.getMembers().filter(function(n) {
        return n.membership === e;
      });
    }
    getEncryptionTargetMembers() {
      var e = this;
      return me(function* () {
        yield e.loadMembersIfNeeded();
        var n = e.getMembersWithMembership(Ht.Join);
        return e.shouldEncryptForInvitedMembers() && (n = n.concat(e.getMembersWithMembership(Ht.Invite))), n;
      })();
    }
    shouldEncryptForInvitedMembers() {
      var e, n = this.currentState.getStateEvents(ce.RoomHistoryVisibility, "");
      return (n == null || (e = n.getContent()) === null || e === void 0 ? void 0 : e.history_visibility) !== "joined";
    }
    getDefaultRoomName(e) {
      return this.calculateRoomName(e, true);
    }
    hasMembershipState(e, n) {
      var r = this.getMember(e);
      return r ? r.membership === n : false;
    }
    getOrCreateFilteredTimelineSet(e) {
      var { prepopulateTimeline: n = true, useSyncEvents: r = true, pendingEvents: i = true } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (this.filteredTimelineSets[e.filterId]) return this.filteredTimelineSets[e.filterId];
      var a = Object.assign({
        filter: e,
        pendingEvents: i
      }, this.opts), s = new H0(this, a);
      this.reEmitter.reEmit(s, [
        mt.Timeline,
        mt.TimelineReset
      ]), r && (this.filteredTimelineSets[e.filterId] = s, this.timelineSets.push(s));
      var l = this.getLiveTimeline();
      if (n) {
        l.getEvents().forEach(function(u) {
          s.addLiveEvent(u, {
            addToState: false
          });
        });
        for (var c = l; c.getNeighbouringTimeline(en.BACKWARDS); ) c = c.getNeighbouringTimeline(en.BACKWARDS);
        s.getLiveTimeline().setPaginationToken(c.getPaginationToken(en.BACKWARDS), en.BACKWARDS);
      } else if (r) {
        var d = l.getPaginationToken(Tn.Forward);
        s.getLiveTimeline().setPaginationToken(d, Tn.Backward);
      }
      return s;
    }
    getThreadListFilter() {
      var e = arguments, n = this;
      return me(function* () {
        var r = e.length > 0 && e[0] !== void 0 ? e[0] : xc.All, i = n.client.getUserId(), a = new ns(i), s = {
          room: {
            timeline: {
              [a1.name]: [
                pi.name
              ]
            }
          }
        };
        r === xc.My && (s.room.timeline[o1.name] = [
          i
        ]), a.setDefinition(s);
        var l = yield n.client.getOrCreateFilter("THREAD_PANEL_".concat(n.roomId, "_").concat(r), a);
        return a.filterId = l, a;
      })();
    }
    createThreadTimelineSet(e) {
      var n = this;
      return me(function* () {
        var r;
        if (Ei.hasServerSideListSupport) r = new H0(n, f_(f_({}, n.opts), {}, {
          pendingEvents: false
        }), void 0, void 0, e ?? xc.All), n.reEmitter.reEmit(r, [
          mt.Timeline,
          mt.TimelineReset
        ]);
        else if (Ei.hasServerSideSupport) {
          var i = yield n.getThreadListFilter(e);
          r = n.getOrCreateFilteredTimelineSet(i, {
            prepopulateTimeline: false,
            useSyncEvents: false,
            pendingEvents: false
          });
        } else r = new H0(n, {
          pendingEvents: false
        }), Array.from(n.threads).forEach((a) => {
          var [, s] = a;
          if (s.length !== 0) {
            var l = s.timeline.some((c) => c.getSender() === n.client.getUserId());
            (e !== xc.My || l) && r.getLiveTimeline().addEvent(s.rootEvent, {
              toStartOfTimeline: false,
              addToState: false
            });
          }
        });
        return r;
      })();
    }
    processThreadRoots(e, n) {
      if (this.client.supportsThreads()) for (var r of e) en.setEventMetadata(r, this.currentState, n), this.getThread(r.getId()) || this.createThread(r.getId(), r, [], n);
    }
    fetchRoomThreads() {
      var e = this;
      return me(function* () {
        if (!(e.threadsReady || !e.client.supportsThreads())) {
          if (Ei.hasServerSideListSupport) yield Promise.all([
            e.fetchRoomThreadList(xc.All),
            e.fetchRoomThreadList(xc.My)
          ]);
          else {
            var n = yield e.getThreadListFilter(), { chunk: r } = yield e.client.createMessagesRequest(e.roomId, "", Number.MAX_SAFE_INTEGER, Tn.Backward, n);
            if (!r.length) return;
            var i = r.map(e.client.getEventMapper()).sort((f, g) => {
              var m = f.getServerAggregatedRelation(pi.name), v = g.getServerAggregatedRelation(pi.name);
              return m.latest_event.origin_server_ts - v.latest_event.origin_server_ts;
            }), a, s = e.getLiveTimeline().getState(en.FORWARDS);
            for (var l of i) {
              var c, d = {
                duplicateStrategy: l1.Ignore,
                fromCache: false,
                addToState: false,
                roomState: s
              };
              (c = e.threadsTimelineSets[0]) === null || c === void 0 || c.addLiveEvent(l, d);
              var u = l.getServerAggregatedRelation(pi.name);
              if (u != null && u.current_user_participated) {
                var h;
                (h = e.threadsTimelineSets[1]) === null || h === void 0 || h.addLiveEvent(l, d), a = l;
              }
            }
            e.processThreadRoots(i, true), e.client.decryptEventIfNeeded(i[i.length - 1]), a && e.client.decryptEventIfNeeded(a);
          }
          e.on(jr.NewReply, e.onThreadReply), e.on(jr.Update, e.onThreadUpdate), e.on(jr.Delete, e.onThreadDelete), e.threadsReady = true;
        }
      })();
    }
    processPollEvents(e) {
      var n = this;
      return me(function* () {
        for (var r of e) try {
          if (!r.isEncrypted() && !Pne(r)) continue;
          yield n.client.decryptEventIfNeeded(r), n.processPollEvent(r);
        } catch (i) {
          _e.warn("Error processing poll event", r.getId(), i);
        }
      })();
    }
    processPollEvent(e) {
      var n = this;
      return me(function* () {
        if (e.isDecryptionFailure()) {
          e.once(or.Decrypted, (s) => {
            n.processPollEvent(s);
          });
          return;
        }
        if (Os.M_POLL_START.matches(e.getType())) {
          try {
            var r = new Bne(e, n.client, n);
            n.polls.set(e.getId(), r), n.emit(tf.New, r), e.once(or.BeforeRedaction, (s) => {
              n.polls.delete(s.getId());
            });
          } catch {
          }
          return;
        }
        var i = e.relationEventId;
        if (i && n.polls.has(i)) {
          var a = n.polls.get(i);
          a == null ? void 0 : a.onNewRelation(e);
        }
      })();
    }
    fetchRoomThreadList(e) {
      var n = this;
      return me(function* () {
        if (n.client.supportsThreads() && n.threadsTimelineSets.length !== 0) {
          var r = e === xc.My ? n.threadsTimelineSets[1] : n.threadsTimelineSets[0], { chunk: i, end: a } = yield n.client.createThreadListMessagesRequest(n.roomId, null, void 0, Tn.Backward, r.threadListType, r.getFilter());
          if (r.getLiveTimeline().setPaginationToken(a ?? null, Tn.Backward), !!i.length) {
            var s = i.map(n.client.getEventMapper());
            n.processThreadRoots(s, true);
            var l = n.getLiveTimeline().getState(en.FORWARDS);
            for (var c of s) r.addLiveEvent(c, {
              duplicateStrategy: l1.Replace,
              fromCache: false,
              roomState: l,
              addToState: false
            });
          }
        }
      })();
    }
    onThreadUpdate(e) {
      this.updateThreadRootEvents(e, false, false);
    }
    onThreadReply(e) {
      this.updateThreadRootEvents(e, false, true);
    }
    onThreadDelete(e) {
      var n;
      this.threads.delete(e.id);
      var r = this.getTimelineForEvent(e.id), i = r == null || (n = r.getEvents()) === null || n === void 0 ? void 0 : n.find((s) => s.getId() === e.id);
      i ? e.clearEventMetadata(i) : _e.debug("onThreadDelete: Could not find root event in room timeline");
      for (var a of this.threadsTimelineSets) a.removeEvent(e.id);
    }
    removeFilteredTimelineSet(e) {
      var n = this.filteredTimelineSets[e.filterId];
      delete this.filteredTimelineSets[e.filterId];
      var r = this.timelineSets.indexOf(n);
      r > -1 && this.timelineSets.splice(r, 1);
    }
    eventShouldLiveIn(e, n, r) {
      var i;
      if (!((i = this.client) !== null && i !== void 0 && i.supportsThreads())) return {
        shouldLiveInRoom: true,
        shouldLiveInThread: false
      };
      if (e.isThreadRoot || r != null && r.has(e.getId())) return {
        shouldLiveInRoom: true,
        shouldLiveInThread: true,
        threadId: e.getId()
      };
      var a = e.isRelation(pi.name), s = e.getAssociatedId(), l = e.threadRootId;
      if (s && !a && (l === s || r != null && r.has(s))) return {
        shouldLiveInRoom: true,
        shouldLiveInThread: false
      };
      var c;
      if (s) {
        var d;
        c = (d = this.findEventById(s)) !== null && d !== void 0 ? d : n == null ? void 0 : n.find((u) => u.getId() === s);
      }
      return c && !a ? this.eventShouldLiveIn(c, n, r) : l != null ? {
        shouldLiveInRoom: false,
        shouldLiveInThread: true,
        threadId: l
      } : !s || e.replyEventId ? {
        shouldLiveInRoom: true,
        shouldLiveInThread: false
      } : {
        shouldLiveInRoom: false,
        shouldLiveInThread: false
      };
    }
    findThreadForEvent(e) {
      if (!e) return null;
      var { threadId: n } = this.eventShouldLiveIn(e);
      return n ? this.getThread(n) : null;
    }
    addThreadedEvents(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, i = this.getThread(e);
      if (i) i.addEvents(n, r);
      else {
        var a, s = (a = this.findEventById(e)) !== null && a !== void 0 ? a : n.find((l) => l.getId() === e);
        this.createThread(e, s, n, r);
      }
    }
    processThreadedEvents(e, n) {
      e.forEach(this.tryApplyRedaction);
      var r = {};
      for (var i of e) {
        var a, { threadId: s, shouldLiveInThread: l } = this.eventShouldLiveIn(i);
        l && !r[s] && (r[s] = []), (a = r[s]) === null || a === void 0 || a.push(i);
      }
      Object.entries(r).map((c) => {
        var [d, u] = c;
        return this.addThreadedEvents(d, u, n);
      });
    }
    createThread(e, n) {
      var r, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], a = arguments.length > 3 ? arguments[3] : void 0;
      if (this.threads.has(e)) return this.threads.get(e);
      if (n) {
        var s = this.relations.getAllChildEventsForEvent(n.getId());
        s != null && s.length && (i = i.concat(s.filter((c) => !c.isRelation(Xn.Replace))));
      }
      var l = new Ei(e, n, {
        room: this,
        client: this.client,
        pendingEventOrdering: this.opts.pendingEventOrdering,
        receipts: (r = this.cachedThreadReadReceipts.get(e)) !== null && r !== void 0 ? r : []
      });
      return this.reEmitter.reEmit(l, [
        jr.Delete,
        jr.Update,
        jr.NewReply,
        mt.Timeline,
        mt.TimelineReset
      ]), this.cachedThreadReadReceipts.delete(e), this.threads.set(l.id, l), l.addEvents(i, false), this.threadsReady && l.initialEventsFetched && this.updateThreadRootEvents(l, a, false), this.emit(jr.New, l, a), l;
    }
    applyEventAsRedaction(e, n) {
      var r = n.threadRootId;
      if (n.makeRedacted(e, this), n.isState()) {
        var i = this.currentState.getStateEvents(n.getType(), n.getStateKey());
        (i == null ? void 0 : i.getId()) === n.getId() && this.currentState.setStateEvents([
          n
        ]);
      }
      this.emit(mt.Redaction, e, this, r), this.visibilityEvents.delete(n.getId()), n.isVisibilityEvent() && this.redactVisibilityChangeEvent(e);
    }
    processLiveEvent(e) {
      this.tryApplyRedaction(e), e.isVisibilityEvent() && this.applyNewVisibilityEvent(e), this.applyPendingVisibilityEvents(e);
      var n = e.getUnsigned().transaction_id;
      if (!n && e.getSender() === this.myUserId) {
        for (var [r, i] of this.txnToEvent) if (i.getId() === e.getId()) {
          _e.debug("processLiveEvent: found sent event without txn ID: ", r, e.getId());
          var a = e.getUnsigned();
          a.transaction_id = r, e.setUnsigned(a);
          break;
        }
      }
    }
    addLiveEvent(e, n) {
      var { duplicateStrategy: r, timelineWasEmpty: i, fromCache: a, addToState: s } = n;
      for (var l of this.timelineSets) l.addLiveEvent(e, {
        duplicateStrategy: r,
        fromCache: a,
        timelineWasEmpty: i,
        addToState: s
      });
      e.sender && e.getType() !== ce.RoomRedaction && this.addReceipt(pne(e.sender.userId, e, ia.Read), true);
    }
    addPendingEvent(e, n) {
      if (e.status !== Vn.SENDING && e.status !== Vn.NOT_SENT) throw new Error("addPendingEvent called on an event with status " + e.status);
      if (this.txnToEvent.get(n)) throw new Error("addPendingEvent called on an event with known txnId " + n);
      if (en.setEventMetadata(e, this.getLiveTimeline().getState(en.FORWARDS), false), this.txnToEvent.set(n, e), this.pendingEventList) {
        if (this.pendingEventList.some((s) => s.status === Vn.NOT_SENT) && (_e.warn("Setting event as NOT_SENT due to messages in the same state"), e.setStatus(Vn.NOT_SENT)), this.pendingEventList.push(e), this.savePendingEvents(), e.isRelation() && this.aggregateNonLiveRelation(e), e.isRedaction()) {
          var r = e.event.redacts, i = this.pendingEventList.find((s) => s.getId() === r);
          !i && r && (i = this.findEventById(r)), i && (i.markLocallyRedacted(e), this.emit(mt.Redaction, e, this, i.threadRootId));
        }
      } else for (var a of this.timelineSets) a.getFilter() ? a.getFilter().filterRoomTimeline([
        e
      ]).length && a.addEventToTimeline(e, a.getLiveTimeline(), {
        toStartOfTimeline: false,
        addToState: false
      }) : a.addEventToTimeline(e, a.getLiveTimeline(), {
        toStartOfTimeline: false,
        addToState: false
      });
      this.emit(mt.LocalEchoUpdated, e, this);
    }
    savePendingEvents() {
      if (this.pendingEventList) {
        var e = this.pendingEventList.map((n) => f_(f_({}, n.event), {}, {
          txn_id: n.getTxnId()
        })).filter((n) => {
          var r = n.type === ce.RoomMessageEncrypted, i = this.hasEncryptionStateEvent();
          return r || !i;
        });
        this.client.store.setPendingEvents(this.roomId, e);
      }
    }
    aggregateNonLiveRelation(e) {
      this.relations.aggregateChildEvent(e);
    }
    getEventForTxnId(e) {
      return this.txnToEvent.get(e);
    }
    handleRemoteEcho(e, n) {
      var r = n.getId(), i = e.getId(), a = n.status;
      _e.debug("Got remote echo for event ".concat(r, " -> ").concat(i, " old status ").concat(a)), this.txnToEvent.delete(e.getUnsigned().transaction_id), this.pendingEventList && this.removePendingEvent(r), n.handleRemoteEcho(e.event);
      var { shouldLiveInRoom: s, threadId: l } = this.eventShouldLiveIn(e), c = l ? this.getThread(l) : null;
      if (c == null ? void 0 : c.setEventMetadata(n), c == null ? void 0 : c.timelineSet.handleRemoteEcho(n, r, i), s) for (var d of this.timelineSets) d.handleRemoteEcho(n, r, i);
      this.emit(mt.LocalEchoUpdated, n, this, r, a);
    }
    updatePendingEvent(e, n, r) {
      if (_e.log("setting pendingEvent status to ".concat(n, " in ").concat(e.getRoomId(), " ") + "event ID ".concat(e.getId(), " -> ").concat(r)), n == Vn.SENT && !r) throw new Error("updatePendingEvent called with status=SENT, but no new event id");
      if (n == Vn.SENT) {
        var i = this.getTimelineForEvent(r);
        if (i) {
          var a = this.findEventById(r), s = a == null ? void 0 : a.getUnsigned().transaction_id;
          if (!s && a) {
            var l = a.getUnsigned();
            l.transaction_id = e.getTxnId(), a.setUnsigned(l), this.removeEvent(a.getId()), this.handleRemoteEcho(a, e);
          }
          return;
        }
      }
      var c = e.status, d = e.getId();
      if (!c) throw new Error("updatePendingEventStatus called on an event which is not a local echo.");
      var u = twe[c];
      if (!(u != null && u.includes(n))) throw new Error("Invalid EventStatus transition ".concat(c, "->").concat(n));
      if (e.setStatus(n), n == Vn.SENT) {
        e.replaceLocalEventId(r);
        var { shouldLiveInRoom: h, threadId: f } = this.eventShouldLiveIn(e), g = f ? this.getThread(f) : void 0;
        if (g == null ? void 0 : g.setEventMetadata(e), g == null ? void 0 : g.timelineSet.replaceEventId(d, r), h) for (var m of this.timelineSets) m.replaceEventId(d, r);
      } else if (n == Vn.CANCELLED) {
        if (this.pendingEventList) {
          var v = this.getPendingEvent(d);
          this.removePendingEvent(d), v != null && v.isRedaction() && this.revertRedactionLocalEcho(v);
        }
        this.removeEvent(d);
      }
      this.savePendingEvents(), this.emit(mt.LocalEchoUpdated, e, this, d, c);
    }
    revertRedactionLocalEcho(e) {
      var n = e.event.redacts;
      if (n) {
        var r = this.getUnfilteredTimelineSet().findEventById(n);
        r && (r.unmarkLocallyRedacted(), this.emit(mt.RedactionCancelled, e, this), r.isRelation() && this.aggregateNonLiveRelation(r));
      }
    }
    assertTimelineSetsAreLive() {
      for (var e = 0; e < this.timelineSets.length; e++) {
        var n = this.timelineSets[e].getLiveTimeline();
        if (n.getPaginationToken(en.FORWARDS)) throw new Error("live timeline " + e + " is no longer live - it has a pagination token (" + n.getPaginationToken(en.FORWARDS) + ")");
        if (n.getNeighbouringTimeline(en.FORWARDS)) throw new Error("live timeline ".concat(e, " is no longer live - it has a neighbouring timeline"));
      }
    }
    addLiveEvents(e, n) {
      var r = this;
      return me(function* () {
        var { duplicateStrategy: i, fromCache: a, timelineWasEmpty: s = false, addToState: l } = n;
        if (i && [
          "replace",
          "ignore"
        ].indexOf(i) === -1) throw new Error("duplicateStrategy MUST be either 'replace' or 'ignore'");
        r.assertTimelineSetsAreLive();
        var c = r.findThreadRoots(e), d = {}, u = {
          duplicateStrategy: i,
          fromCache: a,
          timelineWasEmpty: s,
          addToState: l
        }, h = [
          ...e
        ];
        for (var f of e) {
          var g;
          if (r.processLiveEvent(f), f.getUnsigned().transaction_id) {
            var m = r.txnToEvent.get(f.getUnsigned().transaction_id);
            if (m) {
              r.handleRemoteEcho(f, m);
              continue;
            }
          }
          var { shouldLiveInRoom: v, shouldLiveInThread: y, threadId: w = "" } = r.eventShouldLiveIn(f, h, c);
          if (!y && !v && f.isRelation()) try {
            var b = new to(yield r.client.fetchRoomEvent(r.roomId, f.relationEventId));
            if (h.push(b), b.threadRootId) {
              c.add(b.threadRootId);
              var j = f.getUnsigned();
              j[KC.name] = b.threadRootId, f.setUnsigned(j);
            }
            ({ shouldLiveInRoom: v, shouldLiveInThread: y, threadId: w = "" } = r.eventShouldLiveIn(f, h, c));
          } catch (k) {
            _e.error("Failed to load parent event of unhandled relation", k);
          }
          y && !d[w] && (d[w] = []), (g = d[w]) === null || g === void 0 || g.push(f), v ? r.addLiveEvent(f, u) : !y && f.isRelation() && r.relations.aggregateChildEvent(f);
        }
        Object.entries(d).forEach((k) => {
          var [C, x] = k;
          r.addThreadedEvents(C, x, false);
        });
      })();
    }
    partitionThreadedEvents(e) {
      var n = 0, r = 1, i = 2;
      if (this.client.supportsThreads()) {
        var a = this.findThreadRoots(e);
        return e.reduce((s, l) => {
          var { shouldLiveInRoom: c, shouldLiveInThread: d, threadId: u } = this.eventShouldLiveIn(l, e, a);
          return c && s[n].push(l), d && (l.setThreadId(u ?? ""), s[r].push(l)), !d && !c && s[i].push(l), s;
        }, [
          [],
          [],
          []
        ]);
      } else return [
        e,
        [],
        []
      ];
    }
    findThreadRoots(e) {
      var n = /* @__PURE__ */ new Set();
      for (var r of e) {
        var i = r.threadRootId;
        i != null && n.add(i);
      }
      return n;
    }
    addReceipt(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, r = e.getContent();
      this.roomReceipts.add(r, n), Object.keys(r).forEach((i) => {
        Object.keys(r[i]).forEach((a) => {
          Object.keys(r[i][a]).forEach((s) => {
            var l, c, d, u = r[i][a][s], h = !u.thread_id || u.thread_id === Kb, f = h ? this : this.threads.get((l = u.thread_id) !== null && l !== void 0 ? l : "");
            if (f) {
              if (f.addReceiptToStructure(i, a, s, u, n), !n && this.client.isInitialSyncComplete() && s === this.client.getUserId()) {
                var g = f.timeline[f.timeline.length - 1];
                g && i === g.getId() && s === g.getSender() && (f.setUnread(ir.Total, 0), f.setUnread(ir.Highlight, 0));
              }
            } else {
              var m;
              this.cachedThreadReadReceipts.set(u.thread_id, [
                ...(m = this.cachedThreadReadReceipts.get(u.thread_id)) !== null && m !== void 0 ? m : [],
                {
                  eventId: i,
                  receiptType: a,
                  userId: s,
                  receipt: u,
                  synthetic: n
                }
              ]);
            }
            var v = this.client.getUserId();
            s === v && !h && u.ts < this.oldestThreadedReceiptTs && (this.oldestThreadedReceiptTs = u.ts), !u.thread_id && u.ts > ((c = (d = this.unthreadedReceipts.get(s)) === null || d === void 0 ? void 0 : d.ts) !== null && c !== void 0 ? c : 0) && this.unthreadedReceipts.set(s, u);
          });
        });
      }), this.emit(mt.Receipt, e, this);
    }
    addEphemeralEvents(e) {
      for (var n of e) n.getType() === ce.Typing ? this.currentState.setTypingEvent(n) : n.getType() === ce.Receipt && this.addReceipt(n);
    }
    removeEvents(e) {
      for (var n of e) this.removeEvent(n);
    }
    removeEvent(e) {
      var n = false;
      for (var r of this.timelineSets) {
        var i = r.removeEvent(e);
        i && (i.isRedaction() && this.revertRedactionLocalEcho(i), n = true);
      }
      return n;
    }
    recalculate() {
      var e = this.currentState.getStateEvents(ce.RoomMember, this.myUserId);
      if (e) {
        var n = e.getContent().membership;
        if (this.updateMyMembership(n), n === Ht.Invite) {
          var r = e.getUnsigned().invite_room_state || [];
          r.forEach((a) => {
            var s = this.currentState.getStateEvents(a.type, a.state_key);
            s || this.currentState.setStateEvents([
              new to({
                type: a.type,
                state_key: a.state_key,
                content: a.content,
                event_id: "$fake" + Date.now(),
                room_id: this.roomId,
                sender: this.myUserId
              })
            ]);
          });
        }
      }
      var i = this.name;
      this.name = this.calculateRoomName(this.myUserId), this.normalizedName = L3e(this.name), this.summary = new Ine(this.roomId, {
        title: this.name
      }), i !== this.name && this.emit(mt.Name, this);
    }
    addTags(e) {
      this.tags = e.getContent().tags || {}, this.emit(mt.Tags, e, this);
    }
    addAccountData(e) {
      for (var n of e) {
        n.getType() === "m.tag" && this.addTags(n);
        var r = n.getType(), i = this.accountData.get(r);
        this.accountData.set(r, n), this.emit(mt.AccountData, n, this, i);
      }
    }
    getAccountData(e) {
      return this.accountData.get(e);
    }
    maySendMessage() {
      return this.getMyMembership() === Ht.Join && (this.hasEncryptionStateEvent() ? this.currentState.maySendEvent(ce.RoomMessageEncrypted, this.myUserId) : this.currentState.maySendEvent(ce.RoomMessage, this.myUserId));
    }
    canInvite(e) {
      var n = this.getMyMembership() === Ht.Join, r = this.currentState.getStateEvents(ce.RoomPowerLevels, ""), i = r && r.getContent(), a = this.getMember(e);
      return i && a && i.invite > a.powerLevel && (n = false), n;
    }
    getJoinRule() {
      return this.currentState.getJoinRule();
    }
    getHistoryVisibility() {
      return this.currentState.getHistoryVisibility();
    }
    getGuestAccess() {
      return this.currentState.getGuestAccess();
    }
    getType() {
      var e = this.currentState.getStateEvents(ce.RoomCreate, "");
      if (!e) {
        this.getTypeWarning || (_e.warn("[getType] Room " + this.roomId + " does not have an m.room.create event"), this.getTypeWarning = true);
        return;
      }
      return e.getContent()[qC];
    }
    isSpaceRoom() {
      return this.getType() === Bo.Space;
    }
    isCallRoom() {
      return this.getType() === Bo.UnstableCall;
    }
    isElementVideoRoom() {
      return this.getType() === Bo.ElementVideo;
    }
    findPredecessor() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, n = this.getLiveTimeline().getState(en.FORWARDS);
      return n ? n.findPredecessor(e) : null;
    }
    roomNameGenerator(e) {
      if (this.client.roomNameGenerator) {
        var n = this.client.roomNameGenerator(this.roomId, e);
        if (n !== null) return n;
      }
      switch (e.type) {
        case md.Actual:
          return e.name;
        case md.Generated:
          return e.subtype === "Inviting" ? "Inviting ".concat(wH(e.names, e.count)) : wH(e.names, e.count);
        case md.EmptyRoom:
          return e.oldName ? "Empty room (was ".concat(e.oldName, ")") : "Empty room";
      }
    }
    calculateRoomName(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (!n) {
        var r = this.currentState.getStateEvents(ce.RoomName, "");
        if (r != null && r.getContent().name) return this.roomNameGenerator({
          type: md.Actual,
          name: r.getContent().name
        });
      }
      var i = this.getCanonicalAlias();
      if (i) return this.roomNameGenerator({
        type: md.Actual,
        name: i
      });
      var a = this.currentState.getJoinedMemberCount(), s = this.currentState.getInvitedMemberCount(), l = a + s - 1, c = this.getFunctionalMembers(), d = [];
      if (this.heroes) this.heroes.forEach((w) => {
        if (c.includes(w.userId)) {
          l--;
          return;
        }
        if (w.displayName) d.push(w.displayName);
        else {
          var b = this.getMember(w.userId);
          d.push(b ? b.name : w.userId);
        }
      });
      else {
        var u = this.currentState.getMembers().filter((w) => w.userId !== e && (w.membership === Ht.Invite || w.membership === Ht.Join));
        u = u.filter((w) => {
          var { userId: b } = w;
          return c.includes(b) ? (l--, false) : true;
        });
        var h = new Intl.Collator();
        u.sort((w, b) => h.compare(w.userId, b.userId)), u = u.slice(0, 5), d = u.map((w) => w.name);
      }
      if (l) return this.roomNameGenerator({
        type: md.Generated,
        names: d,
        count: l
      });
      var f = this.getMyMembership();
      if (f == Ht.Join) {
        var g = this.currentState.getStateEvents(ce.RoomThirdPartyInvite);
        if (g != null && g.length) {
          var m = g.map((w) => w.getContent().display_name);
          return this.roomNameGenerator({
            type: md.Generated,
            subtype: "Inviting",
            names: m,
            count: m.length + 1
          });
        }
      }
      var v = d;
      v.length || (v = this.currentState.getMembers().filter((w) => w.userId !== e && w.membership !== Ht.Invite && w.membership !== Ht.Join).map((w) => w.name));
      var y;
      return v.length && (y = this.roomNameGenerator({
        type: md.Generated,
        names: v,
        count: v.length + 1
      })), this.roomNameGenerator({
        type: md.EmptyRoom,
        oldName: y
      });
    }
    applyNewVisibilityEvent(e) {
      var n = e.asVisibilityChange();
      if (n) {
        var r = e.getSender();
        if (r) {
          var i = ug.name && this.currentState.maySendStateEvent(ug.name, r) || ug.altName && this.currentState.maySendStateEvent(ug.altName, r);
          if (i) {
            var a = this.visibilityEvents.get(n.eventId);
            if (a) {
              for (var s = a.length - 1, l = Math.max(0, a.length - ewe); s >= l; --s) {
                var c = a[s];
                if (c.getTs() < e.getTs()) break;
              }
              s === -1 ? a.unshift(e) : a.splice(s + 1, 0, e);
            } else this.visibilityEvents.set(n.eventId, [
              e
            ]);
            var d = this.findEventById(n.eventId);
            d && d.applyVisibilityEvent(n);
          }
        }
      }
    }
    redactVisibilityChangeEvent(e) {
      if (!e.isVisibilityEvent) throw new Error("expected a visibility change event");
      var n = e.getRelation(), r = n == null ? void 0 : n.event_id, i = this.visibilityEvents.get(r);
      if (i) {
        var a = i.findIndex((d) => d.getId() === e.getId());
        if (a !== -1 && (i.splice(a, 1), a === i.length)) {
          var s = this.findEventById(r);
          if (!s) return;
          if (a === 0) this.visibilityEvents.delete(r), s.applyVisibilityEvent();
          else {
            var l = i[i.length - 1], c = l.asVisibilityChange();
            if (!c) throw new Error("at this stage, visibility changes should be well-formed");
            s.applyVisibilityEvent(c);
          }
        }
      }
    }
    applyPendingVisibilityEvents(e) {
      var n = this.visibilityEvents.get(e.getId());
      if (!(!n || n.length == 0)) {
        var r = n[n.length - 1], i = r.asVisibilityChange();
        i && (i.visible, !(r.getTs() < e.getTs()) && e.applyVisibilityEvent(i));
      }
    }
    getOldestThreadedReceiptTs() {
      return this.oldestThreadedReceiptTs;
    }
    hasUserReadEvent(e, n) {
      return this.roomReceipts.hasUserReadEvent(e, n);
    }
    getLastUnthreadedReceiptFor(e) {
      return this.unthreadedReceipts.get(e);
    }
    fixupNotifications(e) {
      super.fixupNotifications(e);
      var n = this.getThreads().filter((i) => this.getThreadUnreadNotificationCount(i.id, ir.Total) > 0);
      for (var r of n) r.fixupNotifications(e);
    }
    compareEventOrdering(e, n) {
      return Pxe(this, e, n);
    }
    hasEncryptionStateEvent() {
      var e;
      return !!(!((e = this.getLiveTimeline().getState(en.FORWARDS)) === null || e === void 0) && e.getStateEvents(ce.RoomEncryption, ""));
    }
  };
  var twe = {
    [Vn.ENCRYPTING]: [
      Vn.SENDING,
      Vn.NOT_SENT,
      Vn.CANCELLED
    ],
    [Vn.SENDING]: [
      Vn.ENCRYPTING,
      Vn.QUEUED,
      Vn.NOT_SENT,
      Vn.SENT
    ],
    [Vn.QUEUED]: [
      Vn.SENDING,
      Vn.NOT_SENT,
      Vn.CANCELLED
    ],
    [Vn.SENT]: [],
    [Vn.NOT_SENT]: [
      Vn.SENDING,
      Vn.QUEUED,
      Vn.CANCELLED
    ],
    [Vn.CANCELLED]: []
  }, md = (function(t) {
    return t[t.EmptyRoom = 0] = "EmptyRoom", t[t.Generated = 1] = "Generated", t[t.Actual = 2] = "Actual", t;
  })({});
  function wH(t, e) {
    var n = e - 1;
    if (t.length) {
      if (t.length === 1 && n <= 1) return t[0];
      if (t.length === 2 && n <= 2) return "".concat(t[0], " and ").concat(t[1]);
      var r = n > 1;
      return r ? "".concat(t[0], " and ").concat(n, " others") : "".concat(t[0], " and 1 other");
    } else return "Empty room";
  }
  function DH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function XC(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? DH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : DH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var CH = 80 * 1e3, nwe = 3, Nn = (function(t) {
    return t.Error = "ERROR", t.Prepared = "PREPARED", t.Stopped = "STOPPED", t.Syncing = "SYNCING", t.Catchup = "CATCHUP", t.Reconnecting = "RECONNECTING", t;
  })({}), rwe = [
    "org.matrix.msc2716v3"
  ];
  function EH(t, e) {
    return "FILTER_SYNC_".concat(t) + (e ? "_" + e : "");
  }
  var tB = (function(t) {
    return t.Offline = "offline", t.Online = "online", t.Unavailable = "unavailable", t;
  })({});
  function Wne(t) {
    return XC({
      initialSyncLimit: 8,
      resolveInvitesToProfiles: false,
      pollTimeout: 30 * 1e3,
      pendingEventOrdering: $1.Chronological,
      threadSupport: false
    }, t);
  }
  function qne(t) {
    return XC({
      canResetEntireTimeline: (e) => false
    }, t);
  }
  class gf {
    constructor(e, n, r) {
      var i = this;
      this.client = e, $(this, "opts", void 0), $(this, "syncOpts", void 0), $(this, "_peekRoom", null), $(this, "currentSyncRequest", void 0), $(this, "abortController", void 0), $(this, "syncState", null), $(this, "syncStateData", void 0), $(this, "catchingUp", false), $(this, "running", false), $(this, "keepAliveTimer", void 0), $(this, "connectionReturnedResolvers", void 0), $(this, "notifEvents", []), $(this, "failedSyncCount", 0), $(this, "storeIsInvalid", false), $(this, "presence", void 0), $(this, "getPushRules", me(function* () {
        try {
          i.syncOpts.logger.debug("Getting push rules...");
          var a = yield i.client.getPushRules();
          i.syncOpts.logger.debug("Got push rules"), i.client.pushRules = a;
        } catch (s) {
          return i.syncOpts.logger.error("Getting push rules failed", s), i.shouldAbortSync(s) ? void 0 : (i.syncOpts.logger.debug("Waiting for saved sync before retrying push rules..."), yield i.recoverFromSyncStartupError(i.savedSyncPromise, s), i.getPushRules());
        }
      })), $(this, "buildDefaultFilter", () => {
        var a = new ns(this.client.credentials.userId);
        return this.client.canSupport.get($o.ThreadUnreadNotifications) !== Ho.Unsupported && a.setUnreadThreadNotifications(true), a;
      }), $(this, "prepareLazyLoadingForSync", me(function* () {
        i.syncOpts.logger.debug("Prepare lazy loading for sync..."), i.client.isGuest() && (i.opts.lazyLoadMembers = false), i.opts.lazyLoadMembers && (i.syncOpts.logger.debug("Enabling lazy load on sync filter..."), i.opts.filter || (i.opts.filter = i.buildDefaultFilter()), i.opts.filter.setLazyLoadMembers(true));
      })), $(this, "storeClientOptions", me(function* () {
        try {
          i.syncOpts.logger.debug("Storing client options..."), yield i.client.storeClientOptions(), i.syncOpts.logger.debug("Stored client options");
        } catch (a) {
          throw i.syncOpts.logger.error("Storing client options failed", a), a;
        }
      })), $(this, "getFilter", me(function* () {
        i.syncOpts.logger.debug("Getting filter...");
        var a;
        i.opts.filter ? a = i.opts.filter : a = i.buildDefaultFilter();
        var s;
        try {
          s = yield i.client.getOrCreateFilter(EH(i.client.credentials.userId), a);
        } catch (l) {
          return i.syncOpts.logger.error("Getting filter failed", l), i.shouldAbortSync(l) ? {} : (i.syncOpts.logger.debug("Waiting for saved sync before retrying filter..."), yield i.recoverFromSyncStartupError(i.savedSyncPromise, l), i.getFilter());
        }
        return {
          filter: a,
          filterId: s
        };
      })), $(this, "savedSyncPromise", void 0), $(this, "onOnline", () => {
        this.syncOpts.logger.debug("Browser thinks we are back online"), this.startKeepAlives(0);
      }), this.opts = Wne(n), this.syncOpts = qne(r), e.getNotifTimelineSet() && e.reEmitter.reEmit(e.getNotifTimelineSet(), [
        mt.Timeline,
        mt.TimelineReset
      ]);
    }
    createRoom(e) {
      var n = Kne(this.client, e, this.opts);
      return n.on(qn.Marker, (r, i) => {
        this.onMarkerStateEvent(n, r, i);
      }), n;
    }
    onMarkerStateEvent(e, n) {
      var { timelineWasEmpty: r } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      if (r) {
        this.syncOpts.logger.debug("MarkerState: Ignoring markerEventId=".concat(n.getId(), " in roomId=").concat(e.roomId, " ") + "because the timeline was empty before the marker arrived which means there is nothing to refresh.");
        return;
      }
      var i = rwe.includes(e.getVersion()) || n.getSender() === e.getCreator();
      i ? (this.syncOpts.logger.debug("MarkerState: Timeline needs to be refreshed because " + "a new markerEventId=".concat(n.getId(), " was sent in roomId=").concat(e.roomId)), e.setTimelineNeedsRefresh(true), e.emit(mt.HistoryImportedWithinTimeline, n, e)) : this.syncOpts.logger.debug("MarkerState: Ignoring markerEventId=".concat(n.getId(), " in roomId=").concat(e.roomId, " because ") + "MSC2716 is not supported in the room version or for any room version, the marker wasn't sent by the room creator.");
    }
    syncLeftRooms() {
      var e = this;
      return me(function* () {
        var n, r = e.client, i = new ns(e.client.credentials.userId);
        i.setTimelineLimit(1), i.setIncludeLeaveRooms(true);
        var a = e.opts.pollTimeout + CH, s = yield r.getOrCreateFilter(EH(r.credentials.userId, "LEFT_ROOMS"), i), l = {
          timeout: 0,
          filter: s,
          "org.matrix.msc4222.use_state_after": true
        }, c = yield r.http.authedRequest(rt.Get, "/sync", l, void 0, {
          localTimeoutMs: a
        }), d = [];
        (n = c.rooms) !== null && n !== void 0 && n.leave && (d = e.mapSyncResponseToRoomArray(c.rooms.leave));
        var u = yield Promise.all(d.map((function() {
          var h = me(function* (f) {
            var g = f.room;
            if (f.isBrandNewRoom) {
              f.timeline = f.timeline || {
                prev_batch: null,
                events: []
              }, g.getLiveTimeline().setPaginationToken(f.timeline.prev_batch, en.BACKWARDS);
              var { timelineEvents: m } = yield e.mapAndInjectRoomEvents(f);
              return g.recalculate(), r.store.storeRoom(g), r.emit(jt.Room, g), e.processEventsForNotifs(g, m), g;
            }
          });
          return function(f) {
            return h.apply(this, arguments);
          };
        })()));
        return u.filter(Boolean);
      })();
    }
    peek(e) {
      var n, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 20;
      if (((n = this._peekRoom) === null || n === void 0 ? void 0 : n.roomId) === e) return Promise.resolve(this._peekRoom);
      var i = this.client;
      return this._peekRoom = this.createRoom(e), this.client.roomInitialSync(e, r).then((a) => {
        var s;
        if (((s = this._peekRoom) === null || s === void 0 ? void 0 : s.roomId) !== e) throw new Error("Peeking aborted");
        a.messages = a.messages || {
          chunk: []
        }, a.messages.chunk = a.messages.chunk || [], a.state = a.state || [];
        var l = Gb(a.state).map(i.getEventMapper()), c = a.state.map(i.getEventMapper()), d = a.messages.chunk.map(i.getEventMapper());
        return Array.isArray(a.presence) && a.presence.map(i.getEventMapper()).forEach(function(u) {
          var h = i.store.getUser(u.getContent().user_id);
          h ? h.setPresenceEvent(u) : (h = Md.createUser(u.getContent().user_id, i), h.setPresenceEvent(u), i.store.storeUser(h)), i.emit(jt.Event, u);
        }), a.messages.start && (this._peekRoom.oldState.paginationToken = a.messages.start), this._peekRoom.oldState.setStateEvents(l), this._peekRoom.currentState.setStateEvents(c), this.resolveInvites(this._peekRoom), this._peekRoom.recalculate(), this._peekRoom.addEventsToTimeline(d.reverse(), true, true, this._peekRoom.getLiveTimeline(), a.messages.start), i.store.storeRoom(this._peekRoom), i.emit(jt.Room, this._peekRoom), this.peekPoll(this._peekRoom), this._peekRoom;
      });
    }
    stopPeeking() {
      this._peekRoom = null;
    }
    peekPoll(e, n) {
      var r, i = this;
      if (this._peekRoom !== e) {
        this.syncOpts.logger.debug("Stopped peeking in room %s", e.roomId);
        return;
      }
      this.client.http.authedRequest(rt.Get, "/events", {
        room_id: e.roomId,
        timeout: String(30 * 1e3),
        from: n
      }, void 0, {
        localTimeoutMs: 50 * 1e3,
        abortSignal: (r = this.abortController) === null || r === void 0 ? void 0 : r.signal
      }).then((function() {
        var a = me(function* (s) {
          if (i._peekRoom !== e) {
            i.syncOpts.logger.debug("Stopped peeking in room %s", e.roomId);
            return;
          }
          s.chunk.filter(function(c) {
            return c.type === "m.presence";
          }).map(i.client.getEventMapper()).forEach((c) => {
            var d = i.client.store.getUser(c.getContent().user_id);
            d ? d.setPresenceEvent(c) : (d = Md.createUser(c.getContent().user_id, i.client), d.setPresenceEvent(c), i.client.store.storeUser(d)), i.client.emit(jt.Event, c);
          });
          var l = s.chunk.filter(function(c) {
            return c.room_id === e.roomId && c.event_id;
          }).map(i.client.getEventMapper());
          yield e.addLiveEvents(l, {
            addToState: true
          }), i.peekPoll(e, s.end);
        });
        return function(s) {
          return a.apply(this, arguments);
        };
      })(), (a) => {
        this.syncOpts.logger.error("[%s] Peek poll failed: %s", e.roomId, a), setTimeout(() => {
          this.peekPoll(e, n);
        }, 30 * 1e3);
      });
    }
    getSyncState() {
      return this.syncState;
    }
    getSyncStateData() {
      var e;
      return (e = this.syncStateData) !== null && e !== void 0 ? e : null;
    }
    recoverFromSyncStartupError(e, n) {
      var r = this;
      return me(function* () {
        yield e;
        var i = r.startKeepAlives();
        r.updateSyncState(Nn.Error, {
          error: n
        }), yield i;
      })();
    }
    shouldAbortSync(e) {
      return e.errcode === "M_UNKNOWN_TOKEN" ? (this.syncOpts.logger.warn("Token no longer valid - assuming logout"), this.stop(), this.updateSyncState(Nn.Error, {
        error: e
      }), true) : false;
    }
    sync() {
      var e = this;
      return me(function* () {
        var n, r;
        if (e.running = true, e.abortController = new AbortController(), (n = globalThis.window) === null || n === void 0 || (r = n.addEventListener) === null || r === void 0 || r.call(n, "online", e.onOnline, false), e.client.isGuest()) return e.doSync({});
        e.syncOpts.logger.debug("Getting saved sync token...");
        var i = e.client.store.getSavedSyncToken().then((u) => (e.syncOpts.logger.debug("Got saved sync token"), u));
        e.savedSyncPromise = e.client.store.getSavedSync().then((u) => {
          if (e.syncOpts.logger.debug("Got reply from saved sync, exists? ".concat(!!u)), u) return e.syncFromCache(u);
        }).catch((u) => {
          e.syncOpts.logger.error("Getting saved sync failed", u);
        }), yield e.getPushRules(), yield e.prepareLazyLoadingForSync(), yield e.storeClientOptions();
        var { filterId: a, filter: s } = yield e.getFilter();
        if (s) {
          if (e.client.resetNotifTimelineSet(), !e.currentSyncRequest) {
            var l = a, c = yield i;
            if (c) e.syncOpts.logger.debug("Sending first sync request...");
            else {
              e.syncOpts.logger.debug("Sending initial sync request...");
              var d = e.buildDefaultFilter();
              d.setDefinition(s.getDefinition()), d.setTimelineLimit(e.opts.initialSyncLimit), l = JSON.stringify(d.getDefinition());
            }
            e.currentSyncRequest = e.doSyncRequest({
              filter: l
            }, c);
          }
          return e.syncOpts.logger.debug("Waiting for saved sync before starting sync processing..."), yield e.savedSyncPromise, e.doSync({
            filter: a
          });
        }
      })();
    }
    stop() {
      var e, n, r;
      this.syncOpts.logger.debug("SyncApi.stop"), (e = globalThis.window) === null || e === void 0 || (n = e.removeEventListener) === null || n === void 0 || n.call(e, "online", this.onOnline, false), this.running = false, (r = this.abortController) === null || r === void 0 || r.abort(), this.keepAliveTimer && (clearTimeout(this.keepAliveTimer), this.keepAliveTimer = void 0);
    }
    retryImmediately() {
      return this.connectionReturnedResolvers ? (this.startKeepAlives(0), true) : false;
    }
    syncFromCache(e) {
      var n = this;
      return me(function* () {
        n.syncOpts.logger.debug("sync(): not doing HTTP hit, instead returning stored /sync data");
        var r = e.nextBatch;
        n.client.store.setSyncToken(r);
        var i = {
          nextSyncToken: r,
          catchingUp: false,
          fromCache: true
        }, a = {
          next_batch: r,
          rooms: e.roomsData,
          account_data: {
            events: e.accountData
          }
        };
        try {
          yield n.processSyncResponse(i, a);
        } catch (s) {
          n.syncOpts.logger.error("Error processing cached sync", s);
        }
        n.storeIsInvalid || n.updateSyncState(Nn.Prepared, i);
      })();
    }
    doSync(e) {
      var n = this;
      return me(function* () {
        for (; n.running; ) {
          var r = n.client.store.getSyncToken(), i = void 0;
          try {
            n.currentSyncRequest || (n.currentSyncRequest = n.doSyncRequest(e, r)), i = yield n.currentSyncRequest;
          } catch (l) {
            var a = yield n.onSyncError(l);
            if (a) return;
            continue;
          } finally {
            n.currentSyncRequest = void 0;
          }
          n.client.store.setSyncToken(i.next_batch), n.failedSyncCount = 0;
          var s = {
            oldSyncToken: r ?? void 0,
            nextSyncToken: i.next_batch,
            catchingUp: n.catchingUp
          };
          try {
            yield n.processSyncResponse(s, i);
          } catch (l) {
            n.syncOpts.logger.error("Caught /sync error", l), n.client.emit(jt.SyncUnexpectedError, l);
          }
          yield n.client.store.setSyncData(i), s.catchingUp = n.catchingUp, e.hasSyncedBefore || (n.updateSyncState(Nn.Prepared, s), e.hasSyncedBefore = true), n.syncOpts.cryptoCallbacks && (yield n.syncOpts.cryptoCallbacks.onSyncCompleted(s)), n.updateSyncState(Nn.Syncing, s), n.client.store.wantsSave() && (yield n.client.store.save());
        }
        n.running || (n.syncOpts.logger.debug("Sync no longer running: exiting."), n.connectionReturnedResolvers && (n.connectionReturnedResolvers.reject(), n.connectionReturnedResolvers = void 0), n.updateSyncState(Nn.Stopped));
      })();
    }
    doSyncRequest(e, n) {
      var r, i = this.getSyncParams(e, n);
      return this.client.http.authedRequest(rt.Get, "/sync", i, void 0, {
        localTimeoutMs: i.timeout + CH,
        abortSignal: (r = this.abortController) === null || r === void 0 ? void 0 : r.signal
      });
    }
    getSyncParams(e, n) {
      var r = this.opts.pollTimeout;
      (this.getSyncState() !== Nn.Syncing || this.catchingUp) && (this.catchingUp = true, r = 0);
      var i = e.filter;
      this.client.isGuest() && !i && (i = this.getGuestFilter());
      var a = {
        filter: i,
        timeout: r,
        "org.matrix.msc4222.use_state_after": true
      };
      return this.opts.disablePresence ? a.set_presence = tB.Offline : this.presence !== void 0 && (a.set_presence = this.presence), n ? a.since = n : a._cacheBuster = Date.now(), [
        Nn.Reconnecting,
        Nn.Error
      ].includes(this.getSyncState()) && (a.timeout = 0), a;
    }
    setPresence(e) {
      this.presence = e;
    }
    onSyncError(e) {
      var n = this;
      return me(function* () {
        if (!n.running) return n.syncOpts.logger.debug("Sync no longer running: exiting"), n.connectionReturnedResolvers && (n.connectionReturnedResolvers.reject(), n.connectionReturnedResolvers = void 0), n.updateSyncState(Nn.Stopped), true;
        if (n.syncOpts.logger.error("/sync error %s", e), n.shouldAbortSync(e)) return true;
        n.failedSyncCount++, n.syncOpts.logger.debug("Number of consecutive failed sync requests:", n.failedSyncCount), n.syncOpts.logger.debug("Starting keep-alive");
        var r = n.startKeepAlives();
        n.currentSyncRequest = void 0, n.updateSyncState(n.failedSyncCount >= nwe ? Nn.Error : Nn.Reconnecting, {
          error: e
        });
        var i = yield r;
        return i && n.getSyncState() === Nn.Error && n.updateSyncState(Nn.Catchup, {
          catchingUp: true
        }), false;
      })();
    }
    processSyncResponse(e, n) {
      var r = this;
      return me(function* () {
        var i, a, s, l, c = r.client;
        if (Array.isArray((i = n.presence) === null || i === void 0 ? void 0 : i.events) && n.presence.events.filter(Dc).map(c.getEventMapper()).forEach(function(w) {
          var b = c.store.getUser(w.getSender());
          b ? b.setPresenceEvent(w) : (b = Md.createUser(w.getSender(), c), b.setPresenceEvent(w), c.store.storeUser(b)), c.emit(jt.Event, w);
        }), Array.isArray((a = n.account_data) === null || a === void 0 ? void 0 : a.events)) {
          var d = n.account_data.events.filter(Dc).map(c.getEventMapper()), u = d.reduce((w, b) => (w[b.getType()] = c.store.getAccountData(b.getType()), w), {});
          c.store.storeAccountDataEvents(d), d.forEach(function(w) {
            if (w.getType() === ce.PushRules) {
              var b = w.getContent();
              c.setPushRules(b);
            }
            var j = u[w.getType()];
            return c.emit(jt.AccountData, w, j), w;
          });
        }
        if (n.to_device && Array.isArray(n.to_device.events) && n.to_device.events.length > 0) {
          var h = n.to_device.events.filter(Dc), f;
          r.syncOpts.cryptoCallbacks ? f = yield r.syncOpts.cryptoCallbacks.preprocessToDeviceMessages(h) : f = h.map((w) => ({
            message: w,
            encryptionInfo: null
          })), Gne(f, c);
        } else r.catchingUp = false;
        var g = [], m = [], v = [], y = [];
        n.rooms && (n.rooms.invite && (g = r.mapSyncResponseToRoomArray(n.rooms.invite)), n.rooms.join && (m = r.mapSyncResponseToRoomArray(n.rooms.join)), n.rooms.leave && (v = r.mapSyncResponseToRoomArray(n.rooms.leave)), n.rooms.knock && (y = r.mapSyncResponseToRoomArray(n.rooms.knock))), r.notifEvents = [], yield V0(g, (function() {
          var w = me(function* (b) {
            var j = b.room, k = r.mapSyncEventsFormat(b.invite_state, j);
            yield r.injectRoomEvents(j, k, void 0), b.isBrandNewRoom ? (j.recalculate(), c.store.storeRoom(j), c.emit(jt.Room, j)) : j.recalculate(), k.forEach(function(C) {
              c.emit(jt.Event, C);
            });
          });
          return function(b) {
            return w.apply(this, arguments);
          };
        })()), yield V0(m, (function() {
          var w = me(function* (b) {
            var j, k = b.room, C = r.mapSyncEventsFormat(b.state, k), x = r.mapSyncEventsFormat(b["org.matrix.msc4222.state_after"], k), S = r.mapSyncEventsFormat(b.timeline, k, false), T = r.mapSyncEventsFormat(b.ephemeral), A = r.mapSyncEventsFormat(b.account_data), B = b["org.matrix.msc4222.state_after"] ? x : C.concat(S), U = r.isRoomEncrypted(k, B);
            if (b.unread_notifications) {
              if (!U || b.unread_notifications.notification_count === 0) {
                var z;
                k.setUnreadNotificationCount(ir.Total, (z = b.unread_notifications.notification_count) !== null && z !== void 0 ? z : 0);
              }
              if (!U || k.getUnreadNotificationCount(ir.Highlight) <= 0) {
                var O;
                k.setUnreadNotificationCount(ir.Highlight, (O = b.unread_notifications.highlight_count) !== null && O !== void 0 ? O : 0);
              }
            }
            var M = (j = b[R2.name]) !== null && j !== void 0 ? j : b[R2.altName];
            if (M) {
              k.resetThreadUnreadNotificationCountFromSync(Object.keys(M));
              for (var [I, N] of Object.entries(M)) {
                if (!U || N.notification_count === 0) {
                  var L;
                  k.setThreadUnreadNotificationCount(I, ir.Total, (L = N.notification_count) !== null && L !== void 0 ? L : 0);
                }
                var H = k.getThreadUnreadNotificationCount(I, ir.Highlight) <= 0;
                if (!U || U && H) {
                  var V;
                  k.setThreadUnreadNotificationCount(I, ir.Highlight, (V = N.highlight_count) !== null && V !== void 0 ? V : 0);
                }
              }
            } else k.resetThreadUnreadNotificationCountFromSync();
            if (b.timeline = b.timeline || {}, b.isBrandNewRoom) b.timeline.prev_batch !== null && k.getLiveTimeline().setPaginationToken(b.timeline.prev_batch, en.BACKWARDS);
            else if (b.timeline.limited) {
              for (var Z = true, Y = S.length - 1; Y >= 0; Y--) {
                var oe = S[Y].getId();
                if (k.getTimelineForEvent(oe)) {
                  r.syncOpts.logger.debug("Already have event ".concat(oe, " in limited sync - not resetting")), Z = false, S.splice(0, Y);
                  break;
                }
              }
              if (Z) {
                var ue;
                k.resetLiveTimeline(b.timeline.prev_batch, r.syncOpts.canResetEntireTimeline(k.roomId) ? null : (ue = e.oldSyncToken) !== null && ue !== void 0 ? ue : null), c.resetNotifTimelineSet();
              }
            }
            if (r.syncOpts.cryptoCallbacks) for (var ie of B) ie.isState() && ie.getType() === ce.RoomEncryption && ie.getStateKey() === "" && (yield r.syncOpts.cryptoCallbacks.onCryptoEvent(k, ie));
            for (var de of S.filter((ae) => ae.isState())) yield r.client.decryptEventIfNeeded(de);
            try {
              "org.matrix.msc4222.state_after" in b ? yield r.injectRoomEvents(k, void 0, x, S, e.fromCache) : yield r.injectRoomEvents(k, C, void 0, S, e.fromCache);
            } catch (ae) {
              r.syncOpts.logger.error("Failed to process events on room ".concat(k.roomId, ":"), ae);
            }
            b.summary && k.setSummary(b.summary), k.addEphemeralEvents(T), k.addAccountData(A), k.recalculate(), b.isBrandNewRoom && (c.store.storeRoom(k), c.emit(jt.Room, k)), r.processEventsForNotifs(k, S);
            var ne = (ae) => c.emit(jt.Event, ae);
            C.forEach(ne), S.forEach(ne), T.forEach(ne), A.forEach(ne), k.decryptCriticalEvents();
          });
          return function(b) {
            return w.apply(this, arguments);
          };
        })()), yield V0(v, (function() {
          var w = me(function* (b) {
            var j = b.room, { timelineEvents: k, stateEvents: C, stateAfterEvents: x } = yield r.mapAndInjectRoomEvents(b), S = r.mapSyncEventsFormat(b.account_data);
            j.addAccountData(S), j.recalculate(), b.isBrandNewRoom && (c.store.storeRoom(j), c.emit(jt.Room, j)), r.processEventsForNotifs(j, k), C == null ? void 0 : C.forEach(function(T) {
              c.emit(jt.Event, T);
            }), x == null ? void 0 : x.forEach(function(T) {
              c.emit(jt.Event, T);
            }), k.forEach(function(T) {
              c.emit(jt.Event, T);
            }), S.forEach(function(T) {
              c.emit(jt.Event, T);
            });
          });
          return function(b) {
            return w.apply(this, arguments);
          };
        })()), yield V0(y, (function() {
          var w = me(function* (b) {
            var j = b.room, k = r.mapSyncEventsFormat(b.knock_state, j);
            yield r.injectRoomEvents(j, k, void 0), b.isBrandNewRoom ? (j.recalculate(), c.store.storeRoom(j), c.emit(jt.Room, j)) : j.recalculate(), k.forEach(function(C) {
              c.emit(jt.Event, C);
            });
          });
          return function(b) {
            return w.apply(this, arguments);
          };
        })()), e.oldSyncToken && r.notifEvents.length && (r.notifEvents.sort(function(w, b) {
          return w.getTs() - b.getTs();
        }), r.notifEvents.forEach(function(w) {
          var b;
          (b = c.getNotifTimelineSet()) === null || b === void 0 || b.addLiveEvent(w, {
            addToState: true
          });
        })), n.device_lists && r.syncOpts.cryptoCallbacks && (yield r.syncOpts.cryptoCallbacks.processDeviceLists(n.device_lists)), yield (s = r.syncOpts.cryptoCallbacks) === null || s === void 0 ? void 0 : s.processKeyCounts(n.device_one_time_keys_count, (l = n.device_unused_fallback_key_types) !== null && l !== void 0 ? l : n["org.matrix.msc2732.device_unused_fallback_key_types"]);
      })();
    }
    startKeepAlives(e) {
      return e === void 0 && (e = 2e3 + Math.floor(Math.random() * 5e3)), this.keepAliveTimer !== null && clearTimeout(this.keepAliveTimer), e > 0 ? this.keepAliveTimer = setTimeout(this.pokeKeepAlive.bind(this), e) : this.pokeKeepAlive(), this.connectionReturnedResolvers || (this.connectionReturnedResolvers = Promise.withResolvers()), this.connectionReturnedResolvers.promise;
    }
    pokeKeepAlive() {
      var e, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      if (!this.running) {
        clearTimeout(this.keepAliveTimer), this.connectionReturnedResolvers && (this.connectionReturnedResolvers.reject("SyncApi.stop() was called"), this.connectionReturnedResolvers = void 0);
        return;
      }
      var r = () => {
        clearTimeout(this.keepAliveTimer), this.connectionReturnedResolvers && (this.connectionReturnedResolvers.resolve(n), this.connectionReturnedResolvers = void 0);
      };
      this.client.http.request(rt.Get, "/_matrix/client/versions", void 0, void 0, {
        prefix: "",
        localTimeoutMs: 15 * 1e3,
        abortSignal: (e = this.abortController) === null || e === void 0 ? void 0 : e.signal
      }).then(() => {
        r();
      }, (i) => {
        i.httpStatus == 400 || i.httpStatus == 404 ? this.keepAliveTimer = setTimeout(r, 2e3) : (n = true, this.keepAliveTimer = setTimeout(this.pokeKeepAlive.bind(this, n), 5e3 + Math.floor(Math.random() * 5e3)), this.updateSyncState(Nn.Error, {
          error: i
        }));
      });
    }
    mapSyncResponseToRoomArray(e) {
      var n = this.client;
      return Object.keys(e).filter((r) => !By(r)).map((r) => {
        var i = n.store.getRoom(r), a = false;
        return i || (i = this.createRoom(r), a = true), XC(XC({}, e[r]), {}, {
          room: i,
          isBrandNewRoom: a
        });
      });
    }
    mapSyncEventsFormat(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
      if (!e || !Array.isArray(e.events)) return [];
      var i = this.client.getEventMapper({
        decrypt: r
      });
      return e.events.filter(Dc).map(function(a) {
        return n && (a.room_id = n.roomId), i(a);
      });
    }
    resolveInvites(e) {
      if (!(!e || !this.opts.resolveInvitesToProfiles)) {
        var n = this.client;
        e.getMembersWithMembership(Ht.Invite).forEach(function(r) {
          if (!r.requestedProfileInfo) {
            r.requestedProfileInfo = true;
            var i = n.getUser(r.userId), a;
            i ? a = Promise.resolve({
              avatar_url: i.avatarUrl,
              displayname: i.displayName
            }) : a = n.getProfileInfo(r.userId), a.then(function(s) {
              var l = r.events.member;
              (l == null ? void 0 : l.getContent().membership) === Ht.Invite && (l.getContent().avatar_url = s.avatar_url, l.getContent().displayname = s.displayname, r.setMembershipEvent(l, e.currentState));
            }, function(s) {
            });
          }
        });
      }
    }
    findEncryptionEvent(e) {
      return e == null ? void 0 : e.find((n) => n.getType() === ce.RoomEncryption && n.getStateKey() === "");
    }
    isRoomEncrypted(e, n) {
      return e.hasEncryptionStateEvent() || !!this.findEncryptionEvent(n);
    }
    mapAndInjectRoomEvents(e) {
      var n = this;
      return me(function* () {
        var r = n.mapSyncEventsFormat(e.state, e.room), i = n.mapSyncEventsFormat(e["org.matrix.msc4222.state_after"], e.room), a = n.mapSyncEventsFormat(e.timeline, e.room);
        return "org.matrix.msc4222.state_after" in e ? yield n.injectRoomEvents(e.room, void 0, i, a) : yield n.injectRoomEvents(e.room, r, void 0, a), {
          timelineEvents: a,
          stateEvents: r,
          stateAfterEvents: i
        };
      })();
    }
    injectRoomEvents(e, n, r, i) {
      var a = arguments, s = this;
      return me(function* () {
        var l = a.length > 4 && a[4] !== void 0 ? a[4] : false, c = r ?? n, d = e.getLiveTimeline(), u = d.getEvents().length == 0;
        if (u) {
          for (var h of c) s.client.getPushActionsForEvent(h);
          d.initialiseState(c, {
            timelineWasEmpty: u
          });
        }
        s.resolveInvites(e), e.recalculate(), u || (e.oldState.setStateEvents(c), e.currentState.setStateEvents(c)), yield e.addLiveEvents(i || [], {
          fromCache: l,
          timelineWasEmpty: u,
          addToState: r === void 0
        }), s.client.processBeaconEvents(e, i);
      })();
    }
    processEventsForNotifs(e, n) {
      if (this.client.getNotifTimelineSet()) for (var r of n) {
        var i, a = this.client.getPushActionsForEvent(r);
        a != null && a.notify && (i = a.tweaks) !== null && i !== void 0 && i.highlight && this.notifEvents.push(r);
      }
    }
    getGuestFilter() {
      return "{}";
    }
    updateSyncState(e, n) {
      var r = this.syncState;
      this.syncState = e, this.syncStateData = n, this.client.emit(jt.Sync, this.syncState, r, n);
    }
  }
  function Kne(t, e, n) {
    var { timelineSupport: r } = t, i = new lk(e, t, t.getUserId(), {
      lazyLoadMembers: n.lazyLoadMembers,
      pendingEventOrdering: n.pendingEventOrdering,
      timelineSupport: r
    });
    return t.reEmitter.reEmit(i, [
      mt.Name,
      mt.Redaction,
      mt.RedactionCancelled,
      mt.Receipt,
      mt.Tags,
      mt.LocalEchoUpdated,
      mt.AccountData,
      mt.MyMembership,
      mt.Timeline,
      mt.TimelineReset,
      qn.Events,
      qn.Members,
      qn.NewMember,
      qn.Update,
      Ii.New,
      Ii.Update,
      Ii.Destroy,
      Ii.LivenessChange
    ]), i.on(qn.NewMember, (a, s, l) => {
      var c;
      l.user = (c = t.getUser(l.userId)) !== null && c !== void 0 ? c : void 0, t.reEmitter.reEmit(l, [
        Ui.Name,
        Ui.Typing,
        Ui.PowerLevel,
        Ui.Membership
      ]);
    }), i;
  }
  function Gne(t, e) {
    var n = [];
    t.map((r) => {
      if (r.message.type === "m.key.verification.cancel") {
        var i = r.message.content.transaction_id;
        i && n.push(i);
      }
      return r;
    }).forEach(function(r) {
      {
        var i = r.message, a = i.content, s = new to(Object.assign({}, i));
        if (i.type === "m.key.verification.start" || i.type === "m.key.verification.request") {
          var l = a.transaction_id;
          n.includes(l) && s.flagCancelled();
        }
        r.encryptionInfo && s.makeEncrypted(ce.RoomMessageEncrypted, {
          ciphertext: ""
        }, r.encryptionInfo.senderCurve25519KeyBase64, ""), e.emit(jt.ToDeviceEvent, s);
      }
      e.emit(jt.ReceivedToDeviceMessage, r);
    });
  }
  class iwe {
    constructor() {
      $(this, "accountData", /* @__PURE__ */ new Map()), $(this, "fromToken", null);
    }
    isNewlyCreated() {
      return Promise.resolve(true);
    }
    getSyncToken() {
      return this.fromToken;
    }
    setSyncToken(e) {
      this.fromToken = e;
    }
    storeRoom(e) {
    }
    getRoom(e) {
      return null;
    }
    getRooms() {
      return [];
    }
    removeRoom(e) {
    }
    getRoomSummaries() {
      return [];
    }
    storeUser(e) {
    }
    getUser(e) {
      return null;
    }
    getUsers() {
      return [];
    }
    scrollback(e, n) {
      return [];
    }
    setUserCreator(e) {
    }
    storeEvents(e, n, r, i) {
    }
    storeFilter(e) {
    }
    getFilter(e, n) {
      return null;
    }
    getFilterIdByName(e) {
      return null;
    }
    setFilterIdByName(e, n) {
    }
    storeAccountDataEvents(e) {
    }
    getAccountData(e) {
    }
    setSyncData(e) {
      return Promise.resolve();
    }
    wantsSave() {
      return false;
    }
    save() {
      return Promise.resolve();
    }
    startup() {
      return Promise.resolve();
    }
    getSavedSync() {
      return Promise.resolve(null);
    }
    getSavedSyncToken() {
      return Promise.resolve(null);
    }
    deleteAllData() {
      return Promise.resolve();
    }
    getOutOfBandMembers() {
      return Promise.resolve(null);
    }
    setOutOfBandMembers(e, n) {
      return Promise.resolve();
    }
    clearOutOfBandMembers() {
      return Promise.resolve();
    }
    getClientOptions() {
      return Promise.resolve(void 0);
    }
    storeClientOptions(e) {
      return Promise.resolve();
    }
    getPendingEvents(e) {
      return me(function* () {
        return [];
      })();
    }
    setPendingEvents(e, n) {
      return Promise.resolve();
    }
    saveToDeviceBatches(e) {
      return me(function* () {
        return Promise.resolve();
      })();
    }
    getOldestToDeviceBatch() {
      return Promise.resolve(null);
    }
    removeToDeviceBatch(e) {
      return me(function* () {
        return Promise.resolve();
      })();
    }
    destroy() {
      return me(function* () {
      })();
    }
  }
  const ma = [];
  for (let t = 0; t < 256; ++t) ma.push((t + 256).toString(16).slice(1));
  function owe(t, e = 0) {
    return (ma[t[e + 0]] + ma[t[e + 1]] + ma[t[e + 2]] + ma[t[e + 3]] + "-" + ma[t[e + 4]] + ma[t[e + 5]] + "-" + ma[t[e + 6]] + ma[t[e + 7]] + "-" + ma[t[e + 8]] + ma[t[e + 9]] + "-" + ma[t[e + 10]] + ma[t[e + 11]] + ma[t[e + 12]] + ma[t[e + 13]] + ma[t[e + 14]] + ma[t[e + 15]]).toLowerCase();
  }
  let Zj;
  const awe = new Uint8Array(16);
  function swe() {
    if (!Zj) {
      if (typeof crypto > "u" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
      Zj = crypto.getRandomValues.bind(crypto);
    }
    return Zj(awe);
  }
  const lwe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), kH = {
    randomUUID: lwe
  };
  function cwe(t, e, n) {
    var _a6;
    t = t || {};
    const r = t.random ?? ((_a6 = t.rng) == null ? void 0 : _a6.call(t)) ?? swe();
    if (r.length < 16) throw new Error("Random bytes length must be >= 16");
    return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, owe(r);
  }
  function dwe(t, e, n) {
    return kH.randomUUID && !t ? kH.randomUUID() : cwe(t);
  }
  var fc = {}, Jj = {}, Xj = {
    exports: {}
  }, SH;
  function nB() {
    if (SH) return Xj.exports;
    SH = 1;
    var t = Xj.exports = {
      v: [
        {
          name: "version",
          reg: /^(\d*)$/
        }
      ],
      o: [
        {
          name: "origin",
          reg: /^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,
          names: [
            "username",
            "sessionId",
            "sessionVersion",
            "netType",
            "ipVer",
            "address"
          ],
          format: "%s %s %d %s IP%d %s"
        }
      ],
      s: [
        {
          name: "name"
        }
      ],
      i: [
        {
          name: "description"
        }
      ],
      u: [
        {
          name: "uri"
        }
      ],
      e: [
        {
          name: "email"
        }
      ],
      p: [
        {
          name: "phone"
        }
      ],
      z: [
        {
          name: "timezones"
        }
      ],
      r: [
        {
          name: "repeats"
        }
      ],
      t: [
        {
          name: "timing",
          reg: /^(\d*) (\d*)/,
          names: [
            "start",
            "stop"
          ],
          format: "%d %d"
        }
      ],
      c: [
        {
          name: "connection",
          reg: /^IN IP(\d) (\S*)/,
          names: [
            "version",
            "ip"
          ],
          format: "IN IP%d %s"
        }
      ],
      b: [
        {
          push: "bandwidth",
          reg: /^(TIAS|AS|CT|RR|RS):(\d*)/,
          names: [
            "type",
            "limit"
          ],
          format: "%s:%s"
        }
      ],
      m: [
        {
          reg: /^(\w*) (\d*) ([\w/]*)(?: (.*))?/,
          names: [
            "type",
            "port",
            "protocol",
            "payloads"
          ],
          format: "%s %d %s %s"
        }
      ],
      a: [
        {
          push: "rtp",
          reg: /^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,
          names: [
            "payload",
            "codec",
            "rate",
            "encoding"
          ],
          format: function(e) {
            return e.encoding ? "rtpmap:%d %s/%s/%s" : e.rate ? "rtpmap:%d %s/%s" : "rtpmap:%d %s";
          }
        },
        {
          push: "fmtp",
          reg: /^fmtp:(\d*) ([\S| ]*)/,
          names: [
            "payload",
            "config"
          ],
          format: "fmtp:%d %s"
        },
        {
          name: "control",
          reg: /^control:(.*)/,
          format: "control:%s"
        },
        {
          name: "rtcp",
          reg: /^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,
          names: [
            "port",
            "netType",
            "ipVer",
            "address"
          ],
          format: function(e) {
            return e.address != null ? "rtcp:%d %s IP%d %s" : "rtcp:%d";
          }
        },
        {
          push: "rtcpFbTrrInt",
          reg: /^rtcp-fb:(\*|\d*) trr-int (\d*)/,
          names: [
            "payload",
            "value"
          ],
          format: "rtcp-fb:%s trr-int %d"
        },
        {
          push: "rtcpFb",
          reg: /^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,
          names: [
            "payload",
            "type",
            "subtype"
          ],
          format: function(e) {
            return e.subtype != null ? "rtcp-fb:%s %s %s" : "rtcp-fb:%s %s";
          }
        },
        {
          push: "ext",
          reg: /^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,
          names: [
            "value",
            "direction",
            "encrypt-uri",
            "uri",
            "config"
          ],
          format: function(e) {
            return "extmap:%d" + (e.direction ? "/%s" : "%v") + (e["encrypt-uri"] ? " %s" : "%v") + " %s" + (e.config ? " %s" : "");
          }
        },
        {
          name: "extmapAllowMixed",
          reg: /^(extmap-allow-mixed)/
        },
        {
          push: "crypto",
          reg: /^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,
          names: [
            "id",
            "suite",
            "config",
            "sessionConfig"
          ],
          format: function(e) {
            return e.sessionConfig != null ? "crypto:%d %s %s %s" : "crypto:%d %s %s";
          }
        },
        {
          name: "setup",
          reg: /^setup:(\w*)/,
          format: "setup:%s"
        },
        {
          name: "connectionType",
          reg: /^connection:(new|existing)/,
          format: "connection:%s"
        },
        {
          name: "mid",
          reg: /^mid:([^\s]*)/,
          format: "mid:%s"
        },
        {
          name: "msid",
          reg: /^msid:(.*)/,
          format: "msid:%s"
        },
        {
          name: "ptime",
          reg: /^ptime:(\d*(?:\.\d*)*)/,
          format: "ptime:%d"
        },
        {
          name: "maxptime",
          reg: /^maxptime:(\d*(?:\.\d*)*)/,
          format: "maxptime:%d"
        },
        {
          name: "direction",
          reg: /^(sendrecv|recvonly|sendonly|inactive)/
        },
        {
          name: "icelite",
          reg: /^(ice-lite)/
        },
        {
          name: "iceUfrag",
          reg: /^ice-ufrag:(\S*)/,
          format: "ice-ufrag:%s"
        },
        {
          name: "icePwd",
          reg: /^ice-pwd:(\S*)/,
          format: "ice-pwd:%s"
        },
        {
          name: "fingerprint",
          reg: /^fingerprint:(\S*) (\S*)/,
          names: [
            "type",
            "hash"
          ],
          format: "fingerprint:%s %s"
        },
        {
          push: "candidates",
          reg: /^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,
          names: [
            "foundation",
            "component",
            "transport",
            "priority",
            "ip",
            "port",
            "type",
            "raddr",
            "rport",
            "tcptype",
            "generation",
            "network-id",
            "network-cost"
          ],
          format: function(e) {
            var n = "candidate:%s %d %s %d %s %d typ %s";
            return n += e.raddr != null ? " raddr %s rport %d" : "%v%v", n += e.tcptype != null ? " tcptype %s" : "%v", e.generation != null && (n += " generation %d"), n += e["network-id"] != null ? " network-id %d" : "%v", n += e["network-cost"] != null ? " network-cost %d" : "%v", n;
          }
        },
        {
          name: "endOfCandidates",
          reg: /^(end-of-candidates)/
        },
        {
          name: "remoteCandidates",
          reg: /^remote-candidates:(.*)/,
          format: "remote-candidates:%s"
        },
        {
          name: "iceOptions",
          reg: /^ice-options:(\S*)/,
          format: "ice-options:%s"
        },
        {
          push: "ssrcs",
          reg: /^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,
          names: [
            "id",
            "attribute",
            "value"
          ],
          format: function(e) {
            var n = "ssrc:%d";
            return e.attribute != null && (n += " %s", e.value != null && (n += ":%s")), n;
          }
        },
        {
          push: "ssrcGroups",
          reg: /^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,
          names: [
            "semantics",
            "ssrcs"
          ],
          format: "ssrc-group:%s %s"
        },
        {
          name: "msidSemantic",
          reg: /^msid-semantic:\s?(\w*) (\S*)/,
          names: [
            "semantic",
            "token"
          ],
          format: "msid-semantic: %s %s"
        },
        {
          push: "groups",
          reg: /^group:(\w*) (.*)/,
          names: [
            "type",
            "mids"
          ],
          format: "group:%s %s"
        },
        {
          name: "rtcpMux",
          reg: /^(rtcp-mux)/
        },
        {
          name: "rtcpRsize",
          reg: /^(rtcp-rsize)/
        },
        {
          name: "sctpmap",
          reg: /^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,
          names: [
            "sctpmapNumber",
            "app",
            "maxMessageSize"
          ],
          format: function(e) {
            return e.maxMessageSize != null ? "sctpmap:%s %s %s" : "sctpmap:%s %s";
          }
        },
        {
          name: "xGoogleFlag",
          reg: /^x-google-flag:([^\s]*)/,
          format: "x-google-flag:%s"
        },
        {
          push: "rids",
          reg: /^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,
          names: [
            "id",
            "direction",
            "params"
          ],
          format: function(e) {
            return e.params ? "rid:%s %s %s" : "rid:%s %s";
          }
        },
        {
          push: "imageattrs",
          reg: new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),
          names: [
            "pt",
            "dir1",
            "attrs1",
            "dir2",
            "attrs2"
          ],
          format: function(e) {
            return "imageattr:%s %s %s" + (e.dir2 ? " %s %s" : "");
          }
        },
        {
          name: "simulcast",
          reg: new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),
          names: [
            "dir1",
            "list1",
            "dir2",
            "list2"
          ],
          format: function(e) {
            return "simulcast:%s %s" + (e.dir2 ? " %s %s" : "");
          }
        },
        {
          name: "simulcast_03",
          reg: /^simulcast:[\s\t]+([\S+\s\t]+)$/,
          names: [
            "value"
          ],
          format: "simulcast: %s"
        },
        {
          name: "framerate",
          reg: /^framerate:(\d+(?:$|\.\d+))/,
          format: "framerate:%s"
        },
        {
          name: "sourceFilter",
          reg: /^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,
          names: [
            "filterMode",
            "netType",
            "addressTypes",
            "destAddress",
            "srcList"
          ],
          format: "source-filter: %s %s %s %s %s"
        },
        {
          name: "bundleOnly",
          reg: /^(bundle-only)/
        },
        {
          name: "label",
          reg: /^label:(.+)/,
          format: "label:%s"
        },
        {
          name: "sctpPort",
          reg: /^sctp-port:(\d+)$/,
          format: "sctp-port:%s"
        },
        {
          name: "maxMessageSize",
          reg: /^max-message-size:(\d+)$/,
          format: "max-message-size:%s"
        },
        {
          push: "tsRefClocks",
          reg: /^ts-refclk:([^\s=]*)(?:=(\S*))?/,
          names: [
            "clksrc",
            "clksrcExt"
          ],
          format: function(e) {
            return "ts-refclk:%s" + (e.clksrcExt != null ? "=%s" : "");
          }
        },
        {
          name: "mediaClk",
          reg: /^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,
          names: [
            "id",
            "mediaClockName",
            "mediaClockValue",
            "rateNumerator",
            "rateDenominator"
          ],
          format: function(e) {
            var n = "mediaclk:";
            return n += e.id != null ? "id=%s %s" : "%v%s", n += e.mediaClockValue != null ? "=%s" : "", n += e.rateNumerator != null ? " rate=%s" : "", n += e.rateDenominator != null ? "/%s" : "", n;
          }
        },
        {
          name: "keywords",
          reg: /^keywds:(.+)$/,
          format: "keywds:%s"
        },
        {
          name: "content",
          reg: /^content:(.+)/,
          format: "content:%s"
        },
        {
          name: "bfcpFloorCtrl",
          reg: /^floorctrl:(c-only|s-only|c-s)/,
          format: "floorctrl:%s"
        },
        {
          name: "bfcpConfId",
          reg: /^confid:(\d+)/,
          format: "confid:%s"
        },
        {
          name: "bfcpUserId",
          reg: /^userid:(\d+)/,
          format: "userid:%s"
        },
        {
          name: "bfcpFloorId",
          reg: /^floorid:(.+) (?:m-stream|mstrm):(.+)/,
          names: [
            "id",
            "mStream"
          ],
          format: "floorid:%s mstrm:%s"
        },
        {
          push: "invalid",
          names: [
            "value"
          ]
        }
      ]
    };
    return Object.keys(t).forEach(function(e) {
      var n = t[e];
      n.forEach(function(r) {
        r.reg || (r.reg = /(.*)/), r.format || (r.format = "%s");
      });
    }), Xj.exports;
  }
  var jH;
  function uwe() {
    return jH || (jH = 1, (function(t) {
      var e = function(l) {
        return String(Number(l)) === l ? Number(l) : l;
      }, n = function(l, c, d, u) {
        if (u && !d) c[u] = e(l[1]);
        else for (var h = 0; h < d.length; h += 1) l[h + 1] != null && (c[d[h]] = e(l[h + 1]));
      }, r = function(l, c, d) {
        var u = l.name && l.names;
        l.push && !c[l.push] ? c[l.push] = [] : u && !c[l.name] && (c[l.name] = {});
        var h = l.push ? {} : u ? c[l.name] : c;
        n(d.match(l.reg), h, l.names, l.name), l.push && c[l.push].push(h);
      }, i = nB(), a = RegExp.prototype.test.bind(/^([a-z])=(.*)/);
      t.parse = function(l) {
        var c = {}, d = [], u = c;
        return l.split(/(\r\n|\r|\n)/).filter(a).forEach(function(h) {
          var f = h[0], g = h.slice(2);
          f === "m" && (d.push({
            rtp: [],
            fmtp: []
          }), u = d[d.length - 1]);
          for (var m = 0; m < (i[f] || []).length; m += 1) {
            var v = i[f][m];
            if (v.reg.test(g)) return r(v, u, g);
          }
        }), c.media = d, c;
      };
      var s = function(l, c) {
        var d = c.split(/=(.+)/, 2);
        return d.length === 2 ? l[d[0]] = e(d[1]) : d.length === 1 && c.length > 1 && (l[d[0]] = void 0), l;
      };
      t.parseParams = function(l) {
        return l.split(/;\s?/).reduce(s, {});
      }, t.parseFmtpConfig = t.parseParams, t.parsePayloads = function(l) {
        return l.toString().split(" ").map(Number);
      }, t.parseRemoteCandidates = function(l) {
        for (var c = [], d = l.split(" ").map(e), u = 0; u < d.length; u += 3) c.push({
          component: d[u],
          ip: d[u + 1],
          port: d[u + 2]
        });
        return c;
      }, t.parseImageAttributes = function(l) {
        return l.split(" ").map(function(c) {
          return c.substring(1, c.length - 1).split(",").reduce(s, {});
        });
      }, t.parseSimulcastStreamList = function(l) {
        return l.split(";").map(function(c) {
          return c.split(",").map(function(d) {
            var u, h = false;
            return d[0] !== "~" ? u = e(d) : (u = e(d.substring(1, d.length)), h = true), {
              scid: u,
              paused: h
            };
          });
        });
      };
    })(Jj)), Jj;
  }
  var Qj, TH;
  function hwe() {
    if (TH) return Qj;
    TH = 1;
    var t = nB(), e = /%[sdv%]/g, n = function(s) {
      var l = 1, c = arguments, d = c.length;
      return s.replace(e, function(u) {
        if (l >= d) return u;
        var h = c[l];
        switch (l += 1, u) {
          case "%%":
            return "%";
          case "%s":
            return String(h);
          case "%d":
            return Number(h);
          case "%v":
            return "";
        }
      });
    }, r = function(s, l, c) {
      var d = l.format instanceof Function ? l.format(l.push ? c : c[l.name]) : l.format, u = [
        s + "=" + d
      ];
      if (l.names) for (var h = 0; h < l.names.length; h += 1) {
        var f = l.names[h];
        l.name ? u.push(c[l.name][f]) : u.push(c[l.names[h]]);
      }
      else u.push(c[l.name]);
      return n.apply(null, u);
    }, i = [
      "v",
      "o",
      "s",
      "i",
      "u",
      "e",
      "p",
      "c",
      "b",
      "t",
      "r",
      "z",
      "a"
    ], a = [
      "i",
      "c",
      "b",
      "a"
    ];
    return Qj = function(s, l) {
      l = l || {}, s.version == null && (s.version = 0), s.name == null && (s.name = " "), s.media.forEach(function(h) {
        h.payloads == null && (h.payloads = "");
      });
      var c = l.outerOrder || i, d = l.innerOrder || a, u = [];
      return c.forEach(function(h) {
        t[h].forEach(function(f) {
          f.name in s && s[f.name] != null ? u.push(r(h, f, s)) : f.push in s && s[f.push] != null && s[f.push].forEach(function(g) {
            u.push(r(h, f, g));
          });
        });
      }), s.media.forEach(function(h) {
        u.push(r("m", t.m[0], h)), d.forEach(function(f) {
          t[f].forEach(function(g) {
            g.name in h && h[g.name] != null ? u.push(r(f, g, h)) : g.push in h && h[g.push] != null && h[g.push].forEach(function(m) {
              u.push(r(f, g, m));
            });
          });
        });
      }), u.join(`\r
`) + `\r
`;
    }, Qj;
  }
  var RH;
  function fwe() {
    if (RH) return fc;
    RH = 1;
    var t = uwe(), e = hwe(), n = nB();
    return fc.grammar = n, fc.write = e, fc.parse = t.parse, fc.parseParams = t.parseParams, fc.parseFmtpConfig = t.parseFmtpConfig, fc.parsePayloads = t.parsePayloads, fc.parseRemoteCandidates = t.parseRemoteCandidates, fc.parseImageAttributes = t.parseImageAttributes, fc.parseSimulcastStreamList = t.parseSimulcastStreamList, fc;
  }
  var nA = fwe();
  function rB(t, e) {
    if (typeof t.toBase64 == "function") return t.toBase64(e);
    var n = btoa(t.reduce((r, i) => r + String.fromCharCode(i), ""));
    return e.omitPadding && (n = n.replace(/={1,2}$/, "")), e.alphabet === "base64url" && (n = n.replace(/\+/g, "-").replace(/\//g, "_")), n;
  }
  Py = function(t) {
    return rB(t, {
      alphabet: "base64",
      omitPadding: false
    });
  };
  function Yne(t) {
    return rB(t, {
      alphabet: "base64",
      omitPadding: true
    });
  }
  function ck(t) {
    return rB(t, {
      alphabet: "base64url",
      omitPadding: true
    });
  }
  function mwe(t, e) {
    return typeof Uint8Array.fromBase64 == "function" ? Uint8Array.fromBase64(t, e) : Uint8Array.from(atob(t), (n) => n.charCodeAt(0));
  }
  wg = function(t) {
    return mwe(t.replace(/-/g, "+").replace(/_/g, "/"), {
      alphabet: "base64",
      lastChunkHandling: "loose"
    });
  };
  var gwe = "abcdefghijklmnopqrstuvwxyz", pwe = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", Fwe = "0123456789";
  function vwe(t) {
    var e = new Uint8Array(t);
    return globalThis.crypto.getRandomValues(e), ck(e);
  }
  kf = function(t) {
    return _we(t, pwe + gwe + Fwe);
  };
  function _we(t, e) {
    if (e.length < 2 || e.length > 256) throw new Error("Character set must be between 2 and 256 characters long");
    if (t < 1 || t > 32768) throw new Error("Requested random string length must be between 1 and 32768");
    for (var n = 256 - 256 % e.length, r = new Uint8Array(Math.floor(t * 1.3)), i = r.length, a = []; a.length < t; ) {
      i === r.length && (globalThis.crypto.getRandomValues(r), i = 0);
      var s = r[i++];
      s < n && a.push(e[s % e.length]);
    }
    return a.join("");
  }
  var Hh = "org.matrix.msc3077.sdp_stream_metadata", xi = (function(t) {
    return t.Usermedia = "m.usermedia", t.Screenshare = "m.screenshare", t;
  })({}), My = null, rA = 0, ywe = () => (My === null && (My = new AudioContext()), rA++, My), bwe = () => {
    if (rA--, rA === 0) {
      var t;
      (t = My) === null || t === void 0 || t.close(), My = null;
    }
  }, xwe = 200, iA = -60, wwe = 8, gd = (function(t) {
    return t.NewStream = "new_stream", t.MuteStateChanged = "mute_state_changed", t.LocalVolumeChanged = "local_volume_changed", t.VolumeChanged = "volume_changed", t.ConnectedChanged = "connected_changed", t.Speaking = "speaking", t.Disposed = "disposed", t;
  })({});
  class ju extends ji {
    constructor(e) {
      super(), $(this, "stream", void 0), $(this, "sdpMetadataStreamId", void 0), $(this, "userId", void 0), $(this, "deviceId", void 0), $(this, "purpose", void 0), $(this, "speakingVolumeSamples", void 0), $(this, "client", void 0), $(this, "call", void 0), $(this, "roomId", void 0), $(this, "audioMuted", void 0), $(this, "videoMuted", void 0), $(this, "localVolume", 1), $(this, "measuringVolumeActivity", false), $(this, "audioContext", void 0), $(this, "analyser", void 0), $(this, "frequencyBinCount", void 0), $(this, "speakingThreshold", iA), $(this, "speaking", false), $(this, "volumeLooperTimeout", void 0), $(this, "_disposed", false), $(this, "_connected", false), $(this, "onAddTrack", () => {
        this.emit(gd.NewStream, this.stream);
      }), $(this, "onCallState", (n) => {
        n === er.Connected ? this.connected = true : n === er.Connecting && (this.connected = false);
      }), $(this, "volumeLooper", () => {
        if (this.analyser && this.measuringVolumeActivity) {
          this.analyser.getFloatFrequencyData(this.frequencyBinCount);
          var n = -1 / 0;
          for (var r of this.frequencyBinCount) r > n && (n = r);
          this.speakingVolumeSamples.shift(), this.speakingVolumeSamples.push(n), this.emit(gd.VolumeChanged, n);
          var i = false;
          for (var a of this.speakingVolumeSamples) if (a > this.speakingThreshold) {
            i = true;
            break;
          }
          this.speaking !== i && (this.speaking = i, this.emit(gd.Speaking, this.speaking)), this.volumeLooperTimeout = setTimeout(this.volumeLooper, xwe);
        }
      }), this.client = e.client, this.call = e.call, this.roomId = e.roomId, this.userId = e.userId, this.deviceId = e.deviceId, this.purpose = e.purpose, this.audioMuted = e.audioMuted, this.videoMuted = e.videoMuted, this.speakingVolumeSamples = new Array(wwe).fill(-1 / 0), this.sdpMetadataStreamId = e.stream.id, this.updateStream(null, e.stream), this.stream = e.stream, this.hasAudioTrack && this.initVolumeMeasuring(), e.call && (e.call.addListener(xr.State, this.onCallState), this.onCallState(e.call.state));
    }
    get connected() {
      return this.isLocal() || this._connected;
    }
    set connected(e) {
      this._connected = e, this.emit(gd.ConnectedChanged, this.connected);
    }
    get hasAudioTrack() {
      return this.stream.getAudioTracks().length > 0;
    }
    updateStream(e, n) {
      if (n !== e) {
        var r = this.measuringVolumeActivity;
        e && (e.removeEventListener("addtrack", this.onAddTrack), this.measureVolumeActivity(false)), this.stream = n, n.addEventListener("addtrack", this.onAddTrack), this.hasAudioTrack ? (this.initVolumeMeasuring(), r && this.measureVolumeActivity(true)) : this.measureVolumeActivity(false), this.emit(gd.NewStream, this.stream);
      }
    }
    initVolumeMeasuring() {
      if (this.hasAudioTrack) {
        this.audioContext || (this.audioContext = ywe()), this.analyser = this.audioContext.createAnalyser(), this.analyser.fftSize = 512, this.analyser.smoothingTimeConstant = 0.1;
        var e = this.audioContext.createMediaStreamSource(this.stream);
        e.connect(this.analyser), this.frequencyBinCount = new Float32Array(this.analyser.frequencyBinCount);
      }
    }
    getMember() {
      var e, n = this.client.getRoom(this.roomId);
      return (e = n == null ? void 0 : n.getMember(this.userId)) !== null && e !== void 0 ? e : null;
    }
    isLocal() {
      return this.userId === this.client.getUserId() && (this.deviceId === void 0 || this.deviceId === this.client.getDeviceId());
    }
    isAudioMuted() {
      return this.stream.getAudioTracks().length === 0 || this.audioMuted;
    }
    isVideoMuted() {
      return this.stream.getVideoTracks().length === 0 || this.videoMuted;
    }
    isSpeaking() {
      return this.speaking;
    }
    setNewStream(e) {
      this.updateStream(this.stream, e);
    }
    setAudioVideoMuted(e, n) {
      e !== null && (this.audioMuted !== e && this.speakingVolumeSamples.fill(-1 / 0), this.audioMuted = e), n !== null && (this.videoMuted = n), this.emit(gd.MuteStateChanged, this.audioMuted, this.videoMuted);
    }
    measureVolumeActivity(e) {
      if (e) {
        if (!this.analyser || !this.frequencyBinCount || !this.hasAudioTrack) return;
        this.measuringVolumeActivity = true, this.volumeLooper();
      } else this.measuringVolumeActivity = false, this.speakingVolumeSamples.fill(-1 / 0), this.emit(gd.VolumeChanged, -1 / 0);
    }
    setSpeakingThreshold(e) {
      this.speakingThreshold = e;
    }
    clone() {
      var e = this.client.getMediaHandler(), n = this.stream.clone();
      return _e.log("CallFeed clone() cloning stream (originalStreamId=".concat(this.stream.id, ", newStreamId").concat(n.id, ")")), this.purpose === xi.Usermedia ? e.userMediaStreams.push(n) : e.screensharingStreams.push(n), new ju({
        client: this.client,
        roomId: this.roomId,
        userId: this.userId,
        deviceId: this.deviceId,
        stream: n,
        purpose: this.purpose,
        audioMuted: this.audioMuted,
        videoMuted: this.videoMuted
      });
    }
    dispose() {
      var e, n;
      clearTimeout(this.volumeLooperTimeout), (e = this.stream) === null || e === void 0 || e.removeEventListener("addtrack", this.onAddTrack), (n = this.call) === null || n === void 0 || n.removeListener(xr.State, this.onCallState), this.audioContext && (this.audioContext = void 0, this.analyser = void 0, bwe()), this._disposed = true, this.emit(gd.Disposed);
    }
    get disposed() {
      return this._disposed;
    }
    set disposed(e) {
      this._disposed = e;
    }
    getLocalVolume() {
      return this.localVolume;
    }
    setLocalVolume(e) {
      this.localVolume = e, this.emit(gd.LocalVolumeChanged, e);
    }
  }
  var Dwe = 3e3, oA = (function(t) {
    return t.Incoming = "Call.incoming", t;
  })({});
  class Cwe {
    constructor(e) {
      $(this, "calls", void 0), $(this, "callEventBuffer", void 0), $(this, "nextSeqByCall", /* @__PURE__ */ new Map()), $(this, "toDeviceEventBuffers", /* @__PURE__ */ new Map()), $(this, "client", void 0), $(this, "candidateEventsByCall", void 0), $(this, "eventBufferPromiseChain", void 0), $(this, "onSync", () => {
        var n = this.callEventBuffer;
        this.callEventBuffer = [], this.eventBufferPromiseChain ? this.eventBufferPromiseChain = this.eventBufferPromiseChain.then(() => this.evaluateEventBuffer(n)) : this.eventBufferPromiseChain = this.evaluateEventBuffer(n);
      }), $(this, "onRoomTimeline", (n) => {
        this.callEventBuffer.push(n);
      }), $(this, "onToDeviceEvent", (n) => {
        var r = n.getContent();
        if (!r.call_id) {
          this.callEventBuffer.push(n);
          return;
        }
        if (this.nextSeqByCall.has(r.call_id) || this.nextSeqByCall.set(r.call_id, 0), r.seq === void 0) {
          this.callEventBuffer.push(n);
          return;
        }
        var i = this.nextSeqByCall.get(r.call_id) || 0;
        if (r.seq !== i) {
          this.toDeviceEventBuffers.has(r.call_id) || this.toDeviceEventBuffers.set(r.call_id, []);
          var a = this.toDeviceEventBuffers.get(r.call_id), s = a.findIndex((u) => u.getContent().seq > r.seq);
          s === -1 ? a.push(n) : a.splice(s, 0, n);
        } else {
          var l = r.call_id;
          this.callEventBuffer.push(n), this.nextSeqByCall.set(l, r.seq + 1);
          for (var c = this.toDeviceEventBuffers.get(l), d = c && c.shift(); d && d.getContent().seq === this.nextSeqByCall.get(l); ) this.callEventBuffer.push(d), this.nextSeqByCall.set(l, d.getContent().seq + 1), d = c.shift();
        }
      }), this.client = e, this.calls = /* @__PURE__ */ new Map(), this.callEventBuffer = [], this.candidateEventsByCall = /* @__PURE__ */ new Map();
    }
    start() {
      this.client.on(jt.Sync, this.onSync), this.client.on(mt.Timeline, this.onRoomTimeline), this.client.on(jt.ToDeviceEvent, this.onToDeviceEvent);
    }
    stop() {
      this.client.removeListener(jt.Sync, this.onSync), this.client.removeListener(mt.Timeline, this.onRoomTimeline), this.client.removeListener(jt.ToDeviceEvent, this.onToDeviceEvent);
    }
    evaluateEventBuffer(e) {
      var n = this;
      return me(function* () {
        yield Promise.all(e.map((u) => n.client.decryptEventIfNeeded(u)));
        var r = e.filter((u) => {
          var h = u.getType();
          return h.startsWith("m.call.") || h.startsWith("org.matrix.call.");
        }), i = /* @__PURE__ */ new Set();
        for (var a of r) {
          var s = a.getType();
          (s === ce.CallAnswer || s === ce.CallHangup) && i.add(a.getContent().call_id);
        }
        for (var l of r) {
          var c = l.getType(), d = l.getContent().call_id;
          if (!(c === ce.CallInvite && i.has(d))) try {
            yield n.handleCallEvent(l);
          } catch (u) {
            _e.error("CallEventHandler evaluateEventBuffer() caught exception handling call event", u);
          }
        }
      })();
    }
    handleCallEvent(e) {
      var n = this;
      return me(function* () {
        var r;
        n.client.emit(jt.ReceivedVoipEvent, e);
        var i = e.getContent(), a = e.getRoomId() || ((r = n.client.groupCallEventHandler.getGroupCallById(i.conf_id)) === null || r === void 0 || (r = r.room) === null || r === void 0 ? void 0 : r.roomId), s = i.conf_id, l = e.getType(), c = e.getSender(), d = i.call_id ? n.calls.get(i.call_id) : void 0, u, h;
        if (s) {
          if (h = n.client.groupCallEventHandler.getGroupCallById(s), !h) {
            _e.warn("CallEventHandler handleCallEvent() could not find a group call - ignoring event (groupCallId=".concat(s, ", type=").concat(l, ")"));
            return;
          }
          if (u = i.device_id, !u) {
            _e.warn("CallEventHandler handleCallEvent() could not find a device id - ignoring event (senderId=".concat(c, ")")), h.emit(bi.Error, new Xne(c));
            return;
          }
          if (i.dest_session_id !== n.client.getSessionId()) {
            _e.warn("CallEventHandler handleCallEvent() call event does not match current session id - ignoring");
            return;
          }
        }
        var f = c === n.client.credentials.userId && (u === void 0 || u === n.client.getDeviceId());
        if (a) {
          if (l === ce.CallInvite) {
            var g, m, v;
            if (f || e.getLocalAge() > i.lifetime - Dwe || d && d.state === er.Ended || (d && _e.warn("CallEventHandler handleCallEvent() already has a call but got an invite - clobbering (callId=".concat(i.call_id, ")")), i.invitee && i.invitee !== n.client.getUserId())) return;
            var y = ((g = n.client.getTurnServersExpiry()) !== null && g !== void 0 ? g : 0) - Date.now();
            if (_e.info("CallEventHandler handleCallEvent() current turn creds expire in " + y + " ms"), d = (m = B2(n.client, a, {
              forceTURN: n.client.forceTURN,
              opponentDeviceId: u,
              groupCallId: s,
              opponentSessionId: i.sender_session_id
            })) !== null && m !== void 0 ? m : void 0, !d) {
              _e.log("CallEventHandler handleCallEvent() this client does not support WebRTC (callId=".concat(i.call_id, ")"));
              return;
            }
            d.callId = i.call_id;
            var w = (v = h) === null || v === void 0 ? void 0 : v.getGroupCallStats();
            w && d.initStats(w);
            try {
              yield d.initWithInvite(e);
            } catch (A) {
              if (A instanceof xu) if (A.code === Ly.UnknownDevice) {
                var b;
                (b = h) === null || b === void 0 || b.emit(bi.Error, A);
              } else _e.error(A);
            }
            if (n.calls.set(d.callId, d), n.candidateEventsByCall.get(d.callId)) for (var j of n.candidateEventsByCall.get(d.callId)) d.onRemoteIceCandidatesReceived(j);
            var k;
            for (var C of n.calls.values()) {
              var x, S = [
                er.WaitLocalMedia,
                er.CreateOffer,
                er.InviteSent
              ].includes(C.state);
              if (d.roomId === C.roomId && C.direction === Qh.Outbound && ((x = d.getOpponentMember()) === null || x === void 0 ? void 0 : x.userId) === C.invitee && S) {
                k = C;
                break;
              }
            }
            k ? k.callId > d.callId ? (_e.log("CallEventHandler handleCallEvent() detected glare - answering incoming call and canceling outgoing call (incomingId=".concat(d.callId, ", outgoingId=").concat(k.callId, ")")), k.replacedBy(d)) : (_e.log("CallEventHandler handleCallEvent() detected glare - hanging up incoming call (incomingId=".concat(d.callId, ", outgoingId=").concat(k.callId, ")")), d.hangup(_r.Replaced, true)) : n.client.emit(oA.Incoming, d);
            return;
          } else if (l === ce.CallCandidates) {
            if (f) return;
            d ? d.onRemoteIceCandidatesReceived(e) : (n.candidateEventsByCall.has(i.call_id) || n.candidateEventsByCall.set(i.call_id, []), n.candidateEventsByCall.get(i.call_id).push(e));
            return;
          } else if ([
            ce.CallHangup,
            ce.CallReject
          ].includes(l)) {
            if (d) d.state !== er.Ended && (l === ce.CallHangup ? d.onHangupReceived(i) : d.onRejectReceived(i), d.state === er.Ended && n.calls.delete(i.call_id));
            else {
              var T;
              d = (T = B2(n.client, a, {
                opponentDeviceId: u,
                opponentSessionId: i.sender_session_id
              })) !== null && T !== void 0 ? T : void 0, d && (d.callId = i.call_id, d.initWithHangup(e), n.calls.set(i.call_id, d));
            }
            return;
          }
          if (!d || !d.hasPeerConnection) {
            _e.info("CallEventHandler handleCallEvent() discarding possible call event as we don't have a call (type=".concat(l, ")"));
            return;
          }
          if (e.getContent().party_id !== d.ourPartyId) switch (l) {
            case ce.CallAnswer:
              f ? d.state === er.Ringing && d.onAnsweredElsewhere(i) : d.onAnswerReceived(e);
              break;
            case ce.CallSelectAnswer:
              d.onSelectAnswerReceived(e);
              break;
            case ce.CallNegotiate:
              d.onNegotiateReceived(e);
              break;
            case ce.CallAssertedIdentity:
            case ce.CallAssertedIdentityPrefix:
              d.onAssertedIdentityReceived(e);
              break;
            case ce.CallSDPStreamMetadataChanged:
            case ce.CallSDPStreamMetadataChangedPrefix:
              d.onSDPStreamMetadataChangedReceived(e);
              break;
          }
        }
      })();
    }
  }
  var aA = (function(t) {
    return t.Incoming = "GroupCall.incoming", t.Outgoing = "GroupCall.outgoing", t.Ended = "GroupCall.ended", t.Participants = "GroupCall.participants", t;
  })({});
  class Ewe {
    constructor(e) {
      this.client = e, $(this, "groupCalls", /* @__PURE__ */ new Map()), $(this, "roomDeferreds", /* @__PURE__ */ new Map()), $(this, "onRoomsChanged", (n) => {
        this.createGroupCallForRoom(n);
      }), $(this, "onRoomStateChanged", (n, r) => {
        var i = n.getType();
        if (i === ce.GroupCallPrefix) {
          var a = n.getStateKey(), s = n.getContent(), l = this.groupCalls.get(r.roomId);
          !l && !s["m.terminated"] && !n.isRedacted() ? this.createGroupCallFromRoomStateEvent(n) : l && l.groupCallId === a ? s["m.terminated"] || n.isRedacted() ? l.terminate(false) : s["m.type"] !== l.type && _e.warn("GroupCallEventHandler onRoomStateChanged() currently does not support changing type (roomId=".concat(r.roomId, ")")) : l && l.groupCallId !== a && _e.warn("GroupCallEventHandler onRoomStateChanged() currently does not support multiple calls (roomId=".concat(r.roomId, ")"));
        }
      });
    }
    start() {
      var e = this;
      return me(function* () {
        e.client.getSyncState() !== Nn.Syncing && (_e.debug("GroupCallEventHandler start() waiting for client to start syncing"), yield new Promise((i) => {
          var a = () => {
            if (e.client.getSyncState() === Nn.Syncing) return e.client.off(jt.Sync, a), i();
          };
          e.client.on(jt.Sync, a);
        }));
        var n = e.client.getRooms();
        for (var r of n) e.createGroupCallForRoom(r);
        e.client.on(jt.Room, e.onRoomsChanged), e.client.on(qn.Events, e.onRoomStateChanged);
      })();
    }
    stop() {
      this.client.removeListener(jt.Room, this.onRoomsChanged), this.client.removeListener(qn.Events, this.onRoomStateChanged);
    }
    getRoomDeferred(e) {
      var n = this.roomDeferreds.get(e);
      if (n === void 0) {
        var r;
        n = {
          prom: new Promise((i) => {
            r = i;
          })
        }, n.resolve = r, this.roomDeferreds.set(e, n);
      }
      return n;
    }
    waitUntilRoomReadyForGroupCalls(e) {
      return this.getRoomDeferred(e).prom;
    }
    getGroupCallById(e) {
      return [
        ...this.groupCalls.values()
      ].find((n) => n.groupCallId === e);
    }
    createGroupCallForRoom(e) {
      var n = e.currentState.getStateEvents(ce.GroupCallPrefix), r = n.sort((s, l) => l.getTs() - s.getTs());
      for (var i of r) {
        var a = i.getContent();
        if (!(a["m.terminated"] || i.isRedacted())) {
          _e.debug("GroupCallEventHandler createGroupCallForRoom() choosing group call from possible calls (stateKey=".concat(i.getStateKey(), ", ts=").concat(i.getTs(), ", roomId=").concat(e.roomId, ", numOfPossibleCalls=").concat(n.length, ")")), this.createGroupCallFromRoomStateEvent(i);
          break;
        }
      }
      this.getRoomDeferred(e.roomId).resolve();
    }
    createGroupCallFromRoomStateEvent(e) {
      var n = e.getRoomId(), r = e.getContent(), i = this.client.getRoom(n);
      if (!i) {
        _e.warn("GroupCallEventHandler createGroupCallFromRoomStateEvent() couldn't find room for call (roomId=".concat(n, ")"));
        return;
      }
      var a = e.getStateKey(), s = r["m.type"];
      if (!Object.values(dk).includes(s)) {
        _e.warn("GroupCallEventHandler createGroupCallFromRoomStateEvent() received invalid call type (type=".concat(s, ", roomId=").concat(n, ")"));
        return;
      }
      var l = r["m.intent"];
      if (!Object.values(Jne).includes(l)) {
        _e.warn("Received invalid group call intent (type=".concat(s, ", roomId=").concat(n, ")"));
        return;
      }
      var c = !!r["io.element.ptt"], d;
      if (r != null && r.dataChannelsEnabled && r !== null && r !== void 0 && r.dataChannelOptions) {
        var { ordered: u, maxPacketLifeTime: h, maxRetransmits: f, protocol: g } = r.dataChannelOptions;
        d = {
          ordered: u,
          maxPacketLifeTime: h,
          maxRetransmits: f,
          protocol: g
        };
      }
      var m = new iB(this.client, i, s, c, l, a, (r == null ? void 0 : r.dataChannelsEnabled) || this.client.isVoipWithNoMediaAllowed, d, this.client.isVoipWithNoMediaAllowed, this.client.useLivekitForGroupCalls, r["io.element.livekit_service_url"]);
      return this.groupCalls.set(i.roomId, m), this.client.emit(aA.Incoming, m), m;
    }
  }
  class kwe {
    constructor() {
      $(this, "bandwidth", {}), $(this, "bitrate", {}), $(this, "packetLoss", {}), $(this, "transport", []);
    }
  }
  class Swe {
    static buildBandwidthReport(e) {
      var n = e.availableIncomingBitrate, r = e.availableOutgoingBitrate;
      return {
        download: n ? Math.round(n / 1e3) : 0,
        upload: r ? Math.round(r / 1e3) : 0
      };
    }
  }
  class jwe {
    static buildReport(e, n, r, i) {
      var a = e == null ? void 0 : e.get(n.localCandidateId), s = e == null ? void 0 : e.get(n.remoteCandidateId);
      if (s && a) {
        var l = s.ip !== void 0 ? s.ip : s.address, c = s.port, d = "".concat(l, ":").concat(c), u = a.ip !== void 0 ? a.ip : a.address, h = a.port, f = "".concat(u, ":").concat(h), g = s.protocol;
        r.some((m) => m.ip === d && m.type === g && m.localIp === f) || r.push({
          ip: d,
          type: g,
          localIp: f,
          isFocus: i,
          localCandidateType: a.candidateType,
          remoteCandidateType: s.candidateType,
          networkType: a.networkType,
          rtt: n.currentRoundTripTime ? n.currentRoundTripTime * 1e3 : NaN
        });
      }
      return r;
    }
  }
  class Twe {
    constructor() {
      $(this, "ssrcToMid", {
        local: /* @__PURE__ */ new Map(),
        remote: /* @__PURE__ */ new Map()
      });
    }
    findMidBySsrc(e, n) {
      var r;
      return this.ssrcToMid[n].forEach((i, a) => {
        if (i.find((s) => s == e)) {
          r = a;
          return;
        }
      }), r;
    }
    parse(e, n) {
      var r = nA.parse(e), i = /* @__PURE__ */ new Map();
      r.media.forEach((a) => {
        if (a.mid && a.type === "video" || a.type === "audio") {
          var s, l = [];
          (s = a.ssrcs) === null || s === void 0 || s.forEach((c) => {
            c.attribute === "cname" && l.push("".concat(c.id));
          }), i.set("".concat(a.mid), l);
        }
      }), this.ssrcToMid[n] = i;
    }
    getSsrcToMidMap(e) {
      return this.ssrcToMid[e];
    }
  }
  class Rwe {
    constructor(e) {
      this.pc = e;
    }
    getLocalTracks(e) {
      var n = (r) => r !== null && r.kind === e;
      return this.pc.getTransceivers().filter((r) => r.currentDirection === "sendonly" || r.currentDirection === "sendrecv").filter((r) => r.sender !== null).map((r) => r.sender).map((r) => r.track).filter(n);
    }
    getTackById(e) {
      return this.pc.getTransceivers().map((n) => {
        if ((n == null ? void 0 : n.sender.track) !== null && n.sender.track.id === e) return n.sender.track;
        if ((n == null ? void 0 : n.receiver.track) !== null && n.receiver.track.id === e) return n.receiver.track;
      }).find((n) => n !== void 0);
    }
    getLocalTrackIdByMid(e) {
      var n, r = this.pc.getTransceivers().find((i) => i.mid === e);
      return r == null || (n = r.sender) === null || n === void 0 || (n = n.track) === null || n === void 0 ? void 0 : n.id;
    }
    getRemoteTrackIdByMid(e) {
      var n, r = this.pc.getTransceivers().find((i) => i.mid === e);
      return r == null || (n = r.receiver) === null || n === void 0 || (n = n.track) === null || n === void 0 ? void 0 : n.id;
    }
    getActiveSimulcastStreams() {
      return 3;
    }
    getTransceiverByTrackId(e) {
      return this.pc.getTransceivers().find((n) => n.receiver.track.id === e || n.sender.track !== null && n.sender.track.id === e);
    }
  }
  class Awe {
    constructor(e, n, r) {
      this.trackId = e, this.type = n, this.kind = r, $(this, "loss", {
        packetsTotal: 0,
        packetsLost: 0,
        isDownloadStream: false
      }), $(this, "bitrate", {
        download: 0,
        upload: 0
      }), $(this, "resolution", {
        width: -1,
        height: -1
      }), $(this, "audioConcealment", {
        concealedAudio: 0,
        totalAudioDuration: 0
      }), $(this, "framerate", 0), $(this, "jitter", 0), $(this, "codec", ""), $(this, "isAlive", true), $(this, "isMuted", false), $(this, "isEnabled", true);
    }
    getType() {
      return this.type;
    }
    setLoss(e) {
      this.loss = e;
    }
    getLoss() {
      return this.loss;
    }
    setResolution(e) {
      this.resolution = e;
    }
    getResolution() {
      return this.resolution;
    }
    setFramerate(e) {
      this.framerate = e;
    }
    getFramerate() {
      return this.framerate;
    }
    setBitrate(e) {
      this.bitrate = e;
    }
    getBitrate() {
      return this.bitrate;
    }
    setCodec(e) {
      return this.codec = e, true;
    }
    getCodec() {
      return this.codec;
    }
    resetBitrate() {
      this.bitrate = {
        download: 0,
        upload: 0
      };
    }
    set alive(e) {
      this.isAlive = e;
    }
    get alive() {
      return this.isAlive;
    }
    set muted(e) {
      this.isMuted = e;
    }
    get muted() {
      return this.isMuted;
    }
    set enabled(e) {
      this.isEnabled = e;
    }
    get enabled() {
      return this.isEnabled;
    }
    setJitter(e) {
      this.jitter = e;
    }
    getJitter() {
      return this.jitter;
    }
    setAudioConcealment(e, n) {
      this.audioConcealment.concealedAudio = e, this.audioConcealment.totalAudioDuration = n;
    }
    getAudioConcealment() {
      return this.audioConcealment;
    }
  }
  class Iwe {
    constructor(e, n) {
      this.mediaSsrcHandler = e, this.mediaTrackHandler = n, $(this, "track2stats", /* @__PURE__ */ new Map());
    }
    findTrack2Stats(e, n) {
      var r;
      if (e.trackIdentifier) r = e.trackIdentifier;
      else if (e.mid) r = n === "remote" ? this.mediaTrackHandler.getRemoteTrackIdByMid(e.mid) : this.mediaTrackHandler.getLocalTrackIdByMid(e.mid);
      else if (e.ssrc) {
        var i = this.mediaSsrcHandler.findMidBySsrc(e.ssrc, n);
        if (!i) return;
        r = n === "remote" ? this.mediaTrackHandler.getRemoteTrackIdByMid(e.mid) : this.mediaTrackHandler.getLocalTrackIdByMid(e.mid);
      }
      if (r) {
        var a = this.track2stats.get(r);
        if (!a) {
          var s = this.mediaTrackHandler.getTackById(r);
          if (s !== void 0) {
            var l = s.kind === "audio" ? s.kind : "video";
            a = new Awe(r, n, l), this.track2stats.set(r, a);
          } else return;
        }
        return a;
      }
    }
    findLocalVideoTrackStats(e) {
      var n = this.mediaTrackHandler.getLocalTracks("video");
      if (n.length !== 0) return this.findTrack2Stats(e, "local");
    }
    getTrack2stats() {
      return this.track2stats;
    }
    findTransceiverByTrackId(e) {
      return this.mediaTrackHandler.getTransceiverByTrackId(e);
    }
  }
  class Km {
    static getNonNegativeValue(e) {
      var n = e;
      return typeof n != "number" && (n = Number(n)), isNaN(n) ? 0 : Math.max(0, n);
    }
  }
  class Ks {
    static buildFramerateResolution(e, n) {
      var r = {
        height: n.frameHeight,
        width: n.frameWidth
      }, i = n.framesPerSecond;
      r.height && r.width && e.setResolution(r), e.setFramerate(Math.round(i || 0));
    }
    static calculateSimulcastFramerate(e, n, r, i) {
      var a = e.getFramerate();
      if (!a) {
        if (r) {
          var s = n.timestamp - r.timestamp;
          if (s > 0 && n.framesSent) {
            var l = n.framesSent - r.framesSent;
            a = l / s * 1e3;
          }
        }
        if (!a) return;
      }
      a = i ? Math.round(a / i) : 0, e.setFramerate(a);
    }
    static buildCodec(e, n, r) {
      var i = e == null ? void 0 : e.get(r.codecId);
      if (i) {
        var a = i.mimeType.split("/")[1];
        a && n.setCodec(a);
      }
    }
    static buildBitrateReceived(e, n, r) {
      e.setBitrate({
        download: Ks.calculateBitrate(n.bytesReceived, r.bytesReceived, n.timestamp, r.timestamp),
        upload: 0
      });
    }
    static buildBitrateSend(e, n, r) {
      e.setBitrate({
        download: 0,
        upload: this.calculateBitrate(n.bytesSent, r.bytesSent, n.timestamp, r.timestamp)
      });
    }
    static buildPacketsLost(e, n, r) {
      var i = n.type === "outbound-rtp" ? "packetsSent" : "packetsReceived", a = n[i];
      (!a || a < 0) && (a = 0);
      var s = Km.getNonNegativeValue(r[i]), l = Math.max(0, a - s), c = Km.getNonNegativeValue(n.packetsLost), d = Km.getNonNegativeValue(r.packetsLost), u = Math.max(0, c - d);
      e.setLoss({
        packetsTotal: l + u,
        packetsLost: u,
        isDownloadStream: n.type !== "outbound-rtp"
      });
    }
    static calculateBitrate(e, n, r, i) {
      var a = Km.getNonNegativeValue(e), s = Km.getNonNegativeValue(n), l = Math.max(0, a - s), c = r - i, d = 0;
      return c > 0 && (d = Math.round(l * 8 / c)), d;
    }
    static setTrackStatsState(e, n) {
      var r;
      if (n === void 0) {
        e.alive = false;
        return;
      }
      var i = e.getType() === "remote" ? n.receiver.track : n == null || (r = n.sender) === null || r === void 0 ? void 0 : r.track;
      if (i == null) {
        e.alive = false;
        return;
      }
      if (i.readyState === "ended") {
        e.alive = false;
        return;
      }
      e.muted = i.muted, e.enabled = i.enabled, e.alive = true;
    }
    static buildTrackSummary(e) {
      var n = {
        count: 0,
        muted: 0,
        maxJitter: 0,
        maxPacketLoss: 0,
        concealedAudio: 0,
        totalAudio: 0
      }, r = {
        count: 0,
        muted: 0,
        maxJitter: 0,
        maxPacketLoss: 0,
        concealedAudio: 0,
        totalAudio: 0
      }, i = e.filter((s) => s.getType() === "remote"), a = i.filter((s) => s.kind === "audio");
      return i.forEach((s) => {
        var l = s.kind === "video" ? n : r;
        if (l.count++, s.alive && s.muted && l.muted++, l.maxJitter < s.getJitter() && (l.maxJitter = s.getJitter()), l.maxPacketLoss < s.getLoss().packetsLost && (l.maxPacketLoss = s.getLoss().packetsLost), a.length > 0) {
          var c, d;
          l.concealedAudio += (c = s.getAudioConcealment()) === null || c === void 0 ? void 0 : c.concealedAudio, l.totalAudio += (d = s.getAudioConcealment()) === null || d === void 0 ? void 0 : d.totalAudioDuration;
        }
      }), {
        audioTrackSummary: r,
        videoTrackSummary: n
      };
    }
    static buildJitter(e, n) {
      if (n.type === "inbound-rtp") {
        var r = n == null ? void 0 : n.jitter;
        if (r !== void 0) {
          var i = Km.getNonNegativeValue(r);
          e.setJitter(Math.round(i * 1e3));
        } else e.setJitter(-1);
      }
    }
    static buildAudioConcealment(e, n) {
      if (n.type === "inbound-rtp") {
        var r = 1e3 * (n == null ? void 0 : n.totalSamplesDuration) / (n == null ? void 0 : n.totalSamplesReceived), i = r * (n == null ? void 0 : n.concealedSamples), a = 1e3 * (n == null ? void 0 : n.totalSamplesDuration);
        e.setAudioConcealment(i, a);
      }
    }
  }
  class Oy {
    static build(e) {
      var n = {}, r = {
        download: 0,
        upload: 0
      }, i = {
        download: 0,
        upload: 0
      }, a = 0, s = 0, l = {
        local: /* @__PURE__ */ new Map(),
        remote: /* @__PURE__ */ new Map()
      }, c = {
        local: /* @__PURE__ */ new Map(),
        remote: /* @__PURE__ */ new Map()
      }, d = {
        local: /* @__PURE__ */ new Map(),
        remote: /* @__PURE__ */ new Map()
      }, u = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), f = 0, g = 0, m = 0, v = 0, y = 0, w = 0;
      for (var [b, j] of e) {
        var k = j.getLoss(), C = k.isDownloadStream ? "download" : "upload";
        if (r[C] += k.packetsTotal, i[C] += k.packetsLost, a += j.getBitrate().download, s += j.getBitrate().upload, j.kind === "audio") {
          var x = j.getAudioConcealment();
          y += x.concealedAudio, w += x.totalAudioDuration, f += j.getBitrate().download, g += j.getBitrate().upload;
        } else m += j.getBitrate().download, v += j.getBitrate().upload;
        l[j.getType()].set(b, j.getResolution()), c[j.getType()].set(b, j.getFramerate()), d[j.getType()].set(b, j.getCodec()), j.getType() === "remote" && (u.set(b, j.getJitter()), j.kind === "audio" && h.set(b, j.getAudioConcealment())), j.resetBitrate();
      }
      return n.bitrate = {
        upload: s,
        download: a
      }, n.bitrate.audio = {
        upload: g,
        download: f
      }, n.bitrate.video = {
        upload: v,
        download: m
      }, n.packetLoss = {
        total: Oy.calculatePacketLoss(i.download + i.upload, r.download + r.upload),
        download: Oy.calculatePacketLoss(i.download, r.download),
        upload: Oy.calculatePacketLoss(i.upload, r.upload)
      }, n.audioConcealment = h, n.totalAudioConcealment = {
        concealedAudio: y,
        totalAudioDuration: w
      }, n.framerate = c, n.resolution = l, n.codec = d, n.jitter = u, n;
    }
    static calculatePacketLoss(e, n) {
      return !n || n <= 0 || !e || e <= 0 ? 0 : Math.round(e / n * 100);
    }
  }
  class pf {
    static buildCallFeedReport(e, n, r) {
      var i = r.getTransceivers(), a = [], s = [];
      return i.forEach((l) => {
        var c, d = (c = l.sender) !== null && c !== void 0 && c.track ? pf.buildTrackStats(l.sender.track, "sender") : null, u = pf.buildTrackStats(l.receiver.track, "receiver");
        a.push({
          mid: l.mid == null ? "null" : l.mid,
          direction: l.direction,
          currentDirection: l.currentDirection == null ? "null" : l.currentDirection,
          sender: d,
          receiver: u
        });
      }), {
        callId: e,
        opponentMemberId: n,
        transceiver: a,
        callFeeds: s
      };
    }
    static buildTrackStats(e) {
      var n, r, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "--", a = (n = e.getSettings()) === null || n === void 0 ? void 0 : n.deviceId, s = (r = e.getConstraints()) === null || r === void 0 ? void 0 : r.deviceId;
      return {
        id: e.id,
        kind: e.kind,
        settingDeviceId: a ?? "unknown",
        constrainDeviceId: s ?? "unknown",
        muted: e.muted,
        enabled: e.enabled,
        readyState: e.readyState,
        label: i
      };
    }
    static expandCallFeedReport(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "unknown";
      return n.forEach((i) => {
        var a = i.stream.getAudioTracks(), s = i.stream.getVideoTracks(), l = a.length > 0 ? pf.buildTrackStats(i.stream.getAudioTracks()[0], i.purpose) : null, c = s.length > 0 ? pf.buildTrackStats(i.stream.getVideoTracks()[0], i.purpose) : null, d = {
          stream: i.stream.id,
          type: i.isLocal() ? "local" : "remote",
          audio: l,
          video: c,
          purpose: i.purpose,
          prefix: r,
          isVideoMuted: i.isVideoMuted(),
          isAudioMuted: i.isAudioMuted()
        };
        e.callFeeds.push(d);
      }), e;
    }
  }
  function AH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Zx(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? AH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : AH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  class Bwe {
    constructor(e, n, r, i) {
      var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
      this.callId = e, this.opponentMemberId = n, this.pc = r, this.emitter = i, this.isFocus = a, $(this, "isActive", true), $(this, "previousStatsReport", void 0), $(this, "currentStatsReport", void 0), $(this, "connectionStats", new kwe()), $(this, "trackStats", void 0), r.addEventListener("signalingstatechange", this.onSignalStateChange.bind(this)), this.trackStats = new Iwe(new Twe(), new Rwe(r));
    }
    processStats(e, n) {
      var r = this;
      return me(function* () {
        var i = {
          isFirstCollection: r.previousStatsReport === void 0,
          receivedMedia: 0,
          receivedAudioMedia: 0,
          receivedVideoMedia: 0,
          audioTrackSummary: {
            count: 0,
            muted: 0,
            maxPacketLoss: 0,
            maxJitter: 0,
            concealedAudio: 0,
            totalAudio: 0
          },
          videoTrackSummary: {
            count: 0,
            muted: 0,
            maxPacketLoss: 0,
            maxJitter: 0,
            concealedAudio: 0,
            totalAudio: 0
          }
        };
        if (r.isActive) {
          var a = r.pc.getStats();
          if (typeof (a == null ? void 0 : a.then) == "function") return a.then((s) => {
            var l, c;
            r.currentStatsReport = typeof (s == null ? void 0 : s.result) == "function" ? s.result() : s;
            try {
              r.processStatsReport(e, n);
            } catch (u) {
              return r.handleError(u), i;
            }
            r.previousStatsReport = r.currentStatsReport, i.receivedMedia = r.connectionStats.bitrate.download, i.receivedAudioMedia = ((l = r.connectionStats.bitrate.audio) === null || l === void 0 ? void 0 : l.download) || 0, i.receivedVideoMedia = ((c = r.connectionStats.bitrate.video) === null || c === void 0 ? void 0 : c.download) || 0;
            var d = Ks.buildTrackSummary(Array.from(r.trackStats.getTrack2stats().values()));
            return Zx(Zx({}, i), {}, {
              audioTrackSummary: d.audioTrackSummary,
              videoTrackSummary: d.videoTrackSummary
            });
          }).catch((s) => (r.handleError(s), i));
          r.isActive = false;
        }
        return Promise.resolve(i);
      })();
    }
    processStatsReport(e, n) {
      var r, i = /* @__PURE__ */ new Map();
      i.callId = this.callId, i.opponentMemberId = this.opponentMemberId, (r = this.currentStatsReport) === null || r === void 0 || r.forEach((a) => {
        var s = this.previousStatsReport ? this.previousStatsReport.get(a.id) : null;
        if (a.type === "candidate-pair" && a.nominated && a.state === "succeeded") this.connectionStats.bandwidth = Swe.buildBandwidthReport(a), this.connectionStats.transport = jwe.buildReport(this.currentStatsReport, a, this.connectionStats.transport, this.isFocus);
        else if (a.type === "inbound-rtp" || a.type === "outbound-rtp") {
          var l = this.trackStats.findTrack2Stats(a, a.type === "inbound-rtp" ? "remote" : "local");
          if (!l) return;
          if (s && Ks.buildPacketsLost(l, a, s), a.type === "inbound-rtp") {
            Ks.buildFramerateResolution(l, a), s && Ks.buildBitrateReceived(l, a, s);
            var c = this.trackStats.findTransceiverByTrackId(l.trackId);
            Ks.setTrackStatsState(l, c), Ks.buildJitter(l, a), Ks.buildAudioConcealment(l, a);
          } else s && (i.set(l.trackId, Km.getNonNegativeValue(a.bytesSent)), Ks.buildBitrateSend(l, a, s));
          Ks.buildCodec(this.currentStatsReport, l, a);
        } else if (a.type === "track" && a.kind === "video" && !a.remoteSource) {
          var d = this.trackStats.findLocalVideoTrackStats(a);
          if (!d) return;
          Ks.buildFramerateResolution(d, a), Ks.calculateSimulcastFramerate(d, a, s, this.trackStats.mediaTrackHandler.getActiveSimulcastStreams());
        }
      }), this.emitter.emitByteSendReport(i), this.emitter.emitCallFeedReport(pf.buildCallFeedReport(this.callId, this.opponentMemberId, this.pc)), this.processAndEmitConnectionStatsReport();
    }
    setActive(e) {
      this.isActive = e;
    }
    getActive() {
      return this.isActive;
    }
    handleError(e) {
      this.isActive = false, _e.warn("CallStatsReportGatherer ".concat(this.callId, " processStatsReport fails and set to inactive ").concat(e));
    }
    processAndEmitConnectionStatsReport() {
      var e = Oy.build(this.trackStats.getTrack2stats());
      e.callId = this.callId, e.opponentMemberId = this.opponentMemberId, this.connectionStats.bandwidth = e.bandwidth, this.connectionStats.bitrate = e.bitrate, this.connectionStats.packetLoss = e.packetLoss, this.emitter.emitConnectionStatsReport(Zx(Zx({}, e), {}, {
        transport: this.connectionStats.transport
      })), this.connectionStats.transport = [];
    }
    stopProcessingStats() {
    }
    onSignalStateChange() {
      this.pc.signalingState === "stable" && (this.pc.currentRemoteDescription && this.trackStats.mediaSsrcHandler.parse(this.pc.currentRemoteDescription.sdp, "remote"), this.pc.currentLocalDescription && this.trackStats.mediaSsrcHandler.parse(this.pc.currentLocalDescription.sdp, "local"));
    }
    setOpponentMemberId(e) {
      this.opponentMemberId = e;
    }
  }
  var Au = (function(t) {
    return t.CONNECTION_STATS = "StatsReport.connection_stats", t.CALL_FEED_REPORT = "StatsReport.call_feed_report", t.BYTE_SENT_STATS = "StatsReport.byte_sent_stats", t.SUMMARY_STATS = "StatsReport.summary_stats", t;
  })({});
  class Pwe extends ji {
    emitByteSendReport(e) {
      this.emit(Au.BYTE_SENT_STATS, e);
    }
    emitConnectionStatsReport(e) {
      this.emit(Au.CONNECTION_STATS, e);
    }
    emitCallFeedReport(e) {
      this.emit(Au.CALL_FEED_REPORT, e);
    }
    emitSummaryStatsReport(e) {
      this.emit(Au.SUMMARY_STATS, e);
    }
  }
  class Zne {
    constructor(e) {
      this.emitter = e;
    }
    build(e) {
      var n = e.filter((u) => !u.isFirstCollection), r = n.length, i = e.length;
      if (r !== 0) {
        var a = {
          receivedAudio: 0,
          receivedVideo: 0,
          receivedMedia: 0,
          concealedAudio: 0,
          totalAudio: 0
        }, s = 0, l = 0;
        n.forEach((u) => {
          this.countTrackListReceivedMedia(a, u), this.countConcealedAudio(a, u), s = this.buildMaxJitter(s, u), l = this.buildMaxPacketLoss(l, u);
        });
        var c = 5, d = {
          percentageReceivedMedia: Number((a.receivedMedia / r).toFixed(c)),
          percentageReceivedVideoMedia: Number((a.receivedVideo / r).toFixed(c)),
          percentageReceivedAudioMedia: Number((a.receivedAudio / r).toFixed(c)),
          maxJitter: s,
          maxPacketLoss: l,
          percentageConcealedAudio: Number(a.totalAudio > 0 ? (a.concealedAudio / a.totalAudio).toFixed(c) : 0),
          peerConnections: i
        };
        this.emitter.emitSummaryStatsReport(d);
      }
    }
    static extendSummaryReport(e, n) {
      var r = [], i = [];
      for (var a of n) {
        i.push(a);
        for (var s of a[1]) r.push(s);
      }
      e.opponentDevicesInCall = Math.max(0, r.length - 1), e.opponentUsersInCall = Math.max(0, i.length - 1), e.diffDevicesToPeerConnections = Math.max(0, r.length - 1) - e.peerConnections, e.ratioPeerConnectionToDevices = Math.max(0, r.length - 1) == 0 ? 0 : e.peerConnections / (r.length - 1);
    }
    countTrackListReceivedMedia(e, n) {
      var r = false, i = false;
      (n.receivedAudioMedia > 0 || n.audioTrackSummary.count === 0) && (e.receivedAudio++, r = true), (n.receivedVideoMedia > 0 || n.videoTrackSummary.count === 0 || n.videoTrackSummary.muted > 0 && n.videoTrackSummary.muted === n.videoTrackSummary.count) && (e.receivedVideo++, i = true), i && r && e.receivedMedia++;
    }
    buildMaxJitter(e, n) {
      return e < n.videoTrackSummary.maxJitter && (e = n.videoTrackSummary.maxJitter), e < n.audioTrackSummary.maxJitter && (e = n.audioTrackSummary.maxJitter), e;
    }
    buildMaxPacketLoss(e, n) {
      return e < n.videoTrackSummary.maxPacketLoss && (e = n.videoTrackSummary.maxPacketLoss), e < n.audioTrackSummary.maxPacketLoss && (e = n.audioTrackSummary.maxPacketLoss), e;
    }
    countConcealedAudio(e, n) {
      e.concealedAudio += n.audioTrackSummary.concealedAudio, e.totalAudio += n.audioTrackSummary.totalAudio;
    }
  }
  class Mwe {
    constructor(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1e4;
      this.groupCallId = e, this.userId = n, this.interval = r, $(this, "timer", void 0), $(this, "gatherers", /* @__PURE__ */ new Map()), $(this, "reports", new Pwe()), $(this, "summaryStatsReportGatherer", new Zne(this.reports));
    }
    start() {
      this.timer === void 0 && this.interval > 0 && (this.timer = setInterval(() => {
        this.processStats();
      }, this.interval));
    }
    stop() {
      this.timer !== void 0 && (clearInterval(this.timer), this.gatherers.forEach((e) => e.stopProcessingStats()));
    }
    hasStatsReportGatherer(e) {
      return this.gatherers.has(e);
    }
    addStatsReportGatherer(e, n, r) {
      return this.hasStatsReportGatherer(e) ? false : (this.gatherers.set(e, new Bwe(e, n, r, this.reports)), true);
    }
    removeStatsReportGatherer(e) {
      return this.gatherers.delete(e);
    }
    getStatsReportGatherer(e) {
      return this.hasStatsReportGatherer(e) ? this.gatherers.get(e) : void 0;
    }
    updateOpponentMember(e, n) {
      var r;
      (r = this.getStatsReportGatherer(e)) === null || r === void 0 || r.setOpponentMemberId(n);
    }
    processStats() {
      var e = [];
      this.gatherers.forEach((n) => {
        e.push(n.processStats(this.groupCallId, this.userId));
      }), Promise.all(e).then((n) => this.summaryStatsReportGatherer.build(n)).catch((n) => {
        _e.error("Could not build summary stats report", n);
      });
    }
    setInterval(e) {
      this.interval = e;
    }
  }
  function IH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Jx(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? IH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : IH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Jne = (function(t) {
    return t.Ring = "m.ring", t.Prompt = "m.prompt", t.Room = "m.room", t;
  })({}), dk = (function(t) {
    return t.Video = "m.video", t.Voice = "m.voice", t;
  })({}), Owe = (function(t) {
    return t.CallEnded = "call_ended", t;
  })({}), bi = (function(t) {
    return t.GroupCallStateChanged = "group_call_state_changed", t.ActiveSpeakerChanged = "active_speaker_changed", t.CallsChanged = "calls_changed", t.UserMediaFeedsChanged = "user_media_feeds_changed", t.ScreenshareFeedsChanged = "screenshare_feeds_changed", t.LocalScreenshareStateChanged = "local_screenshare_state_changed", t.LocalMuteStateChanged = "local_mute_state_changed", t.ParticipantsChanged = "participants_changed", t.Error = "group_call_error", t;
  })({}), hy = (function(t) {
    return t.ConnectionStats = "GroupCall.connection_stats", t.ByteSentStats = "GroupCall.byte_sent_stats", t.SummaryStats = "GroupCall.summary_stats", t.CallFeedStats = "GroupCall.call_feed_stats", t;
  })({}), Ly = (function(t) {
    return t.NoUserMedia = "no_user_media", t.UnknownDevice = "unknown_device", t.PlaceCallFailed = "place_call_failed", t;
  })({});
  class sA extends Error {
    constructor(e, n, r) {
      r ? (super(n + ": " + r), $(this, "code", void 0)) : (super(n), $(this, "code", void 0)), this.code = e;
    }
  }
  class Xne extends sA {
    constructor(e) {
      super(Ly.UnknownDevice, "No device found for " + e), this.userId = e;
    }
  }
  var Ji = (function(t) {
    return t.LocalCallFeedUninitialized = "local_call_feed_uninitialized", t.InitializingLocalCallFeed = "initializing_local_call_feed", t.LocalCallFeedInitialized = "local_call_feed_initialized", t.Entered = "entered", t.Ended = "ended", t;
  })({}), BH = 1e3 * 60 * 60;
  function Xx(t) {
    var e;
    return ((e = t.getOpponentMember()) === null || e === void 0 ? void 0 : e.userId) || t.invitee || null;
  }
  class iB extends ji {
    constructor(e, n, r, i, a, s, l, c, d) {
      var u, h, f = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : false, g = arguments.length > 10 ? arguments[10] : void 0;
      super(), this.client = e, this.room = n, this.type = r, this.isPtt = i, this.intent = a, this.dataChannelsEnabled = l, this.dataChannelOptions = c, this.useLivekit = f, $(this, "activeSpeakerInterval", 1e3), $(this, "retryCallInterval", 5e3), $(this, "participantTimeout", 1e3 * 15), $(this, "pttMaxTransmitTime", 1e3 * 20), $(this, "activeSpeaker", void 0), $(this, "localCallFeed", void 0), $(this, "localScreenshareFeed", void 0), $(this, "localDesktopCapturerSourceId", void 0), $(this, "userMediaFeeds", []), $(this, "screenshareFeeds", []), $(this, "groupCallId", void 0), $(this, "allowCallWithoutVideoAndAudio", void 0), $(this, "calls", /* @__PURE__ */ new Map()), $(this, "callHandlers", /* @__PURE__ */ new Map()), $(this, "activeSpeakerLoopInterval", void 0), $(this, "retryCallLoopInterval", void 0), $(this, "retryCallCounts", /* @__PURE__ */ new Map()), $(this, "reEmitter", void 0), $(this, "transmitTimer", null), $(this, "participantsExpirationTimer", null), $(this, "resendMemberStateTimer", null), $(this, "initWithAudioMuted", false), $(this, "initWithVideoMuted", false), $(this, "initCallFeedPromise", void 0), $(this, "_livekitServiceURL", void 0), $(this, "stats", void 0), $(this, "statsCollectIntervalTime", 0), $(this, "onConnectionStats", (m) => {
        this.emit(hy.ConnectionStats, {
          report: m
        });
      }), $(this, "onByteSentStats", (m) => {
        this.emit(hy.ByteSentStats, {
          report: m
        });
      }), $(this, "onSummaryStats", (m) => {
        Zne.extendSummaryReport(m, this.participants), this.emit(hy.SummaryStats, {
          report: m
        });
      }), $(this, "onCallFeedReport", (m) => {
        this.localCallFeed && (m = pf.expandCallFeedReport(m, [
          this.localCallFeed
        ], "from-local-feed"));
        var v = [];
        this.forEachCall((y) => {
          y.callId === m.callId && y.getFeeds().forEach((w) => v.push(w));
        }), m = pf.expandCallFeedReport(m, v, "from-call-feed"), this.emit(hy.CallFeedStats, {
          report: m
        });
      }), $(this, "_state", Ji.LocalCallFeedUninitialized), $(this, "_participants", /* @__PURE__ */ new Map()), $(this, "_creationTs", null), $(this, "_enteredViaAnotherSession", false), $(this, "onIncomingCall", (m) => {
        var v, y;
        if (m.roomId === this.room.roomId) {
          if (m.state !== er.Ringing) {
            _e.warn("GroupCall ".concat(this.groupCallId, " onIncomingCall() incoming call no longer in ringing state - ignoring"));
            return;
          }
          if (!m.groupCallId || m.groupCallId !== this.groupCallId) {
            _e.log("GroupCall ".concat(this.groupCallId, " onIncomingCall() ignored because it doesn't match the current group call")), m.reject();
            return;
          }
          var w = (v = m.getOpponentMember()) === null || v === void 0 ? void 0 : v.userId;
          if (w === void 0) {
            _e.warn("GroupCall ".concat(this.groupCallId, " onIncomingCall() incoming call with no member - ignoring"));
            return;
          }
          if (this.useLivekit) {
            _e.info("Received incoming call whilst in signaling-only mode! Ignoring.");
            return;
          }
          var b = (y = this.calls.get(w)) !== null && y !== void 0 ? y : /* @__PURE__ */ new Map(), j = b.get(m.getOpponentDeviceId());
          if ((j == null ? void 0 : j.callId) !== m.callId) {
            _e.log("GroupCall ".concat(this.groupCallId, " onIncomingCall() incoming call (userId=").concat(w, ", callId=").concat(m.callId, ")")), j && j.hangup(_r.Replaced, false), b.set(m.getOpponentDeviceId(), m), this.calls.set(w, b), this.initCall(m);
            var k = this.getLocalFeeds().map((x) => x.clone());
            if (!this.callExpected(m)) for (var C of k) So(C.stream.getAudioTracks(), false), So(C.stream.getVideoTracks(), false);
            m.answerWithCallFeeds(k), this.emit(bi.CallsChanged, this.calls);
          }
        }
      }), $(this, "onRetryCallLoop", () => {
        var m = false;
        for (var [{ userId: v }, y] of this.participants) {
          var w = this.calls.get(v), b = this.retryCallCounts.get(v);
          for (var [j, k] of y) {
            var C, x, S = w == null ? void 0 : w.get(j), T = (C = (x = b) === null || x === void 0 ? void 0 : x.get(j)) !== null && C !== void 0 ? C : 0;
            (S == null ? void 0 : S.getOpponentSessionId()) !== k.sessionId && this.wantsOutgoingCall(v, j) && T < 3 && (b === void 0 && (b = /* @__PURE__ */ new Map(), this.retryCallCounts.set(v, b)), b.set(j, T + 1), m = true);
          }
        }
        m && this.placeOutgoingCalls();
      }), $(this, "onCallFeedsChanged", (m) => {
        var v = Xx(m), y = m.getOpponentDeviceId();
        if (!v) throw new Error("Cannot change call feeds without user id");
        var w = this.getUserMediaFeed(v, y), b = m.remoteUsermediaFeed, j = b !== w, k = this.calls.get(v), C = k == null ? void 0 : k.get(y);
        if ((C == null ? void 0 : C.callId) === m.callId) {
          j && (!w && b ? this.addUserMediaFeed(b) : w && b ? this.replaceUserMediaFeed(w, b) : w && !b && this.removeUserMediaFeed(w));
          var x = this.getScreenshareFeed(v, y), S = m.remoteScreensharingFeed, T = S !== x;
          T && (!x && S ? this.addScreenshareFeed(S) : x && S ? this.replaceScreenshareFeed(x, S) : x && !S && this.removeScreenshareFeed(x));
        }
      }), $(this, "onCallStateChanged", (m, v, y) => {
        var w;
        if (v !== er.Ended) {
          var b = this.localCallFeed.isAudioMuted();
          m.localUsermediaStream && m.isMicrophoneMuted() !== b && m.setMicrophoneMuted(b);
          var j = this.localCallFeed.isVideoMuted();
          m.localUsermediaStream && m.isLocalVideoMuted() !== j && m.setLocalVideoMuted(j);
          var k = (w = m.getOpponentMember()) === null || w === void 0 ? void 0 : w.userId;
          if (v === er.Connected && k) {
            var C = this.retryCallCounts.get(k);
            C == null ? void 0 : C.delete(m.getOpponentDeviceId()), (C == null ? void 0 : C.size) === 0 && this.retryCallCounts.delete(k);
          }
        }
      }), $(this, "onCallHangup", (m) => {
        var v, y;
        if (m.hangupReason !== _r.Replaced) {
          var w = (v = (y = m.getOpponentMember()) === null || y === void 0 ? void 0 : y.userId) !== null && v !== void 0 ? v : this.room.getMember(m.invitee).userId, b = this.calls.get(w);
          (b == null ? void 0 : b.get(m.getOpponentDeviceId())) === m && (this.disposeCall(m, m.hangupReason), b.delete(m.getOpponentDeviceId()), b.size === 0 && this.calls.delete(w), this.emit(bi.CallsChanged, this.calls));
        }
      }), $(this, "onCallReplaced", (m, v) => {
        var y = m.getOpponentMember().userId, w = this.calls.get(y);
        w === void 0 && (w = /* @__PURE__ */ new Map(), this.calls.set(y, w)), m.hangup(_r.Replaced, false), this.initCall(v), w.set(m.getOpponentDeviceId(), v), this.emit(bi.CallsChanged, this.calls);
      }), $(this, "onActiveSpeakerLoop", () => {
        var m = void 0, v = void 0;
        for (var y of this.userMediaFeeds) if (!(y.isLocal() && this.userMediaFeeds.length > 1)) {
          var w = y.speakingVolumeSamples.reduce((j, k) => j + Math.max(k, iA)), b = w / y.speakingVolumeSamples.length;
          (!m || b > m) && (m = b, v = y);
        }
        v && this.activeSpeaker !== v && m && m > iA && (this.activeSpeaker = v, this.emit(bi.ActiveSpeakerChanged, this.activeSpeaker));
      }), $(this, "onRoomState", () => this.updateParticipants()), $(this, "onParticipantsChanged", () => {
        this.forEachCall((m) => {
          var v = this.callExpected(m);
          for (var y of m.getLocalFeeds()) So(y.stream.getAudioTracks(), !y.isAudioMuted() && v), So(y.stream.getVideoTracks(), !y.isVideoMuted() && v);
        }), this.state === Ji.Entered && !this.useLivekit && this.placeOutgoingCalls();
      }), $(this, "onStateChanged", (m, v) => {
        (m === Ji.Entered || v === Ji.Entered || m === Ji.Ended) && (this.updateParticipants(), this.updateMemberState().catch((y) => _e.error("GroupCall ".concat(this.groupCallId, ' onStateChanged() failed to update member state devices"'), y)));
      }), $(this, "onLocalFeedsChanged", () => {
        this.state === Ji.Entered && this.updateMemberState().catch((m) => _e.error("GroupCall ".concat(this.groupCallId, " onLocalFeedsChanged() failed to update member state feeds"), m));
      }), this.reEmitter = new gne(this), this.groupCallId = s ?? Gm(), this._livekitServiceURL = g, this.creationTs = (u = (h = n.currentState.getStateEvents(ce.GroupCallPrefix, this.groupCallId)) === null || h === void 0 ? void 0 : h.getTs()) !== null && u !== void 0 ? u : null, this.updateParticipants(), n.on(qn.Update, this.onRoomState), this.on(bi.ParticipantsChanged, this.onParticipantsChanged), this.on(bi.GroupCallStateChanged, this.onStateChanged), this.on(bi.LocalScreenshareStateChanged, this.onLocalFeedsChanged), this.allowCallWithoutVideoAndAudio = !!d;
    }
    create() {
      var e = this;
      return me(function* () {
        return e.creationTs = Date.now(), e.client.groupCallEventHandler.groupCalls.set(e.room.roomId, e), e.client.emit(aA.Outgoing, e), yield e.sendCallStateEvent(), e;
      })();
    }
    sendCallStateEvent() {
      var e = this;
      return me(function* () {
        var n = {
          "m.intent": e.intent,
          "m.type": e.type,
          "io.element.ptt": e.isPtt,
          dataChannelsEnabled: e.dataChannelsEnabled,
          dataChannelOptions: e.dataChannelsEnabled ? e.dataChannelOptions : void 0
        };
        e.livekitServiceURL && (n["io.element.livekit_service_url"] = e.livekitServiceURL), yield e.client.sendStateEvent(e.room.roomId, ce.GroupCallPrefix, n, e.groupCallId);
      })();
    }
    get livekitServiceURL() {
      return this._livekitServiceURL;
    }
    updateLivekitServiceURL(e) {
      return this._livekitServiceURL = e, this.sendCallStateEvent();
    }
    get state() {
      return this._state;
    }
    set state(e) {
      var n = this._state;
      e !== n && (this._state = e, this.emit(bi.GroupCallStateChanged, e, n));
    }
    get participants() {
      return this._participants;
    }
    set participants(e) {
      var n = this._participants, r = (a, s) => a.sessionId === s.sessionId && a.screensharing === s.screensharing, i = (a, s) => XV(a, s, r);
      XV(e, n, i) || (this._participants = e, this.emit(bi.ParticipantsChanged, e));
    }
    get creationTs() {
      return this._creationTs;
    }
    set creationTs(e) {
      this._creationTs = e;
    }
    get enteredViaAnotherSession() {
      return this._enteredViaAnotherSession;
    }
    set enteredViaAnotherSession(e) {
      this._enteredViaAnotherSession = e, this.updateParticipants();
    }
    forEachCall(e) {
      for (var n of this.calls.values()) for (var r of n.values()) e(r);
    }
    getLocalFeeds() {
      var e = [];
      return this.localCallFeed && e.push(this.localCallFeed), this.localScreenshareFeed && e.push(this.localScreenshareFeed), e;
    }
    hasLocalParticipant() {
      var e, n;
      return (e = (n = this.participants.get(this.room.getMember(this.client.getUserId()))) === null || n === void 0 ? void 0 : n.has(this.client.getDeviceId())) !== null && e !== void 0 ? e : false;
    }
    callExpected(e) {
      var n, r = Xx(e), i = r === null ? null : this.room.getMember(r), a = e.getOpponentDeviceId();
      return i !== null && a !== void 0 && ((n = this.participants.get(i)) === null || n === void 0 ? void 0 : n.get(a)) !== void 0;
    }
    initLocalCallFeed() {
      var e = this;
      return me(function* () {
        if (e.useLivekit) {
          _e.info("Livekit group call: not starting local call feed.");
          return;
        }
        if (e.state !== Ji.LocalCallFeedUninitialized) throw new Error('Cannot initialize local call feed in the "'.concat(e.state, '" state.'));
        if (e.state = Ji.InitializingLocalCallFeed, e.initCallFeedPromise) return e.initCallFeedPromise;
        try {
          e.initCallFeedPromise = e.initLocalCallFeedInternal(), yield e.initCallFeedPromise;
        } finally {
          e.initCallFeedPromise = void 0;
        }
      })();
    }
    initLocalCallFeedInternal() {
      var e = this;
      return me(function* () {
        _e.log("GroupCall ".concat(e.groupCallId, " initLocalCallFeedInternal() running"));
        var n;
        try {
          n = yield e.client.getMediaHandler().getUserMediaStream(true, e.type === dk.Video);
        } catch (i) {
          if (e.allowCallWithoutVideoAndAudio) n = new MediaStream();
          else throw e.state = Ji.LocalCallFeedUninitialized, i;
        }
        if (e._state !== Ji.InitializingLocalCallFeed) throw e.client.getMediaHandler().stopUserMediaStream(n), new Error("Group call disposed while gathering media stream");
        var r = new ju({
          client: e.client,
          roomId: e.room.roomId,
          userId: e.client.getUserId(),
          deviceId: e.client.getDeviceId(),
          stream: n,
          purpose: xi.Usermedia,
          audioMuted: e.initWithAudioMuted || n.getAudioTracks().length === 0 || e.isPtt,
          videoMuted: e.initWithVideoMuted || n.getVideoTracks().length === 0
        });
        So(n.getAudioTracks(), !r.isAudioMuted()), So(n.getVideoTracks(), !r.isVideoMuted()), e.localCallFeed = r, e.addUserMediaFeed(r), e.state = Ji.LocalCallFeedInitialized;
      })();
    }
    updateLocalUsermediaStream(e) {
      var n = this;
      return me(function* () {
        if (n.localCallFeed) {
          var r = n.localCallFeed.stream;
          n.localCallFeed.setNewStream(e);
          var i = n.localCallFeed.isAudioMuted(), a = n.localCallFeed.isVideoMuted();
          _e.log("GroupCall ".concat(n.groupCallId, " updateLocalUsermediaStream() (oldStreamId=").concat(r.id, ", newStreamId=").concat(e.id, ", micShouldBeMuted=").concat(i, ", vidShouldBeMuted=").concat(a, ")")), So(e.getAudioTracks(), !i), So(e.getVideoTracks(), !a), n.client.getMediaHandler().stopUserMediaStream(r);
        }
      })();
    }
    enter() {
      var e = this;
      return me(function* () {
        if (e.state === Ji.LocalCallFeedUninitialized) yield e.initLocalCallFeed();
        else if (e.state !== Ji.LocalCallFeedInitialized) throw new Error('Cannot enter call in the "'.concat(e.state, '" state'));
        _e.log("GroupCall ".concat(e.groupCallId, " enter() running")), e.state = Ji.Entered, e.client.on(oA.Incoming, e.onIncomingCall);
        for (var n of e.client.callEventHandler.calls.values()) e.onIncomingCall(n);
        e.useLivekit || (e.retryCallLoopInterval = setInterval(e.onRetryCallLoop, e.retryCallInterval), e.activeSpeaker = void 0, e.onActiveSpeakerLoop(), e.activeSpeakerLoopInterval = setInterval(e.onActiveSpeakerLoop, e.activeSpeakerInterval));
      })();
    }
    dispose() {
      var e;
      this.localCallFeed && (this.removeUserMediaFeed(this.localCallFeed), this.localCallFeed = void 0), this.localScreenshareFeed && (this.client.getMediaHandler().stopScreensharingStream(this.localScreenshareFeed.stream), this.removeScreenshareFeed(this.localScreenshareFeed), this.localScreenshareFeed = void 0, this.localDesktopCapturerSourceId = void 0), this.client.getMediaHandler().stopAllStreams(), this.transmitTimer !== null && (clearTimeout(this.transmitTimer), this.transmitTimer = null), this.retryCallLoopInterval !== void 0 && (clearInterval(this.retryCallLoopInterval), this.retryCallLoopInterval = void 0), this.participantsExpirationTimer !== null && (clearTimeout(this.participantsExpirationTimer), this.participantsExpirationTimer = null), this.state === Ji.Entered && (this.forEachCall((n) => n.hangup(_r.UserHangup, false)), this.activeSpeaker = void 0, clearInterval(this.activeSpeakerLoopInterval), this.retryCallCounts.clear(), clearInterval(this.retryCallLoopInterval), this.client.removeListener(oA.Incoming, this.onIncomingCall), (e = this.stats) === null || e === void 0 || e.stop());
    }
    leave() {
      this.dispose(), this.state = Ji.LocalCallFeedUninitialized;
    }
    terminate() {
      var e = arguments, n = this;
      return me(function* () {
        var r = e.length > 0 && e[0] !== void 0 ? e[0] : true;
        if (n.dispose(), n.room.off(qn.Update, n.onRoomState), n.client.groupCallEventHandler.groupCalls.delete(n.room.roomId), n.client.emit(aA.Ended, n), n.state = Ji.Ended, r) {
          var i = n.room.currentState.getStateEvents(ce.GroupCallPrefix, n.groupCallId);
          yield n.client.sendStateEvent(n.room.roomId, ce.GroupCallPrefix, Jx(Jx({}, i.getContent()), {}, {
            "m.terminated": Owe.CallEnded
          }), n.groupCallId);
        }
      })();
    }
    isLocalVideoMuted() {
      return this.localCallFeed ? this.localCallFeed.isVideoMuted() : true;
    }
    isMicrophoneMuted() {
      return this.localCallFeed ? this.localCallFeed.isAudioMuted() : true;
    }
    setMicrophoneMuted(e) {
      var n = this;
      return me(function* () {
        if (!e && !(yield n.client.getMediaHandler().hasAudioDevice())) return false;
        var r = !e && n.isPtt;
        n.isPtt && (!e && n.isMicrophoneMuted() ? n.transmitTimer = setTimeout(() => {
          n.setMicrophoneMuted(true);
        }, n.pttMaxTransmitTime) : e && !n.isMicrophoneMuted() && (n.transmitTimer !== null && clearTimeout(n.transmitTimer), n.transmitTimer = null)), n.forEachCall((s) => {
          var l;
          return (l = s.localUsermediaFeed) === null || l === void 0 ? void 0 : l.setAudioVideoMuted(e, null);
        });
        var i = (function() {
          var s = me(function* () {
            var l = [];
            n.forEachCall((c) => l.push(c.sendMetadataUpdate())), yield Promise.all(l).catch((c) => _e.info("GroupCall ".concat(n.groupCallId, " setMicrophoneMuted() failed to send some metadata updates"), c));
          });
          return function() {
            return s.apply(this, arguments);
          };
        })();
        if (r && (yield i()), n.localCallFeed) {
          _e.log("GroupCall ".concat(n.groupCallId, " setMicrophoneMuted() (streamId=").concat(n.localCallFeed.stream.id, ", muted=").concat(e, ")"));
          var a = yield n.checkAudioPermissionIfNecessary(e);
          if (!a) return false;
          n.localCallFeed.setAudioVideoMuted(e, null), So(n.localCallFeed.stream.getAudioTracks(), !e);
        } else _e.log("GroupCall ".concat(n.groupCallId, " setMicrophoneMuted() no stream muted (muted=").concat(e, ")")), n.initWithAudioMuted = e;
        return n.forEachCall((s) => So(s.localUsermediaFeed.stream.getAudioTracks(), !e && n.callExpected(s))), n.emit(bi.LocalMuteStateChanged, e, n.isLocalVideoMuted()), r || (yield i()), true;
      })();
    }
    checkAudioPermissionIfNecessary(e) {
      var n = this;
      return me(function* () {
        try {
          if (!e && n.localCallFeed && !n.localCallFeed.hasAudioTrack) {
            var r = yield n.client.getMediaHandler().getUserMediaStream(true, !n.localCallFeed.isVideoMuted());
            if ((r == null ? void 0 : r.getTracks().length) === 0) return _e.log("GroupCall ".concat(n.groupCallId, " setMicrophoneMuted() no device to receive local stream, muted=").concat(e)), false;
          }
        } catch {
          return _e.log("GroupCall ".concat(n.groupCallId, " setMicrophoneMuted() no device or permission to receive local stream, muted=").concat(e)), false;
        }
        return true;
      })();
    }
    setLocalVideoMuted(e) {
      var n = this;
      return me(function* () {
        if (!e && !(yield n.client.getMediaHandler().hasVideoDevice())) return false;
        if (n.localCallFeed) {
          _e.log("GroupCall ".concat(n.groupCallId, " setLocalVideoMuted() (stream=").concat(n.localCallFeed.stream.id, ", muted=").concat(e, ")"));
          try {
            var r = yield n.client.getMediaHandler().getUserMediaStream(true, !e);
            yield n.updateLocalUsermediaStream(r), n.localCallFeed.setAudioVideoMuted(null, e), So(n.localCallFeed.stream.getVideoTracks(), !e);
          } catch {
            return _e.log("GroupCall ".concat(n.groupCallId, " setLocalVideoMuted() no device or permission to receive local stream, muted=").concat(e)), false;
          }
        } else _e.log("GroupCall ".concat(n.groupCallId, " setLocalVideoMuted() no stream muted (muted=").concat(e, ")")), n.initWithVideoMuted = e;
        var i = [];
        return n.forEachCall((a) => i.push(a.setLocalVideoMuted(e))), yield Promise.all(i), n.forEachCall((a) => So(a.localUsermediaFeed.stream.getVideoTracks(), !e && n.callExpected(a))), n.emit(bi.LocalMuteStateChanged, n.isMicrophoneMuted(), e), true;
      })();
    }
    setScreensharingEnabled(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : {};
        if (e === r.isScreensharing()) return e;
        if (e) try {
          _e.log("GroupCall ".concat(r.groupCallId, " setScreensharingEnabled() is asking for screensharing permissions"));
          var a = yield r.client.getMediaHandler().getScreensharingStream(i), s = function* (d) {
            var u = () => {
              r.setScreensharingEnabled(false), d.removeEventListener("ended", u);
            };
            d.addEventListener("ended", u);
          };
          for (var l of a.getTracks()) yield* s(l);
          return _e.log("GroupCall ".concat(r.groupCallId, " setScreensharingEnabled() granted screensharing permissions. Setting screensharing enabled on all calls")), r.localDesktopCapturerSourceId = i.desktopCapturerSourceId, r.localScreenshareFeed = new ju({
            client: r.client,
            roomId: r.room.roomId,
            userId: r.client.getUserId(),
            deviceId: r.client.getDeviceId(),
            stream: a,
            purpose: xi.Screenshare,
            audioMuted: false,
            videoMuted: false
          }), r.addScreenshareFeed(r.localScreenshareFeed), r.emit(bi.LocalScreenshareStateChanged, true, r.localScreenshareFeed, r.localDesktopCapturerSourceId), r.forEachCall((c) => c.pushLocalFeed(r.localScreenshareFeed.clone())), true;
        } catch (c) {
          if (i.throwOnFail) throw c;
          return _e.error("GroupCall ".concat(r.groupCallId, " setScreensharingEnabled() enabling screensharing error"), c), r.emit(bi.Error, new sA(Ly.NoUserMedia, "Failed to get screen-sharing stream: ", c)), false;
        }
        else return r.forEachCall((c) => {
          c.localScreensharingFeed && c.removeLocalFeed(c.localScreensharingFeed);
        }), r.client.getMediaHandler().stopScreensharingStream(r.localScreenshareFeed.stream), r.removeScreenshareFeed(r.localScreenshareFeed), r.localScreenshareFeed = void 0, r.localDesktopCapturerSourceId = void 0, r.emit(bi.LocalScreenshareStateChanged, false, void 0, void 0), false;
      })();
    }
    isScreensharing() {
      return !!this.localScreenshareFeed;
    }
    wantsOutgoingCall(e, n) {
      var r = this.client.getUserId(), i = this.client.getDeviceId();
      return e >= r && (e !== r || n > i);
    }
    placeOutgoingCalls() {
      var e = this, n = false, r = function(l) {
        var c, d = (c = e.calls.get(l)) !== null && c !== void 0 ? c : /* @__PURE__ */ new Map(), u = function(m) {
          var v = d.get(m);
          if ((v == null ? void 0 : v.getOpponentSessionId()) !== f.sessionId && e.wantsOutgoingCall(l, m)) {
            n = true, v !== void 0 && (_e.debug("GroupCall ".concat(e.groupCallId, " placeOutgoingCalls() replacing call (userId=").concat(l, ", deviceId=").concat(m, ", callId=").concat(v.callId, ")")), v.hangup(_r.NewSession, false));
            var y = B2(e.client, e.room.roomId, {
              invitee: l,
              opponentDeviceId: m,
              opponentSessionId: f.sessionId,
              groupCallId: e.groupCallId
            });
            y === null ? (_e.error("GroupCall ".concat(e.groupCallId, " placeOutgoingCalls() failed to create call (userId=").concat(l, ", device=").concat(m, ")")), d.delete(m)) : (e.initCall(y), d.set(m, y), _e.debug("GroupCall ".concat(e.groupCallId, " placeOutgoingCalls() placing call (userId=").concat(l, ", deviceId=").concat(m, ", sessionId=").concat(f.sessionId, ")")), y.placeCallWithCallFeeds(e.getLocalFeeds().map((w) => w.clone()), f.screensharing).then(() => {
              e.dataChannelsEnabled && y.createDataChannel("datachannel", e.dataChannelOptions);
            }).catch((w) => {
              _e.warn("GroupCall ".concat(e.groupCallId, " placeOutgoingCalls() failed to place call (userId=").concat(l, ")"), w), w instanceof xu && w.code === Ly.UnknownDevice ? e.emit(bi.Error, w) : e.emit(bi.Error, new sA(Ly.PlaceCallFailed, "Failed to place call to ".concat(l))), y.hangup(_r.SignallingFailed, false), d.get(m) === y && d.delete(m);
            }));
          }
        };
        for (var [h, f] of a) u(h);
        d.size > 0 ? e.calls.set(l, d) : e.calls.delete(l);
      };
      for (var [{ userId: i }, a] of this.participants) r(i);
      n && this.emit(bi.CallsChanged, this.calls);
    }
    getMemberStateEvents(e) {
      return e === void 0 ? this.room.currentState.getStateEvents(ce.GroupCallMemberPrefix) : this.room.currentState.getStateEvents(ce.GroupCallMemberPrefix, e);
    }
    initCall(e) {
      var n = Xx(e);
      if (!n) throw new Error("Cannot init call without user id");
      var r = () => this.onCallFeedsChanged(e), i = (c, d) => this.onCallStateChanged(e, c, d), a = this.onCallHangup, s = (c) => this.onCallReplaced(e, c), l = this.callHandlers.get(n);
      l === void 0 && (l = /* @__PURE__ */ new Map(), this.callHandlers.set(n, l)), l.set(e.getOpponentDeviceId(), {
        onCallFeedsChanged: r,
        onCallStateChanged: i,
        onCallHangup: a,
        onCallReplaced: s
      }), e.on(xr.FeedsChanged, r), e.on(xr.State, i), e.on(xr.Hangup, a), e.on(xr.Replaced, s), e.isPtt = this.isPtt, this.reEmitter.reEmit(e, Object.values(xr)), e.initStats(this.getGroupCallStats()), r();
    }
    disposeCall(e, n) {
      var r = Xx(e), i = e.getOpponentDeviceId();
      if (!r) throw new Error("Cannot dispose call without user id");
      var a = this.callHandlers.get(r), { onCallFeedsChanged: s, onCallStateChanged: l, onCallHangup: c, onCallReplaced: d } = a.get(i);
      if (e.removeListener(xr.FeedsChanged, s), e.removeListener(xr.State, l), e.removeListener(xr.Hangup, c), e.removeListener(xr.Replaced, d), a.delete(r), a.size === 0 && this.callHandlers.delete(r), e.hangupReason !== _r.Replaced) {
        var u = this.getUserMediaFeed(r, i);
        u && this.removeUserMediaFeed(u);
        var h = this.getScreenshareFeed(r, i);
        h && this.removeScreenshareFeed(h);
      }
    }
    getUserMediaFeed(e, n) {
      return this.userMediaFeeds.find((r) => r.userId === e && r.deviceId === n);
    }
    addUserMediaFeed(e) {
      this.userMediaFeeds.push(e), e.measureVolumeActivity(true), this.emit(bi.UserMediaFeedsChanged, this.userMediaFeeds);
    }
    replaceUserMediaFeed(e, n) {
      var r = this.userMediaFeeds.findIndex((i) => i.userId === e.userId && i.deviceId === e.deviceId);
      if (r === -1) throw new Error("Couldn't find user media feed to replace");
      this.userMediaFeeds.splice(r, 1, n), e.dispose(), n.measureVolumeActivity(true), this.emit(bi.UserMediaFeedsChanged, this.userMediaFeeds);
    }
    removeUserMediaFeed(e) {
      var n = this.userMediaFeeds.findIndex((r) => r.userId === e.userId && r.deviceId === e.deviceId);
      if (n === -1) throw new Error("Couldn't find user media feed to remove");
      this.userMediaFeeds.splice(n, 1), e.dispose(), this.emit(bi.UserMediaFeedsChanged, this.userMediaFeeds), this.activeSpeaker === e && (this.activeSpeaker = this.userMediaFeeds[0], this.emit(bi.ActiveSpeakerChanged, this.activeSpeaker));
    }
    getScreenshareFeed(e, n) {
      return this.screenshareFeeds.find((r) => r.userId === e && r.deviceId === n);
    }
    addScreenshareFeed(e) {
      this.screenshareFeeds.push(e), this.emit(bi.ScreenshareFeedsChanged, this.screenshareFeeds);
    }
    replaceScreenshareFeed(e, n) {
      var r = this.screenshareFeeds.findIndex((i) => i.userId === e.userId && i.deviceId === e.deviceId);
      if (r === -1) throw new Error("Couldn't find screenshare feed to replace");
      this.screenshareFeeds.splice(r, 1, n), e.dispose(), this.emit(bi.ScreenshareFeedsChanged, this.screenshareFeeds);
    }
    removeScreenshareFeed(e) {
      var n = this.screenshareFeeds.findIndex((r) => r.userId === e.userId && r.deviceId === e.deviceId);
      if (n === -1) throw new Error("Couldn't find screenshare feed to remove");
      this.screenshareFeeds.splice(n, 1), e.dispose(), this.emit(bi.ScreenshareFeedsChanged, this.screenshareFeeds);
    }
    updateParticipants() {
      var e = this.room.getMember(this.client.getSafeUserId());
      if (!e) {
        _e.warn("GroupCall ".concat(this.groupCallId, " updateParticipants() tried to update participants before local room member is available"));
        return;
      }
      if (this.participantsExpirationTimer !== null && (clearTimeout(this.participantsExpirationTimer), this.participantsExpirationTimer = null), this.state === Ji.Ended) {
        this.participants = /* @__PURE__ */ new Map();
        return;
      }
      var n = /* @__PURE__ */ new Map(), r = Date.now(), i = this.state === Ji.Entered || this.enteredViaAnotherSession, a = 1 / 0;
      for (var s of this.getMemberStateEvents()) {
        var l = this.room.getMember(s.getStateKey()), c = s.getContent(), d = Array.isArray(c["m.calls"]) ? c["m.calls"] : [], u = d.find((y) => y["m.call_id"] === this.groupCallId), h = Array.isArray(u == null ? void 0 : u["m.devices"]) ? u["m.devices"] : [], f = h.filter((y) => typeof y.device_id == "string" && typeof y.session_id == "string" && typeof y.expires_ts == "number" && y.expires_ts > r && Array.isArray(y.feeds));
        if (!i && (l == null ? void 0 : l.userId) === this.client.getUserId() && (f = f.filter((y) => y.device_id !== this.client.getDeviceId())), f.length > 0 && (l == null ? void 0 : l.membership) === Ht.Join) {
          var g = /* @__PURE__ */ new Map();
          n.set(l, g);
          for (var m of f) g.set(m.device_id, {
            sessionId: m.session_id,
            screensharing: m.feeds.some((y) => y.purpose === xi.Screenshare)
          }), m.expires_ts < a && (a = m.expires_ts);
        }
      }
      if (i) {
        var v = n.get(e);
        v === void 0 && (v = /* @__PURE__ */ new Map(), n.set(e, v)), v.has(this.client.getDeviceId()) || v.set(this.client.getDeviceId(), {
          sessionId: this.client.getSessionId(),
          screensharing: this.getLocalFeeds().some((y) => y.purpose === xi.Screenshare)
        });
      }
      this.participants = n, a < 1 / 0 && (this.participantsExpirationTimer = setTimeout(() => this.updateParticipants(), a - r));
    }
    updateDevices(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i, a = n.length > 1 && n[1] !== void 0 ? n[1] : false, s = Date.now(), l = r.client.getUserId(), c = r.getMemberStateEvents(l), d = (i = c == null ? void 0 : c.getContent()) !== null && i !== void 0 ? i : {}, u = Array.isArray(d["m.calls"]) ? d["m.calls"] : [], h = null, f = [];
        for (var g of u) g["m.call_id"] === r.groupCallId ? h = g : f.push(g);
        h === null && (h = {});
        var m = Array.isArray(h["m.devices"]) ? h["m.devices"] : [], v = m.filter((j) => typeof j.device_id == "string" && typeof j.session_id == "string" && typeof j.expires_ts == "number" && j.expires_ts > s && Array.isArray(j.feeds)), y = e(v);
        if (y !== null) {
          var w = [
            ...f
          ];
          y.length > 0 && w.push(Jx(Jx({}, h), {}, {
            "m.call_id": r.groupCallId,
            "m.devices": y
          }));
          var b = {
            "m.calls": w
          };
          yield r.client.sendStateEvent(r.room.roomId, ce.GroupCallMemberPrefix, b, l, {
            keepAlive: a
          });
        }
      })();
    }
    addDeviceToMemberState() {
      var e = this;
      return me(function* () {
        yield e.updateDevices((n) => [
          ...n.filter((r) => r.device_id !== e.client.getDeviceId()),
          {
            device_id: e.client.getDeviceId(),
            session_id: e.client.getSessionId(),
            expires_ts: Date.now() + BH,
            feeds: e.getLocalFeeds().map((r) => ({
              purpose: r.purpose
            }))
          }
        ]);
      })();
    }
    updateMemberState() {
      var e = this;
      return me(function* () {
        e.resendMemberStateTimer !== null && (clearInterval(e.resendMemberStateTimer), e.resendMemberStateTimer = null), e.state === Ji.Entered ? (yield e.addDeviceToMemberState(), e.resendMemberStateTimer = setInterval(me(function* () {
          _e.log("GroupCall ".concat(e.groupCallId, ' updateMemberState() resending call member state"'));
          try {
            yield e.addDeviceToMemberState();
          } catch (n) {
            _e.error("GroupCall ".concat(e.groupCallId, " updateMemberState() failed to resend call member state"), n);
          }
        }), BH * 3 / 4)) : yield e.updateDevices((n) => n.filter((r) => r.device_id !== e.client.getDeviceId()), true);
      })();
    }
    cleanMemberState() {
      var e = this;
      return me(function* () {
        var { devices: n } = yield e.client.getDevices(), r = new Map(n.map((i) => [
          i.device_id,
          i
        ]));
        yield e.updateDevices((i) => {
          var a = i.filter((s) => {
            var l = r.get(s.device_id);
            return (l == null ? void 0 : l.last_seen_ts) !== void 0 && !(s.device_id === e.client.getDeviceId() && e.state !== Ji.Entered && !e.enteredViaAnotherSession);
          });
          return a.length === i.length ? null : a;
        });
      })();
    }
    getGroupCallStats() {
      if (this.stats === void 0) {
        var e = this.client.getUserId() || "unknown";
        this.stats = new Mwe(this.groupCallId, e, this.statsCollectIntervalTime), this.stats.reports.on(Au.CONNECTION_STATS, this.onConnectionStats), this.stats.reports.on(Au.BYTE_SENT_STATS, this.onByteSentStats), this.stats.reports.on(Au.SUMMARY_STATS, this.onSummaryStats), this.stats.reports.on(Au.CALL_FEED_REPORT, this.onCallFeedReport);
      }
      return this.stats;
    }
    setGroupCallStatsInterval(e) {
      this.statsCollectIntervalTime = e, this.stats !== void 0 && (this.stats.stop(), this.stats.setInterval(e), e > 0 && this.stats.start());
    }
  }
  function PH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Qx(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? PH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : PH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var er = (function(t) {
    return t.Fledgling = "fledgling", t.InviteSent = "invite_sent", t.WaitLocalMedia = "wait_local_media", t.CreateOffer = "create_offer", t.CreateAnswer = "create_answer", t.Connecting = "connecting", t.Connected = "connected", t.Ringing = "ringing", t.Ended = "ended", t;
  })({}), MH = (function(t) {
    return t.Voice = "voice", t.Video = "video", t;
  })({}), Qh = (function(t) {
    return t.Inbound = "inbound", t.Outbound = "outbound", t;
  })({}), ao = (function(t) {
    return t.Local = "local", t.Remote = "remote", t;
  })({}), xr = (function(t) {
    return t.Hangup = "hangup", t.State = "state", t.Error = "error", t.Replaced = "replaced", t.LocalHoldUnhold = "local_hold_unhold", t.RemoteHoldUnhold = "remote_hold_unhold", t.HoldUnhold = "hold_unhold", t.FeedsChanged = "feeds_changed", t.AssertedIdentityChanged = "asserted_identity_changed", t.LengthChanged = "length_changed", t.DataChannel = "datachannel", t.SendVoipEvent = "send_voip_event", t.PeerConnectionCreated = "peer_connection_created", t;
  })({}), _r = (function(t) {
    return t.UserHangup = "user_hangup", t.LocalOfferFailed = "local_offer_failed", t.NoUserMedia = "no_user_media", t.UnknownDevices = "unknown_devices", t.SendInvite = "send_invite", t.CreateAnswer = "create_answer", t.CreateOffer = "create_offer", t.SendAnswer = "send_answer", t.SetRemoteDescription = "set_remote_description", t.SetLocalDescription = "set_local_description", t.AnsweredElsewhere = "answered_elsewhere", t.IceFailed = "ice_failed", t.InviteTimeout = "invite_timeout", t.Replaced = "replaced", t.SignallingFailed = "signalling_timeout", t.UserBusy = "user_busy", t.Transferred = "transferred", t.NewSession = "new_session", t;
  })({}), Lwe = "1", Nwe = "stun:turn.matrix.org", e9 = 60 * 1e3, zwe = 1e3, Uwe = 30 * 1e3, Vwe = 2 * 1e3;
  class xu extends Error {
    constructor(e, n, r) {
      super(n + ": " + r), $(this, "code", void 0), this.code = e;
    }
  }
  function Gm() {
    return Date.now().toString() + kf(16);
  }
  function OH(t) {
    var e = [
      {
        mediaType: "audio",
        codec: "opus",
        enableDtx: true,
        maxAverageBitrate: t ? 12e3 : void 0
      }
    ];
    return e;
  }
  function mc(t, e) {
    return t + ":" + e;
  }
  class Hwe extends ji {
    constructor(e) {
      var n, r;
      if (super(), n = this, $(this, "roomId", void 0), $(this, "callId", void 0), $(this, "invitee", void 0), $(this, "hangupParty", void 0), $(this, "hangupReason", void 0), $(this, "direction", void 0), $(this, "ourPartyId", void 0), $(this, "peerConn", void 0), $(this, "toDeviceSeq", 0), $(this, "isPtt", false), $(this, "_state", er.Fledgling), $(this, "client", void 0), $(this, "forceTURN", void 0), $(this, "turnServers", void 0), $(this, "candidateSendQueue", []), $(this, "candidateSendTries", 0), $(this, "candidatesEnded", false), $(this, "feeds", []), $(this, "transceivers", /* @__PURE__ */ new Map()), $(this, "inviteOrAnswerSent", false), $(this, "waitForLocalAVStream", false), $(this, "successor", void 0), $(this, "opponentMember", void 0), $(this, "opponentVersion", void 0), $(this, "opponentPartyId", void 0), $(this, "opponentCaps", void 0), $(this, "iceDisconnectedTimeout", void 0), $(this, "iceReconnectionTimeOut", void 0), $(this, "inviteTimeout", void 0), $(this, "removeTrackListeners", /* @__PURE__ */ new Map()), $(this, "remoteOnHold", false), $(this, "callStatsAtEnd", void 0), $(this, "makingOffer", false), $(this, "ignoreOffer", false), $(this, "isSettingRemoteAnswerPending", false), $(this, "responsePromiseChain", void 0), $(this, "remoteCandidateBuffer", /* @__PURE__ */ new Map()), $(this, "remoteAssertedIdentity", void 0), $(this, "remoteSDPStreamMetadata", void 0), $(this, "callLengthInterval", void 0), $(this, "callStartTime", void 0), $(this, "opponentDeviceId", void 0), $(this, "hasOpponentDeviceInfo", void 0), $(this, "opponentSessionId", void 0), $(this, "groupCallId", void 0), $(this, "stopVideoTrackTimer", void 0), $(this, "isOnlyDataChannelAllowed", void 0), $(this, "stats", void 0), $(this, "gotLocalIceCandidate", (a) => {
        if (a.candidate) {
          if (this.candidatesEnded && _e.warn("Call ".concat(this.callId, " gotLocalIceCandidate() got candidate after candidates have ended!")), _e.debug("Call ".concat(this.callId, " got local ICE ").concat(a.candidate.sdpMid, " ").concat(a.candidate.candidate)), this.callHasEnded()) return;
          a.candidate.candidate === "" ? this.queueCandidate(null) : this.queueCandidate(a.candidate);
        }
      }), $(this, "onIceGatheringStateChange", (a) => {
        var s;
        _e.debug("Call ".concat(this.callId, " onIceGatheringStateChange() ice gathering state changed to ").concat(this.peerConn.iceGatheringState)), ((s = this.peerConn) === null || s === void 0 ? void 0 : s.iceGatheringState) === "complete" && (this.queueCandidate(null), _e.debug("Call ".concat(this.callId, " onIceGatheringStateChange() ice gathering state complete, set candidates have ended")));
      }), $(this, "getLocalOfferFailed", (a) => {
        _e.error("Call ".concat(this.callId, " getLocalOfferFailed() running"), a), this.emit(xr.Error, new xu(_r.LocalOfferFailed, "Failed to get local offer!", a), this), this.terminate(ao.Local, _r.LocalOfferFailed, false);
      }), $(this, "getUserMediaFailed", (a) => {
        if (this.successor) {
          this.successor.getUserMediaFailed(a);
          return;
        }
        _e.warn("Call ".concat(this.callId, " getUserMediaFailed() failed to get user media - ending call"), a), this.emit(xr.Error, new xu(_r.NoUserMedia, "Couldn't start capturing media! Is your microphone set up and does this app have permission?", a), this), this.terminate(ao.Local, _r.NoUserMedia, false);
      }), $(this, "placeCallFailed", (a) => {
        if (this.successor) {
          this.successor.placeCallFailed(a);
          return;
        }
        _e.warn("Call ".concat(this.callId, " placeCallWithCallFeeds() failed - ending call"), a), this.emit(xr.Error, new xu(_r.IceFailed, "Couldn't start call! Invalid ICE server configuration.", a), this), this.terminate(ao.Local, _r.IceFailed, false);
      }), $(this, "onIceConnectionStateChanged", () => {
        var a, s, l, c, d, u;
        if (!this.callHasEnded()) {
          if (_e.debug("Call ".concat(this.callId, " onIceConnectionStateChanged() running (state=").concat((a = this.peerConn) === null || a === void 0 ? void 0 : a.iceConnectionState, ", conn=").concat((s = this.peerConn) === null || s === void 0 ? void 0 : s.connectionState, ")")), [
            "connected",
            "completed"
          ].includes((l = (c = this.peerConn) === null || c === void 0 ? void 0 : c.iceConnectionState) !== null && l !== void 0 ? l : "")) clearTimeout(this.iceDisconnectedTimeout), this.iceDisconnectedTimeout = void 0, this.iceReconnectionTimeOut && clearTimeout(this.iceReconnectionTimeOut), this.state = er.Connected, !this.callLengthInterval && !this.callStartTime && (this.callStartTime = Date.now(), this.callLengthInterval = setInterval(() => {
            this.emit(xr.LengthChanged, Math.round((Date.now() - this.callStartTime) / 1e3), this);
          }, zwe));
          else if (((d = this.peerConn) === null || d === void 0 ? void 0 : d.iceConnectionState) == "failed") {
            var h;
            if (this.candidatesEnded = false, (h = this.peerConn) !== null && h !== void 0 && h.restartIce) {
              var f;
              this.candidatesEnded = false, _e.debug("Call ".concat(this.callId, " onIceConnectionStateChanged() ice restart (state=").concat((f = this.peerConn) === null || f === void 0 ? void 0 : f.iceConnectionState, ")")), this.peerConn.restartIce();
            } else _e.info("Call ".concat(this.callId, " onIceConnectionStateChanged() hanging up call (ICE failed and no ICE restart method)")), this.hangup(_r.IceFailed, false);
          } else ((u = this.peerConn) === null || u === void 0 ? void 0 : u.iceConnectionState) == "disconnected" && (this.candidatesEnded = false, this.iceReconnectionTimeOut = setTimeout(() => {
            var m, v, y;
            _e.info("Call ".concat(this.callId, " onIceConnectionStateChanged() ICE restarting because of ICE disconnected, (state=").concat((m = this.peerConn) === null || m === void 0 ? void 0 : m.iceConnectionState, ", conn=").concat((v = this.peerConn) === null || v === void 0 ? void 0 : v.connectionState, ")")), (y = this.peerConn) !== null && y !== void 0 && y.restartIce && (this.candidatesEnded = false, this.peerConn.restartIce()), this.iceReconnectionTimeOut = void 0;
          }, Vwe), this.iceDisconnectedTimeout = setTimeout(() => {
            _e.info("Call ".concat(this.callId, " onIceConnectionStateChanged() hanging up call (ICE disconnected for too long)")), this.hangup(_r.IceFailed, false);
          }, Uwe), this.state = er.Connecting);
          if (this.isPtt && [
            "failed",
            "disconnected"
          ].includes(this.peerConn.iceConnectionState)) for (var g of this.getRemoteFeeds()) g.setAudioVideoMuted(true, true);
        }
      }), $(this, "onSignallingStateChanged", () => {
        var a;
        _e.debug("Call ".concat(this.callId, " onSignallingStateChanged() running (state=").concat((a = this.peerConn) === null || a === void 0 ? void 0 : a.signalingState, ")"));
      }), $(this, "onTrack", (a) => {
        if (a.streams.length === 0) {
          _e.warn("Call ".concat(this.callId, " onTrack() called with streamless track streamless (kind=").concat(a.track.kind, ")"));
          return;
        }
        var s = a.streams[0];
        if (this.pushRemoteFeed(s), !this.removeTrackListeners.has(s)) {
          var l = () => {
            s.getTracks().length === 0 && (_e.info("Call ".concat(this.callId, " onTrack() removing track (streamId=").concat(s.id, ")")), this.deleteFeedByStream(s), s.removeEventListener("removetrack", l), this.removeTrackListeners.delete(s));
          };
          s.addEventListener("removetrack", l), this.removeTrackListeners.set(s, l);
        }
      }), $(this, "onDataChannel", (a) => {
        this.emit(xr.DataChannel, a.channel, this);
      }), $(this, "onNegotiationNeeded", me(function* () {
        if (_e.info("Call ".concat(n.callId, " onNegotiationNeeded() negotiation is needed!")), n.state !== er.CreateOffer && n.opponentVersion === 0) {
          _e.info("Call ".concat(n.callId, " onNegotiationNeeded() opponent does not support renegotiation: ignoring negotiationneeded event"));
          return;
        }
        n.queueGotLocalOffer();
      })), $(this, "onHangupReceived", (a) => {
        _e.debug("Call ".concat(this.callId, " onHangupReceived() running")), this.partyIdMatches(a) || this.state === er.Ringing ? this.terminate(ao.Remote, a.reason || _r.UserHangup, true) : _e.info("Call ".concat(this.callId, " onHangupReceived() ignoring message from party ID ").concat(a.party_id, ": our partner is ").concat(this.opponentPartyId));
      }), $(this, "onRejectReceived", (a) => {
        _e.debug("Call ".concat(this.callId, " onRejectReceived() running"));
        var s = [
          er.InviteSent,
          er.Ringing
        ].includes(this.state) || this.state === er.Fledgling && this.direction === Qh.Inbound;
        s ? this.terminate(ao.Remote, a.reason || _r.UserHangup, true) : _e.debug("Call ".concat(this.callId, " onRejectReceived() called in wrong state (state=").concat(this.state, ")"));
      }), $(this, "onAnsweredElsewhere", (a) => {
        _e.debug("Call ".concat(this.callId, " onAnsweredElsewhere() running")), this.terminate(ao.Remote, _r.AnsweredElsewhere, true);
      }), this.roomId = e.roomId, this.invitee = e.invitee, this.client = e.client, !this.client.deviceId) throw new Error("Client must have a device ID to start calls");
      this.forceTURN = (r = e.forceTURN) !== null && r !== void 0 ? r : false, this.ourPartyId = this.client.deviceId, this.opponentDeviceId = e.opponentDeviceId, this.opponentSessionId = e.opponentSessionId, this.groupCallId = e.groupCallId, this.turnServers = e.turnServers || [], this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed() && this.turnServers.push({
        urls: [
          Nwe
        ]
      });
      for (var i of this.turnServers) rne(i, [
        "urls"
      ]);
      this.callId = Gm(), this.isOnlyDataChannelAllowed = this.client.isVoipWithNoMediaAllowed;
    }
    placeVoiceCall() {
      var e = this;
      return me(function* () {
        yield e.placeCall(true, false);
      })();
    }
    placeVideoCall() {
      var e = this;
      return me(function* () {
        yield e.placeCall(true, true);
      })();
    }
    createDataChannel(e, n) {
      var r = this.peerConn.createDataChannel(e, n);
      return this.emit(xr.DataChannel, r, this), r;
    }
    getOpponentMember() {
      return this.opponentMember;
    }
    getOpponentDeviceId() {
      return this.opponentDeviceId;
    }
    getOpponentSessionId() {
      return this.opponentSessionId;
    }
    opponentCanBeTransferred() {
      return !!(this.opponentCaps && this.opponentCaps["m.call.transferee"]);
    }
    opponentSupportsDTMF() {
      return !!(this.opponentCaps && this.opponentCaps["m.call.dtmf"]);
    }
    getRemoteAssertedIdentity() {
      return this.remoteAssertedIdentity;
    }
    get state() {
      return this._state;
    }
    set state(e) {
      var n = this._state;
      this._state = e, this.emit(xr.State, e, n, this);
    }
    get type() {
      return this.hasUserMediaVideoSender || this.hasRemoteUserMediaVideoTrack ? MH.Video : MH.Voice;
    }
    get hasLocalUserMediaVideoTrack() {
      var e;
      return !!((e = this.localUsermediaStream) !== null && e !== void 0 && e.getVideoTracks().length);
    }
    get hasRemoteUserMediaVideoTrack() {
      return this.getRemoteFeeds().some((e) => {
        var n;
        return e.purpose === xi.Usermedia && ((n = e.stream) === null || n === void 0 ? void 0 : n.getVideoTracks().length);
      });
    }
    get hasLocalUserMediaAudioTrack() {
      var e;
      return !!((e = this.localUsermediaStream) !== null && e !== void 0 && e.getAudioTracks().length);
    }
    get hasRemoteUserMediaAudioTrack() {
      return this.getRemoteFeeds().some((e) => {
        var n;
        return e.purpose === xi.Usermedia && !!((n = e.stream) !== null && n !== void 0 && n.getAudioTracks().length);
      });
    }
    get hasUserMediaAudioSender() {
      var e;
      return !!(!((e = this.transceivers.get(mc(xi.Usermedia, "audio"))) === null || e === void 0) && e.sender);
    }
    get hasUserMediaVideoSender() {
      var e;
      return !!(!((e = this.transceivers.get(mc(xi.Usermedia, "video"))) === null || e === void 0) && e.sender);
    }
    get localUsermediaFeed() {
      return this.getLocalFeeds().find((e) => e.purpose === xi.Usermedia);
    }
    get localScreensharingFeed() {
      return this.getLocalFeeds().find((e) => e.purpose === xi.Screenshare);
    }
    get localUsermediaStream() {
      var e;
      return (e = this.localUsermediaFeed) === null || e === void 0 ? void 0 : e.stream;
    }
    get localScreensharingStream() {
      var e;
      return (e = this.localScreensharingFeed) === null || e === void 0 ? void 0 : e.stream;
    }
    get remoteUsermediaFeed() {
      return this.getRemoteFeeds().find((e) => e.purpose === xi.Usermedia);
    }
    get remoteScreensharingFeed() {
      return this.getRemoteFeeds().find((e) => e.purpose === xi.Screenshare);
    }
    get remoteUsermediaStream() {
      var e;
      return (e = this.remoteUsermediaFeed) === null || e === void 0 ? void 0 : e.stream;
    }
    get remoteScreensharingStream() {
      var e;
      return (e = this.remoteScreensharingFeed) === null || e === void 0 ? void 0 : e.stream;
    }
    getFeedByStreamId(e) {
      return this.getFeeds().find((n) => n.stream.id === e);
    }
    getFeeds() {
      return this.feeds;
    }
    getLocalFeeds() {
      return this.feeds.filter((e) => e.isLocal());
    }
    getRemoteFeeds() {
      return this.feeds.filter((e) => !e.isLocal());
    }
    initOpponentCrypto() {
      var e = this;
      return me(function* () {
        var n;
        if (e.opponentDeviceId && e.client.getUseE2eForGroupCall()) {
          if (!e.client.getCrypto()) {
            e.hasOpponentDeviceInfo = true;
            return;
          }
          var r = e.invitee || ((n = e.getOpponentMember()) === null || n === void 0 ? void 0 : n.userId);
          throw r ? (e.hasOpponentDeviceInfo = false, new Xne(r)) : new Error("Couldn't find opponent user ID to init crypto");
        }
      })();
    }
    getLocalSDPStreamMetadata() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, n = {};
      for (var r of this.getLocalFeeds()) e && (r.sdpMetadataStreamId = r.stream.id), n[r.sdpMetadataStreamId] = {
        purpose: r.purpose,
        audio_muted: r.isAudioMuted(),
        video_muted: r.isVideoMuted()
      };
      return n;
    }
    noIncomingFeeds() {
      return !this.feeds.some((e) => !e.isLocal());
    }
    pushRemoteFeed(e) {
      if (!this.opponentSupportsSDPStreamMetadata()) {
        this.pushRemoteFeedWithoutMetadata(e);
        return;
      }
      var n = this.getOpponentMember().userId, r = this.remoteSDPStreamMetadata[e.id].purpose, i = this.remoteSDPStreamMetadata[e.id].audio_muted, a = this.remoteSDPStreamMetadata[e.id].video_muted;
      if (!r) {
        _e.warn("Call ".concat(this.callId, " pushRemoteFeed() ignoring stream because we didn't get any metadata about it (streamId=").concat(e.id, ")"));
        return;
      }
      if (this.getFeedByStreamId(e.id)) {
        _e.warn("Call ".concat(this.callId, " pushRemoteFeed() ignoring stream because we already have a feed for it (streamId=").concat(e.id, ")"));
        return;
      }
      this.feeds.push(new ju({
        client: this.client,
        call: this,
        roomId: this.roomId,
        userId: n,
        deviceId: this.getOpponentDeviceId(),
        stream: e,
        purpose: r,
        audioMuted: i,
        videoMuted: a
      })), this.emit(xr.FeedsChanged, this.feeds, this), _e.info("Call ".concat(this.callId, " pushRemoteFeed() pushed stream (streamId=").concat(e.id, ", active=").concat(e.active, ", purpose=").concat(r, ")"));
    }
    pushRemoteFeedWithoutMetadata(e) {
      var n, r = this.getOpponentMember().userId, i = xi.Usermedia, a = (n = this.feeds.find((s) => !s.isLocal())) === null || n === void 0 ? void 0 : n.stream;
      if (a && e.id !== a.id) {
        _e.warn("Call ".concat(this.callId, " pushRemoteFeedWithoutMetadata() ignoring new stream because we already have stream (streamId=").concat(e.id, ")"));
        return;
      }
      if (this.getFeedByStreamId(e.id)) {
        _e.warn("Call ".concat(this.callId, " pushRemoteFeedWithoutMetadata() ignoring stream because we already have a feed for it (streamId=").concat(e.id, ")"));
        return;
      }
      this.feeds.push(new ju({
        client: this.client,
        call: this,
        roomId: this.roomId,
        audioMuted: false,
        videoMuted: false,
        userId: r,
        deviceId: this.getOpponentDeviceId(),
        stream: e,
        purpose: i
      })), this.emit(xr.FeedsChanged, this.feeds, this), _e.info("Call ".concat(this.callId, " pushRemoteFeedWithoutMetadata() pushed stream (streamId=").concat(e.id, ", active=").concat(e.active, ")"));
    }
    pushNewLocalFeed(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true, i = this.client.getUserId();
      if (So(e.getAudioTracks(), true), So(e.getVideoTracks(), true), this.getFeedByStreamId(e.id)) {
        _e.warn("Call ".concat(this.callId, " pushNewLocalFeed() ignoring stream because we already have a feed for it (streamId=").concat(e.id, ")"));
        return;
      }
      this.pushLocalFeed(new ju({
        client: this.client,
        roomId: this.roomId,
        audioMuted: false,
        videoMuted: false,
        userId: i,
        deviceId: this.getOpponentDeviceId(),
        stream: e,
        purpose: n
      }), r);
    }
    pushLocalFeed(e) {
      var n = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
      if (this.feeds.some((s) => e.stream.id === s.stream.id)) {
        _e.info("Call ".concat(this.callId, " pushLocalFeed() ignoring duplicate local stream (streamId=").concat(e.stream.id, ")"));
        return;
      }
      if (this.feeds.push(e), r) {
        var i = function() {
          _e.info("Call ".concat(n.callId, " pushLocalFeed() adding track to peer connection (id=").concat(a.id, ", kind=").concat(a.kind, ", streamId=").concat(e.stream.id, ", streamPurpose=").concat(e.purpose, ", enabled=").concat(a.enabled, ")"));
          var l = mc(e.purpose, a.kind);
          if (n.transceivers.has(l)) {
            var c = n.transceivers.get(l);
            c.sender.replaceTrack(a), c.direction = c.direction === "inactive" ? "sendonly" : "sendrecv";
          } else {
            var d = n.peerConn.addTrack(a, e.stream), u = n.peerConn.getTransceivers().find((h) => h.sender === d);
            u ? n.transceivers.set(l, u) : _e.warn("Call ".concat(n.callId, " pushLocalFeed() didn't find a matching transceiver after adding track!"));
          }
        };
        for (var a of e.stream.getTracks()) i();
      }
      _e.info("Call ".concat(this.callId, " pushLocalFeed() pushed stream (id=").concat(e.stream.id, ", active=").concat(e.stream.active, ", purpose=").concat(e.purpose, ")")), this.emit(xr.FeedsChanged, this.feeds, this);
    }
    removeLocalFeed(e) {
      var n = mc(e.purpose, "audio"), r = mc(e.purpose, "video");
      for (var i of [
        n,
        r
      ]) if (this.transceivers.has(i)) {
        var a = this.transceivers.get(i);
        a.sender && this.peerConn.removeTrack(a.sender);
      }
      e.purpose === xi.Screenshare && this.client.getMediaHandler().stopScreensharingStream(e.stream), this.deleteFeed(e);
    }
    deleteAllFeeds() {
      for (var e of this.feeds) (!e.isLocal() || !this.groupCallId) && e.dispose();
      this.feeds = [], this.emit(xr.FeedsChanged, this.feeds, this);
    }
    deleteFeedByStream(e) {
      var n = this.getFeedByStreamId(e.id);
      if (!n) {
        _e.warn("Call ".concat(this.callId, " deleteFeedByStream() didn't find the feed to delete (streamId=").concat(e.id, ")"));
        return;
      }
      this.deleteFeed(n);
    }
    deleteFeed(e) {
      e.dispose(), this.feeds.splice(this.feeds.indexOf(e), 1), this.emit(xr.FeedsChanged, this.feeds, this);
    }
    getCurrentCallStats() {
      var e = this;
      return me(function* () {
        return e.callHasEnded() ? e.callStatsAtEnd : e.collectCallStats();
      })();
    }
    collectCallStats() {
      var e = this;
      return me(function* () {
        if (e.peerConn) {
          var n = yield e.peerConn.getStats(), r = [];
          return n.forEach((i) => {
            r.push(i);
          }), r;
        }
      })();
    }
    initWithInvite(e) {
      var n = this;
      return me(function* () {
        var r, i = e.getContent();
        n.direction = Qh.Inbound;
        var a = yield n.client.checkTurnServers();
        a || _e.warn("Call ".concat(n.callId, " initWithInvite() failed to get TURN credentials! Proceeding with call anyway..."));
        var s = i[Hh];
        s ? n.updateRemoteSDPStreamMetadata(s) : _e.debug("Call ".concat(n.callId, " initWithInvite() did not get any SDPStreamMetadata! Can not send/receive multiple streams")), n.peerConn = n.createPeerConnection(), n.emit(xr.PeerConnectionCreated, n.peerConn, n), n.chooseOpponent(e), yield n.initOpponentCrypto();
        try {
          yield n.peerConn.setRemoteDescription(i.offer), _e.debug("Call ".concat(n.callId, " initWithInvite() set remote description: ").concat(i.offer.type)), yield n.addBufferedIceCandidates();
        } catch (u) {
          _e.debug("Call ".concat(n.callId, " initWithInvite() failed to set remote description"), u), n.terminate(ao.Local, _r.SetRemoteDescription, false);
          return;
        }
        var l = (r = n.feeds.find((u) => !u.isLocal())) === null || r === void 0 ? void 0 : r.stream;
        if (!n.isOnlyDataChannelAllowed && (!l || l.getTracks().length === 0)) {
          _e.error("Call ".concat(n.callId, " initWithInvite() no remote stream or no tracks after setting remote description!")), n.terminate(ao.Local, _r.SetRemoteDescription, false);
          return;
        }
        if (n.state = er.Ringing, e.getLocalAge()) {
          var c = setTimeout(() => {
            if (n.state == er.Ringing) {
              var u;
              _e.debug("Call ".concat(n.callId, " initWithInvite() invite has expired. Hanging up.")), n.hangupParty = ao.Remote, n.state = er.Ended, n.stopAllMedia(), n.peerConn.signalingState != "closed" && n.peerConn.close(), (u = n.stats) === null || u === void 0 || u.removeStatsReportGatherer(n.callId), n.emit(xr.Hangup, n);
            }
          }, i.lifetime - e.getLocalAge()), d = (u) => {
            u !== er.Ringing && (clearTimeout(c), n.off(xr.State, d));
          };
          n.on(xr.State, d);
        }
      })();
    }
    initWithHangup(e) {
      this.state = er.Ended;
    }
    shouldAnswerWithMediaType(e, n, r) {
      return e && !n ? (_e.warn("Call ".concat(this.callId, " shouldAnswerWithMediaType() unable to answer with ").concat(r, " because the other side isn't sending it either.")), false) : !ane(e) && e !== n && !this.opponentSupportsSDPStreamMetadata() ? (_e.warn("Call ".concat(this.callId, " shouldAnswerWithMediaType() unable to answer with ").concat(r, "=").concat(e, " because the other side doesn't support it. Answering with ").concat(r, "=").concat(n, ".")), n) : e ?? n;
    }
    answer(e, n) {
      var r = this;
      return me(function* () {
        if (!r.inviteOrAnswerSent) {
          if (e === false && n === false) throw new Error("You CANNOT answer a call without media");
          if (!r.localUsermediaStream && !r.waitForLocalAVStream) {
            var i = r.state, a = r.shouldAnswerWithMediaType(e, r.hasRemoteUserMediaAudioTrack, "audio"), s = r.shouldAnswerWithMediaType(n, r.hasRemoteUserMediaVideoTrack, "video");
            r.state = er.WaitLocalMedia, r.waitForLocalAVStream = true;
            try {
              var l, c = yield r.client.getMediaHandler().getUserMediaStream(a, s);
              r.waitForLocalAVStream = false;
              var d = new ju({
                client: r.client,
                roomId: r.roomId,
                userId: r.client.getUserId(),
                deviceId: (l = r.client.getDeviceId()) !== null && l !== void 0 ? l : void 0,
                stream: c,
                purpose: xi.Usermedia,
                audioMuted: false,
                videoMuted: false
              }), u = [
                d
              ];
              r.localScreensharingFeed && u.push(r.localScreensharingFeed), r.answerWithCallFeeds(u);
            } catch (h) {
              if (s) _e.warn("Call ".concat(r.callId, " answer() failed to getUserMedia(), trying to getUserMedia() without video")), r.state = i, r.waitForLocalAVStream = false, yield r.answer(a, false);
              else {
                r.getUserMediaFailed(h);
                return;
              }
            }
          } else r.waitForLocalAVStream && (r.state = er.WaitLocalMedia);
        }
      })();
    }
    answerWithCallFeeds(e) {
      this.inviteOrAnswerSent || this.queueGotCallFeedsForAnswer(e);
    }
    replacedBy(e) {
      _e.debug("Call ".concat(this.callId, " replacedBy() running (newCallId=").concat(e.callId, ")")), this.state === er.WaitLocalMedia ? (_e.debug("Call ".concat(this.callId, " replacedBy() telling new call to wait for local media (newCallId=").concat(e.callId, ")")), e.waitForLocalAVStream = true) : [
        er.CreateOffer,
        er.InviteSent
      ].includes(this.state) && (e.direction === Qh.Outbound ? e.queueGotCallFeedsForAnswer([]) : (_e.debug("Call ".concat(this.callId, " replacedBy() handing local stream to new call(newCallId=").concat(e.callId, ")")), e.queueGotCallFeedsForAnswer(this.getLocalFeeds().map((n) => n.clone())))), this.successor = e, this.emit(xr.Replaced, e, this), this.hangup(_r.Replaced, true);
    }
    hangup(e, n) {
      if (!this.callHasEnded() && (_e.debug("Call ".concat(this.callId, " hangup() ending call (reason=").concat(e, ")")), this.terminate(ao.Local, e, !n), ![
        er.Fledgling,
        er.WaitLocalMedia
      ].includes(this.state))) {
        var r = {};
        (this.opponentVersion && this.opponentVersion !== 0 || e !== _r.UserHangup) && (r.reason = e), this.sendVoipEvent(ce.CallHangup, r);
      }
    }
    reject() {
      if (this.state !== er.Ringing) throw Error("Call must be in 'ringing' state to reject!");
      if (this.opponentVersion === 0) {
        _e.info("Call ".concat(this.callId, " reject() opponent version is less than 1: sending hangup instead of reject (opponentVersion=").concat(this.opponentVersion, ")")), this.hangup(_r.UserHangup, true);
        return;
      }
      _e.debug("Rejecting call: " + this.callId), this.terminate(ao.Local, _r.UserHangup, true), this.sendVoipEvent(ce.CallReject, {});
    }
    upgradeCall(e, n) {
      var r = this;
      return me(function* () {
        if (!(!e && !n) && r.opponentSupportsSDPStreamMetadata()) try {
          _e.debug("Call ".concat(r.callId, " upgradeCall() upgrading call (audio=").concat(e, ", video=").concat(n, ")"));
          var i = e || r.hasLocalUserMediaAudioTrack, a = n || r.hasLocalUserMediaVideoTrack, s = yield r.client.getMediaHandler().getUserMediaStream(i, a, false);
          yield r.updateLocalUsermediaStream(s, e, n);
        } catch (l) {
          _e.error("Call ".concat(r.callId, " upgradeCall() failed to upgrade the call"), l), r.emit(xr.Error, new xu(_r.NoUserMedia, "Failed to get camera access: ", l), r);
        }
      })();
    }
    opponentSupportsSDPStreamMetadata() {
      return !!this.remoteSDPStreamMetadata;
    }
    isScreensharing() {
      return !!this.localScreensharingStream;
    }
    setScreensharingEnabled(e, n) {
      var r = this;
      return me(function* () {
        if (e && r.isScreensharing()) return _e.warn("Call ".concat(r.callId, " setScreensharingEnabled() there is already a screensharing stream - there is nothing to do!")), true;
        if (!e && !r.isScreensharing()) return _e.warn("Call ".concat(r.callId, " setScreensharingEnabled() there already isn't a screensharing stream - there is nothing to do!")), false;
        if (!r.opponentSupportsSDPStreamMetadata()) return r.setScreensharingEnabledWithoutMetadataSupport(e, n);
        if (_e.debug("Call ".concat(r.callId, " setScreensharingEnabled() running (enabled=").concat(e, ")")), e) try {
          var i = yield r.client.getMediaHandler().getScreensharingStream(n);
          return i ? (r.pushNewLocalFeed(i, xi.Screenshare), true) : false;
        } catch (c) {
          return _e.error("Call ".concat(r.callId, " setScreensharingEnabled() failed to get screen-sharing stream:"), c), false;
        }
        else {
          var a = r.transceivers.get(mc(xi.Screenshare, "audio")), s = r.transceivers.get(mc(xi.Screenshare, "video"));
          for (var l of [
            a,
            s
          ]) l && l.sender && r.peerConn.removeTrack(l.sender);
          return r.client.getMediaHandler().stopScreensharingStream(r.localScreensharingStream), r.deleteFeedByStream(r.localScreensharingStream), false;
        }
      })();
    }
    setScreensharingEnabledWithoutMetadataSupport(e, n) {
      var r = this;
      return me(function* () {
        if (_e.debug("Call ".concat(r.callId, " setScreensharingEnabledWithoutMetadataSupport() running (enabled=").concat(e, ")")), e) try {
          var i, a = yield r.client.getMediaHandler().getScreensharingStream(n);
          if (!a) return false;
          var s = a.getTracks().find((f) => f.kind === "video"), l = (i = r.transceivers.get(mc(xi.Usermedia, "video"))) === null || i === void 0 ? void 0 : i.sender;
          return l == null ? void 0 : l.replaceTrack(s ?? null), r.pushNewLocalFeed(a, xi.Screenshare, false), true;
        } catch (f) {
          return _e.error("Call ".concat(r.callId, " setScreensharingEnabledWithoutMetadataSupport() failed to get screen-sharing stream:"), f), false;
        }
        else {
          var c, d, u = (c = r.localUsermediaStream) === null || c === void 0 ? void 0 : c.getTracks().find((f) => f.kind === "video"), h = (d = r.transceivers.get(mc(xi.Usermedia, "video"))) === null || d === void 0 ? void 0 : d.sender;
          return h == null ? void 0 : h.replaceTrack(u ?? null), r.client.getMediaHandler().stopScreensharingStream(r.localScreensharingStream), r.deleteFeedByStream(r.localScreensharingStream), false;
        }
      })();
    }
    updateLocalUsermediaStream(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : false, a = n.length > 2 && n[2] !== void 0 ? n[2] : false, s = r.localUsermediaFeed, l = i || !s.isAudioMuted() && !r.remoteOnHold, c = a || !s.isVideoMuted() && !r.remoteOnHold;
        _e.log("Call ".concat(r.callId, " updateLocalUsermediaStream() running (streamId=").concat(e.id, ", audio=").concat(l, ", video=").concat(c, ")")), So(e.getAudioTracks(), l), So(e.getVideoTracks(), c);
        for (var d of r.localUsermediaStream.getTracks()) r.localUsermediaStream.removeTrack(d), d.stop();
        for (var u of e.getTracks()) r.localUsermediaStream.addTrack(u);
        var h = function* () {
          var m = mc(xi.Usermedia, f.kind), v = r.transceivers.get(m), y = v == null ? void 0 : v.sender, w = false;
          if (y) try {
            _e.info("Call ".concat(r.callId, " updateLocalUsermediaStream() replacing track (id=").concat(f.id, ", kind=").concat(f.kind, ", streamId=").concat(e.id, ", streamPurpose=").concat(s.purpose, ")")), yield y.replaceTrack(f), v.direction = v.direction === "inactive" ? "sendonly" : "sendrecv", w = true;
          } catch (k) {
            _e.warn("Call ".concat(r.callId, " updateLocalUsermediaStream() replaceTrack failed: adding new transceiver instead"), k);
          }
          if (!w) {
            _e.info("Call ".concat(r.callId, " updateLocalUsermediaStream() adding track to peer connection (id=").concat(f.id, ", kind=").concat(f.kind, ", streamId=").concat(e.id, ", streamPurpose=").concat(s.purpose, ")"));
            var b = r.peerConn.addTrack(f, r.localUsermediaStream), j = r.peerConn.getTransceivers().find((k) => k.sender === b);
            j ? r.transceivers.set(m, j) : _e.warn("Call ".concat(r.callId, " updateLocalUsermediaStream() couldn't find matching transceiver for newly added track!"));
          }
        };
        for (var f of e.getTracks()) yield* h();
      })();
    }
    setLocalVideoMuted(e) {
      var n = this;
      return me(function* () {
        var r;
        if (_e.log("Call ".concat(n.callId, " setLocalVideoMuted() running ").concat(e)), !e && n.stopVideoTrackTimer !== void 0 && (clearTimeout(n.stopVideoTrackTimer), n.stopVideoTrackTimer = void 0), !(yield n.client.getMediaHandler().hasVideoDevice())) return n.isLocalVideoMuted();
        if (!n.hasUserMediaVideoSender && !e) {
          var i;
          return (i = n.localUsermediaFeed) === null || i === void 0 || i.setAudioVideoMuted(null, e), yield n.upgradeCall(false, true), n.isLocalVideoMuted();
        }
        if (!e && n.localUsermediaStream.getVideoTracks().length === 0) {
          var a = yield n.client.getMediaHandler().getUserMediaStream(true, true);
          yield n.updateLocalUsermediaStream(a);
        }
        return (r = n.localUsermediaFeed) === null || r === void 0 || r.setAudioVideoMuted(null, e), n.updateMuteStatus(), yield n.sendMetadataUpdate(), e && (n.stopVideoTrackTimer = setTimeout(() => {
          for (var s of n.localUsermediaStream.getVideoTracks()) s.stop(), n.localUsermediaStream.removeTrack(s);
        }, 120)), n.isLocalVideoMuted();
      })();
    }
    isLocalVideoMuted() {
      var e, n;
      return (e = (n = this.localUsermediaFeed) === null || n === void 0 ? void 0 : n.isVideoMuted()) !== null && e !== void 0 ? e : false;
    }
    setMicrophoneMuted(e) {
      var n = this;
      return me(function* () {
        var r;
        return _e.log("Call ".concat(n.callId, " setMicrophoneMuted() running ").concat(e)), (yield n.client.getMediaHandler().hasAudioDevice()) ? !e && (!n.hasUserMediaAudioSender || !n.hasLocalUserMediaAudioTrack) ? (yield n.upgradeCall(true, false), n.isMicrophoneMuted()) : ((r = n.localUsermediaFeed) === null || r === void 0 || r.setAudioVideoMuted(e, null), n.updateMuteStatus(), yield n.sendMetadataUpdate(), n.isMicrophoneMuted()) : n.isMicrophoneMuted();
      })();
    }
    isMicrophoneMuted() {
      var e, n;
      return (e = (n = this.localUsermediaFeed) === null || n === void 0 ? void 0 : n.isAudioMuted()) !== null && e !== void 0 ? e : false;
    }
    isRemoteOnHold() {
      return this.remoteOnHold;
    }
    setRemoteOnHold(e) {
      if (this.isRemoteOnHold() !== e) {
        this.remoteOnHold = e;
        for (var n of this.peerConn.getTransceivers()) n.direction = e ? "sendonly" : "sendrecv";
        this.updateMuteStatus(), this.sendMetadataUpdate(), this.emit(xr.RemoteHoldUnhold, this.remoteOnHold, this);
      }
    }
    isLocalOnHold() {
      if (this.state !== er.Connected) return false;
      var e = true;
      for (var n of this.peerConn.getTransceivers()) {
        var r = [
          "inactive",
          "recvonly"
        ].includes(n.currentDirection);
        r || (e = false);
      }
      return e;
    }
    sendDtmfDigit(e) {
      for (var n of this.peerConn.getSenders()) {
        var r;
        if (((r = n.track) === null || r === void 0 ? void 0 : r.kind) === "audio" && n.dtmf) {
          n.dtmf.insertDTMF(e);
          return;
        }
      }
      throw new Error("Unable to find a track to send DTMF on");
    }
    updateMuteStatus() {
      var e = this.isMicrophoneMuted() || this.remoteOnHold, n = this.isLocalVideoMuted() || this.remoteOnHold;
      _e.log("Call ".concat(this.callId, " updateMuteStatus stream ").concat(this.localUsermediaStream.id, " micShouldBeMuted ").concat(e, " vidShouldBeMuted ").concat(n)), So(this.localUsermediaStream.getAudioTracks(), !e), So(this.localUsermediaStream.getVideoTracks(), !n);
    }
    sendMetadataUpdate() {
      var e = this;
      return me(function* () {
        yield e.sendVoipEvent(ce.CallSDPStreamMetadataChangedPrefix, {
          [Hh]: e.getLocalSDPStreamMetadata()
        });
      })();
    }
    gotCallFeedsForInvite(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (this.successor) {
        this.successor.queueGotCallFeedsForAnswer(e);
        return;
      }
      if (this.callHasEnded()) {
        this.stopAllMedia();
        return;
      }
      for (var r of e) this.pushLocalFeed(r);
      n && this.peerConn.addTransceiver("video", {
        direction: "recvonly"
      }), this.state = er.CreateOffer, _e.debug("Call ".concat(this.callId, " gotUserMediaForInvite() run"));
    }
    sendAnswer() {
      var e = this;
      return me(function* () {
        var n = {
          answer: {
            sdp: e.peerConn.localDescription.sdp,
            type: e.peerConn.localDescription.type
          },
          [Hh]: e.getLocalSDPStreamMetadata(true)
        };
        n.capabilities = {
          "m.call.transferee": e.client.supportsCallTransfer,
          "m.call.dtmf": false
        };
        var r = e.discardDuplicateCandidates();
        _e.info("Call ".concat(e.callId, " sendAnswer() discarding ").concat(r, " candidates that will be sent in answer"));
        try {
          yield e.sendVoipEvent(ce.CallAnswer, n), e.inviteOrAnswerSent = true;
        } catch (s) {
          e.state = er.Ringing, s instanceof Un && s.event && e.client.cancelPendingEvent(s.event);
          var i = _r.SendAnswer, a = "Failed to send answer";
          throw s.name == "UnknownDeviceError" && (i = _r.UnknownDevices, a = "Unknown devices present in the room"), e.emit(xr.Error, new xu(i, a, s), e), s;
        }
        e.sendCandidateQueue();
      })();
    }
    queueGotCallFeedsForAnswer(e) {
      this.responsePromiseChain ? this.responsePromiseChain = this.responsePromiseChain.then(() => this.gotCallFeedsForAnswer(e)) : this.responsePromiseChain = this.gotCallFeedsForAnswer(e);
    }
    mungeSdp(e, n) {
      var r = nA.parse(e.sdp);
      r.media.forEach((i) => {
        var a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
        for (var l of i.rtp) a.set(l.payload, l.codec), s.set(l.codec, l.payload);
        for (var c of n) if (c.mediaType === i.type) {
          if (!s.has(c.codec)) {
            _e.info("Call ".concat(this.callId, " mungeSdp() ignoring SDP modifications for ").concat(c.codec, " as it's not present."));
            continue;
          }
          var d = [];
          c.enableDtx !== void 0 && d.push("usedtx=".concat(c.enableDtx ? "1" : "0")), c.maxAverageBitrate !== void 0 && d.push("maxaveragebitrate=".concat(c.maxAverageBitrate));
          var u = false;
          for (var h of i.fmtp) a.get(h.payload) === c.codec && (u = true, h.config += ";" + d.join(";"));
          u || i.fmtp.push({
            payload: s.get(c.codec),
            config: d.join(";")
          });
        }
      }), e.sdp = nA.write(r);
    }
    createOffer() {
      var e = this;
      return me(function* () {
        var n = yield e.peerConn.createOffer();
        return e.mungeSdp(n, OH(e.isPtt)), n;
      })();
    }
    createAnswer() {
      var e = this;
      return me(function* () {
        var n = yield e.peerConn.createAnswer();
        return e.mungeSdp(n, OH(e.isPtt)), n;
      })();
    }
    gotCallFeedsForAnswer(e) {
      var n = this;
      return me(function* () {
        if (!n.callHasEnded()) {
          n.waitForLocalAVStream = false;
          for (var r of e) n.pushLocalFeed(r);
          n.state = er.CreateAnswer;
          var i;
          try {
            n.getRidOfRTXCodecs(), i = yield n.createAnswer();
          } catch (a) {
            _e.debug("Call ".concat(n.callId, " gotCallFeedsForAnswer() failed to create answer: "), a), n.terminate(ao.Local, _r.CreateAnswer, true);
            return;
          }
          try {
            if (yield n.peerConn.setLocalDescription(i), n.callHasEnded() || (n.state = er.Connecting, yield new Promise((a) => {
              setTimeout(a, 200);
            }), n.callHasEnded())) return;
            n.sendAnswer();
          } catch (a) {
            _e.debug("Call ".concat(n.callId, " gotCallFeedsForAnswer() error setting local description!"), a), n.terminate(ao.Local, _r.SetLocalDescription, true);
            return;
          }
        }
      })();
    }
    onRemoteIceCandidatesReceived(e) {
      var n = this;
      return me(function* () {
        if (!n.callHasEnded()) {
          var r = e.getContent(), i = r.candidates;
          if (!i) {
            _e.info("Call ".concat(n.callId, " onRemoteIceCandidatesReceived() ignoring candidates event with no candidates!"));
            return;
          }
          var a = r.version === 0 ? null : r.party_id || null;
          if (n.opponentPartyId === void 0) {
            if (a) {
              _e.info("Call ".concat(n.callId, " onRemoteIceCandidatesReceived() buffering ").concat(i.length, " candidates until we pick an opponent"));
              var s = n.remoteCandidateBuffer.get(a) || [];
              s.push(...i), n.remoteCandidateBuffer.set(a, s);
            }
            return;
          }
          if (!n.partyIdMatches(r)) {
            _e.info("Call ".concat(n.callId, " onRemoteIceCandidatesReceived() ignoring candidates from party ID ").concat(r.party_id, ": we have chosen party ID ").concat(n.opponentPartyId));
            return;
          }
          yield n.addIceCandidates(i);
        }
      })();
    }
    onAnswerReceived(e) {
      var n = this;
      return me(function* () {
        var r = e.getContent();
        if (_e.debug("Call ".concat(n.callId, " onAnswerReceived() running (hangupParty=").concat(r.party_id, ")")), n.callHasEnded()) {
          _e.debug("Call ".concat(n.callId, " onAnswerReceived() ignoring answer because call has ended"));
          return;
        }
        if (n.opponentPartyId !== void 0) {
          _e.info("Call ".concat(n.callId, " onAnswerReceived() ignoring answer from party ID ").concat(r.party_id, ": we already have an answer/reject from ").concat(n.opponentPartyId));
          return;
        }
        n.chooseOpponent(e), yield n.addBufferedIceCandidates(), n.state = er.Connecting;
        var i = r[Hh];
        i ? n.updateRemoteSDPStreamMetadata(i) : _e.warn("Call ".concat(n.callId, " onAnswerReceived() did not get any SDPStreamMetadata! Can not send/receive multiple streams"));
        try {
          n.isSettingRemoteAnswerPending = true, yield n.peerConn.setRemoteDescription(r.answer), n.isSettingRemoteAnswerPending = false, _e.debug("Call ".concat(n.callId, " onAnswerReceived() set remote description: ").concat(r.answer.type));
        } catch (a) {
          n.isSettingRemoteAnswerPending = false, _e.debug("Call ".concat(n.callId, " onAnswerReceived() failed to set remote description"), a), n.terminate(ao.Local, _r.SetRemoteDescription, false);
          return;
        }
        if (n.opponentPartyId !== null) try {
          yield n.sendVoipEvent(ce.CallSelectAnswer, {
            selected_party_id: n.opponentPartyId
          });
        } catch (a) {
          _e.warn("Call ".concat(n.callId, " onAnswerReceived() failed to send select_answer event"), a);
        }
      })();
    }
    onSelectAnswerReceived(e) {
      var n = this;
      return me(function* () {
        if (n.direction !== Qh.Inbound) {
          _e.warn("Call ".concat(n.callId, " onSelectAnswerReceived() got select_answer for an outbound call: ignoring"));
          return;
        }
        var r = e.getContent().selected_party_id;
        if (r == null) {
          _e.warn("Call ".concat(n.callId, " onSelectAnswerReceived() got nonsensical select_answer with null/undefined selected_party_id: ignoring"));
          return;
        }
        r !== n.ourPartyId && (_e.info("Call ".concat(n.callId, " onSelectAnswerReceived() got select_answer for party ID ").concat(r, ": we are party ID ").concat(n.ourPartyId, ".")), yield n.terminate(ao.Remote, _r.AnsweredElsewhere, true));
      })();
    }
    onNegotiateReceived(e) {
      var n = this;
      return me(function* () {
        var r = e.getContent(), i = r.description;
        if (!i || !i.sdp || !i.type) {
          _e.info("Call ".concat(n.callId, " onNegotiateReceived() ignoring invalid m.call.negotiate event"));
          return;
        }
        var a = n.direction === Qh.Inbound, s = !n.makingOffer && (n.peerConn.signalingState === "stable" || n.isSettingRemoteAnswerPending), l = i.type === "offer" && !s;
        if (n.ignoreOffer = !a && l, n.ignoreOffer) {
          _e.info("Call ".concat(n.callId, " onNegotiateReceived() ignoring colliding negotiate event because we're impolite"));
          return;
        }
        var c = n.isLocalOnHold(), d = r[Hh];
        d ? n.updateRemoteSDPStreamMetadata(d) : _e.warn("Call ".concat(n.callId, " onNegotiateReceived() received negotiation event without SDPStreamMetadata!"));
        try {
          if (n.isSettingRemoteAnswerPending = i.type == "answer", yield n.peerConn.setRemoteDescription(i), n.isSettingRemoteAnswerPending = false, _e.debug("Call ".concat(n.callId, " onNegotiateReceived() set remote description: ").concat(i.type)), i.type === "offer") {
            var u, h;
            try {
              n.getRidOfRTXCodecs(), h = yield n.createAnswer();
            } catch (g) {
              _e.debug("Call ".concat(n.callId, " onNegotiateReceived() failed to create answer: "), g), n.terminate(ao.Local, _r.CreateAnswer, true);
              return;
            }
            yield n.peerConn.setLocalDescription(h), _e.debug("Call ".concat(n.callId, " onNegotiateReceived() create an answer")), n.sendVoipEvent(ce.CallNegotiate, {
              lifetime: e9,
              description: (u = n.peerConn.localDescription) === null || u === void 0 ? void 0 : u.toJSON(),
              [Hh]: n.getLocalSDPStreamMetadata(true)
            });
          }
        } catch (g) {
          n.isSettingRemoteAnswerPending = false, _e.warn("Call ".concat(n.callId, " onNegotiateReceived() failed to complete negotiation"), g);
        }
        var f = n.isLocalOnHold();
        c !== f && (n.emit(xr.LocalHoldUnhold, f, n), n.emit(xr.HoldUnhold, f));
      })();
    }
    updateRemoteSDPStreamMetadata(e) {
      this.remoteSDPStreamMetadata = sne(this.remoteSDPStreamMetadata || {}, e, true);
      for (var n of this.getRemoteFeeds()) {
        var r, i = n.stream.id, a = this.remoteSDPStreamMetadata[i];
        n.setAudioVideoMuted(a == null ? void 0 : a.audio_muted, a == null ? void 0 : a.video_muted), n.purpose = (r = this.remoteSDPStreamMetadata[i]) === null || r === void 0 ? void 0 : r.purpose;
      }
    }
    onSDPStreamMetadataChangedReceived(e) {
      var n = e.getContent(), r = n[Hh];
      this.updateRemoteSDPStreamMetadata(r);
    }
    onAssertedIdentityReceived(e) {
      var n = this;
      return me(function* () {
        var r = e.getContent();
        r.asserted_identity && (n.remoteAssertedIdentity = {
          id: r.asserted_identity.id,
          displayName: r.asserted_identity.display_name
        }, n.emit(xr.AssertedIdentityChanged, n));
      })();
    }
    callHasEnded() {
      return this.state === er.Ended;
    }
    queueGotLocalOffer() {
      this.responsePromiseChain ? this.responsePromiseChain = this.responsePromiseChain.then(() => this.wrappedGotLocalOffer()) : this.responsePromiseChain = this.wrappedGotLocalOffer();
    }
    wrappedGotLocalOffer() {
      var e = this;
      return me(function* () {
        e.makingOffer = true;
        try {
          yield e.gotLocalOffer();
        } catch (n) {
          e.getLocalOfferFailed(n);
          return;
        } finally {
          e.makingOffer = false;
        }
      })();
    }
    gotLocalOffer() {
      var e = this;
      return me(function* () {
        if (_e.debug("Call ".concat(e.callId, " gotLocalOffer() running")), e.callHasEnded()) {
          _e.debug("Call ".concat(e.callId, ' gotLocalOffer() ignoring newly created offer because the call has ended"'));
          return;
        }
        var n;
        try {
          e.getRidOfRTXCodecs(), n = yield e.createOffer();
        } catch (u) {
          _e.debug("Call ".concat(e.callId, " gotLocalOffer() failed to create offer: "), u), e.terminate(ao.Local, _r.CreateOffer, true);
          return;
        }
        try {
          yield e.peerConn.setLocalDescription(n);
        } catch (u) {
          _e.debug("Call ".concat(e.callId, " gotLocalOffer() error setting local description!"), u), e.terminate(ao.Local, _r.SetLocalDescription, true);
          return;
        }
        if (e.peerConn.iceGatheringState === "gathering" && (yield new Promise((u) => {
          setTimeout(u, 200);
        })), !e.callHasEnded()) {
          var r = e.state === er.CreateOffer ? ce.CallInvite : ce.CallNegotiate, i = {
            lifetime: e9
          };
          if (r === ce.CallInvite && e.invitee && (i.invitee = e.invitee), e.state === er.CreateOffer) {
            var a;
            i.offer = (a = e.peerConn.localDescription) === null || a === void 0 ? void 0 : a.toJSON();
          } else {
            var s;
            i.description = (s = e.peerConn.localDescription) === null || s === void 0 ? void 0 : s.toJSON();
          }
          i.capabilities = {
            "m.call.transferee": e.client.supportsCallTransfer,
            "m.call.dtmf": false
          }, i[Hh] = e.getLocalSDPStreamMetadata(true);
          var l = e.discardDuplicateCandidates();
          _e.info("Call ".concat(e.callId, " gotLocalOffer() discarding ").concat(l, " candidates that will be sent in offer"));
          try {
            yield e.sendVoipEvent(r, i);
          } catch (u) {
            _e.error("Call ".concat(e.callId, " gotLocalOffer() failed to send invite"), u), u instanceof Un && u.event && e.client.cancelPendingEvent(u.event);
            var c = _r.SignallingFailed, d = "Signalling failed";
            e.state === er.CreateOffer && (c = _r.SendInvite, d = "Failed to send invite"), u.name == "UnknownDeviceError" && (c = _r.UnknownDevices, d = "Unknown devices present in the room"), e.emit(xr.Error, new xu(c, d, u), e), e.terminate(ao.Local, c, false);
            return;
          }
          e.sendCandidateQueue(), e.state === er.CreateOffer && (e.inviteOrAnswerSent = true, e.state = er.InviteSent, e.inviteTimeout = setTimeout(() => {
            e.inviteTimeout = void 0, e.state === er.InviteSent && e.hangup(_r.InviteTimeout, false);
          }, e9));
        }
      })();
    }
    getRidOfRTXCodecs() {
      if (!(!RTCRtpReceiver.getCapabilities || !RTCRtpSender.getCapabilities)) {
        var e = this.transceivers.get(mc(xi.Screenshare, "video"));
        if (!(!e || !e.setCodecPreferences)) {
          var n = RTCRtpReceiver.getCapabilities("video").codecs, r = RTCRtpSender.getCapabilities("video").codecs, i = [];
          for (var a of [
            ...n,
            ...r
          ]) if (a.mimeType !== "video/rtx") {
            i.push(a);
            try {
              e.setCodecPreferences(i);
            } catch (s) {
              _e.info("Working around buggy WebRTC impl: claimed to support codec but threw when setting codec preferences", a, s), i.pop();
            }
          }
        }
      }
    }
    sendVoipEvent(e, n) {
      var r = this;
      return me(function* () {
        var i = Qx(Qx({}, n), {}, {
          version: Lwe,
          call_id: r.callId,
          party_id: r.ourPartyId,
          conf_id: r.groupCallId
        });
        if (r.opponentDeviceId) {
          var a, s = r.toDeviceSeq++, l = Qx(Qx({}, i), {}, {
            device_id: r.client.deviceId,
            sender_session_id: r.client.getSessionId(),
            dest_session_id: r.opponentSessionId,
            seq: s,
            [ok]: dwe()
          });
          r.emit(xr.SendVoipEvent, {
            type: "toDevice",
            eventType: e,
            userId: r.invitee || ((a = r.getOpponentMember()) === null || a === void 0 ? void 0 : a.userId),
            opponentDeviceId: r.opponentDeviceId,
            content: l
          }, r);
          var c = r.invitee || r.getOpponentMember().userId;
          if (r.client.getUseE2eForGroupCall()) {
            if (!r.hasOpponentDeviceInfo) {
              _e.warn("Call ".concat(r.callId, " sendVoipEvent() failed: we do not have opponentDeviceInfo"));
              return;
            }
            throw new Error("Unimplemented");
          } else yield r.client.sendToDevice(e, /* @__PURE__ */ new Map([
            [
              c,
              /* @__PURE__ */ new Map([
                [
                  r.opponentDeviceId,
                  l
                ]
              ])
            ]
          ]));
        } else {
          var d;
          r.emit(xr.SendVoipEvent, {
            type: "sendEvent",
            eventType: e,
            roomId: r.roomId,
            content: i,
            userId: r.invitee || ((d = r.getOpponentMember()) === null || d === void 0 ? void 0 : d.userId)
          }, r), yield r.client.sendEvent(r.roomId, e, i);
        }
      })();
    }
    queueCandidate(e) {
      if (e ? this.candidateSendQueue.push(e) : this.candidatesEnded = true, !(this.state === er.Ringing || !this.inviteOrAnswerSent)) {
        var n = this.direction === Qh.Inbound ? 500 : 2e3;
        this.candidateSendTries === 0 && setTimeout(() => {
          this.sendCandidateQueue();
        }, n);
      }
    }
    discardDuplicateCandidates() {
      for (var e = 0, n = [], r = 0; r < this.candidateSendQueue.length; r++) {
        var i = this.candidateSendQueue[r];
        i.candidate === "" ? n.push(i) : e++;
      }
      return this.candidateSendQueue = n, e;
    }
    transfer(e) {
      var n = this;
      return me(function* () {
        var r = yield n.client.getProfileInfo(e), i = Gm(), a = {
          replacement_id: Gm(),
          target_user: {
            id: e,
            display_name: r.displayname,
            avatar_url: r.avatar_url
          },
          create_call: i
        };
        yield n.sendVoipEvent(ce.CallReplaces, a), yield n.terminate(ao.Local, _r.Transferred, true);
      })();
    }
    transferToCall(e) {
      var n = this;
      return me(function* () {
        var r, i, a = (r = e.getOpponentMember()) === null || r === void 0 ? void 0 : r.userId, s = a ? yield n.client.getProfileInfo(a) : void 0, l = (i = n.getOpponentMember()) === null || i === void 0 ? void 0 : i.userId, c = l ? yield n.client.getProfileInfo(l) : void 0, d = Gm(), u = {
          replacement_id: Gm(),
          target_user: {
            id: l,
            display_name: c == null ? void 0 : c.displayname,
            avatar_url: c == null ? void 0 : c.avatar_url
          },
          await_call: d
        };
        yield e.sendVoipEvent(ce.CallReplaces, u);
        var h = {
          replacement_id: Gm(),
          target_user: {
            id: a,
            display_name: s == null ? void 0 : s.displayname,
            avatar_url: s == null ? void 0 : s.avatar_url
          },
          create_call: d
        };
        yield n.sendVoipEvent(ce.CallReplaces, h), yield n.terminate(ao.Local, _r.Transferred, true), yield e.terminate(ao.Local, _r.Transferred, true);
      })();
    }
    terminate(e, n, r) {
      var i = this;
      return me(function* () {
        var a;
        if (!i.callHasEnded()) {
          i.hangupParty = e, i.hangupReason = n, i.state = er.Ended, i.inviteTimeout && (clearTimeout(i.inviteTimeout), i.inviteTimeout = void 0), i.iceDisconnectedTimeout !== void 0 && (clearTimeout(i.iceDisconnectedTimeout), i.iceDisconnectedTimeout = void 0), i.callLengthInterval && (clearInterval(i.callLengthInterval), i.callLengthInterval = void 0), i.stopVideoTrackTimer !== void 0 && (clearTimeout(i.stopVideoTrackTimer), i.stopVideoTrackTimer = void 0);
          for (var [s, l] of i.removeTrackListeners) s.removeEventListener("removetrack", l);
          i.removeTrackListeners.clear(), i.callStatsAtEnd = yield i.collectCallStats(), i.stopAllMedia(), i.deleteAllFeeds(), i.peerConn && i.peerConn.signalingState !== "closed" && i.peerConn.close(), (a = i.stats) === null || a === void 0 || a.removeStatsReportGatherer(i.callId), r && i.emit(xr.Hangup, i), i.client.callEventHandler.calls.delete(i.callId);
        }
      })();
    }
    stopAllMedia() {
      _e.debug("Call ".concat(this.callId, " stopAllMedia() running"));
      for (var e of this.feeds) if (e.isLocal() && e.purpose === xi.Usermedia) this.client.getMediaHandler().stopUserMediaStream(e.stream);
      else if (e.isLocal() && e.purpose === xi.Screenshare) this.client.getMediaHandler().stopScreensharingStream(e.stream);
      else if (!e.isLocal()) {
        _e.debug("Call ".concat(this.callId, " stopAllMedia() stopping stream (streamId=").concat(e.stream.id, ")"));
        for (var n of e.stream.getTracks()) n.stop();
      }
    }
    checkForErrorListener() {
      if (this.listeners(Kte.Error).length === 0) throw new Error("You MUST attach an error listener using call.on('error', function() {})");
    }
    sendCandidateQueue() {
      var e = this;
      return me(function* () {
        if (!(e.candidateSendQueue.length === 0 || e.callHasEnded())) {
          var n = e.candidateSendQueue;
          e.candidateSendQueue = [], ++e.candidateSendTries;
          var r = {
            candidates: n.map((l) => l.toJSON())
          };
          e.candidatesEnded && r.candidates.push({
            candidate: ""
          }), _e.debug("Call ".concat(e.callId, " sendCandidateQueue() attempting to send ").concat(n.length, " candidates"));
          try {
            yield e.sendVoipEvent(ce.CallCandidates, r), e.candidateSendTries = 0, e.sendCandidateQueue();
          } catch (l) {
            if (l instanceof Un && l.event && e.client.cancelPendingEvent(l.event), e.candidateSendQueue.push(...n), e.candidateSendTries > 5) {
              _e.debug("Call ".concat(e.callId, " sendCandidateQueue() failed to send candidates on attempt ").concat(e.candidateSendTries, ". Giving up on this call."), l);
              var i = _r.SignallingFailed, a = "Signalling failed";
              e.emit(xr.Error, new xu(i, a, l), e), e.hangup(i, false);
              return;
            }
            var s = 500 * Math.pow(2, e.candidateSendTries);
            ++e.candidateSendTries, _e.debug("Call ".concat(e.callId, " sendCandidateQueue() failed to send candidates. Retrying in ").concat(s, "ms"), l), setTimeout(() => {
              e.sendCandidateQueue();
            }, s);
          }
        }
      })();
    }
    placeCall(e, n) {
      var r = this;
      return me(function* () {
        if (!e) throw new Error("You CANNOT start a call without audio");
        r.state = er.WaitLocalMedia;
        var i;
        try {
          var a, s = yield r.client.getMediaHandler().getUserMediaStream(e, n);
          So(s.getAudioTracks(), true), So(s.getVideoTracks(), true), i = new ju({
            client: r.client,
            roomId: r.roomId,
            userId: r.client.getUserId(),
            deviceId: (a = r.client.getDeviceId()) !== null && a !== void 0 ? a : void 0,
            stream: s,
            purpose: xi.Usermedia,
            audioMuted: false,
            videoMuted: false
          });
        } catch (l) {
          r.getUserMediaFailed(l);
          return;
        }
        try {
          yield r.placeCallWithCallFeeds([
            i
          ]);
        } catch (l) {
          r.placeCallFailed(l);
          return;
        }
      })();
    }
    placeCallWithCallFeeds(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : false;
        r.checkForErrorListener(), r.direction = Qh.Outbound, yield r.initOpponentCrypto(), r.client.callEventHandler.calls.set(r.callId, r);
        var a = yield r.client.checkTurnServers();
        a || _e.warn("Call ".concat(r.callId, " placeCallWithCallFeeds() failed to get TURN credentials! Proceeding with call anyway...")), r.peerConn = r.createPeerConnection(), r.emit(xr.PeerConnectionCreated, r.peerConn, r), r.gotCallFeedsForInvite(e, i);
      })();
    }
    createPeerConnection() {
      var e, n = new window.RTCPeerConnection({
        iceTransportPolicy: this.forceTURN ? "relay" : void 0,
        iceServers: this.turnServers.length ? this.turnServers : void 0,
        iceCandidatePoolSize: this.client.iceCandidatePoolSize,
        bundlePolicy: "max-bundle"
      });
      n.addEventListener("iceconnectionstatechange", this.onIceConnectionStateChanged), n.addEventListener("signalingstatechange", this.onSignallingStateChanged), n.addEventListener("icecandidate", this.gotLocalIceCandidate), n.addEventListener("icegatheringstatechange", this.onIceGatheringStateChange), n.addEventListener("track", this.onTrack), n.addEventListener("negotiationneeded", this.onNegotiationNeeded), n.addEventListener("datachannel", this.onDataChannel);
      var r = this.getOpponentMember(), i = r ? r.userId : "unknown";
      return (e = this.stats) === null || e === void 0 || e.addStatsReportGatherer(this.callId, i, n), n;
    }
    partyIdMatches(e) {
      var n = e.version === 0 ? null : e.party_id || null;
      return n === this.opponentPartyId;
    }
    chooseOpponent(e) {
      var n, r = e.getContent();
      if (_e.debug("Call ".concat(this.callId, " chooseOpponent() running (partyId=").concat(r.party_id, ")")), this.opponentVersion = r.version, this.opponentVersion === 0 ? this.opponentPartyId = null : this.opponentPartyId = r.party_id || null, this.opponentCaps = r.capabilities || {}, this.opponentMember = (n = this.client.getRoom(this.roomId).getMember(e.getSender())) !== null && n !== void 0 ? n : void 0, this.opponentMember) {
        var i;
        (i = this.stats) === null || i === void 0 || i.updateOpponentMember(this.callId, this.opponentMember.userId);
      }
    }
    addBufferedIceCandidates() {
      var e = this;
      return me(function* () {
        var n = e.remoteCandidateBuffer.get(e.opponentPartyId);
        n && (_e.info("Call ".concat(e.callId, " addBufferedIceCandidates() adding ").concat(n.length, " buffered candidates for opponent ").concat(e.opponentPartyId)), yield e.addIceCandidates(n)), e.remoteCandidateBuffer.clear();
      })();
    }
    addIceCandidates(e) {
      var n = this;
      return me(function* () {
        for (var r of e) {
          (r.sdpMid === null || r.sdpMid === void 0) && (r.sdpMLineIndex === null || r.sdpMLineIndex === void 0) ? _e.debug("Call ".concat(n.callId, " addIceCandidates() got remote ICE end-of-candidates")) : _e.debug("Call ".concat(n.callId, " addIceCandidates() got remote ICE candidate (sdpMid=").concat(r.sdpMid, ", candidate=").concat(r.candidate, ")"));
          try {
            yield n.peerConn.addIceCandidate(r);
          } catch (i) {
            n.ignoreOffer ? _e.debug("Call ".concat(n.callId, " addIceCandidates() failed to add remote ICE candidate because ignoring offer"), i) : _e.info("Call ".concat(n.callId, " addIceCandidates() failed to add remote ICE candidate"), i);
          }
        }
      })();
    }
    get hasPeerConnection() {
      return !!this.peerConn;
    }
    initStats(e) {
      this.stats = e, this.stats.start();
    }
  }
  function So(t, e) {
    for (var n of t) n.enabled = e;
  }
  function lA() {
    if (typeof window > "u" || typeof document > "u") return false;
    try {
      var t, e, n, r = !!((t = (e = (n = window.RTCPeerConnection) !== null && n !== void 0 ? n : window.RTCSessionDescription) !== null && e !== void 0 ? e : window.RTCIceCandidate) !== null && t !== void 0 ? t : navigator.mediaDevices);
      if (!r) return _e.error("WebRTC is not supported in this browser / environment"), false;
    } catch (i) {
      return _e.error("Exception thrown when trying to access WebRTC", i), false;
    }
    return true;
  }
  function B2(t, e, n) {
    if (!lA()) return null;
    var r = n ? n.forceTURN : false, i = {
      client: t,
      roomId: e,
      invitee: n == null ? void 0 : n.invitee,
      turnServers: t.getTurnServers(),
      forceTURN: t.forceTURN || r,
      opponentDeviceId: n == null ? void 0 : n.opponentDeviceId,
      opponentSessionId: n == null ? void 0 : n.opponentSessionId,
      groupCallId: n == null ? void 0 : n.groupCallId
    }, a = new Hwe(i);
    return t.reEmitter.reEmit(a, Object.values(xr)), a;
  }
  var Rc = (function(t) {
    return t.DontNotify = "dont_notify", t.Notify = "notify", t.Coalesce = "coalesce", t;
  })({}), z1 = (function(t) {
    return t.Highlight = "highlight", t.Sound = "sound", t;
  })({}), $we = (function(t) {
    return t.ExactEquals = "==", t.LessThan = "<", t.GreaterThan = ">", t.GreaterThanOrEqual = ">=", t.LessThanOrEqual = "<=", t;
  })({}), Wwe = "2";
  function qwe(t) {
    return t === "==2" || t === "2";
  }
  var di = (function(t) {
    return t.EventMatch = "event_match", t.EventPropertyIs = "event_property_is", t.EventPropertyContains = "event_property_contains", t.ContainsDisplayName = "contains_display_name", t.RoomMemberCount = "room_member_count", t.SenderNotificationPermission = "sender_notification_permission", t.CallStarted = "call_started", t.CallStartedPrefix = "org.matrix.msc3914.call_started", t;
  })({}), Or = (function(t) {
    return t.Override = "override", t.ContentSpecific = "content", t.RoomSpecific = "room", t.SenderSpecific = "sender", t.Underride = "underride", t;
  })({}), Yr = (function(t) {
    return t.Master = ".m.rule.master", t.IsUserMention = ".m.rule.is_user_mention", t.IsRoomMention = ".m.rule.is_room_mention", t.ContainsDisplayName = ".m.rule.contains_display_name", t.ContainsUserName = ".m.rule.contains_user_name", t.AtRoomNotification = ".m.rule.roomnotif", t.DM = ".m.rule.room_one_to_one", t.EncryptedDM = ".m.rule.encrypted_room_one_to_one", t.Message = ".m.rule.message", t.EncryptedMessage = ".m.rule.encrypted", t.InviteToSelf = ".m.rule.invite_for_me", t.MemberEvent = ".m.rule.member_event", t.IncomingCall = ".m.rule.call", t.SuppressNotices = ".m.rule.suppress_notices", t.Tombstone = ".m.rule.tombstone", t.PollStart = ".m.rule.poll_start", t.PollStartUnstable = ".org.matrix.msc3930.rule.poll_start", t.PollEnd = ".m.rule.poll_end", t.PollEndUnstable = ".org.matrix.msc3930.rule.poll_end", t.PollStartOneToOne = ".m.rule.poll_start_one_to_one", t.PollStartOneToOneUnstable = ".org.matrix.msc3930.rule.poll_start_one_to_one", t.PollEndOneToOne = ".m.rule.poll_end_one_to_one", t.PollEndOneToOneUnstable = ".org.matrix.msc3930.rule.poll_end_one_to_one", t;
  })({});
  function LH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function NH(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? LH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : LH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var zH = [
    Or.Override,
    Or.ContentSpecific,
    Or.RoomSpecific,
    Or.SenderSpecific,
    Or.Underride
  ], Kwe = {
    ".m.rule.is_room_mention": {
      rule_id: ".m.rule.is_room_mention",
      default: true,
      enabled: true,
      conditions: [
        {
          kind: di.EventPropertyIs,
          key: "content.m\\.mentions.room",
          value: true
        },
        {
          kind: di.SenderNotificationPermission,
          key: "room"
        }
      ],
      actions: [
        Rc.Notify,
        {
          set_tweak: z1.Highlight
        }
      ]
    },
    ".m.rule.reaction": {
      rule_id: ".m.rule.reaction",
      default: true,
      enabled: true,
      conditions: [
        {
          kind: di.EventMatch,
          key: "type",
          pattern: "m.reaction"
        }
      ],
      actions: [
        Rc.DontNotify
      ]
    },
    ".org.matrix.msc3786.rule.room.server_acl": {
      rule_id: ".org.matrix.msc3786.rule.room.server_acl",
      default: true,
      enabled: true,
      conditions: [
        {
          kind: di.EventMatch,
          key: "type",
          pattern: ce.RoomServerAcl
        },
        {
          kind: di.EventMatch,
          key: "state_key",
          pattern: ""
        }
      ],
      actions: []
    }
  }, oB = /* @__PURE__ */ Symbol("UserDefinedRules"), Gwe = [
    Yr.Master,
    oB,
    Yr.SuppressNotices,
    Yr.InviteToSelf,
    Yr.MemberEvent,
    Yr.IsUserMention,
    Yr.ContainsDisplayName,
    Yr.IsRoomMention,
    Yr.AtRoomNotification,
    Yr.Tombstone,
    ".m.rule.reaction",
    ".m.rule.room.server_acl",
    ".org.matrix.msc3786.rule.room.server_acl",
    ".m.rule.suppress_edits"
  ], Ywe = {
    ".org.matrix.msc3914.rule.room.call": {
      rule_id: ".org.matrix.msc3914.rule.room.call",
      default: true,
      enabled: true,
      conditions: [
        {
          kind: di.EventMatch,
          key: "type",
          pattern: "org.matrix.msc3401.call"
        },
        {
          kind: di.CallStarted
        }
      ],
      actions: [
        Rc.Notify,
        {
          set_tweak: z1.Sound,
          value: "default"
        }
      ]
    }
  }, Zwe = [
    oB,
    Yr.IncomingCall,
    ".org.matrix.msc3914.rule.room.call",
    Yr.EncryptedDM,
    Yr.DM,
    Yr.Message,
    Yr.EncryptedMessage
  ];
  function UH(t, e, n, r, i) {
    var a = n.filter((m) => m.default), s = n.filter((m) => !m.default);
    function l(m) {
      m === oB ? d.push(...s) : m in r ? (t.warn("Adding default global ".concat(e, " push rule ").concat(m)), d.push(r[m])) : t.warn("Missing default global ".concat(e, " push rule ").concat(m));
    }
    var c = 0, d = [];
    for (var u of a) {
      var h = i.indexOf(u.rule_id);
      if (h === -1) {
        d.push(u);
        continue;
      }
      for (; h > c; ) {
        var f = i[c];
        l(f), c += 1;
      }
      d.push(u), c += 1;
    }
    for (var g of i.slice(c)) l(g);
    return d;
  }
  class Oa {
    constructor(e) {
      this.client = e, $(this, "parsedKeys", /* @__PURE__ */ new Map());
    }
    static actionListToActionsObject(e) {
      var n = {
        notify: false,
        tweaks: {}
      };
      for (var r of e) r === Rc.Notify ? n.notify = true : typeof r == "object" && (r.value === void 0 && (r.value = true), n.tweaks[r.set_tweak] = r.value);
      return n;
    }
    static rewriteDefaultRules(e, n) {
      var r = JSON.parse(JSON.stringify(n));
      return r || (r = {}), r.global || (r.global = {}), r.global.override || (r.global.override = []), r.global.underride || (r.global.underride = []), r.global.override = UH(e, Or.Override, r.global.override, Kwe, Gwe), r.global.underride = UH(e, Or.Underride, r.global.underride, Ywe, Zwe), r;
    }
    static getPushRuleGlobRegex(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "i", [i, a] = n ? [
        "(?<=^|\\W)",
        "(?=\\W|$)"
      ] : [
        "^",
        "$"
      ], s = "".concat(n, "-").concat(r, "-").concat(e);
      return Oa.cachedGlobToRegex[s] || (Oa.cachedGlobToRegex[s] = new RegExp(i + "(" + one(e) + ")" + a, r)), Oa.cachedGlobToRegex[s];
    }
    updateCachedPushRuleKeys(e) {
      e || (e = {}), e.global || (e.global = {}), e.global.override || (e.global.override = []), e.global.room || (e.global.room = []), e.global.sender || (e.global.sender = []), e.global.underride || (e.global.underride = []);
      var n = new Set(this.parsedKeys.keys());
      for (var r of [
        e.global.override,
        e.global.room,
        e.global.sender,
        e.global.underride
      ]) for (var i of r) if (i.conditions) for (var a of i.conditions) a.kind === di.EventMatch && (n.delete(a.key), this.parsedKeys.set(a.key, Oa.partsForDottedKey(a.key)));
      n.forEach((s) => this.parsedKeys.delete(s));
    }
    matchingRuleFromKindSet(e, n) {
      for (var r of zH) {
        var i = n[r];
        if (i) {
          for (var a of i) if (a.enabled) {
            var s = this.templateRuleToRaw(r, a);
            if (s && this.ruleMatchesEvent(s, e)) return NH(NH({}, a), {}, {
              kind: r
            });
          }
        }
      }
      return null;
    }
    templateRuleToRaw(e, n) {
      var r = {
        rule_id: n.rule_id,
        actions: n.actions,
        conditions: []
      };
      switch (e) {
        case Or.Underride:
        case Or.Override:
          r.conditions = n.conditions;
          break;
        case Or.RoomSpecific:
          if (!n.rule_id) return null;
          r.conditions.push({
            kind: di.EventMatch,
            key: "room_id",
            value: n.rule_id
          });
          break;
        case Or.SenderSpecific:
          if (!n.rule_id) return null;
          r.conditions.push({
            kind: di.EventMatch,
            key: "user_id",
            value: n.rule_id
          });
          break;
        case Or.ContentSpecific:
          if (!n.pattern) return null;
          r.conditions.push({
            kind: di.EventMatch,
            key: "content.body",
            pattern: n.pattern
          });
          break;
      }
      return r;
    }
    eventFulfillsCondition(e, n) {
      switch (e.kind) {
        case di.EventMatch:
          return this.eventFulfillsEventMatchCondition(e, n);
        case di.EventPropertyIs:
          return this.eventFulfillsEventPropertyIsCondition(e, n);
        case di.EventPropertyContains:
          return this.eventFulfillsEventPropertyContains(e, n);
        case di.ContainsDisplayName:
          return this.eventFulfillsDisplayNameCondition(e, n);
        case di.RoomMemberCount:
          return this.eventFulfillsRoomMemberCountCondition(e, n);
        case di.SenderNotificationPermission:
          return this.eventFulfillsSenderNotifPermCondition(e, n);
        case di.CallStarted:
        case di.CallStartedPrefix:
          return this.eventFulfillsCallStartedCondition(e, n);
      }
      return false;
    }
    eventFulfillsSenderNotifPermCondition(e, n) {
      var r = e.key;
      if (!r) return false;
      var i = this.client.getRoom(n.getRoomId());
      return i != null && i.currentState ? i.currentState.mayTriggerNotifOfType(r, n.getSender()) : false;
    }
    eventFulfillsRoomMemberCountCondition(e, n) {
      if (!e.is) return false;
      var r = this.client.getRoom(n.getRoomId());
      if (!r || !r.currentState || !r.currentState.members) return false;
      var i = r.currentState.getJoinedMemberCount(), a = e.is.match(/^([=<>]*)(\d*)$/);
      if (!a) return false;
      var s = a[1], l = parseInt(a[2]);
      if (isNaN(l)) return false;
      switch (s) {
        case "":
        case "==":
          return i == l;
        case "<":
          return i < l;
        case ">":
          return i > l;
        case "<=":
          return i <= l;
        case ">=":
          return i >= l;
        default:
          return false;
      }
    }
    eventFulfillsDisplayNameCondition(e, n) {
      var r, i = n.getContent();
      if (n.isEncrypted() && n.getClearContent() && (i = n.getClearContent()), !i || !i.body || typeof i.body != "string") return false;
      var a = this.client.getRoom(n.getRoomId()), s = a == null || (r = a.currentState) === null || r === void 0 ? void 0 : r.getMember(this.client.credentials.userId);
      if (!s) return false;
      var l = s.name, c = new RegExp("(^|\\W)" + ine(l) + "(\\W|$)", "i");
      return i.body.search(c) > -1;
    }
    eventFulfillsEventMatchCondition(e, n) {
      if (!e.key) return false;
      var r = this.valueForDottedKey(e.key, n);
      if (typeof r != "string") return false;
      if (e.value) return e.value === r;
      if (typeof e.pattern != "string") return false;
      var i = Oa.getPushRuleGlobRegex(e.pattern, e.key === "content.body");
      return !!r.match(i);
    }
    eventFulfillsEventPropertyIsCondition(e, n) {
      return !e.key || e.value === void 0 ? false : e.value === this.valueForDottedKey(e.key, n);
    }
    eventFulfillsEventPropertyContains(e, n) {
      if (!e.key || e.value === void 0) return false;
      var r = this.valueForDottedKey(e.key, n);
      return Array.isArray(r) ? r.includes(e.value) : false;
    }
    eventFulfillsCallStartedCondition(e, n) {
      return [
        "m.ring",
        "m.prompt"
      ].includes(n.getContent()["m.intent"]) && !("m.terminated" in n.getContent()) && (n.getPrevContent()["m.terminated"] !== n.getContent()["m.terminated"] || zg(n.getPrevContent(), {}));
    }
    static partsForDottedKey(e) {
      var n = [], r = "", i = false;
      for (var a of e) {
        if (i) {
          a === "\\" || a === "." ? r += a : r += "\\" + a, i = false;
          continue;
        }
        a == "." ? (n.push(r), r = "") : a == "\\" ? i = true : r += a;
      }
      return i && (r += "\\"), n.push(r), n;
    }
    valueForDottedKey(e, n) {
      var r = this.parsedKeys.get(e);
      r === void 0 && (r = Oa.partsForDottedKey(e), this.parsedKeys.set(e, r));
      var i, a = r[0], s = 0;
      for (a === "content" ? (i = n.getContent(), ++s) : a === "type" ? (i = n.getType(), ++s) : i = n.event; s < r.length; ++s) {
        if (ane(i)) return;
        var l = r[s];
        i = i[l];
      }
      return i;
    }
    matchingRuleForEventWithRulesets(e, n) {
      return !n || e.getSender() === this.client.getSafeUserId() ? null : this.matchingRuleFromKindSet(e, n.global);
    }
    pushActionsForEventAndRulesets(e, n) {
      var r = this.matchingRuleForEventWithRulesets(e, n);
      if (!r) return {};
      var i = Oa.actionListToActionsObject(r.actions);
      return i.tweaks.highlight === void 0 && (i.tweaks.highlight = r.kind == Or.ContentSpecific), {
        actions: i,
        rule: r
      };
    }
    ruleMatchesEvent(e, n) {
      var r;
      return this.client.supportsIntentionalMentions() && n.getContent()["m.mentions"] !== void 0 && (e.rule_id === Yr.ContainsUserName || e.rule_id === Yr.ContainsDisplayName || e.rule_id === Yr.AtRoomNotification) ? false : !((r = e.conditions) !== null && r !== void 0 && r.some((i) => !this.eventFulfillsCondition(i, n)));
    }
    actionsForEvent(e) {
      var { actions: n } = this.pushActionsForEventAndRulesets(e, this.client.pushRules);
      return n || {};
    }
    actionsAndRuleForEvent(e) {
      return this.pushActionsForEventAndRulesets(e, this.client.pushRules);
    }
    getPushRuleById(e) {
      var n, r = this.getPushRuleAndKindById(e);
      return (n = r == null ? void 0 : r.rule) !== null && n !== void 0 ? n : null;
    }
    getPushRuleAndKindById(e) {
      for (var n of [
        "global"
      ]) {
        var r;
        if (((r = this.client.pushRules) === null || r === void 0 ? void 0 : r[n]) !== void 0) {
          for (var i of zH) if (this.client.pushRules[n][i] !== void 0) {
            for (var a of this.client.pushRules[n][i]) if (a.rule_id === e) return {
              rule: a,
              kind: i
            };
          }
        }
      }
      return null;
    }
  }
  $(Oa, "cachedGlobToRegex", {});
  var P2 = [
    "v1.1",
    "v1.2",
    "v1.3",
    "v1.4",
    "v1.5",
    "v1.6",
    "v1.7",
    "v1.8",
    "v1.9"
  ], Jwe = P2[0], Xwe = P2[P2.length - 1], Qs = (function(t) {
    return t.SUCCESS = "SUCCESS", t.IGNORE = "IGNORE", t.PROMPT = "PROMPT", t.FAIL_PROMPT = "FAIL_PROMPT", t.FAIL_ERROR = "FAIL_ERROR", t;
  })({}), Jl = (function(t) {
    return t.Invalid = "Invalid homeserver discovery response", t.GenericFailure = "Failed to get autodiscovery configuration from server", t.InvalidHsBaseUrl = "Invalid base_url for m.homeserver", t.InvalidHomeserver = "Homeserver URL does not appear to be a valid Matrix homeserver", t.InvalidIsBaseUrl = "Invalid base_url for m.identity_server", t.InvalidIdentityServer = "Identity server URL does not appear to be a valid identity server", t.InvalidIs = "Invalid identity server discovery response", t.MissingWellknown = "No .well-known JSON file found", t.InvalidJson = "Invalid JSON", t.UnsupportedHomeserverSpecVersion = "The homeserver does not meet the version requirements", t;
  })({});
  let ua = class ci {
    static fromDiscoveryConfig(e) {
      var n = this;
      return me(function* () {
        var r, i = {
          "m.homeserver": {
            state: ci.FAIL_ERROR,
            error: ci.ERROR_INVALID,
            base_url: null
          },
          "m.identity_server": {
            state: ci.PROMPT,
            error: null,
            base_url: null
          }
        };
        if (!(e != null && e["m.homeserver"])) return _e.error("No m.homeserver key in config"), i["m.homeserver"].state = ci.FAIL_PROMPT, i["m.homeserver"].error = ci.ERROR_INVALID, Promise.resolve(i);
        if (!e["m.homeserver"].base_url) return _e.error("No m.homeserver base_url in config"), i["m.homeserver"].state = ci.FAIL_PROMPT, i["m.homeserver"].error = ci.ERROR_INVALID_HS_BASE_URL, Promise.resolve(i);
        var a = n.sanitizeWellKnownUrl(e["m.homeserver"].base_url);
        if (!a) return _e.error("Invalid base_url for m.homeserver"), i["m.homeserver"].error = ci.ERROR_INVALID_HS_BASE_URL, Promise.resolve(i);
        var s = yield n.fetchWellKnownObject("".concat(a, "/_matrix/client/versions"));
        if (!s || !Array.isArray((r = s.raw) === null || r === void 0 ? void 0 : r.versions)) return _e.error("Invalid /versions response"), i["m.homeserver"].error = ci.ERROR_INVALID_HOMESERVER, i["m.homeserver"].base_url = a, Promise.resolve(i);
        var l = new Set(s.raw.versions), c = false;
        for (var d of P2) if (l.has(d)) {
          c = true;
          break;
        }
        if (!c) return _e.error("Homeserver does not meet version requirements"), i["m.homeserver"].error = ci.ERROR_UNSUPPORTED_HOMESERVER_SPEC_VERSION, i["m.homeserver"].base_url = a, Promise.resolve(i);
        i["m.homeserver"] = {
          state: ci.SUCCESS,
          error: null,
          base_url: a
        };
        var u = "";
        if (e["m.identity_server"]) {
          var h = {
            "m.homeserver": i["m.homeserver"],
            "m.identity_server": {
              state: ci.FAIL_PROMPT,
              error: ci.ERROR_INVALID_IS,
              base_url: null
            }
          };
          if (u = n.sanitizeWellKnownUrl(e["m.identity_server"].base_url), !u) return _e.error("Invalid base_url for m.identity_server"), h["m.identity_server"].error = ci.ERROR_INVALID_IS_BASE_URL, Promise.resolve(h);
          var f = yield n.fetchWellKnownObject("".concat(u, "/_matrix/identity/v2"));
          if (!(f != null && f.raw) || f.action !== Qs.SUCCESS) return _e.error("Invalid /v2 response"), h["m.identity_server"].error = ci.ERROR_INVALID_IDENTITY_SERVER, h["m.identity_server"].base_url = u, Promise.resolve(h);
        }
        return u && u.toString().length > 0 && (i["m.identity_server"] = {
          state: ci.SUCCESS,
          error: null,
          base_url: u
        }), Object.keys(e).forEach((g) => {
          if (g === "m.homeserver" || g === "m.identity_server") {
            var m = [
              "error",
              "state",
              "base_url"
            ];
            for (var v of Object.keys(e[g])) m.includes(v) || (i[g][v] = e[g][v]);
          } else i[g] = e[g];
        }), Promise.resolve(i);
      })();
    }
    static findClientConfig(e) {
      var n = this;
      return me(function* () {
        if (!e || typeof e != "string" || e.length === 0) throw new Error("'domain' must be a string of non-zero length");
        var r = {
          "m.homeserver": {
            state: ci.FAIL_ERROR,
            error: ci.ERROR_INVALID,
            base_url: null
          },
          "m.identity_server": {
            state: ci.PROMPT,
            error: null,
            base_url: null
          }
        }, i = e.includes("://") ? e : "https://".concat(e), a = yield n.fetchWellKnownObject("".concat(i, "/.well-known/matrix/client"));
        return !a || a.action !== Qs.SUCCESS ? (_e.error("No response or error when parsing .well-known"), a.reason && _e.error(a.reason), a.action === Qs.IGNORE ? r["m.homeserver"] = {
          state: ci.PROMPT,
          error: null,
          base_url: null
        } : (r["m.homeserver"].state = ci.FAIL_PROMPT, r["m.homeserver"].error = ci.ERROR_INVALID), Promise.resolve(r)) : ci.fromDiscoveryConfig(a.raw);
      })();
    }
    static getRawClientConfig(e) {
      var n = this;
      return me(function* () {
        var r;
        if (!e || typeof e != "string" || e.length === 0) throw new Error("'domain' must be a string of non-zero length");
        var i = yield n.fetchWellKnownObject("https://".concat(e, "/.well-known/matrix/client"));
        return i ? (r = i.raw) !== null && r !== void 0 ? r : {} : {};
      })();
    }
    static sanitizeWellKnownUrl(e) {
      if (!e) return false;
      try {
        var n, r;
        try {
          r = new URL(e);
        } catch (l) {
          _e.error("Could not parse url", l);
        }
        if (!((n = r) !== null && n !== void 0 && n.hostname) || r.protocol !== "http:" && r.protocol !== "https:") return false;
        var i = r.port ? ":".concat(r.port) : "", a = r.pathname ? r.pathname : "", s = "".concat(r.protocol, "//").concat(r.hostname).concat(i).concat(a);
        return s.endsWith("/") && (s = s.substring(0, s.length - 1)), s;
      } catch (l) {
        return _e.error(l), false;
      }
    }
    static fetch(e, n) {
      return this.fetchFn ? this.fetchFn(e, n) : globalThis.fetch(e, n);
    }
    static setFetchFn(e) {
      ci.fetchFn = e;
    }
    static fetchWellKnownObject(e) {
      return me(function* () {
        var n;
        try {
          if (n = yield ci.fetch(e, {
            method: rt.Get,
            signal: sk(5e3)
          }), n.status === 404) return {
            raw: {},
            action: Qs.IGNORE,
            reason: ci.ERROR_MISSING_WELLKNOWN
          };
          if (n.status !== 200) return {
            raw: {},
            action: Qs.FAIL_PROMPT,
            reason: "General failure"
          };
        } catch (s) {
          var r = s, i = "";
          return typeof r == "object" && (i = r == null ? void 0 : r.message), {
            error: r,
            raw: {},
            action: Qs.FAIL_PROMPT,
            reason: i || "General failure"
          };
        }
        try {
          return {
            raw: yield n.json(),
            action: Qs.SUCCESS
          };
        } catch (s) {
          var a = s;
          return {
            error: a,
            raw: {},
            action: Qs.FAIL_PROMPT,
            reason: (a == null ? void 0 : a.name) === "SyntaxError" ? ci.ERROR_INVALID_JSON : ci.ERROR_INVALID
          };
        }
      })();
    }
  };
  $(ua, "ERROR_INVALID", Jl.Invalid);
  $(ua, "ERROR_GENERIC_FAILURE", Jl.GenericFailure);
  $(ua, "ERROR_INVALID_HS_BASE_URL", Jl.InvalidHsBaseUrl);
  $(ua, "ERROR_INVALID_HOMESERVER", Jl.InvalidHomeserver);
  $(ua, "ERROR_INVALID_IS_BASE_URL", Jl.InvalidIsBaseUrl);
  $(ua, "ERROR_INVALID_IDENTITY_SERVER", Jl.InvalidIdentityServer);
  $(ua, "ERROR_INVALID_IS", Jl.InvalidIs);
  $(ua, "ERROR_MISSING_WELLKNOWN", Jl.MissingWellknown);
  $(ua, "ERROR_INVALID_JSON", Jl.InvalidJson);
  $(ua, "ERROR_UNSUPPORTED_HOMESERVER_SPEC_VERSION", Jl.UnsupportedHomeserverSpecVersion);
  $(ua, "ALL_ERRORS", Object.keys(Jl));
  $(ua, "FAIL_ERROR", Qs.FAIL_ERROR);
  $(ua, "FAIL_PROMPT", Qs.FAIL_PROMPT);
  $(ua, "PROMPT", Qs.PROMPT);
  $(ua, "SUCCESS", Qs.SUCCESS);
  $(ua, "fetchFn", void 0);
  var cA = (function(t) {
    return t.IS = "SERVICE_TYPE_IS", t.IM = "SERVICE_TYPE_IM", t;
  })({});
  class Qwe {
    constructor(e) {
      this.ourEvent = e, $(this, "timeline", void 0), $(this, "ourEventIndex", 0), $(this, "paginateTokens", {
        [Tn.Backward]: null,
        [Tn.Forward]: null
      }), this.timeline = [
        e
      ];
    }
    getEvent() {
      return this.timeline[this.ourEventIndex];
    }
    getTimeline() {
      return this.timeline;
    }
    getOurEventIndex() {
      return this.ourEventIndex;
    }
    getPaginateToken() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      return this.paginateTokens[e ? Tn.Backward : Tn.Forward];
    }
    setPaginateToken(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      this.paginateTokens[n ? Tn.Backward : Tn.Forward] = e ?? null;
    }
    addEvents(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      n ? (this.timeline = e.concat(this.timeline), this.ourEventIndex += e.length) : this.timeline = this.timeline.concat(e);
    }
  }
  class uk {
    static fromJson(e, n) {
      var r = e.context || {}, i = (r.events_before || []).map(n), a = (r.events_after || []).map(n), s = new Qwe(n(e.result)), l = s.ourEvent.threadRootId;
      return i = i.filter((c) => c.threadRootId === l), a = a.filter((c) => c.threadRootId === l), s.setPaginateToken(r.start, true), s.addEvents(i, true), s.addEvents(a, false), s.setPaginateToken(r.end, false), new uk(e.rank, s);
    }
    constructor(e, n) {
      this.rank = e, this.context = n;
    }
  }
  function VH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function HH(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? VH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : VH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function eDe(t, e) {
    var n = !!e.preventReEmit, r = e.decrypt !== false;
    function i(a) {
      var s = t.getRoom(a.room_id), l;
      s && a.state_key === void 0 && (l = s.findEventById(a.event_id)), !l || l.status ? l = new to(a) : (l.setUnsigned(HH(HH({}, l.getUnsigned()), a.unsigned)), n = true);
      var c = l.getServerAggregatedRelation(Xn.Replace);
      if (c != null && c.content) {
        var d = i(c);
        l.makeReplaced(d);
      }
      var u = s == null ? void 0 : s.findThreadForEvent(l);
      return u && l.setThread(u), l.isEncrypted() && (n || t.reEmitter.reEmit(l, [
        or.Decrypted
      ]), r && t.decryptEventIfNeeded(l)), n || (t.reEmitter.reEmit(l, [
        or.Replaced,
        or.VisibilityChange
      ]), s == null ? void 0 : s.reEmitter.reEmit(l, [
        or.BeforeRedaction
      ])), l;
    }
    return i;
  }
  function $H(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function $h(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? $H(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : $H(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  class WH {
    constructor(e, n, r) {
      this.client = e, this.indexEvent = n, this.directory = r;
    }
    get id() {
      var e = this.indexEvent.getStateKey();
      if (!e) throw new Error("State key not found for branch");
      return e;
    }
    get isActive() {
      return this.indexEvent.getContent().active === true;
    }
    get version() {
      var e;
      return (e = this.indexEvent.getContent().version) !== null && e !== void 0 ? e : 1;
    }
    get roomId() {
      return this.indexEvent.getRoomId();
    }
    delete() {
      var e = this;
      return me(function* () {
        yield e.client.sendStateEvent(e.roomId, Su.name, {}, e.id), yield e.client.redactEvent(e.roomId, e.id);
        var n = (yield e.getVersionHistory())[1];
        n && (yield n.delete());
      })();
    }
    getName() {
      return this.indexEvent.getContent().name || "Unnamed File";
    }
    setName(e) {
      var n = this;
      return me(function* () {
        yield n.client.sendStateEvent(n.roomId, Su.name, $h($h({}, n.indexEvent.getContent()), {}, {
          name: e
        }), n.id);
      })();
    }
    isLocked() {
      return this.indexEvent.getContent().locked || false;
    }
    setLocked(e) {
      var n = this;
      return me(function* () {
        yield n.client.sendStateEvent(n.roomId, Su.name, $h($h({}, n.indexEvent.getContent()), {}, {
          locked: e
        }), n.id);
      })();
    }
    getFileInfo() {
      var e = this;
      return me(function* () {
        var n = yield e.getFileEvent(), r = n.getOriginalContent().file, i = e.client.mxcUrlToHttp(r.url);
        if (!i) throw new Error("No HTTP URL available for ".concat(r.url));
        return {
          info: r,
          httpUrl: i
        };
      })();
    }
    getFileEvent() {
      var e = this;
      return me(function* () {
        var n = e.client.getRoom(e.roomId);
        if (!n) throw new Error("Unknown room");
        for (var r = n.getUnfilteredTimelineSet().findEventById(e.id); !r && n.getLiveTimeline().getState(en.BACKWARDS).paginationToken; ) yield e.client.scrollback(n, 100), r = n.getUnfilteredTimelineSet().findEventById(e.id);
        if (!r) throw new Error("Failed to find event");
        return yield e.client.decryptEventIfNeeded(r), r;
      })();
    }
    createNewVersion(e, n, r, i) {
      var a = this;
      return me(function* () {
        var s = yield a.directory.createFile(e, n, r, $h($h({}, i ?? {}), {}, {
          "m.new_content": true,
          "m.relates_to": {
            rel_type: Xn.Replace,
            event_id: a.id
          }
        }));
        return yield a.client.sendStateEvent(a.roomId, Su.name, {
          active: true,
          name: e,
          version: a.version + 1
        }, s.event_id), yield a.client.sendStateEvent(a.roomId, Su.name, $h($h({}, a.indexEvent.getContent()), {}, {
          active: false
        }), a.id), s;
      })();
    }
    getVersionHistory() {
      var e = this;
      return me(function* () {
        var n = [];
        n.push(e);
        var r = e.client.getRoom(e.roomId);
        if (!r) throw new Error("Invalid or unknown room");
        var i = [
          ...r.getLiveTimeline().getEvents()
        ].reverse(), a, s = yield e.getFileEvent();
        do
          if (a = i.find((c) => c.replacingEventId() === s.getId()), a) {
            var l = e.directory.getFile(a.getId());
            if (l) n.push(l), s = a;
            else break;
          }
        while (a);
        return n;
      })();
    }
  }
  function qH(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Em(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? qH(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : qH(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var tDe = {
    invite: 100,
    kick: 100,
    ban: 100,
    redact: 50,
    state_default: 50,
    events_default: 50,
    users_default: 0,
    events: {
      [ce.RoomPowerLevels]: 100,
      [ce.RoomHistoryVisibility]: 100,
      [ce.RoomTombstone]: 100,
      [ce.RoomEncryption]: 100,
      [ce.RoomName]: 50,
      [ce.RoomMessage]: 50,
      [ce.RoomMessageEncrypted]: 50,
      [ce.Sticker]: 50
    },
    users: {}
  }, h0 = (function(t) {
    return t.Viewer = "viewer", t.Editor = "editor", t.Owner = "owner", t;
  })({});
  class KH {
    constructor(e, n) {
      if (this.client = e, this.roomId = n, $(this, "room", void 0), this.room = this.client.getRoom(this.roomId), !this.room) throw new Error("Unknown room");
    }
    get id() {
      return this.roomId;
    }
    get isTopLevel() {
      var e = this.room.currentState.getStateEvents(ce.SpaceParent);
      return e != null && e.length ? e.every((n) => {
        var r;
        return !((r = n.getContent()) !== null && r !== void 0 && r.via);
      }) : true;
    }
    setName(e) {
      var n = this;
      return me(function* () {
        yield n.client.sendStateEvent(n.roomId, ce.RoomName, {
          name: e
        }, "");
      })();
    }
    invite(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : true, a = [
          r.retryInvite(e)
        ];
        i && a.push(...r.getDirectories().map((s) => s.invite(e, i))), yield Promise.all(a);
      })();
    }
    retryInvite(e) {
      var n = this;
      return me(function* () {
        yield U3e(() => n.client.invite(n.roomId, e), (r) => !(r instanceof Un && r.errcode === "M_FORBIDDEN"));
      })();
    }
    setPermissions(e, n) {
      var r = this;
      return me(function* () {
        var i, a = r.room.currentState.getStateEvents(ce.RoomPowerLevels, "");
        if (Array.isArray(a)) throw new Error("Unexpected return type for power levels");
        var s = (a == null ? void 0 : a.getContent()) || {}, l = s.users_default || 0, c = s.events_default || 50, d = ((i = s.events) === null || i === void 0 ? void 0 : i[ce.RoomPowerLevels]) || 100, u = s.users || {};
        switch (n) {
          case h0.Viewer:
            u[e] = l;
            break;
          case h0.Editor:
            u[e] = c;
            break;
          case h0.Owner:
            u[e] = d;
            break;
          default:
            throw new Error("Invalid role: " + n);
        }
        s.users = u, yield r.client.sendStateEvent(r.roomId, ce.RoomPowerLevels, s, "");
      })();
    }
    getPermissions(e) {
      var n, r, i = this.room.currentState.getStateEvents(ce.RoomPowerLevels, "");
      if (Array.isArray(i)) throw new Error("Unexpected return type for power levels");
      var a = (i == null ? void 0 : i.getContent()) || {}, s = a.users_default || 0, l = a.events_default || 50, c = ((n = a.events) === null || n === void 0 ? void 0 : n[ce.RoomPowerLevels]) || 100, d = ((r = a.users) === null || r === void 0 ? void 0 : r[e]) || s;
      return d >= c ? h0.Owner : d >= l ? h0.Editor : h0.Viewer;
    }
    createDirectory(e) {
      var n = this;
      return me(function* () {
        var r = yield n.client.unstableCreateFileTree(e);
        return yield n.client.sendStateEvent(n.roomId, ce.SpaceChild, {
          via: [
            n.client.getDomain()
          ]
        }, r.roomId), yield n.client.sendStateEvent(r.roomId, ce.SpaceParent, {
          via: [
            n.client.getDomain()
          ]
        }, n.roomId), r;
      })();
    }
    getDirectories() {
      var e = [], n = this.room.currentState.getStateEvents(ce.SpaceChild);
      for (var r of n) try {
        var i = r.getStateKey();
        if (i) {
          var a = this.client.unstableGetFileTreeSpace(i);
          a && e.push(a);
        }
      } catch (s) {
        _e.warn("Unable to create tree space instance for listing. Are we joined?", s);
      }
      return e;
    }
    getDirectory(e) {
      return this.getDirectories().find((n) => n.roomId === e);
    }
    delete() {
      var e = this;
      return me(function* () {
        var n = e.getDirectories();
        for (var r of n) yield r.delete();
        var i = [
          Ht.Invite,
          Ht.Knock,
          Ht.Join
        ], a = e.room.currentState.getStateEvents(ce.RoomMember);
        for (var s of a) {
          var l = s.getStateKey() !== e.client.getUserId();
          if (l && i.includes(s.getContent().membership)) {
            var c = s.getStateKey();
            if (!c) throw new Error("State key not found for branch");
            yield e.client.kick(e.roomId, c, "Room deleted");
          }
        }
        yield e.client.leave(e.roomId);
      })();
    }
    getOrderedChildren(e) {
      var n = e.map((r) => ({
        roomId: r.getStateKey(),
        order: r.getContent().order
      })).filter((r) => r.roomId);
      return n.sort((r, i) => {
        if (r.order && !i.order) return -1;
        if (!r.order && i.order) return 1;
        if (!r.order && !i.order) {
          var a, s, l, c, d = this.client.getRoom(r.roomId), u = this.client.getRoom(i.roomId);
          if (!d || !u) return wD(r.roomId, i.roomId);
          var h = (a = (s = d.currentState.getStateEvents(ce.RoomCreate, "")) === null || s === void 0 ? void 0 : s.getTs()) !== null && a !== void 0 ? a : 0, f = (l = (c = u.currentState.getStateEvents(ce.RoomCreate, "")) === null || c === void 0 ? void 0 : c.getTs()) !== null && l !== void 0 ? l : 0;
          return h === f ? wD(r.roomId, i.roomId) : h - f;
        } else return wD(r.order, i.order);
      }), n;
    }
    getParentRoom() {
      var e = this.room.currentState.getStateEvents(ce.SpaceParent), n = e[0];
      if (!n) throw new Error("Expected to have a parent in a non-top level space");
      var r = n.getStateKey();
      if (!r) throw new Error("No state key found for parent");
      var i = this.client.getRoom(r);
      if (!i) throw new Error("Unable to locate room for parent");
      return i;
    }
    getOrder() {
      if (this.isTopLevel) return -1;
      var e = this.getParentRoom(), n = e.currentState.getStateEvents(ce.SpaceChild), r = this.getOrderedChildren(n);
      return r.findIndex((i) => i.roomId === this.roomId);
    }
    setOrder(e) {
      var n = this;
      return me(function* () {
        var r;
        if (n.isTopLevel) throw new Error("Cannot set order of top level spaces currently");
        var i = n.getParentRoom(), a = i.currentState.getStateEvents(ce.SpaceChild), s = n.getOrderedChildren(a);
        e = Math.max(Math.min(e, s.length - 1), 0);
        var l = n.getOrder(), c = l < e;
        c && e === s.length - 1 ? e-- : !c && e === 0 && e++;
        var d = s[c ? e : e - 1], u = s[c ? e + 1 : e], h = Bf[0], f = false;
        if (!d) u != null && u.order && (h = ZV(u.order));
        else if (e === s.length - 1) u != null && u.order && (h = h_(u.order));
        else {
          var g = d == null ? void 0 : d.order, m = u == null ? void 0 : u.order;
          g && m ? g === m ? h = h_(g) : h = V3e(g, m) : g ? h = h_(g) : m ? h = ZV(m) : f = true;
        }
        if (f) {
          for (var v, y = 0; y <= e; y++) {
            var w = s[y];
            if (y === 0 && (v = w.order), w.order) v = w.order;
            else {
              var b;
              v = v ? h_(v) : Bf[0];
              var j = i.currentState.getStateEvents(ce.SpaceChild, w.roomId), k = (b = j == null ? void 0 : j.getContent()) !== null && b !== void 0 ? b : {
                via: [
                  n.client.getDomain()
                ]
              };
              yield n.client.sendStateEvent(i.roomId, ce.SpaceChild, Em(Em({}, k), {}, {
                order: v
              }), w.roomId);
            }
          }
          v && (h = h_(v));
        }
        var C = i.currentState.getStateEvents(ce.SpaceChild, n.roomId), x = (r = C == null ? void 0 : C.getContent()) !== null && r !== void 0 ? r : {
          via: [
            n.client.getDomain()
          ]
        };
        yield n.client.sendStateEvent(i.roomId, ce.SpaceChild, Em(Em({}, x), {}, {
          order: h
        }), n.roomId);
      })();
    }
    createFile(e, n, r, i) {
      var a = this;
      return me(function* () {
        var { content_uri: s } = yield a.client.uploadContent(n, {
          includeFilename: false
        });
        r.url = s;
        var l = {
          msgtype: Jn.File,
          body: e,
          url: s,
          file: r
        };
        i = i ?? {}, i["m.new_content"] && (i["m.new_content"] = l);
        var c = yield a.client.sendMessage(a.roomId, Em(Em(Em({}, i), l), {}, {
          [dne.name]: {}
        }));
        return yield a.client.sendStateEvent(a.roomId, Su.name, {
          active: true,
          name: e
        }, c.event_id), c;
      })();
    }
    getFile(e) {
      var n = this.room.currentState.getStateEvents(Su.name, e);
      return n ? new WH(this.client, n, this) : null;
    }
    listFiles() {
      return this.listAllFiles().filter((e) => e.isActive);
    }
    listAllFiles() {
      var e, n = (e = this.room.currentState.getStateEvents(Su.name)) !== null && e !== void 0 ? e : [];
      return n.map((r) => new WH(this.client, r, this));
    }
  }
  var M2 = (function(t) {
    return t.Recent = "recent", t.Rank = "rank", t;
  })({}), Ym = (function(t) {
    return t.LocalStreamsChanged = "local_streams_changed", t;
  })({});
  class nDe extends ji {
    constructor(e) {
      super(), this.client = e, $(this, "audioInput", void 0), $(this, "audioSettings", void 0), $(this, "videoInput", void 0), $(this, "localUserMediaStream", void 0), $(this, "userMediaStreams", []), $(this, "screensharingStreams", []), $(this, "getMediaStreamPromise", void 0);
    }
    restoreMediaSettings(e, n) {
      this.audioInput = e, this.videoInput = n;
    }
    setAudioInput(e) {
      var n = this;
      return me(function* () {
        _e.info("MediaHandler setAudioInput() running (deviceId=".concat(e, ")")), n.audioInput !== e && (n.audioInput = e, yield n.updateLocalUsermediaStreams());
      })();
    }
    setAudioSettings(e) {
      var n = this;
      return me(function* () {
        _e.info("MediaHandler setAudioSettings() running (opts=".concat(JSON.stringify(e), ")")), n.audioSettings = Object.assign({}, e), yield n.updateLocalUsermediaStreams();
      })();
    }
    setVideoInput(e) {
      var n = this;
      return me(function* () {
        _e.info("MediaHandler setVideoInput() running (deviceId=".concat(e, ")")), n.videoInput !== e && (n.videoInput = e, yield n.updateLocalUsermediaStreams());
      })();
    }
    setMediaInputs(e, n) {
      var r = this;
      return me(function* () {
        _e.log("MediaHandler setMediaInputs() running (audioInput: ".concat(e, " videoInput: ").concat(n, ")")), r.audioInput = e, r.videoInput = n, yield r.updateLocalUsermediaStreams();
      })();
    }
    updateLocalUsermediaStreams() {
      var e = this;
      return me(function* () {
        if (e.userMediaStreams.length !== 0) {
          var n = /* @__PURE__ */ new Map();
          for (var r of e.client.callEventHandler.calls.values()) n.set(r.callId, {
            audio: r.hasLocalUserMediaAudioTrack,
            video: r.hasLocalUserMediaVideoTrack
          });
          for (var i of e.userMediaStreams) {
            _e.log("MediaHandler updateLocalUsermediaStreams() stopping all tracks (streamId=".concat(i.id, ")"));
            for (var a of i.getTracks()) a.stop();
          }
          e.userMediaStreams = [], e.localUserMediaStream = void 0;
          for (var s of e.client.callEventHandler.calls.values()) if (!(s.callHasEnded() || !n.has(s.callId))) {
            var { audio: l, video: c } = n.get(s.callId);
            _e.log("MediaHandler updateLocalUsermediaStreams() calling getUserMediaStream() (callId=".concat(s.callId, ")"));
            var d = yield e.getUserMediaStream(l, c);
            s.callHasEnded() || (yield s.updateLocalUsermediaStream(d));
          }
          for (var u of e.client.groupCallEventHandler.groupCalls.values()) if (u.localCallFeed) {
            _e.log("MediaHandler updateLocalUsermediaStreams() calling getUserMediaStream() (groupCallId=".concat(u.groupCallId, ")"));
            var h = yield e.getUserMediaStream(true, u.type === dk.Video);
            u.state !== Ji.Ended && (yield u.updateLocalUsermediaStream(h));
          }
          e.emit(Ym.LocalStreamsChanged);
        }
      })();
    }
    hasAudioDevice() {
      return me(function* () {
        try {
          var e = yield navigator.mediaDevices.enumerateDevices();
          return e.filter((n) => n.kind === "audioinput").length > 0;
        } catch (n) {
          return _e.log("MediaHandler hasAudioDevice() calling navigator.mediaDevices.enumerateDevices with error", n), false;
        }
      })();
    }
    hasVideoDevice() {
      return me(function* () {
        try {
          var e = yield navigator.mediaDevices.enumerateDevices();
          return e.filter((n) => n.kind === "videoinput").length > 0;
        } catch (n) {
          return _e.log("MediaHandler hasVideoDevice() calling navigator.mediaDevices.enumerateDevices with error", n), false;
        }
      })();
    }
    getUserMediaStream(e, n) {
      var r = arguments, i = this;
      return me(function* () {
        var a = r.length > 2 && r[2] !== void 0 ? r[2] : true;
        return i.getMediaStreamPromise ? i.getMediaStreamPromise = i.getMediaStreamPromise.then(() => i.getUserMediaStreamInternal(e, n, a)) : i.getMediaStreamPromise = i.getUserMediaStreamInternal(e, n, a), i.getMediaStreamPromise;
      })();
    }
    getUserMediaStreamInternal(e, n, r) {
      var i = this;
      return me(function* () {
        var a = e && (yield i.hasAudioDevice()), s = n && (yield i.hasVideoDevice()), l, c = true;
        if (i.localUserMediaStream) {
          var d, u;
          a !== i.localUserMediaStream.getAudioTracks().length > 0 && (c = false), s !== i.localUserMediaStream.getVideoTracks().length > 0 && (c = false), a && ((d = i.localUserMediaStream.getAudioTracks()[0]) === null || d === void 0 || (d = d.getSettings()) === null || d === void 0 ? void 0 : d.deviceId) !== i.audioInput && (c = false), s && ((u = i.localUserMediaStream.getVideoTracks()[0]) === null || u === void 0 || (u = u.getSettings()) === null || u === void 0 ? void 0 : u.deviceId) !== i.videoInput && (c = false);
        } else c = false;
        if (c) {
          var m;
          if (l = i.localUserMediaStream.clone(), _e.log("MediaHandler getUserMediaStreamInternal() cloning (oldStreamId=".concat((m = i.localUserMediaStream) === null || m === void 0 ? void 0 : m.id, " newStreamId=").concat(l.id, " shouldRequestAudio=").concat(a, " shouldRequestVideo=").concat(s, ")")), !a) for (var v of l.getAudioTracks()) l.removeTrack(v);
          if (!s) for (var y of l.getVideoTracks()) l.removeTrack(y);
        } else {
          var h = i.getUserMediaContraints(a, s);
          l = yield navigator.mediaDevices.getUserMedia(h), _e.log("MediaHandler getUserMediaStreamInternal() calling getUserMediaStream (streamId=".concat(l.id, ", shouldRequestAudio=").concat(a, ", shouldRequestVideo=").concat(s, ", constraints=").concat(JSON.stringify(h), ")"));
          for (var f of l.getTracks()) {
            var g = f.getSettings();
            f.kind === "audio" ? i.audioInput = g.deviceId : f.kind === "video" && (i.videoInput = g.deviceId);
          }
          r && (i.localUserMediaStream = l);
        }
        return r && i.userMediaStreams.push(l), i.emit(Ym.LocalStreamsChanged), l;
      })();
    }
    stopUserMediaStream(e) {
      _e.log("MediaHandler stopUserMediaStream() stopping (streamId=".concat(e.id, ")"));
      for (var n of e.getTracks()) n.stop();
      var r = this.userMediaStreams.indexOf(e);
      if (r !== -1 && (_e.debug("MediaHandler stopUserMediaStream() splicing usermedia stream out stream array (streamId=".concat(e.id, ")"), e.id), this.userMediaStreams.splice(r, 1)), this.emit(Ym.LocalStreamsChanged), this.localUserMediaStream === e) this.localUserMediaStream = void 0;
      else for (var i of e.getTracks()) {
        var a;
        if ((a = this.localUserMediaStream) !== null && a !== void 0 && a.getTrackById(i.id)) {
          this.stopUserMediaStream(this.localUserMediaStream);
          break;
        }
      }
    }
    getScreensharingStream() {
      var e = arguments, n = this;
      return me(function* () {
        var r = e.length > 0 && e[0] !== void 0 ? e[0] : {}, i = e.length > 1 && e[1] !== void 0 ? e[1] : true, a;
        if (n.screensharingStreams.length === 0) {
          var s = n.getScreenshareContraints(r);
          r.desktopCapturerSourceId ? (_e.debug("MediaHandler getScreensharingStream() calling getUserMedia() (opts=".concat(JSON.stringify(r), ")")), a = yield navigator.mediaDevices.getUserMedia(s)) : (_e.debug("MediaHandler getScreensharingStream() calling getDisplayMedia() (opts=".concat(JSON.stringify(r), ")")), a = yield navigator.mediaDevices.getDisplayMedia(s));
        } else {
          var l = n.screensharingStreams[n.screensharingStreams.length - 1];
          _e.log("MediaHandler getScreensharingStream() cloning (streamId=".concat(l.id, ")")), a = l.clone();
        }
        return i && n.screensharingStreams.push(a), n.emit(Ym.LocalStreamsChanged), a;
      })();
    }
    stopScreensharingStream(e) {
      _e.debug("MediaHandler stopScreensharingStream() stopping stream (streamId=".concat(e.id, ")"));
      for (var n of e.getTracks()) n.stop();
      var r = this.screensharingStreams.indexOf(e);
      r !== -1 && (_e.debug("MediaHandler stopScreensharingStream() splicing stream out (streamId=".concat(e.id, ")")), this.screensharingStreams.splice(r, 1)), this.emit(Ym.LocalStreamsChanged);
    }
    stopAllStreams() {
      for (var e of this.userMediaStreams) {
        _e.log("MediaHandler stopAllStreams() stopping (streamId=".concat(e.id, ")"));
        for (var n of e.getTracks()) n.stop();
      }
      for (var r of this.screensharingStreams) for (var i of r.getTracks()) i.stop();
      this.userMediaStreams = [], this.screensharingStreams = [], this.localUserMediaStream = void 0, this.emit(Ym.LocalStreamsChanged);
    }
    getUserMediaContraints(e, n) {
      var r = !!navigator.webkitGetUserMedia;
      return {
        audio: e ? {
          deviceId: this.audioInput ? {
            ideal: this.audioInput
          } : void 0,
          autoGainControl: this.audioSettings ? {
            ideal: this.audioSettings.autoGainControl
          } : void 0,
          echoCancellation: this.audioSettings ? {
            ideal: this.audioSettings.echoCancellation
          } : void 0,
          noiseSuppression: this.audioSettings ? {
            ideal: this.audioSettings.noiseSuppression
          } : void 0
        } : false,
        video: n ? {
          deviceId: this.videoInput ? {
            ideal: this.videoInput
          } : void 0,
          width: r ? {
            exact: 640
          } : {
            ideal: 640
          },
          height: r ? {
            exact: 360
          } : {
            ideal: 360
          }
        } : false
      };
    }
    getScreenshareContraints(e) {
      var { desktopCapturerSourceId: n, audio: r } = e;
      return n ? {
        audio: r ?? false,
        video: {
          mandatory: {
            chromeMediaSource: "desktop",
            chromeMediaSourceId: n
          }
        }
      } : {
        audio: r ?? false,
        video: true
      };
    }
  }
  var rDe = 10 * 1e3, Pf = "*", aB = "$ME", iDe = "$LAZY", Dg = (function(t) {
    return t.RequestFinished = "FINISHED", t.Complete = "COMPLETE", t;
  })({});
  class GH {
    constructor(e) {
      $(this, "list", void 0), $(this, "isModified", void 0), $(this, "joinedCount", 0), this.replaceList(e);
    }
    setModified(e) {
      this.isModified = e;
    }
    updateListRange(e) {
      this.list.ranges = JSON.parse(JSON.stringify(e));
    }
    replaceList(e) {
      var n, r;
      e.filters = (n = e.filters) !== null && n !== void 0 ? n : {}, e.ranges = (r = e.ranges) !== null && r !== void 0 ? r : [], this.list = JSON.parse(JSON.stringify(e)), this.isModified = true, this.joinedCount = 0;
    }
    getList(e) {
      var n = {
        ranges: JSON.parse(JSON.stringify(this.list.ranges))
      };
      return (this.isModified || e) && (n = JSON.parse(JSON.stringify(this.list))), n;
    }
  }
  var Mf = (function(t) {
    return t.PreProcess = "ExtState.PreProcess", t.PostProcess = "ExtState.PostProcess", t;
  })({}), nl = (function(t) {
    return t.RoomData = "SlidingSync.RoomData", t.Lifecycle = "SlidingSync.Lifecycle", t;
  })({});
  class oDe extends ji {
    constructor(e, n, r, i, a) {
      super(), this.proxyBaseUrl = e, this.roomSubscriptionInfo = r, this.client = i, this.timeoutMS = a, $(this, "lists", void 0), $(this, "listModifiedCount", 0), $(this, "terminated", false), $(this, "needsResend", false), $(this, "extensions", {}), $(this, "desiredRoomSubscriptions", /* @__PURE__ */ new Set()), $(this, "confirmedRoomSubscriptions", /* @__PURE__ */ new Set()), $(this, "customSubscriptions", /* @__PURE__ */ new Map()), $(this, "roomIdToCustomSubscription", /* @__PURE__ */ new Map()), $(this, "pendingReq", void 0), $(this, "abortController", void 0), this.lists = /* @__PURE__ */ new Map(), n.forEach((s, l) => {
        this.lists.set(l, new GH(s));
      });
    }
    addCustomSubscription(e, n) {
      if (this.customSubscriptions.has(e)) {
        _e.warn("addCustomSubscription: ".concat(e, " already exists as a custom subscription, ignoring."));
        return;
      }
      this.customSubscriptions.set(e, n);
    }
    useCustomSubscription(e, n) {
      this.roomIdToCustomSubscription.get(e) !== n && (this.roomIdToCustomSubscription.set(e, n), this.confirmedRoomSubscriptions.delete(e));
    }
    getListData(e) {
      var n = this.lists.get(e);
      return n ? {
        joinedCount: n.joinedCount
      } : null;
    }
    getListParams(e) {
      var n = this.lists.get(e);
      return n ? n.getList(true) : null;
    }
    setListRanges(e, n) {
      var r = this.lists.get(e);
      if (!r) throw new Error("no list with key " + e);
      r.updateListRange(n), this.resend();
    }
    setList(e, n) {
      var r = this.lists.get(e);
      r ? (r.replaceList(n), this.lists.set(e, r)) : this.lists.set(e, new GH(n)), this.listModifiedCount += 1, this.resend();
    }
    getRoomSubscriptions() {
      return new Set(Array.from(this.desiredRoomSubscriptions));
    }
    modifyRoomSubscriptions(e) {
      this.desiredRoomSubscriptions = e, this.resend();
    }
    modifyRoomSubscriptionInfo(e) {
      this.roomSubscriptionInfo = e, this.confirmedRoomSubscriptions = /* @__PURE__ */ new Set(), this.resend();
    }
    registerExtension(e) {
      if (this.extensions[e.name()]) throw new Error("registerExtension: ".concat(e.name(), " already exists as an extension"));
      this.extensions[e.name()] = e;
    }
    getExtensionRequest(e) {
      var n = this;
      return me(function* () {
        var r = {};
        for (var i in n.extensions) r[i] = yield n.extensions[i].onRequest(e);
        return r;
      })();
    }
    onPreExtensionsResponse(e) {
      var n = this;
      return me(function* () {
        yield Promise.all(Object.keys(e).map((function() {
          var r = me(function* (i) {
            n.extensions[i].when() == Mf.PreProcess && (yield n.extensions[i].onResponse(e[i]));
          });
          return function(i) {
            return r.apply(this, arguments);
          };
        })()));
      })();
    }
    onPostExtensionsResponse(e) {
      var n = this;
      return me(function* () {
        yield Promise.all(Object.keys(e).map((function() {
          var r = me(function* (i) {
            n.extensions[i].when() == Mf.PostProcess && (yield n.extensions[i].onResponse(e[i]));
          });
          return function(i) {
            return r.apply(this, arguments);
          };
        })()));
      })();
    }
    invokeRoomDataListeners(e, n) {
      var r = this;
      return me(function* () {
        n.required_state || (n.required_state = []), n.timeline || (n.timeline = []), yield r.emitPromised(nl.RoomData, e, n);
      })();
    }
    invokeLifecycleListeners(e, n, r) {
      this.emit(nl.Lifecycle, e, n, r);
    }
    resend() {
      var e;
      this.needsResend = true, (e = this.abortController) === null || e === void 0 || e.abort(), this.abortController = new AbortController();
    }
    stop() {
      var e;
      this.terminated = true, (e = this.abortController) === null || e === void 0 || e.abort(), this.removeAllListeners(nl.Lifecycle), this.removeAllListeners(nl.RoomData);
    }
    resetup() {
      _e.warn("SlidingSync: resetting connection info"), this.lists.forEach((e) => {
        e.setModified(true);
      }), this.confirmedRoomSubscriptions = /* @__PURE__ */ new Set(), this.resend();
    }
    start() {
      var e = this;
      return me(function* () {
        e.abortController = new AbortController();
        for (var n, r = function* () {
          e.needsResend = false;
          var s;
          try {
            var l, c, d, u = {};
            e.lists.forEach((k, C) => {
              u[C] = k.getList(true);
            });
            var h = {
              lists: u,
              pos: n,
              timeout: e.timeoutMS,
              clientTimeout: e.timeoutMS + rDe,
              extensions: yield e.getExtensionRequest(n === void 0)
            }, f = YH(e.desiredRoomSubscriptions, e.confirmedRoomSubscriptions), g = YH(e.confirmedRoomSubscriptions, e.desiredRoomSubscriptions);
            if (g.size > 0 && (h.unsubscribe_rooms = Array.from(g)), f.size > 0) {
              h.room_subscriptions = {};
              for (var m of f) {
                var v = e.roomIdToCustomSubscription.get(m), y = e.roomSubscriptionInfo;
                v && e.customSubscriptions.has(v) && (y = e.customSubscriptions.get(v)), h.room_subscriptions[m] = y;
              }
            }
            e.pendingReq = e.client.slidingSync(h, e.proxyBaseUrl, e.abortController.signal), s = yield e.pendingReq, n = s.pos;
            for (var w of f) e.confirmedRoomSubscriptions.add(w);
            for (var b of g) e.confirmedRoomSubscriptions.delete(b);
            e.lists.forEach((k) => {
              k.setModified(false);
            }), s.lists = (l = s.lists) !== null && l !== void 0 ? l : {}, s.rooms = (c = s.rooms) !== null && c !== void 0 ? c : {}, s.extensions = (d = s.extensions) !== null && d !== void 0 ? d : {}, Object.keys(s.lists).forEach((k) => {
              var C = e.lists.get(k);
              !C || !s || (C.joinedCount = s.lists[k].count);
            }), e.invokeLifecycleListeners(Dg.RequestFinished, s);
          } catch (k) {
            if (k.httpStatus) {
              if (e.invokeLifecycleListeners(Dg.RequestFinished, null, k), k.httpStatus === 400) return e.resetup(), n = void 0, yield Ug(50), 0;
            } else if (e.needsResend || k.name === "AbortError") return 0;
            _e.error(k), yield Ug(5e3);
          }
          if (!s) return 0;
          yield e.onPreExtensionsResponse(s.extensions);
          for (var j in s.rooms) yield e.invokeRoomDataListeners(j, s.rooms[j]);
          e.invokeLifecycleListeners(Dg.Complete, s), yield e.onPostExtensionsResponse(s.extensions);
        }, i; !e.terminated; ) i = yield* r();
      })();
    }
  }
  var YH = (t, e) => {
    var n = new Set(t);
    for (var r of e) n.delete(r);
    return n;
  }, aDe = 3;
  class sDe {
    constructor(e) {
      this.crypto = e;
    }
    name() {
      return "e2ee";
    }
    when() {
      return Mf.PreProcess;
    }
    onRequest(e) {
      var n = this;
      return me(function* () {
        return e && (_e.log("ExtensionE2EE: invalidating all device lists due to missing 'pos'"), yield n.crypto.markAllTrackedUsersAsDirty()), {
          enabled: true
        };
      })();
    }
    onResponse(e) {
      var n = this;
      return me(function* () {
        e.device_lists && (yield n.crypto.processDeviceLists(e.device_lists)), yield n.crypto.processKeyCounts(e.device_one_time_keys_count, e.device_unused_fallback_key_types || e["org.matrix.msc2732.device_unused_fallback_key_types"]), n.crypto.onSyncCompleted({});
      })();
    }
  }
  class lDe {
    constructor(e, n) {
      this.client = e, this.cryptoCallbacks = n, $(this, "nextBatch", null);
    }
    name() {
      return "to_device";
    }
    when() {
      return Mf.PreProcess;
    }
    onRequest(e) {
      var n = this;
      return me(function* () {
        return {
          since: n.nextBatch !== null ? n.nextBatch : void 0,
          limit: 100,
          enabled: true
        };
      })();
    }
    onResponse(e) {
      var n = this;
      return me(function* () {
        var r = e.events || [], i;
        n.cryptoCallbacks ? i = yield n.cryptoCallbacks.preprocessToDeviceMessages(r) : i = r.map((a) => ({
          message: a,
          encryptionInfo: null
        })), Gne(i, n.client), n.nextBatch = e.next_batch;
      })();
    }
  }
  class cDe {
    constructor(e) {
      this.client = e;
    }
    name() {
      return "account_data";
    }
    when() {
      return Mf.PostProcess;
    }
    onRequest(e) {
      return me(function* () {
        return {
          enabled: true
        };
      })();
    }
    onResponse(e) {
      var n = this;
      return me(function* () {
        e.global && e.global.length > 0 && n.processGlobalAccountData(e.global);
        for (var r in e.rooms) {
          var i = d1(n.client, r, e.rooms[r]), a = n.client.getRoom(r);
          if (!a) {
            _e.warn("got account data for room but room doesn't exist on client:", r);
            continue;
          }
          a.addAccountData(i), i.forEach((s) => {
            n.client.emit(jt.Event, s);
          });
        }
      })();
    }
    processGlobalAccountData(e) {
      var n = d1(this.client, void 0, e), r = n.reduce((i, a) => (i[a.getType()] = this.client.store.getAccountData(a.getType()), i), {});
      this.client.store.storeAccountDataEvents(n), n.forEach((i) => {
        if (i.getType() === ce.PushRules) {
          var a = i.getContent();
          this.client.setPushRules(a);
        }
        var s = r[i.getType()];
        return this.client.emit(jt.AccountData, i, s), i;
      });
    }
  }
  class dDe {
    constructor(e) {
      this.client = e;
    }
    name() {
      return "typing";
    }
    when() {
      return Mf.PostProcess;
    }
    onRequest(e) {
      return me(function* () {
        return {
          enabled: true
        };
      })();
    }
    onResponse(e) {
      var n = this;
      return me(function* () {
        if (e != null && e.rooms) for (var r in e.rooms) ere(n.client, r, [
          e.rooms[r]
        ]);
      })();
    }
  }
  class uDe {
    constructor(e) {
      this.client = e;
    }
    name() {
      return "receipts";
    }
    when() {
      return Mf.PostProcess;
    }
    onRequest(e) {
      return me(function* () {
        return {
          enabled: true
        };
      })();
    }
    onResponse(e) {
      var n = this;
      return me(function* () {
        if (e != null && e.rooms) for (var r in e.rooms) ere(n.client, r, [
          e.rooms[r]
        ]);
      })();
    }
  }
  class Qne {
    constructor(e, n, r, i) {
      this.slidingSync = e, this.client = n, $(this, "opts", void 0), $(this, "syncOpts", void 0), $(this, "syncState", null), $(this, "syncStateData", void 0), $(this, "lastPos", null), $(this, "failCount", 0), $(this, "notifEvents", []), this.opts = Wne(r), this.syncOpts = qne(i), n.getNotifTimelineSet() && n.reEmitter.reEmit(n.getNotifTimelineSet(), [
        mt.Timeline,
        mt.TimelineReset
      ]), this.slidingSync.on(nl.Lifecycle, this.onLifecycle.bind(this)), this.slidingSync.on(nl.RoomData, this.onRoomData.bind(this));
      var a = [
        new lDe(this.client, this.syncOpts.cryptoCallbacks),
        new cDe(this.client),
        new dDe(this.client),
        new uDe(this.client)
      ];
      this.syncOpts.cryptoCallbacks && a.push(new sDe(this.syncOpts.cryptoCallbacks)), a.forEach((s) => {
        this.slidingSync.registerExtension(s);
      });
    }
    onRoomData(e, n) {
      var r = this;
      return me(function* () {
        var i = r.client.store.getRoom(e);
        if (!i) {
          if (!n.initial) {
            r.syncOpts.logger.debug("initial flag not set but no stored room exists for room ", e, n);
            return;
          }
          i = Kne(r.client, e, r.opts);
        }
        yield r.processRoomData(r.client, i, n);
      })();
    }
    onLifecycle(e, n, r) {
      switch (r && this.syncOpts.logger.debug("onLifecycle", e, r), e) {
        case Dg.Complete:
          if (this.purgeNotifications(), !n) break;
          this.lastPos || this.updateSyncState(Nn.Prepared, {
            oldSyncToken: void 0,
            nextSyncToken: n.pos,
            catchingUp: false,
            fromCache: false
          }), this.updateSyncState(Nn.Syncing, {
            oldSyncToken: this.lastPos,
            nextSyncToken: n.pos,
            catchingUp: false,
            fromCache: false
          }), this.lastPos = n.pos;
          break;
        case Dg.RequestFinished:
          if (r) {
            if (this.failCount += 1, this.updateSyncState(this.failCount > aDe ? Nn.Error : Nn.Reconnecting, {
              error: new Un(r)
            }), this.shouldAbortSync(new Un(r))) return;
          } else this.failCount = 0, this.syncOpts.logger.debug("SlidingSyncState.RequestFinished with ".concat(Object.keys((n == null ? void 0 : n.rooms) || []).length, " rooms"));
          break;
      }
    }
    syncLeftRooms() {
      return me(function* () {
        return [];
      })();
    }
    peek(e) {
      return me(function* () {
        return null;
      })();
    }
    stopPeeking() {
    }
    setPresence(e) {
    }
    getSyncState() {
      return this.syncState;
    }
    getSyncStateData() {
      var e;
      return (e = this.syncStateData) !== null && e !== void 0 ? e : null;
    }
    createRoom(e) {
      var { timelineSupport: n } = this.client, r = new lk(e, this.client, this.client.getUserId(), {
        lazyLoadMembers: this.opts.lazyLoadMembers,
        pendingEventOrdering: this.opts.pendingEventOrdering,
        timelineSupport: n
      });
      return this.client.reEmitter.reEmit(r, [
        mt.Name,
        mt.Redaction,
        mt.RedactionCancelled,
        mt.Receipt,
        mt.Tags,
        mt.LocalEchoUpdated,
        mt.AccountData,
        mt.MyMembership,
        mt.Timeline,
        mt.TimelineReset
      ]), this.registerStateListeners(r), r;
    }
    registerStateListeners(e) {
      this.client.reEmitter.reEmit(e.currentState, [
        qn.Events,
        qn.Members,
        qn.NewMember,
        qn.Update
      ]), e.currentState.on(qn.NewMember, (n, r, i) => {
        var a;
        i.user = (a = this.client.getUser(i.userId)) !== null && a !== void 0 ? a : void 0, this.client.reEmitter.reEmit(i, [
          Ui.Name,
          Ui.Typing,
          Ui.PowerLevel,
          Ui.Membership
        ]);
      });
    }
    shouldAbortSync(e) {
      return e.errcode === "M_UNKNOWN_TOKEN" ? (this.syncOpts.logger.warn("Token no longer valid - assuming logout"), this.stop(), this.updateSyncState(Nn.Error, {
        error: e
      }), true) : false;
    }
    processRoomData(e, n, r) {
      var i = this;
      return me(function* () {
        r = hDe(e, n.roomId, r);
        var a = d1(i.client, n.roomId, r.required_state), s = d1(i.client, n.roomId, r.timeline, false), l = [];
        if (r.limited || r.initial) {
          var c = /* @__PURE__ */ new Set();
          n.getLiveTimeline().getEvents().forEach((b) => {
            c.add(b.getId());
          });
          for (var d = [], u = [], h = false, f = s.length - 1; f >= 0; f--) {
            var g = s[f];
            if (c.has(g.getId())) {
              h = true;
              continue;
            }
            h ? d.push(g) : u.unshift(g);
          }
          s = u, d.length > 0 && n.addEventsToTimeline(d, true, false, n.getLiveTimeline(), r.prev_batch);
        }
        var m = n.hasEncryptionStateEvent();
        if (r.notification_count != null && n.setUnreadNotificationCount(ir.Total, r.notification_count), r.highlight_count != null && (!m || m && n.getUnreadNotificationCount(ir.Highlight) <= 0) && n.setUnreadNotificationCount(ir.Highlight, r.highlight_count), r.bump_stamp && n.setBumpStamp(r.bump_stamp), Number.isInteger(r.invited_count) && n.currentState.setInvitedMemberCount(r.invited_count), Number.isInteger(r.joined_count) && n.currentState.setJoinedMemberCount(r.joined_count), r.invite_state) {
          var v = d1(i.client, n.roomId, r.invite_state);
          yield i.injectRoomEvents(n, v), r.initial && (n.recalculate(), i.client.store.storeRoom(n), i.client.emit(jt.Room, n)), v.forEach((b) => {
            i.client.emit(jt.Event, b);
          });
          return;
        }
        if (r.limited) {
          var y;
          n.getLiveTimeline().setPaginationToken((y = r.prev_batch) !== null && y !== void 0 ? y : null, en.BACKWARDS);
        }
        yield i.injectRoomEvents(n, a, s, r.num_live), n.addEphemeralEvents(l), n.updateMyMembership(Ht.Join), n.setMSC4186SummaryData(r.heroes, r.joined_count, r.invited_count), n.recalculate(), r.initial && (e.store.storeRoom(n), e.emit(jt.Room, n)), i.addNotifications(s);
        var w = (function() {
          var b = me(function* (j) {
            e.emit(jt.Event, j), j.isState() && j.getType() == ce.RoomEncryption && i.syncOpts.cryptoCallbacks && (yield i.syncOpts.cryptoCallbacks.onCryptoEvent(n, j));
          });
          return function(k) {
            return b.apply(this, arguments);
          };
        })();
        yield V0(a, w), yield V0(s, w), l.forEach(function(b) {
          e.emit(jt.Event, b);
        }), n.decryptCriticalEvents();
      })();
    }
    injectRoomEvents(e, n) {
      var r = arguments, i = this;
      return me(function* () {
        var a = r.length > 2 && r[2] !== void 0 ? r[2] : [], s = r.length > 3 && r[3] !== void 0 ? r[3] : 0, l = e.getLiveTimeline(), c = l.getEvents().length == 0;
        if (c) {
          for (var d of n) i.client.getPushActionsForEvent(d);
          l.initialiseState(n);
        }
        c || (e.oldState.setStateEvents(n), e.currentState.setStateEvents(n));
        var u = [];
        s > 0 && (u = a.slice(-1 * s), a = a.slice(0, -1 * u.length)), yield e.addLiveEvents(a, {
          fromCache: true,
          addToState: false
        }), u.length > 0 && (yield e.addLiveEvents(u, {
          fromCache: false,
          addToState: false
        })), e.recalculate(), i.resolveInvites(e);
      })();
    }
    resolveInvites(e) {
      if (!(!e || !this.opts.resolveInvitesToProfiles)) {
        var n = this.client;
        e.getMembersWithMembership(Ht.Invite).forEach(function(r) {
          if (!r.requestedProfileInfo) {
            r.requestedProfileInfo = true;
            var i = n.getUser(r.userId), a;
            i ? a = Promise.resolve({
              avatar_url: i.avatarUrl,
              displayname: i.displayName
            }) : a = n.getProfileInfo(r.userId), a.then(function(s) {
              var l = r.events.member;
              l.getContent().membership === Ht.Invite && (l.getContent().avatar_url = s.avatar_url, l.getContent().displayname = s.displayname, r.setMembershipEvent(l, e.currentState));
            }, function(s) {
            });
          }
        });
      }
    }
    retryImmediately() {
      return true;
    }
    sync() {
      var e = this;
      return me(function* () {
        for (e.syncOpts.logger.debug("Sliding sync init loop"); !e.client.isGuest(); ) try {
          e.syncOpts.logger.debug("Getting push rules...");
          var n = yield e.client.getPushRules();
          e.syncOpts.logger.debug("Got push rules"), e.client.pushRules = n;
          break;
        } catch (r) {
          if (e.syncOpts.logger.error("Getting push rules failed", r), e.shouldAbortSync(r)) return;
        }
        yield e.slidingSync.start();
      })();
    }
    stop() {
      this.syncOpts.logger.debug("SyncApi.stop"), this.slidingSync.stop();
    }
    updateSyncState(e, n) {
      var r = this.syncState;
      this.syncState = e, this.syncStateData = n, this.client.emit(jt.Sync, this.syncState, r, n);
    }
    addNotifications(e) {
      if (this.client.getNotifTimelineSet()) for (var n of e) {
        var r = this.client.getPushActionsForEvent(n);
        r && r.notify && r.tweaks && r.tweaks.highlight && this.notifEvents.push(n);
      }
    }
    purgeNotifications() {
      this.notifEvents.sort(function(e, n) {
        return e.getTs() - n.getTs();
      }), this.notifEvents.forEach((e) => {
        var n;
        (n = this.client.getNotifTimelineSet()) === null || n === void 0 || n.addLiveEvent(e, {
          addToState: false
        });
      }), this.notifEvents = [];
    }
  }
  function hDe(t, e, n) {
    if (!n.name) return n;
    for (var r of n.required_state) if (r.type === ce.RoomName && r.state_key === "") return r.content = {
      name: n.name
    }, n;
    return n.required_state.push({
      event_id: "$fake-sliding-sync-name-event-" + e,
      state_key: "",
      type: ce.RoomName,
      content: {
        name: n.name
      },
      sender: t.getUserId(),
      origin_server_ts: (/* @__PURE__ */ new Date()).getTime()
    }), n;
  }
  function d1(t, e, n) {
    var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, i = t.getEventMapper({
      decrypt: r
    });
    return n.map(function(a) {
      return a.room_id = e, i(a);
    });
  }
  function ere(t, e, n) {
    var r = d1(t, e, n), i = t.getRoom(e);
    if (!i) {
      _e.warn("got ephemeral events for room but room doesn't exist on client:", e);
      return;
    }
    i.addEphemeralEvents(r), r.forEach((a) => {
      t.emit(jt.Event, a);
    });
  }
  class U1 {
    static RETRY_BACKOFF_RATELIMIT(e, n, r) {
      return zne(r, n, false);
    }
    static QUEUE_MESSAGES(e) {
      return e.getType() === ce.RoomMessage || e.hasAssociation() ? "message" : null;
    }
    constructor() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : U1.RETRY_BACKOFF_RATELIMIT, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : U1.QUEUE_MESSAGES;
      this.retryAlgorithm = e, this.queueAlgorithm = n, $(this, "queues", {}), $(this, "activeQueues", []), $(this, "procFn", null), $(this, "processQueue", (r) => {
        var i = this.peekNextEvent(r);
        if (!i) {
          this.disableQueue(r);
          return;
        }
        this.queues[r].length, Promise.resolve().then(() => this.procFn(i.event)).then((a) => {
          this.removeNextEvent(r), i.event.getId(), i.resolvers.resolve(a), this.processQueue(r);
        }, (a) => {
          i.attempts += 1;
          var s = this.retryAlgorithm(i.event, i.attempts, a);
          i.attempts, i.event.getId(), s === -1 ? (_e.info("Queue '%s' giving up on event %s", r, i.event.getId()), this.clearQueue(r, a)) : setTimeout(this.processQueue, s, r);
        });
      });
    }
    getQueueForEvent(e) {
      var n = this.queueAlgorithm(e);
      return !n || !this.queues[n] ? null : this.queues[n].map(function(r) {
        return r.event;
      });
    }
    removeEventFromQueue(e) {
      var n = this.queueAlgorithm(e);
      if (!n || !this.queues[n]) return false;
      var r = false;
      return HC(this.queues[n], (i) => i.event.getId() === e.getId() ? (r = true, true) : false), r;
    }
    setProcessFunction(e) {
      this.procFn = e, this.startProcessingQueues();
    }
    queueEvent(e) {
      var n = this.queueAlgorithm(e);
      if (!n) return null;
      this.queues[n] || (this.queues[n] = []);
      var r = Promise.withResolvers();
      return this.queues[n].push({
        event: e,
        resolvers: r,
        attempts: 0
      }), e.getId(), this.startProcessingQueues(), r.promise;
    }
    startProcessingQueues() {
      this.procFn && Object.keys(this.queues).filter((e) => this.activeQueues.indexOf(e) === -1 && this.queues[e].length > 0).forEach((e) => {
        this.activeQueues.push(e), this.processQueue(e);
      });
    }
    disableQueue(e) {
      var n = this.activeQueues.indexOf(e);
      n >= 0 && this.activeQueues.splice(n, 1), _e.info("Stopping queue '%s' as it is now empty", e);
    }
    clearQueue(e, n) {
      _e.info("clearing queue '%s'", e);
      for (var r; r = this.removeNextEvent(e); ) r.resolvers.reject(n);
      this.disableQueue(e);
    }
    peekNextEvent(e) {
      var n = this.queues[e];
      if (Array.isArray(n)) return n[0];
    }
    removeNextEvent(e) {
      var n = this.queues[e];
      if (Array.isArray(n)) return n.shift();
    }
  }
  var ZH = 20;
  class fDe {
    constructor(e, n) {
      var r = this;
      this.client = e, this.logger = n, $(this, "sending", false), $(this, "running", true), $(this, "retryTimeout", null), $(this, "retryAttempts", 0), $(this, "sendQueue", me(function* () {
        if (r.retryTimeout !== null && clearTimeout(r.retryTimeout), r.retryTimeout = null, !(r.sending || !r.running)) {
          r.logger.debug("Attempting to send queued to-device messages"), r.sending = true;
          var i;
          try {
            for (; r.running && (i = yield r.client.store.getOldestToDeviceBatch(), i !== null); ) yield r.sendBatch(i), yield r.client.store.removeToDeviceBatch(i.id), r.retryAttempts = 0;
            if (!r.running) return;
            r.logger.debug("All queued to-device messages sent");
          } catch (s) {
            ++r.retryAttempts;
            var a = U1.RETRY_BACKOFF_RATELIMIT(null, r.retryAttempts, s);
            if (a === -1) {
              Math.floor(s.httpStatus / 100) === 4 ? (r.logger.error("Fatal error when sending to-device message - dropping to-device batch!", s), yield r.client.store.removeToDeviceBatch(i.id)) : r.logger.info("Automatic retry limit reached for to-device messages.");
              return;
            }
            r.logger.info("Failed to send batch of to-device messages. Will retry in ".concat(a, "ms"), s), r.retryTimeout = setTimeout(r.sendQueue, a);
          } finally {
            r.sending = false;
          }
        }
      })), $(this, "onResumedSync", (i, a) => {
        i === Nn.Syncing && a !== Nn.Syncing && (this.logger.info("Resuming queue after resumed sync"), this.sendQueue());
      });
    }
    start() {
      this.running = true, this.sendQueue(), this.client.on(jt.Sync, this.onResumedSync);
    }
    stop() {
      this.running = false, this.retryTimeout !== null && clearTimeout(this.retryTimeout), this.retryTimeout = null, this.client.removeListener(jt.Sync, this.onResumedSync);
    }
    queueBatch(e) {
      var n = this;
      return me(function* () {
        for (var r = [], i = 0; i < e.batch.length; i += ZH) {
          var a = {
            eventType: e.eventType,
            batch: e.batch.slice(i, i + ZH),
            txnId: n.client.makeTxnId()
          };
          r.push(a);
          var s = a.batch.map((l) => "".concat(l.userId, "/").concat(l.deviceId, " (msgid ").concat(l.payload[ok], ")"));
          n.logger.info("Enqueuing batch of to-device messages. type=".concat(e.eventType, " txnid=").concat(a.txnId), s);
        }
        yield n.client.store.saveToDeviceBatches(r), n.sendQueue();
      })();
    }
    sendBatch(e) {
      var n = this;
      return me(function* () {
        var r = new zu(() => /* @__PURE__ */ new Map());
        for (var i of e.batch) r.getOrCreate(i.userId).set(i.deviceId, i.payload);
        n.logger.info("Sending batch of ".concat(e.batch.length, " to-device messages with ID ").concat(e.id, " and txnId ").concat(e.txnId)), yield n.client.sendToDevice(e.eventType, r, e.txnId);
      })();
    }
  }
  var t9 = new Os.UnstableValue("m.policies", "org.matrix.msc3847.policies"), ew = new Os.UnstableValue("m.ignore.invites", "org.matrix.msc3847.ignore.invites"), JH = (function(t) {
    return t.Ban = "m.ban", t;
  })({}), u1 = (function(t) {
    return t.User = "m.policy.user", t.Room = "m.policy.room", t.Server = "m.policy.server", t;
  })({}), XH = {
    [u1.User]: ce.PolicyRuleUser,
    [u1.Room]: ce.PolicyRuleRoom,
    [u1.Server]: ce.PolicyRuleServer
  };
  class mDe {
    constructor(e) {
      this.client = e;
    }
    addRule(e, n, r) {
      var i = this;
      return me(function* () {
        var a = yield i.getOrCreateTargetRoom(), s = yield i.client.sendStateEvent(a.roomId, XH[e], {
          entity: n,
          reason: r,
          recommendation: JH.Ban
        });
        return s.event_id;
      })();
    }
    removeRule(e) {
      var n = this;
      return me(function* () {
        yield n.client.redactEvent(e.getRoomId(), e.getId());
      })();
    }
    addSource(e) {
      var n = this;
      return me(function* () {
        yield n.client.joinRoom(e);
        var r = (yield n.getOrCreateSourceRooms()).map((i) => i.roomId);
        return r.includes(e) ? false : (r.push(e), yield n.withIgnoreInvitesPolicies((i) => {
          i.sources = r;
        }), true);
      })();
    }
    getRuleForInvite(e) {
      var n = this;
      return me(function* () {
        var { sender: r, roomId: i } = e, a = yield n.getOrCreateSourceRooms(), s = r.split(":")[1], l = i.split(":")[1];
        for (var c of a) {
          var d = c.getUnfilteredTimelineSet().getLiveTimeline().getState(en.FORWARDS);
          for (var { scope: u, entities: h } of [
            {
              scope: u1.Room,
              entities: [
                i
              ]
            },
            {
              scope: u1.User,
              entities: [
                r
              ]
            },
            {
              scope: u1.Server,
              entities: [
                s,
                l
              ]
            }
          ]) {
            var f = d.getStateEvents(XH[u]);
            for (var g of f) {
              var m = g.getContent();
              if ((m == null ? void 0 : m.recommendation) == JH.Ban) {
                var v = m == null ? void 0 : m.entity;
                if (v) {
                  var y = void 0;
                  try {
                    y = new RegExp(one(v));
                  } catch {
                    continue;
                  }
                  for (var w of h) if (w && y.test(w)) return g;
                }
              }
            }
          }
        }
        return null;
      })();
    }
    getOrCreateTargetRoom() {
      var e = this;
      return me(function* () {
        var n = e.getIgnoreInvitesPolicies(), r = n.target;
        if (typeof r != "string" && (r = null), r) {
          var i = e.client.getRoom(r);
          if (i) return i;
          r = null;
        }
        return r = (yield e.client.createRoom({
          name: "Individual Policy Room",
          preset: Yb.PrivateChat
        })).room_id, yield e.withIgnoreInvitesPolicies((a) => {
          a.target = r;
        }), e.client.getRoom(r);
      })();
    }
    getOrCreateSourceRooms() {
      var e = this;
      return me(function* () {
        var n = e.getIgnoreInvitesPolicies(), r = n.sources, i = false;
        Array.isArray(r) || (i = true, r = []);
        var a = r.filter((l) => typeof l == "string").map((l) => e.client.getRoom(l)).filter((l) => !!l);
        if (a.length != r.length && (i = true), a.length == 0) {
          var s = yield e.getOrCreateTargetRoom();
          i = true, a = [
            s
          ];
        }
        return i && (yield e.withIgnoreInvitesPolicies((l) => {
          l.sources = r;
        })), a;
      })();
    }
    getIgnoreInvitesPolicies() {
      return this.getPoliciesAndIgnoreInvitesPolicies().ignoreInvitesPolicies;
    }
    withIgnoreInvitesPolicies(e) {
      var n = this;
      return me(function* () {
        var { policies: r, ignoreInvitesPolicies: i } = n.getPoliciesAndIgnoreInvitesPolicies();
        e(i), r[ew.name] = i, yield n.client.setAccountData(t9.name, r);
      })();
    }
    getPoliciesAndIgnoreInvitesPolicies() {
      var e = {};
      for (var n of [
        t9.name,
        t9.altName
      ]) {
        var r;
        if (n) {
          var i = (r = this.client.getAccountData(n)) === null || r === void 0 ? void 0 : r.getContent();
          if (i) {
            e = i;
            break;
          }
        }
      }
      var a = {}, s = false;
      for (var l of [
        ew.name,
        ew.altName
      ]) if (l) {
        var c = e[l];
        if (c && typeof c == "object") {
          a = c, s = true;
          break;
        }
      }
      return s || (e[ew.name] = a), {
        policies: e,
        ignoreInvitesPolicies: a
      };
    }
  }
  var n9 = "matrix-js-sdk", gDe = new Uint8Array(8);
  function tre(t, e) {
    return dA.apply(this, arguments);
  }
  function dA() {
    return dA = me(function* (t, e) {
      var n = yield globalThis.crypto.subtle.importKey("raw", t, {
        name: "HKDF"
      }, false, [
        "deriveBits"
      ]), r = yield globalThis.crypto.subtle.deriveBits({
        name: "HKDF",
        salt: gDe,
        info: new TextEncoder().encode(e),
        hash: "SHA-256"
      }, n, 512), i = r.slice(0, 32), a = r.slice(32), s = globalThis.crypto.subtle.importKey("raw", i, {
        name: "AES-CTR"
      }, false, [
        "encrypt",
        "decrypt"
      ]), l = globalThis.crypto.subtle.importKey("raw", a, {
        name: "HMAC",
        hash: {
          name: "SHA-256"
        }
      }, false, [
        "sign",
        "verify"
      ]);
      return Promise.all([
        s,
        l
      ]);
    }), dA.apply(this, arguments);
  }
  function nre(t, e, n, r) {
    return uA.apply(this, arguments);
  }
  function uA() {
    return uA = me(function* (t, e, n, r) {
      var i;
      r ? i = wg(r) : (i = new Uint8Array(16), globalThis.crypto.getRandomValues(i), i[8] &= 127);
      var [a, s] = yield tre(e, n), l = new TextEncoder().encode(t), c = yield globalThis.crypto.subtle.encrypt({
        name: "AES-CTR",
        counter: i,
        length: 64
      }, a, l), d = yield globalThis.crypto.subtle.sign({
        name: "HMAC"
      }, s, c);
      return {
        iv: Py(i),
        ciphertext: Py(new Uint8Array(c)),
        mac: Py(new Uint8Array(d))
      };
    }), uA.apply(this, arguments);
  }
  pDe = function(t, e, n) {
    return hA.apply(this, arguments);
  };
  function hA() {
    return hA = me(function* (t, e, n) {
      var [r, i] = yield tre(e, n), a = wg(t.ciphertext);
      if (!(yield globalThis.crypto.subtle.verify({
        name: "HMAC"
      }, i, wg(t.mac), a))) throw new Error("Error decrypting secret ".concat(n, ": bad MAC"));
      var s = yield globalThis.crypto.subtle.decrypt({
        name: "AES-CTR",
        counter: wg(t.iv),
        length: 64
      }, r, a);
      return new TextDecoder().decode(new Uint8Array(s));
    }), hA.apply(this, arguments);
  }
  Zm = "m.secret_storage.v1.aes-hmac-sha2";
  class rre {
    constructor(e, n) {
      this.accountDataAdapter = e, this.callbacks = n;
    }
    getDefaultKeyId() {
      var e = this;
      return me(function* () {
        var n, r = yield e.accountDataAdapter.getAccountDataFromServer("m.secret_storage.default_key");
        return r && (n = r.key) !== null && n !== void 0 ? n : null;
      })();
    }
    setDefaultKeyId(e) {
      return new Promise((n, r) => {
        var i = (s) => {
          if (s.getType() === "m.secret_storage.default_key") {
            var l = s.getContent(), c = e === null ? Object.keys(l).length === 0 : l.key === e;
            c && (this.accountDataAdapter.removeListener(jt.AccountData, i), n());
          }
        };
        this.accountDataAdapter.on(jt.AccountData, i);
        var a = e === null ? {} : {
          key: e
        };
        this.accountDataAdapter.setAccountData("m.secret_storage.default_key", a).catch((s) => {
          this.accountDataAdapter.removeListener(jt.AccountData, i), r(s);
        });
      });
    }
    addKey(e, n, r) {
      var i = this;
      return me(function* () {
        if (e !== Zm) throw new Error("Unknown key algorithm ".concat(e));
        var a = {
          algorithm: e
        };
        n.name && (a.name = n.name), n.passphrase && (a.passphrase = n.passphrase);
        var { iv: s, mac: l } = yield mA(n.key);
        if (a.iv = s, a.mac = l, !r) do
          r = kf(32);
        while (yield i.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(r)));
        return yield i.accountDataAdapter.setAccountData("m.secret_storage.key.".concat(r), a), {
          keyId: r,
          keyInfo: a
        };
      })();
    }
    getKey(e) {
      var n = this;
      return me(function* () {
        if (e || (e = yield n.getDefaultKeyId()), !e) return null;
        var r = yield n.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(e));
        return r ? [
          e,
          r
        ] : null;
      })();
    }
    hasKey(e) {
      var n = this;
      return me(function* () {
        var r = yield n.getKey(e);
        return !!r;
      })();
    }
    checkKey(e, n) {
      return me(function* () {
        if (n.algorithm === Zm) if (n.mac) {
          var { mac: r } = yield mA(e, n.iv);
          return fA(n.mac) === fA(r);
        } else return true;
        else throw new Error("Unknown algorithm");
      })();
    }
    store(e, n, r) {
      var i = this;
      return me(function* () {
        if (n === null) {
          yield i.accountDataAdapter.setAccountData(e, {});
          return;
        }
        var a = {};
        if (!r) {
          var s = yield i.getDefaultKeyId();
          if (!s) throw new Error("No keys specified and no default key present");
          r = [
            s
          ];
        }
        if (r.length === 0) throw new Error("Zero keys given to encrypt with!");
        for (var l of r) {
          var c = yield i.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(l));
          if (!c) throw new Error("Unknown key: " + l);
          if (c.algorithm === Zm) {
            var d = {
              [l]: c
            }, [, u] = yield i.getSecretStorageKey(d, e);
            a[l] = yield u.encrypt(n);
          } else _e.warn("unknown algorithm for secret storage key " + l + ": " + c.algorithm);
        }
        yield i.accountDataAdapter.setAccountData(e, {
          encrypted: a
        });
      })();
    }
    get(e) {
      var n = this;
      return me(function* () {
        var r = yield n.accountDataAdapter.getAccountDataFromServer(e);
        if (r) {
          if (!r.encrypted) throw new Error("Content is not encrypted!");
          var i = {};
          for (var a of Object.keys(r.encrypted)) {
            var s = yield n.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(a)), l = r.encrypted[a];
            (s == null ? void 0 : s.algorithm) === Zm && l.iv && l.ciphertext && l.mac && (i[a] = s);
          }
          if (Object.keys(i).length === 0) throw new Error("Could not decrypt ".concat(e, " because none of ") + "the keys it is encrypted with are for a supported algorithm");
          var [c, d] = yield n.getSecretStorageKey(i, e), u = r.encrypted[c];
          return d.decrypt(u);
        }
      })();
    }
    isStored(e) {
      var n = this;
      return me(function* () {
        var r = yield n.accountDataAdapter.getAccountDataFromServer(e);
        if (!(r != null && r.encrypted)) return null;
        var i = {};
        for (var a of Object.keys(r.encrypted)) {
          var s = yield n.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(a));
          if (s) {
            var l = r.encrypted[a];
            s.algorithm === Zm && l.iv && l.ciphertext && l.mac && (i[a] = s);
          }
        }
        return Object.keys(i).length ? i : null;
      })();
    }
    getSecretStorageKey(e, n) {
      var r = this;
      return me(function* () {
        if (!r.callbacks.getSecretStorageKey) throw new Error("No getSecretStorageKey callback supplied");
        var i = yield r.callbacks.getSecretStorageKey({
          keys: e
        }, n);
        if (!i) throw new Error("getSecretStorageKey callback returned falsey");
        if (i.length < 2) throw new Error("getSecretStorageKey callback returned invalid data");
        var [a, s] = i;
        if (!e[a]) throw new Error("App returned unknown key from getSecretStorageKey!");
        if (e[a].algorithm === Zm) {
          var l = {
            encrypt: function(d) {
              return nre(d, s, n);
            },
            decrypt: function(d) {
              return pDe(d, s, n);
            }
          };
          return [
            a,
            l
          ];
        } else throw new Error("Unknown key type: " + e[a].algorithm);
      })();
    }
  }
  function fA(t) {
    for (var e = t.length; e >= 1 && t.charCodeAt(e - 1) == 61; ) e--;
    return e < t.length ? t.substring(0, e) : t;
  }
  var FDe = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
  function mA(t, e) {
    return nre(FDe, t, "", e);
  }
  const vDe = Object.freeze(Object.defineProperty({
    __proto__: null,
    SECRET_STORAGE_ALGORITHM_V1_AES: Zm,
    ServerSideSecretStorageImpl: rre,
    calculateKeyCheck: mA,
    trimTrailingEquals: fA
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  var ire = (t) => t.type === "livekit" && "focus_selection" in t, ore = 1e3 * 60 * 60 * 4, _De = (t, e) => {
    var n, r = "Malformed session membership event: ";
    return typeof t.device_id != "string" && e.push(r + "device_id must be string"), typeof t.call_id != "string" && e.push(r + "call_id must be string"), typeof t.application != "string" && e.push(r + "application must be a string"), typeof ((n = t.focus_active) === null || n === void 0 ? void 0 : n.type) != "string" && e.push(r + "focus_active.type must be a string"), Array.isArray(t.foci_preferred) || e.push(r + "foci_preferred must be an array"), t.created_ts !== void 0 && typeof t.created_ts != "number" && e.push(r + "created_ts must be number"), t.scope !== void 0 && typeof t.scope != "string" && e.push(r + "scope must be string"), t["m.call.intent"] !== void 0 && typeof t["m.call.intent"] != "string" && e.push(r + "m.call.intent must be a string"), e.length === 0;
  };
  class QH {
    static equal(e, n) {
      return zg(e.membershipData, n.membershipData);
    }
    constructor(e, n) {
      this.parentEvent = e, $(this, "membershipData", void 0);
      var r = [];
      if (_De(n, r)) this.membershipData = n;
      else throw Error("unknown CallMembership data. Does not match MSC4143 call.member (".concat(r.join(" & "), ") events this could be a legacy membership event: (").concat(n, ")"));
    }
    get sender() {
      return this.parentEvent.getSender();
    }
    get eventId() {
      return this.parentEvent.getId();
    }
    get callId() {
      return this.membershipData.call_id;
    }
    get deviceId() {
      return this.membershipData.device_id;
    }
    get callIntent() {
      return this.membershipData["m.call.intent"];
    }
    get sessionDescription() {
      return {
        application: this.membershipData.application,
        id: this.membershipData.call_id
      };
    }
    get application() {
      return this.membershipData.application;
    }
    get scope() {
      return this.membershipData.scope;
    }
    get membershipID() {
      return this.createdTs().toString();
    }
    createdTs() {
      var e;
      return (e = this.membershipData.created_ts) !== null && e !== void 0 ? e : this.parentEvent.getTs();
    }
    getAbsoluteExpiry() {
      var e;
      return this.createdTs() + ((e = this.membershipData.expires) !== null && e !== void 0 ? e : ore);
    }
    getMsUntilExpiry() {
      return this.getAbsoluteExpiry() - Date.now();
    }
    isExpired() {
      return this.getMsUntilExpiry() <= 0;
    }
    getPreferredFoci() {
      return this.membershipData.foci_preferred;
    }
    getFocusSelection() {
      var e = this.membershipData.focus_active;
      if (ire(e)) return e.focus_selection;
    }
  }
  var Ny = (function(t) {
    return t.Cancel = "cancel", t.Restart = "restart", t.Send = "send", t;
  })({}), sB = (function(t) {
    return t.TooNew = "TOO_NEW", t;
  })({});
  class lB extends Error {
    constructor(e) {
      var n = "Crypto store is invalid because ".concat(e, ", ") + "please stop the client, delete all data and start the client again";
      super(n), this.reason = e, this.name = "InvalidCryptoStoreError";
    }
  }
  $(lB, "TOO_NEW", sB.TooNew);
  class yDe extends Error {
    constructor(e, n) {
      super(e), this.value = n;
    }
  }
  bDe = class extends Error {
    constructor() {
      super("MatrixClient has been stopped");
    }
  };
  class Ff extends Error {
    constructor(e, n) {
      super(e), this.clientEndpoint = n, this.name = "UnsupportedDelayedEventsEndpointError";
    }
  }
  var km = (function(t) {
    return t.Disconnected = "Disconnected", t.Connecting = "Connecting", t.ConnectingFailed = "ConnectingFailed", t.Connected = "Connected", t.Reconnecting = "Reconnecting", t.Disconnecting = "Disconnecting", t.Stuck = "Stuck", t.Unknown = "Unknown", t;
  })({}), ED = (t, e, n) => t.sender === e && t.deviceId === n;
  class xDe {
    constructor(e, n) {
      this.membershipLoopHandler = e, $(this, "logger", void 0), $(this, "running", false), $(this, "wakeup", (r) => {
        this.logger.error("Cannot call wakeup before calling `startWithJoin()`");
      }), $(this, "_actions", []), this.logger = (n ?? _e).getChild("[NewMembershipActionScheduler]");
    }
    get actions() {
      return this._actions;
    }
    startWithJoin() {
      var e = this;
      return me(function* () {
        if (e.running) {
          e.logger.error("Cannot call startWithJoin() on NewMembershipActionScheduler while already running");
          return;
        }
        e.running = true, e._actions = [
          {
            ts: Date.now(),
            type: Qn.SendDelayedEvent
          }
        ];
        try {
          for (var n = function* () {
            e._actions.sort((d, u) => d.ts - u.ts);
            var i = e._actions[0], a = void 0, s = new Promise((d) => {
              e.wakeup = (u) => {
                a = u, d();
              };
            });
            i.ts > Date.now() && (yield Promise.race([
              s,
              Ug(i.ts - Date.now())
            ]));
            var l = {};
            if (!a) {
              e.logger.debug("Current MembershipManager processing: ".concat(i.type, `
Queue:`), e._actions, `
Date.now: "`.concat(Date.now()));
              try {
                l = yield e.membershipLoopHandler(i.type);
              } catch (d) {
                throw Error("The MembershipManager shut down because of the end condition: ".concat(d));
              }
            }
            e._actions.splice(0, 1);
            var c = a ?? l;
            "replace" in c ? e._actions = c.replace : "insert" in c && e._actions.push(...c.insert);
          }; e._actions.length > 0; ) yield* n();
        } finally {
          e.running = false;
        }
        e.logger.debug("Leave MembershipManager ActionScheduler loop (no more actions)");
      })();
    }
    initiateJoin() {
      var e;
      (e = this.wakeup) === null || e === void 0 || e.call(this, {
        replace: [
          {
            ts: Date.now(),
            type: Qn.SendDelayedEvent
          }
        ]
      });
    }
    initiateLeave() {
      var e;
      (e = this.wakeup) === null || e === void 0 || e.call(this, {
        replace: [
          {
            ts: Date.now(),
            type: Qn.SendScheduledDelayedLeaveEvent
          }
        ]
      });
    }
  }
  var zy = (function(t) {
    return t.StatusChanged = "StatusChanged", t.ProbablyLeft = "ProbablyLeft", t;
  })({});
  function e$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function wDe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? e$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : e$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Qn = (function(t) {
    return t.SendDelayedEvent = "SendDelayedEvent", t.SendJoinEvent = "SendJoinEvent", t.RestartDelayedEvent = "RestartDelayedEvent", t.UpdateExpiry = "UpdateExpiry", t.SendScheduledDelayedLeaveEvent = "SendScheduledDelayedLeaveEvent", t.SendLeaveEvent = "SendLeaveEvent", t;
  })({});
  class QC extends ji {
    isActivated() {
      return this.activated;
    }
    isJoined() {
      return this.isActivated();
    }
    join(e, n, r) {
      if (this.scheduler.running) {
        this.logger.error("MembershipManager is already running. Ignoring join request.");
        return;
      }
      this.fociPreferred = e, this.focusActive = n, this.leavePromiseResolvers = void 0, this.activated = true, this.oldStatus = this.status, this.state = QC.defaultState, this.scheduler.startWithJoin().catch((i) => {
        this.logger.error("MembershipManager stopped because: ", i), r == null ? void 0 : r(i);
      }).finally(() => {
        if (this.activated = false, this.oldStatus && this.oldStatus !== this.status && this.emit(zy.StatusChanged, this.oldStatus, this.status), !this.scheduler.running) {
          var i;
          (i = this.leavePromiseResolvers) === null || i === void 0 || i.resolve(true), this.leavePromiseResolvers = void 0;
        }
      });
    }
    leave(e) {
      return this.scheduler.running ? (this.leavePromiseResolvers || (this.leavePromiseResolvers = Promise.withResolvers(), this.activated = false, this.scheduler.initiateLeave(), e && setTimeout(() => {
        var n;
        return (n = this.leavePromiseResolvers) === null || n === void 0 ? void 0 : n.resolve(false);
      }, e)), this.leavePromiseResolvers.promise) : (this.logger.warn("Called MembershipManager.leave() even though the MembershipManager is not running"), Promise.resolve(true));
    }
    onRTCSessionMemberUpdate(e) {
      if (!this.isActivated()) return Promise.resolve();
      var n = this.client.getUserId(), r = this.client.getDeviceId();
      if (!n || !r) return this.logger.error("MembershipManager.onRTCSessionMemberUpdate called without user or device id"), Promise.resolve();
      if (this._ownMembership = e.find((a) => ED(a, n, r)), !this._ownMembership) {
        var i = [
          Qn.SendDelayedEvent,
          Qn.SendJoinEvent
        ];
        this.logger.warn("Missing own membership: force re-join"), this.state.hasMemberStateEvent = false, this.scheduler.actions.some((a) => i.includes(a.type)) ? this.logger.error("tried adding another `SendDelayedEvent` actions even though we already have one in the Queue\nActionQueueOnMemberUpdate:", this.scheduler.actions) : this.scheduler.initiateJoin();
      }
      return Promise.resolve();
    }
    getActiveFocus() {
      if (this.focusActive) if (ire(this.focusActive)) {
        if (this.focusActive.focus_selection === "oldest_membership") {
          var e = this.getOldestMembership();
          return e == null ? void 0 : e.getPreferredFoci()[0];
        }
      } else this.logger.warn("Unknown own ActiveFocus type. This makes it impossible to connect to an SFU.");
      else {
        var n = this.getOldestMembership();
        return n == null ? void 0 : n.getPreferredFoci()[0];
      }
    }
    updateCallIntent(e) {
      var n = this;
      return me(function* () {
        if (!n.activated || !n.ownMembership) throw Error("You cannot update your intent before joining the call");
        n.ownMembership.callIntent !== e && (n.callIntent = e, yield n.sendJoinEvent());
      })();
    }
    constructor(e, n, r, i, a, s) {
      super(), this.joinConfig = e, this.room = n, this.client = r, this.getOldestMembership = i, this.sessionDescription = a, $(this, "activated", false), $(this, "logger", void 0), $(this, "callIntent", void 0), $(this, "leavePromiseResolvers", void 0), $(this, "_ownMembership", void 0), $(this, "oldStatus", void 0), $(this, "scheduler", void 0), $(this, "state", void 0), $(this, "deviceId", void 0), $(this, "stateKey", void 0), $(this, "fociPreferred", void 0), $(this, "focusActive", void 0), $(this, "delayedLeaveEventDelayMsOverride", void 0), this.logger = (s ?? _e).getChild("[MembershipManager]");
      var [l, c] = [
        this.client.getUserId(),
        this.client.getDeviceId()
      ];
      if (l === null) throw Error("Missing userId in client");
      if (c === null) throw Error("Missing deviceId in client");
      this.deviceId = c, this.stateKey = this.makeMembershipStateKey(l, c), this.state = QC.defaultState, this.callIntent = e == null ? void 0 : e.callIntent, this.scheduler = new xDe((d) => (this.oldStatus && (this.logger.debug("MembershipManager applied action changes. Status: ".concat(this.oldStatus, " -> ").concat(this.status)), this.oldStatus !== this.status && this.emit(zy.StatusChanged, this.oldStatus, this.status)), this.oldStatus = this.status, this.logger.debug("MembershipManager before processing action. status=".concat(this.oldStatus)), this.membershipLoopHandler(d)), this.logger);
    }
    get ownMembership() {
      return this._ownMembership;
    }
    static get defaultState() {
      return {
        hasMemberStateEvent: false,
        delayId: void 0,
        startTime: 0,
        rateLimitRetries: /* @__PURE__ */ new Map(),
        networkErrorRetries: /* @__PURE__ */ new Map(),
        expireUpdateIterations: 1,
        probablyLeft: false
      };
    }
    get networkErrorRetryMs() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.networkErrorRetryMs) !== null && e !== void 0 ? e : 3e3;
    }
    get membershipEventExpiryMs() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.membershipEventExpiryMs) !== null && e !== void 0 ? e : ore;
    }
    get membershipEventExpiryHeadroomMs() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.membershipEventExpiryHeadroomMs) !== null && e !== void 0 ? e : 5e3;
    }
    computeNextExpiryActionTs(e) {
      return this.state.startTime + this.membershipEventExpiryMs * e - this.membershipEventExpiryHeadroomMs;
    }
    get delayedLeaveEventDelayMs() {
      var e, n, r;
      return (e = (n = this.delayedLeaveEventDelayMsOverride) !== null && n !== void 0 ? n : (r = this.joinConfig) === null || r === void 0 ? void 0 : r.delayedLeaveEventDelayMs) !== null && e !== void 0 ? e : 8e3;
    }
    get delayedLeaveEventRestartMs() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.delayedLeaveEventRestartMs) !== null && e !== void 0 ? e : 5e3;
    }
    get maximumRateLimitRetryCount() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.maximumRateLimitRetryCount) !== null && e !== void 0 ? e : 10;
    }
    get maximumNetworkErrorRetryCount() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.maximumNetworkErrorRetryCount) !== null && e !== void 0 ? e : 10;
    }
    get delayedLeaveEventRestartLocalTimeoutMs() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.delayedLeaveEventRestartLocalTimeoutMs) !== null && e !== void 0 ? e : 2e3;
    }
    membershipLoopHandler(e) {
      var n = this;
      return me(function* () {
        switch (e) {
          case Qn.SendDelayedEvent:
            return n.state.delayId ? n.cancelKnownDelayIdBeforeSendDelayedEvent(n.state.delayId) : n.sendOrResendDelayedLeaveEvent();
          case Qn.RestartDelayedEvent:
            return n.state.delayId ? n.restartDelayedEvent(n.state.delayId) : El(Qn.SendDelayedEvent);
          case Qn.SendScheduledDelayedLeaveEvent:
            return n.state.hasMemberStateEvent ? n.state.delayId ? n.sendScheduledDelayedLeaveEventOrFallbackToSendLeaveEvent(n.state.delayId) : El(Qn.SendLeaveEvent) : {
              replace: []
            };
          case Qn.SendJoinEvent:
            return n.sendJoinEvent();
          case Qn.UpdateExpiry:
            return n.updateExpiryOnJoinedEvent();
          case Qn.SendLeaveEvent:
            return n.state.hasMemberStateEvent ? n.sendFallbackLeaveEvent() : {
              replace: []
            };
        }
      })();
    }
    sendOrResendDelayedLeaveEvent() {
      var e = this;
      return me(function* () {
        return yield e.client._unstable_sendDelayedStateEvent(e.room.roomId, {
          delay: e.delayedLeaveEventDelayMs
        }, ce.GroupCallMemberPrefix, {}, e.stateKey).then((n) => (e.state.expectedServerDelayLeaveTs = Date.now() + e.delayedLeaveEventDelayMs, e.setAndEmitProbablyLeft(false), e.resetRateLimitCounter(Qn.SendDelayedEvent), e.state.delayId = n.delay_id, e.state.hasMemberStateEvent ? El(Qn.RestartDelayedEvent, e.delayedLeaveEventRestartMs) : El(Qn.SendJoinEvent))).catch((n) => {
          var r = Qn.SendDelayedEvent;
          if (e.manageMaxDelayExceededSituation(n)) return El(r);
          var i = e.actionUpdateFromErrors(n, r, "sendDelayedStateEvent");
          if (i) return i;
          if (e.state.hasMemberStateEvent) {
            if (e.isUnsupportedDelayedEndpoint(n)) return {};
            throw Error("Could not send delayed event, even though delayed events are supported. " + n);
          } else return e.isUnsupportedDelayedEndpoint(n) ? e.logger.info("Not using delayed event because the endpoint is not supported") : e.logger.info("Not using delayed event because: " + n), El(Qn.SendJoinEvent);
        });
      })();
    }
    cancelKnownDelayIdBeforeSendDelayedEvent(e) {
      var n = this;
      return me(function* () {
        return yield n.client._unstable_updateDelayedEvent(e, Ny.Cancel).then(() => (n.state.delayId = void 0, n.resetRateLimitCounter(Qn.SendDelayedEvent), r9(Qn.SendDelayedEvent))).catch((r) => {
          var i = Qn.SendDelayedEvent, a = n.actionUpdateFromErrors(r, i, "updateDelayedEvent");
          if (a) return a;
          if (n.isNotFoundError(r)) return n.state.delayId = void 0, r9(i);
          if (n.isUnsupportedDelayedEndpoint(r)) return r9(Qn.SendJoinEvent);
          throw Error("We failed to cancel a delayed event where we already had a delay id with an error we cannot automatically handle");
        });
      })();
    }
    setAndEmitProbablyLeft(e) {
      this.state.probablyLeft !== e && (this.state.probablyLeft = e, this.emit(zy.ProbablyLeft, this.state.probablyLeft));
    }
    restartDelayedEvent(e) {
      var n = this;
      return me(function* () {
        var r = n.state.expectedServerDelayLeaveTs ? n.state.expectedServerDelayLeaveTs - Date.now() : void 0, i = new Promise((a, s) => {
          setTimeout(() => {
            s(new nne("Restart delayed event timed out before the HS responded"));
          }, r !== void 0 && !n.state.probablyLeft ? Math.min(n.delayedLeaveEventRestartLocalTimeoutMs, r) : n.delayedLeaveEventRestartLocalTimeoutMs);
        });
        return yield Promise.race([
          n.client._unstable_updateDelayedEvent(e, Ny.Restart),
          i
        ]).then(() => (n.state.expectedServerDelayLeaveTs = Date.now() + n.delayedLeaveEventDelayMs, n.resetRateLimitCounter(Qn.RestartDelayedEvent), n.setAndEmitProbablyLeft(false), El(Qn.RestartDelayedEvent, n.delayedLeaveEventRestartMs))).catch((a) => {
          n.state.expectedServerDelayLeaveTs && n.state.expectedServerDelayLeaveTs <= Date.now() && n.setAndEmitProbablyLeft(true);
          var s = Qn.RestartDelayedEvent;
          if (n.isNotFoundError(a)) return n.state.delayId = void 0, El(Qn.SendDelayedEvent);
          if (n.isUnsupportedDelayedEndpoint(a)) return {};
          var l = n.actionUpdateFromErrors(a, s, "updateDelayedEvent");
          if (l) return l;
          throw Error("Could not restart delayed event, even though delayed events are supported. " + a);
        });
      })();
    }
    sendScheduledDelayedLeaveEventOrFallbackToSendLeaveEvent(e) {
      var n = this;
      return me(function* () {
        return yield n.client._unstable_updateDelayedEvent(e, Ny.Send).then(() => (n.state.hasMemberStateEvent = false, n.resetRateLimitCounter(Qn.SendScheduledDelayedLeaveEvent), {
          replace: []
        })).catch((r) => {
          var i = Qn.SendLeaveEvent;
          if (n.isUnsupportedDelayedEndpoint(r)) return {};
          if (n.isNotFoundError(r)) return n.state.delayId = void 0, El(i);
          var a = n.actionUpdateFromErrors(r, i, "updateDelayedEvent");
          return a || (n.logger.warn("Encountered unexpected error during SendScheduledDelayedLeaveEvent. Falling back to SendLeaveEvent", r), El(i));
        });
      })();
    }
    sendJoinEvent() {
      var e = this;
      return me(function* () {
        return yield e.client.sendStateEvent(e.room.roomId, ce.GroupCallMemberPrefix, e.makeMyMembership(e.membershipEventExpiryMs), e.stateKey).then(() => {
          e.setAndEmitProbablyLeft(false), e.state.startTime = Date.now(), e.state.expireUpdateIterations = 1, e.state.hasMemberStateEvent = true, e.resetRateLimitCounter(Qn.SendJoinEvent);
          var n = e.scheduler.actions.filter((r) => r.type !== Qn.UpdateExpiry && r.type !== Qn.SendJoinEvent);
          return {
            replace: [
              ...n,
              {
                ts: Date.now(),
                type: Qn.RestartDelayedEvent
              },
              {
                ts: e.computeNextExpiryActionTs(e.state.expireUpdateIterations),
                type: Qn.UpdateExpiry
              }
            ]
          };
        }).catch((n) => {
          var r = e.actionUpdateFromErrors(n, Qn.SendJoinEvent, "sendStateEvent");
          if (r) return r;
          throw n;
        });
      })();
    }
    updateExpiryOnJoinedEvent() {
      var e = this;
      return me(function* () {
        var n = e.state.expireUpdateIterations + 1;
        return yield e.client.sendStateEvent(e.room.roomId, ce.GroupCallMemberPrefix, e.makeMyMembership(e.membershipEventExpiryMs * n), e.stateKey).then(() => (e.resetRateLimitCounter(Qn.UpdateExpiry), e.state.expireUpdateIterations = n, {
          insert: [
            {
              ts: e.computeNextExpiryActionTs(n),
              type: Qn.UpdateExpiry
            }
          ]
        })).catch((r) => {
          var i = e.actionUpdateFromErrors(r, Qn.UpdateExpiry, "sendStateEvent");
          if (i) return i;
          throw r;
        });
      })();
    }
    sendFallbackLeaveEvent() {
      var e = this;
      return me(function* () {
        return yield e.client.sendStateEvent(e.room.roomId, ce.GroupCallMemberPrefix, {}, e.stateKey).then(() => (e.resetRateLimitCounter(Qn.SendLeaveEvent), e.state.hasMemberStateEvent = false, {
          replace: []
        })).catch((n) => {
          var r = e.actionUpdateFromErrors(n, Qn.SendLeaveEvent, "sendStateEvent");
          if (r) return r;
          throw n;
        });
      })();
    }
    makeMembershipStateKey(e, n) {
      var r = "".concat(e, "_").concat(n, "_").concat(this.sessionDescription.application).concat(this.sessionDescription.id);
      return /^org\.matrix\.msc(3757|3779)\b/.exec(this.room.getVersion()) ? r : "_".concat(r);
    }
    makeMyMembership(e) {
      var n, r, i = !!this.ownMembership;
      return wDe({
        application: this.sessionDescription.application,
        call_id: this.sessionDescription.id,
        scope: "m.room",
        device_id: this.deviceId,
        expires: e,
        focus_active: {
          type: "livekit",
          focus_selection: "oldest_membership"
        },
        foci_preferred: (n = this.fociPreferred) !== null && n !== void 0 ? n : [],
        "m.call.intent": this.callIntent
      }, i ? {
        created_ts: (r = this.ownMembership) === null || r === void 0 ? void 0 : r.createdTs()
      } : void 0);
    }
    isNotFoundError(e) {
      return e instanceof Un && e.errcode === "M_NOT_FOUND";
    }
    manageMaxDelayExceededSituation(e) {
      if (e instanceof Un && e.errcode === "M_UNKNOWN" && e.data["org.matrix.msc4140.errcode"] === "M_MAX_DELAY_EXCEEDED") {
        var n = e.data["org.matrix.msc4140.max_delay"];
        return typeof n == "number" && this.delayedLeaveEventDelayMs > n && (this.delayedLeaveEventDelayMsOverride = n), this.logger.warn("Retry sending delayed disconnection event due to server timeout limitations:", e), true;
      }
      return false;
    }
    actionUpdateFromErrors(e, n, r) {
      var i = this.actionUpdateFromRateLimitError(e, r, n);
      if (i) return i;
      var a = this.actionUpdateFromNetworkErrorRetry(e, n);
      if (a) return a;
    }
    actionUpdateFromRateLimitError(e, n, r) {
      var i;
      if ((e instanceof Vg || e instanceof Un) && e.isRateLimitError()) {
        var a = (i = this.state.rateLimitRetries.get(r)) !== null && i !== void 0 ? i : 0;
        if (a < this.maximumRateLimitRetryCount) {
          var s, l = 5e3;
          try {
            var c;
            s = (c = e.getRetryAfterMs()) !== null && c !== void 0 ? c : l, this.logger.info("Rate limited by server, retrying in ".concat(s, "ms"));
          } catch (d) {
            this.logger.warn("Error while retrieving a rate-limit retry delay, retrying after default delay of ".concat(l), d), s = l;
          }
          return this.state.rateLimitRetries.set(r, a + 1), El(r, s);
        }
        throw Error("Exceeded maximum retries for " + r + " attempts (client." + n + "): " + e);
      }
    }
    actionUpdateFromNetworkErrorRetry(e, n) {
      var r, i = (r = this.state.networkErrorRetries.get(n)) !== null && r !== void 0 ? r : 0, a = this.networkErrorRetryMs / 1e3 + "s", s = "(" + i + "/" + this.maximumNetworkErrorRetryCount + ")", l = this.networkErrorRetryMs;
      if (e instanceof Error && e.name === "AbortError") l = 0, this.logger.warn("Network local timeout error while sending event, immediate retry (" + s + ")", e);
      else if (e instanceof Error && e.message.includes("updating delayed event")) this.logger.warn("delayed event update timeout error, retrying in " + a + " " + s, e);
      else if (e instanceof vp) this.logger.warn("Network connection error while sending event, retrying in " + a + " " + s, e);
      else if ((e instanceof Vg || e instanceof Un) && typeof e.httpStatus == "number" && e.httpStatus >= 500 && e.httpStatus < 600) this.logger.warn("Server error while sending event, retrying in " + a + " " + s, e);
      else return;
      if (i < this.maximumNetworkErrorRetryCount) return this.state.networkErrorRetries.set(n, i + 1), El(n, l);
      throw Error("Reached maximum (" + this.maximumNetworkErrorRetryCount + ") retries cause by: " + e);
    }
    isUnsupportedDelayedEndpoint(e) {
      return e instanceof Ff;
    }
    resetRateLimitCounter(e) {
      this.state.rateLimitRetries.set(e, 0), this.state.networkErrorRetries.set(e, 0);
    }
    get status() {
      var e = this.scheduler.actions;
      if (e.length === 1) {
        var { type: n } = e[0];
        switch (n) {
          case Qn.SendDelayedEvent:
          case Qn.SendJoinEvent:
            return km.Connecting;
          case Qn.UpdateExpiry:
            return km.Connected;
          case Qn.SendScheduledDelayedLeaveEvent:
          case Qn.SendLeaveEvent:
            return km.Disconnecting;
        }
      } else if (e.length === 2) {
        var r = e.map((a) => a.type);
        if ((r.includes(Qn.RestartDelayedEvent) || r.includes(Qn.SendDelayedEvent) && this.state.hasMemberStateEvent) && r.includes(Qn.UpdateExpiry)) return km.Connected;
      } else if (e.length === 3) {
        var i = e.map((a) => a.type);
        if (i.filter((a) => a === Qn.RestartDelayedEvent).length === 2 && i.includes(Qn.UpdateExpiry)) return km.Connected;
      }
      return this.scheduler.running ? (this.logger.error("MembershipManager has an unknown state. Actions: ", e), km.Unknown) : km.Disconnected;
    }
    get probablyLeft() {
      return this.state.probablyLeft;
    }
  }
  function El(t, e) {
    return {
      insert: [
        {
          ts: Date.now() + (e ?? 0),
          type: t
        }
      ]
    };
  }
  function r9(t, e) {
    return {
      replace: [
        {
          ts: Date.now() + 0,
          type: t
        }
      ]
    };
  }
  var Ad = (function(t) {
    return t.ReceivedKeys = "received_keys", t.NotSupportedError = "not_supported_error", t;
  })({});
  class DDe {
    constructor() {
      $(this, "tsBuffer", /* @__PURE__ */ new Map());
    }
    isOutdated(e, n) {
      var r;
      this.tsBuffer.has(e) || this.tsBuffer.set(e, /* @__PURE__ */ new Map());
      var i = (r = this.tsBuffer.get(e)) === null || r === void 0 ? void 0 : r.get(n.keyIndex);
      return i && i > n.creationTS ? true : (this.tsBuffer.get(e).set(n.keyIndex, n.creationTS), false);
    }
  }
  function Cg(t, e) {
    return "".concat(t, ":").concat(e);
  }
  class are extends Error {
    constructor(e) {
      super(e);
    }
    get name() {
      return "NotSupportedError";
    }
  }
  class CDe extends ji {
    setParentLogger(e) {
      this.logger = e.getChild("[ToDeviceKeyTransport]");
    }
    constructor(e, n, r, i, a, s) {
      super(), this.userId = e, this.deviceId = n, this.roomId = r, this.client = i, this.statistics = a, $(this, "logger", _e), $(this, "onToDeviceEvent", (l) => {
        if (l.getType() === ce.CallEncryptionKeysPrefix) {
          var c = this.getValidEventContent(l);
          c && l.getSender() && this.receiveCallKeyEvent(l.getSender(), c);
        }
      }), this.setParentLogger(s ?? _e);
    }
    start() {
      this.client.on(jt.ToDeviceEvent, this.onToDeviceEvent);
    }
    stop() {
      this.client.off(jt.ToDeviceEvent, this.onToDeviceEvent);
    }
    sendKey(e, n, r) {
      var i = this;
      return me(function* () {
        var a = {
          keys: {
            index: n,
            key: e
          },
          room_id: i.roomId,
          member: {
            claimed_device_id: i.deviceId
          },
          session: {
            call_id: "",
            application: "m.call",
            scope: "m.room"
          },
          sent_ts: Date.now()
        }, s = r.map((l) => ({
          userId: l.userId,
          deviceId: l.deviceId
        })).filter((l) => !(l.userId == i.userId && l.deviceId == i.deviceId));
        s.length > 0 ? (yield i.client.encryptAndSendToDevice(ce.CallEncryptionKeysPrefix, s, a).catch((l) => {
          var c = l.message;
          if (c.includes("unknown variant") && c.includes("send_to_device") || c.includes("not supported")) throw new are("The widget driver does not support to-device encryption");
        }), i.statistics.counters.roomEventEncryptionKeysSent += 1) : i.logger.warn("No targets found for sending key");
      })();
    }
    receiveCallKeyEvent(e, n) {
      this.statistics.counters.roomEventEncryptionKeysReceived += 1;
      var r = Date.now(), i = r - (typeof n.sent_ts == "number" ? n.sent_ts : r);
      this.statistics.totals.roomEventEncryptionKeysReceivedTotalAge += i, this.emit(Ad.ReceivedKeys, e, n.member.claimed_device_id, n.keys.key, n.keys.index, r);
    }
    getValidEventContent(e) {
      var n = e.getContent(), r = n.room_id;
      if (!r) {
        this.logger.warn("Malformed Event: invalid call encryption keys event, no roomId");
        return;
      }
      if (r !== this.roomId) {
        this.logger.warn("Malformed Event: Mismatch roomId");
        return;
      }
      if (!n.keys || !n.keys.key || typeof n.keys.index != "number") {
        this.logger.warn("Malformed Event: Missing keys field");
        return;
      }
      if (!n.member || !n.member.claimed_device_id) {
        this.logger.warn("Malformed Event: Missing claimed_device_id");
        return;
      }
      return n;
    }
  }
  var hk = (function(t) {
    return t.EnabledTransportsChanged = "enabled_transports_changed", t;
  })({});
  class cB extends ji {
    constructor(e, n, r) {
      var i;
      super(), i = this, this.toDeviceTransport = e, this.roomKeyTransport = n, $(this, "logger", void 0), $(this, "_enabled", {
        toDevice: true,
        room: false
      }), this.logger = (r ?? _e).getChild("[RoomAndToDeviceTransport]"), this.toDeviceTransport.setParentLogger(this.logger), this.roomKeyTransport.setParentLogger(this.logger), this.roomKeyTransport.on(Ad.ReceivedKeys, function() {
        i._enabled.room || (i.logger.debug("Received room key, enabling room key transport, disabling toDevice transport"), i.setEnabled({
          toDevice: false,
          room: true
        }));
        for (var a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
        i.emit(Ad.ReceivedKeys, ...s);
      }), this.toDeviceTransport.on(Ad.ReceivedKeys, function() {
        if (i._enabled.toDevice) {
          for (var a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
          i.emit(Ad.ReceivedKeys, ...s);
        } else i.logger.debug("To Device transport is disabled, ignoring received keys");
      });
    }
    setEnabled(e) {
      (this.enabled.toDevice !== e.toDevice || this.enabled.room !== e.room) && (this._enabled = e, this.emit(hk.EnabledTransportsChanged, e));
    }
    get enabled() {
      return this._enabled;
    }
    start() {
      this.roomKeyTransport.start(), this.toDeviceTransport.start();
    }
    stop() {
      this.roomKeyTransport.stop(), this.toDeviceTransport.stop();
    }
    sendKey(e, n, r) {
      var i = this;
      return me(function* () {
        if (i.logger.debug("Sending key with index ".concat(n, " to call members (count=").concat(r.length, ") via:") + (i._enabled.room ? "room transport" : "") + (i._enabled.room && i._enabled.toDevice ? "and" : "") + (i._enabled.toDevice ? "to device transport" : "")), i._enabled.room && (yield i.roomKeyTransport.sendKey(e, n, r)), i._enabled.toDevice) try {
          yield i.toDeviceTransport.sendKey(e, n, r);
        } catch (a) {
          a instanceof are && !i._enabled.room && (i.logger.warn("To device is not supported enabling room key transport, disabling toDevice transport"), i.setEnabled({
            toDevice: false,
            room: true
          }), yield i.sendKey(e, n, r));
        }
      })();
    }
  }
  class EDe {
    get updateEncryptionKeyThrottle() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.updateEncryptionKeyThrottle) !== null && e !== void 0 ? e : 3e3;
    }
    get makeKeyDelay() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.makeKeyDelay) !== null && e !== void 0 ? e : 3e3;
    }
    get useKeyDelay() {
      var e, n;
      return (e = (n = this.joinConfig) === null || n === void 0 ? void 0 : n.useKeyDelay) !== null && e !== void 0 ? e : 5e3;
    }
    constructor(e, n, r, i, a, s, l) {
      var c = this;
      this.userId = e, this.deviceId = n, this.getMemberships = r, this.transport = i, this.statistics = a, this.onEncryptionKeysChanged = s, $(this, "manageMediaKeys", false), $(this, "keysEventUpdateTimeout", void 0), $(this, "makeNewKeyTimeout", void 0), $(this, "setNewKeyTimeouts", /* @__PURE__ */ new Set()), $(this, "encryptionKeys", /* @__PURE__ */ new Map()), $(this, "lastEncryptionKeyUpdateRequest", void 0), $(this, "lastMembershipFingerprints", void 0), $(this, "latestGeneratedKeyIndex", -1), $(this, "joinConfig", void 0), $(this, "logger", void 0), $(this, "joined", false), $(this, "sendEncryptionKeysEvent", (function() {
        var d = me(function* (u) {
          if (c.keysEventUpdateTimeout !== void 0 && (clearTimeout(c.keysEventUpdateTimeout), c.keysEventUpdateTimeout = void 0), c.lastEncryptionKeyUpdateRequest = Date.now(), !!c.joined) {
            var h = c.getKeysForParticipant(c.userId, c.deviceId);
            if (!h) {
              c.logger.warn("Tried to send encryption keys event but no keys found!");
              return;
            }
            if (typeof u != "number" && c.latestGeneratedKeyIndex === -1) {
              c.logger.warn("Tried to send encryption keys event but no current key index found!");
              return;
            }
            var f = u ?? c.latestGeneratedKeyIndex;
            c.logger.info("Try sending encryption keys event. keyIndexToSend=".concat(f, " (method parameter: ").concat(u, ")"));
            var g = h[f];
            try {
              c.statistics.counters.roomEventEncryptionKeysSent += 1;
              var m = c.getMemberships().filter((y) => y.sender != null).map((y) => ({
                userId: y.sender,
                deviceId: y.deviceId,
                membershipTs: y.createdTs()
              }));
              yield c.transport.sendKey(Yne(g), f, m), c.logger.debug("sendEncryptionKeysEvent participantId=".concat(c.userId, ":").concat(c.deviceId, " numKeys=").concat(h.length, " currentKeyIndex=").concat(c.latestGeneratedKeyIndex, " keyIndexToSend=").concat(f));
            } catch (y) {
              if (c.keysEventUpdateTimeout === void 0) {
                var v = J7(y, 5e3);
                c.logger.warn("Failed to send m.call.encryption_key, retrying in ".concat(v), y), c.keysEventUpdateTimeout = setTimeout(() => {
                  c.sendEncryptionKeysEvent();
                }, v);
              } else c.logger.info("Not scheduling key resend as another re-send is already pending");
            }
          }
        });
        return function(u) {
          return d.apply(this, arguments);
        };
      })()), $(this, "onTransportChanged", () => {
        this.requestSendCurrentKey();
      }), $(this, "onNewKeyReceived", (d, u, h, f, g) => {
        this.logger.debug("Received key over key transport ".concat(d, ":").concat(u, " at index ").concat(f)), this.setEncryptionKey(d, u, f, h, g);
      }), $(this, "onRotateKeyTimeout", () => {
        if (this.manageMediaKeys) {
          this.makeNewKeyTimeout = void 0, this.logger.info("Making new sender key for key rotation");
          var d = this.makeNewSenderKey(true);
          this.sendEncryptionKeysEvent(d);
        }
      }), this.logger = (l ?? _e).getChild("[EncryptionManager]");
    }
    getEncryptionKeys() {
      var e = /* @__PURE__ */ new Map();
      for (var [n, r] of this.encryptionKeys) {
        var i = r.map((a, s) => ({
          key: a.key,
          keyIndex: s
        }));
        e.set(n, i);
      }
      return e;
    }
    join(e) {
      var n, r, i;
      this.joinConfig = e, this.joined = true, this.manageMediaKeys = (n = (r = this.joinConfig) === null || r === void 0 ? void 0 : r.manageMediaKeys) !== null && n !== void 0 ? n : this.manageMediaKeys, this.transport.on(Ad.ReceivedKeys, this.onNewKeyReceived), this.transport instanceof cB && this.transport.on(hk.EnabledTransportsChanged, this.onTransportChanged), this.transport.start(), (i = this.joinConfig) !== null && i !== void 0 && i.manageMediaKeys && (this.makeNewSenderKey(), this.requestSendCurrentKey());
    }
    leave() {
      this.encryptionKeys.set(Cg(this.userId, this.deviceId), []), this.transport.off(Ad.ReceivedKeys, this.onNewKeyReceived), this.transport.stop(), this.makeNewKeyTimeout !== void 0 && (clearTimeout(this.makeNewKeyTimeout), this.makeNewKeyTimeout = void 0);
      for (var e of this.setNewKeyTimeouts) clearTimeout(e);
      this.setNewKeyTimeouts.clear(), this.manageMediaKeys = false, this.joined = false;
    }
    onMembershipsUpdate(e) {
      if (this.manageMediaKeys && this.joined) {
        var n = new Set(e.filter((d) => !ED(d, this.userId, this.deviceId)).map(i9)), r = new Set(this.getMemberships().filter((d) => !ED(d, this.userId, this.deviceId)).map(i9)), i = Array.from(n).some((d) => !r.has(d)), a = Array.from(r).some((d) => !n.has(d)), s = this.lastMembershipFingerprints;
        if (this.storeLastMembershipFingerprints(), i) this.makeNewKeyTimeout || (this.logger.debug("Member(s) have left: queueing sender key rotation"), this.makeNewKeyTimeout = setTimeout(this.onRotateKeyTimeout, this.makeKeyDelay));
        else if (a) this.logger.debug("New member(s) have joined: re-sending keys"), this.requestSendCurrentKey();
        else if (s) {
          var l = this.lastMembershipFingerprints, c = Array.from(s).some((d) => !l.has(d)) || Array.from(l).some((d) => !s.has(d));
          c && (this.logger.debug("Member(s) have updated/reconnected: re-sending keys to everyone"), this.requestSendCurrentKey());
        }
      }
    }
    makeNewSenderKey() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, n = vwe(16), r = this.getNewEncryptionKeyIndex();
      return this.logger.info("Generated new key at index " + r), this.setEncryptionKey(this.userId, this.deviceId, r, n, Date.now(), e), r;
    }
    requestSendCurrentKey() {
      if (this.manageMediaKeys) {
        if (this.lastEncryptionKeyUpdateRequest && this.lastEncryptionKeyUpdateRequest + this.updateEncryptionKeyThrottle > Date.now()) {
          this.logger.info("Last encryption key event sent too recently: postponing"), this.keysEventUpdateTimeout === void 0 && (this.keysEventUpdateTimeout = setTimeout(() => {
            this.sendEncryptionKeysEvent();
          }, this.updateEncryptionKeyThrottle));
          return;
        }
        this.sendEncryptionKeysEvent();
      }
    }
    getKeysForParticipant(e, n) {
      var r;
      return (r = this.encryptionKeys.get(Cg(e, n))) === null || r === void 0 ? void 0 : r.map((i) => i.key);
    }
    storeLastMembershipFingerprints() {
      this.lastMembershipFingerprints = new Set(this.getMemberships().filter((e) => !ED(e, this.userId, this.deviceId)).map((e) => "".concat(i9(e), ":").concat(e.createdTs())));
    }
    getNewEncryptionKeyIndex() {
      return this.latestGeneratedKeyIndex === -1 ? 0 : (this.latestGeneratedKeyIndex + 1) % 256;
    }
    setEncryptionKey(e, n, r, i, a) {
      var s = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
      this.logger.debug("Setting encryption key for ".concat(e, ":").concat(n, " at index ").concat(r));
      var l = wg(i), c = Cg(e, n);
      this.encryptionKeys.has(c) || this.encryptionKeys.set(c, []);
      var d = this.encryptionKeys.get(c), u = d[r];
      if (u) {
        if (u.timestamp > a) {
          this.logger.info("Ignoring new key at index ".concat(r, " for ").concat(c, " as it is older than existing known key"));
          return;
        }
        if (kDe(u.key, l)) {
          u.timestamp = a;
          return;
        }
      }
      if (e === this.userId && n === this.deviceId && (this.latestGeneratedKeyIndex = r), d[r] = {
        key: l,
        timestamp: a
      }, s) {
        var h = setTimeout(() => {
          this.setNewKeyTimeouts.delete(h), this.logger.info("Delayed-emitting key changed event for ".concat(c, " index ").concat(r)), this.onEncryptionKeysChanged(l, r, c);
        }, this.useKeyDelay);
        this.setNewKeyTimeouts.add(h);
      } else this.onEncryptionKeysChanged(l, r, c);
    }
  }
  function kDe(t, e) {
    return t === e ? true : !!t && !!e && t.length === e.length && t.every((n, r) => n === e[r]);
  }
  var i9 = (t) => Cg(t.sender, t.deviceId);
  class t$ extends ji {
    setParentLogger(e) {
      this.logger = e.getChild("[RoomKeyTransport]");
    }
    constructor(e, n, r, i) {
      super(), this.room = e, this.client = n, this.statistics = r, $(this, "logger", _e), this.setParentLogger(i ?? _e);
    }
    start() {
      this.room.on(mt.Timeline, (e) => {
        this.consumeCallEncryptionEvent(e);
      });
    }
    stop() {
      this.room.off(mt.Timeline, (e) => {
        this.consumeCallEncryptionEvent(e);
      });
    }
    consumeCallEncryptionEvent(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : false;
        if (yield r.client.decryptEventIfNeeded(e), e.isDecryptionFailure()) {
          i ? r.logger.warn("Decryption failed for event ".concat(e.getId(), ": ").concat(e.decryptionFailureReason)) : (r.logger.warn("Decryption failed for event ".concat(e.getId(), ": ").concat(e.decryptionFailureReason, " will retry once only")), setTimeout(() => {
            r.consumeCallEncryptionEvent(e, true);
          }, 1e3));
          return;
        } else i && r.logger.info("Decryption succeeded for event ".concat(e.getId(), " after retry"));
        if (e.getType() !== ce.CallEncryptionKeysPrefix) return Promise.resolve();
        if (!r.room) return r.logger.error("Got room state event for unknown room ".concat(e.getRoomId(), "!")), Promise.resolve();
        r.onEncryptionEvent(e);
      })();
    }
    sendKey(e, n, r) {
      var i = this;
      return me(function* () {
        var a = {
          keys: [
            {
              index: n,
              key: e
            }
          ],
          device_id: i.client.getDeviceId(),
          call_id: "",
          sent_ts: Date.now()
        };
        try {
          yield i.client.sendEvent(i.room.roomId, ce.CallEncryptionKeysPrefix, a);
        } catch (l) {
          i.logger.error("Failed to send call encryption keys", l);
          var s = l;
          throw s.event && i.client.cancelPendingEvent(s.event), l;
        }
      })();
    }
    onEncryptionEvent(e) {
      var n = e.getSender(), r = e.getContent(), i = r.device_id, a = r.call_id;
      if (!n) {
        this.logger.warn("Received m.call.encryption_keys with no userId: callId=".concat(a));
        return;
      }
      if (a !== "") {
        this.logger.warn("Received m.call.encryption_keys with unsupported callId: userId=".concat(n, ", deviceId=").concat(i, ", callId=").concat(a));
        return;
      }
      if (!Array.isArray(r.keys)) {
        this.logger.warn("Received m.call.encryption_keys where keys wasn't an array: callId=".concat(a));
        return;
      }
      if (n === this.client.getUserId() && i === this.client.getDeviceId()) {
        this.logger.info("Ignoring our own keys event");
        return;
      }
      this.statistics.counters.roomEventEncryptionKeysReceived += 1;
      var s = Date.now() - (typeof r.sent_ts == "number" ? r.sent_ts : e.getTs());
      this.statistics.totals.roomEventEncryptionKeysReceivedTotalAge += s;
      for (var l of r.keys) {
        if (!l) {
          this.logger.info("Ignoring false-y key in keys event");
          continue;
        }
        var c = l.key, d = l.index;
        !c || d === void 0 || d === null || a === void 0 || a === null || typeof i != "string" || typeof a != "string" || typeof c != "string" || typeof d != "number" ? this.logger.warn("Malformed call encryption_key: userId=".concat(n, ", deviceId=").concat(i, ", encryptionKeyIndex=").concat(d, " callId=").concat(a)) : (this.logger.debug("onCallEncryption userId=".concat(n, ":").concat(i, " encryptionKeyIndex=").concat(d, " age=").concat(s, "ms")), this.emit(Ad.ReceivedKeys, n, i, c, d, e.getTs()));
      }
    }
  }
  class SDe {
    constructor(e, n, r, i, a, s, l) {
      this.userId = e, this.deviceId = n, this.getMemberships = r, this.transport = i, this.statistics = a, this.onEncryptionKeysChanged = s, $(this, "manageMediaKeys", false), $(this, "participantKeyRings", /* @__PURE__ */ new Map()), $(this, "outboundSession", null), $(this, "currentKeyDistributionPromise", null), $(this, "useKeyDelay", 5e3), $(this, "keyRotationGracePeriodMs", 1e4), $(this, "needToEnsureKeyAgain", false), $(this, "keyBuffer", new DDe()), $(this, "logger", void 0), $(this, "onTransportChanged", () => {
        var c;
        (c = this.logger) === null || c === void 0 || c.info("Transport change detected, restarting key distribution"), this.currentKeyDistributionPromise ? this.currentKeyDistributionPromise.then(() => {
          this.outboundSession && (this.outboundSession.sharedWith = [], this.ensureKeyDistribution());
        }).catch((d) => {
          var u;
          (u = this.logger) === null || u === void 0 || u.error("Failed to restart key distribution", d);
        }) : this.outboundSession && (this.outboundSession.sharedWith = [], this.ensureKeyDistribution());
      }), $(this, "onNewKeyReceived", (c, d, u, h, f) => {
        var g;
        if (!this.manageMediaKeys) {
          var m;
          (m = this.logger) === null || m === void 0 || m.warn("Received key over transport ".concat(c, ":").concat(d, " at index ").concat(h, " but media keys are disabled"));
          return;
        }
        (g = this.logger) === null || g === void 0 || g.debug("Received key over transport ".concat(c, ":").concat(d, " at index ").concat(h));
        var v = Cg(c, d), y = wg(u), w = {
          key: y,
          participantId: v,
          keyIndex: h,
          creationTS: f
        }, b = this.keyBuffer.isOutdated(v, w);
        if (!b) this.addKeyToParticipant(w.key, w.keyIndex, w.participantId), this.statistics.counters.roomEventEncryptionKeysReceived += 1;
        else {
          var j;
          (j = this.logger) === null || j === void 0 || j.info("Received an out of order key for ".concat(c, ":").concat(d, ", dropping it"));
        }
      }), this.logger = l == null ? void 0 : l.getChild("[EncryptionManager]");
    }
    getEncryptionKeys() {
      return new Map(this.participantKeyRings);
    }
    addKeyToParticipant(e, n, r) {
      this.participantKeyRings.has(r) || this.participantKeyRings.set(r, []), this.participantKeyRings.get(r).push({
        key: e,
        keyIndex: n
      }), this.onEncryptionKeysChanged(e, n, r);
    }
    join(e) {
      var n, r, i, a;
      this.manageMediaKeys = (n = e == null ? void 0 : e.manageMediaKeys) !== null && n !== void 0 ? n : true, (r = this.logger) === null || r === void 0 || r.info("Joining room"), this.useKeyDelay = (i = e == null ? void 0 : e.useKeyDelay) !== null && i !== void 0 ? i : 1e3, this.keyRotationGracePeriodMs = (a = e == null ? void 0 : e.keyRotationGracePeriodMs) !== null && a !== void 0 ? a : 1e4, this.transport.on(Ad.ReceivedKeys, this.onNewKeyReceived), this.transport instanceof cB && this.transport.on(hk.EnabledTransportsChanged, this.onTransportChanged), this.transport.start();
    }
    leave() {
      this.transport.off(Ad.ReceivedKeys, this.onNewKeyReceived), this.transport.stop(), this.participantKeyRings.clear();
    }
    ensureKeyDistribution() {
      if (this.manageMediaKeys) if (this.currentKeyDistributionPromise == null) {
        var e;
        (e = this.logger) === null || e === void 0 || e.debug("No active rollout, start a new one"), this.currentKeyDistributionPromise = this.rolloutOutboundKey().then(() => {
          var r;
          if ((r = this.logger) === null || r === void 0 || r.debug("Rollout completed"), this.currentKeyDistributionPromise = null, this.needToEnsureKeyAgain) {
            var i;
            (i = this.logger) === null || i === void 0 || i.debug("New Rollout needed"), this.needToEnsureKeyAgain = false, this.ensureKeyDistribution();
          }
        });
      } else {
        var n;
        (n = this.logger) === null || n === void 0 || n.debug("Rollout in progress, a new rollout will be started after the current one"), this.needToEnsureKeyAgain = true;
      }
    }
    onMembershipsUpdate() {
      var e;
      (e = this.logger) === null || e === void 0 || e.trace("onMembershipsUpdate"), this.ensureKeyDistribution();
    }
    rolloutOutboundKey() {
      var e = this;
      return me(function* () {
        var n, r, i = e.outboundSession == null;
        i && (e.outboundSession = {
          key: e.generateRandomKey(),
          creationTS: Date.now(),
          sharedWith: [],
          keyId: 0
        }, e.addKeyToParticipant(e.outboundSession.key, e.outboundSession.keyId, Cg(e.userId, e.deviceId)));
        var a = e.getMemberships().filter((S) => S.sender != null).map((S) => ({
          userId: S.sender,
          deviceId: S.deviceId,
          membershipTs: S.createdTs()
        })), s = (n = (r = e.outboundSession) === null || r === void 0 ? void 0 : r.sharedWith) !== null && n !== void 0 ? n : [];
        s = s.filter((S) => !a.some((T) => S.userId == T.userId && S.deviceId == T.deviceId && S.membershipTs != T.membershipTs));
        var l = s.filter((S) => !a.some((T) => S.userId == T.userId && S.deviceId == T.deviceId && S.membershipTs == T.membershipTs)), c = a.filter((S) => !s.some((T) => S.userId == T.userId && S.deviceId == T.deviceId && S.membershipTs == T.membershipTs)), d = [], u, h = false;
        if (l.length > 0) {
          var f = e.createNewOutboundSession();
          h = true, d = a, u = f;
        } else if (c.length > 0) {
          var g = Date.now(), m = g - e.outboundSession.creationTS;
          if (m < e.keyRotationGracePeriodMs) {
            var v;
            (v = e.logger) === null || v === void 0 || v.debug("New joiners detected, but the key is recent enough (age:".concat(m, "), keeping it")), d = c, u = e.outboundSession;
          } else {
            var y;
            (y = e.logger) === null || y === void 0 || y.debug("New joiners detected, rotating the key");
            var w = e.createNewOutboundSession();
            h = true, d = a, u = w;
          }
        } else return;
        try {
          var b, j;
          if ((b = e.logger) === null || b === void 0 || b.trace("Sending key..."), yield e.transport.sendKey(Py(u.key), u.keyId, d), e.statistics.counters.roomEventEncryptionKeysSent += 1, u.sharedWith.push(...d), (j = e.logger) === null || j === void 0 || j.trace("key index:".concat(u.keyId, " sent to ").concat(u.sharedWith.map((S) => "".concat(S.userId, ":").concat(S.deviceId)).join(","))), h) {
            var k, C;
            (k = e.logger) === null || k === void 0 || k.trace("Delay Rollout for key:".concat(u.keyId, "...")), yield Ug(e.useKeyDelay), (C = e.logger) === null || C === void 0 || C.trace("...Delayed rollout of index:".concat(u.keyId, " ")), e.addKeyToParticipant(u.key, u.keyId, Cg(e.userId, e.deviceId));
          }
        } catch (S) {
          var x;
          (x = e.logger) === null || x === void 0 || x.error("Failed to rollout key", S);
        }
      })();
    }
    createNewOutboundSession() {
      var e, n = {
        key: this.generateRandomKey(),
        creationTS: Date.now(),
        sharedWith: [],
        keyId: this.nextKeyIndex()
      };
      return (e = this.logger) === null || e === void 0 || e.info("creating new outbound key index:".concat(n.keyId)), this.outboundSession = n, n;
    }
    nextKeyIndex() {
      return this.outboundSession ? (this.outboundSession.keyId + 1) % 256 : 0;
    }
    generateRandomKey() {
      var e = new Uint8Array(16);
      return globalThis.crypto.getRandomValues(e), e;
    }
  }
  function n$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function tw(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? n$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : n$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Js = (function(t) {
    return t.MembershipsChanged = "memberships_changed", t.JoinStateChanged = "join_state_changed", t.EncryptionKeyChanged = "encryption_key_changed", t.MembershipManagerError = "membership_manager_error", t.DidSendCallNotification = "did_send_call_notification", t;
  })({});
  class rl extends ji {
    get membershipStatus() {
      var e;
      return (e = this.membershipManager) === null || e === void 0 ? void 0 : e.status;
    }
    get probablyLeft() {
      var e;
      return (e = this.membershipManager) === null || e === void 0 ? void 0 : e.probablyLeft;
    }
    get callId() {
      return this._callId;
    }
    static callMembershipsForRoom(e) {
      return rl.sessionMembershipsForRoom(e, {
        id: "",
        application: "m.call"
      });
    }
    static sessionMembershipsForRoom(e, n) {
      var r = _e.getChild("[MatrixRTCSession ".concat(e.roomId, "]")), i = e.getLiveTimeline().getState(en.FORWARDS);
      if (!i) throw r.warn("Couldn't get state for room " + e.roomId), new Error("Could't get state for room " + e.roomId);
      var a = i.getStateEvents(ce.GroupCallMemberPrefix), s = [];
      for (var l of a) {
        var c = l.getContent(), d = Object.keys(c).length;
        if (d !== 0) {
          var u = [];
          if (d > 1 && "focus_active" in c ? u.push(c) : d === 1 && "memberships" in c && r.warn("Legacy event found. Those are ignored, they do not contribute to the MatrixRTC session"), u.length !== 0) for (var h of u) try {
            var f, g = new QH(l, h);
            if (!zg(g.sessionDescription, n)) {
              r.info("Ignoring membership of user ".concat(g.sender, " for a different session:  ").concat(JSON.stringify(g.sessionDescription)));
              continue;
            }
            if (g.isExpired()) {
              r.info("Ignoring expired device membership ".concat(g.sender, "/").concat(g.deviceId));
              continue;
            }
            if (!e.hasMembershipState((f = g.sender) !== null && f !== void 0 ? f : "", Ht.Join)) {
              r.info("Ignoring membership of user ".concat(g.sender, " who is not in the room."));
              continue;
            }
            s.push(g);
          } catch (m) {
            r.warn("Couldn't construct call membership: ", m);
          }
        }
      }
      return s.sort((m, v) => m.createdTs() - v.createdTs()), s.length > 1 && r.debug("Call memberships in room ".concat(e.roomId, ", in order: "), s.map((m) => [
        m.createdTs(),
        m.sender
      ])), s;
    }
    static roomSessionForRoom(e, n) {
      var r = rl.sessionMembershipsForRoom(n, {
        id: "",
        application: "m.call"
      });
      return new rl(e, n, r, {
        id: "",
        application: "m.call"
      });
    }
    static sessionForRoom(e, n, r) {
      var i = rl.sessionMembershipsForRoom(n, r);
      return new rl(e, n, i, r);
    }
    get room() {
      return this.roomSubset;
    }
    constructor(e, n, r, i) {
      var a;
      super(), this.client = e, this.roomSubset = n, this.memberships = r, this.sessionDescription = i, $(this, "membershipManager", void 0), $(this, "encryptionManager", void 0), $(this, "_callId", void 0), $(this, "joinConfig", void 0), $(this, "logger", void 0), $(this, "pendingNotificationToSend", void 0), $(this, "expiryTimeout", void 0), $(this, "statistics", {
        counters: {
          roomEventEncryptionKeysSent: 0,
          roomEventEncryptionKeysReceived: 0
        },
        totals: {
          roomEventEncryptionKeysReceivedTotalAge: 0
        }
      }), $(this, "reEmitter", new IF(this)), $(this, "onRoomMemberUpdate", () => {
        this.recalculateSessionMembers();
      }), $(this, "onRTCSessionMemberUpdate", () => {
        this.recalculateSessionMembers();
      }), $(this, "recalculateSessionMembers", () => {
        var l, c, d, u = this.memberships;
        this.memberships = rl.sessionMembershipsForRoom(this.room, this.sessionDescription), this._callId = (l = this._callId) !== null && l !== void 0 ? l : (c = this.memberships[0]) === null || c === void 0 ? void 0 : c.sessionDescription.id;
        var h = u.length != this.memberships.length || u.some((y, w) => !QH.equal(y, this.memberships[w]));
        if (h) {
          var f, g;
          this.logger.info("Memberships for call in room ".concat(this.roomSubset.roomId, " have changed: emitting (").concat(this.memberships.length, " members)")), z3e(this.logger, "emit MatrixRTCSessionEvent.MembershipsChanged", () => {
            this.emit(Js.MembershipsChanged, u, this.memberships);
          }), (f = this.membershipManager) === null || f === void 0 || f.onRTCSessionMemberUpdate(this.memberships);
          var m = (g = this.membershipManager) === null || g === void 0 ? void 0 : g.ownMembership;
          if (this.pendingNotificationToSend && m && u.length === 0) {
            var v;
            m.eventId && (v = this.joinConfig) !== null && v !== void 0 && v.notificationType ? this.sendCallNotify(m.eventId, this.joinConfig.notificationType, m.callIntent) : this.logger.warn("Own membership eventId is undefined, cannot send call notification");
          }
          this.memberships.length > 0 && (this.pendingNotificationToSend = void 0);
        }
        (d = this.encryptionManager) === null || d === void 0 || d.onMembershipsUpdate(u), this.setExpiryTimer();
      }), this.logger = _e.getChild("[MatrixRTCSession ".concat(n.roomId, "]")), this._callId = (a = r[0]) === null || a === void 0 ? void 0 : a.sessionDescription.id;
      var s = this.roomSubset.getLiveTimeline().getState(en.FORWARDS);
      s == null ? void 0 : s.on(qn.Members, this.onRoomMemberUpdate), this.setExpiryTimer();
    }
    isJoined() {
      var e, n;
      return (e = (n = this.membershipManager) === null || n === void 0 ? void 0 : n.isJoined()) !== null && e !== void 0 ? e : false;
    }
    stop() {
      var e = this;
      return me(function* () {
        var n;
        yield (n = e.membershipManager) === null || n === void 0 ? void 0 : n.leave(1e3), e.expiryTimeout && (clearTimeout(e.expiryTimeout), e.expiryTimeout = void 0);
        var r = e.roomSubset.getLiveTimeline().getState(en.FORWARDS);
        r == null ? void 0 : r.off(qn.Members, e.onRoomMemberUpdate);
      })();
    }
    joinRoomSession(e, n, r) {
      var i;
      if (this.isJoined()) {
        this.logger.info("Already joined to session in room ".concat(this.roomSubset.roomId, ": ignoring join call"));
        return;
      } else {
        this.membershipManager = new QC(r, this.roomSubset, this.client, () => this.getOldestMembership(), this.sessionDescription, this.logger), this.reEmitter.reEmit(this.membershipManager, [
          zy.ProbablyLeft,
          zy.StatusChanged
        ]);
        var a;
        if (r != null && r.useExperimentalToDeviceTransport) {
          this.logger.info("Using experimental to-device transport for encryption keys"), this.logger.info("Using to-device with room fallback transport for encryption keys");
          var [s, l] = [
            this.client.getUserId(),
            this.client.getDeviceId()
          ], [c, d, u] = [
            this.roomSubset,
            this.client,
            this.statistics
          ], h = new t$(c, d, u), f = new CDe(s, l, c.roomId, d, u);
          a = new cB(f, h, this.logger), this.reEmitter.reEmit(a, [
            hk.EnabledTransportsChanged
          ]), this.encryptionManager = new SDe(this.client.getUserId(), this.client.getDeviceId(), () => this.memberships, a, this.statistics, (g, m, v) => {
            this.emit(Js.EncryptionKeyChanged, g, m, v);
          }, this.logger);
        } else a = new t$(this.roomSubset, this.client, this.statistics), this.encryptionManager = new EDe(this.client.getUserId(), this.client.getDeviceId(), () => this.memberships, a, this.statistics, (g, m, v) => {
          this.emit(Js.EncryptionKeyChanged, g, m, v);
        });
      }
      this.joinConfig = r, this.pendingNotificationToSend = (i = this.joinConfig) === null || i === void 0 ? void 0 : i.notificationType, this.membershipManager.join(e, n, (g) => {
        this.logger.error("MembershipManager encountered an unrecoverable error: ", g), this.emit(Js.MembershipManagerError, g), this.emit(Js.JoinStateChanged, this.isJoined());
      }), this.encryptionManager.join(r), this.emit(Js.JoinStateChanged, true);
    }
    leaveRoomSession() {
      var e = arguments, n = this;
      return me(function* () {
        var r = e.length > 0 && e[0] !== void 0 ? e[0] : void 0;
        if (!n.isJoined()) return n.logger.info("Not joined to session in room ".concat(n.roomSubset.roomId, ": ignoring leave call")), false;
        n.logger.info("Leaving call session in room ".concat(n.roomSubset.roomId)), n.encryptionManager.leave();
        var i = n.membershipManager.leave(r);
        return n.emit(Js.JoinStateChanged, false), yield i;
      })();
    }
    getActiveFocus() {
      var e;
      return (e = this.membershipManager) === null || e === void 0 ? void 0 : e.getActiveFocus();
    }
    getOldestMembership() {
      return this.memberships[0];
    }
    getConsensusCallIntent() {
      var e, n = (e = this.memberships.find((r) => !!r.callIntent)) === null || e === void 0 ? void 0 : e.callIntent;
      if (n && this.memberships.every((r) => !r.callIntent || r.callIntent === n)) return n;
    }
    updateCallIntent(e) {
      var n = this;
      return me(function* () {
        var r, i, a = (r = n.membershipManager) === null || r === void 0 ? void 0 : r.ownMembership;
        if (!a) throw Error("Not connected yet");
        yield (i = n.membershipManager) === null || i === void 0 ? void 0 : i.updateCallIntent(e);
      })();
    }
    getFocusInUse() {
      var e = this.getOldestMembership();
      if ((e == null ? void 0 : e.getFocusSelection()) === "oldest_membership") return e.getPreferredFoci()[0];
    }
    reemitEncryptionKeys() {
      var e;
      (e = this.encryptionManager) === null || e === void 0 || e.getEncryptionKeys().forEach((n, r) => {
        n.forEach((i) => {
          this.emit(Js.EncryptionKeyChanged, i.key, i.keyIndex, r);
        });
      });
    }
    setExpiryTimer() {
      this.expiryTimeout && (clearTimeout(this.expiryTimeout), this.expiryTimeout = void 0);
      var e;
      for (var n of this.memberships) {
        var r = n.getMsUntilExpiry();
        r !== void 0 && (e === void 0 || r < e) && (e = r);
      }
      e != null && (this.expiryTimeout = setTimeout(this.onRTCSessionMemberUpdate, e));
    }
    sendCallNotify(e, n, r) {
      var i = this, a = (function() {
        var l = me(function* () {
          var c = {
            application: "m.call",
            "m.mentions": {
              user_ids: [],
              room: true
            },
            notify_type: n === "notification" ? "notify" : n,
            call_id: i.callId
          }, d = yield i.client.sendEvent(i.roomSubset.roomId, ce.CallNotify, c);
          return {
            response: d,
            content: c
          };
        });
        return function() {
          return l.apply(this, arguments);
        };
      })(), s = (function() {
        var l = me(function* () {
          var c = {
            "m.mentions": {
              user_ids: [],
              room: true
            },
            notification_type: n,
            "m.relates_to": {
              event_id: e,
              rel_type: Xn.Reference
            },
            sender_ts: Date.now(),
            lifetime: 3e4
          };
          r && (c["m.call.intent"] = r);
          var d = yield i.client.sendEvent(i.roomSubset.roomId, ce.RTCNotification, c);
          return {
            response: d,
            content: c
          };
        });
        return function() {
          return l.apply(this, arguments);
        };
      })();
      Promise.all([
        a(),
        s()
      ]).then((l) => {
        var [c, d] = l, u = tw(tw({}, c.response), c.content), h = tw(tw({}, d.response), d.content);
        this.emit(Js.DidSendCallNotification, h, u);
      }).catch((l) => {
        var [c, d] = l;
        return this.logger.error("Failed to send call notification", c, d);
      });
    }
  }
  var Id = (function(t) {
    return t.SessionStarted = "session_started", t.SessionEnded = "session_ended", t;
  })({});
  class jDe extends ji {
    constructor(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
        id: "",
        application: "m.call"
      };
      super(), this.client = n, this.sessionDescription = r, $(this, "roomSessions", /* @__PURE__ */ new Map()), $(this, "logger", void 0), $(this, "onRoom", (i) => {
        this.refreshRoom(i);
      }), $(this, "onRoomState", (i, a) => {
        var s = this.client.getRoom(i.getRoomId());
        if (!s) {
          this.logger.error("Got room state event for unknown room ".concat(i.getRoomId(), "!"));
          return;
        }
        i.getType() == ce.GroupCallMemberPrefix && this.refreshRoom(s);
      }), this.logger = e.getChild("[MatrixRTCSessionManager]");
    }
    start() {
      for (var e of (n = this.client.getRooms()) !== null && n !== void 0 ? n : []) {
        var n, r = rl.sessionForRoom(this.client, e, this.sessionDescription);
        r.memberships.length > 0 && this.roomSessions.set(e.roomId, r);
      }
      this.client.on(jt.Room, this.onRoom), this.client.on(qn.Events, this.onRoomState);
    }
    stop() {
      for (var e of this.roomSessions.values()) e.stop();
      this.roomSessions.clear(), this.client.off(jt.Room, this.onRoom), this.client.off(qn.Events, this.onRoomState);
    }
    getActiveRoomSession(e) {
      return this.roomSessions.get(e.roomId);
    }
    getRoomSession(e) {
      return this.roomSessions.has(e.roomId) || this.roomSessions.set(e.roomId, rl.sessionForRoom(this.client, e, this.sessionDescription)), this.roomSessions.get(e.roomId);
    }
    refreshRoom(e) {
      var n = !this.roomSessions.has(e.roomId), r = this.getRoomSession(e), i = r.memberships.length > 0 && !n;
      r.onRTCSessionMemberUpdate();
      var a = r.memberships.length > 0;
      i && !a ? (this.logger.trace("Session ended for ".concat(e.roomId, " (").concat(r.memberships.length, " members)")), this.emit(Id.SessionEnded, e.roomId, this.roomSessions.get(e.roomId))) : !i && a && (this.logger.trace("Session started for ".concat(e.roomId, " (").concat(r.memberships.length, " members)")), this.emit(Id.SessionStarted, e.roomId, this.roomSessions.get(e.roomId)));
    }
  }
  function o9(t) {
    return (e) => {
      var n, r;
      return ((n = e.content) === null || n === void 0 || (n = n["m.relates_to"]) === null || n === void 0 ? void 0 : n.event_id) !== t || ((r = e.content) === null || r === void 0 || (r = r["m.relates_to"]) === null || r === void 0 ? void 0 : r.rel_type) === pi.name;
    };
  }
  function sre(t) {
    return gA.apply(this, arguments);
  }
  function gA() {
    return gA = me(function* (t) {
      if (!globalThis.crypto.subtle) throw new Error("Crypto.subtle is not available: insecure context?");
      var e = new TextEncoder().encode(t), n = yield globalThis.crypto.subtle.digest("SHA-256", e);
      return new Uint8Array(n);
    }), gA.apply(this, arguments);
  }
  class fy extends Error {
  }
  fy.prototype.name = "InvalidTokenError";
  function TDe(t) {
    return decodeURIComponent(atob(t).replace(/(.)/g, (e, n) => {
      let r = n.charCodeAt(0).toString(16).toUpperCase();
      return r.length < 2 && (r = "0" + r), "%" + r;
    }));
  }
  function RDe(t) {
    let e = t.replace(/-/g, "+").replace(/_/g, "/");
    switch (e.length % 4) {
      case 0:
        break;
      case 2:
        e += "==";
        break;
      case 3:
        e += "=";
        break;
      default:
        throw new Error("base64 string is not of the correct length");
    }
    try {
      return TDe(e);
    } catch {
      return atob(e);
    }
  }
  function lre(t, e) {
    if (typeof t != "string") throw new fy("Invalid token specified: must be a string");
    e || (e = {});
    const n = e.header === true ? 0 : 1, r = t.split(".")[n];
    if (typeof r != "string") throw new fy(`Invalid token specified: missing part #${n + 1}`);
    let i;
    try {
      i = RDe(r);
    } catch (a) {
      throw new fy(`Invalid token specified: invalid base64 for part #${n + 1} (${a.message})`);
    }
    try {
      return JSON.parse(i);
    } catch (a) {
      throw new fy(`Invalid token specified: invalid json for part #${n + 1} (${a.message})`);
    }
  }
  var ADe = {
    debug: () => {
    },
    info: () => {
    },
    warn: () => {
    },
    error: () => {
    }
  }, bd, xd, O2 = ((t) => (t[t.NONE = 0] = "NONE", t[t.ERROR = 1] = "ERROR", t[t.WARN = 2] = "WARN", t[t.INFO = 3] = "INFO", t[t.DEBUG = 4] = "DEBUG", t))(O2 || {});
  ((t) => {
    function e() {
      bd = 3, xd = ADe;
    }
    t.reset = e;
    function n(i) {
      if (!(0 <= i && i <= 4)) throw new Error("Invalid log level");
      bd = i;
    }
    t.setLevel = n;
    function r(i) {
      xd = i;
    }
    t.setLogger = r;
  })(O2 || (O2 = {}));
  var yo = class pd {
    constructor(e) {
      this._name = e;
    }
    debug(...e) {
      bd >= 4 && xd.debug(pd._format(this._name, this._method), ...e);
    }
    info(...e) {
      bd >= 3 && xd.info(pd._format(this._name, this._method), ...e);
    }
    warn(...e) {
      bd >= 2 && xd.warn(pd._format(this._name, this._method), ...e);
    }
    error(...e) {
      bd >= 1 && xd.error(pd._format(this._name, this._method), ...e);
    }
    throw(e) {
      throw this.error(e), e;
    }
    create(e) {
      const n = Object.create(this);
      return n._method = e, n.debug("begin"), n;
    }
    static createStatic(e, n) {
      const r = new pd(`${e}.${n}`);
      return r.debug("begin"), r;
    }
    static _format(e, n) {
      const r = `[${e}]`;
      return n ? `${r} ${n}:` : r;
    }
    static debug(e, ...n) {
      bd >= 4 && xd.debug(pd._format(e), ...n);
    }
    static info(e, ...n) {
      bd >= 3 && xd.info(pd._format(e), ...n);
    }
    static warn(e, ...n) {
      bd >= 2 && xd.warn(pd._format(e), ...n);
    }
    static error(e, ...n) {
      bd >= 1 && xd.error(pd._format(e), ...n);
    }
  };
  O2.reset();
  var L2 = class {
    static decode(t) {
      try {
        return lre(t);
      } catch (e) {
        throw yo.error("JwtUtils.decode", e), e;
      }
    }
    static async generateSignedJwt(t, e, n) {
      const r = ba.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))), i = ba.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))), a = `${r}.${i}`, s = await window.crypto.subtle.sign({
        name: "ECDSA",
        hash: {
          name: "SHA-256"
        }
      }, n, new TextEncoder().encode(a)), l = ba.encodeBase64Url(new Uint8Array(s));
      return `${a}.${l}`;
    }
    static async generateSignedJwtWithHmac(t, e, n) {
      const r = ba.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))), i = ba.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))), a = `${r}.${i}`, s = await window.crypto.subtle.sign("HMAC", n, new TextEncoder().encode(a)), l = ba.encodeBase64Url(new Uint8Array(s));
      return `${a}.${l}`;
    }
  }, IDe = "10000000-1000-4000-8000-100000000000", pA = (t) => btoa([
    ...new Uint8Array(t)
  ].map((e) => String.fromCharCode(e)).join("")), cre = class _c3 {
    static _randomWord() {
      const e = new Uint32Array(1);
      return crypto.getRandomValues(e), e[0];
    }
    static generateUUIDv4() {
      return IDe.replace(/[018]/g, (n) => (+n ^ _c3._randomWord() & 15 >> +n / 4).toString(16)).replace(/-/g, "");
    }
    static generateCodeVerifier() {
      return _c3.generateUUIDv4() + _c3.generateUUIDv4() + _c3.generateUUIDv4();
    }
    static async generateCodeChallenge(e) {
      if (!crypto.subtle) throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");
      try {
        const r = new TextEncoder().encode(e), i = await crypto.subtle.digest("SHA-256", r);
        return pA(i).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
      } catch (n) {
        throw yo.error("CryptoUtils.generateCodeChallenge", n), n;
      }
    }
    static generateBasicAuth(e, n) {
      const i = new TextEncoder().encode([
        e,
        n
      ].join(":"));
      return pA(i);
    }
    static async hash(e, n) {
      const r = new TextEncoder().encode(n), i = await crypto.subtle.digest(e, r);
      return new Uint8Array(i);
    }
    static async customCalculateJwkThumbprint(e) {
      let n;
      switch (e.kty) {
        case "RSA":
          n = {
            e: e.e,
            kty: e.kty,
            n: e.n
          };
          break;
        case "EC":
          n = {
            crv: e.crv,
            kty: e.kty,
            x: e.x,
            y: e.y
          };
          break;
        case "OKP":
          n = {
            crv: e.crv,
            kty: e.kty,
            x: e.x
          };
          break;
        case "oct":
          n = {
            crv: e.k,
            kty: e.kty
          };
          break;
        default:
          throw new Error("Unknown jwk type");
      }
      const r = await _c3.hash("SHA-256", JSON.stringify(n));
      return _c3.encodeBase64Url(r);
    }
    static async generateDPoPProof({ url: e, accessToken: n, httpMethod: r, keyPair: i, nonce: a }) {
      let s, l;
      const c = {
        jti: window.crypto.randomUUID(),
        htm: r ?? "GET",
        htu: e,
        iat: Math.floor(Date.now() / 1e3)
      };
      n && (s = await _c3.hash("SHA-256", n), l = _c3.encodeBase64Url(s), c.ath = l), a && (c.nonce = a);
      try {
        const d = await crypto.subtle.exportKey("jwk", i.publicKey), u = {
          alg: "ES256",
          typ: "dpop+jwt",
          jwk: {
            crv: d.crv,
            kty: d.kty,
            x: d.x,
            y: d.y
          }
        };
        return await L2.generateSignedJwt(u, c, i.privateKey);
      } catch (d) {
        throw d instanceof TypeError ? new Error(`Error exporting dpop public key: ${d.message}`) : d;
      }
    }
    static async generateDPoPJkt(e) {
      try {
        const n = await crypto.subtle.exportKey("jwk", e.publicKey);
        return await _c3.customCalculateJwkThumbprint(n);
      } catch (n) {
        throw n instanceof TypeError ? new Error(`Could not retrieve dpop keys from storage: ${n.message}`) : n;
      }
    }
    static async generateDPoPKeys() {
      return await window.crypto.subtle.generateKey({
        name: "ECDSA",
        namedCurve: "P-256"
      }, false, [
        "sign",
        "verify"
      ]);
    }
    static async generateClientAssertionJwt(e, n, r, i = "HS256") {
      const a = Math.floor(Date.now() / 1e3), s = {
        alg: i,
        typ: "JWT"
      }, l = {
        iss: e,
        sub: e,
        aud: r,
        jti: _c3.generateUUIDv4(),
        exp: a + 300,
        iat: a
      }, d = {
        HS256: "SHA-256",
        HS384: "SHA-384",
        HS512: "SHA-512"
      }[i];
      if (!d) throw new Error(`Unsupported algorithm: ${i}. Supported algorithms are: HS256, HS384, HS512`);
      const u = new TextEncoder(), h = await crypto.subtle.importKey("raw", u.encode(n), {
        name: "HMAC",
        hash: d
      }, false, [
        "sign"
      ]);
      return await L2.generateSignedJwtWithHmac(s, l, h);
    }
  };
  cre.encodeBase64Url = (t) => pA(t).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
  var ba = cre, BDe = class {
    constructor(e) {
      this._name = e, this._callbacks = [], this._logger = new yo(`Event('${this._name}')`);
    }
    addHandler(e) {
      return this._callbacks.push(e), () => this.removeHandler(e);
    }
    removeHandler(e) {
      const n = this._callbacks.lastIndexOf(e);
      n >= 0 && this._callbacks.splice(n, 1);
    }
    async raise(...e) {
      this._logger.debug("raise:", ...e);
      for (const n of this._callbacks) await n(...e);
    }
  }, e4 = class kD extends BDe {
    constructor() {
      super(...arguments), this._logger = new yo(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
        const e = this._expiration - kD.getEpochTime();
        this._logger.debug("timer completes in", e), this._expiration <= kD.getEpochTime() && (this.cancel(), super.raise());
      };
    }
    static getEpochTime() {
      return Math.floor(Date.now() / 1e3);
    }
    init(e) {
      const n = this._logger.create("init");
      e = Math.max(Math.floor(e), 1);
      const r = kD.getEpochTime() + e;
      if (this.expiration === r && this._timerHandle) {
        n.debug("skipping since already initialized for expiration at", this.expiration);
        return;
      }
      this.cancel(), n.debug("using duration", e), this._expiration = r;
      const i = Math.min(e, 5);
      this._timerHandle = setInterval(this._callback, i * 1e3);
    }
    get expiration() {
      return this._expiration;
    }
    cancel() {
      this._logger.create("cancel"), this._timerHandle && (clearInterval(this._timerHandle), this._timerHandle = null);
    }
  }, r$ = class {
    static readParams(t, e = "query") {
      if (!t) throw new TypeError("Invalid URL");
      const r = new URL(t, "http://127.0.0.1")[e === "fragment" ? "hash" : "search"];
      return new URLSearchParams(r.slice(1));
    }
  }, V1 = ";", H1 = class extends Error {
    constructor(t, e) {
      var n, r, i;
      if (super(t.error_description || t.error || ""), this.form = e, this.name = "ErrorResponse", !t.error) throw yo.error("ErrorResponse", "No error passed"), new Error("No error passed");
      this.error = t.error, this.error_description = (n = t.error_description) != null ? n : null, this.error_uri = (r = t.error_uri) != null ? r : null, this.state = t.userState, this.session_state = (i = t.session_state) != null ? i : null, this.url_state = t.url_state;
    }
  }, PDe = class extends Error {
    constructor(t) {
      super(t), this.name = "ErrorTimeout";
    }
  }, MDe = class {
    constructor() {
      this._logger = new yo("InMemoryWebStorage"), this._data = {};
    }
    clear() {
      this._logger.create("clear"), this._data = {};
    }
    getItem(t) {
      return this._logger.create(`getItem('${t}')`), this._data[t];
    }
    setItem(t, e) {
      this._logger.create(`setItem('${t}')`), this._data[t] = e;
    }
    removeItem(t) {
      this._logger.create(`removeItem('${t}')`), delete this._data[t];
    }
    get length() {
      return Object.getOwnPropertyNames(this._data).length;
    }
    key(t) {
      return Object.getOwnPropertyNames(this._data)[t];
    }
  }, FA = class extends Error {
    constructor(t, e) {
      super(e), this.name = "ErrorDPoPNonce", this.nonce = t;
    }
  }, dB = class {
    constructor(t = [], e = null, n = {}) {
      this._jwtHandler = e, this._extraHeaders = n, this._logger = new yo("JsonService"), this._contentTypes = [], this._contentTypes.push(...t, "application/json"), e && this._contentTypes.push("application/jwt");
    }
    async fetchWithTimeout(t, e = {}) {
      const { timeoutInSeconds: n, ...r } = e;
      if (!n) return await fetch(t, r);
      const i = new AbortController(), a = setTimeout(() => i.abort(), n * 1e3);
      try {
        return await fetch(t, {
          ...e,
          signal: i.signal
        });
      } catch (s) {
        throw s instanceof DOMException && s.name === "AbortError" ? new PDe("Network timed out") : s;
      } finally {
        clearTimeout(a);
      }
    }
    async getJson(t, { token: e, credentials: n, timeoutInSeconds: r } = {}) {
      const i = this._logger.create("getJson"), a = {
        Accept: this._contentTypes.join(", ")
      };
      e && (i.debug("token passed, setting Authorization header"), a.Authorization = "Bearer " + e), this._appendExtraHeaders(a);
      let s;
      try {
        i.debug("url:", t), s = await this.fetchWithTimeout(t, {
          method: "GET",
          headers: a,
          timeoutInSeconds: r,
          credentials: n
        });
      } catch (d) {
        throw i.error("Network Error"), d;
      }
      i.debug("HTTP response received, status", s.status);
      const l = s.headers.get("Content-Type");
      if (l && !this._contentTypes.find((d) => l.startsWith(d)) && i.throw(new Error(`Invalid response Content-Type: ${l ?? "undefined"}, from URL: ${t}`)), s.ok && this._jwtHandler && (l == null ? void 0 : l.startsWith("application/jwt"))) return await this._jwtHandler(await s.text());
      let c;
      try {
        c = await s.json();
      } catch (d) {
        throw i.error("Error parsing JSON response", d), s.ok ? d : new Error(`${s.statusText} (${s.status})`);
      }
      if (!s.ok) throw i.error("Error from server:", c), c.error ? new H1(c) : new Error(`${s.statusText} (${s.status}): ${JSON.stringify(c)}`);
      return c;
    }
    async postForm(t, { body: e, basicAuth: n, timeoutInSeconds: r, initCredentials: i, extraHeaders: a }) {
      const s = this._logger.create("postForm"), l = {
        Accept: this._contentTypes.join(", "),
        "Content-Type": "application/x-www-form-urlencoded",
        ...a
      };
      n !== void 0 && (l.Authorization = "Basic " + n), this._appendExtraHeaders(l);
      let c;
      try {
        s.debug("url:", t), c = await this.fetchWithTimeout(t, {
          method: "POST",
          headers: l,
          body: e,
          timeoutInSeconds: r,
          credentials: i
        });
      } catch (f) {
        throw s.error("Network error"), f;
      }
      s.debug("HTTP response received, status", c.status);
      const d = c.headers.get("Content-Type");
      if (d && !this._contentTypes.find((f) => d.startsWith(f))) throw new Error(`Invalid response Content-Type: ${d ?? "undefined"}, from URL: ${t}`);
      const u = await c.text();
      let h = {};
      if (u) try {
        h = JSON.parse(u);
      } catch (f) {
        throw s.error("Error parsing JSON response", f), c.ok ? f : new Error(`${c.statusText} (${c.status})`);
      }
      if (!c.ok) {
        if (s.error("Error from server:", h), c.headers.has("dpop-nonce")) {
          const f = c.headers.get("dpop-nonce");
          throw new FA(f, `${JSON.stringify(h)}`);
        }
        throw h.error ? new H1(h, e) : new Error(`${c.statusText} (${c.status}): ${JSON.stringify(h)}`);
      }
      return h;
    }
    _appendExtraHeaders(t) {
      const e = this._logger.create("appendExtraHeaders"), n = Object.keys(this._extraHeaders), r = [
        "accept",
        "content-type"
      ], i = [
        "authorization"
      ];
      n.length !== 0 && n.forEach((a) => {
        if (r.includes(a.toLocaleLowerCase())) {
          e.warn("Protected header could not be set", a, r);
          return;
        }
        if (i.includes(a.toLocaleLowerCase()) && Object.keys(t).includes(a)) {
          e.warn("Header could not be overridden", a, i);
          return;
        }
        const s = typeof this._extraHeaders[a] == "function" ? this._extraHeaders[a]() : this._extraHeaders[a];
        s && s !== "" && (t[a] = s);
      });
    }
  }, dre = class {
    constructor(t) {
      this._settings = t, this._logger = new yo("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new dB([
        "application/jwk-set+json"
      ], null, this._settings.extraHeaders), this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
    }
    resetSigningKeys() {
      this._signingKeys = null;
    }
    async getMetadata() {
      const t = this._logger.create("getMetadata");
      if (this._metadata) return t.debug("using cached values"), this._metadata;
      if (!this._metadataUrl) throw t.throw(new Error("No authority or metadataUrl configured on settings")), null;
      t.debug("getting metadata from", this._metadataUrl);
      const e = await this._jsonService.getJson(this._metadataUrl, {
        credentials: this._fetchRequestCredentials,
        timeoutInSeconds: this._settings.requestTimeoutInSeconds
      });
      return t.debug("merging remote JSON with seed metadata"), this._metadata = Object.assign({}, e, this._settings.metadataSeed), this._metadata;
    }
    getIssuer() {
      return this._getMetadataProperty("issuer");
    }
    getAuthorizationEndpoint() {
      return this._getMetadataProperty("authorization_endpoint");
    }
    getUserInfoEndpoint() {
      return this._getMetadataProperty("userinfo_endpoint");
    }
    getTokenEndpoint(t = true) {
      return this._getMetadataProperty("token_endpoint", t);
    }
    getCheckSessionIframe() {
      return this._getMetadataProperty("check_session_iframe", true);
    }
    getEndSessionEndpoint() {
      return this._getMetadataProperty("end_session_endpoint", true);
    }
    getRevocationEndpoint(t = true) {
      return this._getMetadataProperty("revocation_endpoint", t);
    }
    getKeysEndpoint(t = true) {
      return this._getMetadataProperty("jwks_uri", t);
    }
    async _getMetadataProperty(t, e = false) {
      const n = this._logger.create(`_getMetadataProperty('${t}')`), r = await this.getMetadata();
      if (n.debug("resolved"), r[t] === void 0) {
        if (e === true) {
          n.warn("Metadata does not contain optional property");
          return;
        }
        n.throw(new Error("Metadata does not contain property " + t));
      }
      return r[t];
    }
    async getSigningKeys() {
      const t = this._logger.create("getSigningKeys");
      if (this._signingKeys) return t.debug("returning signingKeys from cache"), this._signingKeys;
      const e = await this.getKeysEndpoint(false);
      t.debug("got jwks_uri", e);
      const n = await this._jsonService.getJson(e, {
        timeoutInSeconds: this._settings.requestTimeoutInSeconds
      });
      if (t.debug("got key set", n), !Array.isArray(n.keys)) throw t.throw(new Error("Missing keys on keyset")), null;
      return this._signingKeys = n.keys, this._signingKeys;
    }
  }, fk = class {
    constructor({ prefix: t = "oidc.", store: e = localStorage } = {}) {
      this._logger = new yo("WebStorageStateStore"), this._store = e, this._prefix = t;
    }
    async set(t, e) {
      this._logger.create(`set('${t}')`), t = this._prefix + t, await this._store.setItem(t, e);
    }
    async get(t) {
      return this._logger.create(`get('${t}')`), t = this._prefix + t, await this._store.getItem(t);
    }
    async remove(t) {
      this._logger.create(`remove('${t}')`), t = this._prefix + t;
      const e = await this._store.getItem(t);
      return await this._store.removeItem(t), e;
    }
    async getAllKeys() {
      this._logger.create("getAllKeys");
      const t = await this._store.length, e = [];
      for (let n = 0; n < t; n++) {
        const r = await this._store.key(n);
        r && r.indexOf(this._prefix) === 0 && e.push(r.substr(this._prefix.length));
      }
      return e;
    }
  }, ODe = "code", LDe = "openid", NDe = "client_secret_post", zDe = 900, vA = class {
    constructor({ authority: t, metadataUrl: e, metadata: n, signingKeys: r, metadataSeed: i, client_id: a, client_secret: s, response_type: l = ODe, scope: c = LDe, redirect_uri: d, post_logout_redirect_uri: u, client_authentication: h = NDe, token_endpoint_auth_signing_alg: f = "HS256", prompt: g, display: m, max_age: v, ui_locales: y, acr_values: w, resource: b, response_mode: j, filterProtocolClaims: k = true, loadUserInfo: C = false, requestTimeoutInSeconds: x, staleStateAgeInSeconds: S = zDe, mergeClaimsStrategy: T = {
      array: "replace"
    }, disablePKCE: A = false, stateStore: B, revokeTokenAdditionalContentTypes: U, fetchRequestCredentials: z, refreshTokenAllowedScope: O, extraQueryParams: M = {}, extraTokenParams: I = {}, extraHeaders: N = {}, dpop: L, omitScopeWhenRequesting: H = false }) {
      var V;
      if (this.authority = t, e ? this.metadataUrl = e : (this.metadataUrl = t, t && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = n, this.metadataSeed = i, this.signingKeys = r, this.client_id = a, this.client_secret = s, this.response_type = l, this.scope = c, this.redirect_uri = d, this.post_logout_redirect_uri = u, this.client_authentication = h, this.token_endpoint_auth_signing_alg = f, this.prompt = g, this.display = m, this.max_age = v, this.ui_locales = y, this.acr_values = w, this.resource = b, this.response_mode = j, this.filterProtocolClaims = k ?? true, this.loadUserInfo = !!C, this.staleStateAgeInSeconds = S, this.mergeClaimsStrategy = T, this.omitScopeWhenRequesting = H, this.disablePKCE = !!A, this.revokeTokenAdditionalContentTypes = U, this.fetchRequestCredentials = z || "same-origin", this.requestTimeoutInSeconds = x, B) this.stateStore = B;
      else {
        const Z = typeof window < "u" ? window.localStorage : new MDe();
        this.stateStore = new fk({
          store: Z
        });
      }
      if (this.refreshTokenAllowedScope = O, this.extraQueryParams = M, this.extraTokenParams = I, this.extraHeaders = N, this.dpop = L, this.dpop && !((V = this.dpop) != null && V.store)) throw new Error("A DPoPStore is required when dpop is enabled");
    }
  }, UDe = class {
    constructor(t, e) {
      this._settings = t, this._metadataService = e, this._logger = new yo("UserInfoService"), this._getClaimsFromJwt = async (n) => {
        const r = this._logger.create("_getClaimsFromJwt");
        try {
          const i = L2.decode(n);
          return r.debug("JWT decoding successful"), i;
        } catch (i) {
          throw r.error("Error parsing JWT response"), i;
        }
      }, this._jsonService = new dB(void 0, this._getClaimsFromJwt, this._settings.extraHeaders);
    }
    async getClaims(t) {
      const e = this._logger.create("getClaims");
      t || this._logger.throw(new Error("No token passed"));
      const n = await this._metadataService.getUserInfoEndpoint();
      e.debug("got userinfo url", n);
      const r = await this._jsonService.getJson(n, {
        token: t,
        credentials: this._settings.fetchRequestCredentials,
        timeoutInSeconds: this._settings.requestTimeoutInSeconds
      });
      return e.debug("got claims", r), r;
    }
  }, ure = class {
    constructor(t, e) {
      this._settings = t, this._metadataService = e, this._logger = new yo("TokenClient"), this._jsonService = new dB(this._settings.revokeTokenAdditionalContentTypes, null, this._settings.extraHeaders);
    }
    async exchangeCode({ grant_type: t = "authorization_code", redirect_uri: e = this._settings.redirect_uri, client_id: n = this._settings.client_id, client_secret: r = this._settings.client_secret, extraHeaders: i, ...a }) {
      const s = this._logger.create("exchangeCode");
      n || s.throw(new Error("A client_id is required")), e || s.throw(new Error("A redirect_uri is required")), a.code || s.throw(new Error("A code is required"));
      const l = new URLSearchParams({
        grant_type: t,
        redirect_uri: e
      });
      for (const [h, f] of Object.entries(a)) f != null && l.set(h, f);
      if ((this._settings.client_authentication === "client_secret_basic" || this._settings.client_authentication === "client_secret_jwt") && r == null) throw s.throw(new Error("A client_secret is required")), null;
      let c;
      const d = await this._metadataService.getTokenEndpoint(false);
      switch (this._settings.client_authentication) {
        case "client_secret_basic":
          c = ba.generateBasicAuth(n, r);
          break;
        case "client_secret_post":
          l.append("client_id", n), r && l.append("client_secret", r);
          break;
        case "client_secret_jwt": {
          const h = await ba.generateClientAssertionJwt(n, r, d, this._settings.token_endpoint_auth_signing_alg);
          l.append("client_id", n), l.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), l.append("client_assertion", h);
          break;
        }
      }
      s.debug("got token endpoint");
      const u = await this._jsonService.postForm(d, {
        body: l,
        basicAuth: c,
        timeoutInSeconds: this._settings.requestTimeoutInSeconds,
        initCredentials: this._settings.fetchRequestCredentials,
        extraHeaders: i
      });
      return s.debug("got response"), u;
    }
    async exchangeCredentials({ grant_type: t = "password", client_id: e = this._settings.client_id, client_secret: n = this._settings.client_secret, scope: r = this._settings.scope, ...i }) {
      const a = this._logger.create("exchangeCredentials");
      e || a.throw(new Error("A client_id is required"));
      const s = new URLSearchParams({
        grant_type: t
      });
      this._settings.omitScopeWhenRequesting || s.set("scope", r);
      for (const [u, h] of Object.entries(i)) h != null && s.set(u, h);
      if ((this._settings.client_authentication === "client_secret_basic" || this._settings.client_authentication === "client_secret_jwt") && n == null) throw a.throw(new Error("A client_secret is required")), null;
      let l;
      const c = await this._metadataService.getTokenEndpoint(false);
      switch (this._settings.client_authentication) {
        case "client_secret_basic":
          l = ba.generateBasicAuth(e, n);
          break;
        case "client_secret_post":
          s.append("client_id", e), n && s.append("client_secret", n);
          break;
        case "client_secret_jwt": {
          const u = await ba.generateClientAssertionJwt(e, n, c, this._settings.token_endpoint_auth_signing_alg);
          s.append("client_id", e), s.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), s.append("client_assertion", u);
          break;
        }
      }
      a.debug("got token endpoint");
      const d = await this._jsonService.postForm(c, {
        body: s,
        basicAuth: l,
        timeoutInSeconds: this._settings.requestTimeoutInSeconds,
        initCredentials: this._settings.fetchRequestCredentials
      });
      return a.debug("got response"), d;
    }
    async exchangeRefreshToken({ grant_type: t = "refresh_token", client_id: e = this._settings.client_id, client_secret: n = this._settings.client_secret, timeoutInSeconds: r, extraHeaders: i, ...a }) {
      const s = this._logger.create("exchangeRefreshToken");
      e || s.throw(new Error("A client_id is required")), a.refresh_token || s.throw(new Error("A refresh_token is required"));
      const l = new URLSearchParams({
        grant_type: t
      });
      for (const [h, f] of Object.entries(a)) Array.isArray(f) ? f.forEach((g) => l.append(h, g)) : f != null && l.set(h, f);
      if ((this._settings.client_authentication === "client_secret_basic" || this._settings.client_authentication === "client_secret_jwt") && n == null) throw s.throw(new Error("A client_secret is required")), null;
      let c;
      const d = await this._metadataService.getTokenEndpoint(false);
      switch (this._settings.client_authentication) {
        case "client_secret_basic":
          c = ba.generateBasicAuth(e, n);
          break;
        case "client_secret_post":
          l.append("client_id", e), n && l.append("client_secret", n);
          break;
        case "client_secret_jwt": {
          const h = await ba.generateClientAssertionJwt(e, n, d, this._settings.token_endpoint_auth_signing_alg);
          l.append("client_id", e), l.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), l.append("client_assertion", h);
          break;
        }
      }
      s.debug("got token endpoint");
      const u = await this._jsonService.postForm(d, {
        body: l,
        basicAuth: c,
        timeoutInSeconds: r,
        initCredentials: this._settings.fetchRequestCredentials,
        extraHeaders: i
      });
      return s.debug("got response"), u;
    }
    async revoke(t) {
      var e;
      const n = this._logger.create("revoke");
      t.token || n.throw(new Error("A token is required"));
      const r = await this._metadataService.getRevocationEndpoint(false);
      n.debug(`got revocation endpoint, revoking ${(e = t.token_type_hint) != null ? e : "default token type"}`);
      const i = new URLSearchParams();
      for (const [a, s] of Object.entries(t)) s != null && i.set(a, s);
      i.set("client_id", this._settings.client_id), this._settings.client_secret && i.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(r, {
        body: i,
        timeoutInSeconds: this._settings.requestTimeoutInSeconds
      }), n.debug("got response");
    }
  }, VDe = class {
    constructor(t, e, n) {
      this._settings = t, this._metadataService = e, this._claimsService = n, this._logger = new yo("ResponseValidator"), this._userInfoService = new UDe(this._settings, this._metadataService), this._tokenClient = new ure(this._settings, this._metadataService);
    }
    async validateSigninResponse(t, e, n) {
      const r = this._logger.create("validateSigninResponse");
      this._processSigninState(t, e), r.debug("state processed"), await this._processCode(t, e, n), r.debug("code processed"), t.isOpenId && this._validateIdTokenAttributes(t), r.debug("tokens validated"), await this._processClaims(t, e == null ? void 0 : e.skipUserInfo, t.isOpenId), r.debug("claims processed");
    }
    async validateCredentialsResponse(t, e) {
      const n = this._logger.create("validateCredentialsResponse"), r = t.isOpenId && !!t.id_token;
      r && this._validateIdTokenAttributes(t), n.debug("tokens validated"), await this._processClaims(t, e, r), n.debug("claims processed");
    }
    async validateRefreshResponse(t, e) {
      var n, r;
      const i = this._logger.create("validateRefreshResponse");
      t.userState = e.data, (n = t.session_state) != null || (t.session_state = e.session_state), (r = t.scope) != null || (t.scope = e.scope), t.isOpenId && t.id_token && (this._validateIdTokenAttributes(t, e.id_token), i.debug("ID Token validated")), t.id_token || (t.id_token = e.id_token, t.profile = e.profile);
      const a = t.isOpenId && !!t.id_token;
      await this._processClaims(t, false, a), i.debug("claims processed");
    }
    validateSignoutResponse(t, e) {
      const n = this._logger.create("validateSignoutResponse");
      if (e.id !== t.state && n.throw(new Error("State does not match")), n.debug("state validated"), t.userState = e.data, t.error) throw n.warn("Response was error", t.error), new H1(t);
    }
    _processSigninState(t, e) {
      var n;
      const r = this._logger.create("_processSigninState");
      if (e.id !== t.state && r.throw(new Error("State does not match")), e.client_id || r.throw(new Error("No client_id on state")), e.authority || r.throw(new Error("No authority on state")), this._settings.authority !== e.authority && r.throw(new Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== e.client_id && r.throw(new Error("client_id mismatch on settings vs. signin state")), r.debug("state validated"), t.userState = e.data, t.url_state = e.url_state, (n = t.scope) != null || (t.scope = e.scope), t.error) throw r.warn("Response was error", t.error), new H1(t);
      e.code_verifier && !t.code && r.throw(new Error("Expected code in response"));
    }
    async _processClaims(t, e = false, n = true) {
      const r = this._logger.create("_processClaims");
      if (t.profile = this._claimsService.filterProtocolClaims(t.profile), e || !this._settings.loadUserInfo || !t.access_token) {
        r.debug("not loading user info");
        return;
      }
      r.debug("loading user info");
      const i = await this._userInfoService.getClaims(t.access_token);
      r.debug("user info claims received from user info endpoint"), n && i.sub !== t.profile.sub && r.throw(new Error("subject from UserInfo response does not match subject in ID Token")), t.profile = this._claimsService.mergeClaims(t.profile, this._claimsService.filterProtocolClaims(i)), r.debug("user info claims received, updated profile:", t.profile);
    }
    async _processCode(t, e, n) {
      const r = this._logger.create("_processCode");
      if (t.code) {
        r.debug("Validating code");
        const i = await this._tokenClient.exchangeCode({
          client_id: e.client_id,
          client_secret: e.client_secret,
          code: t.code,
          redirect_uri: e.redirect_uri,
          code_verifier: e.code_verifier,
          extraHeaders: n,
          ...e.extraTokenParams
        });
        Object.assign(t, i);
      } else r.debug("No code to process");
    }
    _validateIdTokenAttributes(t, e) {
      var n;
      const r = this._logger.create("_validateIdTokenAttributes");
      r.debug("decoding ID Token JWT");
      const i = L2.decode((n = t.id_token) != null ? n : "");
      if (i.sub || r.throw(new Error("ID Token is missing a subject claim")), e) {
        const a = L2.decode(e);
        i.sub !== a.sub && r.throw(new Error("sub in id_token does not match current sub")), i.auth_time && i.auth_time !== a.auth_time && r.throw(new Error("auth_time in id_token does not match original auth_time")), i.azp && i.azp !== a.azp && r.throw(new Error("azp in id_token does not match original azp")), !i.azp && a.azp && r.throw(new Error("azp not in id_token, but present in original id_token"));
      }
      t.profile = i;
    }
  }, t4 = class _A {
    constructor(e) {
      this.id = e.id || ba.generateUUIDv4(), this.data = e.data, e.created && e.created > 0 ? this.created = e.created : this.created = e4.getEpochTime(), this.request_type = e.request_type, this.url_state = e.url_state;
    }
    toStorageString() {
      return new yo("State").create("toStorageString"), JSON.stringify({
        id: this.id,
        data: this.data,
        created: this.created,
        request_type: this.request_type,
        url_state: this.url_state
      });
    }
    static fromStorageString(e) {
      return yo.createStatic("State", "fromStorageString"), Promise.resolve(new _A(JSON.parse(e)));
    }
    static async clearStaleState(e, n) {
      const r = yo.createStatic("State", "clearStaleState"), i = e4.getEpochTime() - n, a = await e.getAllKeys();
      r.debug("got keys", a);
      for (let s = 0; s < a.length; s++) {
        const l = a[s], c = await e.get(l);
        let d = false;
        if (c) try {
          const u = await _A.fromStorageString(c);
          r.debug("got item from key:", l, u.created), u.created <= i && (d = true);
        } catch (u) {
          r.error("Error parsing state for key:", l, u), d = true;
        }
        else r.debug("no item in storage for key:", l), d = true;
        d && (r.debug("removed item for key:", l), e.remove(l));
      }
    }
  }, uB = class yA extends t4 {
    constructor(e) {
      super(e), this.code_verifier = e.code_verifier, this.code_challenge = e.code_challenge, this.authority = e.authority, this.client_id = e.client_id, this.redirect_uri = e.redirect_uri, this.scope = e.scope, this.client_secret = e.client_secret, this.extraTokenParams = e.extraTokenParams, this.response_mode = e.response_mode, this.skipUserInfo = e.skipUserInfo;
    }
    static async create(e) {
      const n = e.code_verifier === true ? ba.generateCodeVerifier() : e.code_verifier || void 0, r = n ? await ba.generateCodeChallenge(n) : void 0;
      return new yA({
        ...e,
        code_verifier: n,
        code_challenge: r
      });
    }
    toStorageString() {
      return new yo("SigninState").create("toStorageString"), JSON.stringify({
        id: this.id,
        data: this.data,
        created: this.created,
        request_type: this.request_type,
        url_state: this.url_state,
        code_verifier: this.code_verifier,
        authority: this.authority,
        client_id: this.client_id,
        redirect_uri: this.redirect_uri,
        scope: this.scope,
        client_secret: this.client_secret,
        extraTokenParams: this.extraTokenParams,
        response_mode: this.response_mode,
        skipUserInfo: this.skipUserInfo
      });
    }
    static fromStorageString(e) {
      yo.createStatic("SigninState", "fromStorageString");
      const n = JSON.parse(e);
      return yA.create(n);
    }
  }, hre = class fre {
    constructor(e) {
      this.url = e.url, this.state = e.state;
    }
    static async create({ url: e, authority: n, client_id: r, redirect_uri: i, response_type: a, scope: s, state_data: l, response_mode: c, request_type: d, client_secret: u, nonce: h, url_state: f, resource: g, skipUserInfo: m, extraQueryParams: v, extraTokenParams: y, disablePKCE: w, dpopJkt: b, omitScopeWhenRequesting: j, ...k }) {
      if (!e) throw this._logger.error("create: No url passed"), new Error("url");
      if (!r) throw this._logger.error("create: No client_id passed"), new Error("client_id");
      if (!i) throw this._logger.error("create: No redirect_uri passed"), new Error("redirect_uri");
      if (!a) throw this._logger.error("create: No response_type passed"), new Error("response_type");
      if (!s) throw this._logger.error("create: No scope passed"), new Error("scope");
      if (!n) throw this._logger.error("create: No authority passed"), new Error("authority");
      const C = await uB.create({
        data: l,
        request_type: d,
        url_state: f,
        code_verifier: !w,
        client_id: r,
        authority: n,
        redirect_uri: i,
        response_mode: c,
        client_secret: u,
        scope: s,
        extraTokenParams: y,
        skipUserInfo: m
      }), x = new URL(e);
      x.searchParams.append("client_id", r), x.searchParams.append("redirect_uri", i), x.searchParams.append("response_type", a), j || x.searchParams.append("scope", s), h && x.searchParams.append("nonce", h), b && x.searchParams.append("dpop_jkt", b);
      let S = C.id;
      f && (S = `${S}${V1}${f}`), x.searchParams.append("state", S), C.code_challenge && (x.searchParams.append("code_challenge", C.code_challenge), x.searchParams.append("code_challenge_method", "S256")), g && (Array.isArray(g) ? g : [
        g
      ]).forEach((A) => x.searchParams.append("resource", A));
      for (const [T, A] of Object.entries({
        response_mode: c,
        ...k,
        ...v
      })) A != null && x.searchParams.append(T, A.toString());
      return new fre({
        url: x.href,
        state: C
      });
    }
  };
  hre._logger = new yo("SigninRequest");
  var HDe = hre, $De = "openid", SD = class {
    constructor(t) {
      if (this.access_token = "", this.token_type = "", this.profile = {}, this.state = t.get("state"), this.session_state = t.get("session_state"), this.state) {
        const e = decodeURIComponent(this.state).split(V1);
        this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(V1));
      }
      this.error = t.get("error"), this.error_description = t.get("error_description"), this.error_uri = t.get("error_uri"), this.code = t.get("code");
    }
    get expires_in() {
      if (this.expires_at !== void 0) return this.expires_at - e4.getEpochTime();
    }
    set expires_in(t) {
      typeof t == "string" && (t = Number(t)), t !== void 0 && t >= 0 && (this.expires_at = Math.floor(t) + e4.getEpochTime());
    }
    get isOpenId() {
      var t;
      return ((t = this.scope) == null ? void 0 : t.split(" ").includes($De)) || !!this.id_token;
    }
  }, WDe = class {
    constructor({ url: t, state_data: e, id_token_hint: n, post_logout_redirect_uri: r, extraQueryParams: i, request_type: a, client_id: s, url_state: l }) {
      if (this._logger = new yo("SignoutRequest"), !t) throw this._logger.error("ctor: No url passed"), new Error("url");
      const c = new URL(t);
      if (n && c.searchParams.append("id_token_hint", n), s && c.searchParams.append("client_id", s), r && (c.searchParams.append("post_logout_redirect_uri", r), e || l)) {
        this.state = new t4({
          data: e,
          request_type: a,
          url_state: l
        });
        let d = this.state.id;
        l && (d = `${d}${V1}${l}`), c.searchParams.append("state", d);
      }
      for (const [d, u] of Object.entries({
        ...i
      })) u != null && c.searchParams.append(d, u.toString());
      this.url = c.href;
    }
  }, qDe = class {
    constructor(t) {
      if (this.state = t.get("state"), this.state) {
        const e = decodeURIComponent(this.state).split(V1);
        this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(V1));
      }
      this.error = t.get("error"), this.error_description = t.get("error_description"), this.error_uri = t.get("error_uri");
    }
  }, KDe = [
    "nbf",
    "jti",
    "auth_time",
    "nonce",
    "acr",
    "amr",
    "azp",
    "at_hash"
  ], GDe = [
    "sub",
    "iss",
    "aud",
    "exp",
    "iat"
  ], YDe = class {
    constructor(t) {
      this._settings = t, this._logger = new yo("ClaimsService");
    }
    filterProtocolClaims(t) {
      const e = {
        ...t
      };
      if (this._settings.filterProtocolClaims) {
        let n;
        Array.isArray(this._settings.filterProtocolClaims) ? n = this._settings.filterProtocolClaims : n = KDe;
        for (const r of n) GDe.includes(r) || delete e[r];
      }
      return e;
    }
    mergeClaims(t, e) {
      const n = {
        ...t
      };
      for (const [r, i] of Object.entries(e)) if (n[r] !== i) if (Array.isArray(n[r]) || Array.isArray(i)) if (this._settings.mergeClaimsStrategy.array == "replace") n[r] = i;
      else {
        const a = Array.isArray(n[r]) ? n[r] : [
          n[r]
        ];
        for (const s of Array.isArray(i) ? i : [
          i
        ]) a.includes(s) || a.push(s);
        n[r] = a;
      }
      else typeof n[r] == "object" && typeof i == "object" ? n[r] = this.mergeClaims(n[r], i) : n[r] = i;
      return n;
    }
  }, ZDe = class {
    constructor(t, e) {
      this.keys = t, this.nonce = e;
    }
  }, hB = class {
    constructor(t, e) {
      this._logger = new yo("OidcClient"), this.settings = t instanceof vA ? t : new vA(t), this.metadataService = e ?? new dre(this.settings), this._claimsService = new YDe(this.settings), this._validator = new VDe(this.settings, this.metadataService, this._claimsService), this._tokenClient = new ure(this.settings, this.metadataService);
    }
    async createSigninRequest({ state: t, request: e, request_uri: n, request_type: r, id_token_hint: i, login_hint: a, skipUserInfo: s, nonce: l, url_state: c, response_type: d = this.settings.response_type, scope: u = this.settings.scope, redirect_uri: h = this.settings.redirect_uri, prompt: f = this.settings.prompt, display: g = this.settings.display, max_age: m = this.settings.max_age, ui_locales: v = this.settings.ui_locales, acr_values: y = this.settings.acr_values, resource: w = this.settings.resource, response_mode: b = this.settings.response_mode, extraQueryParams: j = this.settings.extraQueryParams, extraTokenParams: k = this.settings.extraTokenParams, dpopJkt: C, omitScopeWhenRequesting: x = this.settings.omitScopeWhenRequesting }) {
      const S = this._logger.create("createSigninRequest");
      if (d !== "code") throw new Error("Only the Authorization Code flow (with PKCE) is supported");
      const T = await this.metadataService.getAuthorizationEndpoint();
      S.debug("Received authorization endpoint", T);
      const A = await HDe.create({
        url: T,
        authority: this.settings.authority,
        client_id: this.settings.client_id,
        redirect_uri: h,
        response_type: d,
        scope: u,
        state_data: t,
        url_state: c,
        prompt: f,
        display: g,
        max_age: m,
        ui_locales: v,
        id_token_hint: i,
        login_hint: a,
        acr_values: y,
        dpopJkt: C,
        resource: w,
        request: e,
        request_uri: n,
        extraQueryParams: j,
        extraTokenParams: k,
        request_type: r,
        response_mode: b,
        client_secret: this.settings.client_secret,
        skipUserInfo: s,
        nonce: l,
        disablePKCE: this.settings.disablePKCE,
        omitScopeWhenRequesting: x
      });
      await this.clearStaleState();
      const B = A.state;
      return await this.settings.stateStore.set(B.id, B.toStorageString()), A;
    }
    async readSigninResponseState(t, e = false) {
      const n = this._logger.create("readSigninResponseState"), r = new SD(r$.readParams(t, this.settings.response_mode));
      if (!r.state) throw n.throw(new Error("No state in response")), null;
      const i = await this.settings.stateStore[e ? "remove" : "get"](r.state);
      if (!i) throw n.throw(new Error("No matching state found in storage")), null;
      return {
        state: await uB.fromStorageString(i),
        response: r
      };
    }
    async processSigninResponse(t, e, n = true) {
      const r = this._logger.create("processSigninResponse"), { state: i, response: a } = await this.readSigninResponseState(t, n);
      if (r.debug("received state from storage; validating response"), this.settings.dpop && this.settings.dpop.store) {
        const s = await this.getDpopProof(this.settings.dpop.store);
        e = {
          ...e,
          DPoP: s
        };
      }
      try {
        await this._validator.validateSigninResponse(a, i, e);
      } catch (s) {
        if (s instanceof FA && this.settings.dpop) {
          const l = await this.getDpopProof(this.settings.dpop.store, s.nonce);
          e.DPoP = l, await this._validator.validateSigninResponse(a, i, e);
        } else throw s;
      }
      return a;
    }
    async getDpopProof(t, e) {
      let n, r;
      return (await t.getAllKeys()).includes(this.settings.client_id) ? (r = await t.get(this.settings.client_id), r.nonce !== e && e && (r.nonce = e, await t.set(this.settings.client_id, r))) : (n = await ba.generateDPoPKeys(), r = new ZDe(n, e), await t.set(this.settings.client_id, r)), await ba.generateDPoPProof({
        url: await this.metadataService.getTokenEndpoint(false),
        httpMethod: "POST",
        keyPair: r.keys,
        nonce: r.nonce
      });
    }
    async processResourceOwnerPasswordCredentials({ username: t, password: e, skipUserInfo: n = false, extraTokenParams: r = {} }) {
      const i = await this._tokenClient.exchangeCredentials({
        username: t,
        password: e,
        ...r
      }), a = new SD(new URLSearchParams());
      return Object.assign(a, i), await this._validator.validateCredentialsResponse(a, n), a;
    }
    async useRefreshToken({ state: t, redirect_uri: e, resource: n, timeoutInSeconds: r, extraHeaders: i, extraTokenParams: a }) {
      var s;
      const l = this._logger.create("useRefreshToken");
      let c;
      if (this.settings.refreshTokenAllowedScope === void 0) c = t.scope;
      else {
        const h = this.settings.refreshTokenAllowedScope.split(" ");
        c = (((s = t.scope) == null ? void 0 : s.split(" ")) || []).filter((g) => h.includes(g)).join(" ");
      }
      if (this.settings.dpop && this.settings.dpop.store) {
        const h = await this.getDpopProof(this.settings.dpop.store);
        i = {
          ...i,
          DPoP: h
        };
      }
      let d;
      try {
        d = await this._tokenClient.exchangeRefreshToken({
          refresh_token: t.refresh_token,
          scope: c,
          redirect_uri: e,
          resource: n,
          timeoutInSeconds: r,
          extraHeaders: i,
          ...a
        });
      } catch (h) {
        if (h instanceof FA && this.settings.dpop) i.DPoP = await this.getDpopProof(this.settings.dpop.store, h.nonce), d = await this._tokenClient.exchangeRefreshToken({
          refresh_token: t.refresh_token,
          scope: c,
          redirect_uri: e,
          resource: n,
          timeoutInSeconds: r,
          extraHeaders: i,
          ...a
        });
        else throw h;
      }
      const u = new SD(new URLSearchParams());
      return Object.assign(u, d), l.debug("validating response", u), await this._validator.validateRefreshResponse(u, {
        ...t,
        scope: c
      }), u;
    }
    async createSignoutRequest({ state: t, id_token_hint: e, client_id: n, request_type: r, url_state: i, post_logout_redirect_uri: a = this.settings.post_logout_redirect_uri, extraQueryParams: s = this.settings.extraQueryParams } = {}) {
      const l = this._logger.create("createSignoutRequest"), c = await this.metadataService.getEndSessionEndpoint();
      if (!c) throw l.throw(new Error("No end session endpoint")), null;
      l.debug("Received end session endpoint", c), !n && a && !e && (n = this.settings.client_id);
      const d = new WDe({
        url: c,
        id_token_hint: e,
        client_id: n,
        post_logout_redirect_uri: a,
        state_data: t,
        extraQueryParams: s,
        request_type: r,
        url_state: i
      });
      await this.clearStaleState();
      const u = d.state;
      return u && (l.debug("Signout request has state to persist"), await this.settings.stateStore.set(u.id, u.toStorageString())), d;
    }
    async readSignoutResponseState(t, e = false) {
      const n = this._logger.create("readSignoutResponseState"), r = new qDe(r$.readParams(t, this.settings.response_mode));
      if (!r.state) {
        if (n.debug("No state in response"), r.error) throw n.warn("Response was error:", r.error), new H1(r);
        return {
          state: void 0,
          response: r
        };
      }
      const i = await this.settings.stateStore[e ? "remove" : "get"](r.state);
      if (!i) throw n.throw(new Error("No matching state found in storage")), null;
      return {
        state: await t4.fromStorageString(i),
        response: r
      };
    }
    async processSignoutResponse(t) {
      const e = this._logger.create("processSignoutResponse"), { state: n, response: r } = await this.readSignoutResponseState(t, true);
      return n ? (e.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(r, n)) : e.debug("No state from storage; skipping response validation"), r;
    }
    clearStaleState() {
      return this._logger.create("clearStaleState"), t4.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
    }
    async revokeToken(t, e) {
      return this._logger.create("revokeToken"), await this._tokenClient.revoke({
        token: t,
        token_type_hint: e
      });
    }
  }, za = (function(t) {
    return t.NotSupported = "OIDC authentication not supported", t.Misconfigured = "OIDC is misconfigured", t.General = "Something went wrong with OIDC discovery", t.OpSupport = "Configured OIDC OP does not support required functions", t.DynamicRegistrationNotSupported = "Dynamic registration not supported", t.DynamicRegistrationFailed = "Dynamic registration failed", t.DynamicRegistrationInvalid = "Dynamic registration invalid response", t.CodeExchangeFailed = "Failed to exchange code for token", t.InvalidBearerTokenResponse = "Invalid bearer token response", t.InvalidIdToken = "Invalid ID token", t.MissingOrInvalidStoredState = "State required to finish logging in is not found in storage.", t;
  })({}), fB = (t) => !!t && typeof t == "object" && !Array.isArray(t), Iu = (t, e) => !t[e] || !Uy(t, e) ? (_e.error("Missing or invalid property: ".concat(e)), false) : true, Uy = (t, e) => t[e] && typeof t[e] != "string" ? (_e.error("Invalid property: ".concat(e)), false) : true, i$ = (t, e) => t[e] && (!Array.isArray(t[e]) || !t[e].every((n) => typeof n == "string")) ? (_e.error("Invalid property: ".concat(e)), false) : true, a9 = (t, e, n) => {
    var r = t[e];
    return !r || !Array.isArray(r) || !r.includes(n) ? (_e.error("Invalid property: ".concat(e, ". ").concat(n, " is required.")), false) : true;
  }, mB = (t) => {
    if (!fB(t)) throw _e.error("Issuer configuration not found or malformed"), new Error(za.OpSupport);
    var e = [
      Iu(t, "issuer"),
      Iu(t, "authorization_endpoint"),
      Iu(t, "token_endpoint"),
      Iu(t, "revocation_endpoint"),
      Uy(t, "registration_endpoint"),
      Uy(t, "account_management_uri"),
      Uy(t, "device_authorization_endpoint"),
      i$(t, "account_management_actions_supported"),
      a9(t, "response_types_supported", "code"),
      a9(t, "grant_types_supported", "authorization_code"),
      a9(t, "code_challenge_methods_supported", "S256"),
      i$(t, "prompt_values_supported")
    ].some((n) => !n);
    if (!e) return t;
    throw _e.error("Issuer configuration not valid"), new Error(za.OpSupport);
  }, mre = (t) => {
    try {
      return lre(t);
    } catch (e) {
      throw _e.error("Could not decode id_token", e), e;
    }
  }, gre = (t, e, n, r) => {
    try {
      if (!t) throw new Error("No ID token");
      var i = mre(t);
      if (i.iss !== e) throw new Error("Invalid issuer");
      var a = typeof i.aud == "string" ? [
        i.aud
      ] : i.aud;
      if (!a.includes(n)) throw new Error("Invalid audience");
      if (r !== void 0 && i.nonce !== r) throw new Error("Invalid nonce");
      if (!i.exp || Date.now() > i.exp * 1e3) throw new Error("Invalid expiry");
    } catch (s) {
      throw _e.error("Invalid ID token", s), new Error(za.InvalidIdToken);
    }
  };
  function pre(t) {
    if (!fB(t)) throw _e.error("Stored user state not found"), new Error(za.MissingOrInvalidStoredState);
    var e = [
      Iu(t, "homeserverUrl"),
      Iu(t, "nonce"),
      Uy(t, "identityServerUrl")
    ].some((n) => !n);
    if (e) throw new Error(za.MissingOrInvalidStoredState);
  }
  var JDe = (t) => fB(t) && Iu(t, "token_type") && t.token_type.toLowerCase() === "bearer" && Iu(t, "access_token") && Iu(t, "refresh_token") && (!("expires_in" in t) || typeof t.expires_in == "number");
  function Fre(t) {
    if (!JDe(t)) throw new Error(za.InvalidBearerTokenResponse);
  }
  function o$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function n4(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? o$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : o$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var mk = (t) => {
    var e = t ?? kf(10);
    return "openid urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:".concat(e);
  }, XDe = (function() {
    var t = me(function* (e) {
      if (!globalThis.crypto.subtle) return _e.warn("A secure context is required to generate code challenge. Using plain text code challenge"), e;
      var n = yield sre(e);
      return ck(n);
    });
    return function(n) {
      return t.apply(this, arguments);
    };
  })(), QDe = (t) => {
    var { redirectUri: e } = t;
    return {
      scope: mk(),
      redirectUri: e,
      state: kf(8),
      nonce: kf(8),
      codeVerifier: kf(64)
    };
  }, eCe = (function() {
    var t = me(function* (e, n, r) {
      var { scope: i, redirectUri: a, state: s, nonce: l, codeVerifier: c } = r, d = new URL(e);
      return d.searchParams.append("response_mode", "query"), d.searchParams.append("response_type", "code"), d.searchParams.append("redirect_uri", a), d.searchParams.append("client_id", n), d.searchParams.append("state", s), d.searchParams.append("scope", i), d.searchParams.append("nonce", l), d.searchParams.append("code_challenge_method", "S256"), d.searchParams.append("code_challenge", yield XDe(c)), d.toString();
    });
    return function(n, r, i) {
      return t.apply(this, arguments);
    };
  })(), tCe = (function() {
    var t = me(function* (e) {
      var { metadata: n, redirectUri: r, clientId: i, homeserverUrl: a, identityServerUrl: s, nonce: l, prompt: c, urlState: d, loginHint: u } = e, h = mk(), f = new hB(n4(n4({}, n), {}, {
        client_id: i,
        redirect_uri: r,
        authority: n.issuer,
        response_mode: "query",
        response_type: "code",
        scope: h,
        stateStore: new fk({
          prefix: "mx_oidc_",
          store: window.sessionStorage
        })
      })), g = {
        homeserverUrl: a,
        nonce: l,
        identityServerUrl: s
      }, m = yield f.createSigninRequest({
        state: g,
        nonce: l,
        prompt: c,
        url_state: d,
        login_hint: u
      });
      return m.url;
    });
    return function(n) {
      return t.apply(this, arguments);
    };
  })(), nCe = (t) => ({
    id_token: t.id_token,
    scope: t.scope,
    expires_at: t.expires_at,
    refresh_token: t.refresh_token,
    access_token: t.access_token,
    token_type: "Bearer"
  }), rCe = (function() {
    var t = me(function* (e, n) {
      var r = new URL(window.location.origin);
      r.searchParams.append("code", e), r.searchParams.append("state", n), O2.setLogger(_e);
      try {
        var i = new SD(r.searchParams), a = new fk({
          prefix: "mx_oidc_",
          store: window.sessionStorage
        }), s = yield a.get(i.state);
        if (!s) throw new Error(za.MissingOrInvalidStoredState);
        var l = yield uB.fromStorageString(s), c = new hB(n4(n4({}, l), {}, {
          stateStore: a
        })), d = yield c.processSigninResponse(r.href), u = d.userState;
        pre(u), Fre(d), gre(d.id_token, c.settings.authority, c.settings.client_id, u.nonce);
        var h = nCe(d);
        return {
          oidcClientSettings: {
            clientId: c.settings.client_id,
            issuer: c.settings.authority
          },
          tokenResponse: h,
          homeserverUrl: u.homeserverUrl,
          identityServerUrl: u.identityServerUrl,
          idTokenClaims: d.profile
        };
      } catch (g) {
        _e.error("Oidc login failed", g);
        var f = g.message;
        throw Object.values(za).includes(f) ? g : new Error(za.CodeExchangeFailed);
      }
    });
    return function(n, r) {
      return t.apply(this, arguments);
    };
  })();
  function a$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function s$(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? a$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : a$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var gB = (function() {
    var t = me(function* (e) {
      var n = new URL(".well-known/openid-configuration", e), r = yield fetch(n, {
        method: rt.Get,
        signal: sk(5e3)
      }), i = yield r.json();
      return pB(i);
    });
    return function(n) {
      return t.apply(this, arguments);
    };
  })(), pB = (function() {
    var t = me(function* (e) {
      var n = mB(e), r = new vA({
        authority: n.issuer,
        metadata: n,
        redirect_uri: "",
        client_id: ""
      }), i = new dre(r);
      return s$(s$({}, n), {}, {
        signingKeys: yield i.getSigningKeys()
      });
    });
    return function(n) {
      return t.apply(this, arguments);
    };
  })(), iCe = "urn:ietf:params:oauth:grant-type:device_code", s9 = (t, e) => {
    if (!e) return false;
    var n = new URL(e);
    return !(n.protocol !== t.protocol || n.hostname !== t.hostname && !n.hostname.endsWith(".".concat(t.hostname)));
  }, oCe = (function() {
    var t = me(function* (e, n) {
      if (!e.registration_endpoint) throw new Error(za.DynamicRegistrationNotSupported);
      var r = [
        "authorization_code",
        "refresh_token"
      ];
      if (r.some((u) => !e.grant_types_supported.includes(u))) throw new Error(za.DynamicRegistrationNotSupported);
      var i = new URL(n.clientUri), a = {
        client_name: n.clientName,
        client_uri: n.clientUri,
        response_types: [
          "code"
        ],
        grant_types: r,
        redirect_uris: n.redirectUris,
        id_token_signed_response_alg: "RS256",
        token_endpoint_auth_method: "none",
        application_type: n.applicationType,
        contacts: n.contacts,
        logo_uri: s9(i, n.logoUri) ? n.logoUri : void 0,
        policy_uri: s9(i, n.policyUri) ? n.policyUri : void 0,
        tos_uri: s9(i, n.tosUri) ? n.tosUri : void 0
      }, s = {
        Accept: "application/json",
        "Content-Type": "application/json"
      };
      try {
        var l = yield fetch(e.registration_endpoint, {
          method: rt.Post,
          headers: s,
          body: JSON.stringify(a)
        });
        if (l.status >= 400) throw new Error(za.DynamicRegistrationFailed);
        var c = yield l.json(), d = c.client_id;
        if (!d || typeof d != "string") throw new Error(za.DynamicRegistrationInvalid);
        return d;
      } catch (u) {
        throw Object.values(za).includes(u.message) ? u : (_e.error("Dynamic registration request failed", u), new Error(za.DynamicRegistrationFailed));
      }
    });
    return function(n, r) {
      return t.apply(this, arguments);
    };
  })();
  class aCe {
    constructor(e, n, r, i, a) {
      this.idTokenClaims = a, $(this, "oidcClientReady", void 0), $(this, "oidcClient", void 0), $(this, "inflightRefreshRequest", void 0), this.oidcClientReady = this.initialiseOidcClient(e, n, i, r);
    }
    initialiseOidcClient(e, n, r, i) {
      var a = this;
      return me(function* () {
        try {
          var s, l = yield gB(e), c = mk(r);
          a.oidcClient = new hB({
            metadata: l,
            signingKeys: (s = l.signingKeys) !== null && s !== void 0 ? s : void 0,
            client_id: n,
            scope: c,
            redirect_uri: i,
            authority: l.issuer,
            stateStore: new fk({
              prefix: "mx_oidc_",
              store: window.sessionStorage
            })
          });
        } catch (d) {
          throw _e.error("Failed to initialise OIDC client.", d), new Error("Failed to initialise OIDC client.");
        }
      })();
    }
    doRefreshAccessToken(e) {
      var n = this;
      return me(function* () {
        n.inflightRefreshRequest || (n.inflightRefreshRequest = n.getNewTokens(e));
        try {
          var r = yield n.inflightRefreshRequest;
          return r;
        } catch (i) {
          throw i instanceof H1 ? new X7(i) : i;
        } finally {
          n.inflightRefreshRequest = void 0;
        }
      })();
    }
    persistTokens(e) {
      return me(function* () {
      })();
    }
    getNewTokens(e) {
      var n = this;
      return me(function* () {
        if (!n.oidcClient) throw new Error("Cannot get new token before OIDC client is initialised.");
        var r = {
          refresh_token: e,
          session_state: "test",
          data: void 0,
          profile: n.idTokenClaims
        }, i = Date.now(), a = yield n.oidcClient.useRefreshToken({
          state: r,
          timeoutInSeconds: 300
        }), s = {
          accessToken: a.access_token,
          refreshToken: a.refresh_token,
          expiry: a.expires_in ? new Date(i + a.expires_in * 1e3) : void 0
        };
        return yield n.persistTokens(s), s;
      })();
    }
  }
  var sCe = [
    "server",
    "limit",
    "since"
  ];
  function l$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function No(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? l$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : l$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var lCe = 3e3, c$ = 600 * 1e3, cCe = new xo("last_seen_user_agent", "org.matrix.msc3852.last_seen_user_agent"), $1 = (function(t) {
    return t.Chronological = "chronological", t.Detached = "detached", t;
  })({}), dCe = new $b("m.get_login_token", "org.matrix.msc3882.get_login_token"), vre = "uk.half-shot.msc2666", _re = "uk.half-shot.msc2666.mutual_rooms", yre = "uk.half-shot.msc2666.query_mutual_rooms", kd = "org.matrix.msc4140", bre = "uk.tcpip.msc4133", xre = "uk.tcpip.msc4133.stable", dd = "$", jt = (function(t) {
    return t.Sync = "sync", t.Event = "event", t.ToDeviceEvent = "toDeviceEvent", t.ReceivedToDeviceMessage = "receivedToDeviceMessage", t.AccountData = "accountData", t.Room = "Room", t.DeleteRoom = "deleteRoom", t.SyncUnexpectedError = "sync.unexpectedError", t.ClientWellKnown = "WellKnown.client", t.ReceivedVoipEvent = "received_voip_event", t.TurnServers = "turnServers", t.TurnServersError = "turnServers.error", t;
  })({}), uCe = new xo("action", "org.matrix.msc3824.action");
  class gk extends ji {
    constructor(e) {
      var n, r, i, a, s;
      super(), i = this, $(this, "logger", void 0), $(this, "reEmitter", new IF(this)), $(this, "olmVersion", null), $(this, "usingExternalCrypto", false), $(this, "_store", void 0), $(this, "deviceId", void 0), $(this, "credentials", void 0), $(this, "legacyPickleKey", void 0), $(this, "scheduler", void 0), $(this, "clientRunning", false), $(this, "timelineSupport", false), $(this, "urlPreviewCache", {}), $(this, "identityServer", void 0), $(this, "http", void 0), $(this, "cryptoBackend", void 0), $(this, "enableEncryptedStateEvents", void 0), $(this, "cryptoCallbacks", void 0), $(this, "callEventHandler", void 0), $(this, "groupCallEventHandler", void 0), $(this, "supportsCallTransfer", false), $(this, "forceTURN", false), $(this, "iceCandidatePoolSize", 0), $(this, "idBaseUrl", void 0), $(this, "baseUrl", void 0), $(this, "isVoipWithNoMediaAllowed", void 0), $(this, "useLivekitForGroupCalls", void 0), $(this, "canSupportVoip", false), $(this, "peekSync", null), $(this, "isGuestAccount", false), $(this, "ongoingScrollbacks", {}), $(this, "notifTimelineSet", null), $(this, "legacyCryptoStore", void 0), $(this, "verificationMethods", void 0), $(this, "fallbackICEServerAllowed", false), $(this, "syncApi", void 0), $(this, "roomNameGenerator", void 0), $(this, "pushRules", void 0), $(this, "syncLeftRoomsPromise", void 0), $(this, "syncedLeftRooms", false), $(this, "clientOpts", void 0), $(this, "clientWellKnownIntervalID", void 0), $(this, "canResetTimelineCallback", void 0), $(this, "canSupport", /* @__PURE__ */ new Map()), $(this, "pushProcessor", new Oa(this)), $(this, "serverVersionsPromise", void 0), $(this, "clientWellKnown", void 0), $(this, "clientWellKnownPromise", void 0), $(this, "turnServers", []), $(this, "turnServersExpiry", 0), $(this, "checkTurnServersIntervalID", void 0), $(this, "txnCtr", 0), $(this, "mediaHandler", new nDe(this)), $(this, "sessionId", void 0), $(this, "eventsBeingEncrypted", /* @__PURE__ */ new Set()), $(this, "useE2eForGroupCall", true), $(this, "toDeviceMessageQueue", void 0), $(this, "livekitServiceURL", void 0), $(this, "_secretStorage", void 0), $(this, "ignoredInvites", void 0), $(this, "matrixRTC", void 0), $(this, "serverCapabilitiesService", void 0), $(this, "startCallEventHandler", () => {
        this.isInitialSyncComplete() && (lA() && (this.callEventHandler.start(), this.groupCallEventHandler.start()), this.off(jt.Sync, this.startCallEventHandler));
      }), $(this, "startMatrixRTC", () => {
        this.isInitialSyncComplete() && (this.matrixRTC.start(), this.off(jt.Sync, this.startMatrixRTC));
      }), $(this, "fixupRoomNotifications", () => {
        if (this.isInitialSyncComplete()) {
          var c, d = ((c = this.getRooms()) !== null && c !== void 0 ? c : []).filter((f) => f.getUnreadNotificationCount(ir.Total) > 0);
          for (var u of d) {
            var h = this.getSafeUserId();
            u.fixupNotifications(h);
          }
          this.off(jt.Sync, this.fixupRoomNotifications);
        }
      }), this.logger = (n = e.logger) !== null && n !== void 0 ? n : _e, e.baseUrl = Kj(e.baseUrl), e.idBaseUrl = Kj(e.idBaseUrl), this.baseUrl = e.baseUrl, this.idBaseUrl = e.idBaseUrl, this.identityServer = e.identityServer, this.usingExternalCrypto = (r = e.usingExternalCrypto) !== null && r !== void 0 ? r : false, this.store = e.store || new iwe(), this.deviceId = e.deviceId || null, this.sessionId = kf(10);
      var l = e.userId || null;
      this.credentials = {
        userId: l
      }, this.http = new Une(this, {
        fetchFn: e.fetchFn,
        baseUrl: e.baseUrl,
        idBaseUrl: e.idBaseUrl,
        accessToken: e.accessToken,
        refreshToken: e.refreshToken,
        tokenRefreshFunction: e.tokenRefreshFunction,
        prefix: zo.V3,
        onlyData: true,
        extraParams: e.queryParams,
        localTimeoutMs: e.localTimeoutMs,
        useAuthorizationHeader: e.useAuthorizationHeader,
        logger: this.logger
      }), e.pickleKey && (this.legacyPickleKey = e.pickleKey), this.useLivekitForGroupCalls = !!e.useLivekitForGroupCalls, this.scheduler = e.scheduler, this.scheduler && this.scheduler.setProcessFunction((function() {
        var c = me(function* (d) {
          var u = i.getRoom(d.getRoomId());
          d.status !== Vn.SENDING && i.updatePendingEventStatus(u, d, Vn.SENDING);
          var h = yield i.sendEventHttpRequest(d);
          return u && u.updatePendingEvent(d, Vn.SENT, h.event_id), h;
        });
        return function(d) {
          return c.apply(this, arguments);
        };
      })()), lA() && (this.callEventHandler = new Cwe(this), this.groupCallEventHandler = new Ewe(this), this.canSupportVoip = true, this.on(jt.Sync, this.startCallEventHandler)), this.matrixRTC = new jDe(this.logger, this), this.serverCapabilitiesService = new Hne(this.logger, this.http), this.on(jt.Sync, this.fixupRoomNotifications), this.timelineSupport = !!e.timelineSupport, this.legacyCryptoStore = e.cryptoStore, this.verificationMethods = e.verificationMethods, this.cryptoCallbacks = e.cryptoCallbacks || {}, this.enableEncryptedStateEvents = (a = e.enableEncryptedStateEvents) !== null && a !== void 0 ? a : false, this.forceTURN = e.forceTURN || false, this.iceCandidatePoolSize = e.iceCandidatePoolSize === void 0 ? 0 : e.iceCandidatePoolSize, this.supportsCallTransfer = e.supportsCallTransfer || false, this.fallbackICEServerAllowed = e.fallbackICEServerAllowed || false, this.isVoipWithNoMediaAllowed = e.isVoipWithNoMediaAllowed || false, e.useE2eForGroupCall !== void 0 && (this.useE2eForGroupCall = e.useE2eForGroupCall), this.livekitServiceURL = e.livekitServiceURL, this.roomNameGenerator = e.roomNameGenerator, this.toDeviceMessageQueue = new fDe(this, this.logger), this.on(or.Decrypted, (c) => {
        wre(this, c);
      }), this.ignoredInvites = new mDe(this), this._secretStorage = new rre(this, (s = e.cryptoCallbacks) !== null && s !== void 0 ? s : {}), this.setMaxListeners(0);
    }
    set store(e) {
      this._store = e, this._store.setUserCreator((n) => Md.createUser(n, this));
    }
    get store() {
      return this._store;
    }
    startClient(e) {
      var n = this;
      return me(function* () {
        if (!n.clientRunning) {
          n.clientRunning = true, n.on(jt.Sync, n.startMatrixRTC);
          var r = n.getUserId();
          r && n.store.storeUser(new Md(r)), n.canSupportVoip && (n.checkTurnServersIntervalID = setInterval(() => {
            n.checkTurnServers();
          }, c$), n.checkTurnServers()), n.syncApi && (n.logger.error("Still have sync object whilst not running: stopping old one"), n.syncApi.stop());
          try {
            yield n.getVersions();
            var { threads: i, list: a, fwdPagination: s } = yield n.doesServerSupportThread();
            Ei.setServerSideSupport(i), Ei.setServerSideListSupport(a), Ei.setServerSideFwdPaginationSupport(s);
          } catch (l) {
            n.logger.error("Can't fetch server versions, continuing to initialise sync, this will be retried later", l);
          }
          n.clientOpts = e ?? {}, n.clientOpts.slidingSync ? n.syncApi = new Qne(n.clientOpts.slidingSync, n, n.clientOpts, n.buildSyncApiOptions()) : n.syncApi = new gf(n, n.clientOpts, n.buildSyncApiOptions()), n.syncApi.sync().catch((l) => n.logger.info("Sync startup aborted with an error:", l)), n.clientOpts.clientWellKnownPollPeriod !== void 0 && (n.clientWellKnownIntervalID = setInterval(() => {
            n.fetchClientWellKnown();
          }, 1e3 * n.clientOpts.clientWellKnownPollPeriod), n.fetchClientWellKnown()), n.toDeviceMessageQueue.start(), n.serverCapabilitiesService.start();
        }
      })();
    }
    buildSyncApiOptions() {
      return {
        cryptoCallbacks: this.cryptoBackend,
        canResetEntireTimeline: (e) => this.canResetTimelineCallback ? this.canResetTimelineCallback(e) : false,
        logger: this.logger.getChild("sync")
      };
    }
    stopClient() {
      var e, n, r, i, a;
      (e = this.cryptoBackend) === null || e === void 0 || e.stop(), this.off(jt.Sync, this.startMatrixRTC), this.clientRunning && (this.logger.debug("stopping MatrixClient"), this.clientRunning = false, (n = this.syncApi) === null || n === void 0 || n.stop(), this.syncApi = void 0, (r = this.peekSync) === null || r === void 0 || r.stopPeeking(), (i = this.callEventHandler) === null || i === void 0 || i.stop(), (a = this.groupCallEventHandler) === null || a === void 0 || a.stop(), this.callEventHandler = void 0, this.groupCallEventHandler = void 0, globalThis.clearInterval(this.checkTurnServersIntervalID), this.checkTurnServersIntervalID = void 0, this.clientWellKnownIntervalID !== void 0 && globalThis.clearInterval(this.clientWellKnownIntervalID), this.toDeviceMessageQueue.stop(), this.matrixRTC.stop(), this.serverCapabilitiesService.stop());
    }
    clearStores() {
      var e = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      if (this.clientRunning) throw new Error("Cannot clear stores while client is running");
      var r = [];
      r.push(this.store.deleteAllData()), this.legacyCryptoStore && r.push(this.legacyCryptoStore.deleteAllData());
      var i = (function() {
        var a = me(function* () {
          var s;
          try {
            if (s = globalThis.indexedDB, !s) return;
          } catch {
            return;
          }
          var l = function* (f) {
            var g = new Promise((m, v) => {
              e.logger.info("Removing IndexedDB instance ".concat(f));
              var y = s.deleteDatabase(f);
              y.onsuccess = (w) => {
                e.logger.info("Removed IndexedDB instance ".concat(f)), m(0);
              }, y.onerror = (w) => {
                e.logger.warn("Failed to remove IndexedDB instance ".concat(f, ":"), w), m(0);
              }, y.onblocked = (w) => {
                e.logger.info("cannot yet remove IndexedDB instance ".concat(f));
              };
            });
            yield g;
          };
          for (var c of [
            "".concat((d = n.cryptoDatabasePrefix) !== null && d !== void 0 ? d : n9, "::matrix-sdk-crypto"),
            "".concat((u = n.cryptoDatabasePrefix) !== null && u !== void 0 ? u : n9, "::matrix-sdk-crypto-meta")
          ]) {
            var d, u;
            yield* l(c);
          }
        });
        return function() {
          return a.apply(this, arguments);
        };
      })();
      return r.push(i()), Promise.all(r).then();
    }
    getUserId() {
      var e, n;
      return (e = (n = this.credentials) === null || n === void 0 ? void 0 : n.userId) !== null && e !== void 0 ? e : null;
    }
    getSafeUserId() {
      var e = this.getUserId();
      if (!e) throw new Error("Expected logged in user but found none.");
      return e;
    }
    getDomain() {
      var e;
      return (e = this.credentials) !== null && e !== void 0 && e.userId ? this.credentials.userId.replace(/^.*?:/, "") : null;
    }
    getUserIdLocalpart() {
      var e, n;
      return (e = (n = this.credentials) === null || n === void 0 || (n = n.userId) === null || n === void 0 ? void 0 : n.split(":")[0].substring(1)) !== null && e !== void 0 ? e : null;
    }
    getDeviceId() {
      return this.deviceId;
    }
    getSessionId() {
      return this.sessionId;
    }
    supportsVoip() {
      return this.canSupportVoip;
    }
    getMediaHandler() {
      return this.mediaHandler;
    }
    setForceTURN(e) {
      this.forceTURN = e;
    }
    setSupportsCallTransfer(e) {
      this.supportsCallTransfer = e;
    }
    getUseE2eForGroupCall() {
      return this.useE2eForGroupCall;
    }
    createCall(e) {
      return B2(this, e);
    }
    createGroupCall(e, n, r, i, a, s) {
      var l = this;
      return me(function* () {
        if (l.getGroupCallForRoom(e)) throw new Error("".concat(e, " already has an existing group call"));
        var c = l.getRoom(e);
        if (!c) throw new Error("Cannot find room ".concat(e));
        return new iB(l, c, n, r, i, void 0, a || l.isVoipWithNoMediaAllowed, s, l.isVoipWithNoMediaAllowed, l.useLivekitForGroupCalls, l.livekitServiceURL).create();
      })();
    }
    getLivekitServiceURL() {
      return this.livekitServiceURL;
    }
    setLivekitServiceURL(e) {
      this.livekitServiceURL = e;
    }
    waitUntilRoomReadyForGroupCalls(e) {
      return this.groupCallEventHandler.waitUntilRoomReadyForGroupCalls(e);
    }
    getGroupCallForRoom(e) {
      return this.groupCallEventHandler.groupCalls.get(e) || null;
    }
    getSyncState() {
      var e, n;
      return (e = (n = this.syncApi) === null || n === void 0 ? void 0 : n.getSyncState()) !== null && e !== void 0 ? e : null;
    }
    getSyncStateData() {
      return this.syncApi ? this.syncApi.getSyncStateData() : null;
    }
    isInitialSyncComplete() {
      var e = this.getSyncState();
      return e ? e === Nn.Prepared || e === Nn.Syncing : false;
    }
    isGuest() {
      return this.isGuestAccount;
    }
    setGuest(e) {
      this.isGuestAccount = e;
    }
    getScheduler() {
      return this.scheduler;
    }
    retryImmediately() {
      var e, n;
      return this.toDeviceMessageQueue.sendQueue(), (e = (n = this.syncApi) === null || n === void 0 ? void 0 : n.retryImmediately()) !== null && e !== void 0 ? e : false;
    }
    getNotifTimelineSet() {
      return this.notifTimelineSet;
    }
    setNotifTimelineSet(e) {
      this.notifTimelineSet = e;
    }
    getCapabilities() {
      var e = this;
      return me(function* () {
        var n = e.serverCapabilitiesService.getCachedCapabilities();
        return n || e.serverCapabilitiesService.fetchCapabilities();
      })();
    }
    getCachedCapabilities() {
      return this.serverCapabilitiesService.getCachedCapabilities();
    }
    fetchCapabilities() {
      return this.serverCapabilitiesService.fetchCapabilities();
    }
    initRustCrypto() {
      var e = arguments, n = this;
      return me(function* () {
        var r, i, a = e.length > 0 && e[0] !== void 0 ? e[0] : {};
        if (n.cryptoBackend) {
          n.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");
          return;
        }
        var s = n.getUserId();
        if (s === null) throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");
        var l = n.getDeviceId();
        if (l === null) throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");
        n.logger.debug("Downloading Rust crypto library");
        var c = yield L1(() => import("./index-CB8tGS23.js"), []), d = yield c.initRustCrypto({
          logger: n.logger,
          http: n.http,
          userId: s,
          deviceId: l,
          secretStorage: n.secretStorage,
          cryptoCallbacks: n.cryptoCallbacks,
          storePrefix: a.useIndexedDB === false ? null : (r = a.cryptoDatabasePrefix) !== null && r !== void 0 ? r : n9,
          storeKey: a.storageKey,
          storePassphrase: a.storagePassword,
          legacyCryptoStore: n.legacyCryptoStore,
          legacyPickleKey: (i = n.legacyPickleKey) !== null && i !== void 0 ? i : "DEFAULT_KEY",
          legacyMigrationProgressListener: (u, h) => {
            n.emit(oi.LegacyCryptoStoreMigrationProgress, u, h);
          },
          enableEncryptedStateEvents: n.enableEncryptedStateEvents
        });
        d.setSupportedVerificationMethods(n.verificationMethods), n.cryptoBackend = d, n.on(Ui.Membership, d.onRoomMembership.bind(d)), n.on(jt.Event, (u) => {
          d.onLiveEventFromSync(u);
        }), n.reEmitter.reEmit(d, [
          oi.VerificationRequestReceived,
          oi.UserTrustStatusChanged,
          oi.KeyBackupStatus,
          oi.KeyBackupSessionsRemaining,
          oi.KeyBackupFailed,
          oi.KeyBackupDecryptionKeyCached,
          oi.KeysChanged,
          oi.DevicesUpdated,
          oi.WillUpdateDevices,
          oi.DehydratedDeviceCreated,
          oi.DehydratedDeviceUploaded,
          oi.RehydrationStarted,
          oi.RehydrationProgress,
          oi.RehydrationCompleted,
          oi.RehydrationError,
          oi.DehydrationKeyCached,
          oi.DehydratedDeviceRotationError
        ]);
      })();
    }
    get secretStorage() {
      return this._secretStorage;
    }
    getCrypto() {
      return this.cryptoBackend;
    }
    isRoomEncrypted(e) {
      var n = this.getRoom(e);
      return n ? n.hasEncryptionStateEvent() : false;
    }
    isKeyBackupKeyStored() {
      return Promise.resolve(this.secretStorage.isStored("m.megolm_backup.v1"));
    }
    makeKeyBackupPath(e, n, r) {
      var i;
      n !== void 0 ? i = rn("/room_keys/keys/$roomId/$sessionId", {
        $roomId: e,
        $sessionId: n
      }) : e !== void 0 ? i = rn("/room_keys/keys/$roomId", {
        $roomId: e
      }) : i = "/room_keys/keys";
      var a = r === void 0 ? void 0 : {
        version: r
      };
      return {
        path: i,
        queryData: a
      };
    }
    deleteKeysFromBackup(e, n, r) {
      var i = this;
      return me(function* () {
        var a = i.makeKeyBackupPath(e, n, r);
        yield i.http.authedRequest(rt.Delete, a.path, a.queryData, void 0, {
          prefix: zo.V3
        });
      })();
    }
    getMediaConfig() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, n = e ? "/media/config" : "/config";
      return this.http.authedRequest(rt.Get, n, void 0, void 0, {
        prefix: e ? zo.V1 : c1.V3
      });
    }
    getRoom(e) {
      return e ? this.store.getRoom(e) : null;
    }
    getRooms() {
      return this.store.getRooms();
    }
    getVisibleRooms() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, n = this.store.getRooms(), r = new Set(n);
      for (var i of r) {
        var a = this.findPredecessorRooms(i, true, e);
        for (var s of a) r.delete(s);
      }
      return Array.from(r);
    }
    getUser(e) {
      return this.store.getUser(e);
    }
    getUsers() {
      return this.store.getUsers();
    }
    setAccountData(e, n) {
      var r = this;
      return me(function* () {
        if (!r.clientRunning) return r.logger.warn("Calling `setAccountData` before the client is started: `getAccountData` may return inconsistent results."), yield eA(5, () => r.setAccountDataRaw(e, n));
        var i = r.store.getAccountData(e);
        if (i && zg(i.event.content, n)) return {};
        var a = Promise.withResolvers();
        function s(c) {
          c.getType() === e && a.resolve();
        }
        r.addListener(jt.AccountData, s);
        try {
          var l = yield eA(5, () => r.setAccountDataRaw(e, n));
          return yield a.promise, l;
        } finally {
          r.removeListener(jt.AccountData, s);
        }
      })();
    }
    setAccountDataRaw(e, n) {
      var r = rn("/user/$userId/account_data/$type", {
        $userId: this.credentials.userId,
        $type: e
      });
      return this.http.authedRequest(rt.Put, r, void 0, n);
    }
    getAccountData(e) {
      return this.store.getAccountData(e);
    }
    getAccountDataFromServer(e) {
      var n = this;
      return me(function* () {
        if (n.isInitialSyncComplete()) {
          var r = n.store.getAccountData(e);
          return r ? r.getContent() : null;
        }
        var i = rn("/user/$userId/account_data/$type", {
          $userId: n.credentials.userId,
          $type: e
        });
        try {
          return yield n.http.authedRequest(rt.Get, i);
        } catch (s) {
          var a;
          if (((a = s.data) === null || a === void 0 ? void 0 : a.errcode) === "M_NOT_FOUND") return null;
          throw s;
        }
      })();
    }
    deleteAccountData(e) {
      var n = this;
      return me(function* () {
        var r = n.canSupport.get($o.AccountDataDeletion);
        if (r === Ho.Unsupported) {
          yield n.setAccountData(e, {});
          return;
        }
        var i = rn("/user/$userId/account_data/$type", {
          $userId: n.getSafeUserId(),
          $type: e
        }), a = r === Ho.Unstable ? {
          prefix: "/_matrix/client/unstable/org.matrix.msc3391"
        } : void 0;
        return yield n.http.authedRequest(rt.Delete, i, void 0, void 0, a);
      })();
    }
    getIgnoredUsers() {
      var e = this.getAccountData(ce.IgnoredUserList);
      return e != null && e.getContent().ignored_users ? Object.keys(e.getContent().ignored_users) : [];
    }
    setIgnoredUsers(e) {
      var n = {
        ignored_users: {}
      };
      return e.forEach((r) => {
        n.ignored_users[r] = {};
      }), this.setAccountData(ce.IgnoredUserList, n);
    }
    isUserIgnored(e) {
      return this.getIgnoredUsers().includes(e);
    }
    joinRoom(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i, a, s = n.length > 1 && n[1] !== void 0 ? n[1] : {}, l = r.getRoom(e), c = l == null ? void 0 : l.getMember(r.getSafeUserId()), d = c == null ? void 0 : c.membership, u = d == Ht.Invite && (i = c == null || (a = c.events.member) === null || a === void 0 ? void 0 : a.getSender()) !== null && i !== void 0 ? i : null;
        if (r.logger.debug("joinRoom[".concat(e, "]: preJoinMembership=").concat(d, ", inviter=").concat(u, ", opts=").concat(JSON.stringify(s))), d == Ht.Join) return l;
        var h = Promise.resolve();
        if (s.inviteSignUrl) {
          var f = new URL(s.inviteSignUrl);
          f.searchParams.set("mxid", r.credentials.userId), h = r.http.requestOtherUrl(rt.Post, f);
        }
        var g = {};
        s.viaServers && (g.server_name = s.viaServers, g.via = s.viaServers);
        var m = {}, v = yield h;
        v && (m.third_party_signed = v);
        var y = rn("/join/$roomid", {
          $roomid: e
        }), w = yield r.http.authedRequest(rt.Post, y, g, m), b = w.room_id;
        s.acceptSharedHistory && u && r.cryptoBackend && (yield r.cryptoBackend.maybeAcceptKeyBundle(b, u));
        var j = r.getRoom(b);
        if (j != null && j.hasMembershipState(r.credentials.userId, Ht.Join)) return j;
        var k = new gf(r, r.clientOpts, r.buildSyncApiOptions());
        return k.createRoom(b);
      })();
    }
    knockRoom(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = this.getRoom(e);
      if (r != null && r.hasMembershipState(this.credentials.userId, Ht.Knock)) return Promise.resolve({
        room_id: r.roomId
      });
      var i = rn("/knock/$roomIdOrAlias", {
        $roomIdOrAlias: e
      }), a = {};
      n.viaServers && (a.server_name = n.viaServers, a.via = n.viaServers);
      var s = {};
      return n.reason && (s.reason = n.reason), this.http.authedRequest(rt.Post, i, a, s);
    }
    resendEvent(e, n) {
      return this.toDeviceMessageQueue.sendQueue(), this.updatePendingEventStatus(n, e, Vn.SENDING), this.encryptAndSendEvent(n, e);
    }
    cancelPendingEvent(e) {
      if (![
        Vn.QUEUED,
        Vn.NOT_SENT,
        Vn.ENCRYPTING
      ].includes(e.status)) throw new Error("cannot cancel an event with status " + e.status);
      e.status === Vn.ENCRYPTING ? this.eventsBeingEncrypted.delete(e.getId()) : this.scheduler && e.status === Vn.QUEUED && this.scheduler.removeEventFromQueue(e);
      var n = this.getRoom(e.getRoomId());
      this.updatePendingEventStatus(n, e, Vn.CANCELLED);
    }
    setRoomName(e, n) {
      return this.sendStateEvent(e, ce.RoomName, {
        name: n
      });
    }
    setRoomTopic(e, n, r) {
      var i = jne(n, r);
      return this.sendStateEvent(e, ce.RoomTopic, i);
    }
    getRoomTags(e) {
      var n = rn("/user/$userId/rooms/$roomId/tags", {
        $userId: this.credentials.userId,
        $roomId: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    setRoomTag(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = rn("/user/$userId/rooms/$roomId/tags/$tag", {
        $userId: this.credentials.userId,
        $roomId: e,
        $tag: n
      });
      return this.http.authedRequest(rt.Put, i, void 0, r);
    }
    deleteRoomTag(e, n) {
      var r = rn("/user/$userId/rooms/$roomId/tags/$tag", {
        $userId: this.credentials.userId,
        $roomId: e,
        $tag: n
      });
      return this.http.authedRequest(rt.Delete, r);
    }
    setRoomAccountData(e, n, r) {
      var i = rn("/user/$userId/rooms/$roomId/account_data/$type", {
        $userId: this.credentials.userId,
        $roomId: e,
        $type: n
      });
      return this.http.authedRequest(rt.Put, i, void 0, r);
    }
    setPowerLevel(e, n, r) {
      var i = this;
      return me(function* () {
        var a, s;
        if (i.clientRunning && i.isInitialSyncComplete()) {
          var l;
          s = (l = i.getRoom(e)) === null || l === void 0 || (l = l.currentState) === null || l === void 0 || (l = l.getStateEvents(ce.RoomPowerLevels, "")) === null || l === void 0 ? void 0 : l.getContent();
        }
        if (!s) try {
          s = yield i.getStateEvent(e, ce.RoomPowerLevels, "");
        } catch (u) {
          if (u instanceof Un && u.errcode === "M_NOT_FOUND") s = {};
          else throw u;
        }
        s = Gb(s), (a = s) !== null && a !== void 0 && a.users || (s.users = {});
        var c = Array.isArray(n) ? n : [
          n
        ];
        for (var d of c) r == null ? delete s.users[d] : s.users[d] = r;
        return i.sendStateEvent(e, ce.RoomPowerLevels, s, "");
      })();
    }
    unstable_createLiveBeacon(e, n) {
      var r = this;
      return me(function* () {
        return r.unstable_setLiveBeacon(e, n);
      })();
    }
    unstable_setLiveBeacon(e, n) {
      var r = this;
      return me(function* () {
        return r.sendStateEvent(e, G7.name, n, r.getUserId());
      })();
    }
    sendEvent(e, n, r, i, a) {
      var s, l, c, d;
      return !(n != null && n.startsWith(dd)) && n !== null ? (d = i, c = r, l = n, s = null) : (d = a, c = i, l = r, s = n), this.addThreadRelationIfNeeded(c, s, e), this.sendCompleteEvent(e, s, {
        type: l,
        content: c
      }, d);
    }
    addThreadRelationIfNeeded(e, n, r) {
      var i;
      if (n && !((i = e["m.relates_to"]) !== null && i !== void 0 && i.rel_type)) {
        var a, s, l = !!((a = e["m.relates_to"]) !== null && a !== void 0 && a["m.in_reply_to"]);
        e["m.relates_to"] = No(No({}, e["m.relates_to"]), {}, {
          rel_type: pi.name,
          event_id: n,
          is_falling_back: !l
        });
        var c = (s = this.getRoom(r)) === null || s === void 0 ? void 0 : s.getThread(n);
        if (c && !l) {
          var d, u;
          e["m.relates_to"]["m.in_reply_to"] = {
            event_id: (d = (u = c.lastReply((h) => h.isRelation(pi.name) && !h.status)) === null || u === void 0 ? void 0 : u.getId()) !== null && d !== void 0 ? d : n
          };
        }
      }
    }
    sendCompleteEvent(e, n, r, i, a) {
      var s, l;
      typeof i == "string" ? l = i : (s = i, l = a), l || (l = this.makeTxnId());
      var c = new to(Object.assign(r, {
        event_id: "~" + e + ":" + l,
        user_id: this.credentials.userId,
        sender: this.credentials.userId,
        room_id: e,
        origin_server_ts: (/* @__PURE__ */ new Date()).getTime()
      })), d = this.getRoom(e), u = n ? d == null ? void 0 : d.getThread(n) : void 0;
      u && c.setThread(u), s || (this.reEmitter.reEmit(c, [
        or.Replaced,
        or.VisibilityChange
      ]), d == null ? void 0 : d.reEmitter.reEmit(c, [
        or.BeforeRedaction
      ]));
      var h = c.getAssociatedId();
      if (h != null && h.startsWith("~")) {
        var f = d == null ? void 0 : d.getPendingEvents().find((m) => m.getId() === h);
        f == null ? void 0 : f.once(or.LocalEventIdReplaced, () => {
          c.updateAssociatedId(f.getId());
        });
      }
      var g = c.getType();
      return this.logger.debug("sendEvent of type ".concat(g, " in ").concat(e, " with txnId ").concat(l).concat(s ? " (delayed event)" : "")), c.setTxnId(l), c.setStatus(Vn.SENDING), s ? this.encryptAndSendEvent(d, c, s) : (d == null ? void 0 : d.addPendingEvent(c, l), c.status === Vn.NOT_SENT ? Promise.reject(new Error("Event blocked by other events not yet sent")) : this.encryptAndSendEvent(d, c));
    }
    encryptAndSendEvent(e, n, r) {
      var i = this;
      return me(function* () {
        if (r) return i.sendEventHttpRequest(n, r);
        try {
          var a;
          i.eventsBeingEncrypted.add(n.getId());
          try {
            yield i.encryptEventIfNeeded(n, e ?? void 0);
          } finally {
            a = !i.eventsBeingEncrypted.delete(n.getId());
          }
          if (a) return {};
          n.status === Vn.ENCRYPTING && i.updatePendingEventStatus(e, n, Vn.SENDING);
          var s = null;
          return i.scheduler && (s = i.scheduler.queueEvent(n), s && i.scheduler.getQueueForEvent(n).length > 1 && i.updatePendingEventStatus(e, n, Vn.QUEUED)), s || (s = i.sendEventHttpRequest(n), e && (s = s.then((l) => (e.updatePendingEvent(n, Vn.SENT, l.event_id), l)))), yield s;
        } catch (l) {
          i.logger.error("Error sending event", l);
          try {
            n.error = l, i.updatePendingEventStatus(e, n, Vn.NOT_SENT);
          } catch (c) {
            i.logger.error("Exception in error handler!", c);
          }
          throw l instanceof Un && (l.event = n), l;
        }
      })();
    }
    encryptEventIfNeeded(e, n) {
      var r = this;
      return me(function* () {
        if (n && (yield r.shouldEncryptEventForRoom(e, n)) && !(!r.cryptoBackend && r.usingExternalCrypto)) {
          if (!r.cryptoBackend) throw new Error("This room is configured to use encryption, but your client does not support encryption.");
          r.updatePendingEventStatus(n, e, Vn.ENCRYPTING), yield r.cryptoBackend.encryptEvent(e, n);
        }
      })();
    }
    shouldEncryptEventForRoom(e, n) {
      var r = this;
      return me(function* () {
        var i;
        return e.isEncrypted() || e.getType() === ce.Reaction || e.isRedaction() ? false : !!(n.hasEncryptionStateEvent() || (yield (i = r.cryptoBackend) === null || i === void 0 ? void 0 : i.isEncryptionEnabledInRoom(n.roomId)));
      })();
    }
    getEncryptedIfNeededEventType(e, n) {
      var r;
      return n === ce.Reaction ? n : (r = this.getRoom(e)) !== null && r !== void 0 && r.hasEncryptionStateEvent() ? ce.RoomMessageEncrypted : n;
    }
    updatePendingEventStatus(e, n, r) {
      e ? e.updatePendingEvent(n, r) : n.setStatus(r);
    }
    sendEventHttpRequest(e, n) {
      var r = e.getTxnId();
      r || (r = this.makeTxnId(), e.setTxnId(r));
      var i = {
        $roomId: e.getRoomId(),
        $eventType: e.getWireType(),
        $stateKey: e.getStateKey(),
        $txnId: r
      }, a;
      if (e.isState()) {
        var s = "/rooms/$roomId/state/$eventType";
        e.getStateKey() && e.getStateKey().length > 0 && (s = "/rooms/$roomId/state/$eventType/$stateKey"), a = rn(s, i);
      } else if (e.isRedaction() && e.event.redacts) {
        var l = "/rooms/$roomId/redact/$redactsEventId/$txnId";
        a = rn(l, No({
          $redactsEventId: e.event.redacts
        }, i));
      } else a = rn("/rooms/$roomId/send/$eventType/$txnId", i);
      var c = e.getWireContent();
      return n ? this.http.authedRequest(rt.Put, a, d$(n), c) : this.http.authedRequest(rt.Put, a, void 0, c).then((d) => (this.logger.debug("Event sent to ".concat(e.getRoomId(), " with event id ").concat(d.event_id)), d));
    }
    redactEvent(e, n, r, i, a) {
      var s, l, c;
      (s = r) !== null && s !== void 0 && s.startsWith(dd) || (a = i, i = r, r = n, n = null);
      var d = (l = a) === null || l === void 0 ? void 0 : l.reason, u = {
        reason: d
      };
      if (((c = a) === null || c === void 0 ? void 0 : c.with_rel_types) !== void 0) {
        if (this.canSupport.get($o.RelationBasedRedactions) === Ho.Unsupported) throw new Error("Server does not support relation based redactions " + "roomId ".concat(e, " eventId ").concat(r, " txnId: ").concat(i, " threadId ").concat(n));
        var h = this.canSupport.get($o.RelationBasedRedactions) === Ho.Stable ? qR.stable : qR.unstable;
        u[h] = a.with_rel_types;
      }
      return this.sendCompleteEvent(e, n, {
        type: ce.RoomRedaction,
        content: u,
        redacts: r
      }, i);
    }
    sendMessage(e, n, r, i) {
      typeof n != "string" && n !== null && (i = r, r = n, n = null);
      var a = ce.RoomMessage, s = r;
      return this.sendEvent(e, n, a, s, i);
    }
    sendTextMessage(e, n, r, i) {
      var a;
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (i = r, r = n, n = null);
      var s = Dne(r);
      return this.sendMessage(e, n, s, i);
    }
    sendNotice(e, n, r, i) {
      var a;
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (i = r, r = n, n = null);
      var s = Cne(r);
      return this.sendMessage(e, n, s, i);
    }
    sendEmoteMessage(e, n, r, i) {
      var a;
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (i = r, r = n, n = null);
      var s = Ene(r);
      return this.sendMessage(e, n, s, i);
    }
    sendImageMessage(e, n, r, i) {
      var a, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "Image";
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (s = i || "Image", i = r, r = n, n = null);
      var l = {
        msgtype: Jn.Image,
        url: r,
        info: i,
        body: s
      };
      return this.sendMessage(e, n, l);
    }
    sendStickerMessage(e, n, r, i) {
      var a, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "Sticker";
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (s = i || "Sticker", i = r, r = n, n = null);
      var l = {
        url: r,
        info: i,
        body: s
      };
      return this.sendEvent(e, n, ce.Sticker, l);
    }
    sendHtmlMessage(e, n, r, i) {
      var a;
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (i = r, r = n, n = null);
      var s = bne(r, i);
      return this.sendMessage(e, n, s);
    }
    sendHtmlNotice(e, n, r, i) {
      var a;
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (i = r, r = n, n = null);
      var s = xne(r, i);
      return this.sendMessage(e, n, s);
    }
    sendHtmlEmote(e, n, r, i) {
      var a;
      !((a = n) !== null && a !== void 0 && a.startsWith(dd)) && n !== null && (i = r, r = n, n = null);
      var s = wne(r, i);
      return this.sendMessage(e, n, s);
    }
    _unstable_sendDelayedEvent(e, n, r, i, a, s) {
      var l = this;
      return me(function* () {
        if (!(yield l.doesServerSupportUnstableFeature(kd))) throw new Ff("Server does not support the delayed events API", "sendDelayedEvent");
        return l.addThreadRelationIfNeeded(a, r, e), l.sendCompleteEvent(e, r, {
          type: i,
          content: a
        }, n, s);
      })();
    }
    _unstable_sendDelayedStateEvent(e, n, r, i) {
      var a = arguments, s = this;
      return me(function* () {
        var l = a.length > 4 && a[4] !== void 0 ? a[4] : "", c = a.length > 5 && a[5] !== void 0 ? a[5] : {};
        if (!(yield s.doesServerSupportUnstableFeature(kd))) throw new Ff("Server does not support the delayed events API", "sendDelayedStateEvent");
        var d = {
          $roomId: e,
          $eventType: r,
          $stateKey: l
        }, u = rn("/rooms/$roomId/state/$eventType", d);
        return l !== void 0 && (u = rn(u + "/$stateKey", d)), s.http.authedRequest(rt.Put, u, d$(n), i, c);
      })();
    }
    _unstable_getDelayedEvents(e) {
      var n = this;
      return me(function* () {
        if (!(yield n.doesServerSupportUnstableFeature(kd))) throw new Ff("Server does not support the delayed events API", "getDelayedEvents");
        var r = e ? {
          from: e
        } : void 0;
        return yield n.http.authedRequest(rt.Get, "/delayed_events", r, void 0, {
          prefix: "".concat(zo.Unstable, "/").concat(kd)
        });
      })();
    }
    _unstable_updateDelayedEvent(e, n) {
      var r = arguments, i = this;
      return me(function* () {
        var a = r.length > 2 && r[2] !== void 0 ? r[2] : {};
        if (!(yield i.doesServerSupportUnstableFeature(kd))) throw new Ff("Server does not support the delayed events API", "updateDelayedEvent");
        var s = rn("/delayed_events/$delayId", {
          $delayId: e
        }), l = {
          action: n
        };
        return yield i.http.authedRequest(rt.Post, s, void 0, l, No(No({}, a), {}, {
          prefix: "".concat(zo.Unstable, "/").concat(kd)
        }));
      })();
    }
    sendReceipt(e, n, r) {
      var i = arguments, a = this;
      return me(function* () {
        var s = i.length > 3 && i[3] !== void 0 ? i[3] : false;
        if (a.isGuest()) return Promise.resolve({});
        var l = rn("/rooms/$roomId/receipt/$receiptType/$eventId", {
          $roomId: e.getRoomId(),
          $receiptType: n,
          $eventId: e.getId()
        }), c = !s && a.supportsThreads(), d = c ? No(No({}, r), {}, {
          thread_id: W1(e)
        }) : r, u = a.http.authedRequest(rt.Post, l, void 0, d || {}), h = a.getRoom(e.getRoomId());
        return h && a.credentials.userId && h.addLocalEchoReceipt(a.credentials.userId, e, n, s), u;
      })();
    }
    sendReadReceipt(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : ia.Read, a = n.length > 2 && n[2] !== void 0 ? n[2] : false;
        if (e) {
          var s = e.getId(), l = r.getRoom(e.getRoomId());
          if (l != null && l.hasPendingEvent(s)) throw new Error("Cannot set read receipt to a pending event (".concat(s, ")"));
          return r.sendReceipt(e, i, {}, a);
        }
      })();
    }
    setRoomReadMarkers(e, n, r, i) {
      var a = this;
      return me(function* () {
        var s = a.getRoom(e);
        if (s != null && s.hasPendingEvent(n)) throw new Error("Cannot set read marker to a pending event (".concat(n, ")"));
        var l;
        if (r) {
          if (l = r.getId(), s != null && s.hasPendingEvent(l)) throw new Error("Cannot set read receipt to a pending event (".concat(l, ")"));
          s == null ? void 0 : s.addLocalEchoReceipt(a.credentials.userId, r, ia.Read);
        }
        var c;
        if (i) {
          if (c = i.getId(), s != null && s.hasPendingEvent(c)) throw new Error("Cannot set read receipt to a pending event (".concat(c, ")"));
          s == null ? void 0 : s.addLocalEchoReceipt(a.credentials.userId, i, ia.ReadPrivate);
        }
        return yield a.setRoomReadMarkersHttpRequest(e, n, l, c);
      })();
    }
    sendRtcDecline(e, n) {
      return this.sendEvent(e, ce.RTCDecline, {
        "m.relates_to": {
          event_id: n,
          rel_type: Xn.Reference
        }
      });
    }
    getUrlPreview(e, n) {
      n = Math.floor(n / 6e4) * 6e4;
      var r = new URL(e);
      r.hash = "", e = r.toString();
      var i = n + "_" + e;
      if (i in this.urlPreviewCache) return this.urlPreviewCache[i];
      var a = this.http.authedRequest(rt.Get, "/preview_url", {
        url: e,
        ts: n.toString()
      }, void 0, {
        prefix: c1.V3,
        priority: "low"
      });
      return this.urlPreviewCache[i] = a, a;
    }
    sendTyping(e, n, r) {
      if (this.isGuest()) return Promise.resolve({});
      var i = rn("/rooms/$roomId/typing/$userId", {
        $roomId: e,
        $userId: this.getUserId()
      }), a = {
        typing: n
      };
      return n && (a.timeout = r || 2e4), this.http.authedRequest(rt.Put, i, void 0, a);
    }
    getRoomUpgradeHistory(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, i = this.getRoom(e);
      if (!i) return [];
      var a = this.findPredecessorRooms(i, n, r), s = this.findSuccessorRooms(i, n, r);
      return [
        ...a,
        i,
        ...s
      ];
    }
    findPredecessorRooms(e, n, r) {
      for (var i, a = [], s = /* @__PURE__ */ new Set([
        e.roomId
      ]), l = (i = e.findPredecessor(r)) === null || i === void 0 ? void 0 : i.roomId; l !== null; ) {
        var c;
        if (l) {
          if (s.has(l)) break;
          s.add(l);
        }
        var d = this.getRoom(l);
        if (d === null) break;
        if (n) {
          var u = d.currentState.getStateEvents(ce.RoomTombstone, "");
          if (!u || u.getContent().replacement_room !== e.roomId) break;
        }
        a.splice(0, 0, d), e = d, l = (c = e.findPredecessor(r)) === null || c === void 0 ? void 0 : c.roomId;
      }
      return a;
    }
    findSuccessorRooms(e, n, r) {
      for (var i = [], a = e.currentState.getStateEvents(ce.RoomTombstone, ""); a; ) {
        var s = this.getRoom(a.getContent().replacement_room);
        if (!s || s.roomId === e.roomId) break;
        if (n) {
          var l, c = (l = s.findPredecessor(r)) === null || l === void 0 ? void 0 : l.roomId;
          if (!c || c !== e.roomId) break;
        }
        i.push(s);
        var d = new Set(i.map((u) => u.roomId));
        if (d.size < i.length) return i.slice(0, i.length - 1);
        e = s, a = e.currentState.getStateEvents(ce.RoomTombstone, "");
      }
      return i;
    }
    invite(e, n) {
      var r = arguments, i = this;
      return me(function* () {
        var a = r.length > 2 && r[2] !== void 0 ? r[2] : {};
        if (typeof a != "object" && (a = {
          reason: a
        }), a.shareEncryptedHistory) {
          var s;
          yield (s = i.cryptoBackend) === null || s === void 0 ? void 0 : s.shareRoomHistoryWithUser(e, n);
        }
        return yield i.membershipChange(e, n, Ht.Invite, a.reason);
      })();
    }
    inviteByEmail(e, n) {
      return this.inviteByThreePid(e, "email", n);
    }
    inviteByThreePid(e, n, r) {
      var i = this;
      return me(function* () {
        var a, s = rn("/rooms/$roomId/invite", {
          $roomId: e
        }), l = i.getIdentityServerUrl(true);
        if (!l) return Promise.reject(new Un({
          error: "No supplied identity server URL",
          errcode: "ORG.MATRIX.JSSDK_MISSING_PARAM"
        }));
        var c = {
          id_server: l,
          medium: n,
          address: r
        };
        if ((a = i.identityServer) !== null && a !== void 0 && a.getAccessToken) {
          var d = yield i.identityServer.getAccessToken();
          d && (c.id_access_token = d);
        }
        return i.http.authedRequest(rt.Post, s, void 0, c);
      })();
    }
    leave(e) {
      return this.membershipChange(e, void 0, Ht.Leave);
    }
    leaveRoomChain(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this.getRoomUpgradeHistory(e, true), i = r;
      if (!n) {
        i = [];
        for (var a of r) if (i.push(a), a.roomId === e) break;
      }
      var s = {}, l = [], c = (u) => this.leave(u).then(() => {
        delete s[u];
      }).catch((h) => {
        s[u] = h;
      });
      for (var d of i) l.push(c(d.roomId));
      return Promise.all(l).then(() => s);
    }
    ban(e, n, r) {
      return this.membershipChange(e, n, Ht.Ban, r);
    }
    forget(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : true, a = rn("/rooms/$room_id/forget", {
          $room_id: e
        }), s = yield r.http.authedRequest(rt.Post, a);
        return i && (r.store.removeRoom(e), r.emit(jt.DeleteRoom, e)), s;
      })();
    }
    unban(e, n) {
      var r = rn("/rooms/$roomId/unban", {
        $roomId: e
      }), i = {
        user_id: n
      };
      return this.http.authedRequest(rt.Post, r, void 0, i);
    }
    kick(e, n, r) {
      var i = rn("/rooms/$roomId/kick", {
        $roomId: e
      }), a = {
        user_id: n,
        reason: r
      };
      return this.http.authedRequest(rt.Post, i, void 0, a);
    }
    membershipChange(e, n, r, i) {
      var a = rn("/rooms/$room_id/$membership", {
        $room_id: e,
        $membership: r
      });
      return this.http.authedRequest(rt.Post, a, void 0, {
        user_id: n,
        reason: i
      });
    }
    getPushActionsForEvent(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (!e.getPushActions() || n) {
        var { actions: r, rule: i } = this.pushProcessor.actionsAndRuleForEvent(e);
        e.setPushDetails(r, i);
      }
      return e.getPushActions();
    }
    getPushDetailsForEvent(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (!e.getPushDetails() || n) {
        var { actions: r, rule: i } = this.pushProcessor.actionsAndRuleForEvent(e);
        e.setPushDetails(r, i);
      }
      return e.getPushDetails();
    }
    setProfileInfo(e, n) {
      var r = rn("/profile/$userId/$info", {
        $userId: this.credentials.userId,
        $info: e
      });
      return this.http.authedRequest(rt.Put, r, void 0, n);
    }
    setDisplayName(e) {
      var n = this;
      return me(function* () {
        var r = yield n.setProfileInfo("displayname", {
          displayname: e
        }), i = n.getUser(n.getUserId());
        return i && (i.displayName = e, i.emit(Vo.DisplayName, i.events.presence, i)), r;
      })();
    }
    setAvatarUrl(e) {
      var n = this;
      return me(function* () {
        var r = yield n.setProfileInfo("avatar_url", {
          avatar_url: e
        }), i = n.getUser(n.getUserId());
        return i && (i.avatarUrl = e, i.emit(Vo.AvatarUrl, i.events.presence, i)), r;
      })();
    }
    mxcUrlToHttp(e, n, r, i, a, s, l) {
      return rk(this.baseUrl, e, n, r, i, a, s, l);
    }
    setSyncPresence(e) {
      var n = this;
      return me(function* () {
        var r;
        (r = n.syncApi) === null || r === void 0 || r.setPresence(e);
      })();
    }
    setPresence(e) {
      var n = this;
      return me(function* () {
        var r = rn("/presence/$userId/status", {
          $userId: n.credentials.userId
        }), i = [
          "offline",
          "online",
          "unavailable"
        ];
        if (i.indexOf(e.presence) === -1) throw new Error("Bad presence value: " + e.presence);
        yield n.http.authedRequest(rt.Put, r, void 0, e);
      })();
    }
    getPresence(e) {
      var n = rn("/presence/$userId/status", {
        $userId: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    scrollback(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 30, r = 0, i = this.ongoingScrollbacks[e.roomId] || {};
      if (i.promise) return i.promise;
      if (i.errorTs) {
        var a = Date.now() - i.errorTs;
        r = Math.max(lCe - a, 0);
      }
      if (e.oldState.paginationToken === null) return Promise.resolve(e);
      var s = this.store.scrollback(e, n).length;
      if (s === n) return Promise.resolve(e);
      n = n - s;
      var l = new Promise((c, d) => {
        Ug(r).then(() => this.createMessagesRequest(e.roomId, e.oldState.paginationToken, n, Tn.Backward)).then((u) => {
          var h, f, g = u.chunk.map(this.getEventMapper());
          if (u.state) {
            var m = u.state.map(this.getEventMapper());
            e.currentState.setUnknownStateEvents(m);
          }
          var [v, y, w] = e.partitionThreadedEvents(g);
          this.processAggregatedTimelineEvents(e, v), e.addEventsToTimeline(v, true, true, e.getLiveTimeline()), this.processThreadEvents(e, y, true), w.forEach((b) => e.relations.aggregateChildEvent(b)), e.oldState.paginationToken = (h = u.end) !== null && h !== void 0 ? h : null, u.chunk.length === 0 && (e.oldState.paginationToken = null), this.store.storeEvents(e, g, (f = u.end) !== null && f !== void 0 ? f : null, true), delete this.ongoingScrollbacks[e.roomId], c(e);
        }).catch((u) => {
          this.ongoingScrollbacks[e.roomId] = {
            errorTs: Date.now()
          }, d(u);
        });
      });
      return i = {
        promise: l
      }, this.ongoingScrollbacks[e.roomId] = i, l;
    }
    getEventMapper(e) {
      return eDe(this, e || {});
    }
    getEventTimeline(e, n) {
      var r = this;
      return me(function* () {
        var i, a, s, l;
        if (!r.timelineSupport) throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");
        if (!(e != null && e.room)) throw new Error("getEventTimeline only supports room timelines");
        if (e.getTimelineForEvent(n)) return e.getTimelineForEvent(n);
        if (e.thread && r.supportsThreads()) return r.getThreadTimeline(e, n);
        var c = rn("/rooms/$roomId/context/$eventId", {
          $roomId: e.room.roomId,
          $eventId: n
        }), d = void 0;
        (i = r.clientOpts) !== null && i !== void 0 && i.lazyLoadMembers && (d = {
          filter: JSON.stringify(ns.LAZY_LOADING_MESSAGES_FILTER)
        });
        var u = yield r.http.authedRequest(rt.Get, c, d);
        if (!u.event) throw new Error("'event' not in '/context' result - homeserver too old?");
        if (e.getTimelineForEvent(n)) return e.getTimelineForEvent(n);
        var h = r.getEventMapper(), f = h(u.event);
        if (f.isRelation(pi.name)) {
          r.logger.warn("Tried loading a regular timeline at the position of a thread event");
          return;
        }
        var g = [
          ...u.events_after.reverse().map(h),
          f,
          ...u.events_before.map(h)
        ], m = e.getTimelineForEvent(g[0].getId());
        m ? m.getState(en.BACKWARDS).setUnknownStateEvents(u.state.map(h)) : (m = e.addTimeline(), m.initialiseState(u.state.map(h)), m.getState(en.FORWARDS).paginationToken = u.end);
        var [v, y, w] = e.room.partitionThreadedEvents(g);
        return e.addEventsToTimeline(v, true, false, m, u.start), r.processThreadEvents(e.room, y, true), r.processAggregatedTimelineEvents(e.room, v), w.forEach((b) => e.relations.aggregateChildEvent(b)), (a = (s = e.getTimelineForEvent(n)) !== null && s !== void 0 ? s : (l = e.room.findThreadForEvent(f)) === null || l === void 0 ? void 0 : l.liveTimeline) !== null && a !== void 0 ? a : m;
      })();
    }
    getThreadTimeline(e, n) {
      var r = this;
      return me(function* () {
        var i;
        if (!r.supportsThreads()) throw new Error("could not get thread timeline: no client support");
        if (!e.room) throw new Error("could not get thread timeline: not a room timeline");
        if (!e.thread) throw new Error("could not get thread timeline: not a thread timeline");
        var a = rn("/rooms/$roomId/context/$eventId", {
          $roomId: e.room.roomId,
          $eventId: n
        }), s = {
          limit: "0"
        };
        (i = r.clientOpts) !== null && i !== void 0 && i.lazyLoadMembers && (s.filter = JSON.stringify(ns.LAZY_LOADING_MESSAGES_FILTER));
        var l = yield r.http.authedRequest(rt.Get, a, s), c = r.getEventMapper(), d = c(l.event);
        if (e.canContain(d)) {
          var u = r.canSupport.get($o.RelationsRecursion) !== Ho.Unsupported;
          if (Ei.hasServerSideSupport) if (Ei.hasServerSideFwdPaginationSupport) {
            var h, f, g;
            if (!e.thread) throw new Error("could not get thread timeline: not a thread timeline");
            var m = e.thread, v = yield r.fetchRelations(e.room.roomId, m.id, null, null, {
              dir: Tn.Backward,
              from: l.start,
              recurse: u || void 0
            }), y = yield r.fetchRelations(e.room.roomId, m.id, null, null, {
              dir: Tn.Forward,
              from: l.end,
              recurse: u || void 0
            }), w = [
              ...y.chunk.reverse().filter(o9(m.id)).map(c),
              d,
              ...v.chunk.filter(o9(m.id)).map(c)
            ];
            for (var b of w) {
              var j;
              yield (j = e.thread) === null || j === void 0 ? void 0 : j.processEvent(b);
            }
            var k = e.getTimelineForEvent(d.getId());
            if (k ? k.getState(en.BACKWARDS).setUnknownStateEvents(l.state.map(c)) : (k = e.addTimeline(), k.initialiseState(l.state.map(c))), e.addEventsToTimeline(w, true, false, k, y.next_batch), !v.next_batch) {
              var C = yield r.fetchRoomEvent(e.room.roomId, m.id);
              e.addEventsToTimeline([
                c(C)
              ], true, false, k, null);
            }
            return k.setPaginationToken((h = v.next_batch) !== null && h !== void 0 ? h : null, Tn.Backward), k.setPaginationToken((f = y.next_batch) !== null && f !== void 0 ? f : null, Tn.Forward), r.processAggregatedTimelineEvents(e.room, w), (g = e.getTimelineForEvent(n)) !== null && g !== void 0 ? g : k;
          } else {
            for (var x, S = e.thread, T = yield r.fetchRelations(e.room.roomId, S.id, pi.name, null, {
              dir: Tn.Backward,
              from: l.start,
              recurse: u || void 0
            }), A = [], B = l.end; B; ) {
              var U, z = yield r.fetchRelations(e.room.roomId, S.id, pi.name, null, {
                dir: Tn.Forward,
                from: B,
                recurse: u || void 0
              });
              B = (U = z.next_batch) !== null && U !== void 0 ? U : null, A.push(...z.chunk);
            }
            var O = [
              ...A.reverse().map(c),
              d,
              ...T.chunk.map(c)
            ];
            for (var M of O) {
              var I;
              yield (I = e.thread) === null || I === void 0 ? void 0 : I.processEvent(M);
            }
            var N = e.getLiveTimeline();
            if (N.getState(en.BACKWARDS).setUnknownStateEvents(l.state.map(c)), e.addEventsToTimeline(O, true, false, N, null), !T.next_batch) {
              var L = yield r.fetchRoomEvent(e.room.roomId, S.id);
              e.addEventsToTimeline([
                c(L)
              ], true, false, N, null);
            }
            return N.setPaginationToken((x = T.next_batch) !== null && x !== void 0 ? x : null, Tn.Backward), N.setPaginationToken(null, Tn.Forward), r.processAggregatedTimelineEvents(e.room, O), N;
          }
        }
      })();
    }
    getLatestTimeline(e) {
      var n = this;
      return me(function* () {
        if (!n.timelineSupport) throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");
        if (!e.room) throw new Error("getLatestTimeline only supports room timelines");
        var r;
        if (e.threadListType !== null) {
          var i, a = yield n.createThreadListMessagesRequest(e.room.roomId, null, 1, Tn.Backward, e.threadListType, e.getFilter());
          r = (i = a.chunk) === null || i === void 0 ? void 0 : i[0];
        } else if (e.thread && Ei.hasServerSideSupport) {
          var s, l = n.canSupport.get($o.RelationsRecursion) !== Ho.Unsupported, c = yield n.fetchRelations(e.room.roomId, e.thread.id, pi.name, null, {
            dir: Tn.Backward,
            limit: 1,
            recurse: l || void 0
          });
          r = (s = c.chunk) === null || s === void 0 ? void 0 : s[0];
        } else {
          var d, u, h = rn("/rooms/$roomId/messages", {
            $roomId: e.room.roomId
          }), f = {
            dir: "b"
          };
          (d = n.clientOpts) !== null && d !== void 0 && d.lazyLoadMembers && (f.filter = JSON.stringify(ns.LAZY_LOADING_MESSAGES_FILTER));
          var g = yield n.http.authedRequest(rt.Get, h, f);
          r = (u = g.chunk) === null || u === void 0 ? void 0 : u[0];
        }
        if (!r) throw new Error("No message returned when trying to construct getLatestTimeline");
        return n.getEventTimeline(e, r.event_id);
      })();
    }
    createMessagesRequest(e, n) {
      var r, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 30, a = arguments.length > 3 ? arguments[3] : void 0, s = arguments.length > 4 ? arguments[4] : void 0, l = rn("/rooms/$roomId/messages", {
        $roomId: e
      }), c = {
        limit: i.toString(),
        dir: a
      };
      n && (c.from = n);
      var d = null;
      if ((r = this.clientOpts) !== null && r !== void 0 && r.lazyLoadMembers && (d = Object.assign({}, ns.LAZY_LOADING_MESSAGES_FILTER)), s) {
        var u;
        d = d || {}, Object.assign(d, (u = s.getRoomTimelineFilterComponent()) === null || u === void 0 ? void 0 : u.toJSON());
      }
      return d && (c.filter = JSON.stringify(d)), this.http.authedRequest(rt.Get, l, c);
    }
    createThreadListMessagesRequest(e, n) {
      var r, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 30, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Tn.Backward, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : xc.All, l = arguments.length > 5 ? arguments[5] : void 0, c = rn("/rooms/$roomId/threads", {
        $roomId: e
      }), d = {
        limit: i.toString(),
        dir: a,
        include: vne(s)
      };
      n && (d.from = n);
      var u = {};
      if ((r = this.clientOpts) !== null && r !== void 0 && r.lazyLoadMembers && (u = No({}, ns.LAZY_LOADING_MESSAGES_FILTER)), l) {
        var h;
        u = No(No({}, u), (h = l.getRoomTimelineFilterComponent()) === null || h === void 0 ? void 0 : h.toJSON());
      }
      Object.keys(u).length && (d.filter = JSON.stringify(u));
      var f = {
        prefix: Ei.hasServerSideListSupport === Pa.Stable ? zo.V1 : "/_matrix/client/unstable/org.matrix.msc3856"
      };
      return this.http.authedRequest(rt.Get, c, d, void 0, f).then((g) => {
        var m;
        return No(No({}, g), {}, {
          chunk: (m = g.chunk) === null || m === void 0 ? void 0 : m.reverse(),
          start: g.prev_batch,
          end: g.next_batch
        });
      });
    }
    paginateEventTimeline(e, n) {
      var r = this, i = e.getTimelineSet() === this.notifTimelineSet, a = this.getRoom(e.getRoomId()), s = e.getTimelineSet().threadListType, l = e.getTimelineSet().thread;
      n = n || {};
      var c = n.backwards || false;
      if (i && !c) throw new Error("paginateNotifTimeline can only paginate backwards");
      var d = c ? en.BACKWARDS : en.FORWARDS, u = e.getPaginationToken(d), h = e.paginationRequests[d];
      if (h) return h;
      var f, g, m;
      if (i) {
        var v;
        f = "/notifications", g = {
          limit: ((v = n.limit) !== null && v !== void 0 ? v : 30).toString(),
          only: "highlight"
        }, u && u !== "end" && (g.from = u), m = this.http.authedRequest(rt.Get, f, g).then((function() {
          var k = me(function* (C) {
            var x = C.next_token, S = [];
            C.notifications = C.notifications.filter(Dc);
            for (var T = 0; T < C.notifications.length; T++) {
              var A = C.notifications[T], B = r.getEventMapper()(A.event);
              r.getPushDetailsForEvent(B, true), B.event.room_id = A.room_id, S[T] = B;
            }
            var U = e.getTimelineSet();
            return U.addEventsToTimeline(S, c, false, e, x), r.processAggregatedTimelineEvents(U.room, S), c && !C.next_token && e.setPaginationToken(null, d), !!C.next_token;
          });
          return function(C) {
            return k.apply(this, arguments);
          };
        })()).finally(() => {
          e.paginationRequests[d] = null;
        }), e.paginationRequests[d] = m;
      } else if (s !== null) {
        if (!a) throw new Error("Unknown room " + e.getRoomId());
        if (!Ei.hasServerSideFwdPaginationSupport && d === Tn.Forward) throw new Error("Cannot paginate threads forwards without server-side support for MSC 3715");
        m = this.createThreadListMessagesRequest(e.getRoomId(), u, n.limit, d, s, e.getFilter()).then((k) => {
          if (k.state) {
            var C = e.getState(d), x = k.state.filter(Dc).map(this.getEventMapper());
            C.setUnknownStateEvents(x);
          }
          var S = k.end, T = k.chunk.filter(Dc).map(this.getEventMapper()), A = e.getTimelineSet();
          return A.addEventsToTimeline(T, c, false, e, S), this.processAggregatedTimelineEvents(a, T), this.processThreadRoots(a, T, c), c && k.end == k.start && e.setPaginationToken(null, d), k.end !== k.start;
        }).finally(() => {
          e.paginationRequests[d] = null;
        }), e.paginationRequests[d] = m;
      } else if (l) {
        var y, w, b = this.getRoom((y = e.getRoomId()) !== null && y !== void 0 ? y : void 0);
        if (!b) throw new Error("Unknown room " + e.getRoomId());
        var j = this.canSupport.get($o.RelationsRecursion) !== Ho.Unsupported;
        m = this.fetchRelations((w = e.getRoomId()) !== null && w !== void 0 ? w : "", l.id, null, null, {
          dir: d,
          limit: n.limit,
          from: u ?? void 0,
          recurse: j || void 0
        }).then((function() {
          var k = me(function* (C) {
            var x = r.getEventMapper(), S = C.chunk.filter(Dc).filter(o9(l.id)).map(x);
            for (var T of S.slice().reverse()) {
              yield l == null ? void 0 : l.processEvent(T);
              var A = T.getSender();
              (!c || (l == null ? void 0 : l.getEventReadUpTo(A)) === null) && b.addLocalEchoReceipt(A, T, ia.Read);
            }
            var B = C.next_batch, U = e.getTimelineSet();
            if (U.addEventsToTimeline(S, c, false, e, B ?? null), !B && c) {
              var z, O, M = (z = l.rootEvent) !== null && z !== void 0 ? z : x(yield r.fetchRoomEvent((O = e.getRoomId()) !== null && O !== void 0 ? O : "", l.id));
              U.addEventsToTimeline([
                M
              ], true, false, e, null);
            }
            return r.processAggregatedTimelineEvents(U.room, S), c && !B && e.setPaginationToken(null, d), !!B;
          });
          return function(C) {
            return k.apply(this, arguments);
          };
        })()).finally(() => {
          e.paginationRequests[d] = null;
        }), e.paginationRequests[d] = m;
      } else {
        if (!a) throw new Error("Unknown room " + e.getRoomId());
        m = this.createMessagesRequest(e.getRoomId(), u, n.limit, d, e.getFilter()).then((k) => {
          if (k.state) {
            var C = e.getState(d), x = k.state.filter(Dc).map(this.getEventMapper());
            C.setUnknownStateEvents(x);
          }
          var S = k.end, T = k.chunk.filter(Dc).map(this.getEventMapper()), A = e.getTimelineSet(), [B, , U] = a.partitionThreadedEvents(T);
          A.addEventsToTimeline(B, c, false, e, S), this.processAggregatedTimelineEvents(a, B), this.processThreadRoots(a, B.filter((O) => O.getServerAggregatedRelation(pi.name)), false), U.forEach((O) => a.relations.aggregateChildEvent(O));
          var z = k.end === void 0 || k.end === k.start;
          return c && z && e.setPaginationToken(null, d), !z;
        }).finally(() => {
          e.paginationRequests[d] = null;
        }), e.paginationRequests[d] = m;
      }
      return m;
    }
    resetNotifTimelineSet() {
      this.notifTimelineSet && this.notifTimelineSet.resetLiveTimeline("end");
    }
    peekInRoom(e) {
      var n, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 20;
      return (n = this.peekSync) === null || n === void 0 || n.stopPeeking(), this.peekSync = new gf(this, this.clientOpts, this.buildSyncApiOptions()), this.peekSync.peek(e, r);
    }
    stopPeeking() {
      this.peekSync && (this.peekSync.stopPeeking(), this.peekSync = null);
    }
    setGuestAccess(e, n) {
      var r = this.sendStateEvent(e, ce.RoomGuestAccess, {
        guest_access: n.allowJoin ? j2.CanJoin : j2.Forbidden
      }, ""), i = Promise.resolve();
      return n.allowRead && (i = this.sendStateEvent(e, ce.RoomHistoryVisibility, {
        history_visibility: ll.WorldReadable
      }, "")), Promise.all([
        i,
        r
      ]).then();
    }
    requestRegisterEmailToken(e, n, r, i) {
      return this.requestTokenFromEndpoint("/register/email/requestToken", {
        email: e,
        client_secret: n,
        send_attempt: r,
        next_link: i
      });
    }
    requestRegisterMsisdnToken(e, n, r, i, a) {
      return this.requestTokenFromEndpoint("/register/msisdn/requestToken", {
        country: e,
        phone_number: n,
        client_secret: r,
        send_attempt: i,
        next_link: a
      });
    }
    requestAdd3pidEmailToken(e, n, r, i) {
      return this.requestTokenFromEndpoint("/account/3pid/email/requestToken", {
        email: e,
        client_secret: n,
        send_attempt: r,
        next_link: i
      });
    }
    requestAdd3pidMsisdnToken(e, n, r, i, a) {
      return this.requestTokenFromEndpoint("/account/3pid/msisdn/requestToken", {
        country: e,
        phone_number: n,
        client_secret: r,
        send_attempt: i,
        next_link: a
      });
    }
    requestPasswordEmailToken(e, n, r, i) {
      return this.requestTokenFromEndpoint("/account/password/email/requestToken", {
        email: e,
        client_secret: n,
        send_attempt: r,
        next_link: i
      });
    }
    requestPasswordMsisdnToken(e, n, r, i, a) {
      return this.requestTokenFromEndpoint("/account/password/msisdn/requestToken", {
        country: e,
        phone_number: n,
        client_secret: r,
        send_attempt: i,
        next_link: a
      });
    }
    requestTokenFromEndpoint(e, n) {
      var r = this;
      return me(function* () {
        var i = Object.assign({}, n);
        return r.http.request(rt.Post, e, void 0, i);
      })();
    }
    getRoomPushRule(e, n) {
      if (this.pushRules) {
        var r;
        return (r = this.pushRules[e]) === null || r === void 0 || (r = r.room) === null || r === void 0 ? void 0 : r.find((i) => i.rule_id === n);
      } else throw new Error("SyncApi.sync() must be done before accessing to push rules.");
    }
    setRoomMutePushRule(e, n, r) {
      var i, a = false, s = this.getRoomPushRule(e, n);
      if (s != null && s.actions.includes(Rc.DontNotify) && (a = true), !r) a && (i = this.deletePushRule(e, Or.RoomSpecific, s.rule_id));
      else if (!s) i = this.addPushRule(e, Or.RoomSpecific, n, {
        actions: [
          Rc.DontNotify
        ]
      });
      else if (!a) {
        var l = Promise.withResolvers();
        this.deletePushRule(e, Or.RoomSpecific, s.rule_id).then(() => {
          this.addPushRule(e, Or.RoomSpecific, n, {
            actions: [
              Rc.DontNotify
            ]
          }).then(() => {
            l.resolve();
          }).catch((c) => {
            l.reject(c);
          });
        }).catch((c) => {
          l.reject(c);
        }), i = l.promise;
      }
      if (i) return new Promise((c, d) => {
        i.then(() => {
          this.getPushRules().then((u) => {
            this.pushRules = u, c();
          }).catch((u) => {
            d(u);
          });
        }).catch((u) => {
          this.getPushRules().then((h) => {
            this.pushRules = h, d(u);
          }).catch((h) => {
            d(u);
          });
        });
      });
    }
    searchMessageText(e) {
      var n = {
        search_term: e.query
      };
      return "keys" in e && (n.keys = e.keys), this.search({
        body: {
          search_categories: {
            room_events: n
          }
        }
      });
    }
    searchRoomEvents(e) {
      var n = {
        search_categories: {
          room_events: {
            search_term: e.term,
            filter: e.filter,
            order_by: M2.Recent,
            event_context: {
              before_limit: 1,
              after_limit: 1,
              include_profile: true
            }
          }
        }
      }, r = {
        _query: n,
        results: [],
        highlights: []
      };
      return this.search({
        body: n
      }).then((i) => this.processRoomEventsSearch(r, i));
    }
    backPaginateRoomEventsSearch(e) {
      if (!e.next_batch) return Promise.reject(new Error("Cannot backpaginate event search any further"));
      if (e.pendingRequest) return e.pendingRequest;
      var n = {
        body: e._query,
        next_batch: e.next_batch
      }, r = this.search(n, e.abortSignal).then((i) => this.processRoomEventsSearch(e, i)).finally(() => {
        e.pendingRequest = void 0;
      });
      return e.pendingRequest = r, r;
    }
    processRoomEventsSearch(e, n) {
      var r, i, a = n.search_categories.room_events;
      e.count = a.count, e.next_batch = a.next_batch;
      var s = new Set(a.highlights);
      e.highlights.forEach((g) => {
        s.add(g);
      }), e.highlights = Array.from(s);
      for (var l = this.getEventMapper(), c = (r = (i = a.results) === null || i === void 0 ? void 0 : i.length) !== null && r !== void 0 ? r : 0, d = 0; d < c; d++) {
        var u = uk.fromJson(a.results[d], l), h = this.getRoom(u.context.getEvent().getRoomId());
        if (h) for (var f of u.context.getTimeline()) f.setMetadata(h.currentState, false);
        e.results.push(u);
      }
      return e;
    }
    syncLeftRooms() {
      if (this.syncedLeftRooms) return Promise.resolve([]);
      if (this.syncLeftRoomsPromise) return this.syncLeftRoomsPromise;
      var e = new gf(this, this.clientOpts, this.buildSyncApiOptions());
      return this.syncLeftRoomsPromise = e.syncLeftRooms(), this.syncLeftRoomsPromise.then(() => {
        this.logger.debug("Marking success of sync left room request"), this.syncedLeftRooms = true;
      }).finally(() => {
        this.syncLeftRoomsPromise = void 0;
      }), this.syncLeftRoomsPromise;
    }
    createFilter(e) {
      var n = rn("/user/$userId/filter", {
        $userId: this.credentials.userId
      });
      return this.http.authedRequest(rt.Post, n, void 0, e).then((r) => {
        var i = ns.fromJson(this.credentials.userId, r.filter_id, e);
        return this.store.storeFilter(i), i;
      });
    }
    getFilter(e, n, r) {
      if (r) {
        var i = this.store.getFilter(e, n);
        if (i) return Promise.resolve(i);
      }
      var a = rn("/user/$userId/filter/$filterId", {
        $userId: e,
        $filterId: n
      });
      return this.http.authedRequest(rt.Get, a).then((s) => {
        var l = ns.fromJson(e, n, s);
        return this.store.storeFilter(l), l;
      });
    }
    getOrCreateFilter(e, n) {
      var r = this;
      return me(function* () {
        var i = r.store.getFilterIdByName(e), a;
        if (i) {
          try {
            var s = yield r.getFilter(r.credentials.userId, i, true);
            if (s) {
              var l = s.getDefinition(), c = n.getDefinition();
              zg(l, c) && (a = i);
            }
          } catch (u) {
            if (u.errcode !== "M_UNKNOWN" && u.errcode !== "M_NOT_FOUND") throw u;
          }
          a || r.store.setFilterIdByName(e, void 0);
        }
        if (a) return a;
        var d = yield r.createFilter(n.getDefinition());
        return r.store.setFilterIdByName(e, d.filterId), d.filterId;
      })();
    }
    getOpenIdToken() {
      var e = rn("/user/$userId/openid/request_token", {
        $userId: this.credentials.userId
      });
      return this.http.authedRequest(rt.Post, e, void 0, {});
    }
    turnServer() {
      return this.http.authedRequest(rt.Get, "/voip/turnServer");
    }
    getTurnServers() {
      return this.turnServers || [];
    }
    getTurnServersExpiry() {
      return this.turnServersExpiry;
    }
    get pollingTurnServers() {
      return this.checkTurnServersIntervalID !== void 0;
    }
    checkTurnServers() {
      var e = this;
      return me(function* () {
        if (e.canSupportVoip) {
          var n = false, r = e.turnServersExpiry - Date.now();
          if (r > c$) e.logger.debug("TURN creds are valid for another " + r + " ms: not fetching new ones."), n = true;
          else {
            e.logger.debug("Fetching new TURN credentials");
            try {
              var i = yield e.turnServer();
              if (i.uris) {
                e.logger.debug("Got TURN URIs: " + i.uris + " refresh in " + i.ttl + " secs");
                var a = {
                  urls: i.uris,
                  username: i.username,
                  credential: i.password
                };
                e.turnServers = [
                  a
                ], e.turnServersExpiry = Date.now() + i.ttl * 1e3, n = true, e.emit(jt.TurnServers, e.turnServers);
              }
            } catch (s) {
              e.logger.error("Failed to get TURN URIs", s), s.httpStatus === 403 ? (e.logger.info("TURN access unavailable for this account: stopping credentials checks"), e.checkTurnServersIntervalID !== null && globalThis.clearInterval(e.checkTurnServersIntervalID), e.checkTurnServersIntervalID = void 0, e.emit(jt.TurnServersError, s, true)) : e.emit(jt.TurnServersError, s, false);
            }
          }
          return n;
        }
      })();
    }
    setFallbackICEServerAllowed(e) {
      this.fallbackICEServerAllowed = e;
    }
    isFallbackICEServerAllowed() {
      return this.fallbackICEServerAllowed;
    }
    isSynapseAdministrator() {
      var e = rn("/_synapse/admin/v1/users/$userId/admin", {
        $userId: this.getUserId()
      });
      return this.http.authedRequest(rt.Get, e, void 0, void 0, {
        prefix: ""
      }).then((n) => n.admin);
    }
    whoisSynapseUser(e) {
      var n = rn("/_synapse/admin/v1/whois/$userId", {
        $userId: e
      });
      return this.http.authedRequest(rt.Get, n, void 0, void 0, {
        prefix: ""
      });
    }
    deactivateSynapseUser(e) {
      var n = rn("/_synapse/admin/v1/deactivate/$userId", {
        $userId: e
      });
      return this.http.authedRequest(rt.Post, n, void 0, void 0, {
        prefix: ""
      });
    }
    fetchClientWellKnown() {
      var e = this;
      return me(function* () {
        var n;
        e.clientWellKnownPromise = ua.getRawClientConfig((n = e.getDomain()) !== null && n !== void 0 ? n : void 0), e.clientWellKnown = yield e.clientWellKnownPromise, e.emit(jt.ClientWellKnown, e.clientWellKnown);
      })();
    }
    getClientWellKnown() {
      return this.clientWellKnown;
    }
    waitForClientWellKnown() {
      if (!this.clientRunning) throw new Error("Client is not running");
      return this.clientWellKnownPromise;
    }
    storeClientOptions() {
      var e = [
        "boolean",
        "string",
        "number"
      ], n = Object.entries(this.clientOpts).filter((r) => {
        var [i, a] = r;
        return e.includes(typeof a);
      }).reduce((r, i) => {
        var [a, s] = i;
        return r[a] = s, r;
      }, {});
      return this.store.storeClientOptions(n);
    }
    _unstable_getSharedRooms(e) {
      var n = this;
      return me(function* () {
        var r = yield n.doesServerSupportUnstableFeature(vre), i = yield n.doesServerSupportUnstableFeature(_re), a = yield n.doesServerSupportUnstableFeature(yre);
        if (!r && !i && !a) throw Error("Server does not support the Mutual Rooms API");
        var s, l;
        a ? (s = "/uk.half-shot.msc2666/user/mutual_rooms", l = {
          user_id: e
        }) : (s = rn("/uk.half-shot.msc2666/user/".concat(i ? "mutual_rooms" : "shared_rooms", "/$userId"), {
          $userId: e
        }), l = {});
        var c = [], d = null;
        do {
          var u = {};
          d != null && a && (u.batch_token = d);
          var h = yield n.http.authedRequest(rt.Get, s, No(No({}, l), u), void 0, {
            prefix: zo.Unstable
          });
          c.push(...h.joined), h.next_batch_token !== void 0 ? d = h.next_batch_token : d = null;
        } while (d != null);
        return c;
      })();
    }
    getVersions() {
      var e = this;
      return me(function* () {
        if (e.serverVersionsPromise) return e.serverVersionsPromise;
        e.serverVersionsPromise = e.http.authedRequest(rt.Get, "/_matrix/client/versions", void 0, void 0, {
          prefix: ""
        }).catch((r) => {
          throw e.serverVersionsPromise = void 0, r;
        });
        var n = yield e.serverVersionsPromise;
        return e.canSupport = yield txe(n), e.serverVersionsPromise;
      })();
    }
    isVersionSupported(e) {
      var n = this;
      return me(function* () {
        var { versions: r } = yield n.getVersions();
        return r && r.includes(e);
      })();
    }
    doesServerSupportUnstableFeature(e) {
      var n = this;
      return me(function* () {
        var r = yield n.getVersions();
        if (!r) return false;
        var i = r.unstable_features;
        return i && !!i[e];
      })();
    }
    doesServerForceEncryptionForPreset(e) {
      var n = this;
      return me(function* () {
        var r = yield n.getVersions();
        if (!r) return false;
        var i = r.unstable_features, a = e.includes("_chat") ? e.substring(0, e.indexOf("_chat")) : e;
        return i && !!i["io.element.e2ee_forced.".concat(a)];
      })();
    }
    doesServerSupportThread() {
      var e = this;
      return me(function* () {
        if (yield e.isVersionSupported("v1.4")) return {
          threads: Pa.Stable,
          list: Pa.Stable,
          fwdPagination: Pa.Stable
        };
        try {
          var [n, r, i, a, s, l] = yield Promise.all([
            e.doesServerSupportUnstableFeature("org.matrix.msc3440"),
            e.doesServerSupportUnstableFeature("org.matrix.msc3440.stable"),
            e.doesServerSupportUnstableFeature("org.matrix.msc3856"),
            e.doesServerSupportUnstableFeature("org.matrix.msc3856.stable"),
            e.doesServerSupportUnstableFeature("org.matrix.msc3715"),
            e.doesServerSupportUnstableFeature("org.matrix.msc3715.stable")
          ]);
          return {
            threads: CD(r, n),
            list: CD(a, i),
            fwdPagination: CD(l, s)
          };
        } catch {
          return {
            threads: Pa.None,
            list: Pa.None,
            fwdPagination: Pa.None
          };
        }
      })();
    }
    hasLazyLoadMembersEnabled() {
      var e;
      return !!((e = this.clientOpts) !== null && e !== void 0 && e.lazyLoadMembers);
    }
    setCanResetTimelineCallback(e) {
      this.canResetTimelineCallback = e;
    }
    getCanResetTimelineCallback() {
      return this.canResetTimelineCallback;
    }
    relations(e, n, r, i) {
      var a = arguments, s = this;
      return me(function* () {
        var l, c, d = a.length > 4 && a[4] !== void 0 ? a[4] : {
          dir: Tn.Backward
        }, u = i ? s.getEncryptedIfNeededEventType(e, i) : null, [h, f] = yield Promise.all([
          s.fetchRoomEvent(e, n),
          s.fetchRelations(e, n, r, u, d)
        ]), g = s.getEventMapper(), m = h ? g(h) : void 0, v = f.chunk.map(g);
        if (u === ce.RoomMessageEncrypted) {
          var y = m ? v.concat(m) : v;
          yield Promise.all(y.map((w) => s.decryptEventIfNeeded(w))), i !== null && (v = v.filter((w) => w.getType() === i));
        }
        return m && r === Xn.Replace && (v = v.filter((w) => w.getSender() === m.getSender())), {
          originalEvent: m ?? null,
          events: v,
          nextBatch: (l = f.next_batch) !== null && l !== void 0 ? l : null,
          prevBatch: (c = f.prev_batch) !== null && c !== void 0 ? c : null
        };
      })();
    }
    generateClientSecret() {
      return kf(32);
    }
    decryptEventIfNeeded(e, n) {
      return e.isState() && !this.enableEncryptedStateEvents ? Promise.resolve() : (e.shouldAttemptDecryption() && this.getCrypto() && e.attemptDecryption(this.cryptoBackend, n), e.isBeingDecrypted() ? e.getDecryptionPromise() : Promise.resolve());
    }
    termsUrlForService(e, n) {
      switch (e) {
        case cA.IS:
          return this.http.getUrl("/terms", void 0, _u.V2, n);
        case cA.IM:
          return this.http.getUrl("/terms", void 0, "/_matrix/integrations/v1", n);
        default:
          throw new Error("Unsupported service type");
      }
    }
    getHomeserverUrl() {
      return this.baseUrl;
    }
    getIdentityServerUrl() {
      var e, n, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      return r && ((e = this.idBaseUrl) !== null && e !== void 0 && e.startsWith("http://") || (n = this.idBaseUrl) !== null && n !== void 0 && n.startsWith("https://")) ? this.idBaseUrl.split("://")[1] : this.idBaseUrl;
    }
    setIdentityServerUrl(e) {
      this.idBaseUrl = Kj(e), this.http.setIdBaseUrl(this.idBaseUrl);
    }
    getAccessToken() {
      return this.http.opts.accessToken || null;
    }
    getRefreshToken() {
      var e;
      return (e = this.http.opts.refreshToken) !== null && e !== void 0 ? e : null;
    }
    setAccessToken(e) {
      this.http.opts.accessToken = e, this.serverVersionsPromise = void 0;
    }
    isLoggedIn() {
      return this.http.opts.accessToken !== void 0;
    }
    makeTxnId() {
      return "m" + (/* @__PURE__ */ new Date()).getTime() + "." + this.txnCtr++;
    }
    isUsernameAvailable(e) {
      return this.http.authedRequest(rt.Get, "/register/available", {
        username: e
      }).then((n) => n.available).catch((n) => n.errcode === "M_USER_IN_USE" ? false : Promise.reject(n));
    }
    register(e, n, r, i, a, s, l) {
      r && (i.session = r);
      var c = {
        auth: i,
        refresh_token: true
      };
      return e != null && (c.username = e), n != null && (c.password = n), s != null && (c.guest_access_token = s), l != null && (c.inhibit_login = l), this.registerRequest(c);
    }
    registerGuest() {
      var { body: e } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      return this.registerRequest(e || {}, "guest");
    }
    registerRequest(e, n) {
      var r = {};
      return n && (r.kind = n), this.http.request(rt.Post, "/register", r, e);
    }
    refreshToken(e) {
      var n = (r) => this.http.authedRequest(rt.Post, "/refresh", void 0, {
        refresh_token: e
      }, {
        prefix: r,
        inhibitLogoutEmit: true
      });
      return n(zo.V3).catch((r) => {
        if (r.errcode === "M_UNRECOGNIZED") return n(zo.V1);
        throw r;
      });
    }
    loginFlows() {
      return this.http.request(rt.Get, "/login");
    }
    login(e, n) {
      return this.loginRequest(No(No({}, n), {}, {
        type: e
      })).then((r) => (r.access_token && r.user_id && (this.http.opts.accessToken = r.access_token, this.credentials = {
        userId: r.user_id
      }), r));
    }
    loginWithPassword(e, n) {
      return this.login("m.login.password", {
        user: e,
        password: n
      });
    }
    getCasLoginUrl(e) {
      return this.getSsoLoginUrl(e, "cas");
    }
    getSsoLoginUrl(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "sso", r = arguments.length > 2 ? arguments[2] : void 0, i = arguments.length > 3 ? arguments[3] : void 0, a = "/login/" + n + "/redirect";
      r && (a += "/" + r);
      var s = {
        redirectUrl: e,
        [uCe.unstable]: i
      };
      return this.http.getUrl(a, s).href;
    }
    loginWithToken(e) {
      return this.login("m.login.token", {
        token: e
      });
    }
    loginRequest(e) {
      var n = this;
      return me(function* () {
        return yield n.http.authedRequest(rt.Post, "/login", void 0, e);
      })();
    }
    logout() {
      var e = arguments, n = this;
      return me(function* () {
        var r = e.length > 0 && e[0] !== void 0 ? e[0] : false;
        return r && (n.stopClient(), n.http.abort()), n.http.authedRequest(rt.Post, "/logout");
      })();
    }
    deactivateAccount(e, n) {
      var r = {};
      return e && (r.auth = e), n !== void 0 && (r.erase = n), this.http.authedRequest(rt.Post, "/account/deactivate", void 0, r);
    }
    requestLoginToken(e) {
      var n = this;
      return me(function* () {
        var r = {
          auth: e
        };
        return n.http.authedRequest(rt.Post, "/login/get_token", void 0, r, {
          prefix: zo.V1
        });
      })();
    }
    getFallbackAuthUrl(e, n) {
      var r = rn("/auth/$loginType/fallback/web", {
        $loginType: e
      });
      return this.http.getUrl(r, {
        session: n
      }).href;
    }
    createRoom(e) {
      var n = this;
      return me(function* () {
        var r, i = (e.invite_3pid || []).filter((l) => !l.id_access_token);
        if (i.length > 0 && (r = n.identityServer) !== null && r !== void 0 && r.getAccessToken) {
          var a = yield n.identityServer.getAccessToken();
          if (a) for (var s of i) s.id_access_token = a;
        }
        return n.http.authedRequest(rt.Post, "/createRoom", void 0, e);
      })();
    }
    fetchRelations(e, n, r, i) {
      var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
        dir: Tn.Backward
      }, s = a;
      Ei.hasServerSideFwdPaginationSupport === Pa.Experimental && (s = KV("dir", "org.matrix.msc3715.dir", s)), this.canSupport.get($o.RelationsRecursion) === Ho.Unstable && (s = KV("recurse", "org.matrix.msc3981.recurse", s));
      var l = OR(s), c = "/rooms/$roomId/relations/$eventId";
      r !== null ? (c += "/$relationType", i !== null && (c += "/$eventType")) : i !== null && (this.logger.warn("eventType: ".concat(i, ` ignored when fetching
            relations as relationType is null`)), i = null);
      var d = rn(c + "?" + l, {
        $roomId: e,
        $eventId: n,
        $relationType: r,
        $eventType: i
      });
      return this.http.authedRequest(rt.Get, d, void 0, void 0, {
        prefix: zo.V1
      });
    }
    roomState(e) {
      var n = rn("/rooms/$roomId/state", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    fetchRoomEvent(e, n) {
      var r = rn("/rooms/$roomId/event/$eventId", {
        $roomId: e,
        $eventId: n
      });
      return this.http.authedRequest(rt.Get, r);
    }
    members(e, n, r, i) {
      var a = {};
      n && (a.membership = n), r && (a.not_membership = r), i && (a.at = i);
      var s = OR(a), l = rn("/rooms/$roomId/members?" + s, {
        $roomId: e
      });
      return this.http.authedRequest(rt.Get, l);
    }
    upgradeRoom(e, n) {
      var r = rn("/rooms/$roomId/upgrade", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Post, r, void 0, {
        new_version: n
      });
    }
    getStateEvent(e, n, r) {
      var i = {
        $roomId: e,
        $eventType: n,
        $stateKey: r
      }, a = rn("/rooms/$roomId/state/$eventType", i);
      return r !== void 0 && (a = rn(a + "/$stateKey", i)), this.http.authedRequest(rt.Get, a);
    }
    sendStateEvent(e, n, r) {
      var i = arguments, a = this;
      return me(function* () {
        var s = i.length > 3 && i[3] !== void 0 ? i[3] : "", l = i.length > 4 && i[4] !== void 0 ? i[4] : {}, c = a.getRoom(e), d = new to({
          room_id: e,
          type: n,
          state_key: s,
          content: r
        });
        yield a.encryptStateEventIfNeeded(d, c ?? void 0);
        var u = {
          $roomId: e,
          $eventType: d.getWireType(),
          $stateKey: d.getWireStateKey()
        }, h = rn("/rooms/$roomId/state/$eventType", u);
        return s !== void 0 && (h = rn(h + "/$stateKey", u)), a.http.authedRequest(rt.Put, h, void 0, d.getWireContent(), l);
      })();
    }
    encryptStateEventIfNeeded(e, n) {
      var r = this;
      return me(function* () {
        if (r.enableEncryptedStateEvents && n && !(!r.cryptoBackend && r.usingExternalCrypto)) {
          if (!r.cryptoBackend) throw new Error("This room is configured to use encryption, but your client does not support encryption.");
          (yield r.shouldEncryptEventForRoom(e, n)) && (yield r.cryptoBackend.isStateEncryptionEnabledInRoom(n.roomId)) && ([
            "m.room.create",
            "m.room.member",
            "m.room.join_rules",
            "m.room.power_levels",
            "m.room.third_party_invite",
            "m.room.history_visibility",
            "m.room.guest_access",
            "m.room.encryption"
          ].includes(e.getType()) || (yield r.cryptoBackend.encryptEvent(e, n)));
        }
      })();
    }
    roomInitialSync(e, n) {
      var r, i = rn("/rooms/$roomId/initialSync", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Get, i, {
        limit: (r = n == null ? void 0 : n.toString()) !== null && r !== void 0 ? r : "30"
      });
    }
    setRoomReadMarkersHttpRequest(e, n, r, i) {
      var a = this;
      return me(function* () {
        var s = rn("/rooms/$roomId/read_markers", {
          $roomId: e
        }), l = {
          [ia.FullyRead]: n,
          [ia.Read]: r
        };
        return ((yield a.doesServerSupportUnstableFeature("org.matrix.msc2285.stable")) || (yield a.isVersionSupported("v1.4"))) && (l[ia.ReadPrivate] = i), a.http.authedRequest(rt.Post, s, void 0, l);
      })();
    }
    getJoinedRooms() {
      var e = rn("/joined_rooms", {});
      return this.http.authedRequest(rt.Get, e);
    }
    getJoinedRoomMembers(e) {
      var n = rn("/rooms/$roomId/joined_members", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    publicRooms() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, { server: n, limit: r, since: i } = e, a = qte(e, sCe);
      if (Object.keys(a).length === 0) {
        var s = {
          server: n,
          limit: r,
          since: i
        };
        return this.http.authedRequest(rt.Get, "/publicRooms", s);
      } else {
        var l = {
          server: n
        }, c = No({
          limit: r,
          since: i
        }, a);
        return this.http.authedRequest(rt.Post, "/publicRooms", l, c);
      }
    }
    createAlias(e, n) {
      var r = rn("/directory/room/$alias", {
        $alias: e
      }), i = {
        room_id: n
      };
      return this.http.authedRequest(rt.Put, r, void 0, i);
    }
    deleteAlias(e) {
      var n = rn("/directory/room/$alias", {
        $alias: e
      });
      return this.http.authedRequest(rt.Delete, n);
    }
    getLocalAliases(e) {
      var n = rn("/rooms/$roomId/aliases", {
        $roomId: e
      }), r = zo.V3;
      return this.http.authedRequest(rt.Get, n, void 0, void 0, {
        prefix: r
      });
    }
    getRoomIdForAlias(e) {
      var n = rn("/directory/room/$alias", {
        $alias: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    getRoomDirectoryVisibility(e) {
      var n = rn("/directory/list/room/$roomId", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    setRoomDirectoryVisibility(e, n) {
      var r = rn("/directory/list/room/$roomId", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Put, r, void 0, {
        visibility: n
      });
    }
    searchUserDirectory(e) {
      var { term: n, limit: r } = e, i = {
        search_term: n
      };
      return r !== void 0 && (i.limit = r), this.http.authedRequest(rt.Post, "/user_directory/search", void 0, i);
    }
    uploadContent(e, n) {
      return this.http.uploadContent(e, n);
    }
    cancelUpload(e) {
      return this.http.cancelUpload(e);
    }
    getCurrentUploads() {
      return this.http.getCurrentUploads();
    }
    getProfileInfo(e, n) {
      var r = n ? rn("/profile/$userId/$info", {
        $userId: e,
        $info: n
      }) : rn("/profile/$userId", {
        $userId: e
      });
      return this.http.authedRequest(rt.Get, r);
    }
    doesServerSupportExtendedProfiles() {
      var e = this;
      return me(function* () {
        return (yield e.doesServerSupportUnstableFeature(bre)) || (yield e.doesServerSupportUnstableFeature(xre));
      })();
    }
    getExtendedProfileRequestPrefix() {
      var e = this;
      return me(function* () {
        return (yield e.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable")) ? zo.V3 : "/_matrix/client/unstable/uk.tcpip.msc4133";
      })();
    }
    getExtendedProfile(e) {
      var n = this;
      return me(function* () {
        if (!(yield n.doesServerSupportExtendedProfiles())) throw new Error("Server does not support extended profiles");
        return n.http.authedRequest(rt.Get, rn("/profile/$userId", {
          $userId: e
        }), void 0, void 0, {
          prefix: yield n.getExtendedProfileRequestPrefix()
        });
      })();
    }
    getExtendedProfileProperty(e, n) {
      var r = this;
      return me(function* () {
        if (!(yield r.doesServerSupportExtendedProfiles())) throw new Error("Server does not support extended profiles");
        var i = yield r.http.authedRequest(rt.Get, rn("/profile/$userId/$key", {
          $userId: e,
          $key: n
        }), void 0, void 0, {
          prefix: yield r.getExtendedProfileRequestPrefix()
        });
        return i[n];
      })();
    }
    setExtendedProfileProperty(e, n) {
      var r = this;
      return me(function* () {
        if (!(yield r.doesServerSupportExtendedProfiles())) throw new Error("Server does not support extended profiles");
        var i = r.getUserId();
        yield r.http.authedRequest(rt.Put, rn("/profile/$userId/$key", {
          $userId: i,
          $key: e
        }), void 0, {
          [e]: n
        }, {
          prefix: yield r.getExtendedProfileRequestPrefix()
        });
      })();
    }
    deleteExtendedProfileProperty(e) {
      var n = this;
      return me(function* () {
        if (!(yield n.doesServerSupportExtendedProfiles())) throw new Error("Server does not support extended profiles");
        var r = n.getUserId();
        yield n.http.authedRequest(rt.Delete, rn("/profile/$userId/$key", {
          $userId: r,
          $key: e
        }), void 0, void 0, {
          prefix: yield n.getExtendedProfileRequestPrefix()
        });
      })();
    }
    patchExtendedProfile(e) {
      var n = this;
      return me(function* () {
        if (!(yield n.doesServerSupportExtendedProfiles())) throw new Error("Server does not support extended profiles");
        var r = n.getUserId();
        return n.http.authedRequest(rt.Patch, rn("/profile/$userId", {
          $userId: r
        }), {}, e, {
          prefix: yield n.getExtendedProfileRequestPrefix()
        });
      })();
    }
    setExtendedProfile(e) {
      var n = this;
      return me(function* () {
        if (!(yield n.doesServerSupportExtendedProfiles())) throw new Error("Server does not support extended profiles");
        var r = n.getUserId();
        yield n.http.authedRequest(rt.Put, rn("/profile/$userId", {
          $userId: r
        }), {}, e, {
          prefix: yield n.getExtendedProfileRequestPrefix()
        });
      })();
    }
    getThreePids() {
      return this.http.authedRequest(rt.Get, "/account/3pid");
    }
    addThreePidOnly(e) {
      var n = this;
      return me(function* () {
        var r = "/account/3pid/add";
        return n.http.authedRequest(rt.Post, r, void 0, e);
      })();
    }
    bindThreePid(e) {
      var n = this;
      return me(function* () {
        var r = "/account/3pid/bind";
        return n.http.authedRequest(rt.Post, r, void 0, e);
      })();
    }
    unbindThreePid(e, n) {
      var r = this;
      return me(function* () {
        var i = "/account/3pid/unbind", a = {
          medium: e,
          address: n,
          id_server: r.getIdentityServerUrl(true)
        };
        return r.http.authedRequest(rt.Post, i, void 0, a);
      })();
    }
    deleteThreePid(e, n) {
      var r = "/account/3pid/delete";
      return this.http.authedRequest(rt.Post, r, void 0, {
        medium: e,
        address: n
      });
    }
    setPassword(e, n, r) {
      var i = "/account/password", a = {
        auth: e,
        new_password: n,
        logout_devices: r
      };
      return this.http.authedRequest(rt.Post, i, void 0, a);
    }
    getDevices() {
      return this.http.authedRequest(rt.Get, "/devices");
    }
    getDevice(e) {
      var n = rn("/devices/$device_id", {
        $device_id: e
      });
      return this.http.authedRequest(rt.Get, n);
    }
    setDeviceDetails(e, n) {
      var r = rn("/devices/$device_id", {
        $device_id: e
      });
      return this.http.authedRequest(rt.Put, r, void 0, n);
    }
    deleteDevice(e, n) {
      var r = rn("/devices/$device_id", {
        $device_id: e
      }), i = {};
      return n && (i.auth = n), this.http.authedRequest(rt.Delete, r, void 0, i);
    }
    deleteMultipleDevices(e, n) {
      var r = {
        devices: e
      };
      n && (r.auth = n);
      var i = "/delete_devices";
      return this.http.authedRequest(rt.Post, i, void 0, r);
    }
    getPushers() {
      var e = this;
      return me(function* () {
        var n = yield e.http.authedRequest(rt.Get, "/pushers");
        return (yield e.doesServerSupportUnstableFeature("org.matrix.msc3881")) || (n.pushers = n.pushers.map((r) => (r.hasOwnProperty(KR.name) || (r[KR.name] = true), r))), n;
      })();
    }
    setPusher(e) {
      var n = "/pushers/set";
      return this.http.authedRequest(rt.Post, n, void 0, e);
    }
    removePusher(e, n) {
      var r = "/pushers/set", i = {
        pushkey: e,
        app_id: n,
        kind: null
      };
      return this.http.authedRequest(rt.Post, r, void 0, i);
    }
    setLocalNotificationSettings(e, n) {
      var r = "".concat(fne.name, ".").concat(e);
      return this.setAccountData(r, n);
    }
    getPushRules() {
      return this.http.authedRequest(rt.Get, "/pushrules/").then((e) => (this.setPushRules(e), this.pushRules));
    }
    setPushRules(e) {
      this.pushRules = Oa.rewriteDefaultRules(this.logger, e, this.getUserId()), this.pushProcessor.updateCachedPushRuleKeys(this.pushRules);
    }
    addPushRule(e, n, r, i) {
      var a = rn("/pushrules/" + e + "/$kind/$ruleId", {
        $kind: n,
        $ruleId: r
      });
      return this.http.authedRequest(rt.Put, a, void 0, i);
    }
    deletePushRule(e, n, r) {
      var i = rn("/pushrules/" + e + "/$kind/$ruleId", {
        $kind: n,
        $ruleId: r
      });
      return this.http.authedRequest(rt.Delete, i);
    }
    setPushRuleEnabled(e, n, r, i) {
      var a = rn("/pushrules/" + e + "/$kind/$ruleId/enabled", {
        $kind: n,
        $ruleId: r
      });
      return this.http.authedRequest(rt.Put, a, void 0, {
        enabled: i
      });
    }
    setPushRuleActions(e, n, r, i) {
      var a = rn("/pushrules/" + e + "/$kind/$ruleId/actions", {
        $kind: n,
        $ruleId: r
      });
      return this.http.authedRequest(rt.Put, a, void 0, {
        actions: i
      });
    }
    search(e, n) {
      var { body: r, next_batch: i } = e, a = {};
      return i && (a.next_batch = i), this.http.authedRequest(rt.Post, "/search", a, r, {
        abortSignal: n
      });
    }
    uploadKeysRequest(e, n) {
      return this.http.authedRequest(rt.Post, "/keys/upload", void 0, e);
    }
    uploadKeySignatures(e) {
      return this.http.authedRequest(rt.Post, "/keys/signatures/upload", void 0, e);
    }
    downloadKeysForUsers(e) {
      var { token: n } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = {
        device_keys: {}
      };
      return n !== void 0 && (r.token = n), e.forEach((i) => {
        r.device_keys[i] = [];
      }), this.http.authedRequest(rt.Post, "/keys/query", void 0, r);
    }
    claimOneTimeKeys(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "signed_curve25519", r = arguments.length > 2 ? arguments[2] : void 0, i = {};
      n === void 0 && (n = "signed_curve25519");
      for (var [a, s] of e) {
        var l = i[a] || {};
        WC(i, a, l), WC(l, s, n);
      }
      var c = {
        one_time_keys: i
      };
      r && (c.timeout = r);
      var d = "/keys/claim";
      return this.http.authedRequest(rt.Post, d, void 0, c);
    }
    getKeyChanges(e, n) {
      var r = {
        from: e,
        to: n
      };
      return this.http.authedRequest(rt.Get, "/keys/changes", r);
    }
    uploadDeviceSigningKeys(e, n) {
      var r = Object.assign({}, n);
      return e && Object.assign(r, {
        auth: e
      }), this.http.authedRequest(rt.Post, "/keys/device_signing/upload", void 0, r, {
        prefix: zo.Unstable
      });
    }
    registerWithIdentityServer(e) {
      if (!this.idBaseUrl) throw new Error("No identity server base URL set");
      var n = this.http.getUrl("/account/register", void 0, _u.V2, this.idBaseUrl);
      return this.http.requestOtherUrl(rt.Post, n, e);
    }
    requestEmailToken(e, n, r, i, a) {
      var s = {
        client_secret: n,
        email: e,
        send_attempt: r == null ? void 0 : r.toString()
      };
      return i && (s.next_link = i), this.http.idServerRequest(rt.Post, "/validate/email/requestToken", s, _u.V2, a);
    }
    requestMsisdnToken(e, n, r, i, a, s) {
      var l = {
        client_secret: r,
        country: e,
        phone_number: n,
        send_attempt: i == null ? void 0 : i.toString()
      };
      return a && (l.next_link = a), this.http.idServerRequest(rt.Post, "/validate/msisdn/requestToken", l, _u.V2, s);
    }
    submitMsisdnToken(e, n, r, i) {
      var a = {
        sid: e,
        client_secret: n,
        token: r
      };
      return this.http.idServerRequest(rt.Post, "/validate/msisdn/submitToken", a, _u.V2, i ?? void 0);
    }
    submitMsisdnTokenOtherUrl(e, n, r, i) {
      var a = {
        sid: n,
        client_secret: r,
        token: i
      };
      return this.http.requestOtherUrl(rt.Post, e, a);
    }
    getIdentityHashDetails(e) {
      return this.http.idServerRequest(rt.Get, "/hash_details", void 0, _u.V2, e);
    }
    identityHashedLookup(e, n) {
      var r = this;
      return me(function* () {
        var i = {}, a = yield r.getIdentityHashDetails(n);
        if (!a || !a.lookup_pepper || !a.algorithms) throw new Error("Unsupported identity server: bad response");
        i.pepper = a.lookup_pepper;
        var s = {};
        if (a.algorithms.includes("sha256")) i.addresses = yield Promise.all(e.map((function() {
          var f = me(function* (g) {
            var m = g[0].toLowerCase(), v = g[1].toLowerCase(), y = yield sre("".concat(m, " ").concat(v, " ").concat(i.pepper)), w = ck(y);
            return s[w] = g[0], w;
          });
          return function(g) {
            return f.apply(this, arguments);
          };
        })())), i.algorithm = "sha256";
        else if (a.algorithms.includes("none")) i.addresses = e.map((f) => {
          var g = f[0].toLowerCase(), m = f[1].toLowerCase(), v = "".concat(g, " ").concat(m);
          return s[v] = f[0], v;
        }), i.algorithm = "none";
        else throw new Error("Unsupported identity server: unknown hash algorithm");
        var l = yield r.http.idServerRequest(rt.Post, "/lookup", i, _u.V2, n);
        if (!(l != null && l.mappings)) return [];
        var c = [];
        for (var d of Object.keys(l.mappings)) {
          var u = l.mappings[d], h = s[d];
          if (!h) throw new Error("Identity server returned more results than expected");
          c.push({
            address: h,
            mxid: u
          });
        }
        return c;
      })();
    }
    lookupThreePid(e, n, r) {
      var i = this;
      return me(function* () {
        var a = yield i.identityHashedLookup([
          [
            n,
            e
          ]
        ], r), s = a.find((c) => c.address === n);
        if (!s) return {};
        var l = {
          address: n,
          medium: e,
          mxid: s.mxid
        };
        return l;
      })();
    }
    bulkLookupThreePids(e, n) {
      var r = this;
      return me(function* () {
        var i = yield r.identityHashedLookup(e.map((c) => [
          c[1],
          c[0]
        ]), n), a = [], s = function* (d) {
          var u = e.find((h) => h[1] === d.address);
          if (!u) throw new Error("Identity sever returned unexpected results");
          a.push([
            u[0],
            d.address,
            d.mxid
          ]);
        };
        for (var l of i) yield* s(l);
        return {
          threepids: a
        };
      })();
    }
    getIdentityAccount(e) {
      return this.http.idServerRequest(rt.Get, "/account", void 0, _u.V2, e);
    }
    sendToDevice(e, n, r) {
      var i = rn("/sendToDevice/$eventType/$txnId", {
        $eventType: e,
        $txnId: r || this.makeTxnId()
      }), a = {
        messages: dg(n)
      }, s = /* @__PURE__ */ new Map();
      for (var [l, c] of n) s.set(l, Array.from(c.keys()));
      return this.logger.debug("PUT ".concat(i), s), this.http.authedRequest(rt.Put, i, void 0, a);
    }
    encryptAndSendToDevice(e, n, r) {
      var i = this;
      return me(function* () {
        if (!i.cryptoBackend) throw new Error("Cannot encrypt to device event, your client does not support encryption.");
        var a = yield i.cryptoBackend.encryptToDeviceMessages(e, n, r);
        yield i.queueToDevice(a);
      })();
    }
    queueToDevice(e) {
      return this.toDeviceMessageQueue.queueBatch(e);
    }
    getThirdpartyProtocols() {
      return this.http.authedRequest(rt.Get, "/thirdparty/protocols").then((e) => {
        if (!e || typeof e != "object") throw new Error("/thirdparty/protocols did not return an object: ".concat(e));
        return e;
      });
    }
    getThirdpartyLocation(e, n) {
      var r = rn("/thirdparty/location/$protocol", {
        $protocol: e
      });
      return this.http.authedRequest(rt.Get, r, n);
    }
    getThirdpartyUser(e, n) {
      var r = rn("/thirdparty/user/$protocol", {
        $protocol: e
      });
      return this.http.authedRequest(rt.Get, r, n);
    }
    getTerms(e, n) {
      var r = this.termsUrlForService(e, n);
      return this.http.requestOtherUrl(rt.Get, r);
    }
    agreeToTerms(e, n, r, i) {
      var a = this.termsUrlForService(e, n), s = {
        Authorization: "Bearer " + r
      };
      return this.http.requestOtherUrl(rt.Post, a, {
        user_accepts: i
      }, {
        headers: s
      });
    }
    reportEvent(e, n, r, i) {
      var a = rn("/rooms/$roomId/report/$eventId", {
        $roomId: e,
        $eventId: n
      });
      return this.http.authedRequest(rt.Post, a, void 0, {
        score: r,
        reason: i
      });
    }
    reportRoom(e, n) {
      var r = rn("/rooms/$roomId/report", {
        $roomId: e
      });
      return this.http.authedRequest(rt.Post, r, void 0, {
        reason: n
      });
    }
    getRoomHierarchy(e, n, r) {
      var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, a = arguments.length > 4 ? arguments[4] : void 0, s = rn("/rooms/$roomId/hierarchy", {
        $roomId: e
      }), l = {
        suggested_only: String(i),
        max_depth: r == null ? void 0 : r.toString(),
        from: a,
        limit: n == null ? void 0 : n.toString()
      };
      return this.http.authedRequest(rt.Get, s, l, void 0, {
        prefix: zo.V1
      }).catch((c) => {
        if (c.errcode === "M_UNRECOGNIZED") return this.http.authedRequest(rt.Get, s, l, void 0, {
          prefix: "/_matrix/client/unstable/org.matrix.msc2946"
        });
        throw c;
      });
    }
    unstableCreateFileTree(e) {
      var n = this;
      return me(function* () {
        var { room_id: r } = yield n.createRoom({
          name: e,
          preset: Yb.PrivateChat,
          power_level_content_override: No(No({}, tDe), {}, {
            users: {
              [n.getUserId()]: 100
            }
          }),
          creation_content: {
            [qC]: Bo.Space
          },
          initial_state: [
            {
              type: HR.name,
              state_key: WR.name,
              content: {
                [$R.name]: true
              }
            },
            {
              type: ce.RoomEncryption,
              state_key: "",
              content: {
                algorithm: "m.megolm.v1.aes-sha2"
              }
            }
          ]
        });
        return new KH(n, r);
      })();
    }
    unstableGetFileTreeSpace(e) {
      var n, r, i = this.getRoom(e);
      if ((i == null ? void 0 : i.getMyMembership()) !== Ht.Join) return null;
      var a = i.currentState.getStateEvents(ce.RoomCreate, ""), s = i.currentState.getStateEvents(HR.name, WR.name);
      if (!a) throw new Error("Expected single room create event");
      return !(s != null && (n = s.getContent()) !== null && n !== void 0 && n[$R.name]) || ((r = a.getContent()) === null || r === void 0 ? void 0 : r[qC]) !== Bo.Space ? null : new KH(this, e);
    }
    slidingSync(e, n, r) {
      var i = {};
      e.pos && (i.pos = e.pos, delete e.pos), e.timeout && (i.timeout = e.timeout, delete e.timeout);
      var a = e.clientTimeout;
      return delete e.clientTimeout, this.http.authedRequest(rt.Post, "/sync", i, e, {
        prefix: "/_matrix/client/unstable/org.matrix.simplified_msc3575",
        baseUrl: n,
        localTimeoutMs: a,
        abortSignal: r
      });
    }
    supportsThreads() {
      var e;
      return ((e = this.clientOpts) === null || e === void 0 ? void 0 : e.threadSupport) || false;
    }
    supportsIntentionalMentions() {
      return this.canSupport.get($o.IntentionalMentions) !== Ho.Unsupported;
    }
    getRoomSummary(e, n) {
      var r = this;
      return me(function* () {
        var i = {
          prefix: "/_matrix/client/unstable/im.nheko.summary"
        };
        try {
          var a = rn("/summary/$roomid", {
            $roomid: e
          });
          return yield r.http.authedRequest(rt.Get, a, {
            via: n
          }, void 0, i);
        } catch (l) {
          if (l instanceof Un && l.errcode === "M_UNRECOGNIZED") {
            var s = rn("/rooms/$roomid/summary", {
              $roomid: e
            });
            return yield r.http.authedRequest(rt.Get, s, {
              via: n
            }, void 0, i);
          } else throw l;
        }
      })();
    }
    processThreadEvents(e, n, r) {
      e.processThreadedEvents(n, r);
    }
    processThreadRoots(e, n, r) {
      this.supportsThreads() && e.processThreadRoots(n, r);
    }
    processBeaconEvents(e, n) {
      this.processAggregatedTimelineEvents(e, n);
    }
    processAggregatedTimelineEvents(e, n) {
      n != null && n.length && e && (e.currentState.processBeaconEvents(n, this), e.processPollEvents(n));
    }
    whoami() {
      var e = this;
      return me(function* () {
        return e.http.authedRequest(rt.Get, "/account/whoami");
      })();
    }
    timestampToEvent(e, n, r) {
      var i = this;
      return me(function* () {
        var a = rn("/rooms/$roomId/timestamp_to_event", {
          $roomId: e
        }), s = {
          ts: n.toString(),
          dir: r
        };
        try {
          return yield i.http.authedRequest(rt.Get, a, s, void 0, {
            prefix: zo.V1
          });
        } catch (l) {
          if (l.errcode === "M_UNRECOGNIZED" && (l.httpStatus === 400 || l.httpStatus === 404 || l.httpStatus === 405)) return yield i.http.authedRequest(rt.Get, a, s, void 0, {
            prefix: "/_matrix/client/unstable/org.matrix.msc3030"
          });
          throw l;
        }
      })();
    }
    getAuthMetadata() {
      var e = this;
      return me(function* () {
        var n;
        try {
          n = yield e.http.request(rt.Get, "/auth_metadata", void 0, void 0, {
            prefix: zo.Unstable + "/org.matrix.msc2965"
          });
        } catch (i) {
          if (i instanceof Un && i.errcode === "M_UNRECOGNIZED") {
            var { issuer: r } = yield e.http.request(rt.Get, "/auth_issuer", void 0, void 0, {
              prefix: zo.Unstable + "/org.matrix.msc2965"
            });
            return gB(r);
          }
          throw i;
        }
        return pB(n);
      })();
    }
  }
  $(gk, "RESTORE_BACKUP_ERROR_BAD_KEY", "RESTORE_BACKUP_ERROR_BAD_KEY");
  function d$(t) {
    return Object.fromEntries(Object.entries(t).map((e) => {
      var [n, r] = e;
      return [
        "".concat(kd, ".").concat(n),
        r
      ];
    }));
  }
  function wre(t, e) {
    var n, r = t.getUserId(), i = e.getId(), a = t.getRoom(e.getRoomId());
    if (!(!a || !r || !i)) {
      if (!a.findEventById(i)) {
        _e.info("Decrypted event ".concat(e.getId(), " is not in room ").concat(a.roomId, ": ignoring"));
        return;
      }
      var s = !!e.threadRootId && !e.isThreadRoot, l;
      if (s) {
        var c = a.getThread(e.threadRootId);
        l = c ? c.hasUserReadEvent(r, i) : true;
      } else l = a.hasUserReadEvent(r, i);
      if (!l) {
        var d = t.getPushActionsForEvent(e, true), u = !!(d != null && (n = d.tweaks) !== null && n !== void 0 && n.highlight);
        if (u) {
          var h = a.getUnreadCountForEventContext(ir.Highlight, e) + 1;
          s ? a.setThreadUnreadNotificationCount(e.threadRootId, ir.Highlight, h) : a.setUnreadNotificationCount(ir.Highlight, h);
        }
        var f = !!(d != null && d.notify);
        if (f) {
          var g = a.getUnreadCountForEventContext(ir.Total, e) + 1;
          s ? a.setThreadUnreadNotificationCount(e.threadRootId, ir.Total, g) : a.setUnreadNotificationCount(ir.Total, g);
        }
      }
    }
  }
  function W1(t) {
    return N2(t) ? Kb : t.threadRootId;
  }
  function N2(t) {
    if (!t.threadRootId || t.isThreadRoot) return true;
    if (!t.isRelation()) return _e.warn("Event is not a relation or a thread root, but still has a threadRootId! id=".concat(t.getId())), true;
    if (t.isRelation(pi.name)) return false;
    var e = t.relationEventId === t.threadRootId;
    return e;
  }
  var m_ = "m.login.email.identity", u$ = "m.login.msisdn", sr = (function(t) {
    return t.Password = "m.login.password", t.Recaptcha = "m.login.recaptcha", t.Terms = "m.login.terms", t.Email = "m.login.email.identity", t.Msisdn = "m.login.msisdn", t.Sso = "m.login.sso", t.SsoUnstable = "org.matrix.login.sso", t.Dummy = "m.login.dummy", t.RegistrationToken = "m.login.registration_token", t.UnstableRegistrationToken = "org.matrix.msc3231.login.registration_token", t;
  })({});
  class Dre extends Error {
    constructor(e, n, r) {
      super(e), this.required_stages = n, this.flows = r, $(this, "name", "NoAuthFlowFoundError");
    }
  }
  class hCe {
    constructor(e) {
      var n = this;
      $(this, "matrixClient", void 0), $(this, "inputs", void 0), $(this, "clientSecret", void 0), $(this, "requestCallback", void 0), $(this, "busyChangedCallback", void 0), $(this, "stateUpdatedCallback", void 0), $(this, "requestEmailTokenCallback", void 0), $(this, "supportedStages", void 0), $(this, "data", void 0), $(this, "emailSid", void 0), $(this, "requestingEmailToken", false), $(this, "attemptAuthDeferred", null), $(this, "chosenFlow", null), $(this, "currentStage", null), $(this, "emailAttempt", 1), $(this, "submitPromise", null), $(this, "requestEmailToken", me(function* () {
        if (n.requestingEmailToken) _e.warn("Could not request email token: Already requesting");
        else {
          _e.trace("Requesting email token. Attempt: " + n.emailAttempt), n.requestingEmailToken = true;
          try {
            var r = yield n.requestEmailTokenCallback(n.inputs.emailAddress, n.clientSecret, n.emailAttempt++, n.data.session);
            n.emailSid = r.sid, _e.trace("Email token request succeeded");
          } finally {
            n.requestingEmailToken = false;
          }
        }
      })), this.matrixClient = e.matrixClient, this.data = e.authData || {
        flows: []
      }, this.requestCallback = e.doRequest, this.busyChangedCallback = e.busyChanged, this.stateUpdatedCallback = e.stateUpdated || e.startAuthStage, this.requestEmailTokenCallback = e.requestEmailToken, this.inputs = e.inputs || {}, e.sessionId && (this.data.session = e.sessionId), this.clientSecret = e.clientSecret || this.matrixClient.generateClientSecret(), this.emailSid = e.emailSid, e.supportedStages !== void 0 && (this.supportedStages = new Set(e.supportedStages));
    }
    attemptAuth() {
      var e = this;
      return me(function* () {
        var n;
        e.attemptAuthDeferred = Promise.withResolvers();
        var r = e.attemptAuthDeferred.promise;
        if ((n = e.data) !== null && n !== void 0 && (n = n.flows) !== null && n !== void 0 && n.length) e.startNextAuthStage();
        else {
          var i;
          (i = e.busyChangedCallback) === null || i === void 0 || i.call(e, true);
          var a = e.data.session ? {
            session: e.data.session
          } : null;
          e.doRequest(a).finally(() => {
            var s;
            (s = e.busyChangedCallback) === null || s === void 0 || s.call(e, false);
          });
        }
        return r;
      })();
    }
    poll() {
      var e = this;
      return me(function* () {
        if (e.data.session && e.attemptAuthDeferred && !e.submitPromise) {
          var n = {};
          if (e.currentStage == m_ && e.emailSid) {
            var r = {
              sid: e.emailSid,
              client_secret: e.clientSecret
            }, i = e.matrixClient.getIdentityServerUrl();
            i && (r.id_server = new URL(i).host), n = {
              type: m_,
              threepid_creds: r
            };
          }
          e.submitAuthDict(n, true);
        }
      })();
    }
    getSessionId() {
      var e;
      return (e = this.data) === null || e === void 0 ? void 0 : e.session;
    }
    getClientSecret() {
      return this.clientSecret;
    }
    getStageParams(e) {
      var n;
      return (n = this.data) === null || n === void 0 || (n = n.params) === null || n === void 0 ? void 0 : n[e];
    }
    getChosenFlow() {
      return this.chosenFlow;
    }
    submitAuthDict(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i, a = n.length > 1 && n[1] !== void 0 ? n[1] : false;
        if (!r.attemptAuthDeferred) throw new Error("submitAuthDict() called before attemptAuth()");
        if (!a) {
          var s;
          (s = r.busyChangedCallback) === null || s === void 0 || s.call(r, true);
        }
        for (; r.submitPromise; ) try {
          yield r.submitPromise;
        } catch {
        }
        var l;
        (i = r.data) !== null && i !== void 0 && i.session ? l = Object.assign({
          session: r.data.session
        }, e) : l = e;
        try {
          r.submitPromise = r.doRequest(l, a), yield r.submitPromise;
        } finally {
          if (r.submitPromise = null, !a) {
            var c;
            (c = r.busyChangedCallback) === null || c === void 0 || c.call(r, false);
          }
        }
      })();
    }
    getEmailSid() {
      return this.emailSid;
    }
    setEmailSid(e) {
      this.emailSid = e;
    }
    doRequest(e) {
      var n = arguments, r = this;
      return me(function* () {
        var i = n.length > 1 && n[1] !== void 0 ? n[1] : false;
        try {
          var a = yield r.requestCallback(e, i);
          r.attemptAuthDeferred.resolve(a), r.attemptAuthDeferred = null;
        } catch (m) {
          var s, l, c, d, u = m instanceof Un ? m : null, h = (s = u == null || (l = u.data) === null || l === void 0 ? void 0 : l.flows) !== null && s !== void 0 ? s : null, f = ((c = r.data) === null || c === void 0 ? void 0 : c.flows) || !!h;
          if (!u || u.httpStatus !== 401 || !u.data || !f) if (i) _e.log("Background poll request failed doing UI auth: ignoring", m);
          else {
            var g;
            (g = r.attemptAuthDeferred) === null || g === void 0 || g.reject(m);
          }
          u && !u.data && (u.data = {}), u && !u.data.flows && !u.data.completed && !u.data.session && (u.data.flows = r.data.flows, u.data.completed = r.data.completed, u.data.session = r.data.session), u && (r.data = u.data);
          try {
            r.startNextAuthStage();
          } catch (v) {
            r.attemptAuthDeferred.reject(v), r.attemptAuthDeferred = null;
            return;
          }
          if (!r.emailSid && (d = r.chosenFlow) !== null && d !== void 0 && d.stages.includes(sr.Email)) try {
            yield r.requestEmailToken();
          } catch (v) {
            r.attemptAuthDeferred.reject(v), r.attemptAuthDeferred = null;
          }
        }
      })();
    }
    startNextAuthStage() {
      var e, n, r = this.chooseStage();
      if (!r) throw new Error("No incomplete flows from the server");
      if (this.currentStage = r, r === sr.Dummy) {
        this.submitAuthDict({
          type: "m.login.dummy"
        });
        return;
      }
      if ((e = this.data) !== null && e !== void 0 && e.errcode || (n = this.data) !== null && n !== void 0 && n.error) {
        var i, a;
        this.stateUpdatedCallback(r, {
          errcode: ((i = this.data) === null || i === void 0 ? void 0 : i.errcode) || "",
          error: ((a = this.data) === null || a === void 0 ? void 0 : a.error) || ""
        });
        return;
      }
      this.stateUpdatedCallback(r, r === m_ ? {
        emailSid: this.emailSid
      } : {});
    }
    chooseStage() {
      this.chosenFlow === null && (this.chosenFlow = this.chooseFlow()), _e.log("Active flow => %s", JSON.stringify(this.chosenFlow));
      var e = this.firstUncompletedStage(this.chosenFlow);
      return _e.log("Next stage: %s", e), e;
    }
    scoreFlow(e) {
      var n = e.stages.length;
      return this.supportedStages !== void 0 && (n += e.stages.filter((r) => !this.supportedStages.has(r)).length * 10), n;
    }
    chooseFlow() {
      var e, n = ((e = this.data) === null || e === void 0 ? void 0 : e.flows) || [], r = !!this.inputs.emailAddress || !!this.emailSid, i = !!this.inputs.phoneCountry && !!this.inputs.phoneNumber;
      n.sort((u, h) => this.scoreFlow(u) - this.scoreFlow(h));
      for (var a of n) {
        var s = false, l = false;
        for (var c of a.stages) c === m_ ? s = true : c == u$ && (l = true);
        if (s == r && l == i) return a;
      }
      var d = [];
      throw r && d.push(m_), i && d.push(u$), new Dre("No appropriate authentication flow found", d, n);
    }
    firstUncompletedStage(e) {
      var n, r = ((n = this.data) === null || n === void 0 ? void 0 : n.completed) || [];
      return e.stages.find((i) => !r.includes(i));
    }
  }
  class fCe {
    constructor() {
      $(this, "unthreadedReadReceipts", /* @__PURE__ */ new Map()), $(this, "threadedReadReceipts", new zu(() => /* @__PURE__ */ new Map()));
    }
    setUnthreaded(e, n) {
      this.unthreadedReadReceipts.set(e, n);
    }
    setThreaded(e, n, r) {
      this.threadedReadReceipts.getOrCreate(e).set(n, r);
    }
    allUnthreaded() {
      return this.unthreadedReadReceipts.entries();
    }
    *allThreaded() {
      for (var e of this.threadedReadReceipts.values()) for (var n of e.entries()) yield n;
    }
    consumeEphemeralEvents(e) {
      e == null ? void 0 : e.forEach((n) => {
        n.type !== ce.Receipt || !n.content || Object.keys(n.content).forEach((r) => {
          Object.entries(n.content[r]).forEach((i) => {
            var [a, s] = i;
            if ($7(a)) for (var l of Object.keys(s)) {
              var c = n.content[r][a][l], d = {
                data: n.content[r][a][l],
                type: a,
                eventId: r
              };
              c.thread_id ? this.setThreaded(c.thread_id, l, d) : this.setUnthreaded(l, d);
            }
          });
        });
      });
    }
    buildAccumulatedReceiptEvent(e) {
      var n = {
        type: ce.Receipt,
        room_id: e,
        content: {}
      }, r = new zu(() => new zu(() => /* @__PURE__ */ new Map()));
      for (var [i, a] of this.allUnthreaded()) r.getOrCreate(a.eventId).getOrCreate(a.type).set(i, a.data);
      for (var [s, l] of this.allThreaded()) r.getOrCreate(l.eventId).getOrCreate(l.type).set(s, l.data);
      return n.content = dg(r), r.size > 0 ? n : null;
    }
  }
  var yu = (function(t) {
    return t.Invite = "invite", t.Leave = "leave", t.Join = "join", t.Knock = "knock", t;
  })({});
  function mCe(t) {
    return "_localTs" in t && t._localTs !== void 0;
  }
  class Cre {
    constructor() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      this.opts = e, $(this, "accountData", {}), $(this, "inviteRooms", {}), $(this, "knockRooms", {}), $(this, "joinRooms", {}), $(this, "nextBatch", null), this.opts.maxTimelineEntries = this.opts.maxTimelineEntries || 50;
    }
    accumulate(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      this.accumulateRooms(e, n), this.accumulateAccountData(e), this.nextBatch = e.next_batch;
    }
    accumulateAccountData(e) {
      !e.account_data || !e.account_data.events || e.account_data.events.forEach((n) => {
        this.accountData[n.type] = n;
      });
    }
    accumulateRooms(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      e.rooms && (e.rooms.invite && Object.keys(e.rooms.invite).forEach((r) => {
        this.accumulateRoom(r, yu.Invite, e.rooms.invite[r], n);
      }), e.rooms.join && Object.keys(e.rooms.join).forEach((r) => {
        this.accumulateRoom(r, yu.Join, e.rooms.join[r], n);
      }), e.rooms.leave && Object.keys(e.rooms.leave).forEach((r) => {
        this.accumulateRoom(r, yu.Leave, e.rooms.leave[r], n);
      }), e.rooms.knock && Object.keys(e.rooms.knock).forEach((r) => {
        this.accumulateRoom(r, yu.Knock, e.rooms.knock[r], n);
      }));
    }
    accumulateRoom(e, n, r) {
      var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
      switch (n) {
        case yu.Invite:
          this.knockRooms[e] && delete this.knockRooms[e], this.accumulateInviteState(e, r);
          break;
        case yu.Knock:
          this.accumulateKnockState(e, r);
          break;
        case yu.Join:
          this.knockRooms[e] ? delete this.knockRooms[e] : this.inviteRooms[e] && delete this.inviteRooms[e], this.accumulateJoinState(e, r, i);
          break;
        case yu.Leave:
          this.knockRooms[e] ? delete this.knockRooms[e] : this.inviteRooms[e] ? delete this.inviteRooms[e] : delete this.joinRooms[e];
          break;
        default:
          _e.error("Unknown cateogory: ", n);
      }
    }
    accumulateInviteState(e, n) {
      if (!(!n.invite_state || !n.invite_state.events)) {
        if (!this.inviteRooms[e]) {
          this.inviteRooms[e] = {
            invite_state: n.invite_state
          };
          return;
        }
        var r = this.inviteRooms[e];
        n.invite_state.events.forEach((i) => {
          for (var a = false, s = 0; s < r.invite_state.events.length; s++) {
            var l = r.invite_state.events[s];
            l.type === i.type && l.state_key == i.state_key && (r.invite_state.events[s] = i, a = true);
          }
          a || r.invite_state.events.push(i);
        });
      }
    }
    accumulateKnockState(e, n) {
      if (!(!n.knock_state || !n.knock_state.events)) {
        if (!this.knockRooms[e]) {
          this.knockRooms[e] = {
            knock_state: n.knock_state
          };
          return;
        }
        var r = this.knockRooms[e];
        n.knock_state.events.forEach((i) => {
          for (var a = false, s = 0; s < r.knock_state.events.length; s++) {
            var l = r.knock_state.events[s];
            l.type === i.type && l.state_key == i.state_key && (r.knock_state.events[s] = i, a = true);
          }
          a || r.knock_state.events.push(i);
        });
      }
    }
    accumulateJoinState(e, n) {
      var r, i, a, s, l, c, d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      this.joinRooms[e] || (this.joinRooms[e] = {
        _currentState: /* @__PURE__ */ Object.create(null),
        _timeline: [],
        _accountData: /* @__PURE__ */ Object.create(null),
        _unreadNotifications: {},
        _unreadThreadNotifications: {},
        _summary: {},
        _receipts: new fCe()
      });
      var u = this.joinRooms[e];
      if (n.account_data && n.account_data.events && n.account_data.events.forEach((C) => {
        u._accountData[C.type] = C;
      }), n.unread_notifications && (u._unreadNotifications = n.unread_notifications), u._unreadThreadNotifications = (r = (i = n[R2.stable]) !== null && i !== void 0 ? i : n[R2.unstable]) !== null && r !== void 0 ? r : void 0, n.summary) {
        var h, f, g, m = "m.heroes", v = "m.invited_member_count", y = "m.joined_member_count", w = u._summary, b = n.summary;
        w[m] = (h = b[m]) !== null && h !== void 0 ? h : w[m], w[y] = (f = b[y]) !== null && f !== void 0 ? f : w[y], w[v] = (g = b[v]) !== null && g !== void 0 ? g : w[v];
      }
      if (u._receipts.consumeEphemeralEvents((a = n.ephemeral) === null || a === void 0 ? void 0 : a.events), n.timeline && n.timeline.limited && (u._timeline = []), (s = n.state) === null || s === void 0 || (s = s.events) === null || s === void 0 || s.forEach((C) => {
        nw(u._currentState, C);
      }), (l = n["org.matrix.msc4222.state_after"]) === null || l === void 0 || (l = l.events) === null || l === void 0 || l.forEach((C) => {
        nw(u._currentState, C);
      }), (c = n.timeline) === null || c === void 0 || (c = c.events) === null || c === void 0 || c.forEach((C, x) => {
        var S;
        n["org.matrix.msc4222.state_after"] || nw(u._currentState, C);
        var T;
        if (d) T = C;
        else {
          var A;
          T = Object.assign({}, C), T.unsigned !== void 0 && (T.unsigned = Object.assign({}, T.unsigned));
          var B = (A = C.unsigned) === null || A === void 0 ? void 0 : A.age;
          B !== void 0 && (T._localTs = Date.now() - B);
        }
        u._timeline.push({
          event: T,
          token: x === 0 && (S = n.timeline.prev_batch) !== null && S !== void 0 ? S : null
        });
      }), u._timeline.length > this.opts.maxTimelineEntries) {
        for (var j = u._timeline.length - this.opts.maxTimelineEntries, k = j; k < u._timeline.length; k++) if (u._timeline[k].token) {
          u._timeline = u._timeline.slice(k, u._timeline.length);
          break;
        }
      }
    }
    getJSON() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, n = {
        join: {},
        invite: {},
        knock: {},
        leave: {}
      };
      Object.keys(this.inviteRooms).forEach((i) => {
        n.invite[i] = this.inviteRooms[i];
      }), Object.keys(this.knockRooms).forEach((i) => {
        n.knock[i] = this.knockRooms[i];
      }), Object.keys(this.joinRooms).forEach((i) => {
        var a = this.joinRooms[i], s = {
          ephemeral: {
            events: []
          },
          account_data: {
            events: []
          },
          state: {
            events: []
          },
          "org.matrix.msc4222.state_after": {
            events: []
          },
          timeline: {
            events: [],
            prev_batch: null
          },
          unread_notifications: a._unreadNotifications,
          unread_thread_notifications: a._unreadThreadNotifications,
          summary: a._summary
        };
        Object.keys(a._accountData).forEach((f) => {
          s.account_data.events.push(a._accountData[f]);
        });
        var l = a._receipts.buildAccumulatedReceiptEvent(i);
        l && s.ephemeral.events.push(l), a._timeline.forEach((f) => {
          if (!s.timeline.prev_batch) {
            if (!f.token) return;
            s.timeline.prev_batch = f.token;
          }
          var g;
          !e && mCe(f.event) ? (g = Object.assign({}, f.event), g.unsigned !== void 0 && (g.unsigned = Object.assign({}, g.unsigned)), delete g._localTs, g.unsigned = g.unsigned || {}, g.unsigned.age = Date.now() - f.event._localTs) : g = f.event, s.timeline.events.push(g);
        });
        for (var c = /* @__PURE__ */ Object.create(null), d = s.timeline.events.length - 1; d >= 0; d--) {
          var u = s.timeline.events[d];
          if (!(u.state_key === null || u.state_key === void 0)) {
            var h = Gb(u);
            h.unsigned && (h.unsigned.prev_content && (h.content = h.unsigned.prev_content), h.unsigned.prev_sender && (h.sender = h.unsigned.prev_sender)), nw(c, h);
          }
        }
        Object.keys(a._currentState).forEach((f) => {
          Object.keys(a._currentState[f]).forEach((g) => {
            var m = a._currentState[f][g];
            s["org.matrix.msc4222.state_after"].events.push(m), c[f] && c[f][g] && (m = c[f][g]), s.state.events.push(m);
          });
        }), n.join[i] = s;
      });
      var r = [];
      return Object.keys(this.accountData).forEach((i) => {
        r.push(this.accountData[i]);
      }), {
        nextBatch: this.nextBatch,
        roomsData: n,
        accountData: r
      };
    }
    getNextBatchToken() {
      return this.nextBatch;
    }
  }
  function nw(t, e) {
    e.state_key === null || e.state_key === void 0 || !e.type || (t[e.type] || (t[e.type] = /* @__PURE__ */ Object.create(null)), t[e.type][e.state_key] = e);
  }
  function h$(t) {
    var e = typeof t == "string" && !!t && t !== "undefined" && t !== "null";
    return e || typeof t == "number";
  }
  class FB {
    constructor() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      $(this, "rooms", {}), $(this, "users", {}), $(this, "syncToken", null), $(this, "filters", new zu(() => /* @__PURE__ */ new Map())), $(this, "accountData", /* @__PURE__ */ new Map()), $(this, "localStorage", void 0), $(this, "oobMembers", /* @__PURE__ */ new Map()), $(this, "pendingEvents", {}), $(this, "clientOptions", void 0), $(this, "pendingToDeviceBatches", []), $(this, "nextToDeviceBatchId", 0), $(this, "createUser", void 0), $(this, "onRoomMember", (n, r, i) => {
        var a;
        if (i.membership !== Ht.Invite) {
          var s = this.users[i.userId] || ((a = this.createUser) === null || a === void 0 ? void 0 : a.call(this, i.userId));
          i.name && (s.setDisplayName(i.name), i.events.member && s.setRawDisplayName(i.events.member.getDirectionalContent().displayname)), i.events.member && i.events.member.getContent().avatar_url && s.setAvatarUrl(i.events.member.getContent().avatar_url), this.users[s.userId] = s;
        }
      }), this.localStorage = e.localStorage;
    }
    getSyncToken() {
      return this.syncToken;
    }
    isNewlyCreated() {
      return Promise.resolve(true);
    }
    setSyncToken(e) {
      this.syncToken = e;
    }
    storeRoom(e) {
      this.rooms[e.roomId] = e, e.currentState.on(qn.Members, this.onRoomMember), e.currentState.getMembers().forEach((n) => {
        this.onRoomMember(null, e.currentState, n);
      });
    }
    setUserCreator(e) {
      this.createUser = e;
    }
    getRoom(e) {
      return this.rooms[e] || null;
    }
    getRooms() {
      return Object.values(this.rooms);
    }
    removeRoom(e) {
      this.rooms[e] && this.rooms[e].currentState.removeListener(qn.Members, this.onRoomMember), delete this.rooms[e];
    }
    getRoomSummaries() {
      return Object.values(this.rooms).map(function(e) {
        return e.summary;
      });
    }
    storeUser(e) {
      this.users[e.userId] = e;
    }
    getUser(e) {
      return this.users[e] || null;
    }
    getUsers() {
      return Object.values(this.users);
    }
    scrollback(e, n) {
      return [];
    }
    storeEvents(e, n, r, i) {
    }
    storeFilter(e) {
      !(e != null && e.userId) || !(e != null && e.filterId) || this.filters.getOrCreate(e.userId).set(e.filterId, e);
    }
    getFilter(e, n) {
      var r;
      return ((r = this.filters.get(e)) === null || r === void 0 ? void 0 : r.get(n)) || null;
    }
    getFilterIdByName(e) {
      if (!this.localStorage) return null;
      var n = "mxjssdk_memory_filter_" + e;
      try {
        var r = this.localStorage.getItem(n);
        if (h$(r)) return r;
      } catch {
      }
      return null;
    }
    setFilterIdByName(e, n) {
      if (this.localStorage) {
        var r = "mxjssdk_memory_filter_" + e;
        try {
          h$(n) ? this.localStorage.setItem(r, n) : this.localStorage.removeItem(r);
        } catch {
        }
      }
    }
    storeAccountDataEvents(e) {
      e.forEach((n) => {
        var r = !Object.keys(n.getContent()).length;
        r ? this.accountData.delete(n.getType()) : this.accountData.set(n.getType(), n);
      });
    }
    getAccountData(e) {
      return this.accountData.get(e);
    }
    setSyncData(e) {
      return Promise.resolve();
    }
    wantsSave() {
      return false;
    }
    save(e) {
      return Promise.resolve();
    }
    startup() {
      return Promise.resolve();
    }
    getSavedSync() {
      return Promise.resolve(null);
    }
    getSavedSyncToken() {
      return Promise.resolve(null);
    }
    deleteAllData() {
      return this.rooms = {}, this.users = {}, this.syncToken = null, this.filters = new zu(() => /* @__PURE__ */ new Map()), this.accountData = /* @__PURE__ */ new Map(), Promise.resolve();
    }
    getOutOfBandMembers(e) {
      return Promise.resolve(this.oobMembers.get(e) || null);
    }
    setOutOfBandMembers(e, n) {
      return this.oobMembers.set(e, n), Promise.resolve();
    }
    clearOutOfBandMembers(e) {
      return this.oobMembers.delete(e), Promise.resolve();
    }
    getClientOptions() {
      return Promise.resolve(this.clientOptions);
    }
    storeClientOptions(e) {
      return this.clientOptions = Object.assign({}, e), Promise.resolve();
    }
    getPendingEvents(e) {
      var n = this;
      return me(function* () {
        var r;
        return (r = n.pendingEvents[e]) !== null && r !== void 0 ? r : [];
      })();
    }
    setPendingEvents(e, n) {
      var r = this;
      return me(function* () {
        r.pendingEvents[e] = n;
      })();
    }
    saveToDeviceBatches(e) {
      for (var n of e) this.pendingToDeviceBatches.push({
        id: this.nextToDeviceBatchId++,
        eventType: n.eventType,
        txnId: n.txnId,
        batch: n.batch
      });
      return Promise.resolve();
    }
    getOldestToDeviceBatch() {
      var e = this;
      return me(function* () {
        return e.pendingToDeviceBatches.length === 0 ? null : e.pendingToDeviceBatches[0];
      })();
    }
    removeToDeviceBatch(e) {
      return this.pendingToDeviceBatches = this.pendingToDeviceBatches.filter((n) => n.id !== e), Promise.resolve();
    }
    destroy() {
      return me(function* () {
      })();
    }
  }
  let bA, K1;
  bA = "migrationState";
  q1 = (function(t) {
    return t[t.NOT_STARTED = 0] = "NOT_STARTED", t[t.INITIAL_DATA_MIGRATED = 1] = "INITIAL_DATA_MIGRATED", t[t.OLM_SESSIONS_MIGRATED = 2] = "OLM_SESSIONS_MIGRATED", t[t.MEGOLM_SESSIONS_MIGRATED = 3] = "MEGOLM_SESSIONS_MIGRATED", t[t.ROOM_SETTINGS_MIGRATED = 4] = "ROOM_SETTINGS_MIGRATED", t[t.INITIAL_OWN_KEY_QUERY_DONE = 5] = "INITIAL_OWN_KEY_QUERY_DONE", t;
  })({});
  K1 = 50;
  function f$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function m$(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? f$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : f$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function rw(t, e) {
    return encodeURIComponent(t) + "/" + encodeURIComponent(e);
  }
  function gCe(t) {
    var e = t.split("/"), n = decodeURIComponent(e[0]), r = decodeURIComponent(e[1]);
    return {
      senderKey: n,
      sessionId: r
    };
  }
  class pk {
    constructor() {
      $(this, "migrationState", q1.NOT_STARTED), $(this, "account", null), $(this, "crossSigningKeys", null), $(this, "privateKeys", {}), $(this, "sessions", {}), $(this, "inboundGroupSessions", {}), $(this, "inboundGroupSessionsWithheld", {}), $(this, "rooms", {}), $(this, "sessionsNeedingBackup", {});
    }
    containsData() {
      var e = this;
      return me(function* () {
        return e.account !== null;
      })();
    }
    startup() {
      var e = this;
      return me(function* () {
        return e;
      })();
    }
    deleteAllData() {
      return Promise.resolve();
    }
    getMigrationState() {
      var e = this;
      return me(function* () {
        return e.migrationState;
      })();
    }
    setMigrationState(e) {
      var n = this;
      return me(function* () {
        n.migrationState = e;
      })();
    }
    getAccount(e, n) {
      n(this.account);
    }
    storeAccount(e, n) {
      this.account = n;
    }
    getCrossSigningKeys(e, n) {
      n(this.crossSigningKeys);
    }
    getSecretStorePrivateKey(e, n, r) {
      var i = this.privateKeys[r];
      n(i || null);
    }
    storeSecretStorePrivateKey(e, n, r) {
      this.privateKeys[n] = r;
    }
    countEndToEndSessions(e, n) {
      var r = 0;
      for (var i of Object.values(this.sessions)) r += Object.keys(i).length;
      n(r);
    }
    getEndToEndSession(e, n, r, i) {
      var a = this.sessions[e] || {};
      i(a[n] || null);
    }
    getEndToEndSessions(e, n, r) {
      r(this.sessions[e] || {});
    }
    storeEndToEndSession(e, n, r, i) {
      var a = this.sessions[e];
      a === void 0 && (a = {}, this.sessions[e] = a), WC(a, n, r);
    }
    getEndToEndSessionsBatch() {
      var e = this;
      return me(function* () {
        var n = [];
        for (var r of Object.values(e.sessions)) for (var i of Object.values(r)) if (n.push(i), n.length >= K1) return n;
        return n.length === 0 ? null : n;
      })();
    }
    deleteEndToEndSessionsBatch(e) {
      var n = this;
      return me(function* () {
        for (var { deviceKey: r, sessionId: i } of e) {
          var a = n.sessions[r] || {};
          delete a[i], Object.keys(a).length === 0 && delete n.sessions[r];
        }
      })();
    }
    getEndToEndInboundGroupSession(e, n, r, i) {
      var a = rw(e, n);
      i(this.inboundGroupSessions[a] || null, this.inboundGroupSessionsWithheld[a] || null);
    }
    storeEndToEndInboundGroupSession(e, n, r, i) {
      var a = rw(e, n);
      this.inboundGroupSessions[a] = r;
    }
    countEndToEndInboundGroupSessions() {
      var e = this;
      return me(function* () {
        return Object.keys(e.inboundGroupSessions).length;
      })();
    }
    getEndToEndInboundGroupSessionsBatch() {
      var e = this;
      return me(function* () {
        var n = [];
        for (var [r, i] of Object.entries(e.inboundGroupSessions)) if (n.push(m$(m$({}, gCe(r)), {}, {
          sessionData: i,
          needsBackup: r in e.sessionsNeedingBackup
        })), n.length >= K1) return n;
        return n.length === 0 ? null : n;
      })();
    }
    deleteEndToEndInboundGroupSessionsBatch(e) {
      var n = this;
      return me(function* () {
        for (var { senderKey: r, sessionId: i } of e) {
          var a = rw(r, i);
          delete n.inboundGroupSessions[a];
        }
      })();
    }
    getEndToEndRooms(e, n) {
      n(this.rooms);
    }
    markSessionsNeedingBackup(e) {
      for (var n of e) {
        var r = rw(n.senderKey, n.sessionId);
        this.sessionsNeedingBackup[r] = true;
      }
      return Promise.resolve();
    }
    doTxn(e, n, r) {
      return Promise.resolve(r(null));
    }
  }
  var l9 = {}, Sm = {}, f0 = {}, g$;
  function vB() {
    if (g$) return f0;
    g$ = 1, Object.defineProperty(f0, "__esModule", {
      value: true
    }), f0.WidgetApiDirection = void 0, f0.invertedDirection = e;
    var t = (function(n) {
      return n.ToWidget = "toWidget", n.FromWidget = "fromWidget", n;
    })({});
    f0.WidgetApiDirection = t;
    function e(n) {
      if (n === t.ToWidget) return t.FromWidget;
      if (n === t.FromWidget) return t.ToWidget;
      throw new Error("Invalid direction");
    }
    return f0;
  }
  var fu = {}, p$;
  function _B() {
    if (p$) return fu;
    p$ = 1, Object.defineProperty(fu, "__esModule", {
      value: true
    }), fu.UnstableApiVersion = fu.MatrixApiVersion = fu.CurrentApiVersions = void 0;
    var t = (function(r) {
      return r.Prerelease1 = "0.0.1", r.Prerelease2 = "0.0.2", r;
    })({});
    fu.MatrixApiVersion = t;
    var e = (function(r) {
      return r.MSC2762 = "org.matrix.msc2762", r.MSC2762_UPDATE_STATE = "org.matrix.msc2762_update_state", r.MSC2871 = "org.matrix.msc2871", r.MSC2873 = "org.matrix.msc2873", r.MSC2931 = "org.matrix.msc2931", r.MSC2974 = "org.matrix.msc2974", r.MSC2876 = "org.matrix.msc2876", r.MSC3819 = "org.matrix.msc3819", r.MSC3846 = "town.robin.msc3846", r.MSC3869 = "org.matrix.msc3869", r.MSC3973 = "org.matrix.msc3973", r.MSC4039 = "org.matrix.msc4039", r;
    })({});
    fu.UnstableApiVersion = e;
    var n = [
      t.Prerelease1,
      t.Prerelease2,
      e.MSC2762,
      e.MSC2762_UPDATE_STATE,
      e.MSC2871,
      e.MSC2873,
      e.MSC2931,
      e.MSC2974,
      e.MSC2876,
      e.MSC3819,
      e.MSC3846,
      e.MSC3869,
      e.MSC3973,
      e.MSC4039
    ];
    return fu.CurrentApiVersions = n, fu;
  }
  var g_ = {}, F$;
  function yB() {
    if (F$) return g_;
    F$ = 1, Object.defineProperty(g_, "__esModule", {
      value: true
    }), g_.PostmessageTransport = void 0;
    var t = nk(), e = Fk(), n = [
      "message"
    ];
    function r(x) {
      "@babel/helpers - typeof";
      return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
        return typeof S;
      } : function(S) {
        return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
      }, r(x);
    }
    function i(x, S) {
      if (x == null) return {};
      var T = a(x, S), A, B;
      if (Object.getOwnPropertySymbols) {
        var U = Object.getOwnPropertySymbols(x);
        for (B = 0; B < U.length; B++) A = U[B], !(S.indexOf(A) >= 0) && Object.prototype.propertyIsEnumerable.call(x, A) && (T[A] = x[A]);
      }
      return T;
    }
    function a(x, S) {
      if (x == null) return {};
      var T = {}, A = Object.keys(x), B, U;
      for (U = 0; U < A.length; U++) B = A[U], !(S.indexOf(B) >= 0) && (T[B] = x[B]);
      return T;
    }
    function s(x, S) {
      var T = Object.keys(x);
      if (Object.getOwnPropertySymbols) {
        var A = Object.getOwnPropertySymbols(x);
        S && (A = A.filter(function(B) {
          return Object.getOwnPropertyDescriptor(x, B).enumerable;
        })), T.push.apply(T, A);
      }
      return T;
    }
    function l(x) {
      for (var S = 1; S < arguments.length; S++) {
        var T = arguments[S] != null ? arguments[S] : {};
        S % 2 ? s(Object(T), true).forEach(function(A) {
          b(x, A, T[A]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(x, Object.getOwnPropertyDescriptors(T)) : s(Object(T)).forEach(function(A) {
          Object.defineProperty(x, A, Object.getOwnPropertyDescriptor(T, A));
        });
      }
      return x;
    }
    function c(x, S) {
      if (!(x instanceof S)) throw new TypeError("Cannot call a class as a function");
    }
    function d(x, S) {
      for (var T = 0; T < S.length; T++) {
        var A = S[T];
        A.enumerable = A.enumerable || false, A.configurable = true, "value" in A && (A.writable = true), Object.defineProperty(x, j(A.key), A);
      }
    }
    function u(x, S, T) {
      return S && d(x.prototype, S), Object.defineProperty(x, "prototype", {
        writable: false
      }), x;
    }
    function h(x, S) {
      if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function");
      x.prototype = Object.create(S && S.prototype, {
        constructor: {
          value: x,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(x, "prototype", {
        writable: false
      }), S && f(x, S);
    }
    function f(x, S) {
      return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(A, B) {
        return A.__proto__ = B, A;
      }, f(x, S);
    }
    function g(x) {
      var S = y();
      return function() {
        var A = w(x), B;
        if (S) {
          var U = w(this).constructor;
          B = Reflect.construct(A, arguments, U);
        } else B = A.apply(this, arguments);
        return m(this, B);
      };
    }
    function m(x, S) {
      if (S && (r(S) === "object" || typeof S == "function")) return S;
      if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return v(x);
    }
    function v(x) {
      if (x === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return x;
    }
    function y() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function w(x) {
      return w = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(T) {
        return T.__proto__ || Object.getPrototypeOf(T);
      }, w(x);
    }
    function b(x, S, T) {
      return S = j(S), S in x ? Object.defineProperty(x, S, {
        value: T,
        enumerable: true,
        configurable: true,
        writable: true
      }) : x[S] = T, x;
    }
    function j(x) {
      var S = k(x, "string");
      return r(S) === "symbol" ? S : String(S);
    }
    function k(x, S) {
      if (r(x) !== "object" || x === null) return x;
      var T = x[Symbol.toPrimitive];
      if (T !== void 0) {
        var A = T.call(x, S);
        if (r(A) !== "object") return A;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (S === "string" ? String : Number)(x);
    }
    var C = (function(x) {
      h(T, x);
      var S = g(T);
      function T(A, B, U, z) {
        var O;
        return c(this, T), O = S.call(this), O.sendDirection = A, O.transportWindow = U, O.inboundWindow = z, b(v(O), "strictOriginCheck", false), b(v(O), "targetOrigin", "*"), b(v(O), "timeoutSeconds", 10), b(v(O), "_ready", false), b(v(O), "_widgetId", void 0), b(v(O), "outboundRequests", /* @__PURE__ */ new Map()), b(v(O), "stopController", new AbortController()), b(v(O), "handleMessage", function(M) {
          if (!O.stopController.signal.aborted && M.data && !(O.strictOriginCheck && M.origin !== globalThis.origin)) {
            var I = M.data;
            if (!(!I.action || !I.requestId || !I.widgetId)) if (I.response) {
              if (I.api !== O.sendDirection) return;
              O.handleResponse(I);
            } else {
              var N = I;
              if (N.api !== (0, e.invertedDirection)(O.sendDirection)) return;
              O.handleRequest(N);
            }
          }
        }), O._widgetId = B, O;
      }
      return u(T, [
        {
          key: "ready",
          get: function() {
            return this._ready;
          }
        },
        {
          key: "widgetId",
          get: function() {
            return this._widgetId || null;
          }
        },
        {
          key: "nextRequestId",
          get: function() {
            for (var B = "widgetapi-".concat(Date.now()), U = 0, z = B; this.outboundRequests.has(z); ) z = "".concat(B, "-").concat(U++);
            return this.outboundRequests.set(z, null), z;
          }
        },
        {
          key: "sendInternal",
          value: function(B) {
            console.log("[PostmessageTransport] Sending object to ".concat(this.targetOrigin, ": "), B), this.transportWindow.postMessage(B, this.targetOrigin);
          }
        },
        {
          key: "reply",
          value: function(B, U) {
            return this.sendInternal(l(l({}, B), {}, {
              response: U
            }));
          }
        },
        {
          key: "send",
          value: function(B, U) {
            return this.sendComplete(B, U).then(function(z) {
              return z.response;
            });
          }
        },
        {
          key: "sendComplete",
          value: function(B, U) {
            var z = this;
            if (!this.ready || !this.widgetId) return Promise.reject(new Error("Not ready or unknown widget ID"));
            var O = {
              api: this.sendDirection,
              widgetId: this.widgetId,
              requestId: this.nextRequestId,
              action: B,
              data: U
            };
            return B === e.WidgetApiToWidgetAction.UpdateVisibility && (O.visible = U.visible), new Promise(function(M, I) {
              var N = function(oe) {
                Z(), M(oe);
              }, L = function(oe) {
                Z(), I(oe);
              }, H = setTimeout(function() {
                return L(new Error("Request timed out"));
              }, (z.timeoutSeconds || 1) * 1e3), V = function() {
                return L(new Error("Transport stopped"));
              };
              z.stopController.signal.addEventListener("abort", V);
              var Z = function() {
                z.outboundRequests.delete(O.requestId), clearTimeout(H), z.stopController.signal.removeEventListener("abort", V);
              };
              z.outboundRequests.set(O.requestId, {
                request: O,
                resolve: N,
                reject: L
              }), z.sendInternal(O);
            });
          }
        },
        {
          key: "start",
          value: function() {
            this.inboundWindow.addEventListener("message", this.handleMessage), this._ready = true;
          }
        },
        {
          key: "stop",
          value: function() {
            this._ready = false, this.stopController.abort(), this.inboundWindow.removeEventListener("message", this.handleMessage);
          }
        },
        {
          key: "handleRequest",
          value: function(B) {
            if (this.widgetId) {
              if (this.widgetId !== B.widgetId) return;
            } else this._widgetId = B.widgetId;
            this.emit("message", new CustomEvent("message", {
              detail: B
            }));
          }
        },
        {
          key: "handleResponse",
          value: function(B) {
            if (B.widgetId === this.widgetId) {
              var U = this.outboundRequests.get(B.requestId);
              if (U) if ((0, e.isErrorResponse)(B.response)) {
                var z = B.response.error, O = z.message, M = i(z, n);
                U.reject(new e.WidgetApiResponseError(O, M));
              } else U.resolve(B);
            }
          }
        }
      ]), T;
    })(t.EventEmitter);
    return g_.PostmessageTransport = C, g_;
  }
  var jm = {}, v$;
  function bB() {
    if (v$) return jm;
    v$ = 1, Object.defineProperty(jm, "__esModule", {
      value: true
    }), jm.WidgetApiToWidgetAction = jm.WidgetApiFromWidgetAction = void 0;
    var t = (function(n) {
      return n.SupportedApiVersions = "supported_api_versions", n.Capabilities = "capabilities", n.NotifyCapabilities = "notify_capabilities", n.ThemeChange = "theme_change", n.LanguageChange = "language_change", n.TakeScreenshot = "screenshot", n.UpdateVisibility = "visibility", n.OpenIDCredentials = "openid_credentials", n.WidgetConfig = "widget_config", n.CloseModalWidget = "close_modal", n.ButtonClicked = "button_clicked", n.SendEvent = "send_event", n.SendToDevice = "send_to_device", n.UpdateState = "update_state", n.UpdateTurnServers = "update_turn_servers", n;
    })({});
    jm.WidgetApiToWidgetAction = t;
    var e = (function(n) {
      return n.SupportedApiVersions = "supported_api_versions", n.ContentLoaded = "content_loaded", n.SendSticker = "m.sticker", n.UpdateAlwaysOnScreen = "set_always_on_screen", n.GetOpenIDCredentials = "get_openid", n.CloseModalWidget = "close_modal", n.OpenModalWidget = "open_modal", n.SetModalButtonEnabled = "set_button_enabled", n.SendEvent = "send_event", n.SendToDevice = "send_to_device", n.WatchTurnServers = "watch_turn_servers", n.UnwatchTurnServers = "unwatch_turn_servers", n.BeeperReadRoomAccountData = "com.beeper.read_room_account_data", n.MSC2876ReadEvents = "org.matrix.msc2876.read_events", n.MSC2931Navigate = "org.matrix.msc2931.navigate", n.MSC2974RenegotiateCapabilities = "org.matrix.msc2974.request_capabilities", n.MSC3869ReadRelations = "org.matrix.msc3869.read_relations", n.MSC3973UserDirectorySearch = "org.matrix.msc3973.user_directory_search", n.MSC4039GetMediaConfigAction = "org.matrix.msc4039.get_media_config", n.MSC4039UploadFileAction = "org.matrix.msc4039.upload_file", n.MSC4039DownloadFileAction = "org.matrix.msc4039.download_file", n.MSC4157UpdateDelayedEvent = "org.matrix.msc4157.update_delayed_event", n;
    })({});
    return jm.WidgetApiFromWidgetAction = e, jm;
  }
  var p_ = {}, _$;
  function xB() {
    if (_$) return p_;
    _$ = 1, Object.defineProperty(p_, "__esModule", {
      value: true
    }), p_.OpenIDRequestState = void 0;
    var t = (function(e) {
      return e.Allowed = "allowed", e.Blocked = "blocked", e.PendingUserConfirmation = "request", e;
    })({});
    return p_.OpenIDRequestState = t, p_;
  }
  var F_ = {}, y$;
  function Ere() {
    if (y$) return F_;
    y$ = 1, Object.defineProperty(F_, "__esModule", {
      value: true
    }), F_.MatrixWidgetType = void 0;
    var t = (function(e) {
      return e.Custom = "m.custom", e.JitsiMeet = "m.jitsi", e.Stickerpicker = "m.stickerpicker", e;
    })({});
    return F_.MatrixWidgetType = t, F_;
  }
  var v_ = {}, b$;
  function kre() {
    if (b$) return v_;
    b$ = 1, Object.defineProperty(v_, "__esModule", {
      value: true
    }), v_.BuiltInModalButtonID = void 0;
    var t = (function(e) {
      return e.Close = "m.close", e;
    })({});
    return v_.BuiltInModalButtonID = t, v_;
  }
  var mu = {}, x$;
  function wB() {
    if (x$) return mu;
    x$ = 1, Object.defineProperty(mu, "__esModule", {
      value: true
    }), mu.WidgetEventCapability = mu.EventKind = mu.EventDirection = void 0;
    function t(f) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(g) {
        return typeof g;
      } : function(g) {
        return g && typeof Symbol == "function" && g.constructor === Symbol && g !== Symbol.prototype ? "symbol" : typeof g;
      }, t(f);
    }
    function e(f, g) {
      var m = typeof Symbol < "u" && f[Symbol.iterator] || f["@@iterator"];
      if (!m) {
        if (Array.isArray(f) || (m = n(f)) || g) {
          m && (f = m);
          var v = 0, y = function() {
          };
          return {
            s: y,
            n: function() {
              return v >= f.length ? {
                done: true
              } : {
                done: false,
                value: f[v++]
              };
            },
            e: function(C) {
              throw C;
            },
            f: y
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var w = true, b = false, j;
      return {
        s: function() {
          m = m.call(f);
        },
        n: function() {
          var C = m.next();
          return w = C.done, C;
        },
        e: function(C) {
          b = true, j = C;
        },
        f: function() {
          try {
            !w && m.return != null && m.return();
          } finally {
            if (b) throw j;
          }
        }
      };
    }
    function n(f, g) {
      if (f) {
        if (typeof f == "string") return r(f, g);
        var m = Object.prototype.toString.call(f).slice(8, -1);
        if (m === "Object" && f.constructor && (m = f.constructor.name), m === "Map" || m === "Set") return Array.from(f);
        if (m === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)) return r(f, g);
      }
    }
    function r(f, g) {
      (g == null || g > f.length) && (g = f.length);
      for (var m = 0, v = new Array(g); m < g; m++) v[m] = f[m];
      return v;
    }
    function i(f, g) {
      if (!(f instanceof g)) throw new TypeError("Cannot call a class as a function");
    }
    function a(f, g) {
      for (var m = 0; m < g.length; m++) {
        var v = g[m];
        v.enumerable = v.enumerable || false, v.configurable = true, "value" in v && (v.writable = true), Object.defineProperty(f, l(v.key), v);
      }
    }
    function s(f, g, m) {
      return g && a(f.prototype, g), m && a(f, m), Object.defineProperty(f, "prototype", {
        writable: false
      }), f;
    }
    function l(f) {
      var g = c(f, "string");
      return t(g) === "symbol" ? g : String(g);
    }
    function c(f, g) {
      if (t(f) !== "object" || f === null) return f;
      var m = f[Symbol.toPrimitive];
      if (m !== void 0) {
        var v = m.call(f, g);
        if (t(v) !== "object") return v;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return String(f);
    }
    var d = (function(f) {
      return f.Event = "event", f.State = "state_event", f.ToDevice = "to_device", f.RoomAccount = "room_account", f;
    })({});
    mu.EventKind = d;
    var u = (function(f) {
      return f.Send = "send", f.Receive = "receive", f;
    })({});
    mu.EventDirection = u;
    var h = (function() {
      function f(g, m, v, y, w) {
        i(this, f), this.direction = g, this.eventType = m, this.kind = v, this.keyStr = y, this.raw = w;
      }
      return s(f, [
        {
          key: "matchesAsStateEvent",
          value: function(m, v, y) {
            return this.kind !== d.State || this.direction !== m || this.eventType !== v ? false : this.keyStr === null || this.keyStr === y;
          }
        },
        {
          key: "matchesAsToDeviceEvent",
          value: function(m, v) {
            return !(this.kind !== d.ToDevice || this.direction !== m || this.eventType !== v);
          }
        },
        {
          key: "matchesAsRoomEvent",
          value: function(m, v) {
            var y = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            if (this.kind !== d.Event || this.direction !== m || this.eventType !== v) return false;
            if (this.eventType === "m.room.message") {
              if (this.keyStr === null || this.keyStr === y) return true;
            } else return true;
            return false;
          }
        },
        {
          key: "matchesAsRoomAccountData",
          value: function(m, v) {
            return !(this.kind !== d.RoomAccount || this.direction !== m || this.eventType !== v);
          }
        }
      ], [
        {
          key: "forStateEvent",
          value: function(m, v, y) {
            v = v.replace(/#/g, "\\#"), y = y != null ? "#".concat(y) : "";
            var w = "org.matrix.msc2762.".concat(m, ".state_event:").concat(v).concat(y);
            return f.findEventCapabilities([
              w
            ])[0];
          }
        },
        {
          key: "forToDeviceEvent",
          value: function(m, v) {
            var y = "org.matrix.msc3819.".concat(m, ".to_device:").concat(v);
            return f.findEventCapabilities([
              y
            ])[0];
          }
        },
        {
          key: "forRoomEvent",
          value: function(m, v) {
            var y = "org.matrix.msc2762.".concat(m, ".event:").concat(v);
            return f.findEventCapabilities([
              y
            ])[0];
          }
        },
        {
          key: "forRoomMessageEvent",
          value: function(m, v) {
            v = v ?? "";
            var y = "org.matrix.msc2762.".concat(m, ".event:m.room.message#").concat(v);
            return f.findEventCapabilities([
              y
            ])[0];
          }
        },
        {
          key: "forRoomAccountData",
          value: function(m, v) {
            var y = "com.beeper.capabilities.".concat(m, ".room_account_data:").concat(v);
            return f.findEventCapabilities([
              y
            ])[0];
          }
        },
        {
          key: "findEventCapabilities",
          value: function(m) {
            var v = [], y = e(m), w;
            try {
              for (y.s(); !(w = y.n()).done; ) {
                var b = w.value, j = null, k = void 0, C = null;
                if (b.startsWith("org.matrix.msc2762.send.event:") ? (j = u.Send, C = d.Event, k = b.substring(30)) : b.startsWith("org.matrix.msc2762.send.state_event:") ? (j = u.Send, C = d.State, k = b.substring(36)) : b.startsWith("org.matrix.msc3819.send.to_device:") ? (j = u.Send, C = d.ToDevice, k = b.substring(34)) : b.startsWith("org.matrix.msc2762.receive.event:") ? (j = u.Receive, C = d.Event, k = b.substring(33)) : b.startsWith("org.matrix.msc2762.receive.state_event:") ? (j = u.Receive, C = d.State, k = b.substring(39)) : b.startsWith("org.matrix.msc3819.receive.to_device:") ? (j = u.Receive, C = d.ToDevice, k = b.substring(37)) : b.startsWith("com.beeper.capabilities.receive.room_account_data:") && (j = u.Receive, C = d.RoomAccount, k = b.substring(50)), !(j === null || C === null || k === void 0)) {
                  var x = k.startsWith("m.room.message#") || C === d.State, S = null;
                  if (k.includes("#") && x) {
                    var T = k.split("#"), A = T.findIndex(function(B) {
                      return !B.endsWith("\\");
                    });
                    k = T.slice(0, A + 1).map(function(B) {
                      return B.endsWith("\\") ? B.substring(0, B.length - 1) : B;
                    }).join("#"), S = T.slice(A + 1).join("#");
                  }
                  v.push(new f(j, k, C, S, b));
                }
              }
            } catch (B) {
              y.e(B);
            } finally {
              y.f();
            }
            return v;
          }
        }
      ]), f;
    })();
    return mu.WidgetEventCapability = h, mu;
  }
  var __ = {}, w$;
  function DB() {
    if (w$) return __;
    w$ = 1, Object.defineProperty(__, "__esModule", {
      value: true
    }), __.Symbols = void 0;
    var t = (function(e) {
      return e.AnyRoom = "*", e;
    })({});
    return __.Symbols = t, __;
  }
  var y_ = {}, D$;
  function CB() {
    if (D$) return y_;
    D$ = 1, Object.defineProperty(y_, "__esModule", {
      value: true
    }), y_.UpdateDelayedEventAction = void 0;
    var t = (function(e) {
      return e.Cancel = "cancel", e.Restart = "restart", e.Send = "send", e;
    })({});
    return y_.UpdateDelayedEventAction = t, y_;
  }
  var C$;
  function pCe() {
    if (C$) return Sm;
    C$ = 1;
    function t(ne) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(ae) {
        return typeof ae;
      } : function(ae) {
        return ae && typeof Symbol == "function" && ae.constructor === Symbol && ae !== Symbol.prototype ? "symbol" : typeof ae;
      }, t(ne);
    }
    Object.defineProperty(Sm, "__esModule", {
      value: true
    }), Sm.WidgetApiResponseError = Sm.WidgetApi = void 0;
    var e = nk(), n = vB(), r = _B(), i = yB(), a = bB(), s = xB(), l = Ere(), c = kre(), d = wB(), u = DB(), h = CB();
    function f() {
      f = function() {
        return ne;
      };
      var ne = {}, ae = Object.prototype, X = ae.hasOwnProperty, K = Object.defineProperty || function(Re, Ue, qe) {
        Re[Ue] = qe.value;
      }, G = typeof Symbol == "function" ? Symbol : {}, le = G.iterator || "@@iterator", te = G.asyncIterator || "@@asyncIterator", re = G.toStringTag || "@@toStringTag";
      function he(Re, Ue, qe) {
        return Object.defineProperty(Re, Ue, {
          value: qe,
          enumerable: true,
          configurable: true,
          writable: true
        }), Re[Ue];
      }
      try {
        he({}, "");
      } catch {
        he = function(qe, tt, ht) {
          return qe[tt] = ht;
        };
      }
      function se(Re, Ue, qe, tt) {
        var ht = Ue && Ue.prototype instanceof Ee ? Ue : Ee, $e = Object.create(ht.prototype), Tt = new wt(tt || []);
        return K($e, "_invoke", {
          value: bt(Re, qe, Tt)
        }), $e;
      }
      function ye(Re, Ue, qe) {
        try {
          return {
            type: "normal",
            arg: Re.call(Ue, qe)
          };
        } catch (tt) {
          return {
            type: "throw",
            arg: tt
          };
        }
      }
      ne.wrap = se;
      var we = {};
      function Ee() {
      }
      function ke() {
      }
      function Ne() {
      }
      var lt = {};
      he(lt, le, function() {
        return this;
      });
      var Rt = Object.getPrototypeOf, We = Rt && Rt(Rt(st([])));
      We && We !== ae && X.call(We, le) && (lt = We);
      var yt = Ne.prototype = Ee.prototype = Object.create(lt);
      function Xt(Re) {
        [
          "next",
          "throw",
          "return"
        ].forEach(function(Ue) {
          he(Re, Ue, function(qe) {
            return this._invoke(Ue, qe);
          });
        });
      }
      function nn(Re, Ue) {
        function qe(ht, $e, Tt, zt) {
          var Vt = ye(Re[ht], Re, $e);
          if (Vt.type !== "throw") {
            var bn = Vt.arg, Zn = bn.value;
            return Zn && t(Zn) == "object" && X.call(Zn, "__await") ? Ue.resolve(Zn.__await).then(function(Kn) {
              qe("next", Kn, Tt, zt);
            }, function(Kn) {
              qe("throw", Kn, Tt, zt);
            }) : Ue.resolve(Zn).then(function(Kn) {
              bn.value = Kn, Tt(bn);
            }, function(Kn) {
              return qe("throw", Kn, Tt, zt);
            });
          }
          zt(Vt.arg);
        }
        var tt;
        K(this, "_invoke", {
          value: function($e, Tt) {
            function zt() {
              return new Ue(function(Vt, bn) {
                qe($e, Tt, Vt, bn);
              });
            }
            return tt = tt ? tt.then(zt, zt) : zt();
          }
        });
      }
      function bt(Re, Ue, qe) {
        var tt = "suspendedStart";
        return function(ht, $e) {
          if (tt === "executing") throw new Error("Generator is already running");
          if (tt === "completed") {
            if (ht === "throw") throw $e;
            return Be();
          }
          for (qe.method = ht, qe.arg = $e; ; ) {
            var Tt = qe.delegate;
            if (Tt) {
              var zt = At(Tt, qe);
              if (zt) {
                if (zt === we) continue;
                return zt;
              }
            }
            if (qe.method === "next") qe.sent = qe._sent = qe.arg;
            else if (qe.method === "throw") {
              if (tt === "suspendedStart") throw tt = "completed", qe.arg;
              qe.dispatchException(qe.arg);
            } else qe.method === "return" && qe.abrupt("return", qe.arg);
            tt = "executing";
            var Vt = ye(Re, Ue, qe);
            if (Vt.type === "normal") {
              if (tt = qe.done ? "completed" : "suspendedYield", Vt.arg === we) continue;
              return {
                value: Vt.arg,
                done: qe.done
              };
            }
            Vt.type === "throw" && (tt = "completed", qe.method = "throw", qe.arg = Vt.arg);
          }
        };
      }
      function At(Re, Ue) {
        var qe = Ue.method, tt = Re.iterator[qe];
        if (tt === void 0) return Ue.delegate = null, qe === "throw" && Re.iterator.return && (Ue.method = "return", Ue.arg = void 0, At(Re, Ue), Ue.method === "throw") || qe !== "return" && (Ue.method = "throw", Ue.arg = new TypeError("The iterator does not provide a '" + qe + "' method")), we;
        var ht = ye(tt, Re.iterator, Ue.arg);
        if (ht.type === "throw") return Ue.method = "throw", Ue.arg = ht.arg, Ue.delegate = null, we;
        var $e = ht.arg;
        return $e ? $e.done ? (Ue[Re.resultName] = $e.value, Ue.next = Re.nextLoc, Ue.method !== "return" && (Ue.method = "next", Ue.arg = void 0), Ue.delegate = null, we) : $e : (Ue.method = "throw", Ue.arg = new TypeError("iterator result is not an object"), Ue.delegate = null, we);
      }
      function $t(Re) {
        var Ue = {
          tryLoc: Re[0]
        };
        1 in Re && (Ue.catchLoc = Re[1]), 2 in Re && (Ue.finallyLoc = Re[2], Ue.afterLoc = Re[3]), this.tryEntries.push(Ue);
      }
      function Lt(Re) {
        var Ue = Re.completion || {};
        Ue.type = "normal", delete Ue.arg, Re.completion = Ue;
      }
      function wt(Re) {
        this.tryEntries = [
          {
            tryLoc: "root"
          }
        ], Re.forEach($t, this), this.reset(true);
      }
      function st(Re) {
        if (Re) {
          var Ue = Re[le];
          if (Ue) return Ue.call(Re);
          if (typeof Re.next == "function") return Re;
          if (!isNaN(Re.length)) {
            var qe = -1, tt = function ht() {
              for (; ++qe < Re.length; ) if (X.call(Re, qe)) return ht.value = Re[qe], ht.done = false, ht;
              return ht.value = void 0, ht.done = true, ht;
            };
            return tt.next = tt;
          }
        }
        return {
          next: Be
        };
      }
      function Be() {
        return {
          value: void 0,
          done: true
        };
      }
      return ke.prototype = Ne, K(yt, "constructor", {
        value: Ne,
        configurable: true
      }), K(Ne, "constructor", {
        value: ke,
        configurable: true
      }), ke.displayName = he(Ne, re, "GeneratorFunction"), ne.isGeneratorFunction = function(Re) {
        var Ue = typeof Re == "function" && Re.constructor;
        return !!Ue && (Ue === ke || (Ue.displayName || Ue.name) === "GeneratorFunction");
      }, ne.mark = function(Re) {
        return Object.setPrototypeOf ? Object.setPrototypeOf(Re, Ne) : (Re.__proto__ = Ne, he(Re, re, "GeneratorFunction")), Re.prototype = Object.create(yt), Re;
      }, ne.awrap = function(Re) {
        return {
          __await: Re
        };
      }, Xt(nn.prototype), he(nn.prototype, te, function() {
        return this;
      }), ne.AsyncIterator = nn, ne.async = function(Re, Ue, qe, tt, ht) {
        ht === void 0 && (ht = Promise);
        var $e = new nn(se(Re, Ue, qe, tt), ht);
        return ne.isGeneratorFunction(Ue) ? $e : $e.next().then(function(Tt) {
          return Tt.done ? Tt.value : $e.next();
        });
      }, Xt(yt), he(yt, re, "Generator"), he(yt, le, function() {
        return this;
      }), he(yt, "toString", function() {
        return "[object Generator]";
      }), ne.keys = function(Re) {
        var Ue = Object(Re), qe = [];
        for (var tt in Ue) qe.push(tt);
        return qe.reverse(), function ht() {
          for (; qe.length; ) {
            var $e = qe.pop();
            if ($e in Ue) return ht.value = $e, ht.done = false, ht;
          }
          return ht.done = true, ht;
        };
      }, ne.values = st, wt.prototype = {
        constructor: wt,
        reset: function(Ue) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(Lt), !Ue) for (var qe in this) qe.charAt(0) === "t" && X.call(this, qe) && !isNaN(+qe.slice(1)) && (this[qe] = void 0);
        },
        stop: function() {
          this.done = true;
          var Ue = this.tryEntries[0].completion;
          if (Ue.type === "throw") throw Ue.arg;
          return this.rval;
        },
        dispatchException: function(Ue) {
          if (this.done) throw Ue;
          var qe = this;
          function tt(bn, Zn) {
            return Tt.type = "throw", Tt.arg = Ue, qe.next = bn, Zn && (qe.method = "next", qe.arg = void 0), !!Zn;
          }
          for (var ht = this.tryEntries.length - 1; ht >= 0; --ht) {
            var $e = this.tryEntries[ht], Tt = $e.completion;
            if ($e.tryLoc === "root") return tt("end");
            if ($e.tryLoc <= this.prev) {
              var zt = X.call($e, "catchLoc"), Vt = X.call($e, "finallyLoc");
              if (zt && Vt) {
                if (this.prev < $e.catchLoc) return tt($e.catchLoc, true);
                if (this.prev < $e.finallyLoc) return tt($e.finallyLoc);
              } else if (zt) {
                if (this.prev < $e.catchLoc) return tt($e.catchLoc, true);
              } else {
                if (!Vt) throw new Error("try statement without catch or finally");
                if (this.prev < $e.finallyLoc) return tt($e.finallyLoc);
              }
            }
          }
        },
        abrupt: function(Ue, qe) {
          for (var tt = this.tryEntries.length - 1; tt >= 0; --tt) {
            var ht = this.tryEntries[tt];
            if (ht.tryLoc <= this.prev && X.call(ht, "finallyLoc") && this.prev < ht.finallyLoc) {
              var $e = ht;
              break;
            }
          }
          $e && (Ue === "break" || Ue === "continue") && $e.tryLoc <= qe && qe <= $e.finallyLoc && ($e = null);
          var Tt = $e ? $e.completion : {};
          return Tt.type = Ue, Tt.arg = qe, $e ? (this.method = "next", this.next = $e.finallyLoc, we) : this.complete(Tt);
        },
        complete: function(Ue, qe) {
          if (Ue.type === "throw") throw Ue.arg;
          return Ue.type === "break" || Ue.type === "continue" ? this.next = Ue.arg : Ue.type === "return" ? (this.rval = this.arg = Ue.arg, this.method = "return", this.next = "end") : Ue.type === "normal" && qe && (this.next = qe), we;
        },
        finish: function(Ue) {
          for (var qe = this.tryEntries.length - 1; qe >= 0; --qe) {
            var tt = this.tryEntries[qe];
            if (tt.finallyLoc === Ue) return this.complete(tt.completion, tt.afterLoc), Lt(tt), we;
          }
        },
        catch: function(Ue) {
          for (var qe = this.tryEntries.length - 1; qe >= 0; --qe) {
            var tt = this.tryEntries[qe];
            if (tt.tryLoc === Ue) {
              var ht = tt.completion;
              if (ht.type === "throw") {
                var $e = ht.arg;
                Lt(tt);
              }
              return $e;
            }
          }
          throw new Error("illegal catch attempt");
        },
        delegateYield: function(Ue, qe, tt) {
          return this.delegate = {
            iterator: st(Ue),
            resultName: qe,
            nextLoc: tt
          }, this.method === "next" && (this.arg = void 0), we;
        }
      }, ne;
    }
    function g(ne, ae, X, K, G, le, te) {
      try {
        var re = ne[le](te), he = re.value;
      } catch (se) {
        X(se);
        return;
      }
      re.done ? ae(he) : Promise.resolve(he).then(K, G);
    }
    function m(ne) {
      return function() {
        var ae = this, X = arguments;
        return new Promise(function(K, G) {
          var le = ne.apply(ae, X);
          function te(he) {
            g(le, K, G, te, re, "next", he);
          }
          function re(he) {
            g(le, K, G, te, re, "throw", he);
          }
          te(void 0);
        });
      };
    }
    function v(ne, ae) {
      var X = Object.keys(ne);
      if (Object.getOwnPropertySymbols) {
        var K = Object.getOwnPropertySymbols(ne);
        ae && (K = K.filter(function(G) {
          return Object.getOwnPropertyDescriptor(ne, G).enumerable;
        })), X.push.apply(X, K);
      }
      return X;
    }
    function y(ne) {
      for (var ae = 1; ae < arguments.length; ae++) {
        var X = arguments[ae] != null ? arguments[ae] : {};
        ae % 2 ? v(Object(X), true).forEach(function(K) {
          k(ne, K, X[K]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(ne, Object.getOwnPropertyDescriptors(X)) : v(Object(X)).forEach(function(K) {
          Object.defineProperty(ne, K, Object.getOwnPropertyDescriptor(X, K));
        });
      }
      return ne;
    }
    function w(ne, ae) {
      var X = typeof Symbol < "u" && ne[Symbol.iterator] || ne["@@iterator"];
      if (!X) {
        if (Array.isArray(ne) || (X = b(ne)) || ae) {
          X && (ne = X);
          var K = 0, G = function() {
          };
          return {
            s: G,
            n: function() {
              return K >= ne.length ? {
                done: true
              } : {
                done: false,
                value: ne[K++]
              };
            },
            e: function(se) {
              throw se;
            },
            f: G
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var le = true, te = false, re;
      return {
        s: function() {
          X = X.call(ne);
        },
        n: function() {
          var se = X.next();
          return le = se.done, se;
        },
        e: function(se) {
          te = true, re = se;
        },
        f: function() {
          try {
            !le && X.return != null && X.return();
          } finally {
            if (te) throw re;
          }
        }
      };
    }
    function b(ne, ae) {
      if (ne) {
        if (typeof ne == "string") return j(ne, ae);
        var X = Object.prototype.toString.call(ne).slice(8, -1);
        if (X === "Object" && ne.constructor && (X = ne.constructor.name), X === "Map" || X === "Set") return Array.from(ne);
        if (X === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(X)) return j(ne, ae);
      }
    }
    function j(ne, ae) {
      (ae == null || ae > ne.length) && (ae = ne.length);
      for (var X = 0, K = new Array(ae); X < ae; X++) K[X] = ne[X];
      return K;
    }
    function k(ne, ae, X) {
      return ae = S(ae), ae in ne ? Object.defineProperty(ne, ae, {
        value: X,
        enumerable: true,
        configurable: true,
        writable: true
      }) : ne[ae] = X, ne;
    }
    function C(ne, ae) {
      for (var X = 0; X < ae.length; X++) {
        var K = ae[X];
        K.enumerable = K.enumerable || false, K.configurable = true, "value" in K && (K.writable = true), Object.defineProperty(ne, S(K.key), K);
      }
    }
    function x(ne, ae, X) {
      return ae && C(ne.prototype, ae), Object.defineProperty(ne, "prototype", {
        writable: false
      }), ne;
    }
    function S(ne) {
      var ae = T(ne, "string");
      return t(ae) === "symbol" ? ae : String(ae);
    }
    function T(ne, ae) {
      if (t(ne) !== "object" || ne === null) return ne;
      var X = ne[Symbol.toPrimitive];
      if (X !== void 0) {
        var K = X.call(ne, ae);
        if (t(K) !== "object") return K;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (ae === "string" ? String : Number)(ne);
    }
    function A(ne, ae) {
      if (!(ne instanceof ae)) throw new TypeError("Cannot call a class as a function");
    }
    function B(ne, ae) {
      if (typeof ae != "function" && ae !== null) throw new TypeError("Super expression must either be null or a function");
      ne.prototype = Object.create(ae && ae.prototype, {
        constructor: {
          value: ne,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(ne, "prototype", {
        writable: false
      }), ae && H(ne, ae);
    }
    function U(ne) {
      var ae = N();
      return function() {
        var K = V(ne), G;
        if (ae) {
          var le = V(this).constructor;
          G = Reflect.construct(K, arguments, le);
        } else G = K.apply(this, arguments);
        return z(this, G);
      };
    }
    function z(ne, ae) {
      if (ae && (t(ae) === "object" || typeof ae == "function")) return ae;
      if (ae !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return O(ne);
    }
    function O(ne) {
      if (ne === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return ne;
    }
    function M(ne) {
      var ae = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
      return M = function(K) {
        if (K === null || !L(K)) return K;
        if (typeof K != "function") throw new TypeError("Super expression must either be null or a function");
        if (typeof ae < "u") {
          if (ae.has(K)) return ae.get(K);
          ae.set(K, G);
        }
        function G() {
          return I(K, arguments, V(this).constructor);
        }
        return G.prototype = Object.create(K.prototype, {
          constructor: {
            value: G,
            enumerable: false,
            writable: true,
            configurable: true
          }
        }), H(G, K);
      }, M(ne);
    }
    function I(ne, ae, X) {
      return N() ? I = Reflect.construct.bind() : I = function(G, le, te) {
        var re = [
          null
        ];
        re.push.apply(re, le);
        var he = Function.bind.apply(G, re), se = new he();
        return te && H(se, te.prototype), se;
      }, I.apply(null, arguments);
    }
    function N() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function L(ne) {
      return Function.toString.call(ne).indexOf("[native code]") !== -1;
    }
    function H(ne, ae) {
      return H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(K, G) {
        return K.__proto__ = G, K;
      }, H(ne, ae);
    }
    function V(ne) {
      return V = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(X) {
        return X.__proto__ || Object.getPrototypeOf(X);
      }, V(ne);
    }
    function Z(ne) {
      return new ue(ne, 0);
    }
    function Y(ne) {
      return function() {
        return new oe(ne.apply(this, arguments));
      };
    }
    function oe(ne) {
      var ae, X;
      function K(le, te) {
        try {
          var re = ne[le](te), he = re.value, se = he instanceof ue;
          Promise.resolve(se ? he.v : he).then(function(ye) {
            if (se) {
              var we = le === "return" ? "return" : "next";
              if (!he.k || ye.done) return K(we, ye);
              ye = ne[we](ye).value;
            }
            G(re.done ? "return" : "normal", ye);
          }, function(ye) {
            K("throw", ye);
          });
        } catch (ye) {
          G("throw", ye);
        }
      }
      function G(le, te) {
        switch (le) {
          case "return":
            ae.resolve({
              value: te,
              done: true
            });
            break;
          case "throw":
            ae.reject(te);
            break;
          default:
            ae.resolve({
              value: te,
              done: false
            });
        }
        (ae = ae.next) ? K(ae.key, ae.arg) : X = null;
      }
      this._invoke = function(le, te) {
        return new Promise(function(re, he) {
          var se = {
            key: le,
            arg: te,
            resolve: re,
            reject: he,
            next: null
          };
          X ? X = X.next = se : (ae = X = se, K(le, te));
        });
      }, typeof ne.return != "function" && (this.return = void 0);
    }
    oe.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
      return this;
    }, oe.prototype.next = function(ne) {
      return this._invoke("next", ne);
    }, oe.prototype.throw = function(ne) {
      return this._invoke("throw", ne);
    }, oe.prototype.return = function(ne) {
      return this._invoke("return", ne);
    };
    function ue(ne, ae) {
      this.v = ne, this.k = ae;
    }
    var ie = (function(ne) {
      B(X, ne);
      var ae = U(X);
      function X(K, G) {
        var le;
        return A(this, X), le = ae.call(this, K), le.data = G, le;
      }
      return x(X);
    })(M(Error));
    Sm.WidgetApiResponseError = ie, ie.prototype.name = ie.name;
    var de = (function(ne) {
      B(X, ne);
      var ae = U(X);
      function X() {
        var K, G = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, le = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
        if (A(this, X), K = ae.call(this), k(O(K), "transport", void 0), k(O(K), "capabilitiesFinished", false), k(O(K), "supportsMSC2974Renegotiate", false), k(O(K), "requestedCapabilities", []), k(O(K), "approvedCapabilities", void 0), k(O(K), "cachedClientVersions", void 0), k(O(K), "turnServerWatchers", 0), !globalThis.parent) throw new Error("No parent window. This widget doesn't appear to be embedded properly.");
        return K.transport = new i.PostmessageTransport(n.WidgetApiDirection.FromWidget, G, globalThis.parent, globalThis), K.transport.targetOrigin = le, K.transport.on("message", K.handleMessage.bind(O(K))), K;
      }
      return x(X, [
        {
          key: "hasCapability",
          value: function(G) {
            return Array.isArray(this.approvedCapabilities) ? this.approvedCapabilities.includes(G) : this.requestedCapabilities.includes(G);
          }
        },
        {
          key: "requestCapability",
          value: function(G) {
            if (this.capabilitiesFinished && !this.supportsMSC2974Renegotiate) throw new Error("Capabilities have already been negotiated");
            this.requestedCapabilities.push(G);
          }
        },
        {
          key: "requestCapabilities",
          value: function(G) {
            var le = w(G), te;
            try {
              for (le.s(); !(te = le.n()).done; ) {
                var re = te.value;
                this.requestCapability(re);
              }
            } catch (he) {
              le.e(he);
            } finally {
              le.f();
            }
          }
        },
        {
          key: "requestCapabilityForRoomTimeline",
          value: function(G) {
            this.requestCapability("org.matrix.msc2762.timeline:".concat(G));
          }
        },
        {
          key: "requestCapabilityToSendState",
          value: function(G, le) {
            this.requestCapability(d.WidgetEventCapability.forStateEvent(d.EventDirection.Send, G, le).raw);
          }
        },
        {
          key: "requestCapabilityToReceiveState",
          value: function(G, le) {
            this.requestCapability(d.WidgetEventCapability.forStateEvent(d.EventDirection.Receive, G, le).raw);
          }
        },
        {
          key: "requestCapabilityToSendToDevice",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forToDeviceEvent(d.EventDirection.Send, G).raw);
          }
        },
        {
          key: "requestCapabilityToReceiveToDevice",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forToDeviceEvent(d.EventDirection.Receive, G).raw);
          }
        },
        {
          key: "requestCapabilityToSendEvent",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forRoomEvent(d.EventDirection.Send, G).raw);
          }
        },
        {
          key: "requestCapabilityToReceiveEvent",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forRoomEvent(d.EventDirection.Receive, G).raw);
          }
        },
        {
          key: "requestCapabilityToSendMessage",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forRoomMessageEvent(d.EventDirection.Send, G).raw);
          }
        },
        {
          key: "requestCapabilityToReceiveMessage",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forRoomMessageEvent(d.EventDirection.Receive, G).raw);
          }
        },
        {
          key: "requestCapabilityToReceiveRoomAccountData",
          value: function(G) {
            this.requestCapability(d.WidgetEventCapability.forRoomAccountData(d.EventDirection.Receive, G).raw);
          }
        },
        {
          key: "requestOpenIDConnectToken",
          value: function() {
            var G = this;
            return new Promise(function(le, te) {
              G.transport.sendComplete(a.WidgetApiFromWidgetAction.GetOpenIDCredentials, {}).then(function(re) {
                var he = re.response;
                if (he.state === s.OpenIDRequestState.Allowed) le(he);
                else if (he.state === s.OpenIDRequestState.Blocked) te(new Error("User declined to verify their identity"));
                else if (he.state === s.OpenIDRequestState.PendingUserConfirmation) {
                  var se = function ye(we) {
                    we.preventDefault();
                    var Ee = we.detail;
                    Ee.data.original_request_id === re.requestId && (Ee.data.state === s.OpenIDRequestState.Allowed ? (le(Ee.data), G.transport.reply(Ee, {})) : Ee.data.state === s.OpenIDRequestState.Blocked ? (te(new Error("User declined to verify their identity")), G.transport.reply(Ee, {})) : (te(new Error("Invalid state on reply: " + he.state)), G.transport.reply(Ee, {
                      error: {
                        message: "Invalid state"
                      }
                    })), G.off("action:".concat(a.WidgetApiToWidgetAction.OpenIDCredentials), ye));
                  };
                  G.on("action:".concat(a.WidgetApiToWidgetAction.OpenIDCredentials), se);
                } else te(new Error("Invalid state: " + he.state));
              }).catch(te);
            });
          }
        },
        {
          key: "updateRequestedCapabilities",
          value: function() {
            return this.transport.send(a.WidgetApiFromWidgetAction.MSC2974RenegotiateCapabilities, {
              capabilities: this.requestedCapabilities
            }).then();
          }
        },
        {
          key: "sendContentLoaded",
          value: function() {
            return this.transport.send(a.WidgetApiFromWidgetAction.ContentLoaded, {}).then();
          }
        },
        {
          key: "sendSticker",
          value: function(G) {
            return this.transport.send(a.WidgetApiFromWidgetAction.SendSticker, G).then();
          }
        },
        {
          key: "setAlwaysOnScreen",
          value: function(G) {
            return this.transport.send(a.WidgetApiFromWidgetAction.UpdateAlwaysOnScreen, {
              value: G
            }).then(function(le) {
              return le.success;
            });
          }
        },
        {
          key: "openModalWidget",
          value: function(G, le) {
            var te = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], re = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, he = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : l.MatrixWidgetType.Custom;
            return this.transport.send(a.WidgetApiFromWidgetAction.OpenModalWidget, {
              type: he,
              url: G,
              name: le,
              buttons: te,
              data: re
            }).then();
          }
        },
        {
          key: "closeModalWidget",
          value: function() {
            var G = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
            return this.transport.send(a.WidgetApiFromWidgetAction.CloseModalWidget, G).then();
          }
        },
        {
          key: "sendRoomEvent",
          value: function(G, le, te, re, he, se) {
            return this.sendEvent(G, void 0, le, te, re, he, se);
          }
        },
        {
          key: "sendStateEvent",
          value: function(G, le, te, re, he, se) {
            return this.sendEvent(G, le, te, re, he, se);
          }
        },
        {
          key: "sendEvent",
          value: function(G, le, te, re, he, se, ye) {
            return this.transport.send(a.WidgetApiFromWidgetAction.SendEvent, y(y(y(y(y({
              type: G,
              content: te
            }, le !== void 0 && {
              state_key: le
            }), re !== void 0 && {
              room_id: re
            }), he !== void 0 && {
              delay: he
            }), se !== void 0 && {
              parent_delay_id: se
            }), ye !== void 0 && {
              sticky_duration_ms: ye
            }));
          }
        },
        {
          key: "cancelScheduledDelayedEvent",
          value: function(G) {
            return this.transport.send(a.WidgetApiFromWidgetAction.MSC4157UpdateDelayedEvent, {
              delay_id: G,
              action: h.UpdateDelayedEventAction.Cancel
            });
          }
        },
        {
          key: "restartScheduledDelayedEvent",
          value: function(G) {
            return this.transport.send(a.WidgetApiFromWidgetAction.MSC4157UpdateDelayedEvent, {
              delay_id: G,
              action: h.UpdateDelayedEventAction.Restart
            });
          }
        },
        {
          key: "sendScheduledDelayedEvent",
          value: function(G) {
            return this.transport.send(a.WidgetApiFromWidgetAction.MSC4157UpdateDelayedEvent, {
              delay_id: G,
              action: h.UpdateDelayedEventAction.Send
            });
          }
        },
        {
          key: "sendToDevice",
          value: function(G, le, te) {
            return this.transport.send(a.WidgetApiFromWidgetAction.SendToDevice, {
              type: G,
              encrypted: le,
              messages: te
            });
          }
        },
        {
          key: "readRoomAccountData",
          value: function(G, le) {
            var te = {
              type: G
            };
            return le && (le.includes(u.Symbols.AnyRoom) ? te.room_ids = u.Symbols.AnyRoom : te.room_ids = le), this.transport.send(a.WidgetApiFromWidgetAction.BeeperReadRoomAccountData, te).then(function(re) {
              return re.events;
            });
          }
        },
        {
          key: "readRoomEvents",
          value: function(G, le, te, re, he) {
            var se = {
              type: G,
              msgtype: te
            };
            return le !== void 0 && (se.limit = le), re && (re.includes(u.Symbols.AnyRoom) ? se.room_ids = u.Symbols.AnyRoom : se.room_ids = re), he && (se.since = he), this.transport.send(a.WidgetApiFromWidgetAction.MSC2876ReadEvents, se).then(function(ye) {
              return ye.events;
            });
          }
        },
        {
          key: "readEventRelations",
          value: (function() {
            var K = m(f().mark(function le(te, re, he, se, ye, we, Ee, ke) {
              var Ne, lt;
              return f().wrap(function(We) {
                for (; ; ) switch (We.prev = We.next) {
                  case 0:
                    return We.next = 2, this.getClientVersions();
                  case 2:
                    if (Ne = We.sent, Ne.includes(r.UnstableApiVersion.MSC3869)) {
                      We.next = 5;
                      break;
                    }
                    throw new Error("The read_relations action is not supported by the client.");
                  case 5:
                    return lt = {
                      event_id: te,
                      rel_type: he,
                      event_type: se,
                      room_id: re,
                      to: Ee,
                      from: we,
                      limit: ye,
                      direction: ke
                    }, We.abrupt("return", this.transport.send(a.WidgetApiFromWidgetAction.MSC3869ReadRelations, lt));
                  case 7:
                  case "end":
                    return We.stop();
                }
              }, le, this);
            }));
            function G(le, te, re, he, se, ye, we, Ee) {
              return K.apply(this, arguments);
            }
            return G;
          })()
        },
        {
          key: "readStateEvents",
          value: function(G, le, te, re) {
            var he = {
              type: G,
              state_key: te === void 0 ? true : te
            };
            return le !== void 0 && (he.limit = le), re && (re.includes(u.Symbols.AnyRoom) ? he.room_ids = u.Symbols.AnyRoom : he.room_ids = re), this.transport.send(a.WidgetApiFromWidgetAction.MSC2876ReadEvents, he).then(function(se) {
              return se.events;
            });
          }
        },
        {
          key: "setModalButtonEnabled",
          value: function(G, le) {
            if (G === c.BuiltInModalButtonID.Close) throw new Error("The close button cannot be disabled");
            return this.transport.send(a.WidgetApiFromWidgetAction.SetModalButtonEnabled, {
              button: G,
              enabled: le
            }).then();
          }
        },
        {
          key: "navigateTo",
          value: function(G) {
            if (!G || !G.startsWith("https://matrix.to/#")) throw new Error("Invalid matrix.to URI");
            return this.transport.send(a.WidgetApiFromWidgetAction.MSC2931Navigate, {
              uri: G
            }).then();
          }
        },
        {
          key: "getTurnServers",
          value: function() {
            var G = this;
            return Y(f().mark(function le() {
              var te, re;
              return f().wrap(function(se) {
                for (; ; ) switch (se.prev = se.next) {
                  case 0:
                    if (re = (function() {
                      var ye = m(f().mark(function we(Ee) {
                        return f().wrap(function(Ne) {
                          for (; ; ) switch (Ne.prev = Ne.next) {
                            case 0:
                              Ee.preventDefault(), te(Ee.detail.data), G.transport.reply(Ee.detail, {});
                            case 3:
                            case "end":
                              return Ne.stop();
                          }
                        }, we);
                      }));
                      return function(Ee) {
                        return ye.apply(this, arguments);
                      };
                    })(), G.on("action:".concat(a.WidgetApiToWidgetAction.UpdateTurnServers), re), G.turnServerWatchers !== 0) {
                      se.next = 12;
                      break;
                    }
                    return se.prev = 3, se.next = 6, Z(G.transport.send(a.WidgetApiFromWidgetAction.WatchTurnServers, {}));
                  case 6:
                    se.next = 12;
                    break;
                  case 8:
                    throw se.prev = 8, se.t0 = se.catch(3), G.off("action:".concat(a.WidgetApiToWidgetAction.UpdateTurnServers), re), se.t0;
                  case 12:
                    G.turnServerWatchers++, se.prev = 13;
                  case 14:
                    return se.next = 17, Z(new Promise(function(ye) {
                      return te = ye;
                    }));
                  case 17:
                    return se.next = 19, se.sent;
                  case 19:
                    se.next = 14;
                    break;
                  case 21:
                    if (se.prev = 21, G.off("action:".concat(a.WidgetApiToWidgetAction.UpdateTurnServers), re), G.turnServerWatchers--, G.turnServerWatchers !== 0) {
                      se.next = 27;
                      break;
                    }
                    return se.next = 27, Z(G.transport.send(a.WidgetApiFromWidgetAction.UnwatchTurnServers, {}));
                  case 27:
                    return se.finish(21);
                  case 28:
                  case "end":
                    return se.stop();
                }
              }, le, null, [
                [
                  3,
                  8
                ],
                [
                  13,
                  ,
                  21,
                  28
                ]
              ]);
            }))();
          }
        },
        {
          key: "searchUserDirectory",
          value: (function() {
            var K = m(f().mark(function le(te, re) {
              var he, se;
              return f().wrap(function(we) {
                for (; ; ) switch (we.prev = we.next) {
                  case 0:
                    return we.next = 2, this.getClientVersions();
                  case 2:
                    if (he = we.sent, he.includes(r.UnstableApiVersion.MSC3973)) {
                      we.next = 5;
                      break;
                    }
                    throw new Error("The user_directory_search action is not supported by the client.");
                  case 5:
                    return se = {
                      search_term: te,
                      limit: re
                    }, we.abrupt("return", this.transport.send(a.WidgetApiFromWidgetAction.MSC3973UserDirectorySearch, se));
                  case 7:
                  case "end":
                    return we.stop();
                }
              }, le, this);
            }));
            function G(le, te) {
              return K.apply(this, arguments);
            }
            return G;
          })()
        },
        {
          key: "getMediaConfig",
          value: (function() {
            var K = m(f().mark(function le() {
              var te, re;
              return f().wrap(function(se) {
                for (; ; ) switch (se.prev = se.next) {
                  case 0:
                    return se.next = 2, this.getClientVersions();
                  case 2:
                    if (te = se.sent, te.includes(r.UnstableApiVersion.MSC4039)) {
                      se.next = 5;
                      break;
                    }
                    throw new Error("The get_media_config action is not supported by the client.");
                  case 5:
                    return re = {}, se.abrupt("return", this.transport.send(a.WidgetApiFromWidgetAction.MSC4039GetMediaConfigAction, re));
                  case 7:
                  case "end":
                    return se.stop();
                }
              }, le, this);
            }));
            function G() {
              return K.apply(this, arguments);
            }
            return G;
          })()
        },
        {
          key: "uploadFile",
          value: (function() {
            var K = m(f().mark(function le(te) {
              var re, he;
              return f().wrap(function(ye) {
                for (; ; ) switch (ye.prev = ye.next) {
                  case 0:
                    return ye.next = 2, this.getClientVersions();
                  case 2:
                    if (re = ye.sent, re.includes(r.UnstableApiVersion.MSC4039)) {
                      ye.next = 5;
                      break;
                    }
                    throw new Error("The upload_file action is not supported by the client.");
                  case 5:
                    return he = {
                      file: te
                    }, ye.abrupt("return", this.transport.send(a.WidgetApiFromWidgetAction.MSC4039UploadFileAction, he));
                  case 7:
                  case "end":
                    return ye.stop();
                }
              }, le, this);
            }));
            function G(le) {
              return K.apply(this, arguments);
            }
            return G;
          })()
        },
        {
          key: "downloadFile",
          value: (function() {
            var K = m(f().mark(function le(te) {
              var re, he;
              return f().wrap(function(ye) {
                for (; ; ) switch (ye.prev = ye.next) {
                  case 0:
                    return ye.next = 2, this.getClientVersions();
                  case 2:
                    if (re = ye.sent, re.includes(r.UnstableApiVersion.MSC4039)) {
                      ye.next = 5;
                      break;
                    }
                    throw new Error("The download_file action is not supported by the client.");
                  case 5:
                    return he = {
                      content_uri: te
                    }, ye.abrupt("return", this.transport.send(a.WidgetApiFromWidgetAction.MSC4039DownloadFileAction, he));
                  case 7:
                  case "end":
                    return ye.stop();
                }
              }, le, this);
            }));
            function G(le) {
              return K.apply(this, arguments);
            }
            return G;
          })()
        },
        {
          key: "start",
          value: function() {
            var G = this;
            this.transport.start(), this.getClientVersions().then(function(le) {
              le.includes(r.UnstableApiVersion.MSC2974) && (G.supportsMSC2974Renegotiate = true);
            });
          }
        },
        {
          key: "handleMessage",
          value: function(G) {
            var le = new CustomEvent("action:".concat(G.detail.action), {
              detail: G.detail,
              cancelable: true
            });
            if (this.emit("action:".concat(G.detail.action), le), !le.defaultPrevented) switch (G.detail.action) {
              case a.WidgetApiToWidgetAction.SupportedApiVersions:
                return this.replyVersions(G.detail);
              case a.WidgetApiToWidgetAction.Capabilities:
                return this.handleCapabilities(G.detail);
              case a.WidgetApiToWidgetAction.UpdateVisibility:
                return this.transport.reply(G.detail, {});
              case a.WidgetApiToWidgetAction.NotifyCapabilities:
                return this.transport.reply(G.detail, {});
              default:
                return this.transport.reply(G.detail, {
                  error: {
                    message: "Unknown or unsupported to-widget action: " + G.detail.action
                  }
                });
            }
          }
        },
        {
          key: "replyVersions",
          value: function(G) {
            this.transport.reply(G, {
              supported_versions: r.CurrentApiVersions
            });
          }
        },
        {
          key: "getClientVersions",
          value: function() {
            var G = this;
            return Array.isArray(this.cachedClientVersions) ? Promise.resolve(this.cachedClientVersions) : this.transport.send(a.WidgetApiFromWidgetAction.SupportedApiVersions, {}).then(function(le) {
              return G.cachedClientVersions = le.supported_versions, le.supported_versions;
            }).catch(function(le) {
              return console.warn("non-fatal error getting supported client versions: ", le), [];
            });
          }
        },
        {
          key: "handleCapabilities",
          value: function(G) {
            var le = this;
            return this.capabilitiesFinished ? this.transport.reply(G, {
              error: {
                message: "Capability negotiation already completed"
              }
            }) : this.getClientVersions().then(function(te) {
              return te.includes(r.UnstableApiVersion.MSC2871) ? le.once("action:".concat(a.WidgetApiToWidgetAction.NotifyCapabilities), function(re) {
                le.approvedCapabilities = re.detail.data.approved, le.emit("ready");
              }) : le.emit("ready"), le.capabilitiesFinished = true, le.transport.reply(G, {
                capabilities: le.requestedCapabilities
              });
            });
          }
        }
      ]), X;
    })(e.EventEmitter);
    return Sm.WidgetApi = de, Sm;
  }
  var b_ = {}, kl = {}, E$;
  function Sre() {
    if (E$) return kl;
    E$ = 1, Object.defineProperty(kl, "__esModule", {
      value: true
    }), kl.VideoConferenceCapabilities = kl.StickerpickerCapabilities = kl.MatrixCapabilities = void 0, kl.getTimelineRoomIDFromCapability = a, kl.isTimelineCapability = r, kl.isTimelineCapabilityFor = i;
    var t = (function(s) {
      return s.Screenshots = "m.capability.screenshot", s.StickerSending = "m.sticker", s.AlwaysOnScreen = "m.always_on_screen", s.RequiresClient = "io.element.requires_client", s.MSC2931Navigate = "org.matrix.msc2931.navigate", s.MSC3846TurnServers = "town.robin.msc3846.turn_servers", s.MSC3973UserDirectorySearch = "org.matrix.msc3973.user_directory_search", s.MSC4039UploadFile = "org.matrix.msc4039.upload_file", s.MSC4039DownloadFile = "org.matrix.msc4039.download_file", s.MSC4157SendDelayedEvent = "org.matrix.msc4157.send.delayed_event", s.MSC4157UpdateDelayedEvent = "org.matrix.msc4157.update_delayed_event", s.MSC4407SendStickyEvent = "org.matrix.msc4407.send.sticky_event", s.MSC4407ReceiveStickyEvent = "org.matrix.msc4407.receive.sticky_event", s;
    })({});
    kl.MatrixCapabilities = t;
    var e = [
      t.StickerSending
    ];
    kl.StickerpickerCapabilities = e;
    var n = [
      t.AlwaysOnScreen
    ];
    kl.VideoConferenceCapabilities = n;
    function r(s) {
      return s == null ? void 0 : s.startsWith("org.matrix.msc2762.timeline:");
    }
    function i(s, l) {
      return s === "org.matrix.msc2762.timeline:".concat(l);
    }
    function a(s) {
      return s.substring(s.indexOf(":") + 1);
    }
    return kl;
  }
  var x_ = {}, k$;
  function jre() {
    if (k$) return x_;
    k$ = 1, Object.defineProperty(x_, "__esModule", {
      value: true
    }), x_.SimpleObservable = void 0;
    function t(h) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
        return typeof f;
      } : function(f) {
        return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
      }, t(h);
    }
    function e(h, f) {
      var g = typeof Symbol < "u" && h[Symbol.iterator] || h["@@iterator"];
      if (!g) {
        if (Array.isArray(h) || (g = n(h)) || f) {
          g && (h = g);
          var m = 0, v = function() {
          };
          return {
            s: v,
            n: function() {
              return m >= h.length ? {
                done: true
              } : {
                done: false,
                value: h[m++]
              };
            },
            e: function(k) {
              throw k;
            },
            f: v
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var y = true, w = false, b;
      return {
        s: function() {
          g = g.call(h);
        },
        n: function() {
          var k = g.next();
          return y = k.done, k;
        },
        e: function(k) {
          w = true, b = k;
        },
        f: function() {
          try {
            !y && g.return != null && g.return();
          } finally {
            if (w) throw b;
          }
        }
      };
    }
    function n(h, f) {
      if (h) {
        if (typeof h == "string") return r(h, f);
        var g = Object.prototype.toString.call(h).slice(8, -1);
        if (g === "Object" && h.constructor && (g = h.constructor.name), g === "Map" || g === "Set") return Array.from(h);
        if (g === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)) return r(h, f);
      }
    }
    function r(h, f) {
      (f == null || f > h.length) && (f = h.length);
      for (var g = 0, m = new Array(f); g < f; g++) m[g] = h[g];
      return m;
    }
    function i(h, f) {
      if (!(h instanceof f)) throw new TypeError("Cannot call a class as a function");
    }
    function a(h, f) {
      for (var g = 0; g < f.length; g++) {
        var m = f[g];
        m.enumerable = m.enumerable || false, m.configurable = true, "value" in m && (m.writable = true), Object.defineProperty(h, c(m.key), m);
      }
    }
    function s(h, f, g) {
      return f && a(h.prototype, f), Object.defineProperty(h, "prototype", {
        writable: false
      }), h;
    }
    function l(h, f, g) {
      return f = c(f), f in h ? Object.defineProperty(h, f, {
        value: g,
        enumerable: true,
        configurable: true,
        writable: true
      }) : h[f] = g, h;
    }
    function c(h) {
      var f = d(h, "string");
      return t(f) === "symbol" ? f : String(f);
    }
    function d(h, f) {
      if (t(h) !== "object" || h === null) return h;
      var g = h[Symbol.toPrimitive];
      if (g !== void 0) {
        var m = g.call(h, f);
        if (t(m) !== "object") return m;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (f === "string" ? String : Number)(h);
    }
    var u = (function() {
      function h(f) {
        i(this, h), l(this, "listeners", []), f && this.listeners.push(f);
      }
      return s(h, [
        {
          key: "onUpdate",
          value: function(g) {
            this.listeners.push(g);
          }
        },
        {
          key: "update",
          value: function(g) {
            var m = e(this.listeners), v;
            try {
              for (m.s(); !(v = m.n()).done; ) {
                var y = v.value;
                y(g);
              }
            } catch (w) {
              m.e(w);
            } finally {
              m.f();
            }
          }
        },
        {
          key: "close",
          value: function() {
            this.listeners = [];
          }
        }
      ]), h;
    })();
    return x_.SimpleObservable = u, x_;
  }
  var S$;
  function FCe() {
    if (S$) return b_;
    S$ = 1, Object.defineProperty(b_, "__esModule", {
      value: true
    }), b_.ClientWidgetApi = void 0;
    var t = nk(), e = yB(), n = vB(), r = bB(), i = Sre(), a = _B(), s = wB(), l = xB(), c = jre(), d = DB(), u = CB();
    function h(ie) {
      "@babel/helpers - typeof";
      return h = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(de) {
        return typeof de;
      } : function(de) {
        return de && typeof Symbol == "function" && de.constructor === Symbol && de !== Symbol.prototype ? "symbol" : typeof de;
      }, h(ie);
    }
    function f(ie, de) {
      var ne = Object.keys(ie);
      if (Object.getOwnPropertySymbols) {
        var ae = Object.getOwnPropertySymbols(ie);
        de && (ae = ae.filter(function(X) {
          return Object.getOwnPropertyDescriptor(ie, X).enumerable;
        })), ne.push.apply(ne, ae);
      }
      return ne;
    }
    function g(ie) {
      for (var de = 1; de < arguments.length; de++) {
        var ne = arguments[de] != null ? arguments[de] : {};
        de % 2 ? f(Object(ne), true).forEach(function(ae) {
          H(ie, ae, ne[ae]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(ie, Object.getOwnPropertyDescriptors(ne)) : f(Object(ne)).forEach(function(ae) {
          Object.defineProperty(ie, ae, Object.getOwnPropertyDescriptor(ne, ae));
        });
      }
      return ie;
    }
    function m(ie, de) {
      var ne = typeof Symbol < "u" && ie[Symbol.iterator] || ie["@@iterator"];
      if (!ne) {
        if (Array.isArray(ie) || (ne = w(ie)) || de) {
          ne && (ie = ne);
          var ae = 0, X = function() {
          };
          return {
            s: X,
            n: function() {
              return ae >= ie.length ? {
                done: true
              } : {
                done: false,
                value: ie[ae++]
              };
            },
            e: function(re) {
              throw re;
            },
            f: X
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var K = true, G = false, le;
      return {
        s: function() {
          ne = ne.call(ie);
        },
        n: function() {
          var re = ne.next();
          return K = re.done, re;
        },
        e: function(re) {
          G = true, le = re;
        },
        f: function() {
          try {
            !K && ne.return != null && ne.return();
          } finally {
            if (G) throw le;
          }
        }
      };
    }
    function v(ie) {
      return j(ie) || b(ie) || w(ie) || y();
    }
    function y() {
      throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
    }
    function w(ie, de) {
      if (ie) {
        if (typeof ie == "string") return k(ie, de);
        var ne = Object.prototype.toString.call(ie).slice(8, -1);
        if (ne === "Object" && ie.constructor && (ne = ie.constructor.name), ne === "Map" || ne === "Set") return Array.from(ie);
        if (ne === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)) return k(ie, de);
      }
    }
    function b(ie) {
      if (typeof Symbol < "u" && ie[Symbol.iterator] != null || ie["@@iterator"] != null) return Array.from(ie);
    }
    function j(ie) {
      if (Array.isArray(ie)) return k(ie);
    }
    function k(ie, de) {
      (de == null || de > ie.length) && (de = ie.length);
      for (var ne = 0, ae = new Array(de); ne < de; ne++) ae[ne] = ie[ne];
      return ae;
    }
    function C() {
      C = function() {
        return ie;
      };
      var ie = {}, de = Object.prototype, ne = de.hasOwnProperty, ae = Object.defineProperty || function(st, Be, Re) {
        st[Be] = Re.value;
      }, X = typeof Symbol == "function" ? Symbol : {}, K = X.iterator || "@@iterator", G = X.asyncIterator || "@@asyncIterator", le = X.toStringTag || "@@toStringTag";
      function te(st, Be, Re) {
        return Object.defineProperty(st, Be, {
          value: Re,
          enumerable: true,
          configurable: true,
          writable: true
        }), st[Be];
      }
      try {
        te({}, "");
      } catch {
        te = function(Re, Ue, qe) {
          return Re[Ue] = qe;
        };
      }
      function re(st, Be, Re, Ue) {
        var qe = Be && Be.prototype instanceof ye ? Be : ye, tt = Object.create(qe.prototype), ht = new $t(Ue || []);
        return ae(tt, "_invoke", {
          value: Xt(st, Re, ht)
        }), tt;
      }
      function he(st, Be, Re) {
        try {
          return {
            type: "normal",
            arg: st.call(Be, Re)
          };
        } catch (Ue) {
          return {
            type: "throw",
            arg: Ue
          };
        }
      }
      ie.wrap = re;
      var se = {};
      function ye() {
      }
      function we() {
      }
      function Ee() {
      }
      var ke = {};
      te(ke, K, function() {
        return this;
      });
      var Ne = Object.getPrototypeOf, lt = Ne && Ne(Ne(Lt([])));
      lt && lt !== de && ne.call(lt, K) && (ke = lt);
      var Rt = Ee.prototype = ye.prototype = Object.create(ke);
      function We(st) {
        [
          "next",
          "throw",
          "return"
        ].forEach(function(Be) {
          te(st, Be, function(Re) {
            return this._invoke(Be, Re);
          });
        });
      }
      function yt(st, Be) {
        function Re(qe, tt, ht, $e) {
          var Tt = he(st[qe], st, tt);
          if (Tt.type !== "throw") {
            var zt = Tt.arg, Vt = zt.value;
            return Vt && h(Vt) == "object" && ne.call(Vt, "__await") ? Be.resolve(Vt.__await).then(function(bn) {
              Re("next", bn, ht, $e);
            }, function(bn) {
              Re("throw", bn, ht, $e);
            }) : Be.resolve(Vt).then(function(bn) {
              zt.value = bn, ht(zt);
            }, function(bn) {
              return Re("throw", bn, ht, $e);
            });
          }
          $e(Tt.arg);
        }
        var Ue;
        ae(this, "_invoke", {
          value: function(tt, ht) {
            function $e() {
              return new Be(function(Tt, zt) {
                Re(tt, ht, Tt, zt);
              });
            }
            return Ue = Ue ? Ue.then($e, $e) : $e();
          }
        });
      }
      function Xt(st, Be, Re) {
        var Ue = "suspendedStart";
        return function(qe, tt) {
          if (Ue === "executing") throw new Error("Generator is already running");
          if (Ue === "completed") {
            if (qe === "throw") throw tt;
            return wt();
          }
          for (Re.method = qe, Re.arg = tt; ; ) {
            var ht = Re.delegate;
            if (ht) {
              var $e = nn(ht, Re);
              if ($e) {
                if ($e === se) continue;
                return $e;
              }
            }
            if (Re.method === "next") Re.sent = Re._sent = Re.arg;
            else if (Re.method === "throw") {
              if (Ue === "suspendedStart") throw Ue = "completed", Re.arg;
              Re.dispatchException(Re.arg);
            } else Re.method === "return" && Re.abrupt("return", Re.arg);
            Ue = "executing";
            var Tt = he(st, Be, Re);
            if (Tt.type === "normal") {
              if (Ue = Re.done ? "completed" : "suspendedYield", Tt.arg === se) continue;
              return {
                value: Tt.arg,
                done: Re.done
              };
            }
            Tt.type === "throw" && (Ue = "completed", Re.method = "throw", Re.arg = Tt.arg);
          }
        };
      }
      function nn(st, Be) {
        var Re = Be.method, Ue = st.iterator[Re];
        if (Ue === void 0) return Be.delegate = null, Re === "throw" && st.iterator.return && (Be.method = "return", Be.arg = void 0, nn(st, Be), Be.method === "throw") || Re !== "return" && (Be.method = "throw", Be.arg = new TypeError("The iterator does not provide a '" + Re + "' method")), se;
        var qe = he(Ue, st.iterator, Be.arg);
        if (qe.type === "throw") return Be.method = "throw", Be.arg = qe.arg, Be.delegate = null, se;
        var tt = qe.arg;
        return tt ? tt.done ? (Be[st.resultName] = tt.value, Be.next = st.nextLoc, Be.method !== "return" && (Be.method = "next", Be.arg = void 0), Be.delegate = null, se) : tt : (Be.method = "throw", Be.arg = new TypeError("iterator result is not an object"), Be.delegate = null, se);
      }
      function bt(st) {
        var Be = {
          tryLoc: st[0]
        };
        1 in st && (Be.catchLoc = st[1]), 2 in st && (Be.finallyLoc = st[2], Be.afterLoc = st[3]), this.tryEntries.push(Be);
      }
      function At(st) {
        var Be = st.completion || {};
        Be.type = "normal", delete Be.arg, st.completion = Be;
      }
      function $t(st) {
        this.tryEntries = [
          {
            tryLoc: "root"
          }
        ], st.forEach(bt, this), this.reset(true);
      }
      function Lt(st) {
        if (st) {
          var Be = st[K];
          if (Be) return Be.call(st);
          if (typeof st.next == "function") return st;
          if (!isNaN(st.length)) {
            var Re = -1, Ue = function qe() {
              for (; ++Re < st.length; ) if (ne.call(st, Re)) return qe.value = st[Re], qe.done = false, qe;
              return qe.value = void 0, qe.done = true, qe;
            };
            return Ue.next = Ue;
          }
        }
        return {
          next: wt
        };
      }
      function wt() {
        return {
          value: void 0,
          done: true
        };
      }
      return we.prototype = Ee, ae(Rt, "constructor", {
        value: Ee,
        configurable: true
      }), ae(Ee, "constructor", {
        value: we,
        configurable: true
      }), we.displayName = te(Ee, le, "GeneratorFunction"), ie.isGeneratorFunction = function(st) {
        var Be = typeof st == "function" && st.constructor;
        return !!Be && (Be === we || (Be.displayName || Be.name) === "GeneratorFunction");
      }, ie.mark = function(st) {
        return Object.setPrototypeOf ? Object.setPrototypeOf(st, Ee) : (st.__proto__ = Ee, te(st, le, "GeneratorFunction")), st.prototype = Object.create(Rt), st;
      }, ie.awrap = function(st) {
        return {
          __await: st
        };
      }, We(yt.prototype), te(yt.prototype, G, function() {
        return this;
      }), ie.AsyncIterator = yt, ie.async = function(st, Be, Re, Ue, qe) {
        qe === void 0 && (qe = Promise);
        var tt = new yt(re(st, Be, Re, Ue), qe);
        return ie.isGeneratorFunction(Be) ? tt : tt.next().then(function(ht) {
          return ht.done ? ht.value : tt.next();
        });
      }, We(Rt), te(Rt, le, "Generator"), te(Rt, K, function() {
        return this;
      }), te(Rt, "toString", function() {
        return "[object Generator]";
      }), ie.keys = function(st) {
        var Be = Object(st), Re = [];
        for (var Ue in Be) Re.push(Ue);
        return Re.reverse(), function qe() {
          for (; Re.length; ) {
            var tt = Re.pop();
            if (tt in Be) return qe.value = tt, qe.done = false, qe;
          }
          return qe.done = true, qe;
        };
      }, ie.values = Lt, $t.prototype = {
        constructor: $t,
        reset: function(Be) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(At), !Be) for (var Re in this) Re.charAt(0) === "t" && ne.call(this, Re) && !isNaN(+Re.slice(1)) && (this[Re] = void 0);
        },
        stop: function() {
          this.done = true;
          var Be = this.tryEntries[0].completion;
          if (Be.type === "throw") throw Be.arg;
          return this.rval;
        },
        dispatchException: function(Be) {
          if (this.done) throw Be;
          var Re = this;
          function Ue(zt, Vt) {
            return ht.type = "throw", ht.arg = Be, Re.next = zt, Vt && (Re.method = "next", Re.arg = void 0), !!Vt;
          }
          for (var qe = this.tryEntries.length - 1; qe >= 0; --qe) {
            var tt = this.tryEntries[qe], ht = tt.completion;
            if (tt.tryLoc === "root") return Ue("end");
            if (tt.tryLoc <= this.prev) {
              var $e = ne.call(tt, "catchLoc"), Tt = ne.call(tt, "finallyLoc");
              if ($e && Tt) {
                if (this.prev < tt.catchLoc) return Ue(tt.catchLoc, true);
                if (this.prev < tt.finallyLoc) return Ue(tt.finallyLoc);
              } else if ($e) {
                if (this.prev < tt.catchLoc) return Ue(tt.catchLoc, true);
              } else {
                if (!Tt) throw new Error("try statement without catch or finally");
                if (this.prev < tt.finallyLoc) return Ue(tt.finallyLoc);
              }
            }
          }
        },
        abrupt: function(Be, Re) {
          for (var Ue = this.tryEntries.length - 1; Ue >= 0; --Ue) {
            var qe = this.tryEntries[Ue];
            if (qe.tryLoc <= this.prev && ne.call(qe, "finallyLoc") && this.prev < qe.finallyLoc) {
              var tt = qe;
              break;
            }
          }
          tt && (Be === "break" || Be === "continue") && tt.tryLoc <= Re && Re <= tt.finallyLoc && (tt = null);
          var ht = tt ? tt.completion : {};
          return ht.type = Be, ht.arg = Re, tt ? (this.method = "next", this.next = tt.finallyLoc, se) : this.complete(ht);
        },
        complete: function(Be, Re) {
          if (Be.type === "throw") throw Be.arg;
          return Be.type === "break" || Be.type === "continue" ? this.next = Be.arg : Be.type === "return" ? (this.rval = this.arg = Be.arg, this.method = "return", this.next = "end") : Be.type === "normal" && Re && (this.next = Re), se;
        },
        finish: function(Be) {
          for (var Re = this.tryEntries.length - 1; Re >= 0; --Re) {
            var Ue = this.tryEntries[Re];
            if (Ue.finallyLoc === Be) return this.complete(Ue.completion, Ue.afterLoc), At(Ue), se;
          }
        },
        catch: function(Be) {
          for (var Re = this.tryEntries.length - 1; Re >= 0; --Re) {
            var Ue = this.tryEntries[Re];
            if (Ue.tryLoc === Be) {
              var qe = Ue.completion;
              if (qe.type === "throw") {
                var tt = qe.arg;
                At(Ue);
              }
              return tt;
            }
          }
          throw new Error("illegal catch attempt");
        },
        delegateYield: function(Be, Re, Ue) {
          return this.delegate = {
            iterator: Lt(Be),
            resultName: Re,
            nextLoc: Ue
          }, this.method === "next" && (this.arg = void 0), se;
        }
      }, ie;
    }
    function x(ie, de, ne, ae, X, K, G) {
      try {
        var le = ie[K](G), te = le.value;
      } catch (re) {
        ne(re);
        return;
      }
      le.done ? de(te) : Promise.resolve(te).then(ae, X);
    }
    function S(ie) {
      return function() {
        var de = this, ne = arguments;
        return new Promise(function(ae, X) {
          var K = ie.apply(de, ne);
          function G(te) {
            x(K, ae, X, G, le, "next", te);
          }
          function le(te) {
            x(K, ae, X, G, le, "throw", te);
          }
          G(void 0);
        });
      };
    }
    function T(ie, de) {
      if (!(ie instanceof de)) throw new TypeError("Cannot call a class as a function");
    }
    function A(ie, de) {
      for (var ne = 0; ne < de.length; ne++) {
        var ae = de[ne];
        ae.enumerable = ae.enumerable || false, ae.configurable = true, "value" in ae && (ae.writable = true), Object.defineProperty(ie, V(ae.key), ae);
      }
    }
    function B(ie, de, ne) {
      return de && A(ie.prototype, de), Object.defineProperty(ie, "prototype", {
        writable: false
      }), ie;
    }
    function U(ie, de) {
      if (typeof de != "function" && de !== null) throw new TypeError("Super expression must either be null or a function");
      ie.prototype = Object.create(de && de.prototype, {
        constructor: {
          value: ie,
          writable: true,
          configurable: true
        }
      }), Object.defineProperty(ie, "prototype", {
        writable: false
      }), de && z(ie, de);
    }
    function z(ie, de) {
      return z = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(ae, X) {
        return ae.__proto__ = X, ae;
      }, z(ie, de);
    }
    function O(ie) {
      var de = N();
      return function() {
        var ae = L(ie), X;
        if (de) {
          var K = L(this).constructor;
          X = Reflect.construct(ae, arguments, K);
        } else X = ae.apply(this, arguments);
        return M(this, X);
      };
    }
    function M(ie, de) {
      if (de && (h(de) === "object" || typeof de == "function")) return de;
      if (de !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return I(ie);
    }
    function I(ie) {
      if (ie === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return ie;
    }
    function N() {
      if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false;
      if (typeof Proxy == "function") return true;
      try {
        return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        })), true;
      } catch {
        return false;
      }
    }
    function L(ie) {
      return L = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(ne) {
        return ne.__proto__ || Object.getPrototypeOf(ne);
      }, L(ie);
    }
    function H(ie, de, ne) {
      return de = V(de), de in ie ? Object.defineProperty(ie, de, {
        value: ne,
        enumerable: true,
        configurable: true,
        writable: true
      }) : ie[de] = ne, ie;
    }
    function V(ie) {
      var de = Z(ie, "string");
      return h(de) === "symbol" ? de : String(de);
    }
    function Z(ie, de) {
      if (h(ie) !== "object" || ie === null) return ie;
      var ne = ie[Symbol.toPrimitive];
      if (ne !== void 0) {
        var ae = ne.call(ie, de);
        if (h(ae) !== "object") return ae;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (de === "string" ? String : Number)(ie);
    }
    function Y(ie) {
      var de, ne, ae, X = 2;
      for (typeof Symbol < "u" && (ne = Symbol.asyncIterator, ae = Symbol.iterator); X--; ) {
        if (ne && (de = ie[ne]) != null) return de.call(ie);
        if (ae && (de = ie[ae]) != null) return new oe(de.call(ie));
        ne = "@@asyncIterator", ae = "@@iterator";
      }
      throw new TypeError("Object is not async iterable");
    }
    function oe(ie) {
      function de(ne) {
        if (Object(ne) !== ne) return Promise.reject(new TypeError(ne + " is not an object."));
        var ae = ne.done;
        return Promise.resolve(ne.value).then(function(X) {
          return {
            value: X,
            done: ae
          };
        });
      }
      return oe = function(ae) {
        this.s = ae, this.n = ae.next;
      }, oe.prototype = {
        s: null,
        n: null,
        next: function() {
          return de(this.n.apply(this.s, arguments));
        },
        return: function(ae) {
          var X = this.s.return;
          return X === void 0 ? Promise.resolve({
            value: ae,
            done: true
          }) : de(X.apply(this.s, arguments));
        },
        throw: function(ae) {
          var X = this.s.return;
          return X === void 0 ? Promise.reject(ae) : de(X.apply(this.s, arguments));
        }
      }, new oe(ie);
    }
    var ue = (function(ie) {
      U(ne, ie);
      var de = O(ne);
      function ne(ae, X, K) {
        var G;
        if (T(this, ne), G = de.call(this), G.widget = ae, G.driver = K, H(I(G), "transport", void 0), H(I(G), "cachedWidgetVersions", null), H(I(G), "contentLoadedActionSent", false), H(I(G), "allowedCapabilities", /* @__PURE__ */ new Set()), H(I(G), "allowedEvents", []), H(I(G), "isStopped", false), H(I(G), "turnServers", null), H(I(G), "contentLoadedWaitTimer", void 0), H(I(G), "pushRoomStateTasks", /* @__PURE__ */ new Set()), H(I(G), "pushRoomStateResult", /* @__PURE__ */ new Map()), H(I(G), "flushRoomStateTask", null), H(I(G), "viewedRoomId", null), !(X != null && X.contentWindow)) throw new Error("No iframe supplied");
        if (!ae) throw new Error("Invalid widget");
        if (!K) throw new Error("Invalid driver");
        return G.transport = new e.PostmessageTransport(n.WidgetApiDirection.ToWidget, ae.id, X.contentWindow, globalThis), G.transport.targetOrigin = ae.origin, G.transport.on("message", G.handleMessage.bind(I(G))), X.addEventListener("load", G.onIframeLoad.bind(I(G))), G.transport.start(), G;
      }
      return B(ne, [
        {
          key: "hasCapability",
          value: function(X) {
            return this.allowedCapabilities.has(X);
          }
        },
        {
          key: "canUseRoomTimeline",
          value: function(X) {
            return this.hasCapability("org.matrix.msc2762.timeline:".concat(d.Symbols.AnyRoom)) || this.hasCapability("org.matrix.msc2762.timeline:".concat(X));
          }
        },
        {
          key: "canSendRoomEvent",
          value: function(X) {
            var K = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
            return this.allowedEvents.some(function(G) {
              return G.matchesAsRoomEvent(s.EventDirection.Send, X, K);
            });
          }
        },
        {
          key: "canSendStateEvent",
          value: function(X, K) {
            return this.allowedEvents.some(function(G) {
              return G.matchesAsStateEvent(s.EventDirection.Send, X, K);
            });
          }
        },
        {
          key: "canSendToDeviceEvent",
          value: function(X) {
            return this.allowedEvents.some(function(K) {
              return K.matchesAsToDeviceEvent(s.EventDirection.Send, X);
            });
          }
        },
        {
          key: "canReceiveRoomEvent",
          value: function(X) {
            var K = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
            return this.allowedEvents.some(function(G) {
              return G.matchesAsRoomEvent(s.EventDirection.Receive, X, K);
            });
          }
        },
        {
          key: "canReceiveStateEvent",
          value: function(X, K) {
            return this.allowedEvents.some(function(G) {
              return G.matchesAsStateEvent(s.EventDirection.Receive, X, K);
            });
          }
        },
        {
          key: "canReceiveToDeviceEvent",
          value: function(X) {
            return this.allowedEvents.some(function(K) {
              return K.matchesAsToDeviceEvent(s.EventDirection.Receive, X);
            });
          }
        },
        {
          key: "canReceiveRoomAccountData",
          value: function(X) {
            return this.allowedEvents.some(function(K) {
              return K.matchesAsRoomAccountData(s.EventDirection.Receive, X);
            });
          }
        },
        {
          key: "stop",
          value: function() {
            this.isStopped = true, this.transport.stop();
          }
        },
        {
          key: "getWidgetVersions",
          value: (function() {
            var ae = S(C().mark(function K() {
              var G;
              return C().wrap(function(te) {
                for (; ; ) switch (te.prev = te.next) {
                  case 0:
                    if (!Array.isArray(this.cachedWidgetVersions)) {
                      te.next = 2;
                      break;
                    }
                    return te.abrupt("return", this.cachedWidgetVersions);
                  case 2:
                    return te.prev = 2, te.next = 5, this.transport.send(r.WidgetApiToWidgetAction.SupportedApiVersions, {});
                  case 5:
                    return G = te.sent, this.cachedWidgetVersions = G.supported_versions, te.abrupt("return", G.supported_versions);
                  case 10:
                    return te.prev = 10, te.t0 = te.catch(2), console.warn("non-fatal error getting supported widget versions: ", te.t0), te.abrupt("return", []);
                  case 14:
                  case "end":
                    return te.stop();
                }
              }, K, this, [
                [
                  2,
                  10
                ]
              ]);
            }));
            function X() {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "beginCapabilities",
          value: function() {
            var X = this;
            this.emit("preparing");
            var K;
            this.transport.send(r.WidgetApiToWidgetAction.Capabilities, {}).then(function(G) {
              return K = G.capabilities, X.driver.validateCapabilities(new Set(G.capabilities));
            }).then(function(G) {
              X.allowCapabilities(v(G), K), X.emit("ready");
            }).catch(function(G) {
              X.emit("error:preparing", G);
            });
          }
        },
        {
          key: "allowCapabilities",
          value: function(X, K) {
            var G, le = this;
            console.log("Widget ".concat(this.widget.id, " is allowed capabilities:"), X);
            var te = m(X), re;
            try {
              for (te.s(); !(re = te.n()).done; ) {
                var he = re.value;
                this.allowedCapabilities.add(he);
              }
            } catch (bt) {
              te.e(bt);
            } finally {
              te.f();
            }
            var se = s.WidgetEventCapability.findEventCapabilities(X);
            (G = this.allowedEvents).push.apply(G, v(se)), this.transport.send(r.WidgetApiToWidgetAction.NotifyCapabilities, {
              requested: K,
              approved: Array.from(this.allowedCapabilities)
            }).catch(function(bt) {
              console.warn("non-fatal error notifying widget of approved capabilities:", bt);
            }).then(function() {
              le.emit("capabilitiesNotified");
            });
            var ye = m(X), we;
            try {
              for (ye.s(); !(we = ye.n()).done; ) {
                var Ee = we.value;
                if ((0, i.isTimelineCapability)(Ee)) {
                  var ke = (0, i.getTimelineRoomIDFromCapability)(Ee);
                  if (ke === d.Symbols.AnyRoom) {
                    var Ne = m(this.driver.getKnownRooms()), lt;
                    try {
                      for (Ne.s(); !(lt = Ne.n()).done; ) {
                        var Rt = lt.value;
                        this.pushRoomState(Rt);
                      }
                    } catch (bt) {
                      Ne.e(bt);
                    } finally {
                      Ne.f();
                    }
                  } else this.pushRoomState(ke);
                }
              }
            } catch (bt) {
              ye.e(bt);
            } finally {
              ye.f();
            }
            if (X.includes(i.MatrixCapabilities.MSC4407ReceiveStickyEvent)) {
              console.debug("Widget ".concat(this.widget.id, " is allowed to receive sticky events, check current sticky state."));
              var We = X.filter(function(bt) {
                return (0, i.isTimelineCapability)(bt);
              }).map(function(bt) {
                return (0, i.getTimelineRoomIDFromCapability)(bt);
              }).flatMap(function(bt) {
                return bt === d.Symbols.AnyRoom ? le.driver.getKnownRooms() : bt;
              });
              console.debug("Widget ".concat(this.widget.id, " is allowed to receive sticky events in rooms:"), We);
              var yt = m(We), Xt;
              try {
                var nn = function() {
                  var At = Xt.value;
                  le.pushStickyState(At).catch(function($t) {
                    console.error("Failed to push sticky events to widget ".concat(le.widget.id, " for room ").concat(At, ":"), $t);
                  });
                };
                for (yt.s(); !(Xt = yt.n()).done; ) nn();
              } catch (bt) {
                yt.e(bt);
              } finally {
                yt.f();
              }
            }
            se.length > 0 && this.viewedRoomId !== null && !this.canUseRoomTimeline(this.viewedRoomId) && this.pushRoomState(this.viewedRoomId);
          }
        },
        {
          key: "onIframeLoad",
          value: function(X) {
            this.widget.waitForIframeLoad ? this.beginCapabilities() : (console.log("waitForIframeLoad is false: waiting for widget to send contentLoaded"), this.contentLoadedWaitTimer = setTimeout(function() {
              console.error("Widget specified waitForIframeLoad=false but timed out waiting for contentLoaded event!");
            }, 1e4), this.contentLoadedActionSent = false);
          }
        },
        {
          key: "handleContentLoadedAction",
          value: function(X) {
            if (this.contentLoadedWaitTimer !== void 0 && (clearTimeout(this.contentLoadedWaitTimer), this.contentLoadedWaitTimer = void 0), this.contentLoadedActionSent) throw new Error("Improper sequence: ContentLoaded Action can only be sent once after the widget loaded and should only be used if waitForIframeLoad is false (default=true)");
            this.widget.waitForIframeLoad ? this.transport.reply(X, {
              error: {
                message: "Improper sequence: not expecting ContentLoaded event if waitForIframeLoad is true (default=true)"
              }
            }) : (this.transport.reply(X, {}), this.beginCapabilities()), this.contentLoadedActionSent = true;
          }
        },
        {
          key: "replyVersions",
          value: function(X) {
            this.transport.reply(X, {
              supported_versions: a.CurrentApiVersions
            });
          }
        },
        {
          key: "supportsUpdateState",
          value: (function() {
            var ae = S(C().mark(function K() {
              return C().wrap(function(le) {
                for (; ; ) switch (le.prev = le.next) {
                  case 0:
                    return le.next = 2, this.getWidgetVersions();
                  case 2:
                    return le.abrupt("return", le.sent.includes(a.UnstableApiVersion.MSC2762_UPDATE_STATE));
                  case 3:
                  case "end":
                    return le.stop();
                }
              }, K, this);
            }));
            function X() {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleCapabilitiesRenegotiate",
          value: function(X) {
            var K, G = this;
            this.transport.reply(X, {});
            var le = ((K = X.data) === null || K === void 0 ? void 0 : K.capabilities) || [], te = new Set(le.filter(function(re) {
              return !G.hasCapability(re);
            }));
            te.size === 0 && this.allowCapabilities([], []), this.driver.validateCapabilities(te).then(function(re) {
              return G.allowCapabilities(v(re), v(te));
            });
          }
        },
        {
          key: "handleNavigate",
          value: function(X) {
            var K, G = this;
            if (!this.hasCapability(i.MatrixCapabilities.MSC2931Navigate)) return this.transport.reply(X, {
              error: {
                message: "Missing capability"
              }
            });
            if (!((K = X.data) !== null && K !== void 0 && K.uri.startsWith("https://matrix.to/#"))) return this.transport.reply(X, {
              error: {
                message: "Invalid matrix.to URI"
              }
            });
            var le = function(re) {
              console.error("[ClientWidgetApi] Failed to handle navigation: ", re), G.handleDriverError(re, X, "Error handling navigation");
            };
            try {
              this.driver.navigate(X.data.uri.toString()).catch(function(te) {
                return le(te);
              }).then(function() {
                return G.transport.reply(X, {});
              });
            } catch (te) {
              return le(te);
            }
          }
        },
        {
          key: "handleOIDC",
          value: function(X) {
            var K = this, G = 1, le = function(se, ye) {
              return ye = ye || {}, G > 1 ? K.transport.send(r.WidgetApiToWidgetAction.OpenIDCredentials, g({
                state: se,
                original_request_id: X.requestId
              }, ye)) : K.transport.reply(X, g({
                state: se
              }, ye));
            }, te = function(se) {
              return console.error("[ClientWidgetApi] Failed to handle OIDC: ", se), G > 1 ? le(l.OpenIDRequestState.Blocked) : K.transport.reply(X, {
                error: {
                  message: se
                }
              });
            }, re = new c.SimpleObservable(function(he) {
              if (he.state === l.OpenIDRequestState.PendingUserConfirmation && G > 1) return re.close(), te("client provided out-of-phase response to OIDC flow");
              if (he.state === l.OpenIDRequestState.PendingUserConfirmation) {
                le(he.state), G++;
                return;
              }
              return he.state === l.OpenIDRequestState.Allowed && !he.token ? te("client provided invalid OIDC token for an allowed request") : (he.state === l.OpenIDRequestState.Blocked && (he.token = void 0), re.close(), le(he.state, he.token));
            });
            this.driver.askOpenID(re);
          }
        },
        {
          key: "handleReadRoomAccountData",
          value: function(X) {
            var K = this, G = this.driver.readRoomAccountData(X.data.type);
            return this.canReceiveRoomAccountData(X.data.type) ? G.then(function(le) {
              K.transport.reply(X, {
                events: le
              });
            }) : this.transport.reply(X, {
              error: {
                message: "Cannot read room account data of this type"
              }
            });
          }
        },
        {
          key: "handleReadEvents",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le = this, te, re, he, se, ye, we, Ee, ke, Ne, lt;
              return C().wrap(function(We) {
                for (; ; ) switch (We.prev = We.next) {
                  case 0:
                    if (G.data.type) {
                      We.next = 2;
                      break;
                    }
                    return We.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Invalid request - missing event type"
                      }
                    }));
                  case 2:
                    if (!(G.data.limit !== void 0 && (!G.data.limit || G.data.limit < 0))) {
                      We.next = 4;
                      break;
                    }
                    return We.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Invalid request - limit out of range"
                      }
                    }));
                  case 4:
                    if (G.data.room_ids !== void 0) {
                      We.next = 8;
                      break;
                    }
                    te = this.viewedRoomId === null ? [] : [
                      this.viewedRoomId
                    ], We.next = 30;
                    break;
                  case 8:
                    if (G.data.room_ids !== d.Symbols.AnyRoom) {
                      We.next = 12;
                      break;
                    }
                    te = this.driver.getKnownRooms().filter(function(yt) {
                      return le.canUseRoomTimeline(yt);
                    }), We.next = 30;
                    break;
                  case 12:
                    te = G.data.room_ids, re = m(te), We.prev = 14, re.s();
                  case 16:
                    if ((he = re.n()).done) {
                      We.next = 22;
                      break;
                    }
                    if (se = he.value, this.canUseRoomTimeline(se)) {
                      We.next = 20;
                      break;
                    }
                    return We.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Unable to access room timeline: ".concat(se)
                      }
                    }));
                  case 20:
                    We.next = 16;
                    break;
                  case 22:
                    We.next = 27;
                    break;
                  case 24:
                    We.prev = 24, We.t0 = We.catch(14), re.e(We.t0);
                  case 27:
                    return We.prev = 27, re.f(), We.finish(27);
                  case 30:
                    if (ye = G.data.limit || 0, we = G.data.since, Ee = void 0, ke = void 0, G.data.state_key === void 0) {
                      We.next = 40;
                      break;
                    }
                    if (Ee = G.data.state_key === true ? void 0 : G.data.state_key.toString(), this.canReceiveStateEvent(G.data.type, (Ne = Ee) !== null && Ne !== void 0 ? Ne : null)) {
                      We.next = 38;
                      break;
                    }
                    return We.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Cannot read state events of this type"
                      }
                    }));
                  case 38:
                    We.next = 43;
                    break;
                  case 40:
                    if (ke = G.data.msgtype, this.canReceiveRoomEvent(G.data.type, ke)) {
                      We.next = 43;
                      break;
                    }
                    return We.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Cannot read room events of this type"
                      }
                    }));
                  case 43:
                    if (!(G.data.room_ids === void 0 && te.length === 0)) {
                      We.next = 50;
                      break;
                    }
                    return console.warn("The widgetDriver uses deprecated behaviour:\n It does not set the viewedRoomId using `setViewedRoomId`"), We.next = 47, G.data.state_key === void 0 ? this.driver.readRoomEvents(G.data.type, ke, ye, null, we) : this.driver.readStateEvents(G.data.type, Ee, ye, null);
                  case 47:
                    lt = We.sent, We.next = 68;
                    break;
                  case 50:
                    return We.next = 52, this.supportsUpdateState();
                  case 52:
                    if (!We.sent) {
                      We.next = 58;
                      break;
                    }
                    return We.next = 55, Promise.all(te.map(function(yt) {
                      return le.driver.readRoomTimeline(yt, G.data.type, ke, Ee, ye, we);
                    }));
                  case 55:
                    lt = We.sent.flat(1), We.next = 68;
                    break;
                  case 58:
                    if (G.data.state_key !== void 0) {
                      We.next = 64;
                      break;
                    }
                    return We.next = 61, Promise.all(te.map(function(yt) {
                      return le.driver.readRoomTimeline(yt, G.data.type, ke, Ee, ye, we);
                    }));
                  case 61:
                    We.t1 = We.sent, We.next = 67;
                    break;
                  case 64:
                    return We.next = 66, Promise.all(te.map(function(yt) {
                      return le.driver.readRoomState(yt, G.data.type, Ee);
                    }));
                  case 66:
                    We.t1 = We.sent;
                  case 67:
                    lt = We.t1.flat(1);
                  case 68:
                    this.transport.reply(G, {
                      events: lt
                    });
                  case 69:
                  case "end":
                    return We.stop();
                }
              }, K, this, [
                [
                  14,
                  24,
                  27,
                  30
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleSendEvent",
          value: function(X) {
            var K = this;
            if (!X.data.type) return this.transport.reply(X, {
              error: {
                message: "Invalid request - missing event type"
              }
            });
            if (X.data.room_id && !this.canUseRoomTimeline(X.data.room_id)) return this.transport.reply(X, {
              error: {
                message: "Unable to access room timeline: ".concat(X.data.room_id)
              }
            });
            var G = X.data.delay !== void 0 || X.data.parent_delay_id !== void 0;
            if (G && !this.hasCapability(i.MatrixCapabilities.MSC4157SendDelayedEvent)) return this.transport.reply(X, {
              error: {
                message: "Missing capability for ".concat(i.MatrixCapabilities.MSC4157SendDelayedEvent)
              }
            });
            var le = X.data.sticky_duration_ms !== void 0;
            if (le && !this.hasCapability(i.MatrixCapabilities.MSC4407SendStickyEvent)) return this.transport.reply(X, {
              error: {
                message: "Missing capability for ".concat(i.MatrixCapabilities.MSC4407SendStickyEvent)
              }
            });
            var te;
            if (X.data.state_key !== void 0) {
              if (!this.canSendStateEvent(X.data.type, X.data.state_key)) return this.transport.reply(X, {
                error: {
                  message: "Cannot send state events of this type"
                }
              });
              if (le) return this.transport.reply(X, {
                error: {
                  message: "Cannot send a state event with a sticky duration"
                }
              });
              if (G) {
                var re, he;
                te = this.driver.sendDelayedEvent((re = X.data.delay) !== null && re !== void 0 ? re : null, (he = X.data.parent_delay_id) !== null && he !== void 0 ? he : null, X.data.type, X.data.content || {}, X.data.state_key, X.data.room_id);
              } else te = this.driver.sendEvent(X.data.type, X.data.content || {}, X.data.state_key, X.data.room_id);
            } else {
              var se = X.data.content || {}, ye = se.msgtype;
              if (!this.canSendRoomEvent(X.data.type, ye)) return this.transport.reply(X, {
                error: {
                  message: "Cannot send room events of this type"
                }
              });
              var we = [
                X.data.type,
                se,
                null,
                X.data.room_id
              ];
              if (G && X.data.sticky_duration_ms) {
                var Ee, ke;
                te = this.driver.sendDelayedStickyEvent((Ee = X.data.delay) !== null && Ee !== void 0 ? Ee : null, (ke = X.data.parent_delay_id) !== null && ke !== void 0 ? ke : null, X.data.sticky_duration_ms, X.data.type, se, X.data.room_id);
              } else if (G) {
                var Ne, lt, Rt;
                te = (Ne = this.driver).sendDelayedEvent.apply(Ne, [
                  (lt = X.data.delay) !== null && lt !== void 0 ? lt : null,
                  (Rt = X.data.parent_delay_id) !== null && Rt !== void 0 ? Rt : null
                ].concat(we));
              } else if (X.data.sticky_duration_ms) te = this.driver.sendStickyEvent(X.data.sticky_duration_ms, X.data.type, se, X.data.room_id);
              else {
                var We;
                te = (We = this.driver).sendEvent.apply(We, we);
              }
            }
            te.then(function(yt) {
              return K.transport.reply(X, g({
                room_id: yt.roomId
              }, "eventId" in yt ? {
                event_id: yt.eventId
              } : {
                delay_id: yt.delayId
              }));
            }).catch(function(yt) {
              console.error("error sending event: ", yt), K.handleDriverError(yt, X, "Error sending event");
            });
          }
        },
        {
          key: "handleUpdateDelayedEvent",
          value: function(X) {
            var K = this;
            if (!X.data.delay_id) return this.transport.reply(X, {
              error: {
                message: "Invalid request - missing delay_id"
              }
            });
            if (!this.hasCapability(i.MatrixCapabilities.MSC4157UpdateDelayedEvent)) return this.transport.reply(X, {
              error: {
                message: "Missing capability"
              }
            });
            var G;
            switch (X.data.action) {
              case u.UpdateDelayedEventAction.Cancel:
                G = this.driver.cancelScheduledDelayedEvent;
                break;
              case u.UpdateDelayedEventAction.Restart:
                G = this.driver.restartScheduledDelayedEvent;
                break;
              case u.UpdateDelayedEventAction.Send:
                G = this.driver.sendScheduledDelayedEvent;
                break;
              default:
                return this.transport.reply(X, {
                  error: {
                    message: "Invalid request - unsupported action"
                  }
                });
            }
            G.call(this.driver, X.data.delay_id).then(function() {
              return K.transport.reply(X, {});
            }).catch(function(le) {
              console.error("error updating delayed event: ", le), K.handleDriverError(le, X, "Error updating delayed event");
            });
          }
        },
        {
          key: "handleSendToDevice",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              return C().wrap(function(te) {
                for (; ; ) switch (te.prev = te.next) {
                  case 0:
                    if (G.data.type) {
                      te.next = 4;
                      break;
                    }
                    this.transport.reply(G, {
                      error: {
                        message: "Invalid request - missing event type"
                      }
                    }), te.next = 26;
                    break;
                  case 4:
                    if (G.data.messages) {
                      te.next = 8;
                      break;
                    }
                    this.transport.reply(G, {
                      error: {
                        message: "Invalid request - missing event contents"
                      }
                    }), te.next = 26;
                    break;
                  case 8:
                    if (typeof G.data.encrypted == "boolean") {
                      te.next = 12;
                      break;
                    }
                    this.transport.reply(G, {
                      error: {
                        message: "Invalid request - missing encryption flag"
                      }
                    }), te.next = 26;
                    break;
                  case 12:
                    if (this.canSendToDeviceEvent(G.data.type)) {
                      te.next = 16;
                      break;
                    }
                    this.transport.reply(G, {
                      error: {
                        message: "Cannot send to-device events of this type"
                      }
                    }), te.next = 26;
                    break;
                  case 16:
                    return te.prev = 16, te.next = 19, this.driver.sendToDevice(G.data.type, G.data.encrypted, G.data.messages);
                  case 19:
                    this.transport.reply(G, {}), te.next = 26;
                    break;
                  case 22:
                    te.prev = 22, te.t0 = te.catch(16), console.error("error sending to-device event", te.t0), this.handleDriverError(te.t0, G, "Error sending event");
                  case 26:
                  case "end":
                    return te.stop();
                }
              }, K, this, [
                [
                  16,
                  22
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "pollTurnServers",
          value: (function() {
            var ae = S(C().mark(function K(G, le) {
              var te, re, he, se, ye, we;
              return C().wrap(function(ke) {
                for (; ; ) switch (ke.prev = ke.next) {
                  case 0:
                    return ke.prev = 0, ke.next = 3, this.transport.send(r.WidgetApiToWidgetAction.UpdateTurnServers, le);
                  case 3:
                    te = false, re = false, ke.prev = 5, se = Y(G);
                  case 7:
                    return ke.next = 9, se.next();
                  case 9:
                    if (!(te = !(ye = ke.sent).done)) {
                      ke.next = 16;
                      break;
                    }
                    return we = ye.value, ke.next = 13, this.transport.send(r.WidgetApiToWidgetAction.UpdateTurnServers, we);
                  case 13:
                    te = false, ke.next = 7;
                    break;
                  case 16:
                    ke.next = 22;
                    break;
                  case 18:
                    ke.prev = 18, ke.t0 = ke.catch(5), re = true, he = ke.t0;
                  case 22:
                    if (ke.prev = 22, ke.prev = 23, !(te && se.return != null)) {
                      ke.next = 27;
                      break;
                    }
                    return ke.next = 27, se.return();
                  case 27:
                    if (ke.prev = 27, !re) {
                      ke.next = 30;
                      break;
                    }
                    throw he;
                  case 30:
                    return ke.finish(27);
                  case 31:
                    return ke.finish(22);
                  case 32:
                    ke.next = 37;
                    break;
                  case 34:
                    ke.prev = 34, ke.t1 = ke.catch(0), console.error("error polling for TURN servers", ke.t1);
                  case 37:
                  case "end":
                    return ke.stop();
                }
              }, K, this, [
                [
                  0,
                  34
                ],
                [
                  5,
                  18,
                  22,
                  32
                ],
                [
                  23,
                  ,
                  27,
                  31
                ]
              ]);
            }));
            function X(K, G) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleWatchTurnServers",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le, te, re, he;
              return C().wrap(function(ye) {
                for (; ; ) switch (ye.prev = ye.next) {
                  case 0:
                    if (this.hasCapability(i.MatrixCapabilities.MSC3846TurnServers)) {
                      ye.next = 4;
                      break;
                    }
                    this.transport.reply(G, {
                      error: {
                        message: "Missing capability"
                      }
                    }), ye.next = 26;
                    break;
                  case 4:
                    if (!this.turnServers) {
                      ye.next = 8;
                      break;
                    }
                    this.transport.reply(G, {}), ye.next = 26;
                    break;
                  case 8:
                    return ye.prev = 8, le = this.driver.getTurnServers(), ye.next = 12, le.next();
                  case 12:
                    if (te = ye.sent, re = te.done, he = te.value, !re) {
                      ye.next = 17;
                      break;
                    }
                    throw new Error("Client refuses to provide any TURN servers");
                  case 17:
                    this.transport.reply(G, {}), this.pollTurnServers(le, he), this.turnServers = le, ye.next = 26;
                    break;
                  case 22:
                    ye.prev = 22, ye.t0 = ye.catch(8), console.error("error getting first TURN server results", ye.t0), this.transport.reply(G, {
                      error: {
                        message: "TURN servers not available"
                      }
                    });
                  case 26:
                  case "end":
                    return ye.stop();
                }
              }, K, this, [
                [
                  8,
                  22
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleUnwatchTurnServers",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              return C().wrap(function(te) {
                for (; ; ) switch (te.prev = te.next) {
                  case 0:
                    if (this.hasCapability(i.MatrixCapabilities.MSC3846TurnServers)) {
                      te.next = 4;
                      break;
                    }
                    this.transport.reply(G, {
                      error: {
                        message: "Missing capability"
                      }
                    }), te.next = 12;
                    break;
                  case 4:
                    if (this.turnServers) {
                      te.next = 8;
                      break;
                    }
                    this.transport.reply(G, {}), te.next = 12;
                    break;
                  case 8:
                    return te.next = 10, this.turnServers.return(void 0);
                  case 10:
                    this.turnServers = null, this.transport.reply(G, {});
                  case 12:
                  case "end":
                    return te.stop();
                }
              }, K, this);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleReadRelations",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le = this, te, re;
              return C().wrap(function(se) {
                for (; ; ) switch (se.prev = se.next) {
                  case 0:
                    if (G.data.event_id) {
                      se.next = 2;
                      break;
                    }
                    return se.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Invalid request - missing event ID"
                      }
                    }));
                  case 2:
                    if (!(G.data.limit !== void 0 && G.data.limit < 0)) {
                      se.next = 4;
                      break;
                    }
                    return se.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Invalid request - limit out of range"
                      }
                    }));
                  case 4:
                    if (!(G.data.room_id !== void 0 && !this.canUseRoomTimeline(G.data.room_id))) {
                      se.next = 6;
                      break;
                    }
                    return se.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Unable to access room timeline: ".concat(G.data.room_id)
                      }
                    }));
                  case 6:
                    return se.prev = 6, se.next = 9, this.driver.readEventRelations(G.data.event_id, G.data.room_id, G.data.rel_type, G.data.event_type, G.data.from, G.data.to, G.data.limit, G.data.direction);
                  case 9:
                    return te = se.sent, re = te.chunk.filter(function(ye) {
                      return ye.state_key !== void 0 ? le.canReceiveStateEvent(ye.type, ye.state_key) : le.canReceiveRoomEvent(ye.type, ye.content.msgtype);
                    }), se.abrupt("return", this.transport.reply(G, {
                      chunk: re,
                      prev_batch: te.prevBatch,
                      next_batch: te.nextBatch
                    }));
                  case 14:
                    se.prev = 14, se.t0 = se.catch(6), console.error("error getting the relations", se.t0), this.handleDriverError(se.t0, G, "Unexpected error while reading relations");
                  case 18:
                  case "end":
                    return se.stop();
                }
              }, K, this, [
                [
                  6,
                  14
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleUserDirectorySearch",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le;
              return C().wrap(function(re) {
                for (; ; ) switch (re.prev = re.next) {
                  case 0:
                    if (this.hasCapability(i.MatrixCapabilities.MSC3973UserDirectorySearch)) {
                      re.next = 2;
                      break;
                    }
                    return re.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Missing capability"
                      }
                    }));
                  case 2:
                    if (typeof G.data.search_term == "string") {
                      re.next = 4;
                      break;
                    }
                    return re.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Invalid request - missing search term"
                      }
                    }));
                  case 4:
                    if (!(G.data.limit !== void 0 && G.data.limit < 0)) {
                      re.next = 6;
                      break;
                    }
                    return re.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Invalid request - limit out of range"
                      }
                    }));
                  case 6:
                    return re.prev = 6, re.next = 9, this.driver.searchUserDirectory(G.data.search_term, G.data.limit);
                  case 9:
                    return le = re.sent, re.abrupt("return", this.transport.reply(G, {
                      limited: le.limited,
                      results: le.results.map(function(he) {
                        return {
                          user_id: he.userId,
                          display_name: he.displayName,
                          avatar_url: he.avatarUrl
                        };
                      })
                    }));
                  case 13:
                    re.prev = 13, re.t0 = re.catch(6), console.error("error searching in the user directory", re.t0), this.handleDriverError(re.t0, G, "Unexpected error while searching in the user directory");
                  case 17:
                  case "end":
                    return re.stop();
                }
              }, K, this, [
                [
                  6,
                  13
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleGetMediaConfig",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le;
              return C().wrap(function(re) {
                for (; ; ) switch (re.prev = re.next) {
                  case 0:
                    if (this.hasCapability(i.MatrixCapabilities.MSC4039UploadFile)) {
                      re.next = 2;
                      break;
                    }
                    return re.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Missing capability"
                      }
                    }));
                  case 2:
                    return re.prev = 2, re.next = 5, this.driver.getMediaConfig();
                  case 5:
                    return le = re.sent, re.abrupt("return", this.transport.reply(G, le));
                  case 9:
                    re.prev = 9, re.t0 = re.catch(2), console.error("error while getting the media configuration", re.t0), this.handleDriverError(re.t0, G, "Unexpected error while getting the media configuration");
                  case 13:
                  case "end":
                    return re.stop();
                }
              }, K, this, [
                [
                  2,
                  9
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleUploadFile",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le;
              return C().wrap(function(re) {
                for (; ; ) switch (re.prev = re.next) {
                  case 0:
                    if (this.hasCapability(i.MatrixCapabilities.MSC4039UploadFile)) {
                      re.next = 2;
                      break;
                    }
                    return re.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Missing capability"
                      }
                    }));
                  case 2:
                    return re.prev = 2, re.next = 5, this.driver.uploadFile(G.data.file);
                  case 5:
                    return le = re.sent, re.abrupt("return", this.transport.reply(G, {
                      content_uri: le.contentUri
                    }));
                  case 9:
                    re.prev = 9, re.t0 = re.catch(2), console.error("error while uploading a file", re.t0), this.handleDriverError(re.t0, G, "Unexpected error while uploading a file");
                  case 13:
                  case "end":
                    return re.stop();
                }
              }, K, this, [
                [
                  2,
                  9
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleDownloadFile",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le;
              return C().wrap(function(re) {
                for (; ; ) switch (re.prev = re.next) {
                  case 0:
                    if (this.hasCapability(i.MatrixCapabilities.MSC4039DownloadFile)) {
                      re.next = 2;
                      break;
                    }
                    return re.abrupt("return", this.transport.reply(G, {
                      error: {
                        message: "Missing capability"
                      }
                    }));
                  case 2:
                    return re.prev = 2, re.next = 5, this.driver.downloadFile(G.data.content_uri);
                  case 5:
                    return le = re.sent, re.abrupt("return", this.transport.reply(G, {
                      file: le.file
                    }));
                  case 9:
                    re.prev = 9, re.t0 = re.catch(2), console.error("error while downloading a file", re.t0), this.handleDriverError(re.t0, G, "Unexpected error while downloading a file");
                  case 13:
                  case "end":
                    return re.stop();
                }
              }, K, this, [
                [
                  2,
                  9
                ]
              ]);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "handleDriverError",
          value: function(X, K, G) {
            var le = this.driver.processError(X);
            this.transport.reply(K, {
              error: g({
                message: G
              }, le)
            });
          }
        },
        {
          key: "handleMessage",
          value: function(X) {
            if (!this.isStopped) {
              var K = new CustomEvent("action:".concat(X.detail.action), {
                detail: X.detail,
                cancelable: true
              });
              if (this.emit("action:".concat(X.detail.action), K), !K.defaultPrevented) switch (X.detail.action) {
                case r.WidgetApiFromWidgetAction.ContentLoaded:
                  return this.handleContentLoadedAction(X.detail);
                case r.WidgetApiFromWidgetAction.SupportedApiVersions:
                  return this.replyVersions(X.detail);
                case r.WidgetApiFromWidgetAction.SendEvent:
                  return this.handleSendEvent(X.detail);
                case r.WidgetApiFromWidgetAction.SendToDevice:
                  return this.handleSendToDevice(X.detail);
                case r.WidgetApiFromWidgetAction.GetOpenIDCredentials:
                  return this.handleOIDC(X.detail);
                case r.WidgetApiFromWidgetAction.MSC2931Navigate:
                  return this.handleNavigate(X.detail);
                case r.WidgetApiFromWidgetAction.MSC2974RenegotiateCapabilities:
                  return this.handleCapabilitiesRenegotiate(X.detail);
                case r.WidgetApiFromWidgetAction.MSC2876ReadEvents:
                  return this.handleReadEvents(X.detail);
                case r.WidgetApiFromWidgetAction.WatchTurnServers:
                  return this.handleWatchTurnServers(X.detail);
                case r.WidgetApiFromWidgetAction.UnwatchTurnServers:
                  return this.handleUnwatchTurnServers(X.detail);
                case r.WidgetApiFromWidgetAction.MSC3869ReadRelations:
                  return this.handleReadRelations(X.detail);
                case r.WidgetApiFromWidgetAction.MSC3973UserDirectorySearch:
                  return this.handleUserDirectorySearch(X.detail);
                case r.WidgetApiFromWidgetAction.BeeperReadRoomAccountData:
                  return this.handleReadRoomAccountData(X.detail);
                case r.WidgetApiFromWidgetAction.MSC4039GetMediaConfigAction:
                  return this.handleGetMediaConfig(X.detail);
                case r.WidgetApiFromWidgetAction.MSC4039UploadFileAction:
                  return this.handleUploadFile(X.detail);
                case r.WidgetApiFromWidgetAction.MSC4039DownloadFileAction:
                  return this.handleDownloadFile(X.detail);
                case r.WidgetApiFromWidgetAction.MSC4157UpdateDelayedEvent:
                  return this.handleUpdateDelayedEvent(X.detail);
                default:
                  return this.transport.reply(X.detail, {
                    error: {
                      message: "Unknown or unsupported from-widget action: " + X.detail.action
                    }
                  });
              }
            }
          }
        },
        {
          key: "updateTheme",
          value: function(X) {
            return this.transport.send(r.WidgetApiToWidgetAction.ThemeChange, X);
          }
        },
        {
          key: "updateLanguage",
          value: function(X) {
            return this.transport.send(r.WidgetApiToWidgetAction.LanguageChange, {
              lang: X
            });
          }
        },
        {
          key: "takeScreenshot",
          value: function() {
            return this.transport.send(r.WidgetApiToWidgetAction.TakeScreenshot, {});
          }
        },
        {
          key: "updateVisibility",
          value: function(X) {
            return this.transport.send(r.WidgetApiToWidgetAction.UpdateVisibility, {
              visible: X
            });
          }
        },
        {
          key: "sendWidgetConfig",
          value: function(X) {
            return this.transport.send(r.WidgetApiToWidgetAction.WidgetConfig, X).then();
          }
        },
        {
          key: "notifyModalWidgetButtonClicked",
          value: function(X) {
            return this.transport.send(r.WidgetApiToWidgetAction.ButtonClicked, {
              id: X
            }).then();
          }
        },
        {
          key: "notifyModalWidgetClose",
          value: function(X) {
            return this.transport.send(r.WidgetApiToWidgetAction.CloseModalWidget, X).then();
          }
        },
        {
          key: "feedEvent",
          value: (function() {
            var ae = S(C().mark(function K(G, le) {
              var te;
              return C().wrap(function(he) {
                for (; ; ) switch (he.prev = he.next) {
                  case 0:
                    if (le !== void 0 && this.setViewedRoomId(le), !(G.room_id !== this.viewedRoomId && !this.canUseRoomTimeline(G.room_id))) {
                      he.next = 3;
                      break;
                    }
                    return he.abrupt("return");
                  case 3:
                    if (!(G.state_key !== void 0 && G.state_key !== null)) {
                      he.next = 8;
                      break;
                    }
                    if (this.canReceiveStateEvent(G.type, G.state_key)) {
                      he.next = 6;
                      break;
                    }
                    return he.abrupt("return");
                  case 6:
                    he.next = 10;
                    break;
                  case 8:
                    if (this.canReceiveRoomEvent(G.type, (te = G.content) === null || te === void 0 ? void 0 : te.msgtype)) {
                      he.next = 10;
                      break;
                    }
                    return he.abrupt("return");
                  case 10:
                    return he.next = 12, this.transport.send(r.WidgetApiToWidgetAction.SendEvent, G);
                  case 12:
                  case "end":
                    return he.stop();
                }
              }, K, this);
            }));
            function X(K, G) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "feedToDevice",
          value: (function() {
            var ae = S(C().mark(function K(G, le) {
              return C().wrap(function(re) {
                for (; ; ) switch (re.prev = re.next) {
                  case 0:
                    if (!this.canReceiveToDeviceEvent(G.type)) {
                      re.next = 3;
                      break;
                    }
                    return re.next = 3, this.transport.send(r.WidgetApiToWidgetAction.SendToDevice, g(g({}, G), {}, {
                      encrypted: le
                    }));
                  case 3:
                  case "end":
                    return re.stop();
                }
              }, K, this);
            }));
            function X(K, G) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "setViewedRoomId",
          value: function(X) {
            this.viewedRoomId = X, X !== null && !this.canUseRoomTimeline(X) && this.pushRoomState(X);
          }
        },
        {
          key: "flushRoomState",
          value: (function() {
            var ae = S(C().mark(function K() {
              var G, le, te, re, he, se, ye;
              return C().wrap(function(Ee) {
                for (; ; ) switch (Ee.prev = Ee.next) {
                  case 0:
                    Ee.prev = 0;
                  case 1:
                    return Ee.next = 3, Promise.all(this.pushRoomStateTasks);
                  case 3:
                    if (this.pushRoomStateTasks.size > 0) {
                      Ee.next = 1;
                      break;
                    }
                  case 4:
                    G = [], le = m(this.pushRoomStateResult.values());
                    try {
                      for (le.s(); !(te = le.n()).done; ) {
                        re = te.value, he = m(re.values());
                        try {
                          for (he.s(); !(se = he.n()).done; ) ye = se.value, G.push.apply(G, v(ye.values()));
                        } catch (ke) {
                          he.e(ke);
                        } finally {
                          he.f();
                        }
                      }
                    } catch (ke) {
                      le.e(ke);
                    } finally {
                      le.f();
                    }
                    return Ee.next = 9, this.getWidgetVersions();
                  case 9:
                    if (!Ee.sent.includes(a.UnstableApiVersion.MSC2762_UPDATE_STATE)) {
                      Ee.next = 12;
                      break;
                    }
                    return Ee.next = 12, this.transport.send(r.WidgetApiToWidgetAction.UpdateState, {
                      state: G
                    });
                  case 12:
                    return Ee.prev = 12, this.flushRoomStateTask = null, Ee.finish(12);
                  case 15:
                  case "end":
                    return Ee.stop();
                }
              }, K, this, [
                [
                  0,
                  ,
                  12,
                  15
                ]
              ]);
            }));
            function X() {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "pushStickyState",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le = this;
              return C().wrap(function(re) {
                for (; ; ) switch (re.prev = re.next) {
                  case 0:
                    return console.debug("Pushing sticky state to widget for room", G), re.abrupt("return", this.driver.readStickyEvents(G).then(function(he) {
                      var se = he.filter(function(ye) {
                        var we;
                        return le.canReceiveRoomEvent(ye.type, typeof ((we = ye.content) === null || we === void 0 ? void 0 : we.msgtype) == "string" ? ye.content.msgtype : null);
                      });
                      return {
                        roomId: G,
                        stickyEvents: se
                      };
                    }).then((function() {
                      var he = S(C().mark(function se(ye) {
                        var we, Ee, ke;
                        return C().wrap(function(lt) {
                          for (; ; ) switch (lt.prev = lt.next) {
                            case 0:
                              return we = ye.roomId, Ee = ye.stickyEvents, console.debug("Pushing", Ee.length, "sticky events to widget for room", we), ke = Ee.map(function(Rt) {
                                return le.transport.send(r.WidgetApiToWidgetAction.SendEvent, Rt);
                              }), lt.next = 5, Promise.all(ke);
                            case 5:
                            case "end":
                              return lt.stop();
                          }
                        }, se);
                      }));
                      return function(se) {
                        return he.apply(this, arguments);
                      };
                    })()));
                  case 2:
                  case "end":
                    return re.stop();
                }
              }, K, this);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        },
        {
          key: "pushRoomState",
          value: function(X) {
            var K = this, G = m(this.allowedEvents), le;
            try {
              var te = function() {
                var he = le.value;
                if (he.kind === s.EventKind.State && he.direction === s.EventDirection.Receive) {
                  var se, ye, we = K.driver.readRoomState(X, he.eventType, (se = he.keyStr) !== null && se !== void 0 ? se : void 0), Ee = we.then(function(ke) {
                    var Ne = m(ke), lt;
                    try {
                      for (Ne.s(); !(lt = Ne.n()).done; ) {
                        var Rt = lt.value, We = K.pushRoomStateResult.get(X);
                        We === void 0 && (We = /* @__PURE__ */ new Map(), K.pushRoomStateResult.set(X, We));
                        var yt = We.get(he.eventType);
                        yt === void 0 && (yt = /* @__PURE__ */ new Map(), We.set(he.eventType, yt)), yt.has(Rt.state_key) || yt.set(Rt.state_key, Rt);
                      }
                    } catch (Xt) {
                      Ne.e(Xt);
                    } finally {
                      Ne.f();
                    }
                  }, function(ke) {
                    return console.error("Failed to read room state for ".concat(X, " (").concat(he.eventType, ", ").concat(he.keyStr, ")"), ke);
                  }).then(function() {
                    K.pushRoomStateTasks.delete(Ee);
                  });
                  K.pushRoomStateTasks.add(Ee), (ye = K.flushRoomStateTask) !== null && ye !== void 0 || (K.flushRoomStateTask = K.flushRoomState()), K.flushRoomStateTask.catch(function(ke) {
                    return console.error("Failed to push room state", ke);
                  });
                }
              };
              for (G.s(); !(le = G.n()).done; ) te();
            } catch (re) {
              G.e(re);
            } finally {
              G.f();
            }
          }
        },
        {
          key: "feedStateUpdate",
          value: (function() {
            var ae = S(C().mark(function K(G) {
              var le, te;
              return C().wrap(function(he) {
                for (; ; ) switch (he.prev = he.next) {
                  case 0:
                    if (G.state_key !== void 0) {
                      he.next = 2;
                      break;
                    }
                    throw new Error("Not a state event");
                  case 2:
                    if (!((G.room_id === this.viewedRoomId || this.canUseRoomTimeline(G.room_id)) && this.canReceiveStateEvent(G.type, G.state_key))) {
                      he.next = 21;
                      break;
                    }
                    if (this.pushRoomStateTasks.size !== 0) {
                      he.next = 11;
                      break;
                    }
                    return he.next = 6, this.getWidgetVersions();
                  case 6:
                    if (!he.sent.includes(a.UnstableApiVersion.MSC2762_UPDATE_STATE)) {
                      he.next = 9;
                      break;
                    }
                    return he.next = 9, this.transport.send(r.WidgetApiToWidgetAction.UpdateState, {
                      state: [
                        G
                      ]
                    });
                  case 9:
                    he.next = 21;
                    break;
                  case 11:
                    le = this.pushRoomStateResult.get(G.room_id), le === void 0 && (le = /* @__PURE__ */ new Map(), this.pushRoomStateResult.set(G.room_id, le)), te = le.get(G.type), te === void 0 && (te = /* @__PURE__ */ new Map(), le.set(G.type, te)), te.has(G.type) || te.set(G.state_key, G);
                  case 16:
                    return he.next = 18, Promise.all(this.pushRoomStateTasks);
                  case 18:
                    if (this.pushRoomStateTasks.size > 0) {
                      he.next = 16;
                      break;
                    }
                  case 19:
                    return he.next = 21, this.flushRoomStateTask;
                  case 21:
                  case "end":
                    return he.stop();
                }
              }, K, this);
            }));
            function X(K) {
              return ae.apply(this, arguments);
            }
            return X;
          })()
        }
      ]), ne;
    })(t.EventEmitter);
    return b_.ClientWidgetApi = ue, b_;
  }
  var iw = {}, j$;
  function vCe() {
    if (j$) return iw;
    j$ = 1, Object.defineProperty(iw, "__esModule", {
      value: true
    }), iw.isErrorResponse = e;
    function t(n) {
      "@babel/helpers - typeof";
      return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
        return typeof r;
      } : function(r) {
        return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
      }, t(n);
    }
    function e(n) {
      var r = n.error;
      return t(r) === "object" && r !== null && "message" in r && typeof r.message == "string";
    }
    return iw;
  }
  var w_ = {}, T$;
  function _Ce() {
    if (T$) return w_;
    T$ = 1, Object.defineProperty(w_, "__esModule", {
      value: true
    }), w_.WidgetKind = void 0;
    var t = (function(e) {
      return e.Room = "room", e.Account = "account", e.Modal = "modal", e;
    })({});
    return w_.WidgetKind = t, w_;
  }
  var D_ = {}, R$;
  function yCe() {
    if (R$) return D_;
    R$ = 1, Object.defineProperty(D_, "__esModule", {
      value: true
    }), D_.ModalButtonKind = void 0;
    var t = (function(e) {
      return e.Primary = "m.primary", e.Secondary = "m.secondary", e.Warning = "m.warning", e.Danger = "m.danger", e.Link = "m.link", e;
    })({});
    return D_.ModalButtonKind = t, D_;
  }
  var ow = {}, A$;
  function Tre() {
    if (A$) return ow;
    A$ = 1, Object.defineProperty(ow, "__esModule", {
      value: true
    }), ow.isValidUrl = t;
    function t(e) {
      if (!e) return false;
      try {
        var n = new URL(e);
        return !(n.protocol !== "http" && n.protocol !== "https");
      } catch (r) {
        if (r instanceof TypeError) return false;
        throw r;
      }
    }
    return ow;
  }
  var aw = {}, I$;
  function Rre() {
    if (I$) return aw;
    I$ = 1, Object.defineProperty(aw, "__esModule", {
      value: true
    }), aw.assertPresent = t;
    function t(e, n) {
      if (!e[n]) throw new Error("".concat(String(n), " is required"));
    }
    return aw;
  }
  var C_ = {}, B$;
  function Are() {
    if (B$) return C_;
    B$ = 1, Object.defineProperty(C_, "__esModule", {
      value: true
    }), C_.Widget = void 0;
    var t = Fk(), e = Rre();
    function n(d) {
      "@babel/helpers - typeof";
      return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) {
        return typeof u;
      } : function(u) {
        return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
      }, n(d);
    }
    function r(d, u) {
      if (!(d instanceof u)) throw new TypeError("Cannot call a class as a function");
    }
    function i(d, u) {
      for (var h = 0; h < u.length; h++) {
        var f = u[h];
        f.enumerable = f.enumerable || false, f.configurable = true, "value" in f && (f.writable = true), Object.defineProperty(d, s(f.key), f);
      }
    }
    function a(d, u, h) {
      return u && i(d.prototype, u), Object.defineProperty(d, "prototype", {
        writable: false
      }), d;
    }
    function s(d) {
      var u = l(d, "string");
      return n(u) === "symbol" ? u : String(u);
    }
    function l(d, u) {
      if (n(d) !== "object" || d === null) return d;
      var h = d[Symbol.toPrimitive];
      if (h !== void 0) {
        var f = h.call(d, u);
        if (n(f) !== "object") return f;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return String(d);
    }
    var c = (function() {
      function d(u) {
        if (r(this, d), this.definition = u, !this.definition) throw new Error("Definition is required");
        (0, e.assertPresent)(u, "id"), (0, e.assertPresent)(u, "creatorUserId"), (0, e.assertPresent)(u, "type"), (0, e.assertPresent)(u, "url");
      }
      return a(d, [
        {
          key: "creatorUserId",
          get: function() {
            return this.definition.creatorUserId;
          }
        },
        {
          key: "type",
          get: function() {
            return this.definition.type;
          }
        },
        {
          key: "id",
          get: function() {
            return this.definition.id;
          }
        },
        {
          key: "name",
          get: function() {
            return this.definition.name || null;
          }
        },
        {
          key: "title",
          get: function() {
            return this.rawData.title || null;
          }
        },
        {
          key: "templateUrl",
          get: function() {
            return this.definition.url;
          }
        },
        {
          key: "origin",
          get: function() {
            return new URL(this.templateUrl).origin;
          }
        },
        {
          key: "waitForIframeLoad",
          get: function() {
            return this.definition.waitForIframeLoad === false ? false : (this.definition.waitForIframeLoad === true, true);
          }
        },
        {
          key: "rawData",
          get: function() {
            return this.definition.data || {};
          }
        },
        {
          key: "getCompleteUrl",
          value: function(h) {
            return (0, t.runTemplate)(this.templateUrl, this.definition, h);
          }
        }
      ]), d;
    })();
    return C_.Widget = c, C_;
  }
  var E_ = {}, P$;
  function bCe() {
    if (P$) return E_;
    P$ = 1, Object.defineProperty(E_, "__esModule", {
      value: true
    }), E_.WidgetParser = void 0;
    var t = Are(), e = Tre();
    function n(f) {
      "@babel/helpers - typeof";
      return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(g) {
        return typeof g;
      } : function(g) {
        return g && typeof Symbol == "function" && g.constructor === Symbol && g !== Symbol.prototype ? "symbol" : typeof g;
      }, n(f);
    }
    function r(f, g) {
      var m = typeof Symbol < "u" && f[Symbol.iterator] || f["@@iterator"];
      if (!m) {
        if (Array.isArray(f) || (m = i(f)) || g) {
          m && (f = m);
          var v = 0, y = function() {
          };
          return {
            s: y,
            n: function() {
              return v >= f.length ? {
                done: true
              } : {
                done: false,
                value: f[v++]
              };
            },
            e: function(C) {
              throw C;
            },
            f: y
          };
        }
        throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
      }
      var w = true, b = false, j;
      return {
        s: function() {
          m = m.call(f);
        },
        n: function() {
          var C = m.next();
          return w = C.done, C;
        },
        e: function(C) {
          b = true, j = C;
        },
        f: function() {
          try {
            !w && m.return != null && m.return();
          } finally {
            if (b) throw j;
          }
        }
      };
    }
    function i(f, g) {
      if (f) {
        if (typeof f == "string") return a(f, g);
        var m = Object.prototype.toString.call(f).slice(8, -1);
        if (m === "Object" && f.constructor && (m = f.constructor.name), m === "Map" || m === "Set") return Array.from(f);
        if (m === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)) return a(f, g);
      }
    }
    function a(f, g) {
      (g == null || g > f.length) && (g = f.length);
      for (var m = 0, v = new Array(g); m < g; m++) v[m] = f[m];
      return v;
    }
    function s(f, g) {
      if (!(f instanceof g)) throw new TypeError("Cannot call a class as a function");
    }
    function l(f, g) {
      for (var m = 0; m < g.length; m++) {
        var v = g[m];
        v.enumerable = v.enumerable || false, v.configurable = true, "value" in v && (v.writable = true), Object.defineProperty(f, d(v.key), v);
      }
    }
    function c(f, g, m) {
      return m && l(f, m), Object.defineProperty(f, "prototype", {
        writable: false
      }), f;
    }
    function d(f) {
      var g = u(f, "string");
      return n(g) === "symbol" ? g : String(g);
    }
    function u(f, g) {
      if (n(f) !== "object" || f === null) return f;
      var m = f[Symbol.toPrimitive];
      if (m !== void 0) {
        var v = m.call(f, g);
        if (n(v) !== "object") return v;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return String(f);
    }
    var h = (function() {
      function f() {
        s(this, f);
      }
      return c(f, null, [
        {
          key: "parseAccountData",
          value: function(m) {
            if (!m) return [];
            for (var v = [], y = 0, w = Object.keys(m); y < w.length; y++) {
              var b = w[y], j = m[b];
              if (j && !(j.type !== "m.widget" && j.type !== "im.vector.modular.widgets") && j.sender) {
                var k = j.state_key || j.id;
                if (k === b) {
                  var C = {
                    content: j.content,
                    sender: j.sender,
                    type: "m.widget",
                    state_key: b,
                    event_id: "$example",
                    room_id: "!example",
                    origin_server_ts: 1
                  }, x = f.parseRoomWidget(C);
                  x && v.push(x);
                }
              }
            }
            return v;
          }
        },
        {
          key: "parseWidgetsFromRoomState",
          value: function(m) {
            if (!m) return [];
            var v = [], y = r(m), w;
            try {
              for (y.s(); !(w = y.n()).done; ) {
                var b = w.value, j = f.parseRoomWidget(b);
                j && v.push(j);
              }
            } catch (k) {
              y.e(k);
            } finally {
              y.f();
            }
            return v;
          }
        },
        {
          key: "parseRoomWidget",
          value: function(m) {
            if (!m || m.type !== "m.widget" && m.type !== "im.vector.modular.widgets") return null;
            var v = m.content || {}, y = {
              id: m.state_key,
              creatorUserId: v.creatorUserId || m.sender,
              name: v.name,
              type: v.type,
              url: v.url,
              waitForIframeLoad: v.waitForIframeLoad,
              data: v.data
            };
            return f.processEstimatedWidget(y);
          }
        },
        {
          key: "processEstimatedWidget",
          value: function(m) {
            return !m.id || !m.creatorUserId || !m.type || !(0, e.isValidUrl)(m.url) ? null : new t.Widget(m);
          }
        }
      ]), f;
    })();
    return E_.WidgetParser = h, E_;
  }
  var k_ = {}, M$;
  function xCe() {
    if (M$) return k_;
    M$ = 1, Object.defineProperty(k_, "__esModule", {
      value: true
    }), k_.runTemplate = t, k_.toString = e;
    function t(n, r, i) {
      for (var a = Object.assign({}, r.data, {
        matrix_room_id: i.widgetRoomId || "",
        matrix_user_id: i.currentUserId,
        matrix_display_name: i.userDisplayName || i.currentUserId,
        matrix_avatar_url: i.userHttpAvatarUrl || "",
        matrix_widget_id: r.id,
        "org.matrix.msc2873.client_id": i.clientId || "",
        "org.matrix.msc2873.client_theme": i.clientTheme || "",
        "org.matrix.msc2873.client_language": i.clientLanguage || "",
        "org.matrix.msc3819.matrix_device_id": i.deviceId || "",
        "org.matrix.msc4039.matrix_base_url": i.baseUrl || ""
      }), s = n, l = 0, c = Object.keys(a); l < c.length; l++) {
        var d = c[l], u = "$".concat(d).replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), h = new RegExp(u, "g");
        s = s.replace(h, encodeURIComponent(e(a[d])));
      }
      return s;
    }
    function e(n) {
      return n == null ? "".concat(n) : String(n);
    }
    return k_;
  }
  var S_ = {}, O$;
  function wCe() {
    if (O$) return S_;
    O$ = 1, Object.defineProperty(S_, "__esModule", {
      value: true
    }), S_.WidgetDriver = void 0;
    var t = Fk();
    function e(c) {
      "@babel/helpers - typeof";
      return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(d) {
        return typeof d;
      } : function(d) {
        return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d;
      }, e(c);
    }
    function n(c, d) {
      if (!(c instanceof d)) throw new TypeError("Cannot call a class as a function");
    }
    function r(c, d) {
      for (var u = 0; u < d.length; u++) {
        var h = d[u];
        h.enumerable = h.enumerable || false, h.configurable = true, "value" in h && (h.writable = true), Object.defineProperty(c, a(h.key), h);
      }
    }
    function i(c, d, u) {
      return d && r(c.prototype, d), Object.defineProperty(c, "prototype", {
        writable: false
      }), c;
    }
    function a(c) {
      var d = s(c, "string");
      return e(d) === "symbol" ? d : String(d);
    }
    function s(c, d) {
      if (e(c) !== "object" || c === null) return c;
      var u = c[Symbol.toPrimitive];
      if (u !== void 0) {
        var h = u.call(c, d);
        if (e(h) !== "object") return h;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return String(c);
    }
    var l = (function() {
      function c() {
        n(this, c);
      }
      return i(c, [
        {
          key: "validateCapabilities",
          value: function(u) {
            return Promise.resolve(/* @__PURE__ */ new Set());
          }
        },
        {
          key: "sendEvent",
          value: function(u, h) {
            return Promise.reject(new Error("Failed to override function"));
          }
        },
        {
          key: "sendStickyEvent",
          value: function(u, h, f) {
            throw new Error("Method not implemented.");
          }
        },
        {
          key: "sendDelayedEvent",
          value: function(u, h, f, g) {
            return Promise.reject(new Error("Failed to override function"));
          }
        },
        {
          key: "sendDelayedStickyEvent",
          value: function(u, h, f, g, m) {
            throw new Error("Method not implemented.");
          }
        },
        {
          key: "cancelScheduledDelayedEvent",
          value: function(u) {
            return Promise.reject(new Error("Failed to override function"));
          }
        },
        {
          key: "restartScheduledDelayedEvent",
          value: function(u) {
            return Promise.reject(new Error("Failed to override function"));
          }
        },
        {
          key: "sendScheduledDelayedEvent",
          value: function(u) {
            return Promise.reject(new Error("Failed to override function"));
          }
        },
        {
          key: "sendToDevice",
          value: function(u, h, f) {
            return Promise.reject(new Error("Failed to override function"));
          }
        },
        {
          key: "readRoomAccountData",
          value: function(u) {
            return Promise.resolve([]);
          }
        },
        {
          key: "readRoomEvents",
          value: function(u, h, f) {
            return Promise.resolve([]);
          }
        },
        {
          key: "readStateEvents",
          value: function(u, h, f) {
            return Promise.resolve([]);
          }
        },
        {
          key: "readStickyEvents",
          value: function(u) {
            throw new Error("readStickyEvents is not implemented");
          }
        },
        {
          key: "readRoomTimeline",
          value: function(u, h, f, g, m, v) {
            return g === void 0 ? this.readRoomEvents(h, f, m, [
              u
            ], v) : this.readStateEvents(h, g, m, [
              u
            ]);
          }
        },
        {
          key: "readRoomState",
          value: function(u, h, f) {
            return this.readStateEvents(h, f, Number.MAX_SAFE_INTEGER, [
              u
            ]);
          }
        },
        {
          key: "readEventRelations",
          value: function(u, h, f, g, m, v, y, w) {
            return Promise.resolve({
              chunk: []
            });
          }
        },
        {
          key: "askOpenID",
          value: function(u) {
            u.update({
              state: t.OpenIDRequestState.Blocked
            });
          }
        },
        {
          key: "navigate",
          value: function(u) {
            throw new Error("Navigation is not implemented");
          }
        },
        {
          key: "getTurnServers",
          value: function() {
            throw new Error("TURN server support is not implemented");
          }
        },
        {
          key: "searchUserDirectory",
          value: function(u, h) {
            return Promise.resolve({
              limited: false,
              results: []
            });
          }
        },
        {
          key: "getMediaConfig",
          value: function() {
            throw new Error("Get media config is not implemented");
          }
        },
        {
          key: "uploadFile",
          value: function(u) {
            throw new Error("Upload file is not implemented");
          }
        },
        {
          key: "downloadFile",
          value: function(u) {
            throw new Error("Download file is not implemented");
          }
        },
        {
          key: "getKnownRooms",
          value: function() {
            throw new Error("Querying known rooms is not implemented");
          }
        },
        {
          key: "processError",
          value: function(u) {
          }
        }
      ]), c;
    })();
    return S_.WidgetDriver = l, S_;
  }
  var L$;
  function Fk() {
    return L$ || (L$ = 1, (function(t) {
      Object.defineProperty(t, "__esModule", {
        value: true
      });
      var e = pCe();
      Object.keys(e).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === e[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return e[T];
          }
        });
      });
      var n = FCe();
      Object.keys(n).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === n[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return n[T];
          }
        });
      });
      var r = DB();
      Object.keys(r).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === r[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return r[T];
          }
        });
      });
      var i = yB();
      Object.keys(i).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === i[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return i[T];
          }
        });
      });
      var a = Ere();
      Object.keys(a).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === a[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return a[T];
          }
        });
      });
      var s = vCe();
      Object.keys(s).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === s[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return s[T];
          }
        });
      });
      var l = bB();
      Object.keys(l).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === l[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return l[T];
          }
        });
      });
      var c = vB();
      Object.keys(c).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === c[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return c[T];
          }
        });
      });
      var d = _B();
      Object.keys(d).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === d[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return d[T];
          }
        });
      });
      var u = Sre();
      Object.keys(u).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === u[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return u[T];
          }
        });
      });
      var h = xB();
      Object.keys(h).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === h[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return h[T];
          }
        });
      });
      var f = _Ce();
      Object.keys(f).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === f[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return f[T];
          }
        });
      });
      var g = yCe();
      Object.keys(g).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === g[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return g[T];
          }
        });
      });
      var m = kre();
      Object.keys(m).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === m[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return m[T];
          }
        });
      });
      var v = CB();
      Object.keys(v).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === v[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return v[T];
          }
        });
      });
      var y = wB();
      Object.keys(y).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === y[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return y[T];
          }
        });
      });
      var w = Tre();
      Object.keys(w).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === w[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return w[T];
          }
        });
      });
      var b = Rre();
      Object.keys(b).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === b[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return b[T];
          }
        });
      });
      var j = Are();
      Object.keys(j).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === j[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return j[T];
          }
        });
      });
      var k = bCe();
      Object.keys(k).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === k[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return k[T];
          }
        });
      });
      var C = xCe();
      Object.keys(C).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === C[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return C[T];
          }
        });
      });
      var x = jre();
      Object.keys(x).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === x[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return x[T];
          }
        });
      });
      var S = wCe();
      Object.keys(S).forEach(function(T) {
        T === "default" || T === "__esModule" || T in t && t[T] === S[T] || Object.defineProperty(t, T, {
          enumerable: true,
          get: function() {
            return S[T];
          }
        });
      });
    })(l9)), l9;
  }
  var Bn = Fk();
  function N$(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function sw(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? N$(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : N$(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function DCe(t) {
    var e, n, r, i = 2;
    for (typeof Symbol < "u" && (n = Symbol.asyncIterator, r = Symbol.iterator); i--; ) {
      if (n && (e = t[n]) != null) return e.call(t);
      if (r && (e = t[r]) != null) return new jD(e.call(t));
      n = "@@asyncIterator", r = "@@iterator";
    }
    throw new TypeError("Object is not async iterable");
  }
  function jD(t) {
    function e(n) {
      if (Object(n) !== n) return Promise.reject(new TypeError(n + " is not an object."));
      var r = n.done;
      return Promise.resolve(n.value).then(function(i) {
        return {
          value: i,
          done: r
        };
      });
    }
    return jD = function(r) {
      this.s = r, this.n = r.next;
    }, jD.prototype = {
      s: null,
      n: null,
      next: function() {
        return e(this.n.apply(this.s, arguments));
      },
      return: function(r) {
        var i = this.s.return;
        return i === void 0 ? Promise.resolve({
          value: r,
          done: true
        }) : e(i.apply(this.s, arguments));
      },
      throw: function(r) {
        var i = this.s.return;
        return i === void 0 ? Promise.reject(r) : e(i.apply(this.s, arguments));
      }
    }, new jD(t);
  }
  var TD = (function(t) {
    return t.PendingEventsChanged = "PendingEvent.pendingEventsChanged", t;
  })({});
  class Ire extends gk {
    constructor(e, n, r, i, a) {
      var s, l, c, d, u, h, f, g, m, v, y, w, b, j;
      super(i), s = this, this.widgetApi = e, this.capabilities = n, this.roomId = r, $(this, "room", void 0), $(this, "widgetApiReady", void 0), $(this, "roomStateSynced", void 0), $(this, "lifecycle", void 0), $(this, "syncState", null), $(this, "pendingSendingEventsTxId", []), $(this, "eventEmitter", new ji()), $(this, "updateTxId", (function() {
        var x = me(function* (S) {
          if (S.getSender() === s.getUserId() && s.pendingSendingEventsTxId.some((U) => S.getType() === U.type)) {
            for (var T, A = (T = s.pendingSendingEventsTxId.find((U) => U.id === S.getId())) === null || T === void 0 ? void 0 : T.txId; !A && s.pendingSendingEventsTxId.length > 0; ) {
              var B;
              yield new Promise((U) => s.eventEmitter.once(TD.PendingEventsChanged, () => U())), A = (B = s.pendingSendingEventsTxId.find((U) => U.id === S.getId())) === null || B === void 0 ? void 0 : B.txId;
            }
            A && (S.setTxnId(A), S.setUnsigned(sw(sw({}, S.getUnsigned()), {}, {
              transaction_id: A
            }))), s.pendingSendingEventsTxId = s.pendingSendingEventsTxId.filter((U) => U.id !== S.getId()), s.pendingSendingEventsTxId.length === 0 && s.eventEmitter.emit(TD.PendingEventsChanged);
          }
        });
        return function(S) {
          return x.apply(this, arguments);
        };
      })()), $(this, "onEvent", (function() {
        var x = me(function* (S) {
          if (S.preventDefault(), S.detail.data.room_id === s.roomId) {
            var T = new to(S.detail.data);
            yield s.updateTxId(T), s.syncApi instanceof gf ? (yield s.supportUpdateState()) ? yield s.syncApi.injectRoomEvents(s.room, void 0, [], [
              T
            ]) : yield s.syncApi.injectRoomEvents(s.room, [], void 0, [
              T
            ]) : (yield s.supportUpdateState()) ? yield s.syncApi.injectRoomEvents(s.room, [], [
              T
            ]) : _e.error("slididng sync cannot be used in widget mode if the client widget driver does not support the version: 'org.matrix.msc2762_update_state'"), s.emit(jt.Event, T), s.setSyncState(Nn.Syncing), _e.info("Received event ".concat(T.getId(), " ").concat(T.getType()));
          } else {
            var { event_id: A, room_id: B } = S.detail.data;
            _e.info("Received event ".concat(A, " for a different room ").concat(B, "; discarding"));
          }
          yield s.ack(S);
        });
        return function(S) {
          return x.apply(this, arguments);
        };
      })()), $(this, "onToDevice", (function() {
        var x = me(function* (S) {
          S.preventDefault();
          var T = new to({
            type: S.detail.data.type,
            sender: S.detail.data.sender,
            content: S.detail.data.content
          });
          S.detail.data.encrypted && T.makeEncrypted(ce.RoomMessageEncrypted, {}, "", ""), s.emit(jt.ToDeviceEvent, T), s.setSyncState(Nn.Syncing), yield s.ack(S);
        });
        return function(S) {
          return x.apply(this, arguments);
        };
      })()), $(this, "onStateUpdate", (function() {
        var x = me(function* (S) {
          S.preventDefault(), (yield s.supportUpdateState()) || _e.warn("received update_state widget action but the widget driver did not claim to support 'org.matrix.msc2762_update_state'");
          for (var T of S.detail.data.state) if (T.room_id === s.roomId) {
            var A = new to(T);
            s.syncApi instanceof gf ? yield s.syncApi.injectRoomEvents(s.room, void 0, [
              A
            ]) : yield s.syncApi.injectRoomEvents(s.room, [
              A
            ]), _e.info("Updated state entry ".concat(A.getType(), " ").concat(A.getStateKey(), " to ").concat(A.getId()));
          } else {
            var { event_id: B, room_id: U } = S.detail.data;
            _e.info("Received state entry ".concat(B, " for a different room ").concat(U, "; discarding"));
          }
          yield s.ack(S);
        });
        return function(S) {
          return x.apply(this, arguments);
        };
      })());
      var k = this.widgetApi.transport.send.bind(this.widgetApi.transport);
      this.widgetApi.transport.send = (function() {
        var x = me(function* (S, T) {
          try {
            return yield k(S, T);
          } catch (A) {
            z$(A);
          }
        });
        return function(S, T) {
          return x.apply(this, arguments);
        };
      })();
      var C = this.widgetApi.transport.sendComplete.bind(this.widgetApi.transport);
      this.widgetApi.transport.sendComplete = (function() {
        var x = me(function* (S, T) {
          try {
            return yield C(S, T);
          } catch (A) {
            z$(A);
          }
        });
        return function(S, T) {
          return x.apply(this, arguments);
        };
      })(), this.widgetApiReady = new Promise((x) => this.widgetApi.once("ready", x)), this.roomStateSynced = (l = n.receiveState) !== null && l !== void 0 && l.length ? new Promise((x) => this.widgetApi.once("action:".concat(Bn.WidgetApiToWidgetAction.UpdateState), x)) : Promise.resolve(), ((c = n.sendEvent) !== null && c !== void 0 && c.length || (d = n.receiveEvent) !== null && d !== void 0 && d.length || n.sendMessage === true || Array.isArray(n.sendMessage) && n.sendMessage.length || n.receiveMessage === true || Array.isArray(n.receiveMessage) && n.receiveMessage.length || (u = n.sendState) !== null && u !== void 0 && u.length || (h = n.receiveState) !== null && h !== void 0 && h.length) && e.requestCapabilityForRoomTimeline(r), (f = n.sendEvent) === null || f === void 0 || f.forEach((x) => e.requestCapabilityToSendEvent(x)), (g = n.receiveEvent) === null || g === void 0 || g.forEach((x) => e.requestCapabilityToReceiveEvent(x)), n.sendMessage === true ? e.requestCapabilityToSendMessage() : Array.isArray(n.sendMessage) && n.sendMessage.forEach((x) => e.requestCapabilityToSendMessage(x)), n.receiveMessage === true ? e.requestCapabilityToReceiveMessage() : Array.isArray(n.receiveMessage) && n.receiveMessage.forEach((x) => e.requestCapabilityToReceiveMessage(x)), (m = n.sendState) === null || m === void 0 || m.forEach((x) => {
        var { eventType: S, stateKey: T } = x;
        return e.requestCapabilityToSendState(S, T);
      }), (v = n.receiveState) === null || v === void 0 || v.forEach((x) => {
        var { eventType: S, stateKey: T } = x;
        return e.requestCapabilityToReceiveState(S, T);
      }), (y = n.sendToDevice) === null || y === void 0 || y.forEach((x) => e.requestCapabilityToSendToDevice(x)), (w = n.receiveToDevice) === null || w === void 0 || w.forEach((x) => e.requestCapabilityToReceiveToDevice(x)), n.sendDelayedEvents && ((b = n.sendEvent) !== null && b !== void 0 && b.length || n.sendMessage === true || Array.isArray(n.sendMessage) && n.sendMessage.length || (j = n.sendState) !== null && j !== void 0 && j.length) && e.requestCapability(Bn.MatrixCapabilities.MSC4157SendDelayedEvent), n.updateDelayedEvents && e.requestCapability(Bn.MatrixCapabilities.MSC4157UpdateDelayedEvent), n.turnServers && e.requestCapability(Bn.MatrixCapabilities.MSC3846TurnServers), e.on("action:".concat(Bn.WidgetApiToWidgetAction.SendEvent), this.onEvent), e.on("action:".concat(Bn.WidgetApiToWidgetAction.SendToDevice), this.onToDevice), e.on("action:".concat(Bn.WidgetApiToWidgetAction.UpdateState), this.onStateUpdate), e.start(), a && e.sendContentLoaded();
    }
    supportUpdateState() {
      var e = this;
      return me(function* () {
        return (yield e.widgetApi.getClientVersions()).includes(Bn.UnstableApiVersion.MSC2762_UPDATE_STATE);
      })();
    }
    startClient() {
      var e = arguments, n = this;
      return me(function* () {
        var r = e.length > 0 && e[0] !== void 0 ? e[0] : {};
        n.lifecycle = new AbortController();
        var i = n.getUserId();
        if (i && n.store.storeUser(new Md(i)), r.slidingSync ? n.syncApi = new Qne(r.slidingSync, n, r, n.buildSyncApiOptions()) : n.syncApi = new gf(n, r, n.buildSyncApiOptions()), n.room = n.syncApi.createRoom(n.roomId), n.store.storeRoom(n.room), yield n.widgetApiReady, yield n.supportUpdateState()) yield n.roomStateSynced;
        else {
          var a, s;
          yield Promise.all((a = (s = n.capabilities.receiveState) === null || s === void 0 ? void 0 : s.map((function() {
            var l = me(function* (c) {
              var { eventType: d, stateKey: u } = c, h = yield n.widgetApi.readStateEvents(d, void 0, u, [
                n.roomId
              ]), f = h.map((g) => new to(g));
              n.syncApi instanceof gf ? yield n.syncApi.injectRoomEvents(n.room, void 0, f) : yield n.syncApi.injectRoomEvents(n.room, f), f.forEach((g) => {
                n.emit(jt.Event, g), _e.info("Backfilled event ".concat(g.getId(), " ").concat(g.getType(), " ").concat(g.getStateKey()));
              });
            });
            return function(c) {
              return l.apply(this, arguments);
            };
          })())) !== null && a !== void 0 ? a : []);
        }
        r.clientWellKnownPollPeriod !== void 0 && (n.clientWellKnownIntervalID = setInterval(() => {
          n.fetchClientWellKnown();
        }, 1e3 * r.clientWellKnownPollPeriod), n.fetchClientWellKnown()), n.setSyncState(Nn.Syncing), _e.info("Finished initial sync"), n.matrixRTC.start(), n.capabilities.turnServers && n.watchTurnServers();
      })();
    }
    stopClient() {
      this.widgetApi.off("action:".concat(Bn.WidgetApiToWidgetAction.SendEvent), this.onEvent), this.widgetApi.off("action:".concat(Bn.WidgetApiToWidgetAction.SendToDevice), this.onToDevice), this.widgetApi.off("action:".concat(Bn.WidgetApiToWidgetAction.UpdateState), this.onStateUpdate), super.stopClient(), this.lifecycle.abort();
    }
    joinRoom(e) {
      var n = this;
      return me(function* () {
        if (e === n.roomId) return n.room;
        throw new Error("Unknown room: ".concat(e));
      })();
    }
    encryptAndSendEvent(e, n, r) {
      var i = this;
      return me(function* () {
        var a = n.event.redacts ? sw(sw({}, n.getContent()), {}, {
          redacts: n.event.redacts
        }) : n.getContent();
        if (r) {
          var s = yield i.widgetApi.sendRoomEvent(n.getType(), a, e.roomId, "delay" in r ? r.delay : void 0, "parent_delay_id" in r ? r.parent_delay_id : void 0).catch(ud);
          return i.validateSendDelayedEventResponse(s);
        }
        var l = n.getTxnId();
        l && i.pendingSendingEventsTxId.push({
          type: n.getType(),
          id: void 0,
          txId: l
        });
        var c;
        try {
          c = yield i.widgetApi.sendRoomEvent(n.getType(), a, e.roomId).catch(ud);
        } catch (d) {
          throw i.updatePendingEventStatus(e, n, Vn.NOT_SENT), d;
        }
        return e.updatePendingEvent(n, Vn.SENT, c.event_id), i.pendingSendingEventsTxId.forEach((d) => {
          d.txId === l && (d.id = c.event_id);
        }), i.eventEmitter.emit(TD.PendingEventsChanged), {
          event_id: c.event_id
        };
      })();
    }
    sendStateEvent(e, n, r) {
      var i = arguments, a = this;
      return me(function* () {
        var s = i.length > 3 && i[3] !== void 0 ? i[3] : "", l = yield a.widgetApi.sendStateEvent(n, s, r, e).catch(ud);
        if (l.event_id === void 0) throw new Error("'event_id' absent from response to an event request");
        return {
          event_id: l.event_id
        };
      })();
    }
    _unstable_sendDelayedStateEvent(e, n, r, i) {
      var a = arguments, s = this;
      return me(function* () {
        var l = a.length > 4 && a[4] !== void 0 ? a[4] : "";
        if (!(yield s.doesServerSupportUnstableFeature(kd))) throw new Ff("Server does not support the delayed events API", "sendDelayedStateEvent");
        var c = yield s.widgetApi.sendStateEvent(r, l, i, e, "delay" in n ? n.delay : void 0, "parent_delay_id" in n ? n.parent_delay_id : void 0).catch(ud);
        return s.validateSendDelayedEventResponse(c);
      })();
    }
    validateSendDelayedEventResponse(e) {
      if (e.delay_id === void 0) throw new Error("'delay_id' absent from response to a delayed event request");
      return {
        delay_id: e.delay_id
      };
    }
    _unstable_updateDelayedEvent(e, n) {
      var r = this;
      return me(function* () {
        if (!(yield r.doesServerSupportUnstableFeature(kd))) throw new Ff("Server does not support the delayed events API", "updateDelayedEvent");
        return yield r.widgetApi.updateDelayedEvent(e, n).catch(ud), {};
      })();
    }
    encryptAndSendToDevice(e, n, r) {
      var i = this;
      return me(function* () {
        var a = new zu(() => /* @__PURE__ */ new Map());
        for (var { userId: s, deviceId: l } of n) a.getOrCreate(s).set(l, r);
        yield i.widgetApi.sendToDevice(e, true, dg(a)).catch(ud);
      })();
    }
    sendToDevice(e, n) {
      var r = this;
      return me(function* () {
        return yield r.widgetApi.sendToDevice(e, false, dg(n)).catch(ud), {};
      })();
    }
    getOpenIdToken() {
      var e = this;
      return me(function* () {
        var n = yield e.widgetApi.requestOpenIDConnectToken().catch(ud);
        return {
          access_token: n.access_token,
          expires_in: n.expires_in,
          matrix_server_name: n.matrix_server_name,
          token_type: n.token_type
        };
      })();
    }
    queueToDevice(e) {
      var n = this;
      return me(function* () {
        var { eventType: r, batch: i } = e, a = new zu(() => /* @__PURE__ */ new Map());
        for (var { userId: s, deviceId: l, payload: c } of i) a.getOrCreate(s).set(l, c);
        yield n.widgetApi.sendToDevice(r, false, dg(a)).catch(ud);
      })();
    }
    sendToDeviceViaWidgetApi(e, n, r) {
      var i = this;
      return me(function* () {
        yield i.widgetApi.sendToDevice(e, n, dg(r)).catch(ud);
      })();
    }
    checkTurnServers() {
      var e = this;
      return me(function* () {
        return e.turnServers.length > 0;
      })();
    }
    getSyncState() {
      return this.syncState;
    }
    setSyncState(e) {
      var n = this.syncState;
      this.syncState = e, this.emit(jt.Sync, e, n);
    }
    ack(e) {
      var n = this;
      return me(function* () {
        yield n.widgetApi.transport.reply(e.detail, {});
      })();
    }
    watchTurnServers() {
      var e = this;
      return me(function* () {
        var n = e.widgetApi.getTurnServers(), r = () => {
          n.return(void 0);
        };
        e.lifecycle.signal.addEventListener("abort", r);
        try {
          var i = false, a = false, s;
          try {
            for (var l = DCe(n), c; i = !(c = yield l.next()).done; i = false) {
              var d = c.value;
              e.turnServers = [
                {
                  urls: d.uris,
                  username: d.username,
                  credential: d.password
                }
              ], e.emit(jt.TurnServers, e.turnServers), _e.log("Received TURN server: ".concat(d.uris));
            }
          } catch (u) {
            a = true, s = u;
          } finally {
            try {
              i && l.return != null && (yield l.return());
            } finally {
              if (a) throw s;
            }
          }
        } catch (u) {
          _e.warn("Error watching TURN servers", u);
        } finally {
          e.lifecycle.signal.removeEventListener("abort", r);
        }
      })();
    }
  }
  function z$(t) {
    throw t instanceof Bn.WidgetApiResponseError && t.data.matrix_api_error ? Un.fromWidgetApiErrorData(t.data.matrix_api_error) : t;
  }
  function ud(t) {
    throw t instanceof Error && t.message === "Request timed out" ? new vp("widget api timeout") : t;
  }
  Bre = (function(t) {
    return t[t.Blocked = -1] = "Blocked", t[t.Unverified = 0] = "Unverified", t[t.Verified = 1] = "Verified", t;
  })({});
  CCe = class {
    constructor(e) {
      $(this, "deviceId", void 0), $(this, "userId", void 0), $(this, "algorithms", void 0), $(this, "keys", void 0), $(this, "verified", void 0), $(this, "signatures", void 0), $(this, "displayName", void 0), $(this, "dehydrated", false), this.deviceId = e.deviceId, this.userId = e.userId, this.algorithms = e.algorithms, this.keys = e.keys, this.verified = e.verified || Bre.Unverified, this.signatures = e.signatures || /* @__PURE__ */ new Map(), this.displayName = e.displayName, this.dehydrated = !!e.dehydrated;
    }
    getFingerprint() {
      return this.keys.get("ed25519:".concat(this.deviceId));
    }
    getIdentityKey() {
      return this.keys.get("curve25519:".concat(this.deviceId));
    }
  };
  var U$ = function() {
  }, ECe = 10;
  class kCe {
    constructor(e, n) {
      var r, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      this.client = e, this.timelineSet = n, $(this, "windowLimit", void 0), $(this, "start", void 0), $(this, "end", void 0), $(this, "eventCount", 0), this.windowLimit = i.windowLimit || 1e3, (r = n.room) === null || r === void 0 || r.on(mt.Timeline, this.onTimelineEvent.bind(this));
    }
    load(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 20, r = (i) => {
        if (!i) throw new Error("No timeline given to initFields");
        var a, s = i.getEvents();
        if (!e) a = s.length;
        else if (a = s.findIndex((d) => d.getId() === e), a < 0) throw new Error("getEventTimeline result didn't include requested event");
        var l = Math.min(s.length, a + Math.ceil(n / 2)), c = Math.max(0, l - n);
        this.start = new xA(i, c - i.getBaseIndex()), this.end = new xA(i, l - i.getBaseIndex()), this.eventCount = l - c;
      };
      return this.timelineSet.getTimelineForEvent(e) ? (r(this.timelineSet.getTimelineForEvent(e)), Promise.resolve()) : e ? this.client.getEventTimeline(this.timelineSet, e).then(r) : (r(this.timelineSet.getLiveTimeline()), Promise.resolve());
    }
    getTimelineIndex(e) {
      if (e == en.BACKWARDS) {
        var n;
        return (n = this.start) !== null && n !== void 0 ? n : null;
      } else if (e == en.FORWARDS) {
        var r;
        return (r = this.end) !== null && r !== void 0 ? r : null;
      } else throw new Error("Invalid direction '" + e + "'");
    }
    extend(e, n) {
      var r = this.getTimelineIndex(e);
      if (!r) return false;
      var i = e == en.BACKWARDS ? r.retreat(n) : r.advance(n);
      if (i) {
        this.eventCount += i, U$("TimelineWindow: increased cap by " + i + " (now " + this.eventCount + ")");
        var a = this.eventCount - this.windowLimit;
        return a > 0 && this.unpaginate(a, e != en.BACKWARDS), true;
      }
      return false;
    }
    onTimelineEvent(e, n, r, i) {
      i && this.onEventRemoved();
    }
    onEventRemoved() {
      var e = this.getEvents();
      e.length > 0 && e[e.length - 1] === void 0 && this.end && this.end.index--;
    }
    canPaginate(e) {
      var n = this.getTimelineIndex(e);
      if (!n) return false;
      if (e == en.BACKWARDS) {
        if (n.index > n.minIndex()) return true;
      } else if (n.index < n.maxIndex()) return true;
      var r = n.timeline.getNeighbouringTimeline(e), i = n.timeline.getPaginationToken(e);
      return !!r || !!i;
    }
    paginate(e, n) {
      var r = arguments, i = this;
      return me(function* () {
        var a = r.length > 2 && r[2] !== void 0 ? r[2] : true, s = r.length > 3 && r[3] !== void 0 ? r[3] : ECe, l = i.getTimelineIndex(e);
        if (!l) return false;
        if (l.pendingPaginate) return l.pendingPaginate;
        if (i.extend(e, n)) return true;
        if (!a || s === 0) return false;
        var c = l.timeline.getPaginationToken(e);
        if (!c) return false;
        var d = i.client.paginateEventTimeline(l.timeline, {
          backwards: e == en.BACKWARDS,
          limit: n
        }).finally(function() {
          l.pendingPaginate = void 0;
        }).then((u) => u ? i.paginate(e, n, true, s - 1) : i.paginate(e, n, false, 0));
        return l.pendingPaginate = d, d;
      })();
    }
    unpaginate(e, n) {
      var r = n ? this.start : this.end;
      if (!r) throw new Error("Attempting to unpaginate startOfTimeline=".concat(n, " but don't have this direction"));
      if (e > this.eventCount || e < 0) throw new Error("Attemting to unpaginate ".concat(e, " events, but only have ").concat(this.eventCount, " in the timeline"));
      for (; e > 0; ) {
        var i = n ? r.advance(e) : r.retreat(e);
        if (i <= 0) throw new Error("Unable to unpaginate any further, but still have " + this.eventCount + " events");
        e -= i, this.eventCount -= i, U$("TimelineWindow.unpaginate: dropped " + i + " (now " + this.eventCount + ")");
      }
    }
    getEvents() {
      if (!this.start) return [];
      for (var e = [], n = this.start.timeline; n; ) {
        var r, i, a = n.getEvents(), s = 0, l = a.length;
        n === this.start.timeline && (s = this.start.index + n.getBaseIndex()), n === ((r = this.end) === null || r === void 0 ? void 0 : r.timeline) && (l = this.end.index + n.getBaseIndex());
        for (var c = s; c < l; c++) e.push(a[c]);
        if (n === ((i = this.end) === null || i === void 0 ? void 0 : i.timeline)) break;
        n = n.getNeighbouringTimeline(en.FORWARDS);
      }
      return e;
    }
  }
  class xA {
    constructor(e, n) {
      this.timeline = e, this.index = n, $(this, "pendingPaginate", void 0);
    }
    minIndex() {
      return this.timeline.getBaseIndex() * -1;
    }
    maxIndex() {
      return this.timeline.getEvents().length - this.timeline.getBaseIndex();
    }
    advance(e) {
      if (!e) return 0;
      var n;
      if (e < 0) {
        if (n = Math.max(e, this.minIndex() - this.index), n < 0) return this.index += n, n;
      } else if (n = Math.min(e, this.maxIndex() - this.index), n > 0) return this.index += n, n;
      var r = this.timeline.getNeighbouringTimeline(e < 0 ? en.BACKWARDS : en.FORWARDS);
      return r ? (this.timeline = r, e < 0 ? this.index = this.maxIndex() : this.index = this.minIndex(), this.advance(e)) : 0;
    }
    retreat(e) {
      return this.advance(e * -1) * -1;
    }
  }
  function Pre(t, e) {
    return new Promise((n, r) => {
      var i = true, a = t.open(e);
      a.onupgradeneeded = () => {
        i = false;
      }, a.onblocked = () => r(a.error), a.onsuccess = () => {
        var s = a.result;
        s.close(), i || t.deleteDatabase(e), n(i);
      }, a.onerror = () => r(a.error);
    });
  }
  var Mre = [
    (t) => {
      t.createObjectStore("users", {
        keyPath: [
          "userId"
        ]
      }), t.createObjectStore("accountData", {
        keyPath: [
          "type"
        ]
      }), t.createObjectStore("sync", {
        keyPath: [
          "clobber"
        ]
      });
    },
    (t) => {
      var e = t.createObjectStore("oob_membership_events", {
        keyPath: [
          "room_id",
          "state_key"
        ]
      });
      e.createIndex("room", "room_id");
    },
    (t) => {
      t.createObjectStore("client_options", {
        keyPath: [
          "clobber"
        ]
      });
    },
    (t) => {
      t.createObjectStore("to_device_queue", {
        autoIncrement: true
      });
    }
  ], SCe = Mre.length;
  function lw(t, e, n) {
    var r = t.openCursor(e);
    return new Promise((i, a) => {
      var s = [];
      r.onerror = () => {
        var l;
        a(new Error("Query failed: " + ((l = r.error) === null || l === void 0 ? void 0 : l.name)));
      }, r.onsuccess = () => {
        var l = r.result;
        if (!l) {
          i(s);
          return;
        }
        s.push(n(l)), l.continue();
      };
    });
  }
  function Tm(t) {
    return new Promise((e, n) => {
      t.oncomplete = function(r) {
        e(r);
      }, t.onerror = function() {
        n(t.error);
      };
    });
  }
  function Ore(t) {
    return new Promise((e, n) => {
      t.onsuccess = function(r) {
        e(r);
      }, t.onerror = function() {
        n(t.error);
      };
    });
  }
  function jCe(t) {
    return new Promise((e, n) => {
      t.onsuccess = () => e(t), t.onerror = (r) => n(r);
    });
  }
  function c9(t) {
    return Ore(t).then((e) => t.result);
  }
  class V$ {
    static exists(e, n) {
      return n = "matrix-js-sdk:" + (n || "default"), Pre(e, n);
    }
    constructor(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
      this.indexedDB = e, $(this, "dbName", void 0), $(this, "syncAccumulator", void 0), $(this, "db", void 0), $(this, "disconnected", true), $(this, "_isNewlyCreated", false), $(this, "syncToDatabasePromise", void 0), $(this, "pendingUserPresenceData", []), this.dbName = "matrix-js-sdk:" + n, this.syncAccumulator = new Cre();
    }
    connect(e) {
      var n = this;
      if (!this.disconnected) return _e.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"), Promise.resolve();
      this.disconnected = false, _e.log("LocalIndexedDBStoreBackend.connect: connecting...");
      var r = this.indexedDB.open(this.dbName, SCe);
      return r.onupgradeneeded = (i) => {
        var a = r.result, s = i.oldVersion;
        _e.log("LocalIndexedDBStoreBackend.connect: upgrading from ".concat(s)), s < 1 && (this._isNewlyCreated = true), Mre.forEach((l, c) => {
          s <= c && l(a);
        });
      }, r.onblocked = () => {
        _e.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere");
      }, _e.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."), Ore(r).then(me(function* () {
        _e.log("LocalIndexedDBStoreBackend.connect: connected"), n.db = r.result, n.db.onversionchange = () => {
          var i;
          (i = n.db) === null || i === void 0 || i.close(), n.disconnected = true, n.db = void 0;
        }, n.db.onclose = () => {
          n.disconnected = true, n.db = void 0, e == null ? void 0 : e();
        }, yield n.init();
      }));
    }
    isNewlyCreated() {
      return Promise.resolve(this._isNewlyCreated);
    }
    init() {
      return Promise.all([
        this.loadAccountData(),
        this.loadSyncData()
      ]).then((e) => {
        var [n, r] = e;
        _e.log("LocalIndexedDBStoreBackend: loaded initial data"), this.syncAccumulator.accumulate({
          next_batch: r.nextBatch,
          rooms: r.roomsData,
          account_data: {
            events: n
          }
        }, true);
      });
    }
    getOutOfBandMembers(e) {
      return new Promise((n, r) => {
        var i = this.db.transaction([
          "oob_membership_events"
        ], "readonly"), a = i.objectStore("oob_membership_events"), s = a.index("room"), l = IDBKeyRange.only(e), c = s.openCursor(l), d = [], u = false;
        c.onsuccess = () => {
          var h = c.result;
          if (!h) return !d.length && !u ? n(null) : n(d);
          var f = h.value;
          f.oob_written ? u = true : d.push(f), h.continue();
        }, c.onerror = (h) => {
          r(h);
        };
      }).then((n) => (_e.log("LL: got ".concat(n == null ? void 0 : n.length, " membershipEvents from storage for room ").concat(e, " ...")), n));
    }
    setOutOfBandMembers(e, n) {
      var r = this;
      return me(function* () {
        _e.log("LL: backend about to store ".concat(n.length) + " members for ".concat(e));
        var i = r.db.transaction([
          "oob_membership_events"
        ], "readwrite"), a = i.objectStore("oob_membership_events");
        n.forEach((l) => {
          a.put(l);
        });
        var s = {
          room_id: e,
          oob_written: true,
          state_key: 0
        };
        a.put(s), yield Tm(i), _e.log("LL: backend done storing for ".concat(e, "!"));
      })();
    }
    clearOutOfBandMembers(e) {
      var n = this;
      return me(function* () {
        var r = n.db.transaction([
          "oob_membership_events"
        ], "readonly"), i = r.objectStore("oob_membership_events"), a = i.index("room"), s = IDBKeyRange.only(e), l = c9(a.openKeyCursor(s, "next")).then((m) => (m == null ? void 0 : m.primaryKey)[1]), c = c9(a.openKeyCursor(s, "prev")).then((m) => (m == null ? void 0 : m.primaryKey)[1]), [d, u] = yield Promise.all([
          l,
          c
        ]), h = n.db.transaction([
          "oob_membership_events"
        ], "readwrite"), f = h.objectStore("oob_membership_events"), g = IDBKeyRange.bound([
          e,
          d
        ], [
          e,
          u
        ]);
        _e.log("LL: Deleting all users + marker in storage for room ".concat(e, ", with key range:"), [
          e,
          d
        ], [
          e,
          u
        ]), yield jCe(f.delete(g));
      })();
    }
    clearDatabase() {
      return new Promise((e) => {
        var n;
        _e.log("Removing indexeddb instance: ".concat(this.dbName)), (n = this.db) === null || n === void 0 || n.close();
        var r = this.indexedDB.deleteDatabase(this.dbName);
        r.onblocked = () => {
          _e.log("can't yet delete indexeddb ".concat(this.dbName, " because it is open elsewhere"));
        }, r.onerror = () => {
          var i;
          _e.warn("unable to delete js-sdk store indexeddb: ".concat((i = r.error) === null || i === void 0 ? void 0 : i.name)), e();
        }, r.onsuccess = () => {
          _e.log("Removed indexeddb instance: ".concat(this.dbName)), e();
        };
      });
    }
    getSavedSync() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, n = this.syncAccumulator.getJSON();
      return n.nextBatch ? e ? Promise.resolve(Gb(n)) : Promise.resolve(n) : Promise.resolve(null);
    }
    getNextBatchToken() {
      return Promise.resolve(this.syncAccumulator.getNextBatchToken());
    }
    setSyncData(e) {
      return Promise.resolve().then(() => {
        this.syncAccumulator.accumulate(e);
      });
    }
    syncToDatabase(e) {
      var n = this;
      return me(function* () {
        return n.syncToDatabasePromise ? (_e.warn("Skipping syncToDatabase() as persist already in flight"), n.pendingUserPresenceData.push(...e), n.syncToDatabasePromise) : (e.unshift(...n.pendingUserPresenceData), n.syncToDatabasePromise = n.doSyncToDatabase(e), n.syncToDatabasePromise);
      })();
    }
    doSyncToDatabase(e) {
      var n = this;
      return me(function* () {
        try {
          var r = n.syncAccumulator.getJSON(true);
          yield Promise.all([
            n.persistUserPresenceEvents(e),
            n.persistAccountData(r.accountData),
            n.persistSyncData(r.nextBatch, r.roomsData)
          ]);
        } finally {
          n.syncToDatabasePromise = void 0;
        }
      })();
    }
    persistSyncData(e, n) {
      return _e.log("Persisting sync data up to", e), l0(() => {
        var r = this.db.transaction([
          "sync"
        ], "readwrite"), i = r.objectStore("sync");
        return i.put({
          clobber: "-",
          nextBatch: e,
          roomsData: n
        }), Tm(r).then(() => {
          _e.log("Persisted sync data up to", e);
        });
      });
    }
    persistAccountData(e) {
      return l0(() => {
        var n = this.db.transaction([
          "accountData"
        ], "readwrite"), r = n.objectStore("accountData");
        for (var i of e) r.put(i);
        return Tm(n).then();
      });
    }
    persistUserPresenceEvents(e) {
      return l0(() => {
        var n = this.db.transaction([
          "users"
        ], "readwrite"), r = n.objectStore("users");
        for (var i of e) r.put({
          userId: i[0],
          event: i[1]
        });
        return Tm(n).then();
      });
    }
    getUserPresenceEvents() {
      return l0(() => {
        var e = this.db.transaction([
          "users"
        ], "readonly"), n = e.objectStore("users");
        return lw(n, void 0, (r) => [
          r.value.userId,
          r.value.event
        ]);
      });
    }
    loadAccountData() {
      return _e.log("LocalIndexedDBStoreBackend: loading account data..."), l0(() => {
        var e = this.db.transaction([
          "accountData"
        ], "readonly"), n = e.objectStore("accountData");
        return lw(n, void 0, (r) => r.value).then((r) => (_e.log("LocalIndexedDBStoreBackend: loaded account data"), r));
      });
    }
    loadSyncData() {
      return _e.log("LocalIndexedDBStoreBackend: loading sync data..."), l0(() => {
        var e = this.db.transaction([
          "sync"
        ], "readonly"), n = e.objectStore("sync");
        return lw(n, void 0, (r) => r.value).then((r) => (_e.log("LocalIndexedDBStoreBackend: loaded sync data"), r.length > 1 && _e.warn("loadSyncData: More than 1 sync row found."), r.length > 0 ? r[0] : {}));
      });
    }
    getClientOptions() {
      return Promise.resolve().then(() => {
        var e = this.db.transaction([
          "client_options"
        ], "readonly"), n = e.objectStore("client_options");
        return lw(n, void 0, (r) => {
          var i;
          return (i = r.value) === null || i === void 0 ? void 0 : i.options;
        }).then((r) => r[0]);
      });
    }
    storeClientOptions(e) {
      var n = this;
      return me(function* () {
        var r = n.db.transaction([
          "client_options"
        ], "readwrite"), i = r.objectStore("client_options");
        i.put({
          clobber: "-",
          options: e
        }), yield Tm(r);
      })();
    }
    saveToDeviceBatches(e) {
      var n = this;
      return me(function* () {
        var r = n.db.transaction([
          "to_device_queue"
        ], "readwrite"), i = r.objectStore("to_device_queue");
        for (var a of e) i.add(a);
        yield Tm(r);
      })();
    }
    getOldestToDeviceBatch() {
      var e = this;
      return me(function* () {
        var n = e.db.transaction([
          "to_device_queue"
        ], "readonly"), r = n.objectStore("to_device_queue"), i = yield c9(r.openCursor());
        if (!i) return null;
        var a = i.value;
        return {
          id: i.key,
          txnId: a.txnId,
          eventType: a.eventType,
          batch: a.batch
        };
      })();
    }
    removeToDeviceBatch(e) {
      var n = this;
      return me(function* () {
        var r = n.db.transaction([
          "to_device_queue"
        ], "readwrite"), i = r.objectStore("to_device_queue");
        i.delete(e), yield Tm(r);
      })();
    }
    destroy() {
      var e = this;
      return me(function* () {
        var n;
        (n = e.db) === null || n === void 0 || n.close();
      })();
    }
  }
  class TCe {
    constructor(e, n) {
      this.workerFactory = e, this.dbName = n, $(this, "worker", void 0), $(this, "nextSeq", 0), $(this, "inFlight", {}), $(this, "startPromise", void 0), $(this, "onWorkerMessage", (r) => {
        var i = r.data;
        if (i.command == "closed") {
          var a;
          (a = this.onClose) === null || a === void 0 || a.call(this);
        } else if (i.command == "cmd_success" || i.command == "cmd_fail") {
          if (i.seq === void 0) {
            _e.error("Got reply from worker with no seq");
            return;
          }
          var s = this.inFlight[i.seq];
          if (s === void 0) {
            _e.error("Got reply for unknown seq " + i.seq);
            return;
          }
          if (delete this.inFlight[i.seq], i.command == "cmd_success") s.resolve(i.result);
          else {
            var l = new Error(i.error.message);
            l.name = i.error.name, s.reject(l);
          }
        } else _e.warn("Unrecognised message from worker: ", i);
      });
    }
    connect(e) {
      return this.onClose = e, this.ensureStarted().then(() => this.doCmd("connect"));
    }
    clearDatabase() {
      return this.ensureStarted().then(() => this.doCmd("clearDatabase"));
    }
    isNewlyCreated() {
      return this.doCmd("isNewlyCreated");
    }
    getSavedSync() {
      return this.doCmd("getSavedSync");
    }
    getNextBatchToken() {
      return this.doCmd("getNextBatchToken");
    }
    setSyncData(e) {
      return this.doCmd("setSyncData", [
        e
      ]);
    }
    syncToDatabase(e) {
      return this.doCmd("syncToDatabase", [
        e
      ]);
    }
    getOutOfBandMembers(e) {
      return this.doCmd("getOutOfBandMembers", [
        e
      ]);
    }
    setOutOfBandMembers(e, n) {
      return this.doCmd("setOutOfBandMembers", [
        e,
        n
      ]);
    }
    clearOutOfBandMembers(e) {
      return this.doCmd("clearOutOfBandMembers", [
        e
      ]);
    }
    getClientOptions() {
      return this.doCmd("getClientOptions");
    }
    storeClientOptions(e) {
      return this.doCmd("storeClientOptions", [
        e
      ]);
    }
    getUserPresenceEvents() {
      return this.doCmd("getUserPresenceEvents");
    }
    saveToDeviceBatches(e) {
      var n = this;
      return me(function* () {
        return n.doCmd("saveToDeviceBatches", [
          e
        ]);
      })();
    }
    getOldestToDeviceBatch() {
      var e = this;
      return me(function* () {
        return e.doCmd("getOldestToDeviceBatch");
      })();
    }
    removeToDeviceBatch(e) {
      var n = this;
      return me(function* () {
        return n.doCmd("removeToDeviceBatch", [
          e
        ]);
      })();
    }
    ensureStarted() {
      return this.startPromise || (this.worker = this.workerFactory(), this.worker.onmessage = this.onWorkerMessage, this.startPromise = this.doCmd("setupWorker", [
        this.dbName
      ]).then(() => {
        _e.log("IndexedDB worker is ready");
      })), this.startPromise;
    }
    doCmd(e, n) {
      return Promise.resolve().then(() => {
        var r, i = this.nextSeq++, a = Promise.withResolvers();
        return this.inFlight[i] = a, (r = this.worker) === null || r === void 0 || r.postMessage({
          command: e,
          seq: i,
          args: n
        }), a.promise;
      });
    }
    destroy() {
      var e = this;
      return me(function* () {
        var n;
        (n = e.worker) === null || n === void 0 || n.terminate();
      })();
    }
  }
  var RCe = 1e3 * 60 * 5;
  class EB extends FB {
    static exists(e, n) {
      return V$.exists(e, n);
    }
    constructor(e) {
      if (super(e), $(this, "backend", void 0), $(this, "startedUp", false), $(this, "syncTs", 0), $(this, "userModifiedMap", {}), $(this, "emitter", new ji()), $(this, "onClose", () => {
        this.emitter.emit("closed");
      }), $(this, "getSavedSync", this.degradable(() => this.backend.getSavedSync(), "getSavedSync")), $(this, "isNewlyCreated", this.degradable(() => this.backend.isNewlyCreated(), "isNewlyCreated")), $(this, "getSavedSyncToken", this.degradable(() => this.backend.getNextBatchToken(), "getSavedSyncToken")), $(this, "deleteAllData", this.degradable(() => (super.deleteAllData(), this.backend.clearDatabase().then(() => {
        _e.log("Deleted indexeddb data.");
      }, (n) => {
        throw _e.error("Failed to delete indexeddb data: ".concat(n)), n;
      })), null)), $(this, "reallySave", this.degradable(() => {
        this.syncTs = Date.now();
        var n = [];
        for (var r of this.getUsers()) this.userModifiedMap[r.userId] !== r.getLastModifiedTime() && r.events.presence && (n.push([
          r.userId,
          r.events.presence.event
        ]), this.userModifiedMap[r.userId] = r.getLastModifiedTime());
        return this.backend.syncToDatabase(n);
      }, null)), $(this, "setSyncData", this.degradable((n) => this.backend.setSyncData(n), "setSyncData")), $(this, "getOutOfBandMembers", this.degradable((n) => this.backend.getOutOfBandMembers(n), "getOutOfBandMembers")), $(this, "setOutOfBandMembers", this.degradable((n, r) => (super.setOutOfBandMembers(n, r), this.backend.setOutOfBandMembers(n, r)), "setOutOfBandMembers")), $(this, "clearOutOfBandMembers", this.degradable((n) => (super.clearOutOfBandMembers(n), this.backend.clearOutOfBandMembers(n)), "clearOutOfBandMembers")), $(this, "getClientOptions", this.degradable(() => this.backend.getClientOptions(), "getClientOptions")), $(this, "storeClientOptions", this.degradable((n) => (super.storeClientOptions(n), this.backend.storeClientOptions(n)), "storeClientOptions")), !e.indexedDB) throw new Error("Missing required option: indexedDB");
      e.workerFactory ? this.backend = new TCe(e.workerFactory, e.dbName) : this.backend = new V$(e.indexedDB, e.dbName);
    }
    on(e, n) {
      this.emitter.on(e, n);
    }
    startup() {
      return this.startedUp ? (_e.log("IndexedDBStore.startup: already started"), Promise.resolve()) : (_e.log("IndexedDBStore.startup: connecting to backend"), this.backend.connect(this.onClose).then(() => (_e.log("IndexedDBStore.startup: loading presence events"), this.backend.getUserPresenceEvents())).then((e) => {
        _e.log("IndexedDBStore.startup: processing presence events"), e.forEach((n) => {
          var [r, i] = n;
          if (!this.createUser) throw new Error("`IndexedDBStore.startup` must be called after assigning it to the client, not before!");
          var a = this.createUser(r);
          i && a.setPresenceEvent(new to(i)), this.userModifiedMap[a.userId] = a.getLastModifiedTime(), this.storeUser(a);
        }), this.startedUp = true;
      }));
    }
    destroy() {
      return this.backend.destroy();
    }
    wantsSave() {
      var e = Date.now();
      return e - this.syncTs > RCe;
    }
    save() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      return e || this.wantsSave() ? this.reallySave() : Promise.resolve();
    }
    degradable(e, n) {
      var r = this, i = n ? super[n] : null;
      return me(function* () {
        for (var a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
        try {
          return yield e.call(r, ...s);
        } catch (c) {
          _e.error("IndexedDBStore failure, degrading to MemoryStore", c), r.emitter.emit("degraded", c);
          try {
            _e.log("IndexedDBStore trying to delete degraded data"), yield r.backend.clearDatabase(), _e.log("IndexedDBStore delete after degrading succeeded");
          } catch (d) {
            _e.warn("IndexedDBStore delete after degrading failed", d);
          }
          if (i) return i.call(r, ...s);
        }
      });
    }
    getPendingEvents(e) {
      var n = () => super.getPendingEvents, r = this;
      return me(function* () {
        if (!r.localStorage) return n().call(r, e);
        var i = r.localStorage.getItem(d9(e));
        if (i) try {
          return JSON.parse(i);
        } catch (a) {
          _e.error("Could not parse persisted pending events", a);
        }
        return [];
      })();
    }
    setPendingEvents(e, n) {
      var r = () => super.setPendingEvents, i = this;
      return me(function* () {
        if (!i.localStorage) return r().call(i, e, n);
        n.length > 0 ? i.localStorage.setItem(d9(e), JSON.stringify(n)) : i.localStorage.removeItem(d9(e));
      })();
    }
    saveToDeviceBatches(e) {
      return this.backend.saveToDeviceBatches(e);
    }
    getOldestToDeviceBatch() {
      return this.backend.getOldestToDeviceBatch();
    }
    removeToDeviceBatch(e) {
      return this.backend.removeToDeviceBatch(e);
    }
  }
  function d9(t) {
    return "mx_pending_events_".concat(t);
  }
  var Ac = "crypto.", H$ = Ac + "migration", u9 = Ac + "account", ACe = Ac + "cross_signing_keys", RD = Ac + "inboundgroupsessions/", ICe = Ac + "inboundgroupsessions.withheld/", BCe = Ac + "rooms/", h9 = Ac + "sessionsneedingbackup";
  function m0(t) {
    return Ac + "sessions/" + t;
  }
  function f9(t, e) {
    return RD + t + "/" + e;
  }
  function PCe(t, e) {
    return ICe + t + "/" + e;
  }
  function MCe(t) {
    return BCe + t;
  }
  class vk extends pk {
    static exists(e) {
      for (var n = e.length, r = 0; r < n; r++) {
        var i;
        if ((i = e.key(r)) !== null && i !== void 0 && i.startsWith(Ac)) return true;
      }
      return false;
    }
    constructor(e) {
      super(), this.store = e;
    }
    containsData() {
      var e = this;
      return me(function* () {
        return vk.exists(e.store);
      })();
    }
    getMigrationState() {
      var e = this;
      return me(function* () {
        var n;
        return (n = Sl(e.store, H$)) !== null && n !== void 0 ? n : q1.NOT_STARTED;
      })();
    }
    setMigrationState(e) {
      var n = this;
      return me(function* () {
        Rm(n.store, H$, e);
      })();
    }
    countEndToEndSessions(e, n) {
      for (var r = 0, i = 0; i < this.store.length; ++i) {
        var a = this.store.key(i);
        if (a != null && a.startsWith(m0(""))) {
          var s = Sl(this.store, a);
          r += Object.keys(s ?? {}).length;
        }
      }
      n(r);
    }
    _getEndToEndSessions(e) {
      var n = Sl(this.store, m0(e)), r = {};
      for (var [i, a] of Object.entries(n || {})) typeof a == "string" ? r[i] = {
        session: a
      } : r[i] = a;
      return r;
    }
    getEndToEndSession(e, n, r, i) {
      var a, s = this._getEndToEndSessions(e);
      i((a = s[n]) !== null && a !== void 0 ? a : {});
    }
    getEndToEndSessions(e, n, r) {
      var i;
      r((i = this._getEndToEndSessions(e)) !== null && i !== void 0 ? i : {});
    }
    storeEndToEndSession(e, n, r, i) {
      var a = this._getEndToEndSessions(e) || {};
      a[n] = r, Rm(this.store, m0(e), a);
    }
    getEndToEndSessionsBatch() {
      var e = this;
      return me(function* () {
        for (var n = [], r = 0; r < e.store.length; ++r) {
          var i;
          if ((i = e.store.key(r)) !== null && i !== void 0 && i.startsWith(m0(""))) {
            var a = e.store.key(r).split("/")[1];
            for (var s of Object.values(e._getEndToEndSessions(a))) if (n.push(s), n.length >= K1) return n;
          }
        }
        return n.length === 0 ? null : n;
      })();
    }
    deleteEndToEndSessionsBatch(e) {
      var n = this;
      return me(function* () {
        for (var { deviceKey: r, sessionId: i } of e) {
          var a = n._getEndToEndSessions(r) || {};
          delete a[i], Object.keys(a).length === 0 ? n.store.removeItem(m0(r)) : Rm(n.store, m0(r), a);
        }
      })();
    }
    getEndToEndInboundGroupSession(e, n, r, i) {
      i(Sl(this.store, f9(e, n)), Sl(this.store, PCe(e, n)));
    }
    storeEndToEndInboundGroupSession(e, n, r, i) {
      Rm(this.store, f9(e, n), r);
    }
    countEndToEndInboundGroupSessions() {
      var e = this;
      return me(function* () {
        for (var n = 0, r = 0; r < e.store.length; ++r) {
          var i = e.store.key(r);
          i != null && i.startsWith(RD) && (n += 1);
        }
        return n;
      })();
    }
    getEndToEndInboundGroupSessionsBatch() {
      var e = this;
      return me(function* () {
        for (var n = Sl(e.store, h9) || {}, r = [], i = 0; i < e.store.length; ++i) {
          var a = e.store.key(i);
          if (a != null && a.startsWith(RD)) {
            var s = a.slice(RD.length);
            if (r.push({
              senderKey: s.slice(0, 43),
              sessionId: s.slice(44),
              sessionData: Sl(e.store, a),
              needsBackup: s in n
            }), r.length >= K1) return r;
          }
        }
        return r.length === 0 ? null : r;
      })();
    }
    deleteEndToEndInboundGroupSessionsBatch(e) {
      var n = this;
      return me(function* () {
        for (var { senderKey: r, sessionId: i } of e) {
          var a = f9(r, i);
          n.store.removeItem(a);
        }
      })();
    }
    getEndToEndRooms(e, n) {
      for (var r = {}, i = MCe(""), a = 0; a < this.store.length; ++a) {
        var s = this.store.key(a);
        if (s != null && s.startsWith(i)) {
          var l = s.slice(i.length);
          r[l] = Sl(this.store, s);
        }
      }
      n(r);
    }
    markSessionsNeedingBackup(e) {
      var n = Sl(this.store, h9) || {};
      for (var r of e) n[r.senderKey + "/" + r.sessionId] = true;
      return Rm(this.store, h9, n), Promise.resolve();
    }
    deleteAllData() {
      return this.store.removeItem(u9), Promise.resolve();
    }
    getAccount(e, n) {
      var r = Sl(this.store, u9);
      n(r);
    }
    storeAccount(e, n) {
      Rm(this.store, u9, n);
    }
    getCrossSigningKeys(e, n) {
      var r = Sl(this.store, ACe);
      n(r);
    }
    getSecretStorePrivateKey(e, n, r) {
      var i = Sl(this.store, Ac + "ssss_cache.".concat(r));
      n(i);
    }
    storeSecretStorePrivateKey(e, n, r) {
      Rm(this.store, Ac + "ssss_cache.".concat(n), r);
    }
    doTxn(e, n, r) {
      return Promise.resolve(r(null));
    }
  }
  function Sl(t, e) {
    try {
      return JSON.parse(t.getItem(e));
    } catch (n) {
      _e.log("Error: Failed to get key %s: %s", e, n.message), _e.log(n.stack);
    }
    return null;
  }
  function Rm(t, e, n) {
    t.setItem(e, JSON.stringify(n));
  }
  let OCe = class {
    constructor(e) {
      this.db = e, $(this, "nextTxnId", 0), e.onversionchange = () => {
        _e.log("versionchange for indexeddb ".concat(this.db.name, ": closing")), e.close();
      };
    }
    containsData() {
      return me(function* () {
        throw Error("Not implemented for Backend");
      })();
    }
    startup() {
      var e = this;
      return me(function* () {
        return e;
      })();
    }
    deleteAllData() {
      return me(function* () {
        throw Error("This is not implemented, call IDBFactory::deleteDatabase(dbName) instead.");
      })();
    }
    getMigrationState() {
      var e = this;
      return me(function* () {
        var n = q1.NOT_STARTED;
        return yield e.doTxn("readonly", [
          Ur.STORE_ACCOUNT
        ], (r) => {
          var i = r.objectStore(Ur.STORE_ACCOUNT), a = i.get(bA);
          a.onsuccess = () => {
            var s;
            n = (s = a.result) !== null && s !== void 0 ? s : q1.NOT_STARTED;
          };
        }), n;
      })();
    }
    setMigrationState(e) {
      var n = this;
      return me(function* () {
        yield n.doTxn("readwrite", [
          Ur.STORE_ACCOUNT
        ], (r) => {
          var i = r.objectStore(Ur.STORE_ACCOUNT);
          i.put(e, bA);
        });
      })();
    }
    getAccount(e, n) {
      var r = e.objectStore("account"), i = r.get("-");
      i.onsuccess = function() {
        try {
          n(i.result || null);
        } catch (a) {
          ws(e, a);
        }
      };
    }
    storeAccount(e, n) {
      var r = e.objectStore("account");
      r.put(n, "-");
    }
    getCrossSigningKeys(e, n) {
      var r = e.objectStore("account"), i = r.get("crossSigningKeys");
      i.onsuccess = function() {
        try {
          n(i.result || null);
        } catch (a) {
          ws(e, a);
        }
      };
    }
    getSecretStorePrivateKey(e, n, r) {
      var i = e.objectStore("account"), a = i.get("ssss_cache:".concat(r));
      a.onsuccess = function() {
        try {
          n(a.result || null);
        } catch (s) {
          ws(e, s);
        }
      };
    }
    storeSecretStorePrivateKey(e, n, r) {
      var i = e.objectStore("account");
      i.put(r, "ssss_cache:".concat(n));
    }
    countEndToEndSessions(e, n) {
      var r = e.objectStore("sessions"), i = r.count();
      i.onsuccess = function() {
        try {
          n(i.result);
        } catch (a) {
          ws(e, a);
        }
      };
    }
    getEndToEndSessions(e, n, r) {
      var i = n.objectStore("sessions"), a = i.index("deviceKey"), s = a.openCursor(e), l = {};
      s.onsuccess = function() {
        var c = s.result;
        if (c) l[c.value.sessionId] = {
          session: c.value.session,
          lastReceivedMessageTs: c.value.lastReceivedMessageTs
        }, c.continue();
        else try {
          r(l);
        } catch (d) {
          ws(n, d);
        }
      };
    }
    getEndToEndSession(e, n, r, i) {
      var a = r.objectStore("sessions"), s = a.get([
        e,
        n
      ]);
      s.onsuccess = function() {
        try {
          s.result ? i({
            session: s.result.session,
            lastReceivedMessageTs: s.result.lastReceivedMessageTs
          }) : i(null);
        } catch (l) {
          ws(r, l);
        }
      };
    }
    storeEndToEndSession(e, n, r, i) {
      var a = i.objectStore("sessions");
      a.put({
        deviceKey: e,
        sessionId: n,
        session: r.session,
        lastReceivedMessageTs: r.lastReceivedMessageTs
      });
    }
    getEndToEndSessionsBatch() {
      var e = this;
      return me(function* () {
        var n = [];
        return yield e.doTxn("readonly", [
          Ur.STORE_SESSIONS
        ], (r) => {
          var i = r.objectStore(Ur.STORE_SESSIONS), a = i.openCursor();
          a.onsuccess = function() {
            try {
              var s = a.result;
              s && (n.push(s.value), n.length < K1 && s.continue());
            } catch (l) {
              ws(r, l);
            }
          };
        }), n.length === 0 ? null : n;
      })();
    }
    deleteEndToEndSessionsBatch(e) {
      var n = this;
      return me(function* () {
        yield n.doTxn("readwrite", [
          Ur.STORE_SESSIONS
        ], (function() {
          var r = me(function* (i) {
            try {
              var a = i.objectStore(Ur.STORE_SESSIONS), s = function* () {
                var u = a.delete([
                  l,
                  c
                ]);
                yield new Promise((h) => {
                  u.onsuccess = h;
                });
              };
              for (var { deviceKey: l, sessionId: c } of e) yield* s();
            } catch (d) {
              ws(i, d);
            }
          });
          return function(i) {
            return r.apply(this, arguments);
          };
        })());
      })();
    }
    getEndToEndInboundGroupSession(e, n, r, i) {
      var a = false, s = false, l = r.objectStore("inbound_group_sessions"), c = l.get([
        e,
        n
      ]);
      c.onsuccess = function() {
        try {
          c.result ? a = c.result.session : a = null, s !== false && i(a, s);
        } catch (h) {
          ws(r, h);
        }
      };
      var d = r.objectStore("inbound_group_sessions_withheld"), u = d.get([
        e,
        n
      ]);
      u.onsuccess = function() {
        try {
          u.result ? s = u.result.session : s = null, a !== false && i(a, s);
        } catch (h) {
          ws(r, h);
        }
      };
    }
    storeEndToEndInboundGroupSession(e, n, r, i) {
      var a = i.objectStore("inbound_group_sessions");
      a.put({
        senderCurve25519Key: e,
        sessionId: n,
        session: r
      });
    }
    countEndToEndInboundGroupSessions() {
      var e = this;
      return me(function* () {
        var n = 0;
        return yield e.doTxn("readonly", [
          Ur.STORE_INBOUND_GROUP_SESSIONS
        ], (r) => {
          var i = r.objectStore(Ur.STORE_INBOUND_GROUP_SESSIONS), a = i.count();
          a.onsuccess = () => {
            n = a.result;
          };
        }), n;
      })();
    }
    getEndToEndInboundGroupSessionsBatch() {
      var e = this;
      return me(function* () {
        var n = [];
        return yield e.doTxn("readonly", [
          Ur.STORE_INBOUND_GROUP_SESSIONS,
          Ur.STORE_BACKUP
        ], (r) => {
          var i = r.objectStore(Ur.STORE_INBOUND_GROUP_SESSIONS), a = r.objectStore(Ur.STORE_BACKUP), s = i.openCursor();
          s.onsuccess = function() {
            try {
              var l = s.result;
              if (l) {
                var c = a.get(l.key);
                c.onsuccess = () => {
                  n.push({
                    senderKey: l.value.senderCurve25519Key,
                    sessionId: l.value.sessionId,
                    sessionData: l.value.session,
                    needsBackup: c.result !== void 0
                  }), n.length < K1 && l.continue();
                };
              }
            } catch (d) {
              ws(r, d);
            }
          };
        }), n.length === 0 ? null : n;
      })();
    }
    deleteEndToEndInboundGroupSessionsBatch(e) {
      var n = this;
      return me(function* () {
        yield n.doTxn("readwrite", [
          Ur.STORE_INBOUND_GROUP_SESSIONS
        ], (function() {
          var r = me(function* (i) {
            try {
              var a = i.objectStore(Ur.STORE_INBOUND_GROUP_SESSIONS), s = function* () {
                var u = a.delete([
                  l,
                  c
                ]);
                yield new Promise((h) => {
                  u.onsuccess = h;
                });
              };
              for (var { senderKey: l, sessionId: c } of e) yield* s();
            } catch (d) {
              ws(i, d);
            }
          });
          return function(i) {
            return r.apply(this, arguments);
          };
        })());
      })();
    }
    getEndToEndDeviceData(e, n) {
      var r = e.objectStore("device_data"), i = r.get("-");
      i.onsuccess = function() {
        try {
          n(i.result || null);
        } catch (a) {
          ws(e, a);
        }
      };
    }
    getEndToEndRooms(e, n) {
      var r = {}, i = e.objectStore("rooms"), a = i.openCursor();
      a.onsuccess = function() {
        var s = a.result;
        if (s) r[s.key] = s.value, s.continue();
        else try {
          n(r);
        } catch (l) {
          ws(e, l);
        }
      };
    }
    markSessionsNeedingBackup(e, n) {
      var r = this;
      return me(function* () {
        n || (n = r.db.transaction("sessions_needing_backup", "readwrite"));
        var i = n.objectStore("sessions_needing_backup");
        yield Promise.all(e.map((a) => new Promise((s, l) => {
          var c = i.put({
            senderCurve25519Key: a.senderKey,
            sessionId: a.sessionId
          });
          c.onsuccess = s, c.onerror = l;
        })));
      })();
    }
    doTxn(e, n, r) {
      var i = this.db.transaction(n, e), a = zCe(i), s = r(i);
      return a.then(() => s);
    }
  };
  var Lre = [
    (t) => {
      NCe(t);
    },
    (t) => {
      t.createObjectStore("account");
    },
    (t) => {
      var e = t.createObjectStore("sessions", {
        keyPath: [
          "deviceKey",
          "sessionId"
        ]
      });
      e.createIndex("deviceKey", "deviceKey");
    },
    (t) => {
      t.createObjectStore("inbound_group_sessions", {
        keyPath: [
          "senderCurve25519Key",
          "sessionId"
        ]
      });
    },
    (t) => {
      t.createObjectStore("device_data");
    },
    (t) => {
      t.createObjectStore("rooms");
    },
    (t) => {
      t.createObjectStore("sessions_needing_backup", {
        keyPath: [
          "senderCurve25519Key",
          "sessionId"
        ]
      });
    },
    (t) => {
      t.createObjectStore("inbound_group_sessions_withheld", {
        keyPath: [
          "senderCurve25519Key",
          "sessionId"
        ]
      });
    },
    (t) => {
      var e = t.createObjectStore("session_problems", {
        keyPath: [
          "deviceKey",
          "time"
        ]
      });
      e.createIndex("deviceKey", "deviceKey"), t.createObjectStore("notified_error_devices", {
        keyPath: [
          "userId",
          "deviceId"
        ]
      });
    },
    (t) => {
      t.createObjectStore("shared_history_inbound_group_sessions", {
        keyPath: [
          "roomId"
        ]
      });
    },
    (t) => {
      t.createObjectStore("parked_shared_history", {
        keyPath: [
          "roomId"
        ]
      });
    }
  ], Nre = Lre.length;
  function LCe(t, e) {
    _e.log("Upgrading IndexedDBCryptoStore from version ".concat(e) + " to ".concat(Nre)), Lre.forEach((n, r) => {
      e <= r && n(t);
    });
  }
  function NCe(t) {
    var e = t.createObjectStore("outgoingRoomKeyRequests", {
      keyPath: "requestId"
    });
    e.createIndex("session", [
      "requestBody.room_id",
      "requestBody.session_id"
    ]), e.createIndex("state", "state");
  }
  function ws(t, e) {
    t._mx_abortexception = e;
    try {
      t.abort();
    } catch {
    }
  }
  function zCe(t) {
    return new Promise((e, n) => {
      t.oncomplete = () => {
        t._mx_abortexception !== void 0 && n(t._mx_abortexception), e(null);
      }, t.onerror = (r) => {
        t._mx_abortexception !== void 0 ? n(t._mx_abortexception) : (_e.log("Error performing indexeddb txn", r), n(t.error));
      }, t.onabort = (r) => {
        t._mx_abortexception !== void 0 ? n(t._mx_abortexception) : (_e.log("Error performing indexeddb txn", r), n(t.error));
      };
    });
  }
  Ur = class {
    static exists(e, n) {
      return Pre(e, n);
    }
    static existsAndIsNotMigrated(e, n) {
      return new Promise((r, i) => {
        var a = true, s = e.open(n);
        s.onupgradeneeded = () => {
          a = false;
        }, s.onblocked = () => i(s.error), s.onsuccess = () => {
          var l = s.result;
          if (!a) l.close(), e.deleteDatabase(n), r(false);
          else {
            var c = l.transaction([
              Ur.STORE_ACCOUNT
            ], "readonly"), d = c.objectStore(Ur.STORE_ACCOUNT), u = d.get(bA);
            u.onsuccess = () => {
              var h, f = (h = u.result) !== null && h !== void 0 ? h : q1.NOT_STARTED;
              r(f === q1.NOT_STARTED);
            }, u.onerror = () => {
              i(u.error);
            }, l.close();
          }
        }, s.onerror = () => i(s.error);
      });
    }
    constructor(e, n) {
      this.indexedDB = e, this.dbName = n, $(this, "backendPromise", void 0), $(this, "backend", void 0);
    }
    containsData() {
      var e = this;
      return me(function* () {
        return Ur.exists(e.indexedDB, e.dbName);
      })();
    }
    startup() {
      return this.backendPromise ? this.backendPromise : (this.backendPromise = new Promise((e, n) => {
        if (!this.indexedDB) {
          n(new Error("no indexeddb support available"));
          return;
        }
        _e.log("connecting to indexeddb ".concat(this.dbName));
        var r = this.indexedDB.open(this.dbName, Nre);
        r.onupgradeneeded = (i) => {
          var a = r.result, s = i.oldVersion;
          LCe(a, s);
        }, r.onblocked = () => {
          _e.log("can't yet open IndexedDBCryptoStore because it is open elsewhere");
        }, r.onerror = (i) => {
          _e.log("Error connecting to indexeddb", i), n(r.error);
        }, r.onsuccess = () => {
          var i = r.result;
          _e.log("connected to indexeddb ".concat(this.dbName)), e(new OCe(i));
        };
      }).then((e) => e.doTxn("readonly", [
        Ur.STORE_INBOUND_GROUP_SESSIONS,
        Ur.STORE_INBOUND_GROUP_SESSIONS_WITHHELD
      ], (n) => {
        e.getEndToEndInboundGroupSession("", "", n, () => {
        });
      }).then(() => e)).catch((e) => {
        if (e.name === "VersionError") throw _e.warn("Crypto DB is too new for us to use!", e), new lB(sB.TooNew);
        _e.warn("unable to connect to indexeddb ".concat(this.dbName) + ": falling back to localStorage store: ".concat(e));
        try {
          if (!(globalThis.localStorage instanceof Storage)) throw new Error("localStorage is not available");
          return new vk(globalThis.localStorage);
        } catch (n) {
          return _e.warn("Unable to open localStorage: falling back to in-memory store: ".concat(n)), new pk();
        }
      }).then((e) => (this.backend = e, e)), this.backendPromise);
    }
    deleteAllData() {
      return new Promise((e, n) => {
        if (!this.indexedDB) {
          n(new Error("no indexeddb support available"));
          return;
        }
        _e.log("Removing indexeddb instance: ".concat(this.dbName));
        var r = this.indexedDB.deleteDatabase(this.dbName);
        r.onblocked = () => {
          _e.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere");
        }, r.onerror = (i) => {
          _e.log("Error deleting data from indexeddb", i), n(r.error);
        }, r.onsuccess = () => {
          _e.log("Removed indexeddb instance: ".concat(this.dbName)), e();
        };
      }).catch((e) => {
        _e.warn("unable to delete IndexedDBCryptoStore: ".concat(e));
      });
    }
    getMigrationState() {
      return this.backend.getMigrationState();
    }
    setMigrationState(e) {
      return this.backend.setMigrationState(e);
    }
    getAccount(e, n) {
      this.backend.getAccount(e, n);
    }
    storeAccount(e, n) {
      this.backend.storeAccount(e, n);
    }
    getCrossSigningKeys(e, n) {
      this.backend.getCrossSigningKeys(e, n);
    }
    getSecretStorePrivateKey(e, n, r) {
      this.backend.getSecretStorePrivateKey(e, n, r);
    }
    storeSecretStorePrivateKey(e, n, r) {
      this.backend.storeSecretStorePrivateKey(e, n, r);
    }
    countEndToEndSessions(e, n) {
      this.backend.countEndToEndSessions(e, n);
    }
    getEndToEndSession(e, n, r, i) {
      this.backend.getEndToEndSession(e, n, r, i);
    }
    getEndToEndSessions(e, n, r) {
      this.backend.getEndToEndSessions(e, n, r);
    }
    storeEndToEndSession(e, n, r, i) {
      this.backend.storeEndToEndSession(e, n, r, i);
    }
    countEndToEndInboundGroupSessions() {
      return this.backend.countEndToEndInboundGroupSessions();
    }
    getEndToEndSessionsBatch() {
      return this.backend.getEndToEndSessionsBatch();
    }
    deleteEndToEndSessionsBatch(e) {
      return this.backend.deleteEndToEndSessionsBatch(e);
    }
    getEndToEndInboundGroupSession(e, n, r, i) {
      this.backend.getEndToEndInboundGroupSession(e, n, r, i);
    }
    storeEndToEndInboundGroupSession(e, n, r, i) {
      this.backend.storeEndToEndInboundGroupSession(e, n, r, i);
    }
    getEndToEndInboundGroupSessionsBatch() {
      return this.backend.getEndToEndInboundGroupSessionsBatch();
    }
    deleteEndToEndInboundGroupSessionsBatch(e) {
      return this.backend.deleteEndToEndInboundGroupSessionsBatch(e);
    }
    getEndToEndRooms(e, n) {
      this.backend.getEndToEndRooms(e, n);
    }
    markSessionsNeedingBackup(e, n) {
      return this.backend.markSessionsNeedingBackup(e, n);
    }
    doTxn(e, n, r, i) {
      return this.backend.doTxn(e, n, r, i);
    }
  };
  $(Ur, "STORE_ACCOUNT", "account");
  $(Ur, "STORE_SESSIONS", "sessions");
  $(Ur, "STORE_INBOUND_GROUP_SESSIONS", "inbound_group_sessions");
  $(Ur, "STORE_INBOUND_GROUP_SESSIONS_WITHHELD", "inbound_group_sessions_withheld");
  $(Ur, "STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS", "shared_history_inbound_group_sessions");
  $(Ur, "STORE_PARKED_SHARED_HISTORY", "parked_shared_history");
  $(Ur, "STORE_DEVICE_DATA", "device_data");
  $(Ur, "STORE_ROOMS", "rooms");
  $(Ur, "STORE_BACKUP", "sessions_needing_backup");
  var UCe = (function(t) {
    return t.Email = "email", t.Phone = "msisdn", t;
  })({}), VCe = new xo("delegated_oidc_compatibility", "org.matrix.msc3824.delegated_oidc_compatibility"), HCe = (function(t) {
    return t.Gitlab = "gitlab", t.Github = "github", t.Apple = "apple", t.Google = "google", t.Facebook = "facebook", t.Twitter = "twitter", t;
  })({}), kB = (function(t) {
    return t.LOGIN = "login", t.REGISTER = "register", t;
  })({}), $Ce = "us.cloke.msc4175.tz";
  class WCe {
    constructor(e) {
      $(this, "relations", void 0), this.relations = e.filter((n) => !!n);
    }
    getRelations() {
      return this.relations.reduce((e, n) => [
        ...e,
        ...n.getRelations()
      ], []);
    }
    on(e, n) {
      this.relations.forEach((r) => r.on(e, n));
    }
    off(e, n) {
      this.relations.forEach((r) => r.off(e, n));
    }
  }
  var qCe = (function(t) {
    return t.Global = "Global", t.SetItemError = "setItem", t.GetItemError = "getItem", t.RemoveItemError = "removeItem", t.ClearError = "clear", t.QuotaExceededError = "QuotaExceededError", t;
  })({});
  class KCe extends ji {
  }
  var GCe = new KCe(), zre = () => new pk();
  function Ure(t) {
    zre = t;
  }
  function Vre(t) {
    var e, n, r;
    return t.store = (e = t.store) !== null && e !== void 0 ? e : new FB({
      localStorage: globalThis.localStorage
    }), t.scheduler = (n = t.scheduler) !== null && n !== void 0 ? n : new U1(), t.cryptoStore = (r = t.cryptoStore) !== null && r !== void 0 ? r : zre(), t;
  }
  function Zf(t) {
    return new gk(Vre(t));
  }
  function YCe(t, e, n, r) {
    var i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
    return new Ire(t, e, n, Vre(r), i);
  }
  const ZCe = Object.freeze(Object.defineProperty({
    __proto__: null,
    AuthType: sr,
    AutoDiscovery: ua,
    AutoDiscoveryAction: Qs,
    AutoDiscoveryError: Jl,
    Beacon: Rne,
    BeaconEvent: Ii,
    CallEvent: xr,
    CallFeedEvent: gd,
    Category: yu,
    ClientEvent: jt,
    ClientPrefix: zo,
    ClientStoppedError: bDe,
    ConditionKind: di,
    ConditionOperator: $we,
    ConnectionError: vp,
    ContentHelpers: yxe,
    DELEGATED_OIDC_COMPATIBILITY: VCe,
    DEVICE_CODE_SCOPE: iCe,
    DMMemberCountCondition: Wwe,
    DebugLogger: W7,
    Device: CCe,
    DeviceVerification: Bre,
    Direction: Tn,
    DuplicateStrategy: l1,
    EVENT_VISIBILITY_CHANGE_TYPE: ug,
    EventEmitterEvents: Kte,
    EventStatus: Vn,
    EventTimeline: en,
    EventTimelineSet: H0,
    EventType: ce,
    FILTER_RELATED_BY_REL_TYPES: a1,
    FILTER_RELATED_BY_SENDERS: o1,
    FeatureSupport: Pa,
    Filter: ns,
    GET_LOGIN_TOKEN_CAPABILITY: dCe,
    GroupCall: iB,
    GroupCallEvent: bi,
    GroupCallIntent: Jne,
    GroupCallState: Ji,
    GroupCallStatsReportEvent: hy,
    GroupCallType: dk,
    GuestAccess: j2,
    HTTPError: Vg,
    HistoryVisibility: ll,
    HttpApiEvent: I2,
    IdentityPrefix: _u,
    IdentityProviderBrand: HCe,
    IndexedDBCryptoStore: Ur,
    IndexedDBStore: EB,
    InteractiveAuth: hCe,
    InvalidCryptoStoreError: lB,
    InvalidCryptoStoreState: sB,
    JoinRule: kn,
    KNOWN_SAFE_ROOM_VERSION: $ne,
    KeySignatureUploadError: yDe,
    KnownMembership: Ht,
    LOCAL_NOTIFICATION_SETTINGS_PREFIX: fne,
    LocalStorageCryptoStore: vk,
    LocalStorageErrors: qCe,
    LocationAssetType: N1,
    MAIN_ROOM_TIMELINE: Kb,
    MAXIMUM_MATRIX_VERSION: Xwe,
    MINIMUM_MATRIX_VERSION: Jwe,
    MSC3912_RELATION_BASED_REDACTIONS_PROP: qR,
    M_ASSET: Wb,
    M_BEACON: XR,
    M_BEACON_INFO: G7,
    M_HTML: fxe,
    M_LOCATION: qb,
    M_MESSAGE: hxe,
    M_POLL_END: JC,
    M_POLL_KIND_DISCLOSED: Cxe,
    M_POLL_KIND_UNDISCLOSED: Exe,
    M_POLL_RESPONSE: A2,
    M_POLL_START: kxe,
    M_TEXT: q7,
    M_TIMESTAMP: Yf,
    M_TOPIC: K7,
    MatrixClient: gk,
    MatrixError: Un,
    MatrixEvent: to,
    MatrixEventEvent: or,
    MatrixHttpApi: Une,
    MatrixScheduler: U1,
    MediaHandlerEvent: Ym,
    MediaPrefix: c1,
    MemoryCryptoStore: pk,
    MemoryStore: FB,
    Method: rt,
    MsgType: Jn,
    NoAuthFlowFoundError: Dre,
    NotificationCountType: ir,
    OidcError: za,
    OidcTokenRefresher: aCe,
    PUSHER_DEVICE_ID: G3e,
    PUSHER_ENABLED: KR,
    PendingEventOrdering: $1,
    Poll: Bne,
    PollEvent: tf,
    Preset: Yb,
    ProfileKeyMSC4175Timezone: $Ce,
    PushRuleActionName: Rc,
    PushRuleKind: Or,
    REFERENCE_RELATION: yne,
    ReceiptType: ia,
    RelatedRelations: WCe,
    RelationType: Xn,
    Relations: Y7,
    RelationsEvent: Ed,
    RestrictedAllowType: ak,
    Room: lk,
    RoomCreateTypeField: qC,
    RoomEvent: mt,
    RoomMember: S2,
    RoomMemberEvent: Ui,
    RoomNameType: md,
    RoomState: T2,
    RoomStateEvent: qn,
    RoomSummary: Ine,
    RoomType: Bo,
    RoomVersionStability: Vne,
    RoomWidgetClient: Ire,
    RoomWidgetClientEvent: TD,
    RuleId: Yr,
    SERVICE_TYPES: cA,
    SSOAction: kB,
    STABLE_MSC4133_EXTENDED_PROFILES: xre,
    SUPPORTED_MATRIX_VERSIONS: P2,
    SearchOrderBy: M2,
    SearchResult: uk,
    SecretStorage: vDe,
    ServerCapabilities: Hne,
    SetPresence: tB,
    SlidingSyncEvent: nl,
    StatsReport: Au,
    SyncAccumulator: Cre,
    SyncState: Nn,
    THREAD_RELATION_TYPE: pi,
    Thread: Ei,
    ThreadEvent: jr,
    ThreadFilterType: xc,
    ThreepidMedium: UCe,
    TimelineIndex: xA,
    TimelineWindow: kCe,
    ToDeviceMessageId: ok,
    TokenRefreshError: Lne,
    TokenRefreshLogoutError: X7,
    TweakName: z1,
    TypedEventEmitter: ji,
    UNSIGNED_MEMBERSHIP_FIELD: mne,
    UNSIGNED_THREAD_ID_FIELD: KC,
    UNSTABLE_ELEMENT_FUNCTIONAL_USERS: hne,
    UNSTABLE_MSC2666_MUTUAL_ROOMS: _re,
    UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS: yre,
    UNSTABLE_MSC2666_SHARED_ROOMS: vre,
    UNSTABLE_MSC2716_MARKER: une,
    UNSTABLE_MSC3088_ENABLED: $R,
    UNSTABLE_MSC3088_PURPOSE: HR,
    UNSTABLE_MSC3089_BRANCH: Su,
    UNSTABLE_MSC3089_LEAF: dne,
    UNSTABLE_MSC3089_TREE_SUBTYPE: WR,
    UNSTABLE_MSC3852_LAST_SEEN_UA: cCe,
    UNSTABLE_MSC4133_EXTENDED_PROFILES: bre,
    UNSTABLE_MSC4140_DELAYED_EVENTS: kd,
    UnsupportedDelayedEventsEndpointError: Ff,
    UpdateDelayedEventAction: Ny,
    User: Md,
    UserEvent: Vo,
    Visibility: s1,
    anySignal: Nne,
    calculateRetryBackoff: zne,
    completeAuthorizationCodeGrant: rCe,
    createClient: Zf,
    createNewMatrixCall: B2,
    createRoomWidgetClient: YCe,
    decodeBase64: wg,
    decodeIdToken: mre,
    determineFeatureSupport: CD,
    discoverAndValidateOIDCIssuerWellKnown: gB,
    encodeBase64: Py,
    encodeUnpaddedBase64: Yne,
    encodeUnpaddedBase64Url: ck,
    fixNotificationCountOnDecryption: wre,
    generateAuthorizationParams: QDe,
    generateAuthorizationUrl: eCe,
    generateOidcAuthorizationUrl: tCe,
    generateScope: mk,
    getBeaconInfoIdentifier: ZC,
    getHttpUriForMxc: rk,
    inMainTimelineForReceipt: N2,
    isDmMemberCountCondition: qwe,
    isEventTypeSame: mxe,
    isPollEvent: Pne,
    isTimestampInDuration: JR,
    localStorageErrorsEventsEmitter: GCe,
    parseErrorResponse: Q7,
    registerOidcClient: oCe,
    retryNetworkOperation: eA,
    safeGetRetryAfterMs: J7,
    setCryptoStoreFactory: Ure,
    threadFilterTypeToFilter: vne,
    threadIdForReceipt: W1,
    timeoutSignal: sk,
    validateAuthMetadata: mB,
    validateAuthMetadataAndKeys: pB,
    validateBearerTokenResponse: Fre,
    validateIdToken: gre,
    validateStoredUserState: pre
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  JCe = (function(t) {
    return t.Sas = "m.sas.v1", t.ShowQrCode = "m.qr_code.show.v1", t.ScanQrCode = "m.qr_code.scan.v1", t.Reciprocate = "m.reciprocate.v1", t;
  })({});
  function XCe(t) {
    let e = 0;
    if (t === void 0 || t.length === 0) return e;
    for (let n = 0; n < t.length; n += 1) {
      const r = t.codePointAt(n) ?? 0;
      e = (e << 5) - e + r, e = Math.trunc(e);
    }
    return Math.abs(e);
  }
  function _p(t) {
    return `hsl(${XCe(t) % 360}, 65%, 80%)`;
  }
  const SB = vn(void 0), z2 = vn({}), _k = (t, e) => {
    const n = p.useMemo(() => vn(null, (r, i, a) => {
      const s = {
        ...r(t)
      };
      s[e] = typeof a == "function" ? a(s[e]) : a, i(t, s);
    }), [
      t,
      e
    ]);
    return Fn(n);
  }, Fe = (t, e) => {
    const n = p.useMemo(() => (a) => a[e], [
      e
    ]), r = Ze(jF(t, n)), i = _k(t, e);
    return [
      r,
      i
    ];
  };
  var my = {
    exports: {}
  }, QCe = my.exports, $$;
  function e4e() {
    return $$ || ($$ = 1, (function(t, e) {
      (function(n, r) {
        var i = "1.0.41", a = "", s = "?", l = "function", c = "undefined", d = "object", u = "string", h = "major", f = "model", g = "name", m = "type", v = "vendor", y = "version", w = "architecture", b = "console", j = "mobile", k = "tablet", C = "smarttv", x = "wearable", S = "embedded", T = 500, A = "Amazon", B = "Apple", U = "ASUS", z = "BlackBerry", O = "Browser", M = "Chrome", I = "Edge", N = "Firefox", L = "Google", H = "Honor", V = "Huawei", Z = "Lenovo", Y = "LG", oe = "Microsoft", ue = "Motorola", ie = "Nvidia", de = "OnePlus", ne = "Opera", ae = "OPPO", X = "Samsung", K = "Sharp", G = "Sony", le = "Xiaomi", te = "Zebra", re = "Facebook", he = "Chromium OS", se = "Mac OS", ye = " Browser", we = function(wt, st) {
          var Be = {};
          for (var Re in wt) st[Re] && st[Re].length % 2 === 0 ? Be[Re] = st[Re].concat(wt[Re]) : Be[Re] = wt[Re];
          return Be;
        }, Ee = function(wt) {
          for (var st = {}, Be = 0; Be < wt.length; Be++) st[wt[Be].toUpperCase()] = wt[Be];
          return st;
        }, ke = function(wt, st) {
          return typeof wt === u ? Ne(st).indexOf(Ne(wt)) !== -1 : false;
        }, Ne = function(wt) {
          return wt.toLowerCase();
        }, lt = function(wt) {
          return typeof wt === u ? wt.replace(/[^\d\.]/g, a).split(".")[0] : r;
        }, Rt = function(wt, st) {
          if (typeof wt === u) return wt = wt.replace(/^\s\s*/, a), typeof st === c ? wt : wt.substring(0, T);
        }, We = function(wt, st) {
          for (var Be = 0, Re, Ue, qe, tt, ht, $e; Be < st.length && !ht; ) {
            var Tt = st[Be], zt = st[Be + 1];
            for (Re = Ue = 0; Re < Tt.length && !ht && Tt[Re]; ) if (ht = Tt[Re++].exec(wt), ht) for (qe = 0; qe < zt.length; qe++) $e = ht[++Ue], tt = zt[qe], typeof tt === d && tt.length > 0 ? tt.length === 2 ? typeof tt[1] == l ? this[tt[0]] = tt[1].call(this, $e) : this[tt[0]] = tt[1] : tt.length === 3 ? typeof tt[1] === l && !(tt[1].exec && tt[1].test) ? this[tt[0]] = $e ? tt[1].call(this, $e, tt[2]) : r : this[tt[0]] = $e ? $e.replace(tt[1], tt[2]) : r : tt.length === 4 && (this[tt[0]] = $e ? tt[3].call(this, $e.replace(tt[1], tt[2])) : r) : this[tt] = $e || r;
            Be += 2;
          }
        }, yt = function(wt, st) {
          for (var Be in st) if (typeof st[Be] === d && st[Be].length > 0) {
            for (var Re = 0; Re < st[Be].length; Re++) if (ke(st[Be][Re], wt)) return Be === s ? r : Be;
          } else if (ke(st[Be], wt)) return Be === s ? r : Be;
          return st.hasOwnProperty("*") ? st["*"] : wt;
        }, Xt = {
          "1.0": "/8",
          "1.2": "/1",
          "1.3": "/3",
          "2.0": "/412",
          "2.0.2": "/416",
          "2.0.3": "/417",
          "2.0.4": "/419",
          "?": "/"
        }, nn = {
          ME: "4.90",
          "NT 3.11": "NT3.51",
          "NT 4.0": "NT4.0",
          2e3: "NT 5.0",
          XP: [
            "NT 5.1",
            "NT 5.2"
          ],
          Vista: "NT 6.0",
          7: "NT 6.1",
          8: "NT 6.2",
          "8.1": "NT 6.3",
          10: [
            "NT 6.4",
            "NT 10.0"
          ],
          RT: "ARM"
        }, bt = {
          browser: [
            [
              /\b(?:crmo|crios)\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Chrome"
              ]
            ],
            [
              /edg(?:e|ios|a)?\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Edge"
              ]
            ],
            [
              /(opera mini)\/([-\w\.]+)/i,
              /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
              /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /opios[\/ ]+([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                ne + " Mini"
              ]
            ],
            [
              /\bop(?:rg)?x\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                ne + " GX"
              ]
            ],
            [
              /\bopr\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                ne
              ]
            ],
            [
              /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Baidu"
              ]
            ],
            [
              /\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i
            ],
            [
              y,
              [
                g,
                "Maxthon"
              ]
            ],
            [
              /(kindle)\/([\w\.]+)/i,
              /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,
              /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,
              /(?:ms|\()(ie) ([\w\.]+)/i,
              /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,
              /(heytap|ovi|115)browser\/([\d\.]+)/i,
              /(weibo)__([\d\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /quark(?:pc)?\/([-\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Quark"
              ]
            ],
            [
              /\bddg\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "DuckDuckGo"
              ]
            ],
            [
              /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "UC" + O
              ]
            ],
            [
              /microm.+\bqbcore\/([\w\.]+)/i,
              /\bqbcore\/([\w\.]+).+microm/i,
              /micromessenger\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "WeChat"
              ]
            ],
            [
              /konqueror\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Konqueror"
              ]
            ],
            [
              /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
            ],
            [
              y,
              [
                g,
                "IE"
              ]
            ],
            [
              /ya(?:search)?browser\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Yandex"
              ]
            ],
            [
              /slbrowser\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Smart Lenovo " + O
              ]
            ],
            [
              /(avast|avg)\/([\w\.]+)/i
            ],
            [
              [
                g,
                /(.+)/,
                "$1 Secure " + O
              ],
              y
            ],
            [
              /\bfocus\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                N + " Focus"
              ]
            ],
            [
              /\bopt\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                ne + " Touch"
              ]
            ],
            [
              /coc_coc\w+\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Coc Coc"
              ]
            ],
            [
              /dolfin\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Dolphin"
              ]
            ],
            [
              /coast\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                ne + " Coast"
              ]
            ],
            [
              /miuibrowser\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "MIUI" + ye
              ]
            ],
            [
              /fxios\/([\w\.-]+)/i
            ],
            [
              y,
              [
                g,
                N
              ]
            ],
            [
              /\bqihoobrowser\/?([\w\.]*)/i
            ],
            [
              y,
              [
                g,
                "360"
              ]
            ],
            [
              /\b(qq)\/([\w\.]+)/i
            ],
            [
              [
                g,
                /(.+)/,
                "$1Browser"
              ],
              y
            ],
            [
              /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i
            ],
            [
              [
                g,
                /(.+)/,
                "$1" + ye
              ],
              y
            ],
            [
              /samsungbrowser\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                X + " Internet"
              ]
            ],
            [
              /metasr[\/ ]?([\d\.]+)/i
            ],
            [
              y,
              [
                g,
                "Sogou Explorer"
              ]
            ],
            [
              /(sogou)mo\w+\/([\d\.]+)/i
            ],
            [
              [
                g,
                "Sogou Mobile"
              ],
              y
            ],
            [
              /(electron)\/([\w\.]+) safari/i,
              /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
              /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /(lbbrowser|rekonq)/i,
              /\[(linkedin)app\]/i
            ],
            [
              g
            ],
            [
              /ome\/([\w\.]+) \w* ?(iron) saf/i,
              /ome\/([\w\.]+).+qihu (360)[es]e/i
            ],
            [
              y,
              g
            ],
            [
              /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
            ],
            [
              [
                g,
                re
              ],
              y
            ],
            [
              /(Klarna)\/([\w\.]+)/i,
              /(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
              /(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
              /(daum)apps[\/ ]([\w\.]+)/i,
              /safari (line)\/([\w\.]+)/i,
              /\b(line)\/([\w\.]+)\/iab/i,
              /(alipay)client\/([\w\.]+)/i,
              /(twitter)(?:and| f.+e\/([\w\.]+))/i,
              /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /\bgsa\/([\w\.]+) .*safari\//i
            ],
            [
              y,
              [
                g,
                "GSA"
              ]
            ],
            [
              /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "TikTok"
              ]
            ],
            [
              /headlesschrome(?:\/([\w\.]+)| )/i
            ],
            [
              y,
              [
                g,
                M + " Headless"
              ]
            ],
            [
              / wv\).+(chrome)\/([\w\.]+)/i
            ],
            [
              [
                g,
                M + " WebView"
              ],
              y
            ],
            [
              /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
            ],
            [
              y,
              [
                g,
                "Android " + O
              ]
            ],
            [
              /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i
            ],
            [
              y,
              [
                g,
                "Mobile Safari"
              ]
            ],
            [
              /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i
            ],
            [
              y,
              g
            ],
            [
              /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
            ],
            [
              g,
              [
                y,
                yt,
                Xt
              ]
            ],
            [
              /(webkit|khtml)\/([\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /(navigator|netscape\d?)\/([-\w\.]+)/i
            ],
            [
              [
                g,
                "Netscape"
              ],
              y
            ],
            [
              /(wolvic|librewolf)\/([\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /mobile vr; rv:([\w\.]+)\).+firefox/i
            ],
            [
              y,
              [
                g,
                N + " Reality"
              ]
            ],
            [
              /ekiohf.+(flow)\/([\w\.]+)/i,
              /(swiftfox)/i,
              /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,
              /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
              /(firefox)\/([\w\.]+)/i,
              /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
              /(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
              /\b(links) \(([\w\.]+)/i
            ],
            [
              g,
              [
                y,
                /_/g,
                "."
              ]
            ],
            [
              /(cobalt)\/([\w\.]+)/i
            ],
            [
              g,
              [
                y,
                /master.|lts./,
                ""
              ]
            ]
          ],
          cpu: [
            [
              /\b((amd|x|x86[-_]?|wow|win)64)\b/i
            ],
            [
              [
                w,
                "amd64"
              ]
            ],
            [
              /(ia32(?=;))/i,
              /\b((i[346]|x)86)(pc)?\b/i
            ],
            [
              [
                w,
                "ia32"
              ]
            ],
            [
              /\b(aarch64|arm(v?[89]e?l?|_?64))\b/i
            ],
            [
              [
                w,
                "arm64"
              ]
            ],
            [
              /\b(arm(v[67])?ht?n?[fl]p?)\b/i
            ],
            [
              [
                w,
                "armhf"
              ]
            ],
            [
              /( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i
            ],
            [
              [
                w,
                "arm"
              ]
            ],
            [
              /((ppc|powerpc)(64)?)( mac|;|\))/i
            ],
            [
              [
                w,
                /ower/,
                a,
                Ne
              ]
            ],
            [
              / sun4\w[;\)]/i
            ],
            [
              [
                w,
                "sparc"
              ]
            ],
            [
              /\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i
            ],
            [
              [
                w,
                Ne
              ]
            ]
          ],
          device: [
            [
              /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
            ],
            [
              f,
              [
                v,
                X
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
              /samsung[- ]((?!sm-[lr])[-\w]+)/i,
              /sec-(sgh\w+)/i
            ],
            [
              f,
              [
                v,
                X
              ],
              [
                m,
                j
              ]
            ],
            [
              /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
            ],
            [
              f,
              [
                v,
                B
              ],
              [
                m,
                j
              ]
            ],
            [
              /\((ipad);[-\w\),; ]+apple/i,
              /applecoremedia\/[\w\.]+ \((ipad)/i,
              /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
            ],
            [
              f,
              [
                v,
                B
              ],
              [
                m,
                k
              ]
            ],
            [
              /(macintosh);/i
            ],
            [
              f,
              [
                v,
                B
              ]
            ],
            [
              /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
            ],
            [
              f,
              [
                v,
                K
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i
            ],
            [
              f,
              [
                v,
                H
              ],
              [
                m,
                k
              ]
            ],
            [
              /honor([-\w ]+)[;\)]/i
            ],
            [
              f,
              [
                v,
                H
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i
            ],
            [
              f,
              [
                v,
                V
              ],
              [
                m,
                k
              ]
            ],
            [
              /(?:huawei)([-\w ]+)[;\)]/i,
              /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
            ],
            [
              f,
              [
                v,
                V
              ],
              [
                m,
                j
              ]
            ],
            [
              /oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,
              /\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i
            ],
            [
              [
                f,
                /_/g,
                " "
              ],
              [
                v,
                le
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
              /\b; (\w+) build\/hm\1/i,
              /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
              /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
              /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,
              /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,
              / ([\w ]+) miui\/v?\d/i
            ],
            [
              [
                f,
                /_/g,
                " "
              ],
              [
                v,
                le
              ],
              [
                m,
                j
              ]
            ],
            [
              /; (\w+) bui.+ oppo/i,
              /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
            ],
            [
              f,
              [
                v,
                ae
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(opd2(\d{3}a?))(?: bui|\))/i
            ],
            [
              f,
              [
                v,
                yt,
                {
                  OnePlus: [
                    "304",
                    "403",
                    "203"
                  ],
                  "*": ae
                }
              ],
              [
                m,
                k
              ]
            ],
            [
              /vivo (\w+)(?: bui|\))/i,
              /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
            ],
            [
              f,
              [
                v,
                "Vivo"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(rmx[1-3]\d{3})(?: bui|;|\))/i
            ],
            [
              f,
              [
                v,
                "Realme"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
              /\bmot(?:orola)?[- ](\w*)/i,
              /((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
            ],
            [
              f,
              [
                v,
                ue
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(mz60\d|xoom[2 ]{0,2}) build\//i
            ],
            [
              f,
              [
                v,
                ue
              ],
              [
                m,
                k
              ]
            ],
            [
              /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
            ],
            [
              f,
              [
                v,
                Y
              ],
              [
                m,
                k
              ]
            ],
            [
              /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
              /\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,
              /\blg-?([\d\w]+) bui/i
            ],
            [
              f,
              [
                v,
                Y
              ],
              [
                m,
                j
              ]
            ],
            [
              /(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,
              /lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i
            ],
            [
              f,
              [
                v,
                Z
              ],
              [
                m,
                k
              ]
            ],
            [
              /(nokia) (t[12][01])/i
            ],
            [
              v,
              f,
              [
                m,
                k
              ]
            ],
            [
              /(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,
              /nokia[-_ ]?(([-\w\. ]*))/i
            ],
            [
              [
                f,
                /_/g,
                " "
              ],
              [
                m,
                j
              ],
              [
                v,
                "Nokia"
              ]
            ],
            [
              /(pixel (c|tablet))\b/i
            ],
            [
              f,
              [
                v,
                L
              ],
              [
                m,
                k
              ]
            ],
            [
              /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
            ],
            [
              f,
              [
                v,
                L
              ],
              [
                m,
                j
              ]
            ],
            [
              /droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
            ],
            [
              f,
              [
                v,
                G
              ],
              [
                m,
                j
              ]
            ],
            [
              /sony tablet [ps]/i,
              /\b(?:sony)?sgp\w+(?: bui|\))/i
            ],
            [
              [
                f,
                "Xperia Tablet"
              ],
              [
                v,
                G
              ],
              [
                m,
                k
              ]
            ],
            [
              / (kb2005|in20[12]5|be20[12][59])\b/i,
              /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
            ],
            [
              f,
              [
                v,
                de
              ],
              [
                m,
                j
              ]
            ],
            [
              /(alexa)webm/i,
              /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,
              /(kf[a-z]+)( bui|\)).+silk\//i
            ],
            [
              f,
              [
                v,
                A
              ],
              [
                m,
                k
              ]
            ],
            [
              /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
            ],
            [
              [
                f,
                /(.+)/g,
                "Fire Phone $1"
              ],
              [
                v,
                A
              ],
              [
                m,
                j
              ]
            ],
            [
              /(playbook);[-\w\),; ]+(rim)/i
            ],
            [
              f,
              v,
              [
                m,
                k
              ]
            ],
            [
              /\b((?:bb[a-f]|st[hv])100-\d)/i,
              /\(bb10; (\w+)/i
            ],
            [
              f,
              [
                v,
                z
              ],
              [
                m,
                j
              ]
            ],
            [
              /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
            ],
            [
              f,
              [
                v,
                U
              ],
              [
                m,
                k
              ]
            ],
            [
              / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
            ],
            [
              f,
              [
                v,
                U
              ],
              [
                m,
                j
              ]
            ],
            [
              /(nexus 9)/i
            ],
            [
              f,
              [
                v,
                "HTC"
              ],
              [
                m,
                k
              ]
            ],
            [
              /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
              /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
              /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
            ],
            [
              v,
              [
                f,
                /_/g,
                " "
              ],
              [
                m,
                j
              ]
            ],
            [
              /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i
            ],
            [
              f,
              [
                v,
                "TCL"
              ],
              [
                m,
                k
              ]
            ],
            [
              /(itel) ((\w+))/i
            ],
            [
              [
                v,
                Ne
              ],
              f,
              [
                m,
                yt,
                {
                  tablet: [
                    "p10001l",
                    "w7001"
                  ],
                  "*": "mobile"
                }
              ]
            ],
            [
              /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
            ],
            [
              f,
              [
                v,
                "Acer"
              ],
              [
                m,
                k
              ]
            ],
            [
              /droid.+; (m[1-5] note) bui/i,
              /\bmz-([-\w]{2,})/i
            ],
            [
              f,
              [
                v,
                "Meizu"
              ],
              [
                m,
                j
              ]
            ],
            [
              /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
            ],
            [
              f,
              [
                v,
                "Ulefone"
              ],
              [
                m,
                j
              ]
            ],
            [
              /; (energy ?\w+)(?: bui|\))/i,
              /; energizer ([\w ]+)(?: bui|\))/i
            ],
            [
              f,
              [
                v,
                "Energizer"
              ],
              [
                m,
                j
              ]
            ],
            [
              /; cat (b35);/i,
              /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i
            ],
            [
              f,
              [
                v,
                "Cat"
              ],
              [
                m,
                j
              ]
            ],
            [
              /((?:new )?andromax[\w- ]+)(?: bui|\))/i
            ],
            [
              f,
              [
                v,
                "Smartfren"
              ],
              [
                m,
                j
              ]
            ],
            [
              /droid.+; (a(?:015|06[35]|142p?))/i
            ],
            [
              f,
              [
                v,
                "Nothing"
              ],
              [
                m,
                j
              ]
            ],
            [
              /; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,
              /archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i
            ],
            [
              f,
              [
                v,
                "Archos"
              ],
              [
                m,
                k
              ]
            ],
            [
              /archos ([\w ]+)( b|\))/i,
              /; (ac[3-6]\d\w{2,8})( b|\))/i
            ],
            [
              f,
              [
                v,
                "Archos"
              ],
              [
                m,
                j
              ]
            ],
            [
              /(imo) (tab \w+)/i,
              /(infinix) (x1101b?)/i
            ],
            [
              v,
              f,
              [
                m,
                k
              ]
            ],
            [
              /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,
              /; (hmd|imo) ([\w ]+?)(?: bui|\))/i,
              /(hp) ([\w ]+\w)/i,
              /(microsoft); (lumia[\w ]+)/i,
              /(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,
              /(oppo) ?([\w ]+) bui/i
            ],
            [
              v,
              f,
              [
                m,
                j
              ]
            ],
            [
              /(kobo)\s(ereader|touch)/i,
              /(hp).+(touchpad(?!.+tablet)|tablet)/i,
              /(kindle)\/([\w\.]+)/i,
              /(nook)[\w ]+build\/(\w+)/i,
              /(dell) (strea[kpr\d ]*[\dko])/i,
              /(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
              /(trinity)[- ]*(t\d{3}) bui/i,
              /(gigaset)[- ]+(q\w{1,9}) bui/i,
              /(vodafone) ([\w ]+)(?:\)| bui)/i
            ],
            [
              v,
              f,
              [
                m,
                k
              ]
            ],
            [
              /(surface duo)/i
            ],
            [
              f,
              [
                v,
                oe
              ],
              [
                m,
                k
              ]
            ],
            [
              /droid [\d\.]+; (fp\du?)(?: b|\))/i
            ],
            [
              f,
              [
                v,
                "Fairphone"
              ],
              [
                m,
                j
              ]
            ],
            [
              /(u304aa)/i
            ],
            [
              f,
              [
                v,
                "AT&T"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\bsie-(\w*)/i
            ],
            [
              f,
              [
                v,
                "Siemens"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(rct\w+) b/i
            ],
            [
              f,
              [
                v,
                "RCA"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(venue[\d ]{2,7}) b/i
            ],
            [
              f,
              [
                v,
                "Dell"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(q(?:mv|ta)\w+) b/i
            ],
            [
              f,
              [
                v,
                "Verizon"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
            ],
            [
              f,
              [
                v,
                "Barnes & Noble"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(tm\d{3}\w+) b/i
            ],
            [
              f,
              [
                v,
                "NuVision"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(k88) b/i
            ],
            [
              f,
              [
                v,
                "ZTE"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(nx\d{3}j) b/i
            ],
            [
              f,
              [
                v,
                "ZTE"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(gen\d{3}) b.+49h/i
            ],
            [
              f,
              [
                v,
                "Swiss"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(zur\d{3}) b/i
            ],
            [
              f,
              [
                v,
                "Swiss"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b((zeki)?tb.*\b) b/i
            ],
            [
              f,
              [
                v,
                "Zeki"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b([yr]\d{2}) b/i,
              /\b(dragon[- ]+touch |dt)(\w{5}) b/i
            ],
            [
              [
                v,
                "Dragon Touch"
              ],
              f,
              [
                m,
                k
              ]
            ],
            [
              /\b(ns-?\w{0,9}) b/i
            ],
            [
              f,
              [
                v,
                "Insignia"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b((nxa|next)-?\w{0,9}) b/i
            ],
            [
              f,
              [
                v,
                "NextBook"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
            ],
            [
              [
                v,
                "Voice"
              ],
              f,
              [
                m,
                j
              ]
            ],
            [
              /\b(lvtel\-)?(v1[12]) b/i
            ],
            [
              [
                v,
                "LvTel"
              ],
              f,
              [
                m,
                j
              ]
            ],
            [
              /\b(ph-1) /i
            ],
            [
              f,
              [
                v,
                "Essential"
              ],
              [
                m,
                j
              ]
            ],
            [
              /\b(v(100md|700na|7011|917g).*\b) b/i
            ],
            [
              f,
              [
                v,
                "Envizen"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\b(trio[-\w\. ]+) b/i
            ],
            [
              f,
              [
                v,
                "MachSpeed"
              ],
              [
                m,
                k
              ]
            ],
            [
              /\btu_(1491) b/i
            ],
            [
              f,
              [
                v,
                "Rotor"
              ],
              [
                m,
                k
              ]
            ],
            [
              /((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i
            ],
            [
              f,
              [
                v,
                ie
              ],
              [
                m,
                k
              ]
            ],
            [
              /(sprint) (\w+)/i
            ],
            [
              v,
              f,
              [
                m,
                j
              ]
            ],
            [
              /(kin\.[onetw]{3})/i
            ],
            [
              [
                f,
                /\./g,
                " "
              ],
              [
                v,
                oe
              ],
              [
                m,
                j
              ]
            ],
            [
              /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
            ],
            [
              f,
              [
                v,
                te
              ],
              [
                m,
                k
              ]
            ],
            [
              /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
            ],
            [
              f,
              [
                v,
                te
              ],
              [
                m,
                j
              ]
            ],
            [
              /smart-tv.+(samsung)/i
            ],
            [
              v,
              [
                m,
                C
              ]
            ],
            [
              /hbbtv.+maple;(\d+)/i
            ],
            [
              [
                f,
                /^/,
                "SmartTV"
              ],
              [
                v,
                X
              ],
              [
                m,
                C
              ]
            ],
            [
              /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
            ],
            [
              [
                v,
                Y
              ],
              [
                m,
                C
              ]
            ],
            [
              /(apple) ?tv/i
            ],
            [
              v,
              [
                f,
                B + " TV"
              ],
              [
                m,
                C
              ]
            ],
            [
              /crkey/i
            ],
            [
              [
                f,
                M + "cast"
              ],
              [
                v,
                L
              ],
              [
                m,
                C
              ]
            ],
            [
              /droid.+aft(\w+)( bui|\))/i
            ],
            [
              f,
              [
                v,
                A
              ],
              [
                m,
                C
              ]
            ],
            [
              /(shield \w+ tv)/i
            ],
            [
              f,
              [
                v,
                ie
              ],
              [
                m,
                C
              ]
            ],
            [
              /\(dtv[\);].+(aquos)/i,
              /(aquos-tv[\w ]+)\)/i
            ],
            [
              f,
              [
                v,
                K
              ],
              [
                m,
                C
              ]
            ],
            [
              /(bravia[\w ]+)( bui|\))/i
            ],
            [
              f,
              [
                v,
                G
              ],
              [
                m,
                C
              ]
            ],
            [
              /(mi(tv|box)-?\w+) bui/i
            ],
            [
              f,
              [
                v,
                le
              ],
              [
                m,
                C
              ]
            ],
            [
              /Hbbtv.*(technisat) (.*);/i
            ],
            [
              v,
              f,
              [
                m,
                C
              ]
            ],
            [
              /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
              /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
            ],
            [
              [
                v,
                Rt
              ],
              [
                f,
                Rt
              ],
              [
                m,
                C
              ]
            ],
            [
              /droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i
            ],
            [
              f,
              [
                m,
                C
              ]
            ],
            [
              /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
            ],
            [
              [
                m,
                C
              ]
            ],
            [
              /(ouya)/i,
              /(nintendo) ([wids3utch]+)/i
            ],
            [
              v,
              f,
              [
                m,
                b
              ]
            ],
            [
              /droid.+; (shield)( bui|\))/i
            ],
            [
              f,
              [
                v,
                ie
              ],
              [
                m,
                b
              ]
            ],
            [
              /(playstation \w+)/i
            ],
            [
              f,
              [
                v,
                G
              ],
              [
                m,
                b
              ]
            ],
            [
              /\b(xbox(?: one)?(?!; xbox))[\); ]/i
            ],
            [
              f,
              [
                v,
                oe
              ],
              [
                m,
                b
              ]
            ],
            [
              /\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i
            ],
            [
              f,
              [
                v,
                X
              ],
              [
                m,
                x
              ]
            ],
            [
              /((pebble))app/i,
              /(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i
            ],
            [
              v,
              f,
              [
                m,
                x
              ]
            ],
            [
              /(ow(?:19|20)?we?[1-3]{1,3})/i
            ],
            [
              f,
              [
                v,
                ae
              ],
              [
                m,
                x
              ]
            ],
            [
              /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
            ],
            [
              f,
              [
                v,
                B
              ],
              [
                m,
                x
              ]
            ],
            [
              /(opwwe\d{3})/i
            ],
            [
              f,
              [
                v,
                de
              ],
              [
                m,
                x
              ]
            ],
            [
              /(moto 360)/i
            ],
            [
              f,
              [
                v,
                ue
              ],
              [
                m,
                x
              ]
            ],
            [
              /(smartwatch 3)/i
            ],
            [
              f,
              [
                v,
                G
              ],
              [
                m,
                x
              ]
            ],
            [
              /(g watch r)/i
            ],
            [
              f,
              [
                v,
                Y
              ],
              [
                m,
                x
              ]
            ],
            [
              /droid.+; (wt63?0{2,3})\)/i
            ],
            [
              f,
              [
                v,
                te
              ],
              [
                m,
                x
              ]
            ],
            [
              /droid.+; (glass) \d/i
            ],
            [
              f,
              [
                v,
                L
              ],
              [
                m,
                x
              ]
            ],
            [
              /(pico) (4|neo3(?: link|pro)?)/i
            ],
            [
              v,
              f,
              [
                m,
                x
              ]
            ],
            [
              /; (quest( \d| pro)?)/i
            ],
            [
              f,
              [
                v,
                re
              ],
              [
                m,
                x
              ]
            ],
            [
              /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
            ],
            [
              v,
              [
                m,
                S
              ]
            ],
            [
              /(aeobc)\b/i
            ],
            [
              f,
              [
                v,
                A
              ],
              [
                m,
                S
              ]
            ],
            [
              /(homepod).+mac os/i
            ],
            [
              f,
              [
                v,
                B
              ],
              [
                m,
                S
              ]
            ],
            [
              /windows iot/i
            ],
            [
              [
                m,
                S
              ]
            ],
            [
              /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
            ],
            [
              f,
              [
                m,
                j
              ]
            ],
            [
              /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
            ],
            [
              f,
              [
                m,
                k
              ]
            ],
            [
              /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
            ],
            [
              [
                m,
                k
              ]
            ],
            [
              /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
            ],
            [
              [
                m,
                j
              ]
            ],
            [
              /droid .+?; ([\w\. -]+)( bui|\))/i
            ],
            [
              f,
              [
                v,
                "Generic"
              ]
            ]
          ],
          engine: [
            [
              /windows.+ edge\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                I + "HTML"
              ]
            ],
            [
              /(arkweb)\/([\w\.]+)/i
            ],
            [
              g,
              y
            ],
            [
              /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "Blink"
              ]
            ],
            [
              /(presto)\/([\w\.]+)/i,
              /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,
              /ekioh(flow)\/([\w\.]+)/i,
              /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
              /(icab)[\/ ]([23]\.[\d\.]+)/i,
              /\b(libweb)/i
            ],
            [
              g,
              y
            ],
            [
              /ladybird\//i
            ],
            [
              [
                g,
                "LibWeb"
              ]
            ],
            [
              /rv\:([\w\.]{1,9})\b.+(gecko)/i
            ],
            [
              y,
              g
            ]
          ],
          os: [
            [
              /microsoft (windows) (vista|xp)/i
            ],
            [
              g,
              y
            ],
            [
              /(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i
            ],
            [
              g,
              [
                y,
                yt,
                nn
              ]
            ],
            [
              /windows nt 6\.2; (arm)/i,
              /windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,
              /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
            ],
            [
              [
                y,
                yt,
                nn
              ],
              [
                g,
                "Windows"
              ]
            ],
            [
              /[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,
              /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
              /cfnetwork\/.+darwin/i
            ],
            [
              [
                y,
                /_/g,
                "."
              ],
              [
                g,
                "iOS"
              ]
            ],
            [
              /(mac os x) ?([\w\. ]*)/i,
              /(macintosh|mac_powerpc\b)(?!.+haiku)/i
            ],
            [
              [
                g,
                se
              ],
              [
                y,
                /_/g,
                "."
              ]
            ],
            [
              /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
            ],
            [
              y,
              g
            ],
            [
              /(ubuntu) ([\w\.]+) like android/i
            ],
            [
              [
                g,
                /(.+)/,
                "$1 Touch"
              ],
              y
            ],
            [
              /(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i
            ],
            [
              g,
              y
            ],
            [
              /\(bb(10);/i
            ],
            [
              y,
              [
                g,
                z
              ]
            ],
            [
              /(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i
            ],
            [
              y,
              [
                g,
                "Symbian"
              ]
            ],
            [
              /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                N + " OS"
              ]
            ],
            [
              /web0s;.+rt(tv)/i,
              /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
            ],
            [
              y,
              [
                g,
                "webOS"
              ]
            ],
            [
              /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
            ],
            [
              y,
              [
                g,
                "watchOS"
              ]
            ],
            [
              /crkey\/([\d\.]+)/i
            ],
            [
              y,
              [
                g,
                M + "cast"
              ]
            ],
            [
              /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
            ],
            [
              [
                g,
                he
              ],
              y
            ],
            [
              /panasonic;(viera)/i,
              /(netrange)mmh/i,
              /(nettv)\/(\d+\.[\w\.]+)/i,
              /(nintendo|playstation) ([wids345portablevuch]+)/i,
              /(xbox); +xbox ([^\);]+)/i,
              /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
              /(mint)[\/\(\) ]?(\w*)/i,
              /(mageia|vectorlinux)[; ]/i,
              /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
              /(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,
              /(gnu) ?([\w\.]*)/i,
              /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
              /(haiku) (\w+)/i
            ],
            [
              g,
              y
            ],
            [
              /(sunos) ?([\w\.\d]*)/i
            ],
            [
              [
                g,
                "Solaris"
              ],
              y
            ],
            [
              /((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
              /(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
              /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,
              /(unix) ?([\w\.]*)/i
            ],
            [
              g,
              y
            ]
          ]
        }, At = function(wt, st) {
          if (typeof wt === d && (st = wt, wt = r), !(this instanceof At)) return new At(wt, st).getResult();
          var Be = typeof n !== c && n.navigator ? n.navigator : r, Re = wt || (Be && Be.userAgent ? Be.userAgent : a), Ue = Be && Be.userAgentData ? Be.userAgentData : r, qe = st ? we(bt, st) : bt, tt = Be && Be.userAgent == Re;
          return this.getBrowser = function() {
            var ht = {};
            return ht[g] = r, ht[y] = r, We.call(ht, Re, qe.browser), ht[h] = lt(ht[y]), tt && Be && Be.brave && typeof Be.brave.isBrave == l && (ht[g] = "Brave"), ht;
          }, this.getCPU = function() {
            var ht = {};
            return ht[w] = r, We.call(ht, Re, qe.cpu), ht;
          }, this.getDevice = function() {
            var ht = {};
            return ht[v] = r, ht[f] = r, ht[m] = r, We.call(ht, Re, qe.device), tt && !ht[m] && Ue && Ue.mobile && (ht[m] = j), tt && ht[f] == "Macintosh" && Be && typeof Be.standalone !== c && Be.maxTouchPoints && Be.maxTouchPoints > 2 && (ht[f] = "iPad", ht[m] = k), ht;
          }, this.getEngine = function() {
            var ht = {};
            return ht[g] = r, ht[y] = r, We.call(ht, Re, qe.engine), ht;
          }, this.getOS = function() {
            var ht = {};
            return ht[g] = r, ht[y] = r, We.call(ht, Re, qe.os), tt && !ht[g] && Ue && Ue.platform && Ue.platform != "Unknown" && (ht[g] = Ue.platform.replace(/chrome os/i, he).replace(/macos/i, se)), ht;
          }, this.getResult = function() {
            return {
              ua: this.getUA(),
              browser: this.getBrowser(),
              engine: this.getEngine(),
              os: this.getOS(),
              device: this.getDevice(),
              cpu: this.getCPU()
            };
          }, this.getUA = function() {
            return Re;
          }, this.setUA = function(ht) {
            return Re = typeof ht === u && ht.length > T ? Rt(ht, T) : ht, this;
          }, this.setUA(Re), this;
        };
        At.VERSION = i, At.BROWSER = Ee([
          g,
          y,
          h
        ]), At.CPU = Ee([
          w
        ]), At.DEVICE = Ee([
          f,
          v,
          m,
          b,
          j,
          C,
          k,
          x,
          S
        ]), At.ENGINE = At.OS = Ee([
          g,
          y
        ]), t.exports && (e = t.exports = At), e.UAParser = At;
        var $t = typeof n !== c && (n.jQuery || n.Zepto);
        if ($t && !$t.ua) {
          var Lt = new At();
          $t.ua = Lt.getResult(), $t.ua.get = function() {
            return Lt.getUA();
          }, $t.ua.set = function(wt) {
            Lt.setUA(wt);
            var st = Lt.getResult();
            for (var Be in st) $t.ua[Be] = st[Be];
          };
        }
      })(typeof window == "object" ? window : QCe);
    })(my, my.exports)), my.exports;
  }
  var t4e = e4e();
  const r4 = new t4e.UAParser(window.navigator.userAgent).getResult(), n4e = (() => {
    const { os: t, device: e } = r4;
    return e.type === "mobile" || e.type === "tablet" || t.name === "Android" || t.name === "iOS";
  })(), r4e = (t) => t && (t === "Mac OS" ? "macOS" : t), i4e = r4.os.name === "Mac OS", U2 = () => i4e, Dr = () => n4e, h1 = () => {
    const t = r4.browser.name, e = r4e(r4.os.name);
    return !t || !e ? "Sable Web" : `Sable on ${t} for ${e}`;
  }, jB = "settings";
  var Mr = ((t) => (t[t.Modern = 0] = "Modern", t[t.Compact = 1] = "Compact", t[t.Bubble = 2] = "Bubble", t))(Mr || {}), G1 = ((t) => (t.Members = "members", t.Reply = "reply", t))(G1 || {}), Ua = ((t) => (t.Above = "above", t.Inline = "inline", t.Hidden = "hidden", t.Below = "below", t))(Ua || {}), Ic = ((t) => (t.Always = "always", t.Smart = "smart", t.Never = "never", t))(Ic || {});
  function o4e(t) {
    return t === "both" || t === "chat";
  }
  function a4e(t) {
    return t === "both" || t === "viewer";
  }
  function s4e(t, e, n) {
    return !n || e !== "light" && e !== "dark" || t === "none" ? false : t === "both" ? true : e === t;
  }
  const vf = {
    themeId: void 0,
    useSystemTheme: true,
    lightThemeId: void 0,
    darkThemeId: void 0,
    useSystemArboriumTheme: true,
    arboriumThemeId: "dracula",
    arboriumLightTheme: "github-light",
    arboriumDarkTheme: "dracula",
    saturationLevel: 100,
    uniformIcons: false,
    twitterEmoji: true,
    pageZoom: 100,
    hideActivity: false,
    isPeopleDrawer: true,
    isWidgetDrawer: false,
    memberSortFilterIndex: 0,
    enterForNewline: false,
    editorToolbar: false,
    composerToolbarOpen: false,
    messageLayout: 0,
    messageSpacing: "400",
    hideMembershipEvents: false,
    hideNickAvatarEvents: true,
    mediaAutoLoad: true,
    multiplePreviews: true,
    bundledPreview: true,
    urlPreview: true,
    encUrlPreview: false,
    clientUrlPreview: false,
    encClientUrlPreview: false,
    clientPreviewYoutube: false,
    showHiddenEvents: false,
    showTombstoneEvents: false,
    legacyUsernameColor: false,
    enableMSC4268CMD: false,
    usePushNotifications: Dr(),
    useInAppNotifications: Dr(),
    useSystemNotifications: !Dr(),
    isNotificationSounds: true,
    showMessageContentInNotifications: false,
    showMessageContentInEncryptedNotifications: false,
    clearNotificationsOnRead: false,
    hour24Clock: false,
    dateFormatString: "D MMM YYYY",
    developerTools: false,
    settingsSyncEnabled: false,
    jumboEmojiSize: "normal",
    privacyBlur: false,
    privacyBlurAvatars: false,
    privacyBlurEmotes: false,
    showPronouns: true,
    parsePronouns: true,
    pronounPillMaxCount: 3,
    pronounPillMaxLength: 16,
    renderGlobalNameColors: true,
    renderUserCards: "both",
    renderRoomColors: true,
    renderRoomFonts: true,
    captionPosition: "below",
    customDMCards: true,
    sendPresence: true,
    mobileGestures: true,
    rightSwipeAction: "reply",
    hideMembershipInReadOnly: true,
    useRightBubbles: false,
    showUnreadCounts: false,
    badgeCountDMsOnly: true,
    showPingCounts: true,
    showEasterEggs: true,
    hideReads: false,
    emojiSuggestThreshold: 2,
    underlineLinks: false,
    reducedMotion: false,
    autoplayGifs: true,
    autoplayStickers: true,
    autoplayEmojis: true,
    pixelatedImageRendering: "viewer",
    incomingInlineImagesDefaultHeight: 32,
    incomingInlineImagesMaxHeight: 64,
    linkPreviewImageMaxHeight: 640,
    saveStickerEmojiBandwidth: false,
    subspaceHierarchyLimit: 3,
    alwaysShowCallButton: false,
    joinCallOnSingleClick: true,
    faviconForMentionsOnly: false,
    highlightMentions: true,
    pkCompat: false,
    pmpProxying: false,
    mentionInReplies: true,
    showPersonaSetting: false,
    closeFoldersByDefault: false,
    perRoomShowRoomIcon: [],
    showRoomIcon: "smart",
    showRoomBanners: true,
    roomSidebarWidth: 256,
    roomBannerHeight: 190,
    memberSidebarWidth: 262,
    threadSidebarWidth: 440,
    threadRootHeight: 220,
    vcmsgSidebarWidth: 399,
    widgetSidebarWidth: 420,
    isShowingAllRoomsInHome: false,
    renderAnimals: true,
    themeCatalogOnboardingDone: false,
    themeRemoteFavorites: [],
    themeRemoteCatalogEnabled: false,
    themeChatSableWidgetsEnabled: true,
    themeChatAutoPreviewApprovedUrls: true,
    themeChatAutoPreviewAnyUrl: false,
    themeRemoteManualFullUrl: void 0,
    themeRemoteLightFullUrl: void 0,
    themeRemoteDarkFullUrl: void 0,
    themeRemoteManualKind: void 0,
    themeRemoteLightKind: void 0,
    themeRemoteDarkKind: void 0,
    themeMigrationDismissed: false,
    themeRemoteTweakFavorites: [],
    themeRemoteEnabledTweakFullUrls: []
  };
  function l4e() {
    return {
      ...vf,
      themeRemoteFavorites: vf.themeRemoteFavorites.map((t) => ({
        ...t
      })),
      themeRemoteTweakFavorites: vf.themeRemoteTweakFavorites.map((t) => ({
        ...t
      })),
      themeRemoteEnabledTweakFullUrls: [
        ...vf.themeRemoteEnabledTweakFullUrls
      ]
    };
  }
  function c4e(t) {
    t.monochromeMode === true && t.saturationLevel === void 0 ? t.saturationLevel = 0 : t.monochromeMode === false && t.saturationLevel === void 0 && (t.saturationLevel = 100), delete t.monochromeMode, typeof t.renderUserCards == "boolean" ? t.renderUserCards = t.renderUserCards ? "both" : "none" : t.renderUserCards !== "both" && t.renderUserCards !== "light" && t.renderUserCards !== "dark" && t.renderUserCards !== "none" && (t.renderUserCards = "both"), typeof t.pixelatedImageRendering == "boolean" ? t.pixelatedImageRendering = t.pixelatedImageRendering ? "both" : "none" : t.pixelatedImageRendering !== "both" && t.pixelatedImageRendering !== "chat" && t.pixelatedImageRendering !== "viewer" && t.pixelatedImageRendering !== "none" && delete t.pixelatedImageRendering, typeof t.themeChatAutoPreviewAnyUrl != "boolean" && typeof t.themeChatPreviewAnyUrl == "boolean" && (t.themeChatAutoPreviewAnyUrl = t.themeChatPreviewAnyUrl), delete t.themeChatPreviewAnyUrl, delete t.themeChatPreviewApprovedCatalogOnly;
  }
  function Hre(t, e) {
    const n = {
      ...vf,
      ...e
    };
    if (t === null) return n;
    const r = JSON.parse(t);
    return c4e(r), {
      ...n,
      ...r
    };
  }
  const d4e = /* @__PURE__ */ new Set([
    "0",
    "100",
    "200",
    "300",
    "400",
    "500"
  ]), u4e = /* @__PURE__ */ new Set([
    "none",
    "extraSmall",
    "small",
    "normal",
    "large",
    "extraLarge"
  ]);
  function W$(t) {
    return Array.isArray(t) ? t.filter((n) => typeof n == "string") : void 0;
  }
  function h4e(t) {
    if (!Array.isArray(t)) return;
    const e = [];
    for (const n of t) {
      if (!n || typeof n != "object") continue;
      const r = n;
      typeof r.fullUrl == "string" && typeof r.displayName == "string" && typeof r.basename == "string" && (r.kind === "light" || r.kind === "dark") && e.push({
        fullUrl: r.fullUrl,
        displayName: r.displayName,
        basename: r.basename,
        kind: r.kind,
        pinned: typeof r.pinned == "boolean" ? r.pinned : void 0,
        importedLocal: typeof r.importedLocal == "boolean" ? r.importedLocal : void 0
      });
    }
    return e;
  }
  function f4e(t) {
    if (!Array.isArray(t)) return;
    const e = [];
    for (const n of t) {
      if (!n || typeof n != "object") continue;
      const r = n;
      typeof r.fullUrl == "string" && typeof r.displayName == "string" && typeof r.basename == "string" && e.push({
        fullUrl: r.fullUrl,
        displayName: r.displayName,
        basename: r.basename,
        pinned: typeof r.pinned == "boolean" ? r.pinned : void 0,
        importedLocal: typeof r.importedLocal == "boolean" ? r.importedLocal : void 0
      });
    }
    return e;
  }
  function m4e(t) {
    return t in vf || t === "filterPronounsBasedOnLanguage" || t === "filterPronounsLanguages";
  }
  function g4e(t, e) {
    switch (t) {
      case "filterPronounsBasedOnLanguage":
        return typeof e == "boolean" ? e : void 0;
      case "filterPronounsLanguages":
        return W$(e);
      case "messageLayout":
        return typeof e == "number" && Number.isInteger(e) && e >= 0 && e <= 2 ? e : void 0;
      case "messageSpacing":
        return typeof e == "string" && d4e.has(e) ? e : void 0;
      case "captionPosition":
        return e === "above" || e === "inline" || e === "hidden" || e === "below" ? e : void 0;
      case "rightSwipeAction":
        return e === "members" || e === "reply" ? e : void 0;
      case "renderUserCards":
        return e === "both" || e === "light" || e === "dark" || e === "none" ? e : void 0;
      case "pixelatedImageRendering":
        return e === "both" || e === "chat" || e === "viewer" || e === "none" ? e : void 0;
      case "jumboEmojiSize":
        return typeof e == "string" && u4e.has(e) ? e : void 0;
      case "pronounPillMaxCount":
        return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 10 ? e : void 0;
      case "pronounPillMaxLength":
        return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 64 ? e : void 0;
      case "themeRemoteManualKind":
      case "themeRemoteLightKind":
      case "themeRemoteDarkKind":
        return e === "light" || e === "dark" ? e : void 0;
      case "themeRemoteFavorites":
        return h4e(e);
      case "themeRemoteTweakFavorites":
        return f4e(e);
      case "themeRemoteEnabledTweakFullUrls":
        return W$(e);
      default: {
        if (!(t in vf)) return;
        const n = vf[t];
        return typeof n == "boolean" ? typeof e == "boolean" ? e : void 0 : typeof n == "number" ? typeof e == "number" && Number.isFinite(e) ? e : void 0 : (typeof n == "string" || n === void 0) && typeof e == "string" ? e : void 0;
      }
    }
  }
  function p4e(t) {
    if (!t || typeof t != "object" || Array.isArray(t)) return {};
    const e = t, n = {};
    for (const r of Object.keys(e)) {
      if (!m4e(r)) continue;
      const i = g4e(r, e[r]);
      i !== void 0 ? n[r] = i : e[r];
    }
    return n;
  }
  let $re = {};
  const wA = vn(l4e());
  function F4e(t, e) {
    const n = p4e(e);
    $re = n;
    const r = Hre(localStorage.getItem(jB), n);
    t.set(wA, r);
  }
  const Ol = () => Hre(localStorage.getItem(jB), $re), Wre = (t) => {
    localStorage.setItem(jB, JSON.stringify(t));
  }, ge = vn((t) => t(wA), (t, e, n) => {
    e(wA, n), Wre(n);
  });
  function Eg(t, e) {
    if (!t || t[0] !== "#" || t.length !== 7 || !e) return;
    const n = 1 + e / 100;
    let r = Math.min(parseInt(t.substring(1, 3), 16) * n, 255), i = Math.min(parseInt(t.substring(3, 5), 16) * n, 255), a = Math.min(parseInt(t.substring(5, 7), 16) * n, 255);
    r <= 8 && i <= 8 && a <= 8 && e > 0 && (r = r <= 8 ? Math.max(178 - r, 0) : r, i = i <= 8 ? Math.max(178 - i, 0) : i, a = a <= 8 ? Math.max(178 - a, 0) : a);
    const s = Math.floor(r).toString(16).padStart(2, "0"), l = Math.floor(i).toString(16).padStart(2, "0"), c = Math.floor(a).toString(16).padStart(2, "0");
    return `#${s}${l}${c}`;
  }
  function Y1(t, e) {
    if (!t || !e) return false;
    const n = parseInt(t.substring(1, 3), 16), r = parseInt(t.substring(3, 5), 16), i = parseInt(t.substring(5, 7), 16), a = parseInt(e.substring(1, 3), 16), s = parseInt(e.substring(3, 5), 16), l = parseInt(e.substring(5, 7), 16);
    return Math.abs(n - a) < 32 && Math.abs(r - s) < 32 && Math.abs(i - l) < 32;
  }
  const qre = p.createContext(null), v4e = qre.Provider;
  function be() {
    const t = p.useContext(qre);
    if (!t) throw new Error("MatrixClient not initialized!");
    return t;
  }
  const TB = "sable-import://theme/", Kre = "sable-import://tweak/";
  function RB(t) {
    return t.startsWith(TB);
  }
  function _4e(t) {
    return t.startsWith(Kre);
  }
  function gy(t) {
    return RB(t) || _4e(t);
  }
  function y4e() {
    return crypto.randomUUID();
  }
  function b4e() {
    return crypto.randomUUID();
  }
  function x4e(t) {
    return `${TB}${t}/full.sable.css`;
  }
  function w4e(t) {
    return `${TB}${t}/preview.sable.css`;
  }
  function D4e(t) {
    return `${Kre}${t}/full.sable.css`;
  }
  var Gre = "config_onLightFontWeight__2zinav0", Yre = "config_onDarkFontWeight__2zinav1", Zre = "colors_darkTheme__10hhp9c0", Jre = "colors_lightTheme__10hhp9c1", Rr = ((t) => (t.Light = "light", t.Dark = "dark", t))(Rr || {});
  const Xre = "sable-remote-theme", q$ = (t) => {
    if (!t) return false;
    const e = t.trim();
    return /^https:\/\//i.test(e) || RB(e);
  };
  function K$(t, e) {
    return t === "dark" ? "dark" : t === "light" ? "light" : e;
  }
  function G$(t, e) {
    return {
      id: Xre,
      kind: e,
      classNames: [
        "sable-remote-theme",
        e === "dark" ? "sable-remote-kind-dark" : "sable-remote-kind-light",
        e === "dark" ? "dark-theme" : "light-theme",
        e === "dark" ? Zre : Jre,
        e === "dark" ? Yre : Gre
      ],
      remoteFullUrl: t.trim()
    };
  }
  const Hg = {
    id: "light-theme",
    kind: "light",
    classNames: [
      "sable-remote-theme",
      "light-theme",
      Jre,
      Gre
    ]
  }, Zb = {
    id: "dark-theme",
    kind: "dark",
    classNames: [
      "sable-remote-theme",
      "dark-theme",
      Zre,
      Yre
    ]
  }, AB = () => p.useMemo(() => [
    Hg,
    Zb
  ], []), Qre = () => p.useMemo(() => ({
    [Hg.id]: "Light",
    [Zb.id]: "Dark"
  }), []), eie = () => {
    const t = p.useMemo(() => window.matchMedia("(prefers-color-scheme: dark)"), []), [e, n] = p.useState(t.matches ? "dark" : "light");
    return p.useEffect(() => {
      const r = () => {
        n(t.matches ? "dark" : "light");
      };
      return t.addEventListener("change", r), () => {
        t.removeEventListener("change", r);
      };
    }, [
      t,
      n
    ]), e;
  }, yk = () => {
    const t = eie(), e = AB(), [n] = Fe(ge, "useSystemTheme"), [r] = Fe(ge, "themeId"), [i] = Fe(ge, "lightThemeId"), [a] = Fe(ge, "darkThemeId"), [s] = Fe(ge, "themeRemoteManualFullUrl"), [l] = Fe(ge, "themeRemoteLightFullUrl"), [c] = Fe(ge, "themeRemoteDarkFullUrl"), [d] = Fe(ge, "themeRemoteManualKind"), [u] = Fe(ge, "themeRemoteLightKind"), [h] = Fe(ge, "themeRemoteDarkKind");
    if (!n) return q$(s) ? G$(s, K$(d, r === "dark-theme" ? "dark" : "light")) : e.find((m) => m.id === r) ?? Hg;
    const f = t === "dark", g = f ? c : l;
    return q$(g) ? G$(g, K$(f ? h : u, f ? "dark" : "light")) : f ? e.find((m) => m.id === a) ?? Zb : e.find((m) => m.id === i) ?? Hg;
  }, tie = p.createContext(null), C4e = tie.Provider, yp = () => {
    const t = p.useContext(tie);
    if (!t) throw new Error("No theme provided!");
    return t;
  }, Pn = {
    PoniesRoomEmotes: "im.ponies.room_emotes",
    PowerLevelTags: "in.cinny.room.power_level_tags",
    RoomWidget: "im.vector.modular.widgets",
    RoomCosmeticsColor: "moe.sable.room.cosmetics.color",
    RoomCosmeticsFont: "moe.sable.room.cosmetics.font",
    RoomCosmeticsPronouns: "moe.sable.room.cosmetics.pronouns",
    RoomAbbreviations: "moe.sable.room.abbreviations",
    RoomBanner: "page.codeberg.everypizza.room.banner"
  };
  var rs = ((t) => (t.Default = "default", t.AllMessages = "all_messages", t.MentionsAndKeywords = "mentions_and_keywords", t.Mute = "mute", t))(rs || {});
  const $g = "xyz.amorgan.blurhash", bk = "page.codeberg.everypizza.msc4193.spoiler", nie = "page.codeberg.everypizza.msc4193.spoiler.reason", AD = "com.beeper.msc4459.image_source_packs", Vy = "com.beeper.per_message_profile", DA = "com.beeper.linkpreviews", Y$ = "com.famedly.app.forwarded", Of = "io.fsky.nyx.pronouns", i4 = "gay.fomx.biography", V2 = "us.cloke.msc4175.tz", H2 = "m.tz", E4e = "im.ponies.user_emotes", k4e = "im.ponies.emote_rooms", S4e = "org.matrix.msc3401.call", Wg = "moe.sable.app.bio", Z1 = "moe.sable.app.name_color", $2 = "moe.sable.app.name_color_dark_theme", W2 = "moe.sable.app.name_color_light_theme", qg = "kitty.meow.is_cat", Kg = "kitty.meow.has_cats", CA = "moe.sable.message.forward", j4e = "moe.sable.app.nicknames", T4e = "moe.sable.app.pins_read_marker", R4e = "moe.sable.app.settings", A4e = "fyi.cisnt.permessageprofile", J1 = "chat.commet.profile_banner", o4 = "chat.commet.profile_color_scheme", Gg = "chat.commet.profile_bio", a4 = "chat.commet.profile_status", I4e = "in.cinny.spaces", B4e = "io.element.recent_emoji", m9 = /* @__PURE__ */ new Map(), P4e = (t) => {
    var _a6, _b3;
    const e = t[i4], n = /* @__PURE__ */ new Set([
      "avatar_url",
      "displayname",
      Of,
      H2,
      V2,
      Wg,
      Gg,
      i4,
      J1,
      a4,
      Z1,
      W2,
      $2,
      o4,
      Kg,
      qg
    ]), r = {};
    return Object.entries(t).forEach(([i, a]) => {
      n.has(i) || (r[i] = a);
    }), {
      avatarUrl: t.avatar_url,
      displayName: t.displayname,
      pronouns: t[Of],
      timezone: t[V2] || t[H2],
      bio: ((_b3 = (_a6 = e == null ? void 0 : e["m.text"]) == null ? void 0 : _a6[0]) == null ? void 0 : _b3.body) || t[Wg] || t[Gg],
      status: t[a4],
      bannerUrl: t[J1],
      nameColor: t[Z1],
      nameColorDark: t[$2],
      nameColorLight: t[W2],
      heroColorScheme: t[o4],
      isCat: t[qg] === true,
      hasCats: t[Kg] === true,
      extended: r,
      _fetched: true
    };
  }, g0 = (t) => {
    if (typeof t != "string") return;
    const e = t.replaceAll(/["']/g, "").trim();
    return /^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(e) ? e : void 0;
  }, M4e = (t) => t.replaceAll(/[;{}<>]/g, "").slice(0, 32), Hc = (t, e, n) => {
    const r = be(), [i] = Fe(ge, "legacyUsernameColor"), [a] = Fe(ge, "renderGlobalNameColors"), [s] = Fe(ge, "renderRoomColors"), [l] = Fe(ge, "renderRoomFonts"), [c] = Fe(ge, "renderUserCards"), d = yk().kind, u = p.useMemo(() => jF(z2, (v) => v[t]), [
      t
    ]), h = Ze(u), f = Fn(z2), g = (h == null ? void 0 : h._fetched) === true && Object.keys(h ?? {}).every((v) => v === "_fetched"), m = !!t && t !== "undefined" && (!(h == null ? void 0 : h._fetched) || g);
    return p.useEffect(() => {
      if (!m) return;
      let v = m9.get(t);
      v || (v = r.getProfileInfo(t).finally(() => {
        m9.delete(t);
      }), m9.set(t, v));
      let y = true;
      return v.then((w) => {
        if (!y) return;
        const b = P4e(w);
        f((j) => ({
          ...j,
          [t]: {
            ...j[t],
            ...b
          }
        }));
      }).catch(() => {
        y && f((w) => ({
          ...w,
          [t]: {
            ...w[t],
            _fetched: true
          }
        }));
      }), () => {
        y = false;
      };
    }, [
      t,
      m,
      r,
      f
    ]), p.useMemo(() => {
      var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3, _l3, _m2, _n9, _o4, _p2, _q2;
      const v = h ?? {
        displayName: (_a6 = r.getUser(t)) == null ? void 0 : _a6.displayName,
        avatarUrl: (_b3 = r.getUser(t)) == null ? void 0 : _b3.avatarUrl,
        ...n
      };
      let y, w, b, j, k, C;
      if (e && (s || l)) {
        const ne = e.getLiveTimeline().getState(en.FORWARDS);
        if (s) {
          const K = ne == null ? void 0 : ne.getStateEvents(Pn.RoomCosmeticsColor, t);
          y = (_d4 = (_c3 = Array.isArray(K) ? K[0] : K) == null ? void 0 : _c3.getContent()) == null ? void 0 : _d4.color;
        }
        if (l) {
          const K = ne == null ? void 0 : ne.getStateEvents(Pn.RoomCosmeticsFont, t);
          w = (_f4 = (_e13 = Array.isArray(K) ? K[0] : K) == null ? void 0 : _e13.getContent()) == null ? void 0 : _f4.font;
        }
        const ae = ne == null ? void 0 : ne.getStateEvents(Pn.RoomCosmeticsPronouns, t);
        b = (_h4 = (_g4 = Array.isArray(ae) ? ae[0] : ae) == null ? void 0 : _g4.getContent()) == null ? void 0 : _h4.pronouns;
        const X = ne == null ? void 0 : ne.getStateEvents(ce.SpaceParent);
        if (X && X.length > 0) {
          const K = X[0], le = (_i7 = K ? r.getRoom(K.getStateKey()) : void 0) == null ? void 0 : _i7.getLiveTimeline().getState(en.FORWARDS);
          if (s) {
            const re = le == null ? void 0 : le.getStateEvents(Pn.RoomCosmeticsColor, t);
            j = (_k3 = (_j3 = Array.isArray(re) ? re[0] : re) == null ? void 0 : _j3.getContent()) == null ? void 0 : _k3.color;
          }
          if (l) {
            const re = le == null ? void 0 : le.getStateEvents(Pn.RoomCosmeticsFont, t);
            k = (_m2 = (_l3 = Array.isArray(re) ? re[0] : re) == null ? void 0 : _l3.getContent()) == null ? void 0 : _m2.font;
          }
          const te = le == null ? void 0 : le.getStateEvents(Pn.RoomCosmeticsPronouns, t);
          C = (_o4 = (_n9 = Array.isArray(te) ? te[0] : te) == null ? void 0 : _n9.getContent()) == null ? void 0 : _o4.pronouns;
        }
      }
      const x = g0(v == null ? void 0 : v.nameColor), S = g0(v == null ? void 0 : v.nameColorDark), T = g0(v == null ? void 0 : v.nameColorLight), A = (a || t === r.getUserId()) && x ? x : void 0, B = (a || t === r.getUserId()) && d === Rr.Dark && S ? S : void 0, U = (a || t === r.getUserId()) && d === Rr.Light && T ? T : void 0, z = B ?? U ?? A, O = y && g0(y) ? y : void 0, M = j && g0(j) ? j : void 0, I = O || M || z || (i ? _p(t) : void 0), N = w || k;
      let L;
      if (N) {
        const ne = M4e(N);
        L = ne.includes(" ") ? `"${ne}", var(--font-secondary)` : `${ne}, var(--font-secondary)`;
      }
      const H = b || C || (v == null ? void 0 : v.pronouns), V = (_p2 = v == null ? void 0 : v.heroColorScheme) == null ? void 0 : _p2.brightness, Z = (_q2 = v == null ? void 0 : v.heroColorScheme) == null ? void 0 : _q2.color, Y = s4e(c, V, Z), oe = Y ? g0(Z) : void 0, ue = Y ? V : void 0, ie = Eg(oe, ue === "dark" ? -80 : 80), de = Y && ((a || t === r.getUserId()) && ue === "light" && !Y1(ie, T) && T || ue === "dark" && !Y1(ie, S) && S) || I;
      return {
        ...v,
        resolvedColor: I,
        resolvedFont: L,
        resolvedPronouns: H,
        pronouns: H,
        heroColor: oe,
        heroBrightness: ue,
        heroNameColor: de
      };
    }, [
      h,
      n,
      r,
      t,
      e,
      s,
      l,
      a,
      c,
      d,
      i
    ]);
  };
  var cw = {}, Z$;
  function O4e() {
    if (Z$) return cw;
    Z$ = 1;
    function t(i) {
      var a, s, l, c, d;
      return d = new Uint8Array(16), window.crypto.getRandomValues(d.subarray(0, 8)), window.crypto.subtle.generateKey({
        name: "AES-CTR",
        length: 256
      }, true, [
        "encrypt",
        "decrypt"
      ]).then(function(u) {
        return a = u, window.crypto.subtle.exportKey("jwk", a);
      }).then(function(u) {
        return s = u, window.crypto.subtle.encrypt({
          name: "AES-CTR",
          counter: d,
          length: 64
        }, a, i);
      }).then(function(u) {
        return l = u, window.crypto.subtle.digest("SHA-256", l);
      }).then(function(u) {
        return c = u, {
          data: l,
          info: {
            v: "v2",
            key: s,
            iv: n(d),
            hashes: {
              sha256: n(new Uint8Array(c))
            }
          }
        };
      });
    }
    function e(i, a) {
      if (a === void 0 || a.key === void 0 || a.iv === void 0 || a.hashes === void 0 || a.hashes.sha256 === void 0) throw new Error("Invalid info. Missing info.key, info.iv or info.hashes.sha256 key");
      var s, l = r(a.iv), c = a.hashes.sha256;
      return window.crypto.subtle.importKey("jwk", a.key, {
        name: "AES-CTR"
      }, false, [
        "encrypt",
        "decrypt"
      ]).then(function(d) {
        return s = d, window.crypto.subtle.digest("SHA-256", i);
      }).then(function(d) {
        if (n(new Uint8Array(d)) != c) throw new Error("Mismatched SHA-256 digest");
        var u;
        return a.v == "v1" || a.v == "v2" ? u = 64 : u = 128, window.crypto.subtle.decrypt({
          name: "AES-CTR",
          counter: l,
          length: u
        }, s, i);
      });
    }
    function n(i) {
      var a = String.fromCharCode.apply(null, i), s = window.btoa(a), l = i.length, c = 4 * Math.floor((l + 2) / 3) + (l + 2) % 3 - 2;
      return s.slice(0, c);
    }
    function r(i) {
      for (var a = i + "===".slice(0, (4 - i.length % 4) % 4), s = window.atob(a), l = new Uint8Array(s.length), c = 0; c < s.length; c++) l[c] = s.charCodeAt(c);
      return l;
    }
    try {
      cw.encryptAttachment = t, cw.decryptAttachment = e;
    } catch {
    }
    return cw;
  }
  var rie = O4e();
  function ca(t, e) {
    return t.then(function(n) {
      return [
        null,
        n
      ];
    }).catch(function(n) {
      return [
        n,
        void 0
      ];
    });
  }
  const ni = (t, e, n = "") => {
    var _a6;
    return ((_a6 = t.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(e, n)) ?? void 0;
  }, Ud = (t, e) => {
    var _a6;
    return ((_a6 = t.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(e)) ?? [];
  }, Qu = (t, e) => t.getAccountData(e), Hy = (t) => {
    const e = /* @__PURE__ */ new Set(), n = t == null ? void 0 : t.getContent();
    return n === void 0 || Object.keys(n).forEach((r) => {
      const i = n[r];
      Array.isArray(i) && i.forEach((a) => {
        typeof a == "string" && e.add(a);
      });
    }), e;
  }, iie = (t, e) => {
    var _a6, _b3, _c3, _d4;
    return !t || !e ? false : ((_d4 = (_c3 = (_b3 = (_a6 = t.getMember(e)) == null ? void 0 : _a6.events) == null ? void 0 : _b3.member) == null ? void 0 : _c3.getContent()) == null ? void 0 : _d4.is_direct) === true;
  }, Uu = (t) => {
    if (!t) return false;
    const e = ni(t, ce.RoomCreate);
    return e ? e.getContent().type === Bo.Space : false;
  }, Jb = (t) => {
    if (!t) return false;
    const e = ni(t, ce.RoomCreate);
    return e ? e.getContent().type !== Bo.Space : true;
  }, IB = (t, e) => !!((e == null ? void 0 : e.has(t.roomId)) || !t.isSpaceRoom() && t.getJoinedMemberCount() === 2);
  function X1(t) {
    return t.getType() === ce.SpaceChild && Array.isArray(t.getContent().via);
  }
  const sa = (t, e) => {
    const n = /* @__PURE__ */ new Set(), r = (i) => {
      var _a6;
      if (n.has(i)) return;
      n.add(i), (_a6 = t.get(i)) == null ? void 0 : _a6.forEach((s) => r(s));
    };
    return r(e), n.delete(e), n;
  }, s4 = (t) => Ud(t, ce.SpaceChild).reduce((e, n) => {
    const r = n.getStateKey();
    return X1(n) && r && e.push(r), e;
  }, []), oie = (t, e, n) => {
    const r = sa(t, e);
    n.forEach((i) => {
      if (r.has(i)) return;
      const a = t.get(i) ?? /* @__PURE__ */ new Set();
      a.add(e), t.set(i, a);
    });
  }, L4e = (t) => {
    const e = /* @__PURE__ */ new Map();
    return t.getRooms().filter((n) => Uu(n) && n.getMyMembership() === Ht.Join).forEach((n) => oie(e, n.roomId, s4(n))), e;
  }, aie = (t, e) => {
    const n = sa(t, e);
    return Array.from(n).filter((r) => !t.has(r));
  }, N4e = (t) => t.some((e) => typeof e == "string" && e === Rc.Notify), z4e = (t, e) => t == null ? void 0 : t.find((n) => n.rule_id === e && n.rule_id.startsWith("!") && !N4e(n.actions)), Yg = (t, e) => {
    var _a6, _b3, _c3;
    const n = (_c3 = (_b3 = (_a6 = t.getAccountData(ce.PushRules)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.global) == null ? void 0 : _c3.override;
    if (z4e(n, e)) return rs.Mute;
    let r;
    try {
      r = t.getRoomPushRule("global", e);
    } catch {
      r = void 0;
    }
    return r ? r.actions[0] === "notify" ? rs.AllMessages : rs.MentionsAndKeywords : rs.Default;
  }, U4e = /* @__PURE__ */ new Set([
    "m.room.create",
    "m.room.message",
    "m.room.encrypted",
    "m.room.member",
    "m.sticker",
    "m.reaction"
  ]), Vu = (t, e, n) => {
    var _a6;
    const r = t.getType();
    if (!U4e.has(r) || r === "m.room.member" || t.isRedacted()) return false;
    const i = t.getRelation(), a = i == null ? void 0 : i.rel_type;
    if (a === "m.replace") return false;
    if (a === "m.annotation") {
      if (!e || !n || !i) return false;
      const s = i.event_id;
      return s ? ((_a6 = e.findEventById(s)) == null ? void 0 : _a6.getSender()) === n : false;
    }
    return true;
  }, V4e = (t) => {
    const e = t.getUnreadNotificationCount(ir.Total), n = t.getUnreadNotificationCount(ir.Highlight);
    return e > 0 || n > 0;
  }, q2 = (t, e) => {
    var _a6;
    if (Yg(t, e.roomId) === rs.Mute) return false;
    const n = t.getUserId();
    if (!n) return false;
    const r = e.getEventReadUpTo(n), i = e.getLiveTimeline().getEvents();
    if (!r || ((_a6 = i[i.length - 1]) == null ? void 0 : _a6.getSender()) === n) return false;
    for (let s = i.length - 1; s >= 0; s -= 1) {
      const l = i[s];
      if (!l || l.getId() === r) return false;
      if (Vu(l, e, n)) return true;
    }
    return false;
  }, g9 = /* @__PURE__ */ new WeakSet(), rf = (t, e) => {
    var _a6, _b3, _c3;
    if (Yg(t.client, t.roomId) === rs.Mute) return {
      roomId: t.roomId,
      highlight: 0,
      total: 0
    };
    const n = t.client.getUserId();
    if (n && (e == null ? void 0 : e.applyFixup) && !g9.has(t)) {
      g9.add(t);
      try {
        t.fixupNotifications(n);
      } finally {
        g9.delete(t);
      }
    }
    let r = t.getUnreadNotificationCount(ir.Total);
    const i = t.getUnreadNotificationCount(ir.Highlight), a = IB(t, e == null ? void 0 : e.mDirects), s = a ? Yg(t.client, t.roomId) : void 0, l = a && s !== rs.Mute && s !== rs.MentionsAndKeywords;
    if (n && r > 0 && i === 0 && !q2(t.client, t)) {
      const c = t.getRoomUnreadNotificationCount(ir.Total);
      if (c > 0) {
        const h = (_a6 = [
          ...t.getLiveTimeline().getEvents()
        ].toReversed().find((f) => !f.isSending() && f.getSender() !== n && Vu(f, t, n))) == null ? void 0 : _a6.getId();
        h && t.hasUserReadEvent(n, h) && (r -= c);
      }
    }
    if (r === 0 && i === 0 && n && q2(t.client, t)) {
      const c = t.getEventReadUpTo(n), d = t.getLiveTimeline().getEvents();
      let u = 0, h = 0;
      const f = new Oa(t.client);
      for (let g = d.length - 1; g >= 0; g -= 1) {
        const m = d[g];
        if (!m || m.getId() === c) break;
        Vu(m, t, n) && m.getSender() !== n && (u += 1, ((_c3 = (_b3 = f.actionsForEvent(m)) == null ? void 0 : _b3.tweaks) == null ? void 0 : _c3.highlight) && (h += 1));
      }
      if (u > 0) return {
        roomId: t.roomId,
        highlight: h,
        total: u
      };
    }
    return n && !t.getEventReadUpTo(n) && t.getLiveTimeline().getEvents().some((h) => h.getSender() !== n && Vu(h, t, n)) ? r === 0 && i === 0 ? {
      roomId: t.roomId,
      highlight: 0,
      total: 1
    } : {
      roomId: t.roomId,
      highlight: i,
      total: r
    } : l && r > 0 && i === 0 ? {
      roomId: t.roomId,
      highlight: r,
      total: r
    } : {
      roomId: t.roomId,
      highlight: i,
      total: Math.max(r, i)
    };
  }, dw = (t, e) => t.getRooms().reduce((r, i) => {
    if (i.isSpaceRoom() || i.getMyMembership() !== "join" || Yg(t, i.roomId) === rs.Mute) return r;
    const a = rf(i, e);
    return (a.total > 0 || a.highlight > 0) && r.push(a), r;
  }, []), Sd = (t, e, n) => e === Bo.Space ? n === kn.Public ? t.SpaceGlobe : n === kn.Invite || n === kn.Knock || n === kn.Private ? t.SpaceLock : t.Space : e === Bo.UnstableCall ? n === kn.Public ? t.VolumeHighGlobe : n === kn.Invite || n === kn.Knock || n === kn.Private ? t.VolumeHighLock : t.VolumeHigh : n === kn.Public ? t.HashGlobe : n === kn.Invite || n === kn.Knock || n === kn.Private ? t.HashLock : t.Hash, Sa = (t, e, n = 32, r = false) => {
    const i = e.getMxcAvatarUrl();
    return i ? t.mxcUrlToHttp(i, n, n, "crop", void 0, false, r) ?? void 0 : void 0;
  }, Jf = (t, e, n = 32, r = false) => {
    var _a6;
    const i = (_a6 = e.getAvatarFallbackMember()) == null ? void 0 : _a6.getMxcAvatarUrl();
    return i ? t.mxcUrlToHttp(i, n, n, "crop", void 0, false, r) ?? void 0 : Sa(t, e, n, r);
  }, Zg = (t) => {
    const e = t.match(/^> <.+?> .+\n(>.*\n)*?\n/m);
    return e ? t.slice(e[0].length) : t;
  }, sie = (t) => {
    const e = "</mx-reply>", n = t.lastIndexOf(e);
    return n < 0 ? t : t.slice(n + e.length);
  }, gr = (t, e, n) => {
    var _a6;
    if (n == null ? void 0 : n[e]) return n[e];
    const i = (_a6 = t.getMember(e)) == null ? void 0 : _a6.rawDisplayName;
    if (i !== e && (i == null ? void 0 : i.replace(/[\p{Cc}\p{Cf}\u180B-\u180F\uFE00-\uFE0F\u200B-\u200D\t\n ]/gu, "").length) !== 0) return i;
  }, BB = (t, e, n) => [
    t.rawDisplayName === t.userId ? n(t.userId) : t.rawDisplayName,
    e.startsWith("@") || e.indexOf(":") > -1 ? t.userId : n(t.userId)
  ], Jc = (t, e) => {
    var _a6;
    return (_a6 = t.getMember(e)) == null ? void 0 : _a6.getMxcAvatarUrl();
  }, xk = (t) => t.getContent().membership !== t.getPrevContent().membership || t.getContent().reason !== t.getPrevContent().reason, H4e = async (t, e) => {
    const n = t.getCrypto();
    if (!n) return;
    const r = e.getEvents().filter((a) => a.isEncrypted()).toReversed().map((a) => a.attemptDecryption(n, {
      isRetry: true
    })), i = performance.now();
    await Mg({
      name: "decrypt.bulk",
      op: "matrix.crypto",
      attributes: {
        event_count: r.length
      }
    }, () => Promise.allSettled(r)), r.length > 0 && oa("sable.decryption.bulk_latency_ms", performance.now() - i, {
      attributes: {
        event_count: String(r.length)
      }
    });
  }, ID = (t, e) => t.relations.getChildEventsForEvent(e, Xn.Annotation, ce.Reaction), Xb = (t, e, n) => t.relations.getChildEventsForEvent(e, Xn.Replace, n), $4e = (t, e) => {
    const n = (r) => r.getSender() === t.getSender();
    return e.toSorted((r, i) => i.getTs() - r.getTs()).find(n);
  }, eh = (t, e, n) => {
    const r = Xb(n, t, e.getType());
    return r && $4e(e, r.getRelations());
  }, J$ = (t, e) => {
    var _a6;
    const n = e.getContent(), r = (_a6 = n["m.relates_to"]) == null ? void 0 : _a6.rel_type;
    return e.getSender() === t.getUserId() && e.getType() === ce.RoomMessage && (!r || r === Xn.Thread) && (n.msgtype === Jn.Text || n.msgtype === Jn.Emote || n.msgtype === Jn.Notice || n.msgtype === Jn.Image || n.msgtype === Jn.Video || n.msgtype === Jn.Audio || n.msgtype === Jn.File);
  }, is = (t) => {
    var _a6;
    const e = (_a6 = t.getRelation()) == null ? void 0 : _a6.rel_type;
    return e === Xn.Annotation || e === Xn.Replace || t.getContent()["m.new_content"] !== void 0;
  }, Da = (t, e) => {
    var _a6, _b3, _c3, _d4, _e13;
    const n = ((_a6 = t.getRelation) == null ? void 0 : _a6.call(t)) ?? ((_c3 = (_b3 = t.getWireContent) == null ? void 0 : _b3.call(t)) == null ? void 0 : _c3["m.relates_to"]) ?? ((_e13 = (_d4 = t.getContent) == null ? void 0 : _d4.call(t)) == null ? void 0 : _e13["m.relates_to"]);
    return (n == null ? void 0 : n.rel_type) === Xn.Thread && (e === void 0 || n.event_id === e);
  }, X$ = (t) => {
    var _a6, _b3;
    return (((_b3 = (_a6 = t.getServerAggregatedRelation) == null ? void 0 : _a6.call(t, Xn.Thread)) == null ? void 0 : _b3.count) ?? 0) > 0;
  }, lie = (t, e, n = 24) => {
    var _a6;
    let r = e;
    for (let i = 0; i < n; i += 1) {
      const a = t.findEventById(r);
      if (!a || !is(a)) return r;
      const s = (_a6 = a.getRelation()) == null ? void 0 : _a6.event_id;
      if (typeof s != "string" || s === r) return r;
      r = s;
    }
    return r;
  }, cie = (t, e) => {
    const n = {};
    return t.length > 0 && (n.user_ids = t), e && (n.room = true), n;
  }, W4e = (t, e, n) => {
    const r = [];
    return e.forEach((i) => {
      const a = t.getRoom(i);
      if (!a || a.getMyMembership() !== Ht.Join) return;
      a.hasMembershipState(n, Ht.Join) && r.push(i);
    }), r;
  }, q4e = (t, e, n) => e.some((r) => {
    const i = t.getRoom(r);
    return !i || i.getMyMembership() !== Ht.Join ? false : i.hasMembershipState(n, Ht.Ban);
  }), K4e = (t) => {
    const e = /* @__PURE__ */ new Set(), n = ni(t, ce.RoomCreate), r = n == null ? void 0 : n.getContent(), i = n == null ? void 0 : n.getSender();
    return typeof i == "string" && e.add(i), r && Array.isArray(r.additional_creators) && r.additional_creators.forEach((a) => {
      e.add(a);
    }), e;
  }, K2 = (t, e, n) => {
    if (n.length === 1) return n[0];
    const r = (l) => {
      var _a6;
      const c = /* @__PURE__ */ new Set(), d = t.getRoom(l);
      if (!d) return [];
      K4e(d).forEach((m) => c.add(m));
      const u = (_a6 = ni(d, ce.RoomPowerLevels)) == null ? void 0 : _a6.getContent(), { users_default: h, users: f } = u ?? {}, g = typeof h == "number" ? h : 0;
      return typeof f == "object" && Object.keys(f).forEach((m) => {
        f[m] > g && c.add(m);
      }), Array.from(c);
    };
    let i, a = 0;
    const s = r(e);
    return n.forEach((l) => {
      const d = r(l).filter((u) => s.includes(u)).length;
      d > a && (a = d, i = l);
    }), i;
  };
  class die {
    constructor(e, n) {
      __publicField(this, "roomId");
      __publicField(this, "stateKey");
      this.roomId = e, this.stateKey = n;
    }
  }
  var Hr = ((t) => (t.Emoticon = "emoticon", t.Sticker = "sticker", t))(Hr || {});
  class l4 {
    constructor(e) {
      __publicField(this, "meta");
      __publicField(this, "fallbackUsage", [
        Hr.Emoticon,
        Hr.Sticker
      ]);
      this.meta = e;
    }
    get name() {
      const e = this.meta.display_name;
      if (typeof e == "string") return e;
    }
    get avatar() {
      const e = this.meta.avatar_url;
      if (typeof e == "string") return e;
    }
    get attribution() {
      const { attribution: e } = this.meta;
      if (typeof this.meta.attribution == "string") return e;
    }
    get usage() {
      if (!Array.isArray(this.meta.usage)) return this.fallbackUsage;
      const e = this.meta.usage.filter((n) => n === Hr.Emoticon || n === Hr.Sticker);
      return e.length === 0 ? this.fallbackUsage : e;
    }
    get content() {
      return this.meta;
    }
  }
  class Jg {
    constructor(e, n, r) {
      __publicField(this, "shortcode");
      __publicField(this, "url");
      __publicField(this, "image");
      this.shortcode = e, this.url = n, this.image = r;
    }
    static fromPackImage(e, n) {
      const { url: r } = n;
      if (typeof r == "string") return new Jg(e, r, n);
    }
    get body() {
      const { body: e } = this.image;
      return typeof e == "string" ? e : void 0;
    }
    get info() {
      return this.image.info;
    }
    get usage() {
      const e = this.image.usage;
      if (!Array.isArray(e)) return;
      const n = e.filter((r) => r === Hr.Emoticon || r === Hr.Sticker);
      return n.length > 0 ? n : void 0;
    }
    get content() {
      return {
        url: this.url,
        body: this.image.body,
        usage: this.image.usage,
        info: this.image.info
      };
    }
  }
  class G4e {
    constructor(e) {
      __publicField(this, "rawImages");
      __publicField(this, "shortcodeToImages");
      this.rawImages = e;
    }
    get collection() {
      if (this.shortcodeToImages) return this.shortcodeToImages;
      const e = /* @__PURE__ */ new Map();
      return Object.entries(this.rawImages).forEach(([n, r]) => {
        const i = Jg.fromPackImage(n, r);
        i && e.set(n, i);
      }), this.shortcodeToImages = e, this.shortcodeToImages;
    }
  }
  class gh {
    constructor(e, n, r) {
      __publicField(this, "id");
      __publicField(this, "deleted");
      __publicField(this, "address");
      __publicField(this, "meta");
      __publicField(this, "images");
      __publicField(this, "emoticonMemo");
      __publicField(this, "stickerMemo");
      this.id = e, this.address = r, this.deleted = n.pack === void 0 && n.images === void 0, this.meta = new l4(n.pack ?? {}), this.images = new G4e(n.images ?? {});
    }
    static fromMatrixEvent(e, n) {
      const r = n.getRoomId(), i = n.getStateKey(), a = r && typeof i == "string" ? new die(r, i) : void 0, s = n.getContent();
      return new gh(e, s, a);
    }
    getImages(e) {
      if (e === Hr.Emoticon && this.emoticonMemo) return this.emoticonMemo;
      if (e === Hr.Sticker && this.stickerMemo) return this.stickerMemo;
      const n = Array.from(this.images.collection.values()).filter((r) => (r.usage ?? this.meta.usage).includes(e));
      return e === Hr.Emoticon && (this.emoticonMemo = n), e === Hr.Sticker && (this.stickerMemo = n), n;
    }
    getAvatarUrl(e) {
      if (this.meta.avatar) return this.meta.avatar;
      const r = this.getImages(e)[0];
      if (r) return r.url;
    }
  }
  const Zr = {
    CinnySpaces: I4e,
    ElementRecentEmoji: B4e,
    PoniesUserEmotes: E4e,
    PoniesEmoteRooms: k4e,
    SableNicknames: j4e,
    SablePinStatus: T4e,
    SablePerProfileMessageProfiles: A4e,
    SableSettings: R4e
  };
  function Ll(t, e) {
    return !t && !e ? true : !t || !e ? false : t.roomId === e.roomId && t.stateKey === e.stateKey;
  }
  function EA(t, e) {
    return t.length === e.length && t.every((n) => e.includes(n));
  }
  function Y4e(t, e) {
    return t.name === e.name && t.avatar === e.avatar && t.attribution === e.attribution && EA(t.usage, e.usage);
  }
  function uie(t) {
    return t.reduce((e, n) => {
      const r = n.getId();
      return r && e.push(gh.fromMatrixEvent(r, n)), e;
    }, []);
  }
  function Q$(t, e) {
    const n = ni(t, Pn.PoniesRoomEmotes, e);
    if (!n) return;
    const r = n.getId();
    if (r) return gh.fromMatrixEvent(r, n);
  }
  function f1(t) {
    const e = Ud(t, Pn.PoniesRoomEmotes);
    return uie(e);
  }
  function BD(t) {
    var _a6;
    const e = (_a6 = Qu(t, Zr.PoniesEmoteRooms)) == null ? void 0 : _a6.getContent();
    if (typeof e != "object") return [];
    const { rooms: n } = e;
    return typeof n != "object" ? [] : Object.keys(n).flatMap((a) => {
      if (typeof n[a] != "object") return [];
      const s = t.getRoom(a);
      if (!s) return [];
      const l = n[a], d = Ud(s, Pn.PoniesRoomEmotes).filter((u) => {
        const h = u.getStateKey();
        return typeof h == "string" ? !!l[h] : false;
      });
      return uie(d);
    });
  }
  function eW(t) {
    const e = Qu(t, Zr.PoniesUserEmotes), n = t.getUserId();
    return !e || !n ? void 0 : gh.fromMatrixEvent(n, e);
  }
  const Z4e = "sable:imgpk:v1";
  function kA(t, e) {
    return `${Z4e}:${t}:${e}`;
  }
  function J4e(t) {
    const e = {};
    return t.images.collection.forEach((n, r) => {
      e[r] = n.content;
    }), {
      pack: t.meta.content,
      images: e
    };
  }
  function X4e(t) {
    return t.map(({ id: e, content: n, address: r }) => {
      const i = r ? new die(r.roomId, r.stateKey) : void 0;
      return new gh(e, n, i);
    });
  }
  function Q4e(t) {
    return t.filter((e) => !e.deleted).map((e) => ({
      id: e.id,
      content: J4e(e),
      address: e.address ? {
        roomId: e.address.roomId,
        stateKey: e.address.stateKey
      } : void 0
    }));
  }
  function Qb(t, e) {
    try {
      const n = localStorage.getItem(kA(t, e));
      if (!n) return [];
      const r = JSON.parse(n);
      return Array.isArray(r) ? X4e(r) : [];
    } catch {
      return [];
    }
  }
  function eEe(t, e) {
    return Qb(t, e)[0];
  }
  function wk(t, e, n) {
    try {
      const r = Q4e(n);
      r.length === 0 ? localStorage.removeItem(kA(t, e)) : localStorage.setItem(kA(t, e), JSON.stringify(r));
    } catch {
    }
  }
  function hie(t, e, n) {
    wk(t, e, n ? [
      n
    ] : []);
  }
  const tW = () => "user", nW = () => "global", Q1 = (t) => `room:${t}`;
  class fie extends Map {
    toJSON() {
      return Object.fromEntries(this);
    }
  }
  class tEe extends Set {
    toJSON() {
      return Array.from(this);
    }
  }
  const PB = (t) => t.match(/^([@$+#])([^\s:]+):(\S+)$/), mie = (t) => !!PB(t), bo = (t) => {
    var _a6;
    return (_a6 = PB(t)) == null ? void 0 : _a6[3];
  }, MB = (t) => ![
    "1",
    "2",
    "3",
    "4",
    "5",
    "6"
  ].includes(t), G2 = (t) => ![
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7"
  ].includes(t), OB = (t) => ![
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9"
  ].includes(t), BF = (t) => ![
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "10",
    "11"
  ].includes(t), Xc = (t) => {
    const e = () => {
      var _a6;
      const d = ni(t, ce.RoomCreate);
      if (d && BF(d.getContent().room_version)) return d.getSender();
      const u = (_a6 = ni(t, ce.RoomPowerLevels)) == null ? void 0 : _a6.getContent();
      if (!u) return;
      const h = u.users;
      if (!h) return;
      let f;
      return Object.keys(h).forEach((g) => {
        const m = h[g];
        if (m === void 0 || m <= (u.users_default ?? 0)) return;
        if (!f) {
          f = g;
          return;
        }
        const v = h[f];
        v !== void 0 && m > v && (f = g);
      }), f;
    }, n = () => {
      const d = t.getMembers(), u = {};
      return d == null ? void 0 : d.forEach((h) => {
        const { userId: f } = h, g = bo(f);
        if (!g) return;
        const m = u[g];
        if (m === void 0) {
          u[g] = 1;
          return;
        }
        u[g] = m + 1;
      }), u;
    }, r = [], i = e();
    if (i) {
      const d = bo(i);
      d && r.push(d);
    }
    const a = n(), l = Object.keys(a).toSorted((d, u) => (a[u] ?? 0) - (a[d] ?? 0)).slice(0, 3);
    if (r.length === 0) return l;
    const c = r[0];
    return c && l.includes(c) && l.splice(l.indexOf(c), 1), r.concat(l.slice(0, 2));
  };
  if (globalThis.__js_sdk_entrypoint) throw new Error("Multiple matrix-js-sdk entrypoints detected!");
  globalThis.__js_sdk_entrypoint = true;
  var SA;
  try {
    SA = globalThis.indexedDB;
  } catch {
  }
  SA && Ure(() => new Ur(SA, "matrix-js-sdk:crypto"));
  globalThis.matrixcs = ZCe;
  function PD(t, e) {
    const n = e.getJoinRule() ?? kn.Invite, i = Ud(e, ce.SpaceParent).map((a) => a.getStateKey()).filter((a) => !!a).some((a) => {
      const s = t.getRoom(a);
      return !!(s == null ? void 0 : s.isSpaceRoom()) && (s == null ? void 0 : s.getJoinRule()) === kn.Public;
    });
    return n === kn.Invite || n === kn.Restricted && !i || n !== kn.Public && n !== kn.Knock && n !== kn.Restricted;
  }
  const p9 = /* @__PURE__ */ new Map(), uw = /* @__PURE__ */ new Map();
  function jA(t, e, n, r) {
    const i = new fie();
    if (!t.startsWith("mxc")) return i;
    const a = gie(t, e, n, r);
    return !(a == null ? void 0 : a.room_id) || !(a == null ? void 0 : a.state_key) || !(a == null ? void 0 : a.shortcode) || i.set(t, a), i;
  }
  function rW(t, e, n, r, i = false) {
    return n.filter((a) => a.getImages(r).find((s) => s.url === t)).map((a) => {
      var _a6, _b3, _c3;
      const s = a.getImages(r).find((u) => u.url === t), l = e.getRoom((_a6 = a.address) == null ? void 0 : _a6.roomId);
      if (!l || PD(e, l) && !i) return;
      const c = new tEe();
      l && Xc(l).forEach((u) => {
        c.add(u);
      });
      const d = bo(e.getSafeUserId());
      return d && c.add(d), {
        room_id: (_b3 = a.address) == null ? void 0 : _b3.roomId,
        state_key: (_c3 = a.address) == null ? void 0 : _c3.stateKey,
        via: c,
        shortcode: s == null ? void 0 : s.shortcode
      };
    }).find((a) => a != null);
  }
  function gie(t, e, n, r) {
    var _a6;
    if (!t.startsWith("mxc")) return {};
    if ((_a6 = uw.get(r.roomId)) == null ? void 0 : _a6.has(t)) return uw.get(r.roomId).get(t);
    const i = f1(r), a = rW(t, e, i, n, true);
    if (a) {
      const c = uw.get(r.roomId) ?? /* @__PURE__ */ new Map();
      c.set(t, a), uw.set(r.roomId, c);
    }
    if ((a == null ? void 0 : a.room_id) && (a == null ? void 0 : a.shortcode)) return a;
    if (p9.has(t)) return p9.get(t);
    const s = BD(e), l = rW(t, e, s, n, false);
    return (l == null ? void 0 : l.room_id) && (l == null ? void 0 : l.shortcode) ? (p9.set(t, l), l) : {};
  }
  const nEe = (t, e, n, r, i) => ({
    "m.relates_to": {
      event_id: t,
      key: e,
      rel_type: "m.annotation"
    },
    shortcode: i,
    "com.beeper.reaction.shortcode": i,
    [AD]: jA(e, n, Hr.Emoticon, r)
  }), rEe = /\b(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}\b/, iEe = (t) => rEe.test(t), _n = (t) => {
    var _a6;
    return (_a6 = PB(t)) == null ? void 0 : _a6[2];
  }, co = (t) => mie(t) && t.startsWith("@"), Bc = (t) => t.startsWith("!"), ml = (t) => mie(t) && t.startsWith("#"), eF = (t, e) => {
    var _a6, _b3;
    return (_b3 = (_a6 = t.getRooms()) == null ? void 0 : _a6.find((n) => n.getCanonicalAlias() === e && ni(n, ce.RoomTombstone) === void 0)) == null ? void 0 : _b3.roomId;
  }, wi = (t, e) => {
    const n = t.getRoom(e);
    if (!n || ni(n, ce.RoomTombstone) !== void 0) return e;
    const r = n.getCanonicalAlias();
    return r && eF(t, r) === e ? r : e;
  }, LB = (t, e) => {
    const n = {};
    return n.w = t.width, n.h = t.height, n.mimetype = e.type, n.size = e.size, n;
  }, oEe = (t, e) => {
    const n = {};
    return n.duration = Number.isNaN(t.duration) ? void 0 : Math.floor(t.duration * 1e3), n.w = t.videoWidth, n.h = t.videoHeight, n.mimetype = e.type, n.size = e.size, n;
  }, aEe = (t) => {
    const { thumbnail: e, encInfo: n, mxc: r, width: i, height: a } = t, s = {
      thumbnail_info: {
        mimetype: e.type,
        size: e.size,
        w: i,
        h: a
      }
    };
    return n ? s.thumbnail_file = {
      ...n,
      url: r
    } : s.thumbnail_url = r, s;
  }, sEe = (t) => {
    var _a6, _b3;
    if (t instanceof File) return t.name;
    const e = (_b3 = (_a6 = t.type.split("/")[1]) == null ? void 0 : _a6.split("+")[0]) == null ? void 0 : _b3.toLowerCase(), n = e && /^[a-z0-9]+$/.test(e) ? e : void 0;
    return `upload-${Date.now()}${n ? `.${n}` : ""}`;
  }, pie = async (t) => {
    const e = await t.arrayBuffer(), n = await rie.encryptAttachment(e), r = sEe(t), i = new File([
      n.data
    ], r, {
      type: t.type
    });
    return {
      encInfo: n.info,
      file: i,
      originalFile: t
    };
  }, Xf = async (t, e, n) => {
    const r = await rie.decryptAttachment(t, n);
    return new Blob([
      r
    ], {
      type: e
    });
  }, lEe = async (t, e, n) => {
    const { name: r, fileType: i, hideFilename: a, onProgress: s, onPromise: l, onSuccess: c, onError: d } = n, u = performance.now(), h = t.uploadContent(e, {
      name: r,
      type: i,
      includeFilename: !a,
      progressHandler: s
    });
    l == null ? void 0 : l(h);
    try {
      const f = await h, g = f.content_uri;
      if (g) {
        const m = e.type.split("/")[0] || "unknown";
        oa("sable.media.upload_latency_ms", performance.now() - u, {
          attributes: {
            type: m
          }
        }), oa("sable.media.upload_bytes", e.size, {
          attributes: {
            type: m
          }
        }), c(g);
      } else Vr("sable.media.upload_error", 1, {
        attributes: {
          reason: "no_uri"
        }
      }), d(new Un(f));
    } catch (f) {
      Vr("sable.media.upload_error", 1, {
        attributes: {
          reason: "exception"
        }
      });
      const g = f, m = typeof (g == null ? void 0 : g.message) == "string" ? g.message : void 0, v = typeof (g == null ? void 0 : g.name) == "string" ? g.name : void 0;
      d(new Un({
        error: m,
        errcode: v
      }));
    }
  }, Fie = (t) => (e) => e.getSender() === t, NB = (t) => typeof t.getContent().shortcode == "string", vie = (t, e) => t.getRooms().filter((r) => r.getMyMembership() === Ht.Join && r.hasEncryptionStateEvent() && r.getMembers().length <= 2).find((r) => r.getMember(e)), zB = (t, e) => {
    var _a6, _b3;
    const n = (a) => {
      let s, l;
      const c = (d) => {
        var _a7;
        d.userId !== e && (s === void 0 || d.events.member && d.events.member.getTs() < s) && (l = d, s = (_a7 = d.events.member) == null ? void 0 : _a7.getTs());
      };
      return a.forEach(c), l;
    }, r = n(t.getJoinedMembers());
    return r ? r.userId : ((_b3 = n(((_a6 = t.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getMembers()) ?? [])) == null ? void 0 : _b3.userId) ?? e;
  }, c4 = async (t, e, n) => {
    const r = t.getAccountData(ce.Direct);
    let i = {};
    typeof r < "u" && (i = structuredClone(r.getContent())), Object.keys(i).forEach((s) => {
      const l = i[s];
      if (s !== n) {
        const c = l.indexOf(e);
        c > -1 && l.splice(c, 1);
      }
    });
    const a = i[n] || [];
    a.indexOf(e) === -1 && a.push(e), i[n] = a, await t.setAccountData(ce.Direct, i);
  }, UB = async (t, e) => {
    const n = t.getAccountData(ce.Direct);
    let r = {};
    typeof n < "u" && (r = structuredClone(n.getContent())), Object.keys(r).forEach((i) => {
      const a = r[i], s = a.indexOf(e);
      s > -1 && a.splice(s, 1);
    }), await t.setAccountData(ce.Direct, r);
  }, Cn = (t, e, n, r, i, a, s) => t.mxcUrlToHttp(e.replace(/^["']|["']$/g, ""), r, i, a, s, void 0, n), Gd = async (t) => await (await fetch(t, {
    method: "GET"
  })).blob(), Qf = async (t, e) => {
    const n = await Gd(t);
    return await e(await n.arrayBuffer());
  }, iW = (t) => new Promise((e) => {
    setTimeout(e, t);
  }), Hu = async (t, e, n) => {
    let r = 0, i = 0;
    const a = async (s, l) => {
      const [c] = await ca(e(s, l));
      if ((c == null ? void 0 : c.httpStatus) === 429) {
        if (r === n) return;
        const d = c.getRetryAfterMs() ?? 3e3;
        i = d * 1.5, await iW(d), r += 1, await a(s, l);
      }
    };
    for (let s = 0; s < t.length; s += 1) {
      const l = t[s];
      r = 0, await a(l, s), i > 0 && await iW(i);
    }
  }, VB = (t, e, n, r, i, a) => {
    var _a6, _b3, _c3;
    const l = ((_a6 = ID(a ?? e.getUnfilteredTimelineSet(), n)) == null ? void 0 : _a6.getSortedAnnotationsByKey()) ?? [], [, c] = l.find(([f]) => f === r) ?? [], d = c ? Array.from(c) : [], u = d.find(Fie(t.getUserId()));
    if (u && ((_b3 = u.isRelation) == null ? void 0 : _b3.call(u))) {
      const f = u.getId();
      f && t.redactEvent(e.roomId, f);
      return;
    }
    const h = i || ((_c3 = d.find(NB)) == null ? void 0 : _c3.getContent().shortcode);
    t.sendEvent(e.roomId, ce.Reaction, nEe(n, r, t, e, h));
  }, _ie = p.createContext(null), yie = _ie.Provider;
  function Dk() {
    const t = p.useContext(_ie);
    if (!t) throw new Error("Server versions are not provided!");
    return t;
  }
  const hn = () => {
    const { versions: t, unstable_features: e } = Dk();
    return (e == null ? void 0 : e["org.matrix.msc3916.stable"]) || t.includes("v1.11");
  };
  var oW = "UserAvatar_UserAvatar__1f07iat0";
  const cEe = (t) => {
    t.currentTarget.setAttribute("data-image-loaded", "true");
  };
  function Si({ className: t, userId: e, src: n, alt: r, renderFallback: i }) {
    const [a, s] = p.useState(false);
    return p.useEffect(() => {
      s(false);
    }, [
      n
    ]), !n || a ? o.jsx(mp, {
      style: {
        backgroundColor: _p(e),
        color: ct.Surface.Container
      },
      className: gt(oW, t),
      children: i()
    }) : o.jsx(Xu, {
      className: gt(oW, t),
      src: n,
      alt: r,
      onError: () => s(true),
      onLoad: cEe,
      draggable: false
    });
  }
  function Hi({ initial: t, children: e }) {
    return e(...p.useState(t));
  }
  const Ps = (t, e) => {
    const n = localStorage.getItem(t);
    if (n === null) return e;
    if (n !== "undefined") try {
      return JSON.parse(n);
    } catch {
      return e;
    }
  }, Vd = (t, e) => {
    localStorage.setItem(t, JSON.stringify(e));
  }, ph = (t, e, n) => {
    const r = e(t), i = vn(r);
    return i.onMount = (s) => {
      const l = (c) => {
        c.key === t && s(e(t));
      };
      return window.addEventListener("storage", l), () => {
        window.removeEventListener("storage", l);
      };
    }, vn((s) => s(i), (s, l, c) => {
      l(i, c), n(t, c);
    });
  }, dEe = "navToActivePath", bie = (t) => `${dEe}${t}`, uEe = (t) => {
    const e = bie(t), n = ph(e, (i) => {
      const a = Ps(i, {});
      return new Map(Object.entries(a));
    }, (i, a) => {
      const s = Object.fromEntries(a);
      Vd(i, s);
    });
    return vn((i) => i(n), (i, a, s) => {
      if (s.type === "DELETE") {
        a(n, uo(i(n), (l) => {
          l.delete(s.navId);
        }));
        return;
      }
      s.type === "PUT" && a(n, uo(i(n), (l) => {
        l.set(s.navId, s.path);
      }));
    });
  }, hEe = (t) => {
    localStorage.removeItem(bie(t));
  }, fEe = () => localStorage.getItem("sable_debug") === "1", F9 = (t, e, ...n) => {
    if (!fEe() && e === "log") return;
    const r = `[sable:${t}]`;
    console[e](r, ...n);
  }, Po = (t) => ({
    log: (...e) => F9(t, "log", ...e),
    warn: (...e) => F9(t, "warn", ...e),
    error: (...e) => F9(t, "error", ...e)
  }), v9 = Po("sessions"), mEe = {
    sync: "web-sync-store",
    crypto: "crypto-store",
    rustCryptoPrefix: "matrix-js-sdk"
  };
  function gEe(t, e, n, r) {
    localStorage.setItem("cinny_access_token", t), localStorage.setItem("cinny_device_id", e), localStorage.setItem("cinny_user_id", n), localStorage.setItem("cinny_hs_base_url", r);
  }
  const pEe = () => {
    localStorage.removeItem("cinny_hs_base_url"), localStorage.removeItem("cinny_user_id"), localStorage.removeItem("cinny_device_id"), localStorage.removeItem("cinny_access_token");
  }, Ck = () => {
    const t = localStorage.getItem("cinny_hs_base_url"), e = localStorage.getItem("cinny_user_id"), n = localStorage.getItem("cinny_device_id"), r = localStorage.getItem("cinny_access_token");
    if (t && e && n && r) return {
      baseUrl: t,
      userId: e,
      deviceId: n,
      accessToken: r,
      fallbackSdkStores: true
    };
  }, Y2 = (t) => t.fallbackSdkStores ? mEe : {
    sync: `sync${t.userId}`,
    crypto: `crypto${t.userId}`,
    rustCryptoPrefix: `sync${t.userId}`
  }, e3 = "matrixSessions", j_ = ph(e3, (t) => {
    const n = Ps(t, []), r = Ck();
    return r && (pEe(), n.push(r), Vd(t, n)), n;
  }, (t, e) => {
    Vd(t, e);
  }), th = vn((t) => t(j_), (t, e, n) => {
    if (n.type === "PUT") {
      const r = [
        ...t(j_)
      ], i = r.findIndex((a) => a.userId === n.session.userId);
      i === -1 ? (v9.log("PUT new session", n.session.userId), r.push(n.session)) : (v9.log("PUT update session", n.session.userId), r.splice(i, 1, n.session)), e(j_, r);
      return;
    }
    if (n.type === "DELETE") {
      v9.log("DELETE session", n.session.userId);
      const r = t(j_).filter((i) => i.userId !== n.session.userId);
      e(j_, r);
    }
  }), xie = "matrixActiveSession", aW = ph(xie, (t) => Ps(t, void 0), (t, e) => Vd(t, e)), Fh = vn((t) => t(aW), (t, e, n) => {
    e(aW, n);
  }), t3 = vn(null), HB = vn(null), TA = vn({});
  function d4(t, e, n) {
    "serviceWorker" in navigator && navigator.serviceWorker.controller && navigator.serviceWorker.controller.postMessage({
      type: "setSession",
      accessToken: e,
      baseUrl: t,
      userId: n
    });
  }
  const n3 = /* @__PURE__ */ new Map();
  function FEe(t, e) {
    if (!(e instanceof Uint8Array)) throw new Error("Unable to store, privateKey is invalid.");
    n3.set(t, e);
  }
  function vEe(t) {
    return n3.get(t) instanceof Uint8Array;
  }
  function _Ee(t) {
    return n3.get(t);
  }
  function yEe() {
    n3.clear();
  }
  async function bEe({ keys: t }) {
    const n = Object.keys(t).find(vEe);
    if (!n) return;
    const r = _Ee(n);
    return [
      n,
      r
    ];
  }
  function xEe(t, e, n) {
    n3.set(t, n);
  }
  const wEe = {
    getSecretStorageKey: bEe,
    cacheSecretStorageKey: xEe
  }, p0 = Po("slidingSync"), go = fo("slidingSync"), DEe = "joined", CEe = "invites", EEe = "dms", hw = "search", kEe = "room_search", SEe = "space", MD = 1, jEe = 250, TEe = 2e4, REe = 5e3, m1 = [
    "by_recency",
    "by_name"
  ], sW = "unencrypted", AEe = 50, T_ = (t, e) => typeof t != "number" || Number.isNaN(t) || t <= 0 ? e : Math.round(t), wie = () => [
    [
      ce.RoomJoinRules,
      ""
    ],
    [
      ce.RoomAvatar,
      ""
    ],
    [
      ce.RoomTombstone,
      ""
    ],
    [
      ce.RoomEncryption,
      ""
    ],
    [
      ce.RoomCreate,
      ""
    ],
    [
      ce.RoomTopic,
      ""
    ],
    [
      ce.RoomCanonicalAlias,
      ""
    ],
    [
      ce.RoomMember,
      aB
    ],
    [
      "m.space.child",
      Pf
    ],
    [
      "im.ponies.room_emotes",
      Pf
    ],
    [
      "moe.sable.room.abbreviations",
      ""
    ]
  ], IEe = (t) => ({
    timeline_limit: t,
    required_state: [
      [
        Pf,
        Pf
      ]
    ]
  }), BEe = (t) => ({
    timeline_limit: t,
    required_state: [
      [
        Pf,
        Pf
      ],
      [
        ce.RoomMember,
        aB
      ],
      [
        ce.RoomMember,
        iDe
      ]
    ]
  }), PEe = (t, e) => {
    const n = /* @__PURE__ */ new Map(), r = wie(), i = Math.min(t, 100);
    return n.set(DEe, {
      ranges: [
        [
          0,
          Math.max(0, i - 1)
        ]
      ],
      sort: m1,
      timeline_limit: MD,
      required_state: r,
      slow_get_all_rooms: true,
      filters: {
        is_invite: false
      }
    }), e && n.set(CEe, {
      ranges: [
        [
          0,
          Math.max(0, i - 1)
        ]
      ],
      sort: m1,
      timeline_limit: MD,
      required_state: r,
      slow_get_all_rooms: true,
      filters: {
        is_invite: true
      }
    }), n.set(EEe, {
      ranges: [
        [
          0,
          Math.max(0, i - 1)
        ]
      ],
      sort: m1,
      timeline_limit: MD,
      required_state: r,
      slow_get_all_rooms: true,
      filters: {
        is_dm: true
      }
    }), n;
  }, lW = (t) => {
    var _a6;
    return ((_a6 = t == null ? void 0 : t.ranges) == null ? void 0 : _a6.length) ? t.ranges.reduce((e, n) => Math.max(e, n[1] ?? -1), -1) : -1;
  };
  class MEe {
    constructor(e) {
      __publicField(this, "enabled", true);
      this.mx = e;
    }
    setEnabled(e) {
      this.enabled = e;
    }
    name() {
      return "presence";
    }
    when() {
      return Mf.PostProcess;
    }
    async onRequest() {
      return {
        enabled: this.enabled
      };
    }
    async onResponse(e) {
      var _a6;
      if (!((_a6 = e == null ? void 0 : e.events) == null ? void 0 : _a6.length)) return;
      const n = this.mx.getEventMapper();
      e.events.forEach((r) => {
        const i = n(r), a = i.getSender() ?? i.getContent().user_id;
        if (!a) return;
        let s = this.mx.store.getUser(a);
        s ? s.setPresenceEvent(i) : (s = Md.createUser(a, this.mx), s.setPresenceEvent(i), this.mx.store.storeUser(s)), this.mx.emit(jt.Event, i);
      });
    }
  }
  class cW {
    constructor(e, n, r) {
      __publicField(this, "disposed", false);
      __publicField(this, "maxRooms");
      __publicField(this, "listKeys");
      __publicField(this, "activeRoomSubscriptions", /* @__PURE__ */ new Set());
      __publicField(this, "listPageSize");
      __publicField(this, "roomTimelineLimit");
      __publicField(this, "onConnectionChange");
      __publicField(this, "onLifecycle");
      __publicField(this, "onMembershipLeave");
      __publicField(this, "presenceExtension");
      __publicField(this, "listsFullyLoaded", false);
      __publicField(this, "initialSyncCompleted", false);
      __publicField(this, "syncCount", 0);
      __publicField(this, "previousListCounts", /* @__PURE__ */ new Map());
      __publicField(this, "pendingRoomDataListeners", /* @__PURE__ */ new Map());
      __publicField(this, "attachTime", null);
      __publicField(this, "initialSyncSpan", null);
      __publicField(this, "slidingSync");
      __publicField(this, "probeTimeoutMs");
      this.mx = e, this.proxyBaseUrl = n;
      const i = T_(r.listPageSize, jEe), a = T_(r.pollTimeoutMs, TEe);
      this.probeTimeoutMs = T_(r.probeTimeoutMs, 5e3), this.maxRooms = T_(r.maxRooms, REe), this.listPageSize = i;
      const s = r.includeInviteList !== false, l = T_(r.timelineLimit, AEe);
      this.roomTimelineLimit = l;
      const c = IEe(l), d = PEe(i, s);
      this.listKeys = Array.from(d.keys()), this.slidingSync = new oDe(n, d, c, e, a), this.presenceExtension = new MEe(e), this.slidingSync.registerExtension(this.presenceExtension), this.slidingSync.addCustomSubscription(sW, BEe(l)), this.onLifecycle = (u, h, f) => {
        var _a6, _b3;
        const g = performance.now();
        if (this.syncCount += 1, Vr("sable.sync.cycle", 1, {
          attributes: {
            transport: "sliding",
            state: u
          }
        }), go.info("sync", `Sliding sync lifecycle: ${u} (cycle #${this.syncCount})`, {
          state: u,
          hasError: !!f,
          syncNumber: this.syncCount,
          isInitialSync: !this.initialSyncCompleted
        }), f && (go.error("sync", "Sliding sync error", {
          error: f,
          errorMessage: f.message,
          syncNumber: this.syncCount,
          state: u
        }), Vr("sable.sync.error", 1, {
          attributes: {
            transport: "sliding",
            state: u
          }
        })), this.disposed) {
          go.warn("sync", "Sync lifecycle called after disposal", {
            state: u
          });
          return;
        }
        if (u === Dg.RequestFinished && h && !f) {
          const b = h.rooms ?? {};
          Object.entries(b).filter(([, j]) => j.initial || j.limited).filter(([j]) => this.activeRoomSubscriptions.has(j)).forEach(([j]) => {
            const k = this.mx.getRoom(j);
            if (!k) return;
            const C = k.getUnfilteredTimelineSet();
            C.getLiveTimeline().getEvents().length !== 0 && C.resetLiveTimeline();
          });
        }
        if (f || !h || u !== Dg.Complete) return;
        const m = {};
        let v = 0, y = false;
        this.listKeys.forEach((b) => {
          var _a7;
          const k = ((_a7 = this.slidingSync.getListData(b)) == null ? void 0 : _a7.joinedCount) ?? 0, C = this.previousListCounts.get(b) ?? 0;
          v += k, k !== C && (m[b] = {
            previous: C,
            current: k,
            delta: k - C
          }, this.previousListCounts.set(b, k), y = true);
        }), (y || !this.initialSyncCompleted) && go.info("sync", "Room counts changed in sync cycle", {
          syncNumber: this.syncCount,
          changes: m,
          totalRoomCount: v,
          isInitialSync: !this.initialSyncCompleted
        });
        const w = performance.now() - g;
        if (!this.initialSyncCompleted) {
          this.initialSyncCompleted = true;
          const b = this.attachTime != null ? performance.now() - this.attachTime : w;
          go.info("sync", "Initial sync completed", {
            syncNumber: this.syncCount,
            totalRoomCount: v,
            listCounts: Object.fromEntries(this.listKeys.map((j) => {
              var _a7;
              return [
                j,
                ((_a7 = this.slidingSync.getListData(j)) == null ? void 0 : _a7.joinedCount) ?? 0
              ];
            })),
            timeElapsed: `${b.toFixed(2)}ms`
          }), oa("sable.sync.initial_ms", b, {
            attributes: {
              transport: "sliding"
            }
          }), (_a6 = this.initialSyncSpan) == null ? void 0 : _a6.setAttributes({
            "sync.cycles_to_ready": this.syncCount,
            "sync.rooms_at_ready": v
          }), (_b3 = this.initialSyncSpan) == null ? void 0 : _b3.end(), this.initialSyncSpan = null;
        }
        this.expandListsToKnownCount(), oa("sable.sync.processing_ms", w, {
          attributes: {
            transport: "sliding"
          }
        }), w > 1e3 && go.warn("sync", "Slow sync cycle detected", {
          syncNumber: this.syncCount,
          duration: `${w.toFixed(2)}ms`,
          totalRoomCount: v
        });
      }, this.onMembershipLeave = (u, h) => {
        h.userId === this.mx.getUserId() && (h.membership !== Ht.Leave && h.membership !== Ht.Ban || this.activeRoomSubscriptions.has(h.roomId) && this.unsubscribeFromRoom(h.roomId));
      }, this.onConnectionChange = () => {
        const u = navigator.onLine, h = typeof navigator < "u" ? navigator.connection : void 0, f = h == null ? void 0 : h.effectiveType, g = h == null ? void 0 : h.downlink;
        go.info("network", `Network connectivity changed: ${u ? "online" : "offline"}`, {
          online: u,
          effectiveType: f,
          downlink: g ? `${g} Mbps` : void 0
        }), u ? go.info("network", "Device back online - sync will resume", {
          syncNumber: this.syncCount
        }) : go.warn("network", "Device went offline - sync paused", {
          syncNumber: this.syncCount
        });
      };
    }
    attach() {
      var _a6;
      go.info("sync", "Attaching sliding sync listeners", {
        proxyBaseUrl: this.proxyBaseUrl,
        listPageSize: this.listPageSize,
        roomTimelineLimit: this.roomTimelineLimit,
        maxRooms: this.maxRooms,
        lists: this.listKeys
      }), this.attachTime = performance.now(), this.initialSyncSpan = z1e({
        name: "sync.initial",
        op: "matrix.sync",
        attributes: {
          "sync.transport": "sliding",
          "sync.proxy": this.proxyBaseUrl
        }
      }), this.slidingSync.on(nl.Lifecycle, this.onLifecycle), this.mx.on(Ui.Membership, this.onMembershipLeave);
      const e = typeof navigator < "u" ? navigator.connection : void 0;
      (_a6 = e == null ? void 0 : e.addEventListener) == null ? void 0 : _a6.call(e, "change", this.onConnectionChange), e && e.onchange === null && (e.onchange = this.onConnectionChange), typeof window < "u" && (window.addEventListener("online", this.onConnectionChange), window.addEventListener("offline", this.onConnectionChange)), go.info("sync", "Sliding sync listeners attached successfully", {
        hasConnectionAPI: !!e,
        hasWindowEvents: typeof window < "u"
      });
    }
    dispose() {
      var _a6;
      if (this.disposed) return;
      go.info("sync", "Disposing sliding sync", {
        syncCount: this.syncCount,
        initialSyncCompleted: this.initialSyncCompleted
      }), this.pendingRoomDataListeners.clear(), this.disposed = true, this.slidingSync.stop(), this.slidingSync.removeListener(nl.Lifecycle, this.onLifecycle), this.mx.removeListener(Ui.Membership, this.onMembershipLeave);
      const e = typeof navigator < "u" ? navigator.connection : void 0;
      (_a6 = e == null ? void 0 : e.removeEventListener) == null ? void 0 : _a6.call(e, "change", this.onConnectionChange), (e == null ? void 0 : e.onchange) === this.onConnectionChange && (e.onchange = null), typeof window < "u" && (window.removeEventListener("online", this.onConnectionChange), window.removeEventListener("offline", this.onConnectionChange)), go.info("sync", "Sliding sync disposed successfully", {
        totalSyncCycles: this.syncCount
      });
    }
    setPresenceEnabled(e) {
      this.presenceExtension.setEnabled(e);
    }
    getDiagnostics() {
      return {
        proxyBaseUrl: this.proxyBaseUrl,
        timelineLimit: this.roomTimelineLimit,
        listPageSize: this.listPageSize,
        lists: this.listKeys.map((e) => {
          const n = this.slidingSync.getListData(e), r = this.slidingSync.getListParams(e);
          return {
            key: e,
            knownCount: (n == null ? void 0 : n.joinedCount) ?? 0,
            rangeEnd: lW(r)
          };
        })
      };
    }
    expandListsToKnownCount() {
      if (this.listsFullyLoaded) return;
      let e = true, n = false;
      const r = performance.now(), i = {};
      this.listKeys.forEach((l) => {
        var _a6;
        const d = ((_a6 = this.slidingSync.getListData(l)) == null ? void 0 : _a6.joinedCount) ?? 0;
        if (d <= 0) {
          i[l] = {
            status: "empty",
            knownCount: 0
          };
          return;
        }
        const u = this.slidingSync.getListParams(l), h = lW(u), f = Math.min(d, this.maxRooms) - 1;
        if (h >= f) {
          i[l] = {
            status: "complete",
            knownCount: d,
            currentEnd: h
          };
          return;
        }
        e = false;
        const m = Math.min(h + 100, f);
        if (m === h) {
          i[l] = {
            status: "complete",
            knownCount: d,
            currentEnd: h,
            desiredEnd: m
          };
          return;
        }
        this.slidingSync.setListRanges(l, [
          [
            0,
            m
          ]
        ]), n = true, i[l] = {
          status: "expanding",
          knownCount: d,
          previousEnd: h,
          newEnd: m,
          roomsToLoad: m - h
        }, go.info("sync", `Expanding list "${l}" to full range`, {
          list: l,
          knownCount: d,
          previousEnd: h,
          newEnd: m,
          roomsToLoad: m - h
        }), d > this.maxRooms && (p0.warn(`Sliding Sync list "${l}" capped at ${this.maxRooms}/${d} rooms for ${this.mx.getUserId()}`), go.warn("sync", `List "${l}" exceeds maxRooms limit`, {
          list: l,
          knownCount: d,
          maxRooms: this.maxRooms,
          cappedCount: this.maxRooms
        }));
      });
      const a = performance.now() - r, s = Object.values(i).some((l) => l.status === "expanding");
      if (e) {
        this.listsFullyLoaded = true, p0.log(`Sliding Sync all lists fully loaded for ${this.mx.getUserId()}`);
        const l = this.listKeys.reduce((d, u) => {
          var _a6;
          return d + (((_a6 = this.slidingSync.getListData(u)) == null ? void 0 : _a6.joinedCount) ?? 0);
        }, 0), c = this.attachTime != null ? Math.round(performance.now() - this.attachTime) : 0;
        oa("sable.sync.lists_loaded_ms", c, {
          attributes: {
            transport: "sliding"
          }
        }), bg("sable.sync.total_rooms", l, {
          attributes: {
            transport: "sliding"
          }
        });
      } else n && p0.log(`Sliding Sync lists expanding... for ${this.mx.getUserId()}`);
      s && go.info("sync", "List expansion completed", {
        syncNumber: this.syncCount,
        lists: i,
        timeElapsed: `${a.toFixed(2)}ms`
      }), a > 500 && go.warn("sync", "Slow list expansion detected", {
        duration: `${a.toFixed(2)}ms`,
        expandedLists: Object.keys(i).filter((l) => {
          var _a6;
          return ((_a6 = i[l]) == null ? void 0 : _a6.status) === "expanding";
        })
      });
    }
    ensureListRegistered(e, n) {
      let r = this.slidingSync.getListParams(e);
      if (!r) r = {
        ranges: [
          [
            0,
            20
          ]
        ],
        sort: m1,
        timeline_limit: MD,
        required_state: wie(),
        ...n
      };
      else {
        const i = {
          ...r,
          ...n
        };
        if (JSON.stringify(r) === JSON.stringify(i)) return r;
        r = i;
      }
      try {
        n.ranges && Object.keys(n).length === 1 ? this.slidingSync.setListRanges(e, n.ranges) : this.slidingSync.setList(e, r);
      } catch (i) {
        go.warn("sync", `Failed to update list "${e}"`, {
          list: e,
          error: i instanceof Error ? i.message : String(i),
          updateType: n.ranges && Object.keys(n).length === 1 ? "ranges" : "full"
        });
      }
      return this.slidingSync.getListParams(e) ?? r;
    }
    async startSpidering(e, n) {
      if (await new Promise((l) => {
        setTimeout(l, n);
      }), this.disposed) return;
      let r = e - 1, i = true, a = true, s = 0;
      await Mg({
        name: "sync.spidering",
        op: "matrix.sync",
        attributes: {
          "sync.transport": "sliding"
        }
      }, async (l) => {
        var _a6;
        const c = [
          [
            ce.RoomJoinRules,
            ""
          ],
          [
            ce.RoomAvatar,
            ""
          ],
          [
            ce.RoomTombstone,
            ""
          ],
          [
            ce.RoomEncryption,
            ""
          ],
          [
            ce.RoomCreate,
            ""
          ],
          [
            ce.RoomTopic,
            ""
          ],
          [
            ce.RoomCanonicalAlias,
            ""
          ],
          [
            ce.RoomMember,
            aB
          ],
          [
            "m.space.child",
            Pf
          ],
          [
            "im.ponies.room_emotes",
            Pf
          ]
        ];
        for (; i; ) {
          if (this.disposed) return;
          s += 1;
          const u = [
            [
              0,
              r
            ]
          ];
          try {
            a ? this.slidingSync.setList(hw, {
              ranges: u,
              sort: [
                "by_recency"
              ],
              timeline_limit: 0,
              required_state: c
            }) : this.slidingSync.setListRanges(hw, u);
          } catch {
          } finally {
            await new Promise((f) => {
              setTimeout(f, n);
            });
          }
          if (this.disposed) return;
          const h = this.slidingSync.getListData(hw);
          i = r + 1 < ((h == null ? void 0 : h.joinedCount) ?? 0), r += e, a = false;
        }
        const d = ((_a6 = this.slidingSync.getListData(hw)) == null ? void 0 : _a6.joinedCount) ?? 0;
        l.setAttributes({
          "spidering.batches": s,
          "spidering.total_rooms": d
        }), p0.log(`Sliding Sync spidering complete for ${this.mx.getUserId()}`);
      });
    }
    setRoomNameSearch(e) {
      if (this.disposed) return;
      const n = (e == null ? void 0 : e.trim()) ?? "", r = n ? {
        room_name_like: n
      } : {};
      this.ensureListRegistered(kEe, {
        filters: r,
        ranges: [
          [
            0,
            19
          ]
        ],
        sort: m1
      });
    }
    setSpaceScope(e) {
      if (this.disposed) return;
      const n = e ? {
        is_invite: false,
        spaces: [
          e
        ]
      } : {
        is_invite: false
      };
      this.ensureListRegistered(SEe, {
        filters: n,
        ranges: e ? [
          [
            0,
            Math.min(this.listPageSize - 1, 499)
          ]
        ] : [
          [
            0,
            0
          ]
        ],
        sort: m1
      });
    }
    subscribeToRoom(e) {
      if (this.disposed) return;
      const n = this.mx.getRoom(e), r = this.mx.isRoomEncrypted(e);
      n && !r && this.slidingSync.useCustomSubscription(e, sW), this.activeRoomSubscriptions.add(e), this.slidingSync.modifyRoomSubscriptions(new Set(this.activeRoomSubscriptions)), bg("sable.sync.active_subscriptions", this.activeRoomSubscriptions.size, {
        attributes: {
          transport: "sliding"
        }
      }), p0.log(`Sliding Sync active room subscription added: ${e}`), go.info("sync", "Room subscription requested (sliding)", {
        encrypted: r,
        unknownRoom: !n,
        activeSubscriptions: this.activeRoomSubscriptions.size,
        syncCycle: this.syncCount
      }), wa({
        category: "sync.sliding",
        message: "Subscribed to room (active)",
        level: "info",
        data: {
          encrypted: r,
          activeSubscriptions: this.activeRoomSubscriptions.size
        }
      });
      const i = this.pendingRoomDataListeners.get(e);
      i && this.slidingSync.removeListener(nl.RoomData, i);
      const a = performance.now(), s = (l) => {
        var _a6;
        if (l !== e) return;
        const c = Math.round(performance.now() - a), u = ((_a6 = this.mx.getRoom(e)) == null ? void 0 : _a6.getLiveTimeline().getEvents().length) ?? 0;
        go.info("sync", "Room subscription: first data received (sliding)", {
          latencyMs: c,
          syncCycle: this.syncCount,
          eventCount: u
        }), oa("sable.sync.room_sub_latency_ms", c, {
          attributes: {
            transport: "sliding"
          }
        }), oa("sable.sync.room_sub_event_count", u, {
          attributes: {
            transport: "sliding"
          }
        }), wa({
          category: "sync.sliding",
          message: `Room subscription data arrived (${u} events, ${c}ms)`,
          level: "info",
          data: {
            latencyMs: c,
            eventCount: u,
            syncCycle: this.syncCount
          }
        }), this.slidingSync.removeListener(nl.RoomData, s), this.pendingRoomDataListeners.delete(e);
      };
      this.pendingRoomDataListeners.set(e, s), this.slidingSync.on(nl.RoomData, s);
    }
    unsubscribeFromRoom(e) {
      if (this.disposed) return;
      const n = this.pendingRoomDataListeners.get(e);
      n && (this.slidingSync.removeListener(nl.RoomData, n), this.pendingRoomDataListeners.delete(e)), this.activeRoomSubscriptions.delete(e), this.slidingSync.modifyRoomSubscriptions(new Set(this.activeRoomSubscriptions)), bg("sable.sync.active_subscriptions", this.activeRoomSubscriptions.size, {
        attributes: {
          transport: "sliding"
        }
      }), p0.log(`Sliding Sync active room subscription removed: ${e}`), go.info("sync", "Room subscription removed (sliding)", {
        remainingSubscriptions: this.activeRoomSubscriptions.size,
        syncCycle: this.syncCount
      });
    }
    static async probe(e, n, r) {
      return Mg({
        name: "sync.probe",
        op: "matrix.sync",
        attributes: {
          "sync.proxy": n
        }
      }, async (i) => {
        try {
          const a = await e.slidingSync({
            lists: {
              probe: {
                ranges: [
                  [
                    0,
                    0
                  ]
                ],
                timeline_limit: 1,
                required_state: []
              }
            },
            timeout: 0,
            clientTimeout: r
          }, n), s = typeof a.pos == "string" && a.pos.length > 0;
          return i.setAttribute("probe.supported", s), s;
        } catch {
          return i.setAttribute("probe.supported", false), false;
        }
      });
    }
  }
  const os = Po("initMatrix"), To = fo("initMatrix"), Z2 = /* @__PURE__ */ new WeakMap(), RA = /* @__PURE__ */ new WeakMap(), OEe = 3e4, LEe = 2e4, u4 = /* @__PURE__ */ new WeakMap(), g1 = /* @__PURE__ */ new WeakMap(), dW = 2e4;
  function uW(t, e) {
    var _a6;
    (_a6 = g1.get(t)) == null ? void 0 : _a6();
    const { stubOnCacheMiss: n } = e, r = t, i = t.fetchRoomEvent.bind(t);
    let a = false;
    const s = () => {
      a || (a = true, g1.delete(t), r.fetchRoomEvent = i, t.off(jt.Sync, l));
    }, l = (c) => {
      (c === Nn.Prepared || c === Nn.Syncing) && s();
    };
    r.fetchRoomEvent = (c, d) => {
      var _a7;
      if (a) return i(c, d);
      const u = (_a7 = t.getRoom(c)) == null ? void 0 : _a7.findEventById(d);
      if (u) return Promise.resolve(u.event);
      if (n) {
        const h = {
          event_id: d,
          room_id: c
        };
        return Promise.resolve(h);
      }
      return i(c, d);
    }, t.on(jt.Sync, l), g1.set(t, s);
  }
  const Die = (t) => {
    if (t === void 0) return false;
    if (typeof t == "boolean") return t;
    const e = String(t).trim().toLowerCase();
    return e === "false" || e === "0" || e === "off" || e === "no" ? false : e === "true" || e === "1" || e === "on" || e === "yes";
  }, Pc = (t) => new Promise((e) => {
    const n = window.indexedDB.deleteDatabase(t);
    n.addEventListener("success", () => e()), n.addEventListener("error", () => e()), n.addEventListener("blocked", () => e());
  }), hW = async (t) => {
    await Promise.all([
      Pc(t),
      Pc(t.replace(/^sync/, "crypto")),
      Pc(`${t}::matrix-sdk-crypto`)
    ]);
  }, Cie = async (t) => {
    await Promise.all([
      Pc(t.sync),
      Pc(t.crypto),
      Pc(`${t.rustCryptoPrefix}::matrix-sdk-crypto`)
    ]);
  }, h4 = (t) => new Promise((e) => {
    let n = false;
    const r = (a) => {
      n || (n = true, e(a));
    }, i = window.indexedDB.open(t);
    i.addEventListener("error", () => r(void 0)), i.addEventListener("success", () => {
      const a = i.result;
      try {
        if (!a.objectStoreNames.contains("account")) a.close(), r(void 0);
        else {
          const c = a.transaction("account", "readonly").objectStore("account").get("account");
          c.addEventListener("success", () => {
            a.close();
            const d = c.result;
            if (!(d == null ? void 0 : d.account_data)) r(void 0);
            else try {
              const u = JSON.parse(d.account_data);
              r((u == null ? void 0 : u.user_id) ?? void 0);
            } catch {
              r(void 0);
            }
          }), c.addEventListener("error", () => {
            a.close(), r(void 0);
          });
        }
      } catch {
        try {
          a.close();
        } catch {
        }
        r(void 0);
      }
    });
  }), fW = async (t) => {
    try {
      return (await window.indexedDB.databases()).some((n) => n.name === t);
    } catch {
      return false;
    }
  }, _9 = (t) => t === "PREPARED" || t === "SYNCING" || t === "CATCHUP", mW = (t) => {
    const e = t instanceof Error ? t.message : String(t);
    return e.includes("doesn't match") || e.includes("does not match") || e.includes("account in the store") || e.includes("account in the constructor");
  }, NEe = (t, e) => new Promise((n) => {
    const r = performance.now();
    let i = false;
    const a = () => {
      if (i) return;
      i = true, t.removeListener(jt.Sync, c), clearTimeout(s);
      const d = performance.now() - r;
      oa("sable.sync.client_ready_ms", d, {
        attributes: {
          timed_out: String(l)
        }
      }), l && wa({
        category: "sync",
        message: "waitForClientReady timed out \u2014 client may be stuck",
        level: "warning",
        data: {
          timeout_ms: e
        }
      }), n();
    };
    if (_9(t.getSyncState())) {
      oa("sable.sync.client_ready_ms", 0, {
        attributes: {
          timed_out: "false"
        }
      }), a();
      return;
    }
    let s = 0, l = false;
    const c = (d) => {
      To.info("sync", `Sync state changed: ${d}`, {
        state: d,
        ready: _9(d)
      }), _9(d) && a();
    };
    s = window.setTimeout(() => {
      l = true, a();
    }, e), t.on(jt.Sync, c);
  }), zEe = async () => {
    const t = Ps(e3, []), e = new Set(t.map((i) => i.userId)), n = new Set(t.flatMap((i) => {
      const a = Y2(i);
      return [
        a.sync,
        a.crypto,
        `${a.rustCryptoPrefix}::matrix-sdk-crypto`
      ];
    }));
    let r = [];
    try {
      r = await window.indexedDB.databases();
    } catch {
    }
    await Promise.all(r.map(async ({ name: i }) => {
      if (!i) return;
      const a = Array.from(e).some((d) => i.includes(d));
      if (i.includes("@") && !a && !n.has(i)) {
        os.warn(`clearMismatchedStores: "${i}" has unknown user \u2014 deleting`), await Pc(i);
        return;
      }
      if (!i.startsWith("sync")) return;
      const l = await h4(i);
      if (!l) return;
      if (!e.has(l)) {
        os.warn(`clearMismatchedStores: "${i}" has unknown user ${l} \u2014 deleting`), await hW(i);
        return;
      }
      const c = `sync${l}`;
      i !== c && !n.has(i) && (os.warn(`clearMismatchedStores: "${i}" is misplaced for ${l} \u2014 deleting`), await hW(i));
    })), await Promise.all(t.map(async (i) => {
      const a = Y2(i), s = await h4(a.sync);
      s && s !== i.userId && (os.warn(`clearMismatchedStores: "${a.sync}" has ${s} but session is ${i.userId} \u2014 deleting`), await Cie(a));
    }));
  }, y9 = async (t) => {
    const e = Y2(t), n = new EB({
      indexedDB: global.indexedDB,
      localStorage: global.localStorage,
      dbName: e.sync
    }), r = new Ur(global.indexedDB, e.crypto), i = Zf({
      baseUrl: t.baseUrl,
      accessToken: t.accessToken,
      userId: t.userId,
      store: n,
      cryptoStore: r,
      deviceId: t.deviceId,
      timelineSupport: true,
      cryptoCallbacks: wEe,
      verificationMethods: [
        "m.sas.v1"
      ]
    });
    return await n.startup(), i;
  }, Eie = async (t) => {
    const e = Y2(t);
    To.info("sync", "Initializing Matrix client", {
      userId: t.userId,
      baseUrl: t.baseUrl
    });
    const n = async () => {
      os.warn("initClient: wiping all stores for", t.userId), To.warn("sync", "Wiping all stores due to mismatch", {
        userId: t.userId
      }), wa({
        category: "crypto",
        message: "Crypto store mismatch \u2014 wiping local stores and retrying",
        level: "warning"
      }), Vr("sable.crypto.store_wipe", 1), await Cie(e);
      try {
        const i = await window.indexedDB.databases();
        await Promise.all(i.map(async ({ name: a }) => {
          a && a.includes(t.userId) && (os.warn("initClient: also wiping db", a), await Pc(a));
        }));
      } catch {
      }
    };
    let r;
    try {
      r = await y9(t);
    } catch (i) {
      if (!mW(i)) throw To.error("sync", "Failed to build client", {
        error: i
      }), i;
      os.warn("initClient: mismatch on buildClient \u2014 wiping and retrying:", i), To.warn("sync", "Client build mismatch - wiping stores and retrying", {
        error: i
      }), await n(), r = await y9(t);
    }
    try {
      await r.initRustCrypto({
        cryptoDatabasePrefix: e.rustCryptoPrefix
      });
    } catch (i) {
      if (!mW(i)) throw To.error("sync", "Failed to initialize crypto", {
        error: i
      }), i;
      os.warn("initClient: mismatch on initRustCrypto \u2014 wiping and retrying:", i), To.warn("sync", "Crypto init mismatch - wiping stores and retrying", {
        error: i
      }), r.stopClient(), await n(), r = await y9(t), await r.initRustCrypto({
        cryptoDatabasePrefix: e.rustCryptoPrefix
      });
    }
    return r.setMaxListeners(50), r;
  }, AA = (t) => {
    const e = Z2.get(t);
    e && (e.dispose(), Z2.delete(t));
  }, kie = (t) => Z2.get(t), Sie = async (t, e) => {
    var _a6;
    To.info("sync", "Starting Matrix client", {
      userId: t.getUserId()
    }), AA(t);
    const n = e == null ? void 0 : e.slidingSync, r = Die(n == null ? void 0 : n.enabled), i = r && (e == null ? void 0 : e.sessionSlidingSyncOptIn) === true, a = (n == null ? void 0 : n.proxyBaseUrl) ?? (e == null ? void 0 : e.baseUrl), s = typeof a == "string" && a.trim().length > 0;
    os.log("startClient sliding config", {
      userId: t.getUserId(),
      enabled: n == null ? void 0 : n.enabled,
      enabledOnServer: r,
      sessionOptIn: (e == null ? void 0 : e.sessionSlidingSyncOptIn) === true,
      requestedEnabled: i,
      proxyBaseUrl: a,
      hasSlidingProxy: s
    }), To.info("sync", "Sliding sync configuration", {
      enabledOnServer: r,
      requested: i,
      hasProxy: s
    });
    const l = 45e3, c = async (m, v) => {
      var _a7;
      u4.set(t, {
        transport: "classic",
        slidingConfigured: r,
        slidingEnabledOnServer: r,
        sessionOptIn: (e == null ? void 0 : e.sessionSlidingSyncOptIn) === true,
        slidingRequested: i,
        fallbackFromSliding: m,
        reason: v
      }), Vr("sable.sync.transport", 1, {
        attributes: {
          transport: "classic",
          reason: v,
          fallback: String(m)
        }
      });
      const y = new Promise((B) => {
        window.setTimeout(() => {
          To.warn("sync", "Classic sync startup timed out", {
            userId: t.getUserId(),
            timeoutMs: l
          }), B();
        }, l);
      }), w = (e == null ? void 0 : e.pollTimeoutMs) ?? OEe, b = (e == null ? void 0 : e.timelineLimit) ?? 10, j = new ns(t.getUserId() ?? void 0);
      j.setTimelineLimit(b);
      const k = j.getDefinition();
      k.room && (k.room.timeline = k.room.timeline ?? {}, k.room.timeline.lazy_load_members = true), uW(t, {
        stubOnCacheMiss: true
      });
      let C;
      try {
        C = t.startClient({
          lazyLoadMembers: true,
          pollTimeout: w,
          threadSupport: true,
          filter: j
        });
      } catch (B) {
        throw (_a7 = g1.get(t)) == null ? void 0 : _a7(), B;
      }
      await Promise.race([
        C,
        y
      ]);
      let x = 0;
      const S = performance.now();
      let T = false;
      const A = (B, U, z) => {
        var _a8, _b3, _c3;
        if (x += 1, Vr("sable.sync.cycle", 1, {
          attributes: {
            transport: "classic",
            state: B
          }
        }), To.info("sync", `Classic sync state: ${B}`, {
          state: B,
          prevState: U ?? "null",
          syncNumber: x,
          error: (_a8 = z == null ? void 0 : z.error) == null ? void 0 : _a8.message
        }), (B === Nn.Error || B === Nn.Reconnecting) && (To.warn("sync", `Classic sync problem: ${B}`, {
          state: B,
          prevState: U ?? "null",
          errorMessage: (_b3 = z == null ? void 0 : z.error) == null ? void 0 : _b3.message,
          syncNumber: x
        }), Vr("sable.sync.error", 1, {
          attributes: {
            transport: "classic",
            state: B
          }
        }), wa({
          category: "sync.classic",
          message: `Classic sync problem: ${B}`,
          level: "warning",
          data: {
            state: B,
            prevState: U,
            error: (_c3 = z == null ? void 0 : z.error) == null ? void 0 : _c3.message,
            syncNumber: x
          }
        })), !T && (B === Nn.Syncing || B === Nn.Prepared)) {
          T = true;
          const O = performance.now() - S;
          To.info("sync", "Classic sync initial ready", {
            state: B,
            syncNumber: x,
            elapsed: `${O.toFixed(0)}ms`
          }), oa("sable.sync.initial_ms", O, {
            attributes: {
              transport: "classic"
            }
          });
        }
      };
      RA.set(t, A), t.on(jt.Sync, A);
    }, d = async () => {
      if ((n == null ? void 0 : n.bootstrapClassicOnColdCache) === false) return false;
      const m = t.getUserId();
      if (!m) return false;
      const [v, y, w, b] = await Promise.all([
        h4(`sync${m}`),
        h4("web-sync-store"),
        fW(`sync${m}`),
        fW("web-sync-store")
      ]);
      return !(v === m || y === m || w || b);
    };
    if (!r || !i) {
      await c(false, r ? "session_opt_out" : "sliding_disabled_server");
      return;
    }
    if (!s) {
      await c(false, "missing_proxy");
      return;
    }
    if (await d()) {
      os.log("startClient cold-cache bootstrap: using classic sync for this run", t.getUserId()), await c(false, "cold_cache_bootstrap"), NEe(t, dW).catch((m) => {
        To.warn("network", "Cold cache bootstrap timed out", {
          userId: t.getUserId(),
          timeout: `${dW}ms`,
          error: m instanceof Error ? m.message : String(m)
        });
      });
      return;
    }
    const u = a, h = (() => {
      const m = n == null ? void 0 : n.probeTimeoutMs;
      return typeof m == "number" && !Number.isNaN(m) && m > 0 ? Math.round(m) : 5e3;
    })(), f = await cW.probe(t, u, h);
    if (os.log("startClient sliding probe result", {
      userId: t.getUserId(),
      requestedEnabled: i,
      hasSlidingProxy: s,
      proxyBaseUrl: u,
      supported: f
    }), !f) {
      os.warn("Sliding Sync unavailable, falling back to classic sync for", t.getUserId()), To.warn("network", "Sliding Sync probe failed, falling back to classic sync", {
        userId: t.getUserId(),
        proxyBaseUrl: u,
        probeTimeout: `${h}ms`
      }), await c(true, "probe_failed_fallback");
      return;
    }
    const g = new cW(t, u, {
      ...n,
      includeInviteList: true,
      pollTimeoutMs: (n == null ? void 0 : n.pollTimeoutMs) ?? LEe
    });
    g.attach(), Z2.set(t, g), u4.set(t, {
      transport: "sliding",
      slidingConfigured: true,
      slidingEnabledOnServer: r,
      sessionOptIn: (e == null ? void 0 : e.sessionSlidingSyncOptIn) === true,
      slidingRequested: i,
      fallbackFromSliding: false,
      reason: "sliding_active"
    }), Vr("sable.sync.transport", 1, {
      attributes: {
        transport: "sliding",
        reason: "sliding_active",
        fallback: "false"
      }
    });
    try {
      uW(t, {
        stubOnCacheMiss: false
      }), await t.startClient({
        lazyLoadMembers: true,
        slidingSync: g.slidingSync,
        threadSupport: true
      });
    } catch (m) {
      throw (_a6 = g1.get(t)) == null ? void 0 : _a6(), To.error("network", "Failed to start client with sliding sync", {
        error: m instanceof Error ? m.message : String(m),
        userId: t.getUserId(),
        proxyBaseUrl: u,
        stack: m instanceof Error ? m.stack : void 0
      }), AA(t), m;
    }
  }, $u = (t) => {
    var _a6;
    os.log("stopClient", t.getUserId()), To.info("sync", "Stopping client", {
      userId: t.getUserId()
    }), (_a6 = g1.get(t)) == null ? void 0 : _a6(), AA(t);
    const e = RA.get(t);
    e && (t.removeListener(jt.Sync, e), RA.delete(t)), t.stopClient(), u4.delete(t);
  }, jie = async (t) => {
    os.log("clearCacheAndReload", t.getUserId()), $u(t), hEe(t.getSafeUserId()), await t.store.deleteAllData(), window.location.reload();
  }, $B = (t) => {
    var _a6;
    return {
      ...u4.get(t) ?? {
        transport: "classic",
        slidingConfigured: false,
        slidingEnabledOnServer: false,
        sessionOptIn: false,
        slidingRequested: false,
        fallbackFromSliding: false,
        reason: "unknown"
      },
      syncState: t.getSyncState(),
      sliding: (_a6 = Z2.get(t)) == null ? void 0 : _a6.getDiagnostics()
    };
  }, f4 = async (t, e) => {
    os.log("logoutClient", {
      userId: t.getUserId(),
      sessionUserId: e == null ? void 0 : e.userId
    }), To.info("general", "Logging out client", {
      userId: t.getUserId()
    }), d4(), $u(t);
    try {
      await t.logout(), To.info("general", "Logout successful", {
        userId: t.getUserId()
      });
    } catch {
    }
    if (e) {
      const n = Y2(e);
      await t.clearStores({
        cryptoDatabasePrefix: n.rustCryptoPrefix
      }), await Pc(n.sync), await Pc(n.crypto), await Pc(`${n.rustCryptoPrefix}::matrix-sdk-crypto`);
    } else await t.clearStores(), window.localStorage.clear();
  }, UEe = async () => {
    To.info("general", "Clearing all login data and reloading"), (await window.indexedDB.databases()).forEach((e) => {
      const { name: n } = e;
      n && window.indexedDB.deleteDatabase(n);
    }), window.localStorage.clear(), window.location.reload();
  }, bp = (t, e) => {
    p.useEffect(() => {
      if (t) return t.on(jt.AccountData, e), () => {
        t.removeListener(jt.AccountData, e);
      };
    }, [
      t,
      e
    ]);
  };
  function vh(t) {
    const e = be(), [n, r] = p.useState(() => e.getAccountData(t));
    return bp(e, p.useCallback((i) => {
      i.getType() === t && r(i);
    }, [
      t,
      r
    ])), n;
  }
  const WB = () => {
    var _a6;
    return !!((_a6 = vh("m.cross_signing.master")) == null ? void 0 : _a6.getContent());
  }, Tie = async (t, e, n) => {
    const r = await t.getDeviceVerificationStatus(e, n);
    return r ? r.crossSigningVerified : null;
  }, qB = (t) => {
    const e = be();
    p.useEffect(() => (e.on(oi.DevicesUpdated, t), () => {
      e.removeListener(oi.DevicesUpdated, t);
    }), [
      e,
      t
    ]);
  }, VEe = [
    "devices"
  ];
  function Rie() {
    const t = be(), e = p.useCallback(async () => (await t.getDevices()).devices ?? [], [
      t
    ]), { data: n, refetch: r } = ol({
      queryKey: VEe,
      queryFn: e,
      staleTime: 0,
      gcTime: 1 / 0,
      refetchOnMount: "always"
    }), i = p.useCallback(async () => {
      await r();
    }, [
      r
    ]);
    return qB(p.useCallback((a) => {
      const s = t.getUserId();
      s && a.includes(s) && i();
    }, [
      t,
      i
    ])), [
      n ?? void 0,
      i
    ];
  }
  const Aie = (t) => p.useMemo(() => (t == null ? void 0 : t.map((n) => n.device_id)) ?? [], [
    t
  ]), Iie = (t) => {
    const n = be().getDeviceId(), r = p.useMemo(() => t == null ? void 0 : t.find((a) => a.device_id === n), [
      t,
      n
    ]), i = p.useMemo(() => t == null ? void 0 : t.filter((a) => a.device_id !== n), [
      t,
      n
    ]);
    return [
      r,
      i
    ];
  };
  var Wu = ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Unverified = 1] = "Unverified", t[t.Verified = 2] = "Verified", t[t.Unsupported = 3] = "Unsupported", t))(Wu || {});
  const HEe = (t, e, n, r) => {
    const i = be(), a = p.useCallback(async () => {
      if (t && n) {
        const s = await Tie(t, e, n);
        if (s === null) {
          r(3);
          return;
        }
        r(s ? 2 : 1);
        return;
      }
      r(0);
    }, [
      t,
      n,
      e,
      r
    ]);
    p.useEffect(() => {
      a();
    }, [
      i,
      a,
      e
    ]), qB(p.useCallback((s) => {
      s.includes(e) && a();
    }, [
      e,
      a
    ]));
  }, Ek = (t, e, n) => {
    const [r, i] = p.useState(0);
    return HEe(t, e, n, i), r;
  }, Bie = (t, e, n) => {
    const [r, i] = p.useState(), a = Kr(), s = p.useCallback(async () => {
      let l = 0;
      if (t) {
        const c = n.map((h) => Tie(t, e, h)), d = await Promise.allSettled(c);
        _R(d).forEach((h) => {
          h === false && (l += 1);
        });
      }
      a() && i(l);
    }, [
      t,
      e,
      n,
      a
    ]);
    return qB(p.useCallback((l) => {
      l.includes(e) && s();
    }, [
      e,
      s
    ])), p.useEffect(() => {
      s();
    }, [
      s
    ]), r;
  };
  var Pi = "Text_BreakWord__11dexfy0", KB = "Text_LineClamp2__11dexfy1", IA = "Text_LineClamp3__11dexfy2", $Ee = "styles_InfoCard__1o8gwz10";
  function Lf({ variant: t = "Primary", title: e, description: n, before: r, beforeAlign: i = "Start", after: a, children: s }) {
    return o.jsxs(E, {
      direction: "Column",
      className: gt($Ee, ro({
        variant: t
      })),
      gap: "300",
      children: [
        o.jsxs(E, {
          gap: "200",
          alignItems: "Center",
          children: [
            r && o.jsx(E, {
              shrink: "No",
              alignSelf: i,
              children: r
            }),
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              gap: "100",
              children: [
                e && o.jsx(D, {
                  size: "L400",
                  className: Pi,
                  children: e
                }),
                n && o.jsx(D, {
                  size: "T200",
                  className: Pi,
                  children: n
                })
              ]
            }),
            a && o.jsx(E, {
              shrink: "No",
              children: a
            })
          ]
        }),
        s
      ]
    });
  }
  const Pie = p.forwardRef(({ handleClose: t }, e) => {
    const n = be(), r = !!n.getRooms().find((d) => d.hasEncryptionStateEvent()), i = WB(), a = Ek(n.getCrypto(), n.getSafeUserId(), n.getDeviceId() ?? void 0), [s, l] = Et(p.useCallback(async () => {
      await f4(n);
    }, [
      n
    ])), c = s.status === ve.Loading;
    return o.jsxs(lr, {
      variant: "Surface",
      ref: e,
      children: [
        o.jsx(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
            borderBottomWidth: ee.borderWidth.B300
          },
          variant: "Surface",
          size: "500",
          children: o.jsx(E, {
            grow: "Yes",
            children: o.jsx(D, {
              size: "H4",
              children: "Logout"
            })
          })
        }),
        o.jsxs(E, {
          style: {
            padding: ee.space.S400
          },
          direction: "Column",
          gap: "400",
          children: [
            r && (i ? a === Wu.Unverified && o.jsx(Lf, {
              variant: "Critical",
              title: "Unverified Device",
              description: "Verify your device before logging out to save your encrypted messages."
            }) : o.jsx(Lf, {
              variant: "Critical",
              title: "Alert",
              description: "Enable device verification or export your encrypted data from settings to avoid losing access to your messages."
            })),
            o.jsx(D, {
              priority: "400",
              children: "You\u2019re about to log out. Are you sure?"
            }),
            s.status === ve.Error && o.jsxs(D, {
              style: {
                color: ct.Critical.Main
              },
              size: "T300",
              children: [
                "Failed to logout! ",
                s.error.message
              ]
            }),
            o.jsxs(E, {
              direction: "Column",
              gap: "200",
              children: [
                o.jsx(xe, {
                  variant: "Critical",
                  onClick: l,
                  disabled: c,
                  before: c && o.jsx(dt, {
                    variant: "Critical",
                    fill: "Solid",
                    size: "200"
                  }),
                  children: o.jsx(D, {
                    size: "B400",
                    children: "Logout"
                  })
                }),
                o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  onClick: t,
                  disabled: c,
                  children: o.jsx(D, {
                    size: "B400",
                    children: "Cancel"
                  })
                })
              ]
            })
          ]
        })
      ]
    });
  });
  var WEe = Jr({
    defaultClassName: "style_SequenceCard__vcjo52",
    variantClassNames: {
      radii: {
        0: "style_SequenceCard_radii_0__vcjo53",
        300: "style_SequenceCard_radii_300__vcjo54",
        400: "style_SequenceCard_radii_400__vcjo55",
        500: "style_SequenceCard_radii_500__vcjo56"
      },
      outlined: {
        true: "style_SequenceCard_outlined_true__vcjo57"
      },
      mergeBorder: {
        true: "style_SequenceCard_mergeBorder_true__vcjo58"
      }
    },
    defaultVariants: {
      radii: "400"
    },
    compoundVariants: []
  });
  const Te = ft(({ as: t = "div", className: e, variant: n, radii: r, firstChild: i, lastChild: a, outlined: s, mergeBorder: l, ...c }, d) => o.jsx(E, {
    as: t,
    className: gt(WEe({
      radii: r,
      outlined: s,
      mergeBorder: l
    }), ro({
      variant: n
    }), e),
    "data-sequence-card": "true",
    "data-first-child": i,
    "data-last-child": a,
    ...c,
    ref: d
  })), $y = "/login/:server?/", m4 = "/register/:server?/", g4 = "/reset-password/:server?/", p4 = "create/", qEe = "join/", Mie = "lobby/", F4 = "search/", p1 = ":roomIdOrAlias/:eventId?/", J2 = "/home/", KEe = `/home/${p4}`, GEe = `/home/${F4}`, GB = `/home/${p1}`, X2 = "/direct/", YEe = `/direct/${p4}`, YB = `/direct/${p1}`, Q2 = "/:spaceIdOrAlias/", ZEe = `/:spaceIdOrAlias/${Mie}`, JEe = `/:spaceIdOrAlias/${F4}`, ZB = `/:spaceIdOrAlias/${p1}`, Oie = "featured/", Lie = ":server/", eb = "/explore/", XEe = `/explore/${Oie}`, QEe = `/explore/${Lie}`, Nie = "/create", zie = "notifications/", Uie = "invites/", tb = "/inbox/", eke = `/inbox/${zie}`, tke = `/inbox/${Uie}`, nke = "/to", rke = `${nke}/:user_id/:room_id/:event_id?`, PF = "/settings/:section?/", r3 = (t) => t.pathname + t.search + t.hash, gl = (t, e) => {
    const n = new URLSearchParams(e);
    return `${t}?${n}`;
  }, JB = (t) => t.join(","), BA = (t) => t.split(","), PA = (t) => {
    const e = `${ho(window.location.origin)}/sable`;
    return (t == null ? void 0 : t.enabled) ? `${ho(e)}/#${t.basename}` : e;
  }, ike = (t, e) => `${ho(t)}${e}`, MA = (t, e) => {
    const n = t.indexOf("#");
    if (n > -1) {
      const r = e.indexOf("#"), i = Ay(t.slice(n + 1)), s = Ay(e.slice(r + 1)).slice(i.length);
      return `/${Ay(s)}`;
    }
    return e.slice(ho(t).length);
  }, Hd = (t) => {
    const e = t ? {
      server: encodeURIComponent(t)
    } : void 0;
    return hl($y, e);
  }, oke = (t) => {
    const e = t ? {
      server: encodeURIComponent(t)
    } : void 0;
    return hl(m4, e);
  }, ake = (t) => {
    const e = t ? {
      server: encodeURIComponent(t)
    } : void 0;
    return hl(g4, e);
  }, $c = () => J2, XB = () => KEe, QB = () => GEe, Xg = (t, e) => {
    const n = {
      roomIdOrAlias: encodeURIComponent(t),
      eventId: e ? encodeURIComponent(e) : null
    };
    return hl(GB, n);
  }, eP = () => X2, kk = () => YEe, xp = (t, e) => {
    const n = {
      roomIdOrAlias: encodeURIComponent(t),
      eventId: e ? encodeURIComponent(e) : null
    };
    return hl(YB, n);
  }, Sk = (t) => {
    const e = {
      spaceIdOrAlias: encodeURIComponent(t)
    };
    return hl(Q2, e);
  }, Qg = (t) => {
    const e = {
      spaceIdOrAlias: encodeURIComponent(t)
    };
    return hl(ZEe, e);
  }, tP = (t) => {
    const e = {
      spaceIdOrAlias: encodeURIComponent(t)
    };
    return hl(JEe, e);
  }, tF = (t, e, n) => {
    const r = {
      spaceIdOrAlias: encodeURIComponent(t),
      roomIdOrAlias: encodeURIComponent(e),
      eventId: n ? encodeURIComponent(n) : null
    };
    return hl(ZB, r);
  }, nb = () => eb, jk = () => XEe, ep = (t) => {
    const e = {
      server: encodeURIComponent(t)
    };
    return hl(QEe, e);
  }, Vie = () => Nie, nP = () => tb, Tk = () => eke, i3 = () => tke, ig = (t, e) => {
    const n = ho(hl(PF, {
      section: t ?? null
    }));
    if (!e) return n;
    const r = {
      focus: e
    };
    return `${n}?${new URLSearchParams(r).toString()}`;
  }, Rk = [
    {
      id: "general",
      label: "General"
    },
    {
      id: "account",
      label: "Account"
    },
    {
      id: "persona",
      label: "Persona"
    },
    {
      id: "appearance",
      label: "Appearance"
    },
    {
      id: "notifications",
      label: "Notifications"
    },
    {
      id: "devices",
      label: "Devices"
    },
    {
      id: "emojis",
      label: "Emojis & Stickers"
    },
    {
      id: "developer-tools",
      label: "Developer Tools"
    },
    {
      id: "experimental",
      label: "Experimental"
    },
    {
      id: "about",
      label: "About"
    },
    {
      id: "keyboard-shortcuts",
      label: "Keyboard Shortcuts"
    }
  ], rP = (t) => Rk.some((e) => e.id === t), Hie = "moe.sable.client.action", OA = "settings", ske = /^[a-z0-9-]+$/, gW = /["<>]/, $ie = Object.fromEntries(Rk.map((t) => [
    t.id,
    t.label
  ])), lke = {
    general: [
      "client-side-embeds",
      "composer-formatting-toolbar",
      "custom-date-format",
      "date-format",
      "disable-media-auto-load",
      "display-bundled-embeds",
      "display-multiple-embeds",
      "embed-youtube-links",
      "emoji-selector-threshold",
      "enable-swiping",
      "encrypted-room-embeds",
      "encrypted-room-url-preview",
      "enter-for-newline",
      "error-reporting",
      "file-description-placement",
      "hide-member-events-read-only-rooms",
      "hide-membership-change",
      "hide-profile-change",
      "hide-read-receipts",
      "hide-typing-indicators",
      "large-room-call-button",
      "markdown-formatting",
      "message-layout",
      "message-spacing",
      "presence-status",
      "reply-notifications",
      "right-aligned-bubbles",
      "right-swipe-action",
      "session-replay",
      "show-hidden-events",
      "show-redacted-message-tombstones",
      "sync-across-devices",
      "sync-status",
      "twenty-four-hour-time-format",
      "url-preview",
      "use-sliding-sync",
      "join-on-click-voicecalls"
    ],
    account: [
      "about-you",
      "avatar",
      "banner",
      "blocked-users",
      "display-name",
      "email-address",
      "has-cats",
      "is-cat",
      "user-hero-color",
      "matrix-id",
      "name-color",
      "name-color-dark-theme",
      "name-color-light-theme",
      "pronouns",
      "render-animals",
      "status",
      "timezone"
    ],
    persona: [
      "enable-pk-commands",
      "enable-pk-shorthands"
    ],
    appearance: [
      "autoplay-emojis",
      "autoplay-gifs",
      "autoplay-stickers",
      "blur-avatars",
      "blur-emotes",
      "blur-media",
      "code-block-dark-theme",
      "code-block-light-theme",
      "code-block-manual-theme",
      "code-block-system-theme",
      "collapse-folders-by-default",
      "colorful-names",
      "consistent-icon-style",
      "browse-remote-catalog",
      "customize-dm-cards",
      "custom-profile-cards",
      "dark-theme",
      "display-room-banners",
      "jumbo-emoji-size",
      "light-theme",
      "manual-theme",
      "message-link-preview",
      "page-zoom",
      "pixelated-image-rendering",
      "catalog-themes",
      "catalog-tweaks",
      "theme-browse-remote",
      "theme-catalog-clear-remote",
      "theme-chat-sable-widgets",
      "theme-chat-auto-approved",
      "theme-chat-auto-any",
      "theme-import-open",
      "theme-local-sync-system",
      "pronoun-pill-max-count",
      "pronoun-pill-max-length",
      "pronoun-pills-for-all",
      "reduced-motion",
      "render-global-username-colors",
      "render-space-room-fonts",
      "render-space-room-username-colors",
      "saturation",
      "selected-language-for-pronouns",
      "show-easter-eggs",
      "show-pronoun-pills",
      "show-pronouns-only-in-selected-language",
      "subspace-hierarchy-limit",
      "system-theme",
      "twitter-emoji",
      "underline-links",
      "show-room-icons",
      "show-room-home-icons",
      "sidebar-size",
      "incoming-inline-images-default-height",
      "incoming-inline-images-max-height",
      "link-preview-image-max-height"
    ],
    notifications: [
      "background-push-notifications",
      "clear-notifications-when-read-elsewhere",
      "contains-display-name",
      "contains-username",
      "direct-messages",
      "direct-messages-encrypted",
      "email-notification",
      "favicon-dot-mentions-only",
      "highlight-mentions",
      "in-app-notification-sound",
      "in-app-notifications",
      "mention-room",
      "mention-user-id",
      "reset-all-push-notifications",
      "rooms",
      "rooms-encrypted",
      "select-keyword",
      "show-dm-counts",
      "show-encrypted-message-content",
      "show-mention-counts",
      "show-message-content",
      "show-room-counts",
      "system-notifications"
    ],
    devices: [
      "device-dashboard",
      "device-verification",
      "export-messages-data",
      "import-messages-data"
    ],
    emojis: [
      "default-pack",
      "select-pack"
    ],
    "developer-tools": [
      "access-token",
      "enable-developer-tools",
      "export-debug-logs",
      "global-account-data",
      "sentry-category-call",
      "sentry-category-error",
      "sentry-category-general",
      "sentry-category-message",
      "sentry-category-network",
      "sentry-category-notification",
      "sentry-category-sync",
      "sentry-category-timeline",
      "sentry-category-ui",
      "session-activity",
      "session-error-budget",
      "session-replay",
      "traces-profiles"
    ],
    experimental: [
      "bandwidth-saving-emojis",
      "sharehistory-command",
      "show-personas-tab"
    ],
    about: [
      "base-url",
      "clear-cache-and-reload",
      "domain",
      "federation-url",
      "homeserver-compiler",
      "homeserver-name",
      "homeserver-version",
      "report-an-issue"
    ],
    "keyboard-shortcuts": []
  }, cke = Rk.reduce((t, e) => (t[e.id] = new Set(lke[e.id]), t), {}), iP = (t) => {
    if (!(!t || !ske.test(t))) return t;
  }, dke = (t, e) => cke[t].has(e), Wie = (t) => {
    const e = new URLSearchParams(t);
    if (Array.from(e.entries()).some(([s, l]) => gW.test(s) || gW.test(l))) return;
    const n = e.getAll("focus");
    if (n.length > 1) return;
    const r = n[0];
    if (r !== void 0 && iP(r) === void 0) return;
    const i = e.getAll(Hie);
    if (i.length > 1) return;
    const a = i[0];
    if (!(a !== void 0 && a !== OA)) return {
      focus: r,
      hasActionMarker: a === OA
    };
  }, uke = (t) => {
    const [e, n = ""] = t.split("?"), r = new URLSearchParams(n);
    return r.set(Hie, OA), `${e}?${r.toString()}`;
  }, LA = (t) => {
    if (!t.startsWith("/settings/")) return;
    const [e = "", n = ""] = t.split("?"), r = e.match(/^\/settings\/([^/]+)\/?$/);
    if (!r) return;
    const i = r[1];
    if (!rP(i)) return;
    const a = Wie(n);
    if (a && !(a.focus && !dke(i, a.focus))) return {
      section: i,
      focus: a.focus
    };
  }, hke = (t) => {
    var _a6;
    return ((_a6 = Wie(t)) == null ? void 0 : _a6.hasActionMarker) === true;
  }, fke = (t) => {
    var _a6;
    return (_a6 = t.match(/(\/settings\/[^/]+\/?)$/)) == null ? void 0 : _a6[1];
  }, pW = (t, e) => {
    if (!hke(e)) return;
    const n = fke(t);
    if (!n) return;
    const r = e ? `${n}?${e}` : n;
    return LA(r) ? r : void 0;
  }, mke = (t, e) => {
    const n = new URL(t), r = new URL(e);
    if (n.origin === r.origin) {
      if (n.hash) {
        const i = n.hash.replace(/\/+$/, "");
        if (!(r.hash === i || r.hash.startsWith(`${i}/`))) return;
      }
      return MA(t, e);
    }
  }, gke = (t) => {
    const e = new URL(t), n = pW(e.pathname, e.search.replace(/^\?/, ""));
    if (n) return n;
    const r = e.hash.startsWith("#") ? e.hash.slice(1) : e.hash;
    if (!r) return;
    const [i = "", a = ""] = r.split("?");
    return pW(i, a);
  }, pke = (t, e, n) => ike(t, uke(ig(e, n))), qie = (t) => t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "), Fke = (t, e) => {
    const n = $ie[t], r = e ? qie(e) : void 0;
    return r ? `Settings > ${n} > ${r}` : `Settings > ${n}`;
  }, vke = (t, e) => {
    const n = $ie[t], r = e ? qie(e) : void 0;
    return r ? `${n} / ${r}` : n;
  }, Ak = (t, e) => {
    try {
      const n = mke(t, e);
      if (n) return LA(n);
      const r = gke(e);
      return r ? LA(r) : void 0;
    } catch {
      return;
    }
  }, MF = (t) => t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), Kie = (t, e) => t.composedPath().find((r) => {
    var _a6;
    return (_a6 = r.matches) == null ? void 0 : _a6.call(r, e);
  }), NA = () => !!document.activeElement && (document.activeElement.nodeName.toLowerCase() === "input" || document.activeElement.nodeName.toLowerCase() === "textarea" || document.activeElement.getAttribute("contenteditable") === "true" || document.activeElement.getAttribute("role") === "input" || document.activeElement.getAttribute("role") === "textarea"), Gie = (t) => {
    const e = [];
    for (let n = 0; n < t.length; n += 1) {
      const r = t[n];
      r instanceof File && e.push(r);
    }
    return e;
  }, _ke = (t, e) => new Promise((n) => {
    const r = document.createElement("input");
    r.type = "file", t && (r.accept = t), e && (r.multiple = true);
    const i = () => {
      const a = r.files;
      if (!a) n(void 0);
      else {
        const s = Gie(a);
        n(e ? s : s[0]);
      }
      r.removeEventListener("change", i);
    };
    r.addEventListener("change", i), r.click();
  }), Yie = (t) => {
    const e = t.files, n = Gie(e);
    if (n.length !== 0) return n;
  }, FW = (t, e) => new File([
    t
  ], e, {
    type: t.type
  }), yke = async (t) => await (await fetch(t)).blob(), Zie = (t) => URL.createObjectURL(t), bke = (t) => URL.createObjectURL(t), oP = (t) => new Promise((e, n) => {
    const r = document.createElement("img");
    r.addEventListener("load", () => e(r)), r.addEventListener("error", (i) => n(i)), r.src = t;
  }), xke = (t) => new Promise((e, n) => {
    const r = document.createElement("video");
    r.preload = "metadata", r.playsInline = true, r.muted = true, r.addEventListener("loadeddata", () => {
      e(r), r.pause();
    }), r.addEventListener("error", (i) => {
      n(i);
    }), r.src = t, r.load(), r.play();
  }), wke = (t, e) => {
    let i = t, a = e;
    return a > 300 && (i = Math.floor(i * (300 / a)), a = 300), i > 400 && (a = Math.floor(a * (400 / i)), i = 400), [
      i,
      a
    ];
  }, Dke = (t, e, n, r) => new Promise((i) => {
    const a = document.createElement("canvas");
    a.width = e, a.height = n;
    const s = a.getContext("2d");
    if (!s) {
      i(void 0);
      return;
    }
    s.drawImage(t, 0, 0, e, n), a.toBlob((l) => {
      i(l ?? void 0);
    }, r ?? "image/jpeg");
  }), Jo = async (t) => {
    if (navigator.clipboard) try {
      return await navigator.clipboard.writeText(t), true;
    } catch {
      return false;
    }
    const e = document.body, n = document.createElement("input");
    n.style.position = "fixed", n.style.opacity = "0", n.value = t, e.append(n), n.select(), n.setSelectionRange(0, 99999);
    let r = false;
    try {
      r = document.execCommand("Copy");
    } catch {
      r = false;
    }
    return n.remove(), r;
  }, b9 = (t) => {
    const e = document.querySelector("#favicon");
    e && e.setAttribute("href", t);
  }, aP = (t) => {
    const e = t.message.match(/position\s(\d+)\s/);
    if (!e) return;
    const n = e[1], r = parseInt(n, 10);
    if (!Number.isNaN(r)) return r;
  }, Jie = (t) => "Notification" in window ? window.Notification.permission === t : false, wp = (t) => ({
    x: t.clientX,
    y: t.clientY,
    width: 0,
    height: 0
  }), vW = (t, e, n = "text/css") => {
    const r = new Blob([
      t
    ], {
      type: n
    }), i = URL.createObjectURL(r), a = document.createElement("a");
    a.href = i, a.download = e, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
  };
  function Dp(t = 1500, e = false) {
    const [n, r] = p.useState(e), i = p.useRef(null), a = () => {
      i.current !== null && (clearTimeout(i.current), i.current = null);
    }, s = p.useCallback(() => {
      r(!e), a(), i.current = window.setTimeout(() => {
        r(e), i.current = null;
      }, t);
    }, [
      t,
      e
    ]);
    return p.useEffect(() => () => {
      a();
    }, []), [
      n,
      s
    ];
  }
  const Xie = p.createContext(null), Cke = Xie.Provider, Eke = () => p.useContext(Xie);
  var kke = "SettingTile_settingTileRoot__9wiw2o0", Ske = "SettingTile_settingTileTitleRow__9wiw2o1", jke = "SettingTile_settingTileSettingLinkActionTransparentBackground__9wiw2o3", Tke = "SettingTile_settingTileSettingLinkAction__9wiw2o4 SettingTile_settingLinkActionBase__9wiw2o2", Rke = "SettingTile_settingTileSettingLinkActionDesktopHidden__9wiw2o5 SettingTile_settingLinkActionBase__9wiw2o2", Ake = "SettingTile_settingTileSettingLinkActionMobileVisible__9wiw2o6 SettingTile_settingLinkActionBase__9wiw2o2";
  function Ike({ baseUrl: t, section: e, focusId: n }) {
    const r = fr(), [i, a] = Dp(), s = pke(t, e, n);
    return o.jsx(Oe, {
      "aria-label": i ? "Copied settings link" : "Copy settings link",
      className: [
        Tke,
        jke,
        r === sn.Desktop ? Rke : Ake
      ].join(" "),
      onClick: async () => {
        await Jo(s) && a();
      },
      size: "300",
      variant: "Surface",
      fill: "None",
      radii: "Inherit",
      children: o.jsx(Q, {
        src: i ? q.Check : q.Link,
        size: "50"
      })
    });
  }
  function Ie({ focusId: t, showSettingLinkAction: e = true, className: n, title: r, description: i, before: a, after: s, children: l }) {
    const c = Eke(), d = c && t && e ? o.jsx(Ike, {
      baseUrl: c.baseUrl,
      section: c.section,
      focusId: t
    }) : null, u = r ? d : null, h = r ? null : d, f = s || h ? o.jsxs(E, {
      shrink: "No",
      alignItems: "Center",
      gap: "200",
      children: [
        s,
        h
      ]
    }) : null;
    return o.jsxs(E, {
      id: t,
      "data-settings-focus": t,
      className: [
        kke,
        n
      ].filter(Boolean).join(" "),
      alignItems: "Center",
      gap: "300",
      children: [
        a && o.jsx(E, {
          shrink: "No",
          children: a
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          gap: "100",
          children: [
            r && o.jsxs(E, {
              "data-setting-tile-title-row": "true",
              className: Ske,
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(D, {
                  className: Pi,
                  size: "T300",
                  children: r
                }),
                u
              ]
            }),
            i && o.jsx(D, {
              className: Pi,
              size: "T200",
              priority: "300",
              children: i
            }),
            l
          ]
        }),
        f
      ]
    });
  }
  const tp = "data:image/svg+xml,%3csvg%20viewBox='0%200%20512%20512'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20fill='%231a1c28'%20cx='256'%20cy='256'%20r='256'/%3e%3cpath%20fill='%239987f7'%20d='M%20281.22266,61.638672%20C%20252.51454,62.340869%20242.25,96.445312%20242.25,96.445312%20c%200,0%2021.86199,-0.227888%2038.08398,2%2019.65916,2.699828%2036.77735,8.470708%2036.77735,8.470708%200,0%20-12.11665,-45.858806%20-35.88867,-45.277348%20z%20M%20176.44531,79.111328%20c%20-48.18496,2.028265%20-80.827932,69.713192%20-12.08398,159.111332%200.80656,1.04883%20-3.85279,2.3732%20-12.25,-6.08399%20-14.29505,-14.39719%20-25.27735,-39.58398%20-25.27735,-39.58398%200,0%20-30.436281,90.74068%20-54.556636,125.36133%20-11.322288,16.25087%20-23.296412,29.36278%20-34.673828,40.0664%2036.151472,77.35634%20112.144354,132.24302%20201.664064,138.37696%200.39018,-1.71398%200.87261,-3.37593%201.17773,-5.13672%2012.03483,-69.44913%2043.76694,-131.34524%20116.10938,-144.72266%2087.13409,-16.11287%20100.05664,-65.19531%20100.05664,-65.19531%200,0%20-22.84799,-6.68744%20-23.72266,-24.47071%20-0.72761,-14.76952%2026.44531,-16%2026.44531,-16%200,0%20-16.78002,-12.90506%20-42.25,-31.02929%20-14.15717,-10.07649%20-23.71663,-44.74674%20-63.55664,-75.52735%20-42.51354,-32.84961%20-109.55468,-29.36132%20-109.55468,-29.36132%200,0%2011.18932,19.49626%2011.88867,25.47265%201.15061,9.83808%20-4.14406,0.85935%20-4.80664,-0.19336%20-20.4065,-35.136179%20-46.82452,-50.026406%20-69.88867,-51.083982%20-1.58601,-0.07268%20-3.16642,-0.06541%20-4.72071,0%20z%20M%20331.66602,200.88867%20c%2011.37691,-0.77289%2021.73754,6.54405%2024.80664,17.52735%20l%200.88867,6.47265%20c%200,12.65369%20-9.79136,23.13771%20-22.41602,24%20-12.62504,0.86151%20-23.7539,-8.18586%20-25.47265,-20.72265%20-1.71877,-12.53682%206.55284,-24.26336%2018.94336,-26.83204%201.07319,-0.22215%202.15627,-0.37139%203.25,-0.44531%20z'/%3e%3cpath%20fill='%237b6dc4'%20d='m%20177.84845,197.13285%20c%200,0%20-44.43023,-63.57598%20-8.46796,-99.538252%2026.21392,-26.213922%2064.86752,30.516502%2064.86752,30.516502%200,0%20-40.50667,-3.42071%20-42.97866,11.82315%20-1.00026,6.16799%2014.37955,10.70468%2014.37955,10.70468%200,0%20-10.86453,14.69916%20-15.49793,22.44815%20-4.63345,7.74898%20-12.30252,24.04577%20-12.30252,24.04577%20z'/%3e%3c/svg%3e";
  var Xe = "styles_SequenceCardStyle__cljb820", Qie = "styles_settingsHeader__cljb821", Bke = "layout_messageJumpHighlight__1r9nvas9";
  function Qc({ title: t, requestBack: e, requestClose: n, titleAs: r, backLabel: i, actionLabel: a, children: s }) {
    const l = fr(), c = a ?? "Close", d = l === sn.Mobile && e;
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          className: Qie,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsxs(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: [
                  d && o.jsx(Oe, {
                    "aria-label": i ?? "Back",
                    onClick: e,
                    variant: "Surface",
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  }),
                  o.jsx(D, {
                    size: "H4",
                    as: r,
                    truncate: true,
                    children: t
                  })
                ]
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  "aria-label": c,
                  onClick: n,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: s
        })
      ]
    });
  }
  function Pke() {
    var _a6, _b3, _c3, _d4, _e13, _f4;
    const t = be(), [e, n] = p.useState(t.baseUrl), [r, i] = p.useState(void 0);
    return r || t.http.request(rt.Get, "/version", void 0, void 0, {
      prefix: "/_matrix/federation/v1",
      baseUrl: e
    }).then((a) => i({
      server: a
    })).catch((a) => {
      e === t.baseUrl ? t.http.request(rt.Get, "/server", void 0, void 0, {
        prefix: "/.well-known/matrix",
        baseUrl: `https://${t.getSafeUserId().split(":")[1]}`
      }).then((s) => {
        const l = s["m.server"], c = l ? `https://${l.split(":")[0]}` : e;
        c !== e && n(c);
      }).catch((s) => i({
        error: {
          message: String(s)
        }
      })) : i({
        error: {
          message: String(a)
        }
      });
    }), o.jsxs(E, {
      direction: "Column",
      gap: "100",
      id: "homeserver-info",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Homeserver"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Domain",
            focusId: "domain",
            description: t.getSafeUserId().split(":")[1]
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Base URL",
            focusId: "base-url",
            description: o.jsx("a", {
              href: t.baseUrl,
              target: "_blank",
              rel: "noopener noreferrer",
              children: t.baseUrl
            })
          })
        }),
        e !== t.baseUrl && o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Federation URL",
            focusId: "federation-url",
            description: o.jsx("a", {
              href: e,
              target: "_blank",
              rel: "noopener noreferrer",
              children: e
            })
          })
        }),
        r ? o.jsxs(o.Fragment, {
          children: [
            "error" in r && r.error && o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: r.error.message
            }),
            "server" in r && ((_a6 = r.server) == null ? void 0 : _a6.name) && o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Name",
                focusId: "homeserver-name",
                description: (_b3 = r.server) == null ? void 0 : _b3.name
              })
            }),
            "server" in r && ((_c3 = r.server) == null ? void 0 : _c3.version) && o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Version",
                focusId: "homeserver-version",
                description: (_d4 = r.server) == null ? void 0 : _d4.version
              })
            }),
            "server" in r && ((_e13 = r.server) == null ? void 0 : _e13.compiler) && o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Compiler",
                focusId: "homeserver-compiler",
                description: (_f4 = r.server) == null ? void 0 : _f4.compiler
              })
            })
          ]
        }) : o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(dt, {})
        })
      ]
    });
  }
  function Mke({ requestBack: t, requestClose: e }) {
    const n = be(), r = "-dev", i = "", a = Vte();
    return o.jsx(Qc, {
      title: "About",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsxs(E, {
                  gap: "400",
                  children: [
                    o.jsx(E, {
                      shrink: "No",
                      children: o.jsx("img", {
                        style: {
                          width: He(60),
                          height: He(60)
                        },
                        src: tp,
                        alt: "Sable logo"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "300",
                      children: [
                        o.jsxs(E, {
                          direction: "Column",
                          gap: "100",
                          children: [
                            o.jsxs(E, {
                              gap: "100",
                              alignItems: "End",
                              children: [
                                o.jsx(D, {
                                  size: "H3",
                                  children: "Sable"
                                }),
                                o.jsx(D, {
                                  size: "T200",
                                  children: `v1.17.0${r}${i}`
                                })
                              ]
                            }),
                            o.jsx(D, {
                              children: "An almost stable Matrix client."
                            })
                          ]
                        }),
                        o.jsxs(E, {
                          gap: "200",
                          wrap: "Wrap",
                          children: [
                            o.jsx(xe, {
                              as: "a",
                              href: "https://github.com/SableClient/Sable",
                              rel: "noreferrer noopener",
                              target: "_blank",
                              variant: "Secondary",
                              fill: "Soft",
                              size: "300",
                              radii: "300",
                              before: o.jsx(Q, {
                                src: q.Code,
                                size: "100",
                                filled: true
                              }),
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Source Code"
                              })
                            }),
                            o.jsx(xe, {
                              as: "a",
                              href: "https://opencollective.com/sable",
                              rel: "noreferrer noopener",
                              target: "_blank",
                              variant: "Critical",
                              fill: "Soft",
                              size: "300",
                              radii: "300",
                              before: o.jsx(Q, {
                                src: q.Heart,
                                size: "100",
                                filled: true
                              }),
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Support"
                              })
                            })
                          ]
                        })
                      ]
                    })
                  ]
                }),
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Options"
                    }),
                    o.jsx(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: o.jsx(Ie, {
                        title: "Clear Cache & Reload",
                        focusId: "clear-cache-and-reload",
                        description: "Clear all your locally stored data and reload from server.",
                        after: o.jsx(xe, {
                          onClick: () => jie(n),
                          variant: "Secondary",
                          fill: "Soft",
                          size: "300",
                          radii: "300",
                          outlined: true,
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Clear Cache"
                          })
                        })
                      })
                    }),
                    o.jsx(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: o.jsx(Ie, {
                        title: "Report an Issue",
                        focusId: "report-an-issue",
                        description: "Report a bug or request a feature on GitHub.",
                        after: o.jsx(xe, {
                          onClick: a,
                          variant: "Secondary",
                          fill: "Soft",
                          size: "300",
                          radii: "300",
                          outlined: true,
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Report"
                          })
                        })
                      })
                    })
                  ]
                }),
                o.jsx(Pke, {}),
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Credits"
                    }),
                    o.jsx(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: o.jsxs(E, {
                        as: "ul",
                        direction: "Column",
                        gap: "200",
                        style: {
                          margin: 0,
                          paddingLeft: ee.space.S400
                        },
                        children: [
                          o.jsx("li", {
                            children: o.jsxs(D, {
                              size: "T300",
                              children: [
                                o.jsx("a", {
                                  href: "https://github.com/cinnyapp/cinny",
                                  rel: "noreferrer noopener",
                                  target: "_blank",
                                  children: "Cinny"
                                }),
                                ", \xA9 ",
                                o.jsx("a", {
                                  href: "https://github.com/ajbura",
                                  rel: "noreferrer noopener",
                                  target: "_blank",
                                  children: "Ajay Bura"
                                }),
                                ", is used under the terms of ",
                                o.jsx("a", {
                                  href: "https://github.com/cinnyapp/cinny/blob/dev/LICENSE",
                                  rel: "noreferrer noopener",
                                  target: "_blank",
                                  children: "AGPL v3"
                                }),
                                "."
                              ]
                            })
                          }),
                          o.jsx("li", {
                            children: o.jsxs(D, {
                              size: "T300",
                              children: [
                                "The ",
                                o.jsx("a", {
                                  href: "https://github.com/matrix-org/matrix-js-sdk",
                                  rel: "noreferrer noopener",
                                  target: "_blank",
                                  children: "matrix-js-sdk"
                                }),
                                ", \xA9 ",
                                o.jsx("a", {
                                  href: "https://matrix.org/foundation",
                                  rel: "noreferrer noopener",
                                  target: "_blank",
                                  children: "The Matrix.org Foundation C.I.C"
                                }),
                                ", is used under the terms of ",
                                o.jsx("a", {
                                  href: "http://www.apache.org/licenses/LICENSE-2.0",
                                  rel: "noreferrer noopener",
                                  target: "_blank",
                                  children: "Apache 2.0"
                                }),
                                "."
                              ]
                            })
                          }),
                          o.jsx("li", {
                            children: o.jsxs(D, {
                              size: "T300",
                              children: [
                                "The ",
                                o.jsx("a", {
                                  href: "https://github.com/mozilla/twemoji-colr",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "twemoji-colr"
                                }),
                                " font, \xA9 ",
                                o.jsx("a", {
                                  href: "https://mozilla.org/",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "Mozilla Foundation"
                                }),
                                ", is used under the terms of ",
                                o.jsx("a", {
                                  href: "http://www.apache.org/licenses/LICENSE-2.0",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "Apache 2.0"
                                }),
                                "."
                              ]
                            })
                          }),
                          o.jsx("li", {
                            children: o.jsxs(D, {
                              size: "T300",
                              children: [
                                "The ",
                                o.jsx("a", {
                                  href: "https://github.com/twitter/twemoji",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "Twemoji"
                                }),
                                " emoji art, \xA9 ",
                                o.jsx("a", {
                                  href: "https://github.com/twitter/twemoji",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "Twitter, Inc and other contributors"
                                }),
                                ", is used under the terms of ",
                                o.jsx("a", {
                                  href: "https://creativecommons.org/licenses/by/4.0/",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "CC-BY 4.0"
                                }),
                                "."
                              ]
                            })
                          }),
                          o.jsx("li", {
                            children: o.jsxs(D, {
                              size: "T300",
                              children: [
                                "The ",
                                o.jsx("a", {
                                  href: "https://material.io/design/sound/sound-resources.html",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "Material sound resources"
                                }),
                                " ",
                                ", \xA9 ",
                                o.jsx("a", {
                                  href: "https://google.com",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "Google"
                                }),
                                ", are used under the terms of ",
                                o.jsx("a", {
                                  href: "https://creativecommons.org/licenses/by/4.0/",
                                  target: "_blank",
                                  rel: "noreferrer noopener",
                                  children: "CC-BY 4.0"
                                }),
                                "."
                              ]
                            })
                          })
                        ]
                      })
                    })
                  ]
                })
              ]
            })
          })
        })
      })
    });
  }
  function Oke() {
    const e = be().getUserId();
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Matrix ID"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: e,
            focusId: "matrix-id",
            after: o.jsx(Qe, {
              variant: "Secondary",
              radii: "Pill",
              onClick: () => Jo(e),
              children: o.jsx(D, {
                size: "T200",
                children: "Copy"
              })
            })
          })
        })
      ]
    });
  }
  const ed = (t, e) => p.useCallback(async (n) => {
    const r = await _ke(n, e);
    r && t(r);
  }, [
    e,
    t
  ]), Xl = (t) => {
    const e = p.useMemo(() => {
      if (t) return URL.createObjectURL(t);
    }, [
      t
    ]);
    return p.useEffect(() => () => {
      e && URL.revokeObjectURL(e);
    }, [
      e
    ]), e;
  };
  var Lke = "ImageEditor_ImageEditor__ka2t0 _1mqalmd1 _1mqalmd0", Nke = "ImageEditor_ImageEditorHeader__ka2t1 _1mqalmd1 _1mqalmd0", zke = "ImageEditor_ImageEditorContent__ka2t2 _1mqalmd1 _1mqalmd0", Uke = "ImageEditor_Image__ka2t3";
  const Vke = () => {
  }, eoe = ft(({ className: t, name: e, url: n, requestClose: r, ...i }, a) => o.jsxs(E, {
    className: gt(Lke, t),
    direction: "Column",
    ...i,
    ref: a,
    children: [
      o.jsxs(wn, {
        className: Nke,
        size: "400",
        children: [
          o.jsxs(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: [
              o.jsx(Oe, {
                size: "300",
                radii: "300",
                onClick: r,
                children: o.jsx(Q, {
                  size: "50",
                  src: q.ArrowLeft
                })
              }),
              o.jsx(D, {
                size: "T300",
                truncate: true,
                children: "Image Editor"
              })
            ]
          }),
          o.jsx(E, {
            shrink: "No",
            alignItems: "Center",
            gap: "200",
            children: o.jsx(Qe, {
              variant: "Primary",
              radii: "300",
              onClick: Vke,
              children: o.jsx(D, {
                size: "B300",
                children: "Save"
              })
            })
          })
        ]
      }),
      o.jsx(E, {
        grow: "Yes",
        className: zke,
        justifyContent: "Center",
        alignItems: "Center",
        children: o.jsx("img", {
          className: Uke,
          src: n,
          alt: e
        })
      })
    ]
  }));
  var OF = "Modal_ModalWide__wtqeme0";
  function sP(t, e) {
    const n = p.useRef(), r = p.useRef(), { wait: i, immediate: a } = e ?? {};
    return p.useCallback((...l) => {
      r.current = l, !n.current && (a && t(...l), n.current = window.setTimeout(() => {
        r.current && t(...r.current), r.current = void 0, n.current = void 0;
      }, i));
    }, [
      t,
      i,
      a
    ]);
  }
  var Xi = ((t) => (t.Idle = "idle", t.Loading = "loading", t.Success = "success", t.Error = "error", t))(Xi || {});
  const Yd = (t) => {
    const e = vn({
      file: t,
      status: "idle"
    });
    return vn((n) => n(e), (n, r, i) => {
      const a = n(e);
      if ("promise" in i) {
        r(e, {
          status: "loading",
          file: t,
          promise: i.promise,
          progress: {
            loaded: 0,
            total: t.size
          }
        });
        return;
      }
      if ("progress" in i && a.status === "loading") {
        r(e, {
          ...a,
          progress: i.progress
        });
        return;
      }
      if ("mxc" in i) {
        r(e, {
          status: "success",
          file: t,
          mxc: i.mxc
        });
        return;
      }
      "error" in i && r(e, {
        status: "error",
        file: t,
        error: i.error
      });
    });
  }, toe = (t, e, n) => {
    const [r, i] = Fr(e), { file: a } = r, s = sP(p.useCallback((d) => i({
      progress: d
    }), [
      i
    ]), {
      immediate: true,
      wait: 200
    }), l = p.useCallback(() => lEe(t, a, {
      hideFilename: n,
      onPromise: (d) => i({
        promise: d
      }),
      onProgress: s,
      onSuccess: (d) => i({
        mxc: d
      }),
      onError: (d) => i({
        error: d
      })
    }), [
      t,
      a,
      n,
      i,
      s
    ]), c = p.useCallback(() => {
      r.status === "loading" && t.cancelUpload(r.promise);
    }, [
      t,
      r
    ]);
    return {
      upload: r,
      startUpload: l,
      cancelUpload: c
    };
  }, Hke = () => Gf(Yd), $ke = (t, e) => vn((n) => e.map((r) => n(t(r))));
  var Wke = Jr({
    defaultClassName: "UploadCard_UploadCard__1czl4r90",
    variantClassNames: {
      radii: {
        0: "UploadCard_UploadCard_radii_0__1czl4r91 cpipac1",
        300: "UploadCard_UploadCard_radii_300__1czl4r92 cpipac2",
        400: "UploadCard_UploadCard_radii_400__1czl4r93 cpipac3",
        500: "UploadCard_UploadCard_radii_500__1czl4r94 cpipac4",
        Inherit: "UploadCard_UploadCard_radii_Inherit__1czl4r95 cpipac0",
        Pill: "UploadCard_UploadCard_radii_Pill__1czl4r96 cpipac5"
      },
      outlined: {
        true: "UploadCard_UploadCard_outlined_true__1czl4r97"
      },
      compact: {
        true: "UploadCard_UploadCard_compact_true__1czl4r98"
      }
    },
    defaultVariants: {
      radii: "400"
    },
    compoundVariants: []
  }), qke = "UploadCard_UploadCardError__1czl4r99", Kke = "UploadCard_AudioPreviewContainer__1czl4r9a _1mqalmd1 _1mqalmd0", Gke = "UploadCard_AudioWaveformContainer__1czl4r9b _1mqalmd1 _1mqalmd0", Yke = "UploadCard_AudioWaveformBar__1czl4r9c _1mqalmd1 _1mqalmd0", Zke = "UploadCard_AudioWaveformBarPlayed__1czl4r9d _1mqalmd1 _1mqalmd0", Jke = "UploadCard_AudioWaveformBarUnplayed__1czl4r9e _1mqalmd1 _1mqalmd0", Xke = "UploadCard_AudioTimeDisplay__1czl4r9f _1mqalmd1 _1mqalmd0";
  const noe = p.forwardRef(({ before: t, after: e, children: n, bottom: r, radii: i, outlined: a, compact: s }, l) => o.jsxs(E, {
    className: Wke({
      radii: i,
      outlined: a,
      compact: s
    }),
    direction: "Column",
    gap: "200",
    ref: l,
    children: [
      o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          t,
          o.jsx(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "200",
            children: n
          }),
          e
        ]
      }),
      r
    ]
  }));
  function _W({ sentBytes: t, totalBytes: e }) {
    return o.jsxs(E, {
      grow: "Yes",
      direction: "Column",
      gap: "200",
      children: [
        o.jsx(O1, {
          variant: "Secondary",
          size: "300",
          min: 0,
          max: e,
          value: t
        }),
        o.jsxs(E, {
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          children: [
            o.jsx(Rn, {
              variant: "Secondary",
              fill: "Solid",
              radii: "Pill",
              children: o.jsx(D, {
                size: "L400",
                children: `${Math.round(Nb(0, e, t))}%`
              })
            }),
            o.jsx(Rn, {
              variant: "Secondary",
              fill: "Soft",
              radii: "Pill",
              children: o.jsxs(D, {
                size: "L400",
                children: [
                  Wl(t),
                  " / ",
                  Wl(e)
                ]
              })
            })
          ]
        })
      ]
    });
  }
  function yW({ sentBytes: t, totalBytes: e }) {
    return o.jsxs(E, {
      grow: "Yes",
      gap: "200",
      alignItems: "Center",
      children: [
        o.jsx(Rn, {
          variant: "Secondary",
          fill: "Solid",
          radii: "Pill",
          children: o.jsx(D, {
            size: "L400",
            children: `${Math.round(Nb(0, e, t))}%`
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsx(O1, {
            variant: "Secondary",
            size: "300",
            min: 0,
            max: e,
            value: t
          })
        }),
        o.jsx(Rn, {
          variant: "Secondary",
          fill: "Soft",
          radii: "Pill",
          children: o.jsxs(D, {
            size: "L400",
            children: [
              Wl(t),
              " / ",
              Wl(e)
            ]
          })
        })
      ]
    });
  }
  function v4({ children: t }) {
    return o.jsxs(E, {
      className: qke,
      alignItems: "Center",
      gap: "300",
      children: [
        o.jsx(Q, {
          src: q.Warning,
          size: "50"
        }),
        t
      ]
    });
  }
  const Qke = /* @__PURE__ */ new Map([
    [
      "bold",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"
      }))
    ],
    [
      "duotone",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",
        opacity: "0.2"
      }), p.createElement("path", {
        d: "M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"
      }))
    ],
    [
      "fill",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"
      }))
    ],
    [
      "light",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"
      }))
    ],
    [
      "regular",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"
      }))
    ],
    [
      "thin",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"
      }))
    ]
  ]), eSe = /* @__PURE__ */ new Map([
    [
      "bold",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,28H160a20,20,0,0,0-20,20V208a20,20,0,0,0,20,20h40a20,20,0,0,0,20-20V48A20,20,0,0,0,200,28Zm-4,176H164V52h32ZM96,28H56A20,20,0,0,0,36,48V208a20,20,0,0,0,20,20H96a20,20,0,0,0,20-20V48A20,20,0,0,0,96,28ZM92,204H60V52H92Z"
      }))
    ],
    [
      "duotone",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M208,48V208a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8h40A8,8,0,0,1,208,48ZM96,40H56a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z",
        opacity: "0.2"
      }), p.createElement("path", {
        d: "M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"
      }))
    ],
    [
      "fill",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z"
      }))
    ],
    [
      "light",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,34H160a14,14,0,0,0-14,14V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,200,34Zm2,174a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2ZM96,34H56A14,14,0,0,0,42,48V208a14,14,0,0,0,14,14H96a14,14,0,0,0,14-14V48A14,14,0,0,0,96,34Zm2,174a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H96a2,2,0,0,1,2,2Z"
      }))
    ],
    [
      "regular",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"
      }))
    ],
    [
      "thin",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,36H160a12,12,0,0,0-12,12V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,200,36Zm4,172a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4ZM96,36H56A12,12,0,0,0,44,48V208a12,12,0,0,0,12,12H96a12,12,0,0,0,12-12V48A12,12,0,0,0,96,36Zm4,172a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4Z"
      }))
    ]
  ]), tSe = /* @__PURE__ */ new Map([
    [
      "bold",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M234.49,111.07,90.41,22.94A20,20,0,0,0,60,39.87V216.13a20,20,0,0,0,30.41,16.93l144.08-88.13a19.82,19.82,0,0,0,0-33.86ZM84,208.85V47.15L216.16,128Z"
      }))
    ],
    [
      "duotone",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M228.23,134.69,84.15,222.81A8,8,0,0,1,72,216.12V39.88a8,8,0,0,1,12.15-6.69l144.08,88.12A7.82,7.82,0,0,1,228.23,134.69Z",
        opacity: "0.2"
      }), p.createElement("path", {
        d: "M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"
      }))
    ],
    [
      "fill",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z"
      }))
    ],
    [
      "light",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M231.36,116.19,87.28,28.06a14,14,0,0,0-14.18-.27A13.69,13.69,0,0,0,66,39.87V216.13a13.69,13.69,0,0,0,7.1,12.08,14,14,0,0,0,14.18-.27l144.08-88.13a13.82,13.82,0,0,0,0-23.62Zm-6.26,13.38L81,217.7a2,2,0,0,1-2.06,0,1.78,1.78,0,0,1-1-1.61V39.87a1.78,1.78,0,0,1,1-1.61A2.06,2.06,0,0,1,80,38a2,2,0,0,1,1,.31L225.1,126.43a1.82,1.82,0,0,1,0,3.14Z"
      }))
    ],
    [
      "regular",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"
      }))
    ],
    [
      "thin",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M230.32,117.9,86.24,29.79a11.91,11.91,0,0,0-12.17-.23A11.71,11.71,0,0,0,68,39.89V216.11a11.71,11.71,0,0,0,6.07,10.33,11.91,11.91,0,0,0,12.17-.23L230.32,138.1a11.82,11.82,0,0,0,0-20.2Zm-4.18,13.37L82.06,219.39a4,4,0,0,1-4.07.07,3.77,3.77,0,0,1-2-3.35V39.89a3.77,3.77,0,0,1,2-3.35,4,4,0,0,1,4.07.07l144.08,88.12a3.8,3.8,0,0,1,0,6.54Z"
      }))
    ]
  ]), nSe = /* @__PURE__ */ new Map([
    [
      "bold",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z"
      }))
    ],
    [
      "duotone",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",
        opacity: "0.2"
      }), p.createElement("path", {
        d: "M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"
      }))
    ],
    [
      "fill",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z"
      }))
    ],
    [
      "light",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z"
      }))
    ],
    [
      "regular",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"
      }))
    ],
    [
      "thin",
      p.createElement(p.Fragment, null, p.createElement("path", {
        d: "M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z"
      }))
    ]
  ]), rSe = p.createContext({
    color: "currentColor",
    size: "1em",
    weight: "regular",
    mirrored: false
  }), o3 = p.forwardRef((t, e) => {
    const { alt: n, color: r, size: i, weight: a, mirrored: s, children: l, weights: c, ...d } = t, { color: u = "currentColor", size: h, weight: f = "regular", mirrored: g = false, ...m } = p.useContext(rSe);
    return p.createElement("svg", {
      ref: e,
      xmlns: "http://www.w3.org/2000/svg",
      width: i ?? h,
      height: i ?? h,
      fill: r ?? u,
      viewBox: "0 0 256 256",
      transform: s || g ? "scale(-1, 1)" : void 0,
      ...m,
      ...d
    }, !!n && p.createElement("title", null, n), l, c.get(a ?? f));
  });
  o3.displayName = "IconBase";
  const roe = p.forwardRef((t, e) => p.createElement(o3, {
    ref: e,
    ...t,
    weights: Qke
  }));
  roe.displayName = "MicrophoneIcon";
  const iSe = roe, ioe = p.forwardRef((t, e) => p.createElement(o3, {
    ref: e,
    ...t,
    weights: eSe
  }));
  ioe.displayName = "PauseIcon";
  const oSe = ioe, ooe = p.forwardRef((t, e) => p.createElement(o3, {
    ref: e,
    ...t,
    weights: tSe
  }));
  ooe.displayName = "PlayIcon";
  const aSe = ooe, aoe = p.forwardRef((t, e) => p.createElement(o3, {
    ref: e,
    ...t,
    weights: nSe
  }));
  aoe.displayName = "StopIcon";
  const sSe = aoe;
  var Am = {}, x9 = {}, bW;
  function soe() {
    return bW || (bW = 1, (function(t) {
      Object.defineProperty(t, "__esModule", {
        value: true
      }), t.Doctype = t.CDATA = t.Tag = t.Style = t.Script = t.Comment = t.Directive = t.Text = t.Root = t.isTag = t.ElementType = void 0;
      var e;
      (function(r) {
        r.Root = "root", r.Text = "text", r.Directive = "directive", r.Comment = "comment", r.Script = "script", r.Style = "style", r.Tag = "tag", r.CDATA = "cdata", r.Doctype = "doctype";
      })(e = t.ElementType || (t.ElementType = {}));
      function n(r) {
        return r.type === e.Tag || r.type === e.Script || r.type === e.Style;
      }
      t.isTag = n, t.Root = e.Root, t.Text = e.Text, t.Directive = e.Directive, t.Comment = e.Comment, t.Script = e.Script, t.Style = e.Style, t.Tag = e.Tag, t.CDATA = e.CDATA, t.Doctype = e.Doctype;
    })(x9)), x9;
  }
  var kr = {}, xW;
  function wW() {
    if (xW) return kr;
    xW = 1;
    var t = kr && kr.__extends || /* @__PURE__ */ (function() {
      var C = function(x, S) {
        return C = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(T, A) {
          T.__proto__ = A;
        } || function(T, A) {
          for (var B in A) Object.prototype.hasOwnProperty.call(A, B) && (T[B] = A[B]);
        }, C(x, S);
      };
      return function(x, S) {
        if (typeof S != "function" && S !== null) throw new TypeError("Class extends value " + String(S) + " is not a constructor or null");
        C(x, S);
        function T() {
          this.constructor = x;
        }
        x.prototype = S === null ? Object.create(S) : (T.prototype = S.prototype, new T());
      };
    })(), e = kr && kr.__assign || function() {
      return e = Object.assign || function(C) {
        for (var x, S = 1, T = arguments.length; S < T; S++) {
          x = arguments[S];
          for (var A in x) Object.prototype.hasOwnProperty.call(x, A) && (C[A] = x[A]);
        }
        return C;
      }, e.apply(this, arguments);
    };
    Object.defineProperty(kr, "__esModule", {
      value: true
    }), kr.cloneNode = kr.hasChildren = kr.isDocument = kr.isDirective = kr.isComment = kr.isText = kr.isCDATA = kr.isTag = kr.Element = kr.Document = kr.CDATA = kr.NodeWithChildren = kr.ProcessingInstruction = kr.Comment = kr.Text = kr.DataNode = kr.Node = void 0;
    var n = soe(), r = (function() {
      function C() {
        this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
      }
      return Object.defineProperty(C.prototype, "parentNode", {
        get: function() {
          return this.parent;
        },
        set: function(x) {
          this.parent = x;
        },
        enumerable: false,
        configurable: true
      }), Object.defineProperty(C.prototype, "previousSibling", {
        get: function() {
          return this.prev;
        },
        set: function(x) {
          this.prev = x;
        },
        enumerable: false,
        configurable: true
      }), Object.defineProperty(C.prototype, "nextSibling", {
        get: function() {
          return this.next;
        },
        set: function(x) {
          this.next = x;
        },
        enumerable: false,
        configurable: true
      }), C.prototype.cloneNode = function(x) {
        return x === void 0 && (x = false), j(this, x);
      }, C;
    })();
    kr.Node = r;
    var i = (function(C) {
      t(x, C);
      function x(S) {
        var T = C.call(this) || this;
        return T.data = S, T;
      }
      return Object.defineProperty(x.prototype, "nodeValue", {
        get: function() {
          return this.data;
        },
        set: function(S) {
          this.data = S;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(r);
    kr.DataNode = i;
    var a = (function(C) {
      t(x, C);
      function x() {
        var S = C !== null && C.apply(this, arguments) || this;
        return S.type = n.ElementType.Text, S;
      }
      return Object.defineProperty(x.prototype, "nodeType", {
        get: function() {
          return 3;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(i);
    kr.Text = a;
    var s = (function(C) {
      t(x, C);
      function x() {
        var S = C !== null && C.apply(this, arguments) || this;
        return S.type = n.ElementType.Comment, S;
      }
      return Object.defineProperty(x.prototype, "nodeType", {
        get: function() {
          return 8;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(i);
    kr.Comment = s;
    var l = (function(C) {
      t(x, C);
      function x(S, T) {
        var A = C.call(this, T) || this;
        return A.name = S, A.type = n.ElementType.Directive, A;
      }
      return Object.defineProperty(x.prototype, "nodeType", {
        get: function() {
          return 1;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(i);
    kr.ProcessingInstruction = l;
    var c = (function(C) {
      t(x, C);
      function x(S) {
        var T = C.call(this) || this;
        return T.children = S, T;
      }
      return Object.defineProperty(x.prototype, "firstChild", {
        get: function() {
          var S;
          return (S = this.children[0]) !== null && S !== void 0 ? S : null;
        },
        enumerable: false,
        configurable: true
      }), Object.defineProperty(x.prototype, "lastChild", {
        get: function() {
          return this.children.length > 0 ? this.children[this.children.length - 1] : null;
        },
        enumerable: false,
        configurable: true
      }), Object.defineProperty(x.prototype, "childNodes", {
        get: function() {
          return this.children;
        },
        set: function(S) {
          this.children = S;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(r);
    kr.NodeWithChildren = c;
    var d = (function(C) {
      t(x, C);
      function x() {
        var S = C !== null && C.apply(this, arguments) || this;
        return S.type = n.ElementType.CDATA, S;
      }
      return Object.defineProperty(x.prototype, "nodeType", {
        get: function() {
          return 4;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(c);
    kr.CDATA = d;
    var u = (function(C) {
      t(x, C);
      function x() {
        var S = C !== null && C.apply(this, arguments) || this;
        return S.type = n.ElementType.Root, S;
      }
      return Object.defineProperty(x.prototype, "nodeType", {
        get: function() {
          return 9;
        },
        enumerable: false,
        configurable: true
      }), x;
    })(c);
    kr.Document = u;
    var h = (function(C) {
      t(x, C);
      function x(S, T, A, B) {
        A === void 0 && (A = []), B === void 0 && (B = S === "script" ? n.ElementType.Script : S === "style" ? n.ElementType.Style : n.ElementType.Tag);
        var U = C.call(this, A) || this;
        return U.name = S, U.attribs = T, U.type = B, U;
      }
      return Object.defineProperty(x.prototype, "nodeType", {
        get: function() {
          return 1;
        },
        enumerable: false,
        configurable: true
      }), Object.defineProperty(x.prototype, "tagName", {
        get: function() {
          return this.name;
        },
        set: function(S) {
          this.name = S;
        },
        enumerable: false,
        configurable: true
      }), Object.defineProperty(x.prototype, "attributes", {
        get: function() {
          var S = this;
          return Object.keys(this.attribs).map(function(T) {
            var A, B;
            return {
              name: T,
              value: S.attribs[T],
              namespace: (A = S["x-attribsNamespace"]) === null || A === void 0 ? void 0 : A[T],
              prefix: (B = S["x-attribsPrefix"]) === null || B === void 0 ? void 0 : B[T]
            };
          });
        },
        enumerable: false,
        configurable: true
      }), x;
    })(c);
    kr.Element = h;
    function f(C) {
      return (0, n.isTag)(C);
    }
    kr.isTag = f;
    function g(C) {
      return C.type === n.ElementType.CDATA;
    }
    kr.isCDATA = g;
    function m(C) {
      return C.type === n.ElementType.Text;
    }
    kr.isText = m;
    function v(C) {
      return C.type === n.ElementType.Comment;
    }
    kr.isComment = v;
    function y(C) {
      return C.type === n.ElementType.Directive;
    }
    kr.isDirective = y;
    function w(C) {
      return C.type === n.ElementType.Root;
    }
    kr.isDocument = w;
    function b(C) {
      return Object.prototype.hasOwnProperty.call(C, "children");
    }
    kr.hasChildren = b;
    function j(C, x) {
      x === void 0 && (x = false);
      var S;
      if (m(C)) S = new a(C.data);
      else if (v(C)) S = new s(C.data);
      else if (f(C)) {
        var T = x ? k(C.children) : [], A = new h(C.name, e({}, C.attribs), T);
        T.forEach(function(O) {
          return O.parent = A;
        }), C.namespace != null && (A.namespace = C.namespace), C["x-attribsNamespace"] && (A["x-attribsNamespace"] = e({}, C["x-attribsNamespace"])), C["x-attribsPrefix"] && (A["x-attribsPrefix"] = e({}, C["x-attribsPrefix"])), S = A;
      } else if (g(C)) {
        var T = x ? k(C.children) : [], B = new d(T);
        T.forEach(function(M) {
          return M.parent = B;
        }), S = B;
      } else if (w(C)) {
        var T = x ? k(C.children) : [], U = new u(T);
        T.forEach(function(M) {
          return M.parent = U;
        }), C["x-mode"] && (U["x-mode"] = C["x-mode"]), S = U;
      } else if (y(C)) {
        var z = new l(C.name, C.data);
        C["x-name"] != null && (z["x-name"] = C["x-name"], z["x-publicId"] = C["x-publicId"], z["x-systemId"] = C["x-systemId"]), S = z;
      } else throw new Error("Not implemented yet: ".concat(C.type));
      return S.startIndex = C.startIndex, S.endIndex = C.endIndex, C.sourceCodeLocation != null && (S.sourceCodeLocation = C.sourceCodeLocation), S;
    }
    kr.cloneNode = j;
    function k(C) {
      for (var x = C.map(function(T) {
        return j(T, true);
      }), S = 1; S < x.length; S++) x[S].prev = x[S - 1], x[S - 1].next = x[S];
      return x;
    }
    return kr;
  }
  var DW;
  function loe() {
    return DW || (DW = 1, (function(t) {
      var e = Am && Am.__createBinding || (Object.create ? (function(l, c, d, u) {
        u === void 0 && (u = d);
        var h = Object.getOwnPropertyDescriptor(c, d);
        (!h || ("get" in h ? !c.__esModule : h.writable || h.configurable)) && (h = {
          enumerable: true,
          get: function() {
            return c[d];
          }
        }), Object.defineProperty(l, u, h);
      }) : (function(l, c, d, u) {
        u === void 0 && (u = d), l[u] = c[d];
      })), n = Am && Am.__exportStar || function(l, c) {
        for (var d in l) d !== "default" && !Object.prototype.hasOwnProperty.call(c, d) && e(c, l, d);
      };
      Object.defineProperty(t, "__esModule", {
        value: true
      }), t.DomHandler = void 0;
      var r = soe(), i = wW();
      n(wW(), t);
      var a = {
        withStartIndices: false,
        withEndIndices: false,
        xmlMode: false
      }, s = (function() {
        function l(c, d, u) {
          this.dom = [], this.root = new i.Document(this.dom), this.done = false, this.tagStack = [
            this.root
          ], this.lastNode = null, this.parser = null, typeof d == "function" && (u = d, d = a), typeof c == "object" && (d = c, c = void 0), this.callback = c ?? null, this.options = d ?? a, this.elementCB = u ?? null;
        }
        return l.prototype.onparserinit = function(c) {
          this.parser = c;
        }, l.prototype.onreset = function() {
          this.dom = [], this.root = new i.Document(this.dom), this.done = false, this.tagStack = [
            this.root
          ], this.lastNode = null, this.parser = null;
        }, l.prototype.onend = function() {
          this.done || (this.done = true, this.parser = null, this.handleCallback(null));
        }, l.prototype.onerror = function(c) {
          this.handleCallback(c);
        }, l.prototype.onclosetag = function() {
          this.lastNode = null;
          var c = this.tagStack.pop();
          this.options.withEndIndices && (c.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(c);
        }, l.prototype.onopentag = function(c, d) {
          var u = this.options.xmlMode ? r.ElementType.Tag : void 0, h = new i.Element(c, d, void 0, u);
          this.addNode(h), this.tagStack.push(h);
        }, l.prototype.ontext = function(c) {
          var d = this.lastNode;
          if (d && d.type === r.ElementType.Text) d.data += c, this.options.withEndIndices && (d.endIndex = this.parser.endIndex);
          else {
            var u = new i.Text(c);
            this.addNode(u), this.lastNode = u;
          }
        }, l.prototype.oncomment = function(c) {
          if (this.lastNode && this.lastNode.type === r.ElementType.Comment) {
            this.lastNode.data += c;
            return;
          }
          var d = new i.Comment(c);
          this.addNode(d), this.lastNode = d;
        }, l.prototype.oncommentend = function() {
          this.lastNode = null;
        }, l.prototype.oncdatastart = function() {
          var c = new i.Text(""), d = new i.CDATA([
            c
          ]);
          this.addNode(d), c.parent = d, this.lastNode = c;
        }, l.prototype.oncdataend = function() {
          this.lastNode = null;
        }, l.prototype.onprocessinginstruction = function(c, d) {
          var u = new i.ProcessingInstruction(c, d);
          this.addNode(u);
        }, l.prototype.handleCallback = function(c) {
          if (typeof this.callback == "function") this.callback(c, this.dom);
          else if (c) throw c;
        }, l.prototype.addNode = function(c) {
          var d = this.tagStack[this.tagStack.length - 1], u = d.children[d.children.length - 1];
          this.options.withStartIndices && (c.startIndex = this.parser.startIndex), this.options.withEndIndices && (c.endIndex = this.parser.endIndex), d.children.push(c), u && (c.prev = u, u.next = c), c.parent = d, this.lastNode = null;
        }, l;
      })();
      t.DomHandler = s, t.default = s;
    })(Am)), Am;
  }
  var F0 = {}, fw = {}, CW;
  function lSe() {
    if (CW) return fw;
    CW = 1, Object.defineProperty(fw, "__esModule", {
      value: true
    });
    var t = "html", e = "head", n = "body", r = /<([a-zA-Z]+[0-9]?)/, i = /<head[^]*>/i, a = /<body[^]*>/i, s = function(v, y) {
      throw new Error("This browser does not support `document.implementation.createHTMLDocument`");
    }, l = function(v, y) {
      throw new Error("This browser does not support `DOMParser.prototype.parseFromString`");
    }, c = typeof window == "object" && window.DOMParser;
    if (typeof c == "function") {
      var d = new c(), u = "text/html";
      l = function(v, y) {
        return y && (v = "<".concat(y, ">").concat(v, "</").concat(y, ">")), d.parseFromString(v, u);
      }, s = l;
    }
    if (typeof document == "object" && document.implementation) {
      var h = document.implementation.createHTMLDocument();
      s = function(v, y) {
        if (y) {
          var w = h.documentElement.querySelector(y);
          return w && (w.innerHTML = v), h;
        }
        return h.documentElement.innerHTML = v, h;
      };
    }
    var f = typeof document == "object" && document.createElement("template"), g;
    f && f.content && (g = function(v) {
      return f.innerHTML = v, f.content.childNodes;
    });
    function m(v) {
      var y, w, b = v.match(r), j = b && b[1] ? b[1].toLowerCase() : "";
      switch (j) {
        case t: {
          var k = l(v);
          if (!i.test(v)) {
            var C = k.querySelector(e);
            (y = C == null ? void 0 : C.parentNode) === null || y === void 0 || y.removeChild(C);
          }
          if (!a.test(v)) {
            var C = k.querySelector(n);
            (w = C == null ? void 0 : C.parentNode) === null || w === void 0 || w.removeChild(C);
          }
          return k.querySelectorAll(t);
        }
        case e:
        case n: {
          var x = s(v).querySelectorAll(j);
          return a.test(v) && i.test(v) ? x[0].parentNode.childNodes : x;
        }
        default: {
          if (g) return g(v);
          var C = s(v, n).querySelector(n);
          return C.childNodes;
        }
      }
    }
    return fw.default = m, fw;
  }
  var Im = {}, w9 = {}, EW;
  function cSe() {
    return EW || (EW = 1, (function(t) {
      Object.defineProperty(t, "__esModule", {
        value: true
      }), t.CASE_SENSITIVE_TAG_NAMES_MAP = t.CASE_SENSITIVE_TAG_NAMES = void 0, t.CASE_SENSITIVE_TAG_NAMES = [
        "animateMotion",
        "animateTransform",
        "clipPath",
        "feBlend",
        "feColorMatrix",
        "feComponentTransfer",
        "feComposite",
        "feConvolveMatrix",
        "feDiffuseLighting",
        "feDisplacementMap",
        "feDropShadow",
        "feFlood",
        "feFuncA",
        "feFuncB",
        "feFuncG",
        "feFuncR",
        "feGaussianBlur",
        "feImage",
        "feMerge",
        "feMergeNode",
        "feMorphology",
        "feOffset",
        "fePointLight",
        "feSpecularLighting",
        "feSpotLight",
        "feTile",
        "feTurbulence",
        "foreignObject",
        "linearGradient",
        "radialGradient",
        "textPath"
      ], t.CASE_SENSITIVE_TAG_NAMES_MAP = t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e, n) {
        return e[n.toLowerCase()] = n, e;
      }, {});
    })(w9)), w9;
  }
  var kW;
  function dSe() {
    if (kW) return Im;
    kW = 1, Object.defineProperty(Im, "__esModule", {
      value: true
    }), Im.formatDOM = Im.formatAttributes = void 0;
    var t = loe(), e = cSe();
    function n(s) {
      return e.CASE_SENSITIVE_TAG_NAMES_MAP[s];
    }
    function r(s) {
      for (var l = {}, c = 0, d = s.length; c < d; c++) {
        var u = s[c];
        l[u.name] = u.value;
      }
      return l;
    }
    Im.formatAttributes = r;
    function i(s) {
      s = s.toLowerCase();
      var l = n(s);
      return l || s;
    }
    function a(s, l, c) {
      l === void 0 && (l = null);
      for (var d = [], u, h = 0, f = s.length; h < f; h++) {
        var g = s[h];
        switch (g.nodeType) {
          case 1: {
            var m = i(g.nodeName);
            u = new t.Element(m, r(g.attributes)), u.children = a(m === "template" ? g.content.childNodes : g.childNodes, u);
            break;
          }
          case 3:
            u = new t.Text(g.nodeValue);
            break;
          case 8:
            u = new t.Comment(g.nodeValue);
            break;
          default:
            continue;
        }
        var v = d[h - 1] || null;
        v && (v.next = u), u.parent = l, u.prev = v, u.next = null, d.push(u);
      }
      return c && (u = new t.ProcessingInstruction(c.substring(0, c.indexOf(" ")).toLowerCase(), c), u.next = d[0] || null, u.parent = l, d.unshift(u), d[1] && (d[1].prev = d[0])), d;
    }
    return Im.formatDOM = a, Im;
  }
  var SW;
  function uSe() {
    if (SW) return F0;
    SW = 1;
    var t = F0 && F0.__importDefault || function(a) {
      return a && a.__esModule ? a : {
        default: a
      };
    };
    Object.defineProperty(F0, "__esModule", {
      value: true
    });
    var e = t(lSe()), n = dSe(), r = /<(![a-zA-Z\s]+)>/;
    function i(a) {
      if (typeof a != "string") throw new TypeError("First argument must be a string");
      if (!a) return [];
      var s = a.match(r), l = s ? s[1] : void 0;
      return (0, n.formatDOM)((0, e.default)(a), null, l);
    }
    return F0.default = i, F0;
  }
  var jl = {}, R_ = {}, jW;
  function hSe() {
    if (jW) return R_;
    jW = 1;
    var t = 0;
    R_.SAME = t;
    var e = 1;
    return R_.CAMELCASE = e, R_.possibleStandardNames = {
      accept: 0,
      acceptCharset: 1,
      "accept-charset": "acceptCharset",
      accessKey: 1,
      action: 0,
      allowFullScreen: 1,
      alt: 0,
      as: 0,
      async: 0,
      autoCapitalize: 1,
      autoComplete: 1,
      autoCorrect: 1,
      autoFocus: 1,
      autoPlay: 1,
      autoSave: 1,
      capture: 0,
      cellPadding: 1,
      cellSpacing: 1,
      challenge: 0,
      charSet: 1,
      checked: 0,
      children: 0,
      cite: 0,
      class: "className",
      classID: 1,
      className: 1,
      cols: 0,
      colSpan: 1,
      content: 0,
      contentEditable: 1,
      contextMenu: 1,
      controls: 0,
      controlsList: 1,
      coords: 0,
      crossOrigin: 1,
      dangerouslySetInnerHTML: 1,
      data: 0,
      dateTime: 1,
      default: 0,
      defaultChecked: 1,
      defaultValue: 1,
      defer: 0,
      dir: 0,
      disabled: 0,
      disablePictureInPicture: 1,
      disableRemotePlayback: 1,
      download: 0,
      draggable: 0,
      encType: 1,
      enterKeyHint: 1,
      for: "htmlFor",
      form: 0,
      formMethod: 1,
      formAction: 1,
      formEncType: 1,
      formNoValidate: 1,
      formTarget: 1,
      frameBorder: 1,
      headers: 0,
      height: 0,
      hidden: 0,
      high: 0,
      href: 0,
      hrefLang: 1,
      htmlFor: 1,
      httpEquiv: 1,
      "http-equiv": "httpEquiv",
      icon: 0,
      id: 0,
      innerHTML: 1,
      inputMode: 1,
      integrity: 0,
      is: 0,
      itemID: 1,
      itemProp: 1,
      itemRef: 1,
      itemScope: 1,
      itemType: 1,
      keyParams: 1,
      keyType: 1,
      kind: 0,
      label: 0,
      lang: 0,
      list: 0,
      loop: 0,
      low: 0,
      manifest: 0,
      marginWidth: 1,
      marginHeight: 1,
      max: 0,
      maxLength: 1,
      media: 0,
      mediaGroup: 1,
      method: 0,
      min: 0,
      minLength: 1,
      multiple: 0,
      muted: 0,
      name: 0,
      noModule: 1,
      nonce: 0,
      noValidate: 1,
      open: 0,
      optimum: 0,
      pattern: 0,
      placeholder: 0,
      playsInline: 1,
      poster: 0,
      preload: 0,
      profile: 0,
      radioGroup: 1,
      readOnly: 1,
      referrerPolicy: 1,
      rel: 0,
      required: 0,
      reversed: 0,
      role: 0,
      rows: 0,
      rowSpan: 1,
      sandbox: 0,
      scope: 0,
      scoped: 0,
      scrolling: 0,
      seamless: 0,
      selected: 0,
      shape: 0,
      size: 0,
      sizes: 0,
      span: 0,
      spellCheck: 1,
      src: 0,
      srcDoc: 1,
      srcLang: 1,
      srcSet: 1,
      start: 0,
      step: 0,
      style: 0,
      summary: 0,
      tabIndex: 1,
      target: 0,
      title: 0,
      type: 0,
      useMap: 1,
      value: 0,
      width: 0,
      wmode: 0,
      wrap: 0,
      about: 0,
      accentHeight: 1,
      "accent-height": "accentHeight",
      accumulate: 0,
      additive: 0,
      alignmentBaseline: 1,
      "alignment-baseline": "alignmentBaseline",
      allowReorder: 1,
      alphabetic: 0,
      amplitude: 0,
      arabicForm: 1,
      "arabic-form": "arabicForm",
      ascent: 0,
      attributeName: 1,
      attributeType: 1,
      autoReverse: 1,
      azimuth: 0,
      baseFrequency: 1,
      baselineShift: 1,
      "baseline-shift": "baselineShift",
      baseProfile: 1,
      bbox: 0,
      begin: 0,
      bias: 0,
      by: 0,
      calcMode: 1,
      capHeight: 1,
      "cap-height": "capHeight",
      clip: 0,
      clipPath: 1,
      "clip-path": "clipPath",
      clipPathUnits: 1,
      clipRule: 1,
      "clip-rule": "clipRule",
      color: 0,
      colorInterpolation: 1,
      "color-interpolation": "colorInterpolation",
      colorInterpolationFilters: 1,
      "color-interpolation-filters": "colorInterpolationFilters",
      colorProfile: 1,
      "color-profile": "colorProfile",
      colorRendering: 1,
      "color-rendering": "colorRendering",
      contentScriptType: 1,
      contentStyleType: 1,
      cursor: 0,
      cx: 0,
      cy: 0,
      d: 0,
      datatype: 0,
      decelerate: 0,
      descent: 0,
      diffuseConstant: 1,
      direction: 0,
      display: 0,
      divisor: 0,
      dominantBaseline: 1,
      "dominant-baseline": "dominantBaseline",
      dur: 0,
      dx: 0,
      dy: 0,
      edgeMode: 1,
      elevation: 0,
      enableBackground: 1,
      "enable-background": "enableBackground",
      end: 0,
      exponent: 0,
      externalResourcesRequired: 1,
      fill: 0,
      fillOpacity: 1,
      "fill-opacity": "fillOpacity",
      fillRule: 1,
      "fill-rule": "fillRule",
      filter: 0,
      filterRes: 1,
      filterUnits: 1,
      floodOpacity: 1,
      "flood-opacity": "floodOpacity",
      floodColor: 1,
      "flood-color": "floodColor",
      focusable: 0,
      fontFamily: 1,
      "font-family": "fontFamily",
      fontSize: 1,
      "font-size": "fontSize",
      fontSizeAdjust: 1,
      "font-size-adjust": "fontSizeAdjust",
      fontStretch: 1,
      "font-stretch": "fontStretch",
      fontStyle: 1,
      "font-style": "fontStyle",
      fontVariant: 1,
      "font-variant": "fontVariant",
      fontWeight: 1,
      "font-weight": "fontWeight",
      format: 0,
      from: 0,
      fx: 0,
      fy: 0,
      g1: 0,
      g2: 0,
      glyphName: 1,
      "glyph-name": "glyphName",
      glyphOrientationHorizontal: 1,
      "glyph-orientation-horizontal": "glyphOrientationHorizontal",
      glyphOrientationVertical: 1,
      "glyph-orientation-vertical": "glyphOrientationVertical",
      glyphRef: 1,
      gradientTransform: 1,
      gradientUnits: 1,
      hanging: 0,
      horizAdvX: 1,
      "horiz-adv-x": "horizAdvX",
      horizOriginX: 1,
      "horiz-origin-x": "horizOriginX",
      ideographic: 0,
      imageRendering: 1,
      "image-rendering": "imageRendering",
      in2: 0,
      in: 0,
      inlist: 0,
      intercept: 0,
      k1: 0,
      k2: 0,
      k3: 0,
      k4: 0,
      k: 0,
      kernelMatrix: 1,
      kernelUnitLength: 1,
      kerning: 0,
      keyPoints: 1,
      keySplines: 1,
      keyTimes: 1,
      lengthAdjust: 1,
      letterSpacing: 1,
      "letter-spacing": "letterSpacing",
      lightingColor: 1,
      "lighting-color": "lightingColor",
      limitingConeAngle: 1,
      local: 0,
      markerEnd: 1,
      "marker-end": "markerEnd",
      markerHeight: 1,
      markerMid: 1,
      "marker-mid": "markerMid",
      markerStart: 1,
      "marker-start": "markerStart",
      markerUnits: 1,
      markerWidth: 1,
      mask: 0,
      maskContentUnits: 1,
      maskUnits: 1,
      mathematical: 0,
      mode: 0,
      numOctaves: 1,
      offset: 0,
      opacity: 0,
      operator: 0,
      order: 0,
      orient: 0,
      orientation: 0,
      origin: 0,
      overflow: 0,
      overlinePosition: 1,
      "overline-position": "overlinePosition",
      overlineThickness: 1,
      "overline-thickness": "overlineThickness",
      paintOrder: 1,
      "paint-order": "paintOrder",
      panose1: 0,
      "panose-1": "panose1",
      pathLength: 1,
      patternContentUnits: 1,
      patternTransform: 1,
      patternUnits: 1,
      pointerEvents: 1,
      "pointer-events": "pointerEvents",
      points: 0,
      pointsAtX: 1,
      pointsAtY: 1,
      pointsAtZ: 1,
      prefix: 0,
      preserveAlpha: 1,
      preserveAspectRatio: 1,
      primitiveUnits: 1,
      property: 0,
      r: 0,
      radius: 0,
      refX: 1,
      refY: 1,
      renderingIntent: 1,
      "rendering-intent": "renderingIntent",
      repeatCount: 1,
      repeatDur: 1,
      requiredExtensions: 1,
      requiredFeatures: 1,
      resource: 0,
      restart: 0,
      result: 0,
      results: 0,
      rotate: 0,
      rx: 0,
      ry: 0,
      scale: 0,
      security: 0,
      seed: 0,
      shapeRendering: 1,
      "shape-rendering": "shapeRendering",
      slope: 0,
      spacing: 0,
      specularConstant: 1,
      specularExponent: 1,
      speed: 0,
      spreadMethod: 1,
      startOffset: 1,
      stdDeviation: 1,
      stemh: 0,
      stemv: 0,
      stitchTiles: 1,
      stopColor: 1,
      "stop-color": "stopColor",
      stopOpacity: 1,
      "stop-opacity": "stopOpacity",
      strikethroughPosition: 1,
      "strikethrough-position": "strikethroughPosition",
      strikethroughThickness: 1,
      "strikethrough-thickness": "strikethroughThickness",
      string: 0,
      stroke: 0,
      strokeDasharray: 1,
      "stroke-dasharray": "strokeDasharray",
      strokeDashoffset: 1,
      "stroke-dashoffset": "strokeDashoffset",
      strokeLinecap: 1,
      "stroke-linecap": "strokeLinecap",
      strokeLinejoin: 1,
      "stroke-linejoin": "strokeLinejoin",
      strokeMiterlimit: 1,
      "stroke-miterlimit": "strokeMiterlimit",
      strokeWidth: 1,
      "stroke-width": "strokeWidth",
      strokeOpacity: 1,
      "stroke-opacity": "strokeOpacity",
      suppressContentEditableWarning: 1,
      suppressHydrationWarning: 1,
      surfaceScale: 1,
      systemLanguage: 1,
      tableValues: 1,
      targetX: 1,
      targetY: 1,
      textAnchor: 1,
      "text-anchor": "textAnchor",
      textDecoration: 1,
      "text-decoration": "textDecoration",
      textLength: 1,
      textRendering: 1,
      "text-rendering": "textRendering",
      to: 0,
      transform: 0,
      typeof: 0,
      u1: 0,
      u2: 0,
      underlinePosition: 1,
      "underline-position": "underlinePosition",
      underlineThickness: 1,
      "underline-thickness": "underlineThickness",
      unicode: 0,
      unicodeBidi: 1,
      "unicode-bidi": "unicodeBidi",
      unicodeRange: 1,
      "unicode-range": "unicodeRange",
      unitsPerEm: 1,
      "units-per-em": "unitsPerEm",
      unselectable: 0,
      vAlphabetic: 1,
      "v-alphabetic": "vAlphabetic",
      values: 0,
      vectorEffect: 1,
      "vector-effect": "vectorEffect",
      version: 0,
      vertAdvY: 1,
      "vert-adv-y": "vertAdvY",
      vertOriginX: 1,
      "vert-origin-x": "vertOriginX",
      vertOriginY: 1,
      "vert-origin-y": "vertOriginY",
      vHanging: 1,
      "v-hanging": "vHanging",
      vIdeographic: 1,
      "v-ideographic": "vIdeographic",
      viewBox: 1,
      viewTarget: 1,
      visibility: 0,
      vMathematical: 1,
      "v-mathematical": "vMathematical",
      vocab: 0,
      widths: 0,
      wordSpacing: 1,
      "word-spacing": "wordSpacing",
      writingMode: 1,
      "writing-mode": "writingMode",
      x1: 0,
      x2: 0,
      x: 0,
      xChannelSelector: 1,
      xHeight: 1,
      "x-height": "xHeight",
      xlinkActuate: 1,
      "xlink:actuate": "xlinkActuate",
      xlinkArcrole: 1,
      "xlink:arcrole": "xlinkArcrole",
      xlinkHref: 1,
      "xlink:href": "xlinkHref",
      xlinkRole: 1,
      "xlink:role": "xlinkRole",
      xlinkShow: 1,
      "xlink:show": "xlinkShow",
      xlinkTitle: 1,
      "xlink:title": "xlinkTitle",
      xlinkType: 1,
      "xlink:type": "xlinkType",
      xmlBase: 1,
      "xml:base": "xmlBase",
      xmlLang: 1,
      "xml:lang": "xmlLang",
      xmlns: 0,
      "xml:space": "xmlSpace",
      xmlnsXlink: 1,
      "xmlns:xlink": "xmlnsXlink",
      xmlSpace: 1,
      y1: 0,
      y2: 0,
      y: 0,
      yChannelSelector: 1,
      z: 0,
      zoomAndPan: 1
    }, R_;
  }
  var TW;
  function fSe() {
    if (TW) return jl;
    TW = 1;
    const t = 0, e = 1, n = 2, r = 3, i = 4, a = 5, s = 6;
    function l(C) {
      return d.hasOwnProperty(C) ? d[C] : null;
    }
    function c(C, x, S, T, A, B, U) {
      this.acceptsBooleans = x === n || x === r || x === i, this.attributeName = T, this.attributeNamespace = A, this.mustUseProperty = S, this.propertyName = C, this.type = x, this.sanitizeURL = B, this.removeEmptyString = U;
    }
    const d = {};
    [
      "children",
      "dangerouslySetInnerHTML",
      "defaultValue",
      "defaultChecked",
      "innerHTML",
      "suppressContentEditableWarning",
      "suppressHydrationWarning",
      "style"
    ].forEach((C) => {
      d[C] = new c(C, t, false, C, null, false, false);
    }), [
      [
        "acceptCharset",
        "accept-charset"
      ],
      [
        "className",
        "class"
      ],
      [
        "htmlFor",
        "for"
      ],
      [
        "httpEquiv",
        "http-equiv"
      ]
    ].forEach(([C, x]) => {
      d[C] = new c(C, e, false, x, null, false, false);
    }), [
      "contentEditable",
      "draggable",
      "spellCheck",
      "value"
    ].forEach((C) => {
      d[C] = new c(C, n, false, C.toLowerCase(), null, false, false);
    }), [
      "autoReverse",
      "externalResourcesRequired",
      "focusable",
      "preserveAlpha"
    ].forEach((C) => {
      d[C] = new c(C, n, false, C, null, false, false);
    }), [
      "allowFullScreen",
      "async",
      "autoFocus",
      "autoPlay",
      "controls",
      "default",
      "defer",
      "disabled",
      "disablePictureInPicture",
      "disableRemotePlayback",
      "formNoValidate",
      "hidden",
      "loop",
      "noModule",
      "noValidate",
      "open",
      "playsInline",
      "readOnly",
      "required",
      "reversed",
      "scoped",
      "seamless",
      "itemScope"
    ].forEach((C) => {
      d[C] = new c(C, r, false, C.toLowerCase(), null, false, false);
    }), [
      "checked",
      "multiple",
      "muted",
      "selected"
    ].forEach((C) => {
      d[C] = new c(C, r, true, C, null, false, false);
    }), [
      "capture",
      "download"
    ].forEach((C) => {
      d[C] = new c(C, i, false, C, null, false, false);
    }), [
      "cols",
      "rows",
      "size",
      "span"
    ].forEach((C) => {
      d[C] = new c(C, s, false, C, null, false, false);
    }), [
      "rowSpan",
      "start"
    ].forEach((C) => {
      d[C] = new c(C, a, false, C.toLowerCase(), null, false, false);
    });
    const h = /[\-\:]([a-z])/g, f = (C) => C[1].toUpperCase();
    [
      "accent-height",
      "alignment-baseline",
      "arabic-form",
      "baseline-shift",
      "cap-height",
      "clip-path",
      "clip-rule",
      "color-interpolation",
      "color-interpolation-filters",
      "color-profile",
      "color-rendering",
      "dominant-baseline",
      "enable-background",
      "fill-opacity",
      "fill-rule",
      "flood-color",
      "flood-opacity",
      "font-family",
      "font-size",
      "font-size-adjust",
      "font-stretch",
      "font-style",
      "font-variant",
      "font-weight",
      "glyph-name",
      "glyph-orientation-horizontal",
      "glyph-orientation-vertical",
      "horiz-adv-x",
      "horiz-origin-x",
      "image-rendering",
      "letter-spacing",
      "lighting-color",
      "marker-end",
      "marker-mid",
      "marker-start",
      "overline-position",
      "overline-thickness",
      "paint-order",
      "panose-1",
      "pointer-events",
      "rendering-intent",
      "shape-rendering",
      "stop-color",
      "stop-opacity",
      "strikethrough-position",
      "strikethrough-thickness",
      "stroke-dasharray",
      "stroke-dashoffset",
      "stroke-linecap",
      "stroke-linejoin",
      "stroke-miterlimit",
      "stroke-opacity",
      "stroke-width",
      "text-anchor",
      "text-decoration",
      "text-rendering",
      "underline-position",
      "underline-thickness",
      "unicode-bidi",
      "unicode-range",
      "units-per-em",
      "v-alphabetic",
      "v-hanging",
      "v-ideographic",
      "v-mathematical",
      "vector-effect",
      "vert-adv-y",
      "vert-origin-x",
      "vert-origin-y",
      "word-spacing",
      "writing-mode",
      "xmlns:xlink",
      "x-height"
    ].forEach((C) => {
      const x = C.replace(h, f);
      d[x] = new c(x, e, false, C, null, false, false);
    }), [
      "xlink:actuate",
      "xlink:arcrole",
      "xlink:role",
      "xlink:show",
      "xlink:title",
      "xlink:type"
    ].forEach((C) => {
      const x = C.replace(h, f);
      d[x] = new c(x, e, false, C, "http://www.w3.org/1999/xlink", false, false);
    }), [
      "xml:base",
      "xml:lang",
      "xml:space"
    ].forEach((C) => {
      const x = C.replace(h, f);
      d[x] = new c(x, e, false, C, "http://www.w3.org/XML/1998/namespace", false, false);
    }), [
      "tabIndex",
      "crossOrigin"
    ].forEach((C) => {
      d[C] = new c(C, e, false, C.toLowerCase(), null, false, false);
    });
    const g = "xlinkHref";
    d[g] = new c("xlinkHref", e, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false), [
      "src",
      "href",
      "action",
      "formAction"
    ].forEach((C) => {
      d[C] = new c(C, e, false, C.toLowerCase(), null, true, true);
    });
    const { CAMELCASE: m, SAME: v, possibleStandardNames: y } = hSe(), b = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", j = RegExp.prototype.test.bind(new RegExp("^(data|aria)-[" + b + "]*$")), k = Object.keys(y).reduce((C, x) => {
      const S = y[x];
      return S === v ? C[x] = x : S === m ? C[x.toLowerCase()] = x : C[x] = S, C;
    }, {});
    return jl.BOOLEAN = r, jl.BOOLEANISH_STRING = n, jl.NUMERIC = a, jl.OVERLOADED_BOOLEAN = i, jl.POSITIVE_NUMERIC = s, jl.RESERVED = t, jl.STRING = e, jl.getPropertyInfo = l, jl.isCustomAttribute = j, jl.possibleStandardNames = k, jl;
  }
  var v0 = {}, _0 = {}, D9, RW;
  function mSe() {
    if (RW) return D9;
    RW = 1;
    var t = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, e = /\n/g, n = /^\s*/, r = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, i = /^:\s*/, a = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, s = /^[;\s]*/, l = /^\s+|\s+$/g, c = `
`, d = "/", u = "*", h = "", f = "comment", g = "declaration";
    D9 = function(v, y) {
      if (typeof v != "string") throw new TypeError("First argument must be a string");
      if (!v) return [];
      y = y || {};
      var w = 1, b = 1;
      function j(O) {
        var M = O.match(e);
        M && (w += M.length);
        var I = O.lastIndexOf(c);
        b = ~I ? O.length - I : b + O.length;
      }
      function k() {
        var O = {
          line: w,
          column: b
        };
        return function(M) {
          return M.position = new C(O), T(), M;
        };
      }
      function C(O) {
        this.start = O, this.end = {
          line: w,
          column: b
        }, this.source = y.source;
      }
      C.prototype.content = v;
      function x(O) {
        var M = new Error(y.source + ":" + w + ":" + b + ": " + O);
        if (M.reason = O, M.filename = y.source, M.line = w, M.column = b, M.source = v, !y.silent) throw M;
      }
      function S(O) {
        var M = O.exec(v);
        if (M) {
          var I = M[0];
          return j(I), v = v.slice(I.length), M;
        }
      }
      function T() {
        S(n);
      }
      function A(O) {
        var M;
        for (O = O || []; M = B(); ) M !== false && O.push(M);
        return O;
      }
      function B() {
        var O = k();
        if (!(d != v.charAt(0) || u != v.charAt(1))) {
          for (var M = 2; h != v.charAt(M) && (u != v.charAt(M) || d != v.charAt(M + 1)); ) ++M;
          if (M += 2, h === v.charAt(M - 1)) return x("End of comment missing");
          var I = v.slice(2, M - 2);
          return b += 2, j(I), v = v.slice(M), b += 2, O({
            type: f,
            comment: I
          });
        }
      }
      function U() {
        var O = k(), M = S(r);
        if (M) {
          if (B(), !S(i)) return x("property missing ':'");
          var I = S(a), N = O({
            type: g,
            property: m(M[0].replace(t, h)),
            value: I ? m(I[0].replace(t, h)) : h
          });
          return S(s), N;
        }
      }
      function z() {
        var O = [];
        A(O);
        for (var M; M = U(); ) M !== false && (O.push(M), A(O));
        return O;
      }
      return T(), z();
    };
    function m(v) {
      return v ? v.replace(l, h) : h;
    }
    return D9;
  }
  var AW;
  function gSe() {
    if (AW) return _0;
    AW = 1;
    var t = _0 && _0.__importDefault || function(r) {
      return r && r.__esModule ? r : {
        default: r
      };
    };
    Object.defineProperty(_0, "__esModule", {
      value: true
    });
    var e = t(mSe());
    function n(r, i) {
      var a = null;
      if (!r || typeof r != "string") return a;
      var s = (0, e.default)(r), l = typeof i == "function";
      return s.forEach(function(c) {
        if (c.type === "declaration") {
          var d = c.property, u = c.value;
          l ? i(d, u, c) : u && (a = a || {}, a[d] = u);
        }
      }), a;
    }
    return _0.default = n, _0;
  }
  var A_ = {}, IW;
  function pSe() {
    if (IW) return A_;
    IW = 1, Object.defineProperty(A_, "__esModule", {
      value: true
    }), A_.camelCase = void 0;
    var t = /^--[a-zA-Z0-9-]+$/, e = /-([a-z])/g, n = /^[^-]+$/, r = /^-(webkit|moz|ms|o|khtml)-/, i = /^-(ms)-/, a = function(d) {
      return !d || n.test(d) || t.test(d);
    }, s = function(d, u) {
      return u.toUpperCase();
    }, l = function(d, u) {
      return "".concat(u, "-");
    }, c = function(d, u) {
      return u === void 0 && (u = {}), a(d) ? d : (d = d.toLowerCase(), u.reactCompat ? d = d.replace(i, l) : d = d.replace(r, l), d.replace(e, s));
    };
    return A_.camelCase = c, A_;
  }
  var BW;
  function FSe() {
    if (BW) return v0;
    BW = 1;
    var t = v0 && v0.__importDefault || function(i) {
      return i && i.__esModule ? i : {
        default: i
      };
    };
    Object.defineProperty(v0, "__esModule", {
      value: true
    });
    var e = t(gSe()), n = pSe();
    function r(i, a) {
      var s = {};
      return !i || typeof i != "string" || (0, e.default)(i, function(l, c) {
        l && c && (s[(0, n.camelCase)(l, a)] = c);
      }), s;
    }
    return v0.default = r, v0;
  }
  var C9, PW;
  function coe() {
    if (PW) return C9;
    PW = 1;
    var t = dh(), e = FSe().default, n = /* @__PURE__ */ new Set([
      "annotation-xml",
      "color-profile",
      "font-face",
      "font-face-src",
      "font-face-uri",
      "font-face-format",
      "font-face-name",
      "missing-glyph"
    ]);
    function r(u, h) {
      return u.indexOf("-") === -1 ? h && typeof h.is == "string" : !n.has(u);
    }
    var i = {
      reactCompat: true
    };
    function a(u, h) {
      if (u != null) try {
        h.style = e(u, i);
      } catch {
        h.style = {};
      }
    }
    var s = t.version.split(".")[0] >= 16, l = /* @__PURE__ */ new Set([
      "tr",
      "tbody",
      "thead",
      "tfoot",
      "colgroup",
      "table",
      "head",
      "html",
      "frameset"
    ]);
    function c(u) {
      return !l.has(u.name);
    }
    function d(u) {
      return u;
    }
    return C9 = {
      PRESERVE_CUSTOM_ATTRIBUTES: s,
      ELEMENTS_WITH_NO_TEXT_CHILDREN: l,
      isCustomComponent: r,
      setStyleProp: a,
      canTextBeChildOfNode: c,
      returnFirstArg: d
    }, C9;
  }
  var E9, MW;
  function doe() {
    if (MW) return E9;
    MW = 1;
    var t = fSe(), e = coe(), n = [
      "checked",
      "value"
    ], r = [
      "input",
      "select",
      "textarea"
    ], i = {
      reset: true,
      submit: true
    };
    E9 = function(l, c) {
      l = l || {};
      var d, u, h, f, g, m = {}, v = l.type && i[l.type];
      for (d in l) {
        if (h = l[d], t.isCustomAttribute(d)) {
          m[d] = h;
          continue;
        }
        if (u = d.toLowerCase(), f = a(u), f) {
          switch (g = t.getPropertyInfo(f), n.indexOf(f) !== -1 && r.indexOf(c) !== -1 && !v && (f = a("default" + u)), m[f] = h, g && g.type) {
            case t.BOOLEAN:
              m[f] = true;
              break;
            case t.OVERLOADED_BOOLEAN:
              h === "" && (m[f] = true);
              break;
          }
          continue;
        }
        e.PRESERVE_CUSTOM_ATTRIBUTES && (m[d] = h);
      }
      return e.setStyleProp(l.style, m), m;
    };
    function a(s) {
      return t.possibleStandardNames[s];
    }
    return E9;
  }
  var k9, OW;
  function vSe() {
    if (OW) return k9;
    OW = 1;
    var t = dh(), e = doe(), n = coe(), r = n.setStyleProp, i = n.canTextBeChildOfNode;
    function a(l, c) {
      c = c || {};
      for (var d = c.library || t, u = d.cloneElement, h = d.createElement, f = d.isValidElement, g = [], m, v, y = typeof c.replace == "function", w = c.transform || n.returnFirstArg, b, j, k, C = c.trim, x = 0, S = l.length; x < S; x++) {
        if (m = l[x], y && (b = c.replace(m), f(b))) {
          S > 1 && (b = u(b, {
            key: b.key || x
          })), g.push(w(b, m, x));
          continue;
        }
        if (m.type === "text") {
          if (v = !m.data.trim().length, v && m.parent && !i(m.parent) || C && v) continue;
          g.push(w(m.data, m, x));
          continue;
        }
        switch (j = m.attribs, s(m) ? r(j.style, j) : j && (j = e(j, m.name)), k = null, m.type) {
          case "script":
          case "style":
            m.children[0] && (j.dangerouslySetInnerHTML = {
              __html: m.children[0].data
            });
            break;
          case "tag":
            m.name === "textarea" && m.children[0] ? j.defaultValue = m.children[0].data : m.children && m.children.length && (k = a(m.children, c));
            break;
          default:
            continue;
        }
        S > 1 && (j.key = x), g.push(w(h(m.name, j, k), m, x));
      }
      return g.length === 1 ? g[0] : g;
    }
    function s(l) {
      return n.PRESERVE_CUSTOM_ATTRIBUTES && l.type === "tag" && n.isCustomComponent(l.name, l.attribs);
    }
    return k9 = a, k9;
  }
  var S9, LW;
  function _Se() {
    if (LW) return S9;
    LW = 1;
    var t = loe(), e = uSe().default, n = doe(), r = vSe();
    e = typeof e.default == "function" ? e.default : e;
    var i = {
      lowerCaseAttributeNames: false
    };
    function a(s, l) {
      if (typeof s != "string") throw new TypeError("First argument must be a string");
      return s === "" ? [] : (l = l || {}, r(e(s, l.htmlparser2 || i), l));
    }
    return a.domToReact = r, a.htmlToDOM = e, a.attributesToProps = n, a.Comment = t.Comment, a.Element = t.Element, a.ProcessingInstruction = t.ProcessingInstruction, a.Text = t.Text, S9 = a, a.default = a, S9;
  }
  var ySe = _Se();
  const Zd = da(ySe);
  var uoe = Zd.domToReact;
  Zd.htmlToDOM;
  var bSe = Zd.attributesToProps;
  Zd.Comment;
  var hg = Zd.Element;
  Zd.ProcessingInstruction;
  var mw = Zd.Text;
  const xSe = " \xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", wSe = "\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2", zA = "numeric", UA = "ascii", VA = "alpha", Wy = "asciinumeric", py = "alphanumeric", HA = "domain", hoe = "emoji", DSe = "scheme", CSe = "slashscheme", j9 = "whitespace";
  function ESe(t, e) {
    return t in e || (e[t] = []), e[t];
  }
  function fg(t, e, n) {
    e[zA] && (e[Wy] = true, e[py] = true), e[UA] && (e[Wy] = true, e[VA] = true), e[Wy] && (e[py] = true), e[VA] && (e[py] = true), e[py] && (e[HA] = true), e[hoe] && (e[HA] = true);
    for (const r in e) {
      const i = ESe(r, n);
      i.indexOf(t) < 0 && i.push(t);
    }
  }
  function kSe(t, e) {
    const n = {};
    for (const r in e) e[r].indexOf(t) >= 0 && (n[r] = true);
    return n;
  }
  function il(t = null) {
    this.j = {}, this.jr = [], this.jd = null, this.t = t;
  }
  il.groups = {};
  il.prototype = {
    accepts() {
      return !!this.t;
    },
    go(t) {
      const e = this, n = e.j[t];
      if (n) return n;
      for (let r = 0; r < e.jr.length; r++) {
        const i = e.jr[r][0], a = e.jr[r][1];
        if (a && i.test(t)) return a;
      }
      return e.jd;
    },
    has(t, e = false) {
      return e ? t in this.j : !!this.go(t);
    },
    ta(t, e, n, r) {
      for (let i = 0; i < t.length; i++) this.tt(t[i], e, n, r);
    },
    tr(t, e, n, r) {
      r = r || il.groups;
      let i;
      return e && e.j ? i = e : (i = new il(e), n && r && fg(e, n, r)), this.jr.push([
        t,
        i
      ]), i;
    },
    ts(t, e, n, r) {
      let i = this;
      const a = t.length;
      if (!a) return i;
      for (let s = 0; s < a - 1; s++) i = i.tt(t[s]);
      return i.tt(t[a - 1], e, n, r);
    },
    tt(t, e, n, r) {
      r = r || il.groups;
      const i = this;
      if (e && e.j) return i.j[t] = e, e;
      const a = e;
      let s, l = i.go(t);
      if (l ? (s = new il(), Object.assign(s.j, l.j), s.jr.push.apply(s.jr, l.jr), s.jd = l.jd, s.t = l.t) : s = new il(), a) {
        if (r) if (s.t && typeof s.t == "string") {
          const c = Object.assign(kSe(s.t, r), n);
          fg(a, c, r);
        } else n && fg(a, n, r);
        s.t = a;
      }
      return i.j[t] = s, s;
    }
  };
  const Tr = (t, e, n, r, i) => t.ta(e, n, r, i), so = (t, e, n, r, i) => t.tr(e, n, r, i), NW = (t, e, n, r, i) => t.ts(e, n, r, i), Kt = (t, e, n, r, i) => t.tt(e, n, r, i), bu = "WORD", $A = "UWORD", foe = "ASCIINUMERICAL", moe = "ALPHANUMERICAL", rb = "LOCALHOST", WA = "TLD", qA = "UTLD", OD = "SCHEME", P0 = "SLASH_SCHEME", lP = "NUM", KA = "WS", cP = "NL", qy = "OPENBRACE", Ky = "CLOSEBRACE", _4 = "OPENBRACKET", y4 = "CLOSEBRACKET", b4 = "OPENPAREN", x4 = "CLOSEPAREN", w4 = "OPENANGLEBRACKET", D4 = "CLOSEANGLEBRACKET", C4 = "FULLWIDTHLEFTPAREN", E4 = "FULLWIDTHRIGHTPAREN", k4 = "LEFTCORNERBRACKET", S4 = "RIGHTCORNERBRACKET", j4 = "LEFTWHITECORNERBRACKET", T4 = "RIGHTWHITECORNERBRACKET", R4 = "FULLWIDTHLESSTHAN", A4 = "FULLWIDTHGREATERTHAN", I4 = "AMPERSAND", B4 = "APOSTROPHE", P4 = "ASTERISK", of = "AT", M4 = "BACKSLASH", O4 = "BACKTICK", L4 = "CARET", hf = "COLON", dP = "COMMA", N4 = "DOLLAR", wd = "DOT", z4 = "EQUALS", uP = "EXCLAMATION", Rl = "HYPHEN", Gy = "PERCENT", U4 = "PIPE", V4 = "PLUS", H4 = "POUND", Yy = "QUERY", hP = "QUOTE", goe = "FULLWIDTHMIDDLEDOT", fP = "SEMI", Dd = "SLASH", Zy = "TILDE", $4 = "UNDERSCORE", poe = "EMOJI", W4 = "SYM";
  var Foe = Object.freeze({
    __proto__: null,
    ALPHANUMERICAL: moe,
    AMPERSAND: I4,
    APOSTROPHE: B4,
    ASCIINUMERICAL: foe,
    ASTERISK: P4,
    AT: of,
    BACKSLASH: M4,
    BACKTICK: O4,
    CARET: L4,
    CLOSEANGLEBRACKET: D4,
    CLOSEBRACE: Ky,
    CLOSEBRACKET: y4,
    CLOSEPAREN: x4,
    COLON: hf,
    COMMA: dP,
    DOLLAR: N4,
    DOT: wd,
    EMOJI: poe,
    EQUALS: z4,
    EXCLAMATION: uP,
    FULLWIDTHGREATERTHAN: A4,
    FULLWIDTHLEFTPAREN: C4,
    FULLWIDTHLESSTHAN: R4,
    FULLWIDTHMIDDLEDOT: goe,
    FULLWIDTHRIGHTPAREN: E4,
    HYPHEN: Rl,
    LEFTCORNERBRACKET: k4,
    LEFTWHITECORNERBRACKET: j4,
    LOCALHOST: rb,
    NL: cP,
    NUM: lP,
    OPENANGLEBRACKET: w4,
    OPENBRACE: qy,
    OPENBRACKET: _4,
    OPENPAREN: b4,
    PERCENT: Gy,
    PIPE: U4,
    PLUS: V4,
    POUND: H4,
    QUERY: Yy,
    QUOTE: hP,
    RIGHTCORNERBRACKET: S4,
    RIGHTWHITECORNERBRACKET: T4,
    SCHEME: OD,
    SEMI: fP,
    SLASH: Dd,
    SLASH_SCHEME: P0,
    SYM: W4,
    TILDE: Zy,
    TLD: WA,
    UNDERSCORE: $4,
    UTLD: qA,
    UWORD: $A,
    WORD: bu,
    WS: KA
  });
  const gu = /[a-z]/, I_ = new RegExp("\\p{L}", "u"), T9 = new RegExp("\\p{Emoji}", "u"), pu = /\d/, R9 = /\s/, zW = "\r", A9 = `
`, SSe = "\uFE0F", jSe = "\u200D", I9 = "\uFFFC";
  let gw = null, pw = null;
  function TSe(t = []) {
    const e = {};
    il.groups = e;
    const n = new il();
    gw == null && (gw = UW(xSe)), pw == null && (pw = UW(wSe)), Kt(n, "'", B4), Kt(n, "{", qy), Kt(n, "}", Ky), Kt(n, "[", _4), Kt(n, "]", y4), Kt(n, "(", b4), Kt(n, ")", x4), Kt(n, "<", w4), Kt(n, ">", D4), Kt(n, "\uFF08", C4), Kt(n, "\uFF09", E4), Kt(n, "\u300C", k4), Kt(n, "\u300D", S4), Kt(n, "\u300E", j4), Kt(n, "\u300F", T4), Kt(n, "\uFF1C", R4), Kt(n, "\uFF1E", A4), Kt(n, "&", I4), Kt(n, "*", P4), Kt(n, "@", of), Kt(n, "`", O4), Kt(n, "^", L4), Kt(n, ":", hf), Kt(n, ",", dP), Kt(n, "$", N4), Kt(n, ".", wd), Kt(n, "=", z4), Kt(n, "!", uP), Kt(n, "-", Rl), Kt(n, "%", Gy), Kt(n, "|", U4), Kt(n, "+", V4), Kt(n, "#", H4), Kt(n, "?", Yy), Kt(n, '"', hP), Kt(n, "/", Dd), Kt(n, ";", fP), Kt(n, "~", Zy), Kt(n, "_", $4), Kt(n, "\\", M4), Kt(n, "\u30FB", goe);
    const r = so(n, pu, lP, {
      [zA]: true
    });
    so(r, pu, r);
    const i = so(r, gu, foe, {
      [Wy]: true
    }), a = so(r, I_, moe, {
      [py]: true
    }), s = so(n, gu, bu, {
      [UA]: true
    });
    so(s, pu, i), so(s, gu, s), so(i, pu, i), so(i, gu, i);
    const l = so(n, I_, $A, {
      [VA]: true
    });
    so(l, gu), so(l, pu, a), so(l, I_, l), so(a, pu, a), so(a, gu), so(a, I_, a);
    const c = Kt(n, A9, cP, {
      [j9]: true
    }), d = Kt(n, zW, KA, {
      [j9]: true
    }), u = so(n, R9, KA, {
      [j9]: true
    });
    Kt(n, I9, u), Kt(d, A9, c), Kt(d, I9, u), so(d, R9, u), Kt(u, zW), Kt(u, A9), so(u, R9, u), Kt(u, I9, u);
    const h = so(n, T9, poe, {
      [hoe]: true
    });
    Kt(h, "#"), so(h, T9, h), Kt(h, SSe, h);
    const f = Kt(h, jSe);
    Kt(f, "#"), so(f, T9, h);
    const g = [
      [
        gu,
        s
      ],
      [
        pu,
        i
      ]
    ], m = [
      [
        gu,
        null
      ],
      [
        I_,
        l
      ],
      [
        pu,
        a
      ]
    ];
    for (let v = 0; v < gw.length; v++) Wh(n, gw[v], WA, bu, g);
    for (let v = 0; v < pw.length; v++) Wh(n, pw[v], qA, $A, m);
    fg(WA, {
      tld: true,
      ascii: true
    }, e), fg(qA, {
      utld: true,
      alpha: true
    }, e), Wh(n, "file", OD, bu, g), Wh(n, "mailto", OD, bu, g), Wh(n, "http", P0, bu, g), Wh(n, "https", P0, bu, g), Wh(n, "ftp", P0, bu, g), Wh(n, "ftps", P0, bu, g), fg(OD, {
      scheme: true,
      ascii: true
    }, e), fg(P0, {
      slashscheme: true,
      ascii: true
    }, e), t = t.sort((v, y) => v[0] > y[0] ? 1 : -1);
    for (let v = 0; v < t.length; v++) {
      const y = t[v][0], b = t[v][1] ? {
        [DSe]: true
      } : {
        [CSe]: true
      };
      y.indexOf("-") >= 0 ? b[HA] = true : gu.test(y) ? pu.test(y) ? b[Wy] = true : b[UA] = true : b[zA] = true, NW(n, y, y, b);
    }
    return NW(n, "localhost", rb, {
      ascii: true
    }), n.jd = new il(W4), {
      start: n,
      tokens: Object.assign({
        groups: e
      }, Foe)
    };
  }
  function voe(t, e) {
    const n = RSe(e.replace(/[A-Z]/g, (l) => l.toLowerCase())), r = n.length, i = [];
    let a = 0, s = 0;
    for (; s < r; ) {
      let l = t, c = null, d = 0, u = null, h = -1, f = -1;
      for (; s < r && (c = l.go(n[s])); ) l = c, l.accepts() ? (h = 0, f = 0, u = l) : h >= 0 && (h += n[s].length, f++), d += n[s].length, a += n[s].length, s++;
      a -= h, s -= f, d -= h, i.push({
        t: u.t,
        v: e.slice(a - d, a),
        s: a - d,
        e: a
      });
    }
    return i;
  }
  function RSe(t) {
    const e = [], n = t.length;
    let r = 0;
    for (; r < n; ) {
      let i = t.charCodeAt(r), a, s = i < 55296 || i > 56319 || r + 1 === n || (a = t.charCodeAt(r + 1)) < 56320 || a > 57343 ? t[r] : t.slice(r, r + 2);
      e.push(s), r += s.length;
    }
    return e;
  }
  function Wh(t, e, n, r, i) {
    let a;
    const s = e.length;
    for (let l = 0; l < s - 1; l++) {
      const c = e[l];
      t.j[c] ? a = t.j[c] : (a = new il(r), a.jr = i.slice(), t.j[c] = a), t = a;
    }
    return a = new il(n), a.jr = i.slice(), t.j[e[s - 1]] = a, a;
  }
  function UW(t) {
    const e = [], n = [];
    let r = 0, i = "0123456789";
    for (; r < t.length; ) {
      let a = 0;
      for (; i.indexOf(t[r + a]) >= 0; ) a++;
      if (a > 0) {
        e.push(n.join(""));
        for (let s = parseInt(t.substring(r, r + a), 10); s > 0; s--) n.pop();
        r += a;
      } else n.push(t[r]), r++;
    }
    return e;
  }
  const ib = {
    defaultProtocol: "http",
    events: null,
    format: VW,
    formatHref: VW,
    nl2br: false,
    tagName: "a",
    target: null,
    rel: null,
    validate: true,
    truncate: 1 / 0,
    className: null,
    attributes: null,
    ignoreTags: [],
    render: null
  };
  function Ik(t, e = null) {
    let n = Object.assign({}, ib);
    t && (n = Object.assign(n, t instanceof Ik ? t.o : t));
    const r = n.ignoreTags, i = [];
    for (let a = 0; a < r.length; a++) i.push(r[a].toUpperCase());
    this.o = n, e && (this.defaultRender = e), this.ignoreTags = i;
  }
  Ik.prototype = {
    o: ib,
    ignoreTags: [],
    defaultRender(t) {
      return t;
    },
    check(t) {
      return this.get("validate", t.toString(), t);
    },
    get(t, e, n) {
      const r = e != null;
      let i = this.o[t];
      return i && (typeof i == "object" ? (i = n.t in i ? i[n.t] : ib[t], typeof i == "function" && r && (i = i(e, n))) : typeof i == "function" && r && (i = i(e, n.t, n)), i);
    },
    getObj(t, e, n) {
      let r = this.o[t];
      return typeof r == "function" && e != null && (r = r(e, n.t, n)), r;
    },
    render(t) {
      const e = t.render(this);
      return (this.get("render", null, t) || this.defaultRender)(e, t.t, t);
    }
  };
  function VW(t) {
    return t;
  }
  function _oe(t, e) {
    this.t = "token", this.v = t, this.tk = e;
  }
  _oe.prototype = {
    isLink: false,
    toString() {
      return this.v;
    },
    toHref(t) {
      return this.toString();
    },
    toFormattedString(t) {
      const e = this.toString(), n = t.get("truncate", e, this), r = t.get("format", e, this);
      return n && r.length > n ? r.substring(0, n) + "\u2026" : r;
    },
    toFormattedHref(t) {
      return t.get("formatHref", this.toHref(t.get("defaultProtocol")), this);
    },
    startIndex() {
      return this.tk[0].s;
    },
    endIndex() {
      return this.tk[this.tk.length - 1].e;
    },
    toObject(t = ib.defaultProtocol) {
      return {
        type: this.t,
        value: this.toString(),
        isLink: this.isLink,
        href: this.toHref(t),
        start: this.startIndex(),
        end: this.endIndex()
      };
    },
    toFormattedObject(t) {
      return {
        type: this.t,
        value: this.toFormattedString(t),
        isLink: this.isLink,
        href: this.toFormattedHref(t),
        start: this.startIndex(),
        end: this.endIndex()
      };
    },
    validate(t) {
      return t.get("validate", this.toString(), this);
    },
    render(t) {
      const e = this, n = this.toHref(t.get("defaultProtocol")), r = t.get("formatHref", n, this), i = t.get("tagName", n, e), a = this.toFormattedString(t), s = {}, l = t.get("className", n, e), c = t.get("target", n, e), d = t.get("rel", n, e), u = t.getObj("attributes", n, e), h = t.getObj("events", n, e);
      return s.href = r, l && (s.class = l), c && (s.target = c), d && (s.rel = d), u && Object.assign(s, u), {
        tagName: i,
        attributes: s,
        content: a,
        eventListeners: h
      };
    }
  };
  function Bk(t, e) {
    class n extends _oe {
      constructor(i, a) {
        super(i, a), this.t = t;
      }
    }
    for (const r in e) n.prototype[r] = e[r];
    return n.t = t, n;
  }
  const HW = Bk("email", {
    isLink: true,
    toHref() {
      return "mailto:" + this.toString();
    }
  }), $W = Bk("text"), ASe = Bk("nl"), Fw = Bk("url", {
    isLink: true,
    toHref(t = ib.defaultProtocol) {
      return this.hasProtocol() ? this.v : `${t}://${this.v}`;
    },
    hasProtocol() {
      const t = this.tk;
      return t.length >= 2 && t[0].t !== rb && t[1].t === hf;
    }
  }), Tl = (t) => new il(t);
  function ISe({ groups: t }) {
    const e = t.domain.concat([
      I4,
      P4,
      of,
      M4,
      O4,
      L4,
      N4,
      z4,
      Rl,
      lP,
      Gy,
      U4,
      V4,
      H4,
      Dd,
      W4,
      Zy,
      $4
    ]), n = [
      B4,
      hf,
      dP,
      wd,
      uP,
      Gy,
      Yy,
      hP,
      fP,
      w4,
      D4,
      qy,
      Ky,
      y4,
      _4,
      b4,
      x4,
      C4,
      E4,
      k4,
      S4,
      j4,
      T4,
      R4,
      A4
    ], r = [
      I4,
      B4,
      P4,
      M4,
      O4,
      L4,
      N4,
      z4,
      Rl,
      qy,
      Ky,
      Gy,
      U4,
      V4,
      H4,
      Yy,
      Dd,
      W4,
      Zy,
      $4
    ], i = Tl(), a = Kt(i, Zy);
    Tr(a, r, a), Tr(a, t.domain, a);
    const s = Tl(), l = Tl(), c = Tl();
    Tr(i, t.domain, s), Tr(i, t.scheme, l), Tr(i, t.slashscheme, c), Tr(s, r, a), Tr(s, t.domain, s);
    const d = Kt(s, of);
    Kt(a, of, d), Kt(l, of, d), Kt(c, of, d);
    const u = Kt(a, wd);
    Tr(u, r, a), Tr(u, t.domain, a);
    const h = Tl();
    Tr(d, t.domain, h), Tr(h, t.domain, h);
    const f = Kt(h, wd);
    Tr(f, t.domain, h);
    const g = Tl(HW);
    Tr(f, t.tld, g), Tr(f, t.utld, g), Kt(d, rb, g);
    const m = Kt(h, Rl);
    Kt(m, Rl, m), Tr(m, t.domain, h), Tr(g, t.domain, h), Kt(g, wd, f), Kt(g, Rl, m);
    const v = Kt(g, hf);
    Tr(v, t.numeric, HW);
    const y = Kt(s, Rl), w = Kt(s, wd);
    Kt(y, Rl, y), Tr(y, t.domain, s), Tr(w, r, a), Tr(w, t.domain, s);
    const b = Tl(Fw);
    Tr(w, t.tld, b), Tr(w, t.utld, b), Tr(b, t.domain, s), Tr(b, r, a), Kt(b, wd, w), Kt(b, Rl, y), Kt(b, of, d);
    const j = Kt(b, hf), k = Tl(Fw);
    Tr(j, t.numeric, k);
    const C = Tl(Fw), x = Tl();
    Tr(C, e, C), Tr(C, n, x), Tr(x, e, C), Tr(x, n, x), Kt(b, Dd, C), Kt(k, Dd, C);
    const S = Kt(l, hf), T = Kt(c, hf), A = Kt(T, Dd), B = Kt(A, Dd);
    Tr(l, t.domain, s), Kt(l, wd, w), Kt(l, Rl, y), Tr(c, t.domain, s), Kt(c, wd, w), Kt(c, Rl, y), Tr(S, t.domain, C), Kt(S, Dd, C), Kt(S, Yy, C), Tr(B, t.domain, C), Tr(B, e, C), Kt(B, Dd, C);
    const U = [
      [
        qy,
        Ky
      ],
      [
        _4,
        y4
      ],
      [
        b4,
        x4
      ],
      [
        w4,
        D4
      ],
      [
        C4,
        E4
      ],
      [
        k4,
        S4
      ],
      [
        j4,
        T4
      ],
      [
        R4,
        A4
      ]
    ];
    for (let z = 0; z < U.length; z++) {
      const [O, M] = U[z], I = Kt(C, O);
      Kt(x, O, I), Kt(I, M, C);
      const N = Tl(Fw);
      Tr(I, e, N);
      const L = Tl();
      Tr(I, n), Tr(N, e, N), Tr(N, n, L), Tr(L, e, N), Tr(L, n, L), Kt(N, M, C), Kt(L, M, C);
    }
    return Kt(i, rb, b), Kt(i, cP, ASe), {
      start: i,
      tokens: Foe
    };
  }
  function BSe(t, e, n) {
    let r = n.length, i = 0, a = [], s = [];
    for (; i < r; ) {
      let l = t, c = null, d = null, u = 0, h = null, f = -1;
      for (; i < r && !(c = l.go(n[i].t)); ) s.push(n[i++]);
      for (; i < r && (d = c || l.go(n[i].t)); ) c = null, l = d, l.accepts() ? (f = 0, h = l) : f >= 0 && f++, i++, u++;
      if (f < 0) i -= u, i < r && (s.push(n[i]), i++);
      else {
        s.length > 0 && (a.push(B9($W, e, s)), s = []), i -= f, u -= f;
        const g = h.t, m = n.slice(i - u, i);
        a.push(B9(g, e, m));
      }
    }
    return s.length > 0 && a.push(B9($W, e, s)), a;
  }
  function B9(t, e, n) {
    const r = n[0].s, i = n[n.length - 1].e, a = e.slice(r, i);
    return new t(a, n);
  }
  const Ba = {
    scanner: null,
    parser: null,
    tokenQueue: [],
    pluginQueue: [],
    customSchemes: [],
    initialized: false
  };
  function PSe() {
    Ba.scanner = TSe(Ba.customSchemes);
    for (let t = 0; t < Ba.tokenQueue.length; t++) Ba.tokenQueue[t][1]({
      scanner: Ba.scanner
    });
    Ba.parser = ISe(Ba.scanner.tokens);
    for (let t = 0; t < Ba.pluginQueue.length; t++) Ba.pluginQueue[t][1]({
      scanner: Ba.scanner,
      parser: Ba.parser
    });
    return Ba.initialized = true, Ba;
  }
  function mP(t) {
    return Ba.initialized || PSe(), BSe(Ba.parser.start, t, voe(Ba.scanner.start, t));
  }
  mP.scan = voe;
  function yoe(t, e = null, n = null) {
    if (e && typeof e == "object") {
      if (n) throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);
      n = e, e = null;
    }
    const r = new Ik(n), i = mP(t), a = [];
    for (let s = 0; s < i.length; s++) {
      const l = i[s];
      l.isLink && (!e || l.t === e) && r.check(l) && a.push(l.toFormattedObject(r));
    }
    return a;
  }
  function MSe(t, e, n) {
    const r = mP(t), i = [];
    for (let a = 0; a < r.length; a++) {
      const s = r[a];
      if (s.t === "nl" && e.get("nl2br")) {
        const l = `__linkify-el-${n.elementId++}`;
        i.push(p.createElement("br", {
          key: l
        }));
      } else if (!s.isLink || !e.check(s)) i.push(s.toString());
      else {
        let l = e.render(s);
        if (!("key" in l.props)) {
          const c = `__linkify-el-${n.elementId++}`, d = Object.assign({
            key: c
          }, l.props);
          l = p.cloneElement(l, d);
        }
        i.push(l);
      }
    }
    return i;
  }
  function boe(t, e, n) {
    if (p.Children.count(t.props.children) === 0) return t;
    const r = [];
    p.Children.forEach(t.props.children, (s) => {
      typeof s == "string" ? r.push.apply(r, MSe(s, e, n)) : p.isValidElement(s) ? typeof s.type == "string" && e.ignoreTags.indexOf(s.type.toUpperCase()) >= 0 ? r.push(s) : r.push(boe(s, e, n)) : r.push(s);
    });
    const i = `__linkify-el-${n.elementId++}`, a = Object.assign({
      key: i
    }, t.props);
    return p.cloneElement(t, a, r);
  }
  const nF = (t) => {
    let e = 0;
    const n = ({ tagName: c, attributes: d, content: u }) => (d.key = `__linkify-lnk-${e++}`, d.class && (d.className = d.class, delete d.class), p.createElement(c, d, u)), r = {
      key: "__linkify-wrapper"
    };
    for (const c in t) c !== "options" && c !== "as" && c !== "tagName" && c !== "children" && (r[c] = t[c]);
    const i = new Ik(t.options, n), a = t.as || t.tagName || p.Fragment || "span", s = t.children, l = p.createElement(a, r, s);
    return boe(l, i, {
      elementId: 0
    });
  };
  var OSe = "CustomHtml_MarginSpaced__1t9vo330", GA = "CustomHtml_Paragraph__1t9vo331 _1mqalmd1 _1mqalmd0", y0 = "CustomHtml_Heading__1t9vo332 _1mqalmd1 _1mqalmd0 CustomHtml_MarginSpaced__1t9vo330", LSe = "CustomHtml_BlockQuote__1t9vo333 _1mqalmd1 _1mqalmd0 CustomHtml_MarginSpaced__1t9vo330", nh = "CustomHtml_Code__1t9vo336 _1mqalmd1 _1mqalmd0 CustomHtml_BaseCode__1t9vo334 CustomHtml_CodeFont__1t9vo335", NSe = Jr({
    defaultClassName: "CustomHtml__1t9vo338 CustomHtml_SpoilerBase__1t9vo337 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      active: {
        true: "CustomHtml_Spoiler_active_true__1t9vo339"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), zSe = "CustomHtml_CodeBlock__1t9vo33a _1mqalmd1 _1mqalmd0 CustomHtml_BaseCode__1t9vo334 CustomHtml_MarginSpaced__1t9vo330", USe = "CustomHtml_CodeBlockHeader__1t9vo33b ContainerColor_ContainerColor__15396tl0 _1mqalmd1 _1mqalmd0 ContainerColor_ContainerColor_variant_Surface__15396tl2", VSe = "CustomHtml_CodeBlockInternal__1t9vo33c CustomHtml_CodeFont__1t9vo335", HSe = "CustomHtml_CodeBlockBottomShadow__1t9vo33d", $Se = "CustomHtml_List__1t9vo33e _1mqalmd1 _1mqalmd0 CustomHtml_MarginSpaced__1t9vo330", WSe = "CustomHtml_OrderedList__1t9vo33f _1mqalmd1 _1mqalmd0 CustomHtml_MarginSpaced__1t9vo330", qSe = "CustomHtml_Img__1t9vo33g _1mqalmd1 _1mqalmd0 CustomHtml_MarginSpaced__1t9vo330", KSe = "CustomHtml_InlineChromiumBugfix__1t9vo33h", Jy = Jr({
    defaultClassName: "CustomHtml_Mention__1t9vo33i _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      highlight: {
        true: "CustomHtml_Mention_highlight_true__1t9vo33j"
      },
      focus: {
        true: "CustomHtml_Mention_focus_true__1t9vo33k"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), xoe = "CustomHtml_MentionWithIcon__1t9vo33l", woe = "CustomHtml_MentionIcon__1t9vo33m", GSe = Jr({
    defaultClassName: "CustomHtml_Command__1t9vo33n _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      focus: {
        true: "CustomHtml_Command_focus_true__1t9vo33o"
      },
      active: {
        true: "CustomHtml_Command_active_true__1t9vo33p"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), wu = "CustomHtml_EmoticonBase__1t9vo33q _1mqalmd1 _1mqalmd0", q4 = Jr({
    defaultClassName: "CustomHtml_Emoticon__1t9vo33r _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      focus: {
        true: "CustomHtml_Emoticon_focus_true__1t9vo33s"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), Fy = "CustomHtml_EmoticonImg__1t9vo33t _1mqalmd1 _1mqalmd0", YSe = "CustomHtml_highlightText__1t9vo33u _1mqalmd1 _1mqalmd0", ZSe = "CustomHtml_Small__1t9vo33v _1mqalmd1 _1mqalmd0", JSe = "CustomHtml_HorizontalRule__1t9vo33w _1mqalmd1 _1mqalmd0 CustomHtml_MarginSpaced__1t9vo330";
  const ob = (t) => t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), XSe = /^(([^<>()[\]\\.,;:\s@\\"]+(\.[^<>()[\]\\.,;:\s@\\"]+)*)|(\\".+\\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, QSe = "(?<!(https?|ftp|mailto|magnet):\\/\\/\\S*)", e6e = "[\uFE00-\uFE0F]", Doe = "[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\u{1F4A5})?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\u{1F525}|\u{1FA79}))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\u{1F1F2}|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\u{1F1E6}|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\u{1F1F0}|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\u{1F7EB})?|\uDF4B(?:\u200D\u{1F7E9})?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\u{1F308}))?|\uDFF4(?:\u200D\u2620\uFE0F?|\u{E0067}\u{E0062}\uDB40(?:\uDC65\u{E006E}\u{E0067}|\uDC73\u{E0063}\u{E0074}|\uDC77\u{E006C}\u{E0073})\u{E007F})?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\u{1F9BA})?|\uDC26(?:\u200D(?:\u2B1B|\u{1F525}))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\u{1F5E8}\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\u{1F466})?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\u{1F466})?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F468}\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F468}\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F468}\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F468}\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F468}\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\u{1F466})?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\u{1F466})?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\u{1F4A8})?|\uDE35(?:\u200D\u{1F4AB})?|\uDE36(?:\u200D\u{1F32B}\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F9D1}|\uDDD1\u200D\u{1F9D2}(?:\u200D\u{1F9D2})?|\uDDD2(?:\u200D\u{1F9D2})?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F9D1}\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F9D1}\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F9D1}\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F9D1}\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\u{1F9D1}\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\u{1FAF2}\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\u{1FAF2}\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\u{1FAF2}\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\u{1FAF2}\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\u{1FAF2}\uD83C[\uDFFB-\uDFFE])?))?)", Pk = new RegExp(`^(((${Doe})|(:.+?:))(${e6e}|\\s)*){1,10}$`), Mk = (t, e, n, r) => {
    const i = [];
    let a = 0, s = e.exec(t);
    for (; s !== null && typeof s.index == "number"; ) i.push(r(t.slice(a, s.index), i.length)), i.push(n(s, i.length)), a = s.index + s[0].length, e.global ? s = e.exec(t) : s = null;
    return i.push(r(t.slice(a), i.length)), i;
  }, t6e = /^#[0-9a-fA-F]{6}$/;
  function np(t) {
    return t6e.test(t);
  }
  const n6e = /^#?(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/, Coe = "[#]?(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})(?![0-9a-fA-F])";
  function r6e(t) {
    const e = t.trim();
    if (!n6e.test(e)) return;
    const n = e.replace(/^#/, "").toLowerCase();
    if (n.length === 3) {
      const a = `#${`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`}`;
      return np(a) ? a : void 0;
    }
    const r = `#${n}`;
    return np(r) ? r : void 0;
  }
  function rp({ children: t, src: e, className: n }) {
    const [r, i] = p.useState(false), a = p.useRef(null), [s, l] = p.useState(false);
    return p.useEffect(() => {
      let c = true;
      const d = new window.Image();
      d.crossOrigin = "anonymous", d.src = e;
      const u = () => {
        var _a6;
        c && a.current && (a.current.width = d.naturalWidth || d.width, a.current.height = d.naturalHeight || d.height, (_a6 = a.current.getContext("2d")) == null ? void 0 : _a6.drawImage(d, 0, 0), l(true));
      };
      return d.addEventListener("load", u), () => {
        c = false, d.removeEventListener("load", u);
      };
    }, [
      e
    ]), o.jsxs("div", {
      onMouseEnter: () => i(true),
      onMouseLeave: () => i(false),
      onFocus: () => i(true),
      onBlur: () => i(false),
      className: n,
      style: {
        position: "relative",
        display: "inline-flex",
        cursor: "pointer",
        verticalAlign: "middle",
        overflow: "hidden",
        borderRadius: "inherit"
      },
      children: [
        o.jsx("div", {
          style: {
            opacity: r || !s ? 1 : 0,
            display: "flex",
            width: "100%"
          },
          children: t
        }),
        o.jsx("canvas", {
          ref: a,
          style: {
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
            height: "100%",
            objectFit: "inherit",
            opacity: !r && s ? 1 : 0,
            pointerEvents: "none",
            display: "block"
          }
        })
      ]
    });
  }
  const i6e = {
    jsx: "tsx",
    markup: "html"
  };
  let P9 = null;
  function YA(t) {
    return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
  }
  function gc(t, e) {
    const n = {
      mode: "plain",
      html: YA(t)
    };
    return e !== void 0 && (n.language = e), n;
  }
  function o6e(t) {
    return i6e[t.toLowerCase()] ?? t;
  }
  async function WW(t, e) {
    if (Array.isArray(t.availableLanguages)) return t.availableLanguages.includes(e);
    if (typeof t.isLanguageAvailable == "function") try {
      return await t.isLanguageAvailable(e);
    } catch {
      return false;
    }
    return true;
  }
  async function qW(t) {
    if (t) try {
      return await t();
    } catch {
      return null;
    }
    return P9 || (P9 = L1(() => import("./arborium-Bm0lMy1i.js").then(async (m) => {
      await m.__tla;
      return m;
    }), []).then((e) => e).catch(() => null)), P9;
  }
  async function a6e({ code: t, language: e, allowDetect: n = false }, r) {
    const { loadModule: i } = {};
    if (e) {
      const l = o6e(e), c = await qW(i);
      if (!c) return gc(t, e);
      let d;
      try {
        d = c.normalizeLanguage(l);
      } catch {
        return gc(t, e);
      }
      if (!await WW(c, d)) return gc(t, e);
      try {
        const u = await c.highlight(d, t);
        return u === YA(t) ? gc(t, d) : {
          mode: "highlighted",
          html: u,
          language: d
        };
      } catch {
        return gc(t, d);
      }
    }
    const a = await qW(i);
    if (!a) return gc(t, e ?? void 0);
    let s = null;
    if (n) try {
      const l = a.detectLanguage(t);
      l && (s = a.normalizeLanguage(l));
    } catch {
      return gc(t, e ?? void 0);
    }
    if (!s || !await WW(a, s)) return gc(t, e ?? void 0);
    try {
      const l = await a.highlight(s, t);
      return l === YA(t) ? gc(t, s) : {
        mode: "highlighted",
        html: l,
        language: s
      };
    } catch {
      return gc(t, s);
    }
  }
  const Eoe = "2.16.0", s6e = [
    {
      id: "alabaster",
      label: "Alabaster",
      kind: "light"
    },
    {
      id: "ayu-light",
      label: "Ayu Light",
      kind: "light"
    },
    {
      id: "catppuccin-latte",
      label: "Catppuccin Latte",
      kind: "light"
    },
    {
      id: "dayfox",
      label: "Dayfox",
      kind: "light"
    },
    {
      id: "desert256",
      label: "Desert 256",
      kind: "light"
    },
    {
      id: "github-light",
      label: "GitHub Light",
      kind: "light"
    },
    {
      id: "gruvbox-light",
      label: "Gruvbox Light",
      kind: "light"
    },
    {
      id: "light-owl",
      label: "Light Owl",
      kind: "light"
    },
    {
      id: "lucius-light",
      label: "Lucius Light",
      kind: "light"
    },
    {
      id: "melange-light",
      label: "Melange Light",
      kind: "light"
    },
    {
      id: "solarized-light",
      label: "Solarized Light",
      kind: "light"
    },
    {
      id: "rustdoc-light",
      label: "Rustdoc Light",
      kind: "light"
    },
    {
      id: "github-dark",
      label: "GitHub Dark",
      kind: "dark"
    },
    {
      id: "one-dark",
      label: "One Dark",
      kind: "dark"
    },
    {
      id: "nord",
      label: "Nord",
      kind: "dark"
    },
    {
      id: "dracula",
      label: "Dracula",
      kind: "dark"
    },
    {
      id: "tokyo-night",
      label: "Tokyo Night",
      kind: "dark"
    },
    {
      id: "catppuccin-mocha",
      label: "Catppuccin Mocha",
      kind: "dark"
    },
    {
      id: "catppuccin-macchiato",
      label: "Catppuccin Macchiato",
      kind: "dark"
    },
    {
      id: "catppuccin-frappe",
      label: "Catppuccin Frappe",
      kind: "dark"
    },
    {
      id: "rose-pine-moon",
      label: "Rose Pine Moon",
      kind: "dark"
    },
    {
      id: "gruvbox-dark",
      label: "Gruvbox Dark",
      kind: "dark"
    },
    {
      id: "ayu-dark",
      label: "Ayu Dark",
      kind: "dark"
    },
    {
      id: "kanagawa-dragon",
      label: "Kanagawa Dragon",
      kind: "dark"
    },
    {
      id: "solarized-dark",
      label: "Solarized Dark",
      kind: "dark"
    },
    {
      id: "melange-dark",
      label: "Melange Dark",
      kind: "dark"
    },
    {
      id: "monokai",
      label: "Monokai",
      kind: "dark"
    },
    {
      id: "zenburn",
      label: "Zenburn",
      kind: "dark"
    },
    {
      id: "cobalt2",
      label: "Cobalt2",
      kind: "dark"
    },
    {
      id: "ef-melissa-dark",
      label: "Ef Melissa Dark",
      kind: "dark"
    },
    {
      id: "rustdoc-dark",
      label: "Rustdoc Dark",
      kind: "dark"
    },
    {
      id: "rustdoc-ayu",
      label: "Rustdoc Ayu",
      kind: "dark"
    }
  ], gP = "github-light", pP = "dracula", FP = [
    ...s6e
  ], l6e = new Set(FP.map((t) => t.id)), M9 = (t) => FP.filter((e) => e.kind === t), KW = (t) => l6e.has(t), c6e = (t) => {
    var _a6;
    return ((_a6 = FP.find((e) => e.id === t)) == null ? void 0 : _a6.label) ?? t;
  }, d6e = (t) => `https://cdn.jsdelivr.net/npm/@arborium/arborium@${Eoe}/dist/themes/${t}.css`, koe = p.createContext(null), u6e = () => {
    const t = p.useContext(koe);
    if (!t) throw new Error("No Arborium theme status provided!");
    return t;
  }, h6e = `https://cdn.jsdelivr.net/npm/@arborium/arborium@${Eoe}/dist/themes/base-rustdoc.css`, f6e = "arborium-base", m6e = "arborium-theme", GW = (t) => {
    const e = document.getElementById(t);
    if (e instanceof HTMLLinkElement) return e;
    const n = document.createElement("link");
    return n.setAttribute("id", t), n.setAttribute("rel", "stylesheet"), n.setAttribute("type", "text/css"), document.head.append(n), n;
  }, YW = (t, e) => {
    t.getAttribute("href") !== e && t.setAttribute("href", e);
  }, ZW = (t) => {
    t.setAttribute("data-arborium-loaded", "true");
  }, O9 = (t) => {
    t.removeAttribute("data-arborium-loaded");
  };
  function Soe({ kind: t, children: e }) {
    const [n] = Fe(ge, "useSystemArboriumTheme"), [r] = Fe(ge, "arboriumThemeId"), [i] = Fe(ge, "arboriumLightTheme"), [a] = Fe(ge, "arboriumDarkTheme"), [s, l] = p.useState(false), [c, d] = p.useState(false), u = t === Rr.Dark ? a : i;
    let h = gP;
    t === Rr.Dark && (h = pP), u && KW(u) && (h = u);
    const f = !n && r && KW(r) ? r : h, g = d6e(f);
    p.useEffect(() => {
      const v = GW(f6e);
      YW(v, h6e), l(v.dataset.arboriumLoaded === "true");
      const y = () => {
        ZW(v), l(true);
      }, w = () => {
        O9(v), l(false);
      };
      return v.addEventListener("load", y), v.addEventListener("error", w), () => {
        v.removeEventListener("load", y), v.removeEventListener("error", w);
      };
    }, []), p.useEffect(() => {
      const v = GW(m6e), y = v.getAttribute("href") !== g;
      YW(v, g), y && O9(v), d(!y && v.dataset.arboriumLoaded === "true");
      const w = () => {
        ZW(v), d(true);
      }, b = () => {
        O9(v), d(false);
      };
      return v.addEventListener("load", w), v.addEventListener("error", b), () => {
        v.removeEventListener("load", w), v.removeEventListener("error", b);
      };
    }, [
      g
    ]);
    const m = p.useMemo(() => ({
      ready: s && c
    }), [
      s,
      c
    ]);
    return o.jsx(koe.Provider, {
      value: m,
      children: e
    });
  }
  var g6e = "CodeHighlightRenderer_CodeHighlightCode__8wtblz0";
  const p6e = (t, e, n = false) => JSON.stringify([
    t,
    e ?? null,
    n
  ]), L9 = (t, e) => {
    const n = {
      mode: "plain",
      html: t
    };
    return e !== void 0 && (n.language = e), n;
  };
  function joe({ code: t, language: e, allowDetect: n = false, className: r }) {
    const { ready: i } = u6e(), a = p6e(t, e, n), [s, l] = p.useState(() => ({
      key: a,
      result: L9(t, e)
    }));
    p.useEffect(() => {
      let u = false;
      return l({
        key: a,
        result: L9(t, e)
      }), a6e({
        code: t,
        language: e,
        allowDetect: n
      }).then((h) => {
        u || l({
          key: a,
          result: h
        });
      }), () => {
        u = true;
      };
    }, [
      t,
      e,
      n,
      a
    ]);
    const c = s.key === a ? s.result : L9(t, e), d = [
      g6e,
      r
    ].filter(Boolean).join(" ");
    return !i || c.mode === "plain" ? o.jsx("code", {
      className: d,
      children: t
    }) : o.jsx("code", {
      className: d,
      dangerouslySetInnerHTML: {
        __html: c.html
      }
    });
  }
  const F6e = /200D|FE0E|FE0F/g;
  function v6e(t, e = true) {
    const n = [];
    return [
      ...t
    ].forEach((r) => {
      var _a6;
      let i = ((_a6 = r.codePointAt(0)) == null ? void 0 : _a6.toString(16).toUpperCase()) ?? "";
      for (; i.length < 4; ) i = `0${i}`;
      (!e || e && !i.match(F6e)) && n.push(i);
    }), n.join("-");
  }
  const _6e = JSON.parse(`[{"hexcode":"1F1E6","label":"regional indicator A","unicode":"\u{1F1E6}"},{"hexcode":"1F1E7","label":"regional indicator B","unicode":"\u{1F1E7}"},{"hexcode":"1F1E8","label":"regional indicator C","unicode":"\u{1F1E8}"},{"hexcode":"1F1E9","label":"regional indicator D","unicode":"\u{1F1E9}"},{"hexcode":"1F1EA","label":"regional indicator E","unicode":"\u{1F1EA}"},{"hexcode":"1F1EB","label":"regional indicator F","unicode":"\u{1F1EB}"},{"hexcode":"1F1EC","label":"regional indicator G","unicode":"\u{1F1EC}"},{"hexcode":"1F1ED","label":"regional indicator H","unicode":"\u{1F1ED}"},{"hexcode":"1F1EE","label":"regional indicator I","unicode":"\u{1F1EE}"},{"hexcode":"1F1EF","label":"regional indicator J","unicode":"\u{1F1EF}"},{"hexcode":"1F1F0","label":"regional indicator K","unicode":"\u{1F1F0}"},{"hexcode":"1F1F1","label":"regional indicator L","unicode":"\u{1F1F1}"},{"hexcode":"1F1F2","label":"regional indicator M","unicode":"\u{1F1F2}"},{"hexcode":"1F1F3","label":"regional indicator N","unicode":"\u{1F1F3}"},{"hexcode":"1F1F4","label":"regional indicator O","unicode":"\u{1F1F4}"},{"hexcode":"1F1F5","label":"regional indicator P","unicode":"\u{1F1F5}"},{"hexcode":"1F1F6","label":"regional indicator Q","unicode":"\u{1F1F6}"},{"hexcode":"1F1F7","label":"regional indicator R","unicode":"\u{1F1F7}"},{"hexcode":"1F1F8","label":"regional indicator S","unicode":"\u{1F1F8}"},{"hexcode":"1F1F9","label":"regional indicator T","unicode":"\u{1F1F9}"},{"hexcode":"1F1FA","label":"regional indicator U","unicode":"\u{1F1FA}"},{"hexcode":"1F1FB","label":"regional indicator V","unicode":"\u{1F1FB}"},{"hexcode":"1F1FC","label":"regional indicator W","unicode":"\u{1F1FC}"},{"hexcode":"1F1FD","label":"regional indicator X","unicode":"\u{1F1FD}"},{"hexcode":"1F1FE","label":"regional indicator Y","unicode":"\u{1F1FE}"},{"hexcode":"1F1FF","label":"regional indicator Z","unicode":"\u{1F1FF}"},{"group":0,"hexcode":"1F600","label":"grinning face","order":1,"tags":["face","grin"],"unicode":"\u{1F600}"},{"group":0,"hexcode":"1F603","label":"grinning face with big eyes","order":2,"tags":["face","mouth","open","smile"],"unicode":"\u{1F603}"},{"group":0,"hexcode":"1F604","label":"grinning face with smiling eyes","order":3,"tags":["eye","face","mouth","open","smile"],"unicode":"\u{1F604}","emoticon":":D"},{"group":0,"hexcode":"1F601","label":"beaming face with smiling eyes","order":4,"tags":["eye","face","grin","smile"],"unicode":"\u{1F601}"},{"group":0,"hexcode":"1F606","label":"grinning squinting face","order":5,"tags":["face","laugh","mouth","satisfied","smile"],"unicode":"\u{1F606}","emoticon":["xD","XD"]},{"group":0,"hexcode":"1F605","label":"grinning face with sweat","order":6,"tags":["cold","face","open","smile","sweat"],"unicode":"\u{1F605}"},{"group":0,"hexcode":"1F923","label":"rolling on the floor laughing","order":7,"tags":["face","floor","laugh","rofl","rolling","rotfl"],"unicode":"\u{1F923}","emoticon":":'D"},{"group":0,"hexcode":"1F602","label":"face with tears of joy","order":8,"tags":["face","joy","laugh","tear"],"unicode":"\u{1F602}","emoticon":":')"},{"group":0,"hexcode":"1F642","label":"slightly smiling face","order":9,"tags":["face","smile"],"unicode":"\u{1F642}","emoticon":":)"},{"group":0,"hexcode":"1F643","label":"upside-down face","order":10,"tags":["face","upside-down"],"unicode":"\u{1F643}"},{"group":0,"hexcode":"1FAE0","label":"melting face","order":11,"tags":["disappear","dissolve","liquid","melt"],"unicode":"\u{1FAE0}"},{"group":0,"hexcode":"1F609","label":"winking face","order":12,"tags":["face","wink"],"unicode":"\u{1F609}","emoticon":";)"},{"group":0,"hexcode":"1F60A","label":"smiling face with smiling eyes","order":13,"tags":["blush","eye","face","smile"],"unicode":"\u{1F60A}","emoticon":":>"},{"group":0,"hexcode":"1F607","label":"smiling face with halo","order":14,"tags":["angel","face","fantasy","halo","innocent"],"unicode":"\u{1F607}","emoticon":["o:)","O:)"]},{"group":0,"hexcode":"1F970","label":"smiling face with hearts","order":15,"tags":["adore","crush","hearts","in love"],"unicode":"\u{1F970}"},{"group":0,"hexcode":"1F60D","label":"smiling face with heart-eyes","order":16,"tags":["eye","face","love","smile"],"unicode":"\u{1F60D}"},{"group":0,"hexcode":"1F929","label":"star-struck","order":17,"tags":["eyes","face","grinning","star"],"unicode":"\u{1F929}"},{"group":0,"hexcode":"1F618","label":"face blowing a kiss","order":18,"tags":["face","kiss"],"unicode":"\u{1F618}","emoticon":[":x",":X"]},{"group":0,"hexcode":"1F617","label":"kissing face","order":19,"tags":["face","kiss"],"unicode":"\u{1F617}"},{"group":0,"hexcode":"263A","label":"smiling face","order":21,"tags":["face","outlined","relaxed","smile"],"unicode":"\u263A\uFE0F"},{"group":0,"hexcode":"1F61A","label":"kissing face with closed eyes","order":22,"tags":["closed","eye","face","kiss"],"unicode":"\u{1F61A}","emoticon":":*"},{"group":0,"hexcode":"1F619","label":"kissing face with smiling eyes","order":23,"tags":["eye","face","kiss","smile"],"unicode":"\u{1F619}"},{"group":0,"hexcode":"1F972","label":"smiling face with tear","order":24,"tags":["grateful","proud","relieved","smiling","tear","touched"],"unicode":"\u{1F972}"},{"group":0,"hexcode":"1F60B","label":"face savoring food","order":25,"tags":["delicious","face","savouring","smile","yum"],"unicode":"\u{1F60B}"},{"group":0,"hexcode":"1F61B","label":"face with tongue","order":26,"tags":["face","tongue"],"unicode":"\u{1F61B}","emoticon":[":p",":P"]},{"group":0,"hexcode":"1F61C","label":"winking face with tongue","order":27,"tags":["eye","face","joke","tongue","wink"],"unicode":"\u{1F61C}","emoticon":[";p",";P"]},{"group":0,"hexcode":"1F92A","label":"zany face","order":28,"tags":["eye","goofy","large","small"],"unicode":"\u{1F92A}"},{"group":0,"hexcode":"1F61D","label":"squinting face with tongue","order":29,"tags":["eye","face","horrible","taste","tongue"],"unicode":"\u{1F61D}","emoticon":["xp","xP","XP"]},{"group":0,"hexcode":"1F911","label":"money-mouth face","order":30,"tags":["face","money","mouth"],"unicode":"\u{1F911}"},{"group":0,"hexcode":"1F917","label":"smiling face with open hands","order":31,"tags":["face","hug","hugging","open hands","smiling face"],"unicode":"\u{1F917}"},{"group":0,"hexcode":"1F92D","label":"face with hand over mouth","order":32,"tags":["whoops"],"unicode":"\u{1F92D}"},{"group":0,"hexcode":"1FAE2","label":"face with open eyes and hand over mouth","order":33,"tags":["amazement","awe","disbelief","embarrass","scared","surprise"],"unicode":"\u{1FAE2}"},{"group":0,"hexcode":"1FAE3","label":"face with peeking eye","order":34,"tags":["captivated","peep","stare"],"unicode":"\u{1FAE3}"},{"group":0,"hexcode":"1F92B","label":"shushing face","order":35,"tags":["quiet","shush"],"unicode":"\u{1F92B}"},{"group":0,"hexcode":"1F914","label":"thinking face","order":36,"tags":["face","thinking"],"unicode":"\u{1F914}","emoticon":[":l",":L"]},{"group":0,"hexcode":"1FAE1","label":"saluting face","order":37,"tags":["ok","salute","sunny","troops","yes"],"unicode":"\u{1FAE1}"},{"group":0,"hexcode":"1F910","label":"zipper-mouth face","order":38,"tags":["face","mouth","zip","zipper"],"unicode":"\u{1F910}","emoticon":[":z",":Z"]},{"group":0,"hexcode":"1F928","label":"face with raised eyebrow","order":39,"tags":["distrust","skeptic"],"unicode":"\u{1F928}"},{"group":0,"hexcode":"1F610","label":"neutral face","order":40,"tags":["deadpan","face","meh","neutral"],"unicode":"\u{1F610}\uFE0F","emoticon":":|"},{"group":0,"hexcode":"1F611","label":"expressionless face","order":41,"tags":["expressionless","face","inexpressive","meh","unexpressive"],"unicode":"\u{1F611}"},{"group":0,"hexcode":"1F636","label":"face without mouth","order":42,"tags":["face","mouth","quiet","silent"],"unicode":"\u{1F636}","emoticon":":#"},{"group":0,"hexcode":"1FAE5","label":"dotted line face","order":43,"tags":["depressed","disappear","hide","introvert","invisible"],"unicode":"\u{1FAE5}"},{"group":0,"hexcode":"1F636-200D-1F32B-FE0F","label":"face in clouds","order":44,"tags":["absentminded","face in the fog","head in clouds"],"unicode":"\u{1F636}\u200D\u{1F32B}\uFE0F"},{"group":0,"hexcode":"1F60F","label":"smirking face","order":46,"tags":["face","smirk"],"unicode":"\u{1F60F}","emoticon":":j"},{"group":0,"hexcode":"1F612","label":"unamused face","order":47,"tags":["face","unamused","unhappy"],"unicode":"\u{1F612}","emoticon":":?"},{"group":0,"hexcode":"1F644","label":"face with rolling eyes","order":48,"tags":["eyeroll","eyes","face","rolling"],"unicode":"\u{1F644}"},{"group":0,"hexcode":"1F62C","label":"grimacing face","order":49,"tags":["face","grimace"],"unicode":"\u{1F62C}","emoticon":"8D"},{"group":0,"hexcode":"1F62E-200D-1F4A8","label":"face exhaling","order":50,"tags":["exhale","gasp","groan","relief","whisper","whistle"],"unicode":"\u{1F62E}\u200D\u{1F4A8}"},{"group":0,"hexcode":"1F925","label":"lying face","order":51,"tags":["face","lie","pinocchio"],"unicode":"\u{1F925}"},{"group":0,"hexcode":"1FAE8","label":"shaking face","order":52,"tags":["earthquake","face","shaking","shock","vibrate"],"unicode":"\u{1FAE8}"},{"group":0,"hexcode":"1F642-200D-2194-FE0F","label":"head shaking horizontally","order":53,"tags":["no","shake"],"unicode":"\u{1F642}\u200D\u2194\uFE0F"},{"group":0,"hexcode":"1F642-200D-2195-FE0F","label":"head shaking vertically","order":55,"tags":["nod","yes"],"unicode":"\u{1F642}\u200D\u2195\uFE0F"},{"group":0,"hexcode":"1F60C","label":"relieved face","order":57,"tags":["face","relieved"],"unicode":"\u{1F60C}"},{"group":0,"hexcode":"1F614","label":"pensive face","order":58,"tags":["dejected","face","pensive"],"unicode":"\u{1F614}"},{"group":0,"hexcode":"1F62A","label":"sleepy face","order":59,"tags":["face","good night","sleep"],"unicode":"\u{1F62A}"},{"group":0,"hexcode":"1F924","label":"drooling face","order":60,"tags":["drooling","face"],"unicode":"\u{1F924}"},{"group":0,"hexcode":"1F634","label":"sleeping face","order":61,"tags":["face","good night","sleep","zzz"],"unicode":"\u{1F634}"},{"group":0,"hexcode":"1F637","label":"face with medical mask","order":62,"tags":["cold","doctor","face","mask","sick"],"unicode":"\u{1F637}"},{"group":0,"hexcode":"1F912","label":"face with thermometer","order":63,"tags":["face","ill","sick","thermometer"],"unicode":"\u{1F912}"},{"group":0,"hexcode":"1F915","label":"face with head-bandage","order":64,"tags":["bandage","face","hurt","injury"],"unicode":"\u{1F915}"},{"group":0,"hexcode":"1F922","label":"nauseated face","order":65,"tags":["face","nauseated","vomit"],"unicode":"\u{1F922}","emoticon":"%("},{"group":0,"hexcode":"1F92E","label":"face vomiting","order":66,"tags":["puke","sick","vomit"],"unicode":"\u{1F92E}"},{"group":0,"hexcode":"1F927","label":"sneezing face","order":67,"tags":["face","gesundheit","sneeze"],"unicode":"\u{1F927}"},{"group":0,"hexcode":"1F975","label":"hot face","order":68,"tags":["feverish","heat stroke","hot","red-faced","sweating"],"unicode":"\u{1F975}"},{"group":0,"hexcode":"1F976","label":"cold face","order":69,"tags":["blue-faced","cold","freezing","frostbite","icicles"],"unicode":"\u{1F976}"},{"group":0,"hexcode":"1F974","label":"woozy face","order":70,"tags":["dizzy","intoxicated","tipsy","uneven eyes","wavy mouth"],"unicode":"\u{1F974}","emoticon":":&"},{"group":0,"hexcode":"1F635","label":"face with crossed-out eyes","order":71,"tags":["crossed-out eyes","dead","face","knocked out"],"unicode":"\u{1F635}","emoticon":["xo","XO"]},{"group":0,"hexcode":"1F635-200D-1F4AB","label":"face with spiral eyes","order":72,"tags":["dizzy","hypnotized","spiral","trouble","whoa"],"unicode":"\u{1F635}\u200D\u{1F4AB}"},{"group":0,"hexcode":"1F92F","label":"exploding head","order":73,"tags":["mind blown","shocked"],"unicode":"\u{1F92F}"},{"group":0,"hexcode":"1F920","label":"cowboy hat face","order":74,"tags":["cowboy","cowgirl","face","hat"],"unicode":"\u{1F920}"},{"group":0,"hexcode":"1F973","label":"partying face","order":75,"tags":["celebration","hat","horn","party"],"unicode":"\u{1F973}"},{"group":0,"hexcode":"1F978","label":"disguised face","order":76,"tags":["disguise","face","glasses","incognito","nose"],"unicode":"\u{1F978}"},{"group":0,"hexcode":"1F60E","label":"smiling face with sunglasses","order":77,"tags":["bright","cool","face","sun","sunglasses"],"unicode":"\u{1F60E}","emoticon":"8)"},{"group":0,"hexcode":"1F913","label":"nerd face","order":78,"tags":["face","geek","nerd"],"unicode":"\u{1F913}","emoticon":":B"},{"group":0,"hexcode":"1F9D0","label":"face with monocle","order":79,"tags":["face","monocle","stuffy"],"unicode":"\u{1F9D0}"},{"group":0,"hexcode":"1F615","label":"confused face","order":80,"tags":["confused","face","meh"],"unicode":"\u{1F615}","emoticon":":/"},{"group":0,"hexcode":"1FAE4","label":"face with diagonal mouth","order":81,"tags":["disappointed","meh","skeptical","unsure"],"unicode":"\u{1FAE4}"},{"group":0,"hexcode":"1F61F","label":"worried face","order":82,"tags":["face","worried"],"unicode":"\u{1F61F}"},{"group":0,"hexcode":"1F641","label":"slightly frowning face","order":83,"tags":["face","frown"],"unicode":"\u{1F641}"},{"group":0,"hexcode":"2639","label":"frowning face","order":85,"tags":["face","frown"],"unicode":"\u2639\uFE0F","emoticon":":("},{"group":0,"hexcode":"1F62E","label":"face with open mouth","order":86,"tags":["face","mouth","open","sympathy"],"unicode":"\u{1F62E}"},{"group":0,"hexcode":"1F62F","label":"hushed face","order":87,"tags":["face","hushed","stunned","surprised"],"unicode":"\u{1F62F}"},{"group":0,"hexcode":"1F632","label":"astonished face","order":88,"tags":["astonished","face","shocked","totally"],"unicode":"\u{1F632}","emoticon":[":o",":O"]},{"group":0,"hexcode":"1F633","label":"flushed face","order":89,"tags":["dazed","face","flushed"],"unicode":"\u{1F633}","emoticon":":$"},{"group":0,"hexcode":"1F97A","label":"pleading face","order":90,"tags":["begging","mercy","puppy eyes"],"unicode":"\u{1F97A}"},{"group":0,"hexcode":"1F979","label":"face holding back tears","order":91,"tags":["angry","cry","proud","resist","sad"],"unicode":"\u{1F979}"},{"group":0,"hexcode":"1F626","label":"frowning face with open mouth","order":92,"tags":["face","frown","mouth","open"],"unicode":"\u{1F626}"},{"group":0,"hexcode":"1F627","label":"anguished face","order":93,"tags":["anguished","face"],"unicode":"\u{1F627}","emoticon":[":s",":S"]},{"group":0,"hexcode":"1F628","label":"fearful face","order":94,"tags":["face","fear","fearful","scared"],"unicode":"\u{1F628}"},{"group":0,"hexcode":"1F630","label":"anxious face with sweat","order":95,"tags":["blue","cold","face","rushed","sweat"],"unicode":"\u{1F630}"},{"group":0,"hexcode":"1F625","label":"sad but relieved face","order":96,"tags":["disappointed","face","relieved","whew"],"unicode":"\u{1F625}"},{"group":0,"hexcode":"1F622","label":"crying face","order":97,"tags":["cry","face","sad","tear"],"unicode":"\u{1F622}","emoticon":":'("},{"group":0,"hexcode":"1F62D","label":"loudly crying face","order":98,"tags":["cry","face","sad","sob","tear"],"unicode":"\u{1F62D}","emoticon":":'o"},{"group":0,"hexcode":"1F631","label":"face screaming in fear","order":99,"tags":["face","fear","munch","scared","scream"],"unicode":"\u{1F631}","emoticon":"Dx"},{"group":0,"hexcode":"1F616","label":"confounded face","order":100,"tags":["confounded","face"],"unicode":"\u{1F616}","emoticon":["x(","X("]},{"group":0,"hexcode":"1F623","label":"persevering face","order":101,"tags":["face","persevere"],"unicode":"\u{1F623}"},{"group":0,"hexcode":"1F61E","label":"disappointed face","order":102,"tags":["disappointed","face"],"unicode":"\u{1F61E}"},{"group":0,"hexcode":"1F613","label":"downcast face with sweat","order":103,"tags":["cold","face","sweat"],"unicode":"\u{1F613}","emoticon":":<"},{"group":0,"hexcode":"1F629","label":"weary face","order":104,"tags":["face","tired","weary"],"unicode":"\u{1F629}","emoticon":"D:"},{"group":0,"hexcode":"1F62B","label":"tired face","order":105,"tags":["face","tired"],"unicode":"\u{1F62B}","emoticon":[":c",":C"]},{"group":0,"hexcode":"1F971","label":"yawning face","order":106,"tags":["bored","tired","yawn"],"unicode":"\u{1F971}"},{"group":0,"hexcode":"1F624","label":"face with steam from nose","order":107,"tags":["face","triumph","won"],"unicode":"\u{1F624}"},{"group":0,"hexcode":"1F621","label":"enraged face","order":108,"tags":["angry","enraged","face","mad","pouting","rage","red"],"unicode":"\u{1F621}","emoticon":">:/"},{"group":0,"hexcode":"1F620","label":"angry face","order":109,"tags":["anger","angry","face","mad"],"unicode":"\u{1F620}"},{"group":0,"hexcode":"1F92C","label":"face with symbols on mouth","order":110,"tags":["swearing"],"unicode":"\u{1F92C}","emoticon":":@"},{"group":0,"hexcode":"1F608","label":"smiling face with horns","order":111,"tags":["face","fairy tale","fantasy","horns","smile"],"unicode":"\u{1F608}","emoticon":">:)"},{"group":0,"hexcode":"1F47F","label":"angry face with horns","order":112,"tags":["demon","devil","face","fantasy","imp"],"unicode":"\u{1F47F}","emoticon":">:("},{"group":0,"hexcode":"1F480","label":"skull","order":113,"tags":["death","face","fairy tale","monster"],"unicode":"\u{1F480}"},{"group":0,"hexcode":"2620","label":"skull and crossbones","order":115,"tags":["crossbones","death","face","monster","skull"],"unicode":"\u2620\uFE0F"},{"group":0,"hexcode":"1F4A9","label":"pile of poo","order":116,"tags":["dung","face","monster","poo","poop"],"unicode":"\u{1F4A9}"},{"group":0,"hexcode":"1F921","label":"clown face","order":117,"tags":["clown","face"],"unicode":"\u{1F921}"},{"group":0,"hexcode":"1F479","label":"ogre","order":118,"tags":["creature","face","fairy tale","fantasy","monster"],"unicode":"\u{1F479}","emoticon":">0)"},{"group":0,"hexcode":"1F47A","label":"goblin","order":119,"tags":["creature","face","fairy tale","fantasy","monster"],"unicode":"\u{1F47A}"},{"group":0,"hexcode":"1F47B","label":"ghost","order":120,"tags":["creature","face","fairy tale","fantasy","monster"],"unicode":"\u{1F47B}"},{"group":0,"hexcode":"1F47D","label":"alien","order":121,"tags":["creature","extraterrestrial","face","fantasy","ufo"],"unicode":"\u{1F47D}\uFE0F"},{"group":0,"hexcode":"1F47E","label":"alien monster","order":122,"tags":["alien","creature","extraterrestrial","face","monster","ufo"],"unicode":"\u{1F47E}"},{"group":0,"hexcode":"1F916","label":"robot","order":123,"tags":["face","monster"],"unicode":"\u{1F916}"},{"group":0,"hexcode":"1F63A","label":"grinning cat","order":124,"tags":["cat","face","grinning","mouth","open","smile"],"unicode":"\u{1F63A}"},{"group":0,"hexcode":"1F638","label":"grinning cat with smiling eyes","order":125,"tags":["cat","eye","face","grin","smile"],"unicode":"\u{1F638}"},{"group":0,"hexcode":"1F639","label":"cat with tears of joy","order":126,"tags":["cat","face","joy","tear"],"unicode":"\u{1F639}"},{"group":0,"hexcode":"1F63B","label":"smiling cat with heart-eyes","order":127,"tags":["cat","eye","face","heart","love","smile"],"unicode":"\u{1F63B}"},{"group":0,"hexcode":"1F63C","label":"cat with wry smile","order":128,"tags":["cat","face","ironic","smile","wry"],"unicode":"\u{1F63C}"},{"group":0,"hexcode":"1F63D","label":"kissing cat","order":129,"tags":["cat","eye","face","kiss"],"unicode":"\u{1F63D}","emoticon":":3"},{"group":0,"hexcode":"1F640","label":"weary cat","order":130,"tags":["cat","face","oh","surprised","weary"],"unicode":"\u{1F640}"},{"group":0,"hexcode":"1F63F","label":"crying cat","order":131,"tags":["cat","cry","face","sad","tear"],"unicode":"\u{1F63F}"},{"group":0,"hexcode":"1F63E","label":"pouting cat","order":132,"tags":["cat","face","pouting"],"unicode":"\u{1F63E}"},{"group":0,"hexcode":"1F648","label":"see-no-evil monkey","order":133,"tags":["evil","face","forbidden","monkey","see"],"unicode":"\u{1F648}"},{"group":0,"hexcode":"1F649","label":"hear-no-evil monkey","order":134,"tags":["evil","face","forbidden","hear","monkey"],"unicode":"\u{1F649}"},{"group":0,"hexcode":"1F64A","label":"speak-no-evil monkey","order":135,"tags":["evil","face","forbidden","monkey","speak"],"unicode":"\u{1F64A}"},{"group":0,"hexcode":"1F48C","label":"love letter","order":136,"tags":["heart","letter","love","mail"],"unicode":"\u{1F48C}"},{"group":0,"hexcode":"1F498","label":"heart with arrow","order":137,"tags":["arrow","cupid"],"unicode":"\u{1F498}"},{"group":0,"hexcode":"1F49D","label":"heart with ribbon","order":138,"tags":["ribbon","valentine"],"unicode":"\u{1F49D}"},{"group":0,"hexcode":"1F496","label":"sparkling heart","order":139,"tags":["excited","sparkle"],"unicode":"\u{1F496}"},{"group":0,"hexcode":"1F497","label":"growing heart","order":140,"tags":["excited","growing","nervous","pulse"],"unicode":"\u{1F497}"},{"group":0,"hexcode":"1F493","label":"beating heart","order":141,"tags":["beating","heartbeat","pulsating"],"unicode":"\u{1F493}"},{"group":0,"hexcode":"1F49E","label":"revolving hearts","order":142,"tags":["revolving"],"unicode":"\u{1F49E}"},{"group":0,"hexcode":"1F495","label":"two hearts","order":143,"tags":["love"],"unicode":"\u{1F495}"},{"group":0,"hexcode":"1F49F","label":"heart decoration","order":144,"tags":["heart"],"unicode":"\u{1F49F}"},{"group":0,"hexcode":"2763","label":"heart exclamation","order":146,"tags":["exclamation","mark","punctuation"],"unicode":"\u2763\uFE0F"},{"group":0,"hexcode":"1F494","label":"broken heart","order":147,"tags":["break","broken"],"unicode":"\u{1F494}","emoticon":"</3"},{"group":0,"hexcode":"2764-FE0F-200D-1F525","label":"heart on fire","order":148,"tags":["burn","heart","love","lust","sacred heart"],"unicode":"\u2764\uFE0F\u200D\u{1F525}"},{"group":0,"hexcode":"2764-FE0F-200D-1FA79","label":"mending heart","order":150,"tags":["healthier","improving","mending","recovering","recuperating","well"],"unicode":"\u2764\uFE0F\u200D\u{1FA79}"},{"group":0,"hexcode":"2764","label":"red heart","order":153,"tags":["heart"],"unicode":"\u2764\uFE0F","emoticon":"<3"},{"group":0,"hexcode":"1FA77","label":"pink heart","order":154,"tags":["cute","heart","like","love","pink"],"unicode":"\u{1FA77}"},{"group":0,"hexcode":"1F9E1","label":"orange heart","order":155,"tags":["orange"],"unicode":"\u{1F9E1}"},{"group":0,"hexcode":"1F49B","label":"yellow heart","order":156,"tags":["yellow"],"unicode":"\u{1F49B}"},{"group":0,"hexcode":"1F49A","label":"green heart","order":157,"tags":["green"],"unicode":"\u{1F49A}"},{"group":0,"hexcode":"1F499","label":"blue heart","order":158,"tags":["blue"],"unicode":"\u{1F499}"},{"group":0,"hexcode":"1FA75","label":"light blue heart","order":159,"tags":["cyan","heart","light blue","teal"],"unicode":"\u{1FA75}"},{"group":0,"hexcode":"1F49C","label":"purple heart","order":160,"tags":["purple"],"unicode":"\u{1F49C}"},{"group":0,"hexcode":"1F90E","label":"brown heart","order":161,"tags":["brown","heart"],"unicode":"\u{1F90E}"},{"group":0,"hexcode":"1F5A4","label":"black heart","order":162,"tags":["black","evil","wicked"],"unicode":"\u{1F5A4}"},{"group":0,"hexcode":"1FA76","label":"grey heart","order":163,"tags":["gray","heart","silver","slate"],"unicode":"\u{1FA76}"},{"group":0,"hexcode":"1F90D","label":"white heart","order":164,"tags":["heart","white"],"unicode":"\u{1F90D}"},{"group":0,"hexcode":"1F48B","label":"kiss mark","order":165,"tags":["kiss","lips"],"unicode":"\u{1F48B}"},{"group":0,"hexcode":"1F4AF","label":"hundred points","order":166,"tags":["100","full","hundred","score"],"unicode":"\u{1F4AF}"},{"group":0,"hexcode":"1F4A2","label":"anger symbol","order":167,"tags":["angry","comic","mad"],"unicode":"\u{1F4A2}"},{"group":0,"hexcode":"1F4A5","label":"collision","order":168,"tags":["boom","comic"],"unicode":"\u{1F4A5}"},{"group":0,"hexcode":"1F4AB","label":"dizzy","order":169,"tags":["comic","star"],"unicode":"\u{1F4AB}"},{"group":0,"hexcode":"1F4A6","label":"sweat droplets","order":170,"tags":["comic","splashing","sweat"],"unicode":"\u{1F4A6}"},{"group":0,"hexcode":"1F4A8","label":"dashing away","order":171,"tags":["comic","dash","running"],"unicode":"\u{1F4A8}"},{"group":0,"hexcode":"1F573","label":"hole","order":173,"tags":["hole"],"unicode":"\u{1F573}\uFE0F"},{"group":0,"hexcode":"1F4AC","label":"speech balloon","order":174,"tags":["balloon","bubble","comic","dialog","speech"],"unicode":"\u{1F4AC}"},{"group":0,"hexcode":"1F441-FE0F-200D-1F5E8-FE0F","label":"eye in speech bubble","order":175,"tags":["balloon","bubble","eye","speech","witness"],"unicode":"\u{1F441}\uFE0F\u200D\u{1F5E8}\uFE0F"},{"group":0,"hexcode":"1F5E8","label":"left speech bubble","order":180,"tags":["balloon","bubble","dialog","speech"],"unicode":"\u{1F5E8}\uFE0F"},{"group":0,"hexcode":"1F5EF","label":"right anger bubble","order":182,"tags":["angry","balloon","bubble","mad"],"unicode":"\u{1F5EF}\uFE0F"},{"group":0,"hexcode":"1F4AD","label":"thought balloon","order":183,"tags":["balloon","bubble","comic","thought"],"unicode":"\u{1F4AD}"},{"group":0,"hexcode":"1F4A4","label":"ZZZ","order":184,"tags":["comic","good night","sleep","zzz"],"unicode":"\u{1F4A4}"},{"group":1,"hexcode":"1F44B","label":"waving hand","order":185,"tags":["hand","wave","waving"],"unicode":"\u{1F44B}","skins":[{"group":1,"hexcode":"1F44B-1F3FB","label":"waving hand: light skin tone","order":186,"unicode":"\u{1F44B}\u{1F3FB}"},{"group":1,"hexcode":"1F44B-1F3FC","label":"waving hand: medium-light skin tone","order":187,"unicode":"\u{1F44B}\u{1F3FC}"},{"group":1,"hexcode":"1F44B-1F3FD","label":"waving hand: medium skin tone","order":188,"unicode":"\u{1F44B}\u{1F3FD}"},{"group":1,"hexcode":"1F44B-1F3FE","label":"waving hand: medium-dark skin tone","order":189,"unicode":"\u{1F44B}\u{1F3FE}"},{"group":1,"hexcode":"1F44B-1F3FF","label":"waving hand: dark skin tone","order":190,"unicode":"\u{1F44B}\u{1F3FF}"}]},{"group":1,"hexcode":"1F91A","label":"raised back of hand","order":191,"tags":["backhand","raised"],"unicode":"\u{1F91A}","skins":[{"group":1,"hexcode":"1F91A-1F3FB","label":"raised back of hand: light skin tone","order":192,"unicode":"\u{1F91A}\u{1F3FB}"},{"group":1,"hexcode":"1F91A-1F3FC","label":"raised back of hand: medium-light skin tone","order":193,"unicode":"\u{1F91A}\u{1F3FC}"},{"group":1,"hexcode":"1F91A-1F3FD","label":"raised back of hand: medium skin tone","order":194,"unicode":"\u{1F91A}\u{1F3FD}"},{"group":1,"hexcode":"1F91A-1F3FE","label":"raised back of hand: medium-dark skin tone","order":195,"unicode":"\u{1F91A}\u{1F3FE}"},{"group":1,"hexcode":"1F91A-1F3FF","label":"raised back of hand: dark skin tone","order":196,"unicode":"\u{1F91A}\u{1F3FF}"}]},{"group":1,"hexcode":"1F590","label":"hand with fingers splayed","order":198,"tags":["finger","hand","splayed"],"unicode":"\u{1F590}\uFE0F","skins":[{"group":1,"hexcode":"1F590-1F3FB","label":"hand with fingers splayed: light skin tone","order":199,"unicode":"\u{1F590}\u{1F3FB}"},{"group":1,"hexcode":"1F590-1F3FC","label":"hand with fingers splayed: medium-light skin tone","order":200,"unicode":"\u{1F590}\u{1F3FC}"},{"group":1,"hexcode":"1F590-1F3FD","label":"hand with fingers splayed: medium skin tone","order":201,"unicode":"\u{1F590}\u{1F3FD}"},{"group":1,"hexcode":"1F590-1F3FE","label":"hand with fingers splayed: medium-dark skin tone","order":202,"unicode":"\u{1F590}\u{1F3FE}"},{"group":1,"hexcode":"1F590-1F3FF","label":"hand with fingers splayed: dark skin tone","order":203,"unicode":"\u{1F590}\u{1F3FF}"}]},{"group":1,"hexcode":"270B","label":"raised hand","order":204,"tags":["hand","high 5","high five"],"unicode":"\u270B\uFE0F","skins":[{"group":1,"hexcode":"270B-1F3FB","label":"raised hand: light skin tone","order":205,"unicode":"\u270B\u{1F3FB}"},{"group":1,"hexcode":"270B-1F3FC","label":"raised hand: medium-light skin tone","order":206,"unicode":"\u270B\u{1F3FC}"},{"group":1,"hexcode":"270B-1F3FD","label":"raised hand: medium skin tone","order":207,"unicode":"\u270B\u{1F3FD}"},{"group":1,"hexcode":"270B-1F3FE","label":"raised hand: medium-dark skin tone","order":208,"unicode":"\u270B\u{1F3FE}"},{"group":1,"hexcode":"270B-1F3FF","label":"raised hand: dark skin tone","order":209,"unicode":"\u270B\u{1F3FF}"}]},{"group":1,"hexcode":"1F596","label":"vulcan salute","order":210,"tags":["finger","hand","spock","vulcan"],"unicode":"\u{1F596}","skins":[{"group":1,"hexcode":"1F596-1F3FB","label":"vulcan salute: light skin tone","order":211,"unicode":"\u{1F596}\u{1F3FB}"},{"group":1,"hexcode":"1F596-1F3FC","label":"vulcan salute: medium-light skin tone","order":212,"unicode":"\u{1F596}\u{1F3FC}"},{"group":1,"hexcode":"1F596-1F3FD","label":"vulcan salute: medium skin tone","order":213,"unicode":"\u{1F596}\u{1F3FD}"},{"group":1,"hexcode":"1F596-1F3FE","label":"vulcan salute: medium-dark skin tone","order":214,"unicode":"\u{1F596}\u{1F3FE}"},{"group":1,"hexcode":"1F596-1F3FF","label":"vulcan salute: dark skin tone","order":215,"unicode":"\u{1F596}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF1","label":"rightwards hand","order":216,"tags":["hand","right","rightward"],"unicode":"\u{1FAF1}","skins":[{"group":1,"hexcode":"1FAF1-1F3FB","label":"rightwards hand: light skin tone","order":217,"unicode":"\u{1FAF1}\u{1F3FB}"},{"group":1,"hexcode":"1FAF1-1F3FC","label":"rightwards hand: medium-light skin tone","order":218,"unicode":"\u{1FAF1}\u{1F3FC}"},{"group":1,"hexcode":"1FAF1-1F3FD","label":"rightwards hand: medium skin tone","order":219,"unicode":"\u{1FAF1}\u{1F3FD}"},{"group":1,"hexcode":"1FAF1-1F3FE","label":"rightwards hand: medium-dark skin tone","order":220,"unicode":"\u{1FAF1}\u{1F3FE}"},{"group":1,"hexcode":"1FAF1-1F3FF","label":"rightwards hand: dark skin tone","order":221,"unicode":"\u{1FAF1}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF2","label":"leftwards hand","order":222,"tags":["hand","left","leftward"],"unicode":"\u{1FAF2}","skins":[{"group":1,"hexcode":"1FAF2-1F3FB","label":"leftwards hand: light skin tone","order":223,"unicode":"\u{1FAF2}\u{1F3FB}"},{"group":1,"hexcode":"1FAF2-1F3FC","label":"leftwards hand: medium-light skin tone","order":224,"unicode":"\u{1FAF2}\u{1F3FC}"},{"group":1,"hexcode":"1FAF2-1F3FD","label":"leftwards hand: medium skin tone","order":225,"unicode":"\u{1FAF2}\u{1F3FD}"},{"group":1,"hexcode":"1FAF2-1F3FE","label":"leftwards hand: medium-dark skin tone","order":226,"unicode":"\u{1FAF2}\u{1F3FE}"},{"group":1,"hexcode":"1FAF2-1F3FF","label":"leftwards hand: dark skin tone","order":227,"unicode":"\u{1FAF2}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF3","label":"palm down hand","order":228,"tags":["dismiss","drop","shoo"],"unicode":"\u{1FAF3}","skins":[{"group":1,"hexcode":"1FAF3-1F3FB","label":"palm down hand: light skin tone","order":229,"unicode":"\u{1FAF3}\u{1F3FB}"},{"group":1,"hexcode":"1FAF3-1F3FC","label":"palm down hand: medium-light skin tone","order":230,"unicode":"\u{1FAF3}\u{1F3FC}"},{"group":1,"hexcode":"1FAF3-1F3FD","label":"palm down hand: medium skin tone","order":231,"unicode":"\u{1FAF3}\u{1F3FD}"},{"group":1,"hexcode":"1FAF3-1F3FE","label":"palm down hand: medium-dark skin tone","order":232,"unicode":"\u{1FAF3}\u{1F3FE}"},{"group":1,"hexcode":"1FAF3-1F3FF","label":"palm down hand: dark skin tone","order":233,"unicode":"\u{1FAF3}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF4","label":"palm up hand","order":234,"tags":["beckon","catch","come","offer"],"unicode":"\u{1FAF4}","skins":[{"group":1,"hexcode":"1FAF4-1F3FB","label":"palm up hand: light skin tone","order":235,"unicode":"\u{1FAF4}\u{1F3FB}"},{"group":1,"hexcode":"1FAF4-1F3FC","label":"palm up hand: medium-light skin tone","order":236,"unicode":"\u{1FAF4}\u{1F3FC}"},{"group":1,"hexcode":"1FAF4-1F3FD","label":"palm up hand: medium skin tone","order":237,"unicode":"\u{1FAF4}\u{1F3FD}"},{"group":1,"hexcode":"1FAF4-1F3FE","label":"palm up hand: medium-dark skin tone","order":238,"unicode":"\u{1FAF4}\u{1F3FE}"},{"group":1,"hexcode":"1FAF4-1F3FF","label":"palm up hand: dark skin tone","order":239,"unicode":"\u{1FAF4}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF7","label":"leftwards pushing hand","order":240,"tags":["high five","leftward","push","refuse","stop","wait"],"unicode":"\u{1FAF7}","skins":[{"group":1,"hexcode":"1FAF7-1F3FB","label":"leftwards pushing hand: light skin tone","order":241,"unicode":"\u{1FAF7}\u{1F3FB}"},{"group":1,"hexcode":"1FAF7-1F3FC","label":"leftwards pushing hand: medium-light skin tone","order":242,"unicode":"\u{1FAF7}\u{1F3FC}"},{"group":1,"hexcode":"1FAF7-1F3FD","label":"leftwards pushing hand: medium skin tone","order":243,"unicode":"\u{1FAF7}\u{1F3FD}"},{"group":1,"hexcode":"1FAF7-1F3FE","label":"leftwards pushing hand: medium-dark skin tone","order":244,"unicode":"\u{1FAF7}\u{1F3FE}"},{"group":1,"hexcode":"1FAF7-1F3FF","label":"leftwards pushing hand: dark skin tone","order":245,"unicode":"\u{1FAF7}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF8","label":"rightwards pushing hand","order":246,"tags":["high five","push","refuse","rightward","stop","wait"],"unicode":"\u{1FAF8}","skins":[{"group":1,"hexcode":"1FAF8-1F3FB","label":"rightwards pushing hand: light skin tone","order":247,"unicode":"\u{1FAF8}\u{1F3FB}"},{"group":1,"hexcode":"1FAF8-1F3FC","label":"rightwards pushing hand: medium-light skin tone","order":248,"unicode":"\u{1FAF8}\u{1F3FC}"},{"group":1,"hexcode":"1FAF8-1F3FD","label":"rightwards pushing hand: medium skin tone","order":249,"unicode":"\u{1FAF8}\u{1F3FD}"},{"group":1,"hexcode":"1FAF8-1F3FE","label":"rightwards pushing hand: medium-dark skin tone","order":250,"unicode":"\u{1FAF8}\u{1F3FE}"},{"group":1,"hexcode":"1FAF8-1F3FF","label":"rightwards pushing hand: dark skin tone","order":251,"unicode":"\u{1FAF8}\u{1F3FF}"}]},{"group":1,"hexcode":"1F44C","label":"OK hand","order":252,"tags":["hand","ok"],"unicode":"\u{1F44C}","skins":[{"group":1,"hexcode":"1F44C-1F3FB","label":"OK hand: light skin tone","order":253,"unicode":"\u{1F44C}\u{1F3FB}"},{"group":1,"hexcode":"1F44C-1F3FC","label":"OK hand: medium-light skin tone","order":254,"unicode":"\u{1F44C}\u{1F3FC}"},{"group":1,"hexcode":"1F44C-1F3FD","label":"OK hand: medium skin tone","order":255,"unicode":"\u{1F44C}\u{1F3FD}"},{"group":1,"hexcode":"1F44C-1F3FE","label":"OK hand: medium-dark skin tone","order":256,"unicode":"\u{1F44C}\u{1F3FE}"},{"group":1,"hexcode":"1F44C-1F3FF","label":"OK hand: dark skin tone","order":257,"unicode":"\u{1F44C}\u{1F3FF}"}]},{"group":1,"hexcode":"1F90C","label":"pinched fingers","order":258,"tags":["fingers","hand gesture","interrogation","pinched","sarcastic"],"unicode":"\u{1F90C}","skins":[{"group":1,"hexcode":"1F90C-1F3FB","label":"pinched fingers: light skin tone","order":259,"unicode":"\u{1F90C}\u{1F3FB}"},{"group":1,"hexcode":"1F90C-1F3FC","label":"pinched fingers: medium-light skin tone","order":260,"unicode":"\u{1F90C}\u{1F3FC}"},{"group":1,"hexcode":"1F90C-1F3FD","label":"pinched fingers: medium skin tone","order":261,"unicode":"\u{1F90C}\u{1F3FD}"},{"group":1,"hexcode":"1F90C-1F3FE","label":"pinched fingers: medium-dark skin tone","order":262,"unicode":"\u{1F90C}\u{1F3FE}"},{"group":1,"hexcode":"1F90C-1F3FF","label":"pinched fingers: dark skin tone","order":263,"unicode":"\u{1F90C}\u{1F3FF}"}]},{"group":1,"hexcode":"1F90F","label":"pinching hand","order":264,"tags":["small amount"],"unicode":"\u{1F90F}","skins":[{"group":1,"hexcode":"1F90F-1F3FB","label":"pinching hand: light skin tone","order":265,"unicode":"\u{1F90F}\u{1F3FB}"},{"group":1,"hexcode":"1F90F-1F3FC","label":"pinching hand: medium-light skin tone","order":266,"unicode":"\u{1F90F}\u{1F3FC}"},{"group":1,"hexcode":"1F90F-1F3FD","label":"pinching hand: medium skin tone","order":267,"unicode":"\u{1F90F}\u{1F3FD}"},{"group":1,"hexcode":"1F90F-1F3FE","label":"pinching hand: medium-dark skin tone","order":268,"unicode":"\u{1F90F}\u{1F3FE}"},{"group":1,"hexcode":"1F90F-1F3FF","label":"pinching hand: dark skin tone","order":269,"unicode":"\u{1F90F}\u{1F3FF}"}]},{"group":1,"hexcode":"270C","label":"victory hand","order":271,"tags":["hand","v","victory"],"unicode":"\u270C\uFE0F","skins":[{"group":1,"hexcode":"270C-1F3FB","label":"victory hand: light skin tone","order":272,"unicode":"\u270C\u{1F3FB}"},{"group":1,"hexcode":"270C-1F3FC","label":"victory hand: medium-light skin tone","order":273,"unicode":"\u270C\u{1F3FC}"},{"group":1,"hexcode":"270C-1F3FD","label":"victory hand: medium skin tone","order":274,"unicode":"\u270C\u{1F3FD}"},{"group":1,"hexcode":"270C-1F3FE","label":"victory hand: medium-dark skin tone","order":275,"unicode":"\u270C\u{1F3FE}"},{"group":1,"hexcode":"270C-1F3FF","label":"victory hand: dark skin tone","order":276,"unicode":"\u270C\u{1F3FF}"}]},{"group":1,"hexcode":"1F91E","label":"crossed fingers","order":277,"tags":["cross","finger","hand","luck"],"unicode":"\u{1F91E}","skins":[{"group":1,"hexcode":"1F91E-1F3FB","label":"crossed fingers: light skin tone","order":278,"unicode":"\u{1F91E}\u{1F3FB}"},{"group":1,"hexcode":"1F91E-1F3FC","label":"crossed fingers: medium-light skin tone","order":279,"unicode":"\u{1F91E}\u{1F3FC}"},{"group":1,"hexcode":"1F91E-1F3FD","label":"crossed fingers: medium skin tone","order":280,"unicode":"\u{1F91E}\u{1F3FD}"},{"group":1,"hexcode":"1F91E-1F3FE","label":"crossed fingers: medium-dark skin tone","order":281,"unicode":"\u{1F91E}\u{1F3FE}"},{"group":1,"hexcode":"1F91E-1F3FF","label":"crossed fingers: dark skin tone","order":282,"unicode":"\u{1F91E}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF0","label":"hand with index finger and thumb crossed","order":283,"tags":["expensive","heart","love","money","snap"],"unicode":"\u{1FAF0}","skins":[{"group":1,"hexcode":"1FAF0-1F3FB","label":"hand with index finger and thumb crossed: light skin tone","order":284,"unicode":"\u{1FAF0}\u{1F3FB}"},{"group":1,"hexcode":"1FAF0-1F3FC","label":"hand with index finger and thumb crossed: medium-light skin tone","order":285,"unicode":"\u{1FAF0}\u{1F3FC}"},{"group":1,"hexcode":"1FAF0-1F3FD","label":"hand with index finger and thumb crossed: medium skin tone","order":286,"unicode":"\u{1FAF0}\u{1F3FD}"},{"group":1,"hexcode":"1FAF0-1F3FE","label":"hand with index finger and thumb crossed: medium-dark skin tone","order":287,"unicode":"\u{1FAF0}\u{1F3FE}"},{"group":1,"hexcode":"1FAF0-1F3FF","label":"hand with index finger and thumb crossed: dark skin tone","order":288,"unicode":"\u{1FAF0}\u{1F3FF}"}]},{"group":1,"hexcode":"1F91F","label":"love-you gesture","order":289,"tags":["hand","ily"],"unicode":"\u{1F91F}","skins":[{"group":1,"hexcode":"1F91F-1F3FB","label":"love-you gesture: light skin tone","order":290,"unicode":"\u{1F91F}\u{1F3FB}"},{"group":1,"hexcode":"1F91F-1F3FC","label":"love-you gesture: medium-light skin tone","order":291,"unicode":"\u{1F91F}\u{1F3FC}"},{"group":1,"hexcode":"1F91F-1F3FD","label":"love-you gesture: medium skin tone","order":292,"unicode":"\u{1F91F}\u{1F3FD}"},{"group":1,"hexcode":"1F91F-1F3FE","label":"love-you gesture: medium-dark skin tone","order":293,"unicode":"\u{1F91F}\u{1F3FE}"},{"group":1,"hexcode":"1F91F-1F3FF","label":"love-you gesture: dark skin tone","order":294,"unicode":"\u{1F91F}\u{1F3FF}"}]},{"group":1,"hexcode":"1F918","label":"sign of the horns","order":295,"tags":["finger","hand","horns","rock-on"],"unicode":"\u{1F918}","emoticon":["\\\\m/","\\\\M/"],"skins":[{"group":1,"hexcode":"1F918-1F3FB","label":"sign of the horns: light skin tone","order":296,"unicode":"\u{1F918}\u{1F3FB}"},{"group":1,"hexcode":"1F918-1F3FC","label":"sign of the horns: medium-light skin tone","order":297,"unicode":"\u{1F918}\u{1F3FC}"},{"group":1,"hexcode":"1F918-1F3FD","label":"sign of the horns: medium skin tone","order":298,"unicode":"\u{1F918}\u{1F3FD}"},{"group":1,"hexcode":"1F918-1F3FE","label":"sign of the horns: medium-dark skin tone","order":299,"unicode":"\u{1F918}\u{1F3FE}"},{"group":1,"hexcode":"1F918-1F3FF","label":"sign of the horns: dark skin tone","order":300,"unicode":"\u{1F918}\u{1F3FF}"}]},{"group":1,"hexcode":"1F919","label":"call me hand","order":301,"tags":["call","hand","hang loose","shaka"],"unicode":"\u{1F919}","skins":[{"group":1,"hexcode":"1F919-1F3FB","label":"call me hand: light skin tone","order":302,"unicode":"\u{1F919}\u{1F3FB}"},{"group":1,"hexcode":"1F919-1F3FC","label":"call me hand: medium-light skin tone","order":303,"unicode":"\u{1F919}\u{1F3FC}"},{"group":1,"hexcode":"1F919-1F3FD","label":"call me hand: medium skin tone","order":304,"unicode":"\u{1F919}\u{1F3FD}"},{"group":1,"hexcode":"1F919-1F3FE","label":"call me hand: medium-dark skin tone","order":305,"unicode":"\u{1F919}\u{1F3FE}"},{"group":1,"hexcode":"1F919-1F3FF","label":"call me hand: dark skin tone","order":306,"unicode":"\u{1F919}\u{1F3FF}"}]},{"group":1,"hexcode":"1F448","label":"backhand index pointing left","order":307,"tags":["backhand","finger","hand","index","point"],"unicode":"\u{1F448}\uFE0F","skins":[{"group":1,"hexcode":"1F448-1F3FB","label":"backhand index pointing left: light skin tone","order":308,"unicode":"\u{1F448}\u{1F3FB}"},{"group":1,"hexcode":"1F448-1F3FC","label":"backhand index pointing left: medium-light skin tone","order":309,"unicode":"\u{1F448}\u{1F3FC}"},{"group":1,"hexcode":"1F448-1F3FD","label":"backhand index pointing left: medium skin tone","order":310,"unicode":"\u{1F448}\u{1F3FD}"},{"group":1,"hexcode":"1F448-1F3FE","label":"backhand index pointing left: medium-dark skin tone","order":311,"unicode":"\u{1F448}\u{1F3FE}"},{"group":1,"hexcode":"1F448-1F3FF","label":"backhand index pointing left: dark skin tone","order":312,"unicode":"\u{1F448}\u{1F3FF}"}]},{"group":1,"hexcode":"1F449","label":"backhand index pointing right","order":313,"tags":["backhand","finger","hand","index","point"],"unicode":"\u{1F449}\uFE0F","skins":[{"group":1,"hexcode":"1F449-1F3FB","label":"backhand index pointing right: light skin tone","order":314,"unicode":"\u{1F449}\u{1F3FB}"},{"group":1,"hexcode":"1F449-1F3FC","label":"backhand index pointing right: medium-light skin tone","order":315,"unicode":"\u{1F449}\u{1F3FC}"},{"group":1,"hexcode":"1F449-1F3FD","label":"backhand index pointing right: medium skin tone","order":316,"unicode":"\u{1F449}\u{1F3FD}"},{"group":1,"hexcode":"1F449-1F3FE","label":"backhand index pointing right: medium-dark skin tone","order":317,"unicode":"\u{1F449}\u{1F3FE}"},{"group":1,"hexcode":"1F449-1F3FF","label":"backhand index pointing right: dark skin tone","order":318,"unicode":"\u{1F449}\u{1F3FF}"}]},{"group":1,"hexcode":"1F446","label":"backhand index pointing up","order":319,"tags":["backhand","finger","hand","point","up"],"unicode":"\u{1F446}\uFE0F","skins":[{"group":1,"hexcode":"1F446-1F3FB","label":"backhand index pointing up: light skin tone","order":320,"unicode":"\u{1F446}\u{1F3FB}"},{"group":1,"hexcode":"1F446-1F3FC","label":"backhand index pointing up: medium-light skin tone","order":321,"unicode":"\u{1F446}\u{1F3FC}"},{"group":1,"hexcode":"1F446-1F3FD","label":"backhand index pointing up: medium skin tone","order":322,"unicode":"\u{1F446}\u{1F3FD}"},{"group":1,"hexcode":"1F446-1F3FE","label":"backhand index pointing up: medium-dark skin tone","order":323,"unicode":"\u{1F446}\u{1F3FE}"},{"group":1,"hexcode":"1F446-1F3FF","label":"backhand index pointing up: dark skin tone","order":324,"unicode":"\u{1F446}\u{1F3FF}"}]},{"group":1,"hexcode":"1F595","label":"middle finger","order":325,"tags":["finger","hand"],"unicode":"\u{1F595}","skins":[{"group":1,"hexcode":"1F595-1F3FB","label":"middle finger: light skin tone","order":326,"unicode":"\u{1F595}\u{1F3FB}"},{"group":1,"hexcode":"1F595-1F3FC","label":"middle finger: medium-light skin tone","order":327,"unicode":"\u{1F595}\u{1F3FC}"},{"group":1,"hexcode":"1F595-1F3FD","label":"middle finger: medium skin tone","order":328,"unicode":"\u{1F595}\u{1F3FD}"},{"group":1,"hexcode":"1F595-1F3FE","label":"middle finger: medium-dark skin tone","order":329,"unicode":"\u{1F595}\u{1F3FE}"},{"group":1,"hexcode":"1F595-1F3FF","label":"middle finger: dark skin tone","order":330,"unicode":"\u{1F595}\u{1F3FF}"}]},{"group":1,"hexcode":"1F447","label":"backhand index pointing down","order":331,"tags":["backhand","down","finger","hand","point"],"unicode":"\u{1F447}\uFE0F","skins":[{"group":1,"hexcode":"1F447-1F3FB","label":"backhand index pointing down: light skin tone","order":332,"unicode":"\u{1F447}\u{1F3FB}"},{"group":1,"hexcode":"1F447-1F3FC","label":"backhand index pointing down: medium-light skin tone","order":333,"unicode":"\u{1F447}\u{1F3FC}"},{"group":1,"hexcode":"1F447-1F3FD","label":"backhand index pointing down: medium skin tone","order":334,"unicode":"\u{1F447}\u{1F3FD}"},{"group":1,"hexcode":"1F447-1F3FE","label":"backhand index pointing down: medium-dark skin tone","order":335,"unicode":"\u{1F447}\u{1F3FE}"},{"group":1,"hexcode":"1F447-1F3FF","label":"backhand index pointing down: dark skin tone","order":336,"unicode":"\u{1F447}\u{1F3FF}"}]},{"group":1,"hexcode":"261D","label":"index pointing up","order":338,"tags":["finger","hand","index","point","up"],"unicode":"\u261D\uFE0F","skins":[{"group":1,"hexcode":"261D-1F3FB","label":"index pointing up: light skin tone","order":339,"unicode":"\u261D\u{1F3FB}"},{"group":1,"hexcode":"261D-1F3FC","label":"index pointing up: medium-light skin tone","order":340,"unicode":"\u261D\u{1F3FC}"},{"group":1,"hexcode":"261D-1F3FD","label":"index pointing up: medium skin tone","order":341,"unicode":"\u261D\u{1F3FD}"},{"group":1,"hexcode":"261D-1F3FE","label":"index pointing up: medium-dark skin tone","order":342,"unicode":"\u261D\u{1F3FE}"},{"group":1,"hexcode":"261D-1F3FF","label":"index pointing up: dark skin tone","order":343,"unicode":"\u261D\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF5","label":"index pointing at the viewer","order":344,"tags":["point","you"],"unicode":"\u{1FAF5}","skins":[{"group":1,"hexcode":"1FAF5-1F3FB","label":"index pointing at the viewer: light skin tone","order":345,"unicode":"\u{1FAF5}\u{1F3FB}"},{"group":1,"hexcode":"1FAF5-1F3FC","label":"index pointing at the viewer: medium-light skin tone","order":346,"unicode":"\u{1FAF5}\u{1F3FC}"},{"group":1,"hexcode":"1FAF5-1F3FD","label":"index pointing at the viewer: medium skin tone","order":347,"unicode":"\u{1FAF5}\u{1F3FD}"},{"group":1,"hexcode":"1FAF5-1F3FE","label":"index pointing at the viewer: medium-dark skin tone","order":348,"unicode":"\u{1FAF5}\u{1F3FE}"},{"group":1,"hexcode":"1FAF5-1F3FF","label":"index pointing at the viewer: dark skin tone","order":349,"unicode":"\u{1FAF5}\u{1F3FF}"}]},{"group":1,"hexcode":"1F44D","label":"thumbs up","order":350,"tags":["+1","hand","thumb","up"],"unicode":"\u{1F44D}\uFE0F","skins":[{"group":1,"hexcode":"1F44D-1F3FB","label":"thumbs up: light skin tone","order":351,"unicode":"\u{1F44D}\u{1F3FB}"},{"group":1,"hexcode":"1F44D-1F3FC","label":"thumbs up: medium-light skin tone","order":352,"unicode":"\u{1F44D}\u{1F3FC}"},{"group":1,"hexcode":"1F44D-1F3FD","label":"thumbs up: medium skin tone","order":353,"unicode":"\u{1F44D}\u{1F3FD}"},{"group":1,"hexcode":"1F44D-1F3FE","label":"thumbs up: medium-dark skin tone","order":354,"unicode":"\u{1F44D}\u{1F3FE}"},{"group":1,"hexcode":"1F44D-1F3FF","label":"thumbs up: dark skin tone","order":355,"unicode":"\u{1F44D}\u{1F3FF}"}]},{"group":1,"hexcode":"1F44E","label":"thumbs down","order":356,"tags":["-1","down","hand","thumb"],"unicode":"\u{1F44E}\uFE0F","skins":[{"group":1,"hexcode":"1F44E-1F3FB","label":"thumbs down: light skin tone","order":357,"unicode":"\u{1F44E}\u{1F3FB}"},{"group":1,"hexcode":"1F44E-1F3FC","label":"thumbs down: medium-light skin tone","order":358,"unicode":"\u{1F44E}\u{1F3FC}"},{"group":1,"hexcode":"1F44E-1F3FD","label":"thumbs down: medium skin tone","order":359,"unicode":"\u{1F44E}\u{1F3FD}"},{"group":1,"hexcode":"1F44E-1F3FE","label":"thumbs down: medium-dark skin tone","order":360,"unicode":"\u{1F44E}\u{1F3FE}"},{"group":1,"hexcode":"1F44E-1F3FF","label":"thumbs down: dark skin tone","order":361,"unicode":"\u{1F44E}\u{1F3FF}"}]},{"group":1,"hexcode":"270A","label":"raised fist","order":362,"tags":["clenched","fist","hand","punch"],"unicode":"\u270A\uFE0F","skins":[{"group":1,"hexcode":"270A-1F3FB","label":"raised fist: light skin tone","order":363,"unicode":"\u270A\u{1F3FB}"},{"group":1,"hexcode":"270A-1F3FC","label":"raised fist: medium-light skin tone","order":364,"unicode":"\u270A\u{1F3FC}"},{"group":1,"hexcode":"270A-1F3FD","label":"raised fist: medium skin tone","order":365,"unicode":"\u270A\u{1F3FD}"},{"group":1,"hexcode":"270A-1F3FE","label":"raised fist: medium-dark skin tone","order":366,"unicode":"\u270A\u{1F3FE}"},{"group":1,"hexcode":"270A-1F3FF","label":"raised fist: dark skin tone","order":367,"unicode":"\u270A\u{1F3FF}"}]},{"group":1,"hexcode":"1F44A","label":"oncoming fist","order":368,"tags":["clenched","fist","hand","punch"],"unicode":"\u{1F44A}","skins":[{"group":1,"hexcode":"1F44A-1F3FB","label":"oncoming fist: light skin tone","order":369,"unicode":"\u{1F44A}\u{1F3FB}"},{"group":1,"hexcode":"1F44A-1F3FC","label":"oncoming fist: medium-light skin tone","order":370,"unicode":"\u{1F44A}\u{1F3FC}"},{"group":1,"hexcode":"1F44A-1F3FD","label":"oncoming fist: medium skin tone","order":371,"unicode":"\u{1F44A}\u{1F3FD}"},{"group":1,"hexcode":"1F44A-1F3FE","label":"oncoming fist: medium-dark skin tone","order":372,"unicode":"\u{1F44A}\u{1F3FE}"},{"group":1,"hexcode":"1F44A-1F3FF","label":"oncoming fist: dark skin tone","order":373,"unicode":"\u{1F44A}\u{1F3FF}"}]},{"group":1,"hexcode":"1F91B","label":"left-facing fist","order":374,"tags":["fist","leftwards"],"unicode":"\u{1F91B}","skins":[{"group":1,"hexcode":"1F91B-1F3FB","label":"left-facing fist: light skin tone","order":375,"unicode":"\u{1F91B}\u{1F3FB}"},{"group":1,"hexcode":"1F91B-1F3FC","label":"left-facing fist: medium-light skin tone","order":376,"unicode":"\u{1F91B}\u{1F3FC}"},{"group":1,"hexcode":"1F91B-1F3FD","label":"left-facing fist: medium skin tone","order":377,"unicode":"\u{1F91B}\u{1F3FD}"},{"group":1,"hexcode":"1F91B-1F3FE","label":"left-facing fist: medium-dark skin tone","order":378,"unicode":"\u{1F91B}\u{1F3FE}"},{"group":1,"hexcode":"1F91B-1F3FF","label":"left-facing fist: dark skin tone","order":379,"unicode":"\u{1F91B}\u{1F3FF}"}]},{"group":1,"hexcode":"1F91C","label":"right-facing fist","order":380,"tags":["fist","rightwards"],"unicode":"\u{1F91C}","skins":[{"group":1,"hexcode":"1F91C-1F3FB","label":"right-facing fist: light skin tone","order":381,"unicode":"\u{1F91C}\u{1F3FB}"},{"group":1,"hexcode":"1F91C-1F3FC","label":"right-facing fist: medium-light skin tone","order":382,"unicode":"\u{1F91C}\u{1F3FC}"},{"group":1,"hexcode":"1F91C-1F3FD","label":"right-facing fist: medium skin tone","order":383,"unicode":"\u{1F91C}\u{1F3FD}"},{"group":1,"hexcode":"1F91C-1F3FE","label":"right-facing fist: medium-dark skin tone","order":384,"unicode":"\u{1F91C}\u{1F3FE}"},{"group":1,"hexcode":"1F91C-1F3FF","label":"right-facing fist: dark skin tone","order":385,"unicode":"\u{1F91C}\u{1F3FF}"}]},{"group":1,"hexcode":"1F44F","label":"clapping hands","order":386,"tags":["clap","hand"],"unicode":"\u{1F44F}","skins":[{"group":1,"hexcode":"1F44F-1F3FB","label":"clapping hands: light skin tone","order":387,"unicode":"\u{1F44F}\u{1F3FB}"},{"group":1,"hexcode":"1F44F-1F3FC","label":"clapping hands: medium-light skin tone","order":388,"unicode":"\u{1F44F}\u{1F3FC}"},{"group":1,"hexcode":"1F44F-1F3FD","label":"clapping hands: medium skin tone","order":389,"unicode":"\u{1F44F}\u{1F3FD}"},{"group":1,"hexcode":"1F44F-1F3FE","label":"clapping hands: medium-dark skin tone","order":390,"unicode":"\u{1F44F}\u{1F3FE}"},{"group":1,"hexcode":"1F44F-1F3FF","label":"clapping hands: dark skin tone","order":391,"unicode":"\u{1F44F}\u{1F3FF}"}]},{"group":1,"hexcode":"1F64C","label":"raising hands","order":392,"tags":["celebration","gesture","hand","hooray","raised"],"unicode":"\u{1F64C}","skins":[{"group":1,"hexcode":"1F64C-1F3FB","label":"raising hands: light skin tone","order":393,"unicode":"\u{1F64C}\u{1F3FB}"},{"group":1,"hexcode":"1F64C-1F3FC","label":"raising hands: medium-light skin tone","order":394,"unicode":"\u{1F64C}\u{1F3FC}"},{"group":1,"hexcode":"1F64C-1F3FD","label":"raising hands: medium skin tone","order":395,"unicode":"\u{1F64C}\u{1F3FD}"},{"group":1,"hexcode":"1F64C-1F3FE","label":"raising hands: medium-dark skin tone","order":396,"unicode":"\u{1F64C}\u{1F3FE}"},{"group":1,"hexcode":"1F64C-1F3FF","label":"raising hands: dark skin tone","order":397,"unicode":"\u{1F64C}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAF6","label":"heart hands","order":398,"tags":["love"],"unicode":"\u{1FAF6}","skins":[{"group":1,"hexcode":"1FAF6-1F3FB","label":"heart hands: light skin tone","order":399,"unicode":"\u{1FAF6}\u{1F3FB}"},{"group":1,"hexcode":"1FAF6-1F3FC","label":"heart hands: medium-light skin tone","order":400,"unicode":"\u{1FAF6}\u{1F3FC}"},{"group":1,"hexcode":"1FAF6-1F3FD","label":"heart hands: medium skin tone","order":401,"unicode":"\u{1FAF6}\u{1F3FD}"},{"group":1,"hexcode":"1FAF6-1F3FE","label":"heart hands: medium-dark skin tone","order":402,"unicode":"\u{1FAF6}\u{1F3FE}"},{"group":1,"hexcode":"1FAF6-1F3FF","label":"heart hands: dark skin tone","order":403,"unicode":"\u{1FAF6}\u{1F3FF}"}]},{"group":1,"hexcode":"1F450","label":"open hands","order":404,"tags":["hand","open"],"unicode":"\u{1F450}","skins":[{"group":1,"hexcode":"1F450-1F3FB","label":"open hands: light skin tone","order":405,"unicode":"\u{1F450}\u{1F3FB}"},{"group":1,"hexcode":"1F450-1F3FC","label":"open hands: medium-light skin tone","order":406,"unicode":"\u{1F450}\u{1F3FC}"},{"group":1,"hexcode":"1F450-1F3FD","label":"open hands: medium skin tone","order":407,"unicode":"\u{1F450}\u{1F3FD}"},{"group":1,"hexcode":"1F450-1F3FE","label":"open hands: medium-dark skin tone","order":408,"unicode":"\u{1F450}\u{1F3FE}"},{"group":1,"hexcode":"1F450-1F3FF","label":"open hands: dark skin tone","order":409,"unicode":"\u{1F450}\u{1F3FF}"}]},{"group":1,"hexcode":"1F932","label":"palms up together","order":410,"tags":["prayer"],"unicode":"\u{1F932}","skins":[{"group":1,"hexcode":"1F932-1F3FB","label":"palms up together: light skin tone","order":411,"unicode":"\u{1F932}\u{1F3FB}"},{"group":1,"hexcode":"1F932-1F3FC","label":"palms up together: medium-light skin tone","order":412,"unicode":"\u{1F932}\u{1F3FC}"},{"group":1,"hexcode":"1F932-1F3FD","label":"palms up together: medium skin tone","order":413,"unicode":"\u{1F932}\u{1F3FD}"},{"group":1,"hexcode":"1F932-1F3FE","label":"palms up together: medium-dark skin tone","order":414,"unicode":"\u{1F932}\u{1F3FE}"},{"group":1,"hexcode":"1F932-1F3FF","label":"palms up together: dark skin tone","order":415,"unicode":"\u{1F932}\u{1F3FF}"}]},{"group":1,"hexcode":"1F91D","label":"handshake","order":416,"tags":["agreement","hand","meeting","shake"],"unicode":"\u{1F91D}","skins":[{"group":1,"hexcode":"1F91D-1F3FB","label":"handshake: light skin tone","order":417,"unicode":"\u{1F91D}\u{1F3FB}"},{"group":1,"hexcode":"1F91D-1F3FC","label":"handshake: medium-light skin tone","order":418,"unicode":"\u{1F91D}\u{1F3FC}"},{"group":1,"hexcode":"1F91D-1F3FD","label":"handshake: medium skin tone","order":419,"unicode":"\u{1F91D}\u{1F3FD}"},{"group":1,"hexcode":"1F91D-1F3FE","label":"handshake: medium-dark skin tone","order":420,"unicode":"\u{1F91D}\u{1F3FE}"},{"group":1,"hexcode":"1F91D-1F3FF","label":"handshake: dark skin tone","order":421,"unicode":"\u{1F91D}\u{1F3FF}"},{"group":1,"hexcode":"1FAF1-1F3FB-200D-1FAF2-1F3FC","label":"handshake: light skin tone, medium-light skin tone","order":422,"unicode":"\u{1FAF1}\u{1F3FB}\u200D\u{1FAF2}\u{1F3FC}"},{"group":1,"hexcode":"1FAF1-1F3FB-200D-1FAF2-1F3FD","label":"handshake: light skin tone, medium skin tone","order":423,"unicode":"\u{1FAF1}\u{1F3FB}\u200D\u{1FAF2}\u{1F3FD}"},{"group":1,"hexcode":"1FAF1-1F3FB-200D-1FAF2-1F3FE","label":"handshake: light skin tone, medium-dark skin tone","order":424,"unicode":"\u{1FAF1}\u{1F3FB}\u200D\u{1FAF2}\u{1F3FE}"},{"group":1,"hexcode":"1FAF1-1F3FB-200D-1FAF2-1F3FF","label":"handshake: light skin tone, dark skin tone","order":425,"unicode":"\u{1FAF1}\u{1F3FB}\u200D\u{1FAF2}\u{1F3FF}"},{"group":1,"hexcode":"1FAF1-1F3FC-200D-1FAF2-1F3FB","label":"handshake: medium-light skin tone, light skin tone","order":426,"unicode":"\u{1FAF1}\u{1F3FC}\u200D\u{1FAF2}\u{1F3FB}"},{"group":1,"hexcode":"1FAF1-1F3FC-200D-1FAF2-1F3FD","label":"handshake: medium-light skin tone, medium skin tone","order":427,"unicode":"\u{1FAF1}\u{1F3FC}\u200D\u{1FAF2}\u{1F3FD}"},{"group":1,"hexcode":"1FAF1-1F3FC-200D-1FAF2-1F3FE","label":"handshake: medium-light skin tone, medium-dark skin tone","order":428,"unicode":"\u{1FAF1}\u{1F3FC}\u200D\u{1FAF2}\u{1F3FE}"},{"group":1,"hexcode":"1FAF1-1F3FC-200D-1FAF2-1F3FF","label":"handshake: medium-light skin tone, dark skin tone","order":429,"unicode":"\u{1FAF1}\u{1F3FC}\u200D\u{1FAF2}\u{1F3FF}"},{"group":1,"hexcode":"1FAF1-1F3FD-200D-1FAF2-1F3FB","label":"handshake: medium skin tone, light skin tone","order":430,"unicode":"\u{1FAF1}\u{1F3FD}\u200D\u{1FAF2}\u{1F3FB}"},{"group":1,"hexcode":"1FAF1-1F3FD-200D-1FAF2-1F3FC","label":"handshake: medium skin tone, medium-light skin tone","order":431,"unicode":"\u{1FAF1}\u{1F3FD}\u200D\u{1FAF2}\u{1F3FC}"},{"group":1,"hexcode":"1FAF1-1F3FD-200D-1FAF2-1F3FE","label":"handshake: medium skin tone, medium-dark skin tone","order":432,"unicode":"\u{1FAF1}\u{1F3FD}\u200D\u{1FAF2}\u{1F3FE}"},{"group":1,"hexcode":"1FAF1-1F3FD-200D-1FAF2-1F3FF","label":"handshake: medium skin tone, dark skin tone","order":433,"unicode":"\u{1FAF1}\u{1F3FD}\u200D\u{1FAF2}\u{1F3FF}"},{"group":1,"hexcode":"1FAF1-1F3FE-200D-1FAF2-1F3FB","label":"handshake: medium-dark skin tone, light skin tone","order":434,"unicode":"\u{1FAF1}\u{1F3FE}\u200D\u{1FAF2}\u{1F3FB}"},{"group":1,"hexcode":"1FAF1-1F3FE-200D-1FAF2-1F3FC","label":"handshake: medium-dark skin tone, medium-light skin tone","order":435,"unicode":"\u{1FAF1}\u{1F3FE}\u200D\u{1FAF2}\u{1F3FC}"},{"group":1,"hexcode":"1FAF1-1F3FE-200D-1FAF2-1F3FD","label":"handshake: medium-dark skin tone, medium skin tone","order":436,"unicode":"\u{1FAF1}\u{1F3FE}\u200D\u{1FAF2}\u{1F3FD}"},{"group":1,"hexcode":"1FAF1-1F3FE-200D-1FAF2-1F3FF","label":"handshake: medium-dark skin tone, dark skin tone","order":437,"unicode":"\u{1FAF1}\u{1F3FE}\u200D\u{1FAF2}\u{1F3FF}"},{"group":1,"hexcode":"1FAF1-1F3FF-200D-1FAF2-1F3FB","label":"handshake: dark skin tone, light skin tone","order":438,"unicode":"\u{1FAF1}\u{1F3FF}\u200D\u{1FAF2}\u{1F3FB}"},{"group":1,"hexcode":"1FAF1-1F3FF-200D-1FAF2-1F3FC","label":"handshake: dark skin tone, medium-light skin tone","order":439,"unicode":"\u{1FAF1}\u{1F3FF}\u200D\u{1FAF2}\u{1F3FC}"},{"group":1,"hexcode":"1FAF1-1F3FF-200D-1FAF2-1F3FD","label":"handshake: dark skin tone, medium skin tone","order":440,"unicode":"\u{1FAF1}\u{1F3FF}\u200D\u{1FAF2}\u{1F3FD}"},{"group":1,"hexcode":"1FAF1-1F3FF-200D-1FAF2-1F3FE","label":"handshake: dark skin tone, medium-dark skin tone","order":441,"unicode":"\u{1FAF1}\u{1F3FF}\u200D\u{1FAF2}\u{1F3FE}"}]},{"group":1,"hexcode":"1F64F","label":"folded hands","order":442,"tags":["ask","hand","high 5","high five","please","pray","thanks"],"unicode":"\u{1F64F}","skins":[{"group":1,"hexcode":"1F64F-1F3FB","label":"folded hands: light skin tone","order":443,"unicode":"\u{1F64F}\u{1F3FB}"},{"group":1,"hexcode":"1F64F-1F3FC","label":"folded hands: medium-light skin tone","order":444,"unicode":"\u{1F64F}\u{1F3FC}"},{"group":1,"hexcode":"1F64F-1F3FD","label":"folded hands: medium skin tone","order":445,"unicode":"\u{1F64F}\u{1F3FD}"},{"group":1,"hexcode":"1F64F-1F3FE","label":"folded hands: medium-dark skin tone","order":446,"unicode":"\u{1F64F}\u{1F3FE}"},{"group":1,"hexcode":"1F64F-1F3FF","label":"folded hands: dark skin tone","order":447,"unicode":"\u{1F64F}\u{1F3FF}"}]},{"group":1,"hexcode":"270D","label":"writing hand","order":449,"tags":["hand","write"],"unicode":"\u270D\uFE0F","skins":[{"group":1,"hexcode":"270D-1F3FB","label":"writing hand: light skin tone","order":450,"unicode":"\u270D\u{1F3FB}"},{"group":1,"hexcode":"270D-1F3FC","label":"writing hand: medium-light skin tone","order":451,"unicode":"\u270D\u{1F3FC}"},{"group":1,"hexcode":"270D-1F3FD","label":"writing hand: medium skin tone","order":452,"unicode":"\u270D\u{1F3FD}"},{"group":1,"hexcode":"270D-1F3FE","label":"writing hand: medium-dark skin tone","order":453,"unicode":"\u270D\u{1F3FE}"},{"group":1,"hexcode":"270D-1F3FF","label":"writing hand: dark skin tone","order":454,"unicode":"\u270D\u{1F3FF}"}]},{"group":1,"hexcode":"1F485","label":"nail polish","order":455,"tags":["care","cosmetics","manicure","nail","polish"],"unicode":"\u{1F485}","skins":[{"group":1,"hexcode":"1F485-1F3FB","label":"nail polish: light skin tone","order":456,"unicode":"\u{1F485}\u{1F3FB}"},{"group":1,"hexcode":"1F485-1F3FC","label":"nail polish: medium-light skin tone","order":457,"unicode":"\u{1F485}\u{1F3FC}"},{"group":1,"hexcode":"1F485-1F3FD","label":"nail polish: medium skin tone","order":458,"unicode":"\u{1F485}\u{1F3FD}"},{"group":1,"hexcode":"1F485-1F3FE","label":"nail polish: medium-dark skin tone","order":459,"unicode":"\u{1F485}\u{1F3FE}"},{"group":1,"hexcode":"1F485-1F3FF","label":"nail polish: dark skin tone","order":460,"unicode":"\u{1F485}\u{1F3FF}"}]},{"group":1,"hexcode":"1F933","label":"selfie","order":461,"tags":["camera","phone"],"unicode":"\u{1F933}","skins":[{"group":1,"hexcode":"1F933-1F3FB","label":"selfie: light skin tone","order":462,"unicode":"\u{1F933}\u{1F3FB}"},{"group":1,"hexcode":"1F933-1F3FC","label":"selfie: medium-light skin tone","order":463,"unicode":"\u{1F933}\u{1F3FC}"},{"group":1,"hexcode":"1F933-1F3FD","label":"selfie: medium skin tone","order":464,"unicode":"\u{1F933}\u{1F3FD}"},{"group":1,"hexcode":"1F933-1F3FE","label":"selfie: medium-dark skin tone","order":465,"unicode":"\u{1F933}\u{1F3FE}"},{"group":1,"hexcode":"1F933-1F3FF","label":"selfie: dark skin tone","order":466,"unicode":"\u{1F933}\u{1F3FF}"}]},{"group":1,"hexcode":"1F4AA","label":"flexed biceps","order":467,"tags":["biceps","comic","flex","muscle"],"unicode":"\u{1F4AA}","skins":[{"group":1,"hexcode":"1F4AA-1F3FB","label":"flexed biceps: light skin tone","order":468,"unicode":"\u{1F4AA}\u{1F3FB}"},{"group":1,"hexcode":"1F4AA-1F3FC","label":"flexed biceps: medium-light skin tone","order":469,"unicode":"\u{1F4AA}\u{1F3FC}"},{"group":1,"hexcode":"1F4AA-1F3FD","label":"flexed biceps: medium skin tone","order":470,"unicode":"\u{1F4AA}\u{1F3FD}"},{"group":1,"hexcode":"1F4AA-1F3FE","label":"flexed biceps: medium-dark skin tone","order":471,"unicode":"\u{1F4AA}\u{1F3FE}"},{"group":1,"hexcode":"1F4AA-1F3FF","label":"flexed biceps: dark skin tone","order":472,"unicode":"\u{1F4AA}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9BE","label":"mechanical arm","order":473,"tags":["accessibility","prosthetic"],"unicode":"\u{1F9BE}"},{"group":1,"hexcode":"1F9BF","label":"mechanical leg","order":474,"tags":["accessibility","prosthetic"],"unicode":"\u{1F9BF}"},{"group":1,"hexcode":"1F9B5","label":"leg","order":475,"tags":["kick","limb"],"unicode":"\u{1F9B5}","skins":[{"group":1,"hexcode":"1F9B5-1F3FB","label":"leg: light skin tone","order":476,"unicode":"\u{1F9B5}\u{1F3FB}"},{"group":1,"hexcode":"1F9B5-1F3FC","label":"leg: medium-light skin tone","order":477,"unicode":"\u{1F9B5}\u{1F3FC}"},{"group":1,"hexcode":"1F9B5-1F3FD","label":"leg: medium skin tone","order":478,"unicode":"\u{1F9B5}\u{1F3FD}"},{"group":1,"hexcode":"1F9B5-1F3FE","label":"leg: medium-dark skin tone","order":479,"unicode":"\u{1F9B5}\u{1F3FE}"},{"group":1,"hexcode":"1F9B5-1F3FF","label":"leg: dark skin tone","order":480,"unicode":"\u{1F9B5}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9B6","label":"foot","order":481,"tags":["kick","stomp"],"unicode":"\u{1F9B6}","skins":[{"group":1,"hexcode":"1F9B6-1F3FB","label":"foot: light skin tone","order":482,"unicode":"\u{1F9B6}\u{1F3FB}"},{"group":1,"hexcode":"1F9B6-1F3FC","label":"foot: medium-light skin tone","order":483,"unicode":"\u{1F9B6}\u{1F3FC}"},{"group":1,"hexcode":"1F9B6-1F3FD","label":"foot: medium skin tone","order":484,"unicode":"\u{1F9B6}\u{1F3FD}"},{"group":1,"hexcode":"1F9B6-1F3FE","label":"foot: medium-dark skin tone","order":485,"unicode":"\u{1F9B6}\u{1F3FE}"},{"group":1,"hexcode":"1F9B6-1F3FF","label":"foot: dark skin tone","order":486,"unicode":"\u{1F9B6}\u{1F3FF}"}]},{"group":1,"hexcode":"1F442","label":"ear","order":487,"tags":["body"],"unicode":"\u{1F442}\uFE0F","skins":[{"group":1,"hexcode":"1F442-1F3FB","label":"ear: light skin tone","order":488,"unicode":"\u{1F442}\u{1F3FB}"},{"group":1,"hexcode":"1F442-1F3FC","label":"ear: medium-light skin tone","order":489,"unicode":"\u{1F442}\u{1F3FC}"},{"group":1,"hexcode":"1F442-1F3FD","label":"ear: medium skin tone","order":490,"unicode":"\u{1F442}\u{1F3FD}"},{"group":1,"hexcode":"1F442-1F3FE","label":"ear: medium-dark skin tone","order":491,"unicode":"\u{1F442}\u{1F3FE}"},{"group":1,"hexcode":"1F442-1F3FF","label":"ear: dark skin tone","order":492,"unicode":"\u{1F442}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9BB","label":"ear with hearing aid","order":493,"tags":["accessibility","hard of hearing"],"unicode":"\u{1F9BB}","skins":[{"group":1,"hexcode":"1F9BB-1F3FB","label":"ear with hearing aid: light skin tone","order":494,"unicode":"\u{1F9BB}\u{1F3FB}"},{"group":1,"hexcode":"1F9BB-1F3FC","label":"ear with hearing aid: medium-light skin tone","order":495,"unicode":"\u{1F9BB}\u{1F3FC}"},{"group":1,"hexcode":"1F9BB-1F3FD","label":"ear with hearing aid: medium skin tone","order":496,"unicode":"\u{1F9BB}\u{1F3FD}"},{"group":1,"hexcode":"1F9BB-1F3FE","label":"ear with hearing aid: medium-dark skin tone","order":497,"unicode":"\u{1F9BB}\u{1F3FE}"},{"group":1,"hexcode":"1F9BB-1F3FF","label":"ear with hearing aid: dark skin tone","order":498,"unicode":"\u{1F9BB}\u{1F3FF}"}]},{"group":1,"hexcode":"1F443","label":"nose","order":499,"tags":["body"],"unicode":"\u{1F443}","skins":[{"group":1,"hexcode":"1F443-1F3FB","label":"nose: light skin tone","order":500,"unicode":"\u{1F443}\u{1F3FB}"},{"group":1,"hexcode":"1F443-1F3FC","label":"nose: medium-light skin tone","order":501,"unicode":"\u{1F443}\u{1F3FC}"},{"group":1,"hexcode":"1F443-1F3FD","label":"nose: medium skin tone","order":502,"unicode":"\u{1F443}\u{1F3FD}"},{"group":1,"hexcode":"1F443-1F3FE","label":"nose: medium-dark skin tone","order":503,"unicode":"\u{1F443}\u{1F3FE}"},{"group":1,"hexcode":"1F443-1F3FF","label":"nose: dark skin tone","order":504,"unicode":"\u{1F443}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9E0","label":"brain","order":505,"tags":["intelligent"],"unicode":"\u{1F9E0}"},{"group":1,"hexcode":"1FAC0","label":"anatomical heart","order":506,"tags":["anatomical","cardiology","heart","organ","pulse"],"unicode":"\u{1FAC0}"},{"group":1,"hexcode":"1FAC1","label":"lungs","order":507,"tags":["breath","exhalation","inhalation","organ","respiration"],"unicode":"\u{1FAC1}"},{"group":1,"hexcode":"1F9B7","label":"tooth","order":508,"tags":["dentist"],"unicode":"\u{1F9B7}"},{"group":1,"hexcode":"1F9B4","label":"bone","order":509,"tags":["skeleton"],"unicode":"\u{1F9B4}"},{"group":1,"hexcode":"1F440","label":"eyes","order":510,"tags":["eye","face"],"unicode":"\u{1F440}"},{"group":1,"hexcode":"1F441","label":"eye","order":512,"tags":["body"],"unicode":"\u{1F441}\uFE0F"},{"group":1,"hexcode":"1F445","label":"tongue","order":513,"tags":["body"],"unicode":"\u{1F445}"},{"group":1,"hexcode":"1F444","label":"mouth","order":514,"tags":["lips"],"unicode":"\u{1F444}"},{"group":1,"hexcode":"1FAE6","label":"biting lip","order":515,"tags":["anxious","fear","flirting","nervous","uncomfortable","worried"],"unicode":"\u{1FAE6}"},{"group":1,"hexcode":"1F476","label":"baby","order":516,"tags":["young"],"unicode":"\u{1F476}","skins":[{"group":1,"hexcode":"1F476-1F3FB","label":"baby: light skin tone","order":517,"unicode":"\u{1F476}\u{1F3FB}"},{"group":1,"hexcode":"1F476-1F3FC","label":"baby: medium-light skin tone","order":518,"unicode":"\u{1F476}\u{1F3FC}"},{"group":1,"hexcode":"1F476-1F3FD","label":"baby: medium skin tone","order":519,"unicode":"\u{1F476}\u{1F3FD}"},{"group":1,"hexcode":"1F476-1F3FE","label":"baby: medium-dark skin tone","order":520,"unicode":"\u{1F476}\u{1F3FE}"},{"group":1,"hexcode":"1F476-1F3FF","label":"baby: dark skin tone","order":521,"unicode":"\u{1F476}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D2","label":"child","order":522,"tags":["gender-neutral","unspecified gender","young"],"unicode":"\u{1F9D2}","skins":[{"group":1,"hexcode":"1F9D2-1F3FB","label":"child: light skin tone","order":523,"unicode":"\u{1F9D2}\u{1F3FB}"},{"group":1,"hexcode":"1F9D2-1F3FC","label":"child: medium-light skin tone","order":524,"unicode":"\u{1F9D2}\u{1F3FC}"},{"group":1,"hexcode":"1F9D2-1F3FD","label":"child: medium skin tone","order":525,"unicode":"\u{1F9D2}\u{1F3FD}"},{"group":1,"hexcode":"1F9D2-1F3FE","label":"child: medium-dark skin tone","order":526,"unicode":"\u{1F9D2}\u{1F3FE}"},{"group":1,"hexcode":"1F9D2-1F3FF","label":"child: dark skin tone","order":527,"unicode":"\u{1F9D2}\u{1F3FF}"}]},{"group":1,"hexcode":"1F466","label":"boy","order":528,"tags":["young"],"unicode":"\u{1F466}","skins":[{"group":1,"hexcode":"1F466-1F3FB","label":"boy: light skin tone","order":529,"unicode":"\u{1F466}\u{1F3FB}"},{"group":1,"hexcode":"1F466-1F3FC","label":"boy: medium-light skin tone","order":530,"unicode":"\u{1F466}\u{1F3FC}"},{"group":1,"hexcode":"1F466-1F3FD","label":"boy: medium skin tone","order":531,"unicode":"\u{1F466}\u{1F3FD}"},{"group":1,"hexcode":"1F466-1F3FE","label":"boy: medium-dark skin tone","order":532,"unicode":"\u{1F466}\u{1F3FE}"},{"group":1,"hexcode":"1F466-1F3FF","label":"boy: dark skin tone","order":533,"unicode":"\u{1F466}\u{1F3FF}"}]},{"group":1,"hexcode":"1F467","label":"girl","order":534,"tags":["virgo","young","zodiac"],"unicode":"\u{1F467}","skins":[{"group":1,"hexcode":"1F467-1F3FB","label":"girl: light skin tone","order":535,"unicode":"\u{1F467}\u{1F3FB}"},{"group":1,"hexcode":"1F467-1F3FC","label":"girl: medium-light skin tone","order":536,"unicode":"\u{1F467}\u{1F3FC}"},{"group":1,"hexcode":"1F467-1F3FD","label":"girl: medium skin tone","order":537,"unicode":"\u{1F467}\u{1F3FD}"},{"group":1,"hexcode":"1F467-1F3FE","label":"girl: medium-dark skin tone","order":538,"unicode":"\u{1F467}\u{1F3FE}"},{"group":1,"hexcode":"1F467-1F3FF","label":"girl: dark skin tone","order":539,"unicode":"\u{1F467}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D1","label":"person","order":540,"tags":["adult","gender-neutral","unspecified gender"],"unicode":"\u{1F9D1}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB","label":"person: light skin tone","order":541,"unicode":"\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FC","label":"person: medium-light skin tone","order":542,"unicode":"\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FD","label":"person: medium skin tone","order":543,"unicode":"\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FE","label":"person: medium-dark skin tone","order":544,"unicode":"\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FF","label":"person: dark skin tone","order":545,"unicode":"\u{1F9D1}\u{1F3FF}"}]},{"group":1,"hexcode":"1F471","label":"person: blond hair","order":546,"tags":["blond","blond-haired person","hair"],"unicode":"\u{1F471}","skins":[{"group":1,"hexcode":"1F471-1F3FB","label":"person: light skin tone, blond hair","order":547,"unicode":"\u{1F471}\u{1F3FB}"},{"group":1,"hexcode":"1F471-1F3FC","label":"person: medium-light skin tone, blond hair","order":548,"unicode":"\u{1F471}\u{1F3FC}"},{"group":1,"hexcode":"1F471-1F3FD","label":"person: medium skin tone, blond hair","order":549,"unicode":"\u{1F471}\u{1F3FD}"},{"group":1,"hexcode":"1F471-1F3FE","label":"person: medium-dark skin tone, blond hair","order":550,"unicode":"\u{1F471}\u{1F3FE}"},{"group":1,"hexcode":"1F471-1F3FF","label":"person: dark skin tone, blond hair","order":551,"unicode":"\u{1F471}\u{1F3FF}"}]},{"group":1,"hexcode":"1F468","label":"man","order":552,"tags":["adult"],"unicode":"\u{1F468}","skins":[{"group":1,"hexcode":"1F468-1F3FB","label":"man: light skin tone","order":553,"unicode":"\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FC","label":"man: medium-light skin tone","order":554,"unicode":"\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FD","label":"man: medium skin tone","order":555,"unicode":"\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FE","label":"man: medium-dark skin tone","order":556,"unicode":"\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FF","label":"man: dark skin tone","order":557,"unicode":"\u{1F468}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D4","label":"person: beard","order":558,"tags":["beard","person"],"unicode":"\u{1F9D4}","skins":[{"group":1,"hexcode":"1F9D4-1F3FB","label":"person: light skin tone, beard","order":559,"unicode":"\u{1F9D4}\u{1F3FB}"},{"group":1,"hexcode":"1F9D4-1F3FC","label":"person: medium-light skin tone, beard","order":560,"unicode":"\u{1F9D4}\u{1F3FC}"},{"group":1,"hexcode":"1F9D4-1F3FD","label":"person: medium skin tone, beard","order":561,"unicode":"\u{1F9D4}\u{1F3FD}"},{"group":1,"hexcode":"1F9D4-1F3FE","label":"person: medium-dark skin tone, beard","order":562,"unicode":"\u{1F9D4}\u{1F3FE}"},{"group":1,"hexcode":"1F9D4-1F3FF","label":"person: dark skin tone, beard","order":563,"unicode":"\u{1F9D4}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D4-200D-2642-FE0F","label":"man: beard","order":564,"tags":["beard","man"],"unicode":"\u{1F9D4}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9D4-1F3FB-200D-2642-FE0F","label":"man: light skin tone, beard","order":566,"unicode":"\u{1F9D4}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FC-200D-2642-FE0F","label":"man: medium-light skin tone, beard","order":568,"unicode":"\u{1F9D4}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FD-200D-2642-FE0F","label":"man: medium skin tone, beard","order":570,"unicode":"\u{1F9D4}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FE-200D-2642-FE0F","label":"man: medium-dark skin tone, beard","order":572,"unicode":"\u{1F9D4}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FF-200D-2642-FE0F","label":"man: dark skin tone, beard","order":574,"unicode":"\u{1F9D4}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9D4-200D-2640-FE0F","label":"woman: beard","order":576,"tags":["beard","woman"],"unicode":"\u{1F9D4}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9D4-1F3FB-200D-2640-FE0F","label":"woman: light skin tone, beard","order":578,"unicode":"\u{1F9D4}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FC-200D-2640-FE0F","label":"woman: medium-light skin tone, beard","order":580,"unicode":"\u{1F9D4}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FD-200D-2640-FE0F","label":"woman: medium skin tone, beard","order":582,"unicode":"\u{1F9D4}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FE-200D-2640-FE0F","label":"woman: medium-dark skin tone, beard","order":584,"unicode":"\u{1F9D4}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D4-1F3FF-200D-2640-FE0F","label":"woman: dark skin tone, beard","order":586,"unicode":"\u{1F9D4}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-1F9B0","label":"man: red hair","order":588,"tags":["adult","man","red hair"],"unicode":"\u{1F468}\u200D\u{1F9B0}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9B0","label":"man: light skin tone, red hair","order":589,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9B0","label":"man: medium-light skin tone, red hair","order":590,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9B0","label":"man: medium skin tone, red hair","order":591,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9B0","label":"man: medium-dark skin tone, red hair","order":592,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9B0","label":"man: dark skin tone, red hair","order":593,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9B0}"}]},{"group":1,"hexcode":"1F468-200D-1F9B1","label":"man: curly hair","order":594,"tags":["adult","curly hair","man"],"unicode":"\u{1F468}\u200D\u{1F9B1}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9B1","label":"man: light skin tone, curly hair","order":595,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9B1","label":"man: medium-light skin tone, curly hair","order":596,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9B1","label":"man: medium skin tone, curly hair","order":597,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9B1","label":"man: medium-dark skin tone, curly hair","order":598,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9B1","label":"man: dark skin tone, curly hair","order":599,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9B1}"}]},{"group":1,"hexcode":"1F468-200D-1F9B3","label":"man: white hair","order":600,"tags":["adult","man","white hair"],"unicode":"\u{1F468}\u200D\u{1F9B3}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9B3","label":"man: light skin tone, white hair","order":601,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9B3","label":"man: medium-light skin tone, white hair","order":602,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9B3","label":"man: medium skin tone, white hair","order":603,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9B3","label":"man: medium-dark skin tone, white hair","order":604,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9B3","label":"man: dark skin tone, white hair","order":605,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9B3}"}]},{"group":1,"hexcode":"1F468-200D-1F9B2","label":"man: bald","order":606,"tags":["adult","bald","man"],"unicode":"\u{1F468}\u200D\u{1F9B2}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9B2","label":"man: light skin tone, bald","order":607,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9B2","label":"man: medium-light skin tone, bald","order":608,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9B2","label":"man: medium skin tone, bald","order":609,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9B2","label":"man: medium-dark skin tone, bald","order":610,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9B2","label":"man: dark skin tone, bald","order":611,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9B2}"}]},{"group":1,"hexcode":"1F469","label":"woman","order":612,"tags":["adult"],"unicode":"\u{1F469}","skins":[{"group":1,"hexcode":"1F469-1F3FB","label":"woman: light skin tone","order":613,"unicode":"\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC","label":"woman: medium-light skin tone","order":614,"unicode":"\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD","label":"woman: medium skin tone","order":615,"unicode":"\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE","label":"woman: medium-dark skin tone","order":616,"unicode":"\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FF","label":"woman: dark skin tone","order":617,"unicode":"\u{1F469}\u{1F3FF}"}]},{"group":1,"hexcode":"1F469-200D-1F9B0","label":"woman: red hair","order":618,"tags":["adult","red hair","woman"],"unicode":"\u{1F469}\u200D\u{1F9B0}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9B0","label":"woman: light skin tone, red hair","order":619,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9B0","label":"woman: medium-light skin tone, red hair","order":620,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9B0","label":"woman: medium skin tone, red hair","order":621,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9B0","label":"woman: medium-dark skin tone, red hair","order":622,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9B0","label":"woman: dark skin tone, red hair","order":623,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9B0}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9B0","label":"person: red hair","order":624,"tags":["adult","gender-neutral","person","red hair","unspecified gender"],"unicode":"\u{1F9D1}\u200D\u{1F9B0}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9B0","label":"person: light skin tone, red hair","order":625,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9B0","label":"person: medium-light skin tone, red hair","order":626,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9B0","label":"person: medium skin tone, red hair","order":627,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9B0","label":"person: medium-dark skin tone, red hair","order":628,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9B0}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9B0","label":"person: dark skin tone, red hair","order":629,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9B0}"}]},{"group":1,"hexcode":"1F469-200D-1F9B1","label":"woman: curly hair","order":630,"tags":["adult","curly hair","woman"],"unicode":"\u{1F469}\u200D\u{1F9B1}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9B1","label":"woman: light skin tone, curly hair","order":631,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9B1","label":"woman: medium-light skin tone, curly hair","order":632,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9B1","label":"woman: medium skin tone, curly hair","order":633,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9B1","label":"woman: medium-dark skin tone, curly hair","order":634,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9B1","label":"woman: dark skin tone, curly hair","order":635,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9B1}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9B1","label":"person: curly hair","order":636,"tags":["adult","curly hair","gender-neutral","person","unspecified gender"],"unicode":"\u{1F9D1}\u200D\u{1F9B1}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9B1","label":"person: light skin tone, curly hair","order":637,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9B1","label":"person: medium-light skin tone, curly hair","order":638,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9B1","label":"person: medium skin tone, curly hair","order":639,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9B1","label":"person: medium-dark skin tone, curly hair","order":640,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9B1}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9B1","label":"person: dark skin tone, curly hair","order":641,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9B1}"}]},{"group":1,"hexcode":"1F469-200D-1F9B3","label":"woman: white hair","order":642,"tags":["adult","white hair","woman"],"unicode":"\u{1F469}\u200D\u{1F9B3}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9B3","label":"woman: light skin tone, white hair","order":643,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9B3","label":"woman: medium-light skin tone, white hair","order":644,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9B3","label":"woman: medium skin tone, white hair","order":645,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9B3","label":"woman: medium-dark skin tone, white hair","order":646,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9B3","label":"woman: dark skin tone, white hair","order":647,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9B3}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9B3","label":"person: white hair","order":648,"tags":["adult","gender-neutral","person","unspecified gender","white hair"],"unicode":"\u{1F9D1}\u200D\u{1F9B3}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9B3","label":"person: light skin tone, white hair","order":649,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9B3","label":"person: medium-light skin tone, white hair","order":650,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9B3","label":"person: medium skin tone, white hair","order":651,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9B3","label":"person: medium-dark skin tone, white hair","order":652,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9B3}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9B3","label":"person: dark skin tone, white hair","order":653,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9B3}"}]},{"group":1,"hexcode":"1F469-200D-1F9B2","label":"woman: bald","order":654,"tags":["adult","bald","woman"],"unicode":"\u{1F469}\u200D\u{1F9B2}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9B2","label":"woman: light skin tone, bald","order":655,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9B2","label":"woman: medium-light skin tone, bald","order":656,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9B2","label":"woman: medium skin tone, bald","order":657,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9B2","label":"woman: medium-dark skin tone, bald","order":658,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9B2","label":"woman: dark skin tone, bald","order":659,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9B2}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9B2","label":"person: bald","order":660,"tags":["adult","bald","gender-neutral","person","unspecified gender"],"unicode":"\u{1F9D1}\u200D\u{1F9B2}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9B2","label":"person: light skin tone, bald","order":661,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9B2","label":"person: medium-light skin tone, bald","order":662,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9B2","label":"person: medium skin tone, bald","order":663,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9B2","label":"person: medium-dark skin tone, bald","order":664,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9B2}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9B2","label":"person: dark skin tone, bald","order":665,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9B2}"}]},{"group":1,"hexcode":"1F471-200D-2640-FE0F","label":"woman: blond hair","order":666,"tags":["blond-haired woman","blonde","hair","woman"],"unicode":"\u{1F471}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F471-1F3FB-200D-2640-FE0F","label":"woman: light skin tone, blond hair","order":668,"unicode":"\u{1F471}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F471-1F3FC-200D-2640-FE0F","label":"woman: medium-light skin tone, blond hair","order":670,"unicode":"\u{1F471}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F471-1F3FD-200D-2640-FE0F","label":"woman: medium skin tone, blond hair","order":672,"unicode":"\u{1F471}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F471-1F3FE-200D-2640-FE0F","label":"woman: medium-dark skin tone, blond hair","order":674,"unicode":"\u{1F471}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F471-1F3FF-200D-2640-FE0F","label":"woman: dark skin tone, blond hair","order":676,"unicode":"\u{1F471}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F471-200D-2642-FE0F","label":"man: blond hair","order":678,"tags":["blond","blond-haired man","hair","man"],"unicode":"\u{1F471}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F471-1F3FB-200D-2642-FE0F","label":"man: light skin tone, blond hair","order":680,"unicode":"\u{1F471}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F471-1F3FC-200D-2642-FE0F","label":"man: medium-light skin tone, blond hair","order":682,"unicode":"\u{1F471}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F471-1F3FD-200D-2642-FE0F","label":"man: medium skin tone, blond hair","order":684,"unicode":"\u{1F471}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F471-1F3FE-200D-2642-FE0F","label":"man: medium-dark skin tone, blond hair","order":686,"unicode":"\u{1F471}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F471-1F3FF-200D-2642-FE0F","label":"man: dark skin tone, blond hair","order":688,"unicode":"\u{1F471}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9D3","label":"older person","order":690,"tags":["adult","gender-neutral","old","unspecified gender"],"unicode":"\u{1F9D3}","skins":[{"group":1,"hexcode":"1F9D3-1F3FB","label":"older person: light skin tone","order":691,"unicode":"\u{1F9D3}\u{1F3FB}"},{"group":1,"hexcode":"1F9D3-1F3FC","label":"older person: medium-light skin tone","order":692,"unicode":"\u{1F9D3}\u{1F3FC}"},{"group":1,"hexcode":"1F9D3-1F3FD","label":"older person: medium skin tone","order":693,"unicode":"\u{1F9D3}\u{1F3FD}"},{"group":1,"hexcode":"1F9D3-1F3FE","label":"older person: medium-dark skin tone","order":694,"unicode":"\u{1F9D3}\u{1F3FE}"},{"group":1,"hexcode":"1F9D3-1F3FF","label":"older person: dark skin tone","order":695,"unicode":"\u{1F9D3}\u{1F3FF}"}]},{"group":1,"hexcode":"1F474","label":"old man","order":696,"tags":["adult","man","old"],"unicode":"\u{1F474}","skins":[{"group":1,"hexcode":"1F474-1F3FB","label":"old man: light skin tone","order":697,"unicode":"\u{1F474}\u{1F3FB}"},{"group":1,"hexcode":"1F474-1F3FC","label":"old man: medium-light skin tone","order":698,"unicode":"\u{1F474}\u{1F3FC}"},{"group":1,"hexcode":"1F474-1F3FD","label":"old man: medium skin tone","order":699,"unicode":"\u{1F474}\u{1F3FD}"},{"group":1,"hexcode":"1F474-1F3FE","label":"old man: medium-dark skin tone","order":700,"unicode":"\u{1F474}\u{1F3FE}"},{"group":1,"hexcode":"1F474-1F3FF","label":"old man: dark skin tone","order":701,"unicode":"\u{1F474}\u{1F3FF}"}]},{"group":1,"hexcode":"1F475","label":"old woman","order":702,"tags":["adult","old","woman"],"unicode":"\u{1F475}","skins":[{"group":1,"hexcode":"1F475-1F3FB","label":"old woman: light skin tone","order":703,"unicode":"\u{1F475}\u{1F3FB}"},{"group":1,"hexcode":"1F475-1F3FC","label":"old woman: medium-light skin tone","order":704,"unicode":"\u{1F475}\u{1F3FC}"},{"group":1,"hexcode":"1F475-1F3FD","label":"old woman: medium skin tone","order":705,"unicode":"\u{1F475}\u{1F3FD}"},{"group":1,"hexcode":"1F475-1F3FE","label":"old woman: medium-dark skin tone","order":706,"unicode":"\u{1F475}\u{1F3FE}"},{"group":1,"hexcode":"1F475-1F3FF","label":"old woman: dark skin tone","order":707,"unicode":"\u{1F475}\u{1F3FF}"}]},{"group":1,"hexcode":"1F64D","label":"person frowning","order":708,"tags":["frown","gesture"],"unicode":"\u{1F64D}","skins":[{"group":1,"hexcode":"1F64D-1F3FB","label":"person frowning: light skin tone","order":709,"unicode":"\u{1F64D}\u{1F3FB}"},{"group":1,"hexcode":"1F64D-1F3FC","label":"person frowning: medium-light skin tone","order":710,"unicode":"\u{1F64D}\u{1F3FC}"},{"group":1,"hexcode":"1F64D-1F3FD","label":"person frowning: medium skin tone","order":711,"unicode":"\u{1F64D}\u{1F3FD}"},{"group":1,"hexcode":"1F64D-1F3FE","label":"person frowning: medium-dark skin tone","order":712,"unicode":"\u{1F64D}\u{1F3FE}"},{"group":1,"hexcode":"1F64D-1F3FF","label":"person frowning: dark skin tone","order":713,"unicode":"\u{1F64D}\u{1F3FF}"}]},{"group":1,"hexcode":"1F64D-200D-2642-FE0F","label":"man frowning","order":714,"tags":["frowning","gesture","man"],"unicode":"\u{1F64D}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F64D-1F3FB-200D-2642-FE0F","label":"man frowning: light skin tone","order":716,"unicode":"\u{1F64D}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FC-200D-2642-FE0F","label":"man frowning: medium-light skin tone","order":718,"unicode":"\u{1F64D}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FD-200D-2642-FE0F","label":"man frowning: medium skin tone","order":720,"unicode":"\u{1F64D}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FE-200D-2642-FE0F","label":"man frowning: medium-dark skin tone","order":722,"unicode":"\u{1F64D}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FF-200D-2642-FE0F","label":"man frowning: dark skin tone","order":724,"unicode":"\u{1F64D}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F64D-200D-2640-FE0F","label":"woman frowning","order":726,"tags":["frowning","gesture","woman"],"unicode":"\u{1F64D}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F64D-1F3FB-200D-2640-FE0F","label":"woman frowning: light skin tone","order":728,"unicode":"\u{1F64D}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FC-200D-2640-FE0F","label":"woman frowning: medium-light skin tone","order":730,"unicode":"\u{1F64D}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FD-200D-2640-FE0F","label":"woman frowning: medium skin tone","order":732,"unicode":"\u{1F64D}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FE-200D-2640-FE0F","label":"woman frowning: medium-dark skin tone","order":734,"unicode":"\u{1F64D}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64D-1F3FF-200D-2640-FE0F","label":"woman frowning: dark skin tone","order":736,"unicode":"\u{1F64D}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F64E","label":"person pouting","order":738,"tags":["gesture","pouting"],"unicode":"\u{1F64E}","skins":[{"group":1,"hexcode":"1F64E-1F3FB","label":"person pouting: light skin tone","order":739,"unicode":"\u{1F64E}\u{1F3FB}"},{"group":1,"hexcode":"1F64E-1F3FC","label":"person pouting: medium-light skin tone","order":740,"unicode":"\u{1F64E}\u{1F3FC}"},{"group":1,"hexcode":"1F64E-1F3FD","label":"person pouting: medium skin tone","order":741,"unicode":"\u{1F64E}\u{1F3FD}"},{"group":1,"hexcode":"1F64E-1F3FE","label":"person pouting: medium-dark skin tone","order":742,"unicode":"\u{1F64E}\u{1F3FE}"},{"group":1,"hexcode":"1F64E-1F3FF","label":"person pouting: dark skin tone","order":743,"unicode":"\u{1F64E}\u{1F3FF}"}]},{"group":1,"hexcode":"1F64E-200D-2642-FE0F","label":"man pouting","order":744,"tags":["gesture","man","pouting"],"unicode":"\u{1F64E}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F64E-1F3FB-200D-2642-FE0F","label":"man pouting: light skin tone","order":746,"unicode":"\u{1F64E}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FC-200D-2642-FE0F","label":"man pouting: medium-light skin tone","order":748,"unicode":"\u{1F64E}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FD-200D-2642-FE0F","label":"man pouting: medium skin tone","order":750,"unicode":"\u{1F64E}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FE-200D-2642-FE0F","label":"man pouting: medium-dark skin tone","order":752,"unicode":"\u{1F64E}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FF-200D-2642-FE0F","label":"man pouting: dark skin tone","order":754,"unicode":"\u{1F64E}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F64E-200D-2640-FE0F","label":"woman pouting","order":756,"tags":["gesture","pouting","woman"],"unicode":"\u{1F64E}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F64E-1F3FB-200D-2640-FE0F","label":"woman pouting: light skin tone","order":758,"unicode":"\u{1F64E}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FC-200D-2640-FE0F","label":"woman pouting: medium-light skin tone","order":760,"unicode":"\u{1F64E}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FD-200D-2640-FE0F","label":"woman pouting: medium skin tone","order":762,"unicode":"\u{1F64E}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FE-200D-2640-FE0F","label":"woman pouting: medium-dark skin tone","order":764,"unicode":"\u{1F64E}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64E-1F3FF-200D-2640-FE0F","label":"woman pouting: dark skin tone","order":766,"unicode":"\u{1F64E}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F645","label":"person gesturing NO","order":768,"tags":["forbidden","gesture","hand","person gesturing no","prohibited"],"unicode":"\u{1F645}","skins":[{"group":1,"hexcode":"1F645-1F3FB","label":"person gesturing NO: light skin tone","order":769,"unicode":"\u{1F645}\u{1F3FB}"},{"group":1,"hexcode":"1F645-1F3FC","label":"person gesturing NO: medium-light skin tone","order":770,"unicode":"\u{1F645}\u{1F3FC}"},{"group":1,"hexcode":"1F645-1F3FD","label":"person gesturing NO: medium skin tone","order":771,"unicode":"\u{1F645}\u{1F3FD}"},{"group":1,"hexcode":"1F645-1F3FE","label":"person gesturing NO: medium-dark skin tone","order":772,"unicode":"\u{1F645}\u{1F3FE}"},{"group":1,"hexcode":"1F645-1F3FF","label":"person gesturing NO: dark skin tone","order":773,"unicode":"\u{1F645}\u{1F3FF}"}]},{"group":1,"hexcode":"1F645-200D-2642-FE0F","label":"man gesturing NO","order":774,"tags":["forbidden","gesture","hand","man","man gesturing no","prohibited"],"unicode":"\u{1F645}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F645-1F3FB-200D-2642-FE0F","label":"man gesturing NO: light skin tone","order":776,"unicode":"\u{1F645}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F645-1F3FC-200D-2642-FE0F","label":"man gesturing NO: medium-light skin tone","order":778,"unicode":"\u{1F645}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F645-1F3FD-200D-2642-FE0F","label":"man gesturing NO: medium skin tone","order":780,"unicode":"\u{1F645}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F645-1F3FE-200D-2642-FE0F","label":"man gesturing NO: medium-dark skin tone","order":782,"unicode":"\u{1F645}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F645-1F3FF-200D-2642-FE0F","label":"man gesturing NO: dark skin tone","order":784,"unicode":"\u{1F645}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F645-200D-2640-FE0F","label":"woman gesturing NO","order":786,"tags":["forbidden","gesture","hand","prohibited","woman","woman gesturing no"],"unicode":"\u{1F645}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F645-1F3FB-200D-2640-FE0F","label":"woman gesturing NO: light skin tone","order":788,"unicode":"\u{1F645}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F645-1F3FC-200D-2640-FE0F","label":"woman gesturing NO: medium-light skin tone","order":790,"unicode":"\u{1F645}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F645-1F3FD-200D-2640-FE0F","label":"woman gesturing NO: medium skin tone","order":792,"unicode":"\u{1F645}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F645-1F3FE-200D-2640-FE0F","label":"woman gesturing NO: medium-dark skin tone","order":794,"unicode":"\u{1F645}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F645-1F3FF-200D-2640-FE0F","label":"woman gesturing NO: dark skin tone","order":796,"unicode":"\u{1F645}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F646","label":"person gesturing OK","order":798,"tags":["gesture","hand","ok","person gesturing ok"],"unicode":"\u{1F646}","skins":[{"group":1,"hexcode":"1F646-1F3FB","label":"person gesturing OK: light skin tone","order":799,"unicode":"\u{1F646}\u{1F3FB}"},{"group":1,"hexcode":"1F646-1F3FC","label":"person gesturing OK: medium-light skin tone","order":800,"unicode":"\u{1F646}\u{1F3FC}"},{"group":1,"hexcode":"1F646-1F3FD","label":"person gesturing OK: medium skin tone","order":801,"unicode":"\u{1F646}\u{1F3FD}"},{"group":1,"hexcode":"1F646-1F3FE","label":"person gesturing OK: medium-dark skin tone","order":802,"unicode":"\u{1F646}\u{1F3FE}"},{"group":1,"hexcode":"1F646-1F3FF","label":"person gesturing OK: dark skin tone","order":803,"unicode":"\u{1F646}\u{1F3FF}"}]},{"group":1,"hexcode":"1F646-200D-2642-FE0F","label":"man gesturing OK","order":804,"tags":["gesture","hand","man","man gesturing ok","ok"],"unicode":"\u{1F646}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F646-1F3FB-200D-2642-FE0F","label":"man gesturing OK: light skin tone","order":806,"unicode":"\u{1F646}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F646-1F3FC-200D-2642-FE0F","label":"man gesturing OK: medium-light skin tone","order":808,"unicode":"\u{1F646}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F646-1F3FD-200D-2642-FE0F","label":"man gesturing OK: medium skin tone","order":810,"unicode":"\u{1F646}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F646-1F3FE-200D-2642-FE0F","label":"man gesturing OK: medium-dark skin tone","order":812,"unicode":"\u{1F646}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F646-1F3FF-200D-2642-FE0F","label":"man gesturing OK: dark skin tone","order":814,"unicode":"\u{1F646}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F646-200D-2640-FE0F","label":"woman gesturing OK","order":816,"tags":["gesture","hand","ok","woman","woman gesturing ok"],"unicode":"\u{1F646}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F646-1F3FB-200D-2640-FE0F","label":"woman gesturing OK: light skin tone","order":818,"unicode":"\u{1F646}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F646-1F3FC-200D-2640-FE0F","label":"woman gesturing OK: medium-light skin tone","order":820,"unicode":"\u{1F646}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F646-1F3FD-200D-2640-FE0F","label":"woman gesturing OK: medium skin tone","order":822,"unicode":"\u{1F646}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F646-1F3FE-200D-2640-FE0F","label":"woman gesturing OK: medium-dark skin tone","order":824,"unicode":"\u{1F646}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F646-1F3FF-200D-2640-FE0F","label":"woman gesturing OK: dark skin tone","order":826,"unicode":"\u{1F646}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F481","label":"person tipping hand","order":828,"tags":["hand","help","information","sassy","tipping"],"unicode":"\u{1F481}","skins":[{"group":1,"hexcode":"1F481-1F3FB","label":"person tipping hand: light skin tone","order":829,"unicode":"\u{1F481}\u{1F3FB}"},{"group":1,"hexcode":"1F481-1F3FC","label":"person tipping hand: medium-light skin tone","order":830,"unicode":"\u{1F481}\u{1F3FC}"},{"group":1,"hexcode":"1F481-1F3FD","label":"person tipping hand: medium skin tone","order":831,"unicode":"\u{1F481}\u{1F3FD}"},{"group":1,"hexcode":"1F481-1F3FE","label":"person tipping hand: medium-dark skin tone","order":832,"unicode":"\u{1F481}\u{1F3FE}"},{"group":1,"hexcode":"1F481-1F3FF","label":"person tipping hand: dark skin tone","order":833,"unicode":"\u{1F481}\u{1F3FF}"}]},{"group":1,"hexcode":"1F481-200D-2642-FE0F","label":"man tipping hand","order":834,"tags":["man","sassy","tipping hand"],"unicode":"\u{1F481}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F481-1F3FB-200D-2642-FE0F","label":"man tipping hand: light skin tone","order":836,"unicode":"\u{1F481}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F481-1F3FC-200D-2642-FE0F","label":"man tipping hand: medium-light skin tone","order":838,"unicode":"\u{1F481}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F481-1F3FD-200D-2642-FE0F","label":"man tipping hand: medium skin tone","order":840,"unicode":"\u{1F481}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F481-1F3FE-200D-2642-FE0F","label":"man tipping hand: medium-dark skin tone","order":842,"unicode":"\u{1F481}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F481-1F3FF-200D-2642-FE0F","label":"man tipping hand: dark skin tone","order":844,"unicode":"\u{1F481}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F481-200D-2640-FE0F","label":"woman tipping hand","order":846,"tags":["sassy","tipping hand","woman"],"unicode":"\u{1F481}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F481-1F3FB-200D-2640-FE0F","label":"woman tipping hand: light skin tone","order":848,"unicode":"\u{1F481}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F481-1F3FC-200D-2640-FE0F","label":"woman tipping hand: medium-light skin tone","order":850,"unicode":"\u{1F481}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F481-1F3FD-200D-2640-FE0F","label":"woman tipping hand: medium skin tone","order":852,"unicode":"\u{1F481}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F481-1F3FE-200D-2640-FE0F","label":"woman tipping hand: medium-dark skin tone","order":854,"unicode":"\u{1F481}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F481-1F3FF-200D-2640-FE0F","label":"woman tipping hand: dark skin tone","order":856,"unicode":"\u{1F481}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F64B","label":"person raising hand","order":858,"tags":["gesture","hand","happy","raised"],"unicode":"\u{1F64B}","skins":[{"group":1,"hexcode":"1F64B-1F3FB","label":"person raising hand: light skin tone","order":859,"unicode":"\u{1F64B}\u{1F3FB}"},{"group":1,"hexcode":"1F64B-1F3FC","label":"person raising hand: medium-light skin tone","order":860,"unicode":"\u{1F64B}\u{1F3FC}"},{"group":1,"hexcode":"1F64B-1F3FD","label":"person raising hand: medium skin tone","order":861,"unicode":"\u{1F64B}\u{1F3FD}"},{"group":1,"hexcode":"1F64B-1F3FE","label":"person raising hand: medium-dark skin tone","order":862,"unicode":"\u{1F64B}\u{1F3FE}"},{"group":1,"hexcode":"1F64B-1F3FF","label":"person raising hand: dark skin tone","order":863,"unicode":"\u{1F64B}\u{1F3FF}"}]},{"group":1,"hexcode":"1F64B-200D-2642-FE0F","label":"man raising hand","order":864,"tags":["gesture","man","raising hand"],"unicode":"\u{1F64B}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F64B-1F3FB-200D-2642-FE0F","label":"man raising hand: light skin tone","order":866,"unicode":"\u{1F64B}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FC-200D-2642-FE0F","label":"man raising hand: medium-light skin tone","order":868,"unicode":"\u{1F64B}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FD-200D-2642-FE0F","label":"man raising hand: medium skin tone","order":870,"unicode":"\u{1F64B}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FE-200D-2642-FE0F","label":"man raising hand: medium-dark skin tone","order":872,"unicode":"\u{1F64B}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FF-200D-2642-FE0F","label":"man raising hand: dark skin tone","order":874,"unicode":"\u{1F64B}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F64B-200D-2640-FE0F","label":"woman raising hand","order":876,"tags":["gesture","raising hand","woman"],"unicode":"\u{1F64B}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F64B-1F3FB-200D-2640-FE0F","label":"woman raising hand: light skin tone","order":878,"unicode":"\u{1F64B}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FC-200D-2640-FE0F","label":"woman raising hand: medium-light skin tone","order":880,"unicode":"\u{1F64B}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FD-200D-2640-FE0F","label":"woman raising hand: medium skin tone","order":882,"unicode":"\u{1F64B}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FE-200D-2640-FE0F","label":"woman raising hand: medium-dark skin tone","order":884,"unicode":"\u{1F64B}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F64B-1F3FF-200D-2640-FE0F","label":"woman raising hand: dark skin tone","order":886,"unicode":"\u{1F64B}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9CF","label":"deaf person","order":888,"tags":["accessibility","deaf","ear","hear"],"unicode":"\u{1F9CF}","skins":[{"group":1,"hexcode":"1F9CF-1F3FB","label":"deaf person: light skin tone","order":889,"unicode":"\u{1F9CF}\u{1F3FB}"},{"group":1,"hexcode":"1F9CF-1F3FC","label":"deaf person: medium-light skin tone","order":890,"unicode":"\u{1F9CF}\u{1F3FC}"},{"group":1,"hexcode":"1F9CF-1F3FD","label":"deaf person: medium skin tone","order":891,"unicode":"\u{1F9CF}\u{1F3FD}"},{"group":1,"hexcode":"1F9CF-1F3FE","label":"deaf person: medium-dark skin tone","order":892,"unicode":"\u{1F9CF}\u{1F3FE}"},{"group":1,"hexcode":"1F9CF-1F3FF","label":"deaf person: dark skin tone","order":893,"unicode":"\u{1F9CF}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9CF-200D-2642-FE0F","label":"deaf man","order":894,"tags":["deaf","man"],"unicode":"\u{1F9CF}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9CF-1F3FB-200D-2642-FE0F","label":"deaf man: light skin tone","order":896,"unicode":"\u{1F9CF}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FC-200D-2642-FE0F","label":"deaf man: medium-light skin tone","order":898,"unicode":"\u{1F9CF}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FD-200D-2642-FE0F","label":"deaf man: medium skin tone","order":900,"unicode":"\u{1F9CF}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FE-200D-2642-FE0F","label":"deaf man: medium-dark skin tone","order":902,"unicode":"\u{1F9CF}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FF-200D-2642-FE0F","label":"deaf man: dark skin tone","order":904,"unicode":"\u{1F9CF}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9CF-200D-2640-FE0F","label":"deaf woman","order":906,"tags":["deaf","woman"],"unicode":"\u{1F9CF}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9CF-1F3FB-200D-2640-FE0F","label":"deaf woman: light skin tone","order":908,"unicode":"\u{1F9CF}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FC-200D-2640-FE0F","label":"deaf woman: medium-light skin tone","order":910,"unicode":"\u{1F9CF}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FD-200D-2640-FE0F","label":"deaf woman: medium skin tone","order":912,"unicode":"\u{1F9CF}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FE-200D-2640-FE0F","label":"deaf woman: medium-dark skin tone","order":914,"unicode":"\u{1F9CF}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CF-1F3FF-200D-2640-FE0F","label":"deaf woman: dark skin tone","order":916,"unicode":"\u{1F9CF}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F647","label":"person bowing","order":918,"tags":["apology","bow","gesture","sorry"],"unicode":"\u{1F647}","skins":[{"group":1,"hexcode":"1F647-1F3FB","label":"person bowing: light skin tone","order":919,"unicode":"\u{1F647}\u{1F3FB}"},{"group":1,"hexcode":"1F647-1F3FC","label":"person bowing: medium-light skin tone","order":920,"unicode":"\u{1F647}\u{1F3FC}"},{"group":1,"hexcode":"1F647-1F3FD","label":"person bowing: medium skin tone","order":921,"unicode":"\u{1F647}\u{1F3FD}"},{"group":1,"hexcode":"1F647-1F3FE","label":"person bowing: medium-dark skin tone","order":922,"unicode":"\u{1F647}\u{1F3FE}"},{"group":1,"hexcode":"1F647-1F3FF","label":"person bowing: dark skin tone","order":923,"unicode":"\u{1F647}\u{1F3FF}"}]},{"group":1,"hexcode":"1F647-200D-2642-FE0F","label":"man bowing","order":924,"tags":["apology","bowing","favor","gesture","man","sorry"],"unicode":"\u{1F647}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F647-1F3FB-200D-2642-FE0F","label":"man bowing: light skin tone","order":926,"unicode":"\u{1F647}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F647-1F3FC-200D-2642-FE0F","label":"man bowing: medium-light skin tone","order":928,"unicode":"\u{1F647}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F647-1F3FD-200D-2642-FE0F","label":"man bowing: medium skin tone","order":930,"unicode":"\u{1F647}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F647-1F3FE-200D-2642-FE0F","label":"man bowing: medium-dark skin tone","order":932,"unicode":"\u{1F647}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F647-1F3FF-200D-2642-FE0F","label":"man bowing: dark skin tone","order":934,"unicode":"\u{1F647}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F647-200D-2640-FE0F","label":"woman bowing","order":936,"tags":["apology","bowing","favor","gesture","sorry","woman"],"unicode":"\u{1F647}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F647-1F3FB-200D-2640-FE0F","label":"woman bowing: light skin tone","order":938,"unicode":"\u{1F647}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F647-1F3FC-200D-2640-FE0F","label":"woman bowing: medium-light skin tone","order":940,"unicode":"\u{1F647}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F647-1F3FD-200D-2640-FE0F","label":"woman bowing: medium skin tone","order":942,"unicode":"\u{1F647}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F647-1F3FE-200D-2640-FE0F","label":"woman bowing: medium-dark skin tone","order":944,"unicode":"\u{1F647}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F647-1F3FF-200D-2640-FE0F","label":"woman bowing: dark skin tone","order":946,"unicode":"\u{1F647}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F926","label":"person facepalming","order":948,"tags":["disbelief","exasperation","face","palm"],"unicode":"\u{1F926}","skins":[{"group":1,"hexcode":"1F926-1F3FB","label":"person facepalming: light skin tone","order":949,"unicode":"\u{1F926}\u{1F3FB}"},{"group":1,"hexcode":"1F926-1F3FC","label":"person facepalming: medium-light skin tone","order":950,"unicode":"\u{1F926}\u{1F3FC}"},{"group":1,"hexcode":"1F926-1F3FD","label":"person facepalming: medium skin tone","order":951,"unicode":"\u{1F926}\u{1F3FD}"},{"group":1,"hexcode":"1F926-1F3FE","label":"person facepalming: medium-dark skin tone","order":952,"unicode":"\u{1F926}\u{1F3FE}"},{"group":1,"hexcode":"1F926-1F3FF","label":"person facepalming: dark skin tone","order":953,"unicode":"\u{1F926}\u{1F3FF}"}]},{"group":1,"hexcode":"1F926-200D-2642-FE0F","label":"man facepalming","order":954,"tags":["disbelief","exasperation","facepalm","man"],"unicode":"\u{1F926}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F926-1F3FB-200D-2642-FE0F","label":"man facepalming: light skin tone","order":956,"unicode":"\u{1F926}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F926-1F3FC-200D-2642-FE0F","label":"man facepalming: medium-light skin tone","order":958,"unicode":"\u{1F926}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F926-1F3FD-200D-2642-FE0F","label":"man facepalming: medium skin tone","order":960,"unicode":"\u{1F926}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F926-1F3FE-200D-2642-FE0F","label":"man facepalming: medium-dark skin tone","order":962,"unicode":"\u{1F926}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F926-1F3FF-200D-2642-FE0F","label":"man facepalming: dark skin tone","order":964,"unicode":"\u{1F926}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F926-200D-2640-FE0F","label":"woman facepalming","order":966,"tags":["disbelief","exasperation","facepalm","woman"],"unicode":"\u{1F926}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F926-1F3FB-200D-2640-FE0F","label":"woman facepalming: light skin tone","order":968,"unicode":"\u{1F926}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F926-1F3FC-200D-2640-FE0F","label":"woman facepalming: medium-light skin tone","order":970,"unicode":"\u{1F926}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F926-1F3FD-200D-2640-FE0F","label":"woman facepalming: medium skin tone","order":972,"unicode":"\u{1F926}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F926-1F3FE-200D-2640-FE0F","label":"woman facepalming: medium-dark skin tone","order":974,"unicode":"\u{1F926}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F926-1F3FF-200D-2640-FE0F","label":"woman facepalming: dark skin tone","order":976,"unicode":"\u{1F926}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F937","label":"person shrugging","order":978,"tags":["doubt","ignorance","indifference","shrug"],"unicode":"\u{1F937}","skins":[{"group":1,"hexcode":"1F937-1F3FB","label":"person shrugging: light skin tone","order":979,"unicode":"\u{1F937}\u{1F3FB}"},{"group":1,"hexcode":"1F937-1F3FC","label":"person shrugging: medium-light skin tone","order":980,"unicode":"\u{1F937}\u{1F3FC}"},{"group":1,"hexcode":"1F937-1F3FD","label":"person shrugging: medium skin tone","order":981,"unicode":"\u{1F937}\u{1F3FD}"},{"group":1,"hexcode":"1F937-1F3FE","label":"person shrugging: medium-dark skin tone","order":982,"unicode":"\u{1F937}\u{1F3FE}"},{"group":1,"hexcode":"1F937-1F3FF","label":"person shrugging: dark skin tone","order":983,"unicode":"\u{1F937}\u{1F3FF}"}]},{"group":1,"hexcode":"1F937-200D-2642-FE0F","label":"man shrugging","order":984,"tags":["doubt","ignorance","indifference","man","shrug"],"unicode":"\u{1F937}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F937-1F3FB-200D-2642-FE0F","label":"man shrugging: light skin tone","order":986,"unicode":"\u{1F937}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F937-1F3FC-200D-2642-FE0F","label":"man shrugging: medium-light skin tone","order":988,"unicode":"\u{1F937}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F937-1F3FD-200D-2642-FE0F","label":"man shrugging: medium skin tone","order":990,"unicode":"\u{1F937}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F937-1F3FE-200D-2642-FE0F","label":"man shrugging: medium-dark skin tone","order":992,"unicode":"\u{1F937}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F937-1F3FF-200D-2642-FE0F","label":"man shrugging: dark skin tone","order":994,"unicode":"\u{1F937}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F937-200D-2640-FE0F","label":"woman shrugging","order":996,"tags":["doubt","ignorance","indifference","shrug","woman"],"unicode":"\u{1F937}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F937-1F3FB-200D-2640-FE0F","label":"woman shrugging: light skin tone","order":998,"unicode":"\u{1F937}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F937-1F3FC-200D-2640-FE0F","label":"woman shrugging: medium-light skin tone","order":1000,"unicode":"\u{1F937}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F937-1F3FD-200D-2640-FE0F","label":"woman shrugging: medium skin tone","order":1002,"unicode":"\u{1F937}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F937-1F3FE-200D-2640-FE0F","label":"woman shrugging: medium-dark skin tone","order":1004,"unicode":"\u{1F937}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F937-1F3FF-200D-2640-FE0F","label":"woman shrugging: dark skin tone","order":1006,"unicode":"\u{1F937}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-2695-FE0F","label":"health worker","order":1008,"tags":["doctor","healthcare","nurse","therapist"],"unicode":"\u{1F9D1}\u200D\u2695\uFE0F","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-2695-FE0F","label":"health worker: light skin tone","order":1010,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2695-FE0F","label":"health worker: medium-light skin tone","order":1012,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2695-FE0F","label":"health worker: medium skin tone","order":1014,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2695-FE0F","label":"health worker: medium-dark skin tone","order":1016,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2695-FE0F","label":"health worker: dark skin tone","order":1018,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2695\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-2695-FE0F","label":"man health worker","order":1020,"tags":["doctor","healthcare","man","nurse","therapist"],"unicode":"\u{1F468}\u200D\u2695\uFE0F","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-2695-FE0F","label":"man health worker: light skin tone","order":1022,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F468-1F3FC-200D-2695-FE0F","label":"man health worker: medium-light skin tone","order":1024,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F468-1F3FD-200D-2695-FE0F","label":"man health worker: medium skin tone","order":1026,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F468-1F3FE-200D-2695-FE0F","label":"man health worker: medium-dark skin tone","order":1028,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F468-1F3FF-200D-2695-FE0F","label":"man health worker: dark skin tone","order":1030,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2695\uFE0F"}]},{"group":1,"hexcode":"1F469-200D-2695-FE0F","label":"woman health worker","order":1032,"tags":["doctor","healthcare","nurse","therapist","woman"],"unicode":"\u{1F469}\u200D\u2695\uFE0F","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2695-FE0F","label":"woman health worker: light skin tone","order":1034,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F469-1F3FC-200D-2695-FE0F","label":"woman health worker: medium-light skin tone","order":1036,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F469-1F3FD-200D-2695-FE0F","label":"woman health worker: medium skin tone","order":1038,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F469-1F3FE-200D-2695-FE0F","label":"woman health worker: medium-dark skin tone","order":1040,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2695\uFE0F"},{"group":1,"hexcode":"1F469-1F3FF-200D-2695-FE0F","label":"woman health worker: dark skin tone","order":1042,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2695\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-1F393","label":"student","order":1044,"tags":["graduate"],"unicode":"\u{1F9D1}\u200D\u{1F393}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F393","label":"student: light skin tone","order":1045,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F393}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F393","label":"student: medium-light skin tone","order":1046,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F393}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F393","label":"student: medium skin tone","order":1047,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F393}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F393","label":"student: medium-dark skin tone","order":1048,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F393}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F393","label":"student: dark skin tone","order":1049,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F393}"}]},{"group":1,"hexcode":"1F468-200D-1F393","label":"man student","order":1050,"tags":["graduate","man","student"],"unicode":"\u{1F468}\u200D\u{1F393}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F393","label":"man student: light skin tone","order":1051,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F393}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F393","label":"man student: medium-light skin tone","order":1052,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F393}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F393","label":"man student: medium skin tone","order":1053,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F393}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F393","label":"man student: medium-dark skin tone","order":1054,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F393}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F393","label":"man student: dark skin tone","order":1055,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F393}"}]},{"group":1,"hexcode":"1F469-200D-1F393","label":"woman student","order":1056,"tags":["graduate","student","woman"],"unicode":"\u{1F469}\u200D\u{1F393}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F393","label":"woman student: light skin tone","order":1057,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F393}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F393","label":"woman student: medium-light skin tone","order":1058,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F393}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F393","label":"woman student: medium skin tone","order":1059,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F393}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F393","label":"woman student: medium-dark skin tone","order":1060,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F393}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F393","label":"woman student: dark skin tone","order":1061,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F393}"}]},{"group":1,"hexcode":"1F9D1-200D-1F3EB","label":"teacher","order":1062,"tags":["instructor","lecturer","professor"],"unicode":"\u{1F9D1}\u200D\u{1F3EB}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F3EB","label":"teacher: light skin tone","order":1063,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F3EB","label":"teacher: medium-light skin tone","order":1064,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F3EB","label":"teacher: medium skin tone","order":1065,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F3EB","label":"teacher: medium-dark skin tone","order":1066,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F3EB","label":"teacher: dark skin tone","order":1067,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F3EB}"}]},{"group":1,"hexcode":"1F468-200D-1F3EB","label":"man teacher","order":1068,"tags":["instructor","lecturer","man","professor","teacher"],"unicode":"\u{1F468}\u200D\u{1F3EB}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F3EB","label":"man teacher: light skin tone","order":1069,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F3EB","label":"man teacher: medium-light skin tone","order":1070,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F3EB","label":"man teacher: medium skin tone","order":1071,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F3EB","label":"man teacher: medium-dark skin tone","order":1072,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F3EB","label":"man teacher: dark skin tone","order":1073,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F3EB}"}]},{"group":1,"hexcode":"1F469-200D-1F3EB","label":"woman teacher","order":1074,"tags":["instructor","lecturer","professor","teacher","woman"],"unicode":"\u{1F469}\u200D\u{1F3EB}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F3EB","label":"woman teacher: light skin tone","order":1075,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F3EB","label":"woman teacher: medium-light skin tone","order":1076,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F3EB","label":"woman teacher: medium skin tone","order":1077,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F3EB","label":"woman teacher: medium-dark skin tone","order":1078,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F3EB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F3EB","label":"woman teacher: dark skin tone","order":1079,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F3EB}"}]},{"group":1,"hexcode":"1F9D1-200D-2696-FE0F","label":"judge","order":1080,"tags":["justice","law","scales"],"unicode":"\u{1F9D1}\u200D\u2696\uFE0F","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-2696-FE0F","label":"judge: light skin tone","order":1082,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2696-FE0F","label":"judge: medium-light skin tone","order":1084,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2696-FE0F","label":"judge: medium skin tone","order":1086,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2696-FE0F","label":"judge: medium-dark skin tone","order":1088,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2696-FE0F","label":"judge: dark skin tone","order":1090,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2696\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-2696-FE0F","label":"man judge","order":1092,"tags":["judge","justice","law","man","scales"],"unicode":"\u{1F468}\u200D\u2696\uFE0F","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-2696-FE0F","label":"man judge: light skin tone","order":1094,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F468-1F3FC-200D-2696-FE0F","label":"man judge: medium-light skin tone","order":1096,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F468-1F3FD-200D-2696-FE0F","label":"man judge: medium skin tone","order":1098,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F468-1F3FE-200D-2696-FE0F","label":"man judge: medium-dark skin tone","order":1100,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F468-1F3FF-200D-2696-FE0F","label":"man judge: dark skin tone","order":1102,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2696\uFE0F"}]},{"group":1,"hexcode":"1F469-200D-2696-FE0F","label":"woman judge","order":1104,"tags":["judge","justice","law","scales","woman"],"unicode":"\u{1F469}\u200D\u2696\uFE0F","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2696-FE0F","label":"woman judge: light skin tone","order":1106,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F469-1F3FC-200D-2696-FE0F","label":"woman judge: medium-light skin tone","order":1108,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F469-1F3FD-200D-2696-FE0F","label":"woman judge: medium skin tone","order":1110,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F469-1F3FE-200D-2696-FE0F","label":"woman judge: medium-dark skin tone","order":1112,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2696\uFE0F"},{"group":1,"hexcode":"1F469-1F3FF-200D-2696-FE0F","label":"woman judge: dark skin tone","order":1114,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2696\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-1F33E","label":"farmer","order":1116,"tags":["gardener","rancher"],"unicode":"\u{1F9D1}\u200D\u{1F33E}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F33E","label":"farmer: light skin tone","order":1117,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F33E","label":"farmer: medium-light skin tone","order":1118,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F33E","label":"farmer: medium skin tone","order":1119,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F33E","label":"farmer: medium-dark skin tone","order":1120,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F33E","label":"farmer: dark skin tone","order":1121,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F33E}"}]},{"group":1,"hexcode":"1F468-200D-1F33E","label":"man farmer","order":1122,"tags":["farmer","gardener","man","rancher"],"unicode":"\u{1F468}\u200D\u{1F33E}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F33E","label":"man farmer: light skin tone","order":1123,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F33E","label":"man farmer: medium-light skin tone","order":1124,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F33E","label":"man farmer: medium skin tone","order":1125,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F33E","label":"man farmer: medium-dark skin tone","order":1126,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F33E","label":"man farmer: dark skin tone","order":1127,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F33E}"}]},{"group":1,"hexcode":"1F469-200D-1F33E","label":"woman farmer","order":1128,"tags":["farmer","gardener","rancher","woman"],"unicode":"\u{1F469}\u200D\u{1F33E}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F33E","label":"woman farmer: light skin tone","order":1129,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F33E","label":"woman farmer: medium-light skin tone","order":1130,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F33E","label":"woman farmer: medium skin tone","order":1131,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F33E","label":"woman farmer: medium-dark skin tone","order":1132,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F33E}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F33E","label":"woman farmer: dark skin tone","order":1133,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F33E}"}]},{"group":1,"hexcode":"1F9D1-200D-1F373","label":"cook","order":1134,"tags":["chef"],"unicode":"\u{1F9D1}\u200D\u{1F373}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F373","label":"cook: light skin tone","order":1135,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F373}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F373","label":"cook: medium-light skin tone","order":1136,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F373}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F373","label":"cook: medium skin tone","order":1137,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F373}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F373","label":"cook: medium-dark skin tone","order":1138,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F373}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F373","label":"cook: dark skin tone","order":1139,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F373}"}]},{"group":1,"hexcode":"1F468-200D-1F373","label":"man cook","order":1140,"tags":["chef","cook","man"],"unicode":"\u{1F468}\u200D\u{1F373}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F373","label":"man cook: light skin tone","order":1141,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F373}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F373","label":"man cook: medium-light skin tone","order":1142,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F373}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F373","label":"man cook: medium skin tone","order":1143,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F373}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F373","label":"man cook: medium-dark skin tone","order":1144,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F373}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F373","label":"man cook: dark skin tone","order":1145,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F373}"}]},{"group":1,"hexcode":"1F469-200D-1F373","label":"woman cook","order":1146,"tags":["chef","cook","woman"],"unicode":"\u{1F469}\u200D\u{1F373}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F373","label":"woman cook: light skin tone","order":1147,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F373}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F373","label":"woman cook: medium-light skin tone","order":1148,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F373}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F373","label":"woman cook: medium skin tone","order":1149,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F373}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F373","label":"woman cook: medium-dark skin tone","order":1150,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F373}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F373","label":"woman cook: dark skin tone","order":1151,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F373}"}]},{"group":1,"hexcode":"1F9D1-200D-1F527","label":"mechanic","order":1152,"tags":["electrician","plumber","tradesperson"],"unicode":"\u{1F9D1}\u200D\u{1F527}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F527","label":"mechanic: light skin tone","order":1153,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F527}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F527","label":"mechanic: medium-light skin tone","order":1154,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F527}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F527","label":"mechanic: medium skin tone","order":1155,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F527}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F527","label":"mechanic: medium-dark skin tone","order":1156,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F527}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F527","label":"mechanic: dark skin tone","order":1157,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F527}"}]},{"group":1,"hexcode":"1F468-200D-1F527","label":"man mechanic","order":1158,"tags":["electrician","man","mechanic","plumber","tradesperson"],"unicode":"\u{1F468}\u200D\u{1F527}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F527","label":"man mechanic: light skin tone","order":1159,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F527}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F527","label":"man mechanic: medium-light skin tone","order":1160,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F527}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F527","label":"man mechanic: medium skin tone","order":1161,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F527}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F527","label":"man mechanic: medium-dark skin tone","order":1162,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F527}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F527","label":"man mechanic: dark skin tone","order":1163,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F527}"}]},{"group":1,"hexcode":"1F469-200D-1F527","label":"woman mechanic","order":1164,"tags":["electrician","mechanic","plumber","tradesperson","woman"],"unicode":"\u{1F469}\u200D\u{1F527}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F527","label":"woman mechanic: light skin tone","order":1165,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F527}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F527","label":"woman mechanic: medium-light skin tone","order":1166,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F527}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F527","label":"woman mechanic: medium skin tone","order":1167,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F527}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F527","label":"woman mechanic: medium-dark skin tone","order":1168,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F527}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F527","label":"woman mechanic: dark skin tone","order":1169,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F527}"}]},{"group":1,"hexcode":"1F9D1-200D-1F3ED","label":"factory worker","order":1170,"tags":["assembly","factory","industrial","worker"],"unicode":"\u{1F9D1}\u200D\u{1F3ED}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F3ED","label":"factory worker: light skin tone","order":1171,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F3ED","label":"factory worker: medium-light skin tone","order":1172,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F3ED","label":"factory worker: medium skin tone","order":1173,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F3ED","label":"factory worker: medium-dark skin tone","order":1174,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F3ED","label":"factory worker: dark skin tone","order":1175,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F3ED}"}]},{"group":1,"hexcode":"1F468-200D-1F3ED","label":"man factory worker","order":1176,"tags":["assembly","factory","industrial","man","worker"],"unicode":"\u{1F468}\u200D\u{1F3ED}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F3ED","label":"man factory worker: light skin tone","order":1177,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F3ED","label":"man factory worker: medium-light skin tone","order":1178,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F3ED","label":"man factory worker: medium skin tone","order":1179,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F3ED","label":"man factory worker: medium-dark skin tone","order":1180,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F3ED","label":"man factory worker: dark skin tone","order":1181,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F3ED}"}]},{"group":1,"hexcode":"1F469-200D-1F3ED","label":"woman factory worker","order":1182,"tags":["assembly","factory","industrial","woman","worker"],"unicode":"\u{1F469}\u200D\u{1F3ED}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F3ED","label":"woman factory worker: light skin tone","order":1183,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F3ED","label":"woman factory worker: medium-light skin tone","order":1184,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F3ED","label":"woman factory worker: medium skin tone","order":1185,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F3ED","label":"woman factory worker: medium-dark skin tone","order":1186,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F3ED}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F3ED","label":"woman factory worker: dark skin tone","order":1187,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F3ED}"}]},{"group":1,"hexcode":"1F9D1-200D-1F4BC","label":"office worker","order":1188,"tags":["architect","business","manager","white-collar"],"unicode":"\u{1F9D1}\u200D\u{1F4BC}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F4BC","label":"office worker: light skin tone","order":1189,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F4BC","label":"office worker: medium-light skin tone","order":1190,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F4BC","label":"office worker: medium skin tone","order":1191,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F4BC","label":"office worker: medium-dark skin tone","order":1192,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F4BC","label":"office worker: dark skin tone","order":1193,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F4BC}"}]},{"group":1,"hexcode":"1F468-200D-1F4BC","label":"man office worker","order":1194,"tags":["architect","business","man","manager","white-collar"],"unicode":"\u{1F468}\u200D\u{1F4BC}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F4BC","label":"man office worker: light skin tone","order":1195,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F4BC","label":"man office worker: medium-light skin tone","order":1196,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F4BC","label":"man office worker: medium skin tone","order":1197,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F4BC","label":"man office worker: medium-dark skin tone","order":1198,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F4BC","label":"man office worker: dark skin tone","order":1199,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F4BC}"}]},{"group":1,"hexcode":"1F469-200D-1F4BC","label":"woman office worker","order":1200,"tags":["architect","business","manager","white-collar","woman"],"unicode":"\u{1F469}\u200D\u{1F4BC}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F4BC","label":"woman office worker: light skin tone","order":1201,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F4BC","label":"woman office worker: medium-light skin tone","order":1202,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F4BC","label":"woman office worker: medium skin tone","order":1203,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F4BC","label":"woman office worker: medium-dark skin tone","order":1204,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F4BC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F4BC","label":"woman office worker: dark skin tone","order":1205,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F4BC}"}]},{"group":1,"hexcode":"1F9D1-200D-1F52C","label":"scientist","order":1206,"tags":["biologist","chemist","engineer","physicist"],"unicode":"\u{1F9D1}\u200D\u{1F52C}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F52C","label":"scientist: light skin tone","order":1207,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F52C","label":"scientist: medium-light skin tone","order":1208,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F52C","label":"scientist: medium skin tone","order":1209,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F52C","label":"scientist: medium-dark skin tone","order":1210,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F52C","label":"scientist: dark skin tone","order":1211,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F52C}"}]},{"group":1,"hexcode":"1F468-200D-1F52C","label":"man scientist","order":1212,"tags":["biologist","chemist","engineer","man","physicist","scientist"],"unicode":"\u{1F468}\u200D\u{1F52C}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F52C","label":"man scientist: light skin tone","order":1213,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F52C","label":"man scientist: medium-light skin tone","order":1214,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F52C","label":"man scientist: medium skin tone","order":1215,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F52C","label":"man scientist: medium-dark skin tone","order":1216,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F52C","label":"man scientist: dark skin tone","order":1217,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F52C}"}]},{"group":1,"hexcode":"1F469-200D-1F52C","label":"woman scientist","order":1218,"tags":["biologist","chemist","engineer","physicist","scientist","woman"],"unicode":"\u{1F469}\u200D\u{1F52C}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F52C","label":"woman scientist: light skin tone","order":1219,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F52C","label":"woman scientist: medium-light skin tone","order":1220,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F52C","label":"woman scientist: medium skin tone","order":1221,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F52C","label":"woman scientist: medium-dark skin tone","order":1222,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F52C}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F52C","label":"woman scientist: dark skin tone","order":1223,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F52C}"}]},{"group":1,"hexcode":"1F9D1-200D-1F4BB","label":"technologist","order":1224,"tags":["coder","developer","inventor","software"],"unicode":"\u{1F9D1}\u200D\u{1F4BB}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F4BB","label":"technologist: light skin tone","order":1225,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F4BB","label":"technologist: medium-light skin tone","order":1226,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F4BB","label":"technologist: medium skin tone","order":1227,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F4BB","label":"technologist: medium-dark skin tone","order":1228,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F4BB","label":"technologist: dark skin tone","order":1229,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F4BB}"}]},{"group":1,"hexcode":"1F468-200D-1F4BB","label":"man technologist","order":1230,"tags":["coder","developer","inventor","man","software","technologist"],"unicode":"\u{1F468}\u200D\u{1F4BB}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F4BB","label":"man technologist: light skin tone","order":1231,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F4BB","label":"man technologist: medium-light skin tone","order":1232,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F4BB","label":"man technologist: medium skin tone","order":1233,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F4BB","label":"man technologist: medium-dark skin tone","order":1234,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F4BB","label":"man technologist: dark skin tone","order":1235,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F4BB}"}]},{"group":1,"hexcode":"1F469-200D-1F4BB","label":"woman technologist","order":1236,"tags":["coder","developer","inventor","software","technologist","woman"],"unicode":"\u{1F469}\u200D\u{1F4BB}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F4BB","label":"woman technologist: light skin tone","order":1237,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F4BB","label":"woman technologist: medium-light skin tone","order":1238,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F4BB","label":"woman technologist: medium skin tone","order":1239,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F4BB","label":"woman technologist: medium-dark skin tone","order":1240,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F4BB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F4BB","label":"woman technologist: dark skin tone","order":1241,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F4BB}"}]},{"group":1,"hexcode":"1F9D1-200D-1F3A4","label":"singer","order":1242,"tags":["actor","entertainer","rock","star"],"unicode":"\u{1F9D1}\u200D\u{1F3A4}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F3A4","label":"singer: light skin tone","order":1243,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F3A4","label":"singer: medium-light skin tone","order":1244,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F3A4","label":"singer: medium skin tone","order":1245,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F3A4","label":"singer: medium-dark skin tone","order":1246,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F3A4","label":"singer: dark skin tone","order":1247,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F3A4}"}]},{"group":1,"hexcode":"1F468-200D-1F3A4","label":"man singer","order":1248,"tags":["actor","entertainer","man","rock","singer","star"],"unicode":"\u{1F468}\u200D\u{1F3A4}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F3A4","label":"man singer: light skin tone","order":1249,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F3A4","label":"man singer: medium-light skin tone","order":1250,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F3A4","label":"man singer: medium skin tone","order":1251,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F3A4","label":"man singer: medium-dark skin tone","order":1252,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F3A4","label":"man singer: dark skin tone","order":1253,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F3A4}"}]},{"group":1,"hexcode":"1F469-200D-1F3A4","label":"woman singer","order":1254,"tags":["actor","entertainer","rock","singer","star","woman"],"unicode":"\u{1F469}\u200D\u{1F3A4}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F3A4","label":"woman singer: light skin tone","order":1255,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F3A4","label":"woman singer: medium-light skin tone","order":1256,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F3A4","label":"woman singer: medium skin tone","order":1257,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F3A4","label":"woman singer: medium-dark skin tone","order":1258,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F3A4}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F3A4","label":"woman singer: dark skin tone","order":1259,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F3A4}"}]},{"group":1,"hexcode":"1F9D1-200D-1F3A8","label":"artist","order":1260,"tags":["palette"],"unicode":"\u{1F9D1}\u200D\u{1F3A8}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F3A8","label":"artist: light skin tone","order":1261,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F3A8","label":"artist: medium-light skin tone","order":1262,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F3A8","label":"artist: medium skin tone","order":1263,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F3A8","label":"artist: medium-dark skin tone","order":1264,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F3A8","label":"artist: dark skin tone","order":1265,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F3A8}"}]},{"group":1,"hexcode":"1F468-200D-1F3A8","label":"man artist","order":1266,"tags":["artist","man","palette"],"unicode":"\u{1F468}\u200D\u{1F3A8}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F3A8","label":"man artist: light skin tone","order":1267,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F3A8","label":"man artist: medium-light skin tone","order":1268,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F3A8","label":"man artist: medium skin tone","order":1269,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F3A8","label":"man artist: medium-dark skin tone","order":1270,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F3A8","label":"man artist: dark skin tone","order":1271,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F3A8}"}]},{"group":1,"hexcode":"1F469-200D-1F3A8","label":"woman artist","order":1272,"tags":["artist","palette","woman"],"unicode":"\u{1F469}\u200D\u{1F3A8}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F3A8","label":"woman artist: light skin tone","order":1273,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F3A8","label":"woman artist: medium-light skin tone","order":1274,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F3A8","label":"woman artist: medium skin tone","order":1275,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F3A8","label":"woman artist: medium-dark skin tone","order":1276,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F3A8}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F3A8","label":"woman artist: dark skin tone","order":1277,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F3A8}"}]},{"group":1,"hexcode":"1F9D1-200D-2708-FE0F","label":"pilot","order":1278,"tags":["plane"],"unicode":"\u{1F9D1}\u200D\u2708\uFE0F","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-2708-FE0F","label":"pilot: light skin tone","order":1280,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2708-FE0F","label":"pilot: medium-light skin tone","order":1282,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2708-FE0F","label":"pilot: medium skin tone","order":1284,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2708-FE0F","label":"pilot: medium-dark skin tone","order":1286,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2708-FE0F","label":"pilot: dark skin tone","order":1288,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2708\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-2708-FE0F","label":"man pilot","order":1290,"tags":["man","pilot","plane"],"unicode":"\u{1F468}\u200D\u2708\uFE0F","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-2708-FE0F","label":"man pilot: light skin tone","order":1292,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F468-1F3FC-200D-2708-FE0F","label":"man pilot: medium-light skin tone","order":1294,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F468-1F3FD-200D-2708-FE0F","label":"man pilot: medium skin tone","order":1296,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F468-1F3FE-200D-2708-FE0F","label":"man pilot: medium-dark skin tone","order":1298,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F468-1F3FF-200D-2708-FE0F","label":"man pilot: dark skin tone","order":1300,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2708\uFE0F"}]},{"group":1,"hexcode":"1F469-200D-2708-FE0F","label":"woman pilot","order":1302,"tags":["pilot","plane","woman"],"unicode":"\u{1F469}\u200D\u2708\uFE0F","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2708-FE0F","label":"woman pilot: light skin tone","order":1304,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F469-1F3FC-200D-2708-FE0F","label":"woman pilot: medium-light skin tone","order":1306,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F469-1F3FD-200D-2708-FE0F","label":"woman pilot: medium skin tone","order":1308,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F469-1F3FE-200D-2708-FE0F","label":"woman pilot: medium-dark skin tone","order":1310,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2708\uFE0F"},{"group":1,"hexcode":"1F469-1F3FF-200D-2708-FE0F","label":"woman pilot: dark skin tone","order":1312,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2708\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-1F680","label":"astronaut","order":1314,"tags":["rocket"],"unicode":"\u{1F9D1}\u200D\u{1F680}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F680","label":"astronaut: light skin tone","order":1315,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F680}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F680","label":"astronaut: medium-light skin tone","order":1316,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F680}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F680","label":"astronaut: medium skin tone","order":1317,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F680}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F680","label":"astronaut: medium-dark skin tone","order":1318,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F680}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F680","label":"astronaut: dark skin tone","order":1319,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F680}"}]},{"group":1,"hexcode":"1F468-200D-1F680","label":"man astronaut","order":1320,"tags":["astronaut","man","rocket"],"unicode":"\u{1F468}\u200D\u{1F680}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F680","label":"man astronaut: light skin tone","order":1321,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F680}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F680","label":"man astronaut: medium-light skin tone","order":1322,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F680}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F680","label":"man astronaut: medium skin tone","order":1323,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F680}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F680","label":"man astronaut: medium-dark skin tone","order":1324,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F680}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F680","label":"man astronaut: dark skin tone","order":1325,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F680}"}]},{"group":1,"hexcode":"1F469-200D-1F680","label":"woman astronaut","order":1326,"tags":["astronaut","rocket","woman"],"unicode":"\u{1F469}\u200D\u{1F680}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F680","label":"woman astronaut: light skin tone","order":1327,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F680}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F680","label":"woman astronaut: medium-light skin tone","order":1328,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F680}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F680","label":"woman astronaut: medium skin tone","order":1329,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F680}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F680","label":"woman astronaut: medium-dark skin tone","order":1330,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F680}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F680","label":"woman astronaut: dark skin tone","order":1331,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F680}"}]},{"group":1,"hexcode":"1F9D1-200D-1F692","label":"firefighter","order":1332,"tags":["fire","firetruck"],"unicode":"\u{1F9D1}\u200D\u{1F692}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F692","label":"firefighter: light skin tone","order":1333,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F692}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F692","label":"firefighter: medium-light skin tone","order":1334,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F692}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F692","label":"firefighter: medium skin tone","order":1335,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F692}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F692","label":"firefighter: medium-dark skin tone","order":1336,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F692}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F692","label":"firefighter: dark skin tone","order":1337,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F692}"}]},{"group":1,"hexcode":"1F468-200D-1F692","label":"man firefighter","order":1338,"tags":["firefighter","firetruck","man"],"unicode":"\u{1F468}\u200D\u{1F692}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F692","label":"man firefighter: light skin tone","order":1339,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F692}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F692","label":"man firefighter: medium-light skin tone","order":1340,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F692}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F692","label":"man firefighter: medium skin tone","order":1341,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F692}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F692","label":"man firefighter: medium-dark skin tone","order":1342,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F692}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F692","label":"man firefighter: dark skin tone","order":1343,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F692}"}]},{"group":1,"hexcode":"1F469-200D-1F692","label":"woman firefighter","order":1344,"tags":["firefighter","firetruck","woman"],"unicode":"\u{1F469}\u200D\u{1F692}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F692","label":"woman firefighter: light skin tone","order":1345,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F692}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F692","label":"woman firefighter: medium-light skin tone","order":1346,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F692}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F692","label":"woman firefighter: medium skin tone","order":1347,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F692}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F692","label":"woman firefighter: medium-dark skin tone","order":1348,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F692}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F692","label":"woman firefighter: dark skin tone","order":1349,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F692}"}]},{"group":1,"hexcode":"1F46E","label":"police officer","order":1350,"tags":["cop","officer","police"],"unicode":"\u{1F46E}","skins":[{"group":1,"hexcode":"1F46E-1F3FB","label":"police officer: light skin tone","order":1351,"unicode":"\u{1F46E}\u{1F3FB}"},{"group":1,"hexcode":"1F46E-1F3FC","label":"police officer: medium-light skin tone","order":1352,"unicode":"\u{1F46E}\u{1F3FC}"},{"group":1,"hexcode":"1F46E-1F3FD","label":"police officer: medium skin tone","order":1353,"unicode":"\u{1F46E}\u{1F3FD}"},{"group":1,"hexcode":"1F46E-1F3FE","label":"police officer: medium-dark skin tone","order":1354,"unicode":"\u{1F46E}\u{1F3FE}"},{"group":1,"hexcode":"1F46E-1F3FF","label":"police officer: dark skin tone","order":1355,"unicode":"\u{1F46E}\u{1F3FF}"}]},{"group":1,"hexcode":"1F46E-200D-2642-FE0F","label":"man police officer","order":1356,"tags":["cop","man","officer","police"],"unicode":"\u{1F46E}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F46E-1F3FB-200D-2642-FE0F","label":"man police officer: light skin tone","order":1358,"unicode":"\u{1F46E}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FC-200D-2642-FE0F","label":"man police officer: medium-light skin tone","order":1360,"unicode":"\u{1F46E}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FD-200D-2642-FE0F","label":"man police officer: medium skin tone","order":1362,"unicode":"\u{1F46E}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FE-200D-2642-FE0F","label":"man police officer: medium-dark skin tone","order":1364,"unicode":"\u{1F46E}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FF-200D-2642-FE0F","label":"man police officer: dark skin tone","order":1366,"unicode":"\u{1F46E}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F46E-200D-2640-FE0F","label":"woman police officer","order":1368,"tags":["cop","officer","police","woman"],"unicode":"\u{1F46E}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F46E-1F3FB-200D-2640-FE0F","label":"woman police officer: light skin tone","order":1370,"unicode":"\u{1F46E}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FC-200D-2640-FE0F","label":"woman police officer: medium-light skin tone","order":1372,"unicode":"\u{1F46E}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FD-200D-2640-FE0F","label":"woman police officer: medium skin tone","order":1374,"unicode":"\u{1F46E}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FE-200D-2640-FE0F","label":"woman police officer: medium-dark skin tone","order":1376,"unicode":"\u{1F46E}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F46E-1F3FF-200D-2640-FE0F","label":"woman police officer: dark skin tone","order":1378,"unicode":"\u{1F46E}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F575","label":"detective","order":1381,"tags":["sleuth","spy"],"unicode":"\u{1F575}\uFE0F","skins":[{"group":1,"hexcode":"1F575-1F3FB","label":"detective: light skin tone","order":1382,"unicode":"\u{1F575}\u{1F3FB}"},{"group":1,"hexcode":"1F575-1F3FC","label":"detective: medium-light skin tone","order":1383,"unicode":"\u{1F575}\u{1F3FC}"},{"group":1,"hexcode":"1F575-1F3FD","label":"detective: medium skin tone","order":1384,"unicode":"\u{1F575}\u{1F3FD}"},{"group":1,"hexcode":"1F575-1F3FE","label":"detective: medium-dark skin tone","order":1385,"unicode":"\u{1F575}\u{1F3FE}"},{"group":1,"hexcode":"1F575-1F3FF","label":"detective: dark skin tone","order":1386,"unicode":"\u{1F575}\u{1F3FF}"}]},{"group":1,"hexcode":"1F575-FE0F-200D-2642-FE0F","label":"man detective","order":1387,"tags":["detective","man","sleuth","spy"],"unicode":"\u{1F575}\uFE0F\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F575-1F3FB-200D-2642-FE0F","label":"man detective: light skin tone","order":1391,"unicode":"\u{1F575}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F575-1F3FC-200D-2642-FE0F","label":"man detective: medium-light skin tone","order":1393,"unicode":"\u{1F575}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F575-1F3FD-200D-2642-FE0F","label":"man detective: medium skin tone","order":1395,"unicode":"\u{1F575}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F575-1F3FE-200D-2642-FE0F","label":"man detective: medium-dark skin tone","order":1397,"unicode":"\u{1F575}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F575-1F3FF-200D-2642-FE0F","label":"man detective: dark skin tone","order":1399,"unicode":"\u{1F575}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F575-FE0F-200D-2640-FE0F","label":"woman detective","order":1401,"tags":["detective","sleuth","spy","woman"],"unicode":"\u{1F575}\uFE0F\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F575-1F3FB-200D-2640-FE0F","label":"woman detective: light skin tone","order":1405,"unicode":"\u{1F575}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F575-1F3FC-200D-2640-FE0F","label":"woman detective: medium-light skin tone","order":1407,"unicode":"\u{1F575}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F575-1F3FD-200D-2640-FE0F","label":"woman detective: medium skin tone","order":1409,"unicode":"\u{1F575}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F575-1F3FE-200D-2640-FE0F","label":"woman detective: medium-dark skin tone","order":1411,"unicode":"\u{1F575}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F575-1F3FF-200D-2640-FE0F","label":"woman detective: dark skin tone","order":1413,"unicode":"\u{1F575}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F482","label":"guard","order":1415,"tags":["guard"],"unicode":"\u{1F482}","skins":[{"group":1,"hexcode":"1F482-1F3FB","label":"guard: light skin tone","order":1416,"unicode":"\u{1F482}\u{1F3FB}"},{"group":1,"hexcode":"1F482-1F3FC","label":"guard: medium-light skin tone","order":1417,"unicode":"\u{1F482}\u{1F3FC}"},{"group":1,"hexcode":"1F482-1F3FD","label":"guard: medium skin tone","order":1418,"unicode":"\u{1F482}\u{1F3FD}"},{"group":1,"hexcode":"1F482-1F3FE","label":"guard: medium-dark skin tone","order":1419,"unicode":"\u{1F482}\u{1F3FE}"},{"group":1,"hexcode":"1F482-1F3FF","label":"guard: dark skin tone","order":1420,"unicode":"\u{1F482}\u{1F3FF}"}]},{"group":1,"hexcode":"1F482-200D-2642-FE0F","label":"man guard","order":1421,"tags":["guard","man"],"unicode":"\u{1F482}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F482-1F3FB-200D-2642-FE0F","label":"man guard: light skin tone","order":1423,"unicode":"\u{1F482}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F482-1F3FC-200D-2642-FE0F","label":"man guard: medium-light skin tone","order":1425,"unicode":"\u{1F482}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F482-1F3FD-200D-2642-FE0F","label":"man guard: medium skin tone","order":1427,"unicode":"\u{1F482}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F482-1F3FE-200D-2642-FE0F","label":"man guard: medium-dark skin tone","order":1429,"unicode":"\u{1F482}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F482-1F3FF-200D-2642-FE0F","label":"man guard: dark skin tone","order":1431,"unicode":"\u{1F482}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F482-200D-2640-FE0F","label":"woman guard","order":1433,"tags":["guard","woman"],"unicode":"\u{1F482}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F482-1F3FB-200D-2640-FE0F","label":"woman guard: light skin tone","order":1435,"unicode":"\u{1F482}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F482-1F3FC-200D-2640-FE0F","label":"woman guard: medium-light skin tone","order":1437,"unicode":"\u{1F482}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F482-1F3FD-200D-2640-FE0F","label":"woman guard: medium skin tone","order":1439,"unicode":"\u{1F482}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F482-1F3FE-200D-2640-FE0F","label":"woman guard: medium-dark skin tone","order":1441,"unicode":"\u{1F482}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F482-1F3FF-200D-2640-FE0F","label":"woman guard: dark skin tone","order":1443,"unicode":"\u{1F482}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F977","label":"ninja","order":1445,"tags":["fighter","hidden","stealth"],"unicode":"\u{1F977}","skins":[{"group":1,"hexcode":"1F977-1F3FB","label":"ninja: light skin tone","order":1446,"unicode":"\u{1F977}\u{1F3FB}"},{"group":1,"hexcode":"1F977-1F3FC","label":"ninja: medium-light skin tone","order":1447,"unicode":"\u{1F977}\u{1F3FC}"},{"group":1,"hexcode":"1F977-1F3FD","label":"ninja: medium skin tone","order":1448,"unicode":"\u{1F977}\u{1F3FD}"},{"group":1,"hexcode":"1F977-1F3FE","label":"ninja: medium-dark skin tone","order":1449,"unicode":"\u{1F977}\u{1F3FE}"},{"group":1,"hexcode":"1F977-1F3FF","label":"ninja: dark skin tone","order":1450,"unicode":"\u{1F977}\u{1F3FF}"}]},{"group":1,"hexcode":"1F477","label":"construction worker","order":1451,"tags":["construction","hat","worker"],"unicode":"\u{1F477}","skins":[{"group":1,"hexcode":"1F477-1F3FB","label":"construction worker: light skin tone","order":1452,"unicode":"\u{1F477}\u{1F3FB}"},{"group":1,"hexcode":"1F477-1F3FC","label":"construction worker: medium-light skin tone","order":1453,"unicode":"\u{1F477}\u{1F3FC}"},{"group":1,"hexcode":"1F477-1F3FD","label":"construction worker: medium skin tone","order":1454,"unicode":"\u{1F477}\u{1F3FD}"},{"group":1,"hexcode":"1F477-1F3FE","label":"construction worker: medium-dark skin tone","order":1455,"unicode":"\u{1F477}\u{1F3FE}"},{"group":1,"hexcode":"1F477-1F3FF","label":"construction worker: dark skin tone","order":1456,"unicode":"\u{1F477}\u{1F3FF}"}]},{"group":1,"hexcode":"1F477-200D-2642-FE0F","label":"man construction worker","order":1457,"tags":["construction","man","worker"],"unicode":"\u{1F477}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F477-1F3FB-200D-2642-FE0F","label":"man construction worker: light skin tone","order":1459,"unicode":"\u{1F477}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F477-1F3FC-200D-2642-FE0F","label":"man construction worker: medium-light skin tone","order":1461,"unicode":"\u{1F477}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F477-1F3FD-200D-2642-FE0F","label":"man construction worker: medium skin tone","order":1463,"unicode":"\u{1F477}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F477-1F3FE-200D-2642-FE0F","label":"man construction worker: medium-dark skin tone","order":1465,"unicode":"\u{1F477}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F477-1F3FF-200D-2642-FE0F","label":"man construction worker: dark skin tone","order":1467,"unicode":"\u{1F477}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F477-200D-2640-FE0F","label":"woman construction worker","order":1469,"tags":["construction","woman","worker"],"unicode":"\u{1F477}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F477-1F3FB-200D-2640-FE0F","label":"woman construction worker: light skin tone","order":1471,"unicode":"\u{1F477}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F477-1F3FC-200D-2640-FE0F","label":"woman construction worker: medium-light skin tone","order":1473,"unicode":"\u{1F477}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F477-1F3FD-200D-2640-FE0F","label":"woman construction worker: medium skin tone","order":1475,"unicode":"\u{1F477}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F477-1F3FE-200D-2640-FE0F","label":"woman construction worker: medium-dark skin tone","order":1477,"unicode":"\u{1F477}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F477-1F3FF-200D-2640-FE0F","label":"woman construction worker: dark skin tone","order":1479,"unicode":"\u{1F477}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1FAC5","label":"person with crown","order":1481,"tags":["monarch","noble","regal","royalty"],"unicode":"\u{1FAC5}","skins":[{"group":1,"hexcode":"1FAC5-1F3FB","label":"person with crown: light skin tone","order":1482,"unicode":"\u{1FAC5}\u{1F3FB}"},{"group":1,"hexcode":"1FAC5-1F3FC","label":"person with crown: medium-light skin tone","order":1483,"unicode":"\u{1FAC5}\u{1F3FC}"},{"group":1,"hexcode":"1FAC5-1F3FD","label":"person with crown: medium skin tone","order":1484,"unicode":"\u{1FAC5}\u{1F3FD}"},{"group":1,"hexcode":"1FAC5-1F3FE","label":"person with crown: medium-dark skin tone","order":1485,"unicode":"\u{1FAC5}\u{1F3FE}"},{"group":1,"hexcode":"1FAC5-1F3FF","label":"person with crown: dark skin tone","order":1486,"unicode":"\u{1FAC5}\u{1F3FF}"}]},{"group":1,"hexcode":"1F934","label":"prince","order":1487,"tags":["prince"],"unicode":"\u{1F934}","skins":[{"group":1,"hexcode":"1F934-1F3FB","label":"prince: light skin tone","order":1488,"unicode":"\u{1F934}\u{1F3FB}"},{"group":1,"hexcode":"1F934-1F3FC","label":"prince: medium-light skin tone","order":1489,"unicode":"\u{1F934}\u{1F3FC}"},{"group":1,"hexcode":"1F934-1F3FD","label":"prince: medium skin tone","order":1490,"unicode":"\u{1F934}\u{1F3FD}"},{"group":1,"hexcode":"1F934-1F3FE","label":"prince: medium-dark skin tone","order":1491,"unicode":"\u{1F934}\u{1F3FE}"},{"group":1,"hexcode":"1F934-1F3FF","label":"prince: dark skin tone","order":1492,"unicode":"\u{1F934}\u{1F3FF}"}]},{"group":1,"hexcode":"1F478","label":"princess","order":1493,"tags":["fairy tale","fantasy"],"unicode":"\u{1F478}","skins":[{"group":1,"hexcode":"1F478-1F3FB","label":"princess: light skin tone","order":1494,"unicode":"\u{1F478}\u{1F3FB}"},{"group":1,"hexcode":"1F478-1F3FC","label":"princess: medium-light skin tone","order":1495,"unicode":"\u{1F478}\u{1F3FC}"},{"group":1,"hexcode":"1F478-1F3FD","label":"princess: medium skin tone","order":1496,"unicode":"\u{1F478}\u{1F3FD}"},{"group":1,"hexcode":"1F478-1F3FE","label":"princess: medium-dark skin tone","order":1497,"unicode":"\u{1F478}\u{1F3FE}"},{"group":1,"hexcode":"1F478-1F3FF","label":"princess: dark skin tone","order":1498,"unicode":"\u{1F478}\u{1F3FF}"}]},{"group":1,"hexcode":"1F473","label":"person wearing turban","order":1499,"tags":["turban"],"unicode":"\u{1F473}","skins":[{"group":1,"hexcode":"1F473-1F3FB","label":"person wearing turban: light skin tone","order":1500,"unicode":"\u{1F473}\u{1F3FB}"},{"group":1,"hexcode":"1F473-1F3FC","label":"person wearing turban: medium-light skin tone","order":1501,"unicode":"\u{1F473}\u{1F3FC}"},{"group":1,"hexcode":"1F473-1F3FD","label":"person wearing turban: medium skin tone","order":1502,"unicode":"\u{1F473}\u{1F3FD}"},{"group":1,"hexcode":"1F473-1F3FE","label":"person wearing turban: medium-dark skin tone","order":1503,"unicode":"\u{1F473}\u{1F3FE}"},{"group":1,"hexcode":"1F473-1F3FF","label":"person wearing turban: dark skin tone","order":1504,"unicode":"\u{1F473}\u{1F3FF}"}]},{"group":1,"hexcode":"1F473-200D-2642-FE0F","label":"man wearing turban","order":1505,"tags":["man","turban"],"unicode":"\u{1F473}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F473-1F3FB-200D-2642-FE0F","label":"man wearing turban: light skin tone","order":1507,"unicode":"\u{1F473}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F473-1F3FC-200D-2642-FE0F","label":"man wearing turban: medium-light skin tone","order":1509,"unicode":"\u{1F473}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F473-1F3FD-200D-2642-FE0F","label":"man wearing turban: medium skin tone","order":1511,"unicode":"\u{1F473}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F473-1F3FE-200D-2642-FE0F","label":"man wearing turban: medium-dark skin tone","order":1513,"unicode":"\u{1F473}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F473-1F3FF-200D-2642-FE0F","label":"man wearing turban: dark skin tone","order":1515,"unicode":"\u{1F473}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F473-200D-2640-FE0F","label":"woman wearing turban","order":1517,"tags":["turban","woman"],"unicode":"\u{1F473}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F473-1F3FB-200D-2640-FE0F","label":"woman wearing turban: light skin tone","order":1519,"unicode":"\u{1F473}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F473-1F3FC-200D-2640-FE0F","label":"woman wearing turban: medium-light skin tone","order":1521,"unicode":"\u{1F473}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F473-1F3FD-200D-2640-FE0F","label":"woman wearing turban: medium skin tone","order":1523,"unicode":"\u{1F473}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F473-1F3FE-200D-2640-FE0F","label":"woman wearing turban: medium-dark skin tone","order":1525,"unicode":"\u{1F473}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F473-1F3FF-200D-2640-FE0F","label":"woman wearing turban: dark skin tone","order":1527,"unicode":"\u{1F473}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F472","label":"person with skullcap","order":1529,"tags":["cap","gua pi mao","hat","person","skullcap"],"unicode":"\u{1F472}","skins":[{"group":1,"hexcode":"1F472-1F3FB","label":"person with skullcap: light skin tone","order":1530,"unicode":"\u{1F472}\u{1F3FB}"},{"group":1,"hexcode":"1F472-1F3FC","label":"person with skullcap: medium-light skin tone","order":1531,"unicode":"\u{1F472}\u{1F3FC}"},{"group":1,"hexcode":"1F472-1F3FD","label":"person with skullcap: medium skin tone","order":1532,"unicode":"\u{1F472}\u{1F3FD}"},{"group":1,"hexcode":"1F472-1F3FE","label":"person with skullcap: medium-dark skin tone","order":1533,"unicode":"\u{1F472}\u{1F3FE}"},{"group":1,"hexcode":"1F472-1F3FF","label":"person with skullcap: dark skin tone","order":1534,"unicode":"\u{1F472}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D5","label":"woman with headscarf","order":1535,"tags":["headscarf","hijab","mantilla","tichel"],"unicode":"\u{1F9D5}","skins":[{"group":1,"hexcode":"1F9D5-1F3FB","label":"woman with headscarf: light skin tone","order":1536,"unicode":"\u{1F9D5}\u{1F3FB}"},{"group":1,"hexcode":"1F9D5-1F3FC","label":"woman with headscarf: medium-light skin tone","order":1537,"unicode":"\u{1F9D5}\u{1F3FC}"},{"group":1,"hexcode":"1F9D5-1F3FD","label":"woman with headscarf: medium skin tone","order":1538,"unicode":"\u{1F9D5}\u{1F3FD}"},{"group":1,"hexcode":"1F9D5-1F3FE","label":"woman with headscarf: medium-dark skin tone","order":1539,"unicode":"\u{1F9D5}\u{1F3FE}"},{"group":1,"hexcode":"1F9D5-1F3FF","label":"woman with headscarf: dark skin tone","order":1540,"unicode":"\u{1F9D5}\u{1F3FF}"}]},{"group":1,"hexcode":"1F935","label":"person in tuxedo","order":1541,"tags":["groom","person","tuxedo"],"unicode":"\u{1F935}","skins":[{"group":1,"hexcode":"1F935-1F3FB","label":"person in tuxedo: light skin tone","order":1542,"unicode":"\u{1F935}\u{1F3FB}"},{"group":1,"hexcode":"1F935-1F3FC","label":"person in tuxedo: medium-light skin tone","order":1543,"unicode":"\u{1F935}\u{1F3FC}"},{"group":1,"hexcode":"1F935-1F3FD","label":"person in tuxedo: medium skin tone","order":1544,"unicode":"\u{1F935}\u{1F3FD}"},{"group":1,"hexcode":"1F935-1F3FE","label":"person in tuxedo: medium-dark skin tone","order":1545,"unicode":"\u{1F935}\u{1F3FE}"},{"group":1,"hexcode":"1F935-1F3FF","label":"person in tuxedo: dark skin tone","order":1546,"unicode":"\u{1F935}\u{1F3FF}"}]},{"group":1,"hexcode":"1F935-200D-2642-FE0F","label":"man in tuxedo","order":1547,"tags":["man","tuxedo"],"unicode":"\u{1F935}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F935-1F3FB-200D-2642-FE0F","label":"man in tuxedo: light skin tone","order":1549,"unicode":"\u{1F935}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F935-1F3FC-200D-2642-FE0F","label":"man in tuxedo: medium-light skin tone","order":1551,"unicode":"\u{1F935}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F935-1F3FD-200D-2642-FE0F","label":"man in tuxedo: medium skin tone","order":1553,"unicode":"\u{1F935}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F935-1F3FE-200D-2642-FE0F","label":"man in tuxedo: medium-dark skin tone","order":1555,"unicode":"\u{1F935}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F935-1F3FF-200D-2642-FE0F","label":"man in tuxedo: dark skin tone","order":1557,"unicode":"\u{1F935}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F935-200D-2640-FE0F","label":"woman in tuxedo","order":1559,"tags":["tuxedo","woman"],"unicode":"\u{1F935}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F935-1F3FB-200D-2640-FE0F","label":"woman in tuxedo: light skin tone","order":1561,"unicode":"\u{1F935}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F935-1F3FC-200D-2640-FE0F","label":"woman in tuxedo: medium-light skin tone","order":1563,"unicode":"\u{1F935}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F935-1F3FD-200D-2640-FE0F","label":"woman in tuxedo: medium skin tone","order":1565,"unicode":"\u{1F935}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F935-1F3FE-200D-2640-FE0F","label":"woman in tuxedo: medium-dark skin tone","order":1567,"unicode":"\u{1F935}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F935-1F3FF-200D-2640-FE0F","label":"woman in tuxedo: dark skin tone","order":1569,"unicode":"\u{1F935}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F470","label":"person with veil","order":1571,"tags":["bride","person","veil","wedding"],"unicode":"\u{1F470}","skins":[{"group":1,"hexcode":"1F470-1F3FB","label":"person with veil: light skin tone","order":1572,"unicode":"\u{1F470}\u{1F3FB}"},{"group":1,"hexcode":"1F470-1F3FC","label":"person with veil: medium-light skin tone","order":1573,"unicode":"\u{1F470}\u{1F3FC}"},{"group":1,"hexcode":"1F470-1F3FD","label":"person with veil: medium skin tone","order":1574,"unicode":"\u{1F470}\u{1F3FD}"},{"group":1,"hexcode":"1F470-1F3FE","label":"person with veil: medium-dark skin tone","order":1575,"unicode":"\u{1F470}\u{1F3FE}"},{"group":1,"hexcode":"1F470-1F3FF","label":"person with veil: dark skin tone","order":1576,"unicode":"\u{1F470}\u{1F3FF}"}]},{"group":1,"hexcode":"1F470-200D-2642-FE0F","label":"man with veil","order":1577,"tags":["man","veil"],"unicode":"\u{1F470}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F470-1F3FB-200D-2642-FE0F","label":"man with veil: light skin tone","order":1579,"unicode":"\u{1F470}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F470-1F3FC-200D-2642-FE0F","label":"man with veil: medium-light skin tone","order":1581,"unicode":"\u{1F470}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F470-1F3FD-200D-2642-FE0F","label":"man with veil: medium skin tone","order":1583,"unicode":"\u{1F470}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F470-1F3FE-200D-2642-FE0F","label":"man with veil: medium-dark skin tone","order":1585,"unicode":"\u{1F470}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F470-1F3FF-200D-2642-FE0F","label":"man with veil: dark skin tone","order":1587,"unicode":"\u{1F470}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F470-200D-2640-FE0F","label":"woman with veil","order":1589,"tags":["veil","woman"],"unicode":"\u{1F470}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F470-1F3FB-200D-2640-FE0F","label":"woman with veil: light skin tone","order":1591,"unicode":"\u{1F470}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F470-1F3FC-200D-2640-FE0F","label":"woman with veil: medium-light skin tone","order":1593,"unicode":"\u{1F470}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F470-1F3FD-200D-2640-FE0F","label":"woman with veil: medium skin tone","order":1595,"unicode":"\u{1F470}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F470-1F3FE-200D-2640-FE0F","label":"woman with veil: medium-dark skin tone","order":1597,"unicode":"\u{1F470}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F470-1F3FF-200D-2640-FE0F","label":"woman with veil: dark skin tone","order":1599,"unicode":"\u{1F470}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F930","label":"pregnant woman","order":1601,"tags":["pregnant","woman"],"unicode":"\u{1F930}","skins":[{"group":1,"hexcode":"1F930-1F3FB","label":"pregnant woman: light skin tone","order":1602,"unicode":"\u{1F930}\u{1F3FB}"},{"group":1,"hexcode":"1F930-1F3FC","label":"pregnant woman: medium-light skin tone","order":1603,"unicode":"\u{1F930}\u{1F3FC}"},{"group":1,"hexcode":"1F930-1F3FD","label":"pregnant woman: medium skin tone","order":1604,"unicode":"\u{1F930}\u{1F3FD}"},{"group":1,"hexcode":"1F930-1F3FE","label":"pregnant woman: medium-dark skin tone","order":1605,"unicode":"\u{1F930}\u{1F3FE}"},{"group":1,"hexcode":"1F930-1F3FF","label":"pregnant woman: dark skin tone","order":1606,"unicode":"\u{1F930}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAC3","label":"pregnant man","order":1607,"tags":["belly","bloated","full","pregnant"],"unicode":"\u{1FAC3}","skins":[{"group":1,"hexcode":"1FAC3-1F3FB","label":"pregnant man: light skin tone","order":1608,"unicode":"\u{1FAC3}\u{1F3FB}"},{"group":1,"hexcode":"1FAC3-1F3FC","label":"pregnant man: medium-light skin tone","order":1609,"unicode":"\u{1FAC3}\u{1F3FC}"},{"group":1,"hexcode":"1FAC3-1F3FD","label":"pregnant man: medium skin tone","order":1610,"unicode":"\u{1FAC3}\u{1F3FD}"},{"group":1,"hexcode":"1FAC3-1F3FE","label":"pregnant man: medium-dark skin tone","order":1611,"unicode":"\u{1FAC3}\u{1F3FE}"},{"group":1,"hexcode":"1FAC3-1F3FF","label":"pregnant man: dark skin tone","order":1612,"unicode":"\u{1FAC3}\u{1F3FF}"}]},{"group":1,"hexcode":"1FAC4","label":"pregnant person","order":1613,"tags":["belly","bloated","full","pregnant"],"unicode":"\u{1FAC4}","skins":[{"group":1,"hexcode":"1FAC4-1F3FB","label":"pregnant person: light skin tone","order":1614,"unicode":"\u{1FAC4}\u{1F3FB}"},{"group":1,"hexcode":"1FAC4-1F3FC","label":"pregnant person: medium-light skin tone","order":1615,"unicode":"\u{1FAC4}\u{1F3FC}"},{"group":1,"hexcode":"1FAC4-1F3FD","label":"pregnant person: medium skin tone","order":1616,"unicode":"\u{1FAC4}\u{1F3FD}"},{"group":1,"hexcode":"1FAC4-1F3FE","label":"pregnant person: medium-dark skin tone","order":1617,"unicode":"\u{1FAC4}\u{1F3FE}"},{"group":1,"hexcode":"1FAC4-1F3FF","label":"pregnant person: dark skin tone","order":1618,"unicode":"\u{1FAC4}\u{1F3FF}"}]},{"group":1,"hexcode":"1F931","label":"breast-feeding","order":1619,"tags":["baby","breast","nursing"],"unicode":"\u{1F931}","skins":[{"group":1,"hexcode":"1F931-1F3FB","label":"breast-feeding: light skin tone","order":1620,"unicode":"\u{1F931}\u{1F3FB}"},{"group":1,"hexcode":"1F931-1F3FC","label":"breast-feeding: medium-light skin tone","order":1621,"unicode":"\u{1F931}\u{1F3FC}"},{"group":1,"hexcode":"1F931-1F3FD","label":"breast-feeding: medium skin tone","order":1622,"unicode":"\u{1F931}\u{1F3FD}"},{"group":1,"hexcode":"1F931-1F3FE","label":"breast-feeding: medium-dark skin tone","order":1623,"unicode":"\u{1F931}\u{1F3FE}"},{"group":1,"hexcode":"1F931-1F3FF","label":"breast-feeding: dark skin tone","order":1624,"unicode":"\u{1F931}\u{1F3FF}"}]},{"group":1,"hexcode":"1F469-200D-1F37C","label":"woman feeding baby","order":1625,"tags":["baby","feeding","nursing","woman"],"unicode":"\u{1F469}\u200D\u{1F37C}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F37C","label":"woman feeding baby: light skin tone","order":1626,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F37C","label":"woman feeding baby: medium-light skin tone","order":1627,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F37C","label":"woman feeding baby: medium skin tone","order":1628,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F37C","label":"woman feeding baby: medium-dark skin tone","order":1629,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F37C","label":"woman feeding baby: dark skin tone","order":1630,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F37C}"}]},{"group":1,"hexcode":"1F468-200D-1F37C","label":"man feeding baby","order":1631,"tags":["baby","feeding","man","nursing"],"unicode":"\u{1F468}\u200D\u{1F37C}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F37C","label":"man feeding baby: light skin tone","order":1632,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F37C","label":"man feeding baby: medium-light skin tone","order":1633,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F37C","label":"man feeding baby: medium skin tone","order":1634,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F37C","label":"man feeding baby: medium-dark skin tone","order":1635,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F37C","label":"man feeding baby: dark skin tone","order":1636,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F37C}"}]},{"group":1,"hexcode":"1F9D1-200D-1F37C","label":"person feeding baby","order":1637,"tags":["baby","feeding","nursing","person"],"unicode":"\u{1F9D1}\u200D\u{1F37C}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F37C","label":"person feeding baby: light skin tone","order":1638,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F37C","label":"person feeding baby: medium-light skin tone","order":1639,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F37C","label":"person feeding baby: medium skin tone","order":1640,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F37C","label":"person feeding baby: medium-dark skin tone","order":1641,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F37C}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F37C","label":"person feeding baby: dark skin tone","order":1642,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F37C}"}]},{"group":1,"hexcode":"1F47C","label":"baby angel","order":1643,"tags":["angel","baby","face","fairy tale","fantasy"],"unicode":"\u{1F47C}","skins":[{"group":1,"hexcode":"1F47C-1F3FB","label":"baby angel: light skin tone","order":1644,"unicode":"\u{1F47C}\u{1F3FB}"},{"group":1,"hexcode":"1F47C-1F3FC","label":"baby angel: medium-light skin tone","order":1645,"unicode":"\u{1F47C}\u{1F3FC}"},{"group":1,"hexcode":"1F47C-1F3FD","label":"baby angel: medium skin tone","order":1646,"unicode":"\u{1F47C}\u{1F3FD}"},{"group":1,"hexcode":"1F47C-1F3FE","label":"baby angel: medium-dark skin tone","order":1647,"unicode":"\u{1F47C}\u{1F3FE}"},{"group":1,"hexcode":"1F47C-1F3FF","label":"baby angel: dark skin tone","order":1648,"unicode":"\u{1F47C}\u{1F3FF}"}]},{"group":1,"hexcode":"1F385","label":"Santa Claus","order":1649,"tags":["celebration","christmas","claus","father","santa"],"unicode":"\u{1F385}","skins":[{"group":1,"hexcode":"1F385-1F3FB","label":"Santa Claus: light skin tone","order":1650,"unicode":"\u{1F385}\u{1F3FB}"},{"group":1,"hexcode":"1F385-1F3FC","label":"Santa Claus: medium-light skin tone","order":1651,"unicode":"\u{1F385}\u{1F3FC}"},{"group":1,"hexcode":"1F385-1F3FD","label":"Santa Claus: medium skin tone","order":1652,"unicode":"\u{1F385}\u{1F3FD}"},{"group":1,"hexcode":"1F385-1F3FE","label":"Santa Claus: medium-dark skin tone","order":1653,"unicode":"\u{1F385}\u{1F3FE}"},{"group":1,"hexcode":"1F385-1F3FF","label":"Santa Claus: dark skin tone","order":1654,"unicode":"\u{1F385}\u{1F3FF}"}]},{"group":1,"hexcode":"1F936","label":"Mrs. Claus","order":1655,"tags":["celebration","christmas","claus","mother","mrs."],"unicode":"\u{1F936}","skins":[{"group":1,"hexcode":"1F936-1F3FB","label":"Mrs. Claus: light skin tone","order":1656,"unicode":"\u{1F936}\u{1F3FB}"},{"group":1,"hexcode":"1F936-1F3FC","label":"Mrs. Claus: medium-light skin tone","order":1657,"unicode":"\u{1F936}\u{1F3FC}"},{"group":1,"hexcode":"1F936-1F3FD","label":"Mrs. Claus: medium skin tone","order":1658,"unicode":"\u{1F936}\u{1F3FD}"},{"group":1,"hexcode":"1F936-1F3FE","label":"Mrs. Claus: medium-dark skin tone","order":1659,"unicode":"\u{1F936}\u{1F3FE}"},{"group":1,"hexcode":"1F936-1F3FF","label":"Mrs. Claus: dark skin tone","order":1660,"unicode":"\u{1F936}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D1-200D-1F384","label":"mx claus","order":1661,"tags":["christmas","claus"],"unicode":"\u{1F9D1}\u200D\u{1F384}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F384","label":"mx claus: light skin tone","order":1662,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F384}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F384","label":"mx claus: medium-light skin tone","order":1663,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F384}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F384","label":"mx claus: medium skin tone","order":1664,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F384}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F384","label":"mx claus: medium-dark skin tone","order":1665,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F384}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F384","label":"mx claus: dark skin tone","order":1666,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F384}"}]},{"group":1,"hexcode":"1F9B8","label":"superhero","order":1667,"tags":["good","hero","heroine","superpower"],"unicode":"\u{1F9B8}","skins":[{"group":1,"hexcode":"1F9B8-1F3FB","label":"superhero: light skin tone","order":1668,"unicode":"\u{1F9B8}\u{1F3FB}"},{"group":1,"hexcode":"1F9B8-1F3FC","label":"superhero: medium-light skin tone","order":1669,"unicode":"\u{1F9B8}\u{1F3FC}"},{"group":1,"hexcode":"1F9B8-1F3FD","label":"superhero: medium skin tone","order":1670,"unicode":"\u{1F9B8}\u{1F3FD}"},{"group":1,"hexcode":"1F9B8-1F3FE","label":"superhero: medium-dark skin tone","order":1671,"unicode":"\u{1F9B8}\u{1F3FE}"},{"group":1,"hexcode":"1F9B8-1F3FF","label":"superhero: dark skin tone","order":1672,"unicode":"\u{1F9B8}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9B8-200D-2642-FE0F","label":"man superhero","order":1673,"tags":["good","hero","man","superpower"],"unicode":"\u{1F9B8}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9B8-1F3FB-200D-2642-FE0F","label":"man superhero: light skin tone","order":1675,"unicode":"\u{1F9B8}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FC-200D-2642-FE0F","label":"man superhero: medium-light skin tone","order":1677,"unicode":"\u{1F9B8}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FD-200D-2642-FE0F","label":"man superhero: medium skin tone","order":1679,"unicode":"\u{1F9B8}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FE-200D-2642-FE0F","label":"man superhero: medium-dark skin tone","order":1681,"unicode":"\u{1F9B8}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FF-200D-2642-FE0F","label":"man superhero: dark skin tone","order":1683,"unicode":"\u{1F9B8}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9B8-200D-2640-FE0F","label":"woman superhero","order":1685,"tags":["good","hero","heroine","superpower","woman"],"unicode":"\u{1F9B8}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9B8-1F3FB-200D-2640-FE0F","label":"woman superhero: light skin tone","order":1687,"unicode":"\u{1F9B8}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FC-200D-2640-FE0F","label":"woman superhero: medium-light skin tone","order":1689,"unicode":"\u{1F9B8}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FD-200D-2640-FE0F","label":"woman superhero: medium skin tone","order":1691,"unicode":"\u{1F9B8}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FE-200D-2640-FE0F","label":"woman superhero: medium-dark skin tone","order":1693,"unicode":"\u{1F9B8}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B8-1F3FF-200D-2640-FE0F","label":"woman superhero: dark skin tone","order":1695,"unicode":"\u{1F9B8}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9B9","label":"supervillain","order":1697,"tags":["criminal","evil","superpower","villain"],"unicode":"\u{1F9B9}","skins":[{"group":1,"hexcode":"1F9B9-1F3FB","label":"supervillain: light skin tone","order":1698,"unicode":"\u{1F9B9}\u{1F3FB}"},{"group":1,"hexcode":"1F9B9-1F3FC","label":"supervillain: medium-light skin tone","order":1699,"unicode":"\u{1F9B9}\u{1F3FC}"},{"group":1,"hexcode":"1F9B9-1F3FD","label":"supervillain: medium skin tone","order":1700,"unicode":"\u{1F9B9}\u{1F3FD}"},{"group":1,"hexcode":"1F9B9-1F3FE","label":"supervillain: medium-dark skin tone","order":1701,"unicode":"\u{1F9B9}\u{1F3FE}"},{"group":1,"hexcode":"1F9B9-1F3FF","label":"supervillain: dark skin tone","order":1702,"unicode":"\u{1F9B9}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9B9-200D-2642-FE0F","label":"man supervillain","order":1703,"tags":["criminal","evil","man","superpower","villain"],"unicode":"\u{1F9B9}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9B9-1F3FB-200D-2642-FE0F","label":"man supervillain: light skin tone","order":1705,"unicode":"\u{1F9B9}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FC-200D-2642-FE0F","label":"man supervillain: medium-light skin tone","order":1707,"unicode":"\u{1F9B9}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FD-200D-2642-FE0F","label":"man supervillain: medium skin tone","order":1709,"unicode":"\u{1F9B9}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FE-200D-2642-FE0F","label":"man supervillain: medium-dark skin tone","order":1711,"unicode":"\u{1F9B9}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FF-200D-2642-FE0F","label":"man supervillain: dark skin tone","order":1713,"unicode":"\u{1F9B9}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9B9-200D-2640-FE0F","label":"woman supervillain","order":1715,"tags":["criminal","evil","superpower","villain","woman"],"unicode":"\u{1F9B9}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9B9-1F3FB-200D-2640-FE0F","label":"woman supervillain: light skin tone","order":1717,"unicode":"\u{1F9B9}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FC-200D-2640-FE0F","label":"woman supervillain: medium-light skin tone","order":1719,"unicode":"\u{1F9B9}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FD-200D-2640-FE0F","label":"woman supervillain: medium skin tone","order":1721,"unicode":"\u{1F9B9}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FE-200D-2640-FE0F","label":"woman supervillain: medium-dark skin tone","order":1723,"unicode":"\u{1F9B9}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9B9-1F3FF-200D-2640-FE0F","label":"woman supervillain: dark skin tone","order":1725,"unicode":"\u{1F9B9}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9D9","label":"mage","order":1727,"tags":["sorcerer","sorceress","witch","wizard"],"unicode":"\u{1F9D9}","skins":[{"group":1,"hexcode":"1F9D9-1F3FB","label":"mage: light skin tone","order":1728,"unicode":"\u{1F9D9}\u{1F3FB}"},{"group":1,"hexcode":"1F9D9-1F3FC","label":"mage: medium-light skin tone","order":1729,"unicode":"\u{1F9D9}\u{1F3FC}"},{"group":1,"hexcode":"1F9D9-1F3FD","label":"mage: medium skin tone","order":1730,"unicode":"\u{1F9D9}\u{1F3FD}"},{"group":1,"hexcode":"1F9D9-1F3FE","label":"mage: medium-dark skin tone","order":1731,"unicode":"\u{1F9D9}\u{1F3FE}"},{"group":1,"hexcode":"1F9D9-1F3FF","label":"mage: dark skin tone","order":1732,"unicode":"\u{1F9D9}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D9-200D-2642-FE0F","label":"man mage","order":1733,"tags":["sorcerer","wizard"],"unicode":"\u{1F9D9}\u200D\u2642\uFE0F","emoticon":":{>","skins":[{"group":1,"hexcode":"1F9D9-1F3FB-200D-2642-FE0F","label":"man mage: light skin tone","order":1735,"unicode":"\u{1F9D9}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FC-200D-2642-FE0F","label":"man mage: medium-light skin tone","order":1737,"unicode":"\u{1F9D9}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FD-200D-2642-FE0F","label":"man mage: medium skin tone","order":1739,"unicode":"\u{1F9D9}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FE-200D-2642-FE0F","label":"man mage: medium-dark skin tone","order":1741,"unicode":"\u{1F9D9}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FF-200D-2642-FE0F","label":"man mage: dark skin tone","order":1743,"unicode":"\u{1F9D9}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9D9-200D-2640-FE0F","label":"woman mage","order":1745,"tags":["sorceress","witch"],"unicode":"\u{1F9D9}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9D9-1F3FB-200D-2640-FE0F","label":"woman mage: light skin tone","order":1747,"unicode":"\u{1F9D9}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FC-200D-2640-FE0F","label":"woman mage: medium-light skin tone","order":1749,"unicode":"\u{1F9D9}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FD-200D-2640-FE0F","label":"woman mage: medium skin tone","order":1751,"unicode":"\u{1F9D9}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FE-200D-2640-FE0F","label":"woman mage: medium-dark skin tone","order":1753,"unicode":"\u{1F9D9}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D9-1F3FF-200D-2640-FE0F","label":"woman mage: dark skin tone","order":1755,"unicode":"\u{1F9D9}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9DA","label":"fairy","order":1757,"tags":["oberon","puck","titania"],"unicode":"\u{1F9DA}","skins":[{"group":1,"hexcode":"1F9DA-1F3FB","label":"fairy: light skin tone","order":1758,"unicode":"\u{1F9DA}\u{1F3FB}"},{"group":1,"hexcode":"1F9DA-1F3FC","label":"fairy: medium-light skin tone","order":1759,"unicode":"\u{1F9DA}\u{1F3FC}"},{"group":1,"hexcode":"1F9DA-1F3FD","label":"fairy: medium skin tone","order":1760,"unicode":"\u{1F9DA}\u{1F3FD}"},{"group":1,"hexcode":"1F9DA-1F3FE","label":"fairy: medium-dark skin tone","order":1761,"unicode":"\u{1F9DA}\u{1F3FE}"},{"group":1,"hexcode":"1F9DA-1F3FF","label":"fairy: dark skin tone","order":1762,"unicode":"\u{1F9DA}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9DA-200D-2642-FE0F","label":"man fairy","order":1763,"tags":["oberon","puck"],"unicode":"\u{1F9DA}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9DA-1F3FB-200D-2642-FE0F","label":"man fairy: light skin tone","order":1765,"unicode":"\u{1F9DA}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FC-200D-2642-FE0F","label":"man fairy: medium-light skin tone","order":1767,"unicode":"\u{1F9DA}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FD-200D-2642-FE0F","label":"man fairy: medium skin tone","order":1769,"unicode":"\u{1F9DA}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FE-200D-2642-FE0F","label":"man fairy: medium-dark skin tone","order":1771,"unicode":"\u{1F9DA}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FF-200D-2642-FE0F","label":"man fairy: dark skin tone","order":1773,"unicode":"\u{1F9DA}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9DA-200D-2640-FE0F","label":"woman fairy","order":1775,"tags":["titania"],"unicode":"\u{1F9DA}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9DA-1F3FB-200D-2640-FE0F","label":"woman fairy: light skin tone","order":1777,"unicode":"\u{1F9DA}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FC-200D-2640-FE0F","label":"woman fairy: medium-light skin tone","order":1779,"unicode":"\u{1F9DA}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FD-200D-2640-FE0F","label":"woman fairy: medium skin tone","order":1781,"unicode":"\u{1F9DA}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FE-200D-2640-FE0F","label":"woman fairy: medium-dark skin tone","order":1783,"unicode":"\u{1F9DA}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DA-1F3FF-200D-2640-FE0F","label":"woman fairy: dark skin tone","order":1785,"unicode":"\u{1F9DA}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9DB","label":"vampire","order":1787,"tags":["dracula","undead"],"unicode":"\u{1F9DB}","emoticon":":E","skins":[{"group":1,"hexcode":"1F9DB-1F3FB","label":"vampire: light skin tone","order":1788,"unicode":"\u{1F9DB}\u{1F3FB}"},{"group":1,"hexcode":"1F9DB-1F3FC","label":"vampire: medium-light skin tone","order":1789,"unicode":"\u{1F9DB}\u{1F3FC}"},{"group":1,"hexcode":"1F9DB-1F3FD","label":"vampire: medium skin tone","order":1790,"unicode":"\u{1F9DB}\u{1F3FD}"},{"group":1,"hexcode":"1F9DB-1F3FE","label":"vampire: medium-dark skin tone","order":1791,"unicode":"\u{1F9DB}\u{1F3FE}"},{"group":1,"hexcode":"1F9DB-1F3FF","label":"vampire: dark skin tone","order":1792,"unicode":"\u{1F9DB}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9DB-200D-2642-FE0F","label":"man vampire","order":1793,"tags":["dracula","undead"],"unicode":"\u{1F9DB}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9DB-1F3FB-200D-2642-FE0F","label":"man vampire: light skin tone","order":1795,"unicode":"\u{1F9DB}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FC-200D-2642-FE0F","label":"man vampire: medium-light skin tone","order":1797,"unicode":"\u{1F9DB}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FD-200D-2642-FE0F","label":"man vampire: medium skin tone","order":1799,"unicode":"\u{1F9DB}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FE-200D-2642-FE0F","label":"man vampire: medium-dark skin tone","order":1801,"unicode":"\u{1F9DB}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FF-200D-2642-FE0F","label":"man vampire: dark skin tone","order":1803,"unicode":"\u{1F9DB}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9DB-200D-2640-FE0F","label":"woman vampire","order":1805,"tags":["undead"],"unicode":"\u{1F9DB}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9DB-1F3FB-200D-2640-FE0F","label":"woman vampire: light skin tone","order":1807,"unicode":"\u{1F9DB}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FC-200D-2640-FE0F","label":"woman vampire: medium-light skin tone","order":1809,"unicode":"\u{1F9DB}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FD-200D-2640-FE0F","label":"woman vampire: medium skin tone","order":1811,"unicode":"\u{1F9DB}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FE-200D-2640-FE0F","label":"woman vampire: medium-dark skin tone","order":1813,"unicode":"\u{1F9DB}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DB-1F3FF-200D-2640-FE0F","label":"woman vampire: dark skin tone","order":1815,"unicode":"\u{1F9DB}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9DC","label":"merperson","order":1817,"tags":["mermaid","merman","merwoman"],"unicode":"\u{1F9DC}","skins":[{"group":1,"hexcode":"1F9DC-1F3FB","label":"merperson: light skin tone","order":1818,"unicode":"\u{1F9DC}\u{1F3FB}"},{"group":1,"hexcode":"1F9DC-1F3FC","label":"merperson: medium-light skin tone","order":1819,"unicode":"\u{1F9DC}\u{1F3FC}"},{"group":1,"hexcode":"1F9DC-1F3FD","label":"merperson: medium skin tone","order":1820,"unicode":"\u{1F9DC}\u{1F3FD}"},{"group":1,"hexcode":"1F9DC-1F3FE","label":"merperson: medium-dark skin tone","order":1821,"unicode":"\u{1F9DC}\u{1F3FE}"},{"group":1,"hexcode":"1F9DC-1F3FF","label":"merperson: dark skin tone","order":1822,"unicode":"\u{1F9DC}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9DC-200D-2642-FE0F","label":"merman","order":1823,"tags":["triton"],"unicode":"\u{1F9DC}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9DC-1F3FB-200D-2642-FE0F","label":"merman: light skin tone","order":1825,"unicode":"\u{1F9DC}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FC-200D-2642-FE0F","label":"merman: medium-light skin tone","order":1827,"unicode":"\u{1F9DC}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FD-200D-2642-FE0F","label":"merman: medium skin tone","order":1829,"unicode":"\u{1F9DC}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FE-200D-2642-FE0F","label":"merman: medium-dark skin tone","order":1831,"unicode":"\u{1F9DC}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FF-200D-2642-FE0F","label":"merman: dark skin tone","order":1833,"unicode":"\u{1F9DC}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9DC-200D-2640-FE0F","label":"mermaid","order":1835,"tags":["merwoman"],"unicode":"\u{1F9DC}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9DC-1F3FB-200D-2640-FE0F","label":"mermaid: light skin tone","order":1837,"unicode":"\u{1F9DC}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FC-200D-2640-FE0F","label":"mermaid: medium-light skin tone","order":1839,"unicode":"\u{1F9DC}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FD-200D-2640-FE0F","label":"mermaid: medium skin tone","order":1841,"unicode":"\u{1F9DC}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FE-200D-2640-FE0F","label":"mermaid: medium-dark skin tone","order":1843,"unicode":"\u{1F9DC}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DC-1F3FF-200D-2640-FE0F","label":"mermaid: dark skin tone","order":1845,"unicode":"\u{1F9DC}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9DD","label":"elf","order":1847,"tags":["magical"],"unicode":"\u{1F9DD}","skins":[{"group":1,"hexcode":"1F9DD-1F3FB","label":"elf: light skin tone","order":1848,"unicode":"\u{1F9DD}\u{1F3FB}"},{"group":1,"hexcode":"1F9DD-1F3FC","label":"elf: medium-light skin tone","order":1849,"unicode":"\u{1F9DD}\u{1F3FC}"},{"group":1,"hexcode":"1F9DD-1F3FD","label":"elf: medium skin tone","order":1850,"unicode":"\u{1F9DD}\u{1F3FD}"},{"group":1,"hexcode":"1F9DD-1F3FE","label":"elf: medium-dark skin tone","order":1851,"unicode":"\u{1F9DD}\u{1F3FE}"},{"group":1,"hexcode":"1F9DD-1F3FF","label":"elf: dark skin tone","order":1852,"unicode":"\u{1F9DD}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9DD-200D-2642-FE0F","label":"man elf","order":1853,"tags":["magical"],"unicode":"\u{1F9DD}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9DD-1F3FB-200D-2642-FE0F","label":"man elf: light skin tone","order":1855,"unicode":"\u{1F9DD}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FC-200D-2642-FE0F","label":"man elf: medium-light skin tone","order":1857,"unicode":"\u{1F9DD}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FD-200D-2642-FE0F","label":"man elf: medium skin tone","order":1859,"unicode":"\u{1F9DD}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FE-200D-2642-FE0F","label":"man elf: medium-dark skin tone","order":1861,"unicode":"\u{1F9DD}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FF-200D-2642-FE0F","label":"man elf: dark skin tone","order":1863,"unicode":"\u{1F9DD}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9DD-200D-2640-FE0F","label":"woman elf","order":1865,"tags":["magical"],"unicode":"\u{1F9DD}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9DD-1F3FB-200D-2640-FE0F","label":"woman elf: light skin tone","order":1867,"unicode":"\u{1F9DD}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FC-200D-2640-FE0F","label":"woman elf: medium-light skin tone","order":1869,"unicode":"\u{1F9DD}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FD-200D-2640-FE0F","label":"woman elf: medium skin tone","order":1871,"unicode":"\u{1F9DD}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FE-200D-2640-FE0F","label":"woman elf: medium-dark skin tone","order":1873,"unicode":"\u{1F9DD}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DD-1F3FF-200D-2640-FE0F","label":"woman elf: dark skin tone","order":1875,"unicode":"\u{1F9DD}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9DE","label":"genie","order":1877,"tags":["djinn"],"unicode":"\u{1F9DE}"},{"group":1,"hexcode":"1F9DE-200D-2642-FE0F","label":"man genie","order":1878,"tags":["djinn"],"unicode":"\u{1F9DE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DE-200D-2640-FE0F","label":"woman genie","order":1880,"tags":["djinn"],"unicode":"\u{1F9DE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9DF","label":"zombie","order":1882,"tags":["undead","walking dead"],"unicode":"\u{1F9DF}","emoticon":"8#"},{"group":1,"hexcode":"1F9DF-200D-2642-FE0F","label":"man zombie","order":1883,"tags":["undead","walking dead"],"unicode":"\u{1F9DF}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9DF-200D-2640-FE0F","label":"woman zombie","order":1885,"tags":["undead","walking dead"],"unicode":"\u{1F9DF}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CC","label":"troll","order":1887,"tags":["fairy tale","fantasy","monster"],"unicode":"\u{1F9CC}"},{"group":1,"hexcode":"1F486","label":"person getting massage","order":1888,"tags":["face","massage","salon"],"unicode":"\u{1F486}","skins":[{"group":1,"hexcode":"1F486-1F3FB","label":"person getting massage: light skin tone","order":1889,"unicode":"\u{1F486}\u{1F3FB}"},{"group":1,"hexcode":"1F486-1F3FC","label":"person getting massage: medium-light skin tone","order":1890,"unicode":"\u{1F486}\u{1F3FC}"},{"group":1,"hexcode":"1F486-1F3FD","label":"person getting massage: medium skin tone","order":1891,"unicode":"\u{1F486}\u{1F3FD}"},{"group":1,"hexcode":"1F486-1F3FE","label":"person getting massage: medium-dark skin tone","order":1892,"unicode":"\u{1F486}\u{1F3FE}"},{"group":1,"hexcode":"1F486-1F3FF","label":"person getting massage: dark skin tone","order":1893,"unicode":"\u{1F486}\u{1F3FF}"}]},{"group":1,"hexcode":"1F486-200D-2642-FE0F","label":"man getting massage","order":1894,"tags":["face","man","massage"],"unicode":"\u{1F486}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F486-1F3FB-200D-2642-FE0F","label":"man getting massage: light skin tone","order":1896,"unicode":"\u{1F486}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F486-1F3FC-200D-2642-FE0F","label":"man getting massage: medium-light skin tone","order":1898,"unicode":"\u{1F486}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F486-1F3FD-200D-2642-FE0F","label":"man getting massage: medium skin tone","order":1900,"unicode":"\u{1F486}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F486-1F3FE-200D-2642-FE0F","label":"man getting massage: medium-dark skin tone","order":1902,"unicode":"\u{1F486}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F486-1F3FF-200D-2642-FE0F","label":"man getting massage: dark skin tone","order":1904,"unicode":"\u{1F486}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F486-200D-2640-FE0F","label":"woman getting massage","order":1906,"tags":["face","massage","woman"],"unicode":"\u{1F486}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F486-1F3FB-200D-2640-FE0F","label":"woman getting massage: light skin tone","order":1908,"unicode":"\u{1F486}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F486-1F3FC-200D-2640-FE0F","label":"woman getting massage: medium-light skin tone","order":1910,"unicode":"\u{1F486}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F486-1F3FD-200D-2640-FE0F","label":"woman getting massage: medium skin tone","order":1912,"unicode":"\u{1F486}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F486-1F3FE-200D-2640-FE0F","label":"woman getting massage: medium-dark skin tone","order":1914,"unicode":"\u{1F486}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F486-1F3FF-200D-2640-FE0F","label":"woman getting massage: dark skin tone","order":1916,"unicode":"\u{1F486}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F487","label":"person getting haircut","order":1918,"tags":["barber","beauty","haircut","parlor"],"unicode":"\u{1F487}","skins":[{"group":1,"hexcode":"1F487-1F3FB","label":"person getting haircut: light skin tone","order":1919,"unicode":"\u{1F487}\u{1F3FB}"},{"group":1,"hexcode":"1F487-1F3FC","label":"person getting haircut: medium-light skin tone","order":1920,"unicode":"\u{1F487}\u{1F3FC}"},{"group":1,"hexcode":"1F487-1F3FD","label":"person getting haircut: medium skin tone","order":1921,"unicode":"\u{1F487}\u{1F3FD}"},{"group":1,"hexcode":"1F487-1F3FE","label":"person getting haircut: medium-dark skin tone","order":1922,"unicode":"\u{1F487}\u{1F3FE}"},{"group":1,"hexcode":"1F487-1F3FF","label":"person getting haircut: dark skin tone","order":1923,"unicode":"\u{1F487}\u{1F3FF}"}]},{"group":1,"hexcode":"1F487-200D-2642-FE0F","label":"man getting haircut","order":1924,"tags":["haircut","man"],"unicode":"\u{1F487}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F487-1F3FB-200D-2642-FE0F","label":"man getting haircut: light skin tone","order":1926,"unicode":"\u{1F487}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F487-1F3FC-200D-2642-FE0F","label":"man getting haircut: medium-light skin tone","order":1928,"unicode":"\u{1F487}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F487-1F3FD-200D-2642-FE0F","label":"man getting haircut: medium skin tone","order":1930,"unicode":"\u{1F487}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F487-1F3FE-200D-2642-FE0F","label":"man getting haircut: medium-dark skin tone","order":1932,"unicode":"\u{1F487}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F487-1F3FF-200D-2642-FE0F","label":"man getting haircut: dark skin tone","order":1934,"unicode":"\u{1F487}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F487-200D-2640-FE0F","label":"woman getting haircut","order":1936,"tags":["haircut","woman"],"unicode":"\u{1F487}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F487-1F3FB-200D-2640-FE0F","label":"woman getting haircut: light skin tone","order":1938,"unicode":"\u{1F487}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F487-1F3FC-200D-2640-FE0F","label":"woman getting haircut: medium-light skin tone","order":1940,"unicode":"\u{1F487}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F487-1F3FD-200D-2640-FE0F","label":"woman getting haircut: medium skin tone","order":1942,"unicode":"\u{1F487}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F487-1F3FE-200D-2640-FE0F","label":"woman getting haircut: medium-dark skin tone","order":1944,"unicode":"\u{1F487}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F487-1F3FF-200D-2640-FE0F","label":"woman getting haircut: dark skin tone","order":1946,"unicode":"\u{1F487}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F6B6","label":"person walking","order":1948,"tags":["hike","walk","walking"],"unicode":"\u{1F6B6}","skins":[{"group":1,"hexcode":"1F6B6-1F3FB","label":"person walking: light skin tone","order":1949,"unicode":"\u{1F6B6}\u{1F3FB}"},{"group":1,"hexcode":"1F6B6-1F3FC","label":"person walking: medium-light skin tone","order":1950,"unicode":"\u{1F6B6}\u{1F3FC}"},{"group":1,"hexcode":"1F6B6-1F3FD","label":"person walking: medium skin tone","order":1951,"unicode":"\u{1F6B6}\u{1F3FD}"},{"group":1,"hexcode":"1F6B6-1F3FE","label":"person walking: medium-dark skin tone","order":1952,"unicode":"\u{1F6B6}\u{1F3FE}"},{"group":1,"hexcode":"1F6B6-1F3FF","label":"person walking: dark skin tone","order":1953,"unicode":"\u{1F6B6}\u{1F3FF}"}]},{"group":1,"hexcode":"1F6B6-200D-2642-FE0F","label":"man walking","order":1954,"tags":["hike","man","walk"],"unicode":"\u{1F6B6}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F6B6-1F3FB-200D-2642-FE0F","label":"man walking: light skin tone","order":1956,"unicode":"\u{1F6B6}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FC-200D-2642-FE0F","label":"man walking: medium-light skin tone","order":1958,"unicode":"\u{1F6B6}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FD-200D-2642-FE0F","label":"man walking: medium skin tone","order":1960,"unicode":"\u{1F6B6}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FE-200D-2642-FE0F","label":"man walking: medium-dark skin tone","order":1962,"unicode":"\u{1F6B6}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FF-200D-2642-FE0F","label":"man walking: dark skin tone","order":1964,"unicode":"\u{1F6B6}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F6B6-200D-2640-FE0F","label":"woman walking","order":1966,"tags":["hike","walk","woman"],"unicode":"\u{1F6B6}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F6B6-1F3FB-200D-2640-FE0F","label":"woman walking: light skin tone","order":1968,"unicode":"\u{1F6B6}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FC-200D-2640-FE0F","label":"woman walking: medium-light skin tone","order":1970,"unicode":"\u{1F6B6}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FD-200D-2640-FE0F","label":"woman walking: medium skin tone","order":1972,"unicode":"\u{1F6B6}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FE-200D-2640-FE0F","label":"woman walking: medium-dark skin tone","order":1974,"unicode":"\u{1F6B6}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FF-200D-2640-FE0F","label":"woman walking: dark skin tone","order":1976,"unicode":"\u{1F6B6}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F6B6-200D-27A1-FE0F","label":"person walking facing right","order":1978,"tags":["hike","person walking","walk","walking"],"unicode":"\u{1F6B6}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F6B6-1F3FB-200D-27A1-FE0F","label":"person walking facing right","order":1980,"unicode":"\u{1F6B6}\u{1F3FB}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FC-200D-27A1-FE0F","label":"person walking facing right","order":1982,"unicode":"\u{1F6B6}\u{1F3FC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FD-200D-27A1-FE0F","label":"person walking facing right","order":1984,"unicode":"\u{1F6B6}\u{1F3FD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FE-200D-27A1-FE0F","label":"person walking facing right","order":1986,"unicode":"\u{1F6B6}\u{1F3FE}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FF-200D-27A1-FE0F","label":"person walking facing right","order":1988,"unicode":"\u{1F6B6}\u{1F3FF}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F6B6-200D-2640-FE0F-200D-27A1-FE0F","label":"woman walking facing right","order":1990,"tags":["hike","walk","woman","woman walking"],"unicode":"\u{1F6B6}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F6B6-1F3FB-200D-2640-FE0F-200D-27A1-FE0F","label":"woman walking facing right","order":1994,"unicode":"\u{1F6B6}\u{1F3FB}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FC-200D-2640-FE0F-200D-27A1-FE0F","label":"woman walking facing right","order":1998,"unicode":"\u{1F6B6}\u{1F3FC}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FD-200D-2640-FE0F-200D-27A1-FE0F","label":"woman walking facing right","order":2002,"unicode":"\u{1F6B6}\u{1F3FD}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FE-200D-2640-FE0F-200D-27A1-FE0F","label":"woman walking facing right","order":2006,"unicode":"\u{1F6B6}\u{1F3FE}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FF-200D-2640-FE0F-200D-27A1-FE0F","label":"woman walking facing right","order":2010,"unicode":"\u{1F6B6}\u{1F3FF}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F6B6-200D-2642-FE0F-200D-27A1-FE0F","label":"man walking facing right","order":2014,"tags":["hike","man","man walking","walk"],"unicode":"\u{1F6B6}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F6B6-1F3FB-200D-2642-FE0F-200D-27A1-FE0F","label":"man walking facing right","order":2018,"unicode":"\u{1F6B6}\u{1F3FB}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FC-200D-2642-FE0F-200D-27A1-FE0F","label":"man walking facing right","order":2022,"unicode":"\u{1F6B6}\u{1F3FC}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FD-200D-2642-FE0F-200D-27A1-FE0F","label":"man walking facing right","order":2026,"unicode":"\u{1F6B6}\u{1F3FD}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FE-200D-2642-FE0F-200D-27A1-FE0F","label":"man walking facing right","order":2030,"unicode":"\u{1F6B6}\u{1F3FE}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F6B6-1F3FF-200D-2642-FE0F-200D-27A1-FE0F","label":"man walking facing right","order":2034,"unicode":"\u{1F6B6}\u{1F3FF}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F9CD","label":"person standing","order":2038,"tags":["stand","standing"],"unicode":"\u{1F9CD}","skins":[{"group":1,"hexcode":"1F9CD-1F3FB","label":"person standing: light skin tone","order":2039,"unicode":"\u{1F9CD}\u{1F3FB}"},{"group":1,"hexcode":"1F9CD-1F3FC","label":"person standing: medium-light skin tone","order":2040,"unicode":"\u{1F9CD}\u{1F3FC}"},{"group":1,"hexcode":"1F9CD-1F3FD","label":"person standing: medium skin tone","order":2041,"unicode":"\u{1F9CD}\u{1F3FD}"},{"group":1,"hexcode":"1F9CD-1F3FE","label":"person standing: medium-dark skin tone","order":2042,"unicode":"\u{1F9CD}\u{1F3FE}"},{"group":1,"hexcode":"1F9CD-1F3FF","label":"person standing: dark skin tone","order":2043,"unicode":"\u{1F9CD}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9CD-200D-2642-FE0F","label":"man standing","order":2044,"tags":["man","standing"],"unicode":"\u{1F9CD}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9CD-1F3FB-200D-2642-FE0F","label":"man standing: light skin tone","order":2046,"unicode":"\u{1F9CD}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FC-200D-2642-FE0F","label":"man standing: medium-light skin tone","order":2048,"unicode":"\u{1F9CD}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FD-200D-2642-FE0F","label":"man standing: medium skin tone","order":2050,"unicode":"\u{1F9CD}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FE-200D-2642-FE0F","label":"man standing: medium-dark skin tone","order":2052,"unicode":"\u{1F9CD}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FF-200D-2642-FE0F","label":"man standing: dark skin tone","order":2054,"unicode":"\u{1F9CD}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9CD-200D-2640-FE0F","label":"woman standing","order":2056,"tags":["standing","woman"],"unicode":"\u{1F9CD}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9CD-1F3FB-200D-2640-FE0F","label":"woman standing: light skin tone","order":2058,"unicode":"\u{1F9CD}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FC-200D-2640-FE0F","label":"woman standing: medium-light skin tone","order":2060,"unicode":"\u{1F9CD}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FD-200D-2640-FE0F","label":"woman standing: medium skin tone","order":2062,"unicode":"\u{1F9CD}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FE-200D-2640-FE0F","label":"woman standing: medium-dark skin tone","order":2064,"unicode":"\u{1F9CD}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CD-1F3FF-200D-2640-FE0F","label":"woman standing: dark skin tone","order":2066,"unicode":"\u{1F9CD}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9CE","label":"person kneeling","order":2068,"tags":["kneel","kneeling"],"unicode":"\u{1F9CE}","skins":[{"group":1,"hexcode":"1F9CE-1F3FB","label":"person kneeling: light skin tone","order":2069,"unicode":"\u{1F9CE}\u{1F3FB}"},{"group":1,"hexcode":"1F9CE-1F3FC","label":"person kneeling: medium-light skin tone","order":2070,"unicode":"\u{1F9CE}\u{1F3FC}"},{"group":1,"hexcode":"1F9CE-1F3FD","label":"person kneeling: medium skin tone","order":2071,"unicode":"\u{1F9CE}\u{1F3FD}"},{"group":1,"hexcode":"1F9CE-1F3FE","label":"person kneeling: medium-dark skin tone","order":2072,"unicode":"\u{1F9CE}\u{1F3FE}"},{"group":1,"hexcode":"1F9CE-1F3FF","label":"person kneeling: dark skin tone","order":2073,"unicode":"\u{1F9CE}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9CE-200D-2642-FE0F","label":"man kneeling","order":2074,"tags":["kneeling","man"],"unicode":"\u{1F9CE}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9CE-1F3FB-200D-2642-FE0F","label":"man kneeling: light skin tone","order":2076,"unicode":"\u{1F9CE}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FC-200D-2642-FE0F","label":"man kneeling: medium-light skin tone","order":2078,"unicode":"\u{1F9CE}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FD-200D-2642-FE0F","label":"man kneeling: medium skin tone","order":2080,"unicode":"\u{1F9CE}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FE-200D-2642-FE0F","label":"man kneeling: medium-dark skin tone","order":2082,"unicode":"\u{1F9CE}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FF-200D-2642-FE0F","label":"man kneeling: dark skin tone","order":2084,"unicode":"\u{1F9CE}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9CE-200D-2640-FE0F","label":"woman kneeling","order":2086,"tags":["kneeling","woman"],"unicode":"\u{1F9CE}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9CE-1F3FB-200D-2640-FE0F","label":"woman kneeling: light skin tone","order":2088,"unicode":"\u{1F9CE}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FC-200D-2640-FE0F","label":"woman kneeling: medium-light skin tone","order":2090,"unicode":"\u{1F9CE}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FD-200D-2640-FE0F","label":"woman kneeling: medium skin tone","order":2092,"unicode":"\u{1F9CE}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FE-200D-2640-FE0F","label":"woman kneeling: medium-dark skin tone","order":2094,"unicode":"\u{1F9CE}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FF-200D-2640-FE0F","label":"woman kneeling: dark skin tone","order":2096,"unicode":"\u{1F9CE}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9CE-200D-27A1-FE0F","label":"person kneeling facing right","order":2098,"tags":["kneel","kneeling","person kneeling"],"unicode":"\u{1F9CE}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F9CE-1F3FB-200D-27A1-FE0F","label":"person kneeling facing right","order":2100,"unicode":"\u{1F9CE}\u{1F3FB}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FC-200D-27A1-FE0F","label":"person kneeling facing right","order":2102,"unicode":"\u{1F9CE}\u{1F3FC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FD-200D-27A1-FE0F","label":"person kneeling facing right","order":2104,"unicode":"\u{1F9CE}\u{1F3FD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FE-200D-27A1-FE0F","label":"person kneeling facing right","order":2106,"unicode":"\u{1F9CE}\u{1F3FE}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FF-200D-27A1-FE0F","label":"person kneeling facing right","order":2108,"unicode":"\u{1F9CE}\u{1F3FF}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F9CE-200D-2640-FE0F-200D-27A1-FE0F","label":"woman kneeling facing right","order":2110,"tags":["kneeling","woman"],"unicode":"\u{1F9CE}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F9CE-1F3FB-200D-2640-FE0F-200D-27A1-FE0F","label":"woman kneeling facing right","order":2114,"unicode":"\u{1F9CE}\u{1F3FB}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FC-200D-2640-FE0F-200D-27A1-FE0F","label":"woman kneeling facing right","order":2118,"unicode":"\u{1F9CE}\u{1F3FC}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FD-200D-2640-FE0F-200D-27A1-FE0F","label":"woman kneeling facing right","order":2122,"unicode":"\u{1F9CE}\u{1F3FD}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FE-200D-2640-FE0F-200D-27A1-FE0F","label":"woman kneeling facing right","order":2126,"unicode":"\u{1F9CE}\u{1F3FE}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FF-200D-2640-FE0F-200D-27A1-FE0F","label":"woman kneeling facing right","order":2130,"unicode":"\u{1F9CE}\u{1F3FF}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F9CE-200D-2642-FE0F-200D-27A1-FE0F","label":"man kneeling facing right","order":2134,"tags":["kneeling","man"],"unicode":"\u{1F9CE}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F9CE-1F3FB-200D-2642-FE0F-200D-27A1-FE0F","label":"man kneeling facing right","order":2138,"unicode":"\u{1F9CE}\u{1F3FB}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FC-200D-2642-FE0F-200D-27A1-FE0F","label":"man kneeling facing right","order":2142,"unicode":"\u{1F9CE}\u{1F3FC}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FD-200D-2642-FE0F-200D-27A1-FE0F","label":"man kneeling facing right","order":2146,"unicode":"\u{1F9CE}\u{1F3FD}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FE-200D-2642-FE0F-200D-27A1-FE0F","label":"man kneeling facing right","order":2150,"unicode":"\u{1F9CE}\u{1F3FE}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9CE-1F3FF-200D-2642-FE0F-200D-27A1-FE0F","label":"man kneeling facing right","order":2154,"unicode":"\u{1F9CE}\u{1F3FF}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-1F9AF","label":"person with white cane","order":2158,"tags":["accessibility","blind"],"unicode":"\u{1F9D1}\u200D\u{1F9AF}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9AF","label":"person with white cane: light skin tone","order":2159,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9AF","label":"person with white cane: medium-light skin tone","order":2160,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9AF","label":"person with white cane: medium skin tone","order":2161,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9AF","label":"person with white cane: medium-dark skin tone","order":2162,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9AF","label":"person with white cane: dark skin tone","order":2163,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9AF}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9AF-200D-27A1-FE0F","label":"person with white cane facing right","order":2164,"tags":["accessibility","blind","person with white cane"],"unicode":"\u{1F9D1}\u200D\u{1F9AF}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9AF-200D-27A1-FE0F","label":"person with white cane facing right","order":2166,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9AF-200D-27A1-FE0F","label":"person with white cane facing right","order":2168,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9AF-200D-27A1-FE0F","label":"person with white cane facing right","order":2170,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9AF-200D-27A1-FE0F","label":"person with white cane facing right","order":2172,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9AF-200D-27A1-FE0F","label":"person with white cane facing right","order":2174,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-1F9AF","label":"man with white cane","order":2176,"tags":["accessibility","blind","man"],"unicode":"\u{1F468}\u200D\u{1F9AF}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9AF","label":"man with white cane: light skin tone","order":2177,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9AF","label":"man with white cane: medium-light skin tone","order":2178,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9AF","label":"man with white cane: medium skin tone","order":2179,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9AF","label":"man with white cane: medium-dark skin tone","order":2180,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9AF","label":"man with white cane: dark skin tone","order":2181,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9AF}"}]},{"group":1,"hexcode":"1F468-200D-1F9AF-200D-27A1-FE0F","label":"man with white cane facing right","order":2182,"tags":["accessibility","blind","man","man with white cane"],"unicode":"\u{1F468}\u200D\u{1F9AF}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9AF-200D-27A1-FE0F","label":"man with white cane facing right","order":2184,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9AF-200D-27A1-FE0F","label":"man with white cane facing right","order":2186,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9AF-200D-27A1-FE0F","label":"man with white cane facing right","order":2188,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9AF-200D-27A1-FE0F","label":"man with white cane facing right","order":2190,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9AF-200D-27A1-FE0F","label":"man with white cane facing right","order":2192,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F469-200D-1F9AF","label":"woman with white cane","order":2194,"tags":["accessibility","blind","woman"],"unicode":"\u{1F469}\u200D\u{1F9AF}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9AF","label":"woman with white cane: light skin tone","order":2195,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9AF","label":"woman with white cane: medium-light skin tone","order":2196,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9AF","label":"woman with white cane: medium skin tone","order":2197,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9AF","label":"woman with white cane: medium-dark skin tone","order":2198,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9AF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9AF","label":"woman with white cane: dark skin tone","order":2199,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9AF}"}]},{"group":1,"hexcode":"1F469-200D-1F9AF-200D-27A1-FE0F","label":"woman with white cane facing right","order":2200,"tags":["accessibility","blind","woman","woman with white cane"],"unicode":"\u{1F469}\u200D\u{1F9AF}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9AF-200D-27A1-FE0F","label":"woman with white cane facing right","order":2202,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9AF-200D-27A1-FE0F","label":"woman with white cane facing right","order":2204,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9AF-200D-27A1-FE0F","label":"woman with white cane facing right","order":2206,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9AF-200D-27A1-FE0F","label":"woman with white cane facing right","order":2208,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9AF-200D-27A1-FE0F","label":"woman with white cane facing right","order":2210,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9AF}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-1F9BC","label":"person in motorized wheelchair","order":2212,"tags":["accessibility","wheelchair"],"unicode":"\u{1F9D1}\u200D\u{1F9BC}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9BC","label":"person in motorized wheelchair: light skin tone","order":2213,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9BC","label":"person in motorized wheelchair: medium-light skin tone","order":2214,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9BC","label":"person in motorized wheelchair: medium skin tone","order":2215,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9BC","label":"person in motorized wheelchair: medium-dark skin tone","order":2216,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9BC","label":"person in motorized wheelchair: dark skin tone","order":2217,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9BC}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9BC-200D-27A1-FE0F","label":"person in motorized wheelchair facing right","order":2218,"tags":["accessibility","person in motorized wheelchair","wheelchair"],"unicode":"\u{1F9D1}\u200D\u{1F9BC}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9BC-200D-27A1-FE0F","label":"person in motorized wheelchair facing right","order":2220,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9BC-200D-27A1-FE0F","label":"person in motorized wheelchair facing right","order":2222,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9BC-200D-27A1-FE0F","label":"person in motorized wheelchair facing right","order":2224,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9BC-200D-27A1-FE0F","label":"person in motorized wheelchair facing right","order":2226,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9BC-200D-27A1-FE0F","label":"person in motorized wheelchair facing right","order":2228,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-1F9BC","label":"man in motorized wheelchair","order":2230,"tags":["accessibility","man","wheelchair"],"unicode":"\u{1F468}\u200D\u{1F9BC}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9BC","label":"man in motorized wheelchair: light skin tone","order":2231,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9BC","label":"man in motorized wheelchair: medium-light skin tone","order":2232,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9BC","label":"man in motorized wheelchair: medium skin tone","order":2233,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9BC","label":"man in motorized wheelchair: medium-dark skin tone","order":2234,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9BC","label":"man in motorized wheelchair: dark skin tone","order":2235,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9BC}"}]},{"group":1,"hexcode":"1F468-200D-1F9BC-200D-27A1-FE0F","label":"man in motorized wheelchair facing right","order":2236,"tags":["accessibility","man","man in motorized wheelchair","wheelchair"],"unicode":"\u{1F468}\u200D\u{1F9BC}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9BC-200D-27A1-FE0F","label":"man in motorized wheelchair facing right","order":2238,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9BC-200D-27A1-FE0F","label":"man in motorized wheelchair facing right","order":2240,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9BC-200D-27A1-FE0F","label":"man in motorized wheelchair facing right","order":2242,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9BC-200D-27A1-FE0F","label":"man in motorized wheelchair facing right","order":2244,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9BC-200D-27A1-FE0F","label":"man in motorized wheelchair facing right","order":2246,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F469-200D-1F9BC","label":"woman in motorized wheelchair","order":2248,"tags":["accessibility","wheelchair","woman"],"unicode":"\u{1F469}\u200D\u{1F9BC}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9BC","label":"woman in motorized wheelchair: light skin tone","order":2249,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9BC","label":"woman in motorized wheelchair: medium-light skin tone","order":2250,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9BC","label":"woman in motorized wheelchair: medium skin tone","order":2251,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9BC","label":"woman in motorized wheelchair: medium-dark skin tone","order":2252,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9BC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9BC","label":"woman in motorized wheelchair: dark skin tone","order":2253,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9BC}"}]},{"group":1,"hexcode":"1F469-200D-1F9BC-200D-27A1-FE0F","label":"woman in motorized wheelchair facing right","order":2254,"tags":["accessibility","wheelchair","woman","woman in motorized wheelchair"],"unicode":"\u{1F469}\u200D\u{1F9BC}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9BC-200D-27A1-FE0F","label":"woman in motorized wheelchair facing right","order":2256,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9BC-200D-27A1-FE0F","label":"woman in motorized wheelchair facing right","order":2258,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9BC-200D-27A1-FE0F","label":"woman in motorized wheelchair facing right","order":2260,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9BC-200D-27A1-FE0F","label":"woman in motorized wheelchair facing right","order":2262,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9BC-200D-27A1-FE0F","label":"woman in motorized wheelchair facing right","order":2264,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9BC}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F9D1-200D-1F9BD","label":"person in manual wheelchair","order":2266,"tags":["accessibility","wheelchair"],"unicode":"\u{1F9D1}\u200D\u{1F9BD}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9BD","label":"person in manual wheelchair: light skin tone","order":2267,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9BD","label":"person in manual wheelchair: medium-light skin tone","order":2268,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9BD","label":"person in manual wheelchair: medium skin tone","order":2269,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9BD","label":"person in manual wheelchair: medium-dark skin tone","order":2270,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9BD","label":"person in manual wheelchair: dark skin tone","order":2271,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9BD}"}]},{"group":1,"hexcode":"1F9D1-200D-1F9BD-200D-27A1-FE0F","label":"person in manual wheelchair facing right","order":2272,"tags":["accessibility","person in manual wheelchair","wheelchair"],"unicode":"\u{1F9D1}\u200D\u{1F9BD}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F9BD-200D-27A1-FE0F","label":"person in manual wheelchair facing right","order":2274,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F9BD-200D-27A1-FE0F","label":"person in manual wheelchair facing right","order":2276,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F9BD-200D-27A1-FE0F","label":"person in manual wheelchair facing right","order":2278,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F9BD-200D-27A1-FE0F","label":"person in manual wheelchair facing right","order":2280,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F9BD-200D-27A1-FE0F","label":"person in manual wheelchair facing right","order":2282,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F468-200D-1F9BD","label":"man in manual wheelchair","order":2284,"tags":["accessibility","man","wheelchair"],"unicode":"\u{1F468}\u200D\u{1F9BD}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9BD","label":"man in manual wheelchair: light skin tone","order":2285,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9BD","label":"man in manual wheelchair: medium-light skin tone","order":2286,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9BD","label":"man in manual wheelchair: medium skin tone","order":2287,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9BD","label":"man in manual wheelchair: medium-dark skin tone","order":2288,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9BD","label":"man in manual wheelchair: dark skin tone","order":2289,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9BD}"}]},{"group":1,"hexcode":"1F468-200D-1F9BD-200D-27A1-FE0F","label":"man in manual wheelchair facing right","order":2290,"tags":["accessibility","man","man in manual wheelchair","wheelchair"],"unicode":"\u{1F468}\u200D\u{1F9BD}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-1F9BD-200D-27A1-FE0F","label":"man in manual wheelchair facing right","order":2292,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F9BD-200D-27A1-FE0F","label":"man in manual wheelchair facing right","order":2294,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F9BD-200D-27A1-FE0F","label":"man in manual wheelchair facing right","order":2296,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F9BD-200D-27A1-FE0F","label":"man in manual wheelchair facing right","order":2298,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F9BD-200D-27A1-FE0F","label":"man in manual wheelchair facing right","order":2300,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F469-200D-1F9BD","label":"woman in manual wheelchair","order":2302,"tags":["accessibility","wheelchair","woman"],"unicode":"\u{1F469}\u200D\u{1F9BD}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9BD","label":"woman in manual wheelchair: light skin tone","order":2303,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9BD","label":"woman in manual wheelchair: medium-light skin tone","order":2304,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9BD","label":"woman in manual wheelchair: medium skin tone","order":2305,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9BD","label":"woman in manual wheelchair: medium-dark skin tone","order":2306,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9BD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9BD","label":"woman in manual wheelchair: dark skin tone","order":2307,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9BD}"}]},{"group":1,"hexcode":"1F469-200D-1F9BD-200D-27A1-FE0F","label":"woman in manual wheelchair facing right","order":2308,"tags":["accessibility","wheelchair","woman","woman in manual wheelchair"],"unicode":"\u{1F469}\u200D\u{1F9BD}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-1F9BD-200D-27A1-FE0F","label":"woman in manual wheelchair facing right","order":2310,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F9BD-200D-27A1-FE0F","label":"woman in manual wheelchair facing right","order":2312,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F9BD-200D-27A1-FE0F","label":"woman in manual wheelchair facing right","order":2314,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F9BD-200D-27A1-FE0F","label":"woman in manual wheelchair facing right","order":2316,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F9BD-200D-27A1-FE0F","label":"woman in manual wheelchair facing right","order":2318,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F9BD}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F3C3","label":"person running","order":2320,"tags":["marathon","running"],"unicode":"\u{1F3C3}","skins":[{"group":1,"hexcode":"1F3C3-1F3FB","label":"person running: light skin tone","order":2321,"unicode":"\u{1F3C3}\u{1F3FB}"},{"group":1,"hexcode":"1F3C3-1F3FC","label":"person running: medium-light skin tone","order":2322,"unicode":"\u{1F3C3}\u{1F3FC}"},{"group":1,"hexcode":"1F3C3-1F3FD","label":"person running: medium skin tone","order":2323,"unicode":"\u{1F3C3}\u{1F3FD}"},{"group":1,"hexcode":"1F3C3-1F3FE","label":"person running: medium-dark skin tone","order":2324,"unicode":"\u{1F3C3}\u{1F3FE}"},{"group":1,"hexcode":"1F3C3-1F3FF","label":"person running: dark skin tone","order":2325,"unicode":"\u{1F3C3}\u{1F3FF}"}]},{"group":1,"hexcode":"1F3C3-200D-2642-FE0F","label":"man running","order":2326,"tags":["man","marathon","racing","running"],"unicode":"\u{1F3C3}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F3C3-1F3FB-200D-2642-FE0F","label":"man running: light skin tone","order":2328,"unicode":"\u{1F3C3}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FC-200D-2642-FE0F","label":"man running: medium-light skin tone","order":2330,"unicode":"\u{1F3C3}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FD-200D-2642-FE0F","label":"man running: medium skin tone","order":2332,"unicode":"\u{1F3C3}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FE-200D-2642-FE0F","label":"man running: medium-dark skin tone","order":2334,"unicode":"\u{1F3C3}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FF-200D-2642-FE0F","label":"man running: dark skin tone","order":2336,"unicode":"\u{1F3C3}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F3C3-200D-2640-FE0F","label":"woman running","order":2338,"tags":["marathon","racing","running","woman"],"unicode":"\u{1F3C3}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F3C3-1F3FB-200D-2640-FE0F","label":"woman running: light skin tone","order":2340,"unicode":"\u{1F3C3}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FC-200D-2640-FE0F","label":"woman running: medium-light skin tone","order":2342,"unicode":"\u{1F3C3}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FD-200D-2640-FE0F","label":"woman running: medium skin tone","order":2344,"unicode":"\u{1F3C3}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FE-200D-2640-FE0F","label":"woman running: medium-dark skin tone","order":2346,"unicode":"\u{1F3C3}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FF-200D-2640-FE0F","label":"woman running: dark skin tone","order":2348,"unicode":"\u{1F3C3}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F3C3-200D-27A1-FE0F","label":"person running facing right","order":2350,"tags":["marathon","person running","running"],"unicode":"\u{1F3C3}\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F3C3-1F3FB-200D-27A1-FE0F","label":"person running facing right","order":2352,"unicode":"\u{1F3C3}\u{1F3FB}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FC-200D-27A1-FE0F","label":"person running facing right","order":2354,"unicode":"\u{1F3C3}\u{1F3FC}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FD-200D-27A1-FE0F","label":"person running facing right","order":2356,"unicode":"\u{1F3C3}\u{1F3FD}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FE-200D-27A1-FE0F","label":"person running facing right","order":2358,"unicode":"\u{1F3C3}\u{1F3FE}\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FF-200D-27A1-FE0F","label":"person running facing right","order":2360,"unicode":"\u{1F3C3}\u{1F3FF}\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F3C3-200D-2640-FE0F-200D-27A1-FE0F","label":"woman running facing right","order":2362,"tags":["marathon","racing","running","woman"],"unicode":"\u{1F3C3}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F3C3-1F3FB-200D-2640-FE0F-200D-27A1-FE0F","label":"woman running facing right","order":2366,"unicode":"\u{1F3C3}\u{1F3FB}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FC-200D-2640-FE0F-200D-27A1-FE0F","label":"woman running facing right","order":2370,"unicode":"\u{1F3C3}\u{1F3FC}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FD-200D-2640-FE0F-200D-27A1-FE0F","label":"woman running facing right","order":2374,"unicode":"\u{1F3C3}\u{1F3FD}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FE-200D-2640-FE0F-200D-27A1-FE0F","label":"woman running facing right","order":2378,"unicode":"\u{1F3C3}\u{1F3FE}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FF-200D-2640-FE0F-200D-27A1-FE0F","label":"woman running facing right","order":2382,"unicode":"\u{1F3C3}\u{1F3FF}\u200D\u2640\uFE0F\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F3C3-200D-2642-FE0F-200D-27A1-FE0F","label":"man running facing right","order":2386,"tags":["man","marathon","racing","running"],"unicode":"\u{1F3C3}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F","skins":[{"group":1,"hexcode":"1F3C3-1F3FB-200D-2642-FE0F-200D-27A1-FE0F","label":"man running facing right","order":2390,"unicode":"\u{1F3C3}\u{1F3FB}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FC-200D-2642-FE0F-200D-27A1-FE0F","label":"man running facing right","order":2394,"unicode":"\u{1F3C3}\u{1F3FC}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FD-200D-2642-FE0F-200D-27A1-FE0F","label":"man running facing right","order":2398,"unicode":"\u{1F3C3}\u{1F3FD}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FE-200D-2642-FE0F-200D-27A1-FE0F","label":"man running facing right","order":2402,"unicode":"\u{1F3C3}\u{1F3FE}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"},{"group":1,"hexcode":"1F3C3-1F3FF-200D-2642-FE0F-200D-27A1-FE0F","label":"man running facing right","order":2406,"unicode":"\u{1F3C3}\u{1F3FF}\u200D\u2642\uFE0F\u200D\u27A1\uFE0F"}]},{"group":1,"hexcode":"1F483","label":"woman dancing","order":2410,"tags":["dance","dancing","woman"],"unicode":"\u{1F483}","skins":[{"group":1,"hexcode":"1F483-1F3FB","label":"woman dancing: light skin tone","order":2411,"unicode":"\u{1F483}\u{1F3FB}"},{"group":1,"hexcode":"1F483-1F3FC","label":"woman dancing: medium-light skin tone","order":2412,"unicode":"\u{1F483}\u{1F3FC}"},{"group":1,"hexcode":"1F483-1F3FD","label":"woman dancing: medium skin tone","order":2413,"unicode":"\u{1F483}\u{1F3FD}"},{"group":1,"hexcode":"1F483-1F3FE","label":"woman dancing: medium-dark skin tone","order":2414,"unicode":"\u{1F483}\u{1F3FE}"},{"group":1,"hexcode":"1F483-1F3FF","label":"woman dancing: dark skin tone","order":2415,"unicode":"\u{1F483}\u{1F3FF}"}]},{"group":1,"hexcode":"1F57A","label":"man dancing","order":2416,"tags":["dance","dancing","man"],"unicode":"\u{1F57A}","skins":[{"group":1,"hexcode":"1F57A-1F3FB","label":"man dancing: light skin tone","order":2417,"unicode":"\u{1F57A}\u{1F3FB}"},{"group":1,"hexcode":"1F57A-1F3FC","label":"man dancing: medium-light skin tone","order":2418,"unicode":"\u{1F57A}\u{1F3FC}"},{"group":1,"hexcode":"1F57A-1F3FD","label":"man dancing: medium skin tone","order":2419,"unicode":"\u{1F57A}\u{1F3FD}"},{"group":1,"hexcode":"1F57A-1F3FE","label":"man dancing: medium-dark skin tone","order":2420,"unicode":"\u{1F57A}\u{1F3FE}"},{"group":1,"hexcode":"1F57A-1F3FF","label":"man dancing: dark skin tone","order":2421,"unicode":"\u{1F57A}\u{1F3FF}"}]},{"group":1,"hexcode":"1F574","label":"person in suit levitating","order":2423,"tags":["business","person","suit"],"unicode":"\u{1F574}\uFE0F","skins":[{"group":1,"hexcode":"1F574-1F3FB","label":"person in suit levitating: light skin tone","order":2424,"unicode":"\u{1F574}\u{1F3FB}"},{"group":1,"hexcode":"1F574-1F3FC","label":"person in suit levitating: medium-light skin tone","order":2425,"unicode":"\u{1F574}\u{1F3FC}"},{"group":1,"hexcode":"1F574-1F3FD","label":"person in suit levitating: medium skin tone","order":2426,"unicode":"\u{1F574}\u{1F3FD}"},{"group":1,"hexcode":"1F574-1F3FE","label":"person in suit levitating: medium-dark skin tone","order":2427,"unicode":"\u{1F574}\u{1F3FE}"},{"group":1,"hexcode":"1F574-1F3FF","label":"person in suit levitating: dark skin tone","order":2428,"unicode":"\u{1F574}\u{1F3FF}"}]},{"group":1,"hexcode":"1F46F","label":"people with bunny ears","order":2429,"tags":["bunny ear","dancer","partying"],"unicode":"\u{1F46F}"},{"group":1,"hexcode":"1F46F-200D-2642-FE0F","label":"men with bunny ears","order":2430,"tags":["bunny ear","dancer","men","partying"],"unicode":"\u{1F46F}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F46F-200D-2640-FE0F","label":"women with bunny ears","order":2432,"tags":["bunny ear","dancer","partying","women"],"unicode":"\u{1F46F}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D6","label":"person in steamy room","order":2434,"tags":["sauna","steam room"],"unicode":"\u{1F9D6}","skins":[{"group":1,"hexcode":"1F9D6-1F3FB","label":"person in steamy room: light skin tone","order":2435,"unicode":"\u{1F9D6}\u{1F3FB}"},{"group":1,"hexcode":"1F9D6-1F3FC","label":"person in steamy room: medium-light skin tone","order":2436,"unicode":"\u{1F9D6}\u{1F3FC}"},{"group":1,"hexcode":"1F9D6-1F3FD","label":"person in steamy room: medium skin tone","order":2437,"unicode":"\u{1F9D6}\u{1F3FD}"},{"group":1,"hexcode":"1F9D6-1F3FE","label":"person in steamy room: medium-dark skin tone","order":2438,"unicode":"\u{1F9D6}\u{1F3FE}"},{"group":1,"hexcode":"1F9D6-1F3FF","label":"person in steamy room: dark skin tone","order":2439,"unicode":"\u{1F9D6}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D6-200D-2642-FE0F","label":"man in steamy room","order":2440,"tags":["sauna","steam room"],"unicode":"\u{1F9D6}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9D6-1F3FB-200D-2642-FE0F","label":"man in steamy room: light skin tone","order":2442,"unicode":"\u{1F9D6}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FC-200D-2642-FE0F","label":"man in steamy room: medium-light skin tone","order":2444,"unicode":"\u{1F9D6}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FD-200D-2642-FE0F","label":"man in steamy room: medium skin tone","order":2446,"unicode":"\u{1F9D6}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FE-200D-2642-FE0F","label":"man in steamy room: medium-dark skin tone","order":2448,"unicode":"\u{1F9D6}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FF-200D-2642-FE0F","label":"man in steamy room: dark skin tone","order":2450,"unicode":"\u{1F9D6}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9D6-200D-2640-FE0F","label":"woman in steamy room","order":2452,"tags":["sauna","steam room"],"unicode":"\u{1F9D6}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9D6-1F3FB-200D-2640-FE0F","label":"woman in steamy room: light skin tone","order":2454,"unicode":"\u{1F9D6}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FC-200D-2640-FE0F","label":"woman in steamy room: medium-light skin tone","order":2456,"unicode":"\u{1F9D6}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FD-200D-2640-FE0F","label":"woman in steamy room: medium skin tone","order":2458,"unicode":"\u{1F9D6}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FE-200D-2640-FE0F","label":"woman in steamy room: medium-dark skin tone","order":2460,"unicode":"\u{1F9D6}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D6-1F3FF-200D-2640-FE0F","label":"woman in steamy room: dark skin tone","order":2462,"unicode":"\u{1F9D6}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9D7","label":"person climbing","order":2464,"tags":["climber"],"unicode":"\u{1F9D7}","skins":[{"group":1,"hexcode":"1F9D7-1F3FB","label":"person climbing: light skin tone","order":2465,"unicode":"\u{1F9D7}\u{1F3FB}"},{"group":1,"hexcode":"1F9D7-1F3FC","label":"person climbing: medium-light skin tone","order":2466,"unicode":"\u{1F9D7}\u{1F3FC}"},{"group":1,"hexcode":"1F9D7-1F3FD","label":"person climbing: medium skin tone","order":2467,"unicode":"\u{1F9D7}\u{1F3FD}"},{"group":1,"hexcode":"1F9D7-1F3FE","label":"person climbing: medium-dark skin tone","order":2468,"unicode":"\u{1F9D7}\u{1F3FE}"},{"group":1,"hexcode":"1F9D7-1F3FF","label":"person climbing: dark skin tone","order":2469,"unicode":"\u{1F9D7}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D7-200D-2642-FE0F","label":"man climbing","order":2470,"tags":["climber"],"unicode":"\u{1F9D7}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9D7-1F3FB-200D-2642-FE0F","label":"man climbing: light skin tone","order":2472,"unicode":"\u{1F9D7}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FC-200D-2642-FE0F","label":"man climbing: medium-light skin tone","order":2474,"unicode":"\u{1F9D7}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FD-200D-2642-FE0F","label":"man climbing: medium skin tone","order":2476,"unicode":"\u{1F9D7}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FE-200D-2642-FE0F","label":"man climbing: medium-dark skin tone","order":2478,"unicode":"\u{1F9D7}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FF-200D-2642-FE0F","label":"man climbing: dark skin tone","order":2480,"unicode":"\u{1F9D7}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9D7-200D-2640-FE0F","label":"woman climbing","order":2482,"tags":["climber"],"unicode":"\u{1F9D7}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9D7-1F3FB-200D-2640-FE0F","label":"woman climbing: light skin tone","order":2484,"unicode":"\u{1F9D7}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FC-200D-2640-FE0F","label":"woman climbing: medium-light skin tone","order":2486,"unicode":"\u{1F9D7}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FD-200D-2640-FE0F","label":"woman climbing: medium skin tone","order":2488,"unicode":"\u{1F9D7}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FE-200D-2640-FE0F","label":"woman climbing: medium-dark skin tone","order":2490,"unicode":"\u{1F9D7}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D7-1F3FF-200D-2640-FE0F","label":"woman climbing: dark skin tone","order":2492,"unicode":"\u{1F9D7}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F93A","label":"person fencing","order":2494,"tags":["fencer","fencing","sword"],"unicode":"\u{1F93A}"},{"group":1,"hexcode":"1F3C7","label":"horse racing","order":2495,"tags":["horse","jockey","racehorse","racing"],"unicode":"\u{1F3C7}","skins":[{"group":1,"hexcode":"1F3C7-1F3FB","label":"horse racing: light skin tone","order":2496,"unicode":"\u{1F3C7}\u{1F3FB}"},{"group":1,"hexcode":"1F3C7-1F3FC","label":"horse racing: medium-light skin tone","order":2497,"unicode":"\u{1F3C7}\u{1F3FC}"},{"group":1,"hexcode":"1F3C7-1F3FD","label":"horse racing: medium skin tone","order":2498,"unicode":"\u{1F3C7}\u{1F3FD}"},{"group":1,"hexcode":"1F3C7-1F3FE","label":"horse racing: medium-dark skin tone","order":2499,"unicode":"\u{1F3C7}\u{1F3FE}"},{"group":1,"hexcode":"1F3C7-1F3FF","label":"horse racing: dark skin tone","order":2500,"unicode":"\u{1F3C7}\u{1F3FF}"}]},{"group":1,"hexcode":"26F7","label":"skier","order":2502,"tags":["ski","snow"],"unicode":"\u26F7\uFE0F"},{"group":1,"hexcode":"1F3C2","label":"snowboarder","order":2503,"tags":["ski","snow","snowboard"],"unicode":"\u{1F3C2}\uFE0F","skins":[{"group":1,"hexcode":"1F3C2-1F3FB","label":"snowboarder: light skin tone","order":2504,"unicode":"\u{1F3C2}\u{1F3FB}"},{"group":1,"hexcode":"1F3C2-1F3FC","label":"snowboarder: medium-light skin tone","order":2505,"unicode":"\u{1F3C2}\u{1F3FC}"},{"group":1,"hexcode":"1F3C2-1F3FD","label":"snowboarder: medium skin tone","order":2506,"unicode":"\u{1F3C2}\u{1F3FD}"},{"group":1,"hexcode":"1F3C2-1F3FE","label":"snowboarder: medium-dark skin tone","order":2507,"unicode":"\u{1F3C2}\u{1F3FE}"},{"group":1,"hexcode":"1F3C2-1F3FF","label":"snowboarder: dark skin tone","order":2508,"unicode":"\u{1F3C2}\u{1F3FF}"}]},{"group":1,"hexcode":"1F3CC","label":"person golfing","order":2510,"tags":["ball","golf"],"unicode":"\u{1F3CC}\uFE0F","skins":[{"group":1,"hexcode":"1F3CC-1F3FB","label":"person golfing: light skin tone","order":2511,"unicode":"\u{1F3CC}\u{1F3FB}"},{"group":1,"hexcode":"1F3CC-1F3FC","label":"person golfing: medium-light skin tone","order":2512,"unicode":"\u{1F3CC}\u{1F3FC}"},{"group":1,"hexcode":"1F3CC-1F3FD","label":"person golfing: medium skin tone","order":2513,"unicode":"\u{1F3CC}\u{1F3FD}"},{"group":1,"hexcode":"1F3CC-1F3FE","label":"person golfing: medium-dark skin tone","order":2514,"unicode":"\u{1F3CC}\u{1F3FE}"},{"group":1,"hexcode":"1F3CC-1F3FF","label":"person golfing: dark skin tone","order":2515,"unicode":"\u{1F3CC}\u{1F3FF}"}]},{"group":1,"hexcode":"1F3CC-FE0F-200D-2642-FE0F","label":"man golfing","order":2516,"tags":["golf","man"],"unicode":"\u{1F3CC}\uFE0F\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F3CC-1F3FB-200D-2642-FE0F","label":"man golfing: light skin tone","order":2520,"unicode":"\u{1F3CC}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FC-200D-2642-FE0F","label":"man golfing: medium-light skin tone","order":2522,"unicode":"\u{1F3CC}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FD-200D-2642-FE0F","label":"man golfing: medium skin tone","order":2524,"unicode":"\u{1F3CC}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FE-200D-2642-FE0F","label":"man golfing: medium-dark skin tone","order":2526,"unicode":"\u{1F3CC}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FF-200D-2642-FE0F","label":"man golfing: dark skin tone","order":2528,"unicode":"\u{1F3CC}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F3CC-FE0F-200D-2640-FE0F","label":"woman golfing","order":2530,"tags":["golf","woman"],"unicode":"\u{1F3CC}\uFE0F\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F3CC-1F3FB-200D-2640-FE0F","label":"woman golfing: light skin tone","order":2534,"unicode":"\u{1F3CC}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FC-200D-2640-FE0F","label":"woman golfing: medium-light skin tone","order":2536,"unicode":"\u{1F3CC}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FD-200D-2640-FE0F","label":"woman golfing: medium skin tone","order":2538,"unicode":"\u{1F3CC}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FE-200D-2640-FE0F","label":"woman golfing: medium-dark skin tone","order":2540,"unicode":"\u{1F3CC}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CC-1F3FF-200D-2640-FE0F","label":"woman golfing: dark skin tone","order":2542,"unicode":"\u{1F3CC}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F3C4","label":"person surfing","order":2544,"tags":["surfing"],"unicode":"\u{1F3C4}\uFE0F","skins":[{"group":1,"hexcode":"1F3C4-1F3FB","label":"person surfing: light skin tone","order":2545,"unicode":"\u{1F3C4}\u{1F3FB}"},{"group":1,"hexcode":"1F3C4-1F3FC","label":"person surfing: medium-light skin tone","order":2546,"unicode":"\u{1F3C4}\u{1F3FC}"},{"group":1,"hexcode":"1F3C4-1F3FD","label":"person surfing: medium skin tone","order":2547,"unicode":"\u{1F3C4}\u{1F3FD}"},{"group":1,"hexcode":"1F3C4-1F3FE","label":"person surfing: medium-dark skin tone","order":2548,"unicode":"\u{1F3C4}\u{1F3FE}"},{"group":1,"hexcode":"1F3C4-1F3FF","label":"person surfing: dark skin tone","order":2549,"unicode":"\u{1F3C4}\u{1F3FF}"}]},{"group":1,"hexcode":"1F3C4-200D-2642-FE0F","label":"man surfing","order":2550,"tags":["man","surfing"],"unicode":"\u{1F3C4}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F3C4-1F3FB-200D-2642-FE0F","label":"man surfing: light skin tone","order":2552,"unicode":"\u{1F3C4}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FC-200D-2642-FE0F","label":"man surfing: medium-light skin tone","order":2554,"unicode":"\u{1F3C4}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FD-200D-2642-FE0F","label":"man surfing: medium skin tone","order":2556,"unicode":"\u{1F3C4}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FE-200D-2642-FE0F","label":"man surfing: medium-dark skin tone","order":2558,"unicode":"\u{1F3C4}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FF-200D-2642-FE0F","label":"man surfing: dark skin tone","order":2560,"unicode":"\u{1F3C4}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F3C4-200D-2640-FE0F","label":"woman surfing","order":2562,"tags":["surfing","woman"],"unicode":"\u{1F3C4}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F3C4-1F3FB-200D-2640-FE0F","label":"woman surfing: light skin tone","order":2564,"unicode":"\u{1F3C4}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FC-200D-2640-FE0F","label":"woman surfing: medium-light skin tone","order":2566,"unicode":"\u{1F3C4}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FD-200D-2640-FE0F","label":"woman surfing: medium skin tone","order":2568,"unicode":"\u{1F3C4}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FE-200D-2640-FE0F","label":"woman surfing: medium-dark skin tone","order":2570,"unicode":"\u{1F3C4}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3C4-1F3FF-200D-2640-FE0F","label":"woman surfing: dark skin tone","order":2572,"unicode":"\u{1F3C4}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F6A3","label":"person rowing boat","order":2574,"tags":["boat","rowboat"],"unicode":"\u{1F6A3}","skins":[{"group":1,"hexcode":"1F6A3-1F3FB","label":"person rowing boat: light skin tone","order":2575,"unicode":"\u{1F6A3}\u{1F3FB}"},{"group":1,"hexcode":"1F6A3-1F3FC","label":"person rowing boat: medium-light skin tone","order":2576,"unicode":"\u{1F6A3}\u{1F3FC}"},{"group":1,"hexcode":"1F6A3-1F3FD","label":"person rowing boat: medium skin tone","order":2577,"unicode":"\u{1F6A3}\u{1F3FD}"},{"group":1,"hexcode":"1F6A3-1F3FE","label":"person rowing boat: medium-dark skin tone","order":2578,"unicode":"\u{1F6A3}\u{1F3FE}"},{"group":1,"hexcode":"1F6A3-1F3FF","label":"person rowing boat: dark skin tone","order":2579,"unicode":"\u{1F6A3}\u{1F3FF}"}]},{"group":1,"hexcode":"1F6A3-200D-2642-FE0F","label":"man rowing boat","order":2580,"tags":["boat","man","rowboat"],"unicode":"\u{1F6A3}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F6A3-1F3FB-200D-2642-FE0F","label":"man rowing boat: light skin tone","order":2582,"unicode":"\u{1F6A3}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FC-200D-2642-FE0F","label":"man rowing boat: medium-light skin tone","order":2584,"unicode":"\u{1F6A3}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FD-200D-2642-FE0F","label":"man rowing boat: medium skin tone","order":2586,"unicode":"\u{1F6A3}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FE-200D-2642-FE0F","label":"man rowing boat: medium-dark skin tone","order":2588,"unicode":"\u{1F6A3}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FF-200D-2642-FE0F","label":"man rowing boat: dark skin tone","order":2590,"unicode":"\u{1F6A3}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F6A3-200D-2640-FE0F","label":"woman rowing boat","order":2592,"tags":["boat","rowboat","woman"],"unicode":"\u{1F6A3}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F6A3-1F3FB-200D-2640-FE0F","label":"woman rowing boat: light skin tone","order":2594,"unicode":"\u{1F6A3}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FC-200D-2640-FE0F","label":"woman rowing boat: medium-light skin tone","order":2596,"unicode":"\u{1F6A3}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FD-200D-2640-FE0F","label":"woman rowing boat: medium skin tone","order":2598,"unicode":"\u{1F6A3}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FE-200D-2640-FE0F","label":"woman rowing boat: medium-dark skin tone","order":2600,"unicode":"\u{1F6A3}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6A3-1F3FF-200D-2640-FE0F","label":"woman rowing boat: dark skin tone","order":2602,"unicode":"\u{1F6A3}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F3CA","label":"person swimming","order":2604,"tags":["swim"],"unicode":"\u{1F3CA}\uFE0F","skins":[{"group":1,"hexcode":"1F3CA-1F3FB","label":"person swimming: light skin tone","order":2605,"unicode":"\u{1F3CA}\u{1F3FB}"},{"group":1,"hexcode":"1F3CA-1F3FC","label":"person swimming: medium-light skin tone","order":2606,"unicode":"\u{1F3CA}\u{1F3FC}"},{"group":1,"hexcode":"1F3CA-1F3FD","label":"person swimming: medium skin tone","order":2607,"unicode":"\u{1F3CA}\u{1F3FD}"},{"group":1,"hexcode":"1F3CA-1F3FE","label":"person swimming: medium-dark skin tone","order":2608,"unicode":"\u{1F3CA}\u{1F3FE}"},{"group":1,"hexcode":"1F3CA-1F3FF","label":"person swimming: dark skin tone","order":2609,"unicode":"\u{1F3CA}\u{1F3FF}"}]},{"group":1,"hexcode":"1F3CA-200D-2642-FE0F","label":"man swimming","order":2610,"tags":["man","swim"],"unicode":"\u{1F3CA}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F3CA-1F3FB-200D-2642-FE0F","label":"man swimming: light skin tone","order":2612,"unicode":"\u{1F3CA}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FC-200D-2642-FE0F","label":"man swimming: medium-light skin tone","order":2614,"unicode":"\u{1F3CA}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FD-200D-2642-FE0F","label":"man swimming: medium skin tone","order":2616,"unicode":"\u{1F3CA}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FE-200D-2642-FE0F","label":"man swimming: medium-dark skin tone","order":2618,"unicode":"\u{1F3CA}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FF-200D-2642-FE0F","label":"man swimming: dark skin tone","order":2620,"unicode":"\u{1F3CA}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F3CA-200D-2640-FE0F","label":"woman swimming","order":2622,"tags":["swim","woman"],"unicode":"\u{1F3CA}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F3CA-1F3FB-200D-2640-FE0F","label":"woman swimming: light skin tone","order":2624,"unicode":"\u{1F3CA}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FC-200D-2640-FE0F","label":"woman swimming: medium-light skin tone","order":2626,"unicode":"\u{1F3CA}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FD-200D-2640-FE0F","label":"woman swimming: medium skin tone","order":2628,"unicode":"\u{1F3CA}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FE-200D-2640-FE0F","label":"woman swimming: medium-dark skin tone","order":2630,"unicode":"\u{1F3CA}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CA-1F3FF-200D-2640-FE0F","label":"woman swimming: dark skin tone","order":2632,"unicode":"\u{1F3CA}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"26F9","label":"person bouncing ball","order":2635,"tags":["ball"],"unicode":"\u26F9\uFE0F","skins":[{"group":1,"hexcode":"26F9-1F3FB","label":"person bouncing ball: light skin tone","order":2636,"unicode":"\u26F9\u{1F3FB}"},{"group":1,"hexcode":"26F9-1F3FC","label":"person bouncing ball: medium-light skin tone","order":2637,"unicode":"\u26F9\u{1F3FC}"},{"group":1,"hexcode":"26F9-1F3FD","label":"person bouncing ball: medium skin tone","order":2638,"unicode":"\u26F9\u{1F3FD}"},{"group":1,"hexcode":"26F9-1F3FE","label":"person bouncing ball: medium-dark skin tone","order":2639,"unicode":"\u26F9\u{1F3FE}"},{"group":1,"hexcode":"26F9-1F3FF","label":"person bouncing ball: dark skin tone","order":2640,"unicode":"\u26F9\u{1F3FF}"}]},{"group":1,"hexcode":"26F9-FE0F-200D-2642-FE0F","label":"man bouncing ball","order":2641,"tags":["ball","man"],"unicode":"\u26F9\uFE0F\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"26F9-1F3FB-200D-2642-FE0F","label":"man bouncing ball: light skin tone","order":2645,"unicode":"\u26F9\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"26F9-1F3FC-200D-2642-FE0F","label":"man bouncing ball: medium-light skin tone","order":2647,"unicode":"\u26F9\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"26F9-1F3FD-200D-2642-FE0F","label":"man bouncing ball: medium skin tone","order":2649,"unicode":"\u26F9\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"26F9-1F3FE-200D-2642-FE0F","label":"man bouncing ball: medium-dark skin tone","order":2651,"unicode":"\u26F9\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"26F9-1F3FF-200D-2642-FE0F","label":"man bouncing ball: dark skin tone","order":2653,"unicode":"\u26F9\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"26F9-FE0F-200D-2640-FE0F","label":"woman bouncing ball","order":2655,"tags":["ball","woman"],"unicode":"\u26F9\uFE0F\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"26F9-1F3FB-200D-2640-FE0F","label":"woman bouncing ball: light skin tone","order":2659,"unicode":"\u26F9\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"26F9-1F3FC-200D-2640-FE0F","label":"woman bouncing ball: medium-light skin tone","order":2661,"unicode":"\u26F9\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"26F9-1F3FD-200D-2640-FE0F","label":"woman bouncing ball: medium skin tone","order":2663,"unicode":"\u26F9\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"26F9-1F3FE-200D-2640-FE0F","label":"woman bouncing ball: medium-dark skin tone","order":2665,"unicode":"\u26F9\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"26F9-1F3FF-200D-2640-FE0F","label":"woman bouncing ball: dark skin tone","order":2667,"unicode":"\u26F9\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F3CB","label":"person lifting weights","order":2670,"tags":["lifter","weight"],"unicode":"\u{1F3CB}\uFE0F","skins":[{"group":1,"hexcode":"1F3CB-1F3FB","label":"person lifting weights: light skin tone","order":2671,"unicode":"\u{1F3CB}\u{1F3FB}"},{"group":1,"hexcode":"1F3CB-1F3FC","label":"person lifting weights: medium-light skin tone","order":2672,"unicode":"\u{1F3CB}\u{1F3FC}"},{"group":1,"hexcode":"1F3CB-1F3FD","label":"person lifting weights: medium skin tone","order":2673,"unicode":"\u{1F3CB}\u{1F3FD}"},{"group":1,"hexcode":"1F3CB-1F3FE","label":"person lifting weights: medium-dark skin tone","order":2674,"unicode":"\u{1F3CB}\u{1F3FE}"},{"group":1,"hexcode":"1F3CB-1F3FF","label":"person lifting weights: dark skin tone","order":2675,"unicode":"\u{1F3CB}\u{1F3FF}"}]},{"group":1,"hexcode":"1F3CB-FE0F-200D-2642-FE0F","label":"man lifting weights","order":2676,"tags":["man","weight lifter"],"unicode":"\u{1F3CB}\uFE0F\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F3CB-1F3FB-200D-2642-FE0F","label":"man lifting weights: light skin tone","order":2680,"unicode":"\u{1F3CB}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FC-200D-2642-FE0F","label":"man lifting weights: medium-light skin tone","order":2682,"unicode":"\u{1F3CB}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FD-200D-2642-FE0F","label":"man lifting weights: medium skin tone","order":2684,"unicode":"\u{1F3CB}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FE-200D-2642-FE0F","label":"man lifting weights: medium-dark skin tone","order":2686,"unicode":"\u{1F3CB}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FF-200D-2642-FE0F","label":"man lifting weights: dark skin tone","order":2688,"unicode":"\u{1F3CB}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F3CB-FE0F-200D-2640-FE0F","label":"woman lifting weights","order":2690,"tags":["weight lifter","woman"],"unicode":"\u{1F3CB}\uFE0F\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F3CB-1F3FB-200D-2640-FE0F","label":"woman lifting weights: light skin tone","order":2694,"unicode":"\u{1F3CB}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FC-200D-2640-FE0F","label":"woman lifting weights: medium-light skin tone","order":2696,"unicode":"\u{1F3CB}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FD-200D-2640-FE0F","label":"woman lifting weights: medium skin tone","order":2698,"unicode":"\u{1F3CB}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FE-200D-2640-FE0F","label":"woman lifting weights: medium-dark skin tone","order":2700,"unicode":"\u{1F3CB}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F3CB-1F3FF-200D-2640-FE0F","label":"woman lifting weights: dark skin tone","order":2702,"unicode":"\u{1F3CB}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F6B4","label":"person biking","order":2704,"tags":["bicycle","biking","cyclist"],"unicode":"\u{1F6B4}","skins":[{"group":1,"hexcode":"1F6B4-1F3FB","label":"person biking: light skin tone","order":2705,"unicode":"\u{1F6B4}\u{1F3FB}"},{"group":1,"hexcode":"1F6B4-1F3FC","label":"person biking: medium-light skin tone","order":2706,"unicode":"\u{1F6B4}\u{1F3FC}"},{"group":1,"hexcode":"1F6B4-1F3FD","label":"person biking: medium skin tone","order":2707,"unicode":"\u{1F6B4}\u{1F3FD}"},{"group":1,"hexcode":"1F6B4-1F3FE","label":"person biking: medium-dark skin tone","order":2708,"unicode":"\u{1F6B4}\u{1F3FE}"},{"group":1,"hexcode":"1F6B4-1F3FF","label":"person biking: dark skin tone","order":2709,"unicode":"\u{1F6B4}\u{1F3FF}"}]},{"group":1,"hexcode":"1F6B4-200D-2642-FE0F","label":"man biking","order":2710,"tags":["bicycle","biking","cyclist","man"],"unicode":"\u{1F6B4}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F6B4-1F3FB-200D-2642-FE0F","label":"man biking: light skin tone","order":2712,"unicode":"\u{1F6B4}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FC-200D-2642-FE0F","label":"man biking: medium-light skin tone","order":2714,"unicode":"\u{1F6B4}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FD-200D-2642-FE0F","label":"man biking: medium skin tone","order":2716,"unicode":"\u{1F6B4}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FE-200D-2642-FE0F","label":"man biking: medium-dark skin tone","order":2718,"unicode":"\u{1F6B4}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FF-200D-2642-FE0F","label":"man biking: dark skin tone","order":2720,"unicode":"\u{1F6B4}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F6B4-200D-2640-FE0F","label":"woman biking","order":2722,"tags":["bicycle","biking","cyclist","woman"],"unicode":"\u{1F6B4}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F6B4-1F3FB-200D-2640-FE0F","label":"woman biking: light skin tone","order":2724,"unicode":"\u{1F6B4}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FC-200D-2640-FE0F","label":"woman biking: medium-light skin tone","order":2726,"unicode":"\u{1F6B4}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FD-200D-2640-FE0F","label":"woman biking: medium skin tone","order":2728,"unicode":"\u{1F6B4}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FE-200D-2640-FE0F","label":"woman biking: medium-dark skin tone","order":2730,"unicode":"\u{1F6B4}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B4-1F3FF-200D-2640-FE0F","label":"woman biking: dark skin tone","order":2732,"unicode":"\u{1F6B4}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F6B5","label":"person mountain biking","order":2734,"tags":["bicycle","bicyclist","bike","cyclist","mountain"],"unicode":"\u{1F6B5}","skins":[{"group":1,"hexcode":"1F6B5-1F3FB","label":"person mountain biking: light skin tone","order":2735,"unicode":"\u{1F6B5}\u{1F3FB}"},{"group":1,"hexcode":"1F6B5-1F3FC","label":"person mountain biking: medium-light skin tone","order":2736,"unicode":"\u{1F6B5}\u{1F3FC}"},{"group":1,"hexcode":"1F6B5-1F3FD","label":"person mountain biking: medium skin tone","order":2737,"unicode":"\u{1F6B5}\u{1F3FD}"},{"group":1,"hexcode":"1F6B5-1F3FE","label":"person mountain biking: medium-dark skin tone","order":2738,"unicode":"\u{1F6B5}\u{1F3FE}"},{"group":1,"hexcode":"1F6B5-1F3FF","label":"person mountain biking: dark skin tone","order":2739,"unicode":"\u{1F6B5}\u{1F3FF}"}]},{"group":1,"hexcode":"1F6B5-200D-2642-FE0F","label":"man mountain biking","order":2740,"tags":["bicycle","bike","cyclist","man","mountain"],"unicode":"\u{1F6B5}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F6B5-1F3FB-200D-2642-FE0F","label":"man mountain biking: light skin tone","order":2742,"unicode":"\u{1F6B5}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FC-200D-2642-FE0F","label":"man mountain biking: medium-light skin tone","order":2744,"unicode":"\u{1F6B5}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FD-200D-2642-FE0F","label":"man mountain biking: medium skin tone","order":2746,"unicode":"\u{1F6B5}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FE-200D-2642-FE0F","label":"man mountain biking: medium-dark skin tone","order":2748,"unicode":"\u{1F6B5}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FF-200D-2642-FE0F","label":"man mountain biking: dark skin tone","order":2750,"unicode":"\u{1F6B5}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F6B5-200D-2640-FE0F","label":"woman mountain biking","order":2752,"tags":["bicycle","bike","biking","cyclist","mountain","woman"],"unicode":"\u{1F6B5}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F6B5-1F3FB-200D-2640-FE0F","label":"woman mountain biking: light skin tone","order":2754,"unicode":"\u{1F6B5}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FC-200D-2640-FE0F","label":"woman mountain biking: medium-light skin tone","order":2756,"unicode":"\u{1F6B5}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FD-200D-2640-FE0F","label":"woman mountain biking: medium skin tone","order":2758,"unicode":"\u{1F6B5}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FE-200D-2640-FE0F","label":"woman mountain biking: medium-dark skin tone","order":2760,"unicode":"\u{1F6B5}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F6B5-1F3FF-200D-2640-FE0F","label":"woman mountain biking: dark skin tone","order":2762,"unicode":"\u{1F6B5}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F938","label":"person cartwheeling","order":2764,"tags":["cartwheel","gymnastics"],"unicode":"\u{1F938}","skins":[{"group":1,"hexcode":"1F938-1F3FB","label":"person cartwheeling: light skin tone","order":2765,"unicode":"\u{1F938}\u{1F3FB}"},{"group":1,"hexcode":"1F938-1F3FC","label":"person cartwheeling: medium-light skin tone","order":2766,"unicode":"\u{1F938}\u{1F3FC}"},{"group":1,"hexcode":"1F938-1F3FD","label":"person cartwheeling: medium skin tone","order":2767,"unicode":"\u{1F938}\u{1F3FD}"},{"group":1,"hexcode":"1F938-1F3FE","label":"person cartwheeling: medium-dark skin tone","order":2768,"unicode":"\u{1F938}\u{1F3FE}"},{"group":1,"hexcode":"1F938-1F3FF","label":"person cartwheeling: dark skin tone","order":2769,"unicode":"\u{1F938}\u{1F3FF}"}]},{"group":1,"hexcode":"1F938-200D-2642-FE0F","label":"man cartwheeling","order":2770,"tags":["cartwheel","gymnastics","man"],"unicode":"\u{1F938}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F938-1F3FB-200D-2642-FE0F","label":"man cartwheeling: light skin tone","order":2772,"unicode":"\u{1F938}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F938-1F3FC-200D-2642-FE0F","label":"man cartwheeling: medium-light skin tone","order":2774,"unicode":"\u{1F938}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F938-1F3FD-200D-2642-FE0F","label":"man cartwheeling: medium skin tone","order":2776,"unicode":"\u{1F938}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F938-1F3FE-200D-2642-FE0F","label":"man cartwheeling: medium-dark skin tone","order":2778,"unicode":"\u{1F938}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F938-1F3FF-200D-2642-FE0F","label":"man cartwheeling: dark skin tone","order":2780,"unicode":"\u{1F938}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F938-200D-2640-FE0F","label":"woman cartwheeling","order":2782,"tags":["cartwheel","gymnastics","woman"],"unicode":"\u{1F938}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F938-1F3FB-200D-2640-FE0F","label":"woman cartwheeling: light skin tone","order":2784,"unicode":"\u{1F938}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F938-1F3FC-200D-2640-FE0F","label":"woman cartwheeling: medium-light skin tone","order":2786,"unicode":"\u{1F938}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F938-1F3FD-200D-2640-FE0F","label":"woman cartwheeling: medium skin tone","order":2788,"unicode":"\u{1F938}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F938-1F3FE-200D-2640-FE0F","label":"woman cartwheeling: medium-dark skin tone","order":2790,"unicode":"\u{1F938}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F938-1F3FF-200D-2640-FE0F","label":"woman cartwheeling: dark skin tone","order":2792,"unicode":"\u{1F938}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F93C","label":"people wrestling","order":2794,"tags":["wrestle","wrestler"],"unicode":"\u{1F93C}"},{"group":1,"hexcode":"1F93C-200D-2642-FE0F","label":"men wrestling","order":2795,"tags":["men","wrestle"],"unicode":"\u{1F93C}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93C-200D-2640-FE0F","label":"women wrestling","order":2797,"tags":["women","wrestle"],"unicode":"\u{1F93C}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93D","label":"person playing water polo","order":2799,"tags":["polo","water"],"unicode":"\u{1F93D}","skins":[{"group":1,"hexcode":"1F93D-1F3FB","label":"person playing water polo: light skin tone","order":2800,"unicode":"\u{1F93D}\u{1F3FB}"},{"group":1,"hexcode":"1F93D-1F3FC","label":"person playing water polo: medium-light skin tone","order":2801,"unicode":"\u{1F93D}\u{1F3FC}"},{"group":1,"hexcode":"1F93D-1F3FD","label":"person playing water polo: medium skin tone","order":2802,"unicode":"\u{1F93D}\u{1F3FD}"},{"group":1,"hexcode":"1F93D-1F3FE","label":"person playing water polo: medium-dark skin tone","order":2803,"unicode":"\u{1F93D}\u{1F3FE}"},{"group":1,"hexcode":"1F93D-1F3FF","label":"person playing water polo: dark skin tone","order":2804,"unicode":"\u{1F93D}\u{1F3FF}"}]},{"group":1,"hexcode":"1F93D-200D-2642-FE0F","label":"man playing water polo","order":2805,"tags":["man","water polo"],"unicode":"\u{1F93D}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F93D-1F3FB-200D-2642-FE0F","label":"man playing water polo: light skin tone","order":2807,"unicode":"\u{1F93D}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FC-200D-2642-FE0F","label":"man playing water polo: medium-light skin tone","order":2809,"unicode":"\u{1F93D}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FD-200D-2642-FE0F","label":"man playing water polo: medium skin tone","order":2811,"unicode":"\u{1F93D}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FE-200D-2642-FE0F","label":"man playing water polo: medium-dark skin tone","order":2813,"unicode":"\u{1F93D}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FF-200D-2642-FE0F","label":"man playing water polo: dark skin tone","order":2815,"unicode":"\u{1F93D}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F93D-200D-2640-FE0F","label":"woman playing water polo","order":2817,"tags":["water polo","woman"],"unicode":"\u{1F93D}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F93D-1F3FB-200D-2640-FE0F","label":"woman playing water polo: light skin tone","order":2819,"unicode":"\u{1F93D}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FC-200D-2640-FE0F","label":"woman playing water polo: medium-light skin tone","order":2821,"unicode":"\u{1F93D}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FD-200D-2640-FE0F","label":"woman playing water polo: medium skin tone","order":2823,"unicode":"\u{1F93D}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FE-200D-2640-FE0F","label":"woman playing water polo: medium-dark skin tone","order":2825,"unicode":"\u{1F93D}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93D-1F3FF-200D-2640-FE0F","label":"woman playing water polo: dark skin tone","order":2827,"unicode":"\u{1F93D}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F93E","label":"person playing handball","order":2829,"tags":["ball","handball"],"unicode":"\u{1F93E}","skins":[{"group":1,"hexcode":"1F93E-1F3FB","label":"person playing handball: light skin tone","order":2830,"unicode":"\u{1F93E}\u{1F3FB}"},{"group":1,"hexcode":"1F93E-1F3FC","label":"person playing handball: medium-light skin tone","order":2831,"unicode":"\u{1F93E}\u{1F3FC}"},{"group":1,"hexcode":"1F93E-1F3FD","label":"person playing handball: medium skin tone","order":2832,"unicode":"\u{1F93E}\u{1F3FD}"},{"group":1,"hexcode":"1F93E-1F3FE","label":"person playing handball: medium-dark skin tone","order":2833,"unicode":"\u{1F93E}\u{1F3FE}"},{"group":1,"hexcode":"1F93E-1F3FF","label":"person playing handball: dark skin tone","order":2834,"unicode":"\u{1F93E}\u{1F3FF}"}]},{"group":1,"hexcode":"1F93E-200D-2642-FE0F","label":"man playing handball","order":2835,"tags":["handball","man"],"unicode":"\u{1F93E}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F93E-1F3FB-200D-2642-FE0F","label":"man playing handball: light skin tone","order":2837,"unicode":"\u{1F93E}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FC-200D-2642-FE0F","label":"man playing handball: medium-light skin tone","order":2839,"unicode":"\u{1F93E}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FD-200D-2642-FE0F","label":"man playing handball: medium skin tone","order":2841,"unicode":"\u{1F93E}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FE-200D-2642-FE0F","label":"man playing handball: medium-dark skin tone","order":2843,"unicode":"\u{1F93E}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FF-200D-2642-FE0F","label":"man playing handball: dark skin tone","order":2845,"unicode":"\u{1F93E}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F93E-200D-2640-FE0F","label":"woman playing handball","order":2847,"tags":["handball","woman"],"unicode":"\u{1F93E}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F93E-1F3FB-200D-2640-FE0F","label":"woman playing handball: light skin tone","order":2849,"unicode":"\u{1F93E}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FC-200D-2640-FE0F","label":"woman playing handball: medium-light skin tone","order":2851,"unicode":"\u{1F93E}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FD-200D-2640-FE0F","label":"woman playing handball: medium skin tone","order":2853,"unicode":"\u{1F93E}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FE-200D-2640-FE0F","label":"woman playing handball: medium-dark skin tone","order":2855,"unicode":"\u{1F93E}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F93E-1F3FF-200D-2640-FE0F","label":"woman playing handball: dark skin tone","order":2857,"unicode":"\u{1F93E}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F939","label":"person juggling","order":2859,"tags":["balance","juggle","multitask","skill"],"unicode":"\u{1F939}","skins":[{"group":1,"hexcode":"1F939-1F3FB","label":"person juggling: light skin tone","order":2860,"unicode":"\u{1F939}\u{1F3FB}"},{"group":1,"hexcode":"1F939-1F3FC","label":"person juggling: medium-light skin tone","order":2861,"unicode":"\u{1F939}\u{1F3FC}"},{"group":1,"hexcode":"1F939-1F3FD","label":"person juggling: medium skin tone","order":2862,"unicode":"\u{1F939}\u{1F3FD}"},{"group":1,"hexcode":"1F939-1F3FE","label":"person juggling: medium-dark skin tone","order":2863,"unicode":"\u{1F939}\u{1F3FE}"},{"group":1,"hexcode":"1F939-1F3FF","label":"person juggling: dark skin tone","order":2864,"unicode":"\u{1F939}\u{1F3FF}"}]},{"group":1,"hexcode":"1F939-200D-2642-FE0F","label":"man juggling","order":2865,"tags":["juggling","man","multitask"],"unicode":"\u{1F939}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F939-1F3FB-200D-2642-FE0F","label":"man juggling: light skin tone","order":2867,"unicode":"\u{1F939}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F939-1F3FC-200D-2642-FE0F","label":"man juggling: medium-light skin tone","order":2869,"unicode":"\u{1F939}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F939-1F3FD-200D-2642-FE0F","label":"man juggling: medium skin tone","order":2871,"unicode":"\u{1F939}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F939-1F3FE-200D-2642-FE0F","label":"man juggling: medium-dark skin tone","order":2873,"unicode":"\u{1F939}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F939-1F3FF-200D-2642-FE0F","label":"man juggling: dark skin tone","order":2875,"unicode":"\u{1F939}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F939-200D-2640-FE0F","label":"woman juggling","order":2877,"tags":["juggling","multitask","woman"],"unicode":"\u{1F939}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F939-1F3FB-200D-2640-FE0F","label":"woman juggling: light skin tone","order":2879,"unicode":"\u{1F939}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F939-1F3FC-200D-2640-FE0F","label":"woman juggling: medium-light skin tone","order":2881,"unicode":"\u{1F939}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F939-1F3FD-200D-2640-FE0F","label":"woman juggling: medium skin tone","order":2883,"unicode":"\u{1F939}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F939-1F3FE-200D-2640-FE0F","label":"woman juggling: medium-dark skin tone","order":2885,"unicode":"\u{1F939}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F939-1F3FF-200D-2640-FE0F","label":"woman juggling: dark skin tone","order":2887,"unicode":"\u{1F939}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F9D8","label":"person in lotus position","order":2889,"tags":["meditation","yoga"],"unicode":"\u{1F9D8}","skins":[{"group":1,"hexcode":"1F9D8-1F3FB","label":"person in lotus position: light skin tone","order":2890,"unicode":"\u{1F9D8}\u{1F3FB}"},{"group":1,"hexcode":"1F9D8-1F3FC","label":"person in lotus position: medium-light skin tone","order":2891,"unicode":"\u{1F9D8}\u{1F3FC}"},{"group":1,"hexcode":"1F9D8-1F3FD","label":"person in lotus position: medium skin tone","order":2892,"unicode":"\u{1F9D8}\u{1F3FD}"},{"group":1,"hexcode":"1F9D8-1F3FE","label":"person in lotus position: medium-dark skin tone","order":2893,"unicode":"\u{1F9D8}\u{1F3FE}"},{"group":1,"hexcode":"1F9D8-1F3FF","label":"person in lotus position: dark skin tone","order":2894,"unicode":"\u{1F9D8}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D8-200D-2642-FE0F","label":"man in lotus position","order":2895,"tags":["meditation","yoga"],"unicode":"\u{1F9D8}\u200D\u2642\uFE0F","skins":[{"group":1,"hexcode":"1F9D8-1F3FB-200D-2642-FE0F","label":"man in lotus position: light skin tone","order":2897,"unicode":"\u{1F9D8}\u{1F3FB}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FC-200D-2642-FE0F","label":"man in lotus position: medium-light skin tone","order":2899,"unicode":"\u{1F9D8}\u{1F3FC}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FD-200D-2642-FE0F","label":"man in lotus position: medium skin tone","order":2901,"unicode":"\u{1F9D8}\u{1F3FD}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FE-200D-2642-FE0F","label":"man in lotus position: medium-dark skin tone","order":2903,"unicode":"\u{1F9D8}\u{1F3FE}\u200D\u2642\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FF-200D-2642-FE0F","label":"man in lotus position: dark skin tone","order":2905,"unicode":"\u{1F9D8}\u{1F3FF}\u200D\u2642\uFE0F"}]},{"group":1,"hexcode":"1F9D8-200D-2640-FE0F","label":"woman in lotus position","order":2907,"tags":["meditation","yoga"],"unicode":"\u{1F9D8}\u200D\u2640\uFE0F","skins":[{"group":1,"hexcode":"1F9D8-1F3FB-200D-2640-FE0F","label":"woman in lotus position: light skin tone","order":2909,"unicode":"\u{1F9D8}\u{1F3FB}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FC-200D-2640-FE0F","label":"woman in lotus position: medium-light skin tone","order":2911,"unicode":"\u{1F9D8}\u{1F3FC}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FD-200D-2640-FE0F","label":"woman in lotus position: medium skin tone","order":2913,"unicode":"\u{1F9D8}\u{1F3FD}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FE-200D-2640-FE0F","label":"woman in lotus position: medium-dark skin tone","order":2915,"unicode":"\u{1F9D8}\u{1F3FE}\u200D\u2640\uFE0F"},{"group":1,"hexcode":"1F9D8-1F3FF-200D-2640-FE0F","label":"woman in lotus position: dark skin tone","order":2917,"unicode":"\u{1F9D8}\u{1F3FF}\u200D\u2640\uFE0F"}]},{"group":1,"hexcode":"1F6C0","label":"person taking bath","order":2919,"tags":["bath","bathtub"],"unicode":"\u{1F6C0}","skins":[{"group":1,"hexcode":"1F6C0-1F3FB","label":"person taking bath: light skin tone","order":2920,"unicode":"\u{1F6C0}\u{1F3FB}"},{"group":1,"hexcode":"1F6C0-1F3FC","label":"person taking bath: medium-light skin tone","order":2921,"unicode":"\u{1F6C0}\u{1F3FC}"},{"group":1,"hexcode":"1F6C0-1F3FD","label":"person taking bath: medium skin tone","order":2922,"unicode":"\u{1F6C0}\u{1F3FD}"},{"group":1,"hexcode":"1F6C0-1F3FE","label":"person taking bath: medium-dark skin tone","order":2923,"unicode":"\u{1F6C0}\u{1F3FE}"},{"group":1,"hexcode":"1F6C0-1F3FF","label":"person taking bath: dark skin tone","order":2924,"unicode":"\u{1F6C0}\u{1F3FF}"}]},{"group":1,"hexcode":"1F6CC","label":"person in bed","order":2925,"tags":["good night","hotel","sleep"],"unicode":"\u{1F6CC}","skins":[{"group":1,"hexcode":"1F6CC-1F3FB","label":"person in bed: light skin tone","order":2926,"unicode":"\u{1F6CC}\u{1F3FB}"},{"group":1,"hexcode":"1F6CC-1F3FC","label":"person in bed: medium-light skin tone","order":2927,"unicode":"\u{1F6CC}\u{1F3FC}"},{"group":1,"hexcode":"1F6CC-1F3FD","label":"person in bed: medium skin tone","order":2928,"unicode":"\u{1F6CC}\u{1F3FD}"},{"group":1,"hexcode":"1F6CC-1F3FE","label":"person in bed: medium-dark skin tone","order":2929,"unicode":"\u{1F6CC}\u{1F3FE}"},{"group":1,"hexcode":"1F6CC-1F3FF","label":"person in bed: dark skin tone","order":2930,"unicode":"\u{1F6CC}\u{1F3FF}"}]},{"group":1,"hexcode":"1F9D1-200D-1F91D-200D-1F9D1","label":"people holding hands","order":2931,"tags":["couple","hand","hold","holding hands","person"],"unicode":"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}","skins":[{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FB","label":"people holding hands: light skin tone","order":2932,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FC","label":"people holding hands: light skin tone, medium-light skin tone","order":2933,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FD","label":"people holding hands: light skin tone, medium skin tone","order":2934,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FE","label":"people holding hands: light skin tone, medium-dark skin tone","order":2935,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FF","label":"people holding hands: light skin tone, dark skin tone","order":2936,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FB","label":"people holding hands: medium-light skin tone, light skin tone","order":2937,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FC","label":"people holding hands: medium-light skin tone","order":2938,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FD","label":"people holding hands: medium-light skin tone, medium skin tone","order":2939,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FE","label":"people holding hands: medium-light skin tone, medium-dark skin tone","order":2940,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FF","label":"people holding hands: medium-light skin tone, dark skin tone","order":2941,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FB","label":"people holding hands: medium skin tone, light skin tone","order":2942,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FC","label":"people holding hands: medium skin tone, medium-light skin tone","order":2943,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FD","label":"people holding hands: medium skin tone","order":2944,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FE","label":"people holding hands: medium skin tone, medium-dark skin tone","order":2945,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FF","label":"people holding hands: medium skin tone, dark skin tone","order":2946,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FB","label":"people holding hands: medium-dark skin tone, light skin tone","order":2947,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FC","label":"people holding hands: medium-dark skin tone, medium-light skin tone","order":2948,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FD","label":"people holding hands: medium-dark skin tone, medium skin tone","order":2949,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FE","label":"people holding hands: medium-dark skin tone","order":2950,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FF","label":"people holding hands: medium-dark skin tone, dark skin tone","order":2951,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FB","label":"people holding hands: dark skin tone, light skin tone","order":2952,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FC","label":"people holding hands: dark skin tone, medium-light skin tone","order":2953,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FD","label":"people holding hands: dark skin tone, medium skin tone","order":2954,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FE","label":"people holding hands: dark skin tone, medium-dark skin tone","order":2955,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FF","label":"people holding hands: dark skin tone","order":2956,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FF}"}]},{"group":1,"hexcode":"1F46D","label":"women holding hands","order":2957,"tags":["couple","hand","holding hands","women"],"unicode":"\u{1F46D}","skins":[{"group":1,"hexcode":"1F46D-1F3FB","label":"women holding hands: light skin tone","order":2958,"unicode":"\u{1F46D}\u{1F3FB}"},{"group":1,"hexcode":"1F46D-1F3FC","label":"women holding hands: medium-light skin tone","order":2964,"unicode":"\u{1F46D}\u{1F3FC}"},{"group":1,"hexcode":"1F46D-1F3FD","label":"women holding hands: medium skin tone","order":2970,"unicode":"\u{1F46D}\u{1F3FD}"},{"group":1,"hexcode":"1F46D-1F3FE","label":"women holding hands: medium-dark skin tone","order":2976,"unicode":"\u{1F46D}\u{1F3FE}"},{"group":1,"hexcode":"1F46D-1F3FF","label":"women holding hands: dark skin tone","order":2982,"unicode":"\u{1F46D}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F469-1F3FC","label":"women holding hands: light skin tone, medium-light skin tone","order":2959,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F469-1F3FD","label":"women holding hands: light skin tone, medium skin tone","order":2960,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F469-1F3FE","label":"women holding hands: light skin tone, medium-dark skin tone","order":2961,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F469-1F3FF","label":"women holding hands: light skin tone, dark skin tone","order":2962,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F469-1F3FB","label":"women holding hands: medium-light skin tone, light skin tone","order":2963,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F469-1F3FD","label":"women holding hands: medium-light skin tone, medium skin tone","order":2965,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F469-1F3FE","label":"women holding hands: medium-light skin tone, medium-dark skin tone","order":2966,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F469-1F3FF","label":"women holding hands: medium-light skin tone, dark skin tone","order":2967,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F469-1F3FB","label":"women holding hands: medium skin tone, light skin tone","order":2968,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F469-1F3FC","label":"women holding hands: medium skin tone, medium-light skin tone","order":2969,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F469-1F3FE","label":"women holding hands: medium skin tone, medium-dark skin tone","order":2971,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F469-1F3FF","label":"women holding hands: medium skin tone, dark skin tone","order":2972,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F469-1F3FB","label":"women holding hands: medium-dark skin tone, light skin tone","order":2973,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F469-1F3FC","label":"women holding hands: medium-dark skin tone, medium-light skin tone","order":2974,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F469-1F3FD","label":"women holding hands: medium-dark skin tone, medium skin tone","order":2975,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F469-1F3FF","label":"women holding hands: medium-dark skin tone, dark skin tone","order":2977,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F469-1F3FB","label":"women holding hands: dark skin tone, light skin tone","order":2978,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F469-1F3FC","label":"women holding hands: dark skin tone, medium-light skin tone","order":2979,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F469-1F3FD","label":"women holding hands: dark skin tone, medium skin tone","order":2980,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F469-1F3FE","label":"women holding hands: dark skin tone, medium-dark skin tone","order":2981,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F469}\u{1F3FE}"}]},{"group":1,"hexcode":"1F46B","label":"woman and man holding hands","order":2983,"tags":["couple","hand","hold","holding hands","man","woman"],"unicode":"\u{1F46B}","skins":[{"group":1,"hexcode":"1F46B-1F3FB","label":"woman and man holding hands: light skin tone","order":2984,"unicode":"\u{1F46B}\u{1F3FB}"},{"group":1,"hexcode":"1F46B-1F3FC","label":"woman and man holding hands: medium-light skin tone","order":2990,"unicode":"\u{1F46B}\u{1F3FC}"},{"group":1,"hexcode":"1F46B-1F3FD","label":"woman and man holding hands: medium skin tone","order":2996,"unicode":"\u{1F46B}\u{1F3FD}"},{"group":1,"hexcode":"1F46B-1F3FE","label":"woman and man holding hands: medium-dark skin tone","order":3002,"unicode":"\u{1F46B}\u{1F3FE}"},{"group":1,"hexcode":"1F46B-1F3FF","label":"woman and man holding hands: dark skin tone","order":3008,"unicode":"\u{1F46B}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F468-1F3FC","label":"woman and man holding hands: light skin tone, medium-light skin tone","order":2985,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F468-1F3FD","label":"woman and man holding hands: light skin tone, medium skin tone","order":2986,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F468-1F3FE","label":"woman and man holding hands: light skin tone, medium-dark skin tone","order":2987,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FB-200D-1F91D-200D-1F468-1F3FF","label":"woman and man holding hands: light skin tone, dark skin tone","order":2988,"unicode":"\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F468-1F3FB","label":"woman and man holding hands: medium-light skin tone, light skin tone","order":2989,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F468-1F3FD","label":"woman and man holding hands: medium-light skin tone, medium skin tone","order":2991,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F468-1F3FE","label":"woman and man holding hands: medium-light skin tone, medium-dark skin tone","order":2992,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FC-200D-1F91D-200D-1F468-1F3FF","label":"woman and man holding hands: medium-light skin tone, dark skin tone","order":2993,"unicode":"\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F468-1F3FB","label":"woman and man holding hands: medium skin tone, light skin tone","order":2994,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F468-1F3FC","label":"woman and man holding hands: medium skin tone, medium-light skin tone","order":2995,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F468-1F3FE","label":"woman and man holding hands: medium skin tone, medium-dark skin tone","order":2997,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FD-200D-1F91D-200D-1F468-1F3FF","label":"woman and man holding hands: medium skin tone, dark skin tone","order":2998,"unicode":"\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F468-1F3FB","label":"woman and man holding hands: medium-dark skin tone, light skin tone","order":2999,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F468-1F3FC","label":"woman and man holding hands: medium-dark skin tone, medium-light skin tone","order":3000,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F468-1F3FD","label":"woman and man holding hands: medium-dark skin tone, medium skin tone","order":3001,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-1F91D-200D-1F468-1F3FF","label":"woman and man holding hands: medium-dark skin tone, dark skin tone","order":3003,"unicode":"\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F468-1F3FB","label":"woman and man holding hands: dark skin tone, light skin tone","order":3004,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F468-1F3FC","label":"woman and man holding hands: dark skin tone, medium-light skin tone","order":3005,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F468-1F3FD","label":"woman and man holding hands: dark skin tone, medium skin tone","order":3006,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-1F91D-200D-1F468-1F3FE","label":"woman and man holding hands: dark skin tone, medium-dark skin tone","order":3007,"unicode":"\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"}]},{"group":1,"hexcode":"1F46C","label":"men holding hands","order":3009,"tags":["couple","gemini","holding hands","man","men","twins","zodiac"],"unicode":"\u{1F46C}","skins":[{"group":1,"hexcode":"1F46C-1F3FB","label":"men holding hands: light skin tone","order":3010,"unicode":"\u{1F46C}\u{1F3FB}"},{"group":1,"hexcode":"1F46C-1F3FC","label":"men holding hands: medium-light skin tone","order":3016,"unicode":"\u{1F46C}\u{1F3FC}"},{"group":1,"hexcode":"1F46C-1F3FD","label":"men holding hands: medium skin tone","order":3022,"unicode":"\u{1F46C}\u{1F3FD}"},{"group":1,"hexcode":"1F46C-1F3FE","label":"men holding hands: medium-dark skin tone","order":3028,"unicode":"\u{1F46C}\u{1F3FE}"},{"group":1,"hexcode":"1F46C-1F3FF","label":"men holding hands: dark skin tone","order":3034,"unicode":"\u{1F46C}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FB-200D-1F91D-200D-1F468-1F3FC","label":"men holding hands: light skin tone, medium-light skin tone","order":3011,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FB-200D-1F91D-200D-1F468-1F3FD","label":"men holding hands: light skin tone, medium skin tone","order":3012,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FB-200D-1F91D-200D-1F468-1F3FE","label":"men holding hands: light skin tone, medium-dark skin tone","order":3013,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FB-200D-1F91D-200D-1F468-1F3FF","label":"men holding hands: light skin tone, dark skin tone","order":3014,"unicode":"\u{1F468}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F91D-200D-1F468-1F3FB","label":"men holding hands: medium-light skin tone, light skin tone","order":3015,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F91D-200D-1F468-1F3FD","label":"men holding hands: medium-light skin tone, medium skin tone","order":3017,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F91D-200D-1F468-1F3FE","label":"men holding hands: medium-light skin tone, medium-dark skin tone","order":3018,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FC-200D-1F91D-200D-1F468-1F3FF","label":"men holding hands: medium-light skin tone, dark skin tone","order":3019,"unicode":"\u{1F468}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F91D-200D-1F468-1F3FB","label":"men holding hands: medium skin tone, light skin tone","order":3020,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F91D-200D-1F468-1F3FC","label":"men holding hands: medium skin tone, medium-light skin tone","order":3021,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F91D-200D-1F468-1F3FE","label":"men holding hands: medium skin tone, medium-dark skin tone","order":3023,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FD-200D-1F91D-200D-1F468-1F3FF","label":"men holding hands: medium skin tone, dark skin tone","order":3024,"unicode":"\u{1F468}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F91D-200D-1F468-1F3FB","label":"men holding hands: medium-dark skin tone, light skin tone","order":3025,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F91D-200D-1F468-1F3FC","label":"men holding hands: medium-dark skin tone, medium-light skin tone","order":3026,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F91D-200D-1F468-1F3FD","label":"men holding hands: medium-dark skin tone, medium skin tone","order":3027,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FE-200D-1F91D-200D-1F468-1F3FF","label":"men holding hands: medium-dark skin tone, dark skin tone","order":3029,"unicode":"\u{1F468}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F91D-200D-1F468-1F3FB","label":"men holding hands: dark skin tone, light skin tone","order":3030,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F91D-200D-1F468-1F3FC","label":"men holding hands: dark skin tone, medium-light skin tone","order":3031,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F91D-200D-1F468-1F3FD","label":"men holding hands: dark skin tone, medium skin tone","order":3032,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FF-200D-1F91D-200D-1F468-1F3FE","label":"men holding hands: dark skin tone, medium-dark skin tone","order":3033,"unicode":"\u{1F468}\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F468}\u{1F3FE}"}]},{"group":1,"hexcode":"1F48F","label":"kiss","order":3035,"tags":["couple"],"unicode":"\u{1F48F}","skins":[{"group":1,"hexcode":"1F48F-1F3FB","label":"kiss: light skin tone","order":3036,"unicode":"\u{1F48F}\u{1F3FB}"},{"group":1,"hexcode":"1F48F-1F3FC","label":"kiss: medium-light skin tone","order":3037,"unicode":"\u{1F48F}\u{1F3FC}"},{"group":1,"hexcode":"1F48F-1F3FD","label":"kiss: medium skin tone","order":3038,"unicode":"\u{1F48F}\u{1F3FD}"},{"group":1,"hexcode":"1F48F-1F3FE","label":"kiss: medium-dark skin tone","order":3039,"unicode":"\u{1F48F}\u{1F3FE}"},{"group":1,"hexcode":"1F48F-1F3FF","label":"kiss: dark skin tone","order":3040,"unicode":"\u{1F48F}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC","label":"kiss: person, person, light skin tone, medium-light skin tone","order":3041,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD","label":"kiss: person, person, light skin tone, medium skin tone","order":3043,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE","label":"kiss: person, person, light skin tone, medium-dark skin tone","order":3045,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF","label":"kiss: person, person, light skin tone, dark skin tone","order":3047,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB","label":"kiss: person, person, medium-light skin tone, light skin tone","order":3049,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD","label":"kiss: person, person, medium-light skin tone, medium skin tone","order":3051,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE","label":"kiss: person, person, medium-light skin tone, medium-dark skin tone","order":3053,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF","label":"kiss: person, person, medium-light skin tone, dark skin tone","order":3055,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB","label":"kiss: person, person, medium skin tone, light skin tone","order":3057,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC","label":"kiss: person, person, medium skin tone, medium-light skin tone","order":3059,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE","label":"kiss: person, person, medium skin tone, medium-dark skin tone","order":3061,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF","label":"kiss: person, person, medium skin tone, dark skin tone","order":3063,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB","label":"kiss: person, person, medium-dark skin tone, light skin tone","order":3065,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC","label":"kiss: person, person, medium-dark skin tone, medium-light skin tone","order":3067,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD","label":"kiss: person, person, medium-dark skin tone, medium skin tone","order":3069,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF","label":"kiss: person, person, medium-dark skin tone, dark skin tone","order":3071,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB","label":"kiss: person, person, dark skin tone, light skin tone","order":3073,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC","label":"kiss: person, person, dark skin tone, medium-light skin tone","order":3075,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD","label":"kiss: person, person, dark skin tone, medium skin tone","order":3077,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE","label":"kiss: person, person, dark skin tone, medium-dark skin tone","order":3079,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F9D1}\u{1F3FE}"}]},{"group":1,"hexcode":"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468","label":"kiss: woman, man","order":3081,"tags":["couple","kiss","man","woman"],"unicode":"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: woman, man, light skin tone","order":3083,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: woman, man, light skin tone, medium-light skin tone","order":3085,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: woman, man, light skin tone, medium skin tone","order":3087,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: woman, man, light skin tone, medium-dark skin tone","order":3089,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: woman, man, light skin tone, dark skin tone","order":3091,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: woman, man, medium-light skin tone, light skin tone","order":3093,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: woman, man, medium-light skin tone","order":3095,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: woman, man, medium-light skin tone, medium skin tone","order":3097,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: woman, man, medium-light skin tone, medium-dark skin tone","order":3099,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: woman, man, medium-light skin tone, dark skin tone","order":3101,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: woman, man, medium skin tone, light skin tone","order":3103,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: woman, man, medium skin tone, medium-light skin tone","order":3105,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: woman, man, medium skin tone","order":3107,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: woman, man, medium skin tone, medium-dark skin tone","order":3109,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: woman, man, medium skin tone, dark skin tone","order":3111,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: woman, man, medium-dark skin tone, light skin tone","order":3113,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: woman, man, medium-dark skin tone, medium-light skin tone","order":3115,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: woman, man, medium-dark skin tone, medium skin tone","order":3117,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: woman, man, medium-dark skin tone","order":3119,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: woman, man, medium-dark skin tone, dark skin tone","order":3121,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: woman, man, dark skin tone, light skin tone","order":3123,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: woman, man, dark skin tone, medium-light skin tone","order":3125,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: woman, man, dark skin tone, medium skin tone","order":3127,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: woman, man, dark skin tone, medium-dark skin tone","order":3129,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: woman, man, dark skin tone","order":3131,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"}]},{"group":1,"hexcode":"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468","label":"kiss: man, man","order":3133,"tags":["couple","kiss","man"],"unicode":"\u{1F468}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: man, man, light skin tone","order":3135,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: man, man, light skin tone, medium-light skin tone","order":3137,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: man, man, light skin tone, medium skin tone","order":3139,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: man, man, light skin tone, medium-dark skin tone","order":3141,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: man, man, light skin tone, dark skin tone","order":3143,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: man, man, medium-light skin tone, light skin tone","order":3145,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: man, man, medium-light skin tone","order":3147,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: man, man, medium-light skin tone, medium skin tone","order":3149,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: man, man, medium-light skin tone, medium-dark skin tone","order":3151,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: man, man, medium-light skin tone, dark skin tone","order":3153,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: man, man, medium skin tone, light skin tone","order":3155,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: man, man, medium skin tone, medium-light skin tone","order":3157,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: man, man, medium skin tone","order":3159,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: man, man, medium skin tone, medium-dark skin tone","order":3161,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: man, man, medium skin tone, dark skin tone","order":3163,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: man, man, medium-dark skin tone, light skin tone","order":3165,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: man, man, medium-dark skin tone, medium-light skin tone","order":3167,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: man, man, medium-dark skin tone, medium skin tone","order":3169,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: man, man, medium-dark skin tone","order":3171,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: man, man, medium-dark skin tone, dark skin tone","order":3173,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB","label":"kiss: man, man, dark skin tone, light skin tone","order":3175,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC","label":"kiss: man, man, dark skin tone, medium-light skin tone","order":3177,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD","label":"kiss: man, man, dark skin tone, medium skin tone","order":3179,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE","label":"kiss: man, man, dark skin tone, medium-dark skin tone","order":3181,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF","label":"kiss: man, man, dark skin tone","order":3183,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}\u{1F3FF}"}]},{"group":1,"hexcode":"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469","label":"kiss: woman, woman","order":3185,"tags":["couple","kiss","woman"],"unicode":"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB","label":"kiss: woman, woman, light skin tone","order":3187,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC","label":"kiss: woman, woman, light skin tone, medium-light skin tone","order":3189,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD","label":"kiss: woman, woman, light skin tone, medium skin tone","order":3191,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE","label":"kiss: woman, woman, light skin tone, medium-dark skin tone","order":3193,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF","label":"kiss: woman, woman, light skin tone, dark skin tone","order":3195,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB","label":"kiss: woman, woman, medium-light skin tone, light skin tone","order":3197,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC","label":"kiss: woman, woman, medium-light skin tone","order":3199,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD","label":"kiss: woman, woman, medium-light skin tone, medium skin tone","order":3201,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE","label":"kiss: woman, woman, medium-light skin tone, medium-dark skin tone","order":3203,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF","label":"kiss: woman, woman, medium-light skin tone, dark skin tone","order":3205,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB","label":"kiss: woman, woman, medium skin tone, light skin tone","order":3207,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC","label":"kiss: woman, woman, medium skin tone, medium-light skin tone","order":3209,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD","label":"kiss: woman, woman, medium skin tone","order":3211,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE","label":"kiss: woman, woman, medium skin tone, medium-dark skin tone","order":3213,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF","label":"kiss: woman, woman, medium skin tone, dark skin tone","order":3215,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB","label":"kiss: woman, woman, medium-dark skin tone, light skin tone","order":3217,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC","label":"kiss: woman, woman, medium-dark skin tone, medium-light skin tone","order":3219,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD","label":"kiss: woman, woman, medium-dark skin tone, medium skin tone","order":3221,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE","label":"kiss: woman, woman, medium-dark skin tone","order":3223,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF","label":"kiss: woman, woman, medium-dark skin tone, dark skin tone","order":3225,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB","label":"kiss: woman, woman, dark skin tone, light skin tone","order":3227,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC","label":"kiss: woman, woman, dark skin tone, medium-light skin tone","order":3229,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD","label":"kiss: woman, woman, dark skin tone, medium skin tone","order":3231,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE","label":"kiss: woman, woman, dark skin tone, medium-dark skin tone","order":3233,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF","label":"kiss: woman, woman, dark skin tone","order":3235,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}\u{1F3FF}"}]},{"group":1,"hexcode":"1F491","label":"couple with heart","order":3237,"tags":["couple","love"],"unicode":"\u{1F491}","skins":[{"group":1,"hexcode":"1F491-1F3FB","label":"couple with heart: light skin tone","order":3238,"unicode":"\u{1F491}\u{1F3FB}"},{"group":1,"hexcode":"1F491-1F3FC","label":"couple with heart: medium-light skin tone","order":3239,"unicode":"\u{1F491}\u{1F3FC}"},{"group":1,"hexcode":"1F491-1F3FD","label":"couple with heart: medium skin tone","order":3240,"unicode":"\u{1F491}\u{1F3FD}"},{"group":1,"hexcode":"1F491-1F3FE","label":"couple with heart: medium-dark skin tone","order":3241,"unicode":"\u{1F491}\u{1F3FE}"},{"group":1,"hexcode":"1F491-1F3FF","label":"couple with heart: dark skin tone","order":3242,"unicode":"\u{1F491}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FC","label":"couple with heart: person, person, light skin tone, medium-light skin tone","order":3243,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FD","label":"couple with heart: person, person, light skin tone, medium skin tone","order":3245,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FE","label":"couple with heart: person, person, light skin tone, medium-dark skin tone","order":3247,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FF","label":"couple with heart: person, person, light skin tone, dark skin tone","order":3249,"unicode":"\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FB","label":"couple with heart: person, person, medium-light skin tone, light skin tone","order":3251,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FD","label":"couple with heart: person, person, medium-light skin tone, medium skin tone","order":3253,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FE","label":"couple with heart: person, person, medium-light skin tone, medium-dark skin tone","order":3255,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FF","label":"couple with heart: person, person, medium-light skin tone, dark skin tone","order":3257,"unicode":"\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FB","label":"couple with heart: person, person, medium skin tone, light skin tone","order":3259,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FC","label":"couple with heart: person, person, medium skin tone, medium-light skin tone","order":3261,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FE","label":"couple with heart: person, person, medium skin tone, medium-dark skin tone","order":3263,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FE}"},{"group":1,"hexcode":"1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FF","label":"couple with heart: person, person, medium skin tone, dark skin tone","order":3265,"unicode":"\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FB","label":"couple with heart: person, person, medium-dark skin tone, light skin tone","order":3267,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FC","label":"couple with heart: person, person, medium-dark skin tone, medium-light skin tone","order":3269,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FD","label":"couple with heart: person, person, medium-dark skin tone, medium skin tone","order":3271,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FF","label":"couple with heart: person, person, medium-dark skin tone, dark skin tone","order":3273,"unicode":"\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FF}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FB","label":"couple with heart: person, person, dark skin tone, light skin tone","order":3275,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FB}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FC","label":"couple with heart: person, person, dark skin tone, medium-light skin tone","order":3277,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FC}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FD","label":"couple with heart: person, person, dark skin tone, medium skin tone","order":3279,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FD}"},{"group":1,"hexcode":"1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FE","label":"couple with heart: person, person, dark skin tone, medium-dark skin tone","order":3281,"unicode":"\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F9D1}\u{1F3FE}"}]},{"group":1,"hexcode":"1F469-200D-2764-FE0F-200D-1F468","label":"couple with heart: woman, man","order":3283,"tags":["couple","couple with heart","love","man","woman"],"unicode":"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F468}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: woman, man, light skin tone","order":3285,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: woman, man, light skin tone, medium-light skin tone","order":3287,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: woman, man, light skin tone, medium skin tone","order":3289,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: woman, man, light skin tone, medium-dark skin tone","order":3291,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: woman, man, light skin tone, dark skin tone","order":3293,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: woman, man, medium-light skin tone, light skin tone","order":3295,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: woman, man, medium-light skin tone","order":3297,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: woman, man, medium-light skin tone, medium skin tone","order":3299,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: woman, man, medium-light skin tone, medium-dark skin tone","order":3301,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: woman, man, medium-light skin tone, dark skin tone","order":3303,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: woman, man, medium skin tone, light skin tone","order":3305,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: woman, man, medium skin tone, medium-light skin tone","order":3307,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: woman, man, medium skin tone","order":3309,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: woman, man, medium skin tone, medium-dark skin tone","order":3311,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: woman, man, medium skin tone, dark skin tone","order":3313,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: woman, man, medium-dark skin tone, light skin tone","order":3315,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: woman, man, medium-dark skin tone, medium-light skin tone","order":3317,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: woman, man, medium-dark skin tone, medium skin tone","order":3319,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: woman, man, medium-dark skin tone","order":3321,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: woman, man, medium-dark skin tone, dark skin tone","order":3323,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: woman, man, dark skin tone, light skin tone","order":3325,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: woman, man, dark skin tone, medium-light skin tone","order":3327,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: woman, man, dark skin tone, medium skin tone","order":3329,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: woman, man, dark skin tone, medium-dark skin tone","order":3331,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: woman, man, dark skin tone","order":3333,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"}]},{"group":1,"hexcode":"1F468-200D-2764-FE0F-200D-1F468","label":"couple with heart: man, man","order":3335,"tags":["couple","couple with heart","love","man"],"unicode":"\u{1F468}\u200D\u2764\uFE0F\u200D\u{1F468}","skins":[{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: man, man, light skin tone","order":3337,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: man, man, light skin tone, medium-light skin tone","order":3339,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: man, man, light skin tone, medium skin tone","order":3341,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: man, man, light skin tone, medium-dark skin tone","order":3343,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: man, man, light skin tone, dark skin tone","order":3345,"unicode":"\u{1F468}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: man, man, medium-light skin tone, light skin tone","order":3347,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: man, man, medium-light skin tone","order":3349,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: man, man, medium-light skin tone, medium skin tone","order":3351,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: man, man, medium-light skin tone, medium-dark skin tone","order":3353,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: man, man, medium-light skin tone, dark skin tone","order":3355,"unicode":"\u{1F468}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: man, man, medium skin tone, light skin tone","order":3357,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: man, man, medium skin tone, medium-light skin tone","order":3359,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: man, man, medium skin tone","order":3361,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: man, man, medium skin tone, medium-dark skin tone","order":3363,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: man, man, medium skin tone, dark skin tone","order":3365,"unicode":"\u{1F468}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: man, man, medium-dark skin tone, light skin tone","order":3367,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: man, man, medium-dark skin tone, medium-light skin tone","order":3369,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: man, man, medium-dark skin tone, medium skin tone","order":3371,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: man, man, medium-dark skin tone","order":3373,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: man, man, medium-dark skin tone, dark skin tone","order":3375,"unicode":"\u{1F468}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FB","label":"couple with heart: man, man, dark skin tone, light skin tone","order":3377,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FB}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FC","label":"couple with heart: man, man, dark skin tone, medium-light skin tone","order":3379,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FC}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FD","label":"couple with heart: man, man, dark skin tone, medium skin tone","order":3381,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FD}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FE","label":"couple with heart: man, man, dark skin tone, medium-dark skin tone","order":3383,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FE}"},{"group":1,"hexcode":"1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FF","label":"couple with heart: man, man, dark skin tone","order":3385,"unicode":"\u{1F468}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F468}\u{1F3FF}"}]},{"group":1,"hexcode":"1F469-200D-2764-FE0F-200D-1F469","label":"couple with heart: woman, woman","order":3387,"tags":["couple","couple with heart","love","woman"],"unicode":"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F469}","skins":[{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FB","label":"couple with heart: woman, woman, light skin tone","order":3389,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FC","label":"couple with heart: woman, woman, light skin tone, medium-light skin tone","order":3391,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FD","label":"couple with heart: woman, woman, light skin tone, medium skin tone","order":3393,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FE","label":"couple with heart: woman, woman, light skin tone, medium-dark skin tone","order":3395,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FF","label":"couple with heart: woman, woman, light skin tone, dark skin tone","order":3397,"unicode":"\u{1F469}\u{1F3FB}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FB","label":"couple with heart: woman, woman, medium-light skin tone, light skin tone","order":3399,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FC","label":"couple with heart: woman, woman, medium-light skin tone","order":3401,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FD","label":"couple with heart: woman, woman, medium-light skin tone, medium skin tone","order":3403,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FE","label":"couple with heart: woman, woman, medium-light skin tone, medium-dark skin tone","order":3405,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FF","label":"couple with heart: woman, woman, medium-light skin tone, dark skin tone","order":3407,"unicode":"\u{1F469}\u{1F3FC}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FB","label":"couple with heart: woman, woman, medium skin tone, light skin tone","order":3409,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FC","label":"couple with heart: woman, woman, medium skin tone, medium-light skin tone","order":3411,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FD","label":"couple with heart: woman, woman, medium skin tone","order":3413,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FE","label":"couple with heart: woman, woman, medium skin tone, medium-dark skin tone","order":3415,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FF","label":"couple with heart: woman, woman, medium skin tone, dark skin tone","order":3417,"unicode":"\u{1F469}\u{1F3FD}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FB","label":"couple with heart: woman, woman, medium-dark skin tone, light skin tone","order":3419,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FC","label":"couple with heart: woman, woman, medium-dark skin tone, medium-light skin tone","order":3421,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FD","label":"couple with heart: woman, woman, medium-dark skin tone, medium skin tone","order":3423,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FE","label":"couple with heart: woman, woman, medium-dark skin tone","order":3425,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FF","label":"couple with heart: woman, woman, medium-dark skin tone, dark skin tone","order":3427,"unicode":"\u{1F469}\u{1F3FE}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FF}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FB","label":"couple with heart: woman, woman, dark skin tone, light skin tone","order":3429,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FB}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FC","label":"couple with heart: woman, woman, dark skin tone, medium-light skin tone","order":3431,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FC}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FD","label":"couple with heart: woman, woman, dark skin tone, medium skin tone","order":3433,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FD}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FE","label":"couple with heart: woman, woman, dark skin tone, medium-dark skin tone","order":3435,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FE}"},{"group":1,"hexcode":"1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FF","label":"couple with heart: woman, woman, dark skin tone","order":3437,"unicode":"\u{1F469}\u{1F3FF}\u200D\u2764\uFE0F\u200D\u{1F469}\u{1F3FF}"}]},{"group":1,"hexcode":"1F468-200D-1F469-200D-1F466","label":"family: man, woman, boy","order":3439,"tags":["boy","family","man","woman"],"unicode":"\u{1F468}\u200D\u{1F469}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F469-200D-1F467","label":"family: man, woman, girl","order":3440,"tags":["family","girl","man","woman"],"unicode":"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}"},{"group":1,"hexcode":"1F468-200D-1F469-200D-1F467-200D-1F466","label":"family: man, woman, girl, boy","order":3441,"tags":["boy","family","girl","man","woman"],"unicode":"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F469-200D-1F466-200D-1F466","label":"family: man, woman, boy, boy","order":3442,"tags":["boy","family","man","woman"],"unicode":"\u{1F468}\u200D\u{1F469}\u200D\u{1F466}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F469-200D-1F467-200D-1F467","label":"family: man, woman, girl, girl","order":3443,"tags":["family","girl","man","woman"],"unicode":"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F467}"},{"group":1,"hexcode":"1F468-200D-1F468-200D-1F466","label":"family: man, man, boy","order":3444,"tags":["boy","family","man"],"unicode":"\u{1F468}\u200D\u{1F468}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F468-200D-1F467","label":"family: man, man, girl","order":3445,"tags":["family","girl","man"],"unicode":"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}"},{"group":1,"hexcode":"1F468-200D-1F468-200D-1F467-200D-1F466","label":"family: man, man, girl, boy","order":3446,"tags":["boy","family","girl","man"],"unicode":"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F468-200D-1F466-200D-1F466","label":"family: man, man, boy, boy","order":3447,"tags":["boy","family","man"],"unicode":"\u{1F468}\u200D\u{1F468}\u200D\u{1F466}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F468-200D-1F467-200D-1F467","label":"family: man, man, girl, girl","order":3448,"tags":["family","girl","man"],"unicode":"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}\u200D\u{1F467}"},{"group":1,"hexcode":"1F469-200D-1F469-200D-1F466","label":"family: woman, woman, boy","order":3449,"tags":["boy","family","woman"],"unicode":"\u{1F469}\u200D\u{1F469}\u200D\u{1F466}"},{"group":1,"hexcode":"1F469-200D-1F469-200D-1F467","label":"family: woman, woman, girl","order":3450,"tags":["family","girl","woman"],"unicode":"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}"},{"group":1,"hexcode":"1F469-200D-1F469-200D-1F467-200D-1F466","label":"family: woman, woman, girl, boy","order":3451,"tags":["boy","family","girl","woman"],"unicode":"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}"},{"group":1,"hexcode":"1F469-200D-1F469-200D-1F466-200D-1F466","label":"family: woman, woman, boy, boy","order":3452,"tags":["boy","family","woman"],"unicode":"\u{1F469}\u200D\u{1F469}\u200D\u{1F466}\u200D\u{1F466}"},{"group":1,"hexcode":"1F469-200D-1F469-200D-1F467-200D-1F467","label":"family: woman, woman, girl, girl","order":3453,"tags":["family","girl","woman"],"unicode":"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F467}"},{"group":1,"hexcode":"1F468-200D-1F466","label":"family: man, boy","order":3454,"tags":["boy","family","man"],"unicode":"\u{1F468}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F466-200D-1F466","label":"family: man, boy, boy","order":3455,"tags":["boy","family","man"],"unicode":"\u{1F468}\u200D\u{1F466}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F467","label":"family: man, girl","order":3456,"tags":["family","girl","man"],"unicode":"\u{1F468}\u200D\u{1F467}"},{"group":1,"hexcode":"1F468-200D-1F467-200D-1F466","label":"family: man, girl, boy","order":3457,"tags":["boy","family","girl","man"],"unicode":"\u{1F468}\u200D\u{1F467}\u200D\u{1F466}"},{"group":1,"hexcode":"1F468-200D-1F467-200D-1F467","label":"family: man, girl, girl","order":3458,"tags":["family","girl","man"],"unicode":"\u{1F468}\u200D\u{1F467}\u200D\u{1F467}"},{"group":1,"hexcode":"1F469-200D-1F466","label":"family: woman, boy","order":3459,"tags":["boy","family","woman"],"unicode":"\u{1F469}\u200D\u{1F466}"},{"group":1,"hexcode":"1F469-200D-1F466-200D-1F466","label":"family: woman, boy, boy","order":3460,"tags":["boy","family","woman"],"unicode":"\u{1F469}\u200D\u{1F466}\u200D\u{1F466}"},{"group":1,"hexcode":"1F469-200D-1F467","label":"family: woman, girl","order":3461,"tags":["family","girl","woman"],"unicode":"\u{1F469}\u200D\u{1F467}"},{"group":1,"hexcode":"1F469-200D-1F467-200D-1F466","label":"family: woman, girl, boy","order":3462,"tags":["boy","family","girl","woman"],"unicode":"\u{1F469}\u200D\u{1F467}\u200D\u{1F466}"},{"group":1,"hexcode":"1F469-200D-1F467-200D-1F467","label":"family: woman, girl, girl","order":3463,"tags":["family","girl","woman"],"unicode":"\u{1F469}\u200D\u{1F467}\u200D\u{1F467}"},{"group":1,"hexcode":"1F5E3","label":"speaking head","order":3465,"tags":["face","head","silhouette","speak","speaking"],"unicode":"\u{1F5E3}\uFE0F"},{"group":1,"hexcode":"1F464","label":"bust in silhouette","order":3466,"tags":["bust","silhouette"],"unicode":"\u{1F464}"},{"group":1,"hexcode":"1F465","label":"busts in silhouette","order":3467,"tags":["bust","silhouette"],"unicode":"\u{1F465}"},{"group":1,"hexcode":"1FAC2","label":"people hugging","order":3468,"tags":["goodbye","hello","hug","thanks"],"unicode":"\u{1FAC2}"},{"group":1,"hexcode":"1F46A","label":"family","order":3469,"tags":["family"],"unicode":"\u{1F46A}\uFE0F"},{"group":1,"hexcode":"1F9D1-200D-1F9D1-200D-1F9D2","label":"family: adult, adult, child","order":3470,"tags":["family: adult, adult, child"],"unicode":"\u{1F9D1}\u200D\u{1F9D1}\u200D\u{1F9D2}"},{"group":1,"hexcode":"1F9D1-200D-1F9D1-200D-1F9D2-200D-1F9D2","label":"family: adult, adult, child, child","order":3471,"tags":["family: adult, adult, child, child"],"unicode":"\u{1F9D1}\u200D\u{1F9D1}\u200D\u{1F9D2}\u200D\u{1F9D2}"},{"group":1,"hexcode":"1F9D1-200D-1F9D2","label":"family: adult, child","order":3472,"tags":["family: adult, child"],"unicode":"\u{1F9D1}\u200D\u{1F9D2}"},{"group":1,"hexcode":"1F9D1-200D-1F9D2-200D-1F9D2","label":"family: adult, child, child","order":3473,"tags":["family: adult, child, child"],"unicode":"\u{1F9D1}\u200D\u{1F9D2}\u200D\u{1F9D2}"},{"group":1,"hexcode":"1F463","label":"footprints","order":3474,"tags":["clothing","footprint","print"],"unicode":"\u{1F463}"},{"group":2,"hexcode":"1F3FB","label":"light skin tone","order":3475,"tags":["skin tone","type 1\u20132"],"unicode":"\u{1F3FB}"},{"group":2,"hexcode":"1F3FC","label":"medium-light skin tone","order":3476,"tags":["skin tone","type 3"],"unicode":"\u{1F3FC}"},{"group":2,"hexcode":"1F3FD","label":"medium skin tone","order":3477,"tags":["skin tone","type 4"],"unicode":"\u{1F3FD}"},{"group":2,"hexcode":"1F3FE","label":"medium-dark skin tone","order":3478,"tags":["skin tone","type 5"],"unicode":"\u{1F3FE}"},{"group":2,"hexcode":"1F3FF","label":"dark skin tone","order":3479,"tags":["skin tone","type 6"],"unicode":"\u{1F3FF}"},{"group":2,"hexcode":"1F9B0","label":"red hair","order":3480,"tags":["ginger","redhead"],"unicode":"\u{1F9B0}"},{"group":2,"hexcode":"1F9B1","label":"curly hair","order":3481,"tags":["afro","curly","ringlets"],"unicode":"\u{1F9B1}"},{"group":2,"hexcode":"1F9B3","label":"white hair","order":3482,"tags":["gray","hair","old","white"],"unicode":"\u{1F9B3}"},{"group":2,"hexcode":"1F9B2","label":"bald","order":3483,"tags":["chemotherapy","hairless","no hair","shaven"],"unicode":"\u{1F9B2}"},{"group":3,"hexcode":"1F435","label":"monkey face","order":3484,"tags":["face","monkey"],"unicode":"\u{1F435}"},{"group":3,"hexcode":"1F412","label":"monkey","order":3485,"tags":["monkey"],"unicode":"\u{1F412}"},{"group":3,"hexcode":"1F98D","label":"gorilla","order":3486,"tags":["gorilla"],"unicode":"\u{1F98D}"},{"group":3,"hexcode":"1F9A7","label":"orangutan","order":3487,"tags":["ape"],"unicode":"\u{1F9A7}"},{"group":3,"hexcode":"1F436","label":"dog face","order":3488,"tags":["dog","face","pet"],"unicode":"\u{1F436}"},{"group":3,"hexcode":"1F415","label":"dog","order":3489,"tags":["pet"],"unicode":"\u{1F415}\uFE0F"},{"group":3,"hexcode":"1F9AE","label":"guide dog","order":3490,"tags":["accessibility","blind","guide"],"unicode":"\u{1F9AE}"},{"group":3,"hexcode":"1F415-200D-1F9BA","label":"service dog","order":3491,"tags":["accessibility","assistance","dog","service"],"unicode":"\u{1F415}\u200D\u{1F9BA}"},{"group":3,"hexcode":"1F429","label":"poodle","order":3492,"tags":["dog"],"unicode":"\u{1F429}"},{"group":3,"hexcode":"1F43A","label":"wolf","order":3493,"tags":["face"],"unicode":"\u{1F43A}"},{"group":3,"hexcode":"1F98A","label":"fox","order":3494,"tags":["face"],"unicode":"\u{1F98A}"},{"group":3,"hexcode":"1F99D","label":"raccoon","order":3495,"tags":["curious","sly"],"unicode":"\u{1F99D}"},{"group":3,"hexcode":"1F431","label":"cat face","order":3496,"tags":["cat","face","pet"],"unicode":"\u{1F431}"},{"group":3,"hexcode":"1F408","label":"cat","order":3497,"tags":["pet"],"unicode":"\u{1F408}\uFE0F"},{"group":3,"hexcode":"1F408-200D-2B1B","label":"black cat","order":3498,"tags":["black","cat","unlucky"],"unicode":"\u{1F408}\u200D\u2B1B"},{"group":3,"hexcode":"1F981","label":"lion","order":3499,"tags":["face","leo","zodiac"],"unicode":"\u{1F981}"},{"group":3,"hexcode":"1F42F","label":"tiger face","order":3500,"tags":["face","tiger"],"unicode":"\u{1F42F}"},{"group":3,"hexcode":"1F405","label":"tiger","order":3501,"tags":["tiger"],"unicode":"\u{1F405}"},{"group":3,"hexcode":"1F406","label":"leopard","order":3502,"tags":["leopard"],"unicode":"\u{1F406}"},{"group":3,"hexcode":"1F434","label":"horse face","order":3503,"tags":["face","horse"],"unicode":"\u{1F434}"},{"group":3,"hexcode":"1FACE","label":"moose","order":3504,"tags":["animal","antlers","elk","mammal"],"unicode":"\u{1FACE}"},{"group":3,"hexcode":"1FACF","label":"donkey","order":3505,"tags":["animal","ass","burro","mammal","mule","stubborn"],"unicode":"\u{1FACF}"},{"group":3,"hexcode":"1F40E","label":"horse","order":3506,"tags":["equestrian","racehorse","racing"],"unicode":"\u{1F40E}"},{"group":3,"hexcode":"1F984","label":"unicorn","order":3507,"tags":["face"],"unicode":"\u{1F984}"},{"group":3,"hexcode":"1F993","label":"zebra","order":3508,"tags":["stripe"],"unicode":"\u{1F993}"},{"group":3,"hexcode":"1F98C","label":"deer","order":3509,"tags":["deer"],"unicode":"\u{1F98C}"},{"group":3,"hexcode":"1F9AC","label":"bison","order":3510,"tags":["buffalo","herd","wisent"],"unicode":"\u{1F9AC}"},{"group":3,"hexcode":"1F42E","label":"cow face","order":3511,"tags":["cow","face"],"unicode":"\u{1F42E}"},{"group":3,"hexcode":"1F402","label":"ox","order":3512,"tags":["bull","taurus","zodiac"],"unicode":"\u{1F402}"},{"group":3,"hexcode":"1F403","label":"water buffalo","order":3513,"tags":["buffalo","water"],"unicode":"\u{1F403}"},{"group":3,"hexcode":"1F404","label":"cow","order":3514,"tags":["cow"],"unicode":"\u{1F404}"},{"group":3,"hexcode":"1F437","label":"pig face","order":3515,"tags":["face","pig"],"unicode":"\u{1F437}"},{"group":3,"hexcode":"1F416","label":"pig","order":3516,"tags":["sow"],"unicode":"\u{1F416}"},{"group":3,"hexcode":"1F417","label":"boar","order":3517,"tags":["pig"],"unicode":"\u{1F417}"},{"group":3,"hexcode":"1F43D","label":"pig nose","order":3518,"tags":["face","nose","pig"],"unicode":"\u{1F43D}"},{"group":3,"hexcode":"1F40F","label":"ram","order":3519,"tags":["aries","male","sheep","zodiac"],"unicode":"\u{1F40F}"},{"group":3,"hexcode":"1F411","label":"ewe","order":3520,"tags":["female","sheep"],"unicode":"\u{1F411}"},{"group":3,"hexcode":"1F410","label":"goat","order":3521,"tags":["capricorn","zodiac"],"unicode":"\u{1F410}"},{"group":3,"hexcode":"1F42A","label":"camel","order":3522,"tags":["dromedary","hump"],"unicode":"\u{1F42A}"},{"group":3,"hexcode":"1F42B","label":"two-hump camel","order":3523,"tags":["bactrian","camel","hump"],"unicode":"\u{1F42B}"},{"group":3,"hexcode":"1F999","label":"llama","order":3524,"tags":["alpaca","guanaco","vicu\xF1a","wool"],"unicode":"\u{1F999}"},{"group":3,"hexcode":"1F992","label":"giraffe","order":3525,"tags":["spots"],"unicode":"\u{1F992}"},{"group":3,"hexcode":"1F418","label":"elephant","order":3526,"tags":["elephant"],"unicode":"\u{1F418}"},{"group":3,"hexcode":"1F9A3","label":"mammoth","order":3527,"tags":["extinction","large","tusk","woolly"],"unicode":"\u{1F9A3}"},{"group":3,"hexcode":"1F98F","label":"rhinoceros","order":3528,"tags":["rhinoceros"],"unicode":"\u{1F98F}"},{"group":3,"hexcode":"1F99B","label":"hippopotamus","order":3529,"tags":["hippo"],"unicode":"\u{1F99B}"},{"group":3,"hexcode":"1F42D","label":"mouse face","order":3530,"tags":["face","mouse"],"unicode":"\u{1F42D}"},{"group":3,"hexcode":"1F401","label":"mouse","order":3531,"tags":["mouse"],"unicode":"\u{1F401}"},{"group":3,"hexcode":"1F400","label":"rat","order":3532,"tags":["rat"],"unicode":"\u{1F400}"},{"group":3,"hexcode":"1F439","label":"hamster","order":3533,"tags":["face","pet"],"unicode":"\u{1F439}"},{"group":3,"hexcode":"1F430","label":"rabbit face","order":3534,"tags":["bunny","face","pet","rabbit"],"unicode":"\u{1F430}"},{"group":3,"hexcode":"1F407","label":"rabbit","order":3535,"tags":["bunny","pet"],"unicode":"\u{1F407}"},{"group":3,"hexcode":"1F43F","label":"chipmunk","order":3537,"tags":["squirrel"],"unicode":"\u{1F43F}\uFE0F"},{"group":3,"hexcode":"1F9AB","label":"beaver","order":3538,"tags":["dam"],"unicode":"\u{1F9AB}"},{"group":3,"hexcode":"1F994","label":"hedgehog","order":3539,"tags":["spiny"],"unicode":"\u{1F994}"},{"group":3,"hexcode":"1F987","label":"bat","order":3540,"tags":["vampire"],"unicode":"\u{1F987}"},{"group":3,"hexcode":"1F43B","label":"bear","order":3541,"tags":["face"],"unicode":"\u{1F43B}"},{"group":3,"hexcode":"1F43B-200D-2744-FE0F","label":"polar bear","order":3542,"tags":["arctic","bear","white"],"unicode":"\u{1F43B}\u200D\u2744\uFE0F"},{"group":3,"hexcode":"1F428","label":"koala","order":3544,"tags":["face","marsupial"],"unicode":"\u{1F428}"},{"group":3,"hexcode":"1F43C","label":"panda","order":3545,"tags":["face"],"unicode":"\u{1F43C}"},{"group":3,"hexcode":"1F9A5","label":"sloth","order":3546,"tags":["lazy","slow"],"unicode":"\u{1F9A5}"},{"group":3,"hexcode":"1F9A6","label":"otter","order":3547,"tags":["fishing","playful"],"unicode":"\u{1F9A6}"},{"group":3,"hexcode":"1F9A8","label":"skunk","order":3548,"tags":["stink"],"unicode":"\u{1F9A8}"},{"group":3,"hexcode":"1F998","label":"kangaroo","order":3549,"tags":["joey","jump","marsupial"],"unicode":"\u{1F998}"},{"group":3,"hexcode":"1F9A1","label":"badger","order":3550,"tags":["honey badger","pester"],"unicode":"\u{1F9A1}"},{"group":3,"hexcode":"1F43E","label":"paw prints","order":3551,"tags":["feet","paw","print"],"unicode":"\u{1F43E}"},{"group":3,"hexcode":"1F983","label":"turkey","order":3552,"tags":["bird"],"unicode":"\u{1F983}"},{"group":3,"hexcode":"1F414","label":"chicken","order":3553,"tags":["bird"],"unicode":"\u{1F414}"},{"group":3,"hexcode":"1F413","label":"rooster","order":3554,"tags":["bird"],"unicode":"\u{1F413}"},{"group":3,"hexcode":"1F423","label":"hatching chick","order":3555,"tags":["baby","bird","chick","hatching"],"unicode":"\u{1F423}"},{"group":3,"hexcode":"1F424","label":"baby chick","order":3556,"tags":["baby","bird","chick"],"unicode":"\u{1F424}"},{"group":3,"hexcode":"1F425","label":"front-facing baby chick","order":3557,"tags":["baby","bird","chick"],"unicode":"\u{1F425}"},{"group":3,"hexcode":"1F426","label":"bird","order":3558,"tags":["bird"],"unicode":"\u{1F426}\uFE0F"},{"group":3,"hexcode":"1F427","label":"penguin","order":3559,"tags":["bird"],"unicode":"\u{1F427}"},{"group":3,"hexcode":"1F54A","label":"dove","order":3561,"tags":["bird","fly","peace"],"unicode":"\u{1F54A}\uFE0F"},{"group":3,"hexcode":"1F985","label":"eagle","order":3562,"tags":["bird"],"unicode":"\u{1F985}"},{"group":3,"hexcode":"1F986","label":"duck","order":3563,"tags":["bird"],"unicode":"\u{1F986}"},{"group":3,"hexcode":"1F9A2","label":"swan","order":3564,"tags":["bird","cygnet","ugly duckling"],"unicode":"\u{1F9A2}"},{"group":3,"hexcode":"1F989","label":"owl","order":3565,"tags":["bird","wise"],"unicode":"\u{1F989}"},{"group":3,"hexcode":"1F9A4","label":"dodo","order":3566,"tags":["extinction","large","mauritius"],"unicode":"\u{1F9A4}"},{"group":3,"hexcode":"1FAB6","label":"feather","order":3567,"tags":["bird","flight","light","plumage"],"unicode":"\u{1FAB6}"},{"group":3,"hexcode":"1F9A9","label":"flamingo","order":3568,"tags":["flamboyant","tropical"],"unicode":"\u{1F9A9}"},{"group":3,"hexcode":"1F99A","label":"peacock","order":3569,"tags":["bird","ostentatious","peahen","proud"],"unicode":"\u{1F99A}"},{"group":3,"hexcode":"1F99C","label":"parrot","order":3570,"tags":["bird","pirate","talk"],"unicode":"\u{1F99C}"},{"group":3,"hexcode":"1FABD","label":"wing","order":3571,"tags":["angelic","aviation","bird","flying","mythology"],"unicode":"\u{1FABD}"},{"group":3,"hexcode":"1F426-200D-2B1B","label":"black bird","order":3572,"tags":["bird","black","crow","raven","rook"],"unicode":"\u{1F426}\u200D\u2B1B"},{"group":3,"hexcode":"1FABF","label":"goose","order":3573,"tags":["bird","fowl","honk","silly"],"unicode":"\u{1FABF}"},{"group":3,"hexcode":"1F426-200D-1F525","label":"phoenix","order":3574,"tags":["fantasy","firebird","rebirth","reincarnation"],"unicode":"\u{1F426}\u200D\u{1F525}"},{"group":3,"hexcode":"1F438","label":"frog","order":3575,"tags":["face"],"unicode":"\u{1F438}"},{"group":3,"hexcode":"1F40A","label":"crocodile","order":3576,"tags":["crocodile"],"unicode":"\u{1F40A}"},{"group":3,"hexcode":"1F422","label":"turtle","order":3577,"tags":["terrapin","tortoise"],"unicode":"\u{1F422}"},{"group":3,"hexcode":"1F98E","label":"lizard","order":3578,"tags":["reptile"],"unicode":"\u{1F98E}"},{"group":3,"hexcode":"1F40D","label":"snake","order":3579,"tags":["bearer","ophiuchus","serpent","zodiac"],"unicode":"\u{1F40D}"},{"group":3,"hexcode":"1F432","label":"dragon face","order":3580,"tags":["dragon","face","fairy tale"],"unicode":"\u{1F432}"},{"group":3,"hexcode":"1F409","label":"dragon","order":3581,"tags":["fairy tale"],"unicode":"\u{1F409}"},{"group":3,"hexcode":"1F995","label":"sauropod","order":3582,"tags":["brachiosaurus","brontosaurus","diplodocus"],"unicode":"\u{1F995}"},{"group":3,"hexcode":"1F996","label":"T-Rex","order":3583,"tags":["t-rex","tyrannosaurus rex"],"unicode":"\u{1F996}"},{"group":3,"hexcode":"1F433","label":"spouting whale","order":3584,"tags":["face","spouting","whale"],"unicode":"\u{1F433}"},{"group":3,"hexcode":"1F40B","label":"whale","order":3585,"tags":["whale"],"unicode":"\u{1F40B}"},{"group":3,"hexcode":"1F42C","label":"dolphin","order":3586,"tags":["flipper"],"unicode":"\u{1F42C}"},{"group":3,"hexcode":"1F9AD","label":"seal","order":3587,"tags":["sea lion"],"unicode":"\u{1F9AD}"},{"group":3,"hexcode":"1F41F","label":"fish","order":3588,"tags":["pisces","zodiac"],"unicode":"\u{1F41F}\uFE0F"},{"group":3,"hexcode":"1F420","label":"tropical fish","order":3589,"tags":["fish","tropical"],"unicode":"\u{1F420}"},{"group":3,"hexcode":"1F421","label":"blowfish","order":3590,"tags":["fish"],"unicode":"\u{1F421}"},{"group":3,"hexcode":"1F988","label":"shark","order":3591,"tags":["fish"],"unicode":"\u{1F988}"},{"group":3,"hexcode":"1F419","label":"octopus","order":3592,"tags":["octopus"],"unicode":"\u{1F419}"},{"group":3,"hexcode":"1F41A","label":"spiral shell","order":3593,"tags":["shell","spiral"],"unicode":"\u{1F41A}"},{"group":3,"hexcode":"1FAB8","label":"coral","order":3594,"tags":["ocean","reef"],"unicode":"\u{1FAB8}"},{"group":3,"hexcode":"1FABC","label":"jellyfish","order":3595,"tags":["burn","invertebrate","jelly","marine","ouch","stinger"],"unicode":"\u{1FABC}"},{"group":3,"hexcode":"1F40C","label":"snail","order":3596,"tags":["snail"],"unicode":"\u{1F40C}"},{"group":3,"hexcode":"1F98B","label":"butterfly","order":3597,"tags":["insect","pretty"],"unicode":"\u{1F98B}"},{"group":3,"hexcode":"1F41B","label":"bug","order":3598,"tags":["insect"],"unicode":"\u{1F41B}"},{"group":3,"hexcode":"1F41C","label":"ant","order":3599,"tags":["insect"],"unicode":"\u{1F41C}"},{"group":3,"hexcode":"1F41D","label":"honeybee","order":3600,"tags":["bee","insect"],"unicode":"\u{1F41D}"},{"group":3,"hexcode":"1FAB2","label":"beetle","order":3601,"tags":["bug","insect"],"unicode":"\u{1FAB2}"},{"group":3,"hexcode":"1F41E","label":"lady beetle","order":3602,"tags":["beetle","insect","ladybird","ladybug"],"unicode":"\u{1F41E}"},{"group":3,"hexcode":"1F997","label":"cricket","order":3603,"tags":["grasshopper"],"unicode":"\u{1F997}"},{"group":3,"hexcode":"1FAB3","label":"cockroach","order":3604,"tags":["insect","pest","roach"],"unicode":"\u{1FAB3}"},{"group":3,"hexcode":"1F577","label":"spider","order":3606,"tags":["insect"],"unicode":"\u{1F577}\uFE0F"},{"group":3,"hexcode":"1F578","label":"spider web","order":3608,"tags":["spider","web"],"unicode":"\u{1F578}\uFE0F"},{"group":3,"hexcode":"1F982","label":"scorpion","order":3609,"tags":["scorpio","zodiac"],"unicode":"\u{1F982}"},{"group":3,"hexcode":"1F99F","label":"mosquito","order":3610,"tags":["disease","fever","malaria","pest","virus"],"unicode":"\u{1F99F}"},{"group":3,"hexcode":"1FAB0","label":"fly","order":3611,"tags":["disease","maggot","pest","rotting"],"unicode":"\u{1FAB0}"},{"group":3,"hexcode":"1FAB1","label":"worm","order":3612,"tags":["annelid","earthworm","parasite"],"unicode":"\u{1FAB1}"},{"group":3,"hexcode":"1F9A0","label":"microbe","order":3613,"tags":["amoeba","bacteria","virus"],"unicode":"\u{1F9A0}"},{"group":3,"hexcode":"1F490","label":"bouquet","order":3614,"tags":["flower"],"unicode":"\u{1F490}"},{"group":3,"hexcode":"1F338","label":"cherry blossom","order":3615,"tags":["blossom","cherry","flower"],"unicode":"\u{1F338}"},{"group":3,"hexcode":"1F4AE","label":"white flower","order":3616,"tags":["flower"],"unicode":"\u{1F4AE}"},{"group":3,"hexcode":"1FAB7","label":"lotus","order":3617,"tags":["buddhism","flower","hinduism","purity"],"unicode":"\u{1FAB7}"},{"group":3,"hexcode":"1F3F5","label":"rosette","order":3619,"tags":["plant"],"unicode":"\u{1F3F5}\uFE0F"},{"group":3,"hexcode":"1F339","label":"rose","order":3620,"tags":["flower"],"unicode":"\u{1F339}"},{"group":3,"hexcode":"1F940","label":"wilted flower","order":3621,"tags":["flower","wilted"],"unicode":"\u{1F940}"},{"group":3,"hexcode":"1F33A","label":"hibiscus","order":3622,"tags":["flower"],"unicode":"\u{1F33A}"},{"group":3,"hexcode":"1F33B","label":"sunflower","order":3623,"tags":["flower","sun"],"unicode":"\u{1F33B}"},{"group":3,"hexcode":"1F33C","label":"blossom","order":3624,"tags":["flower"],"unicode":"\u{1F33C}"},{"group":3,"hexcode":"1F337","label":"tulip","order":3625,"tags":["flower"],"unicode":"\u{1F337}"},{"group":3,"hexcode":"1FABB","label":"hyacinth","order":3626,"tags":["bluebonnet","flower","lavender","lupine","snapdragon"],"unicode":"\u{1FABB}"},{"group":3,"hexcode":"1F331","label":"seedling","order":3627,"tags":["young"],"unicode":"\u{1F331}"},{"group":3,"hexcode":"1FAB4","label":"potted plant","order":3628,"tags":["boring","grow","house","nurturing","plant","useless"],"unicode":"\u{1FAB4}"},{"group":3,"hexcode":"1F332","label":"evergreen tree","order":3629,"tags":["tree"],"unicode":"\u{1F332}"},{"group":3,"hexcode":"1F333","label":"deciduous tree","order":3630,"tags":["deciduous","shedding","tree"],"unicode":"\u{1F333}"},{"group":3,"hexcode":"1F334","label":"palm tree","order":3631,"tags":["palm","tree"],"unicode":"\u{1F334}"},{"group":3,"hexcode":"1F335","label":"cactus","order":3632,"tags":["plant"],"unicode":"\u{1F335}"},{"group":3,"hexcode":"1F33E","label":"sheaf of rice","order":3633,"tags":["ear","grain","rice"],"unicode":"\u{1F33E}"},{"group":3,"hexcode":"1F33F","label":"herb","order":3634,"tags":["leaf"],"unicode":"\u{1F33F}"},{"group":3,"hexcode":"2618","label":"shamrock","order":3636,"tags":["plant"],"unicode":"\u2618\uFE0F"},{"group":3,"hexcode":"1F340","label":"four leaf clover","order":3637,"tags":["4","clover","four","four-leaf clover","leaf"],"unicode":"\u{1F340}"},{"group":3,"hexcode":"1F341","label":"maple leaf","order":3638,"tags":["falling","leaf","maple"],"unicode":"\u{1F341}"},{"group":3,"hexcode":"1F342","label":"fallen leaf","order":3639,"tags":["falling","leaf"],"unicode":"\u{1F342}"},{"group":3,"hexcode":"1F343","label":"leaf fluttering in wind","order":3640,"tags":["blow","flutter","leaf","wind"],"unicode":"\u{1F343}"},{"group":3,"hexcode":"1FAB9","label":"empty nest","order":3641,"tags":["nesting"],"unicode":"\u{1FAB9}"},{"group":3,"hexcode":"1FABA","label":"nest with eggs","order":3642,"tags":["nesting"],"unicode":"\u{1FABA}"},{"group":3,"hexcode":"1F344","label":"mushroom","order":3643,"tags":["toadstool"],"unicode":"\u{1F344}"},{"group":4,"hexcode":"1F347","label":"grapes","order":3644,"tags":["fruit","grape"],"unicode":"\u{1F347}"},{"group":4,"hexcode":"1F348","label":"melon","order":3645,"tags":["fruit"],"unicode":"\u{1F348}"},{"group":4,"hexcode":"1F349","label":"watermelon","order":3646,"tags":["fruit"],"unicode":"\u{1F349}"},{"group":4,"hexcode":"1F34A","label":"tangerine","order":3647,"tags":["fruit","orange"],"unicode":"\u{1F34A}"},{"group":4,"hexcode":"1F34B","label":"lemon","order":3648,"tags":["citrus","fruit"],"unicode":"\u{1F34B}"},{"group":4,"hexcode":"1F34B-200D-1F7E9","label":"lime","order":3649,"tags":["citrus","fruit","tropical"],"unicode":"\u{1F34B}\u200D\u{1F7E9}"},{"group":4,"hexcode":"1F34C","label":"banana","order":3650,"tags":["fruit"],"unicode":"\u{1F34C}"},{"group":4,"hexcode":"1F34D","label":"pineapple","order":3651,"tags":["fruit"],"unicode":"\u{1F34D}"},{"group":4,"hexcode":"1F96D","label":"mango","order":3652,"tags":["fruit","tropical"],"unicode":"\u{1F96D}"},{"group":4,"hexcode":"1F34E","label":"red apple","order":3653,"tags":["apple","fruit","red"],"unicode":"\u{1F34E}"},{"group":4,"hexcode":"1F34F","label":"green apple","order":3654,"tags":["apple","fruit","green"],"unicode":"\u{1F34F}"},{"group":4,"hexcode":"1F350","label":"pear","order":3655,"tags":["fruit"],"unicode":"\u{1F350}"},{"group":4,"hexcode":"1F351","label":"peach","order":3656,"tags":["fruit"],"unicode":"\u{1F351}"},{"group":4,"hexcode":"1F352","label":"cherries","order":3657,"tags":["berries","cherry","fruit","red"],"unicode":"\u{1F352}"},{"group":4,"hexcode":"1F353","label":"strawberry","order":3658,"tags":["berry","fruit"],"unicode":"\u{1F353}"},{"group":4,"hexcode":"1FAD0","label":"blueberries","order":3659,"tags":["berry","bilberry","blue","blueberry"],"unicode":"\u{1FAD0}"},{"group":4,"hexcode":"1F95D","label":"kiwi fruit","order":3660,"tags":["food","fruit","kiwi"],"unicode":"\u{1F95D}"},{"group":4,"hexcode":"1F345","label":"tomato","order":3661,"tags":["fruit","vegetable"],"unicode":"\u{1F345}"},{"group":4,"hexcode":"1FAD2","label":"olive","order":3662,"tags":["food"],"unicode":"\u{1FAD2}"},{"group":4,"hexcode":"1F965","label":"coconut","order":3663,"tags":["palm","pi\xF1a colada"],"unicode":"\u{1F965}"},{"group":4,"hexcode":"1F951","label":"avocado","order":3664,"tags":["food","fruit"],"unicode":"\u{1F951}"},{"group":4,"hexcode":"1F346","label":"eggplant","order":3665,"tags":["aubergine","vegetable"],"unicode":"\u{1F346}"},{"group":4,"hexcode":"1F954","label":"potato","order":3666,"tags":["food","vegetable"],"unicode":"\u{1F954}"},{"group":4,"hexcode":"1F955","label":"carrot","order":3667,"tags":["food","vegetable"],"unicode":"\u{1F955}"},{"group":4,"hexcode":"1F33D","label":"ear of corn","order":3668,"tags":["corn","ear","maize","maze"],"unicode":"\u{1F33D}"},{"group":4,"hexcode":"1F336","label":"hot pepper","order":3670,"tags":["hot","pepper"],"unicode":"\u{1F336}\uFE0F"},{"group":4,"hexcode":"1FAD1","label":"bell pepper","order":3671,"tags":["capsicum","pepper","vegetable"],"unicode":"\u{1FAD1}"},{"group":4,"hexcode":"1F952","label":"cucumber","order":3672,"tags":["food","pickle","vegetable"],"unicode":"\u{1F952}"},{"group":4,"hexcode":"1F96C","label":"leafy green","order":3673,"tags":["bok choy","cabbage","kale","lettuce"],"unicode":"\u{1F96C}"},{"group":4,"hexcode":"1F966","label":"broccoli","order":3674,"tags":["wild cabbage"],"unicode":"\u{1F966}"},{"group":4,"hexcode":"1F9C4","label":"garlic","order":3675,"tags":["flavoring"],"unicode":"\u{1F9C4}"},{"group":4,"hexcode":"1F9C5","label":"onion","order":3676,"tags":["flavoring"],"unicode":"\u{1F9C5}"},{"group":4,"hexcode":"1F95C","label":"peanuts","order":3677,"tags":["food","nut","peanut","vegetable"],"unicode":"\u{1F95C}"},{"group":4,"hexcode":"1FAD8","label":"beans","order":3678,"tags":["food","kidney","legume"],"unicode":"\u{1FAD8}"},{"group":4,"hexcode":"1F330","label":"chestnut","order":3679,"tags":["plant"],"unicode":"\u{1F330}"},{"group":4,"hexcode":"1FADA","label":"ginger root","order":3680,"tags":["beer","root","spice"],"unicode":"\u{1FADA}"},{"group":4,"hexcode":"1FADB","label":"pea pod","order":3681,"tags":["beans","edamame","legume","pea","pod","vegetable"],"unicode":"\u{1FADB}"},{"group":4,"hexcode":"1F344-200D-1F7EB","label":"brown mushroom","order":3682,"tags":["food","fungus","nature","vegetable"],"unicode":"\u{1F344}\u200D\u{1F7EB}"},{"group":4,"hexcode":"1F35E","label":"bread","order":3683,"tags":["loaf"],"unicode":"\u{1F35E}"},{"group":4,"hexcode":"1F950","label":"croissant","order":3684,"tags":["bread","breakfast","food","french","roll"],"unicode":"\u{1F950}"},{"group":4,"hexcode":"1F956","label":"baguette bread","order":3685,"tags":["baguette","bread","food","french"],"unicode":"\u{1F956}"},{"group":4,"hexcode":"1FAD3","label":"flatbread","order":3686,"tags":["arepa","lavash","naan","pita"],"unicode":"\u{1FAD3}"},{"group":4,"hexcode":"1F968","label":"pretzel","order":3687,"tags":["twisted"],"unicode":"\u{1F968}"},{"group":4,"hexcode":"1F96F","label":"bagel","order":3688,"tags":["bakery","breakfast","schmear"],"unicode":"\u{1F96F}"},{"group":4,"hexcode":"1F95E","label":"pancakes","order":3689,"tags":["breakfast","cr\xEApe","food","hotcake","pancake"],"unicode":"\u{1F95E}"},{"group":4,"hexcode":"1F9C7","label":"waffle","order":3690,"tags":["breakfast","indecisive","iron"],"unicode":"\u{1F9C7}"},{"group":4,"hexcode":"1F9C0","label":"cheese wedge","order":3691,"tags":["cheese"],"unicode":"\u{1F9C0}"},{"group":4,"hexcode":"1F356","label":"meat on bone","order":3692,"tags":["bone","meat"],"unicode":"\u{1F356}"},{"group":4,"hexcode":"1F357","label":"poultry leg","order":3693,"tags":["bone","chicken","drumstick","leg","poultry"],"unicode":"\u{1F357}"},{"group":4,"hexcode":"1F969","label":"cut of meat","order":3694,"tags":["chop","lambchop","porkchop","steak"],"unicode":"\u{1F969}"},{"group":4,"hexcode":"1F953","label":"bacon","order":3695,"tags":["breakfast","food","meat"],"unicode":"\u{1F953}"},{"group":4,"hexcode":"1F354","label":"hamburger","order":3696,"tags":["burger"],"unicode":"\u{1F354}"},{"group":4,"hexcode":"1F35F","label":"french fries","order":3697,"tags":["french","fries"],"unicode":"\u{1F35F}"},{"group":4,"hexcode":"1F355","label":"pizza","order":3698,"tags":["cheese","slice"],"unicode":"\u{1F355}"},{"group":4,"hexcode":"1F32D","label":"hot dog","order":3699,"tags":["frankfurter","hotdog","sausage"],"unicode":"\u{1F32D}"},{"group":4,"hexcode":"1F96A","label":"sandwich","order":3700,"tags":["bread"],"unicode":"\u{1F96A}"},{"group":4,"hexcode":"1F32E","label":"taco","order":3701,"tags":["mexican"],"unicode":"\u{1F32E}"},{"group":4,"hexcode":"1F32F","label":"burrito","order":3702,"tags":["mexican","wrap"],"unicode":"\u{1F32F}"},{"group":4,"hexcode":"1FAD4","label":"tamale","order":3703,"tags":["mexican","wrapped"],"unicode":"\u{1FAD4}"},{"group":4,"hexcode":"1F959","label":"stuffed flatbread","order":3704,"tags":["falafel","flatbread","food","gyro","kebab","stuffed"],"unicode":"\u{1F959}"},{"group":4,"hexcode":"1F9C6","label":"falafel","order":3705,"tags":["chickpea","meatball"],"unicode":"\u{1F9C6}"},{"group":4,"hexcode":"1F95A","label":"egg","order":3706,"tags":["breakfast","food"],"unicode":"\u{1F95A}"},{"group":4,"hexcode":"1F373","label":"cooking","order":3707,"tags":["breakfast","egg","frying","pan"],"unicode":"\u{1F373}"},{"group":4,"hexcode":"1F958","label":"shallow pan of food","order":3708,"tags":["casserole","food","paella","pan","shallow"],"unicode":"\u{1F958}"},{"group":4,"hexcode":"1F372","label":"pot of food","order":3709,"tags":["pot","stew"],"unicode":"\u{1F372}"},{"group":4,"hexcode":"1FAD5","label":"fondue","order":3710,"tags":["cheese","chocolate","melted","pot","swiss"],"unicode":"\u{1FAD5}"},{"group":4,"hexcode":"1F963","label":"bowl with spoon","order":3711,"tags":["breakfast","cereal","congee"],"unicode":"\u{1F963}"},{"group":4,"hexcode":"1F957","label":"green salad","order":3712,"tags":["food","green","salad"],"unicode":"\u{1F957}"},{"group":4,"hexcode":"1F37F","label":"popcorn","order":3713,"tags":["popcorn"],"unicode":"\u{1F37F}"},{"group":4,"hexcode":"1F9C8","label":"butter","order":3714,"tags":["dairy"],"unicode":"\u{1F9C8}"},{"group":4,"hexcode":"1F9C2","label":"salt","order":3715,"tags":["condiment","shaker"],"unicode":"\u{1F9C2}"},{"group":4,"hexcode":"1F96B","label":"canned food","order":3716,"tags":["can"],"unicode":"\u{1F96B}"},{"group":4,"hexcode":"1F371","label":"bento box","order":3717,"tags":["bento","box"],"unicode":"\u{1F371}"},{"group":4,"hexcode":"1F358","label":"rice cracker","order":3718,"tags":["cracker","rice"],"unicode":"\u{1F358}"},{"group":4,"hexcode":"1F359","label":"rice ball","order":3719,"tags":["ball","japanese","rice"],"unicode":"\u{1F359}"},{"group":4,"hexcode":"1F35A","label":"cooked rice","order":3720,"tags":["cooked","rice"],"unicode":"\u{1F35A}"},{"group":4,"hexcode":"1F35B","label":"curry rice","order":3721,"tags":["curry","rice"],"unicode":"\u{1F35B}"},{"group":4,"hexcode":"1F35C","label":"steaming bowl","order":3722,"tags":["bowl","noodle","ramen","steaming"],"unicode":"\u{1F35C}"},{"group":4,"hexcode":"1F35D","label":"spaghetti","order":3723,"tags":["pasta"],"unicode":"\u{1F35D}"},{"group":4,"hexcode":"1F360","label":"roasted sweet potato","order":3724,"tags":["potato","roasted","sweet"],"unicode":"\u{1F360}"},{"group":4,"hexcode":"1F362","label":"oden","order":3725,"tags":["kebab","seafood","skewer","stick"],"unicode":"\u{1F362}"},{"group":4,"hexcode":"1F363","label":"sushi","order":3726,"tags":["sushi"],"unicode":"\u{1F363}"},{"group":4,"hexcode":"1F364","label":"fried shrimp","order":3727,"tags":["fried","prawn","shrimp","tempura"],"unicode":"\u{1F364}"},{"group":4,"hexcode":"1F365","label":"fish cake with swirl","order":3728,"tags":["cake","fish","pastry","swirl"],"unicode":"\u{1F365}"},{"group":4,"hexcode":"1F96E","label":"moon cake","order":3729,"tags":["autumn","festival","yu\xE8b\u01D0ng"],"unicode":"\u{1F96E}"},{"group":4,"hexcode":"1F361","label":"dango","order":3730,"tags":["dessert","japanese","skewer","stick","sweet"],"unicode":"\u{1F361}"},{"group":4,"hexcode":"1F95F","label":"dumpling","order":3731,"tags":["empanada","gy\u014Dza","jiaozi","pierogi","potsticker"],"unicode":"\u{1F95F}"},{"group":4,"hexcode":"1F960","label":"fortune cookie","order":3732,"tags":["prophecy"],"unicode":"\u{1F960}"},{"group":4,"hexcode":"1F961","label":"takeout box","order":3733,"tags":["oyster pail"],"unicode":"\u{1F961}"},{"group":4,"hexcode":"1F980","label":"crab","order":3734,"tags":["cancer","zodiac"],"unicode":"\u{1F980}"},{"group":4,"hexcode":"1F99E","label":"lobster","order":3735,"tags":["bisque","claws","seafood"],"unicode":"\u{1F99E}"},{"group":4,"hexcode":"1F990","label":"shrimp","order":3736,"tags":["food","shellfish","small"],"unicode":"\u{1F990}"},{"group":4,"hexcode":"1F991","label":"squid","order":3737,"tags":["food","molusc"],"unicode":"\u{1F991}"},{"group":4,"hexcode":"1F9AA","label":"oyster","order":3738,"tags":["diving","pearl"],"unicode":"\u{1F9AA}"},{"group":4,"hexcode":"1F366","label":"soft ice cream","order":3739,"tags":["cream","dessert","ice","icecream","soft","sweet"],"unicode":"\u{1F366}"},{"group":4,"hexcode":"1F367","label":"shaved ice","order":3740,"tags":["dessert","ice","shaved","sweet"],"unicode":"\u{1F367}"},{"group":4,"hexcode":"1F368","label":"ice cream","order":3741,"tags":["cream","dessert","ice","sweet"],"unicode":"\u{1F368}"},{"group":4,"hexcode":"1F369","label":"doughnut","order":3742,"tags":["breakfast","dessert","donut","sweet"],"unicode":"\u{1F369}"},{"group":4,"hexcode":"1F36A","label":"cookie","order":3743,"tags":["dessert","sweet"],"unicode":"\u{1F36A}"},{"group":4,"hexcode":"1F382","label":"birthday cake","order":3744,"tags":["birthday","cake","celebration","dessert","pastry","sweet"],"unicode":"\u{1F382}"},{"group":4,"hexcode":"1F370","label":"shortcake","order":3745,"tags":["cake","dessert","pastry","slice","sweet"],"unicode":"\u{1F370}"},{"group":4,"hexcode":"1F9C1","label":"cupcake","order":3746,"tags":["bakery","sweet"],"unicode":"\u{1F9C1}"},{"group":4,"hexcode":"1F967","label":"pie","order":3747,"tags":["filling","pastry"],"unicode":"\u{1F967}"},{"group":4,"hexcode":"1F36B","label":"chocolate bar","order":3748,"tags":["bar","chocolate","dessert","sweet"],"unicode":"\u{1F36B}"},{"group":4,"hexcode":"1F36C","label":"candy","order":3749,"tags":["dessert","sweet"],"unicode":"\u{1F36C}"},{"group":4,"hexcode":"1F36D","label":"lollipop","order":3750,"tags":["candy","dessert","sweet"],"unicode":"\u{1F36D}"},{"group":4,"hexcode":"1F36E","label":"custard","order":3751,"tags":["dessert","pudding","sweet"],"unicode":"\u{1F36E}"},{"group":4,"hexcode":"1F36F","label":"honey pot","order":3752,"tags":["honey","honeypot","pot","sweet"],"unicode":"\u{1F36F}"},{"group":4,"hexcode":"1F37C","label":"baby bottle","order":3753,"tags":["baby","bottle","drink","milk"],"unicode":"\u{1F37C}"},{"group":4,"hexcode":"1F95B","label":"glass of milk","order":3754,"tags":["drink","glass","milk"],"unicode":"\u{1F95B}"},{"group":4,"hexcode":"2615","label":"hot beverage","order":3755,"tags":["beverage","coffee","drink","hot","steaming","tea"],"unicode":"\u2615\uFE0F"},{"group":4,"hexcode":"1FAD6","label":"teapot","order":3756,"tags":["drink","pot","tea"],"unicode":"\u{1FAD6}"},{"group":4,"hexcode":"1F375","label":"teacup without handle","order":3757,"tags":["beverage","cup","drink","tea","teacup"],"unicode":"\u{1F375}"},{"group":4,"hexcode":"1F376","label":"sake","order":3758,"tags":["bar","beverage","bottle","cup","drink"],"unicode":"\u{1F376}"},{"group":4,"hexcode":"1F37E","label":"bottle with popping cork","order":3759,"tags":["bar","bottle","cork","drink","popping"],"unicode":"\u{1F37E}"},{"group":4,"hexcode":"1F377","label":"wine glass","order":3760,"tags":["bar","beverage","drink","glass","wine"],"unicode":"\u{1F377}"},{"group":4,"hexcode":"1F378","label":"cocktail glass","order":3761,"tags":["bar","cocktail","drink","glass"],"unicode":"\u{1F378}\uFE0F"},{"group":4,"hexcode":"1F379","label":"tropical drink","order":3762,"tags":["bar","drink","tropical"],"unicode":"\u{1F379}"},{"group":4,"hexcode":"1F37A","label":"beer mug","order":3763,"tags":["bar","beer","drink","mug"],"unicode":"\u{1F37A}"},{"group":4,"hexcode":"1F37B","label":"clinking beer mugs","order":3764,"tags":["bar","beer","clink","drink","mug"],"unicode":"\u{1F37B}"},{"group":4,"hexcode":"1F942","label":"clinking glasses","order":3765,"tags":["celebrate","clink","drink","glass"],"unicode":"\u{1F942}"},{"group":4,"hexcode":"1F943","label":"tumbler glass","order":3766,"tags":["glass","liquor","shot","tumbler","whisky"],"unicode":"\u{1F943}"},{"group":4,"hexcode":"1FAD7","label":"pouring liquid","order":3767,"tags":["drink","empty","glass","spill"],"unicode":"\u{1FAD7}"},{"group":4,"hexcode":"1F964","label":"cup with straw","order":3768,"tags":["juice","soda"],"unicode":"\u{1F964}"},{"group":4,"hexcode":"1F9CB","label":"bubble tea","order":3769,"tags":["bubble","milk","pearl","tea"],"unicode":"\u{1F9CB}"},{"group":4,"hexcode":"1F9C3","label":"beverage box","order":3770,"tags":["beverage","box","juice","straw","sweet"],"unicode":"\u{1F9C3}"},{"group":4,"hexcode":"1F9C9","label":"mate","order":3771,"tags":["drink"],"unicode":"\u{1F9C9}"},{"group":4,"hexcode":"1F9CA","label":"ice","order":3772,"tags":["cold","ice cube","iceberg"],"unicode":"\u{1F9CA}"},{"group":4,"hexcode":"1F962","label":"chopsticks","order":3773,"tags":["hashi"],"unicode":"\u{1F962}"},{"group":4,"hexcode":"1F37D","label":"fork and knife with plate","order":3775,"tags":["cooking","fork","knife","plate"],"unicode":"\u{1F37D}\uFE0F"},{"group":4,"hexcode":"1F374","label":"fork and knife","order":3776,"tags":["cooking","cutlery","fork","knife"],"unicode":"\u{1F374}"},{"group":4,"hexcode":"1F944","label":"spoon","order":3777,"tags":["tableware"],"unicode":"\u{1F944}"},{"group":4,"hexcode":"1F52A","label":"kitchen knife","order":3778,"tags":["cooking","hocho","knife","tool","weapon"],"unicode":"\u{1F52A}"},{"group":4,"hexcode":"1FAD9","label":"jar","order":3779,"tags":["condiment","container","empty","sauce","store"],"unicode":"\u{1FAD9}"},{"group":4,"hexcode":"1F3FA","label":"amphora","order":3780,"tags":["aquarius","cooking","drink","jug","zodiac"],"unicode":"\u{1F3FA}"},{"group":5,"hexcode":"1F30D","label":"globe showing Europe-Africa","order":3781,"tags":["africa","earth","europe","globe","globe showing europe-africa","world"],"unicode":"\u{1F30D}\uFE0F"},{"group":5,"hexcode":"1F30E","label":"globe showing Americas","order":3782,"tags":["americas","earth","globe","globe showing americas","world"],"unicode":"\u{1F30E}\uFE0F"},{"group":5,"hexcode":"1F30F","label":"globe showing Asia-Australia","order":3783,"tags":["asia","australia","earth","globe","globe showing asia-australia","world"],"unicode":"\u{1F30F}\uFE0F"},{"group":5,"hexcode":"1F310","label":"globe with meridians","order":3784,"tags":["earth","globe","meridians","world"],"unicode":"\u{1F310}"},{"group":5,"hexcode":"1F5FA","label":"world map","order":3786,"tags":["map","world"],"unicode":"\u{1F5FA}\uFE0F"},{"group":5,"hexcode":"1F5FE","label":"map of Japan","order":3787,"tags":["japan","map","map of japan"],"unicode":"\u{1F5FE}"},{"group":5,"hexcode":"1F9ED","label":"compass","order":3788,"tags":["magnetic","navigation","orienteering"],"unicode":"\u{1F9ED}"},{"group":5,"hexcode":"1F3D4","label":"snow-capped mountain","order":3790,"tags":["cold","mountain","snow"],"unicode":"\u{1F3D4}\uFE0F"},{"group":5,"hexcode":"26F0","label":"mountain","order":3792,"tags":["mountain"],"unicode":"\u26F0\uFE0F"},{"group":5,"hexcode":"1F30B","label":"volcano","order":3793,"tags":["eruption","mountain"],"unicode":"\u{1F30B}"},{"group":5,"hexcode":"1F5FB","label":"mount fuji","order":3794,"tags":["fuji","mountain"],"unicode":"\u{1F5FB}"},{"group":5,"hexcode":"1F3D5","label":"camping","order":3796,"tags":["camping"],"unicode":"\u{1F3D5}\uFE0F"},{"group":5,"hexcode":"1F3D6","label":"beach with umbrella","order":3798,"tags":["beach","umbrella"],"unicode":"\u{1F3D6}\uFE0F"},{"group":5,"hexcode":"1F3DC","label":"desert","order":3800,"tags":["desert"],"unicode":"\u{1F3DC}\uFE0F"},{"group":5,"hexcode":"1F3DD","label":"desert island","order":3802,"tags":["desert","island"],"unicode":"\u{1F3DD}\uFE0F"},{"group":5,"hexcode":"1F3DE","label":"national park","order":3804,"tags":["park"],"unicode":"\u{1F3DE}\uFE0F"},{"group":5,"hexcode":"1F3DF","label":"stadium","order":3806,"tags":["stadium"],"unicode":"\u{1F3DF}\uFE0F"},{"group":5,"hexcode":"1F3DB","label":"classical building","order":3808,"tags":["classical"],"unicode":"\u{1F3DB}\uFE0F"},{"group":5,"hexcode":"1F3D7","label":"building construction","order":3810,"tags":["construction"],"unicode":"\u{1F3D7}\uFE0F"},{"group":5,"hexcode":"1F9F1","label":"brick","order":3811,"tags":["bricks","clay","mortar","wall"],"unicode":"\u{1F9F1}"},{"group":5,"hexcode":"1FAA8","label":"rock","order":3812,"tags":["boulder","heavy","solid","stone"],"unicode":"\u{1FAA8}"},{"group":5,"hexcode":"1FAB5","label":"wood","order":3813,"tags":["log","lumber","timber"],"unicode":"\u{1FAB5}"},{"group":5,"hexcode":"1F6D6","label":"hut","order":3814,"tags":["house","roundhouse","yurt"],"unicode":"\u{1F6D6}"},{"group":5,"hexcode":"1F3D8","label":"houses","order":3816,"tags":["houses"],"unicode":"\u{1F3D8}\uFE0F"},{"group":5,"hexcode":"1F3DA","label":"derelict house","order":3818,"tags":["derelict","house"],"unicode":"\u{1F3DA}\uFE0F"},{"group":5,"hexcode":"1F3E0","label":"house","order":3819,"tags":["home"],"unicode":"\u{1F3E0}\uFE0F"},{"group":5,"hexcode":"1F3E1","label":"house with garden","order":3820,"tags":["garden","home","house"],"unicode":"\u{1F3E1}"},{"group":5,"hexcode":"1F3E2","label":"office building","order":3821,"tags":["building"],"unicode":"\u{1F3E2}"},{"group":5,"hexcode":"1F3E3","label":"Japanese post office","order":3822,"tags":["japanese","japanese post office","post"],"unicode":"\u{1F3E3}"},{"group":5,"hexcode":"1F3E4","label":"post office","order":3823,"tags":["european","post"],"unicode":"\u{1F3E4}"},{"group":5,"hexcode":"1F3E5","label":"hospital","order":3824,"tags":["doctor","medicine"],"unicode":"\u{1F3E5}"},{"group":5,"hexcode":"1F3E6","label":"bank","order":3825,"tags":["building"],"unicode":"\u{1F3E6}"},{"group":5,"hexcode":"1F3E8","label":"hotel","order":3826,"tags":["building"],"unicode":"\u{1F3E8}"},{"group":5,"hexcode":"1F3E9","label":"love hotel","order":3827,"tags":["hotel","love"],"unicode":"\u{1F3E9}"},{"group":5,"hexcode":"1F3EA","label":"convenience store","order":3828,"tags":["convenience","store"],"unicode":"\u{1F3EA}"},{"group":5,"hexcode":"1F3EB","label":"school","order":3829,"tags":["building"],"unicode":"\u{1F3EB}"},{"group":5,"hexcode":"1F3EC","label":"department store","order":3830,"tags":["department","store"],"unicode":"\u{1F3EC}"},{"group":5,"hexcode":"1F3ED","label":"factory","order":3831,"tags":["building"],"unicode":"\u{1F3ED}\uFE0F"},{"group":5,"hexcode":"1F3EF","label":"Japanese castle","order":3832,"tags":["castle","japanese"],"unicode":"\u{1F3EF}"},{"group":5,"hexcode":"1F3F0","label":"castle","order":3833,"tags":["european"],"unicode":"\u{1F3F0}"},{"group":5,"hexcode":"1F492","label":"wedding","order":3834,"tags":["chapel","romance"],"unicode":"\u{1F492}"},{"group":5,"hexcode":"1F5FC","label":"Tokyo tower","order":3835,"tags":["tokyo","tower"],"unicode":"\u{1F5FC}"},{"group":5,"hexcode":"1F5FD","label":"Statue of Liberty","order":3836,"tags":["liberty","statue","statue of liberty"],"unicode":"\u{1F5FD}"},{"group":5,"hexcode":"26EA","label":"church","order":3837,"tags":["christian","cross","religion"],"unicode":"\u26EA\uFE0F"},{"group":5,"hexcode":"1F54C","label":"mosque","order":3838,"tags":["islam","muslim","religion"],"unicode":"\u{1F54C}"},{"group":5,"hexcode":"1F6D5","label":"hindu temple","order":3839,"tags":["hindu","temple"],"unicode":"\u{1F6D5}"},{"group":5,"hexcode":"1F54D","label":"synagogue","order":3840,"tags":["jew","jewish","religion","temple"],"unicode":"\u{1F54D}"},{"group":5,"hexcode":"26E9","label":"shinto shrine","order":3842,"tags":["religion","shinto","shrine"],"unicode":"\u26E9\uFE0F"},{"group":5,"hexcode":"1F54B","label":"kaaba","order":3843,"tags":["islam","muslim","religion"],"unicode":"\u{1F54B}"},{"group":5,"hexcode":"26F2","label":"fountain","order":3844,"tags":["fountain"],"unicode":"\u26F2\uFE0F"},{"group":5,"hexcode":"26FA","label":"tent","order":3845,"tags":["camping"],"unicode":"\u26FA\uFE0F"},{"group":5,"hexcode":"1F301","label":"foggy","order":3846,"tags":["fog"],"unicode":"\u{1F301}"},{"group":5,"hexcode":"1F303","label":"night with stars","order":3847,"tags":["night","star"],"unicode":"\u{1F303}"},{"group":5,"hexcode":"1F3D9","label":"cityscape","order":3849,"tags":["city"],"unicode":"\u{1F3D9}\uFE0F"},{"group":5,"hexcode":"1F304","label":"sunrise over mountains","order":3850,"tags":["morning","mountain","sun","sunrise"],"unicode":"\u{1F304}"},{"group":5,"hexcode":"1F305","label":"sunrise","order":3851,"tags":["morning","sun"],"unicode":"\u{1F305}"},{"group":5,"hexcode":"1F306","label":"cityscape at dusk","order":3852,"tags":["city","dusk","evening","landscape","sunset"],"unicode":"\u{1F306}"},{"group":5,"hexcode":"1F307","label":"sunset","order":3853,"tags":["dusk","sun"],"unicode":"\u{1F307}"},{"group":5,"hexcode":"1F309","label":"bridge at night","order":3854,"tags":["bridge","night"],"unicode":"\u{1F309}"},{"group":5,"hexcode":"2668","label":"hot springs","order":3856,"tags":["hot","hotsprings","springs","steaming"],"unicode":"\u2668\uFE0F"},{"group":5,"hexcode":"1F3A0","label":"carousel horse","order":3857,"tags":["carousel","horse"],"unicode":"\u{1F3A0}"},{"group":5,"hexcode":"1F6DD","label":"playground slide","order":3858,"tags":["amusement park","play","theme park"],"unicode":"\u{1F6DD}"},{"group":5,"hexcode":"1F3A1","label":"ferris wheel","order":3859,"tags":["amusement park","ferris","theme park","wheel"],"unicode":"\u{1F3A1}"},{"group":5,"hexcode":"1F3A2","label":"roller coaster","order":3860,"tags":["amusement park","coaster","roller","theme park"],"unicode":"\u{1F3A2}"},{"group":5,"hexcode":"1F488","label":"barber pole","order":3861,"tags":["barber","haircut","pole"],"unicode":"\u{1F488}"},{"group":5,"hexcode":"1F3AA","label":"circus tent","order":3862,"tags":["circus","tent"],"unicode":"\u{1F3AA}"},{"group":5,"hexcode":"1F682","label":"locomotive","order":3863,"tags":["engine","railway","steam","train"],"unicode":"\u{1F682}"},{"group":5,"hexcode":"1F683","label":"railway car","order":3864,"tags":["car","electric","railway","train","tram","trolleybus"],"unicode":"\u{1F683}"},{"group":5,"hexcode":"1F684","label":"high-speed train","order":3865,"tags":["railway","shinkansen","speed","train"],"unicode":"\u{1F684}"},{"group":5,"hexcode":"1F685","label":"bullet train","order":3866,"tags":["bullet","railway","shinkansen","speed","train"],"unicode":"\u{1F685}"},{"group":5,"hexcode":"1F686","label":"train","order":3867,"tags":["railway"],"unicode":"\u{1F686}"},{"group":5,"hexcode":"1F687","label":"metro","order":3868,"tags":["subway"],"unicode":"\u{1F687}\uFE0F"},{"group":5,"hexcode":"1F688","label":"light rail","order":3869,"tags":["railway"],"unicode":"\u{1F688}"},{"group":5,"hexcode":"1F689","label":"station","order":3870,"tags":["railway","train"],"unicode":"\u{1F689}"},{"group":5,"hexcode":"1F68A","label":"tram","order":3871,"tags":["trolleybus"],"unicode":"\u{1F68A}"},{"group":5,"hexcode":"1F69D","label":"monorail","order":3872,"tags":["vehicle"],"unicode":"\u{1F69D}"},{"group":5,"hexcode":"1F69E","label":"mountain railway","order":3873,"tags":["car","mountain","railway"],"unicode":"\u{1F69E}"},{"group":5,"hexcode":"1F68B","label":"tram car","order":3874,"tags":["car","tram","trolleybus"],"unicode":"\u{1F68B}"},{"group":5,"hexcode":"1F68C","label":"bus","order":3875,"tags":["vehicle"],"unicode":"\u{1F68C}"},{"group":5,"hexcode":"1F68D","label":"oncoming bus","order":3876,"tags":["bus","oncoming"],"unicode":"\u{1F68D}\uFE0F"},{"group":5,"hexcode":"1F68E","label":"trolleybus","order":3877,"tags":["bus","tram","trolley"],"unicode":"\u{1F68E}"},{"group":5,"hexcode":"1F690","label":"minibus","order":3878,"tags":["bus"],"unicode":"\u{1F690}"},{"group":5,"hexcode":"1F691","label":"ambulance","order":3879,"tags":["vehicle"],"unicode":"\u{1F691}\uFE0F"},{"group":5,"hexcode":"1F692","label":"fire engine","order":3880,"tags":["engine","fire","truck"],"unicode":"\u{1F692}"},{"group":5,"hexcode":"1F693","label":"police car","order":3881,"tags":["car","patrol","police"],"unicode":"\u{1F693}"},{"group":5,"hexcode":"1F694","label":"oncoming police car","order":3882,"tags":["car","oncoming","police"],"unicode":"\u{1F694}\uFE0F"},{"group":5,"hexcode":"1F695","label":"taxi","order":3883,"tags":["vehicle"],"unicode":"\u{1F695}"},{"group":5,"hexcode":"1F696","label":"oncoming taxi","order":3884,"tags":["oncoming","taxi"],"unicode":"\u{1F696}"},{"group":5,"hexcode":"1F697","label":"automobile","order":3885,"tags":["car"],"unicode":"\u{1F697}"},{"group":5,"hexcode":"1F698","label":"oncoming automobile","order":3886,"tags":["automobile","car","oncoming"],"unicode":"\u{1F698}\uFE0F"},{"group":5,"hexcode":"1F699","label":"sport utility vehicle","order":3887,"tags":["recreational","sport utility"],"unicode":"\u{1F699}"},{"group":5,"hexcode":"1F6FB","label":"pickup truck","order":3888,"tags":["pick-up","pickup","truck"],"unicode":"\u{1F6FB}"},{"group":5,"hexcode":"1F69A","label":"delivery truck","order":3889,"tags":["delivery","truck"],"unicode":"\u{1F69A}"},{"group":5,"hexcode":"1F69B","label":"articulated lorry","order":3890,"tags":["lorry","semi","truck"],"unicode":"\u{1F69B}"},{"group":5,"hexcode":"1F69C","label":"tractor","order":3891,"tags":["vehicle"],"unicode":"\u{1F69C}"},{"group":5,"hexcode":"1F3CE","label":"racing car","order":3893,"tags":["car","racing"],"unicode":"\u{1F3CE}\uFE0F"},{"group":5,"hexcode":"1F3CD","label":"motorcycle","order":3895,"tags":["racing"],"unicode":"\u{1F3CD}\uFE0F"},{"group":5,"hexcode":"1F6F5","label":"motor scooter","order":3896,"tags":["motor","scooter"],"unicode":"\u{1F6F5}"},{"group":5,"hexcode":"1F9BD","label":"manual wheelchair","order":3897,"tags":["accessibility"],"unicode":"\u{1F9BD}"},{"group":5,"hexcode":"1F9BC","label":"motorized wheelchair","order":3898,"tags":["accessibility"],"unicode":"\u{1F9BC}"},{"group":5,"hexcode":"1F6FA","label":"auto rickshaw","order":3899,"tags":["tuk tuk"],"unicode":"\u{1F6FA}"},{"group":5,"hexcode":"1F6B2","label":"bicycle","order":3900,"tags":["bike"],"unicode":"\u{1F6B2}\uFE0F"},{"group":5,"hexcode":"1F6F4","label":"kick scooter","order":3901,"tags":["kick","scooter"],"unicode":"\u{1F6F4}"},{"group":5,"hexcode":"1F6F9","label":"skateboard","order":3902,"tags":["board"],"unicode":"\u{1F6F9}"},{"group":5,"hexcode":"1F6FC","label":"roller skate","order":3903,"tags":["roller","skate"],"unicode":"\u{1F6FC}"},{"group":5,"hexcode":"1F68F","label":"bus stop","order":3904,"tags":["bus","stop"],"unicode":"\u{1F68F}"},{"group":5,"hexcode":"1F6E3","label":"motorway","order":3906,"tags":["highway","road"],"unicode":"\u{1F6E3}\uFE0F"},{"group":5,"hexcode":"1F6E4","label":"railway track","order":3908,"tags":["railway","train"],"unicode":"\u{1F6E4}\uFE0F"},{"group":5,"hexcode":"1F6E2","label":"oil drum","order":3910,"tags":["drum","oil"],"unicode":"\u{1F6E2}\uFE0F"},{"group":5,"hexcode":"26FD","label":"fuel pump","order":3911,"tags":["diesel","fuel","fuelpump","gas","pump","station"],"unicode":"\u26FD\uFE0F"},{"group":5,"hexcode":"1F6DE","label":"wheel","order":3912,"tags":["circle","tire","turn"],"unicode":"\u{1F6DE}"},{"group":5,"hexcode":"1F6A8","label":"police car light","order":3913,"tags":["beacon","car","light","police","revolving"],"unicode":"\u{1F6A8}"},{"group":5,"hexcode":"1F6A5","label":"horizontal traffic light","order":3914,"tags":["light","signal","traffic"],"unicode":"\u{1F6A5}"},{"group":5,"hexcode":"1F6A6","label":"vertical traffic light","order":3915,"tags":["light","signal","traffic"],"unicode":"\u{1F6A6}"},{"group":5,"hexcode":"1F6D1","label":"stop sign","order":3916,"tags":["octagonal","sign","stop"],"unicode":"\u{1F6D1}"},{"group":5,"hexcode":"1F6A7","label":"construction","order":3917,"tags":["barrier"],"unicode":"\u{1F6A7}"},{"group":5,"hexcode":"2693","label":"anchor","order":3918,"tags":["ship","tool"],"unicode":"\u2693\uFE0F"},{"group":5,"hexcode":"1F6DF","label":"ring buoy","order":3919,"tags":["float","life preserver","life saver","rescue","safety"],"unicode":"\u{1F6DF}"},{"group":5,"hexcode":"26F5","label":"sailboat","order":3920,"tags":["boat","resort","sea","yacht"],"unicode":"\u26F5\uFE0F"},{"group":5,"hexcode":"1F6F6","label":"canoe","order":3921,"tags":["boat"],"unicode":"\u{1F6F6}"},{"group":5,"hexcode":"1F6A4","label":"speedboat","order":3922,"tags":["boat"],"unicode":"\u{1F6A4}"},{"group":5,"hexcode":"1F6F3","label":"passenger ship","order":3924,"tags":["passenger","ship"],"unicode":"\u{1F6F3}\uFE0F"},{"group":5,"hexcode":"26F4","label":"ferry","order":3926,"tags":["boat","passenger"],"unicode":"\u26F4\uFE0F"},{"group":5,"hexcode":"1F6E5","label":"motor boat","order":3928,"tags":["boat","motorboat"],"unicode":"\u{1F6E5}\uFE0F"},{"group":5,"hexcode":"1F6A2","label":"ship","order":3929,"tags":["boat","passenger"],"unicode":"\u{1F6A2}"},{"group":5,"hexcode":"2708","label":"airplane","order":3931,"tags":["aeroplane"],"unicode":"\u2708\uFE0F"},{"group":5,"hexcode":"1F6E9","label":"small airplane","order":3933,"tags":["aeroplane","airplane"],"unicode":"\u{1F6E9}\uFE0F"},{"group":5,"hexcode":"1F6EB","label":"airplane departure","order":3934,"tags":["aeroplane","airplane","check-in","departure","departures"],"unicode":"\u{1F6EB}"},{"group":5,"hexcode":"1F6EC","label":"airplane arrival","order":3935,"tags":["aeroplane","airplane","arrivals","arriving","landing"],"unicode":"\u{1F6EC}"},{"group":5,"hexcode":"1FA82","label":"parachute","order":3936,"tags":["hang-glide","parasail","skydive"],"unicode":"\u{1FA82}"},{"group":5,"hexcode":"1F4BA","label":"seat","order":3937,"tags":["chair"],"unicode":"\u{1F4BA}"},{"group":5,"hexcode":"1F681","label":"helicopter","order":3938,"tags":["vehicle"],"unicode":"\u{1F681}"},{"group":5,"hexcode":"1F69F","label":"suspension railway","order":3939,"tags":["railway","suspension"],"unicode":"\u{1F69F}"},{"group":5,"hexcode":"1F6A0","label":"mountain cableway","order":3940,"tags":["cable","gondola","mountain"],"unicode":"\u{1F6A0}"},{"group":5,"hexcode":"1F6A1","label":"aerial tramway","order":3941,"tags":["aerial","cable","car","gondola","tramway"],"unicode":"\u{1F6A1}"},{"group":5,"hexcode":"1F6F0","label":"satellite","order":3943,"tags":["space"],"unicode":"\u{1F6F0}\uFE0F"},{"group":5,"hexcode":"1F680","label":"rocket","order":3944,"tags":["space"],"unicode":"\u{1F680}"},{"group":5,"hexcode":"1F6F8","label":"flying saucer","order":3945,"tags":["ufo"],"unicode":"\u{1F6F8}"},{"group":5,"hexcode":"1F6CE","label":"bellhop bell","order":3947,"tags":["bell","bellhop","hotel"],"unicode":"\u{1F6CE}\uFE0F"},{"group":5,"hexcode":"1F9F3","label":"luggage","order":3948,"tags":["packing","travel"],"unicode":"\u{1F9F3}"},{"group":5,"hexcode":"231B","label":"hourglass done","order":3949,"tags":["sand","timer"],"unicode":"\u231B\uFE0F"},{"group":5,"hexcode":"23F3","label":"hourglass not done","order":3950,"tags":["hourglass","sand","timer"],"unicode":"\u23F3\uFE0F"},{"group":5,"hexcode":"231A","label":"watch","order":3951,"tags":["clock"],"unicode":"\u231A\uFE0F"},{"group":5,"hexcode":"23F0","label":"alarm clock","order":3952,"tags":["alarm","clock"],"unicode":"\u23F0\uFE0F"},{"group":5,"hexcode":"23F1","label":"stopwatch","order":3954,"tags":["clock"],"unicode":"\u23F1\uFE0F"},{"group":5,"hexcode":"23F2","label":"timer clock","order":3956,"tags":["clock","timer"],"unicode":"\u23F2\uFE0F"},{"group":5,"hexcode":"1F570","label":"mantelpiece clock","order":3958,"tags":["clock"],"unicode":"\u{1F570}\uFE0F"},{"group":5,"hexcode":"1F55B","label":"twelve o\u2019clock","order":3959,"tags":["00","12","12:00","clock","o\u2019clock","twelve"],"unicode":"\u{1F55B}\uFE0F"},{"group":5,"hexcode":"1F567","label":"twelve-thirty","order":3960,"tags":["12","12:30","clock","thirty","twelve"],"unicode":"\u{1F567}\uFE0F"},{"group":5,"hexcode":"1F550","label":"one o\u2019clock","order":3961,"tags":["00","1","1:00","clock","one","o\u2019clock"],"unicode":"\u{1F550}\uFE0F"},{"group":5,"hexcode":"1F55C","label":"one-thirty","order":3962,"tags":["1","1:30","clock","one","thirty"],"unicode":"\u{1F55C}\uFE0F"},{"group":5,"hexcode":"1F551","label":"two o\u2019clock","order":3963,"tags":["00","2","2:00","clock","o\u2019clock","two"],"unicode":"\u{1F551}\uFE0F"},{"group":5,"hexcode":"1F55D","label":"two-thirty","order":3964,"tags":["2","2:30","clock","thirty","two"],"unicode":"\u{1F55D}\uFE0F"},{"group":5,"hexcode":"1F552","label":"three o\u2019clock","order":3965,"tags":["00","3","3:00","clock","o\u2019clock","three"],"unicode":"\u{1F552}\uFE0F"},{"group":5,"hexcode":"1F55E","label":"three-thirty","order":3966,"tags":["3","3:30","clock","thirty","three"],"unicode":"\u{1F55E}\uFE0F"},{"group":5,"hexcode":"1F553","label":"four o\u2019clock","order":3967,"tags":["00","4","4:00","clock","four","o\u2019clock"],"unicode":"\u{1F553}\uFE0F"},{"group":5,"hexcode":"1F55F","label":"four-thirty","order":3968,"tags":["4","4:30","clock","four","thirty"],"unicode":"\u{1F55F}\uFE0F"},{"group":5,"hexcode":"1F554","label":"five o\u2019clock","order":3969,"tags":["00","5","5:00","clock","five","o\u2019clock"],"unicode":"\u{1F554}\uFE0F"},{"group":5,"hexcode":"1F560","label":"five-thirty","order":3970,"tags":["5","5:30","clock","five","thirty"],"unicode":"\u{1F560}\uFE0F"},{"group":5,"hexcode":"1F555","label":"six o\u2019clock","order":3971,"tags":["00","6","6:00","clock","o\u2019clock","six"],"unicode":"\u{1F555}\uFE0F"},{"group":5,"hexcode":"1F561","label":"six-thirty","order":3972,"tags":["6","6:30","clock","six","thirty"],"unicode":"\u{1F561}\uFE0F"},{"group":5,"hexcode":"1F556","label":"seven o\u2019clock","order":3973,"tags":["00","7","7:00","clock","o\u2019clock","seven"],"unicode":"\u{1F556}\uFE0F"},{"group":5,"hexcode":"1F562","label":"seven-thirty","order":3974,"tags":["7","7:30","clock","seven","thirty"],"unicode":"\u{1F562}\uFE0F"},{"group":5,"hexcode":"1F557","label":"eight o\u2019clock","order":3975,"tags":["00","8","8:00","clock","eight","o\u2019clock"],"unicode":"\u{1F557}\uFE0F"},{"group":5,"hexcode":"1F563","label":"eight-thirty","order":3976,"tags":["8","8:30","clock","eight","thirty"],"unicode":"\u{1F563}\uFE0F"},{"group":5,"hexcode":"1F558","label":"nine o\u2019clock","order":3977,"tags":["00","9","9:00","clock","nine","o\u2019clock"],"unicode":"\u{1F558}\uFE0F"},{"group":5,"hexcode":"1F564","label":"nine-thirty","order":3978,"tags":["9","9:30","clock","nine","thirty"],"unicode":"\u{1F564}\uFE0F"},{"group":5,"hexcode":"1F559","label":"ten o\u2019clock","order":3979,"tags":["00","10","10:00","clock","o\u2019clock","ten"],"unicode":"\u{1F559}\uFE0F"},{"group":5,"hexcode":"1F565","label":"ten-thirty","order":3980,"tags":["10","10:30","clock","ten","thirty"],"unicode":"\u{1F565}\uFE0F"},{"group":5,"hexcode":"1F55A","label":"eleven o\u2019clock","order":3981,"tags":["00","11","11:00","clock","eleven","o\u2019clock"],"unicode":"\u{1F55A}\uFE0F"},{"group":5,"hexcode":"1F566","label":"eleven-thirty","order":3982,"tags":["11","11:30","clock","eleven","thirty"],"unicode":"\u{1F566}\uFE0F"},{"group":5,"hexcode":"1F311","label":"new moon","order":3983,"tags":["dark","moon"],"unicode":"\u{1F311}"},{"group":5,"hexcode":"1F312","label":"waxing crescent moon","order":3984,"tags":["crescent","moon","waxing"],"unicode":"\u{1F312}"},{"group":5,"hexcode":"1F313","label":"first quarter moon","order":3985,"tags":["moon","quarter"],"unicode":"\u{1F313}"},{"group":5,"hexcode":"1F314","label":"waxing gibbous moon","order":3986,"tags":["gibbous","moon","waxing"],"unicode":"\u{1F314}"},{"group":5,"hexcode":"1F315","label":"full moon","order":3987,"tags":["full","moon"],"unicode":"\u{1F315}\uFE0F"},{"group":5,"hexcode":"1F316","label":"waning gibbous moon","order":3988,"tags":["gibbous","moon","waning"],"unicode":"\u{1F316}"},{"group":5,"hexcode":"1F317","label":"last quarter moon","order":3989,"tags":["moon","quarter"],"unicode":"\u{1F317}"},{"group":5,"hexcode":"1F318","label":"waning crescent moon","order":3990,"tags":["crescent","moon","waning"],"unicode":"\u{1F318}"},{"group":5,"hexcode":"1F319","label":"crescent moon","order":3991,"tags":["crescent","moon"],"unicode":"\u{1F319}"},{"group":5,"hexcode":"1F31A","label":"new moon face","order":3992,"tags":["face","moon"],"unicode":"\u{1F31A}"},{"group":5,"hexcode":"1F31B","label":"first quarter moon face","order":3993,"tags":["face","moon","quarter"],"unicode":"\u{1F31B}"},{"group":5,"hexcode":"1F31C","label":"last quarter moon face","order":3994,"tags":["face","moon","quarter"],"unicode":"\u{1F31C}\uFE0F"},{"group":5,"hexcode":"1F321","label":"thermometer","order":3996,"tags":["weather"],"unicode":"\u{1F321}\uFE0F"},{"group":5,"hexcode":"2600","label":"sun","order":3998,"tags":["bright","rays","sunny"],"unicode":"\u2600\uFE0F"},{"group":5,"hexcode":"1F31D","label":"full moon face","order":3999,"tags":["bright","face","full","moon"],"unicode":"\u{1F31D}"},{"group":5,"hexcode":"1F31E","label":"sun with face","order":4000,"tags":["bright","face","sun"],"unicode":"\u{1F31E}"},{"group":5,"hexcode":"1FA90","label":"ringed planet","order":4001,"tags":["saturn","saturnine"],"unicode":"\u{1FA90}"},{"group":5,"hexcode":"2B50","label":"star","order":4002,"tags":["star"],"unicode":"\u2B50\uFE0F"},{"group":5,"hexcode":"1F31F","label":"glowing star","order":4003,"tags":["glittery","glow","shining","sparkle","star"],"unicode":"\u{1F31F}"},{"group":5,"hexcode":"1F320","label":"shooting star","order":4004,"tags":["falling","shooting","star"],"unicode":"\u{1F320}"},{"group":5,"hexcode":"1F30C","label":"milky way","order":4005,"tags":["space"],"unicode":"\u{1F30C}"},{"group":5,"hexcode":"2601","label":"cloud","order":4007,"tags":["weather"],"unicode":"\u2601\uFE0F"},{"group":5,"hexcode":"26C5","label":"sun behind cloud","order":4008,"tags":["cloud","sun"],"unicode":"\u26C5\uFE0F"},{"group":5,"hexcode":"26C8","label":"cloud with lightning and rain","order":4010,"tags":["cloud","rain","thunder"],"unicode":"\u26C8\uFE0F"},{"group":5,"hexcode":"1F324","label":"sun behind small cloud","order":4012,"tags":["cloud","sun"],"unicode":"\u{1F324}\uFE0F"},{"group":5,"hexcode":"1F325","label":"sun behind large cloud","order":4014,"tags":["cloud","sun"],"unicode":"\u{1F325}\uFE0F"},{"group":5,"hexcode":"1F326","label":"sun behind rain cloud","order":4016,"tags":["cloud","rain","sun"],"unicode":"\u{1F326}\uFE0F"},{"group":5,"hexcode":"1F327","label":"cloud with rain","order":4018,"tags":["cloud","rain"],"unicode":"\u{1F327}\uFE0F"},{"group":5,"hexcode":"1F328","label":"cloud with snow","order":4020,"tags":["cloud","cold","snow"],"unicode":"\u{1F328}\uFE0F"},{"group":5,"hexcode":"1F329","label":"cloud with lightning","order":4022,"tags":["cloud","lightning"],"unicode":"\u{1F329}\uFE0F"},{"group":5,"hexcode":"1F32A","label":"tornado","order":4024,"tags":["cloud","whirlwind"],"unicode":"\u{1F32A}\uFE0F"},{"group":5,"hexcode":"1F32B","label":"fog","order":4026,"tags":["cloud"],"unicode":"\u{1F32B}\uFE0F"},{"group":5,"hexcode":"1F32C","label":"wind face","order":4028,"tags":["blow","cloud","face","wind"],"unicode":"\u{1F32C}\uFE0F"},{"group":5,"hexcode":"1F300","label":"cyclone","order":4029,"tags":["dizzy","hurricane","twister","typhoon"],"unicode":"\u{1F300}"},{"group":5,"hexcode":"1F308","label":"rainbow","order":4030,"tags":["rain"],"unicode":"\u{1F308}"},{"group":5,"hexcode":"1F302","label":"closed umbrella","order":4031,"tags":["clothing","rain","umbrella"],"unicode":"\u{1F302}"},{"group":5,"hexcode":"2602","label":"umbrella","order":4033,"tags":["clothing","rain"],"unicode":"\u2602\uFE0F"},{"group":5,"hexcode":"2614","label":"umbrella with rain drops","order":4034,"tags":["clothing","drop","rain","umbrella"],"unicode":"\u2614\uFE0F"},{"group":5,"hexcode":"26F1","label":"umbrella on ground","order":4036,"tags":["rain","sun","umbrella"],"unicode":"\u26F1\uFE0F"},{"group":5,"hexcode":"26A1","label":"high voltage","order":4037,"tags":["danger","electric","lightning","voltage","zap"],"unicode":"\u26A1\uFE0F"},{"group":5,"hexcode":"2744","label":"snowflake","order":4039,"tags":["cold","snow"],"unicode":"\u2744\uFE0F"},{"group":5,"hexcode":"2603","label":"snowman","order":4041,"tags":["cold","snow"],"unicode":"\u2603\uFE0F"},{"group":5,"hexcode":"26C4","label":"snowman without snow","order":4042,"tags":["cold","snow","snowman"],"unicode":"\u26C4\uFE0F"},{"group":5,"hexcode":"2604","label":"comet","order":4044,"tags":["space"],"unicode":"\u2604\uFE0F"},{"group":5,"hexcode":"1F525","label":"fire","order":4045,"tags":["flame","tool"],"unicode":"\u{1F525}"},{"group":5,"hexcode":"1F4A7","label":"droplet","order":4046,"tags":["cold","comic","drop","sweat"],"unicode":"\u{1F4A7}"},{"group":5,"hexcode":"1F30A","label":"water wave","order":4047,"tags":["ocean","water","wave"],"unicode":"\u{1F30A}"},{"group":6,"hexcode":"1F383","label":"jack-o-lantern","order":4048,"tags":["celebration","halloween","jack","lantern"],"unicode":"\u{1F383}"},{"group":6,"hexcode":"1F384","label":"Christmas tree","order":4049,"tags":["celebration","christmas","tree"],"unicode":"\u{1F384}"},{"group":6,"hexcode":"1F386","label":"fireworks","order":4050,"tags":["celebration"],"unicode":"\u{1F386}"},{"group":6,"hexcode":"1F387","label":"sparkler","order":4051,"tags":["celebration","fireworks","sparkle"],"unicode":"\u{1F387}"},{"group":6,"hexcode":"1F9E8","label":"firecracker","order":4052,"tags":["dynamite","explosive","fireworks"],"unicode":"\u{1F9E8}"},{"group":6,"hexcode":"2728","label":"sparkles","order":4053,"tags":["*","sparkle","star"],"unicode":"\u2728\uFE0F"},{"group":6,"hexcode":"1F388","label":"balloon","order":4054,"tags":["celebration"],"unicode":"\u{1F388}"},{"group":6,"hexcode":"1F389","label":"party popper","order":4055,"tags":["celebration","party","popper","tada"],"unicode":"\u{1F389}"},{"group":6,"hexcode":"1F38A","label":"confetti ball","order":4056,"tags":["ball","celebration","confetti"],"unicode":"\u{1F38A}"},{"group":6,"hexcode":"1F38B","label":"tanabata tree","order":4057,"tags":["banner","celebration","japanese","tree"],"unicode":"\u{1F38B}"},{"group":6,"hexcode":"1F38D","label":"pine decoration","order":4058,"tags":["bamboo","celebration","japanese","pine"],"unicode":"\u{1F38D}"},{"group":6,"hexcode":"1F38E","label":"Japanese dolls","order":4059,"tags":["celebration","doll","festival","japanese","japanese dolls"],"unicode":"\u{1F38E}"},{"group":6,"hexcode":"1F38F","label":"carp streamer","order":4060,"tags":["carp","celebration","streamer"],"unicode":"\u{1F38F}"},{"group":6,"hexcode":"1F390","label":"wind chime","order":4061,"tags":["bell","celebration","chime","wind"],"unicode":"\u{1F390}"},{"group":6,"hexcode":"1F391","label":"moon viewing ceremony","order":4062,"tags":["celebration","ceremony","moon"],"unicode":"\u{1F391}"},{"group":6,"hexcode":"1F9E7","label":"red envelope","order":4063,"tags":["gift","good luck","h\xF3ngb\u0101o","lai see","money"],"unicode":"\u{1F9E7}"},{"group":6,"hexcode":"1F380","label":"ribbon","order":4064,"tags":["celebration"],"unicode":"\u{1F380}"},{"group":6,"hexcode":"1F381","label":"wrapped gift","order":4065,"tags":["box","celebration","gift","present","wrapped"],"unicode":"\u{1F381}"},{"group":6,"hexcode":"1F397","label":"reminder ribbon","order":4067,"tags":["celebration","reminder","ribbon"],"unicode":"\u{1F397}\uFE0F"},{"group":6,"hexcode":"1F39F","label":"admission tickets","order":4069,"tags":["admission","ticket"],"unicode":"\u{1F39F}\uFE0F"},{"group":6,"hexcode":"1F3AB","label":"ticket","order":4070,"tags":["admission"],"unicode":"\u{1F3AB}"},{"group":6,"hexcode":"1F396","label":"military medal","order":4072,"tags":["celebration","medal","military"],"unicode":"\u{1F396}\uFE0F"},{"group":6,"hexcode":"1F3C6","label":"trophy","order":4073,"tags":["prize"],"unicode":"\u{1F3C6}\uFE0F"},{"group":6,"hexcode":"1F3C5","label":"sports medal","order":4074,"tags":["medal"],"unicode":"\u{1F3C5}"},{"group":6,"hexcode":"1F947","label":"1st place medal","order":4075,"tags":["first","gold","medal"],"unicode":"\u{1F947}"},{"group":6,"hexcode":"1F948","label":"2nd place medal","order":4076,"tags":["medal","second","silver"],"unicode":"\u{1F948}"},{"group":6,"hexcode":"1F949","label":"3rd place medal","order":4077,"tags":["bronze","medal","third"],"unicode":"\u{1F949}"},{"group":6,"hexcode":"26BD","label":"soccer ball","order":4078,"tags":["ball","football","soccer"],"unicode":"\u26BD\uFE0F"},{"group":6,"hexcode":"26BE","label":"baseball","order":4079,"tags":["ball"],"unicode":"\u26BE\uFE0F"},{"group":6,"hexcode":"1F94E","label":"softball","order":4080,"tags":["ball","glove","underarm"],"unicode":"\u{1F94E}"},{"group":6,"hexcode":"1F3C0","label":"basketball","order":4081,"tags":["ball","hoop"],"unicode":"\u{1F3C0}"},{"group":6,"hexcode":"1F3D0","label":"volleyball","order":4082,"tags":["ball","game"],"unicode":"\u{1F3D0}"},{"group":6,"hexcode":"1F3C8","label":"american football","order":4083,"tags":["american","ball","football"],"unicode":"\u{1F3C8}"},{"group":6,"hexcode":"1F3C9","label":"rugby football","order":4084,"tags":["ball","football","rugby"],"unicode":"\u{1F3C9}"},{"group":6,"hexcode":"1F3BE","label":"tennis","order":4085,"tags":["ball","racquet"],"unicode":"\u{1F3BE}"},{"group":6,"hexcode":"1F94F","label":"flying disc","order":4086,"tags":["ultimate"],"unicode":"\u{1F94F}"},{"group":6,"hexcode":"1F3B3","label":"bowling","order":4087,"tags":["ball","game"],"unicode":"\u{1F3B3}"},{"group":6,"hexcode":"1F3CF","label":"cricket game","order":4088,"tags":["ball","bat","game"],"unicode":"\u{1F3CF}"},{"group":6,"hexcode":"1F3D1","label":"field hockey","order":4089,"tags":["ball","field","game","hockey","stick"],"unicode":"\u{1F3D1}"},{"group":6,"hexcode":"1F3D2","label":"ice hockey","order":4090,"tags":["game","hockey","ice","puck","stick"],"unicode":"\u{1F3D2}"},{"group":6,"hexcode":"1F94D","label":"lacrosse","order":4091,"tags":["ball","goal","stick"],"unicode":"\u{1F94D}"},{"group":6,"hexcode":"1F3D3","label":"ping pong","order":4092,"tags":["ball","bat","game","paddle","table tennis"],"unicode":"\u{1F3D3}"},{"group":6,"hexcode":"1F3F8","label":"badminton","order":4093,"tags":["birdie","game","racquet","shuttlecock"],"unicode":"\u{1F3F8}"},{"group":6,"hexcode":"1F94A","label":"boxing glove","order":4094,"tags":["boxing","glove"],"unicode":"\u{1F94A}"},{"group":6,"hexcode":"1F94B","label":"martial arts uniform","order":4095,"tags":["judo","karate","martial arts","taekwondo","uniform"],"unicode":"\u{1F94B}"},{"group":6,"hexcode":"1F945","label":"goal net","order":4096,"tags":["goal","net"],"unicode":"\u{1F945}"},{"group":6,"hexcode":"26F3","label":"flag in hole","order":4097,"tags":["golf","hole"],"unicode":"\u26F3\uFE0F"},{"group":6,"hexcode":"26F8","label":"ice skate","order":4099,"tags":["ice","skate"],"unicode":"\u26F8\uFE0F"},{"group":6,"hexcode":"1F3A3","label":"fishing pole","order":4100,"tags":["fish","pole"],"unicode":"\u{1F3A3}"},{"group":6,"hexcode":"1F93F","label":"diving mask","order":4101,"tags":["diving","scuba","snorkeling"],"unicode":"\u{1F93F}"},{"group":6,"hexcode":"1F3BD","label":"running shirt","order":4102,"tags":["athletics","running","sash","shirt"],"unicode":"\u{1F3BD}"},{"group":6,"hexcode":"1F3BF","label":"skis","order":4103,"tags":["ski","snow"],"unicode":"\u{1F3BF}"},{"group":6,"hexcode":"1F6F7","label":"sled","order":4104,"tags":["sledge","sleigh"],"unicode":"\u{1F6F7}"},{"group":6,"hexcode":"1F94C","label":"curling stone","order":4105,"tags":["game","rock"],"unicode":"\u{1F94C}"},{"group":6,"hexcode":"1F3AF","label":"bullseye","order":4106,"tags":["dart","direct hit","game","hit","target"],"unicode":"\u{1F3AF}"},{"group":6,"hexcode":"1FA80","label":"yo-yo","order":4107,"tags":["fluctuate","toy"],"unicode":"\u{1FA80}"},{"group":6,"hexcode":"1FA81","label":"kite","order":4108,"tags":["fly","soar"],"unicode":"\u{1FA81}"},{"group":6,"hexcode":"1F52B","label":"water pistol","order":4109,"tags":["gun","handgun","pistol","revolver","tool","water","weapon"],"unicode":"\u{1F52B}"},{"group":6,"hexcode":"1F3B1","label":"pool 8 ball","order":4110,"tags":["8","ball","billiard","eight","game"],"unicode":"\u{1F3B1}"},{"group":6,"hexcode":"1F52E","label":"crystal ball","order":4111,"tags":["ball","crystal","fairy tale","fantasy","fortune","tool"],"unicode":"\u{1F52E}"},{"group":6,"hexcode":"1FA84","label":"magic wand","order":4112,"tags":["magic","witch","wizard"],"unicode":"\u{1FA84}"},{"group":6,"hexcode":"1F3AE","label":"video game","order":4113,"tags":["controller","game"],"unicode":"\u{1F3AE}\uFE0F"},{"group":6,"hexcode":"1F579","label":"joystick","order":4115,"tags":["game","video game"],"unicode":"\u{1F579}\uFE0F"},{"group":6,"hexcode":"1F3B0","label":"slot machine","order":4116,"tags":["game","slot"],"unicode":"\u{1F3B0}"},{"group":6,"hexcode":"1F3B2","label":"game die","order":4117,"tags":["dice","die","game"],"unicode":"\u{1F3B2}"},{"group":6,"hexcode":"1F9E9","label":"puzzle piece","order":4118,"tags":["clue","interlocking","jigsaw","piece","puzzle"],"unicode":"\u{1F9E9}"},{"group":6,"hexcode":"1F9F8","label":"teddy bear","order":4119,"tags":["plaything","plush","stuffed","toy"],"unicode":"\u{1F9F8}"},{"group":6,"hexcode":"1FA85","label":"pi\xF1ata","order":4120,"tags":["celebration","party"],"unicode":"\u{1FA85}"},{"group":6,"hexcode":"1FAA9","label":"mirror ball","order":4121,"tags":["dance","disco","glitter","party"],"unicode":"\u{1FAA9}"},{"group":6,"hexcode":"1FA86","label":"nesting dolls","order":4122,"tags":["doll","nesting","russia"],"unicode":"\u{1FA86}"},{"group":6,"hexcode":"2660","label":"spade suit","order":4124,"tags":["card","game"],"unicode":"\u2660\uFE0F"},{"group":6,"hexcode":"2665","label":"heart suit","order":4126,"tags":["card","game"],"unicode":"\u2665\uFE0F"},{"group":6,"hexcode":"2666","label":"diamond suit","order":4128,"tags":["card","game"],"unicode":"\u2666\uFE0F"},{"group":6,"hexcode":"2663","label":"club suit","order":4130,"tags":["card","game"],"unicode":"\u2663\uFE0F"},{"group":6,"hexcode":"265F","label":"chess pawn","order":4132,"tags":["chess","dupe","expendable"],"unicode":"\u265F\uFE0F"},{"group":6,"hexcode":"1F0CF","label":"joker","order":4133,"tags":["card","game","wildcard"],"unicode":"\u{1F0CF}"},{"group":6,"hexcode":"1F004","label":"mahjong red dragon","order":4134,"tags":["game","mahjong","red"],"unicode":"\u{1F004}\uFE0F"},{"group":6,"hexcode":"1F3B4","label":"flower playing cards","order":4135,"tags":["card","flower","game","japanese","playing"],"unicode":"\u{1F3B4}"},{"group":6,"hexcode":"1F3AD","label":"performing arts","order":4136,"tags":["art","mask","performing","theater","theatre"],"unicode":"\u{1F3AD}\uFE0F"},{"group":6,"hexcode":"1F5BC","label":"framed picture","order":4138,"tags":["art","frame","museum","painting","picture"],"unicode":"\u{1F5BC}\uFE0F"},{"group":6,"hexcode":"1F3A8","label":"artist palette","order":4139,"tags":["art","museum","painting","palette"],"unicode":"\u{1F3A8}"},{"group":6,"hexcode":"1F9F5","label":"thread","order":4140,"tags":["needle","sewing","spool","string"],"unicode":"\u{1F9F5}"},{"group":6,"hexcode":"1FAA1","label":"sewing needle","order":4141,"tags":["embroidery","needle","sewing","stitches","sutures","tailoring"],"unicode":"\u{1FAA1}"},{"group":6,"hexcode":"1F9F6","label":"yarn","order":4142,"tags":["ball","crochet","knit"],"unicode":"\u{1F9F6}"},{"group":6,"hexcode":"1FAA2","label":"knot","order":4143,"tags":["rope","tangled","tie","twine","twist"],"unicode":"\u{1FAA2}"},{"group":7,"hexcode":"1F453","label":"glasses","order":4144,"tags":["clothing","eye","eyeglasses","eyewear"],"unicode":"\u{1F453}\uFE0F"},{"group":7,"hexcode":"1F576","label":"sunglasses","order":4146,"tags":["dark","eye","eyewear","glasses"],"unicode":"\u{1F576}\uFE0F"},{"group":7,"hexcode":"1F97D","label":"goggles","order":4147,"tags":["eye protection","swimming","welding"],"unicode":"\u{1F97D}"},{"group":7,"hexcode":"1F97C","label":"lab coat","order":4148,"tags":["doctor","experiment","scientist"],"unicode":"\u{1F97C}"},{"group":7,"hexcode":"1F9BA","label":"safety vest","order":4149,"tags":["emergency","safety","vest"],"unicode":"\u{1F9BA}"},{"group":7,"hexcode":"1F454","label":"necktie","order":4150,"tags":["clothing","tie"],"unicode":"\u{1F454}"},{"group":7,"hexcode":"1F455","label":"t-shirt","order":4151,"tags":["clothing","shirt","tshirt"],"unicode":"\u{1F455}"},{"group":7,"hexcode":"1F456","label":"jeans","order":4152,"tags":["clothing","pants","trousers"],"unicode":"\u{1F456}"},{"group":7,"hexcode":"1F9E3","label":"scarf","order":4153,"tags":["neck"],"unicode":"\u{1F9E3}"},{"group":7,"hexcode":"1F9E4","label":"gloves","order":4154,"tags":["hand"],"unicode":"\u{1F9E4}"},{"group":7,"hexcode":"1F9E5","label":"coat","order":4155,"tags":["jacket"],"unicode":"\u{1F9E5}"},{"group":7,"hexcode":"1F9E6","label":"socks","order":4156,"tags":["stocking"],"unicode":"\u{1F9E6}"},{"group":7,"hexcode":"1F457","label":"dress","order":4157,"tags":["clothing"],"unicode":"\u{1F457}"},{"group":7,"hexcode":"1F458","label":"kimono","order":4158,"tags":["clothing"],"unicode":"\u{1F458}"},{"group":7,"hexcode":"1F97B","label":"sari","order":4159,"tags":["clothing","dress"],"unicode":"\u{1F97B}"},{"group":7,"hexcode":"1FA71","label":"one-piece swimsuit","order":4160,"tags":["bathing suit"],"unicode":"\u{1FA71}"},{"group":7,"hexcode":"1FA72","label":"briefs","order":4161,"tags":["bathing suit","one-piece","swimsuit","underwear"],"unicode":"\u{1FA72}"},{"group":7,"hexcode":"1FA73","label":"shorts","order":4162,"tags":["bathing suit","pants","underwear"],"unicode":"\u{1FA73}"},{"group":7,"hexcode":"1F459","label":"bikini","order":4163,"tags":["clothing","swim"],"unicode":"\u{1F459}"},{"group":7,"hexcode":"1F45A","label":"woman\u2019s clothes","order":4164,"tags":["clothing","woman"],"unicode":"\u{1F45A}"},{"group":7,"hexcode":"1FAAD","label":"folding hand fan","order":4165,"tags":["cooling","dance","fan","flutter","hot","shy"],"unicode":"\u{1FAAD}"},{"group":7,"hexcode":"1F45B","label":"purse","order":4166,"tags":["clothing","coin"],"unicode":"\u{1F45B}"},{"group":7,"hexcode":"1F45C","label":"handbag","order":4167,"tags":["bag","clothing","purse"],"unicode":"\u{1F45C}"},{"group":7,"hexcode":"1F45D","label":"clutch bag","order":4168,"tags":["bag","clothing","pouch"],"unicode":"\u{1F45D}"},{"group":7,"hexcode":"1F6CD","label":"shopping bags","order":4170,"tags":["bag","hotel","shopping"],"unicode":"\u{1F6CD}\uFE0F"},{"group":7,"hexcode":"1F392","label":"backpack","order":4171,"tags":["bag","rucksack","satchel","school"],"unicode":"\u{1F392}"},{"group":7,"hexcode":"1FA74","label":"thong sandal","order":4172,"tags":["beach sandals","sandals","thong sandals","thongs","z\u014Dri"],"unicode":"\u{1FA74}"},{"group":7,"hexcode":"1F45E","label":"man\u2019s shoe","order":4173,"tags":["clothing","man","shoe"],"unicode":"\u{1F45E}"},{"group":7,"hexcode":"1F45F","label":"running shoe","order":4174,"tags":["athletic","clothing","shoe","sneaker"],"unicode":"\u{1F45F}"},{"group":7,"hexcode":"1F97E","label":"hiking boot","order":4175,"tags":["backpacking","boot","camping","hiking"],"unicode":"\u{1F97E}"},{"group":7,"hexcode":"1F97F","label":"flat shoe","order":4176,"tags":["ballet flat","slip-on","slipper"],"unicode":"\u{1F97F}"},{"group":7,"hexcode":"1F460","label":"high-heeled shoe","order":4177,"tags":["clothing","heel","shoe","woman"],"unicode":"\u{1F460}"},{"group":7,"hexcode":"1F461","label":"woman\u2019s sandal","order":4178,"tags":["clothing","sandal","shoe","woman"],"unicode":"\u{1F461}"},{"group":7,"hexcode":"1FA70","label":"ballet shoes","order":4179,"tags":["ballet","dance"],"unicode":"\u{1FA70}"},{"group":7,"hexcode":"1F462","label":"woman\u2019s boot","order":4180,"tags":["boot","clothing","shoe","woman"],"unicode":"\u{1F462}"},{"group":7,"hexcode":"1FAAE","label":"hair pick","order":4181,"tags":["afro","comb","hair","pick"],"unicode":"\u{1FAAE}"},{"group":7,"hexcode":"1F451","label":"crown","order":4182,"tags":["clothing","king","queen"],"unicode":"\u{1F451}"},{"group":7,"hexcode":"1F452","label":"woman\u2019s hat","order":4183,"tags":["clothing","hat","woman"],"unicode":"\u{1F452}"},{"group":7,"hexcode":"1F3A9","label":"top hat","order":4184,"tags":["clothing","hat","top","tophat"],"unicode":"\u{1F3A9}"},{"group":7,"hexcode":"1F393","label":"graduation cap","order":4185,"tags":["cap","celebration","clothing","graduation","hat"],"unicode":"\u{1F393}\uFE0F"},{"group":7,"hexcode":"1F9E2","label":"billed cap","order":4186,"tags":["baseball cap"],"unicode":"\u{1F9E2}"},{"group":7,"hexcode":"1FA96","label":"military helmet","order":4187,"tags":["army","helmet","military","soldier","warrior"],"unicode":"\u{1FA96}"},{"group":7,"hexcode":"26D1","label":"rescue worker\u2019s helmet","order":4189,"tags":["aid","cross","face","hat","helmet"],"unicode":"\u26D1\uFE0F"},{"group":7,"hexcode":"1F4FF","label":"prayer beads","order":4190,"tags":["beads","clothing","necklace","prayer","religion"],"unicode":"\u{1F4FF}"},{"group":7,"hexcode":"1F484","label":"lipstick","order":4191,"tags":["cosmetics","makeup"],"unicode":"\u{1F484}"},{"group":7,"hexcode":"1F48D","label":"ring","order":4192,"tags":["diamond"],"unicode":"\u{1F48D}"},{"group":7,"hexcode":"1F48E","label":"gem stone","order":4193,"tags":["diamond","gem","jewel"],"unicode":"\u{1F48E}"},{"group":7,"hexcode":"1F507","label":"muted speaker","order":4194,"tags":["mute","quiet","silent","speaker"],"unicode":"\u{1F507}"},{"group":7,"hexcode":"1F508","label":"speaker low volume","order":4195,"tags":["soft"],"unicode":"\u{1F508}\uFE0F"},{"group":7,"hexcode":"1F509","label":"speaker medium volume","order":4196,"tags":["medium"],"unicode":"\u{1F509}"},{"group":7,"hexcode":"1F50A","label":"speaker high volume","order":4197,"tags":["loud"],"unicode":"\u{1F50A}"},{"group":7,"hexcode":"1F4E2","label":"loudspeaker","order":4198,"tags":["loud","public address"],"unicode":"\u{1F4E2}"},{"group":7,"hexcode":"1F4E3","label":"megaphone","order":4199,"tags":["cheering"],"unicode":"\u{1F4E3}"},{"group":7,"hexcode":"1F4EF","label":"postal horn","order":4200,"tags":["horn","post","postal"],"unicode":"\u{1F4EF}"},{"group":7,"hexcode":"1F514","label":"bell","order":4201,"tags":["bell"],"unicode":"\u{1F514}"},{"group":7,"hexcode":"1F515","label":"bell with slash","order":4202,"tags":["bell","forbidden","mute","quiet","silent"],"unicode":"\u{1F515}"},{"group":7,"hexcode":"1F3BC","label":"musical score","order":4203,"tags":["music","score"],"unicode":"\u{1F3BC}"},{"group":7,"hexcode":"1F3B5","label":"musical note","order":4204,"tags":["music","note"],"unicode":"\u{1F3B5}"},{"group":7,"hexcode":"1F3B6","label":"musical notes","order":4205,"tags":["music","note","notes"],"unicode":"\u{1F3B6}"},{"group":7,"hexcode":"1F399","label":"studio microphone","order":4207,"tags":["mic","microphone","music","studio"],"unicode":"\u{1F399}\uFE0F"},{"group":7,"hexcode":"1F39A","label":"level slider","order":4209,"tags":["level","music","slider"],"unicode":"\u{1F39A}\uFE0F"},{"group":7,"hexcode":"1F39B","label":"control knobs","order":4211,"tags":["control","knobs","music"],"unicode":"\u{1F39B}\uFE0F"},{"group":7,"hexcode":"1F3A4","label":"microphone","order":4212,"tags":["karaoke","mic"],"unicode":"\u{1F3A4}"},{"group":7,"hexcode":"1F3A7","label":"headphone","order":4213,"tags":["earbud"],"unicode":"\u{1F3A7}\uFE0F"},{"group":7,"hexcode":"1F4FB","label":"radio","order":4214,"tags":["video"],"unicode":"\u{1F4FB}\uFE0F"},{"group":7,"hexcode":"1F3B7","label":"saxophone","order":4215,"tags":["instrument","music","sax"],"unicode":"\u{1F3B7}"},{"group":7,"hexcode":"1FA97","label":"accordion","order":4216,"tags":["concertina","squeeze box"],"unicode":"\u{1FA97}"},{"group":7,"hexcode":"1F3B8","label":"guitar","order":4217,"tags":["instrument","music"],"unicode":"\u{1F3B8}"},{"group":7,"hexcode":"1F3B9","label":"musical keyboard","order":4218,"tags":["instrument","keyboard","music","piano"],"unicode":"\u{1F3B9}"},{"group":7,"hexcode":"1F3BA","label":"trumpet","order":4219,"tags":["instrument","music"],"unicode":"\u{1F3BA}"},{"group":7,"hexcode":"1F3BB","label":"violin","order":4220,"tags":["instrument","music"],"unicode":"\u{1F3BB}"},{"group":7,"hexcode":"1FA95","label":"banjo","order":4221,"tags":["music","stringed"],"unicode":"\u{1FA95}"},{"group":7,"hexcode":"1F941","label":"drum","order":4222,"tags":["drumsticks","music"],"unicode":"\u{1F941}"},{"group":7,"hexcode":"1FA98","label":"long drum","order":4223,"tags":["beat","conga","drum","rhythm"],"unicode":"\u{1FA98}"},{"group":7,"hexcode":"1FA87","label":"maracas","order":4224,"tags":["instrument","music","percussion","rattle","shake"],"unicode":"\u{1FA87}"},{"group":7,"hexcode":"1FA88","label":"flute","order":4225,"tags":["fife","music","pipe","recorder","woodwind"],"unicode":"\u{1FA88}"},{"group":7,"hexcode":"1F4F1","label":"mobile phone","order":4226,"tags":["cell","mobile","phone","telephone"],"unicode":"\u{1F4F1}"},{"group":7,"hexcode":"1F4F2","label":"mobile phone with arrow","order":4227,"tags":["arrow","cell","mobile","phone","receive"],"unicode":"\u{1F4F2}"},{"group":7,"hexcode":"260E","label":"telephone","order":4229,"tags":["phone"],"unicode":"\u260E\uFE0F"},{"group":7,"hexcode":"1F4DE","label":"telephone receiver","order":4230,"tags":["phone","receiver","telephone"],"unicode":"\u{1F4DE}"},{"group":7,"hexcode":"1F4DF","label":"pager","order":4231,"tags":["pager"],"unicode":"\u{1F4DF}\uFE0F"},{"group":7,"hexcode":"1F4E0","label":"fax machine","order":4232,"tags":["fax"],"unicode":"\u{1F4E0}"},{"group":7,"hexcode":"1F50B","label":"battery","order":4233,"tags":["battery"],"unicode":"\u{1F50B}"},{"group":7,"hexcode":"1FAAB","label":"low battery","order":4234,"tags":["electronic","low energy"],"unicode":"\u{1FAAB}"},{"group":7,"hexcode":"1F50C","label":"electric plug","order":4235,"tags":["electric","electricity","plug"],"unicode":"\u{1F50C}"},{"group":7,"hexcode":"1F4BB","label":"laptop","order":4236,"tags":["computer","pc","personal"],"unicode":"\u{1F4BB}\uFE0F"},{"group":7,"hexcode":"1F5A5","label":"desktop computer","order":4238,"tags":["computer","desktop"],"unicode":"\u{1F5A5}\uFE0F"},{"group":7,"hexcode":"1F5A8","label":"printer","order":4240,"tags":["computer"],"unicode":"\u{1F5A8}\uFE0F"},{"group":7,"hexcode":"2328","label":"keyboard","order":4242,"tags":["computer"],"unicode":"\u2328\uFE0F"},{"group":7,"hexcode":"1F5B1","label":"computer mouse","order":4244,"tags":["computer"],"unicode":"\u{1F5B1}\uFE0F"},{"group":7,"hexcode":"1F5B2","label":"trackball","order":4246,"tags":["computer"],"unicode":"\u{1F5B2}\uFE0F"},{"group":7,"hexcode":"1F4BD","label":"computer disk","order":4247,"tags":["computer","disk","minidisk","optical"],"unicode":"\u{1F4BD}"},{"group":7,"hexcode":"1F4BE","label":"floppy disk","order":4248,"tags":["computer","disk","floppy"],"unicode":"\u{1F4BE}"},{"group":7,"hexcode":"1F4BF","label":"optical disk","order":4249,"tags":["cd","computer","disk","optical"],"unicode":"\u{1F4BF}\uFE0F"},{"group":7,"hexcode":"1F4C0","label":"dvd","order":4250,"tags":["blu-ray","computer","disk","optical"],"unicode":"\u{1F4C0}"},{"group":7,"hexcode":"1F9EE","label":"abacus","order":4251,"tags":["calculation"],"unicode":"\u{1F9EE}"},{"group":7,"hexcode":"1F3A5","label":"movie camera","order":4252,"tags":["camera","cinema","movie"],"unicode":"\u{1F3A5}"},{"group":7,"hexcode":"1F39E","label":"film frames","order":4254,"tags":["cinema","film","frames","movie"],"unicode":"\u{1F39E}\uFE0F"},{"group":7,"hexcode":"1F4FD","label":"film projector","order":4256,"tags":["cinema","film","movie","projector","video"],"unicode":"\u{1F4FD}\uFE0F"},{"group":7,"hexcode":"1F3AC","label":"clapper board","order":4257,"tags":["clapper","movie"],"unicode":"\u{1F3AC}\uFE0F"},{"group":7,"hexcode":"1F4FA","label":"television","order":4258,"tags":["tv","video"],"unicode":"\u{1F4FA}\uFE0F"},{"group":7,"hexcode":"1F4F7","label":"camera","order":4259,"tags":["video"],"unicode":"\u{1F4F7}\uFE0F"},{"group":7,"hexcode":"1F4F8","label":"camera with flash","order":4260,"tags":["camera","flash","video"],"unicode":"\u{1F4F8}"},{"group":7,"hexcode":"1F4F9","label":"video camera","order":4261,"tags":["camera","video"],"unicode":"\u{1F4F9}\uFE0F"},{"group":7,"hexcode":"1F4FC","label":"videocassette","order":4262,"tags":["tape","vhs","video"],"unicode":"\u{1F4FC}"},{"group":7,"hexcode":"1F50D","label":"magnifying glass tilted left","order":4263,"tags":["glass","magnifying","search","tool"],"unicode":"\u{1F50D}\uFE0F"},{"group":7,"hexcode":"1F50E","label":"magnifying glass tilted right","order":4264,"tags":["glass","magnifying","search","tool"],"unicode":"\u{1F50E}"},{"group":7,"hexcode":"1F56F","label":"candle","order":4266,"tags":["light"],"unicode":"\u{1F56F}\uFE0F"},{"group":7,"hexcode":"1F4A1","label":"light bulb","order":4267,"tags":["bulb","comic","electric","idea","light"],"unicode":"\u{1F4A1}"},{"group":7,"hexcode":"1F526","label":"flashlight","order":4268,"tags":["electric","light","tool","torch"],"unicode":"\u{1F526}"},{"group":7,"hexcode":"1F3EE","label":"red paper lantern","order":4269,"tags":["bar","lantern","light","red"],"unicode":"\u{1F3EE}"},{"group":7,"hexcode":"1FA94","label":"diya lamp","order":4270,"tags":["diya","lamp","oil"],"unicode":"\u{1FA94}"},{"group":7,"hexcode":"1F4D4","label":"notebook with decorative cover","order":4271,"tags":["book","cover","decorated","notebook"],"unicode":"\u{1F4D4}"},{"group":7,"hexcode":"1F4D5","label":"closed book","order":4272,"tags":["book","closed"],"unicode":"\u{1F4D5}"},{"group":7,"hexcode":"1F4D6","label":"open book","order":4273,"tags":["book","open"],"unicode":"\u{1F4D6}"},{"group":7,"hexcode":"1F4D7","label":"green book","order":4274,"tags":["book","green"],"unicode":"\u{1F4D7}"},{"group":7,"hexcode":"1F4D8","label":"blue book","order":4275,"tags":["blue","book"],"unicode":"\u{1F4D8}"},{"group":7,"hexcode":"1F4D9","label":"orange book","order":4276,"tags":["book","orange"],"unicode":"\u{1F4D9}"},{"group":7,"hexcode":"1F4DA","label":"books","order":4277,"tags":["book"],"unicode":"\u{1F4DA}\uFE0F"},{"group":7,"hexcode":"1F4D3","label":"notebook","order":4278,"tags":["notebook"],"unicode":"\u{1F4D3}"},{"group":7,"hexcode":"1F4D2","label":"ledger","order":4279,"tags":["notebook"],"unicode":"\u{1F4D2}"},{"group":7,"hexcode":"1F4C3","label":"page with curl","order":4280,"tags":["curl","document","page"],"unicode":"\u{1F4C3}"},{"group":7,"hexcode":"1F4DC","label":"scroll","order":4281,"tags":["paper"],"unicode":"\u{1F4DC}"},{"group":7,"hexcode":"1F4C4","label":"page facing up","order":4282,"tags":["document","page"],"unicode":"\u{1F4C4}"},{"group":7,"hexcode":"1F4F0","label":"newspaper","order":4283,"tags":["news","paper"],"unicode":"\u{1F4F0}"},{"group":7,"hexcode":"1F5DE","label":"rolled-up newspaper","order":4285,"tags":["news","newspaper","paper","rolled"],"unicode":"\u{1F5DE}\uFE0F"},{"group":7,"hexcode":"1F4D1","label":"bookmark tabs","order":4286,"tags":["bookmark","mark","marker","tabs"],"unicode":"\u{1F4D1}"},{"group":7,"hexcode":"1F516","label":"bookmark","order":4287,"tags":["mark"],"unicode":"\u{1F516}"},{"group":7,"hexcode":"1F3F7","label":"label","order":4289,"tags":["label"],"unicode":"\u{1F3F7}\uFE0F"},{"group":7,"hexcode":"1F4B0","label":"money bag","order":4290,"tags":["bag","dollar","money","moneybag"],"unicode":"\u{1F4B0}\uFE0F"},{"group":7,"hexcode":"1FA99","label":"coin","order":4291,"tags":["gold","metal","money","silver","treasure"],"unicode":"\u{1FA99}"},{"group":7,"hexcode":"1F4B4","label":"yen banknote","order":4292,"tags":["banknote","bill","currency","money","note","yen"],"unicode":"\u{1F4B4}"},{"group":7,"hexcode":"1F4B5","label":"dollar banknote","order":4293,"tags":["banknote","bill","currency","dollar","money","note"],"unicode":"\u{1F4B5}"},{"group":7,"hexcode":"1F4B6","label":"euro banknote","order":4294,"tags":["banknote","bill","currency","euro","money","note"],"unicode":"\u{1F4B6}"},{"group":7,"hexcode":"1F4B7","label":"pound banknote","order":4295,"tags":["banknote","bill","currency","money","note","pound"],"unicode":"\u{1F4B7}"},{"group":7,"hexcode":"1F4B8","label":"money with wings","order":4296,"tags":["banknote","bill","fly","money","wings"],"unicode":"\u{1F4B8}"},{"group":7,"hexcode":"1F4B3","label":"credit card","order":4297,"tags":["card","credit","money"],"unicode":"\u{1F4B3}\uFE0F"},{"group":7,"hexcode":"1F9FE","label":"receipt","order":4298,"tags":["accounting","bookkeeping","evidence","proof"],"unicode":"\u{1F9FE}"},{"group":7,"hexcode":"1F4B9","label":"chart increasing with yen","order":4299,"tags":["chart","graph","growth","money","yen"],"unicode":"\u{1F4B9}"},{"group":7,"hexcode":"2709","label":"envelope","order":4301,"tags":["email","letter"],"unicode":"\u2709\uFE0F"},{"group":7,"hexcode":"1F4E7","label":"e-mail","order":4302,"tags":["email","letter","mail"],"unicode":"\u{1F4E7}"},{"group":7,"hexcode":"1F4E8","label":"incoming envelope","order":4303,"tags":["e-mail","email","envelope","incoming","letter","receive"],"unicode":"\u{1F4E8}"},{"group":7,"hexcode":"1F4E9","label":"envelope with arrow","order":4304,"tags":["arrow","e-mail","email","envelope","outgoing"],"unicode":"\u{1F4E9}"},{"group":7,"hexcode":"1F4E4","label":"outbox tray","order":4305,"tags":["box","letter","mail","outbox","sent","tray"],"unicode":"\u{1F4E4}\uFE0F"},{"group":7,"hexcode":"1F4E5","label":"inbox tray","order":4306,"tags":["box","inbox","letter","mail","receive","tray"],"unicode":"\u{1F4E5}\uFE0F"},{"group":7,"hexcode":"1F4E6","label":"package","order":4307,"tags":["box","parcel"],"unicode":"\u{1F4E6}\uFE0F"},{"group":7,"hexcode":"1F4EB","label":"closed mailbox with raised flag","order":4308,"tags":["closed","mail","mailbox","postbox"],"unicode":"\u{1F4EB}\uFE0F"},{"group":7,"hexcode":"1F4EA","label":"closed mailbox with lowered flag","order":4309,"tags":["closed","lowered","mail","mailbox","postbox"],"unicode":"\u{1F4EA}\uFE0F"},{"group":7,"hexcode":"1F4EC","label":"open mailbox with raised flag","order":4310,"tags":["mail","mailbox","open","postbox"],"unicode":"\u{1F4EC}\uFE0F"},{"group":7,"hexcode":"1F4ED","label":"open mailbox with lowered flag","order":4311,"tags":["lowered","mail","mailbox","open","postbox"],"unicode":"\u{1F4ED}\uFE0F"},{"group":7,"hexcode":"1F4EE","label":"postbox","order":4312,"tags":["mail","mailbox"],"unicode":"\u{1F4EE}"},{"group":7,"hexcode":"1F5F3","label":"ballot box with ballot","order":4314,"tags":["ballot","box"],"unicode":"\u{1F5F3}\uFE0F"},{"group":7,"hexcode":"270F","label":"pencil","order":4316,"tags":["pencil"],"unicode":"\u270F\uFE0F"},{"group":7,"hexcode":"2712","label":"black nib","order":4318,"tags":["nib","pen"],"unicode":"\u2712\uFE0F"},{"group":7,"hexcode":"1F58B","label":"fountain pen","order":4320,"tags":["fountain","pen"],"unicode":"\u{1F58B}\uFE0F"},{"group":7,"hexcode":"1F58A","label":"pen","order":4322,"tags":["ballpoint"],"unicode":"\u{1F58A}\uFE0F"},{"group":7,"hexcode":"1F58C","label":"paintbrush","order":4324,"tags":["painting"],"unicode":"\u{1F58C}\uFE0F"},{"group":7,"hexcode":"1F58D","label":"crayon","order":4326,"tags":["crayon"],"unicode":"\u{1F58D}\uFE0F"},{"group":7,"hexcode":"1F4DD","label":"memo","order":4327,"tags":["pencil"],"unicode":"\u{1F4DD}"},{"group":7,"hexcode":"1F4BC","label":"briefcase","order":4328,"tags":["briefcase"],"unicode":"\u{1F4BC}"},{"group":7,"hexcode":"1F4C1","label":"file folder","order":4329,"tags":["file","folder"],"unicode":"\u{1F4C1}"},{"group":7,"hexcode":"1F4C2","label":"open file folder","order":4330,"tags":["file","folder","open"],"unicode":"\u{1F4C2}"},{"group":7,"hexcode":"1F5C2","label":"card index dividers","order":4332,"tags":["card","dividers","index"],"unicode":"\u{1F5C2}\uFE0F"},{"group":7,"hexcode":"1F4C5","label":"calendar","order":4333,"tags":["date"],"unicode":"\u{1F4C5}"},{"group":7,"hexcode":"1F4C6","label":"tear-off calendar","order":4334,"tags":["calendar"],"unicode":"\u{1F4C6}"},{"group":7,"hexcode":"1F5D2","label":"spiral notepad","order":4336,"tags":["note","pad","spiral"],"unicode":"\u{1F5D2}\uFE0F"},{"group":7,"hexcode":"1F5D3","label":"spiral calendar","order":4338,"tags":["calendar","pad","spiral"],"unicode":"\u{1F5D3}\uFE0F"},{"group":7,"hexcode":"1F4C7","label":"card index","order":4339,"tags":["card","index","rolodex"],"unicode":"\u{1F4C7}"},{"group":7,"hexcode":"1F4C8","label":"chart increasing","order":4340,"tags":["chart","graph","growth","trend","upward"],"unicode":"\u{1F4C8}"},{"group":7,"hexcode":"1F4C9","label":"chart decreasing","order":4341,"tags":["chart","down","graph","trend"],"unicode":"\u{1F4C9}"},{"group":7,"hexcode":"1F4CA","label":"bar chart","order":4342,"tags":["bar","chart","graph"],"unicode":"\u{1F4CA}"},{"group":7,"hexcode":"1F4CB","label":"clipboard","order":4343,"tags":["clipboard"],"unicode":"\u{1F4CB}\uFE0F"},{"group":7,"hexcode":"1F4CC","label":"pushpin","order":4344,"tags":["pin"],"unicode":"\u{1F4CC}"},{"group":7,"hexcode":"1F4CD","label":"round pushpin","order":4345,"tags":["pin","pushpin"],"unicode":"\u{1F4CD}"},{"group":7,"hexcode":"1F4CE","label":"paperclip","order":4346,"tags":["paperclip"],"unicode":"\u{1F4CE}"},{"group":7,"hexcode":"1F587","label":"linked paperclips","order":4348,"tags":["link","paperclip"],"unicode":"\u{1F587}\uFE0F"},{"group":7,"hexcode":"1F4CF","label":"straight ruler","order":4349,"tags":["ruler","straight edge"],"unicode":"\u{1F4CF}"},{"group":7,"hexcode":"1F4D0","label":"triangular ruler","order":4350,"tags":["ruler","set","triangle"],"unicode":"\u{1F4D0}"},{"group":7,"hexcode":"2702","label":"scissors","order":4352,"tags":["cutting","tool"],"unicode":"\u2702\uFE0F"},{"group":7,"hexcode":"1F5C3","label":"card file box","order":4354,"tags":["box","card","file"],"unicode":"\u{1F5C3}\uFE0F"},{"group":7,"hexcode":"1F5C4","label":"file cabinet","order":4356,"tags":["cabinet","file","filing"],"unicode":"\u{1F5C4}\uFE0F"},{"group":7,"hexcode":"1F5D1","label":"wastebasket","order":4358,"tags":["wastebasket"],"unicode":"\u{1F5D1}\uFE0F"},{"group":7,"hexcode":"1F512","label":"locked","order":4359,"tags":["closed"],"unicode":"\u{1F512}\uFE0F"},{"group":7,"hexcode":"1F513","label":"unlocked","order":4360,"tags":["lock","open","unlock"],"unicode":"\u{1F513}\uFE0F"},{"group":7,"hexcode":"1F50F","label":"locked with pen","order":4361,"tags":["ink","lock","nib","pen","privacy"],"unicode":"\u{1F50F}"},{"group":7,"hexcode":"1F510","label":"locked with key","order":4362,"tags":["closed","key","lock","secure"],"unicode":"\u{1F510}"},{"group":7,"hexcode":"1F511","label":"key","order":4363,"tags":["lock","password"],"unicode":"\u{1F511}"},{"group":7,"hexcode":"1F5DD","label":"old key","order":4365,"tags":["clue","key","lock","old"],"unicode":"\u{1F5DD}\uFE0F"},{"group":7,"hexcode":"1F528","label":"hammer","order":4366,"tags":["tool"],"unicode":"\u{1F528}"},{"group":7,"hexcode":"1FA93","label":"axe","order":4367,"tags":["chop","hatchet","split","wood"],"unicode":"\u{1FA93}"},{"group":7,"hexcode":"26CF","label":"pick","order":4369,"tags":["mining","tool"],"unicode":"\u26CF\uFE0F"},{"group":7,"hexcode":"2692","label":"hammer and pick","order":4371,"tags":["hammer","pick","tool"],"unicode":"\u2692\uFE0F"},{"group":7,"hexcode":"1F6E0","label":"hammer and wrench","order":4373,"tags":["hammer","spanner","tool","wrench"],"unicode":"\u{1F6E0}\uFE0F"},{"group":7,"hexcode":"1F5E1","label":"dagger","order":4375,"tags":["knife","weapon"],"unicode":"\u{1F5E1}\uFE0F"},{"group":7,"hexcode":"2694","label":"crossed swords","order":4377,"tags":["crossed","swords","weapon"],"unicode":"\u2694\uFE0F"},{"group":7,"hexcode":"1F4A3","label":"bomb","order":4378,"tags":["comic"],"unicode":"\u{1F4A3}\uFE0F"},{"group":7,"hexcode":"1FA83","label":"boomerang","order":4379,"tags":["rebound","repercussion"],"unicode":"\u{1FA83}"},{"group":7,"hexcode":"1F3F9","label":"bow and arrow","order":4380,"tags":["archer","arrow","bow","sagittarius","zodiac"],"unicode":"\u{1F3F9}"},{"group":7,"hexcode":"1F6E1","label":"shield","order":4382,"tags":["weapon"],"unicode":"\u{1F6E1}\uFE0F"},{"group":7,"hexcode":"1FA9A","label":"carpentry saw","order":4383,"tags":["carpenter","lumber","saw","tool"],"unicode":"\u{1FA9A}"},{"group":7,"hexcode":"1F527","label":"wrench","order":4384,"tags":["spanner","tool"],"unicode":"\u{1F527}"},{"group":7,"hexcode":"1FA9B","label":"screwdriver","order":4385,"tags":["screw","tool"],"unicode":"\u{1FA9B}"},{"group":7,"hexcode":"1F529","label":"nut and bolt","order":4386,"tags":["bolt","nut","tool"],"unicode":"\u{1F529}"},{"group":7,"hexcode":"2699","label":"gear","order":4388,"tags":["cog","cogwheel","tool"],"unicode":"\u2699\uFE0F"},{"group":7,"hexcode":"1F5DC","label":"clamp","order":4390,"tags":["compress","tool","vice"],"unicode":"\u{1F5DC}\uFE0F"},{"group":7,"hexcode":"2696","label":"balance scale","order":4392,"tags":["balance","justice","libra","scale","zodiac"],"unicode":"\u2696\uFE0F"},{"group":7,"hexcode":"1F9AF","label":"white cane","order":4393,"tags":["accessibility","blind"],"unicode":"\u{1F9AF}"},{"group":7,"hexcode":"1F517","label":"link","order":4394,"tags":["link"],"unicode":"\u{1F517}"},{"group":7,"hexcode":"26D3-FE0F-200D-1F4A5","label":"broken chain","order":4395,"tags":["break","breaking","chain","cuffs","freedom"],"unicode":"\u26D3\uFE0F\u200D\u{1F4A5}"},{"group":7,"hexcode":"26D3","label":"chains","order":4398,"tags":["chain"],"unicode":"\u26D3\uFE0F"},{"group":7,"hexcode":"1FA9D","label":"hook","order":4399,"tags":["catch","crook","curve","ensnare","selling point"],"unicode":"\u{1FA9D}"},{"group":7,"hexcode":"1F9F0","label":"toolbox","order":4400,"tags":["chest","mechanic","tool"],"unicode":"\u{1F9F0}"},{"group":7,"hexcode":"1F9F2","label":"magnet","order":4401,"tags":["attraction","horseshoe","magnetic"],"unicode":"\u{1F9F2}"},{"group":7,"hexcode":"1FA9C","label":"ladder","order":4402,"tags":["climb","rung","step"],"unicode":"\u{1FA9C}"},{"group":7,"hexcode":"2697","label":"alembic","order":4404,"tags":["chemistry","tool"],"unicode":"\u2697\uFE0F"},{"group":7,"hexcode":"1F9EA","label":"test tube","order":4405,"tags":["chemist","chemistry","experiment","lab","science"],"unicode":"\u{1F9EA}"},{"group":7,"hexcode":"1F9EB","label":"petri dish","order":4406,"tags":["bacteria","biologist","biology","culture","lab"],"unicode":"\u{1F9EB}"},{"group":7,"hexcode":"1F9EC","label":"dna","order":4407,"tags":["biologist","evolution","gene","genetics","life"],"unicode":"\u{1F9EC}"},{"group":7,"hexcode":"1F52C","label":"microscope","order":4408,"tags":["science","tool"],"unicode":"\u{1F52C}"},{"group":7,"hexcode":"1F52D","label":"telescope","order":4409,"tags":["science","tool"],"unicode":"\u{1F52D}"},{"group":7,"hexcode":"1F4E1","label":"satellite antenna","order":4410,"tags":["antenna","dish","satellite"],"unicode":"\u{1F4E1}"},{"group":7,"hexcode":"1F489","label":"syringe","order":4411,"tags":["medicine","needle","shot","sick"],"unicode":"\u{1F489}"},{"group":7,"hexcode":"1FA78","label":"drop of blood","order":4412,"tags":["bleed","blood donation","injury","medicine","menstruation"],"unicode":"\u{1FA78}"},{"group":7,"hexcode":"1F48A","label":"pill","order":4413,"tags":["doctor","medicine","sick"],"unicode":"\u{1F48A}"},{"group":7,"hexcode":"1FA79","label":"adhesive bandage","order":4414,"tags":["bandage"],"unicode":"\u{1FA79}"},{"group":7,"hexcode":"1FA7C","label":"crutch","order":4415,"tags":["cane","disability","hurt","mobility aid","stick"],"unicode":"\u{1FA7C}"},{"group":7,"hexcode":"1FA7A","label":"stethoscope","order":4416,"tags":["doctor","heart","medicine"],"unicode":"\u{1FA7A}"},{"group":7,"hexcode":"1FA7B","label":"x-ray","order":4417,"tags":["bones","doctor","medical","skeleton"],"unicode":"\u{1FA7B}"},{"group":7,"hexcode":"1F6AA","label":"door","order":4418,"tags":["door"],"unicode":"\u{1F6AA}"},{"group":7,"hexcode":"1F6D7","label":"elevator","order":4419,"tags":["accessibility","hoist","lift"],"unicode":"\u{1F6D7}"},{"group":7,"hexcode":"1FA9E","label":"mirror","order":4420,"tags":["reflection","reflector","speculum"],"unicode":"\u{1FA9E}"},{"group":7,"hexcode":"1FA9F","label":"window","order":4421,"tags":["frame","fresh air","opening","transparent","view"],"unicode":"\u{1FA9F}"},{"group":7,"hexcode":"1F6CF","label":"bed","order":4423,"tags":["hotel","sleep"],"unicode":"\u{1F6CF}\uFE0F"},{"group":7,"hexcode":"1F6CB","label":"couch and lamp","order":4425,"tags":["couch","hotel","lamp"],"unicode":"\u{1F6CB}\uFE0F"},{"group":7,"hexcode":"1FA91","label":"chair","order":4426,"tags":["seat","sit"],"unicode":"\u{1FA91}"},{"group":7,"hexcode":"1F6BD","label":"toilet","order":4427,"tags":["toilet"],"unicode":"\u{1F6BD}"},{"group":7,"hexcode":"1FAA0","label":"plunger","order":4428,"tags":["force cup","plumber","suction","toilet"],"unicode":"\u{1FAA0}"},{"group":7,"hexcode":"1F6BF","label":"shower","order":4429,"tags":["water"],"unicode":"\u{1F6BF}"},{"group":7,"hexcode":"1F6C1","label":"bathtub","order":4430,"tags":["bath"],"unicode":"\u{1F6C1}"},{"group":7,"hexcode":"1FAA4","label":"mouse trap","order":4431,"tags":["bait","mousetrap","snare","trap"],"unicode":"\u{1FAA4}"},{"group":7,"hexcode":"1FA92","label":"razor","order":4432,"tags":["sharp","shave"],"unicode":"\u{1FA92}"},{"group":7,"hexcode":"1F9F4","label":"lotion bottle","order":4433,"tags":["lotion","moisturizer","shampoo","sunscreen"],"unicode":"\u{1F9F4}"},{"group":7,"hexcode":"1F9F7","label":"safety pin","order":4434,"tags":["diaper","punk rock"],"unicode":"\u{1F9F7}"},{"group":7,"hexcode":"1F9F9","label":"broom","order":4435,"tags":["cleaning","sweeping","witch"],"unicode":"\u{1F9F9}"},{"group":7,"hexcode":"1F9FA","label":"basket","order":4436,"tags":["farming","laundry","picnic"],"unicode":"\u{1F9FA}"},{"group":7,"hexcode":"1F9FB","label":"roll of paper","order":4437,"tags":["paper towels","toilet paper"],"unicode":"\u{1F9FB}"},{"group":7,"hexcode":"1FAA3","label":"bucket","order":4438,"tags":["cask","pail","vat"],"unicode":"\u{1FAA3}"},{"group":7,"hexcode":"1F9FC","label":"soap","order":4439,"tags":["bar","bathing","cleaning","lather","soapdish"],"unicode":"\u{1F9FC}"},{"group":7,"hexcode":"1FAE7","label":"bubbles","order":4440,"tags":["burp","clean","soap","underwater"],"unicode":"\u{1FAE7}"},{"group":7,"hexcode":"1FAA5","label":"toothbrush","order":4441,"tags":["bathroom","brush","clean","dental","hygiene","teeth"],"unicode":"\u{1FAA5}"},{"group":7,"hexcode":"1F9FD","label":"sponge","order":4442,"tags":["absorbing","cleaning","porous"],"unicode":"\u{1F9FD}"},{"group":7,"hexcode":"1F9EF","label":"fire extinguisher","order":4443,"tags":["extinguish","fire","quench"],"unicode":"\u{1F9EF}"},{"group":7,"hexcode":"1F6D2","label":"shopping cart","order":4444,"tags":["cart","shopping","trolley"],"unicode":"\u{1F6D2}"},{"group":7,"hexcode":"1F6AC","label":"cigarette","order":4445,"tags":["smoking"],"unicode":"\u{1F6AC}"},{"group":7,"hexcode":"26B0","label":"coffin","order":4447,"tags":["death"],"unicode":"\u26B0\uFE0F"},{"group":7,"hexcode":"1FAA6","label":"headstone","order":4448,"tags":["cemetery","grave","graveyard","tombstone"],"unicode":"\u{1FAA6}"},{"group":7,"hexcode":"26B1","label":"funeral urn","order":4450,"tags":["ashes","death","funeral","urn"],"unicode":"\u26B1\uFE0F"},{"group":7,"hexcode":"1F9FF","label":"nazar amulet","order":4451,"tags":["bead","charm","evil-eye","nazar","talisman"],"unicode":"\u{1F9FF}"},{"group":7,"hexcode":"1FAAC","label":"hamsa","order":4452,"tags":["amulet","fatima","hand","mary","miriam","protection"],"unicode":"\u{1FAAC}"},{"group":7,"hexcode":"1F5FF","label":"moai","order":4453,"tags":["face","moyai","statue"],"unicode":"\u{1F5FF}"},{"group":7,"hexcode":"1FAA7","label":"placard","order":4454,"tags":["demonstration","picket","protest","sign"],"unicode":"\u{1FAA7}"},{"group":7,"hexcode":"1FAAA","label":"identification card","order":4455,"tags":["credentials","id","license","security"],"unicode":"\u{1FAAA}"},{"group":8,"hexcode":"1F3E7","label":"ATM sign","order":4456,"tags":["atm","atm sign","automated","bank","teller"],"unicode":"\u{1F3E7}"},{"group":8,"hexcode":"1F6AE","label":"litter in bin sign","order":4457,"tags":["litter","litter bin"],"unicode":"\u{1F6AE}"},{"group":8,"hexcode":"1F6B0","label":"potable water","order":4458,"tags":["drinking","potable","water"],"unicode":"\u{1F6B0}"},{"group":8,"hexcode":"267F","label":"wheelchair symbol","order":4459,"tags":["access"],"unicode":"\u267F\uFE0F"},{"group":8,"hexcode":"1F6B9","label":"men\u2019s room","order":4460,"tags":["bathroom","lavatory","man","restroom","toilet","wc"],"unicode":"\u{1F6B9}\uFE0F"},{"group":8,"hexcode":"1F6BA","label":"women\u2019s room","order":4461,"tags":["bathroom","lavatory","restroom","toilet","wc","woman"],"unicode":"\u{1F6BA}\uFE0F"},{"group":8,"hexcode":"1F6BB","label":"restroom","order":4462,"tags":["bathroom","lavatory","toilet","wc"],"unicode":"\u{1F6BB}"},{"group":8,"hexcode":"1F6BC","label":"baby symbol","order":4463,"tags":["baby","changing"],"unicode":"\u{1F6BC}\uFE0F"},{"group":8,"hexcode":"1F6BE","label":"water closet","order":4464,"tags":["bathroom","closet","lavatory","restroom","toilet","water","wc"],"unicode":"\u{1F6BE}"},{"group":8,"hexcode":"1F6C2","label":"passport control","order":4465,"tags":["control","passport"],"unicode":"\u{1F6C2}"},{"group":8,"hexcode":"1F6C3","label":"customs","order":4466,"tags":["customs"],"unicode":"\u{1F6C3}"},{"group":8,"hexcode":"1F6C4","label":"baggage claim","order":4467,"tags":["baggage","claim"],"unicode":"\u{1F6C4}"},{"group":8,"hexcode":"1F6C5","label":"left luggage","order":4468,"tags":["baggage","locker","luggage"],"unicode":"\u{1F6C5}"},{"group":8,"hexcode":"26A0","label":"warning","order":4470,"tags":["warning"],"unicode":"\u26A0\uFE0F"},{"group":8,"hexcode":"1F6B8","label":"children crossing","order":4471,"tags":["child","crossing","pedestrian","traffic"],"unicode":"\u{1F6B8}"},{"group":8,"hexcode":"26D4","label":"no entry","order":4472,"tags":["entry","forbidden","no","not","prohibited","traffic"],"unicode":"\u26D4\uFE0F"},{"group":8,"hexcode":"1F6AB","label":"prohibited","order":4473,"tags":["entry","forbidden","no","not"],"unicode":"\u{1F6AB}"},{"group":8,"hexcode":"1F6B3","label":"no bicycles","order":4474,"tags":["bicycle","bike","forbidden","no","prohibited"],"unicode":"\u{1F6B3}"},{"group":8,"hexcode":"1F6AD","label":"no smoking","order":4475,"tags":["forbidden","no","not","prohibited","smoking"],"unicode":"\u{1F6AD}\uFE0F"},{"group":8,"hexcode":"1F6AF","label":"no littering","order":4476,"tags":["forbidden","litter","no","not","prohibited"],"unicode":"\u{1F6AF}"},{"group":8,"hexcode":"1F6B1","label":"non-potable water","order":4477,"tags":["non-drinking","non-potable","water"],"unicode":"\u{1F6B1}"},{"group":8,"hexcode":"1F6B7","label":"no pedestrians","order":4478,"tags":["forbidden","no","not","pedestrian","prohibited"],"unicode":"\u{1F6B7}"},{"group":8,"hexcode":"1F4F5","label":"no mobile phones","order":4479,"tags":["cell","forbidden","mobile","no","phone"],"unicode":"\u{1F4F5}"},{"group":8,"hexcode":"1F51E","label":"no one under eighteen","order":4480,"tags":["18","age restriction","eighteen","prohibited","underage"],"unicode":"\u{1F51E}"},{"group":8,"hexcode":"2622","label":"radioactive","order":4482,"tags":["sign"],"unicode":"\u2622\uFE0F"},{"group":8,"hexcode":"2623","label":"biohazard","order":4484,"tags":["sign"],"unicode":"\u2623\uFE0F"},{"group":8,"hexcode":"2B06","label":"up arrow","order":4486,"tags":["arrow","cardinal","direction","north"],"unicode":"\u2B06\uFE0F"},{"group":8,"hexcode":"2197","label":"up-right arrow","order":4488,"tags":["arrow","direction","intercardinal","northeast"],"unicode":"\u2197\uFE0F"},{"group":8,"hexcode":"27A1","label":"right arrow","order":4490,"tags":["arrow","cardinal","direction","east"],"unicode":"\u27A1\uFE0F"},{"group":8,"hexcode":"2198","label":"down-right arrow","order":4492,"tags":["arrow","direction","intercardinal","southeast"],"unicode":"\u2198\uFE0F"},{"group":8,"hexcode":"2B07","label":"down arrow","order":4494,"tags":["arrow","cardinal","direction","down","south"],"unicode":"\u2B07\uFE0F"},{"group":8,"hexcode":"2199","label":"down-left arrow","order":4496,"tags":["arrow","direction","intercardinal","southwest"],"unicode":"\u2199\uFE0F"},{"group":8,"hexcode":"2B05","label":"left arrow","order":4498,"tags":["arrow","cardinal","direction","west"],"unicode":"\u2B05\uFE0F"},{"group":8,"hexcode":"2196","label":"up-left arrow","order":4500,"tags":["arrow","direction","intercardinal","northwest"],"unicode":"\u2196\uFE0F"},{"group":8,"hexcode":"2195","label":"up-down arrow","order":4502,"tags":["arrow"],"unicode":"\u2195\uFE0F"},{"group":8,"hexcode":"2194","label":"left-right arrow","order":4504,"tags":["arrow"],"unicode":"\u2194\uFE0F"},{"group":8,"hexcode":"21A9","label":"right arrow curving left","order":4506,"tags":["arrow"],"unicode":"\u21A9\uFE0F"},{"group":8,"hexcode":"21AA","label":"left arrow curving right","order":4508,"tags":["arrow"],"unicode":"\u21AA\uFE0F"},{"group":8,"hexcode":"2934","label":"right arrow curving up","order":4510,"tags":["arrow"],"unicode":"\u2934\uFE0F"},{"group":8,"hexcode":"2935","label":"right arrow curving down","order":4512,"tags":["arrow","down"],"unicode":"\u2935\uFE0F"},{"group":8,"hexcode":"1F503","label":"clockwise vertical arrows","order":4513,"tags":["arrow","clockwise","reload"],"unicode":"\u{1F503}"},{"group":8,"hexcode":"1F504","label":"counterclockwise arrows button","order":4514,"tags":["anticlockwise","arrow","counterclockwise","withershins"],"unicode":"\u{1F504}"},{"group":8,"hexcode":"1F519","label":"BACK arrow","order":4515,"tags":["arrow","back"],"unicode":"\u{1F519}"},{"group":8,"hexcode":"1F51A","label":"END arrow","order":4516,"tags":["arrow","end"],"unicode":"\u{1F51A}"},{"group":8,"hexcode":"1F51B","label":"ON! arrow","order":4517,"tags":["arrow","mark","on","on!"],"unicode":"\u{1F51B}"},{"group":8,"hexcode":"1F51C","label":"SOON arrow","order":4518,"tags":["arrow","soon"],"unicode":"\u{1F51C}"},{"group":8,"hexcode":"1F51D","label":"TOP arrow","order":4519,"tags":["arrow","top","up"],"unicode":"\u{1F51D}"},{"group":8,"hexcode":"1F6D0","label":"place of worship","order":4520,"tags":["religion","worship"],"unicode":"\u{1F6D0}"},{"group":8,"hexcode":"269B","label":"atom symbol","order":4522,"tags":["atheist","atom"],"unicode":"\u269B\uFE0F"},{"group":8,"hexcode":"1F549","label":"om","order":4524,"tags":["hindu","religion"],"unicode":"\u{1F549}\uFE0F"},{"group":8,"hexcode":"2721","label":"star of David","order":4526,"tags":["david","jew","jewish","religion","star","star of david"],"unicode":"\u2721\uFE0F"},{"group":8,"hexcode":"2638","label":"wheel of dharma","order":4528,"tags":["buddhist","dharma","religion","wheel"],"unicode":"\u2638\uFE0F"},{"group":8,"hexcode":"262F","label":"yin yang","order":4530,"tags":["religion","tao","taoist","yang","yin"],"unicode":"\u262F\uFE0F"},{"group":8,"hexcode":"271D","label":"latin cross","order":4532,"tags":["christian","cross","religion"],"unicode":"\u271D\uFE0F"},{"group":8,"hexcode":"2626","label":"orthodox cross","order":4534,"tags":["christian","cross","religion"],"unicode":"\u2626\uFE0F"},{"group":8,"hexcode":"262A","label":"star and crescent","order":4536,"tags":["islam","muslim","religion"],"unicode":"\u262A\uFE0F"},{"group":8,"hexcode":"262E","label":"peace symbol","order":4538,"tags":["peace"],"unicode":"\u262E\uFE0F"},{"group":8,"hexcode":"1F54E","label":"menorah","order":4539,"tags":["candelabrum","candlestick","religion"],"unicode":"\u{1F54E}"},{"group":8,"hexcode":"1F52F","label":"dotted six-pointed star","order":4540,"tags":["fortune","star"],"unicode":"\u{1F52F}"},{"group":8,"hexcode":"1FAAF","label":"khanda","order":4541,"tags":["religion","sikh"],"unicode":"\u{1FAAF}"},{"group":8,"hexcode":"2648","label":"Aries","order":4542,"tags":["aries","ram","zodiac"],"unicode":"\u2648\uFE0F"},{"group":8,"hexcode":"2649","label":"Taurus","order":4543,"tags":["bull","ox","taurus","zodiac"],"unicode":"\u2649\uFE0F"},{"group":8,"hexcode":"264A","label":"Gemini","order":4544,"tags":["gemini","twins","zodiac"],"unicode":"\u264A\uFE0F"},{"group":8,"hexcode":"264B","label":"Cancer","order":4545,"tags":["cancer","crab","zodiac"],"unicode":"\u264B\uFE0F"},{"group":8,"hexcode":"264C","label":"Leo","order":4546,"tags":["leo","lion","zodiac"],"unicode":"\u264C\uFE0F"},{"group":8,"hexcode":"264D","label":"Virgo","order":4547,"tags":["virgo","zodiac"],"unicode":"\u264D\uFE0F"},{"group":8,"hexcode":"264E","label":"Libra","order":4548,"tags":["balance","justice","libra","scales","zodiac"],"unicode":"\u264E\uFE0F"},{"group":8,"hexcode":"264F","label":"Scorpio","order":4549,"tags":["scorpio","scorpion","scorpius","zodiac"],"unicode":"\u264F\uFE0F"},{"group":8,"hexcode":"2650","label":"Sagittarius","order":4550,"tags":["archer","sagittarius","zodiac"],"unicode":"\u2650\uFE0F"},{"group":8,"hexcode":"2651","label":"Capricorn","order":4551,"tags":["capricorn","goat","zodiac"],"unicode":"\u2651\uFE0F"},{"group":8,"hexcode":"2652","label":"Aquarius","order":4552,"tags":["aquarius","bearer","water","zodiac"],"unicode":"\u2652\uFE0F"},{"group":8,"hexcode":"2653","label":"Pisces","order":4553,"tags":["fish","pisces","zodiac"],"unicode":"\u2653\uFE0F"},{"group":8,"hexcode":"26CE","label":"Ophiuchus","order":4554,"tags":["bearer","ophiuchus","serpent","snake","zodiac"],"unicode":"\u26CE\uFE0F"},{"group":8,"hexcode":"1F500","label":"shuffle tracks button","order":4555,"tags":["arrow","crossed"],"unicode":"\u{1F500}"},{"group":8,"hexcode":"1F501","label":"repeat button","order":4556,"tags":["arrow","clockwise","repeat"],"unicode":"\u{1F501}"},{"group":8,"hexcode":"1F502","label":"repeat single button","order":4557,"tags":["arrow","clockwise","once"],"unicode":"\u{1F502}"},{"group":8,"hexcode":"25B6","label":"play button","order":4559,"tags":["arrow","play","right","triangle"],"unicode":"\u25B6\uFE0F"},{"group":8,"hexcode":"23E9","label":"fast-forward button","order":4560,"tags":["arrow","double","fast","forward"],"unicode":"\u23E9\uFE0F"},{"group":8,"hexcode":"23ED","label":"next track button","order":4562,"tags":["arrow","next scene","next track","triangle"],"unicode":"\u23ED\uFE0F"},{"group":8,"hexcode":"23EF","label":"play or pause button","order":4564,"tags":["arrow","pause","play","right","triangle"],"unicode":"\u23EF\uFE0F"},{"group":8,"hexcode":"25C0","label":"reverse button","order":4566,"tags":["arrow","left","reverse","triangle"],"unicode":"\u25C0\uFE0F"},{"group":8,"hexcode":"23EA","label":"fast reverse button","order":4567,"tags":["arrow","double","rewind"],"unicode":"\u23EA\uFE0F"},{"group":8,"hexcode":"23EE","label":"last track button","order":4569,"tags":["arrow","previous scene","previous track","triangle"],"unicode":"\u23EE\uFE0F"},{"group":8,"hexcode":"1F53C","label":"upwards button","order":4570,"tags":["arrow","button"],"unicode":"\u{1F53C}"},{"group":8,"hexcode":"23EB","label":"fast up button","order":4571,"tags":["arrow","double"],"unicode":"\u23EB\uFE0F"},{"group":8,"hexcode":"1F53D","label":"downwards button","order":4572,"tags":["arrow","button","down"],"unicode":"\u{1F53D}"},{"group":8,"hexcode":"23EC","label":"fast down button","order":4573,"tags":["arrow","double","down"],"unicode":"\u23EC\uFE0F"},{"group":8,"hexcode":"23F8","label":"pause button","order":4575,"tags":["bar","double","pause","vertical"],"unicode":"\u23F8\uFE0F"},{"group":8,"hexcode":"23F9","label":"stop button","order":4577,"tags":["square","stop"],"unicode":"\u23F9\uFE0F"},{"group":8,"hexcode":"23FA","label":"record button","order":4579,"tags":["circle","record"],"unicode":"\u23FA\uFE0F"},{"group":8,"hexcode":"23CF","label":"eject button","order":4581,"tags":["eject"],"unicode":"\u23CF\uFE0F"},{"group":8,"hexcode":"1F3A6","label":"cinema","order":4582,"tags":["camera","film","movie"],"unicode":"\u{1F3A6}"},{"group":8,"hexcode":"1F505","label":"dim button","order":4583,"tags":["brightness","dim","low"],"unicode":"\u{1F505}"},{"group":8,"hexcode":"1F506","label":"bright button","order":4584,"tags":["bright","brightness"],"unicode":"\u{1F506}"},{"group":8,"hexcode":"1F4F6","label":"antenna bars","order":4585,"tags":["antenna","bar","cell","mobile","phone"],"unicode":"\u{1F4F6}"},{"group":8,"hexcode":"1F6DC","label":"wireless","order":4586,"tags":["computer","internet","network","wi-fi","wifi"],"unicode":"\u{1F6DC}"},{"group":8,"hexcode":"1F4F3","label":"vibration mode","order":4587,"tags":["cell","mobile","mode","phone","telephone","vibration"],"unicode":"\u{1F4F3}"},{"group":8,"hexcode":"1F4F4","label":"mobile phone off","order":4588,"tags":["cell","mobile","off","phone","telephone"],"unicode":"\u{1F4F4}"},{"group":8,"hexcode":"2640","label":"female sign","order":4590,"tags":["woman"],"unicode":"\u2640\uFE0F"},{"group":8,"hexcode":"2642","label":"male sign","order":4592,"tags":["man"],"unicode":"\u2642\uFE0F"},{"group":8,"hexcode":"26A7","label":"transgender symbol","order":4594,"tags":["transgender"],"unicode":"\u26A7\uFE0F"},{"group":8,"hexcode":"2716","label":"multiply","order":4596,"tags":["cancel","multiplication","sign","x","\xD7"],"unicode":"\u2716\uFE0F"},{"group":8,"hexcode":"2795","label":"plus","order":4597,"tags":["+","math","sign"],"unicode":"\u2795\uFE0F"},{"group":8,"hexcode":"2796","label":"minus","order":4598,"tags":["-","math","sign","\u2212"],"unicode":"\u2796\uFE0F"},{"group":8,"hexcode":"2797","label":"divide","order":4599,"tags":["division","math","sign","\xF7"],"unicode":"\u2797\uFE0F"},{"group":8,"hexcode":"1F7F0","label":"heavy equals sign","order":4600,"tags":["equality","math"],"unicode":"\u{1F7F0}"},{"group":8,"hexcode":"267E","label":"infinity","order":4602,"tags":["forever","unbounded","universal"],"unicode":"\u267E\uFE0F"},{"group":8,"hexcode":"203C","label":"double exclamation mark","order":4604,"tags":["!","!!","bangbang","exclamation","mark"],"unicode":"\u203C\uFE0F"},{"group":8,"hexcode":"2049","label":"exclamation question mark","order":4606,"tags":["!","!?","?","exclamation","interrobang","mark","punctuation","question"],"unicode":"\u2049\uFE0F"},{"group":8,"hexcode":"2753","label":"red question mark","order":4607,"tags":["?","mark","punctuation","question"],"unicode":"\u2753\uFE0F"},{"group":8,"hexcode":"2754","label":"white question mark","order":4608,"tags":["?","mark","outlined","punctuation","question"],"unicode":"\u2754\uFE0F"},{"group":8,"hexcode":"2755","label":"white exclamation mark","order":4609,"tags":["!","exclamation","mark","outlined","punctuation"],"unicode":"\u2755\uFE0F"},{"group":8,"hexcode":"2757","label":"red exclamation mark","order":4610,"tags":["!","exclamation","mark","punctuation"],"unicode":"\u2757\uFE0F"},{"group":8,"hexcode":"3030","label":"wavy dash","order":4612,"tags":["dash","punctuation","wavy"],"unicode":"\u3030\uFE0F"},{"group":8,"hexcode":"1F4B1","label":"currency exchange","order":4613,"tags":["bank","currency","exchange","money"],"unicode":"\u{1F4B1}"},{"group":8,"hexcode":"1F4B2","label":"heavy dollar sign","order":4614,"tags":["currency","dollar","money"],"unicode":"\u{1F4B2}"},{"group":8,"hexcode":"2695","label":"medical symbol","order":4616,"tags":["aesculapius","medicine","staff"],"unicode":"\u2695\uFE0F"},{"group":8,"hexcode":"267B","label":"recycling symbol","order":4618,"tags":["recycle"],"unicode":"\u267B\uFE0F"},{"group":8,"hexcode":"269C","label":"fleur-de-lis","order":4620,"tags":["fleur-de-lis"],"unicode":"\u269C\uFE0F"},{"group":8,"hexcode":"1F531","label":"trident emblem","order":4621,"tags":["anchor","emblem","ship","tool","trident"],"unicode":"\u{1F531}"},{"group":8,"hexcode":"1F4DB","label":"name badge","order":4622,"tags":["badge","name"],"unicode":"\u{1F4DB}"},{"group":8,"hexcode":"1F530","label":"Japanese symbol for beginner","order":4623,"tags":["beginner","chevron","japanese","japanese symbol for beginner","leaf"],"unicode":"\u{1F530}"},{"group":8,"hexcode":"2B55","label":"hollow red circle","order":4624,"tags":["circle","large","o","red"],"unicode":"\u2B55\uFE0F"},{"group":8,"hexcode":"2705","label":"check mark button","order":4625,"tags":["button","check","mark","\u2713"],"unicode":"\u2705\uFE0F"},{"group":8,"hexcode":"2611","label":"check box with check","order":4627,"tags":["box","check","\u2713"],"unicode":"\u2611\uFE0F"},{"group":8,"hexcode":"2714","label":"check mark","order":4629,"tags":["check","mark","\u2713"],"unicode":"\u2714\uFE0F"},{"group":8,"hexcode":"274C","label":"cross mark","order":4630,"tags":["cancel","cross","mark","multiplication","multiply","x","\xD7"],"unicode":"\u274C\uFE0F"},{"group":8,"hexcode":"274E","label":"cross mark button","order":4631,"tags":["mark","square","x","\xD7"],"unicode":"\u274E\uFE0F"},{"group":8,"hexcode":"27B0","label":"curly loop","order":4632,"tags":["curl","loop"],"unicode":"\u27B0\uFE0F"},{"group":8,"hexcode":"27BF","label":"double curly loop","order":4633,"tags":["curl","double","loop"],"unicode":"\u27BF\uFE0F"},{"group":8,"hexcode":"303D","label":"part alternation mark","order":4635,"tags":["mark","part"],"unicode":"\u303D\uFE0F"},{"group":8,"hexcode":"2733","label":"eight-spoked asterisk","order":4637,"tags":["*","asterisk"],"unicode":"\u2733\uFE0F"},{"group":8,"hexcode":"2734","label":"eight-pointed star","order":4639,"tags":["*","star"],"unicode":"\u2734\uFE0F"},{"group":8,"hexcode":"2747","label":"sparkle","order":4641,"tags":["*"],"unicode":"\u2747\uFE0F"},{"group":8,"hexcode":"00A9","label":"copyright","order":4643,"tags":["c"],"unicode":"\xA9\uFE0F"},{"group":8,"hexcode":"00AE","label":"registered","order":4645,"tags":["r"],"unicode":"\xAE\uFE0F"},{"group":8,"hexcode":"2122","label":"trade mark","order":4647,"tags":["mark","tm","trademark"],"unicode":"\u2122\uFE0F"},{"group":8,"hexcode":"0023-FE0F-20E3","label":"keycap: #","order":4648,"tags":["keycap"],"unicode":"#\uFE0F\u20E3"},{"group":8,"hexcode":"002A-FE0F-20E3","label":"keycap: *","order":4650,"tags":["keycap"],"unicode":"*\uFE0F\u20E3"},{"group":8,"hexcode":"0030-FE0F-20E3","label":"keycap: 0","order":4652,"tags":["keycap"],"unicode":"0\uFE0F\u20E3"},{"group":8,"hexcode":"0031-FE0F-20E3","label":"keycap: 1","order":4654,"tags":["keycap"],"unicode":"1\uFE0F\u20E3"},{"group":8,"hexcode":"0032-FE0F-20E3","label":"keycap: 2","order":4656,"tags":["keycap"],"unicode":"2\uFE0F\u20E3"},{"group":8,"hexcode":"0033-FE0F-20E3","label":"keycap: 3","order":4658,"tags":["keycap"],"unicode":"3\uFE0F\u20E3"},{"group":8,"hexcode":"0034-FE0F-20E3","label":"keycap: 4","order":4660,"tags":["keycap"],"unicode":"4\uFE0F\u20E3"},{"group":8,"hexcode":"0035-FE0F-20E3","label":"keycap: 5","order":4662,"tags":["keycap"],"unicode":"5\uFE0F\u20E3"},{"group":8,"hexcode":"0036-FE0F-20E3","label":"keycap: 6","order":4664,"tags":["keycap"],"unicode":"6\uFE0F\u20E3"},{"group":8,"hexcode":"0037-FE0F-20E3","label":"keycap: 7","order":4666,"tags":["keycap"],"unicode":"7\uFE0F\u20E3"},{"group":8,"hexcode":"0038-FE0F-20E3","label":"keycap: 8","order":4668,"tags":["keycap"],"unicode":"8\uFE0F\u20E3"},{"group":8,"hexcode":"0039-FE0F-20E3","label":"keycap: 9","order":4670,"tags":["keycap"],"unicode":"9\uFE0F\u20E3"},{"group":8,"hexcode":"1F51F","label":"keycap: 10","order":4672,"tags":["keycap"],"unicode":"\u{1F51F}"},{"group":8,"hexcode":"1F520","label":"input latin uppercase","order":4673,"tags":["abcd","input","latin","letters","uppercase"],"unicode":"\u{1F520}"},{"group":8,"hexcode":"1F521","label":"input latin lowercase","order":4674,"tags":["abcd","input","latin","letters","lowercase"],"unicode":"\u{1F521}"},{"group":8,"hexcode":"1F522","label":"input numbers","order":4675,"tags":["1234","input","numbers"],"unicode":"\u{1F522}"},{"group":8,"hexcode":"1F523","label":"input symbols","order":4676,"tags":["input","\u3012\u266A&%"],"unicode":"\u{1F523}"},{"group":8,"hexcode":"1F524","label":"input latin letters","order":4677,"tags":["abc","alphabet","input","latin","letters"],"unicode":"\u{1F524}"},{"group":8,"hexcode":"1F170","label":"A button (blood type)","order":4679,"tags":["a","a button (blood type)","blood type"],"unicode":"\u{1F170}\uFE0F"},{"group":8,"hexcode":"1F18E","label":"AB button (blood type)","order":4680,"tags":["ab","ab button (blood type)","blood type"],"unicode":"\u{1F18E}"},{"group":8,"hexcode":"1F171","label":"B button (blood type)","order":4682,"tags":["b","b button (blood type)","blood type"],"unicode":"\u{1F171}\uFE0F"},{"group":8,"hexcode":"1F191","label":"CL button","order":4683,"tags":["cl","cl button"],"unicode":"\u{1F191}"},{"group":8,"hexcode":"1F192","label":"COOL button","order":4684,"tags":["cool","cool button"],"unicode":"\u{1F192}"},{"group":8,"hexcode":"1F193","label":"FREE button","order":4685,"tags":["free","free button"],"unicode":"\u{1F193}"},{"group":8,"hexcode":"2139","label":"information","order":4687,"tags":["i"],"unicode":"\u2139\uFE0F"},{"group":8,"hexcode":"1F194","label":"ID button","order":4688,"tags":["id","id button","identity"],"unicode":"\u{1F194}"},{"group":8,"hexcode":"24C2","label":"circled M","order":4690,"tags":["circle","circled m","m"],"unicode":"\u24C2\uFE0F"},{"group":8,"hexcode":"1F195","label":"NEW button","order":4691,"tags":["new","new button"],"unicode":"\u{1F195}"},{"group":8,"hexcode":"1F196","label":"NG button","order":4692,"tags":["ng","ng button"],"unicode":"\u{1F196}"},{"group":8,"hexcode":"1F17E","label":"O button (blood type)","order":4694,"tags":["blood type","o","o button (blood type)"],"unicode":"\u{1F17E}\uFE0F"},{"group":8,"hexcode":"1F197","label":"OK button","order":4695,"tags":["ok","ok button"],"unicode":"\u{1F197}"},{"group":8,"hexcode":"1F17F","label":"P button","order":4697,"tags":["p","p button","parking"],"unicode":"\u{1F17F}\uFE0F"},{"group":8,"hexcode":"1F198","label":"SOS button","order":4698,"tags":["help","sos","sos button"],"unicode":"\u{1F198}"},{"group":8,"hexcode":"1F199","label":"UP! button","order":4699,"tags":["mark","up","up!","up! button"],"unicode":"\u{1F199}"},{"group":8,"hexcode":"1F19A","label":"VS button","order":4700,"tags":["versus","vs","vs button"],"unicode":"\u{1F19A}"},{"group":8,"hexcode":"1F201","label":"Japanese \u201Chere\u201D button","order":4701,"tags":["japanese","japanese \u201Chere\u201D button","katakana","\u201Chere\u201D","\u30B3\u30B3"],"unicode":"\u{1F201}"},{"group":8,"hexcode":"1F202","label":"Japanese \u201Cservice charge\u201D button","order":4703,"tags":["japanese","japanese \u201Cservice charge\u201D button","katakana","\u201Cservice charge\u201D","\u30B5"],"unicode":"\u{1F202}\uFE0F"},{"group":8,"hexcode":"1F237","label":"Japanese \u201Cmonthly amount\u201D button","order":4705,"tags":["ideograph","japanese","japanese \u201Cmonthly amount\u201D button","\u201Cmonthly amount\u201D","\u6708"],"unicode":"\u{1F237}\uFE0F"},{"group":8,"hexcode":"1F236","label":"Japanese \u201Cnot free of charge\u201D button","order":4706,"tags":["ideograph","japanese","japanese \u201Cnot free of charge\u201D button","\u201Cnot free of charge\u201D","\u6709"],"unicode":"\u{1F236}"},{"group":8,"hexcode":"1F22F","label":"Japanese \u201Creserved\u201D button","order":4707,"tags":["ideograph","japanese","japanese \u201Creserved\u201D button","\u201Creserved\u201D","\u6307"],"unicode":"\u{1F22F}\uFE0F"},{"group":8,"hexcode":"1F250","label":"Japanese \u201Cbargain\u201D button","order":4708,"tags":["ideograph","japanese","japanese \u201Cbargain\u201D button","\u201Cbargain\u201D","\u5F97"],"unicode":"\u{1F250}"},{"group":8,"hexcode":"1F239","label":"Japanese \u201Cdiscount\u201D button","order":4709,"tags":["ideograph","japanese","japanese \u201Cdiscount\u201D button","\u201Cdiscount\u201D","\u5272"],"unicode":"\u{1F239}"},{"group":8,"hexcode":"1F21A","label":"Japanese \u201Cfree of charge\u201D button","order":4710,"tags":["ideograph","japanese","japanese \u201Cfree of charge\u201D button","\u201Cfree of charge\u201D","\u7121"],"unicode":"\u{1F21A}\uFE0F"},{"group":8,"hexcode":"1F232","label":"Japanese \u201Cprohibited\u201D button","order":4711,"tags":["ideograph","japanese","japanese \u201Cprohibited\u201D button","\u201Cprohibited\u201D","\u7981"],"unicode":"\u{1F232}"},{"group":8,"hexcode":"1F251","label":"Japanese \u201Cacceptable\u201D button","order":4712,"tags":["ideograph","japanese","japanese \u201Cacceptable\u201D button","\u201Cacceptable\u201D","\u53EF"],"unicode":"\u{1F251}"},{"group":8,"hexcode":"1F238","label":"Japanese \u201Capplication\u201D button","order":4713,"tags":["ideograph","japanese","japanese \u201Capplication\u201D button","\u201Capplication\u201D","\u7533"],"unicode":"\u{1F238}"},{"group":8,"hexcode":"1F234","label":"Japanese \u201Cpassing grade\u201D button","order":4714,"tags":["ideograph","japanese","japanese \u201Cpassing grade\u201D button","\u201Cpassing grade\u201D","\u5408"],"unicode":"\u{1F234}"},{"group":8,"hexcode":"1F233","label":"Japanese \u201Cvacancy\u201D button","order":4715,"tags":["ideograph","japanese","japanese \u201Cvacancy\u201D button","\u201Cvacancy\u201D","\u7A7A"],"unicode":"\u{1F233}"},{"group":8,"hexcode":"3297","label":"Japanese \u201Ccongratulations\u201D button","order":4717,"tags":["ideograph","japanese","japanese \u201Ccongratulations\u201D button","\u201Ccongratulations\u201D","\u795D"],"unicode":"\u3297\uFE0F"},{"group":8,"hexcode":"3299","label":"Japanese \u201Csecret\u201D button","order":4719,"tags":["ideograph","japanese","japanese \u201Csecret\u201D button","\u201Csecret\u201D","\u79D8"],"unicode":"\u3299\uFE0F"},{"group":8,"hexcode":"1F23A","label":"Japanese \u201Copen for business\u201D button","order":4720,"tags":["ideograph","japanese","japanese \u201Copen for business\u201D button","\u201Copen for business\u201D","\u55B6"],"unicode":"\u{1F23A}"},{"group":8,"hexcode":"1F235","label":"Japanese \u201Cno vacancy\u201D button","order":4721,"tags":["ideograph","japanese","japanese \u201Cno vacancy\u201D button","\u201Cno vacancy\u201D","\u6E80"],"unicode":"\u{1F235}"},{"group":8,"hexcode":"1F534","label":"red circle","order":4722,"tags":["circle","geometric","red"],"unicode":"\u{1F534}"},{"group":8,"hexcode":"1F7E0","label":"orange circle","order":4723,"tags":["circle","orange"],"unicode":"\u{1F7E0}"},{"group":8,"hexcode":"1F7E1","label":"yellow circle","order":4724,"tags":["circle","yellow"],"unicode":"\u{1F7E1}"},{"group":8,"hexcode":"1F7E2","label":"green circle","order":4725,"tags":["circle","green"],"unicode":"\u{1F7E2}"},{"group":8,"hexcode":"1F535","label":"blue circle","order":4726,"tags":["blue","circle","geometric"],"unicode":"\u{1F535}"},{"group":8,"hexcode":"1F7E3","label":"purple circle","order":4727,"tags":["circle","purple"],"unicode":"\u{1F7E3}"},{"group":8,"hexcode":"1F7E4","label":"brown circle","order":4728,"tags":["brown","circle"],"unicode":"\u{1F7E4}"},{"group":8,"hexcode":"26AB","label":"black circle","order":4729,"tags":["circle","geometric"],"unicode":"\u26AB\uFE0F"},{"group":8,"hexcode":"26AA","label":"white circle","order":4730,"tags":["circle","geometric"],"unicode":"\u26AA\uFE0F"},{"group":8,"hexcode":"1F7E5","label":"red square","order":4731,"tags":["red","square"],"unicode":"\u{1F7E5}"},{"group":8,"hexcode":"1F7E7","label":"orange square","order":4732,"tags":["orange","square"],"unicode":"\u{1F7E7}"},{"group":8,"hexcode":"1F7E8","label":"yellow square","order":4733,"tags":["square","yellow"],"unicode":"\u{1F7E8}"},{"group":8,"hexcode":"1F7E9","label":"green square","order":4734,"tags":["green","square"],"unicode":"\u{1F7E9}"},{"group":8,"hexcode":"1F7E6","label":"blue square","order":4735,"tags":["blue","square"],"unicode":"\u{1F7E6}"},{"group":8,"hexcode":"1F7EA","label":"purple square","order":4736,"tags":["purple","square"],"unicode":"\u{1F7EA}"},{"group":8,"hexcode":"1F7EB","label":"brown square","order":4737,"tags":["brown","square"],"unicode":"\u{1F7EB}"},{"group":8,"hexcode":"2B1B","label":"black large square","order":4738,"tags":["geometric","square"],"unicode":"\u2B1B\uFE0F"},{"group":8,"hexcode":"2B1C","label":"white large square","order":4739,"tags":["geometric","square"],"unicode":"\u2B1C\uFE0F"},{"group":8,"hexcode":"25FC","label":"black medium square","order":4741,"tags":["geometric","square"],"unicode":"\u25FC\uFE0F"},{"group":8,"hexcode":"25FB","label":"white medium square","order":4743,"tags":["geometric","square"],"unicode":"\u25FB\uFE0F"},{"group":8,"hexcode":"25FE","label":"black medium-small square","order":4744,"tags":["geometric","square"],"unicode":"\u25FE\uFE0F"},{"group":8,"hexcode":"25FD","label":"white medium-small square","order":4745,"tags":["geometric","square"],"unicode":"\u25FD\uFE0F"},{"group":8,"hexcode":"25AA","label":"black small square","order":4747,"tags":["geometric","square"],"unicode":"\u25AA\uFE0F"},{"group":8,"hexcode":"25AB","label":"white small square","order":4749,"tags":["geometric","square"],"unicode":"\u25AB\uFE0F"},{"group":8,"hexcode":"1F536","label":"large orange diamond","order":4750,"tags":["diamond","geometric","orange"],"unicode":"\u{1F536}"},{"group":8,"hexcode":"1F537","label":"large blue diamond","order":4751,"tags":["blue","diamond","geometric"],"unicode":"\u{1F537}"},{"group":8,"hexcode":"1F538","label":"small orange diamond","order":4752,"tags":["diamond","geometric","orange"],"unicode":"\u{1F538}"},{"group":8,"hexcode":"1F539","label":"small blue diamond","order":4753,"tags":["blue","diamond","geometric"],"unicode":"\u{1F539}"},{"group":8,"hexcode":"1F53A","label":"red triangle pointed up","order":4754,"tags":["geometric","red"],"unicode":"\u{1F53A}"},{"group":8,"hexcode":"1F53B","label":"red triangle pointed down","order":4755,"tags":["down","geometric","red"],"unicode":"\u{1F53B}"},{"group":8,"hexcode":"1F4A0","label":"diamond with a dot","order":4756,"tags":["comic","diamond","geometric","inside"],"unicode":"\u{1F4A0}"},{"group":8,"hexcode":"1F518","label":"radio button","order":4757,"tags":["button","geometric","radio"],"unicode":"\u{1F518}"},{"group":8,"hexcode":"1F533","label":"white square button","order":4758,"tags":["button","geometric","outlined","square"],"unicode":"\u{1F533}"},{"group":8,"hexcode":"1F532","label":"black square button","order":4759,"tags":["button","geometric","square"],"unicode":"\u{1F532}"},{"group":9,"hexcode":"1F3C1","label":"chequered flag","order":4760,"tags":["checkered","chequered","racing"],"unicode":"\u{1F3C1}"},{"group":9,"hexcode":"1F6A9","label":"triangular flag","order":4761,"tags":["post"],"unicode":"\u{1F6A9}"},{"group":9,"hexcode":"1F38C","label":"crossed flags","order":4762,"tags":["celebration","cross","crossed","japanese"],"unicode":"\u{1F38C}"},{"group":9,"hexcode":"1F3F4","label":"black flag","order":4763,"tags":["waving"],"unicode":"\u{1F3F4}"},{"group":9,"hexcode":"1F3F3","label":"white flag","order":4765,"tags":["waving"],"unicode":"\u{1F3F3}\uFE0F"},{"group":9,"hexcode":"1F3F3-FE0F-200D-1F308","label":"rainbow flag","order":4766,"tags":["pride","rainbow"],"unicode":"\u{1F3F3}\uFE0F\u200D\u{1F308}"},{"group":9,"hexcode":"1F3F3-FE0F-200D-26A7-FE0F","label":"transgender flag","order":4768,"tags":["flag","light blue","pink","transgender","white"],"unicode":"\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F"},{"group":9,"hexcode":"1F3F4-200D-2620-FE0F","label":"pirate flag","order":4772,"tags":["jolly roger","pirate","plunder","treasure"],"unicode":"\u{1F3F4}\u200D\u2620\uFE0F"},{"group":9,"hexcode":"1F1E6-1F1E8","label":"flag: Ascension Island","order":4774,"tags":["AC","flag","flag: ascension island"],"unicode":"\u{1F1E6}\u{1F1E8}"},{"group":9,"hexcode":"1F1E6-1F1E9","label":"flag: Andorra","order":4775,"tags":["AD","flag","flag: andorra"],"unicode":"\u{1F1E6}\u{1F1E9}"},{"group":9,"hexcode":"1F1E6-1F1EA","label":"flag: United Arab Emirates","order":4776,"tags":["AE","flag","flag: united arab emirates"],"unicode":"\u{1F1E6}\u{1F1EA}"},{"group":9,"hexcode":"1F1E6-1F1EB","label":"flag: Afghanistan","order":4777,"tags":["AF","flag","flag: afghanistan"],"unicode":"\u{1F1E6}\u{1F1EB}"},{"group":9,"hexcode":"1F1E6-1F1EC","label":"flag: Antigua & Barbuda","order":4778,"tags":["AG","flag","flag: antigua & barbuda"],"unicode":"\u{1F1E6}\u{1F1EC}"},{"group":9,"hexcode":"1F1E6-1F1EE","label":"flag: Anguilla","order":4779,"tags":["AI","flag","flag: anguilla"],"unicode":"\u{1F1E6}\u{1F1EE}"},{"group":9,"hexcode":"1F1E6-1F1F1","label":"flag: Albania","order":4780,"tags":["AL","flag","flag: albania"],"unicode":"\u{1F1E6}\u{1F1F1}"},{"group":9,"hexcode":"1F1E6-1F1F2","label":"flag: Armenia","order":4781,"tags":["AM","flag","flag: armenia"],"unicode":"\u{1F1E6}\u{1F1F2}"},{"group":9,"hexcode":"1F1E6-1F1F4","label":"flag: Angola","order":4782,"tags":["AO","flag","flag: angola"],"unicode":"\u{1F1E6}\u{1F1F4}"},{"group":9,"hexcode":"1F1E6-1F1F6","label":"flag: Antarctica","order":4783,"tags":["AQ","flag","flag: antarctica"],"unicode":"\u{1F1E6}\u{1F1F6}"},{"group":9,"hexcode":"1F1E6-1F1F7","label":"flag: Argentina","order":4784,"tags":["AR","flag","flag: argentina"],"unicode":"\u{1F1E6}\u{1F1F7}"},{"group":9,"hexcode":"1F1E6-1F1F8","label":"flag: American Samoa","order":4785,"tags":["AS","flag","flag: american samoa"],"unicode":"\u{1F1E6}\u{1F1F8}"},{"group":9,"hexcode":"1F1E6-1F1F9","label":"flag: Austria","order":4786,"tags":["AT","flag","flag: austria"],"unicode":"\u{1F1E6}\u{1F1F9}"},{"group":9,"hexcode":"1F1E6-1F1FA","label":"flag: Australia","order":4787,"tags":["AU","flag","flag: australia"],"unicode":"\u{1F1E6}\u{1F1FA}"},{"group":9,"hexcode":"1F1E6-1F1FC","label":"flag: Aruba","order":4788,"tags":["AW","flag","flag: aruba"],"unicode":"\u{1F1E6}\u{1F1FC}"},{"group":9,"hexcode":"1F1E6-1F1FD","label":"flag: \xC5land Islands","order":4789,"tags":["AX","flag","flag: \xE5land islands"],"unicode":"\u{1F1E6}\u{1F1FD}"},{"group":9,"hexcode":"1F1E6-1F1FF","label":"flag: Azerbaijan","order":4790,"tags":["AZ","flag","flag: azerbaijan"],"unicode":"\u{1F1E6}\u{1F1FF}"},{"group":9,"hexcode":"1F1E7-1F1E6","label":"flag: Bosnia & Herzegovina","order":4791,"tags":["BA","flag","flag: bosnia & herzegovina"],"unicode":"\u{1F1E7}\u{1F1E6}"},{"group":9,"hexcode":"1F1E7-1F1E7","label":"flag: Barbados","order":4792,"tags":["BB","flag","flag: barbados"],"unicode":"\u{1F1E7}\u{1F1E7}"},{"group":9,"hexcode":"1F1E7-1F1E9","label":"flag: Bangladesh","order":4793,"tags":["BD","flag","flag: bangladesh"],"unicode":"\u{1F1E7}\u{1F1E9}"},{"group":9,"hexcode":"1F1E7-1F1EA","label":"flag: Belgium","order":4794,"tags":["BE","flag","flag: belgium"],"unicode":"\u{1F1E7}\u{1F1EA}"},{"group":9,"hexcode":"1F1E7-1F1EB","label":"flag: Burkina Faso","order":4795,"tags":["BF","flag","flag: burkina faso"],"unicode":"\u{1F1E7}\u{1F1EB}"},{"group":9,"hexcode":"1F1E7-1F1EC","label":"flag: Bulgaria","order":4796,"tags":["BG","flag","flag: bulgaria"],"unicode":"\u{1F1E7}\u{1F1EC}"},{"group":9,"hexcode":"1F1E7-1F1ED","label":"flag: Bahrain","order":4797,"tags":["BH","flag","flag: bahrain"],"unicode":"\u{1F1E7}\u{1F1ED}"},{"group":9,"hexcode":"1F1E7-1F1EE","label":"flag: Burundi","order":4798,"tags":["BI","flag","flag: burundi"],"unicode":"\u{1F1E7}\u{1F1EE}"},{"group":9,"hexcode":"1F1E7-1F1EF","label":"flag: Benin","order":4799,"tags":["BJ","flag","flag: benin"],"unicode":"\u{1F1E7}\u{1F1EF}"},{"group":9,"hexcode":"1F1E7-1F1F1","label":"flag: St. Barth\xE9lemy","order":4800,"tags":["BL","flag","flag: st. barth\xE9lemy"],"unicode":"\u{1F1E7}\u{1F1F1}"},{"group":9,"hexcode":"1F1E7-1F1F2","label":"flag: Bermuda","order":4801,"tags":["BM","flag","flag: bermuda"],"unicode":"\u{1F1E7}\u{1F1F2}"},{"group":9,"hexcode":"1F1E7-1F1F3","label":"flag: Brunei","order":4802,"tags":["BN","flag","flag: brunei"],"unicode":"\u{1F1E7}\u{1F1F3}"},{"group":9,"hexcode":"1F1E7-1F1F4","label":"flag: Bolivia","order":4803,"tags":["BO","flag","flag: bolivia"],"unicode":"\u{1F1E7}\u{1F1F4}"},{"group":9,"hexcode":"1F1E7-1F1F6","label":"flag: Caribbean Netherlands","order":4804,"tags":["BQ","flag","flag: caribbean netherlands"],"unicode":"\u{1F1E7}\u{1F1F6}"},{"group":9,"hexcode":"1F1E7-1F1F7","label":"flag: Brazil","order":4805,"tags":["BR","flag","flag: brazil"],"unicode":"\u{1F1E7}\u{1F1F7}"},{"group":9,"hexcode":"1F1E7-1F1F8","label":"flag: Bahamas","order":4806,"tags":["BS","flag","flag: bahamas"],"unicode":"\u{1F1E7}\u{1F1F8}"},{"group":9,"hexcode":"1F1E7-1F1F9","label":"flag: Bhutan","order":4807,"tags":["BT","flag","flag: bhutan"],"unicode":"\u{1F1E7}\u{1F1F9}"},{"group":9,"hexcode":"1F1E7-1F1FB","label":"flag: Bouvet Island","order":4808,"tags":["BV","flag","flag: bouvet island"],"unicode":"\u{1F1E7}\u{1F1FB}"},{"group":9,"hexcode":"1F1E7-1F1FC","label":"flag: Botswana","order":4809,"tags":["BW","flag","flag: botswana"],"unicode":"\u{1F1E7}\u{1F1FC}"},{"group":9,"hexcode":"1F1E7-1F1FE","label":"flag: Belarus","order":4810,"tags":["BY","flag","flag: belarus"],"unicode":"\u{1F1E7}\u{1F1FE}"},{"group":9,"hexcode":"1F1E7-1F1FF","label":"flag: Belize","order":4811,"tags":["BZ","flag","flag: belize"],"unicode":"\u{1F1E7}\u{1F1FF}"},{"group":9,"hexcode":"1F1E8-1F1E6","label":"flag: Canada","order":4812,"tags":["CA","flag","flag: canada"],"unicode":"\u{1F1E8}\u{1F1E6}"},{"group":9,"hexcode":"1F1E8-1F1E8","label":"flag: Cocos (Keeling) Islands","order":4813,"tags":["CC","flag","flag: cocos (keeling) islands"],"unicode":"\u{1F1E8}\u{1F1E8}"},{"group":9,"hexcode":"1F1E8-1F1E9","label":"flag: Congo - Kinshasa","order":4814,"tags":["CD","flag","flag: congo - kinshasa"],"unicode":"\u{1F1E8}\u{1F1E9}"},{"group":9,"hexcode":"1F1E8-1F1EB","label":"flag: Central African Republic","order":4815,"tags":["CF","flag","flag: central african republic"],"unicode":"\u{1F1E8}\u{1F1EB}"},{"group":9,"hexcode":"1F1E8-1F1EC","label":"flag: Congo - Brazzaville","order":4816,"tags":["CG","flag","flag: congo - brazzaville"],"unicode":"\u{1F1E8}\u{1F1EC}"},{"group":9,"hexcode":"1F1E8-1F1ED","label":"flag: Switzerland","order":4817,"tags":["CH","flag","flag: switzerland"],"unicode":"\u{1F1E8}\u{1F1ED}"},{"group":9,"hexcode":"1F1E8-1F1EE","label":"flag: C\xF4te d\u2019Ivoire","order":4818,"tags":["CI","flag","flag: c\xF4te d\u2019ivoire"],"unicode":"\u{1F1E8}\u{1F1EE}"},{"group":9,"hexcode":"1F1E8-1F1F0","label":"flag: Cook Islands","order":4819,"tags":["CK","flag","flag: cook islands"],"unicode":"\u{1F1E8}\u{1F1F0}"},{"group":9,"hexcode":"1F1E8-1F1F1","label":"flag: Chile","order":4820,"tags":["CL","flag","flag: chile"],"unicode":"\u{1F1E8}\u{1F1F1}"},{"group":9,"hexcode":"1F1E8-1F1F2","label":"flag: Cameroon","order":4821,"tags":["CM","flag","flag: cameroon"],"unicode":"\u{1F1E8}\u{1F1F2}"},{"group":9,"hexcode":"1F1E8-1F1F3","label":"flag: China","order":4822,"tags":["CN","flag","flag: china"],"unicode":"\u{1F1E8}\u{1F1F3}"},{"group":9,"hexcode":"1F1E8-1F1F4","label":"flag: Colombia","order":4823,"tags":["CO","flag","flag: colombia"],"unicode":"\u{1F1E8}\u{1F1F4}"},{"group":9,"hexcode":"1F1E8-1F1F5","label":"flag: Clipperton Island","order":4824,"tags":["CP","flag","flag: clipperton island"],"unicode":"\u{1F1E8}\u{1F1F5}"},{"group":9,"hexcode":"1F1E8-1F1F7","label":"flag: Costa Rica","order":4825,"tags":["CR","flag","flag: costa rica"],"unicode":"\u{1F1E8}\u{1F1F7}"},{"group":9,"hexcode":"1F1E8-1F1FA","label":"flag: Cuba","order":4826,"tags":["CU","flag","flag: cuba"],"unicode":"\u{1F1E8}\u{1F1FA}"},{"group":9,"hexcode":"1F1E8-1F1FB","label":"flag: Cape Verde","order":4827,"tags":["CV","flag","flag: cape verde"],"unicode":"\u{1F1E8}\u{1F1FB}"},{"group":9,"hexcode":"1F1E8-1F1FC","label":"flag: Cura\xE7ao","order":4828,"tags":["CW","flag","flag: cura\xE7ao"],"unicode":"\u{1F1E8}\u{1F1FC}"},{"group":9,"hexcode":"1F1E8-1F1FD","label":"flag: Christmas Island","order":4829,"tags":["CX","flag","flag: christmas island"],"unicode":"\u{1F1E8}\u{1F1FD}"},{"group":9,"hexcode":"1F1E8-1F1FE","label":"flag: Cyprus","order":4830,"tags":["CY","flag","flag: cyprus"],"unicode":"\u{1F1E8}\u{1F1FE}"},{"group":9,"hexcode":"1F1E8-1F1FF","label":"flag: Czechia","order":4831,"tags":["CZ","flag","flag: czechia"],"unicode":"\u{1F1E8}\u{1F1FF}"},{"group":9,"hexcode":"1F1E9-1F1EA","label":"flag: Germany","order":4832,"tags":["DE","flag","flag: germany"],"unicode":"\u{1F1E9}\u{1F1EA}"},{"group":9,"hexcode":"1F1E9-1F1EC","label":"flag: Diego Garcia","order":4833,"tags":["DG","flag","flag: diego garcia"],"unicode":"\u{1F1E9}\u{1F1EC}"},{"group":9,"hexcode":"1F1E9-1F1EF","label":"flag: Djibouti","order":4834,"tags":["DJ","flag","flag: djibouti"],"unicode":"\u{1F1E9}\u{1F1EF}"},{"group":9,"hexcode":"1F1E9-1F1F0","label":"flag: Denmark","order":4835,"tags":["DK","flag","flag: denmark"],"unicode":"\u{1F1E9}\u{1F1F0}"},{"group":9,"hexcode":"1F1E9-1F1F2","label":"flag: Dominica","order":4836,"tags":["DM","flag","flag: dominica"],"unicode":"\u{1F1E9}\u{1F1F2}"},{"group":9,"hexcode":"1F1E9-1F1F4","label":"flag: Dominican Republic","order":4837,"tags":["DO","flag","flag: dominican republic"],"unicode":"\u{1F1E9}\u{1F1F4}"},{"group":9,"hexcode":"1F1E9-1F1FF","label":"flag: Algeria","order":4838,"tags":["DZ","flag","flag: algeria"],"unicode":"\u{1F1E9}\u{1F1FF}"},{"group":9,"hexcode":"1F1EA-1F1E6","label":"flag: Ceuta & Melilla","order":4839,"tags":["EA","flag","flag: ceuta & melilla"],"unicode":"\u{1F1EA}\u{1F1E6}"},{"group":9,"hexcode":"1F1EA-1F1E8","label":"flag: Ecuador","order":4840,"tags":["EC","flag","flag: ecuador"],"unicode":"\u{1F1EA}\u{1F1E8}"},{"group":9,"hexcode":"1F1EA-1F1EA","label":"flag: Estonia","order":4841,"tags":["EE","flag","flag: estonia"],"unicode":"\u{1F1EA}\u{1F1EA}"},{"group":9,"hexcode":"1F1EA-1F1EC","label":"flag: Egypt","order":4842,"tags":["EG","flag","flag: egypt"],"unicode":"\u{1F1EA}\u{1F1EC}"},{"group":9,"hexcode":"1F1EA-1F1ED","label":"flag: Western Sahara","order":4843,"tags":["EH","flag","flag: western sahara"],"unicode":"\u{1F1EA}\u{1F1ED}"},{"group":9,"hexcode":"1F1EA-1F1F7","label":"flag: Eritrea","order":4844,"tags":["ER","flag","flag: eritrea"],"unicode":"\u{1F1EA}\u{1F1F7}"},{"group":9,"hexcode":"1F1EA-1F1F8","label":"flag: Spain","order":4845,"tags":["ES","flag","flag: spain"],"unicode":"\u{1F1EA}\u{1F1F8}"},{"group":9,"hexcode":"1F1EA-1F1F9","label":"flag: Ethiopia","order":4846,"tags":["ET","flag","flag: ethiopia"],"unicode":"\u{1F1EA}\u{1F1F9}"},{"group":9,"hexcode":"1F1EA-1F1FA","label":"flag: European Union","order":4847,"tags":["EU","flag","flag: european union"],"unicode":"\u{1F1EA}\u{1F1FA}"},{"group":9,"hexcode":"1F1EB-1F1EE","label":"flag: Finland","order":4848,"tags":["FI","flag","flag: finland"],"unicode":"\u{1F1EB}\u{1F1EE}"},{"group":9,"hexcode":"1F1EB-1F1EF","label":"flag: Fiji","order":4849,"tags":["FJ","flag","flag: fiji"],"unicode":"\u{1F1EB}\u{1F1EF}"},{"group":9,"hexcode":"1F1EB-1F1F0","label":"flag: Falkland Islands","order":4850,"tags":["FK","flag","flag: falkland islands"],"unicode":"\u{1F1EB}\u{1F1F0}"},{"group":9,"hexcode":"1F1EB-1F1F2","label":"flag: Micronesia","order":4851,"tags":["FM","flag","flag: micronesia"],"unicode":"\u{1F1EB}\u{1F1F2}"},{"group":9,"hexcode":"1F1EB-1F1F4","label":"flag: Faroe Islands","order":4852,"tags":["FO","flag","flag: faroe islands"],"unicode":"\u{1F1EB}\u{1F1F4}"},{"group":9,"hexcode":"1F1EB-1F1F7","label":"flag: France","order":4853,"tags":["FR","flag","flag: france"],"unicode":"\u{1F1EB}\u{1F1F7}"},{"group":9,"hexcode":"1F1EC-1F1E6","label":"flag: Gabon","order":4854,"tags":["GA","flag","flag: gabon"],"unicode":"\u{1F1EC}\u{1F1E6}"},{"group":9,"hexcode":"1F1EC-1F1E7","label":"flag: United Kingdom","order":4855,"tags":["GB","flag","flag: united kingdom"],"unicode":"\u{1F1EC}\u{1F1E7}"},{"group":9,"hexcode":"1F1EC-1F1E9","label":"flag: Grenada","order":4856,"tags":["GD","flag","flag: grenada"],"unicode":"\u{1F1EC}\u{1F1E9}"},{"group":9,"hexcode":"1F1EC-1F1EA","label":"flag: Georgia","order":4857,"tags":["GE","flag","flag: georgia"],"unicode":"\u{1F1EC}\u{1F1EA}"},{"group":9,"hexcode":"1F1EC-1F1EB","label":"flag: French Guiana","order":4858,"tags":["GF","flag","flag: french guiana"],"unicode":"\u{1F1EC}\u{1F1EB}"},{"group":9,"hexcode":"1F1EC-1F1EC","label":"flag: Guernsey","order":4859,"tags":["GG","flag","flag: guernsey"],"unicode":"\u{1F1EC}\u{1F1EC}"},{"group":9,"hexcode":"1F1EC-1F1ED","label":"flag: Ghana","order":4860,"tags":["GH","flag","flag: ghana"],"unicode":"\u{1F1EC}\u{1F1ED}"},{"group":9,"hexcode":"1F1EC-1F1EE","label":"flag: Gibraltar","order":4861,"tags":["GI","flag","flag: gibraltar"],"unicode":"\u{1F1EC}\u{1F1EE}"},{"group":9,"hexcode":"1F1EC-1F1F1","label":"flag: Greenland","order":4862,"tags":["GL","flag","flag: greenland"],"unicode":"\u{1F1EC}\u{1F1F1}"},{"group":9,"hexcode":"1F1EC-1F1F2","label":"flag: Gambia","order":4863,"tags":["GM","flag","flag: gambia"],"unicode":"\u{1F1EC}\u{1F1F2}"},{"group":9,"hexcode":"1F1EC-1F1F3","label":"flag: Guinea","order":4864,"tags":["GN","flag","flag: guinea"],"unicode":"\u{1F1EC}\u{1F1F3}"},{"group":9,"hexcode":"1F1EC-1F1F5","label":"flag: Guadeloupe","order":4865,"tags":["GP","flag","flag: guadeloupe"],"unicode":"\u{1F1EC}\u{1F1F5}"},{"group":9,"hexcode":"1F1EC-1F1F6","label":"flag: Equatorial Guinea","order":4866,"tags":["GQ","flag","flag: equatorial guinea"],"unicode":"\u{1F1EC}\u{1F1F6}"},{"group":9,"hexcode":"1F1EC-1F1F7","label":"flag: Greece","order":4867,"tags":["GR","flag","flag: greece"],"unicode":"\u{1F1EC}\u{1F1F7}"},{"group":9,"hexcode":"1F1EC-1F1F8","label":"flag: South Georgia & South Sandwich Islands","order":4868,"tags":["GS","flag","flag: south georgia & south sandwich islands"],"unicode":"\u{1F1EC}\u{1F1F8}"},{"group":9,"hexcode":"1F1EC-1F1F9","label":"flag: Guatemala","order":4869,"tags":["GT","flag","flag: guatemala"],"unicode":"\u{1F1EC}\u{1F1F9}"},{"group":9,"hexcode":"1F1EC-1F1FA","label":"flag: Guam","order":4870,"tags":["GU","flag","flag: guam"],"unicode":"\u{1F1EC}\u{1F1FA}"},{"group":9,"hexcode":"1F1EC-1F1FC","label":"flag: Guinea-Bissau","order":4871,"tags":["GW","flag","flag: guinea-bissau"],"unicode":"\u{1F1EC}\u{1F1FC}"},{"group":9,"hexcode":"1F1EC-1F1FE","label":"flag: Guyana","order":4872,"tags":["GY","flag","flag: guyana"],"unicode":"\u{1F1EC}\u{1F1FE}"},{"group":9,"hexcode":"1F1ED-1F1F0","label":"flag: Hong Kong SAR China","order":4873,"tags":["HK","flag","flag: hong kong sar china"],"unicode":"\u{1F1ED}\u{1F1F0}"},{"group":9,"hexcode":"1F1ED-1F1F2","label":"flag: Heard & McDonald Islands","order":4874,"tags":["HM","flag","flag: heard & mcdonald islands"],"unicode":"\u{1F1ED}\u{1F1F2}"},{"group":9,"hexcode":"1F1ED-1F1F3","label":"flag: Honduras","order":4875,"tags":["HN","flag","flag: honduras"],"unicode":"\u{1F1ED}\u{1F1F3}"},{"group":9,"hexcode":"1F1ED-1F1F7","label":"flag: Croatia","order":4876,"tags":["HR","flag","flag: croatia"],"unicode":"\u{1F1ED}\u{1F1F7}"},{"group":9,"hexcode":"1F1ED-1F1F9","label":"flag: Haiti","order":4877,"tags":["HT","flag","flag: haiti"],"unicode":"\u{1F1ED}\u{1F1F9}"},{"group":9,"hexcode":"1F1ED-1F1FA","label":"flag: Hungary","order":4878,"tags":["HU","flag","flag: hungary"],"unicode":"\u{1F1ED}\u{1F1FA}"},{"group":9,"hexcode":"1F1EE-1F1E8","label":"flag: Canary Islands","order":4879,"tags":["IC","flag","flag: canary islands"],"unicode":"\u{1F1EE}\u{1F1E8}"},{"group":9,"hexcode":"1F1EE-1F1E9","label":"flag: Indonesia","order":4880,"tags":["ID","flag","flag: indonesia"],"unicode":"\u{1F1EE}\u{1F1E9}"},{"group":9,"hexcode":"1F1EE-1F1EA","label":"flag: Ireland","order":4881,"tags":["IE","flag","flag: ireland"],"unicode":"\u{1F1EE}\u{1F1EA}"},{"group":9,"hexcode":"1F1EE-1F1F1","label":"flag: Israel","order":4882,"tags":["IL","flag","flag: israel"],"unicode":"\u{1F1EE}\u{1F1F1}"},{"group":9,"hexcode":"1F1EE-1F1F2","label":"flag: Isle of Man","order":4883,"tags":["IM","flag","flag: isle of man"],"unicode":"\u{1F1EE}\u{1F1F2}"},{"group":9,"hexcode":"1F1EE-1F1F3","label":"flag: India","order":4884,"tags":["IN","flag","flag: india"],"unicode":"\u{1F1EE}\u{1F1F3}"},{"group":9,"hexcode":"1F1EE-1F1F4","label":"flag: British Indian Ocean Territory","order":4885,"tags":["IO","flag","flag: british indian ocean territory"],"unicode":"\u{1F1EE}\u{1F1F4}"},{"group":9,"hexcode":"1F1EE-1F1F6","label":"flag: Iraq","order":4886,"tags":["IQ","flag","flag: iraq"],"unicode":"\u{1F1EE}\u{1F1F6}"},{"group":9,"hexcode":"1F1EE-1F1F7","label":"flag: Iran","order":4887,"tags":["IR","flag","flag: iran"],"unicode":"\u{1F1EE}\u{1F1F7}"},{"group":9,"hexcode":"1F1EE-1F1F8","label":"flag: Iceland","order":4888,"tags":["IS","flag","flag: iceland"],"unicode":"\u{1F1EE}\u{1F1F8}"},{"group":9,"hexcode":"1F1EE-1F1F9","label":"flag: Italy","order":4889,"tags":["IT","flag","flag: italy"],"unicode":"\u{1F1EE}\u{1F1F9}"},{"group":9,"hexcode":"1F1EF-1F1EA","label":"flag: Jersey","order":4890,"tags":["JE","flag","flag: jersey"],"unicode":"\u{1F1EF}\u{1F1EA}"},{"group":9,"hexcode":"1F1EF-1F1F2","label":"flag: Jamaica","order":4891,"tags":["JM","flag","flag: jamaica"],"unicode":"\u{1F1EF}\u{1F1F2}"},{"group":9,"hexcode":"1F1EF-1F1F4","label":"flag: Jordan","order":4892,"tags":["JO","flag","flag: jordan"],"unicode":"\u{1F1EF}\u{1F1F4}"},{"group":9,"hexcode":"1F1EF-1F1F5","label":"flag: Japan","order":4893,"tags":["JP","flag","flag: japan"],"unicode":"\u{1F1EF}\u{1F1F5}"},{"group":9,"hexcode":"1F1F0-1F1EA","label":"flag: Kenya","order":4894,"tags":["KE","flag","flag: kenya"],"unicode":"\u{1F1F0}\u{1F1EA}"},{"group":9,"hexcode":"1F1F0-1F1EC","label":"flag: Kyrgyzstan","order":4895,"tags":["KG","flag","flag: kyrgyzstan"],"unicode":"\u{1F1F0}\u{1F1EC}"},{"group":9,"hexcode":"1F1F0-1F1ED","label":"flag: Cambodia","order":4896,"tags":["KH","flag","flag: cambodia"],"unicode":"\u{1F1F0}\u{1F1ED}"},{"group":9,"hexcode":"1F1F0-1F1EE","label":"flag: Kiribati","order":4897,"tags":["KI","flag","flag: kiribati"],"unicode":"\u{1F1F0}\u{1F1EE}"},{"group":9,"hexcode":"1F1F0-1F1F2","label":"flag: Comoros","order":4898,"tags":["KM","flag","flag: comoros"],"unicode":"\u{1F1F0}\u{1F1F2}"},{"group":9,"hexcode":"1F1F0-1F1F3","label":"flag: St. Kitts & Nevis","order":4899,"tags":["KN","flag","flag: st. kitts & nevis"],"unicode":"\u{1F1F0}\u{1F1F3}"},{"group":9,"hexcode":"1F1F0-1F1F5","label":"flag: North Korea","order":4900,"tags":["KP","flag","flag: north korea"],"unicode":"\u{1F1F0}\u{1F1F5}"},{"group":9,"hexcode":"1F1F0-1F1F7","label":"flag: South Korea","order":4901,"tags":["KR","flag","flag: south korea"],"unicode":"\u{1F1F0}\u{1F1F7}"},{"group":9,"hexcode":"1F1F0-1F1FC","label":"flag: Kuwait","order":4902,"tags":["KW","flag","flag: kuwait"],"unicode":"\u{1F1F0}\u{1F1FC}"},{"group":9,"hexcode":"1F1F0-1F1FE","label":"flag: Cayman Islands","order":4903,"tags":["KY","flag","flag: cayman islands"],"unicode":"\u{1F1F0}\u{1F1FE}"},{"group":9,"hexcode":"1F1F0-1F1FF","label":"flag: Kazakhstan","order":4904,"tags":["KZ","flag","flag: kazakhstan"],"unicode":"\u{1F1F0}\u{1F1FF}"},{"group":9,"hexcode":"1F1F1-1F1E6","label":"flag: Laos","order":4905,"tags":["LA","flag","flag: laos"],"unicode":"\u{1F1F1}\u{1F1E6}"},{"group":9,"hexcode":"1F1F1-1F1E7","label":"flag: Lebanon","order":4906,"tags":["LB","flag","flag: lebanon"],"unicode":"\u{1F1F1}\u{1F1E7}"},{"group":9,"hexcode":"1F1F1-1F1E8","label":"flag: St. Lucia","order":4907,"tags":["LC","flag","flag: st. lucia"],"unicode":"\u{1F1F1}\u{1F1E8}"},{"group":9,"hexcode":"1F1F1-1F1EE","label":"flag: Liechtenstein","order":4908,"tags":["LI","flag","flag: liechtenstein"],"unicode":"\u{1F1F1}\u{1F1EE}"},{"group":9,"hexcode":"1F1F1-1F1F0","label":"flag: Sri Lanka","order":4909,"tags":["LK","flag","flag: sri lanka"],"unicode":"\u{1F1F1}\u{1F1F0}"},{"group":9,"hexcode":"1F1F1-1F1F7","label":"flag: Liberia","order":4910,"tags":["LR","flag","flag: liberia"],"unicode":"\u{1F1F1}\u{1F1F7}"},{"group":9,"hexcode":"1F1F1-1F1F8","label":"flag: Lesotho","order":4911,"tags":["LS","flag","flag: lesotho"],"unicode":"\u{1F1F1}\u{1F1F8}"},{"group":9,"hexcode":"1F1F1-1F1F9","label":"flag: Lithuania","order":4912,"tags":["LT","flag","flag: lithuania"],"unicode":"\u{1F1F1}\u{1F1F9}"},{"group":9,"hexcode":"1F1F1-1F1FA","label":"flag: Luxembourg","order":4913,"tags":["LU","flag","flag: luxembourg"],"unicode":"\u{1F1F1}\u{1F1FA}"},{"group":9,"hexcode":"1F1F1-1F1FB","label":"flag: Latvia","order":4914,"tags":["LV","flag","flag: latvia"],"unicode":"\u{1F1F1}\u{1F1FB}"},{"group":9,"hexcode":"1F1F1-1F1FE","label":"flag: Libya","order":4915,"tags":["LY","flag","flag: libya"],"unicode":"\u{1F1F1}\u{1F1FE}"},{"group":9,"hexcode":"1F1F2-1F1E6","label":"flag: Morocco","order":4916,"tags":["MA","flag","flag: morocco"],"unicode":"\u{1F1F2}\u{1F1E6}"},{"group":9,"hexcode":"1F1F2-1F1E8","label":"flag: Monaco","order":4917,"tags":["MC","flag","flag: monaco"],"unicode":"\u{1F1F2}\u{1F1E8}"},{"group":9,"hexcode":"1F1F2-1F1E9","label":"flag: Moldova","order":4918,"tags":["MD","flag","flag: moldova"],"unicode":"\u{1F1F2}\u{1F1E9}"},{"group":9,"hexcode":"1F1F2-1F1EA","label":"flag: Montenegro","order":4919,"tags":["ME","flag","flag: montenegro"],"unicode":"\u{1F1F2}\u{1F1EA}"},{"group":9,"hexcode":"1F1F2-1F1EB","label":"flag: St. Martin","order":4920,"tags":["MF","flag","flag: st. martin"],"unicode":"\u{1F1F2}\u{1F1EB}"},{"group":9,"hexcode":"1F1F2-1F1EC","label":"flag: Madagascar","order":4921,"tags":["MG","flag","flag: madagascar"],"unicode":"\u{1F1F2}\u{1F1EC}"},{"group":9,"hexcode":"1F1F2-1F1ED","label":"flag: Marshall Islands","order":4922,"tags":["MH","flag","flag: marshall islands"],"unicode":"\u{1F1F2}\u{1F1ED}"},{"group":9,"hexcode":"1F1F2-1F1F0","label":"flag: North Macedonia","order":4923,"tags":["MK","flag","flag: north macedonia"],"unicode":"\u{1F1F2}\u{1F1F0}"},{"group":9,"hexcode":"1F1F2-1F1F1","label":"flag: Mali","order":4924,"tags":["ML","flag","flag: mali"],"unicode":"\u{1F1F2}\u{1F1F1}"},{"group":9,"hexcode":"1F1F2-1F1F2","label":"flag: Myanmar (Burma)","order":4925,"tags":["MM","flag","flag: myanmar (burma)"],"unicode":"\u{1F1F2}\u{1F1F2}"},{"group":9,"hexcode":"1F1F2-1F1F3","label":"flag: Mongolia","order":4926,"tags":["MN","flag","flag: mongolia"],"unicode":"\u{1F1F2}\u{1F1F3}"},{"group":9,"hexcode":"1F1F2-1F1F4","label":"flag: Macao SAR China","order":4927,"tags":["MO","flag","flag: macao sar china"],"unicode":"\u{1F1F2}\u{1F1F4}"},{"group":9,"hexcode":"1F1F2-1F1F5","label":"flag: Northern Mariana Islands","order":4928,"tags":["MP","flag","flag: northern mariana islands"],"unicode":"\u{1F1F2}\u{1F1F5}"},{"group":9,"hexcode":"1F1F2-1F1F6","label":"flag: Martinique","order":4929,"tags":["MQ","flag","flag: martinique"],"unicode":"\u{1F1F2}\u{1F1F6}"},{"group":9,"hexcode":"1F1F2-1F1F7","label":"flag: Mauritania","order":4930,"tags":["MR","flag","flag: mauritania"],"unicode":"\u{1F1F2}\u{1F1F7}"},{"group":9,"hexcode":"1F1F2-1F1F8","label":"flag: Montserrat","order":4931,"tags":["MS","flag","flag: montserrat"],"unicode":"\u{1F1F2}\u{1F1F8}"},{"group":9,"hexcode":"1F1F2-1F1F9","label":"flag: Malta","order":4932,"tags":["MT","flag","flag: malta"],"unicode":"\u{1F1F2}\u{1F1F9}"},{"group":9,"hexcode":"1F1F2-1F1FA","label":"flag: Mauritius","order":4933,"tags":["MU","flag","flag: mauritius"],"unicode":"\u{1F1F2}\u{1F1FA}"},{"group":9,"hexcode":"1F1F2-1F1FB","label":"flag: Maldives","order":4934,"tags":["MV","flag","flag: maldives"],"unicode":"\u{1F1F2}\u{1F1FB}"},{"group":9,"hexcode":"1F1F2-1F1FC","label":"flag: Malawi","order":4935,"tags":["MW","flag","flag: malawi"],"unicode":"\u{1F1F2}\u{1F1FC}"},{"group":9,"hexcode":"1F1F2-1F1FD","label":"flag: Mexico","order":4936,"tags":["MX","flag","flag: mexico"],"unicode":"\u{1F1F2}\u{1F1FD}"},{"group":9,"hexcode":"1F1F2-1F1FE","label":"flag: Malaysia","order":4937,"tags":["MY","flag","flag: malaysia"],"unicode":"\u{1F1F2}\u{1F1FE}"},{"group":9,"hexcode":"1F1F2-1F1FF","label":"flag: Mozambique","order":4938,"tags":["MZ","flag","flag: mozambique"],"unicode":"\u{1F1F2}\u{1F1FF}"},{"group":9,"hexcode":"1F1F3-1F1E6","label":"flag: Namibia","order":4939,"tags":["NA","flag","flag: namibia"],"unicode":"\u{1F1F3}\u{1F1E6}"},{"group":9,"hexcode":"1F1F3-1F1E8","label":"flag: New Caledonia","order":4940,"tags":["NC","flag","flag: new caledonia"],"unicode":"\u{1F1F3}\u{1F1E8}"},{"group":9,"hexcode":"1F1F3-1F1EA","label":"flag: Niger","order":4941,"tags":["NE","flag","flag: niger"],"unicode":"\u{1F1F3}\u{1F1EA}"},{"group":9,"hexcode":"1F1F3-1F1EB","label":"flag: Norfolk Island","order":4942,"tags":["NF","flag","flag: norfolk island"],"unicode":"\u{1F1F3}\u{1F1EB}"},{"group":9,"hexcode":"1F1F3-1F1EC","label":"flag: Nigeria","order":4943,"tags":["NG","flag","flag: nigeria"],"unicode":"\u{1F1F3}\u{1F1EC}"},{"group":9,"hexcode":"1F1F3-1F1EE","label":"flag: Nicaragua","order":4944,"tags":["NI","flag","flag: nicaragua"],"unicode":"\u{1F1F3}\u{1F1EE}"},{"group":9,"hexcode":"1F1F3-1F1F1","label":"flag: Netherlands","order":4945,"tags":["NL","flag","flag: netherlands"],"unicode":"\u{1F1F3}\u{1F1F1}"},{"group":9,"hexcode":"1F1F3-1F1F4","label":"flag: Norway","order":4946,"tags":["NO","flag","flag: norway"],"unicode":"\u{1F1F3}\u{1F1F4}"},{"group":9,"hexcode":"1F1F3-1F1F5","label":"flag: Nepal","order":4947,"tags":["NP","flag","flag: nepal"],"unicode":"\u{1F1F3}\u{1F1F5}"},{"group":9,"hexcode":"1F1F3-1F1F7","label":"flag: Nauru","order":4948,"tags":["NR","flag","flag: nauru"],"unicode":"\u{1F1F3}\u{1F1F7}"},{"group":9,"hexcode":"1F1F3-1F1FA","label":"flag: Niue","order":4949,"tags":["NU","flag","flag: niue"],"unicode":"\u{1F1F3}\u{1F1FA}"},{"group":9,"hexcode":"1F1F3-1F1FF","label":"flag: New Zealand","order":4950,"tags":["NZ","flag","flag: new zealand"],"unicode":"\u{1F1F3}\u{1F1FF}"},{"group":9,"hexcode":"1F1F4-1F1F2","label":"flag: Oman","order":4951,"tags":["OM","flag","flag: oman"],"unicode":"\u{1F1F4}\u{1F1F2}"},{"group":9,"hexcode":"1F1F5-1F1E6","label":"flag: Panama","order":4952,"tags":["PA","flag","flag: panama"],"unicode":"\u{1F1F5}\u{1F1E6}"},{"group":9,"hexcode":"1F1F5-1F1EA","label":"flag: Peru","order":4953,"tags":["PE","flag","flag: peru"],"unicode":"\u{1F1F5}\u{1F1EA}"},{"group":9,"hexcode":"1F1F5-1F1EB","label":"flag: French Polynesia","order":4954,"tags":["PF","flag","flag: french polynesia"],"unicode":"\u{1F1F5}\u{1F1EB}"},{"group":9,"hexcode":"1F1F5-1F1EC","label":"flag: Papua New Guinea","order":4955,"tags":["PG","flag","flag: papua new guinea"],"unicode":"\u{1F1F5}\u{1F1EC}"},{"group":9,"hexcode":"1F1F5-1F1ED","label":"flag: Philippines","order":4956,"tags":["PH","flag","flag: philippines"],"unicode":"\u{1F1F5}\u{1F1ED}"},{"group":9,"hexcode":"1F1F5-1F1F0","label":"flag: Pakistan","order":4957,"tags":["PK","flag","flag: pakistan"],"unicode":"\u{1F1F5}\u{1F1F0}"},{"group":9,"hexcode":"1F1F5-1F1F1","label":"flag: Poland","order":4958,"tags":["PL","flag","flag: poland"],"unicode":"\u{1F1F5}\u{1F1F1}"},{"group":9,"hexcode":"1F1F5-1F1F2","label":"flag: St. Pierre & Miquelon","order":4959,"tags":["PM","flag","flag: st. pierre & miquelon"],"unicode":"\u{1F1F5}\u{1F1F2}"},{"group":9,"hexcode":"1F1F5-1F1F3","label":"flag: Pitcairn Islands","order":4960,"tags":["PN","flag","flag: pitcairn islands"],"unicode":"\u{1F1F5}\u{1F1F3}"},{"group":9,"hexcode":"1F1F5-1F1F7","label":"flag: Puerto Rico","order":4961,"tags":["PR","flag","flag: puerto rico"],"unicode":"\u{1F1F5}\u{1F1F7}"},{"group":9,"hexcode":"1F1F5-1F1F8","label":"flag: Palestinian Territories","order":4962,"tags":["PS","flag","flag: palestinian territories"],"unicode":"\u{1F1F5}\u{1F1F8}"},{"group":9,"hexcode":"1F1F5-1F1F9","label":"flag: Portugal","order":4963,"tags":["PT","flag","flag: portugal"],"unicode":"\u{1F1F5}\u{1F1F9}"},{"group":9,"hexcode":"1F1F5-1F1FC","label":"flag: Palau","order":4964,"tags":["PW","flag","flag: palau"],"unicode":"\u{1F1F5}\u{1F1FC}"},{"group":9,"hexcode":"1F1F5-1F1FE","label":"flag: Paraguay","order":4965,"tags":["PY","flag","flag: paraguay"],"unicode":"\u{1F1F5}\u{1F1FE}"},{"group":9,"hexcode":"1F1F6-1F1E6","label":"flag: Qatar","order":4966,"tags":["QA","flag","flag: qatar"],"unicode":"\u{1F1F6}\u{1F1E6}"},{"group":9,"hexcode":"1F1F7-1F1EA","label":"flag: R\xE9union","order":4967,"tags":["RE","flag","flag: r\xE9union"],"unicode":"\u{1F1F7}\u{1F1EA}"},{"group":9,"hexcode":"1F1F7-1F1F4","label":"flag: Romania","order":4968,"tags":["RO","flag","flag: romania"],"unicode":"\u{1F1F7}\u{1F1F4}"},{"group":9,"hexcode":"1F1F7-1F1F8","label":"flag: Serbia","order":4969,"tags":["RS","flag","flag: serbia"],"unicode":"\u{1F1F7}\u{1F1F8}"},{"group":9,"hexcode":"1F1F7-1F1FA","label":"flag: Russia","order":4970,"tags":["RU","flag","flag: russia"],"unicode":"\u{1F1F7}\u{1F1FA}"},{"group":9,"hexcode":"1F1F7-1F1FC","label":"flag: Rwanda","order":4971,"tags":["RW","flag","flag: rwanda"],"unicode":"\u{1F1F7}\u{1F1FC}"},{"group":9,"hexcode":"1F1F8-1F1E6","label":"flag: Saudi Arabia","order":4972,"tags":["SA","flag","flag: saudi arabia"],"unicode":"\u{1F1F8}\u{1F1E6}"},{"group":9,"hexcode":"1F1F8-1F1E7","label":"flag: Solomon Islands","order":4973,"tags":["SB","flag","flag: solomon islands"],"unicode":"\u{1F1F8}\u{1F1E7}"},{"group":9,"hexcode":"1F1F8-1F1E8","label":"flag: Seychelles","order":4974,"tags":["SC","flag","flag: seychelles"],"unicode":"\u{1F1F8}\u{1F1E8}"},{"group":9,"hexcode":"1F1F8-1F1E9","label":"flag: Sudan","order":4975,"tags":["SD","flag","flag: sudan"],"unicode":"\u{1F1F8}\u{1F1E9}"},{"group":9,"hexcode":"1F1F8-1F1EA","label":"flag: Sweden","order":4976,"tags":["SE","flag","flag: sweden"],"unicode":"\u{1F1F8}\u{1F1EA}"},{"group":9,"hexcode":"1F1F8-1F1EC","label":"flag: Singapore","order":4977,"tags":["SG","flag","flag: singapore"],"unicode":"\u{1F1F8}\u{1F1EC}"},{"group":9,"hexcode":"1F1F8-1F1ED","label":"flag: St. Helena","order":4978,"tags":["SH","flag","flag: st. helena"],"unicode":"\u{1F1F8}\u{1F1ED}"},{"group":9,"hexcode":"1F1F8-1F1EE","label":"flag: Slovenia","order":4979,"tags":["SI","flag","flag: slovenia"],"unicode":"\u{1F1F8}\u{1F1EE}"},{"group":9,"hexcode":"1F1F8-1F1EF","label":"flag: Svalbard & Jan Mayen","order":4980,"tags":["SJ","flag","flag: svalbard & jan mayen"],"unicode":"\u{1F1F8}\u{1F1EF}"},{"group":9,"hexcode":"1F1F8-1F1F0","label":"flag: Slovakia","order":4981,"tags":["SK","flag","flag: slovakia"],"unicode":"\u{1F1F8}\u{1F1F0}"},{"group":9,"hexcode":"1F1F8-1F1F1","label":"flag: Sierra Leone","order":4982,"tags":["SL","flag","flag: sierra leone"],"unicode":"\u{1F1F8}\u{1F1F1}"},{"group":9,"hexcode":"1F1F8-1F1F2","label":"flag: San Marino","order":4983,"tags":["SM","flag","flag: san marino"],"unicode":"\u{1F1F8}\u{1F1F2}"},{"group":9,"hexcode":"1F1F8-1F1F3","label":"flag: Senegal","order":4984,"tags":["SN","flag","flag: senegal"],"unicode":"\u{1F1F8}\u{1F1F3}"},{"group":9,"hexcode":"1F1F8-1F1F4","label":"flag: Somalia","order":4985,"tags":["SO","flag","flag: somalia"],"unicode":"\u{1F1F8}\u{1F1F4}"},{"group":9,"hexcode":"1F1F8-1F1F7","label":"flag: Suriname","order":4986,"tags":["SR","flag","flag: suriname"],"unicode":"\u{1F1F8}\u{1F1F7}"},{"group":9,"hexcode":"1F1F8-1F1F8","label":"flag: South Sudan","order":4987,"tags":["SS","flag","flag: south sudan"],"unicode":"\u{1F1F8}\u{1F1F8}"},{"group":9,"hexcode":"1F1F8-1F1F9","label":"flag: S\xE3o Tom\xE9 & Pr\xEDncipe","order":4988,"tags":["ST","flag","flag: s\xE3o tom\xE9 & pr\xEDncipe"],"unicode":"\u{1F1F8}\u{1F1F9}"},{"group":9,"hexcode":"1F1F8-1F1FB","label":"flag: El Salvador","order":4989,"tags":["SV","flag","flag: el salvador"],"unicode":"\u{1F1F8}\u{1F1FB}"},{"group":9,"hexcode":"1F1F8-1F1FD","label":"flag: Sint Maarten","order":4990,"tags":["SX","flag","flag: sint maarten"],"unicode":"\u{1F1F8}\u{1F1FD}"},{"group":9,"hexcode":"1F1F8-1F1FE","label":"flag: Syria","order":4991,"tags":["SY","flag","flag: syria"],"unicode":"\u{1F1F8}\u{1F1FE}"},{"group":9,"hexcode":"1F1F8-1F1FF","label":"flag: Eswatini","order":4992,"tags":["SZ","flag","flag: eswatini"],"unicode":"\u{1F1F8}\u{1F1FF}"},{"group":9,"hexcode":"1F1F9-1F1E6","label":"flag: Tristan da Cunha","order":4993,"tags":["TA","flag","flag: tristan da cunha"],"unicode":"\u{1F1F9}\u{1F1E6}"},{"group":9,"hexcode":"1F1F9-1F1E8","label":"flag: Turks & Caicos Islands","order":4994,"tags":["TC","flag","flag: turks & caicos islands"],"unicode":"\u{1F1F9}\u{1F1E8}"},{"group":9,"hexcode":"1F1F9-1F1E9","label":"flag: Chad","order":4995,"tags":["TD","flag","flag: chad"],"unicode":"\u{1F1F9}\u{1F1E9}"},{"group":9,"hexcode":"1F1F9-1F1EB","label":"flag: French Southern Territories","order":4996,"tags":["TF","flag","flag: french southern territories"],"unicode":"\u{1F1F9}\u{1F1EB}"},{"group":9,"hexcode":"1F1F9-1F1EC","label":"flag: Togo","order":4997,"tags":["TG","flag","flag: togo"],"unicode":"\u{1F1F9}\u{1F1EC}"},{"group":9,"hexcode":"1F1F9-1F1ED","label":"flag: Thailand","order":4998,"tags":["TH","flag","flag: thailand"],"unicode":"\u{1F1F9}\u{1F1ED}"},{"group":9,"hexcode":"1F1F9-1F1EF","label":"flag: Tajikistan","order":4999,"tags":["TJ","flag","flag: tajikistan"],"unicode":"\u{1F1F9}\u{1F1EF}"},{"group":9,"hexcode":"1F1F9-1F1F0","label":"flag: Tokelau","order":5000,"tags":["TK","flag","flag: tokelau"],"unicode":"\u{1F1F9}\u{1F1F0}"},{"group":9,"hexcode":"1F1F9-1F1F1","label":"flag: Timor-Leste","order":5001,"tags":["TL","flag","flag: timor-leste"],"unicode":"\u{1F1F9}\u{1F1F1}"},{"group":9,"hexcode":"1F1F9-1F1F2","label":"flag: Turkmenistan","order":5002,"tags":["TM","flag","flag: turkmenistan"],"unicode":"\u{1F1F9}\u{1F1F2}"},{"group":9,"hexcode":"1F1F9-1F1F3","label":"flag: Tunisia","order":5003,"tags":["TN","flag","flag: tunisia"],"unicode":"\u{1F1F9}\u{1F1F3}"},{"group":9,"hexcode":"1F1F9-1F1F4","label":"flag: Tonga","order":5004,"tags":["TO","flag","flag: tonga"],"unicode":"\u{1F1F9}\u{1F1F4}"},{"group":9,"hexcode":"1F1F9-1F1F7","label":"flag: T\xFCrkiye","order":5005,"tags":["TR","flag","flag: t\xFCrkiye"],"unicode":"\u{1F1F9}\u{1F1F7}"},{"group":9,"hexcode":"1F1F9-1F1F9","label":"flag: Trinidad & Tobago","order":5006,"tags":["TT","flag","flag: trinidad & tobago"],"unicode":"\u{1F1F9}\u{1F1F9}"},{"group":9,"hexcode":"1F1F9-1F1FB","label":"flag: Tuvalu","order":5007,"tags":["TV","flag","flag: tuvalu"],"unicode":"\u{1F1F9}\u{1F1FB}"},{"group":9,"hexcode":"1F1F9-1F1FC","label":"flag: Taiwan","order":5008,"tags":["TW","flag","flag: taiwan"],"unicode":"\u{1F1F9}\u{1F1FC}"},{"group":9,"hexcode":"1F1F9-1F1FF","label":"flag: Tanzania","order":5009,"tags":["TZ","flag","flag: tanzania"],"unicode":"\u{1F1F9}\u{1F1FF}"},{"group":9,"hexcode":"1F1FA-1F1E6","label":"flag: Ukraine","order":5010,"tags":["UA","flag","flag: ukraine"],"unicode":"\u{1F1FA}\u{1F1E6}"},{"group":9,"hexcode":"1F1FA-1F1EC","label":"flag: Uganda","order":5011,"tags":["UG","flag","flag: uganda"],"unicode":"\u{1F1FA}\u{1F1EC}"},{"group":9,"hexcode":"1F1FA-1F1F2","label":"flag: U.S. Outlying Islands","order":5012,"tags":["UM","flag","flag: u.s. outlying islands"],"unicode":"\u{1F1FA}\u{1F1F2}"},{"group":9,"hexcode":"1F1FA-1F1F3","label":"flag: United Nations","order":5013,"tags":["UN","flag","flag: united nations"],"unicode":"\u{1F1FA}\u{1F1F3}"},{"group":9,"hexcode":"1F1FA-1F1F8","label":"flag: United States","order":5014,"tags":["US","flag","flag: united states"],"unicode":"\u{1F1FA}\u{1F1F8}"},{"group":9,"hexcode":"1F1FA-1F1FE","label":"flag: Uruguay","order":5015,"tags":["UY","flag","flag: uruguay"],"unicode":"\u{1F1FA}\u{1F1FE}"},{"group":9,"hexcode":"1F1FA-1F1FF","label":"flag: Uzbekistan","order":5016,"tags":["UZ","flag","flag: uzbekistan"],"unicode":"\u{1F1FA}\u{1F1FF}"},{"group":9,"hexcode":"1F1FB-1F1E6","label":"flag: Vatican City","order":5017,"tags":["VA","flag","flag: vatican city"],"unicode":"\u{1F1FB}\u{1F1E6}"},{"group":9,"hexcode":"1F1FB-1F1E8","label":"flag: St. Vincent & Grenadines","order":5018,"tags":["VC","flag","flag: st. vincent & grenadines"],"unicode":"\u{1F1FB}\u{1F1E8}"},{"group":9,"hexcode":"1F1FB-1F1EA","label":"flag: Venezuela","order":5019,"tags":["VE","flag","flag: venezuela"],"unicode":"\u{1F1FB}\u{1F1EA}"},{"group":9,"hexcode":"1F1FB-1F1EC","label":"flag: British Virgin Islands","order":5020,"tags":["VG","flag","flag: british virgin islands"],"unicode":"\u{1F1FB}\u{1F1EC}"},{"group":9,"hexcode":"1F1FB-1F1EE","label":"flag: U.S. Virgin Islands","order":5021,"tags":["VI","flag","flag: u.s. virgin islands"],"unicode":"\u{1F1FB}\u{1F1EE}"},{"group":9,"hexcode":"1F1FB-1F1F3","label":"flag: Vietnam","order":5022,"tags":["VN","flag","flag: vietnam"],"unicode":"\u{1F1FB}\u{1F1F3}"},{"group":9,"hexcode":"1F1FB-1F1FA","label":"flag: Vanuatu","order":5023,"tags":["VU","flag","flag: vanuatu"],"unicode":"\u{1F1FB}\u{1F1FA}"},{"group":9,"hexcode":"1F1FC-1F1EB","label":"flag: Wallis & Futuna","order":5024,"tags":["WF","flag","flag: wallis & futuna"],"unicode":"\u{1F1FC}\u{1F1EB}"},{"group":9,"hexcode":"1F1FC-1F1F8","label":"flag: Samoa","order":5025,"tags":["WS","flag","flag: samoa"],"unicode":"\u{1F1FC}\u{1F1F8}"},{"group":9,"hexcode":"1F1FD-1F1F0","label":"flag: Kosovo","order":5026,"tags":["XK","flag","flag: kosovo"],"unicode":"\u{1F1FD}\u{1F1F0}"},{"group":9,"hexcode":"1F1FE-1F1EA","label":"flag: Yemen","order":5027,"tags":["YE","flag","flag: yemen"],"unicode":"\u{1F1FE}\u{1F1EA}"},{"group":9,"hexcode":"1F1FE-1F1F9","label":"flag: Mayotte","order":5028,"tags":["YT","flag","flag: mayotte"],"unicode":"\u{1F1FE}\u{1F1F9}"},{"group":9,"hexcode":"1F1FF-1F1E6","label":"flag: South Africa","order":5029,"tags":["ZA","flag","flag: south africa"],"unicode":"\u{1F1FF}\u{1F1E6}"},{"group":9,"hexcode":"1F1FF-1F1F2","label":"flag: Zambia","order":5030,"tags":["ZM","flag","flag: zambia"],"unicode":"\u{1F1FF}\u{1F1F2}"},{"group":9,"hexcode":"1F1FF-1F1FC","label":"flag: Zimbabwe","order":5031,"tags":["ZW","flag","flag: zimbabwe"],"unicode":"\u{1F1FF}\u{1F1FC}"},{"group":9,"hexcode":"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F","label":"flag: England","order":5032,"tags":["flag","flag: england","gbeng"],"unicode":"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}"},{"group":9,"hexcode":"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F","label":"flag: Scotland","order":5033,"tags":["flag","flag: scotland","gbsct"],"unicode":"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}"},{"group":9,"hexcode":"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F","label":"flag: Wales","order":5034,"tags":["flag","flag: wales","gbwls"],"unicode":"\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}"}]`), Toe = {
    2049: "interrobang",
    2122: [
      "tm",
      "trade_mark"
    ],
    2139: [
      "information_source",
      "information"
    ],
    2194: "left_right_arrow",
    2195: [
      "arrow_up_down",
      "up_down_arrow"
    ],
    2196: [
      "arrow_upper_left",
      "up_left_arrow"
    ],
    2197: "arrow_upper_right",
    2198: "arrow_lower_right",
    2199: "arrow_lower_left",
    2328: "keyboard",
    2600: [
      "sunny",
      "sun"
    ],
    2601: "cloud",
    2602: "umbrella2",
    2603: "snowman2",
    2604: "comet",
    2611: "ballot_box_with_check",
    2614: "umbrella",
    2615: [
      "coffee",
      "hot_beverage"
    ],
    2618: "shamrock",
    2620: [
      "skull_crossbones",
      "skull_and_crossbones"
    ],
    2622: [
      "radioactive",
      "radioactive_sign"
    ],
    2623: [
      "biohazard",
      "biohazard_sign"
    ],
    2626: "orthodox_cross",
    2638: "wheel_of_dharma",
    2639: [
      "frowning2",
      "white_frowning_face",
      "frowning_face"
    ],
    2640: "female_sign",
    2642: "male_sign",
    2648: "aries",
    2649: "taurus",
    2650: "sagittarius",
    2651: "capricorn",
    2652: "aquarius",
    2653: "pisces",
    2660: [
      "spades",
      "spade_suit"
    ],
    2663: [
      "clubs",
      "club_suit"
    ],
    2665: [
      "hearts",
      "heart_suit"
    ],
    2666: [
      "diamonds",
      "diamond_suit"
    ],
    2668: [
      "hotsprings",
      "hot_springs"
    ],
    2692: [
      "hammer_pick",
      "hammer_and_pick"
    ],
    2693: "anchor",
    2694: "crossed_swords",
    2695: "medical_symbol",
    2696: [
      "scales",
      "balance_scale"
    ],
    2697: "alembic",
    2699: "gear",
    2702: "scissors",
    2705: "white_check_mark",
    2708: "airplane",
    2709: "envelope",
    2712: "black_nib",
    2714: [
      "heavy_check_mark",
      "check_mark"
    ],
    2716: "heavy_multiplication_x",
    2721: "star_of_david",
    2728: "sparkles",
    2733: "eight_spoked_asterisk",
    2734: "eight_pointed_black_star",
    2744: "snowflake",
    2747: "sparkle",
    2753: [
      "question",
      "question_mark"
    ],
    2754: "grey_question",
    2755: "grey_exclamation",
    2757: "exclamation",
    2763: [
      "heart_exclamation",
      "heavy_heart_exclamation_mark_ornament"
    ],
    2764: [
      "heart",
      "red_heart"
    ],
    2795: "heavy_plus_sign",
    2796: "heavy_minus_sign",
    2797: "heavy_division_sign",
    2934: "arrow_heading_up",
    2935: "arrow_heading_down",
    3030: "wavy_dash",
    3297: "congratulations",
    3299: "secret",
    "1F600": [
      "grinning",
      "grinning_face"
    ],
    "1F603": "smiley",
    "1F604": "smile",
    "1F601": "grin",
    "1F606": [
      "laughing",
      "satisfied"
    ],
    "1F979": "face_holding_back_tears",
    "1F605": "sweat_smile",
    "1F602": "joy",
    "1F923": [
      "rofl",
      "rolling_on_the_floor_laughing"
    ],
    "1F972": "smiling_face_with_tear",
    "263A": [
      "relaxed",
      "smiling_face"
    ],
    "1F60A": "blush",
    "1F607": "innocent",
    "1F642": [
      "slight_smile",
      "slightly_smiling_face"
    ],
    "1F643": [
      "upside_down",
      "upside_down_face"
    ],
    "1F609": [
      "wink",
      "winking_face"
    ],
    "1F60C": [
      "relieved",
      "relieved_face"
    ],
    "1F60D": "heart_eyes",
    "1F970": "smiling_face_with_3_hearts",
    "1F618": "kissing_heart",
    "1F617": [
      "kissing",
      "kissing_face"
    ],
    "1F619": "kissing_smiling_eyes",
    "1F61A": "kissing_closed_eyes",
    "1F60B": "yum",
    "1F61B": "stuck_out_tongue",
    "1F61D": "stuck_out_tongue_closed_eyes",
    "1F61C": "stuck_out_tongue_winking_eye",
    "1F92A": "zany_face",
    "1F928": "face_with_raised_eyebrow",
    "1F9D0": "face_with_monocle",
    "1F913": [
      "nerd",
      "nerd_face"
    ],
    "1F60E": "sunglasses",
    "1F978": "disguised_face",
    "1F929": "star_struck",
    "1F973": "partying_face",
    "1F60F": [
      "smirk",
      "smirking_face"
    ],
    "1F612": [
      "unamused",
      "unamused_face"
    ],
    "1F61E": "disappointed",
    "1F614": [
      "pensive",
      "pensive_face"
    ],
    "1F61F": [
      "worried",
      "worried_face"
    ],
    "1F615": [
      "confused",
      "confused_face"
    ],
    "1F641": [
      "slight_frown",
      "slightly_frowning_face"
    ],
    "1F623": "persevere",
    "1F616": "confounded",
    "1F62B": "tired_face",
    "1F629": [
      "weary",
      "weary_face"
    ],
    "1F97A": "pleading_face",
    "1F622": [
      "cry",
      "crying_face"
    ],
    "1F62D": "sob",
    "1F624": "triumph",
    "1F620": [
      "angry",
      "angry_face"
    ],
    "1F621": [
      "rage",
      "pouting_face"
    ],
    "1F92C": "face_with_symbols_over_mouth",
    "1F92F": "exploding_head",
    "1F633": [
      "flushed",
      "flushed_face"
    ],
    "1F975": "hot_face",
    "1F976": "cold_face",
    "1F636-200D-1F32B-FE0F": "face_in_clouds",
    "1F631": "scream",
    "1F628": [
      "fearful",
      "fearful_face"
    ],
    "1F630": "cold_sweat",
    "1F625": "disappointed_relieved",
    "1F613": "sweat",
    "1F917": [
      "hugging",
      "hugging_face"
    ],
    "1F914": [
      "thinking",
      "thinking_face"
    ],
    "1FAE3": "face_with_peeking_eye",
    "1F92D": "face_with_hand_over_mouth",
    "1FAE2": "face_with_open_eyes_and_hand_over_mouth",
    "1FAE1": "saluting_face",
    "1F92B": "shushing_face",
    "1FAE0": "melting_face",
    "1F925": [
      "lying_face",
      "liar"
    ],
    "1F636": "no_mouth",
    "1FAE5": "dotted_line_face",
    "1F610": "neutral_face",
    "1FAE4": "face_with_diagonal_mouth",
    "1F611": "expressionless",
    "1FAE8": "shaking_face",
    "1F62C": "grimacing",
    "1F644": [
      "rolling_eyes",
      "face_with_rolling_eyes"
    ],
    "1F62F": [
      "hushed",
      "hushed_face"
    ],
    "1F626": "frowning",
    "1F627": "anguished",
    "1F62E": "open_mouth",
    "1F632": "astonished",
    "1F971": "yawning_face",
    "1F634": [
      "sleeping",
      "sleeping_face"
    ],
    "1F924": [
      "drooling_face",
      "drool"
    ],
    "1F62A": [
      "sleepy",
      "sleepy_face"
    ],
    "1F62E-200D-1F4A8": "face_exhaling",
    "1F635": "dizzy_face",
    "1F635-200D-1F4AB": "face_with_spiral_eyes",
    "1F910": [
      "zipper_mouth",
      "zipper_mouth_face"
    ],
    "1F974": "woozy_face",
    "1F922": [
      "nauseated_face",
      "sick"
    ],
    "1F92E": "face_vomiting",
    "1F927": [
      "sneezing_face",
      "sneeze"
    ],
    "1F637": "mask",
    "1F912": [
      "thermometer_face",
      "face_with_thermometer"
    ],
    "1F915": [
      "head_bandage",
      "face_with_head_bandage"
    ],
    "1F911": [
      "money_mouth",
      "money_mouth_face"
    ],
    "1F920": [
      "cowboy",
      "face_with_cowboy_hat"
    ],
    "1F608": "smiling_imp",
    "1F47F": "imp",
    "1F479": [
      "japanese_ogre",
      "ogre"
    ],
    "1F47A": [
      "japanese_goblin",
      "goblin"
    ],
    "1F921": [
      "clown",
      "clown_face"
    ],
    "1F4A9": [
      "poop",
      "shit",
      "hankey",
      "poo",
      "pile_of_poo"
    ],
    "1F47B": "ghost",
    "1F480": [
      "skull",
      "skeleton"
    ],
    "1F47D": "alien",
    "1F47E": [
      "space_invader",
      "alien_monster"
    ],
    "1F916": [
      "robot",
      "robot_face"
    ],
    "1F383": "jack_o_lantern",
    "1F63A": [
      "smiley_cat",
      "grinning_cat"
    ],
    "1F638": "smile_cat",
    "1F639": "joy_cat",
    "1F63B": "heart_eyes_cat",
    "1F63C": "smirk_cat",
    "1F63D": "kissing_cat",
    "1F640": [
      "scream_cat",
      "weary_cat"
    ],
    "1F63F": [
      "crying_cat_face",
      "crying_cat"
    ],
    "1F63E": "pouting_cat",
    "1FAF6": "heart_hands",
    "1FAF6-1F3FB": [
      "heart_hands_tone1",
      "heart_hands_light_skin_tone"
    ],
    "1FAF6-1F3FC": [
      "heart_hands_tone2",
      "heart_hands_medium_light_skin_tone"
    ],
    "1FAF6-1F3FD": [
      "heart_hands_tone3",
      "heart_hands_medium_skin_tone"
    ],
    "1FAF6-1F3FE": [
      "heart_hands_tone4",
      "heart_hands_medium_dark_skin_tone"
    ],
    "1FAF6-1F3FF": [
      "heart_hands_tone5",
      "heart_hands_dark_skin_tone"
    ],
    "1F932": "palms_up_together",
    "1F932-1F3FB": [
      "palms_up_together_tone1",
      "palms_up_together_light_skin_tone"
    ],
    "1F932-1F3FC": [
      "palms_up_together_tone2",
      "palms_up_together_medium_light_skin_tone"
    ],
    "1F932-1F3FD": [
      "palms_up_together_tone3",
      "palms_up_together_medium_skin_tone"
    ],
    "1F932-1F3FE": [
      "palms_up_together_tone4",
      "palms_up_together_medium_dark_skin_tone"
    ],
    "1F932-1F3FF": [
      "palms_up_together_tone5",
      "palms_up_together_dark_skin_tone"
    ],
    "1F450": "open_hands",
    "1F450-1F3FB": "open_hands_tone1",
    "1F450-1F3FC": "open_hands_tone2",
    "1F450-1F3FD": "open_hands_tone3",
    "1F450-1F3FE": "open_hands_tone4",
    "1F450-1F3FF": "open_hands_tone5",
    "1F64C": [
      "raised_hands",
      "raising_hands"
    ],
    "1F64C-1F3FB": "raised_hands_tone1",
    "1F64C-1F3FC": "raised_hands_tone2",
    "1F64C-1F3FD": "raised_hands_tone3",
    "1F64C-1F3FE": "raised_hands_tone4",
    "1F64C-1F3FF": "raised_hands_tone5",
    "1F44F": "clap",
    "1F44F-1F3FB": "clap_tone1",
    "1F44F-1F3FC": "clap_tone2",
    "1F44F-1F3FD": "clap_tone3",
    "1F44F-1F3FE": "clap_tone4",
    "1F44F-1F3FF": "clap_tone5",
    "1F91D": [
      "handshake",
      "shaking_hands"
    ],
    "1F91D-1F3FB": [
      "handshake_tone1",
      "handshake_light_skin_tone"
    ],
    "1FAF1-1F3FB-200D-1FAF2-1F3FC": [
      "handshake_tone1_tone2",
      "handshake_light_skin_tone_medium_light_skin_tone"
    ],
    "1FAF1-1F3FB-200D-1FAF2-1F3FD": [
      "handshake_tone1_tone3",
      "handshake_light_skin_tone_medium_skin_tone"
    ],
    "1FAF1-1F3FB-200D-1FAF2-1F3FE": [
      "handshake_tone1_tone4",
      "handshake_light_skin_tone_medium_dark_skin_tone"
    ],
    "1FAF1-1F3FB-200D-1FAF2-1F3FF": [
      "handshake_tone1_tone5",
      "handshake_light_skin_tone_dark_skin_tone"
    ],
    "1FAF1-1F3FC-200D-1FAF2-1F3FB": [
      "handshake_tone2_tone1",
      "handshake_medium_light_skin_tone_light_skin_tone"
    ],
    "1F91D-1F3FC": [
      "handshake_tone2",
      "handshake_medium_light_skin_tone"
    ],
    "1FAF1-1F3FC-200D-1FAF2-1F3FD": [
      "handshake_tone2_tone3",
      "handshake_medium_light_skin_tone_medium_skin_tone"
    ],
    "1FAF1-1F3FC-200D-1FAF2-1F3FE": [
      "handshake_tone2_tone4",
      "handshake_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1FAF1-1F3FC-200D-1FAF2-1F3FF": [
      "handshake_tone2_tone5",
      "handshake_medium_light_skin_tone_dark_skin_tone"
    ],
    "1FAF1-1F3FD-200D-1FAF2-1F3FB": [
      "handshake_tone3_tone1",
      "handshake_medium_skin_tone_light_skin_tone"
    ],
    "1FAF1-1F3FD-200D-1FAF2-1F3FC": [
      "handshake_tone3_tone2",
      "handshake_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F91D-1F3FD": [
      "handshake_tone3",
      "handshake_medium_skin_tone"
    ],
    "1FAF1-1F3FD-200D-1FAF2-1F3FE": [
      "handshake_tone3_tone4",
      "handshake_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1FAF1-1F3FD-200D-1FAF2-1F3FF": [
      "handshake_tone3_tone5",
      "handshake_medium_skin_tone_dark_skin_tone"
    ],
    "1FAF1-1F3FE-200D-1FAF2-1F3FB": [
      "handshake_tone4_tone1",
      "handshake_medium_dark_skin_tone_light_skin_tone"
    ],
    "1FAF1-1F3FE-200D-1FAF2-1F3FC": [
      "handshake_tone4_tone2",
      "handshake_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1FAF1-1F3FE-200D-1FAF2-1F3FD": [
      "handshake_tone4_tone3",
      "handshake_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F91D-1F3FE": [
      "handshake_tone4",
      "handshake_medium_dark_skin_tone"
    ],
    "1FAF1-1F3FE-200D-1FAF2-1F3FF": [
      "handshake_tone4_tone5",
      "handshake_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1FAF1-1F3FF-200D-1FAF2-1F3FB": [
      "handshake_tone5_tone1",
      "handshake_dark_skin_tone_light_skin_tone"
    ],
    "1FAF1-1F3FF-200D-1FAF2-1F3FC": [
      "handshake_tone5_tone2",
      "handshake_dark_skin_tone_medium_light_skin_tone"
    ],
    "1FAF1-1F3FF-200D-1FAF2-1F3FD": [
      "handshake_tone5_tone3",
      "handshake_dark_skin_tone_medium_skin_tone"
    ],
    "1FAF1-1F3FF-200D-1FAF2-1F3FE": [
      "handshake_tone5_tone4",
      "handshake_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F91D-1F3FF": [
      "handshake_tone5",
      "handshake_dark_skin_tone"
    ],
    "1F44D": [
      "thumbsup",
      "+1",
      "thumbup",
      "thumbs_up"
    ],
    "1F44D-1F3FB": [
      "thumbsup_tone1",
      "+1_tone1",
      "thumbup_tone1"
    ],
    "1F44D-1F3FC": [
      "thumbsup_tone2",
      "+1_tone2",
      "thumbup_tone2"
    ],
    "1F44D-1F3FD": [
      "thumbsup_tone3",
      "+1_tone3",
      "thumbup_tone3"
    ],
    "1F44D-1F3FE": [
      "thumbsup_tone4",
      "+1_tone4",
      "thumbup_tone4"
    ],
    "1F44D-1F3FF": [
      "thumbsup_tone5",
      "+1_tone5",
      "thumbup_tone5"
    ],
    "1F44E": [
      "thumbsdown",
      "-1",
      "thumbdown",
      "thumbs_down"
    ],
    "1F44E-1F3FB": [
      "thumbsdown_tone1",
      "-1_tone1",
      "thumbdown_tone1"
    ],
    "1F44E-1F3FC": [
      "thumbsdown_tone2",
      "-1_tone2",
      "thumbdown_tone2"
    ],
    "1F44E-1F3FD": [
      "thumbsdown_tone3",
      "-1_tone3",
      "thumbdown_tone3"
    ],
    "1F44E-1F3FE": [
      "thumbsdown_tone4",
      "-1_tone4",
      "thumbdown_tone4"
    ],
    "1F44E-1F3FF": [
      "thumbsdown_tone5",
      "-1_tone5",
      "thumbdown_tone5"
    ],
    "1F44A": [
      "punch",
      "oncoming_fist"
    ],
    "1F44A-1F3FB": "punch_tone1",
    "1F44A-1F3FC": "punch_tone2",
    "1F44A-1F3FD": "punch_tone3",
    "1F44A-1F3FE": "punch_tone4",
    "1F44A-1F3FF": "punch_tone5",
    "270A": [
      "fist",
      "raised_fist"
    ],
    "270A-1F3FB": "fist_tone1",
    "270A-1F3FC": "fist_tone2",
    "270A-1F3FD": "fist_tone3",
    "270A-1F3FE": "fist_tone4",
    "270A-1F3FF": "fist_tone5",
    "1F91B": [
      "left_facing_fist",
      "left_fist"
    ],
    "1F91B-1F3FB": [
      "left_facing_fist_tone1",
      "left_fist_tone1"
    ],
    "1F91B-1F3FC": [
      "left_facing_fist_tone2",
      "left_fist_tone2"
    ],
    "1F91B-1F3FD": [
      "left_facing_fist_tone3",
      "left_fist_tone3"
    ],
    "1F91B-1F3FE": [
      "left_facing_fist_tone4",
      "left_fist_tone4"
    ],
    "1F91B-1F3FF": [
      "left_facing_fist_tone5",
      "left_fist_tone5"
    ],
    "1F91C": [
      "right_facing_fist",
      "right_fist"
    ],
    "1F91C-1F3FB": [
      "right_facing_fist_tone1",
      "right_fist_tone1"
    ],
    "1F91C-1F3FC": [
      "right_facing_fist_tone2",
      "right_fist_tone2"
    ],
    "1F91C-1F3FD": [
      "right_facing_fist_tone3",
      "right_fist_tone3"
    ],
    "1F91C-1F3FE": [
      "right_facing_fist_tone4",
      "right_fist_tone4"
    ],
    "1F91C-1F3FF": [
      "right_facing_fist_tone5",
      "right_fist_tone5"
    ],
    "1FAF7": "leftwards_pushing_hand",
    "1FAF7-1F3FB": [
      "leftwards_pushing_hand_tone1",
      "leftwards_pushing_hand_light_skin_tone"
    ],
    "1FAF7-1F3FC": [
      "leftwards_pushing_hand_tone2",
      "leftwards_pushing_hand_medium_light_skin_tone"
    ],
    "1FAF7-1F3FD": [
      "leftwards_pushing_hand_tone3",
      "leftwards_pushing_hand_medium_skin_tone"
    ],
    "1FAF7-1F3FE": [
      "leftwards_pushing_hand_tone4",
      "leftwards_pushing_hand_medium_dark_skin_tone"
    ],
    "1FAF7-1F3FF": [
      "leftwards_pushing_hand_tone5",
      "leftwards_pushing_hand_dark_skin_tone"
    ],
    "1FAF8": "rightwards_pushing_hand",
    "1FAF8-1F3FB": [
      "rightwards_pushing_hand_tone1",
      "rightwards_pushing_hand_light_skin_tone"
    ],
    "1FAF8-1F3FC": [
      "rightwards_pushing_hand_tone2",
      "rightwards_pushing_hand_medium_light_skin_tone"
    ],
    "1FAF8-1F3FD": [
      "rightwards_pushing_hand_tone3",
      "rightwards_pushing_hand_medium_skin_tone"
    ],
    "1FAF8-1F3FE": [
      "rightwards_pushing_hand_tone4",
      "rightwards_pushing_hand_medium_dark_skin_tone"
    ],
    "1FAF8-1F3FF": [
      "rightwards_pushing_hand_tone5",
      "rightwards_pushing_hand_dark_skin_tone"
    ],
    "1F91E": [
      "fingers_crossed",
      "hand_with_index_and_middle_finger_crossed"
    ],
    "1F91E-1F3FB": [
      "fingers_crossed_tone1",
      "hand_with_index_and_middle_fingers_crossed_tone1"
    ],
    "1F91E-1F3FC": [
      "fingers_crossed_tone2",
      "hand_with_index_and_middle_fingers_crossed_tone2"
    ],
    "1F91E-1F3FD": [
      "fingers_crossed_tone3",
      "hand_with_index_and_middle_fingers_crossed_tone3"
    ],
    "1F91E-1F3FE": [
      "fingers_crossed_tone4",
      "hand_with_index_and_middle_fingers_crossed_tone4"
    ],
    "1F91E-1F3FF": [
      "fingers_crossed_tone5",
      "hand_with_index_and_middle_fingers_crossed_tone5"
    ],
    "270C": [
      "v",
      "victory_hand"
    ],
    "270C-1F3FB": "v_tone1",
    "270C-1F3FC": "v_tone2",
    "270C-1F3FD": "v_tone3",
    "270C-1F3FE": "v_tone4",
    "270C-1F3FF": "v_tone5",
    "1FAF0": "hand_with_index_finger_and_thumb_crossed",
    "1FAF0-1F3FB": [
      "hand_with_index_finger_and_thumb_crossed_tone1",
      "hand_with_index_finger_and_thumb_crossed_light_skin_tone"
    ],
    "1FAF0-1F3FC": [
      "hand_with_index_finger_and_thumb_crossed_tone2",
      "hand_with_index_finger_and_thumb_crossed_medium_light_skin_tone"
    ],
    "1FAF0-1F3FD": [
      "hand_with_index_finger_and_thumb_crossed_tone3",
      "hand_with_index_finger_and_thumb_crossed_medium_skin_tone"
    ],
    "1FAF0-1F3FE": [
      "hand_with_index_finger_and_thumb_crossed_tone4",
      "hand_with_index_finger_and_thumb_crossed_medium_dark_skin_tone"
    ],
    "1FAF0-1F3FF": [
      "hand_with_index_finger_and_thumb_crossed_tone5",
      "hand_with_index_finger_and_thumb_crossed_dark_skin_tone"
    ],
    "1F91F": "love_you_gesture",
    "1F91F-1F3FB": [
      "love_you_gesture_tone1",
      "love_you_gesture_light_skin_tone"
    ],
    "1F91F-1F3FC": [
      "love_you_gesture_tone2",
      "love_you_gesture_medium_light_skin_tone"
    ],
    "1F91F-1F3FD": [
      "love_you_gesture_tone3",
      "love_you_gesture_medium_skin_tone"
    ],
    "1F91F-1F3FE": [
      "love_you_gesture_tone4",
      "love_you_gesture_medium_dark_skin_tone"
    ],
    "1F91F-1F3FF": [
      "love_you_gesture_tone5",
      "love_you_gesture_dark_skin_tone"
    ],
    "1F918": [
      "metal",
      "sign_of_the_horns"
    ],
    "1F918-1F3FB": [
      "metal_tone1",
      "sign_of_the_horns_tone1"
    ],
    "1F918-1F3FC": [
      "metal_tone2",
      "sign_of_the_horns_tone2"
    ],
    "1F918-1F3FD": [
      "metal_tone3",
      "sign_of_the_horns_tone3"
    ],
    "1F918-1F3FE": [
      "metal_tone4",
      "sign_of_the_horns_tone4"
    ],
    "1F918-1F3FF": [
      "metal_tone5",
      "sign_of_the_horns_tone5"
    ],
    "1F44C": "ok_hand",
    "1F44C-1F3FB": "ok_hand_tone1",
    "1F44C-1F3FC": "ok_hand_tone2",
    "1F44C-1F3FD": "ok_hand_tone3",
    "1F44C-1F3FE": "ok_hand_tone4",
    "1F44C-1F3FF": "ok_hand_tone5",
    "1F90C": "pinched_fingers",
    "1F90C-1F3FC": [
      "pinched_fingers_tone2",
      "pinched_fingers_medium_light_skin_tone"
    ],
    "1F90C-1F3FB": [
      "pinched_fingers_tone1",
      "pinched_fingers_light_skin_tone"
    ],
    "1F90C-1F3FD": [
      "pinched_fingers_tone3",
      "pinched_fingers_medium_skin_tone"
    ],
    "1F90C-1F3FE": [
      "pinched_fingers_tone4",
      "pinched_fingers_medium_dark_skin_tone"
    ],
    "1F90C-1F3FF": [
      "pinched_fingers_tone5",
      "pinched_fingers_dark_skin_tone"
    ],
    "1F90F": "pinching_hand",
    "1F90F-1F3FB": [
      "pinching_hand_tone1",
      "pinching_hand_light_skin_tone"
    ],
    "1F90F-1F3FC": [
      "pinching_hand_tone2",
      "pinching_hand_medium_light_skin_tone"
    ],
    "1F90F-1F3FD": [
      "pinching_hand_tone3",
      "pinching_hand_medium_skin_tone"
    ],
    "1F90F-1F3FE": [
      "pinching_hand_tone4",
      "pinching_hand_medium_dark_skin_tone"
    ],
    "1F90F-1F3FF": [
      "pinching_hand_tone5",
      "pinching_hand_dark_skin_tone"
    ],
    "1FAF3": "palm_down_hand",
    "1FAF3-1F3FB": [
      "palm_down_hand_tone1",
      "palm_down_hand_light_skin_tone"
    ],
    "1FAF3-1F3FC": [
      "palm_down_hand_tone2",
      "palm_down_hand_medium_light_skin_tone"
    ],
    "1FAF3-1F3FD": [
      "palm_down_hand_tone3",
      "palm_down_hand_medium_skin_tone"
    ],
    "1FAF3-1F3FE": [
      "palm_down_hand_tone4",
      "palm_down_hand_medium_dark_skin_tone"
    ],
    "1FAF3-1F3FF": [
      "palm_down_hand_tone5",
      "palm_down_hand_dark_skin_tone"
    ],
    "1FAF4": "palm_up_hand",
    "1FAF4-1F3FB": [
      "palm_up_hand_tone1",
      "palm_up_hand_light_skin_tone"
    ],
    "1FAF4-1F3FC": [
      "palm_up_hand_tone2",
      "palm_up_hand_medium_light_skin_tone"
    ],
    "1FAF4-1F3FD": [
      "palm_up_hand_tone3",
      "palm_up_hand_medium_skin_tone"
    ],
    "1FAF4-1F3FE": [
      "palm_up_hand_tone4",
      "palm_up_hand_medium_dark_skin_tone"
    ],
    "1FAF4-1F3FF": [
      "palm_up_hand_tone5",
      "palm_up_hand_dark_skin_tone"
    ],
    "1F448": "point_left",
    "1F448-1F3FB": "point_left_tone1",
    "1F448-1F3FC": "point_left_tone2",
    "1F448-1F3FD": "point_left_tone3",
    "1F448-1F3FE": "point_left_tone4",
    "1F448-1F3FF": "point_left_tone5",
    "1F449": "point_right",
    "1F449-1F3FB": "point_right_tone1",
    "1F449-1F3FC": "point_right_tone2",
    "1F449-1F3FD": "point_right_tone3",
    "1F449-1F3FE": "point_right_tone4",
    "1F449-1F3FF": "point_right_tone5",
    "1F446": "point_up_2",
    "1F446-1F3FB": "point_up_2_tone1",
    "1F446-1F3FC": "point_up_2_tone2",
    "1F446-1F3FD": "point_up_2_tone3",
    "1F446-1F3FE": "point_up_2_tone4",
    "1F446-1F3FF": "point_up_2_tone5",
    "1F447": "point_down",
    "1F447-1F3FB": "point_down_tone1",
    "1F447-1F3FC": "point_down_tone2",
    "1F447-1F3FD": "point_down_tone3",
    "1F447-1F3FE": "point_down_tone4",
    "1F447-1F3FF": "point_down_tone5",
    "261D": "point_up",
    "261D-1F3FB": "point_up_tone1",
    "261D-1F3FC": "point_up_tone2",
    "261D-1F3FD": "point_up_tone3",
    "261D-1F3FE": "point_up_tone4",
    "261D-1F3FF": "point_up_tone5",
    "270B": "raised_hand",
    "270B-1F3FB": "raised_hand_tone1",
    "270B-1F3FC": "raised_hand_tone2",
    "270B-1F3FD": "raised_hand_tone3",
    "270B-1F3FE": "raised_hand_tone4",
    "270B-1F3FF": "raised_hand_tone5",
    "1F91A": [
      "raised_back_of_hand",
      "back_of_hand"
    ],
    "1F91A-1F3FB": [
      "raised_back_of_hand_tone1",
      "back_of_hand_tone1"
    ],
    "1F91A-1F3FC": [
      "raised_back_of_hand_tone2",
      "back_of_hand_tone2"
    ],
    "1F91A-1F3FD": [
      "raised_back_of_hand_tone3",
      "back_of_hand_tone3"
    ],
    "1F91A-1F3FE": [
      "raised_back_of_hand_tone4",
      "back_of_hand_tone4"
    ],
    "1F91A-1F3FF": [
      "raised_back_of_hand_tone5",
      "back_of_hand_tone5"
    ],
    "1F590": [
      "hand_splayed",
      "raised_hand_with_fingers_splayed"
    ],
    "1F590-1F3FB": [
      "hand_splayed_tone1",
      "raised_hand_with_fingers_splayed_tone1"
    ],
    "1F590-1F3FC": [
      "hand_splayed_tone2",
      "raised_hand_with_fingers_splayed_tone2"
    ],
    "1F590-1F3FD": [
      "hand_splayed_tone3",
      "raised_hand_with_fingers_splayed_tone3"
    ],
    "1F590-1F3FE": [
      "hand_splayed_tone4",
      "raised_hand_with_fingers_splayed_tone4"
    ],
    "1F590-1F3FF": [
      "hand_splayed_tone5",
      "raised_hand_with_fingers_splayed_tone5"
    ],
    "1F596": [
      "vulcan",
      "raised_hand_with_part_between_middle_and_ring_fingers",
      "vulcan_salute"
    ],
    "1F596-1F3FB": [
      "vulcan_tone1",
      "raised_hand_with_part_between_middle_and_ring_fingers_tone1"
    ],
    "1F596-1F3FC": [
      "vulcan_tone2",
      "raised_hand_with_part_between_middle_and_ring_fingers_tone2"
    ],
    "1F596-1F3FD": [
      "vulcan_tone3",
      "raised_hand_with_part_between_middle_and_ring_fingers_tone3"
    ],
    "1F596-1F3FE": [
      "vulcan_tone4",
      "raised_hand_with_part_between_middle_and_ring_fingers_tone4"
    ],
    "1F596-1F3FF": [
      "vulcan_tone5",
      "raised_hand_with_part_between_middle_and_ring_fingers_tone5"
    ],
    "1F44B": [
      "wave",
      "waving_hand"
    ],
    "1F44B-1F3FB": "wave_tone1",
    "1F44B-1F3FC": "wave_tone2",
    "1F44B-1F3FD": "wave_tone3",
    "1F44B-1F3FE": "wave_tone4",
    "1F44B-1F3FF": "wave_tone5",
    "1F919": [
      "call_me",
      "call_me_hand"
    ],
    "1F919-1F3FB": [
      "call_me_tone1",
      "call_me_hand_tone1"
    ],
    "1F919-1F3FC": [
      "call_me_tone2",
      "call_me_hand_tone2"
    ],
    "1F919-1F3FD": [
      "call_me_tone3",
      "call_me_hand_tone3"
    ],
    "1F919-1F3FE": [
      "call_me_tone4",
      "call_me_hand_tone4"
    ],
    "1F919-1F3FF": [
      "call_me_tone5",
      "call_me_hand_tone5"
    ],
    "1FAF2": "leftwards_hand",
    "1FAF2-1F3FB": [
      "leftwards_hand_tone1",
      "leftwards_hand_light_skin_tone"
    ],
    "1FAF2-1F3FC": [
      "leftwards_hand_tone2",
      "leftwards_hand_medium_light_skin_tone"
    ],
    "1FAF2-1F3FD": [
      "leftwards_hand_tone3",
      "leftwards_hand_medium_skin_tone"
    ],
    "1FAF2-1F3FE": [
      "leftwards_hand_tone4",
      "leftwards_hand_medium_dark_skin_tone"
    ],
    "1FAF2-1F3FF": [
      "leftwards_hand_tone5",
      "leftwards_hand_dark_skin_tone"
    ],
    "1FAF1": "rightwards_hand",
    "1FAF1-1F3FB": [
      "rightwards_hand_tone1",
      "rightwards_hand_light_skin_tone"
    ],
    "1FAF1-1F3FC": [
      "rightwards_hand_tone2",
      "rightwards_hand_medium_light_skin_tone"
    ],
    "1FAF1-1F3FD": [
      "rightwards_hand_tone3",
      "rightwards_hand_medium_skin_tone"
    ],
    "1FAF1-1F3FE": [
      "rightwards_hand_tone4",
      "rightwards_hand_medium_dark_skin_tone"
    ],
    "1FAF1-1F3FF": [
      "rightwards_hand_tone5",
      "rightwards_hand_dark_skin_tone"
    ],
    "1F4AA": [
      "muscle",
      "flexed_biceps"
    ],
    "1F4AA-1F3FB": "muscle_tone1",
    "1F4AA-1F3FC": "muscle_tone2",
    "1F4AA-1F3FD": "muscle_tone3",
    "1F4AA-1F3FE": "muscle_tone4",
    "1F4AA-1F3FF": "muscle_tone5",
    "1F9BE": "mechanical_arm",
    "1F595": [
      "middle_finger",
      "reversed_hand_with_middle_finger_extended"
    ],
    "1F595-1F3FB": [
      "middle_finger_tone1",
      "reversed_hand_with_middle_finger_extended_tone1"
    ],
    "1F595-1F3FC": [
      "middle_finger_tone2",
      "reversed_hand_with_middle_finger_extended_tone2"
    ],
    "1F595-1F3FD": [
      "middle_finger_tone3",
      "reversed_hand_with_middle_finger_extended_tone3"
    ],
    "1F595-1F3FE": [
      "middle_finger_tone4",
      "reversed_hand_with_middle_finger_extended_tone4"
    ],
    "1F595-1F3FF": [
      "middle_finger_tone5",
      "reversed_hand_with_middle_finger_extended_tone5"
    ],
    "270D": "writing_hand",
    "270D-1F3FB": "writing_hand_tone1",
    "270D-1F3FC": "writing_hand_tone2",
    "270D-1F3FD": "writing_hand_tone3",
    "270D-1F3FE": "writing_hand_tone4",
    "270D-1F3FF": "writing_hand_tone5",
    "1F64F": [
      "pray",
      "folded_hands"
    ],
    "1F64F-1F3FB": "pray_tone1",
    "1F64F-1F3FC": "pray_tone2",
    "1F64F-1F3FD": "pray_tone3",
    "1F64F-1F3FE": "pray_tone4",
    "1F64F-1F3FF": "pray_tone5",
    "1FAF5": "index_pointing_at_the_viewer",
    "1FAF5-1F3FB": [
      "index_pointing_at_the_viewer_tone1",
      "index_pointing_at_the_viewer_light_skin_tone"
    ],
    "1FAF5-1F3FC": [
      "index_pointing_at_the_viewer_tone2",
      "index_pointing_at_the_viewer_medium_light_skin_tone"
    ],
    "1FAF5-1F3FD": [
      "index_pointing_at_the_viewer_tone3",
      "index_pointing_at_the_viewer_medium_skin_tone"
    ],
    "1FAF5-1F3FE": [
      "index_pointing_at_the_viewer_tone4",
      "index_pointing_at_the_viewer_medium_dark_skin_tone"
    ],
    "1FAF5-1F3FF": [
      "index_pointing_at_the_viewer_tone5",
      "index_pointing_at_the_viewer_dark_skin_tone"
    ],
    "1F9B6": "foot",
    "1F9B6-1F3FB": [
      "foot_tone1",
      "foot_light_skin_tone"
    ],
    "1F9B6-1F3FC": [
      "foot_tone2",
      "foot_medium_light_skin_tone"
    ],
    "1F9B6-1F3FD": [
      "foot_tone3",
      "foot_medium_skin_tone"
    ],
    "1F9B6-1F3FE": [
      "foot_tone4",
      "foot_medium_dark_skin_tone"
    ],
    "1F9B6-1F3FF": [
      "foot_tone5",
      "foot_dark_skin_tone"
    ],
    "1F9B5": "leg",
    "1F9B5-1F3FB": [
      "leg_tone1",
      "leg_light_skin_tone"
    ],
    "1F9B5-1F3FC": [
      "leg_tone2",
      "leg_medium_light_skin_tone"
    ],
    "1F9B5-1F3FD": [
      "leg_tone3",
      "leg_medium_skin_tone"
    ],
    "1F9B5-1F3FE": [
      "leg_tone4",
      "leg_medium_dark_skin_tone"
    ],
    "1F9B5-1F3FF": [
      "leg_tone5",
      "leg_dark_skin_tone"
    ],
    "1F9BF": "mechanical_leg",
    "1F484": "lipstick",
    "1F48B": [
      "kiss",
      "kiss_mark"
    ],
    "1F444": [
      "lips",
      "mouth"
    ],
    "1FAE6": "biting_lip",
    "1F9B7": "tooth",
    "1F445": "tongue",
    "1F442": "ear",
    "1F442-1F3FB": "ear_tone1",
    "1F442-1F3FC": "ear_tone2",
    "1F442-1F3FD": "ear_tone3",
    "1F442-1F3FE": "ear_tone4",
    "1F442-1F3FF": "ear_tone5",
    "1F9BB": "ear_with_hearing_aid",
    "1F9BB-1F3FB": [
      "ear_with_hearing_aid_tone1",
      "ear_with_hearing_aid_light_skin_tone"
    ],
    "1F9BB-1F3FC": [
      "ear_with_hearing_aid_tone2",
      "ear_with_hearing_aid_medium_light_skin_tone"
    ],
    "1F9BB-1F3FD": [
      "ear_with_hearing_aid_tone3",
      "ear_with_hearing_aid_medium_skin_tone"
    ],
    "1F9BB-1F3FE": [
      "ear_with_hearing_aid_tone4",
      "ear_with_hearing_aid_medium_dark_skin_tone"
    ],
    "1F9BB-1F3FF": [
      "ear_with_hearing_aid_tone5",
      "ear_with_hearing_aid_dark_skin_tone"
    ],
    "1F443": "nose",
    "1F443-1F3FB": "nose_tone1",
    "1F443-1F3FC": "nose_tone2",
    "1F443-1F3FD": "nose_tone3",
    "1F443-1F3FE": "nose_tone4",
    "1F443-1F3FF": "nose_tone5",
    "1F463": "footprints",
    "1F441": "eye",
    "1F440": "eyes",
    "1FAC0": "anatomical_heart",
    "1FAC1": "lungs",
    "1F9E0": "brain",
    "1F5E3": [
      "speaking_head",
      "speaking_head_in_silhouette"
    ],
    "1F464": "bust_in_silhouette",
    "1F465": "busts_in_silhouette",
    "1FAC2": "people_hugging",
    "1F476": "baby",
    "1F476-1F3FB": "baby_tone1",
    "1F476-1F3FC": "baby_tone2",
    "1F476-1F3FD": "baby_tone3",
    "1F476-1F3FE": "baby_tone4",
    "1F476-1F3FF": "baby_tone5",
    "1F9D2": "child",
    "1F9D2-1F3FB": [
      "child_tone1",
      "child_light_skin_tone"
    ],
    "1F9D2-1F3FC": [
      "child_tone2",
      "child_medium_light_skin_tone"
    ],
    "1F9D2-1F3FD": [
      "child_tone3",
      "child_medium_skin_tone"
    ],
    "1F9D2-1F3FE": [
      "child_tone4",
      "child_medium_dark_skin_tone"
    ],
    "1F9D2-1F3FF": [
      "child_tone5",
      "child_dark_skin_tone"
    ],
    "1F467": "girl",
    "1F467-1F3FB": "girl_tone1",
    "1F467-1F3FC": "girl_tone2",
    "1F467-1F3FD": "girl_tone3",
    "1F467-1F3FE": "girl_tone4",
    "1F467-1F3FF": "girl_tone5",
    "1F466": "boy",
    "1F466-1F3FB": "boy_tone1",
    "1F466-1F3FC": "boy_tone2",
    "1F466-1F3FD": "boy_tone3",
    "1F466-1F3FE": "boy_tone4",
    "1F466-1F3FF": "boy_tone5",
    "1F9D1": [
      "adult",
      "person"
    ],
    "1F9D1-1F3FB": [
      "adult_tone1",
      "adult_light_skin_tone"
    ],
    "1F9D1-1F3FC": [
      "adult_tone2",
      "adult_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD": [
      "adult_tone3",
      "adult_medium_skin_tone"
    ],
    "1F9D1-1F3FE": [
      "adult_tone4",
      "adult_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF": [
      "adult_tone5",
      "adult_dark_skin_tone"
    ],
    "1F469": "woman",
    "1F469-1F3FB": "woman_tone1",
    "1F469-1F3FC": "woman_tone2",
    "1F469-1F3FD": "woman_tone3",
    "1F469-1F3FE": "woman_tone4",
    "1F469-1F3FF": "woman_tone5",
    "1F468": "man",
    "1F468-1F3FB": "man_tone1",
    "1F468-1F3FC": "man_tone2",
    "1F468-1F3FD": "man_tone3",
    "1F468-1F3FE": "man_tone4",
    "1F468-1F3FF": "man_tone5",
    "1F9D1-200D-1F9B1": "person_curly_hair",
    "1F9D1-1F3FB-200D-1F9B1": [
      "person_tone1_curly_hair",
      "person_light_skin_tone_curly_hair"
    ],
    "1F9D1-1F3FC-200D-1F9B1": [
      "person_tone2_curly_hair",
      "person_medium_light_skin_tone_curly_hair"
    ],
    "1F9D1-1F3FD-200D-1F9B1": [
      "person_tone3_curly_hair",
      "person_medium_skin_tone_curly_hair"
    ],
    "1F9D1-1F3FE-200D-1F9B1": [
      "person_tone4_curly_hair",
      "person_medium_dark_skin_tone_curly_hair"
    ],
    "1F9D1-1F3FF-200D-1F9B1": [
      "person_tone5_curly_hair",
      "person_dark_skin_tone_curly_hair"
    ],
    "1F469-200D-1F9B1": "woman_curly_haired",
    "1F469-1F3FB-200D-1F9B1": [
      "woman_curly_haired_tone1",
      "woman_curly_haired_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9B1": [
      "woman_curly_haired_tone2",
      "woman_curly_haired_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9B1": [
      "woman_curly_haired_tone3",
      "woman_curly_haired_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9B1": [
      "woman_curly_haired_tone4",
      "woman_curly_haired_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9B1": [
      "woman_curly_haired_tone5",
      "woman_curly_haired_dark_skin_tone"
    ],
    "1F468-200D-1F9B1": "man_curly_haired",
    "1F468-1F3FB-200D-1F9B1": [
      "man_curly_haired_tone1",
      "man_curly_haired_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9B1": [
      "man_curly_haired_tone2",
      "man_curly_haired_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9B1": [
      "man_curly_haired_tone3",
      "man_curly_haired_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9B1": [
      "man_curly_haired_tone4",
      "man_curly_haired_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9B1": [
      "man_curly_haired_tone5",
      "man_curly_haired_dark_skin_tone"
    ],
    "1F9D1-200D-1F9B0": "person_red_hair",
    "1F9D1-1F3FB-200D-1F9B0": [
      "person_tone1_red_hair",
      "person_light_skin_tone_red_hair"
    ],
    "1F9D1-1F3FC-200D-1F9B0": [
      "person_tone2_red_hair",
      "person_medium_light_skin_tone_red_hair"
    ],
    "1F9D1-1F3FD-200D-1F9B0": [
      "person_tone3_red_hair",
      "person_medium_skin_tone_red_hair"
    ],
    "1F9D1-1F3FE-200D-1F9B0": [
      "person_tone4_red_hair",
      "person_medium_dark_skin_tone_red_hair"
    ],
    "1F9D1-1F3FF-200D-1F9B0": [
      "person_tone5_red_hair",
      "person_dark_skin_tone_red_hair"
    ],
    "1F469-200D-1F9B0": "woman_red_haired",
    "1F469-1F3FB-200D-1F9B0": [
      "woman_red_haired_tone1",
      "woman_red_haired_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9B0": [
      "woman_red_haired_tone2",
      "woman_red_haired_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9B0": [
      "woman_red_haired_tone3",
      "woman_red_haired_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9B0": [
      "woman_red_haired_tone4",
      "woman_red_haired_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9B0": [
      "woman_red_haired_tone5",
      "woman_red_haired_dark_skin_tone"
    ],
    "1F468-200D-1F9B0": [
      "man_red_haired",
      "man_red_hair"
    ],
    "1F468-1F3FB-200D-1F9B0": [
      "man_red_haired_tone1",
      "man_red_haired_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9B0": [
      "man_red_haired_tone2",
      "man_red_haired_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9B0": [
      "man_red_haired_tone3",
      "man_red_haired_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9B0": [
      "man_red_haired_tone4",
      "man_red_haired_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9B0": [
      "man_red_haired_tone5",
      "man_red_haired_dark_skin_tone"
    ],
    "1F471": [
      "blond_haired_person",
      "person_with_blond_hair"
    ],
    "1F471-1F3FB": [
      "blond_haired_person_tone1",
      "person_with_blond_hair_tone1"
    ],
    "1F471-1F3FC": [
      "blond_haired_person_tone2",
      "person_with_blond_hair_tone2"
    ],
    "1F471-1F3FD": [
      "blond_haired_person_tone3",
      "person_with_blond_hair_tone3"
    ],
    "1F471-1F3FE": [
      "blond_haired_person_tone4",
      "person_with_blond_hair_tone4"
    ],
    "1F471-1F3FF": [
      "blond_haired_person_tone5",
      "person_with_blond_hair_tone5"
    ],
    "1F471-200D-2640-FE0F": "blond-haired_woman",
    "1F471-1F3FB-200D-2640-FE0F": [
      "blond-haired_woman_tone1",
      "blond-haired_woman_light_skin_tone"
    ],
    "1F471-1F3FC-200D-2640-FE0F": [
      "blond-haired_woman_tone2",
      "blond-haired_woman_medium_light_skin_tone"
    ],
    "1F471-1F3FD-200D-2640-FE0F": [
      "blond-haired_woman_tone3",
      "blond-haired_woman_medium_skin_tone"
    ],
    "1F471-1F3FE-200D-2640-FE0F": [
      "blond-haired_woman_tone4",
      "blond-haired_woman_medium_dark_skin_tone"
    ],
    "1F471-1F3FF-200D-2640-FE0F": [
      "blond-haired_woman_tone5",
      "blond-haired_woman_dark_skin_tone"
    ],
    "1F471-200D-2642-FE0F": "blond-haired_man",
    "1F471-1F3FB-200D-2642-FE0F": [
      "blond-haired_man_tone1",
      "blond-haired_man_light_skin_tone"
    ],
    "1F471-1F3FC-200D-2642-FE0F": [
      "blond-haired_man_tone2",
      "blond-haired_man_medium_light_skin_tone"
    ],
    "1F471-1F3FD-200D-2642-FE0F": [
      "blond-haired_man_tone3",
      "blond-haired_man_medium_skin_tone"
    ],
    "1F471-1F3FE-200D-2642-FE0F": [
      "blond-haired_man_tone4",
      "blond-haired_man_medium_dark_skin_tone"
    ],
    "1F471-1F3FF-200D-2642-FE0F": [
      "blond-haired_man_tone5",
      "blond-haired_man_dark_skin_tone"
    ],
    "1F9D1-200D-1F9B3": "person_white_hair",
    "1F9D1-1F3FB-200D-1F9B3": [
      "person_tone1_white_hair",
      "person_light_skin_tone_white_hair"
    ],
    "1F9D1-1F3FC-200D-1F9B3": [
      "person_tone2_white_hair",
      "person_medium_light_skin_tone_white_hair"
    ],
    "1F9D1-1F3FD-200D-1F9B3": [
      "person_tone3_white_hair",
      "person_medium_skin_tone_white_hair"
    ],
    "1F9D1-1F3FE-200D-1F9B3": [
      "person_tone4_white_hair",
      "person_medium_dark_skin_tone_white_hair"
    ],
    "1F9D1-1F3FF-200D-1F9B3": [
      "person_tone5_white_hair",
      "person_dark_skin_tone_white_hair"
    ],
    "1F469-200D-1F9B3": "woman_white_haired",
    "1F469-1F3FB-200D-1F9B3": [
      "woman_white_haired_tone1",
      "woman_white_haired_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9B3": [
      "woman_white_haired_tone2",
      "woman_white_haired_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9B3": [
      "woman_white_haired_tone3",
      "woman_white_haired_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9B3": [
      "woman_white_haired_tone4",
      "woman_white_haired_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9B3": [
      "woman_white_haired_tone5",
      "woman_white_haired_dark_skin_tone"
    ],
    "1F468-200D-1F9B3": "man_white_haired",
    "1F468-1F3FB-200D-1F9B3": [
      "man_white_haired_tone1",
      "man_white_haired_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9B3": [
      "man_white_haired_tone2",
      "man_white_haired_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9B3": [
      "man_white_haired_tone3",
      "man_white_haired_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9B3": [
      "man_white_haired_tone4",
      "man_white_haired_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9B3": [
      "man_white_haired_tone5",
      "man_white_haired_dark_skin_tone"
    ],
    "1F9D1-200D-1F9B2": "person_bald",
    "1F9D1-1F3FB-200D-1F9B2": [
      "person_tone1_bald",
      "person_light_skin_tone_bald"
    ],
    "1F9D1-1F3FC-200D-1F9B2": [
      "person_tone2_bald",
      "person_medium_light_skin_tone_bald"
    ],
    "1F9D1-1F3FD-200D-1F9B2": [
      "person_tone3_bald",
      "person_medium_skin_tone_bald"
    ],
    "1F9D1-1F3FE-200D-1F9B2": [
      "person_tone4_bald",
      "person_medium_dark_skin_tone_bald"
    ],
    "1F9D1-1F3FF-200D-1F9B2": [
      "person_tone5_bald",
      "person_dark_skin_tone_bald"
    ],
    "1F469-200D-1F9B2": "woman_bald",
    "1F469-1F3FB-200D-1F9B2": [
      "woman_bald_tone1",
      "woman_bald_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9B2": [
      "woman_bald_tone2",
      "woman_bald_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9B2": [
      "woman_bald_tone3",
      "woman_bald_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9B2": [
      "woman_bald_tone4",
      "woman_bald_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9B2": [
      "woman_bald_tone5",
      "woman_bald_dark_skin_tone"
    ],
    "1F468-200D-1F9B2": "man_bald",
    "1F468-1F3FB-200D-1F9B2": [
      "man_bald_tone1",
      "man_bald_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9B2": [
      "man_bald_tone2",
      "man_bald_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9B2": [
      "man_bald_tone3",
      "man_bald_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9B2": [
      "man_bald_tone4",
      "man_bald_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9B2": [
      "man_bald_tone5",
      "man_bald_dark_skin_tone"
    ],
    "1F9D4": [
      "bearded_person",
      "person_beard"
    ],
    "1F9D4-1F3FB": [
      "bearded_person_tone1",
      "bearded_person_light_skin_tone"
    ],
    "1F9D4-1F3FC": [
      "bearded_person_tone2",
      "bearded_person_medium_light_skin_tone"
    ],
    "1F9D4-1F3FD": [
      "bearded_person_tone3",
      "bearded_person_medium_skin_tone"
    ],
    "1F9D4-1F3FE": [
      "bearded_person_tone4",
      "bearded_person_medium_dark_skin_tone"
    ],
    "1F9D4-1F3FF": [
      "bearded_person_tone5",
      "bearded_person_dark_skin_tone"
    ],
    "1F9D4-200D-2640-FE0F": "woman_beard",
    "1F9D4-1F3FB-200D-2640-FE0F": [
      "woman_tone1_beard",
      "woman_light_skin_tone_beard"
    ],
    "1F9D4-1F3FC-200D-2640-FE0F": [
      "woman_tone2_beard",
      "woman_medium_light_skin_tone_beard"
    ],
    "1F9D4-1F3FD-200D-2640-FE0F": [
      "woman_tone3_beard",
      "woman_medium_skin_tone_beard"
    ],
    "1F9D4-1F3FE-200D-2640-FE0F": [
      "woman_tone4_beard",
      "woman_medium_dark_skin_tone_beard"
    ],
    "1F9D4-1F3FF-200D-2640-FE0F": [
      "woman_tone5_beard",
      "woman_dark_skin_tone_beard"
    ],
    "1F9D4-200D-2642-FE0F": "man_beard",
    "1F9D4-1F3FB-200D-2642-FE0F": [
      "man_tone1_beard",
      "man_light_skin_tone_beard"
    ],
    "1F9D4-1F3FC-200D-2642-FE0F": [
      "man_tone2_beard",
      "man_medium_light_skin_tone_beard"
    ],
    "1F9D4-1F3FD-200D-2642-FE0F": [
      "man_tone3_beard",
      "man_medium_skin_tone_beard"
    ],
    "1F9D4-1F3FE-200D-2642-FE0F": [
      "man_tone4_beard",
      "man_medium_dark_skin_tone_beard"
    ],
    "1F9D4-1F3FF-200D-2642-FE0F": [
      "man_tone5_beard",
      "man_dark_skin_tone_beard"
    ],
    "1F9D3": [
      "older_adult",
      "older_person"
    ],
    "1F9D3-1F3FB": [
      "older_adult_tone1",
      "older_adult_light_skin_tone"
    ],
    "1F9D3-1F3FC": [
      "older_adult_tone2",
      "older_adult_medium_light_skin_tone"
    ],
    "1F9D3-1F3FD": [
      "older_adult_tone3",
      "older_adult_medium_skin_tone"
    ],
    "1F9D3-1F3FE": [
      "older_adult_tone4",
      "older_adult_medium_dark_skin_tone"
    ],
    "1F9D3-1F3FF": [
      "older_adult_tone5",
      "older_adult_dark_skin_tone"
    ],
    "1F475": [
      "older_woman",
      "grandma",
      "old_woman"
    ],
    "1F475-1F3FB": [
      "older_woman_tone1",
      "grandma_tone1"
    ],
    "1F475-1F3FC": [
      "older_woman_tone2",
      "grandma_tone2"
    ],
    "1F475-1F3FD": [
      "older_woman_tone3",
      "grandma_tone3"
    ],
    "1F475-1F3FE": [
      "older_woman_tone4",
      "grandma_tone4"
    ],
    "1F475-1F3FF": [
      "older_woman_tone5",
      "grandma_tone5"
    ],
    "1F474": [
      "older_man",
      "old_man"
    ],
    "1F474-1F3FB": "older_man_tone1",
    "1F474-1F3FC": "older_man_tone2",
    "1F474-1F3FD": "older_man_tone3",
    "1F474-1F3FE": "older_man_tone4",
    "1F474-1F3FF": "older_man_tone5",
    "1F472": [
      "man_with_chinese_cap",
      "man_with_gua_pi_mao"
    ],
    "1F472-1F3FB": [
      "man_with_chinese_cap_tone1",
      "man_with_gua_pi_mao_tone1"
    ],
    "1F472-1F3FC": [
      "man_with_chinese_cap_tone2",
      "man_with_gua_pi_mao_tone2"
    ],
    "1F472-1F3FD": [
      "man_with_chinese_cap_tone3",
      "man_with_gua_pi_mao_tone3"
    ],
    "1F472-1F3FE": [
      "man_with_chinese_cap_tone4",
      "man_with_gua_pi_mao_tone4"
    ],
    "1F472-1F3FF": [
      "man_with_chinese_cap_tone5",
      "man_with_gua_pi_mao_tone5"
    ],
    "1F473": [
      "person_wearing_turban",
      "man_with_turban"
    ],
    "1F473-1F3FB": [
      "person_wearing_turban_tone1",
      "man_with_turban_tone1"
    ],
    "1F473-1F3FC": [
      "person_wearing_turban_tone2",
      "man_with_turban_tone2"
    ],
    "1F473-1F3FD": [
      "person_wearing_turban_tone3",
      "man_with_turban_tone3"
    ],
    "1F473-1F3FE": [
      "person_wearing_turban_tone4",
      "man_with_turban_tone4"
    ],
    "1F473-1F3FF": [
      "person_wearing_turban_tone5",
      "man_with_turban_tone5"
    ],
    "1F473-200D-2640-FE0F": "woman_wearing_turban",
    "1F473-1F3FB-200D-2640-FE0F": [
      "woman_wearing_turban_tone1",
      "woman_wearing_turban_light_skin_tone"
    ],
    "1F473-1F3FC-200D-2640-FE0F": [
      "woman_wearing_turban_tone2",
      "woman_wearing_turban_medium_light_skin_tone"
    ],
    "1F473-1F3FD-200D-2640-FE0F": [
      "woman_wearing_turban_tone3",
      "woman_wearing_turban_medium_skin_tone"
    ],
    "1F473-1F3FE-200D-2640-FE0F": [
      "woman_wearing_turban_tone4",
      "woman_wearing_turban_medium_dark_skin_tone"
    ],
    "1F473-1F3FF-200D-2640-FE0F": [
      "woman_wearing_turban_tone5",
      "woman_wearing_turban_dark_skin_tone"
    ],
    "1F473-200D-2642-FE0F": "man_wearing_turban",
    "1F473-1F3FB-200D-2642-FE0F": [
      "man_wearing_turban_tone1",
      "man_wearing_turban_light_skin_tone"
    ],
    "1F473-1F3FC-200D-2642-FE0F": [
      "man_wearing_turban_tone2",
      "man_wearing_turban_medium_light_skin_tone"
    ],
    "1F473-1F3FD-200D-2642-FE0F": [
      "man_wearing_turban_tone3",
      "man_wearing_turban_medium_skin_tone"
    ],
    "1F473-1F3FE-200D-2642-FE0F": [
      "man_wearing_turban_tone4",
      "man_wearing_turban_medium_dark_skin_tone"
    ],
    "1F473-1F3FF-200D-2642-FE0F": [
      "man_wearing_turban_tone5",
      "man_wearing_turban_dark_skin_tone"
    ],
    "1F9D5": "woman_with_headscarf",
    "1F9D5-1F3FB": [
      "woman_with_headscarf_tone1",
      "woman_with_headscarf_light_skin_tone"
    ],
    "1F9D5-1F3FC": [
      "woman_with_headscarf_tone2",
      "woman_with_headscarf_medium_light_skin_tone"
    ],
    "1F9D5-1F3FD": [
      "woman_with_headscarf_tone3",
      "woman_with_headscarf_medium_skin_tone"
    ],
    "1F9D5-1F3FE": [
      "woman_with_headscarf_tone4",
      "woman_with_headscarf_medium_dark_skin_tone"
    ],
    "1F9D5-1F3FF": [
      "woman_with_headscarf_tone5",
      "woman_with_headscarf_dark_skin_tone"
    ],
    "1F46E": [
      "police_officer",
      "cop"
    ],
    "1F46E-1F3FB": [
      "police_officer_tone1",
      "cop_tone1"
    ],
    "1F46E-1F3FC": [
      "police_officer_tone2",
      "cop_tone2"
    ],
    "1F46E-1F3FD": [
      "police_officer_tone3",
      "cop_tone3"
    ],
    "1F46E-1F3FE": [
      "police_officer_tone4",
      "cop_tone4"
    ],
    "1F46E-1F3FF": [
      "police_officer_tone5",
      "cop_tone5"
    ],
    "1F46E-200D-2640-FE0F": "woman_police_officer",
    "1F46E-1F3FB-200D-2640-FE0F": [
      "woman_police_officer_tone1",
      "woman_police_officer_light_skin_tone"
    ],
    "1F46E-1F3FC-200D-2640-FE0F": [
      "woman_police_officer_tone2",
      "woman_police_officer_medium_light_skin_tone"
    ],
    "1F46E-1F3FD-200D-2640-FE0F": [
      "woman_police_officer_tone3",
      "woman_police_officer_medium_skin_tone"
    ],
    "1F46E-1F3FE-200D-2640-FE0F": [
      "woman_police_officer_tone4",
      "woman_police_officer_medium_dark_skin_tone"
    ],
    "1F46E-1F3FF-200D-2640-FE0F": [
      "woman_police_officer_tone5",
      "woman_police_officer_dark_skin_tone"
    ],
    "1F46E-200D-2642-FE0F": "man_police_officer",
    "1F46E-1F3FB-200D-2642-FE0F": [
      "man_police_officer_tone1",
      "man_police_officer_light_skin_tone"
    ],
    "1F46E-1F3FC-200D-2642-FE0F": [
      "man_police_officer_tone2",
      "man_police_officer_medium_light_skin_tone"
    ],
    "1F46E-1F3FD-200D-2642-FE0F": [
      "man_police_officer_tone3",
      "man_police_officer_medium_skin_tone"
    ],
    "1F46E-1F3FE-200D-2642-FE0F": [
      "man_police_officer_tone4",
      "man_police_officer_medium_dark_skin_tone"
    ],
    "1F46E-1F3FF-200D-2642-FE0F": [
      "man_police_officer_tone5",
      "man_police_officer_dark_skin_tone"
    ],
    "1F477": "construction_worker",
    "1F477-1F3FB": "construction_worker_tone1",
    "1F477-1F3FC": "construction_worker_tone2",
    "1F477-1F3FD": "construction_worker_tone3",
    "1F477-1F3FE": "construction_worker_tone4",
    "1F477-1F3FF": "construction_worker_tone5",
    "1F477-200D-2640-FE0F": "woman_construction_worker",
    "1F477-1F3FB-200D-2640-FE0F": [
      "woman_construction_worker_tone1",
      "woman_construction_worker_light_skin_tone"
    ],
    "1F477-1F3FC-200D-2640-FE0F": [
      "woman_construction_worker_tone2",
      "woman_construction_worker_medium_light_skin_tone"
    ],
    "1F477-1F3FD-200D-2640-FE0F": [
      "woman_construction_worker_tone3",
      "woman_construction_worker_medium_skin_tone"
    ],
    "1F477-1F3FE-200D-2640-FE0F": [
      "woman_construction_worker_tone4",
      "woman_construction_worker_medium_dark_skin_tone"
    ],
    "1F477-1F3FF-200D-2640-FE0F": [
      "woman_construction_worker_tone5",
      "woman_construction_worker_dark_skin_tone"
    ],
    "1F477-200D-2642-FE0F": "man_construction_worker",
    "1F477-1F3FB-200D-2642-FE0F": [
      "man_construction_worker_tone1",
      "man_construction_worker_light_skin_tone"
    ],
    "1F477-1F3FC-200D-2642-FE0F": [
      "man_construction_worker_tone2",
      "man_construction_worker_medium_light_skin_tone"
    ],
    "1F477-1F3FD-200D-2642-FE0F": [
      "man_construction_worker_tone3",
      "man_construction_worker_medium_skin_tone"
    ],
    "1F477-1F3FE-200D-2642-FE0F": [
      "man_construction_worker_tone4",
      "man_construction_worker_medium_dark_skin_tone"
    ],
    "1F477-1F3FF-200D-2642-FE0F": [
      "man_construction_worker_tone5",
      "man_construction_worker_dark_skin_tone"
    ],
    "1F482": [
      "guard",
      "guardsman"
    ],
    "1F482-1F3FB": [
      "guard_tone1",
      "guardsman_tone1"
    ],
    "1F482-1F3FC": [
      "guard_tone2",
      "guardsman_tone2"
    ],
    "1F482-1F3FD": [
      "guard_tone3",
      "guardsman_tone3"
    ],
    "1F482-1F3FE": [
      "guard_tone4",
      "guardsman_tone4"
    ],
    "1F482-1F3FF": [
      "guard_tone5",
      "guardsman_tone5"
    ],
    "1F482-200D-2640-FE0F": "woman_guard",
    "1F482-1F3FB-200D-2640-FE0F": [
      "woman_guard_tone1",
      "woman_guard_light_skin_tone"
    ],
    "1F482-1F3FC-200D-2640-FE0F": [
      "woman_guard_tone2",
      "woman_guard_medium_light_skin_tone"
    ],
    "1F482-1F3FD-200D-2640-FE0F": [
      "woman_guard_tone3",
      "woman_guard_medium_skin_tone"
    ],
    "1F482-1F3FE-200D-2640-FE0F": [
      "woman_guard_tone4",
      "woman_guard_medium_dark_skin_tone"
    ],
    "1F482-1F3FF-200D-2640-FE0F": [
      "woman_guard_tone5",
      "woman_guard_dark_skin_tone"
    ],
    "1F482-200D-2642-FE0F": "man_guard",
    "1F482-1F3FB-200D-2642-FE0F": [
      "man_guard_tone1",
      "man_guard_light_skin_tone"
    ],
    "1F482-1F3FC-200D-2642-FE0F": [
      "man_guard_tone2",
      "man_guard_medium_light_skin_tone"
    ],
    "1F482-1F3FD-200D-2642-FE0F": [
      "man_guard_tone3",
      "man_guard_medium_skin_tone"
    ],
    "1F482-1F3FE-200D-2642-FE0F": [
      "man_guard_tone4",
      "man_guard_medium_dark_skin_tone"
    ],
    "1F482-1F3FF-200D-2642-FE0F": [
      "man_guard_tone5",
      "man_guard_dark_skin_tone"
    ],
    "1F575": [
      "detective",
      "spy",
      "sleuth_or_spy"
    ],
    "1F575-1F3FB": [
      "detective_tone1",
      "spy_tone1",
      "sleuth_or_spy_tone1"
    ],
    "1F575-1F3FC": [
      "detective_tone2",
      "spy_tone2",
      "sleuth_or_spy_tone2"
    ],
    "1F575-1F3FD": [
      "detective_tone3",
      "spy_tone3",
      "sleuth_or_spy_tone3"
    ],
    "1F575-1F3FE": [
      "detective_tone4",
      "spy_tone4",
      "sleuth_or_spy_tone4"
    ],
    "1F575-1F3FF": [
      "detective_tone5",
      "spy_tone5",
      "sleuth_or_spy_tone5"
    ],
    "1F575-FE0F-200D-2640-FE0F": "woman_detective",
    "1F575-1F3FB-200D-2640-FE0F": [
      "woman_detective_tone1",
      "woman_detective_light_skin_tone"
    ],
    "1F575-1F3FC-200D-2640-FE0F": [
      "woman_detective_tone2",
      "woman_detective_medium_light_skin_tone"
    ],
    "1F575-1F3FD-200D-2640-FE0F": [
      "woman_detective_tone3",
      "woman_detective_medium_skin_tone"
    ],
    "1F575-1F3FE-200D-2640-FE0F": [
      "woman_detective_tone4",
      "woman_detective_medium_dark_skin_tone"
    ],
    "1F575-1F3FF-200D-2640-FE0F": [
      "woman_detective_tone5",
      "woman_detective_dark_skin_tone"
    ],
    "1F575-FE0F-200D-2642-FE0F": "man_detective",
    "1F575-1F3FB-200D-2642-FE0F": [
      "man_detective_tone1",
      "man_detective_light_skin_tone"
    ],
    "1F575-1F3FC-200D-2642-FE0F": [
      "man_detective_tone2",
      "man_detective_medium_light_skin_tone"
    ],
    "1F575-1F3FD-200D-2642-FE0F": [
      "man_detective_tone3",
      "man_detective_medium_skin_tone"
    ],
    "1F575-1F3FE-200D-2642-FE0F": [
      "man_detective_tone4",
      "man_detective_medium_dark_skin_tone"
    ],
    "1F575-1F3FF-200D-2642-FE0F": [
      "man_detective_tone5",
      "man_detective_dark_skin_tone"
    ],
    "1F9D1-200D-2695-FE0F": "health_worker",
    "1F9D1-1F3FB-200D-2695-FE0F": [
      "health_worker_tone1",
      "health_worker_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2695-FE0F": [
      "health_worker_tone2",
      "health_worker_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2695-FE0F": [
      "health_worker_tone3",
      "health_worker_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2695-FE0F": [
      "health_worker_tone4",
      "health_worker_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2695-FE0F": [
      "health_worker_tone5",
      "health_worker_dark_skin_tone"
    ],
    "1F469-200D-2695-FE0F": "woman_health_worker",
    "1F469-1F3FB-200D-2695-FE0F": [
      "woman_health_worker_tone1",
      "woman_health_worker_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2695-FE0F": [
      "woman_health_worker_tone2",
      "woman_health_worker_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2695-FE0F": [
      "woman_health_worker_tone3",
      "woman_health_worker_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2695-FE0F": [
      "woman_health_worker_tone4",
      "woman_health_worker_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2695-FE0F": [
      "woman_health_worker_tone5",
      "woman_health_worker_dark_skin_tone"
    ],
    "1F468-200D-2695-FE0F": "man_health_worker",
    "1F468-1F3FB-200D-2695-FE0F": [
      "man_health_worker_tone1",
      "man_health_worker_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2695-FE0F": [
      "man_health_worker_tone2",
      "man_health_worker_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2695-FE0F": [
      "man_health_worker_tone3",
      "man_health_worker_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-2695-FE0F": [
      "man_health_worker_tone4",
      "man_health_worker_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2695-FE0F": [
      "man_health_worker_tone5",
      "man_health_worker_dark_skin_tone"
    ],
    "1F9D1-200D-1F33E": "farmer",
    "1F9D1-1F3FB-200D-1F33E": [
      "farmer_tone1",
      "farmer_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F33E": [
      "farmer_tone2",
      "farmer_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F33E": [
      "farmer_tone3",
      "farmer_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F33E": [
      "farmer_tone4",
      "farmer_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F33E": [
      "farmer_tone5",
      "farmer_dark_skin_tone"
    ],
    "1F469-200D-1F33E": "woman_farmer",
    "1F469-1F3FB-200D-1F33E": [
      "woman_farmer_tone1",
      "woman_farmer_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F33E": [
      "woman_farmer_tone2",
      "woman_farmer_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F33E": [
      "woman_farmer_tone3",
      "woman_farmer_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F33E": [
      "woman_farmer_tone4",
      "woman_farmer_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F33E": [
      "woman_farmer_tone5",
      "woman_farmer_dark_skin_tone"
    ],
    "1F468-200D-1F33E": "man_farmer",
    "1F468-1F3FB-200D-1F33E": [
      "man_farmer_tone1",
      "man_farmer_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F33E": [
      "man_farmer_tone2",
      "man_farmer_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F33E": [
      "man_farmer_tone3",
      "man_farmer_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F33E": [
      "man_farmer_tone4",
      "man_farmer_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F33E": [
      "man_farmer_tone5",
      "man_farmer_dark_skin_tone"
    ],
    "1F9D1-200D-1F373": "cook",
    "1F9D1-1F3FB-200D-1F373": [
      "cook_tone1",
      "cook_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F373": [
      "cook_tone2",
      "cook_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F373": [
      "cook_tone3",
      "cook_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F373": [
      "cook_tone4",
      "cook_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F373": [
      "cook_tone5",
      "cook_dark_skin_tone"
    ],
    "1F469-200D-1F373": "woman_cook",
    "1F469-1F3FB-200D-1F373": [
      "woman_cook_tone1",
      "woman_cook_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F373": [
      "woman_cook_tone2",
      "woman_cook_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F373": [
      "woman_cook_tone3",
      "woman_cook_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F373": [
      "woman_cook_tone4",
      "woman_cook_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F373": [
      "woman_cook_tone5",
      "woman_cook_dark_skin_tone"
    ],
    "1F468-200D-1F373": "man_cook",
    "1F468-1F3FB-200D-1F373": [
      "man_cook_tone1",
      "man_cook_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F373": [
      "man_cook_tone2",
      "man_cook_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F373": [
      "man_cook_tone3",
      "man_cook_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F373": [
      "man_cook_tone4",
      "man_cook_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F373": [
      "man_cook_tone5",
      "man_cook_dark_skin_tone"
    ],
    "1F9D1-200D-1F393": "student",
    "1F9D1-1F3FB-200D-1F393": [
      "student_tone1",
      "student_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F393": [
      "student_tone2",
      "student_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F393": [
      "student_tone3",
      "student_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F393": [
      "student_tone4",
      "student_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F393": [
      "student_tone5",
      "student_dark_skin_tone"
    ],
    "1F469-200D-1F393": "woman_student",
    "1F469-1F3FB-200D-1F393": [
      "woman_student_tone1",
      "woman_student_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F393": [
      "woman_student_tone2",
      "woman_student_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F393": [
      "woman_student_tone3",
      "woman_student_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F393": [
      "woman_student_tone4",
      "woman_student_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F393": [
      "woman_student_tone5",
      "woman_student_dark_skin_tone"
    ],
    "1F468-200D-1F393": "man_student",
    "1F468-1F3FB-200D-1F393": [
      "man_student_tone1",
      "man_student_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F393": [
      "man_student_tone2",
      "man_student_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F393": [
      "man_student_tone3",
      "man_student_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F393": [
      "man_student_tone4",
      "man_student_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F393": [
      "man_student_tone5",
      "man_student_dark_skin_tone"
    ],
    "1F9D1-200D-1F3A4": "singer",
    "1F9D1-1F3FB-200D-1F3A4": [
      "singer_tone1",
      "singer_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F3A4": [
      "singer_tone2",
      "singer_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F3A4": [
      "singer_tone3",
      "singer_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F3A4": [
      "singer_tone4",
      "singer_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F3A4": [
      "singer_tone5",
      "singer_dark_skin_tone"
    ],
    "1F469-200D-1F3A4": "woman_singer",
    "1F469-1F3FB-200D-1F3A4": [
      "woman_singer_tone1",
      "woman_singer_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F3A4": [
      "woman_singer_tone2",
      "woman_singer_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F3A4": [
      "woman_singer_tone3",
      "woman_singer_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F3A4": [
      "woman_singer_tone4",
      "woman_singer_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F3A4": [
      "woman_singer_tone5",
      "woman_singer_dark_skin_tone"
    ],
    "1F468-200D-1F3A4": "man_singer",
    "1F468-1F3FB-200D-1F3A4": [
      "man_singer_tone1",
      "man_singer_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F3A4": [
      "man_singer_tone2",
      "man_singer_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F3A4": [
      "man_singer_tone3",
      "man_singer_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F3A4": [
      "man_singer_tone4",
      "man_singer_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F3A4": [
      "man_singer_tone5",
      "man_singer_dark_skin_tone"
    ],
    "1F9D1-200D-1F3EB": "teacher",
    "1F9D1-1F3FB-200D-1F3EB": [
      "teacher_tone1",
      "teacher_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F3EB": [
      "teacher_tone2",
      "teacher_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F3EB": [
      "teacher_tone3",
      "teacher_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F3EB": [
      "teacher_tone4",
      "teacher_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F3EB": [
      "teacher_tone5",
      "teacher_dark_skin_tone"
    ],
    "1F469-200D-1F3EB": "woman_teacher",
    "1F469-1F3FB-200D-1F3EB": [
      "woman_teacher_tone1",
      "woman_teacher_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F3EB": [
      "woman_teacher_tone2",
      "woman_teacher_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F3EB": [
      "woman_teacher_tone3",
      "woman_teacher_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F3EB": [
      "woman_teacher_tone4",
      "woman_teacher_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F3EB": [
      "woman_teacher_tone5",
      "woman_teacher_dark_skin_tone"
    ],
    "1F468-200D-1F3EB": "man_teacher",
    "1F468-1F3FB-200D-1F3EB": [
      "man_teacher_tone1",
      "man_teacher_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F3EB": [
      "man_teacher_tone2",
      "man_teacher_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F3EB": [
      "man_teacher_tone3",
      "man_teacher_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F3EB": [
      "man_teacher_tone4",
      "man_teacher_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F3EB": [
      "man_teacher_tone5",
      "man_teacher_dark_skin_tone"
    ],
    "1F9D1-200D-1F3ED": "factory_worker",
    "1F9D1-1F3FB-200D-1F3ED": [
      "factory_worker_tone1",
      "factory_worker_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F3ED": [
      "factory_worker_tone2",
      "factory_worker_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F3ED": [
      "factory_worker_tone3",
      "factory_worker_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F3ED": [
      "factory_worker_tone4",
      "factory_worker_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F3ED": [
      "factory_worker_tone5",
      "factory_worker_dark_skin_tone"
    ],
    "1F469-200D-1F3ED": "woman_factory_worker",
    "1F469-1F3FB-200D-1F3ED": [
      "woman_factory_worker_tone1",
      "woman_factory_worker_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F3ED": [
      "woman_factory_worker_tone2",
      "woman_factory_worker_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F3ED": [
      "woman_factory_worker_tone3",
      "woman_factory_worker_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F3ED": [
      "woman_factory_worker_tone4",
      "woman_factory_worker_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F3ED": [
      "woman_factory_worker_tone5",
      "woman_factory_worker_dark_skin_tone"
    ],
    "1F468-200D-1F3ED": "man_factory_worker",
    "1F468-1F3FB-200D-1F3ED": [
      "man_factory_worker_tone1",
      "man_factory_worker_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F3ED": [
      "man_factory_worker_tone2",
      "man_factory_worker_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F3ED": [
      "man_factory_worker_tone3",
      "man_factory_worker_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F3ED": [
      "man_factory_worker_tone4",
      "man_factory_worker_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F3ED": [
      "man_factory_worker_tone5",
      "man_factory_worker_dark_skin_tone"
    ],
    "1F9D1-200D-1F4BB": "technologist",
    "1F9D1-1F3FB-200D-1F4BB": [
      "technologist_tone1",
      "technologist_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F4BB": [
      "technologist_tone2",
      "technologist_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F4BB": [
      "technologist_tone3",
      "technologist_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F4BB": [
      "technologist_tone4",
      "technologist_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F4BB": [
      "technologist_tone5",
      "technologist_dark_skin_tone"
    ],
    "1F469-200D-1F4BB": "woman_technologist",
    "1F469-1F3FB-200D-1F4BB": [
      "woman_technologist_tone1",
      "woman_technologist_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F4BB": [
      "woman_technologist_tone2",
      "woman_technologist_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F4BB": [
      "woman_technologist_tone3",
      "woman_technologist_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F4BB": [
      "woman_technologist_tone4",
      "woman_technologist_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F4BB": [
      "woman_technologist_tone5",
      "woman_technologist_dark_skin_tone"
    ],
    "1F468-200D-1F4BB": "man_technologist",
    "1F468-1F3FB-200D-1F4BB": [
      "man_technologist_tone1",
      "man_technologist_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F4BB": [
      "man_technologist_tone2",
      "man_technologist_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F4BB": [
      "man_technologist_tone3",
      "man_technologist_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F4BB": [
      "man_technologist_tone4",
      "man_technologist_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F4BB": [
      "man_technologist_tone5",
      "man_technologist_dark_skin_tone"
    ],
    "1F9D1-200D-1F4BC": "office_worker",
    "1F9D1-1F3FB-200D-1F4BC": [
      "office_worker_tone1",
      "office_worker_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F4BC": [
      "office_worker_tone2",
      "office_worker_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F4BC": [
      "office_worker_tone3",
      "office_worker_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F4BC": [
      "office_worker_tone4",
      "office_worker_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F4BC": [
      "office_worker_tone5",
      "office_worker_dark_skin_tone"
    ],
    "1F469-200D-1F4BC": "woman_office_worker",
    "1F469-1F3FB-200D-1F4BC": [
      "woman_office_worker_tone1",
      "woman_office_worker_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F4BC": [
      "woman_office_worker_tone2",
      "woman_office_worker_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F4BC": [
      "woman_office_worker_tone3",
      "woman_office_worker_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F4BC": [
      "woman_office_worker_tone4",
      "woman_office_worker_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F4BC": [
      "woman_office_worker_tone5",
      "woman_office_worker_dark_skin_tone"
    ],
    "1F468-200D-1F4BC": "man_office_worker",
    "1F468-1F3FB-200D-1F4BC": [
      "man_office_worker_tone1",
      "man_office_worker_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F4BC": [
      "man_office_worker_tone2",
      "man_office_worker_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F4BC": [
      "man_office_worker_tone3",
      "man_office_worker_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F4BC": [
      "man_office_worker_tone4",
      "man_office_worker_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F4BC": [
      "man_office_worker_tone5",
      "man_office_worker_dark_skin_tone"
    ],
    "1F9D1-200D-1F527": "mechanic",
    "1F9D1-1F3FB-200D-1F527": [
      "mechanic_tone1",
      "mechanic_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F527": [
      "mechanic_tone2",
      "mechanic_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F527": [
      "mechanic_tone3",
      "mechanic_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F527": [
      "mechanic_tone4",
      "mechanic_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F527": [
      "mechanic_tone5",
      "mechanic_dark_skin_tone"
    ],
    "1F469-200D-1F527": "woman_mechanic",
    "1F469-1F3FB-200D-1F527": [
      "woman_mechanic_tone1",
      "woman_mechanic_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F527": [
      "woman_mechanic_tone2",
      "woman_mechanic_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F527": [
      "woman_mechanic_tone3",
      "woman_mechanic_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F527": [
      "woman_mechanic_tone4",
      "woman_mechanic_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F527": [
      "woman_mechanic_tone5",
      "woman_mechanic_dark_skin_tone"
    ],
    "1F468-200D-1F527": "man_mechanic",
    "1F468-1F3FB-200D-1F527": [
      "man_mechanic_tone1",
      "man_mechanic_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F527": [
      "man_mechanic_tone2",
      "man_mechanic_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F527": [
      "man_mechanic_tone3",
      "man_mechanic_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F527": [
      "man_mechanic_tone4",
      "man_mechanic_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F527": [
      "man_mechanic_tone5",
      "man_mechanic_dark_skin_tone"
    ],
    "1F9D1-200D-1F52C": "scientist",
    "1F9D1-1F3FB-200D-1F52C": [
      "scientist_tone1",
      "scientist_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F52C": [
      "scientist_tone2",
      "scientist_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F52C": [
      "scientist_tone3",
      "scientist_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F52C": [
      "scientist_tone4",
      "scientist_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F52C": [
      "scientist_tone5",
      "scientist_dark_skin_tone"
    ],
    "1F469-200D-1F52C": "woman_scientist",
    "1F469-1F3FB-200D-1F52C": [
      "woman_scientist_tone1",
      "woman_scientist_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F52C": [
      "woman_scientist_tone2",
      "woman_scientist_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F52C": [
      "woman_scientist_tone3",
      "woman_scientist_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F52C": [
      "woman_scientist_tone4",
      "woman_scientist_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F52C": [
      "woman_scientist_tone5",
      "woman_scientist_dark_skin_tone"
    ],
    "1F468-200D-1F52C": "man_scientist",
    "1F468-1F3FB-200D-1F52C": [
      "man_scientist_tone1",
      "man_scientist_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F52C": [
      "man_scientist_tone2",
      "man_scientist_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F52C": [
      "man_scientist_tone3",
      "man_scientist_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F52C": [
      "man_scientist_tone4",
      "man_scientist_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F52C": [
      "man_scientist_tone5",
      "man_scientist_dark_skin_tone"
    ],
    "1F9D1-200D-1F3A8": "artist",
    "1F9D1-1F3FB-200D-1F3A8": [
      "artist_tone1",
      "artist_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F3A8": [
      "artist_tone2",
      "artist_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F3A8": [
      "artist_tone3",
      "artist_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F3A8": [
      "artist_tone4",
      "artist_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F3A8": [
      "artist_tone5",
      "artist_dark_skin_tone"
    ],
    "1F469-200D-1F3A8": "woman_artist",
    "1F469-1F3FB-200D-1F3A8": [
      "woman_artist_tone1",
      "woman_artist_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F3A8": [
      "woman_artist_tone2",
      "woman_artist_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F3A8": [
      "woman_artist_tone3",
      "woman_artist_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F3A8": [
      "woman_artist_tone4",
      "woman_artist_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F3A8": [
      "woman_artist_tone5",
      "woman_artist_dark_skin_tone"
    ],
    "1F468-200D-1F3A8": "man_artist",
    "1F468-1F3FB-200D-1F3A8": [
      "man_artist_tone1",
      "man_artist_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F3A8": [
      "man_artist_tone2",
      "man_artist_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F3A8": [
      "man_artist_tone3",
      "man_artist_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F3A8": [
      "man_artist_tone4",
      "man_artist_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F3A8": [
      "man_artist_tone5",
      "man_artist_dark_skin_tone"
    ],
    "1F9D1-200D-1F692": "firefighter",
    "1F9D1-1F3FB-200D-1F692": [
      "firefighter_tone1",
      "firefighter_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F692": [
      "firefighter_tone2",
      "firefighter_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F692": [
      "firefighter_tone3",
      "firefighter_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F692": [
      "firefighter_tone4",
      "firefighter_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F692": [
      "firefighter_tone5",
      "firefighter_dark_skin_tone"
    ],
    "1F469-200D-1F692": "woman_firefighter",
    "1F469-1F3FB-200D-1F692": [
      "woman_firefighter_tone1",
      "woman_firefighter_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F692": [
      "woman_firefighter_tone2",
      "woman_firefighter_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F692": [
      "woman_firefighter_tone3",
      "woman_firefighter_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F692": [
      "woman_firefighter_tone4",
      "woman_firefighter_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F692": [
      "woman_firefighter_tone5",
      "woman_firefighter_dark_skin_tone"
    ],
    "1F468-200D-1F692": "man_firefighter",
    "1F468-1F3FB-200D-1F692": [
      "man_firefighter_tone1",
      "man_firefighter_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F692": [
      "man_firefighter_tone2",
      "man_firefighter_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F692": [
      "man_firefighter_tone3",
      "man_firefighter_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F692": [
      "man_firefighter_tone4",
      "man_firefighter_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F692": [
      "man_firefighter_tone5",
      "man_firefighter_dark_skin_tone"
    ],
    "1F9D1-200D-2708-FE0F": "pilot",
    "1F9D1-1F3FB-200D-2708-FE0F": [
      "pilot_tone1",
      "pilot_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2708-FE0F": [
      "pilot_tone2",
      "pilot_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2708-FE0F": [
      "pilot_tone3",
      "pilot_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2708-FE0F": [
      "pilot_tone4",
      "pilot_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2708-FE0F": [
      "pilot_tone5",
      "pilot_dark_skin_tone"
    ],
    "1F469-200D-2708-FE0F": "woman_pilot",
    "1F469-1F3FB-200D-2708-FE0F": [
      "woman_pilot_tone1",
      "woman_pilot_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2708-FE0F": [
      "woman_pilot_tone2",
      "woman_pilot_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2708-FE0F": [
      "woman_pilot_tone3",
      "woman_pilot_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2708-FE0F": [
      "woman_pilot_tone4",
      "woman_pilot_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2708-FE0F": [
      "woman_pilot_tone5",
      "woman_pilot_dark_skin_tone"
    ],
    "1F468-200D-2708-FE0F": "man_pilot",
    "1F468-1F3FB-200D-2708-FE0F": [
      "man_pilot_tone1",
      "man_pilot_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2708-FE0F": [
      "man_pilot_tone2",
      "man_pilot_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2708-FE0F": [
      "man_pilot_tone3",
      "man_pilot_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-2708-FE0F": [
      "man_pilot_tone4",
      "man_pilot_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2708-FE0F": [
      "man_pilot_tone5",
      "man_pilot_dark_skin_tone"
    ],
    "1F9D1-200D-1F680": "astronaut",
    "1F9D1-1F3FB-200D-1F680": [
      "astronaut_tone1",
      "astronaut_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F680": [
      "astronaut_tone2",
      "astronaut_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F680": [
      "astronaut_tone3",
      "astronaut_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F680": [
      "astronaut_tone4",
      "astronaut_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F680": [
      "astronaut_tone5",
      "astronaut_dark_skin_tone"
    ],
    "1F469-200D-1F680": "woman_astronaut",
    "1F469-1F3FB-200D-1F680": [
      "woman_astronaut_tone1",
      "woman_astronaut_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F680": [
      "woman_astronaut_tone2",
      "woman_astronaut_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F680": [
      "woman_astronaut_tone3",
      "woman_astronaut_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F680": [
      "woman_astronaut_tone4",
      "woman_astronaut_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F680": [
      "woman_astronaut_tone5",
      "woman_astronaut_dark_skin_tone"
    ],
    "1F468-200D-1F680": "man_astronaut",
    "1F468-1F3FB-200D-1F680": [
      "man_astronaut_tone1",
      "man_astronaut_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F680": [
      "man_astronaut_tone2",
      "man_astronaut_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F680": [
      "man_astronaut_tone3",
      "man_astronaut_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F680": [
      "man_astronaut_tone4",
      "man_astronaut_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F680": [
      "man_astronaut_tone5",
      "man_astronaut_dark_skin_tone"
    ],
    "1F9D1-200D-2696-FE0F": "judge",
    "1F9D1-1F3FB-200D-2696-FE0F": [
      "judge_tone1",
      "judge_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2696-FE0F": [
      "judge_tone2",
      "judge_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2696-FE0F": [
      "judge_tone3",
      "judge_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2696-FE0F": [
      "judge_tone4",
      "judge_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2696-FE0F": [
      "judge_tone5",
      "judge_dark_skin_tone"
    ],
    "1F469-200D-2696-FE0F": "woman_judge",
    "1F469-1F3FB-200D-2696-FE0F": [
      "woman_judge_tone1",
      "woman_judge_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2696-FE0F": [
      "woman_judge_tone2",
      "woman_judge_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2696-FE0F": [
      "woman_judge_tone3",
      "woman_judge_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2696-FE0F": [
      "woman_judge_tone4",
      "woman_judge_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2696-FE0F": [
      "woman_judge_tone5",
      "woman_judge_dark_skin_tone"
    ],
    "1F468-200D-2696-FE0F": "man_judge",
    "1F468-1F3FB-200D-2696-FE0F": [
      "man_judge_tone1",
      "man_judge_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2696-FE0F": [
      "man_judge_tone2",
      "man_judge_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2696-FE0F": [
      "man_judge_tone3",
      "man_judge_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-2696-FE0F": [
      "man_judge_tone4",
      "man_judge_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2696-FE0F": [
      "man_judge_tone5",
      "man_judge_dark_skin_tone"
    ],
    "1F470": "person_with_veil",
    "1F470-1F3FB": "person_with_veil_tone1",
    "1F470-1F3FC": "person_with_veil_tone2",
    "1F470-1F3FD": "person_with_veil_tone3",
    "1F470-1F3FE": "person_with_veil_tone4",
    "1F470-1F3FF": "person_with_veil_tone5",
    "1F470-200D-2640-FE0F": "woman_with_veil",
    "1F470-1F3FB-200D-2640-FE0F": [
      "woman_with_veil_tone1",
      "woman_with_veil_light_skin_tone"
    ],
    "1F470-1F3FC-200D-2640-FE0F": [
      "woman_with_veil_tone2",
      "woman_with_veil_medium_light_skin_tone"
    ],
    "1F470-1F3FD-200D-2640-FE0F": [
      "woman_with_veil_tone3",
      "woman_with_veil_medium_skin_tone"
    ],
    "1F470-1F3FE-200D-2640-FE0F": [
      "woman_with_veil_tone4",
      "woman_with_veil_medium_dark_skin_tone"
    ],
    "1F470-1F3FF-200D-2640-FE0F": [
      "woman_with_veil_tone5",
      "woman_with_veil_dark_skin_tone"
    ],
    "1F470-200D-2642-FE0F": "man_with_veil",
    "1F470-1F3FB-200D-2642-FE0F": [
      "man_with_veil_tone1",
      "man_with_veil_light_skin_tone"
    ],
    "1F470-1F3FC-200D-2642-FE0F": [
      "man_with_veil_tone2",
      "man_with_veil_medium_light_skin_tone"
    ],
    "1F470-1F3FD-200D-2642-FE0F": [
      "man_with_veil_tone3",
      "man_with_veil_medium_skin_tone"
    ],
    "1F470-1F3FE-200D-2642-FE0F": [
      "man_with_veil_tone4",
      "man_with_veil_medium_dark_skin_tone"
    ],
    "1F470-1F3FF-200D-2642-FE0F": [
      "man_with_veil_tone5",
      "man_with_veil_dark_skin_tone"
    ],
    "1F935": "person_in_tuxedo",
    "1F935-1F3FB": [
      "person_in_tuxedo_tone1",
      "tuxedo_tone1"
    ],
    "1F935-1F3FC": [
      "person_in_tuxedo_tone2",
      "tuxedo_tone2"
    ],
    "1F935-1F3FD": [
      "person_in_tuxedo_tone3",
      "tuxedo_tone3"
    ],
    "1F935-1F3FE": [
      "person_in_tuxedo_tone4",
      "tuxedo_tone4"
    ],
    "1F935-1F3FF": [
      "person_in_tuxedo_tone5",
      "tuxedo_tone5"
    ],
    "1F935-200D-2640-FE0F": "woman_in_tuxedo",
    "1F935-1F3FB-200D-2640-FE0F": [
      "woman_in_tuxedo_tone1",
      "woman_in_tuxedo_light_skin_tone"
    ],
    "1F935-1F3FC-200D-2640-FE0F": [
      "woman_in_tuxedo_tone2",
      "woman_in_tuxedo_medium_light_skin_tone"
    ],
    "1F935-1F3FD-200D-2640-FE0F": [
      "woman_in_tuxedo_tone3",
      "woman_in_tuxedo_medium_skin_tone"
    ],
    "1F935-1F3FE-200D-2640-FE0F": [
      "woman_in_tuxedo_tone4",
      "woman_in_tuxedo_medium_dark_skin_tone"
    ],
    "1F935-1F3FF-200D-2640-FE0F": [
      "woman_in_tuxedo_tone5",
      "woman_in_tuxedo_dark_skin_tone"
    ],
    "1F935-200D-2642-FE0F": "man_in_tuxedo",
    "1F935-1F3FB-200D-2642-FE0F": [
      "man_in_tuxedo_tone1",
      "man_in_tuxedo_light_skin_tone"
    ],
    "1F935-1F3FC-200D-2642-FE0F": [
      "man_in_tuxedo_tone2",
      "man_in_tuxedo_medium_light_skin_tone"
    ],
    "1F935-1F3FD-200D-2642-FE0F": [
      "man_in_tuxedo_tone3",
      "man_in_tuxedo_medium_skin_tone"
    ],
    "1F935-1F3FE-200D-2642-FE0F": [
      "man_in_tuxedo_tone4",
      "man_in_tuxedo_medium_dark_skin_tone"
    ],
    "1F935-1F3FF-200D-2642-FE0F": [
      "man_in_tuxedo_tone5",
      "man_in_tuxedo_dark_skin_tone"
    ],
    "1FAC5": "person_with_crown",
    "1FAC5-1F3FB": [
      "person_with_crown_tone1",
      "person_with_crown_light_skin_tone"
    ],
    "1FAC5-1F3FC": [
      "person_with_crown_tone2",
      "person_with_crown_medium_light_skin_tone"
    ],
    "1FAC5-1F3FD": [
      "person_with_crown_tone3",
      "person_with_crown_medium_skin_tone"
    ],
    "1FAC5-1F3FE": [
      "person_with_crown_tone4",
      "person_with_crown_medium_dark_skin_tone"
    ],
    "1FAC5-1F3FF": [
      "person_with_crown_tone5",
      "person_with_crown_dark_skin_tone"
    ],
    "1F478": "princess",
    "1F478-1F3FB": "princess_tone1",
    "1F478-1F3FC": "princess_tone2",
    "1F478-1F3FD": "princess_tone3",
    "1F478-1F3FE": "princess_tone4",
    "1F478-1F3FF": "princess_tone5",
    "1F934": "prince",
    "1F934-1F3FB": "prince_tone1",
    "1F934-1F3FC": "prince_tone2",
    "1F934-1F3FD": "prince_tone3",
    "1F934-1F3FE": "prince_tone4",
    "1F934-1F3FF": "prince_tone5",
    "1F9B8": "superhero",
    "1F9B8-1F3FB": [
      "superhero_tone1",
      "superhero_light_skin_tone"
    ],
    "1F9B8-1F3FC": [
      "superhero_tone2",
      "superhero_medium_light_skin_tone"
    ],
    "1F9B8-1F3FD": [
      "superhero_tone3",
      "superhero_medium_skin_tone"
    ],
    "1F9B8-1F3FE": [
      "superhero_tone4",
      "superhero_medium_dark_skin_tone"
    ],
    "1F9B8-1F3FF": [
      "superhero_tone5",
      "superhero_dark_skin_tone"
    ],
    "1F9B8-200D-2640-FE0F": "woman_superhero",
    "1F9B8-1F3FB-200D-2640-FE0F": [
      "woman_superhero_tone1",
      "woman_superhero_light_skin_tone"
    ],
    "1F9B8-1F3FC-200D-2640-FE0F": [
      "woman_superhero_tone2",
      "woman_superhero_medium_light_skin_tone"
    ],
    "1F9B8-1F3FD-200D-2640-FE0F": [
      "woman_superhero_tone3",
      "woman_superhero_medium_skin_tone"
    ],
    "1F9B8-1F3FE-200D-2640-FE0F": [
      "woman_superhero_tone4",
      "woman_superhero_medium_dark_skin_tone"
    ],
    "1F9B8-1F3FF-200D-2640-FE0F": [
      "woman_superhero_tone5",
      "woman_superhero_dark_skin_tone"
    ],
    "1F9B8-200D-2642-FE0F": "man_superhero",
    "1F9B8-1F3FB-200D-2642-FE0F": [
      "man_superhero_tone1",
      "man_superhero_light_skin_tone"
    ],
    "1F9B8-1F3FC-200D-2642-FE0F": [
      "man_superhero_tone2",
      "man_superhero_medium_light_skin_tone"
    ],
    "1F9B8-1F3FD-200D-2642-FE0F": [
      "man_superhero_tone3",
      "man_superhero_medium_skin_tone"
    ],
    "1F9B8-1F3FE-200D-2642-FE0F": [
      "man_superhero_tone4",
      "man_superhero_medium_dark_skin_tone"
    ],
    "1F9B8-1F3FF-200D-2642-FE0F": [
      "man_superhero_tone5",
      "man_superhero_dark_skin_tone"
    ],
    "1F9B9": "supervillain",
    "1F9B9-1F3FB": [
      "supervillain_tone1",
      "supervillain_light_skin_tone"
    ],
    "1F9B9-1F3FC": [
      "supervillain_tone2",
      "supervillain_medium_light_skin_tone"
    ],
    "1F9B9-1F3FD": [
      "supervillain_tone3",
      "supervillain_medium_skin_tone"
    ],
    "1F9B9-1F3FE": [
      "supervillain_tone4",
      "supervillain_medium_dark_skin_tone"
    ],
    "1F9B9-1F3FF": [
      "supervillain_tone5",
      "supervillain_dark_skin_tone"
    ],
    "1F9B9-200D-2640-FE0F": "woman_supervillain",
    "1F9B9-1F3FB-200D-2640-FE0F": [
      "woman_supervillain_tone1",
      "woman_supervillain_light_skin_tone"
    ],
    "1F9B9-1F3FC-200D-2640-FE0F": [
      "woman_supervillain_tone2",
      "woman_supervillain_medium_light_skin_tone"
    ],
    "1F9B9-1F3FD-200D-2640-FE0F": [
      "woman_supervillain_tone3",
      "woman_supervillain_medium_skin_tone"
    ],
    "1F9B9-1F3FE-200D-2640-FE0F": [
      "woman_supervillain_tone4",
      "woman_supervillain_medium_dark_skin_tone"
    ],
    "1F9B9-1F3FF-200D-2640-FE0F": [
      "woman_supervillain_tone5",
      "woman_supervillain_dark_skin_tone"
    ],
    "1F9B9-200D-2642-FE0F": "man_supervillain",
    "1F9B9-1F3FB-200D-2642-FE0F": [
      "man_supervillain_tone1",
      "man_supervillain_light_skin_tone"
    ],
    "1F9B9-1F3FC-200D-2642-FE0F": [
      "man_supervillain_tone2",
      "man_supervillain_medium_light_skin_tone"
    ],
    "1F9B9-1F3FD-200D-2642-FE0F": [
      "man_supervillain_tone3",
      "man_supervillain_medium_skin_tone"
    ],
    "1F9B9-1F3FE-200D-2642-FE0F": [
      "man_supervillain_tone4",
      "man_supervillain_medium_dark_skin_tone"
    ],
    "1F9B9-1F3FF-200D-2642-FE0F": [
      "man_supervillain_tone5",
      "man_supervillain_dark_skin_tone"
    ],
    "1F977": "ninja",
    "1F977-1F3FB": [
      "ninja_tone1",
      "ninja_light_skin_tone"
    ],
    "1F977-1F3FC": [
      "ninja_tone2",
      "ninja_medium_light_skin_tone"
    ],
    "1F977-1F3FD": [
      "ninja_tone3",
      "ninja_medium_skin_tone"
    ],
    "1F977-1F3FE": [
      "ninja_tone4",
      "ninja_medium_dark_skin_tone"
    ],
    "1F977-1F3FF": [
      "ninja_tone5",
      "ninja_dark_skin_tone"
    ],
    "1F9D1-200D-1F384": "mx_claus",
    "1F9D1-1F3FB-200D-1F384": [
      "mx_claus_tone1",
      "mx_claus_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F384": [
      "mx_claus_tone2",
      "mx_claus_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F384": [
      "mx_claus_tone3",
      "mx_claus_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F384": [
      "mx_claus_tone4",
      "mx_claus_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F384": [
      "mx_claus_tone5",
      "mx_claus_dark_skin_tone"
    ],
    "1F936": [
      "mrs_claus",
      "mother_christmas"
    ],
    "1F936-1F3FB": [
      "mrs_claus_tone1",
      "mother_christmas_tone1"
    ],
    "1F936-1F3FC": [
      "mrs_claus_tone2",
      "mother_christmas_tone2"
    ],
    "1F936-1F3FD": [
      "mrs_claus_tone3",
      "mother_christmas_tone3"
    ],
    "1F936-1F3FE": [
      "mrs_claus_tone4",
      "mother_christmas_tone4"
    ],
    "1F936-1F3FF": [
      "mrs_claus_tone5",
      "mother_christmas_tone5"
    ],
    "1F385": [
      "santa",
      "santa_claus"
    ],
    "1F385-1F3FB": "santa_tone1",
    "1F385-1F3FC": "santa_tone2",
    "1F385-1F3FD": "santa_tone3",
    "1F385-1F3FE": "santa_tone4",
    "1F385-1F3FF": "santa_tone5",
    "1F9D9": "mage",
    "1F9D9-1F3FB": [
      "mage_tone1",
      "mage_light_skin_tone"
    ],
    "1F9D9-1F3FC": [
      "mage_tone2",
      "mage_medium_light_skin_tone"
    ],
    "1F9D9-1F3FD": [
      "mage_tone3",
      "mage_medium_skin_tone"
    ],
    "1F9D9-1F3FE": [
      "mage_tone4",
      "mage_medium_dark_skin_tone"
    ],
    "1F9D9-1F3FF": [
      "mage_tone5",
      "mage_dark_skin_tone"
    ],
    "1F9D9-200D-2640-FE0F": "woman_mage",
    "1F9D9-1F3FB-200D-2640-FE0F": [
      "woman_mage_tone1",
      "woman_mage_light_skin_tone"
    ],
    "1F9D9-1F3FC-200D-2640-FE0F": [
      "woman_mage_tone2",
      "woman_mage_medium_light_skin_tone"
    ],
    "1F9D9-1F3FD-200D-2640-FE0F": [
      "woman_mage_tone3",
      "woman_mage_medium_skin_tone"
    ],
    "1F9D9-1F3FE-200D-2640-FE0F": [
      "woman_mage_tone4",
      "woman_mage_medium_dark_skin_tone"
    ],
    "1F9D9-1F3FF-200D-2640-FE0F": [
      "woman_mage_tone5",
      "woman_mage_dark_skin_tone"
    ],
    "1F9D9-200D-2642-FE0F": "man_mage",
    "1F9D9-1F3FB-200D-2642-FE0F": [
      "man_mage_tone1",
      "man_mage_light_skin_tone"
    ],
    "1F9D9-1F3FC-200D-2642-FE0F": [
      "man_mage_tone2",
      "man_mage_medium_light_skin_tone"
    ],
    "1F9D9-1F3FD-200D-2642-FE0F": [
      "man_mage_tone3",
      "man_mage_medium_skin_tone"
    ],
    "1F9D9-1F3FE-200D-2642-FE0F": [
      "man_mage_tone4",
      "man_mage_medium_dark_skin_tone"
    ],
    "1F9D9-1F3FF-200D-2642-FE0F": [
      "man_mage_tone5",
      "man_mage_dark_skin_tone"
    ],
    "1F9DD": "elf",
    "1F9DD-1F3FB": [
      "elf_tone1",
      "elf_light_skin_tone"
    ],
    "1F9DD-1F3FC": [
      "elf_tone2",
      "elf_medium_light_skin_tone"
    ],
    "1F9DD-1F3FD": [
      "elf_tone3",
      "elf_medium_skin_tone"
    ],
    "1F9DD-1F3FE": [
      "elf_tone4",
      "elf_medium_dark_skin_tone"
    ],
    "1F9DD-1F3FF": [
      "elf_tone5",
      "elf_dark_skin_tone"
    ],
    "1F9DD-200D-2640-FE0F": "woman_elf",
    "1F9DD-1F3FB-200D-2640-FE0F": [
      "woman_elf_tone1",
      "woman_elf_light_skin_tone"
    ],
    "1F9DD-1F3FC-200D-2640-FE0F": [
      "woman_elf_tone2",
      "woman_elf_medium_light_skin_tone"
    ],
    "1F9DD-1F3FD-200D-2640-FE0F": [
      "woman_elf_tone3",
      "woman_elf_medium_skin_tone"
    ],
    "1F9DD-1F3FE-200D-2640-FE0F": [
      "woman_elf_tone4",
      "woman_elf_medium_dark_skin_tone"
    ],
    "1F9DD-1F3FF-200D-2640-FE0F": [
      "woman_elf_tone5",
      "woman_elf_dark_skin_tone"
    ],
    "1F9DD-200D-2642-FE0F": "man_elf",
    "1F9DD-1F3FB-200D-2642-FE0F": [
      "man_elf_tone1",
      "man_elf_light_skin_tone"
    ],
    "1F9DD-1F3FC-200D-2642-FE0F": [
      "man_elf_tone2",
      "man_elf_medium_light_skin_tone"
    ],
    "1F9DD-1F3FD-200D-2642-FE0F": [
      "man_elf_tone3",
      "man_elf_medium_skin_tone"
    ],
    "1F9DD-1F3FE-200D-2642-FE0F": [
      "man_elf_tone4",
      "man_elf_medium_dark_skin_tone"
    ],
    "1F9DD-1F3FF-200D-2642-FE0F": [
      "man_elf_tone5",
      "man_elf_dark_skin_tone"
    ],
    "1F9CC": "troll",
    "1F9DB": "vampire",
    "1F9DB-1F3FB": [
      "vampire_tone1",
      "vampire_light_skin_tone"
    ],
    "1F9DB-1F3FC": [
      "vampire_tone2",
      "vampire_medium_light_skin_tone"
    ],
    "1F9DB-1F3FD": [
      "vampire_tone3",
      "vampire_medium_skin_tone"
    ],
    "1F9DB-1F3FE": [
      "vampire_tone4",
      "vampire_medium_dark_skin_tone"
    ],
    "1F9DB-1F3FF": [
      "vampire_tone5",
      "vampire_dark_skin_tone"
    ],
    "1F9DB-200D-2640-FE0F": "woman_vampire",
    "1F9DB-1F3FB-200D-2640-FE0F": [
      "woman_vampire_tone1",
      "woman_vampire_light_skin_tone"
    ],
    "1F9DB-1F3FC-200D-2640-FE0F": [
      "woman_vampire_tone2",
      "woman_vampire_medium_light_skin_tone"
    ],
    "1F9DB-1F3FD-200D-2640-FE0F": [
      "woman_vampire_tone3",
      "woman_vampire_medium_skin_tone"
    ],
    "1F9DB-1F3FE-200D-2640-FE0F": [
      "woman_vampire_tone4",
      "woman_vampire_medium_dark_skin_tone"
    ],
    "1F9DB-1F3FF-200D-2640-FE0F": [
      "woman_vampire_tone5",
      "woman_vampire_dark_skin_tone"
    ],
    "1F9DB-200D-2642-FE0F": "man_vampire",
    "1F9DB-1F3FB-200D-2642-FE0F": [
      "man_vampire_tone1",
      "man_vampire_light_skin_tone"
    ],
    "1F9DB-1F3FC-200D-2642-FE0F": [
      "man_vampire_tone2",
      "man_vampire_medium_light_skin_tone"
    ],
    "1F9DB-1F3FD-200D-2642-FE0F": [
      "man_vampire_tone3",
      "man_vampire_medium_skin_tone"
    ],
    "1F9DB-1F3FE-200D-2642-FE0F": [
      "man_vampire_tone4",
      "man_vampire_medium_dark_skin_tone"
    ],
    "1F9DB-1F3FF-200D-2642-FE0F": [
      "man_vampire_tone5",
      "man_vampire_dark_skin_tone"
    ],
    "1F9DF": "zombie",
    "1F9DF-200D-2640-FE0F": "woman_zombie",
    "1F9DF-200D-2642-FE0F": "man_zombie",
    "1F9DE": "genie",
    "1F9DE-200D-2640-FE0F": "woman_genie",
    "1F9DE-200D-2642-FE0F": "man_genie",
    "1F9DC": "merperson",
    "1F9DC-1F3FB": [
      "merperson_tone1",
      "merperson_light_skin_tone"
    ],
    "1F9DC-1F3FC": [
      "merperson_tone2",
      "merperson_medium_light_skin_tone"
    ],
    "1F9DC-1F3FD": [
      "merperson_tone3",
      "merperson_medium_skin_tone"
    ],
    "1F9DC-1F3FE": [
      "merperson_tone4",
      "merperson_medium_dark_skin_tone"
    ],
    "1F9DC-1F3FF": [
      "merperson_tone5",
      "merperson_dark_skin_tone"
    ],
    "1F9DC-200D-2640-FE0F": "mermaid",
    "1F9DC-1F3FB-200D-2640-FE0F": [
      "mermaid_tone1",
      "mermaid_light_skin_tone"
    ],
    "1F9DC-1F3FC-200D-2640-FE0F": [
      "mermaid_tone2",
      "mermaid_medium_light_skin_tone"
    ],
    "1F9DC-1F3FD-200D-2640-FE0F": [
      "mermaid_tone3",
      "mermaid_medium_skin_tone"
    ],
    "1F9DC-1F3FE-200D-2640-FE0F": [
      "mermaid_tone4",
      "mermaid_medium_dark_skin_tone"
    ],
    "1F9DC-1F3FF-200D-2640-FE0F": [
      "mermaid_tone5",
      "mermaid_dark_skin_tone"
    ],
    "1F9DC-200D-2642-FE0F": "merman",
    "1F9DC-1F3FB-200D-2642-FE0F": [
      "merman_tone1",
      "merman_light_skin_tone"
    ],
    "1F9DC-1F3FC-200D-2642-FE0F": [
      "merman_tone2",
      "merman_medium_light_skin_tone"
    ],
    "1F9DC-1F3FD-200D-2642-FE0F": [
      "merman_tone3",
      "merman_medium_skin_tone"
    ],
    "1F9DC-1F3FE-200D-2642-FE0F": [
      "merman_tone4",
      "merman_medium_dark_skin_tone"
    ],
    "1F9DC-1F3FF-200D-2642-FE0F": [
      "merman_tone5",
      "merman_dark_skin_tone"
    ],
    "1F9DA": "fairy",
    "1F9DA-1F3FB": [
      "fairy_tone1",
      "fairy_light_skin_tone"
    ],
    "1F9DA-1F3FC": [
      "fairy_tone2",
      "fairy_medium_light_skin_tone"
    ],
    "1F9DA-1F3FD": [
      "fairy_tone3",
      "fairy_medium_skin_tone"
    ],
    "1F9DA-1F3FE": [
      "fairy_tone4",
      "fairy_medium_dark_skin_tone"
    ],
    "1F9DA-1F3FF": [
      "fairy_tone5",
      "fairy_dark_skin_tone"
    ],
    "1F9DA-200D-2640-FE0F": "woman_fairy",
    "1F9DA-1F3FB-200D-2640-FE0F": [
      "woman_fairy_tone1",
      "woman_fairy_light_skin_tone"
    ],
    "1F9DA-1F3FC-200D-2640-FE0F": [
      "woman_fairy_tone2",
      "woman_fairy_medium_light_skin_tone"
    ],
    "1F9DA-1F3FD-200D-2640-FE0F": [
      "woman_fairy_tone3",
      "woman_fairy_medium_skin_tone"
    ],
    "1F9DA-1F3FE-200D-2640-FE0F": [
      "woman_fairy_tone4",
      "woman_fairy_medium_dark_skin_tone"
    ],
    "1F9DA-1F3FF-200D-2640-FE0F": [
      "woman_fairy_tone5",
      "woman_fairy_dark_skin_tone"
    ],
    "1F9DA-200D-2642-FE0F": "man_fairy",
    "1F9DA-1F3FB-200D-2642-FE0F": [
      "man_fairy_tone1",
      "man_fairy_light_skin_tone"
    ],
    "1F9DA-1F3FC-200D-2642-FE0F": [
      "man_fairy_tone2",
      "man_fairy_medium_light_skin_tone"
    ],
    "1F9DA-1F3FD-200D-2642-FE0F": [
      "man_fairy_tone3",
      "man_fairy_medium_skin_tone"
    ],
    "1F9DA-1F3FE-200D-2642-FE0F": [
      "man_fairy_tone4",
      "man_fairy_medium_dark_skin_tone"
    ],
    "1F9DA-1F3FF-200D-2642-FE0F": [
      "man_fairy_tone5",
      "man_fairy_dark_skin_tone"
    ],
    "1F47C": [
      "angel",
      "baby_angel"
    ],
    "1F47C-1F3FB": "angel_tone1",
    "1F47C-1F3FC": "angel_tone2",
    "1F47C-1F3FD": "angel_tone3",
    "1F47C-1F3FE": "angel_tone4",
    "1F47C-1F3FF": "angel_tone5",
    "1FAC4": "pregnant_person",
    "1FAC4-1F3FB": [
      "pregnant_person_tone1",
      "pregnant_person_light_skin_tone"
    ],
    "1FAC4-1F3FC": [
      "pregnant_person_tone2",
      "pregnant_person_medium_light_skin_tone"
    ],
    "1FAC4-1F3FD": [
      "pregnant_person_tone3",
      "pregnant_person_medium_skin_tone"
    ],
    "1FAC4-1F3FE": [
      "pregnant_person_tone4",
      "pregnant_person_medium_dark_skin_tone"
    ],
    "1FAC4-1F3FF": [
      "pregnant_person_tone5",
      "pregnant_person_dark_skin_tone"
    ],
    "1F930": [
      "pregnant_woman",
      "expecting_woman"
    ],
    "1F930-1F3FB": [
      "pregnant_woman_tone1",
      "expecting_woman_tone1"
    ],
    "1F930-1F3FC": [
      "pregnant_woman_tone2",
      "expecting_woman_tone2"
    ],
    "1F930-1F3FD": [
      "pregnant_woman_tone3",
      "expecting_woman_tone3"
    ],
    "1F930-1F3FE": [
      "pregnant_woman_tone4",
      "expecting_woman_tone4"
    ],
    "1F930-1F3FF": [
      "pregnant_woman_tone5",
      "expecting_woman_tone5"
    ],
    "1FAC3": "pregnant_man",
    "1FAC3-1F3FB": [
      "pregnant_man_tone1",
      "pregnant_man_light_skin_tone"
    ],
    "1FAC3-1F3FC": [
      "pregnant_man_tone2",
      "pregnant_man_medium_light_skin_tone"
    ],
    "1FAC3-1F3FD": [
      "pregnant_man_tone3",
      "pregnant_man_medium_skin_tone"
    ],
    "1FAC3-1F3FE": [
      "pregnant_man_tone4",
      "pregnant_man_medium_dark_skin_tone"
    ],
    "1FAC3-1F3FF": [
      "pregnant_man_tone5",
      "pregnant_man_dark_skin_tone"
    ],
    "1F931": "breast_feeding",
    "1F931-1F3FB": [
      "breast_feeding_tone1",
      "breast_feeding_light_skin_tone"
    ],
    "1F931-1F3FC": [
      "breast_feeding_tone2",
      "breast_feeding_medium_light_skin_tone"
    ],
    "1F931-1F3FD": [
      "breast_feeding_tone3",
      "breast_feeding_medium_skin_tone"
    ],
    "1F931-1F3FE": [
      "breast_feeding_tone4",
      "breast_feeding_medium_dark_skin_tone"
    ],
    "1F931-1F3FF": [
      "breast_feeding_tone5",
      "breast_feeding_dark_skin_tone"
    ],
    "1F9D1-200D-1F37C": "person_feeding_baby",
    "1F9D1-1F3FB-200D-1F37C": [
      "person_feeding_baby_tone1",
      "person_feeding_baby_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F37C": [
      "person_feeding_baby_tone2",
      "person_feeding_baby_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F37C": [
      "person_feeding_baby_tone3",
      "person_feeding_baby_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F37C": [
      "person_feeding_baby_tone4",
      "person_feeding_baby_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F37C": [
      "person_feeding_baby_tone5",
      "person_feeding_baby_dark_skin_tone"
    ],
    "1F469-200D-1F37C": "woman_feeding_baby",
    "1F469-1F3FB-200D-1F37C": [
      "woman_feeding_baby_tone1",
      "woman_feeding_baby_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F37C": [
      "woman_feeding_baby_tone2",
      "woman_feeding_baby_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F37C": [
      "woman_feeding_baby_tone3",
      "woman_feeding_baby_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F37C": [
      "woman_feeding_baby_tone4",
      "woman_feeding_baby_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F37C": [
      "woman_feeding_baby_tone5",
      "woman_feeding_baby_dark_skin_tone"
    ],
    "1F468-200D-1F37C": "man_feeding_baby",
    "1F468-1F3FB-200D-1F37C": [
      "man_feeding_baby_tone1",
      "man_feeding_baby_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F37C": [
      "man_feeding_baby_tone2",
      "man_feeding_baby_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F37C": [
      "man_feeding_baby_tone3",
      "man_feeding_baby_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F37C": [
      "man_feeding_baby_tone4",
      "man_feeding_baby_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F37C": [
      "man_feeding_baby_tone5",
      "man_feeding_baby_dark_skin_tone"
    ],
    "1F647": [
      "person_bowing",
      "bow"
    ],
    "1F647-1F3FB": [
      "person_bowing_tone1",
      "bow_tone1"
    ],
    "1F647-1F3FC": [
      "person_bowing_tone2",
      "bow_tone2"
    ],
    "1F647-1F3FD": [
      "person_bowing_tone3",
      "bow_tone3"
    ],
    "1F647-1F3FE": [
      "person_bowing_tone4",
      "bow_tone4"
    ],
    "1F647-1F3FF": [
      "person_bowing_tone5",
      "bow_tone5"
    ],
    "1F647-200D-2640-FE0F": "woman_bowing",
    "1F647-1F3FB-200D-2640-FE0F": [
      "woman_bowing_tone1",
      "woman_bowing_light_skin_tone"
    ],
    "1F647-1F3FC-200D-2640-FE0F": [
      "woman_bowing_tone2",
      "woman_bowing_medium_light_skin_tone"
    ],
    "1F647-1F3FD-200D-2640-FE0F": [
      "woman_bowing_tone3",
      "woman_bowing_medium_skin_tone"
    ],
    "1F647-1F3FE-200D-2640-FE0F": [
      "woman_bowing_tone4",
      "woman_bowing_medium_dark_skin_tone"
    ],
    "1F647-1F3FF-200D-2640-FE0F": [
      "woman_bowing_tone5",
      "woman_bowing_dark_skin_tone"
    ],
    "1F647-200D-2642-FE0F": "man_bowing",
    "1F647-1F3FB-200D-2642-FE0F": [
      "man_bowing_tone1",
      "man_bowing_light_skin_tone"
    ],
    "1F647-1F3FC-200D-2642-FE0F": [
      "man_bowing_tone2",
      "man_bowing_medium_light_skin_tone"
    ],
    "1F647-1F3FD-200D-2642-FE0F": [
      "man_bowing_tone3",
      "man_bowing_medium_skin_tone"
    ],
    "1F647-1F3FE-200D-2642-FE0F": [
      "man_bowing_tone4",
      "man_bowing_medium_dark_skin_tone"
    ],
    "1F647-1F3FF-200D-2642-FE0F": [
      "man_bowing_tone5",
      "man_bowing_dark_skin_tone"
    ],
    "1F481": [
      "person_tipping_hand",
      "information_desk_person"
    ],
    "1F481-1F3FB": [
      "person_tipping_hand_tone1",
      "information_desk_person_tone1"
    ],
    "1F481-1F3FC": [
      "person_tipping_hand_tone2",
      "information_desk_person_tone2"
    ],
    "1F481-1F3FD": [
      "person_tipping_hand_tone3",
      "information_desk_person_tone3"
    ],
    "1F481-1F3FE": [
      "person_tipping_hand_tone4",
      "information_desk_person_tone4"
    ],
    "1F481-1F3FF": [
      "person_tipping_hand_tone5",
      "information_desk_person_tone5"
    ],
    "1F481-200D-2640-FE0F": "woman_tipping_hand",
    "1F481-1F3FB-200D-2640-FE0F": [
      "woman_tipping_hand_tone1",
      "woman_tipping_hand_light_skin_tone"
    ],
    "1F481-1F3FC-200D-2640-FE0F": [
      "woman_tipping_hand_tone2",
      "woman_tipping_hand_medium_light_skin_tone"
    ],
    "1F481-1F3FD-200D-2640-FE0F": [
      "woman_tipping_hand_tone3",
      "woman_tipping_hand_medium_skin_tone"
    ],
    "1F481-1F3FE-200D-2640-FE0F": [
      "woman_tipping_hand_tone4",
      "woman_tipping_hand_medium_dark_skin_tone"
    ],
    "1F481-1F3FF-200D-2640-FE0F": [
      "woman_tipping_hand_tone5",
      "woman_tipping_hand_dark_skin_tone"
    ],
    "1F481-200D-2642-FE0F": "man_tipping_hand",
    "1F481-1F3FB-200D-2642-FE0F": [
      "man_tipping_hand_tone1",
      "man_tipping_hand_light_skin_tone"
    ],
    "1F481-1F3FC-200D-2642-FE0F": [
      "man_tipping_hand_tone2",
      "man_tipping_hand_medium_light_skin_tone"
    ],
    "1F481-1F3FD-200D-2642-FE0F": [
      "man_tipping_hand_tone3",
      "man_tipping_hand_medium_skin_tone"
    ],
    "1F481-1F3FE-200D-2642-FE0F": [
      "man_tipping_hand_tone4",
      "man_tipping_hand_medium_dark_skin_tone"
    ],
    "1F481-1F3FF-200D-2642-FE0F": [
      "man_tipping_hand_tone5",
      "man_tipping_hand_dark_skin_tone"
    ],
    "1F645": [
      "person_gesturing_no",
      "no_good"
    ],
    "1F645-1F3FB": [
      "person_gesturing_no_tone1",
      "no_good_tone1"
    ],
    "1F645-1F3FC": [
      "person_gesturing_no_tone2",
      "no_good_tone2"
    ],
    "1F645-1F3FD": [
      "person_gesturing_no_tone3",
      "no_good_tone3"
    ],
    "1F645-1F3FE": [
      "person_gesturing_no_tone4",
      "no_good_tone4"
    ],
    "1F645-1F3FF": [
      "person_gesturing_no_tone5",
      "no_good_tone5"
    ],
    "1F645-200D-2640-FE0F": "woman_gesturing_no",
    "1F645-1F3FB-200D-2640-FE0F": [
      "woman_gesturing_no_tone1",
      "woman_gesturing_no_light_skin_tone"
    ],
    "1F645-1F3FC-200D-2640-FE0F": [
      "woman_gesturing_no_tone2",
      "woman_gesturing_no_medium_light_skin_tone"
    ],
    "1F645-1F3FD-200D-2640-FE0F": [
      "woman_gesturing_no_tone3",
      "woman_gesturing_no_medium_skin_tone"
    ],
    "1F645-1F3FE-200D-2640-FE0F": [
      "woman_gesturing_no_tone4",
      "woman_gesturing_no_medium_dark_skin_tone"
    ],
    "1F645-1F3FF-200D-2640-FE0F": [
      "woman_gesturing_no_tone5",
      "woman_gesturing_no_dark_skin_tone"
    ],
    "1F645-200D-2642-FE0F": "man_gesturing_no",
    "1F645-1F3FB-200D-2642-FE0F": [
      "man_gesturing_no_tone1",
      "man_gesturing_no_light_skin_tone"
    ],
    "1F645-1F3FC-200D-2642-FE0F": [
      "man_gesturing_no_tone2",
      "man_gesturing_no_medium_light_skin_tone"
    ],
    "1F645-1F3FD-200D-2642-FE0F": [
      "man_gesturing_no_tone3",
      "man_gesturing_no_medium_skin_tone"
    ],
    "1F645-1F3FE-200D-2642-FE0F": [
      "man_gesturing_no_tone4",
      "man_gesturing_no_medium_dark_skin_tone"
    ],
    "1F645-1F3FF-200D-2642-FE0F": [
      "man_gesturing_no_tone5",
      "man_gesturing_no_dark_skin_tone"
    ],
    "1F646": [
      "person_gesturing_ok",
      "ok_woman"
    ],
    "1F646-1F3FB": [
      "person_gesturing_ok_tone1",
      "ok_woman_tone1"
    ],
    "1F646-1F3FC": [
      "person_gesturing_ok_tone2",
      "ok_woman_tone2"
    ],
    "1F646-1F3FD": [
      "person_gesturing_ok_tone3",
      "ok_woman_tone3"
    ],
    "1F646-1F3FE": [
      "person_gesturing_ok_tone4",
      "ok_woman_tone4"
    ],
    "1F646-1F3FF": [
      "person_gesturing_ok_tone5",
      "ok_woman_tone5"
    ],
    "1F646-200D-2640-FE0F": "woman_gesturing_ok",
    "1F646-1F3FB-200D-2640-FE0F": [
      "woman_gesturing_ok_tone1",
      "woman_gesturing_ok_light_skin_tone"
    ],
    "1F646-1F3FC-200D-2640-FE0F": [
      "woman_gesturing_ok_tone2",
      "woman_gesturing_ok_medium_light_skin_tone"
    ],
    "1F646-1F3FD-200D-2640-FE0F": [
      "woman_gesturing_ok_tone3",
      "woman_gesturing_ok_medium_skin_tone"
    ],
    "1F646-1F3FE-200D-2640-FE0F": [
      "woman_gesturing_ok_tone4",
      "woman_gesturing_ok_medium_dark_skin_tone"
    ],
    "1F646-1F3FF-200D-2640-FE0F": [
      "woman_gesturing_ok_tone5",
      "woman_gesturing_ok_dark_skin_tone"
    ],
    "1F646-200D-2642-FE0F": "man_gesturing_ok",
    "1F646-1F3FB-200D-2642-FE0F": [
      "man_gesturing_ok_tone1",
      "man_gesturing_ok_light_skin_tone"
    ],
    "1F646-1F3FC-200D-2642-FE0F": [
      "man_gesturing_ok_tone2",
      "man_gesturing_ok_medium_light_skin_tone"
    ],
    "1F646-1F3FD-200D-2642-FE0F": [
      "man_gesturing_ok_tone3",
      "man_gesturing_ok_medium_skin_tone"
    ],
    "1F646-1F3FE-200D-2642-FE0F": [
      "man_gesturing_ok_tone4",
      "man_gesturing_ok_medium_dark_skin_tone"
    ],
    "1F646-1F3FF-200D-2642-FE0F": [
      "man_gesturing_ok_tone5",
      "man_gesturing_ok_dark_skin_tone"
    ],
    "1F64B": [
      "person_raising_hand",
      "raising_hand"
    ],
    "1F64B-1F3FB": [
      "person_raising_hand_tone1",
      "raising_hand_tone1"
    ],
    "1F64B-1F3FC": [
      "person_raising_hand_tone2",
      "raising_hand_tone2"
    ],
    "1F64B-1F3FD": [
      "person_raising_hand_tone3",
      "raising_hand_tone3"
    ],
    "1F64B-1F3FE": [
      "person_raising_hand_tone4",
      "raising_hand_tone4"
    ],
    "1F64B-1F3FF": [
      "person_raising_hand_tone5",
      "raising_hand_tone5"
    ],
    "1F64B-200D-2640-FE0F": "woman_raising_hand",
    "1F64B-1F3FB-200D-2640-FE0F": [
      "woman_raising_hand_tone1",
      "woman_raising_hand_light_skin_tone"
    ],
    "1F64B-1F3FC-200D-2640-FE0F": [
      "woman_raising_hand_tone2",
      "woman_raising_hand_medium_light_skin_tone"
    ],
    "1F64B-1F3FD-200D-2640-FE0F": [
      "woman_raising_hand_tone3",
      "woman_raising_hand_medium_skin_tone"
    ],
    "1F64B-1F3FE-200D-2640-FE0F": [
      "woman_raising_hand_tone4",
      "woman_raising_hand_medium_dark_skin_tone"
    ],
    "1F64B-1F3FF-200D-2640-FE0F": [
      "woman_raising_hand_tone5",
      "woman_raising_hand_dark_skin_tone"
    ],
    "1F64B-200D-2642-FE0F": "man_raising_hand",
    "1F64B-1F3FB-200D-2642-FE0F": [
      "man_raising_hand_tone1",
      "man_raising_hand_light_skin_tone"
    ],
    "1F64B-1F3FC-200D-2642-FE0F": [
      "man_raising_hand_tone2",
      "man_raising_hand_medium_light_skin_tone"
    ],
    "1F64B-1F3FD-200D-2642-FE0F": [
      "man_raising_hand_tone3",
      "man_raising_hand_medium_skin_tone"
    ],
    "1F64B-1F3FE-200D-2642-FE0F": [
      "man_raising_hand_tone4",
      "man_raising_hand_medium_dark_skin_tone"
    ],
    "1F64B-1F3FF-200D-2642-FE0F": [
      "man_raising_hand_tone5",
      "man_raising_hand_dark_skin_tone"
    ],
    "1F9CF": "deaf_person",
    "1F9CF-1F3FB": [
      "deaf_person_tone1",
      "deaf_person_light_skin_tone"
    ],
    "1F9CF-1F3FC": [
      "deaf_person_tone2",
      "deaf_person_medium_light_skin_tone"
    ],
    "1F9CF-1F3FD": [
      "deaf_person_tone3",
      "deaf_person_medium_skin_tone"
    ],
    "1F9CF-1F3FE": [
      "deaf_person_tone4",
      "deaf_person_medium_dark_skin_tone"
    ],
    "1F9CF-1F3FF": [
      "deaf_person_tone5",
      "deaf_person_dark_skin_tone"
    ],
    "1F9CF-200D-2640-FE0F": "deaf_woman",
    "1F9CF-1F3FB-200D-2640-FE0F": [
      "deaf_woman_tone1",
      "deaf_woman_light_skin_tone"
    ],
    "1F9CF-1F3FC-200D-2640-FE0F": [
      "deaf_woman_tone2",
      "deaf_woman_medium_light_skin_tone"
    ],
    "1F9CF-1F3FD-200D-2640-FE0F": [
      "deaf_woman_tone3",
      "deaf_woman_medium_skin_tone"
    ],
    "1F9CF-1F3FE-200D-2640-FE0F": [
      "deaf_woman_tone4",
      "deaf_woman_medium_dark_skin_tone"
    ],
    "1F9CF-1F3FF-200D-2640-FE0F": [
      "deaf_woman_tone5",
      "deaf_woman_dark_skin_tone"
    ],
    "1F9CF-200D-2642-FE0F": "deaf_man",
    "1F9CF-1F3FB-200D-2642-FE0F": [
      "deaf_man_tone1",
      "deaf_man_light_skin_tone"
    ],
    "1F9CF-1F3FC-200D-2642-FE0F": [
      "deaf_man_tone2",
      "deaf_man_medium_light_skin_tone"
    ],
    "1F9CF-1F3FD-200D-2642-FE0F": [
      "deaf_man_tone3",
      "deaf_man_medium_skin_tone"
    ],
    "1F9CF-1F3FE-200D-2642-FE0F": [
      "deaf_man_tone4",
      "deaf_man_medium_dark_skin_tone"
    ],
    "1F9CF-1F3FF-200D-2642-FE0F": [
      "deaf_man_tone5",
      "deaf_man_dark_skin_tone"
    ],
    "1F926": [
      "person_facepalming",
      "face_palm",
      "facepalm"
    ],
    "1F926-1F3FB": [
      "person_facepalming_tone1",
      "face_palm_tone1",
      "facepalm_tone1"
    ],
    "1F926-1F3FC": [
      "person_facepalming_tone2",
      "face_palm_tone2",
      "facepalm_tone2"
    ],
    "1F926-1F3FD": [
      "person_facepalming_tone3",
      "face_palm_tone3",
      "facepalm_tone3"
    ],
    "1F926-1F3FE": [
      "person_facepalming_tone4",
      "face_palm_tone4",
      "facepalm_tone4"
    ],
    "1F926-1F3FF": [
      "person_facepalming_tone5",
      "face_palm_tone5",
      "facepalm_tone5"
    ],
    "1F926-200D-2640-FE0F": "woman_facepalming",
    "1F926-1F3FB-200D-2640-FE0F": [
      "woman_facepalming_tone1",
      "woman_facepalming_light_skin_tone"
    ],
    "1F926-1F3FC-200D-2640-FE0F": [
      "woman_facepalming_tone2",
      "woman_facepalming_medium_light_skin_tone"
    ],
    "1F926-1F3FD-200D-2640-FE0F": [
      "woman_facepalming_tone3",
      "woman_facepalming_medium_skin_tone"
    ],
    "1F926-1F3FE-200D-2640-FE0F": [
      "woman_facepalming_tone4",
      "woman_facepalming_medium_dark_skin_tone"
    ],
    "1F926-1F3FF-200D-2640-FE0F": [
      "woman_facepalming_tone5",
      "woman_facepalming_dark_skin_tone"
    ],
    "1F926-200D-2642-FE0F": "man_facepalming",
    "1F926-1F3FB-200D-2642-FE0F": [
      "man_facepalming_tone1",
      "man_facepalming_light_skin_tone"
    ],
    "1F926-1F3FC-200D-2642-FE0F": [
      "man_facepalming_tone2",
      "man_facepalming_medium_light_skin_tone"
    ],
    "1F926-1F3FD-200D-2642-FE0F": [
      "man_facepalming_tone3",
      "man_facepalming_medium_skin_tone"
    ],
    "1F926-1F3FE-200D-2642-FE0F": [
      "man_facepalming_tone4",
      "man_facepalming_medium_dark_skin_tone"
    ],
    "1F926-1F3FF-200D-2642-FE0F": [
      "man_facepalming_tone5",
      "man_facepalming_dark_skin_tone"
    ],
    "1F937": [
      "person_shrugging",
      "shrug"
    ],
    "1F937-1F3FB": [
      "person_shrugging_tone1",
      "shrug_tone1"
    ],
    "1F937-1F3FC": [
      "person_shrugging_tone2",
      "shrug_tone2"
    ],
    "1F937-1F3FD": [
      "person_shrugging_tone3",
      "shrug_tone3"
    ],
    "1F937-1F3FE": [
      "person_shrugging_tone4",
      "shrug_tone4"
    ],
    "1F937-1F3FF": [
      "person_shrugging_tone5",
      "shrug_tone5"
    ],
    "1F937-200D-2640-FE0F": "woman_shrugging",
    "1F937-1F3FB-200D-2640-FE0F": [
      "woman_shrugging_tone1",
      "woman_shrugging_light_skin_tone"
    ],
    "1F937-1F3FC-200D-2640-FE0F": [
      "woman_shrugging_tone2",
      "woman_shrugging_medium_light_skin_tone"
    ],
    "1F937-1F3FD-200D-2640-FE0F": [
      "woman_shrugging_tone3",
      "woman_shrugging_medium_skin_tone"
    ],
    "1F937-1F3FE-200D-2640-FE0F": [
      "woman_shrugging_tone4",
      "woman_shrugging_medium_dark_skin_tone"
    ],
    "1F937-1F3FF-200D-2640-FE0F": [
      "woman_shrugging_tone5",
      "woman_shrugging_dark_skin_tone"
    ],
    "1F937-200D-2642-FE0F": "man_shrugging",
    "1F937-1F3FB-200D-2642-FE0F": [
      "man_shrugging_tone1",
      "man_shrugging_light_skin_tone"
    ],
    "1F937-1F3FC-200D-2642-FE0F": [
      "man_shrugging_tone2",
      "man_shrugging_medium_light_skin_tone"
    ],
    "1F937-1F3FD-200D-2642-FE0F": [
      "man_shrugging_tone3",
      "man_shrugging_medium_skin_tone"
    ],
    "1F937-1F3FE-200D-2642-FE0F": [
      "man_shrugging_tone4",
      "man_shrugging_medium_dark_skin_tone"
    ],
    "1F937-1F3FF-200D-2642-FE0F": [
      "man_shrugging_tone5",
      "man_shrugging_dark_skin_tone"
    ],
    "1F64E": [
      "person_pouting",
      "person_with_pouting_face"
    ],
    "1F64E-1F3FB": [
      "person_pouting_tone1",
      "person_with_pouting_face_tone1"
    ],
    "1F64E-1F3FC": [
      "person_pouting_tone2",
      "person_with_pouting_face_tone2"
    ],
    "1F64E-1F3FD": [
      "person_pouting_tone3",
      "person_with_pouting_face_tone3"
    ],
    "1F64E-1F3FE": [
      "person_pouting_tone4",
      "person_with_pouting_face_tone4"
    ],
    "1F64E-1F3FF": [
      "person_pouting_tone5",
      "person_with_pouting_face_tone5"
    ],
    "1F64E-200D-2640-FE0F": "woman_pouting",
    "1F64E-1F3FB-200D-2640-FE0F": [
      "woman_pouting_tone1",
      "woman_pouting_light_skin_tone"
    ],
    "1F64E-1F3FC-200D-2640-FE0F": [
      "woman_pouting_tone2",
      "woman_pouting_medium_light_skin_tone"
    ],
    "1F64E-1F3FD-200D-2640-FE0F": [
      "woman_pouting_tone3",
      "woman_pouting_medium_skin_tone"
    ],
    "1F64E-1F3FE-200D-2640-FE0F": [
      "woman_pouting_tone4",
      "woman_pouting_medium_dark_skin_tone"
    ],
    "1F64E-1F3FF-200D-2640-FE0F": [
      "woman_pouting_tone5",
      "woman_pouting_dark_skin_tone"
    ],
    "1F64E-200D-2642-FE0F": "man_pouting",
    "1F64E-1F3FB-200D-2642-FE0F": [
      "man_pouting_tone1",
      "man_pouting_light_skin_tone"
    ],
    "1F64E-1F3FC-200D-2642-FE0F": [
      "man_pouting_tone2",
      "man_pouting_medium_light_skin_tone"
    ],
    "1F64E-1F3FD-200D-2642-FE0F": [
      "man_pouting_tone3",
      "man_pouting_medium_skin_tone"
    ],
    "1F64E-1F3FE-200D-2642-FE0F": [
      "man_pouting_tone4",
      "man_pouting_medium_dark_skin_tone"
    ],
    "1F64E-1F3FF-200D-2642-FE0F": [
      "man_pouting_tone5",
      "man_pouting_dark_skin_tone"
    ],
    "1F64D": "person_frowning",
    "1F64D-1F3FB": "person_frowning_tone1",
    "1F64D-1F3FC": "person_frowning_tone2",
    "1F64D-1F3FD": "person_frowning_tone3",
    "1F64D-1F3FE": "person_frowning_tone4",
    "1F64D-1F3FF": "person_frowning_tone5",
    "1F64D-200D-2640-FE0F": "woman_frowning",
    "1F64D-1F3FB-200D-2640-FE0F": [
      "woman_frowning_tone1",
      "woman_frowning_light_skin_tone"
    ],
    "1F64D-1F3FC-200D-2640-FE0F": [
      "woman_frowning_tone2",
      "woman_frowning_medium_light_skin_tone"
    ],
    "1F64D-1F3FD-200D-2640-FE0F": [
      "woman_frowning_tone3",
      "woman_frowning_medium_skin_tone"
    ],
    "1F64D-1F3FE-200D-2640-FE0F": [
      "woman_frowning_tone4",
      "woman_frowning_medium_dark_skin_tone"
    ],
    "1F64D-1F3FF-200D-2640-FE0F": [
      "woman_frowning_tone5",
      "woman_frowning_dark_skin_tone"
    ],
    "1F64D-200D-2642-FE0F": "man_frowning",
    "1F64D-1F3FB-200D-2642-FE0F": [
      "man_frowning_tone1",
      "man_frowning_light_skin_tone"
    ],
    "1F64D-1F3FC-200D-2642-FE0F": [
      "man_frowning_tone2",
      "man_frowning_medium_light_skin_tone"
    ],
    "1F64D-1F3FD-200D-2642-FE0F": [
      "man_frowning_tone3",
      "man_frowning_medium_skin_tone"
    ],
    "1F64D-1F3FE-200D-2642-FE0F": [
      "man_frowning_tone4",
      "man_frowning_medium_dark_skin_tone"
    ],
    "1F64D-1F3FF-200D-2642-FE0F": [
      "man_frowning_tone5",
      "man_frowning_dark_skin_tone"
    ],
    "1F487": [
      "person_getting_haircut",
      "haircut"
    ],
    "1F487-1F3FB": [
      "person_getting_haircut_tone1",
      "haircut_tone1"
    ],
    "1F487-1F3FC": [
      "person_getting_haircut_tone2",
      "haircut_tone2"
    ],
    "1F487-1F3FD": [
      "person_getting_haircut_tone3",
      "haircut_tone3"
    ],
    "1F487-1F3FE": [
      "person_getting_haircut_tone4",
      "haircut_tone4"
    ],
    "1F487-1F3FF": [
      "person_getting_haircut_tone5",
      "haircut_tone5"
    ],
    "1F487-200D-2640-FE0F": "woman_getting_haircut",
    "1F487-1F3FB-200D-2640-FE0F": [
      "woman_getting_haircut_tone1",
      "woman_getting_haircut_light_skin_tone"
    ],
    "1F487-1F3FC-200D-2640-FE0F": [
      "woman_getting_haircut_tone2",
      "woman_getting_haircut_medium_light_skin_tone"
    ],
    "1F487-1F3FD-200D-2640-FE0F": [
      "woman_getting_haircut_tone3",
      "woman_getting_haircut_medium_skin_tone"
    ],
    "1F487-1F3FE-200D-2640-FE0F": [
      "woman_getting_haircut_tone4",
      "woman_getting_haircut_medium_dark_skin_tone"
    ],
    "1F487-1F3FF-200D-2640-FE0F": [
      "woman_getting_haircut_tone5",
      "woman_getting_haircut_dark_skin_tone"
    ],
    "1F487-200D-2642-FE0F": "man_getting_haircut",
    "1F487-1F3FB-200D-2642-FE0F": [
      "man_getting_haircut_tone1",
      "man_getting_haircut_light_skin_tone"
    ],
    "1F487-1F3FC-200D-2642-FE0F": [
      "man_getting_haircut_tone2",
      "man_getting_haircut_medium_light_skin_tone"
    ],
    "1F487-1F3FD-200D-2642-FE0F": [
      "man_getting_haircut_tone3",
      "man_getting_haircut_medium_skin_tone"
    ],
    "1F487-1F3FE-200D-2642-FE0F": [
      "man_getting_haircut_tone4",
      "man_getting_haircut_medium_dark_skin_tone"
    ],
    "1F487-1F3FF-200D-2642-FE0F": [
      "man_getting_haircut_tone5",
      "man_getting_haircut_dark_skin_tone"
    ],
    "1F486": [
      "person_getting_massage",
      "massage"
    ],
    "1F486-1F3FB": [
      "person_getting_massage_tone1",
      "massage_tone1"
    ],
    "1F486-1F3FC": [
      "person_getting_massage_tone2",
      "massage_tone2"
    ],
    "1F486-1F3FD": [
      "person_getting_massage_tone3",
      "massage_tone3"
    ],
    "1F486-1F3FE": [
      "person_getting_massage_tone4",
      "massage_tone4"
    ],
    "1F486-1F3FF": [
      "person_getting_massage_tone5",
      "massage_tone5"
    ],
    "1F486-200D-2640-FE0F": "woman_getting_face_massage",
    "1F486-1F3FB-200D-2640-FE0F": [
      "woman_getting_face_massage_tone1",
      "woman_getting_face_massage_light_skin_tone"
    ],
    "1F486-1F3FC-200D-2640-FE0F": [
      "woman_getting_face_massage_tone2",
      "woman_getting_face_massage_medium_light_skin_tone"
    ],
    "1F486-1F3FD-200D-2640-FE0F": [
      "woman_getting_face_massage_tone3",
      "woman_getting_face_massage_medium_skin_tone"
    ],
    "1F486-1F3FE-200D-2640-FE0F": [
      "woman_getting_face_massage_tone4",
      "woman_getting_face_massage_medium_dark_skin_tone"
    ],
    "1F486-1F3FF-200D-2640-FE0F": [
      "woman_getting_face_massage_tone5",
      "woman_getting_face_massage_dark_skin_tone"
    ],
    "1F486-200D-2642-FE0F": "man_getting_face_massage",
    "1F486-1F3FB-200D-2642-FE0F": [
      "man_getting_face_massage_tone1",
      "man_getting_face_massage_light_skin_tone"
    ],
    "1F486-1F3FC-200D-2642-FE0F": [
      "man_getting_face_massage_tone2",
      "man_getting_face_massage_medium_light_skin_tone"
    ],
    "1F486-1F3FD-200D-2642-FE0F": [
      "man_getting_face_massage_tone3",
      "man_getting_face_massage_medium_skin_tone"
    ],
    "1F486-1F3FE-200D-2642-FE0F": [
      "man_getting_face_massage_tone4",
      "man_getting_face_massage_medium_dark_skin_tone"
    ],
    "1F486-1F3FF-200D-2642-FE0F": [
      "man_getting_face_massage_tone5",
      "man_getting_face_massage_dark_skin_tone"
    ],
    "1F9D6": "person_in_steamy_room",
    "1F9D6-1F3FB": [
      "person_in_steamy_room_tone1",
      "person_in_steamy_room_light_skin_tone"
    ],
    "1F9D6-1F3FC": [
      "person_in_steamy_room_tone2",
      "person_in_steamy_room_medium_light_skin_tone"
    ],
    "1F9D6-1F3FD": [
      "person_in_steamy_room_tone3",
      "person_in_steamy_room_medium_skin_tone"
    ],
    "1F9D6-1F3FE": [
      "person_in_steamy_room_tone4",
      "person_in_steamy_room_medium_dark_skin_tone"
    ],
    "1F9D6-1F3FF": [
      "person_in_steamy_room_tone5",
      "person_in_steamy_room_dark_skin_tone"
    ],
    "1F9D6-200D-2640-FE0F": "woman_in_steamy_room",
    "1F9D6-1F3FB-200D-2640-FE0F": [
      "woman_in_steamy_room_tone1",
      "woman_in_steamy_room_light_skin_tone"
    ],
    "1F9D6-1F3FC-200D-2640-FE0F": [
      "woman_in_steamy_room_tone2",
      "woman_in_steamy_room_medium_light_skin_tone"
    ],
    "1F9D6-1F3FD-200D-2640-FE0F": [
      "woman_in_steamy_room_tone3",
      "woman_in_steamy_room_medium_skin_tone"
    ],
    "1F9D6-1F3FE-200D-2640-FE0F": [
      "woman_in_steamy_room_tone4",
      "woman_in_steamy_room_medium_dark_skin_tone"
    ],
    "1F9D6-1F3FF-200D-2640-FE0F": [
      "woman_in_steamy_room_tone5",
      "woman_in_steamy_room_dark_skin_tone"
    ],
    "1F9D6-200D-2642-FE0F": "man_in_steamy_room",
    "1F9D6-1F3FB-200D-2642-FE0F": [
      "man_in_steamy_room_tone1",
      "man_in_steamy_room_light_skin_tone"
    ],
    "1F9D6-1F3FC-200D-2642-FE0F": [
      "man_in_steamy_room_tone2",
      "man_in_steamy_room_medium_light_skin_tone"
    ],
    "1F9D6-1F3FD-200D-2642-FE0F": [
      "man_in_steamy_room_tone3",
      "man_in_steamy_room_medium_skin_tone"
    ],
    "1F9D6-1F3FE-200D-2642-FE0F": [
      "man_in_steamy_room_tone4",
      "man_in_steamy_room_medium_dark_skin_tone"
    ],
    "1F9D6-1F3FF-200D-2642-FE0F": [
      "man_in_steamy_room_tone5",
      "man_in_steamy_room_dark_skin_tone"
    ],
    "1F485": [
      "nail_care",
      "nail_polish"
    ],
    "1F485-1F3FB": "nail_care_tone1",
    "1F485-1F3FC": "nail_care_tone2",
    "1F485-1F3FD": "nail_care_tone3",
    "1F485-1F3FE": "nail_care_tone4",
    "1F485-1F3FF": "nail_care_tone5",
    "1F933": "selfie",
    "1F933-1F3FB": "selfie_tone1",
    "1F933-1F3FC": "selfie_tone2",
    "1F933-1F3FD": "selfie_tone3",
    "1F933-1F3FE": "selfie_tone4",
    "1F933-1F3FF": "selfie_tone5",
    "1F483": [
      "dancer",
      "woman_dancing"
    ],
    "1F483-1F3FB": "dancer_tone1",
    "1F483-1F3FC": "dancer_tone2",
    "1F483-1F3FD": "dancer_tone3",
    "1F483-1F3FE": "dancer_tone4",
    "1F483-1F3FF": "dancer_tone5",
    "1F57A": [
      "man_dancing",
      "male_dancer"
    ],
    "1F57A-1F3FB": [
      "man_dancing_tone1",
      "male_dancer_tone1"
    ],
    "1F57A-1F3FC": [
      "man_dancing_tone2",
      "male_dancer_tone2"
    ],
    "1F57A-1F3FD": [
      "man_dancing_tone3",
      "male_dancer_tone3"
    ],
    "1F57A-1F3FF": [
      "man_dancing_tone5",
      "male_dancer_tone5"
    ],
    "1F57A-1F3FE": [
      "man_dancing_tone4",
      "male_dancer_tone4"
    ],
    "1F46F": [
      "people_with_bunny_ears_partying",
      "dancers"
    ],
    "1F46F-200D-2640-FE0F": "women_with_bunny_ears_partying",
    "1F46F-200D-2642-FE0F": "men_with_bunny_ears_partying",
    "1F574": [
      "levitate",
      "man_in_business_suit_levitating"
    ],
    "1F574-1F3FB": [
      "levitate_tone1",
      "man_in_business_suit_levitating_tone1",
      "man_in_business_suit_levitating_light_skin_tone"
    ],
    "1F574-1F3FC": [
      "levitate_tone2",
      "man_in_business_suit_levitating_tone2",
      "man_in_business_suit_levitating_medium_light_skin_tone"
    ],
    "1F574-1F3FD": [
      "levitate_tone3",
      "man_in_business_suit_levitating_tone3",
      "man_in_business_suit_levitating_medium_skin_tone"
    ],
    "1F574-1F3FE": [
      "levitate_tone4",
      "man_in_business_suit_levitating_tone4",
      "man_in_business_suit_levitating_medium_dark_skin_tone"
    ],
    "1F574-1F3FF": [
      "levitate_tone5",
      "man_in_business_suit_levitating_tone5",
      "man_in_business_suit_levitating_dark_skin_tone"
    ],
    "1F9D1-200D-1F9BD": "person_in_manual_wheelchair",
    "1F9D1-1F3FB-200D-1F9BD": [
      "person_in_manual_wheelchair_tone1",
      "person_in_manual_wheelchair_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F9BD": [
      "person_in_manual_wheelchair_tone2",
      "person_in_manual_wheelchair_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F9BD": [
      "person_in_manual_wheelchair_tone3",
      "person_in_manual_wheelchair_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F9BD": [
      "person_in_manual_wheelchair_tone4",
      "person_in_manual_wheelchair_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F9BD": [
      "person_in_manual_wheelchair_tone5",
      "person_in_manual_wheelchair_dark_skin_tone"
    ],
    "1F469-200D-1F9BD": "woman_in_manual_wheelchair",
    "1F469-1F3FB-200D-1F9BD": [
      "woman_in_manual_wheelchair_tone1",
      "woman_in_manual_wheelchair_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9BD": [
      "woman_in_manual_wheelchair_tone2",
      "woman_in_manual_wheelchair_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9BD": [
      "woman_in_manual_wheelchair_tone3",
      "woman_in_manual_wheelchair_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9BD": [
      "woman_in_manual_wheelchair_tone4",
      "woman_in_manual_wheelchair_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9BD": [
      "woman_in_manual_wheelchair_tone5",
      "woman_in_manual_wheelchair_dark_skin_tone"
    ],
    "1F468-200D-1F9BD": "man_in_manual_wheelchair",
    "1F468-1F3FB-200D-1F9BD": [
      "man_in_manual_wheelchair_tone1",
      "man_in_manual_wheelchair_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9BD": [
      "man_in_manual_wheelchair_tone2",
      "man_in_manual_wheelchair_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9BD": [
      "man_in_manual_wheelchair_tone3",
      "man_in_manual_wheelchair_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9BD": [
      "man_in_manual_wheelchair_tone4",
      "man_in_manual_wheelchair_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9BD": [
      "man_in_manual_wheelchair_tone5",
      "man_in_manual_wheelchair_dark_skin_tone"
    ],
    "1F9D1-200D-1F9BC": "person_in_motorized_wheelchair",
    "1F9D1-1F3FB-200D-1F9BC": [
      "person_in_motorized_wheelchair_tone1",
      "person_in_motorized_wheelchair_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F9BC": [
      "person_in_motorized_wheelchair_tone2",
      "person_in_motorized_wheelchair_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F9BC": [
      "person_in_motorized_wheelchair_tone3",
      "person_in_motorized_wheelchair_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F9BC": [
      "person_in_motorized_wheelchair_tone4",
      "person_in_motorized_wheelchair_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F9BC": [
      "person_in_motorized_wheelchair_tone5",
      "person_in_motorized_wheelchair_dark_skin_tone"
    ],
    "1F469-200D-1F9BC": "woman_in_motorized_wheelchair",
    "1F469-1F3FB-200D-1F9BC": [
      "woman_in_motorized_wheelchair_tone1",
      "woman_in_motorized_wheelchair_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9BC": [
      "woman_in_motorized_wheelchair_tone2",
      "woman_in_motorized_wheelchair_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9BC": [
      "woman_in_motorized_wheelchair_tone3",
      "woman_in_motorized_wheelchair_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9BC": [
      "woman_in_motorized_wheelchair_tone4",
      "woman_in_motorized_wheelchair_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9BC": [
      "woman_in_motorized_wheelchair_tone5",
      "woman_in_motorized_wheelchair_dark_skin_tone"
    ],
    "1F468-200D-1F9BC": "man_in_motorized_wheelchair",
    "1F468-1F3FB-200D-1F9BC": [
      "man_in_motorized_wheelchair_tone1",
      "man_in_motorized_wheelchair_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9BC": [
      "man_in_motorized_wheelchair_tone2",
      "man_in_motorized_wheelchair_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9BC": [
      "man_in_motorized_wheelchair_tone3",
      "man_in_motorized_wheelchair_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9BC": [
      "man_in_motorized_wheelchair_tone4",
      "man_in_motorized_wheelchair_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9BC": [
      "man_in_motorized_wheelchair_tone5",
      "man_in_motorized_wheelchair_dark_skin_tone"
    ],
    "1F6B6": [
      "person_walking",
      "walking"
    ],
    "1F6B6-1F3FB": [
      "person_walking_tone1",
      "walking_tone1"
    ],
    "1F6B6-1F3FC": [
      "person_walking_tone2",
      "walking_tone2"
    ],
    "1F6B6-1F3FD": [
      "person_walking_tone3",
      "walking_tone3"
    ],
    "1F6B6-1F3FE": [
      "person_walking_tone4",
      "walking_tone4"
    ],
    "1F6B6-1F3FF": [
      "person_walking_tone5",
      "walking_tone5"
    ],
    "1F6B6-200D-2640-FE0F": "woman_walking",
    "1F6B6-1F3FB-200D-2640-FE0F": [
      "woman_walking_tone1",
      "woman_walking_light_skin_tone"
    ],
    "1F6B6-1F3FC-200D-2640-FE0F": [
      "woman_walking_tone2",
      "woman_walking_medium_light_skin_tone"
    ],
    "1F6B6-1F3FD-200D-2640-FE0F": [
      "woman_walking_tone3",
      "woman_walking_medium_skin_tone"
    ],
    "1F6B6-1F3FE-200D-2640-FE0F": [
      "woman_walking_tone4",
      "woman_walking_medium_dark_skin_tone"
    ],
    "1F6B6-1F3FF-200D-2640-FE0F": [
      "woman_walking_tone5",
      "woman_walking_dark_skin_tone"
    ],
    "1F6B6-200D-2642-FE0F": "man_walking",
    "1F6B6-1F3FB-200D-2642-FE0F": [
      "man_walking_tone1",
      "man_walking_light_skin_tone"
    ],
    "1F6B6-1F3FC-200D-2642-FE0F": [
      "man_walking_tone2",
      "man_walking_medium_light_skin_tone"
    ],
    "1F6B6-1F3FD-200D-2642-FE0F": [
      "man_walking_tone3",
      "man_walking_medium_skin_tone"
    ],
    "1F6B6-1F3FE-200D-2642-FE0F": [
      "man_walking_tone4",
      "man_walking_medium_dark_skin_tone"
    ],
    "1F6B6-1F3FF-200D-2642-FE0F": [
      "man_walking_tone5",
      "man_walking_dark_skin_tone"
    ],
    "1F9D1-200D-1F9AF": "person_with_probing_cane",
    "1F9D1-1F3FB-200D-1F9AF": [
      "person_with_probing_cane_tone1",
      "person_with_probing_cane_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F9AF": [
      "person_with_probing_cane_tone2",
      "person_with_probing_cane_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F9AF": [
      "person_with_probing_cane_tone3",
      "person_with_probing_cane_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F9AF": [
      "person_with_probing_cane_tone4",
      "person_with_probing_cane_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F9AF": [
      "person_with_probing_cane_tone5",
      "person_with_probing_cane_dark_skin_tone"
    ],
    "1F469-200D-1F9AF": "woman_with_probing_cane",
    "1F469-1F3FB-200D-1F9AF": [
      "woman_with_probing_cane_tone1",
      "woman_with_probing_cane_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F9AF": [
      "woman_with_probing_cane_tone2",
      "woman_with_probing_cane_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F9AF": [
      "woman_with_probing_cane_tone3",
      "woman_with_probing_cane_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-1F9AF": [
      "woman_with_probing_cane_tone4",
      "woman_with_probing_cane_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F9AF": [
      "woman_with_probing_cane_tone5",
      "woman_with_probing_cane_dark_skin_tone"
    ],
    "1F468-200D-1F9AF": "man_with_probing_cane",
    "1F468-1F3FB-200D-1F9AF": [
      "man_with_probing_cane_tone1",
      "man_with_probing_cane_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F9AF": [
      "man_with_probing_cane_tone2",
      "man_with_probing_cane_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F9AF": [
      "man_with_probing_cane_tone3",
      "man_with_probing_cane_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-1F9AF": [
      "man_with_probing_cane_tone4",
      "man_with_probing_cane_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F9AF": [
      "man_with_probing_cane_tone5",
      "man_with_probing_cane_dark_skin_tone"
    ],
    "1F9CE": "person_kneeling",
    "1F9CE-1F3FB": [
      "person_kneeling_tone1",
      "person_kneeling_light_skin_tone"
    ],
    "1F9CE-1F3FC": [
      "person_kneeling_tone2",
      "person_kneeling_medium_light_skin_tone"
    ],
    "1F9CE-1F3FD": [
      "person_kneeling_tone3",
      "person_kneeling_medium_skin_tone"
    ],
    "1F9CE-1F3FE": [
      "person_kneeling_tone4",
      "person_kneeling_medium_dark_skin_tone"
    ],
    "1F9CE-1F3FF": [
      "person_kneeling_tone5",
      "person_kneeling_dark_skin_tone"
    ],
    "1F9CE-200D-2640-FE0F": "woman_kneeling",
    "1F9CE-1F3FB-200D-2640-FE0F": [
      "woman_kneeling_tone1",
      "woman_kneeling_light_skin_tone"
    ],
    "1F9CE-1F3FC-200D-2640-FE0F": [
      "woman_kneeling_tone2",
      "woman_kneeling_medium_light_skin_tone"
    ],
    "1F9CE-1F3FD-200D-2640-FE0F": [
      "woman_kneeling_tone3",
      "woman_kneeling_medium_skin_tone"
    ],
    "1F9CE-1F3FE-200D-2640-FE0F": [
      "woman_kneeling_tone4",
      "woman_kneeling_medium_dark_skin_tone"
    ],
    "1F9CE-1F3FF-200D-2640-FE0F": [
      "woman_kneeling_tone5",
      "woman_kneeling_dark_skin_tone"
    ],
    "1F9CE-200D-2642-FE0F": "man_kneeling",
    "1F9CE-1F3FB-200D-2642-FE0F": [
      "man_kneeling_tone1",
      "man_kneeling_light_skin_tone"
    ],
    "1F9CE-1F3FC-200D-2642-FE0F": [
      "man_kneeling_tone2",
      "man_kneeling_medium_light_skin_tone"
    ],
    "1F9CE-1F3FD-200D-2642-FE0F": [
      "man_kneeling_tone3",
      "man_kneeling_medium_skin_tone"
    ],
    "1F9CE-1F3FE-200D-2642-FE0F": [
      "man_kneeling_tone4",
      "man_kneeling_medium_dark_skin_tone"
    ],
    "1F9CE-1F3FF-200D-2642-FE0F": [
      "man_kneeling_tone5",
      "man_kneeling_dark_skin_tone"
    ],
    "1F3C3": [
      "person_running",
      "runner"
    ],
    "1F3C3-1F3FB": [
      "person_running_tone1",
      "runner_tone1"
    ],
    "1F3C3-1F3FC": [
      "person_running_tone2",
      "runner_tone2"
    ],
    "1F3C3-1F3FD": [
      "person_running_tone3",
      "runner_tone3"
    ],
    "1F3C3-1F3FE": [
      "person_running_tone4",
      "runner_tone4"
    ],
    "1F3C3-1F3FF": [
      "person_running_tone5",
      "runner_tone5"
    ],
    "1F3C3-200D-2640-FE0F": "woman_running",
    "1F3C3-1F3FB-200D-2640-FE0F": [
      "woman_running_tone1",
      "woman_running_light_skin_tone"
    ],
    "1F3C3-1F3FC-200D-2640-FE0F": [
      "woman_running_tone2",
      "woman_running_medium_light_skin_tone"
    ],
    "1F3C3-1F3FD-200D-2640-FE0F": [
      "woman_running_tone3",
      "woman_running_medium_skin_tone"
    ],
    "1F3C3-1F3FE-200D-2640-FE0F": [
      "woman_running_tone4",
      "woman_running_medium_dark_skin_tone"
    ],
    "1F3C3-1F3FF-200D-2640-FE0F": [
      "woman_running_tone5",
      "woman_running_dark_skin_tone"
    ],
    "1F3C3-200D-2642-FE0F": "man_running",
    "1F3C3-1F3FB-200D-2642-FE0F": [
      "man_running_tone1",
      "man_running_light_skin_tone"
    ],
    "1F3C3-1F3FC-200D-2642-FE0F": [
      "man_running_tone2",
      "man_running_medium_light_skin_tone"
    ],
    "1F3C3-1F3FD-200D-2642-FE0F": [
      "man_running_tone3",
      "man_running_medium_skin_tone"
    ],
    "1F3C3-1F3FE-200D-2642-FE0F": [
      "man_running_tone4",
      "man_running_medium_dark_skin_tone"
    ],
    "1F3C3-1F3FF-200D-2642-FE0F": [
      "man_running_tone5",
      "man_running_dark_skin_tone"
    ],
    "1F9CD": "person_standing",
    "1F9CD-1F3FB": [
      "person_standing_tone1",
      "person_standing_light_skin_tone"
    ],
    "1F9CD-1F3FC": [
      "person_standing_tone2",
      "person_standing_medium_light_skin_tone"
    ],
    "1F9CD-1F3FD": [
      "person_standing_tone3",
      "person_standing_medium_skin_tone"
    ],
    "1F9CD-1F3FE": [
      "person_standing_tone4",
      "person_standing_medium_dark_skin_tone"
    ],
    "1F9CD-1F3FF": [
      "person_standing_tone5",
      "person_standing_dark_skin_tone"
    ],
    "1F9CD-200D-2640-FE0F": "woman_standing",
    "1F9CD-1F3FB-200D-2640-FE0F": [
      "woman_standing_tone1",
      "woman_standing_light_skin_tone"
    ],
    "1F9CD-1F3FC-200D-2640-FE0F": [
      "woman_standing_tone2",
      "woman_standing_medium_light_skin_tone"
    ],
    "1F9CD-1F3FD-200D-2640-FE0F": [
      "woman_standing_tone3",
      "woman_standing_medium_skin_tone"
    ],
    "1F9CD-1F3FE-200D-2640-FE0F": [
      "woman_standing_tone4",
      "woman_standing_medium_dark_skin_tone"
    ],
    "1F9CD-1F3FF-200D-2640-FE0F": [
      "woman_standing_tone5",
      "woman_standing_dark_skin_tone"
    ],
    "1F9CD-200D-2642-FE0F": "man_standing",
    "1F9CD-1F3FB-200D-2642-FE0F": [
      "man_standing_tone1",
      "man_standing_light_skin_tone"
    ],
    "1F9CD-1F3FC-200D-2642-FE0F": [
      "man_standing_tone2",
      "man_standing_medium_light_skin_tone"
    ],
    "1F9CD-1F3FD-200D-2642-FE0F": [
      "man_standing_tone3",
      "man_standing_medium_skin_tone"
    ],
    "1F9CD-1F3FE-200D-2642-FE0F": [
      "man_standing_tone4",
      "man_standing_medium_dark_skin_tone"
    ],
    "1F9CD-1F3FF-200D-2642-FE0F": [
      "man_standing_tone5",
      "man_standing_dark_skin_tone"
    ],
    "1F9D1-200D-1F91D-200D-1F9D1": "people_holding_hands",
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FB": [
      "people_holding_hands_tone1",
      "people_holding_hands_light_skin_tone"
    ],
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FC": [
      "people_holding_hands_tone1_tone2",
      "people_holding_hands_light_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FD": [
      "people_holding_hands_tone1_tone3",
      "people_holding_hands_light_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FE": [
      "people_holding_hands_tone1_tone4",
      "people_holding_hands_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FF": [
      "people_holding_hands_tone1_tone5",
      "people_holding_hands_light_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FB": [
      "people_holding_hands_tone2_tone1",
      "people_holding_hands_medium_light_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FC": [
      "people_holding_hands_tone2",
      "people_holding_hands_medium_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FD": [
      "people_holding_hands_tone2_tone3",
      "people_holding_hands_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FE": [
      "people_holding_hands_tone2_tone4",
      "people_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FF": [
      "people_holding_hands_tone2_tone5",
      "people_holding_hands_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FB": [
      "people_holding_hands_tone3_tone1",
      "people_holding_hands_medium_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FC": [
      "people_holding_hands_tone3_tone2",
      "people_holding_hands_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FD": [
      "people_holding_hands_tone3",
      "people_holding_hands_medium_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FE": [
      "people_holding_hands_tone3_tone4",
      "people_holding_hands_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FF": [
      "people_holding_hands_tone3_tone5",
      "people_holding_hands_medium_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FB": [
      "people_holding_hands_tone4_tone1",
      "people_holding_hands_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FC": [
      "people_holding_hands_tone4_tone2",
      "people_holding_hands_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FD": [
      "people_holding_hands_tone4_tone3",
      "people_holding_hands_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FE": [
      "people_holding_hands_tone4",
      "people_holding_hands_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FF": [
      "people_holding_hands_tone4_tone5",
      "people_holding_hands_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FB": [
      "people_holding_hands_tone5_tone1",
      "people_holding_hands_dark_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FC": [
      "people_holding_hands_tone5_tone2",
      "people_holding_hands_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FD": [
      "people_holding_hands_tone5_tone3",
      "people_holding_hands_dark_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FE": [
      "people_holding_hands_tone5_tone4",
      "people_holding_hands_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FF": [
      "people_holding_hands_tone5",
      "people_holding_hands_dark_skin_tone"
    ],
    "1F46B": "couple",
    "1F46B-1F3FB": [
      "woman_and_man_holding_hands_tone1",
      "woman_and_man_holding_hands_light_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FC": [
      "woman_and_man_holding_hands_tone1_tone2",
      "woman_and_man_holding_hands_light_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FD": [
      "woman_and_man_holding_hands_tone1_tone3",
      "woman_and_man_holding_hands_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FE": [
      "woman_and_man_holding_hands_tone1_tone4",
      "woman_and_man_holding_hands_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FF": [
      "woman_and_man_holding_hands_tone1_tone5",
      "woman_and_man_holding_hands_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FB": [
      "woman_and_man_holding_hands_tone2_tone1",
      "woman_and_man_holding_hands_medium_light_skin_tone_light_skin_tone"
    ],
    "1F46B-1F3FC": [
      "woman_and_man_holding_hands_tone2",
      "woman_and_man_holding_hands_medium_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FD": [
      "woman_and_man_holding_hands_tone2_tone3",
      "woman_and_man_holding_hands_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FE": [
      "woman_and_man_holding_hands_tone2_tone4",
      "woman_and_man_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FF": [
      "woman_and_man_holding_hands_tone2_tone5",
      "woman_and_man_holding_hands_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FB": [
      "woman_and_man_holding_hands_tone3_tone1",
      "woman_and_man_holding_hands_medium_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FC": [
      "woman_and_man_holding_hands_tone3_tone2",
      "woman_and_man_holding_hands_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F46B-1F3FD": [
      "woman_and_man_holding_hands_tone3",
      "woman_and_man_holding_hands_medium_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FE": [
      "woman_and_man_holding_hands_tone3_tone4",
      "woman_and_man_holding_hands_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FF": [
      "woman_and_man_holding_hands_tone3_tone5",
      "woman_and_man_holding_hands_medium_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FB": [
      "woman_and_man_holding_hands_tone4_tone1",
      "woman_and_man_holding_hands_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FC": [
      "woman_and_man_holding_hands_tone4_tone2",
      "woman_and_man_holding_hands_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FD": [
      "woman_and_man_holding_hands_tone4_tone3",
      "woman_and_man_holding_hands_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F46B-1F3FE": [
      "woman_and_man_holding_hands_tone4",
      "woman_and_man_holding_hands_medium_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FF": [
      "woman_and_man_holding_hands_tone4_tone5",
      "woman_and_man_holding_hands_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FB": [
      "woman_and_man_holding_hands_tone5_tone1",
      "woman_and_man_holding_hands_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FC": [
      "woman_and_man_holding_hands_tone5_tone2",
      "woman_and_man_holding_hands_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FD": [
      "woman_and_man_holding_hands_tone5_tone3",
      "woman_and_man_holding_hands_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FE": [
      "woman_and_man_holding_hands_tone5_tone4",
      "woman_and_man_holding_hands_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F46B-1F3FF": [
      "woman_and_man_holding_hands_tone5",
      "woman_and_man_holding_hands_dark_skin_tone"
    ],
    "1F46D": "two_women_holding_hands",
    "1F46D-1F3FB": [
      "women_holding_hands_tone1",
      "women_holding_hands_light_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FC": [
      "women_holding_hands_tone1_tone2",
      "women_holding_hands_light_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FD": [
      "women_holding_hands_tone1_tone3",
      "women_holding_hands_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FE": [
      "women_holding_hands_tone1_tone4",
      "women_holding_hands_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FF": [
      "women_holding_hands_tone1_tone5",
      "women_holding_hands_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FB": [
      "women_holding_hands_tone2_tone1",
      "women_holding_hands_medium_light_skin_tone_light_skin_tone"
    ],
    "1F46D-1F3FC": [
      "women_holding_hands_tone2",
      "women_holding_hands_medium_light_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FD": [
      "women_holding_hands_tone2_tone3",
      "women_holding_hands_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FE": [
      "women_holding_hands_tone2_tone4",
      "women_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FF": [
      "women_holding_hands_tone2_tone5",
      "women_holding_hands_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FB": [
      "women_holding_hands_tone3_tone1",
      "women_holding_hands_medium_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FC": [
      "women_holding_hands_tone3_tone2",
      "women_holding_hands_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F46D-1F3FD": [
      "women_holding_hands_tone3",
      "women_holding_hands_medium_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FE": [
      "women_holding_hands_tone3_tone4",
      "women_holding_hands_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FF": [
      "women_holding_hands_tone3_tone5",
      "women_holding_hands_medium_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FB": [
      "women_holding_hands_tone4_tone1",
      "women_holding_hands_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FC": [
      "women_holding_hands_tone4_tone2",
      "women_holding_hands_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FD": [
      "women_holding_hands_tone4_tone3",
      "women_holding_hands_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F46D-1F3FE": [
      "women_holding_hands_tone4",
      "women_holding_hands_medium_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FF": [
      "women_holding_hands_tone4_tone5",
      "women_holding_hands_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FB": [
      "women_holding_hands_tone5_tone1",
      "women_holding_hands_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FC": [
      "women_holding_hands_tone5_tone2",
      "women_holding_hands_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FD": [
      "women_holding_hands_tone5_tone3",
      "women_holding_hands_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FE": [
      "women_holding_hands_tone5_tone4",
      "women_holding_hands_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F46D-1F3FF": [
      "women_holding_hands_tone5",
      "women_holding_hands_dark_skin_tone"
    ],
    "1F46C": "two_men_holding_hands",
    "1F46C-1F3FB": [
      "men_holding_hands_tone1",
      "men_holding_hands_light_skin_tone"
    ],
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FC": [
      "men_holding_hands_tone1_tone2",
      "men_holding_hands_light_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FD": [
      "men_holding_hands_tone1_tone3",
      "men_holding_hands_light_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FE": [
      "men_holding_hands_tone1_tone4",
      "men_holding_hands_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FF": [
      "men_holding_hands_tone1_tone5",
      "men_holding_hands_light_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FB": [
      "men_holding_hands_tone2_tone1",
      "men_holding_hands_medium_light_skin_tone_light_skin_tone"
    ],
    "1F46C-1F3FC": [
      "men_holding_hands_tone2",
      "men_holding_hands_medium_light_skin_tone"
    ],
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FD": [
      "men_holding_hands_tone2_tone3",
      "men_holding_hands_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FE": [
      "men_holding_hands_tone2_tone4",
      "men_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FF": [
      "men_holding_hands_tone2_tone5",
      "men_holding_hands_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FB": [
      "men_holding_hands_tone3_tone1",
      "men_holding_hands_medium_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FC": [
      "men_holding_hands_tone3_tone2",
      "men_holding_hands_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F46C-1F3FD": [
      "men_holding_hands_tone3",
      "men_holding_hands_medium_skin_tone"
    ],
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FE": [
      "men_holding_hands_tone3_tone4",
      "men_holding_hands_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FF": [
      "men_holding_hands_tone3_tone5",
      "men_holding_hands_medium_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FB": [
      "men_holding_hands_tone4_tone1",
      "men_holding_hands_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FC": [
      "men_holding_hands_tone4_tone2",
      "men_holding_hands_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FD": [
      "men_holding_hands_tone4_tone3",
      "men_holding_hands_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F46C-1F3FE": [
      "men_holding_hands_tone4",
      "men_holding_hands_medium_dark_skin_tone"
    ],
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FF": [
      "men_holding_hands_tone4_tone5",
      "men_holding_hands_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FB": [
      "men_holding_hands_tone5_tone1",
      "men_holding_hands_dark_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FC": [
      "men_holding_hands_tone5_tone2",
      "men_holding_hands_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FD": [
      "men_holding_hands_tone5_tone3",
      "men_holding_hands_dark_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FE": [
      "men_holding_hands_tone5_tone4",
      "men_holding_hands_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F46C-1F3FF": [
      "men_holding_hands_tone5",
      "men_holding_hands_dark_skin_tone"
    ],
    "1F491": "couple_with_heart",
    "1F491-1F3FB": [
      "couple_with_heart_tone1",
      "couple_with_heart_light_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FC": [
      "couple_with_heart_person_person_tone1_tone2",
      "couple_with_heart_person_person_light_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FD": [
      "couple_with_heart_person_person_tone1_tone3",
      "couple_with_heart_person_person_light_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FE": [
      "couple_with_heart_person_person_tone1_tone4",
      "couple_with_heart_person_person_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FF": [
      "couple_with_heart_person_person_tone1_tone5",
      "couple_with_heart_person_person_light_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FB": [
      "couple_with_heart_person_person_tone2_tone1",
      "couple_with_heart_person_person_medium_light_skin_tone_light_skin_tone"
    ],
    "1F491-1F3FC": [
      "couple_with_heart_tone2",
      "couple_with_heart_medium_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FD": [
      "couple_with_heart_person_person_tone2_tone3",
      "couple_with_heart_person_person_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FE": [
      "couple_with_heart_person_person_tone2_tone4",
      "couple_with_heart_person_person_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FF": [
      "couple_with_heart_person_person_tone2_tone5",
      "couple_with_heart_person_person_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FB": [
      "couple_with_heart_person_person_tone3_tone1",
      "couple_with_heart_person_person_medium_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FC": [
      "couple_with_heart_person_person_tone3_tone2",
      "couple_with_heart_person_person_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F491-1F3FD": [
      "couple_with_heart_tone3",
      "couple_with_heart_medium_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FE": [
      "couple_with_heart_person_person_tone3_tone4",
      "couple_with_heart_person_person_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FF": [
      "couple_with_heart_person_person_tone3_tone5",
      "couple_with_heart_person_person_medium_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FB": [
      "couple_with_heart_person_person_tone4_tone1",
      "couple_with_heart_person_person_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FC": [
      "couple_with_heart_person_person_tone4_tone2",
      "couple_with_heart_person_person_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FD": [
      "couple_with_heart_person_person_tone4_tone3",
      "couple_with_heart_person_person_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F491-1F3FE": [
      "couple_with_heart_tone4",
      "couple_with_heart_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FF": [
      "couple_with_heart_person_person_tone4_tone5",
      "couple_with_heart_person_person_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FB": [
      "couple_with_heart_person_person_tone5_tone1",
      "couple_with_heart_person_person_dark_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FC": [
      "couple_with_heart_person_person_tone5_tone2",
      "couple_with_heart_person_person_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FD": [
      "couple_with_heart_person_person_tone5_tone3",
      "couple_with_heart_person_person_dark_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FE": [
      "couple_with_heart_person_person_tone5_tone4",
      "couple_with_heart_person_person_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F491-1F3FF": [
      "couple_with_heart_tone5",
      "couple_with_heart_dark_skin_tone"
    ],
    "1F469-200D-2764-FE0F-200D-1F468": "couple_with_heart_woman_man",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_woman_man_tone1",
      "couple_with_heart_woman_man_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_woman_man_tone1_tone2",
      "couple_with_heart_woman_man_light_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_woman_man_tone1_tone3",
      "couple_with_heart_woman_man_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_woman_man_tone1_tone4",
      "couple_with_heart_woman_man_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_woman_man_tone1_tone5",
      "couple_with_heart_woman_man_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_woman_man_tone2_tone1",
      "couple_with_heart_woman_man_medium_light_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_woman_man_tone2",
      "couple_with_heart_woman_man_medium_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_woman_man_tone2_tone3",
      "couple_with_heart_woman_man_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_woman_man_tone2_tone4",
      "couple_with_heart_woman_man_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_woman_man_tone2_tone5",
      "couple_with_heart_woman_man_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_woman_man_tone3_tone1",
      "couple_with_heart_woman_man_medium_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_woman_man_tone3_tone2",
      "couple_with_heart_woman_man_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_woman_man_tone3",
      "couple_with_heart_woman_man_medium_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_woman_man_tone3_tone4",
      "couple_with_heart_woman_man_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_woman_man_tone3_tone5",
      "couple_with_heart_woman_man_medium_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_woman_man_tone4_tone1",
      "couple_with_heart_woman_man_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_woman_man_tone4_tone2",
      "couple_with_heart_woman_man_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_woman_man_tone4_tone3",
      "couple_with_heart_woman_man_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_woman_man_tone4",
      "couple_with_heart_woman_man_medium_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_woman_man_tone4_tone5",
      "couple_with_heart_woman_man_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_woman_man_tone5_tone1",
      "couple_with_heart_woman_man_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_woman_man_tone5_tone2",
      "couple_with_heart_woman_man_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_woman_man_tone5_tone3",
      "couple_with_heart_woman_man_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_woman_man_tone5_tone4",
      "couple_with_heart_woman_man_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_woman_man_tone5",
      "couple_with_heart_woman_man_dark_skin_tone"
    ],
    "1F469-200D-2764-FE0F-200D-1F469": [
      "couple_ww",
      "couple_with_heart_ww"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FB": [
      "couple_with_heart_woman_woman_tone1",
      "couple_with_heart_woman_woman_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FC": [
      "couple_with_heart_woman_woman_tone1_tone2",
      "couple_with_heart_woman_woman_light_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FD": [
      "couple_with_heart_woman_woman_tone1_tone3",
      "couple_with_heart_woman_woman_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FE": [
      "couple_with_heart_woman_woman_tone1_tone4",
      "couple_with_heart_woman_woman_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FF": [
      "couple_with_heart_woman_woman_tone1_tone5",
      "couple_with_heart_woman_woman_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FB": [
      "couple_with_heart_woman_woman_tone2_tone1",
      "couple_with_heart_woman_woman_medium_light_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FC": [
      "couple_with_heart_woman_woman_tone2",
      "couple_with_heart_woman_woman_medium_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FD": [
      "couple_with_heart_woman_woman_tone2_tone3",
      "couple_with_heart_woman_woman_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FE": [
      "couple_with_heart_woman_woman_tone2_tone4",
      "couple_with_heart_woman_woman_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FF": [
      "couple_with_heart_woman_woman_tone2_tone5",
      "couple_with_heart_woman_woman_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FB": [
      "couple_with_heart_woman_woman_tone3_tone1",
      "couple_with_heart_woman_woman_medium_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FC": [
      "couple_with_heart_woman_woman_tone3_tone2",
      "couple_with_heart_woman_woman_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FD": [
      "couple_with_heart_woman_woman_tone3",
      "couple_with_heart_woman_woman_medium_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FE": [
      "couple_with_heart_woman_woman_tone3_tone4",
      "couple_with_heart_woman_woman_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FF": [
      "couple_with_heart_woman_woman_tone3_tone5",
      "couple_with_heart_woman_woman_medium_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FB": [
      "couple_with_heart_woman_woman_tone4_tone1",
      "couple_with_heart_woman_woman_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FC": [
      "couple_with_heart_woman_woman_tone4_tone2",
      "couple_with_heart_woman_woman_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FD": [
      "couple_with_heart_woman_woman_tone4_tone3",
      "couple_with_heart_woman_woman_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FE": [
      "couple_with_heart_woman_woman_tone4",
      "couple_with_heart_woman_woman_medium_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FF": [
      "couple_with_heart_woman_woman_tone4_tone5",
      "couple_with_heart_woman_woman_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FB": [
      "couple_with_heart_woman_woman_tone5_tone1",
      "couple_with_heart_woman_woman_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FC": [
      "couple_with_heart_woman_woman_tone5_tone2",
      "couple_with_heart_woman_woman_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FD": [
      "couple_with_heart_woman_woman_tone5_tone3",
      "couple_with_heart_woman_woman_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FE": [
      "couple_with_heart_woman_woman_tone5_tone4",
      "couple_with_heart_woman_woman_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FF": [
      "couple_with_heart_woman_woman_tone5",
      "couple_with_heart_woman_woman_dark_skin_tone"
    ],
    "1F468-200D-2764-FE0F-200D-1F468": [
      "couple_mm",
      "couple_with_heart_mm"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_man_man_tone1",
      "couple_with_heart_man_man_light_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_man_man_tone1_tone2",
      "couple_with_heart_man_man_light_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_man_man_tone1_tone3",
      "couple_with_heart_man_man_light_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_man_man_tone1_tone4",
      "couple_with_heart_man_man_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_man_man_tone1_tone5",
      "couple_with_heart_man_man_light_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_man_man_tone2_tone1",
      "couple_with_heart_man_man_medium_light_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_man_man_tone2",
      "couple_with_heart_man_man_medium_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_man_man_tone2_tone3",
      "couple_with_heart_man_man_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_man_man_tone2_tone4",
      "couple_with_heart_man_man_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_man_man_tone2_tone5",
      "couple_with_heart_man_man_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_man_man_tone3_tone1",
      "couple_with_heart_man_man_medium_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_man_man_tone3_tone2",
      "couple_with_heart_man_man_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_man_man_tone3",
      "couple_with_heart_man_man_medium_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_man_man_tone3_tone4",
      "couple_with_heart_man_man_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_man_man_tone3_tone5",
      "couple_with_heart_man_man_medium_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_man_man_tone4_tone1",
      "couple_with_heart_man_man_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_man_man_tone4_tone2",
      "couple_with_heart_man_man_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_man_man_tone4_tone3",
      "couple_with_heart_man_man_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_man_man_tone4",
      "couple_with_heart_man_man_medium_dark_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_man_man_tone4_tone5",
      "couple_with_heart_man_man_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_man_man_tone5_tone1",
      "couple_with_heart_man_man_dark_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_man_man_tone5_tone2",
      "couple_with_heart_man_man_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_man_man_tone5_tone3",
      "couple_with_heart_man_man_dark_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_man_man_tone5_tone4",
      "couple_with_heart_man_man_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_man_man_tone5",
      "couple_with_heart_man_man_dark_skin_tone"
    ],
    "1F48F": "couplekiss",
    "1F48F-1F3FB": [
      "kiss_tone1",
      "kiss_light_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "kiss_person_person_tone1_tone2",
      "kiss_person_person_light_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "kiss_person_person_tone1_tone3",
      "kiss_person_person_light_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "kiss_person_person_tone1_tone4",
      "kiss_person_person_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "kiss_person_person_tone1_tone5",
      "kiss_person_person_light_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "kiss_person_person_tone2_tone1",
      "kiss_person_person_medium_light_skin_tone_light_skin_tone"
    ],
    "1F48F-1F3FC": [
      "kiss_tone2",
      "kiss_medium_light_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "kiss_person_person_tone2_tone3",
      "kiss_person_person_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "kiss_person_person_tone2_tone4",
      "kiss_person_person_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "kiss_person_person_tone2_tone5",
      "kiss_person_person_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "kiss_person_person_tone3_tone1",
      "kiss_person_person_medium_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "kiss_person_person_tone3_tone2",
      "kiss_person_person_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F48F-1F3FD": [
      "kiss_tone3",
      "kiss_medium_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "kiss_person_person_tone3_tone4",
      "kiss_person_person_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "kiss_person_person_tone3_tone5",
      "kiss_person_person_medium_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "kiss_person_person_tone4_tone1",
      "kiss_person_person_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "kiss_person_person_tone4_tone2",
      "kiss_person_person_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "kiss_person_person_tone4_tone3",
      "kiss_person_person_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F48F-1F3FE": [
      "kiss_tone4",
      "kiss_medium_dark_skin_tone"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "kiss_person_person_tone4_tone5",
      "kiss_person_person_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "kiss_person_person_tone5_tone1",
      "kiss_person_person_dark_skin_tone_light_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "kiss_person_person_tone5_tone2",
      "kiss_person_person_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "kiss_person_person_tone5_tone3",
      "kiss_person_person_dark_skin_tone_medium_skin_tone"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "kiss_person_person_tone5_tone4",
      "kiss_person_person_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F48F-1F3FF": [
      "kiss_tone5",
      "kiss_dark_skin_tone"
    ],
    "1F469-200D-2764-FE0F-200D-1F48B-200D-1F468": "kiss_woman_man",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_woman_man_tone1",
      "kiss_woman_man_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_woman_man_tone1_tone2",
      "kiss_woman_man_light_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_woman_man_tone1_tone3",
      "kiss_woman_man_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_woman_man_tone1_tone4",
      "kiss_woman_man_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_woman_man_tone1_tone5",
      "kiss_woman_man_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_woman_man_tone2_tone1",
      "kiss_woman_man_medium_light_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_woman_man_tone2",
      "kiss_woman_man_medium_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_woman_man_tone2_tone3",
      "kiss_woman_man_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_woman_man_tone2_tone4",
      "kiss_woman_man_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_woman_man_tone2_tone5",
      "kiss_woman_man_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_woman_man_tone3_tone1",
      "kiss_woman_man_medium_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_woman_man_tone3_tone2",
      "kiss_woman_man_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_woman_man_tone3",
      "kiss_woman_man_medium_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_woman_man_tone3_tone4",
      "kiss_woman_man_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_woman_man_tone3_tone5",
      "kiss_woman_man_medium_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_woman_man_tone4_tone1",
      "kiss_woman_man_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_woman_man_tone4_tone2",
      "kiss_woman_man_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_woman_man_tone4_tone3",
      "kiss_woman_man_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_woman_man_tone4",
      "kiss_woman_man_medium_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_woman_man_tone4_tone5",
      "kiss_woman_man_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_woman_man_tone5_tone1",
      "kiss_woman_man_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_woman_man_tone5_tone2",
      "kiss_woman_man_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_woman_man_tone5_tone3",
      "kiss_woman_man_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_woman_man_tone5_tone4",
      "kiss_woman_man_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_woman_man_tone5",
      "kiss_woman_man_dark_skin_tone"
    ],
    "1F469-200D-2764-FE0F-200D-1F48B-200D-1F469": [
      "kiss_ww",
      "couplekiss_ww"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": [
      "kiss_woman_woman_tone1",
      "kiss_woman_woman_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": [
      "kiss_woman_woman_tone1_tone2",
      "kiss_woman_woman_light_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": [
      "kiss_woman_woman_tone1_tone3",
      "kiss_woman_woman_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": [
      "kiss_woman_woman_tone1_tone4",
      "kiss_woman_woman_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": [
      "kiss_woman_woman_tone1_tone5",
      "kiss_woman_woman_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": [
      "kiss_woman_woman_tone2_tone1",
      "kiss_woman_woman_medium_light_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": [
      "kiss_woman_woman_tone2",
      "kiss_woman_woman_medium_light_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": [
      "kiss_woman_woman_tone2_tone3",
      "kiss_woman_woman_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": [
      "kiss_woman_woman_tone2_tone4",
      "kiss_woman_woman_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": [
      "kiss_woman_woman_tone2_tone5",
      "kiss_woman_woman_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": [
      "kiss_woman_woman_tone3_tone1",
      "kiss_woman_woman_medium_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": [
      "kiss_woman_woman_tone3_tone2",
      "kiss_woman_woman_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": [
      "kiss_woman_woman_tone3",
      "kiss_woman_woman_medium_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": [
      "kiss_woman_woman_tone3_tone4",
      "kiss_woman_woman_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": [
      "kiss_woman_woman_tone3_tone5",
      "kiss_woman_woman_medium_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": [
      "kiss_woman_woman_tone4_tone1",
      "kiss_woman_woman_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": [
      "kiss_woman_woman_tone4_tone2",
      "kiss_woman_woman_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": [
      "kiss_woman_woman_tone4_tone3",
      "kiss_woman_woman_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": [
      "kiss_woman_woman_tone4",
      "kiss_woman_woman_medium_dark_skin_tone"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": [
      "kiss_woman_woman_tone4_tone5",
      "kiss_woman_woman_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": [
      "kiss_woman_woman_tone5_tone1",
      "kiss_woman_woman_dark_skin_tone_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": [
      "kiss_woman_woman_tone5_tone2",
      "kiss_woman_woman_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": [
      "kiss_woman_woman_tone5_tone3",
      "kiss_woman_woman_dark_skin_tone_medium_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": [
      "kiss_woman_woman_tone5_tone4",
      "kiss_woman_woman_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": [
      "kiss_woman_woman_tone5",
      "kiss_woman_woman_dark_skin_tone"
    ],
    "1F468-200D-2764-FE0F-200D-1F48B-200D-1F468": [
      "kiss_mm",
      "couplekiss_mm",
      "kiss_man_man"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_man_man_tone1",
      "kiss_man_man_light_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_man_man_tone1_tone2",
      "kiss_man_man_light_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_man_man_tone1_tone3",
      "kiss_man_man_light_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_man_man_tone1_tone4",
      "kiss_man_man_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_man_man_tone1_tone5",
      "kiss_man_man_light_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_man_man_tone2_tone1",
      "kiss_man_man_medium_light_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_man_man_tone2",
      "kiss_man_man_medium_light_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_man_man_tone2_tone3",
      "kiss_man_man_medium_light_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_man_man_tone2_tone4",
      "kiss_man_man_medium_light_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_man_man_tone2_tone5",
      "kiss_man_man_medium_light_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_man_man_tone3_tone1",
      "kiss_man_man_medium_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_man_man_tone3_tone2",
      "kiss_man_man_medium_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_man_man_tone3",
      "kiss_man_man_medium_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_man_man_tone3_tone4",
      "kiss_man_man_medium_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_man_man_tone3_tone5",
      "kiss_man_man_medium_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_man_man_tone4_tone1",
      "kiss_man_man_medium_dark_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_man_man_tone4_tone2",
      "kiss_man_man_medium_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_man_man_tone4_tone3",
      "kiss_man_man_medium_dark_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_man_man_tone4",
      "kiss_man_man_medium_dark_skin_tone"
    ],
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_man_man_tone4_tone5",
      "kiss_man_man_medium_dark_skin_tone_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_man_man_tone5_tone1",
      "kiss_man_man_dark_skin_tone_light_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_man_man_tone5_tone2",
      "kiss_man_man_dark_skin_tone_medium_light_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_man_man_tone5_tone3",
      "kiss_man_man_dark_skin_tone_medium_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_man_man_tone5_tone4",
      "kiss_man_man_dark_skin_tone_medium_dark_skin_tone"
    ],
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_man_man_tone5",
      "kiss_man_man_dark_skin_tone"
    ],
    "1F46A": "family",
    "1F468-200D-1F469-200D-1F466": "family_man_woman_boy",
    "1F468-200D-1F469-200D-1F467": "family_mwg",
    "1F468-200D-1F469-200D-1F467-200D-1F466": "family_mwgb",
    "1F468-200D-1F469-200D-1F466-200D-1F466": "family_mwbb",
    "1F468-200D-1F469-200D-1F467-200D-1F467": "family_mwgg",
    "1F469-200D-1F469-200D-1F466": "family_wwb",
    "1F469-200D-1F469-200D-1F467": "family_wwg",
    "1F469-200D-1F469-200D-1F467-200D-1F466": "family_wwgb",
    "1F469-200D-1F469-200D-1F466-200D-1F466": "family_wwbb",
    "1F469-200D-1F469-200D-1F467-200D-1F467": "family_wwgg",
    "1F468-200D-1F468-200D-1F466": "family_mmb",
    "1F468-200D-1F468-200D-1F467": "family_mmg",
    "1F468-200D-1F468-200D-1F467-200D-1F466": "family_mmgb",
    "1F468-200D-1F468-200D-1F466-200D-1F466": "family_mmbb",
    "1F468-200D-1F468-200D-1F467-200D-1F467": "family_mmgg",
    "1F469-200D-1F466": "family_woman_boy",
    "1F469-200D-1F467": "family_woman_girl",
    "1F469-200D-1F467-200D-1F466": "family_woman_girl_boy",
    "1F469-200D-1F466-200D-1F466": "family_woman_boy_boy",
    "1F469-200D-1F467-200D-1F467": "family_woman_girl_girl",
    "1F468-200D-1F466": "family_man_boy",
    "1F468-200D-1F467": "family_man_girl",
    "1F468-200D-1F467-200D-1F466": "family_man_girl_boy",
    "1F468-200D-1F466-200D-1F466": "family_man_boy_boy",
    "1F468-200D-1F467-200D-1F467": "family_man_girl_girl",
    "1FAA2": "knot",
    "1F9F6": "yarn",
    "1F9F5": "thread",
    "1FAA1": "sewing_needle",
    "1F9E5": "coat",
    "1F97C": "lab_coat",
    "1F9BA": "safety_vest",
    "1F45A": "womans_clothes",
    "1F455": [
      "shirt",
      "t_shirt"
    ],
    "1F456": "jeans",
    "1FA72": "briefs",
    "1FA73": "shorts",
    "1F454": "necktie",
    "1F457": "dress",
    "1F459": "bikini",
    "1FA71": "one_piece_swimsuit",
    "1F458": "kimono",
    "1F97B": "sari",
    "1FA74": "thong_sandal",
    "1F97F": [
      "womans_flat_shoe",
      "flat_shoe"
    ],
    "1F460": "high_heel",
    "1F461": [
      "sandal",
      "womans_sandal"
    ],
    "1F462": [
      "boot",
      "womans_boot"
    ],
    "1F45E": "mans_shoe",
    "1F45F": [
      "athletic_shoe",
      "running_shoe"
    ],
    "1F97E": "hiking_boot",
    "1F9E6": "socks",
    "1F9E4": "gloves",
    "1F9E3": "scarf",
    "1F3A9": [
      "tophat",
      "top_hat"
    ],
    "1F9E2": "billed_cap",
    "1F452": "womans_hat",
    "1F393": "mortar_board",
    "26D1": [
      "helmet_with_cross",
      "helmet_with_white_cross"
    ],
    "1FA96": "military_helmet",
    "1F451": "crown",
    "1F48D": "ring",
    "1F45D": [
      "pouch",
      "clutch_bag"
    ],
    "1F45B": "purse",
    "1F45C": "handbag",
    "1F4BC": "briefcase",
    "1F392": [
      "school_satchel",
      "backpack"
    ],
    "1F9F3": "luggage",
    "1F453": [
      "eyeglasses",
      "glasses"
    ],
    "1F576": "dark_sunglasses",
    "1F97D": "goggles",
    "1F302": "closed_umbrella",
    "1F9B1": [
      "curly_haired",
      "curly_hair"
    ],
    "1F9B0": [
      "red_haired",
      "red_hair"
    ],
    "1F9B3": [
      "white_haired",
      "white_hair"
    ],
    "1F9B2": "bald",
    "1F436": [
      "dog",
      "dog_face"
    ],
    "1F431": [
      "cat",
      "cat_face"
    ],
    "1F42D": [
      "mouse",
      "mouse_face"
    ],
    "1F439": "hamster",
    "1F430": [
      "rabbit",
      "rabbit_face"
    ],
    "1F98A": [
      "fox",
      "fox_face"
    ],
    "1F43B": "bear",
    "1F43C": [
      "panda_face",
      "panda"
    ],
    "1F43B-200D-2744-FE0F": "polar_bear",
    "1F428": "koala",
    "1F42F": [
      "tiger",
      "tiger_face"
    ],
    "1F981": [
      "lion_face",
      "lion"
    ],
    "1F42E": [
      "cow",
      "cow_face"
    ],
    "1F437": [
      "pig",
      "pig_face"
    ],
    "1F43D": "pig_nose",
    "1F438": "frog",
    "1F435": "monkey_face",
    "1F648": "see_no_evil",
    "1F649": "hear_no_evil",
    "1F64A": "speak_no_evil",
    "1F412": "monkey",
    "1F414": "chicken",
    "1F427": "penguin",
    "1F426": "bird",
    "1F424": "baby_chick",
    "1F423": "hatching_chick",
    "1F425": "hatched_chick",
    "1FABF": "goose",
    "1F986": "duck",
    "1F426-200D-2B1B": "black_bird",
    "1F985": "eagle",
    "1F989": "owl",
    "1F987": "bat",
    "1F43A": "wolf",
    "1F417": "boar",
    "1F434": [
      "horse",
      "horse_face"
    ],
    "1F984": [
      "unicorn",
      "unicorn_face"
    ],
    "1FACE": "moose",
    "1F41D": [
      "bee",
      "honeybee"
    ],
    "1FAB1": "worm",
    "1F41B": "bug",
    "1F98B": "butterfly",
    "1F40C": "snail",
    "1F41E": "lady_beetle",
    "1F41C": "ant",
    "1FAB0": "fly",
    "1FAB2": "beetle",
    "1FAB3": "cockroach",
    "1F99F": "mosquito",
    "1F997": "cricket",
    "1F577": "spider",
    "1F578": "spider_web",
    "1F982": "scorpion",
    "1F422": "turtle",
    "1F40D": "snake",
    "1F98E": "lizard",
    "1F996": "t_rex",
    "1F995": "sauropod",
    "1F419": "octopus",
    "1F991": "squid",
    "1FABC": "jellyfish",
    "1F990": "shrimp",
    "1F99E": "lobster",
    "1F980": "crab",
    "1F421": "blowfish",
    "1F420": "tropical_fish",
    "1F41F": "fish",
    "1F42C": "dolphin",
    "1F433": "whale",
    "1F40B": "whale2",
    "1F988": "shark",
    "1F9AD": "seal",
    "1F40A": "crocodile",
    "1F405": "tiger2",
    "1F406": "leopard",
    "1F993": "zebra",
    "1F98D": "gorilla",
    "1F9A7": "orangutan",
    "1F9A3": "mammoth",
    "1F418": "elephant",
    "1F99B": "hippopotamus",
    "1F98F": [
      "rhino",
      "rhinoceros"
    ],
    "1F42A": "dromedary_camel",
    "1F42B": "camel",
    "1F992": "giraffe",
    "1F998": "kangaroo",
    "1F9AC": "bison",
    "1F403": "water_buffalo",
    "1F402": "ox",
    "1F404": "cow2",
    "1FACF": "donkey",
    "1F40E": "racehorse",
    "1F416": "pig2",
    "1F40F": "ram",
    "1F411": [
      "sheep",
      "ewe"
    ],
    "1F999": "llama",
    "1F410": "goat",
    "1F98C": "deer",
    "1F415": "dog2",
    "1F429": "poodle",
    "1F9AE": "guide_dog",
    "1F415-200D-1F9BA": "service_dog",
    "1F408": "cat2",
    "1F408-200D-2B1B": "black_cat",
    "1FAB6": "feather",
    "1FABD": "wing",
    "1F413": "rooster",
    "1F983": "turkey",
    "1F9A4": "dodo",
    "1F99A": "peacock",
    "1F99C": "parrot",
    "1F9A2": "swan",
    "1F9A9": "flamingo",
    "1F54A": [
      "dove",
      "dove_of_peace"
    ],
    "1F407": "rabbit2",
    "1F99D": "raccoon",
    "1F9A8": "skunk",
    "1F9A1": "badger",
    "1F9AB": "beaver",
    "1F9A6": "otter",
    "1F9A5": "sloth",
    "1F401": "mouse2",
    "1F400": "rat",
    "1F43F": "chipmunk",
    "1F994": "hedgehog",
    "1F43E": [
      "feet",
      "paw_prints"
    ],
    "1F409": "dragon",
    "1F432": "dragon_face",
    "1F335": "cactus",
    "1F384": "christmas_tree",
    "1F332": "evergreen_tree",
    "1F333": "deciduous_tree",
    "1F334": "palm_tree",
    "1FAB5": "wood",
    "1F331": "seedling",
    "1F33F": "herb",
    "1F340": "four_leaf_clover",
    "1F38D": "bamboo",
    "1FAB4": "potted_plant",
    "1F38B": "tanabata_tree",
    "1F343": "leaves",
    "1F342": "fallen_leaf",
    "1F341": "maple_leaf",
    "1FABA": "nest_with_eggs",
    "1FAB9": "empty_nest",
    "1F344": "mushroom",
    "1F41A": [
      "shell",
      "spiral_shell"
    ],
    "1FAB8": "coral",
    "1FAA8": "rock",
    "1F33E": [
      "ear_of_rice",
      "sheaf_of_rice"
    ],
    "1F490": "bouquet",
    "1F337": "tulip",
    "1F339": "rose",
    "1F940": [
      "wilted_rose",
      "wilted_flower"
    ],
    "1FABB": "hyacinth",
    "1FAB7": "lotus",
    "1F33A": "hibiscus",
    "1F338": "cherry_blossom",
    "1F33C": "blossom",
    "1F33B": "sunflower",
    "1F31E": "sun_with_face",
    "1F31D": "full_moon_with_face",
    "1F31B": "first_quarter_moon_with_face",
    "1F31C": "last_quarter_moon_with_face",
    "1F31A": [
      "new_moon_with_face",
      "new_moon_face"
    ],
    "1F315": "full_moon",
    "1F316": "waning_gibbous_moon",
    "1F317": "last_quarter_moon",
    "1F318": "waning_crescent_moon",
    "1F311": "new_moon",
    "1F312": "waxing_crescent_moon",
    "1F313": "first_quarter_moon",
    "1F314": "waxing_gibbous_moon",
    "1F319": "crescent_moon",
    "1F30E": "earth_americas",
    "1F30D": "earth_africa",
    "1F30F": "earth_asia",
    "1FA90": "ringed_planet",
    "1F4AB": "dizzy",
    "2B50": "star",
    "1F31F": [
      "star2",
      "glowing_star"
    ],
    "26A1": [
      "zap",
      "high_voltage"
    ],
    "1F4A5": [
      "boom",
      "collision"
    ],
    "1F525": [
      "fire",
      "flame"
    ],
    "1F32A": [
      "cloud_tornado",
      "cloud_with_tornado",
      "tornado"
    ],
    "1F308": "rainbow",
    "1F324": [
      "white_sun_small_cloud",
      "white_sun_with_small_cloud"
    ],
    "26C5": "partly_sunny",
    "1F325": [
      "white_sun_cloud",
      "white_sun_behind_cloud"
    ],
    "1F326": [
      "white_sun_rain_cloud",
      "white_sun_behind_cloud_with_rain"
    ],
    "1F327": [
      "cloud_rain",
      "cloud_with_rain"
    ],
    "26C8": [
      "thunder_cloud_rain",
      "thunder_cloud_and_rain"
    ],
    "1F329": [
      "cloud_lightning",
      "cloud_with_lightning"
    ],
    "1F328": [
      "cloud_snow",
      "cloud_with_snow"
    ],
    "26C4": "snowman",
    "1F32C": [
      "wind_blowing_face",
      "wind_face"
    ],
    "1F4A8": [
      "dash",
      "dashing_away"
    ],
    "1F4A7": "droplet",
    "1F4A6": "sweat_drops",
    "1FAE7": "bubbles",
    "1F30A": [
      "ocean",
      "water_wave"
    ],
    "1F32B": "fog",
    "1F34F": "green_apple",
    "1F34E": [
      "apple",
      "red_apple"
    ],
    "1F350": "pear",
    "1F34A": "tangerine",
    "1F34B": "lemon",
    "1F34C": "banana",
    "1F349": "watermelon",
    "1F347": "grapes",
    "1F353": "strawberry",
    "1FAD0": "blueberries",
    "1F348": "melon",
    "1F352": "cherries",
    "1F351": "peach",
    "1F96D": "mango",
    "1F34D": "pineapple",
    "1F965": "coconut",
    "1F95D": [
      "kiwi",
      "kiwifruit",
      "kiwi_fruit"
    ],
    "1F345": "tomato",
    "1F346": "eggplant",
    "1F951": "avocado",
    "1FADB": "pea_pod",
    "1F966": "broccoli",
    "1F96C": "leafy_green",
    "1F952": "cucumber",
    "1F336": "hot_pepper",
    "1FAD1": "bell_pepper",
    "1F33D": [
      "corn",
      "ear_of_corn"
    ],
    "1F955": "carrot",
    "1FAD2": "olive",
    "1F9C4": "garlic",
    "1F9C5": "onion",
    "1F954": "potato",
    "1F360": "sweet_potato",
    "1FADA": "ginger_root",
    "1F950": "croissant",
    "1F96F": "bagel",
    "1F35E": "bread",
    "1F956": [
      "french_bread",
      "baguette_bread"
    ],
    "1F968": "pretzel",
    "1F9C0": [
      "cheese",
      "cheese_wedge"
    ],
    "1F95A": "egg",
    "1F373": "cooking",
    "1F9C8": "butter",
    "1F95E": "pancakes",
    "1F9C7": "waffle",
    "1F953": "bacon",
    "1F969": "cut_of_meat",
    "1F357": "poultry_leg",
    "1F356": "meat_on_bone",
    "1F9B4": "bone",
    "1F32D": [
      "hotdog",
      "hot_dog"
    ],
    "1F354": "hamburger",
    "1F35F": [
      "fries",
      "french_fries"
    ],
    "1F355": "pizza",
    "1FAD3": "flatbread",
    "1F96A": "sandwich",
    "1F959": [
      "stuffed_flatbread",
      "stuffed_pita"
    ],
    "1F9C6": "falafel",
    "1F32E": "taco",
    "1F32F": "burrito",
    "1FAD4": "tamale",
    "1F957": [
      "salad",
      "green_salad"
    ],
    "1F958": [
      "shallow_pan_of_food",
      "paella"
    ],
    "1FAD5": "fondue",
    "1F96B": "canned_food",
    "1FAD9": "jar",
    "1F35D": "spaghetti",
    "1F35C": [
      "ramen",
      "steaming_bowl"
    ],
    "1F372": [
      "stew",
      "pot_of_food"
    ],
    "1F35B": [
      "curry",
      "curry_rice"
    ],
    "1F363": "sushi",
    "1F371": [
      "bento",
      "bento_box"
    ],
    "1F95F": "dumpling",
    "1F9AA": "oyster",
    "1F364": "fried_shrimp",
    "1F359": "rice_ball",
    "1F35A": [
      "rice",
      "cooked_rice"
    ],
    "1F358": "rice_cracker",
    "1F365": "fish_cake",
    "1F960": "fortune_cookie",
    "1F96E": "moon_cake",
    "1F362": "oden",
    "1F361": "dango",
    "1F367": "shaved_ice",
    "1F368": "ice_cream",
    "1F366": "icecream",
    "1F967": "pie",
    "1F9C1": "cupcake",
    "1F370": [
      "cake",
      "shortcake"
    ],
    "1F382": [
      "birthday",
      "birthday_cake"
    ],
    "1F36E": [
      "custard",
      "pudding",
      "flan"
    ],
    "1F36D": "lollipop",
    "1F36C": "candy",
    "1F36B": "chocolate_bar",
    "1F37F": "popcorn",
    "1F369": "doughnut",
    "1F36A": "cookie",
    "1F330": "chestnut",
    "1F95C": [
      "peanuts",
      "shelled_peanut"
    ],
    "1FAD8": "beans",
    "1F36F": "honey_pot",
    "1F95B": [
      "milk",
      "glass_of_milk"
    ],
    "1FAD7": "pouring_liquid",
    "1F37C": "baby_bottle",
    "1FAD6": "teapot",
    "1F375": "tea",
    "1F9C9": "mate",
    "1F9C3": "beverage_box",
    "1F964": "cup_with_straw",
    "1F9CB": "bubble_tea",
    "1F376": "sake",
    "1F37A": [
      "beer",
      "beer_mug"
    ],
    "1F37B": "beers",
    "1F942": [
      "champagne_glass",
      "clinking_glass"
    ],
    "1F377": "wine_glass",
    "1F943": [
      "tumbler_glass",
      "whisky"
    ],
    "1F378": "cocktail",
    "1F379": "tropical_drink",
    "1F37E": [
      "champagne",
      "bottle_with_popping_cork"
    ],
    "1F9CA": "ice_cube",
    "1F944": "spoon",
    "1F374": "fork_and_knife",
    "1F37D": [
      "fork_knife_plate",
      "fork_and_knife_with_plate"
    ],
    "1F963": "bowl_with_spoon",
    "1F961": "takeout_box",
    "1F962": "chopsticks",
    "1F9C2": "salt",
    "26BD": [
      "soccer",
      "soccer_ball"
    ],
    "1F3C0": "basketball",
    "1F3C8": "football",
    "26BE": "baseball",
    "1F94E": "softball",
    "1F3BE": "tennis",
    "1F3D0": "volleyball",
    "1F3C9": "rugby_football",
    "1F94F": "flying_disc",
    "1F3B1": "8ball",
    "1FA80": "yo_yo",
    "1F3D3": [
      "ping_pong",
      "table_tennis"
    ],
    "1F3F8": "badminton",
    "1F3D2": [
      "hockey",
      "ice_hockey"
    ],
    "1F3D1": "field_hockey",
    "1F94D": "lacrosse",
    "1F3CF": [
      "cricket_game",
      "cricket_bat_ball"
    ],
    "1FA83": "boomerang",
    "1F945": [
      "goal",
      "goal_net"
    ],
    "26F3": [
      "golf",
      "flag_in_hole"
    ],
    "1FA81": "kite",
    "1F6DD": "playground_slide",
    "1F3F9": [
      "bow_and_arrow",
      "archery"
    ],
    "1F3A3": [
      "fishing_pole_and_fish",
      "fishing_pole"
    ],
    "1F93F": "diving_mask",
    "1F94A": [
      "boxing_glove",
      "boxing_gloves"
    ],
    "1F94B": [
      "martial_arts_uniform",
      "karate_uniform"
    ],
    "1F3BD": [
      "running_shirt_with_sash",
      "running_shirt"
    ],
    "1F6F9": "skateboard",
    "1F6FC": "roller_skate",
    "1F6F7": "sled",
    "26F8": "ice_skate",
    "1F94C": "curling_stone",
    "1F3BF": [
      "ski",
      "skis"
    ],
    "26F7": "skier",
    "1F3C2": "snowboarder",
    "1F3C2-1F3FB": [
      "snowboarder_tone1",
      "snowboarder_light_skin_tone"
    ],
    "1F3C2-1F3FC": [
      "snowboarder_tone2",
      "snowboarder_medium_light_skin_tone"
    ],
    "1F3C2-1F3FD": [
      "snowboarder_tone3",
      "snowboarder_medium_skin_tone"
    ],
    "1F3C2-1F3FE": [
      "snowboarder_tone4",
      "snowboarder_medium_dark_skin_tone"
    ],
    "1F3C2-1F3FF": [
      "snowboarder_tone5",
      "snowboarder_dark_skin_tone"
    ],
    "1FA82": "parachute",
    "1F3CB": [
      "person_lifting_weights",
      "lifter",
      "weight_lifter"
    ],
    "1F3CB-1F3FB": [
      "person_lifting_weights_tone1",
      "lifter_tone1",
      "weight_lifter_tone1"
    ],
    "1F3CB-1F3FC": [
      "person_lifting_weights_tone2",
      "lifter_tone2",
      "weight_lifter_tone2"
    ],
    "1F3CB-1F3FD": [
      "person_lifting_weights_tone3",
      "lifter_tone3",
      "weight_lifter_tone3"
    ],
    "1F3CB-1F3FE": [
      "person_lifting_weights_tone4",
      "lifter_tone4",
      "weight_lifter_tone4"
    ],
    "1F3CB-1F3FF": [
      "person_lifting_weights_tone5",
      "lifter_tone5",
      "weight_lifter_tone5"
    ],
    "1F3CB-FE0F-200D-2640-FE0F": "woman_lifting_weights",
    "1F3CB-1F3FB-200D-2640-FE0F": [
      "woman_lifting_weights_tone1",
      "woman_lifting_weights_light_skin_tone"
    ],
    "1F3CB-1F3FC-200D-2640-FE0F": [
      "woman_lifting_weights_tone2",
      "woman_lifting_weights_medium_light_skin_tone"
    ],
    "1F3CB-1F3FD-200D-2640-FE0F": [
      "woman_lifting_weights_tone3",
      "woman_lifting_weights_medium_skin_tone"
    ],
    "1F3CB-1F3FE-200D-2640-FE0F": [
      "woman_lifting_weights_tone4",
      "woman_lifting_weights_medium_dark_skin_tone"
    ],
    "1F3CB-1F3FF-200D-2640-FE0F": [
      "woman_lifting_weights_tone5",
      "woman_lifting_weights_dark_skin_tone"
    ],
    "1F3CB-FE0F-200D-2642-FE0F": "man_lifting_weights",
    "1F3CB-1F3FB-200D-2642-FE0F": [
      "man_lifting_weights_tone1",
      "man_lifting_weights_light_skin_tone"
    ],
    "1F3CB-1F3FC-200D-2642-FE0F": [
      "man_lifting_weights_tone2",
      "man_lifting_weights_medium_light_skin_tone"
    ],
    "1F3CB-1F3FD-200D-2642-FE0F": [
      "man_lifting_weights_tone3",
      "man_lifting_weights_medium_skin_tone"
    ],
    "1F3CB-1F3FE-200D-2642-FE0F": [
      "man_lifting_weights_tone4",
      "man_lifting_weights_medium_dark_skin_tone"
    ],
    "1F3CB-1F3FF-200D-2642-FE0F": [
      "man_lifting_weights_tone5",
      "man_lifting_weights_dark_skin_tone"
    ],
    "1F93C": [
      "people_wrestling",
      "wrestlers",
      "wrestling"
    ],
    "1F93C-200D-2640-FE0F": "women_wrestling",
    "1F93C-200D-2642-FE0F": "men_wrestling",
    "1F938": [
      "person_doing_cartwheel",
      "cartwheel"
    ],
    "1F938-1F3FB": [
      "person_doing_cartwheel_tone1",
      "cartwheel_tone1"
    ],
    "1F938-1F3FC": [
      "person_doing_cartwheel_tone2",
      "cartwheel_tone2"
    ],
    "1F938-1F3FD": [
      "person_doing_cartwheel_tone3",
      "cartwheel_tone3"
    ],
    "1F938-1F3FE": [
      "person_doing_cartwheel_tone4",
      "cartwheel_tone4"
    ],
    "1F938-1F3FF": [
      "person_doing_cartwheel_tone5",
      "cartwheel_tone5"
    ],
    "1F938-200D-2640-FE0F": "woman_cartwheeling",
    "1F938-1F3FB-200D-2640-FE0F": [
      "woman_cartwheeling_tone1",
      "woman_cartwheeling_light_skin_tone"
    ],
    "1F938-1F3FC-200D-2640-FE0F": [
      "woman_cartwheeling_tone2",
      "woman_cartwheeling_medium_light_skin_tone"
    ],
    "1F938-1F3FD-200D-2640-FE0F": [
      "woman_cartwheeling_tone3",
      "woman_cartwheeling_medium_skin_tone"
    ],
    "1F938-1F3FE-200D-2640-FE0F": [
      "woman_cartwheeling_tone4",
      "woman_cartwheeling_medium_dark_skin_tone"
    ],
    "1F938-1F3FF-200D-2640-FE0F": [
      "woman_cartwheeling_tone5",
      "woman_cartwheeling_dark_skin_tone"
    ],
    "1F938-200D-2642-FE0F": "man_cartwheeling",
    "1F938-1F3FB-200D-2642-FE0F": [
      "man_cartwheeling_tone1",
      "man_cartwheeling_light_skin_tone"
    ],
    "1F938-1F3FC-200D-2642-FE0F": [
      "man_cartwheeling_tone2",
      "man_cartwheeling_medium_light_skin_tone"
    ],
    "1F938-1F3FD-200D-2642-FE0F": [
      "man_cartwheeling_tone3",
      "man_cartwheeling_medium_skin_tone"
    ],
    "1F938-1F3FE-200D-2642-FE0F": [
      "man_cartwheeling_tone4",
      "man_cartwheeling_medium_dark_skin_tone"
    ],
    "1F938-1F3FF-200D-2642-FE0F": [
      "man_cartwheeling_tone5",
      "man_cartwheeling_dark_skin_tone"
    ],
    "26F9": [
      "person_bouncing_ball",
      "basketball_player",
      "person_with_ball"
    ],
    "26F9-1F3FB": [
      "person_bouncing_ball_tone1",
      "basketball_player_tone1",
      "person_with_ball_tone1"
    ],
    "26F9-1F3FC": [
      "person_bouncing_ball_tone2",
      "basketball_player_tone2",
      "person_with_ball_tone2"
    ],
    "26F9-1F3FD": [
      "person_bouncing_ball_tone3",
      "basketball_player_tone3",
      "person_with_ball_tone3"
    ],
    "26F9-1F3FE": [
      "person_bouncing_ball_tone4",
      "basketball_player_tone4",
      "person_with_ball_tone4"
    ],
    "26F9-1F3FF": [
      "person_bouncing_ball_tone5",
      "basketball_player_tone5",
      "person_with_ball_tone5"
    ],
    "26F9-FE0F-200D-2640-FE0F": "woman_bouncing_ball",
    "26F9-1F3FB-200D-2640-FE0F": [
      "woman_bouncing_ball_tone1",
      "woman_bouncing_ball_light_skin_tone"
    ],
    "26F9-1F3FC-200D-2640-FE0F": [
      "woman_bouncing_ball_tone2",
      "woman_bouncing_ball_medium_light_skin_tone"
    ],
    "26F9-1F3FD-200D-2640-FE0F": [
      "woman_bouncing_ball_tone3",
      "woman_bouncing_ball_medium_skin_tone"
    ],
    "26F9-1F3FE-200D-2640-FE0F": [
      "woman_bouncing_ball_tone4",
      "woman_bouncing_ball_medium_dark_skin_tone"
    ],
    "26F9-1F3FF-200D-2640-FE0F": [
      "woman_bouncing_ball_tone5",
      "woman_bouncing_ball_dark_skin_tone"
    ],
    "26F9-FE0F-200D-2642-FE0F": "man_bouncing_ball",
    "26F9-1F3FB-200D-2642-FE0F": [
      "man_bouncing_ball_tone1",
      "man_bouncing_ball_light_skin_tone"
    ],
    "26F9-1F3FC-200D-2642-FE0F": [
      "man_bouncing_ball_tone2",
      "man_bouncing_ball_medium_light_skin_tone"
    ],
    "26F9-1F3FD-200D-2642-FE0F": [
      "man_bouncing_ball_tone3",
      "man_bouncing_ball_medium_skin_tone"
    ],
    "26F9-1F3FE-200D-2642-FE0F": [
      "man_bouncing_ball_tone4",
      "man_bouncing_ball_medium_dark_skin_tone"
    ],
    "26F9-1F3FF-200D-2642-FE0F": [
      "man_bouncing_ball_tone5",
      "man_bouncing_ball_dark_skin_tone"
    ],
    "1F93A": [
      "person_fencing",
      "fencer",
      "fencing"
    ],
    "1F93E": [
      "person_playing_handball",
      "handball"
    ],
    "1F93E-1F3FB": [
      "person_playing_handball_tone1",
      "handball_tone1"
    ],
    "1F93E-1F3FC": [
      "person_playing_handball_tone2",
      "handball_tone2"
    ],
    "1F93E-1F3FD": [
      "person_playing_handball_tone3",
      "handball_tone3"
    ],
    "1F93E-1F3FE": [
      "person_playing_handball_tone4",
      "handball_tone4"
    ],
    "1F93E-1F3FF": [
      "person_playing_handball_tone5",
      "handball_tone5"
    ],
    "1F93E-200D-2640-FE0F": "woman_playing_handball",
    "1F93E-1F3FB-200D-2640-FE0F": [
      "woman_playing_handball_tone1",
      "woman_playing_handball_light_skin_tone"
    ],
    "1F93E-1F3FC-200D-2640-FE0F": [
      "woman_playing_handball_tone2",
      "woman_playing_handball_medium_light_skin_tone"
    ],
    "1F93E-1F3FD-200D-2640-FE0F": [
      "woman_playing_handball_tone3",
      "woman_playing_handball_medium_skin_tone"
    ],
    "1F93E-1F3FE-200D-2640-FE0F": [
      "woman_playing_handball_tone4",
      "woman_playing_handball_medium_dark_skin_tone"
    ],
    "1F93E-1F3FF-200D-2640-FE0F": [
      "woman_playing_handball_tone5",
      "woman_playing_handball_dark_skin_tone"
    ],
    "1F93E-200D-2642-FE0F": "man_playing_handball",
    "1F93E-1F3FB-200D-2642-FE0F": [
      "man_playing_handball_tone1",
      "man_playing_handball_light_skin_tone"
    ],
    "1F93E-1F3FC-200D-2642-FE0F": [
      "man_playing_handball_tone2",
      "man_playing_handball_medium_light_skin_tone"
    ],
    "1F93E-1F3FD-200D-2642-FE0F": [
      "man_playing_handball_tone3",
      "man_playing_handball_medium_skin_tone"
    ],
    "1F93E-1F3FE-200D-2642-FE0F": [
      "man_playing_handball_tone4",
      "man_playing_handball_medium_dark_skin_tone"
    ],
    "1F93E-1F3FF-200D-2642-FE0F": [
      "man_playing_handball_tone5",
      "man_playing_handball_dark_skin_tone"
    ],
    "1F3CC": [
      "person_golfing",
      "golfer"
    ],
    "1F3CC-1F3FB": [
      "person_golfing_tone1",
      "person_golfing_light_skin_tone"
    ],
    "1F3CC-1F3FC": [
      "person_golfing_tone2",
      "person_golfing_medium_light_skin_tone"
    ],
    "1F3CC-1F3FD": [
      "person_golfing_tone3",
      "person_golfing_medium_skin_tone"
    ],
    "1F3CC-1F3FE": [
      "person_golfing_tone4",
      "person_golfing_medium_dark_skin_tone"
    ],
    "1F3CC-1F3FF": [
      "person_golfing_tone5",
      "person_golfing_dark_skin_tone"
    ],
    "1F3CC-FE0F-200D-2640-FE0F": "woman_golfing",
    "1F3CC-1F3FB-200D-2640-FE0F": [
      "woman_golfing_tone1",
      "woman_golfing_light_skin_tone"
    ],
    "1F3CC-1F3FC-200D-2640-FE0F": [
      "woman_golfing_tone2",
      "woman_golfing_medium_light_skin_tone"
    ],
    "1F3CC-1F3FD-200D-2640-FE0F": [
      "woman_golfing_tone3",
      "woman_golfing_medium_skin_tone"
    ],
    "1F3CC-1F3FE-200D-2640-FE0F": [
      "woman_golfing_tone4",
      "woman_golfing_medium_dark_skin_tone"
    ],
    "1F3CC-1F3FF-200D-2640-FE0F": [
      "woman_golfing_tone5",
      "woman_golfing_dark_skin_tone"
    ],
    "1F3CC-FE0F-200D-2642-FE0F": "man_golfing",
    "1F3CC-1F3FB-200D-2642-FE0F": [
      "man_golfing_tone1",
      "man_golfing_light_skin_tone"
    ],
    "1F3CC-1F3FC-200D-2642-FE0F": [
      "man_golfing_tone2",
      "man_golfing_medium_light_skin_tone"
    ],
    "1F3CC-1F3FD-200D-2642-FE0F": [
      "man_golfing_tone3",
      "man_golfing_medium_skin_tone"
    ],
    "1F3CC-1F3FE-200D-2642-FE0F": [
      "man_golfing_tone4",
      "man_golfing_medium_dark_skin_tone"
    ],
    "1F3CC-1F3FF-200D-2642-FE0F": [
      "man_golfing_tone5",
      "man_golfing_dark_skin_tone"
    ],
    "1F3C7": "horse_racing",
    "1F3C7-1F3FB": "horse_racing_tone1",
    "1F3C7-1F3FC": "horse_racing_tone2",
    "1F3C7-1F3FD": "horse_racing_tone3",
    "1F3C7-1F3FE": "horse_racing_tone4",
    "1F3C7-1F3FF": "horse_racing_tone5",
    "1F9D8": "person_in_lotus_position",
    "1F9D8-1F3FB": [
      "person_in_lotus_position_tone1",
      "person_in_lotus_position_light_skin_tone"
    ],
    "1F9D8-1F3FC": [
      "person_in_lotus_position_tone2",
      "person_in_lotus_position_medium_light_skin_tone"
    ],
    "1F9D8-1F3FD": [
      "person_in_lotus_position_tone3",
      "person_in_lotus_position_medium_skin_tone"
    ],
    "1F9D8-1F3FE": [
      "person_in_lotus_position_tone4",
      "person_in_lotus_position_medium_dark_skin_tone"
    ],
    "1F9D8-1F3FF": [
      "person_in_lotus_position_tone5",
      "person_in_lotus_position_dark_skin_tone"
    ],
    "1F9D8-200D-2640-FE0F": "woman_in_lotus_position",
    "1F9D8-1F3FB-200D-2640-FE0F": [
      "woman_in_lotus_position_tone1",
      "woman_in_lotus_position_light_skin_tone"
    ],
    "1F9D8-1F3FC-200D-2640-FE0F": [
      "woman_in_lotus_position_tone2",
      "woman_in_lotus_position_medium_light_skin_tone"
    ],
    "1F9D8-1F3FD-200D-2640-FE0F": [
      "woman_in_lotus_position_tone3",
      "woman_in_lotus_position_medium_skin_tone"
    ],
    "1F9D8-1F3FE-200D-2640-FE0F": [
      "woman_in_lotus_position_tone4",
      "woman_in_lotus_position_medium_dark_skin_tone"
    ],
    "1F9D8-1F3FF-200D-2640-FE0F": [
      "woman_in_lotus_position_tone5",
      "woman_in_lotus_position_dark_skin_tone"
    ],
    "1F9D8-200D-2642-FE0F": "man_in_lotus_position",
    "1F9D8-1F3FB-200D-2642-FE0F": [
      "man_in_lotus_position_tone1",
      "man_in_lotus_position_light_skin_tone"
    ],
    "1F9D8-1F3FC-200D-2642-FE0F": [
      "man_in_lotus_position_tone2",
      "man_in_lotus_position_medium_light_skin_tone"
    ],
    "1F9D8-1F3FD-200D-2642-FE0F": [
      "man_in_lotus_position_tone3",
      "man_in_lotus_position_medium_skin_tone"
    ],
    "1F9D8-1F3FE-200D-2642-FE0F": [
      "man_in_lotus_position_tone4",
      "man_in_lotus_position_medium_dark_skin_tone"
    ],
    "1F9D8-1F3FF-200D-2642-FE0F": [
      "man_in_lotus_position_tone5",
      "man_in_lotus_position_dark_skin_tone"
    ],
    "1F3C4": [
      "person_surfing",
      "surfer"
    ],
    "1F3C4-1F3FB": [
      "person_surfing_tone1",
      "surfer_tone1"
    ],
    "1F3C4-1F3FC": [
      "person_surfing_tone2",
      "surfer_tone2"
    ],
    "1F3C4-1F3FD": [
      "person_surfing_tone3",
      "surfer_tone3"
    ],
    "1F3C4-1F3FE": [
      "person_surfing_tone4",
      "surfer_tone4"
    ],
    "1F3C4-1F3FF": [
      "person_surfing_tone5",
      "surfer_tone5"
    ],
    "1F3C4-200D-2640-FE0F": "woman_surfing",
    "1F3C4-1F3FB-200D-2640-FE0F": [
      "woman_surfing_tone1",
      "woman_surfing_light_skin_tone"
    ],
    "1F3C4-1F3FC-200D-2640-FE0F": [
      "woman_surfing_tone2",
      "woman_surfing_medium_light_skin_tone"
    ],
    "1F3C4-1F3FD-200D-2640-FE0F": [
      "woman_surfing_tone3",
      "woman_surfing_medium_skin_tone"
    ],
    "1F3C4-1F3FE-200D-2640-FE0F": [
      "woman_surfing_tone4",
      "woman_surfing_medium_dark_skin_tone"
    ],
    "1F3C4-1F3FF-200D-2640-FE0F": [
      "woman_surfing_tone5",
      "woman_surfing_dark_skin_tone"
    ],
    "1F3C4-200D-2642-FE0F": "man_surfing",
    "1F3C4-1F3FB-200D-2642-FE0F": [
      "man_surfing_tone1",
      "man_surfing_light_skin_tone"
    ],
    "1F3C4-1F3FC-200D-2642-FE0F": [
      "man_surfing_tone2",
      "man_surfing_medium_light_skin_tone"
    ],
    "1F3C4-1F3FD-200D-2642-FE0F": [
      "man_surfing_tone3",
      "man_surfing_medium_skin_tone"
    ],
    "1F3C4-1F3FE-200D-2642-FE0F": [
      "man_surfing_tone4",
      "man_surfing_medium_dark_skin_tone"
    ],
    "1F3C4-1F3FF-200D-2642-FE0F": [
      "man_surfing_tone5",
      "man_surfing_dark_skin_tone"
    ],
    "1F3CA": [
      "person_swimming",
      "swimmer"
    ],
    "1F3CA-1F3FB": [
      "person_swimming_tone1",
      "swimmer_tone1"
    ],
    "1F3CA-1F3FC": [
      "person_swimming_tone2",
      "swimmer_tone2"
    ],
    "1F3CA-1F3FD": [
      "person_swimming_tone3",
      "swimmer_tone3"
    ],
    "1F3CA-1F3FE": [
      "person_swimming_tone4",
      "swimmer_tone4"
    ],
    "1F3CA-1F3FF": [
      "person_swimming_tone5",
      "swimmer_tone5"
    ],
    "1F3CA-200D-2640-FE0F": "woman_swimming",
    "1F3CA-1F3FB-200D-2640-FE0F": [
      "woman_swimming_tone1",
      "woman_swimming_light_skin_tone"
    ],
    "1F3CA-1F3FC-200D-2640-FE0F": [
      "woman_swimming_tone2",
      "woman_swimming_medium_light_skin_tone"
    ],
    "1F3CA-1F3FD-200D-2640-FE0F": [
      "woman_swimming_tone3",
      "woman_swimming_medium_skin_tone"
    ],
    "1F3CA-1F3FE-200D-2640-FE0F": [
      "woman_swimming_tone4",
      "woman_swimming_medium_dark_skin_tone"
    ],
    "1F3CA-1F3FF-200D-2640-FE0F": [
      "woman_swimming_tone5",
      "woman_swimming_dark_skin_tone"
    ],
    "1F3CA-200D-2642-FE0F": "man_swimming",
    "1F3CA-1F3FB-200D-2642-FE0F": [
      "man_swimming_tone1",
      "man_swimming_light_skin_tone"
    ],
    "1F3CA-1F3FC-200D-2642-FE0F": [
      "man_swimming_tone2",
      "man_swimming_medium_light_skin_tone"
    ],
    "1F3CA-1F3FD-200D-2642-FE0F": [
      "man_swimming_tone3",
      "man_swimming_medium_skin_tone"
    ],
    "1F3CA-1F3FE-200D-2642-FE0F": [
      "man_swimming_tone4",
      "man_swimming_medium_dark_skin_tone"
    ],
    "1F3CA-1F3FF-200D-2642-FE0F": [
      "man_swimming_tone5",
      "man_swimming_dark_skin_tone"
    ],
    "1F93D": [
      "person_playing_water_polo",
      "water_polo"
    ],
    "1F93D-1F3FB": [
      "person_playing_water_polo_tone1",
      "water_polo_tone1"
    ],
    "1F93D-1F3FC": [
      "person_playing_water_polo_tone2",
      "water_polo_tone2"
    ],
    "1F93D-1F3FD": [
      "person_playing_water_polo_tone3",
      "water_polo_tone3"
    ],
    "1F93D-1F3FE": [
      "person_playing_water_polo_tone4",
      "water_polo_tone4"
    ],
    "1F93D-1F3FF": [
      "person_playing_water_polo_tone5",
      "water_polo_tone5"
    ],
    "1F93D-200D-2640-FE0F": "woman_playing_water_polo",
    "1F93D-1F3FB-200D-2640-FE0F": [
      "woman_playing_water_polo_tone1",
      "woman_playing_water_polo_light_skin_tone"
    ],
    "1F93D-1F3FC-200D-2640-FE0F": [
      "woman_playing_water_polo_tone2",
      "woman_playing_water_polo_medium_light_skin_tone"
    ],
    "1F93D-1F3FD-200D-2640-FE0F": [
      "woman_playing_water_polo_tone3",
      "woman_playing_water_polo_medium_skin_tone"
    ],
    "1F93D-1F3FE-200D-2640-FE0F": [
      "woman_playing_water_polo_tone4",
      "woman_playing_water_polo_medium_dark_skin_tone"
    ],
    "1F93D-1F3FF-200D-2640-FE0F": [
      "woman_playing_water_polo_tone5",
      "woman_playing_water_polo_dark_skin_tone"
    ],
    "1F93D-200D-2642-FE0F": "man_playing_water_polo",
    "1F93D-1F3FB-200D-2642-FE0F": [
      "man_playing_water_polo_tone1",
      "man_playing_water_polo_light_skin_tone"
    ],
    "1F93D-1F3FC-200D-2642-FE0F": [
      "man_playing_water_polo_tone2",
      "man_playing_water_polo_medium_light_skin_tone"
    ],
    "1F93D-1F3FD-200D-2642-FE0F": [
      "man_playing_water_polo_tone3",
      "man_playing_water_polo_medium_skin_tone"
    ],
    "1F93D-1F3FE-200D-2642-FE0F": [
      "man_playing_water_polo_tone4",
      "man_playing_water_polo_medium_dark_skin_tone"
    ],
    "1F93D-1F3FF-200D-2642-FE0F": [
      "man_playing_water_polo_tone5",
      "man_playing_water_polo_dark_skin_tone"
    ],
    "1F6A3": [
      "person_rowing_boat",
      "rowboat"
    ],
    "1F6A3-1F3FB": [
      "person_rowing_boat_tone1",
      "rowboat_tone1"
    ],
    "1F6A3-1F3FC": [
      "person_rowing_boat_tone2",
      "rowboat_tone2"
    ],
    "1F6A3-1F3FD": [
      "person_rowing_boat_tone3",
      "rowboat_tone3"
    ],
    "1F6A3-1F3FE": [
      "person_rowing_boat_tone4",
      "rowboat_tone4"
    ],
    "1F6A3-1F3FF": [
      "person_rowing_boat_tone5",
      "rowboat_tone5"
    ],
    "1F6A3-200D-2640-FE0F": "woman_rowing_boat",
    "1F6A3-1F3FB-200D-2640-FE0F": [
      "woman_rowing_boat_tone1",
      "woman_rowing_boat_light_skin_tone"
    ],
    "1F6A3-1F3FC-200D-2640-FE0F": [
      "woman_rowing_boat_tone2",
      "woman_rowing_boat_medium_light_skin_tone"
    ],
    "1F6A3-1F3FD-200D-2640-FE0F": [
      "woman_rowing_boat_tone3",
      "woman_rowing_boat_medium_skin_tone"
    ],
    "1F6A3-1F3FE-200D-2640-FE0F": [
      "woman_rowing_boat_tone4",
      "woman_rowing_boat_medium_dark_skin_tone"
    ],
    "1F6A3-1F3FF-200D-2640-FE0F": [
      "woman_rowing_boat_tone5",
      "woman_rowing_boat_dark_skin_tone"
    ],
    "1F6A3-200D-2642-FE0F": "man_rowing_boat",
    "1F6A3-1F3FB-200D-2642-FE0F": [
      "man_rowing_boat_tone1",
      "man_rowing_boat_light_skin_tone"
    ],
    "1F6A3-1F3FC-200D-2642-FE0F": [
      "man_rowing_boat_tone2",
      "man_rowing_boat_medium_light_skin_tone"
    ],
    "1F6A3-1F3FD-200D-2642-FE0F": [
      "man_rowing_boat_tone3",
      "man_rowing_boat_medium_skin_tone"
    ],
    "1F6A3-1F3FE-200D-2642-FE0F": [
      "man_rowing_boat_tone4",
      "man_rowing_boat_medium_dark_skin_tone"
    ],
    "1F6A3-1F3FF-200D-2642-FE0F": [
      "man_rowing_boat_tone5",
      "man_rowing_boat_dark_skin_tone"
    ],
    "1F9D7": "person_climbing",
    "1F9D7-1F3FB": [
      "person_climbing_tone1",
      "person_climbing_light_skin_tone"
    ],
    "1F9D7-1F3FC": [
      "person_climbing_tone2",
      "person_climbing_medium_light_skin_tone"
    ],
    "1F9D7-1F3FD": [
      "person_climbing_tone3",
      "person_climbing_medium_skin_tone"
    ],
    "1F9D7-1F3FE": [
      "person_climbing_tone4",
      "person_climbing_medium_dark_skin_tone"
    ],
    "1F9D7-1F3FF": [
      "person_climbing_tone5",
      "person_climbing_dark_skin_tone"
    ],
    "1F9D7-200D-2640-FE0F": "woman_climbing",
    "1F9D7-1F3FB-200D-2640-FE0F": [
      "woman_climbing_tone1",
      "woman_climbing_light_skin_tone"
    ],
    "1F9D7-1F3FC-200D-2640-FE0F": [
      "woman_climbing_tone2",
      "woman_climbing_medium_light_skin_tone"
    ],
    "1F9D7-1F3FD-200D-2640-FE0F": [
      "woman_climbing_tone3",
      "woman_climbing_medium_skin_tone"
    ],
    "1F9D7-1F3FE-200D-2640-FE0F": [
      "woman_climbing_tone4",
      "woman_climbing_medium_dark_skin_tone"
    ],
    "1F9D7-1F3FF-200D-2640-FE0F": [
      "woman_climbing_tone5",
      "woman_climbing_dark_skin_tone"
    ],
    "1F9D7-200D-2642-FE0F": "man_climbing",
    "1F9D7-1F3FB-200D-2642-FE0F": [
      "man_climbing_tone1",
      "man_climbing_light_skin_tone"
    ],
    "1F9D7-1F3FC-200D-2642-FE0F": [
      "man_climbing_tone2",
      "man_climbing_medium_light_skin_tone"
    ],
    "1F9D7-1F3FD-200D-2642-FE0F": [
      "man_climbing_tone3",
      "man_climbing_medium_skin_tone"
    ],
    "1F9D7-1F3FE-200D-2642-FE0F": [
      "man_climbing_tone4",
      "man_climbing_medium_dark_skin_tone"
    ],
    "1F9D7-1F3FF-200D-2642-FE0F": [
      "man_climbing_tone5",
      "man_climbing_dark_skin_tone"
    ],
    "1F6B5": [
      "person_mountain_biking",
      "mountain_bicyclist"
    ],
    "1F6B5-1F3FB": [
      "person_mountain_biking_tone1",
      "mountain_bicyclist_tone1"
    ],
    "1F6B5-1F3FC": [
      "person_mountain_biking_tone2",
      "mountain_bicyclist_tone2"
    ],
    "1F6B5-1F3FD": [
      "person_mountain_biking_tone3",
      "mountain_bicyclist_tone3"
    ],
    "1F6B5-1F3FE": [
      "person_mountain_biking_tone4",
      "mountain_bicyclist_tone4"
    ],
    "1F6B5-1F3FF": [
      "person_mountain_biking_tone5",
      "mountain_bicyclist_tone5"
    ],
    "1F6B5-200D-2640-FE0F": "woman_mountain_biking",
    "1F6B5-1F3FB-200D-2640-FE0F": [
      "woman_mountain_biking_tone1",
      "woman_mountain_biking_light_skin_tone"
    ],
    "1F6B5-1F3FC-200D-2640-FE0F": [
      "woman_mountain_biking_tone2",
      "woman_mountain_biking_medium_light_skin_tone"
    ],
    "1F6B5-1F3FD-200D-2640-FE0F": [
      "woman_mountain_biking_tone3",
      "woman_mountain_biking_medium_skin_tone"
    ],
    "1F6B5-1F3FE-200D-2640-FE0F": [
      "woman_mountain_biking_tone4",
      "woman_mountain_biking_medium_dark_skin_tone"
    ],
    "1F6B5-1F3FF-200D-2640-FE0F": [
      "woman_mountain_biking_tone5",
      "woman_mountain_biking_dark_skin_tone"
    ],
    "1F6B5-200D-2642-FE0F": "man_mountain_biking",
    "1F6B5-1F3FB-200D-2642-FE0F": [
      "man_mountain_biking_tone1",
      "man_mountain_biking_light_skin_tone"
    ],
    "1F6B5-1F3FC-200D-2642-FE0F": [
      "man_mountain_biking_tone2",
      "man_mountain_biking_medium_light_skin_tone"
    ],
    "1F6B5-1F3FD-200D-2642-FE0F": [
      "man_mountain_biking_tone3",
      "man_mountain_biking_medium_skin_tone"
    ],
    "1F6B5-1F3FE-200D-2642-FE0F": [
      "man_mountain_biking_tone4",
      "man_mountain_biking_medium_dark_skin_tone"
    ],
    "1F6B5-1F3FF-200D-2642-FE0F": [
      "man_mountain_biking_tone5",
      "man_mountain_biking_dark_skin_tone"
    ],
    "1F6B4": [
      "person_biking",
      "bicyclist"
    ],
    "1F6B4-1F3FB": [
      "person_biking_tone1",
      "bicyclist_tone1"
    ],
    "1F6B4-1F3FC": [
      "person_biking_tone2",
      "bicyclist_tone2"
    ],
    "1F6B4-1F3FD": [
      "person_biking_tone3",
      "bicyclist_tone3"
    ],
    "1F6B4-1F3FE": [
      "person_biking_tone4",
      "bicyclist_tone4"
    ],
    "1F6B4-1F3FF": [
      "person_biking_tone5",
      "bicyclist_tone5"
    ],
    "1F6B4-200D-2640-FE0F": "woman_biking",
    "1F6B4-1F3FB-200D-2640-FE0F": [
      "woman_biking_tone1",
      "woman_biking_light_skin_tone"
    ],
    "1F6B4-1F3FC-200D-2640-FE0F": [
      "woman_biking_tone2",
      "woman_biking_medium_light_skin_tone"
    ],
    "1F6B4-1F3FD-200D-2640-FE0F": [
      "woman_biking_tone3",
      "woman_biking_medium_skin_tone"
    ],
    "1F6B4-1F3FE-200D-2640-FE0F": [
      "woman_biking_tone4",
      "woman_biking_medium_dark_skin_tone"
    ],
    "1F6B4-1F3FF-200D-2640-FE0F": [
      "woman_biking_tone5",
      "woman_biking_dark_skin_tone"
    ],
    "1F6B4-200D-2642-FE0F": "man_biking",
    "1F6B4-1F3FB-200D-2642-FE0F": [
      "man_biking_tone1",
      "man_biking_light_skin_tone"
    ],
    "1F6B4-1F3FC-200D-2642-FE0F": [
      "man_biking_tone2",
      "man_biking_medium_light_skin_tone"
    ],
    "1F6B4-1F3FD-200D-2642-FE0F": [
      "man_biking_tone3",
      "man_biking_medium_skin_tone"
    ],
    "1F6B4-1F3FE-200D-2642-FE0F": [
      "man_biking_tone4",
      "man_biking_medium_dark_skin_tone"
    ],
    "1F6B4-1F3FF-200D-2642-FE0F": [
      "man_biking_tone5",
      "man_biking_dark_skin_tone"
    ],
    "1F3C6": "trophy",
    "1F947": [
      "first_place",
      "first_place_medal"
    ],
    "1F948": [
      "second_place",
      "second_place_medal"
    ],
    "1F949": [
      "third_place",
      "third_place_medal"
    ],
    "1F3C5": [
      "medal",
      "sports_medal"
    ],
    "1F396": "military_medal",
    "1F3F5": "rosette",
    "1F397": "reminder_ribbon",
    "1F3AB": "ticket",
    "1F39F": [
      "tickets",
      "admission_tickets"
    ],
    "1F3AA": "circus_tent",
    "1F939": [
      "person_juggling",
      "juggling",
      "juggler"
    ],
    "1F939-1F3FB": [
      "person_juggling_tone1",
      "juggling_tone1",
      "juggler_tone1"
    ],
    "1F939-1F3FC": [
      "person_juggling_tone2",
      "juggling_tone2",
      "juggler_tone2"
    ],
    "1F939-1F3FD": [
      "person_juggling_tone3",
      "juggling_tone3",
      "juggler_tone3"
    ],
    "1F939-1F3FE": [
      "person_juggling_tone4",
      "juggling_tone4",
      "juggler_tone4"
    ],
    "1F939-1F3FF": [
      "person_juggling_tone5",
      "juggling_tone5",
      "juggler_tone5"
    ],
    "1F939-200D-2640-FE0F": "woman_juggling",
    "1F939-1F3FB-200D-2640-FE0F": [
      "woman_juggling_tone1",
      "woman_juggling_light_skin_tone"
    ],
    "1F939-1F3FC-200D-2640-FE0F": [
      "woman_juggling_tone2",
      "woman_juggling_medium_light_skin_tone"
    ],
    "1F939-1F3FD-200D-2640-FE0F": [
      "woman_juggling_tone3",
      "woman_juggling_medium_skin_tone"
    ],
    "1F939-1F3FE-200D-2640-FE0F": [
      "woman_juggling_tone4",
      "woman_juggling_medium_dark_skin_tone"
    ],
    "1F939-1F3FF-200D-2640-FE0F": [
      "woman_juggling_tone5",
      "woman_juggling_dark_skin_tone"
    ],
    "1F939-200D-2642-FE0F": "man_juggling",
    "1F939-1F3FB-200D-2642-FE0F": [
      "man_juggling_tone1",
      "man_juggling_light_skin_tone"
    ],
    "1F939-1F3FC-200D-2642-FE0F": [
      "man_juggling_tone2",
      "man_juggling_medium_light_skin_tone"
    ],
    "1F939-1F3FD-200D-2642-FE0F": [
      "man_juggling_tone3",
      "man_juggling_medium_skin_tone"
    ],
    "1F939-1F3FE-200D-2642-FE0F": [
      "man_juggling_tone4",
      "man_juggling_medium_dark_skin_tone"
    ],
    "1F939-1F3FF-200D-2642-FE0F": [
      "man_juggling_tone5",
      "man_juggling_dark_skin_tone"
    ],
    "1F3AD": "performing_arts",
    "1FA70": "ballet_shoes",
    "1F3A8": "art",
    "1F3AC": [
      "clapper",
      "clapper_board"
    ],
    "1F3A4": "microphone",
    "1F3A7": [
      "headphones",
      "headphone"
    ],
    "1F3BC": "musical_score",
    "1F3B9": "musical_keyboard",
    "1FA87": "maracas",
    "1F941": [
      "drum",
      "drum_with_drumsticks"
    ],
    "1FA98": "long_drum",
    "1F3B7": "saxophone",
    "1F3BA": "trumpet",
    "1FA97": "accordion",
    "1F3B8": "guitar",
    "1FA95": "banjo",
    "1F3BB": "violin",
    "1FA88": "flute",
    "1F3B2": "game_die",
    "265F": "chess_pawn",
    "1F3AF": [
      "dart",
      "direct_hit"
    ],
    "1F3B3": "bowling",
    "1F3AE": "video_game",
    "1F3B0": "slot_machine",
    "1F9E9": [
      "jigsaw",
      "puzzle_piece"
    ],
    "1F697": [
      "red_car",
      "automobile"
    ],
    "1F695": "taxi",
    "1F699": "blue_car",
    "1F6FB": "pickup_truck",
    "1F690": "minibus",
    "1F68C": "bus",
    "1F68E": "trolleybus",
    "1F3CE": [
      "race_car",
      "racing_car"
    ],
    "1F693": "police_car",
    "1F691": "ambulance",
    "1F692": "fire_engine",
    "1F69A": "truck",
    "1F69B": "articulated_lorry",
    "1F69C": "tractor",
    "1F9AF": "probing_cane",
    "1F9BD": "manual_wheelchair",
    "1F9BC": "motorized_wheelchair",
    "1FA7C": "crutch",
    "1F6F4": [
      "scooter",
      "kick_scooter"
    ],
    "1F6B2": [
      "bike",
      "bicycle"
    ],
    "1F6F5": [
      "motor_scooter",
      "motorbike"
    ],
    "1F3CD": [
      "motorcycle",
      "racing_motorcycle"
    ],
    "1F6FA": "auto_rickshaw",
    "1F6DE": "wheel",
    "1F6A8": "rotating_light",
    "1F694": "oncoming_police_car",
    "1F68D": "oncoming_bus",
    "1F698": "oncoming_automobile",
    "1F696": "oncoming_taxi",
    "1F6A1": "aerial_tramway",
    "1F6A0": "mountain_cableway",
    "1F69F": "suspension_railway",
    "1F683": "railway_car",
    "1F68B": [
      "train",
      "tram_car"
    ],
    "1F69E": "mountain_railway",
    "1F69D": "monorail",
    "1F684": "bullettrain_side",
    "1F685": [
      "bullettrain_front",
      "bullet_train"
    ],
    "1F688": "light_rail",
    "1F682": [
      "steam_locomotive",
      "locomotive"
    ],
    "1F686": "train2",
    "1F687": "metro",
    "1F68A": "tram",
    "1F689": "station",
    "1F6EB": "airplane_departure",
    "1F6EC": "airplane_arriving",
    "1F6E9": [
      "airplane_small",
      "small_airplane"
    ],
    "1F4BA": "seat",
    "1F6F0": "satellite_orbital",
    "1F680": "rocket",
    "1F6F8": "flying_saucer",
    "1F681": "helicopter",
    "1F6F6": [
      "canoe",
      "kayak"
    ],
    "26F5": "sailboat",
    "1F6A4": "speedboat",
    "1F6E5": [
      "motorboat",
      "motor_boat"
    ],
    "1F6F3": [
      "cruise_ship",
      "passenger_ship"
    ],
    "26F4": "ferry",
    "1F6A2": "ship",
    "1F6DF": "ring_buoy",
    "1FA9D": "hook",
    "26FD": [
      "fuelpump",
      "fuel_pump"
    ],
    "1F6A7": "construction",
    "1F6A6": "vertical_traffic_light",
    "1F6A5": "traffic_light",
    "1F68F": [
      "busstop",
      "bus_stop"
    ],
    "1F5FA": [
      "map",
      "world_map"
    ],
    "1F5FF": [
      "moyai",
      "moai"
    ],
    "1F5FD": "statue_of_liberty",
    "1F5FC": "tokyo_tower",
    "1F3F0": [
      "european_castle",
      "castle"
    ],
    "1F3EF": "japanese_castle",
    "1F3DF": "stadium",
    "1F3A1": "ferris_wheel",
    "1F3A2": "roller_coaster",
    "1F3A0": "carousel_horse",
    "26F2": "fountain",
    "26F1": [
      "beach_umbrella",
      "umbrella_on_ground"
    ],
    "1F3D6": [
      "beach",
      "beach_with_umbrella"
    ],
    "1F3DD": [
      "island",
      "desert_island"
    ],
    "1F3DC": "desert",
    "1F30B": "volcano",
    "26F0": "mountain",
    "1F3D4": [
      "mountain_snow",
      "snow_capped_mountain"
    ],
    "1F5FB": "mount_fuji",
    "1F3D5": "camping",
    "26FA": "tent",
    "1F3E0": "house",
    "1F3E1": "house_with_garden",
    "1F3D8": [
      "homes",
      "house_buildings",
      "houses"
    ],
    "1F3DA": [
      "house_abandoned",
      "derelict_house_building"
    ],
    "1F6D6": "hut",
    "1F3D7": [
      "construction_site",
      "building_construction"
    ],
    "1F3ED": "factory",
    "1F3E2": "office",
    "1F3EC": "department_store",
    "1F3E3": "post_office",
    "1F3E4": "european_post_office",
    "1F3E5": "hospital",
    "1F3E6": "bank",
    "1F3E8": "hotel",
    "1F3EA": "convenience_store",
    "1F3EB": "school",
    "1F3E9": "love_hotel",
    "1F492": "wedding",
    "1F3DB": "classical_building",
    "26EA": "church",
    "1F54C": "mosque",
    "1F54D": "synagogue",
    "1F6D5": "hindu_temple",
    "1F54B": "kaaba",
    "26E9": "shinto_shrine",
    "1F6E4": [
      "railway_track",
      "railroad_track"
    ],
    "1F6E3": "motorway",
    "1F5FE": [
      "japan",
      "map_of_japan"
    ],
    "1F391": "rice_scene",
    "1F3DE": [
      "park",
      "national_park"
    ],
    "1F305": "sunrise",
    "1F304": "sunrise_over_mountains",
    "1F320": [
      "stars",
      "shooting_star"
    ],
    "1F387": "sparkler",
    "1F386": "fireworks",
    "1F307": [
      "city_sunset",
      "city_sunrise",
      "sunset"
    ],
    "1F306": "city_dusk",
    "1F3D9": "cityscape",
    "1F303": "night_with_stars",
    "1F30C": "milky_way",
    "1F309": "bridge_at_night",
    "1F301": "foggy",
    "231A": "watch",
    "1F4F1": "mobile_phone",
    "1F4F2": "calling",
    "1F4BB": "computer",
    "1F5A5": [
      "desktop",
      "desktop_computer"
    ],
    "1F5A8": "printer",
    "1F5B1": [
      "mouse_three_button",
      "three_button_mouse"
    ],
    "1F5B2": "trackball",
    "1F579": "joystick",
    "1F5DC": [
      "compression",
      "clamp"
    ],
    "1F4BD": [
      "minidisc",
      "computer_disk"
    ],
    "1F4BE": "floppy_disk",
    "1F4BF": [
      "cd",
      "optical_disk"
    ],
    "1F4C0": "dvd",
    "1F4FC": [
      "vhs",
      "videocassette"
    ],
    "1F4F7": "camera",
    "1F4F8": "camera_with_flash",
    "1F4F9": "video_camera",
    "1F3A5": "movie_camera",
    "1F4FD": [
      "projector",
      "film_projector"
    ],
    "1F39E": "film_frames",
    "1F4DE": "telephone_receiver",
    "260E": "telephone",
    "1F4DF": "pager",
    "1F4E0": [
      "fax",
      "fax_machine"
    ],
    "1F4FA": [
      "tv",
      "television"
    ],
    "1F4FB": "radio",
    "1F399": [
      "microphone2",
      "studio_microphone"
    ],
    "1F39A": "level_slider",
    "1F39B": "control_knobs",
    "1F9ED": "compass",
    "23F1": "stopwatch",
    "23F2": [
      "timer",
      "timer_clock"
    ],
    "23F0": "alarm_clock",
    "1F570": [
      "clock",
      "mantlepiece_clock"
    ],
    "231B": "hourglass",
    "23F3": "hourglass_flowing_sand",
    "1F4E1": "satellite",
    "1F50B": "battery",
    "1FAAB": "low_battery",
    "1F50C": "electric_plug",
    "1F4A1": [
      "bulb",
      "light_bulb"
    ],
    "1F526": "flashlight",
    "1F56F": "candle",
    "1FA94": "diya_lamp",
    "1F9EF": "fire_extinguisher",
    "1F6E2": [
      "oil",
      "oil_drum"
    ],
    "1F4B8": "money_with_wings",
    "1F4B5": "dollar",
    "1F4B4": [
      "yen",
      "yen_banknote"
    ],
    "1F4B6": [
      "euro",
      "euro_banknote"
    ],
    "1F4B7": "pound",
    "1FA99": "coin",
    "1F4B0": [
      "moneybag",
      "money_bag"
    ],
    "1F4B3": "credit_card",
    "1FAAA": "identification_card",
    "1F48E": [
      "gem",
      "gem_stone"
    ],
    "1FA9C": "ladder",
    "1F9F0": "toolbox",
    "1FA9B": "screwdriver",
    "1F527": "wrench",
    "1F528": "hammer",
    "1F6E0": [
      "tools",
      "hammer_and_wrench"
    ],
    "26CF": "pick",
    "1FA9A": "carpentry_saw",
    "1F529": "nut_and_bolt",
    "1FAA4": "mouse_trap",
    "1F9F1": [
      "bricks",
      "brick"
    ],
    "26D3": "chains",
    "1F9F2": "magnet",
    "1F52B": [
      "gun",
      "pistol"
    ],
    "1F4A3": "bomb",
    "1F9E8": "firecracker",
    "1FA93": "axe",
    "1F52A": [
      "knife",
      "kitchen_knife"
    ],
    "1F5E1": [
      "dagger",
      "dagger_knife"
    ],
    "1F6E1": "shield",
    "1F6AC": [
      "smoking",
      "cigarette"
    ],
    "26B0": "coffin",
    "1FAA6": "headstone",
    "26B1": [
      "urn",
      "funeral_urn"
    ],
    "1F3FA": "amphora",
    "1F52E": "crystal_ball",
    "1F4FF": "prayer_beads",
    "1F9FF": "nazar_amulet",
    "1FAAC": "hamsa",
    "1F488": [
      "barber",
      "barber_pole"
    ],
    "1F52D": "telescope",
    "1F52C": "microscope",
    "1F573": "hole",
    "1FA7B": "x_ray",
    "1FA79": "adhesive_bandage",
    "1FA7A": "stethoscope",
    "1F48A": "pill",
    "1F489": "syringe",
    "1FA78": "drop_of_blood",
    "1F9EC": "dna",
    "1F9A0": "microbe",
    "1F9EB": "petri_dish",
    "1F9EA": "test_tube",
    "1F321": "thermometer",
    "1F9F9": "broom",
    "1FAA0": "plunger",
    "1F9FA": "basket",
    "1F9FB": "roll_of_paper",
    "1F6BD": "toilet",
    "1F6B0": "potable_water",
    "1F6BF": "shower",
    "1F6C1": "bathtub",
    "1F6C0": "bath",
    "1F6C0-1F3FB": "bath_tone1",
    "1F6C0-1F3FC": "bath_tone2",
    "1F6C0-1F3FD": "bath_tone3",
    "1F6C0-1F3FE": "bath_tone4",
    "1F6C0-1F3FF": "bath_tone5",
    "1F9FC": "soap",
    "1FAA5": "toothbrush",
    "1FA92": "razor",
    "1FAAE": "hair_pick",
    "1F9FD": "sponge",
    "1FAA3": "bucket",
    "1F9F4": [
      "squeeze_bottle",
      "lotion_bottle"
    ],
    "1F6CE": [
      "bellhop",
      "bellhop_bell"
    ],
    "1F511": "key",
    "1F5DD": [
      "key2",
      "old_key"
    ],
    "1F6AA": "door",
    "1FA91": "chair",
    "1F6CB": [
      "couch",
      "couch_and_lamp"
    ],
    "1F6CF": "bed",
    "1F6CC": [
      "sleeping_accommodation",
      "person_in_bed"
    ],
    "1F6CC-1F3FB": [
      "person_in_bed_tone1",
      "person_in_bed_light_skin_tone"
    ],
    "1F6CC-1F3FC": [
      "person_in_bed_tone2",
      "person_in_bed_medium_light_skin_tone"
    ],
    "1F6CC-1F3FD": [
      "person_in_bed_tone3",
      "person_in_bed_medium_skin_tone"
    ],
    "1F6CC-1F3FE": [
      "person_in_bed_tone4",
      "person_in_bed_medium_dark_skin_tone"
    ],
    "1F6CC-1F3FF": [
      "person_in_bed_tone5",
      "person_in_bed_dark_skin_tone"
    ],
    "1F9F8": "teddy_bear",
    "1FA86": "nesting_dolls",
    "1F5BC": [
      "frame_photo",
      "frame_with_picture"
    ],
    "1FA9E": "mirror",
    "1FA9F": "window",
    "1F6CD": "shopping_bags",
    "1F6D2": [
      "shopping_cart",
      "shopping_trolley"
    ],
    "1F381": [
      "gift",
      "wrapped_gift"
    ],
    "1F388": "balloon",
    "1F38F": [
      "flags",
      "carp_streamer"
    ],
    "1F380": "ribbon",
    "1FA84": "magic_wand",
    "1FA85": "pinata",
    "1F38A": "confetti_ball",
    "1F389": [
      "tada",
      "party_popper"
    ],
    "1F38E": "dolls",
    "1FAAD": "folding_hand_fan",
    "1F3EE": "izakaya_lantern",
    "1F390": "wind_chime",
    "1FAA9": "mirror_ball",
    "1F9E7": "red_envelope",
    "1F4E9": "envelope_with_arrow",
    "1F4E8": "incoming_envelope",
    "1F4E7": [
      "e-mail",
      "email",
      "e_mail"
    ],
    "1F48C": "love_letter",
    "1F4E5": "inbox_tray",
    "1F4E4": "outbox_tray",
    "1F4E6": "package",
    "1F3F7": "label",
    "1FAA7": "placard",
    "1F4EA": "mailbox_closed",
    "1F4EB": "mailbox",
    "1F4EC": "mailbox_with_mail",
    "1F4ED": "mailbox_with_no_mail",
    "1F4EE": "postbox",
    "1F4EF": "postal_horn",
    "1F4DC": "scroll",
    "1F4C3": "page_with_curl",
    "1F4C4": "page_facing_up",
    "1F4D1": "bookmark_tabs",
    "1F9FE": "receipt",
    "1F4CA": "bar_chart",
    "1F4C8": "chart_with_upwards_trend",
    "1F4C9": "chart_with_downwards_trend",
    "1F5D2": [
      "notepad_spiral",
      "spiral_note_pad"
    ],
    "1F5D3": [
      "calendar_spiral",
      "spiral_calendar_pad"
    ],
    "1F4C6": "calendar",
    "1F4C5": "date",
    "1F5D1": "wastebasket",
    "1F4C7": "card_index",
    "1F5C3": [
      "card_box",
      "card_file_box"
    ],
    "1F5F3": [
      "ballot_box",
      "ballot_box_with_ballot"
    ],
    "1F5C4": "file_cabinet",
    "1F4CB": "clipboard",
    "1F4C1": "file_folder",
    "1F4C2": "open_file_folder",
    "1F5C2": [
      "dividers",
      "card_index_dividers"
    ],
    "1F5DE": [
      "newspaper2",
      "rolled_up_newspaper"
    ],
    "1F4F0": "newspaper",
    "1F4D3": "notebook",
    "1F4D4": "notebook_with_decorative_cover",
    "1F4D2": "ledger",
    "1F4D5": "closed_book",
    "1F4D7": "green_book",
    "1F4D8": "blue_book",
    "1F4D9": "orange_book",
    "1F4DA": "books",
    "1F4D6": [
      "book",
      "open_book"
    ],
    "1F516": "bookmark",
    "1F9F7": "safety_pin",
    "1F517": "link",
    "1F4CE": "paperclip",
    "1F587": [
      "paperclips",
      "linked_paperclips"
    ],
    "1F4D0": "triangular_ruler",
    "1F4CF": "straight_ruler",
    "1F9EE": "abacus",
    "1F4CC": "pushpin",
    "1F4CD": "round_pushpin",
    "1F58A": [
      "pen_ballpoint",
      "lower_left_ballpoint_pen",
      "pen"
    ],
    "1F58B": [
      "pen_fountain",
      "lower_left_fountain_pen",
      "fountain_pen"
    ],
    "1F58C": [
      "paintbrush",
      "lower_left_paintbrush"
    ],
    "1F58D": [
      "crayon",
      "lower_left_crayon"
    ],
    "1F4DD": [
      "pencil",
      "memo"
    ],
    "270F": "pencil2",
    "1F50D": "mag",
    "1F50E": "mag_right",
    "1F50F": "lock_with_ink_pen",
    "1F510": "closed_lock_with_key",
    "1F512": [
      "lock",
      "locked"
    ],
    "1F513": [
      "unlock",
      "unlocked"
    ],
    "1FA77": "pink_heart",
    "1F9E1": "orange_heart",
    "1F49B": "yellow_heart",
    "1F49A": "green_heart",
    "1FA75": "light_blue_heart",
    "1F499": "blue_heart",
    "1F49C": "purple_heart",
    "1F5A4": "black_heart",
    "1FA76": "grey_heart",
    "1F90D": "white_heart",
    "1F90E": "brown_heart",
    "1F494": "broken_heart",
    "1F495": "two_hearts",
    "1F49E": "revolving_hearts",
    "1F493": [
      "heartbeat",
      "beating_heart"
    ],
    "1F497": [
      "heartpulse",
      "growing_heart"
    ],
    "1F496": "sparkling_heart",
    "1F498": "cupid",
    "1F49D": "gift_heart",
    "2764-FE0F-200D-1FA79": "mending_heart",
    "2764-FE0F-200D-1F525": "heart_on_fire",
    "1F49F": "heart_decoration",
    "262E": [
      "peace",
      "peace_symbol"
    ],
    "271D": [
      "cross",
      "latin_cross"
    ],
    "262A": "star_and_crescent",
    "1F549": "om_symbol",
    "1FAAF": "khanda",
    "1F52F": "six_pointed_star",
    "1F54E": "menorah",
    "262F": "yin_yang",
    "1F6D0": [
      "place_of_worship",
      "worship_symbol"
    ],
    "26CE": "ophiuchus",
    "264A": "gemini",
    "264B": "cancer",
    "264C": "leo",
    "264D": "virgo",
    "264E": "libra",
    "264F": [
      "scorpius",
      "scorpio"
    ],
    "1F194": "id",
    "269B": [
      "atom",
      "atom_symbol"
    ],
    "1F251": "accept",
    "1F4F4": "mobile_phone_off",
    "1F4F3": "vibration_mode",
    "1F236": "u6709",
    "1F21A": "u7121",
    "1F238": "u7533",
    "1F23A": "u55b6",
    "1F237": "u6708",
    "1F19A": "vs",
    "1F4AE": "white_flower",
    "1F250": "ideograph_advantage",
    "1F234": "u5408",
    "1F235": "u6e80",
    "1F239": "u5272",
    "1F232": "u7981",
    "1F170": "a",
    "1F171": "b",
    "1F18E": "ab",
    "1F191": "cl",
    "1F17E": "o2",
    "1F198": "sos",
    "274C": [
      "x",
      "cross_mark"
    ],
    "2B55": "o",
    "1F6D1": [
      "octagonal_sign",
      "stop_sign"
    ],
    "26D4": "no_entry",
    "1F4DB": "name_badge",
    "1F6AB": [
      "no_entry_sign",
      "prohibited"
    ],
    "1F4AF": "100",
    "1F4A2": "anger",
    "1F6B7": "no_pedestrians",
    "1F6AF": [
      "do_not_litter",
      "no_littering"
    ],
    "1F6B3": "no_bicycles",
    "1F6B1": "non-potable_water",
    "1F51E": "underage",
    "1F4F5": "no_mobile_phones",
    "1F6AD": "no_smoking",
    "203C": "bangbang",
    "1F505": "low_brightness",
    "1F506": "high_brightness",
    "303D": "part_alternation_mark",
    "26A0": "warning",
    "1F6B8": "children_crossing",
    "1F531": "trident",
    "269C": [
      "fleur-de-lis",
      "fleur_de_lis"
    ],
    "1F530": "beginner",
    "267B": "recycle",
    "1F22F": "u6307",
    "1F4B9": "chart",
    "274E": "negative_squared_cross_mark",
    "1F310": "globe_with_meridians",
    "1F4A0": "diamond_shape_with_a_dot_inside",
    "24C2": [
      "m",
      "circled_m"
    ],
    "1F300": "cyclone",
    "1F4A4": "zzz",
    "1F3E7": "atm",
    "1F6BE": [
      "wc",
      "water_closet"
    ],
    "267F": "wheelchair",
    "1F17F": "parking",
    "1F6D7": "elevator",
    "1F233": "u7a7a",
    "1F202": "sa",
    "1F6C2": "passport_control",
    "1F6C3": "customs",
    "1F6C4": "baggage_claim",
    "1F6C5": "left_luggage",
    "1F6DC": "wireless",
    "1F6B9": [
      "mens",
      "mens_room"
    ],
    "1F6BA": [
      "womens",
      "womens_room"
    ],
    "1F6BC": "baby_symbol",
    "1F6BB": "restroom",
    "1F6AE": "put_litter_in_its_place",
    "1F3A6": "cinema",
    "1F4F6": [
      "signal_strength",
      "antenna_bars"
    ],
    "1F201": "koko",
    "1F523": [
      "symbols",
      "input_symbols"
    ],
    "1F524": "abc",
    "1F521": "abcd",
    "1F520": "capital_abcd",
    "1F196": "ng",
    "1F197": "ok",
    "1F199": "up",
    "1F192": "cool",
    "1F195": "new",
    "1F193": "free",
    "0030-FE0F-20E3": "zero",
    "0031-FE0F-20E3": "one",
    "0032-FE0F-20E3": "two",
    "0033-FE0F-20E3": "three",
    "0034-FE0F-20E3": "four",
    "0035-FE0F-20E3": "five",
    "0036-FE0F-20E3": "six",
    "0037-FE0F-20E3": "seven",
    "0038-FE0F-20E3": "eight",
    "0039-FE0F-20E3": "nine",
    "1F51F": "keycap_ten",
    "1F522": [
      "1234",
      "input_numbers"
    ],
    "0023-FE0F-20E3": "hash",
    "002A-FE0F-20E3": [
      "asterisk",
      "keycap_asterisk"
    ],
    "23CF": [
      "eject",
      "eject_symbol"
    ],
    "25B6": "arrow_forward",
    "23F8": [
      "pause_button",
      "double_vertical_bar"
    ],
    "23EF": "play_pause",
    "23F9": "stop_button",
    "23FA": "record_button",
    "23ED": [
      "track_next",
      "next_track"
    ],
    "23EE": [
      "track_previous",
      "previous_track"
    ],
    "23E9": "fast_forward",
    "23EA": "rewind",
    "23EB": "arrow_double_up",
    "23EC": "arrow_double_down",
    "25C0": "arrow_backward",
    "1F53C": "arrow_up_small",
    "1F53D": "arrow_down_small",
    "27A1": [
      "arrow_right",
      "right_arrow"
    ],
    "2B05": [
      "arrow_left",
      "left_arrow"
    ],
    "2B06": [
      "arrow_up",
      "up_arrow"
    ],
    "2B07": [
      "arrow_down",
      "down_arrow"
    ],
    "21AA": "arrow_right_hook",
    "21A9": "leftwards_arrow_with_hook",
    "1F500": "twisted_rightwards_arrows",
    "1F501": "repeat",
    "1F502": "repeat_one",
    "1F504": "arrows_counterclockwise",
    "1F503": "arrows_clockwise",
    "1F3B5": "musical_note",
    "1F3B6": [
      "notes",
      "musical_notes"
    ],
    "1F7F0": "heavy_equals_sign",
    "267E": "infinity",
    "1F4B2": "heavy_dollar_sign",
    "1F4B1": "currency_exchange",
    "00A9": "copyright",
    "00AE": "registered",
    "27B0": "curly_loop",
    "27BF": "loop",
    "1F51A": [
      "end",
      "end_arrow"
    ],
    "1F519": [
      "back",
      "back_arrow"
    ],
    "1F51B": [
      "on",
      "on_arrow"
    ],
    "1F51D": [
      "top",
      "top_arrow"
    ],
    "1F51C": [
      "soon",
      "soon_arrow"
    ],
    "1F518": "radio_button",
    "26AA": "white_circle",
    "26AB": "black_circle",
    "1F534": "red_circle",
    "1F535": "blue_circle",
    "1F7E4": "brown_circle",
    "1F7E3": "purple_circle",
    "1F7E2": "green_circle",
    "1F7E1": "yellow_circle",
    "1F7E0": "orange_circle",
    "1F53A": "small_red_triangle",
    "1F53B": "small_red_triangle_down",
    "1F538": "small_orange_diamond",
    "1F539": "small_blue_diamond",
    "1F536": "large_orange_diamond",
    "1F537": "large_blue_diamond",
    "1F533": "white_square_button",
    "1F532": "black_square_button",
    "25AA": "black_small_square",
    "25AB": "white_small_square",
    "25FE": "black_medium_small_square",
    "25FD": "white_medium_small_square",
    "25FC": "black_medium_square",
    "25FB": "white_medium_square",
    "2B1B": "black_large_square",
    "2B1C": "white_large_square",
    "1F7E7": "orange_square",
    "1F7E6": "blue_square",
    "1F7E5": "red_square",
    "1F7EB": "brown_square",
    "1F7EA": "purple_square",
    "1F7E9": "green_square",
    "1F7E8": "yellow_square",
    "1F508": "speaker",
    "1F507": [
      "mute",
      "muted_speaker"
    ],
    "1F509": "sound",
    "1F50A": "loud_sound",
    "1F514": "bell",
    "1F515": "no_bell",
    "1F4E3": [
      "mega",
      "megaphone"
    ],
    "1F4E2": "loudspeaker",
    "1F5E8": [
      "speech_left",
      "left_speech_bubble"
    ],
    "1F441-FE0F-200D-1F5E8-FE0F": "eye_in_speech_bubble",
    "1F4AC": "speech_balloon",
    "1F4AD": "thought_balloon",
    "1F5EF": [
      "anger_right",
      "right_anger_bubble"
    ],
    "1F0CF": [
      "black_joker",
      "joker"
    ],
    "1F3B4": "flower_playing_cards",
    "1F004": "mahjong",
    "1F550": [
      "clock1",
      "one_oclock"
    ],
    "1F551": [
      "clock2",
      "two_oclock"
    ],
    "1F552": [
      "clock3",
      "three_oclock"
    ],
    "1F553": [
      "clock4",
      "four_oclock"
    ],
    "1F554": [
      "clock5",
      "five_oclock"
    ],
    "1F555": [
      "clock6",
      "six_oclock"
    ],
    "1F556": [
      "clock7",
      "seven_oclock"
    ],
    "1F557": [
      "clock8",
      "eight_oclock"
    ],
    "1F558": [
      "clock9",
      "nine_oclock"
    ],
    "1F559": [
      "clock10",
      "ten_oclock"
    ],
    "1F55A": [
      "clock11",
      "eleven_oclock"
    ],
    "1F55B": [
      "clock12",
      "twelve_oclock"
    ],
    "1F55C": [
      "clock130",
      "one_thirty"
    ],
    "1F55D": [
      "clock230",
      "two_thirty"
    ],
    "1F55E": [
      "clock330",
      "three_thirty"
    ],
    "1F55F": [
      "clock430",
      "four_thirty"
    ],
    "1F560": [
      "clock530",
      "five_thirty"
    ],
    "1F561": [
      "clock630",
      "six_thirty"
    ],
    "1F562": [
      "clock730",
      "seven_thirty"
    ],
    "1F563": [
      "clock830",
      "eight_thirty"
    ],
    "1F564": [
      "clock930",
      "nine_thirty"
    ],
    "1F565": [
      "clock1030",
      "ten_thirty"
    ],
    "1F566": [
      "clock1130",
      "eleven_thirty"
    ],
    "1F567": [
      "clock1230",
      "twelve_thirty"
    ],
    "26A7": "transgender_symbol",
    "1F3F3": [
      "flag_white",
      "waving_white_flag",
      "white_flag"
    ],
    "1F3F4": [
      "flag_black",
      "waving_black_flag",
      "black_flag"
    ],
    "1F3F4-200D-2620-FE0F": "pirate_flag",
    "1F3C1": "checkered_flag",
    "1F6A9": "triangular_flag_on_post",
    "1F3F3-FE0F-200D-1F308": [
      "rainbow_flag",
      "gay_pride_flag"
    ],
    "1F3F3-FE0F-200D-26A7-FE0F": "transgender_flag",
    "1F1FA-1F1F3": "united_nations",
    "1F1E6-1F1EB": [
      "flag_af",
      "af"
    ],
    "1F1E6-1F1FD": [
      "flag_ax",
      "ax"
    ],
    "1F1E6-1F1F1": [
      "flag_al",
      "al"
    ],
    "1F1E9-1F1FF": [
      "flag_dz",
      "dz"
    ],
    "1F1E6-1F1F8": [
      "flag_as",
      "as"
    ],
    "1F1E6-1F1E9": [
      "flag_ad",
      "ad"
    ],
    "1F1E6-1F1F4": [
      "flag_ao",
      "ao"
    ],
    "1F1E6-1F1EE": [
      "flag_ai",
      "ai"
    ],
    "1F1E6-1F1F6": [
      "flag_aq",
      "aq"
    ],
    "1F1E6-1F1EC": [
      "flag_ag",
      "ag"
    ],
    "1F1E6-1F1F7": [
      "flag_ar",
      "ar"
    ],
    "1F1E6-1F1F2": [
      "flag_am",
      "am"
    ],
    "1F1E6-1F1FC": [
      "flag_aw",
      "aw"
    ],
    "1F1E6-1F1FA": [
      "flag_au",
      "au"
    ],
    "1F1E6-1F1F9": [
      "flag_at",
      "at"
    ],
    "1F1E6-1F1FF": [
      "flag_az",
      "az"
    ],
    "1F1E7-1F1F8": [
      "flag_bs",
      "bs"
    ],
    "1F1E7-1F1ED": [
      "flag_bh",
      "bh"
    ],
    "1F1E7-1F1E9": [
      "flag_bd",
      "bd"
    ],
    "1F1E7-1F1E7": [
      "flag_bb",
      "bb"
    ],
    "1F1E7-1F1FE": [
      "flag_by",
      "by"
    ],
    "1F1E7-1F1EA": [
      "flag_be",
      "be"
    ],
    "1F1E7-1F1FF": [
      "flag_bz",
      "bz"
    ],
    "1F1E7-1F1EF": [
      "flag_bj",
      "bj"
    ],
    "1F1E7-1F1F2": [
      "flag_bm",
      "bm"
    ],
    "1F1E7-1F1F9": [
      "flag_bt",
      "bt"
    ],
    "1F1E7-1F1F4": [
      "flag_bo",
      "bo"
    ],
    "1F1E7-1F1E6": [
      "flag_ba",
      "ba"
    ],
    "1F1E7-1F1FC": [
      "flag_bw",
      "bw"
    ],
    "1F1E7-1F1F7": [
      "flag_br",
      "br"
    ],
    "1F1EE-1F1F4": [
      "flag_io",
      "io"
    ],
    "1F1FB-1F1EC": [
      "flag_vg",
      "vg"
    ],
    "1F1E7-1F1F3": [
      "flag_bn",
      "bn"
    ],
    "1F1E7-1F1EC": [
      "flag_bg",
      "bg"
    ],
    "1F1E7-1F1EB": [
      "flag_bf",
      "bf"
    ],
    "1F1E7-1F1EE": [
      "flag_bi",
      "bi"
    ],
    "1F1F0-1F1ED": [
      "flag_kh",
      "kh"
    ],
    "1F1E8-1F1F2": [
      "flag_cm",
      "cm"
    ],
    "1F1E8-1F1E6": [
      "flag_ca",
      "ca"
    ],
    "1F1EE-1F1E8": [
      "flag_ic",
      "ic"
    ],
    "1F1E8-1F1FB": [
      "flag_cv",
      "cv"
    ],
    "1F1E7-1F1F6": [
      "flag_bq",
      "bq"
    ],
    "1F1F0-1F1FE": [
      "flag_ky",
      "ky"
    ],
    "1F1E8-1F1EB": [
      "flag_cf",
      "cf"
    ],
    "1F1F9-1F1E9": [
      "flag_td",
      "td"
    ],
    "1F1E8-1F1F1": [
      "flag_cl",
      "chile"
    ],
    "1F1E8-1F1F3": [
      "flag_cn",
      "cn"
    ],
    "1F1E8-1F1FD": [
      "flag_cx",
      "cx"
    ],
    "1F1E8-1F1E8": [
      "flag_cc",
      "cc"
    ],
    "1F1E8-1F1F4": [
      "flag_co",
      "co"
    ],
    "1F1F0-1F1F2": [
      "flag_km",
      "km"
    ],
    "1F1E8-1F1EC": [
      "flag_cg",
      "cg"
    ],
    "1F1E8-1F1E9": [
      "flag_cd",
      "congo"
    ],
    "1F1E8-1F1F0": [
      "flag_ck",
      "ck"
    ],
    "1F1E8-1F1F7": [
      "flag_cr",
      "cr"
    ],
    "1F1E8-1F1EE": [
      "flag_ci",
      "ci"
    ],
    "1F1ED-1F1F7": [
      "flag_hr",
      "hr"
    ],
    "1F1E8-1F1FA": [
      "flag_cu",
      "cu"
    ],
    "1F1E8-1F1FC": [
      "flag_cw",
      "cw"
    ],
    "1F1E8-1F1FE": [
      "flag_cy",
      "cy"
    ],
    "1F1E8-1F1FF": [
      "flag_cz",
      "cz"
    ],
    "1F1E9-1F1F0": [
      "flag_dk",
      "dk"
    ],
    "1F1E9-1F1EF": [
      "flag_dj",
      "dj"
    ],
    "1F1E9-1F1F2": [
      "flag_dm",
      "dm"
    ],
    "1F1E9-1F1F4": [
      "flag_do",
      "do"
    ],
    "1F1EA-1F1E8": [
      "flag_ec",
      "ec"
    ],
    "1F1EA-1F1EC": [
      "flag_eg",
      "eg"
    ],
    "1F1F8-1F1FB": [
      "flag_sv",
      "sv"
    ],
    "1F1EC-1F1F6": [
      "flag_gq",
      "gq"
    ],
    "1F1EA-1F1F7": [
      "flag_er",
      "er"
    ],
    "1F1EA-1F1EA": [
      "flag_ee",
      "ee"
    ],
    "1F1EA-1F1F9": [
      "flag_et",
      "et"
    ],
    "1F1EA-1F1FA": [
      "flag_eu",
      "eu"
    ],
    "1F1EB-1F1F0": [
      "flag_fk",
      "fk"
    ],
    "1F1EB-1F1F4": [
      "flag_fo",
      "fo"
    ],
    "1F1EB-1F1EF": [
      "flag_fj",
      "fj"
    ],
    "1F1EB-1F1EE": [
      "flag_fi",
      "fi"
    ],
    "1F1EB-1F1F7": [
      "flag_fr",
      "fr"
    ],
    "1F1EC-1F1EB": [
      "flag_gf",
      "gf"
    ],
    "1F1F5-1F1EB": [
      "flag_pf",
      "pf"
    ],
    "1F1F9-1F1EB": [
      "flag_tf",
      "tf"
    ],
    "1F1EC-1F1E6": [
      "flag_ga",
      "ga"
    ],
    "1F1EC-1F1F2": [
      "flag_gm",
      "gm"
    ],
    "1F1EC-1F1EA": [
      "flag_ge",
      "ge"
    ],
    "1F1E9-1F1EA": [
      "flag_de",
      "de"
    ],
    "1F1EC-1F1ED": [
      "flag_gh",
      "gh"
    ],
    "1F1EC-1F1EE": [
      "flag_gi",
      "gi"
    ],
    "1F1EC-1F1F7": [
      "flag_gr",
      "gr"
    ],
    "1F1EC-1F1F1": [
      "flag_gl",
      "gl"
    ],
    "1F1EC-1F1E9": [
      "flag_gd",
      "gd"
    ],
    "1F1EC-1F1F5": [
      "flag_gp",
      "gp"
    ],
    "1F1EC-1F1FA": [
      "flag_gu",
      "gu"
    ],
    "1F1EC-1F1F9": [
      "flag_gt",
      "gt"
    ],
    "1F1EC-1F1EC": [
      "flag_gg",
      "gg"
    ],
    "1F1EC-1F1F3": [
      "flag_gn",
      "gn"
    ],
    "1F1EC-1F1FC": [
      "flag_gw",
      "gw"
    ],
    "1F1EC-1F1FE": [
      "flag_gy",
      "gy"
    ],
    "1F1ED-1F1F9": [
      "flag_ht",
      "ht"
    ],
    "1F1ED-1F1F3": [
      "flag_hn",
      "hn"
    ],
    "1F1ED-1F1F0": [
      "flag_hk",
      "hk"
    ],
    "1F1ED-1F1FA": [
      "flag_hu",
      "hu"
    ],
    "1F1EE-1F1F8": [
      "flag_is",
      "is"
    ],
    "1F1EE-1F1F3": [
      "flag_in",
      "in"
    ],
    "1F1EE-1F1E9": [
      "flag_id",
      "indonesia"
    ],
    "1F1EE-1F1F7": [
      "flag_ir",
      "ir"
    ],
    "1F1EE-1F1F6": [
      "flag_iq",
      "iq"
    ],
    "1F1EE-1F1EA": [
      "flag_ie",
      "ie"
    ],
    "1F1EE-1F1F2": [
      "flag_im",
      "im"
    ],
    "1F1EE-1F1F1": [
      "flag_il",
      "il"
    ],
    "1F1EE-1F1F9": [
      "flag_it",
      "it"
    ],
    "1F1EF-1F1F2": [
      "flag_jm",
      "jm"
    ],
    "1F1EF-1F1F5": [
      "flag_jp",
      "jp"
    ],
    "1F38C": "crossed_flags",
    "1F1EF-1F1EA": [
      "flag_je",
      "je"
    ],
    "1F1EF-1F1F4": [
      "flag_jo",
      "jo"
    ],
    "1F1F0-1F1FF": [
      "flag_kz",
      "kz"
    ],
    "1F1F0-1F1EA": [
      "flag_ke",
      "ke"
    ],
    "1F1F0-1F1EE": [
      "flag_ki",
      "ki"
    ],
    "1F1FD-1F1F0": [
      "flag_xk",
      "xk"
    ],
    "1F1F0-1F1FC": [
      "flag_kw",
      "kw"
    ],
    "1F1F0-1F1EC": [
      "flag_kg",
      "kg"
    ],
    "1F1F1-1F1E6": [
      "flag_la",
      "la"
    ],
    "1F1F1-1F1FB": [
      "flag_lv",
      "lv"
    ],
    "1F1F1-1F1E7": [
      "flag_lb",
      "lb"
    ],
    "1F1F1-1F1F8": [
      "flag_ls",
      "ls"
    ],
    "1F1F1-1F1F7": [
      "flag_lr",
      "lr"
    ],
    "1F1F1-1F1FE": [
      "flag_ly",
      "ly"
    ],
    "1F1F1-1F1EE": [
      "flag_li",
      "li"
    ],
    "1F1F1-1F1F9": [
      "flag_lt",
      "lt"
    ],
    "1F1F1-1F1FA": [
      "flag_lu",
      "lu"
    ],
    "1F1F2-1F1F4": [
      "flag_mo",
      "mo"
    ],
    "1F1F2-1F1F0": [
      "flag_mk",
      "mk"
    ],
    "1F1F2-1F1EC": [
      "flag_mg",
      "mg"
    ],
    "1F1F2-1F1FC": [
      "flag_mw",
      "mw"
    ],
    "1F1F2-1F1FE": [
      "flag_my",
      "my"
    ],
    "1F1F2-1F1FB": [
      "flag_mv",
      "mv"
    ],
    "1F1F2-1F1F1": [
      "flag_ml",
      "ml"
    ],
    "1F1F2-1F1F9": [
      "flag_mt",
      "mt"
    ],
    "1F1F2-1F1ED": [
      "flag_mh",
      "mh"
    ],
    "1F1F2-1F1F6": [
      "flag_mq",
      "mq"
    ],
    "1F1F2-1F1F7": [
      "flag_mr",
      "mr"
    ],
    "1F1F2-1F1FA": [
      "flag_mu",
      "mu"
    ],
    "1F1FE-1F1F9": [
      "flag_yt",
      "yt"
    ],
    "1F1F2-1F1FD": [
      "flag_mx",
      "mx"
    ],
    "1F1EB-1F1F2": [
      "flag_fm",
      "fm"
    ],
    "1F1F2-1F1E9": [
      "flag_md",
      "md"
    ],
    "1F1F2-1F1E8": [
      "flag_mc",
      "mc"
    ],
    "1F1F2-1F1F3": [
      "flag_mn",
      "mn"
    ],
    "1F1F2-1F1EA": [
      "flag_me",
      "me"
    ],
    "1F1F2-1F1F8": [
      "flag_ms",
      "ms"
    ],
    "1F1F2-1F1E6": [
      "flag_ma",
      "ma"
    ],
    "1F1F2-1F1FF": [
      "flag_mz",
      "mz"
    ],
    "1F1F2-1F1F2": [
      "flag_mm",
      "mm"
    ],
    "1F1F3-1F1E6": [
      "flag_na",
      "na"
    ],
    "1F1F3-1F1F7": [
      "flag_nr",
      "nr"
    ],
    "1F1F3-1F1F5": [
      "flag_np",
      "np"
    ],
    "1F1F3-1F1F1": [
      "flag_nl",
      "nl"
    ],
    "1F1F3-1F1E8": [
      "flag_nc",
      "nc"
    ],
    "1F1F3-1F1FF": [
      "flag_nz",
      "nz"
    ],
    "1F1F3-1F1EE": [
      "flag_ni",
      "ni"
    ],
    "1F1F3-1F1EA": [
      "flag_ne",
      "ne"
    ],
    "1F1F3-1F1EC": [
      "flag_ng",
      "nigeria"
    ],
    "1F1F3-1F1FA": [
      "flag_nu",
      "nu"
    ],
    "1F1F3-1F1EB": [
      "flag_nf",
      "nf"
    ],
    "1F1F0-1F1F5": [
      "flag_kp",
      "kp"
    ],
    "1F1F2-1F1F5": [
      "flag_mp",
      "mp"
    ],
    "1F1F3-1F1F4": [
      "flag_no",
      "no"
    ],
    "1F1F4-1F1F2": [
      "flag_om",
      "om"
    ],
    "1F1F5-1F1F0": [
      "flag_pk",
      "pk"
    ],
    "1F1F5-1F1FC": [
      "flag_pw",
      "pw"
    ],
    "1F1F5-1F1F8": [
      "flag_ps",
      "ps"
    ],
    "1F1F5-1F1E6": [
      "flag_pa",
      "pa"
    ],
    "1F1F5-1F1EC": [
      "flag_pg",
      "pg"
    ],
    "1F1F5-1F1FE": [
      "flag_py",
      "py"
    ],
    "1F1F5-1F1EA": [
      "flag_pe",
      "pe"
    ],
    "1F1F5-1F1ED": [
      "flag_ph",
      "ph"
    ],
    "1F1F5-1F1F3": [
      "flag_pn",
      "pn"
    ],
    "1F1F5-1F1F1": [
      "flag_pl",
      "pl"
    ],
    "1F1F5-1F1F9": [
      "flag_pt",
      "pt"
    ],
    "1F1F5-1F1F7": [
      "flag_pr",
      "pr"
    ],
    "1F1F6-1F1E6": [
      "flag_qa",
      "qa"
    ],
    "1F1F7-1F1EA": [
      "flag_re",
      "re"
    ],
    "1F1F7-1F1F4": [
      "flag_ro",
      "ro"
    ],
    "1F1F7-1F1FA": [
      "flag_ru",
      "ru"
    ],
    "1F1F7-1F1FC": [
      "flag_rw",
      "rw"
    ],
    "1F1FC-1F1F8": [
      "flag_ws",
      "ws"
    ],
    "1F1F8-1F1F2": [
      "flag_sm",
      "sm"
    ],
    "1F1F8-1F1F9": [
      "flag_st",
      "st"
    ],
    "1F1F8-1F1E6": [
      "flag_sa",
      "saudiarabia",
      "saudi"
    ],
    "1F1F8-1F1F3": [
      "flag_sn",
      "sn"
    ],
    "1F1F7-1F1F8": [
      "flag_rs",
      "rs"
    ],
    "1F1F8-1F1E8": [
      "flag_sc",
      "sc"
    ],
    "1F1F8-1F1F1": [
      "flag_sl",
      "sl"
    ],
    "1F1F8-1F1EC": [
      "flag_sg",
      "sg"
    ],
    "1F1F8-1F1FD": [
      "flag_sx",
      "sx"
    ],
    "1F1F8-1F1F0": [
      "flag_sk",
      "sk"
    ],
    "1F1F8-1F1EE": [
      "flag_si",
      "si"
    ],
    "1F1EC-1F1F8": [
      "flag_gs",
      "gs"
    ],
    "1F1F8-1F1E7": [
      "flag_sb",
      "sb"
    ],
    "1F1F8-1F1F4": [
      "flag_so",
      "so"
    ],
    "1F1FF-1F1E6": [
      "flag_za",
      "za"
    ],
    "1F1F0-1F1F7": [
      "flag_kr",
      "kr"
    ],
    "1F1F8-1F1F8": [
      "flag_ss",
      "ss"
    ],
    "1F1EA-1F1F8": [
      "flag_es",
      "es"
    ],
    "1F1F1-1F1F0": [
      "flag_lk",
      "lk"
    ],
    "1F1E7-1F1F1": [
      "flag_bl",
      "bl"
    ],
    "1F1F8-1F1ED": [
      "flag_sh",
      "sh"
    ],
    "1F1F0-1F1F3": [
      "flag_kn",
      "kn"
    ],
    "1F1F1-1F1E8": [
      "flag_lc",
      "lc"
    ],
    "1F1F5-1F1F2": [
      "flag_pm",
      "pm"
    ],
    "1F1FB-1F1E8": [
      "flag_vc",
      "vc"
    ],
    "1F1F8-1F1E9": [
      "flag_sd",
      "sd"
    ],
    "1F1F8-1F1F7": [
      "flag_sr",
      "sr"
    ],
    "1F1F8-1F1FF": [
      "flag_sz",
      "sz"
    ],
    "1F1F8-1F1EA": [
      "flag_se",
      "se"
    ],
    "1F1E8-1F1ED": [
      "flag_ch",
      "ch"
    ],
    "1F1F8-1F1FE": [
      "flag_sy",
      "sy"
    ],
    "1F1F9-1F1FC": [
      "flag_tw",
      "tw"
    ],
    "1F1F9-1F1EF": [
      "flag_tj",
      "tj"
    ],
    "1F1F9-1F1FF": [
      "flag_tz",
      "tz"
    ],
    "1F1F9-1F1ED": [
      "flag_th",
      "th"
    ],
    "1F1F9-1F1F1": [
      "flag_tl",
      "tl"
    ],
    "1F1F9-1F1EC": [
      "flag_tg",
      "tg"
    ],
    "1F1F9-1F1F0": [
      "flag_tk",
      "tk"
    ],
    "1F1F9-1F1F4": [
      "flag_to",
      "to"
    ],
    "1F1F9-1F1F9": [
      "flag_tt",
      "tt"
    ],
    "1F1F9-1F1F3": [
      "flag_tn",
      "tn"
    ],
    "1F1F9-1F1F7": [
      "flag_tr",
      "tr"
    ],
    "1F1F9-1F1F2": [
      "flag_tm",
      "turkmenistan"
    ],
    "1F1F9-1F1E8": [
      "flag_tc",
      "tc"
    ],
    "1F1FB-1F1EE": [
      "flag_vi",
      "vi"
    ],
    "1F1F9-1F1FB": [
      "flag_tv",
      "tuvalu"
    ],
    "1F1FA-1F1EC": [
      "flag_ug",
      "ug"
    ],
    "1F1FA-1F1E6": [
      "flag_ua",
      "ua"
    ],
    "1F1E6-1F1EA": [
      "flag_ae",
      "ae"
    ],
    "1F1EC-1F1E7": [
      "flag_gb",
      "gb"
    ],
    "1F3F4-E0067-E0062-E0065-E006E-E0067-E007F": "england",
    "1F3F4-E0067-E0062-E0073-E0063-E0074-E007F": "scotland",
    "1F3F4-E0067-E0062-E0077-E006C-E0073-E007F": "wales",
    "1F1FA-1F1F8": [
      "flag_us",
      "us"
    ],
    "1F1FA-1F1FE": [
      "flag_uy",
      "uy"
    ],
    "1F1FA-1F1FF": [
      "flag_uz",
      "uz"
    ],
    "1F1FB-1F1FA": [
      "flag_vu",
      "vu"
    ],
    "1F1FB-1F1E6": [
      "flag_va",
      "va"
    ],
    "1F1FB-1F1EA": [
      "flag_ve",
      "ve"
    ],
    "1F1FB-1F1F3": [
      "flag_vn",
      "vn"
    ],
    "1F1FC-1F1EB": [
      "flag_wf",
      "wf"
    ],
    "1F1EA-1F1ED": [
      "flag_eh",
      "eh"
    ],
    "1F1FE-1F1EA": [
      "flag_ye",
      "ye"
    ],
    "1F1FF-1F1F2": [
      "flag_zm",
      "zm"
    ],
    "1F1FF-1F1FC": [
      "flag_zw",
      "zw"
    ],
    "1F1E6-1F1E8": [
      "flag_ac",
      "ac"
    ],
    "1F1E7-1F1FB": [
      "flag_bv",
      "bv"
    ],
    "1F1E8-1F1F5": [
      "flag_cp",
      "cp"
    ],
    "1F1EA-1F1E6": [
      "flag_ea",
      "ea"
    ],
    "1F1E9-1F1EC": [
      "flag_dg",
      "dg"
    ],
    "1F1ED-1F1F2": [
      "flag_hm",
      "hm"
    ],
    "1F1F2-1F1EB": [
      "flag_mf",
      "mf"
    ],
    "1F1F8-1F1EF": [
      "flag_sj",
      "sj"
    ],
    "1F1F9-1F1E6": [
      "flag_ta",
      "ta"
    ],
    "1F1FA-1F1F2": [
      "flag_um",
      "um"
    ],
    "1F3FB": "tone1",
    "1F3FC": "tone2",
    "1F3FD": "tone3",
    "1F3FE": "tone4",
    "1F3FF": "tone5",
    "1F1FF": "regional_indicator_z",
    "1F1FE": "regional_indicator_y",
    "1F1FD": "regional_indicator_x",
    "1F1FC": "regional_indicator_w",
    "1F1FB": "regional_indicator_v",
    "1F1FA": "regional_indicator_u",
    "1F1F9": "regional_indicator_t",
    "1F1F8": "regional_indicator_s",
    "1F1F7": "regional_indicator_r",
    "1F1F6": "regional_indicator_q",
    "1F1F5": "regional_indicator_p",
    "1F1F4": "regional_indicator_o",
    "1F1F3": "regional_indicator_n",
    "1F1F2": "regional_indicator_m",
    "1F1F1": "regional_indicator_l",
    "1F1F0": "regional_indicator_k",
    "1F1EF": "regional_indicator_j",
    "1F1EE": "regional_indicator_i",
    "1F1ED": "regional_indicator_h",
    "1F1EC": "regional_indicator_g",
    "1F1EB": "regional_indicator_f",
    "1F1EA": "regional_indicator_e",
    "1F1E9": "regional_indicator_d",
    "1F1E8": "regional_indicator_c",
    "1F1E7": "regional_indicator_b",
    "1F1E6": "regional_indicator_a"
  }, Roe = {
    2049: [
      "exclamation_question",
      "interrobang"
    ],
    2122: [
      "tm",
      "trade_mark"
    ],
    2139: [
      "info",
      "information_source"
    ],
    2194: "left_right_arrow",
    2195: "arrow_up_down",
    2196: "arrow_upper_left",
    2197: "arrow_upper_right",
    2198: "arrow_lower_right",
    2199: "arrow_lower_left",
    2328: "keyboard",
    2600: "sun",
    2601: "cloud",
    2602: "umbrella",
    2603: "snowman2",
    2604: "comet",
    2611: "ballot_box_with_check",
    2614: "umbrella_with_rain",
    2615: "coffee",
    2618: "shamrock",
    2620: "skull_and_crossbones",
    2622: "radioactive",
    2623: "biohazard",
    2626: "orthodox_cross",
    2638: "wheel_of_dharma",
    2639: "white_frowning_face",
    2640: [
      "female",
      "female_sign"
    ],
    2642: [
      "male",
      "male_sign"
    ],
    2648: "aries",
    2649: "taurus",
    2650: "sagittarius",
    2651: "capricorn",
    2652: "aquarius",
    2653: "pisces",
    2660: "spades",
    2663: "clubs",
    2665: "hearts",
    2666: "diamonds",
    2668: "hotsprings",
    2692: "hammer_and_pick",
    2693: "anchor",
    2694: "crossed_swords",
    2695: [
      "medical",
      "medical_symbol"
    ],
    2696: "scales",
    2697: "alembic",
    2699: "gear",
    2702: "scissors",
    2705: [
      "check_mark_button",
      "white_check_mark"
    ],
    2708: "airplane",
    2709: "envelope",
    2712: "black_nib",
    2714: [
      "check_mark",
      "heavy_check_mark"
    ],
    2716: [
      "multiplication",
      "multiply"
    ],
    2721: "star_of_david",
    2728: "sparkles",
    2733: "eight_spoked_asterisk",
    2734: "eight_pointed_black_star",
    2744: "snowflake",
    2747: "sparkle",
    2753: "question",
    2754: "white_question",
    2755: "white_exclamation",
    2757: "exclamation",
    2763: "heart_exclamation",
    2764: [
      "heart",
      "red_heart"
    ],
    2795: "plus",
    2796: "minus",
    2797: [
      "divide",
      "division"
    ],
    2934: "arrow_heading_up",
    2935: "arrow_heading_down",
    3030: "wavy_dash",
    3297: [
      "congratulations",
      "ja_congratulations"
    ],
    3299: [
      "ja_secret",
      "secret"
    ],
    "00A9": "copyright",
    "00AE": "registered",
    "203C": [
      "bangbang",
      "double_exclamation"
    ],
    "21A9": [
      "arrow_left_hook",
      "leftwards_arrow_with_hook"
    ],
    "21AA": [
      "arrow_right_hook",
      "rightwards_arrow_with_hook"
    ],
    "231A": "watch",
    "231B": "hourglass",
    "23CF": "eject",
    "23E9": "fast_forward",
    "23EA": [
      "fast_reverse",
      "rewind"
    ],
    "23EB": [
      "arrow_double_up",
      "fast_up"
    ],
    "23EC": [
      "arrow_double_down",
      "fast_down"
    ],
    "23ED": "next_track",
    "23EE": "previous_track",
    "23EF": "play_pause",
    "23F0": "alarm_clock",
    "23F1": "stopwatch",
    "23F2": "timer_clock",
    "23F3": "hourglass_flowing_sand",
    "23F8": "pause",
    "23F9": "stop",
    "23FA": "record",
    "24C2": "m",
    "25AA": "black_small_square",
    "25AB": "white_small_square",
    "25B6": [
      "arrow_forward",
      "play"
    ],
    "25C0": [
      "arrow_backward",
      "reverse"
    ],
    "25FB": "white_medium_square",
    "25FC": "black_medium_square",
    "25FD": "white_medium_small_square",
    "25FE": "black_medium_small_square",
    "260E": "telephone",
    "261D": "point_up_2",
    "261D-1F3FB": "point_up_2_tone1",
    "261D-1F3FC": "point_up_2_tone2",
    "261D-1F3FD": "point_up_2_tone3",
    "261D-1F3FE": "point_up_2_tone4",
    "261D-1F3FF": "point_up_2_tone5",
    "262A": "star_and_crescent",
    "262E": [
      "peace",
      "peace_symbol"
    ],
    "262F": "yin_yang",
    "263A": [
      "relaxed",
      "smiling_face"
    ],
    "264A": "gemini",
    "264B": "cancer",
    "264C": "leo",
    "264D": "virgo",
    "264E": "libra",
    "264F": "scorpius",
    "265F": "chess_pawn",
    "267B": [
      "recycle",
      "recycling_symbol"
    ],
    "267E": "infinity",
    "267F": [
      "handicapped",
      "wheelchair"
    ],
    "269B": [
      "atom",
      "atom_symbol"
    ],
    "269C": "fleur-de-lis",
    "26A0": "warning",
    "26A1": [
      "high_voltage",
      "zap"
    ],
    "26A7": "transgender_symbol",
    "26AA": "white_circle",
    "26AB": "black_circle",
    "26B0": "coffin",
    "26B1": "funeral_urn",
    "26BD": "soccer",
    "26BE": "baseball",
    "26C4": "snowman",
    "26C5": [
      "partly_sunny",
      "sun_behind_cloud"
    ],
    "26C8": [
      "stormy",
      "thunder_cloud_and_rain"
    ],
    "26CE": "ophiuchus",
    "26CF": "pick",
    "26D1": [
      "helmet_with_cross",
      "rescue_worker_helmet"
    ],
    "26D3": "chains",
    "26D4": "no_entry",
    "26E9": "shinto_shrine",
    "26EA": "church",
    "26F0": "mountain",
    "26F1": [
      "beach_umbrella",
      "umbrella_on_ground"
    ],
    "26F2": "fountain",
    "26F3": "golf",
    "26F4": "ferry",
    "26F5": "sailboat",
    "26F7": [
      "person_skiing",
      "skier",
      "skiing"
    ],
    "26F8": "ice_skate",
    "26F9": "person_bouncing_ball",
    "26F9-1F3FB": "person_bouncing_ball_tone1",
    "26F9-1F3FC": "person_bouncing_ball_tone2",
    "26F9-1F3FD": "person_bouncing_ball_tone3",
    "26F9-1F3FE": "person_bouncing_ball_tone4",
    "26F9-1F3FF": "person_bouncing_ball_tone5",
    "26FA": "tent",
    "26FD": "fuelpump",
    "270A": "fist",
    "270A-1F3FB": "fist_tone1",
    "270A-1F3FC": "fist_tone2",
    "270A-1F3FD": "fist_tone3",
    "270A-1F3FE": "fist_tone4",
    "270A-1F3FF": "fist_tone5",
    "270B": [
      "high_five",
      "raised_hand"
    ],
    "270B-1F3FB": [
      "high_five_tone1",
      "raised_hand_tone1"
    ],
    "270B-1F3FC": [
      "high_five_tone2",
      "raised_hand_tone2"
    ],
    "270B-1F3FD": [
      "high_five_tone3",
      "raised_hand_tone3"
    ],
    "270B-1F3FE": [
      "high_five_tone4",
      "raised_hand_tone4"
    ],
    "270B-1F3FF": [
      "high_five_tone5",
      "raised_hand_tone5"
    ],
    "270C": [
      "v",
      "victory"
    ],
    "270C-1F3FB": [
      "v_tone1",
      "victory_tone1"
    ],
    "270C-1F3FC": [
      "v_tone2",
      "victory_tone2"
    ],
    "270C-1F3FD": [
      "v_tone3",
      "victory_tone3"
    ],
    "270C-1F3FE": [
      "v_tone4",
      "victory_tone4"
    ],
    "270C-1F3FF": [
      "v_tone5",
      "victory_tone5"
    ],
    "270D": "writing_hand",
    "270D-1F3FB": "writing_hand_tone1",
    "270D-1F3FC": "writing_hand_tone2",
    "270D-1F3FD": "writing_hand_tone3",
    "270D-1F3FE": "writing_hand_tone4",
    "270D-1F3FF": "writing_hand_tone5",
    "270F": "pencil",
    "271D": "latin_cross",
    "274C": [
      "cross_mark",
      "x"
    ],
    "274E": [
      "cross_mark_button",
      "negative_squared_cross_mark"
    ],
    "27A1": "arrow_right",
    "27B0": "curly_loop",
    "27BF": [
      "double_curly_loop",
      "loop"
    ],
    "2B05": "arrow_left",
    "2B06": "arrow_up",
    "2B07": "arrow_down",
    "2B1B": "black_large_square",
    "2B1C": "white_large_square",
    "2B50": "star",
    "2B55": [
      "hollow_red_circle",
      "red_o"
    ],
    "303D": "part_alternation_mark",
    "1F004": "mahjong",
    "1F0CF": "black_joker",
    "1F170": [
      "a",
      "a_blood"
    ],
    "1F171": [
      "b",
      "b_blood"
    ],
    "1F17E": [
      "o",
      "o_blood"
    ],
    "1F17F": "parking",
    "1F18E": [
      "ab",
      "ab_blood"
    ],
    "1F191": "cl",
    "1F192": "cool",
    "1F193": "free",
    "1F194": "id",
    "1F195": "new",
    "1F196": "ng",
    "1F197": "ok",
    "1F198": "sos",
    "1F199": "up2",
    "1F19A": "vs",
    "1F1E6": "regional_indicator_a",
    "1F1E7": "regional_indicator_b",
    "1F1E8": "regional_indicator_c",
    "1F1E9": "regional_indicator_d",
    "1F1EA": "regional_indicator_e",
    "1F1EB": "regional_indicator_f",
    "1F1EC": "regional_indicator_g",
    "1F1ED": "regional_indicator_h",
    "1F1EE": "regional_indicator_i",
    "1F1EF": "regional_indicator_j",
    "1F1F0": "regional_indicator_k",
    "1F1F1": "regional_indicator_l",
    "1F1F2": "regional_indicator_m",
    "1F1F3": "regional_indicator_n",
    "1F1F4": "regional_indicator_o",
    "1F1F5": "regional_indicator_p",
    "1F1F6": "regional_indicator_q",
    "1F1F7": "regional_indicator_r",
    "1F1F8": "regional_indicator_s",
    "1F1F9": "regional_indicator_t",
    "1F1FA": "regional_indicator_u",
    "1F1FB": "regional_indicator_v",
    "1F1FC": "regional_indicator_w",
    "1F1FD": "regional_indicator_x",
    "1F1FE": "regional_indicator_y",
    "1F1FF": "regional_indicator_z",
    "1F201": [
      "ja_here",
      "koko"
    ],
    "1F202": "ja_service_charge",
    "1F21A": "ja_free_of_charge",
    "1F22F": "ja_reserved",
    "1F232": "ja_prohibited",
    "1F233": "ja_vacancy",
    "1F234": "ja_passing_grade",
    "1F235": "ja_no_vacancy",
    "1F236": "ja_not_free_of_carge",
    "1F237": "ja_monthly_amount",
    "1F238": "ja_application",
    "1F239": "ja_discount",
    "1F23A": "ja_open_for_business",
    "1F250": [
      "ideograph_advantage",
      "ja_bargain"
    ],
    "1F251": [
      "accept",
      "ja_acceptable"
    ],
    "1F300": "cyclone",
    "1F301": "foggy",
    "1F302": "closed_umbrella",
    "1F303": "night_with_stars",
    "1F304": "sunrise_over_mountains",
    "1F305": "sunrise",
    "1F306": "city_dusk",
    "1F307": [
      "city_sunrise",
      "city_sunset"
    ],
    "1F308": "rainbow",
    "1F309": "bridge_at_night",
    "1F30A": [
      "ocean",
      "water_wave"
    ],
    "1F30B": "volcano",
    "1F30C": "milky_way",
    "1F30D": [
      "earth_africa",
      "earth_europe"
    ],
    "1F30E": "earth_americas",
    "1F30F": "earth_asia",
    "1F310": "globe_with_meridians",
    "1F311": "new_moon",
    "1F312": "waxing_crescent_moon",
    "1F313": "first_quarter_moon",
    "1F314": "waxing_gibbous_moon",
    "1F315": "full_moon",
    "1F316": "waning_gibbous_moon",
    "1F317": "last_quarter_moon",
    "1F318": "waning_crescent_moon",
    "1F319": "crescent_moon",
    "1F31A": "new_moon_with_face",
    "1F31B": "first_quarter_moon_with_face",
    "1F31C": "last_quarter_moon_with_face",
    "1F31D": "full_moon_with_face",
    "1F31E": "sun_with_face",
    "1F31F": [
      "glowing_star",
      "star2"
    ],
    "1F320": [
      "shooting_star",
      "stars"
    ],
    "1F321": "thermometer",
    "1F324": [
      "sun_behind_small_cloud",
      "sunny"
    ],
    "1F325": [
      "cloudy",
      "sun_behind_large_cloud"
    ],
    "1F326": [
      "sun_and_rain",
      "sun_behind_rain_cloud"
    ],
    "1F327": [
      "cloud_with_rain",
      "rainy"
    ],
    "1F328": [
      "cloud_with_snow",
      "snowy"
    ],
    "1F329": [
      "cloud_with_lightning",
      "lightning"
    ],
    "1F32A": "tornado",
    "1F32B": "fog",
    "1F32C": "wind_blowing_face",
    "1F32D": "hotdog",
    "1F32E": "taco",
    "1F32F": "burrito",
    "1F330": "chestnut",
    "1F331": "seedling",
    "1F332": "evergreen_tree",
    "1F333": "deciduous_tree",
    "1F334": "palm_tree",
    "1F335": "cactus",
    "1F336": "hot_pepper",
    "1F337": "tulip",
    "1F338": "cherry_blossom",
    "1F339": "rose",
    "1F33A": "hibiscus",
    "1F33B": "sunflower",
    "1F33C": "blossom",
    "1F33D": [
      "corn",
      "ear_of_corn"
    ],
    "1F33E": [
      "ear_of_rice",
      "sheaf_of_rice"
    ],
    "1F33F": "herb",
    "1F340": "four_leaf_clover",
    "1F341": "maple_leaf",
    "1F342": "fallen_leaf",
    "1F343": "leaves",
    "1F344": "mushroom",
    "1F345": "tomato",
    "1F346": "eggplant",
    "1F347": "grapes",
    "1F348": "melon",
    "1F349": "watermelon",
    "1F34A": [
      "orange",
      "tangerine"
    ],
    "1F34B": "lemon",
    "1F34C": "banana",
    "1F34D": "pineapple",
    "1F34E": [
      "apple",
      "red_apple"
    ],
    "1F34F": "green_apple",
    "1F350": "pear",
    "1F351": "peach",
    "1F352": "cherries",
    "1F353": "strawberry",
    "1F354": "hamburger",
    "1F355": "pizza",
    "1F356": "meat_on_bone",
    "1F357": "poultry_leg",
    "1F358": "rice_cracker",
    "1F359": "rice_ball",
    "1F35A": [
      "cooked_rice",
      "rice"
    ],
    "1F35B": [
      "curry",
      "curry_rice"
    ],
    "1F35C": [
      "ramen",
      "steaming_bowl"
    ],
    "1F35D": "spaghetti",
    "1F35E": "bread",
    "1F35F": [
      "french_fries",
      "fries"
    ],
    "1F360": "sweet_potato",
    "1F361": "dango",
    "1F362": "oden",
    "1F363": "sushi",
    "1F364": "fried_shrimp",
    "1F365": "fish_cake",
    "1F366": [
      "icecream",
      "soft_serve"
    ],
    "1F367": "shaved_ice",
    "1F368": "ice_cream",
    "1F369": "doughnut",
    "1F36A": "cookie",
    "1F36B": "chocolate_bar",
    "1F36C": "candy",
    "1F36D": "lollipop",
    "1F36E": "custard",
    "1F36F": "honey_pot",
    "1F370": [
      "cake",
      "shortcake"
    ],
    "1F371": [
      "bento",
      "bento_box"
    ],
    "1F372": [
      "pot_of_food",
      "stew"
    ],
    "1F373": [
      "cooking",
      "fried_egg"
    ],
    "1F374": "fork_and_knife",
    "1F375": "tea",
    "1F376": "sake",
    "1F377": "wine_glass",
    "1F378": "cocktail",
    "1F379": "tropical_drink",
    "1F37A": "beer",
    "1F37B": "beers",
    "1F37C": "baby_bottle",
    "1F37D": "fork_knife_plate",
    "1F37E": "champagne",
    "1F37F": "popcorn",
    "1F380": "ribbon",
    "1F381": "gift",
    "1F382": [
      "birthday",
      "birthday_cake"
    ],
    "1F383": "jack_o_lantern",
    "1F384": "christmas_tree",
    "1F385": "santa",
    "1F385-1F3FB": "santa_tone1",
    "1F385-1F3FC": "santa_tone2",
    "1F385-1F3FD": "santa_tone3",
    "1F385-1F3FE": "santa_tone4",
    "1F385-1F3FF": "santa_tone5",
    "1F386": "fireworks",
    "1F387": "sparkler",
    "1F388": "balloon",
    "1F389": [
      "party",
      "party_popper",
      "tada"
    ],
    "1F38A": "confetti_ball",
    "1F38B": "tanabata_tree",
    "1F38C": "crossed_flags",
    "1F38D": "bamboo",
    "1F38E": "dolls",
    "1F38F": [
      "carp_streamer",
      "flags"
    ],
    "1F390": "wind_chime",
    "1F391": [
      "moon_ceremony",
      "rice_scene"
    ],
    "1F392": [
      "backpack",
      "school_satchel"
    ],
    "1F393": [
      "graduation_cap",
      "mortar_board"
    ],
    "1F396": "military_medal",
    "1F397": "reminder_ribbon",
    "1F399": "studio_microphone",
    "1F39A": "level_slider",
    "1F39B": "control_knobs",
    "1F39E": "film_frames",
    "1F39F": [
      "admission_tickets",
      "tickets"
    ],
    "1F3A0": "carousel_horse",
    "1F3A1": "ferris_wheel",
    "1F3A2": "roller_coaster",
    "1F3A3": [
      "fishing_pole",
      "fishing_pole_and_fish"
    ],
    "1F3A4": "microphone",
    "1F3A5": "movie_camera",
    "1F3A6": "cinema",
    "1F3A7": "headphones",
    "1F3A8": [
      "art",
      "palette"
    ],
    "1F3A9": [
      "top_hat",
      "tophat"
    ],
    "1F3AA": "circus_tent",
    "1F3AB": "ticket",
    "1F3AC": "clapper",
    "1F3AD": "performing_arts",
    "1F3AE": [
      "controller",
      "video_game"
    ],
    "1F3AF": [
      "bullseye",
      "dart",
      "direct_hit"
    ],
    "1F3B0": "slot_machine",
    "1F3B1": [
      "8ball",
      "billiards"
    ],
    "1F3B2": "game_die",
    "1F3B3": "bowling",
    "1F3B4": "flower_playing_cards",
    "1F3B5": "musical_note",
    "1F3B6": [
      "musical_notes",
      "notes"
    ],
    "1F3B7": "saxophone",
    "1F3B8": "guitar",
    "1F3B9": "musical_keyboard",
    "1F3BA": "trumpet",
    "1F3BB": "violin",
    "1F3BC": "musical_score",
    "1F3BD": [
      "running_shirt",
      "running_shirt_with_sash"
    ],
    "1F3BE": "tennis",
    "1F3BF": "ski",
    "1F3C0": "basketball",
    "1F3C1": "checkered_flag",
    "1F3C2": [
      "person_snowboarding",
      "snowboarder",
      "snowboarding"
    ],
    "1F3C2-1F3FB": [
      "person_snowboarding_tone1",
      "snowboarder_tone1",
      "snowboarding_tone1"
    ],
    "1F3C2-1F3FC": [
      "person_snowboarding_tone2",
      "snowboarder_tone2",
      "snowboarding_tone2"
    ],
    "1F3C2-1F3FD": [
      "person_snowboarding_tone3",
      "snowboarder_tone3",
      "snowboarding_tone3"
    ],
    "1F3C2-1F3FE": [
      "person_snowboarding_tone4",
      "snowboarder_tone4",
      "snowboarding_tone4"
    ],
    "1F3C2-1F3FF": [
      "person_snowboarding_tone5",
      "snowboarder_tone5",
      "snowboarding_tone5"
    ],
    "1F3C3": [
      "person_running",
      "running"
    ],
    "1F3C3-1F3FB": [
      "person_running_tone1",
      "running_tone1"
    ],
    "1F3C3-1F3FC": [
      "person_running_tone2",
      "running_tone2"
    ],
    "1F3C3-1F3FD": [
      "person_running_tone3",
      "running_tone3"
    ],
    "1F3C3-1F3FE": [
      "person_running_tone4",
      "running_tone4"
    ],
    "1F3C3-1F3FF": [
      "person_running_tone5",
      "running_tone5"
    ],
    "1F3C4": [
      "person_surfing",
      "surfer",
      "surfing"
    ],
    "1F3C4-1F3FB": [
      "person_surfing_tone1",
      "surfer_tone1",
      "surfing_tone1"
    ],
    "1F3C4-1F3FC": [
      "person_surfing_tone2",
      "surfer_tone2",
      "surfing_tone2"
    ],
    "1F3C4-1F3FD": [
      "person_surfing_tone3",
      "surfer_tone3",
      "surfing_tone3"
    ],
    "1F3C4-1F3FE": [
      "person_surfing_tone4",
      "surfer_tone4",
      "surfing_tone4"
    ],
    "1F3C4-1F3FF": [
      "person_surfing_tone5",
      "surfer_tone5",
      "surfing_tone5"
    ],
    "1F3C5": "sports_medal",
    "1F3C6": "trophy",
    "1F3C7": "horse_racing",
    "1F3C7-1F3FB": "horse_racing_tone1",
    "1F3C7-1F3FC": "horse_racing_tone2",
    "1F3C7-1F3FD": "horse_racing_tone3",
    "1F3C7-1F3FE": "horse_racing_tone4",
    "1F3C7-1F3FF": "horse_racing_tone5",
    "1F3C8": "football",
    "1F3C9": "rugby_football",
    "1F3CA": [
      "person_swimming",
      "swimmer",
      "swimming"
    ],
    "1F3CA-1F3FB": [
      "person_swimming_tone1",
      "swimmer_tone1",
      "swimming_tone1"
    ],
    "1F3CA-1F3FC": [
      "person_swimming_tone2",
      "swimmer_tone2",
      "swimming_tone2"
    ],
    "1F3CA-1F3FD": [
      "person_swimming_tone3",
      "swimmer_tone3",
      "swimming_tone3"
    ],
    "1F3CA-1F3FE": [
      "person_swimming_tone4",
      "swimmer_tone4",
      "swimming_tone4"
    ],
    "1F3CA-1F3FF": [
      "person_swimming_tone5",
      "swimmer_tone5",
      "swimming_tone5"
    ],
    "1F3CB": [
      "person_lifting_weights",
      "weight_lifter",
      "weight_lifting"
    ],
    "1F3CB-1F3FB": [
      "person_lifting_weights_tone1",
      "weight_lifter_tone1",
      "weight_lifting_tone1"
    ],
    "1F3CB-1F3FC": [
      "person_lifting_weights_tone2",
      "weight_lifter_tone2",
      "weight_lifting_tone2"
    ],
    "1F3CB-1F3FD": [
      "person_lifting_weights_tone3",
      "weight_lifter_tone3",
      "weight_lifting_tone3"
    ],
    "1F3CB-1F3FE": [
      "person_lifting_weights_tone4",
      "weight_lifter_tone4",
      "weight_lifting_tone4"
    ],
    "1F3CB-1F3FF": [
      "person_lifting_weights_tone5",
      "weight_lifter_tone5",
      "weight_lifting_tone5"
    ],
    "1F3CC": [
      "golfer",
      "golfing",
      "person_golfing"
    ],
    "1F3CC-1F3FB": [
      "golfer_tone1",
      "golfing_tone1",
      "person_golfing_tone1"
    ],
    "1F3CC-1F3FC": [
      "golfer_tone2",
      "golfing_tone2",
      "person_golfing_tone2"
    ],
    "1F3CC-1F3FD": [
      "golfer_tone3",
      "golfing_tone3",
      "person_golfing_tone3"
    ],
    "1F3CC-1F3FE": [
      "golfer_tone4",
      "golfing_tone4",
      "person_golfing_tone4"
    ],
    "1F3CC-1F3FF": [
      "golfer_tone5",
      "golfing_tone5",
      "person_golfing_tone5"
    ],
    "1F3CD": "motorcycle",
    "1F3CE": "racing_car",
    "1F3CF": "cricket_game",
    "1F3D0": "volleyball",
    "1F3D1": "field_hockey",
    "1F3D2": "hockey",
    "1F3D3": "ping_pong",
    "1F3D4": "mountain_snow",
    "1F3D5": "camping",
    "1F3D6": [
      "beach",
      "beach_with_umbrella"
    ],
    "1F3D7": [
      "building_construction",
      "construction_site"
    ],
    "1F3D8": [
      "homes",
      "houses"
    ],
    "1F3D9": "cityscape",
    "1F3DA": [
      "derelict_house",
      "house_abandoned"
    ],
    "1F3DB": "classical_building",
    "1F3DC": "desert",
    "1F3DD": [
      "desert_island",
      "island"
    ],
    "1F3DE": "national_park",
    "1F3DF": "stadium",
    "1F3E0": "house",
    "1F3E1": "house_with_garden",
    "1F3E2": "office",
    "1F3E3": "post_office",
    "1F3E4": "european_post_office",
    "1F3E5": "hospital",
    "1F3E6": "bank",
    "1F3E7": "atm",
    "1F3E8": "hotel",
    "1F3E9": "love_hotel",
    "1F3EA": "convenience_store",
    "1F3EB": "school",
    "1F3EC": "department_store",
    "1F3ED": "factory",
    "1F3EE": [
      "izakaya_lantern",
      "red_paper_lantern"
    ],
    "1F3EF": "japanese_castle",
    "1F3F0": [
      "castle",
      "european_castle"
    ],
    "1F3F3": "white_flag",
    "1F3F4": "black_flag",
    "1F3F5": "rosette",
    "1F3F7": "label",
    "1F3F8": "badminton",
    "1F3F9": "bow_and_arrow",
    "1F3FA": "amphora",
    "1F3FB": [
      "tone1",
      "tone_light"
    ],
    "1F3FC": [
      "tone2",
      "tone_medium_light"
    ],
    "1F3FD": [
      "tone3",
      "tone_medium"
    ],
    "1F3FE": [
      "tone4",
      "tone_medium_dark"
    ],
    "1F3FF": [
      "tone5",
      "tone_dark"
    ],
    "1F400": "rat",
    "1F401": "mouse",
    "1F402": "ox",
    "1F403": "water_buffalo",
    "1F404": "cow",
    "1F405": "tiger",
    "1F406": "leopard",
    "1F407": "rabbit",
    "1F408": "cat",
    "1F409": "dragon",
    "1F40A": "crocodile",
    "1F40B": "whale",
    "1F40C": "snail",
    "1F40D": "snake",
    "1F40E": [
      "horse",
      "racehorse"
    ],
    "1F40F": "ram",
    "1F410": "goat",
    "1F411": [
      "ewe",
      "sheep"
    ],
    "1F412": "monkey",
    "1F413": "rooster",
    "1F414": [
      "chicken",
      "chicken_face"
    ],
    "1F415": "dog",
    "1F416": "pig",
    "1F417": "boar",
    "1F418": "elephant",
    "1F419": "octopus",
    "1F41A": "shell",
    "1F41B": "bug",
    "1F41C": "ant",
    "1F41D": "bee",
    "1F41E": "lady_beetle",
    "1F41F": "fish",
    "1F420": "tropical_fish",
    "1F421": "blowfish",
    "1F422": "turtle",
    "1F423": "hatching_chick",
    "1F424": "baby_chick",
    "1F425": "hatched_chick",
    "1F426": [
      "bird",
      "bird_face"
    ],
    "1F427": [
      "penguin",
      "penguin_face"
    ],
    "1F428": [
      "koala",
      "koala_face"
    ],
    "1F429": "poodle",
    "1F42A": "dromedary_camel",
    "1F42B": "camel",
    "1F42C": "dolphin",
    "1F42D": "mouse_face",
    "1F42E": "cow_face",
    "1F42F": "tiger_face",
    "1F430": "rabbit_face",
    "1F431": "cat_face",
    "1F432": "dragon_face",
    "1F433": "spouting_whale",
    "1F434": "horse_face",
    "1F435": "monkey_face",
    "1F436": "dog_face",
    "1F437": "pig_face",
    "1F438": [
      "frog",
      "frog_face"
    ],
    "1F439": [
      "hamster",
      "hamster_face"
    ],
    "1F43A": [
      "wolf",
      "wolf_face"
    ],
    "1F43B": [
      "bear",
      "bear_face"
    ],
    "1F43C": [
      "panda",
      "panda_face"
    ],
    "1F43D": "pig_nose",
    "1F43E": "paw_prints",
    "1F43F": "chipmunk",
    "1F440": "eyes",
    "1F441": "eye",
    "1F442": "ear",
    "1F442-1F3FB": "ear_tone1",
    "1F442-1F3FC": "ear_tone2",
    "1F442-1F3FD": "ear_tone3",
    "1F442-1F3FE": "ear_tone4",
    "1F442-1F3FF": "ear_tone5",
    "1F443": "nose",
    "1F443-1F3FB": "nose_tone1",
    "1F443-1F3FC": "nose_tone2",
    "1F443-1F3FD": "nose_tone3",
    "1F443-1F3FE": "nose_tone4",
    "1F443-1F3FF": "nose_tone5",
    "1F444": [
      "lips",
      "mouth"
    ],
    "1F445": "tongue",
    "1F446": "point_up",
    "1F446-1F3FB": "point_up_tone1",
    "1F446-1F3FC": "point_up_tone2",
    "1F446-1F3FD": "point_up_tone3",
    "1F446-1F3FE": "point_up_tone4",
    "1F446-1F3FF": "point_up_tone5",
    "1F447": "point_down",
    "1F447-1F3FB": "point_down_tone1",
    "1F447-1F3FC": "point_down_tone2",
    "1F447-1F3FD": "point_down_tone3",
    "1F447-1F3FE": "point_down_tone4",
    "1F447-1F3FF": "point_down_tone5",
    "1F448": "point_left",
    "1F448-1F3FB": "point_left_tone1",
    "1F448-1F3FC": "point_left_tone2",
    "1F448-1F3FD": "point_left_tone3",
    "1F448-1F3FE": "point_left_tone4",
    "1F448-1F3FF": "point_left_tone5",
    "1F449": "point_right",
    "1F449-1F3FB": "point_right_tone1",
    "1F449-1F3FC": "point_right_tone2",
    "1F449-1F3FD": "point_right_tone3",
    "1F449-1F3FE": "point_right_tone4",
    "1F449-1F3FF": "point_right_tone5",
    "1F44A": "punch",
    "1F44A-1F3FB": "punch_tone1",
    "1F44A-1F3FC": "punch_tone2",
    "1F44A-1F3FD": "punch_tone3",
    "1F44A-1F3FE": "punch_tone4",
    "1F44A-1F3FF": "punch_tone5",
    "1F44B": [
      "wave",
      "waving_hand"
    ],
    "1F44B-1F3FB": [
      "wave_tone1",
      "waving_hand_tone1"
    ],
    "1F44B-1F3FC": [
      "wave_tone2",
      "waving_hand_tone2"
    ],
    "1F44B-1F3FD": [
      "wave_tone3",
      "waving_hand_tone3"
    ],
    "1F44B-1F3FE": [
      "wave_tone4",
      "waving_hand_tone4"
    ],
    "1F44B-1F3FF": [
      "wave_tone5",
      "waving_hand_tone5"
    ],
    "1F44C": "ok_hand",
    "1F44C-1F3FB": "ok_hand_tone1",
    "1F44C-1F3FC": "ok_hand_tone2",
    "1F44C-1F3FD": "ok_hand_tone3",
    "1F44C-1F3FE": "ok_hand_tone4",
    "1F44C-1F3FF": "ok_hand_tone5",
    "1F44D": [
      "+1",
      "thumbsup",
      "yes"
    ],
    "1F44D-1F3FB": [
      "+1_tone1",
      "thumbsup_tone1",
      "yes_tone1"
    ],
    "1F44D-1F3FC": [
      "+1_tone2",
      "thumbsup_tone2",
      "yes_tone2"
    ],
    "1F44D-1F3FD": [
      "+1_tone3",
      "thumbsup_tone3",
      "yes_tone3"
    ],
    "1F44D-1F3FE": [
      "+1_tone4",
      "thumbsup_tone4",
      "yes_tone4"
    ],
    "1F44D-1F3FF": [
      "+1_tone5",
      "thumbsup_tone5",
      "yes_tone5"
    ],
    "1F44E": [
      "-1",
      "no",
      "thumbsdown"
    ],
    "1F44E-1F3FB": [
      "-1_tone1",
      "no_tone1",
      "thumbsdown_tone1"
    ],
    "1F44E-1F3FC": [
      "-1_tone2",
      "no_tone2",
      "thumbsdown_tone2"
    ],
    "1F44E-1F3FD": [
      "-1_tone3",
      "no_tone3",
      "thumbsdown_tone3"
    ],
    "1F44E-1F3FE": [
      "-1_tone4",
      "no_tone4",
      "thumbsdown_tone4"
    ],
    "1F44E-1F3FF": [
      "-1_tone5",
      "no_tone5",
      "thumbsdown_tone5"
    ],
    "1F44F": [
      "clap",
      "clapping_hands"
    ],
    "1F44F-1F3FB": [
      "clap_tone1",
      "clapping_hands_tone1"
    ],
    "1F44F-1F3FC": [
      "clap_tone2",
      "clapping_hands_tone2"
    ],
    "1F44F-1F3FD": [
      "clap_tone3",
      "clapping_hands_tone3"
    ],
    "1F44F-1F3FE": [
      "clap_tone4",
      "clapping_hands_tone4"
    ],
    "1F44F-1F3FF": [
      "clap_tone5",
      "clapping_hands_tone5"
    ],
    "1F450": "open_hands",
    "1F450-1F3FB": "open_hands_tone1",
    "1F450-1F3FC": "open_hands_tone2",
    "1F450-1F3FD": "open_hands_tone3",
    "1F450-1F3FE": "open_hands_tone4",
    "1F450-1F3FF": "open_hands_tone5",
    "1F451": "crown",
    "1F452": "womans_hat",
    "1F453": [
      "eyeglasses",
      "glasses"
    ],
    "1F454": "necktie",
    "1F455": "shirt",
    "1F456": "jeans",
    "1F457": "dress",
    "1F458": "kimono",
    "1F459": "bikini",
    "1F45A": "womans_clothes",
    "1F45B": "purse",
    "1F45C": "handbag",
    "1F45D": [
      "clutch_bag",
      "pouch"
    ],
    "1F45E": "mans_shoe",
    "1F45F": [
      "athletic_shoe",
      "sneaker"
    ],
    "1F460": "high_heel",
    "1F461": "sandal",
    "1F462": "boot",
    "1F463": "footprints",
    "1F464": "bust_in_silhouette",
    "1F465": "busts_in_silhouette",
    "1F466": "boy",
    "1F466-1F3FB": "boy_tone1",
    "1F466-1F3FC": "boy_tone2",
    "1F466-1F3FD": "boy_tone3",
    "1F466-1F3FE": "boy_tone4",
    "1F466-1F3FF": "boy_tone5",
    "1F467": "girl",
    "1F467-1F3FB": "girl_tone1",
    "1F467-1F3FC": "girl_tone2",
    "1F467-1F3FD": "girl_tone3",
    "1F467-1F3FE": "girl_tone4",
    "1F467-1F3FF": "girl_tone5",
    "1F468": "man",
    "1F468-1F3FB": "man_tone1",
    "1F468-1F3FC": "man_tone2",
    "1F468-1F3FD": "man_tone3",
    "1F468-1F3FE": "man_tone4",
    "1F468-1F3FF": "man_tone5",
    "1F469": "woman",
    "1F469-1F3FB": "woman_tone1",
    "1F469-1F3FC": "woman_tone2",
    "1F469-1F3FD": "woman_tone3",
    "1F469-1F3FE": "woman_tone4",
    "1F469-1F3FF": "woman_tone5",
    "1F46A": "family",
    "1F46B": "couple",
    "1F46B-1F3FB": "couple_tone1",
    "1F46B-1F3FC": "couple_tone2",
    "1F46B-1F3FD": "couple_tone3",
    "1F46B-1F3FE": "couple_tone4",
    "1F46B-1F3FF": "couple_tone5",
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FC": "couple_tone1-2",
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FD": "couple_tone1-3",
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FE": "couple_tone1-4",
    "1F469-1F3FB-200D-1F91D-200D-1F468-1F3FF": "couple_tone1-5",
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FB": "couple_tone2-1",
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FD": "couple_tone2-3",
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FE": "couple_tone2-4",
    "1F469-1F3FC-200D-1F91D-200D-1F468-1F3FF": "couple_tone2-5",
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FB": "couple_tone3-1",
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FC": "couple_tone3-2",
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FE": "couple_tone3-4",
    "1F469-1F3FD-200D-1F91D-200D-1F468-1F3FF": "couple_tone3-5",
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FB": "couple_tone4-1",
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FC": "couple_tone4-2",
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FD": "couple_tone4-3",
    "1F469-1F3FE-200D-1F91D-200D-1F468-1F3FF": "couple_tone4-5",
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FB": "couple_tone5-1",
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FC": "couple_tone5-2",
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FD": "couple_tone5-3",
    "1F469-1F3FF-200D-1F91D-200D-1F468-1F3FE": "couple_tone5-4",
    "1F46C": "two_men_holding_hands",
    "1F46C-1F3FB": "two_men_holding_hands_tone1",
    "1F46C-1F3FC": "two_men_holding_hands_tone2",
    "1F46C-1F3FD": "two_men_holding_hands_tone3",
    "1F46C-1F3FE": "two_men_holding_hands_tone4",
    "1F46C-1F3FF": "two_men_holding_hands_tone5",
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FC": "two_men_holding_hands_tone1-2",
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FD": "two_men_holding_hands_tone1-3",
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FE": "two_men_holding_hands_tone1-4",
    "1F468-1F3FB-200D-1F91D-200D-1F468-1F3FF": "two_men_holding_hands_tone1-5",
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FB": "two_men_holding_hands_tone2-1",
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FD": "two_men_holding_hands_tone2-3",
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FE": "two_men_holding_hands_tone2-4",
    "1F468-1F3FC-200D-1F91D-200D-1F468-1F3FF": "two_men_holding_hands_tone2-5",
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FB": "two_men_holding_hands_tone3-1",
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FC": "two_men_holding_hands_tone3-2",
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FE": "two_men_holding_hands_tone3-4",
    "1F468-1F3FD-200D-1F91D-200D-1F468-1F3FF": "two_men_holding_hands_tone3-5",
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FB": "two_men_holding_hands_tone4-1",
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FC": "two_men_holding_hands_tone4-2",
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FD": "two_men_holding_hands_tone4-3",
    "1F468-1F3FE-200D-1F91D-200D-1F468-1F3FF": "two_men_holding_hands_tone4-5",
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FB": "two_men_holding_hands_tone5-1",
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FC": "two_men_holding_hands_tone5-2",
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FD": "two_men_holding_hands_tone5-3",
    "1F468-1F3FF-200D-1F91D-200D-1F468-1F3FE": "two_men_holding_hands_tone5-4",
    "1F46D": "two_women_holding_hands",
    "1F46D-1F3FB": "two_women_holding_hands_tone1",
    "1F46D-1F3FC": "two_women_holding_hands_tone2",
    "1F46D-1F3FD": "two_women_holding_hands_tone3",
    "1F46D-1F3FE": "two_women_holding_hands_tone4",
    "1F46D-1F3FF": "two_women_holding_hands_tone5",
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FC": "two_women_holding_hands_tone1-2",
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FD": "two_women_holding_hands_tone1-3",
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FE": "two_women_holding_hands_tone1-4",
    "1F469-1F3FB-200D-1F91D-200D-1F469-1F3FF": "two_women_holding_hands_tone1-5",
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FB": "two_women_holding_hands_tone2-1",
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FD": "two_women_holding_hands_tone2-3",
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FE": "two_women_holding_hands_tone2-4",
    "1F469-1F3FC-200D-1F91D-200D-1F469-1F3FF": "two_women_holding_hands_tone2-5",
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FB": "two_women_holding_hands_tone3-1",
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FC": "two_women_holding_hands_tone3-2",
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FE": "two_women_holding_hands_tone3-4",
    "1F469-1F3FD-200D-1F91D-200D-1F469-1F3FF": "two_women_holding_hands_tone3-5",
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FB": "two_women_holding_hands_tone4-1",
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FC": "two_women_holding_hands_tone4-2",
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FD": "two_women_holding_hands_tone4-3",
    "1F469-1F3FE-200D-1F91D-200D-1F469-1F3FF": "two_women_holding_hands_tone4-5",
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FB": "two_women_holding_hands_tone5-1",
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FC": "two_women_holding_hands_tone5-2",
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FD": "two_women_holding_hands_tone5-3",
    "1F469-1F3FF-200D-1F91D-200D-1F469-1F3FE": "two_women_holding_hands_tone5-4",
    "1F46E": [
      "cop",
      "police_officer"
    ],
    "1F46E-1F3FB": [
      "cop_tone1",
      "police_officer_tone1"
    ],
    "1F46E-1F3FC": [
      "cop_tone2",
      "police_officer_tone2"
    ],
    "1F46E-1F3FD": [
      "cop_tone3",
      "police_officer_tone3"
    ],
    "1F46E-1F3FE": [
      "cop_tone4",
      "police_officer_tone4"
    ],
    "1F46E-1F3FF": [
      "cop_tone5",
      "police_officer_tone5"
    ],
    "1F46F": [
      "dancers",
      "people_with_bunny_ears_partying"
    ],
    "1F470": "person_with_veil",
    "1F470-1F3FB": "person_with_veil_tone1",
    "1F470-1F3FC": "person_with_veil_tone2",
    "1F470-1F3FD": "person_with_veil_tone3",
    "1F470-1F3FE": "person_with_veil_tone4",
    "1F470-1F3FF": "person_with_veil_tone5",
    "1F471": "blond_haired",
    "1F471-1F3FB": "blond_haired_tone1",
    "1F471-1F3FC": "blond_haired_tone2",
    "1F471-1F3FD": "blond_haired_tone3",
    "1F471-1F3FE": "blond_haired_tone4",
    "1F471-1F3FF": "blond_haired_tone5",
    "1F472": "person_with_skullcap",
    "1F472-1F3FB": "person_with_skullcap_tone1",
    "1F472-1F3FC": "person_with_skullcap_tone2",
    "1F472-1F3FD": "person_with_skullcap_tone3",
    "1F472-1F3FE": "person_with_skullcap_tone4",
    "1F472-1F3FF": "person_with_skullcap_tone5",
    "1F473": "person_wearing_turban",
    "1F473-1F3FB": "person_wearing_turban_tone1",
    "1F473-1F3FC": "person_wearing_turban_tone2",
    "1F473-1F3FD": "person_wearing_turban_tone3",
    "1F473-1F3FE": "person_wearing_turban_tone4",
    "1F473-1F3FF": "person_wearing_turban_tone5",
    "1F474": "older_man",
    "1F474-1F3FB": "older_man_tone1",
    "1F474-1F3FC": "older_man_tone2",
    "1F474-1F3FD": "older_man_tone3",
    "1F474-1F3FE": "older_man_tone4",
    "1F474-1F3FF": "older_man_tone5",
    "1F475": "older_woman",
    "1F475-1F3FB": "older_woman_tone1",
    "1F475-1F3FC": "older_woman_tone2",
    "1F475-1F3FD": "older_woman_tone3",
    "1F475-1F3FE": "older_woman_tone4",
    "1F475-1F3FF": "older_woman_tone5",
    "1F476": "baby",
    "1F476-1F3FB": "baby_tone1",
    "1F476-1F3FC": "baby_tone2",
    "1F476-1F3FD": "baby_tone3",
    "1F476-1F3FE": "baby_tone4",
    "1F476-1F3FF": "baby_tone5",
    "1F477": "construction_worker",
    "1F477-1F3FB": "construction_worker_tone1",
    "1F477-1F3FC": "construction_worker_tone2",
    "1F477-1F3FD": "construction_worker_tone3",
    "1F477-1F3FE": "construction_worker_tone4",
    "1F477-1F3FF": "construction_worker_tone5",
    "1F478": "princess",
    "1F478-1F3FB": "princess_tone1",
    "1F478-1F3FC": "princess_tone2",
    "1F478-1F3FD": "princess_tone3",
    "1F478-1F3FE": "princess_tone4",
    "1F478-1F3FF": "princess_tone5",
    "1F479": [
      "japanese_ogre",
      "ogre"
    ],
    "1F47A": [
      "goblin",
      "japanese_goblin"
    ],
    "1F47B": "ghost",
    "1F47C": "angel",
    "1F47C-1F3FB": "angel_tone1",
    "1F47C-1F3FC": "angel_tone2",
    "1F47C-1F3FD": "angel_tone3",
    "1F47C-1F3FE": "angel_tone4",
    "1F47C-1F3FF": "angel_tone5",
    "1F47D": "alien",
    "1F47E": [
      "alien_monster",
      "space_invader"
    ],
    "1F47F": [
      "angry_imp",
      "imp"
    ],
    "1F480": "skull",
    "1F481": "person_tipping_hand",
    "1F481-1F3FB": "person_tipping_hand_tone1",
    "1F481-1F3FC": "person_tipping_hand_tone2",
    "1F481-1F3FD": "person_tipping_hand_tone3",
    "1F481-1F3FE": "person_tipping_hand_tone4",
    "1F481-1F3FF": "person_tipping_hand_tone5",
    "1F482": "guard",
    "1F482-1F3FB": "guard_tone1",
    "1F482-1F3FC": "guard_tone2",
    "1F482-1F3FD": "guard_tone3",
    "1F482-1F3FE": "guard_tone4",
    "1F482-1F3FF": "guard_tone5",
    "1F483": [
      "dancer",
      "woman_dancing"
    ],
    "1F483-1F3FB": [
      "dancer_tone1",
      "woman_dancing_tone1"
    ],
    "1F483-1F3FC": [
      "dancer_tone2",
      "woman_dancing_tone2"
    ],
    "1F483-1F3FD": [
      "dancer_tone3",
      "woman_dancing_tone3"
    ],
    "1F483-1F3FE": [
      "dancer_tone4",
      "woman_dancing_tone4"
    ],
    "1F483-1F3FF": [
      "dancer_tone5",
      "woman_dancing_tone5"
    ],
    "1F484": "lipstick",
    "1F485": [
      "nail_care",
      "nail_polish"
    ],
    "1F485-1F3FB": [
      "nail_care_tone1",
      "nail_polish_tone1"
    ],
    "1F485-1F3FC": [
      "nail_care_tone2",
      "nail_polish_tone2"
    ],
    "1F485-1F3FD": [
      "nail_care_tone3",
      "nail_polish_tone3"
    ],
    "1F485-1F3FE": [
      "nail_care_tone4",
      "nail_polish_tone4"
    ],
    "1F485-1F3FF": [
      "nail_care_tone5",
      "nail_polish_tone5"
    ],
    "1F486": [
      "massage",
      "person_getting_massage"
    ],
    "1F486-1F3FB": [
      "massage_tone1",
      "person_getting_massage_tone1"
    ],
    "1F486-1F3FC": [
      "massage_tone2",
      "person_getting_massage_tone2"
    ],
    "1F486-1F3FD": [
      "massage_tone3",
      "person_getting_massage_tone3"
    ],
    "1F486-1F3FE": [
      "massage_tone4",
      "person_getting_massage_tone4"
    ],
    "1F486-1F3FF": [
      "massage_tone5",
      "person_getting_massage_tone5"
    ],
    "1F487": [
      "haircut",
      "person_getting_haircut"
    ],
    "1F487-1F3FB": [
      "haircut_tone1",
      "person_getting_haircut_tone1"
    ],
    "1F487-1F3FC": [
      "haircut_tone2",
      "person_getting_haircut_tone2"
    ],
    "1F487-1F3FD": [
      "haircut_tone3",
      "person_getting_haircut_tone3"
    ],
    "1F487-1F3FE": [
      "haircut_tone4",
      "person_getting_haircut_tone4"
    ],
    "1F487-1F3FF": [
      "haircut_tone5",
      "person_getting_haircut_tone5"
    ],
    "1F488": [
      "barber",
      "barber_pole"
    ],
    "1F489": "syringe",
    "1F48A": "pill",
    "1F48B": "kiss",
    "1F48C": "love_letter",
    "1F48D": "ring",
    "1F48E": "gem",
    "1F48F": [
      "couple_kiss",
      "couplekiss"
    ],
    "1F48F-1F3FB": [
      "couple_kiss_tone1",
      "couplekiss_tone1"
    ],
    "1F48F-1F3FC": [
      "couple_kiss_tone2",
      "couplekiss_tone2"
    ],
    "1F48F-1F3FD": [
      "couple_kiss_tone3",
      "couplekiss_tone3"
    ],
    "1F48F-1F3FE": [
      "couple_kiss_tone4",
      "couplekiss_tone4"
    ],
    "1F48F-1F3FF": [
      "couple_kiss_tone5",
      "couplekiss_tone5"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "couple_kiss_tone1-2",
      "couplekiss_tone1-2"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "couple_kiss_tone1-3",
      "couplekiss_tone1-3"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "couple_kiss_tone1-4",
      "couplekiss_tone1-4"
    ],
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "couple_kiss_tone1-5",
      "couplekiss_tone1-5"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "couple_kiss_tone2-1",
      "couplekiss_tone2-1"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "couple_kiss_tone2-3",
      "couplekiss_tone2-3"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "couple_kiss_tone2-4",
      "couplekiss_tone2-4"
    ],
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "couple_kiss_tone2-5",
      "couplekiss_tone2-5"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "couple_kiss_tone3-1",
      "couplekiss_tone3-1"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "couple_kiss_tone3-2",
      "couplekiss_tone3-2"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "couple_kiss_tone3-4",
      "couplekiss_tone3-4"
    ],
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "couple_kiss_tone3-5",
      "couplekiss_tone3-5"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "couple_kiss_tone4-1",
      "couplekiss_tone4-1"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "couple_kiss_tone4-2",
      "couplekiss_tone4-2"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "couple_kiss_tone4-3",
      "couplekiss_tone4-3"
    ],
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FF": [
      "couple_kiss_tone4-5",
      "couplekiss_tone4-5"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FB": [
      "couple_kiss_tone5-1",
      "couplekiss_tone5-1"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FC": [
      "couple_kiss_tone5-2",
      "couplekiss_tone5-2"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FD": [
      "couple_kiss_tone5-3",
      "couplekiss_tone5-3"
    ],
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F9D1-1F3FE": [
      "couple_kiss_tone5-4",
      "couplekiss_tone5-4"
    ],
    "1F490": "bouquet",
    "1F491": "couple_with_heart",
    "1F491-1F3FB": "couple_with_heart_tone1",
    "1F491-1F3FC": "couple_with_heart_tone2",
    "1F491-1F3FD": "couple_with_heart_tone3",
    "1F491-1F3FE": "couple_with_heart_tone4",
    "1F491-1F3FF": "couple_with_heart_tone5",
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FC": "couple_with_heart_tone1-2",
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FD": "couple_with_heart_tone1-3",
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FE": "couple_with_heart_tone1-4",
    "1F9D1-1F3FB-200D-2764-FE0F-200D-1F9D1-1F3FF": "couple_with_heart_tone1-5",
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FB": "couple_with_heart_tone2-1",
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FD": "couple_with_heart_tone2-3",
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FE": "couple_with_heart_tone2-4",
    "1F9D1-1F3FC-200D-2764-FE0F-200D-1F9D1-1F3FF": "couple_with_heart_tone2-5",
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FB": "couple_with_heart_tone3-1",
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FC": "couple_with_heart_tone3-2",
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FE": "couple_with_heart_tone3-4",
    "1F9D1-1F3FD-200D-2764-FE0F-200D-1F9D1-1F3FF": "couple_with_heart_tone3-5",
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FB": "couple_with_heart_tone4-1",
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FC": "couple_with_heart_tone4-2",
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FD": "couple_with_heart_tone4-3",
    "1F9D1-1F3FE-200D-2764-FE0F-200D-1F9D1-1F3FF": "couple_with_heart_tone4-5",
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FB": "couple_with_heart_tone5-1",
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FC": "couple_with_heart_tone5-2",
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FD": "couple_with_heart_tone5-3",
    "1F9D1-1F3FF-200D-2764-FE0F-200D-1F9D1-1F3FE": "couple_with_heart_tone5-4",
    "1F492": "wedding",
    "1F493": [
      "beating_heart",
      "heartbeat"
    ],
    "1F494": "broken_heart",
    "1F495": "two_hearts",
    "1F496": "sparkling_heart",
    "1F497": [
      "growing_heart",
      "heartpulse"
    ],
    "1F498": [
      "cupid",
      "heart_with_arrow"
    ],
    "1F499": "blue_heart",
    "1F49A": "green_heart",
    "1F49B": "yellow_heart",
    "1F49C": "purple_heart",
    "1F49D": [
      "gift_heart",
      "heart_with_ribbon"
    ],
    "1F49E": "revolving_hearts",
    "1F49F": "heart_decoration",
    "1F4A0": [
      "diamond_shape_with_a_dot_inside",
      "diamond_with_a_dot"
    ],
    "1F4A1": [
      "bulb",
      "light_bulb"
    ],
    "1F4A2": "anger",
    "1F4A3": "bomb",
    "1F4A4": "zzz",
    "1F4A5": [
      "boom",
      "collision"
    ],
    "1F4A6": "sweat_drops",
    "1F4A7": "droplet",
    "1F4A8": [
      "dash",
      "dashing_away"
    ],
    "1F4A9": [
      "poop",
      "shit"
    ],
    "1F4AA": [
      "muscle",
      "right_bicep"
    ],
    "1F4AA-1F3FB": [
      "muscle_tone1",
      "right_bicep_tone1"
    ],
    "1F4AA-1F3FC": [
      "muscle_tone2",
      "right_bicep_tone2"
    ],
    "1F4AA-1F3FD": [
      "muscle_tone3",
      "right_bicep_tone3"
    ],
    "1F4AA-1F3FE": [
      "muscle_tone4",
      "right_bicep_tone4"
    ],
    "1F4AA-1F3FF": [
      "muscle_tone5",
      "right_bicep_tone5"
    ],
    "1F4AB": "dizzy",
    "1F4AC": "speech_balloon",
    "1F4AD": "thought_balloon",
    "1F4AE": "white_flower",
    "1F4AF": "100",
    "1F4B0": "moneybag",
    "1F4B1": "currency_exchange",
    "1F4B2": "heavy_dollar_sign",
    "1F4B3": "credit_card",
    "1F4B4": "yen",
    "1F4B5": "dollar",
    "1F4B6": "euro",
    "1F4B7": "pound",
    "1F4B8": "money_with_wings",
    "1F4B9": "chart",
    "1F4BA": "seat",
    "1F4BB": "laptop",
    "1F4BC": "briefcase",
    "1F4BD": [
      "computer_disk",
      "minidisc"
    ],
    "1F4BE": "floppy_disk",
    "1F4BF": [
      "cd",
      "optical_disk"
    ],
    "1F4C0": "dvd",
    "1F4C1": "file_folder",
    "1F4C2": "open_file_folder",
    "1F4C3": "page_with_curl",
    "1F4C4": "page_facing_up",
    "1F4C5": "date",
    "1F4C6": "calendar",
    "1F4C7": "card_index",
    "1F4C8": [
      "chart_increasing",
      "chart_with_upwards_trend"
    ],
    "1F4C9": [
      "chart_decreasing",
      "chart_with_downwards_trend"
    ],
    "1F4CA": "bar_chart",
    "1F4CB": "clipboard",
    "1F4CC": "pushpin",
    "1F4CD": "round_pushpin",
    "1F4CE": "paperclip",
    "1F4CF": "straight_ruler",
    "1F4D0": "triangular_ruler",
    "1F4D1": "bookmark_tabs",
    "1F4D2": "ledger",
    "1F4D3": "notebook",
    "1F4D4": "notebook_with_decorative_cover",
    "1F4D5": "closed_book",
    "1F4D6": [
      "book",
      "open_book"
    ],
    "1F4D7": "green_book",
    "1F4D8": "blue_book",
    "1F4D9": "orange_book",
    "1F4DA": "books",
    "1F4DB": "name_badge",
    "1F4DC": "scroll",
    "1F4DD": "memo",
    "1F4DE": "telephone_receiver",
    "1F4DF": "pager",
    "1F4E0": [
      "fax",
      "fax_machine"
    ],
    "1F4E1": "satellite_antenna",
    "1F4E2": "loudspeaker",
    "1F4E3": [
      "mega",
      "megaphone"
    ],
    "1F4E4": "outbox_tray",
    "1F4E5": "inbox_tray",
    "1F4E6": "package",
    "1F4E7": [
      "e-mail",
      "email"
    ],
    "1F4E8": "incoming_envelope",
    "1F4E9": "envelope_with_arrow",
    "1F4EA": "mailbox_closed",
    "1F4EB": "mailbox",
    "1F4EC": "mailbox_with_mail",
    "1F4ED": "mailbox_with_no_mail",
    "1F4EE": "postbox",
    "1F4EF": "postal_horn",
    "1F4F0": "newspaper",
    "1F4F1": [
      "android",
      "iphone",
      "mobile_phone"
    ],
    "1F4F2": [
      "calling",
      "mobile_phone_arrow"
    ],
    "1F4F3": "vibration_mode",
    "1F4F4": "mobile_phone_off",
    "1F4F5": "no_mobile_phones",
    "1F4F6": [
      "antenna_bars",
      "signal_strength"
    ],
    "1F4F7": "camera",
    "1F4F8": "camera_with_flash",
    "1F4F9": "video_camera",
    "1F4FA": "tv",
    "1F4FB": "radio",
    "1F4FC": [
      "vhs",
      "videocassette"
    ],
    "1F4FD": "film_projector",
    "1F4FF": "prayer_beads",
    "1F500": [
      "shuffle",
      "twisted_rightwards_arrows"
    ],
    "1F501": "repeat",
    "1F502": "repeat_one",
    "1F503": [
      "arrows_clockwise",
      "clockwise"
    ],
    "1F504": [
      "arrows_counterclockwise",
      "counterclockwise"
    ],
    "1F505": [
      "dim_button",
      "low_brightness"
    ],
    "1F506": [
      "bright_button",
      "high_brightness"
    ],
    "1F507": [
      "mute",
      "no_sound"
    ],
    "1F508": [
      "low_volume",
      "quiet_sound",
      "speaker"
    ],
    "1F509": [
      "medium_volumne",
      "sound"
    ],
    "1F50A": [
      "high_volume",
      "loud_sound"
    ],
    "1F50B": "battery",
    "1F50C": "electric_plug",
    "1F50D": "mag",
    "1F50E": "mag_right",
    "1F50F": [
      "lock_with_ink_pen",
      "locked_with_pen"
    ],
    "1F510": [
      "closed_lock_with_key",
      "locked_with_key"
    ],
    "1F511": "key",
    "1F512": [
      "lock",
      "locked"
    ],
    "1F513": [
      "unlock",
      "unlocked"
    ],
    "1F514": "bell",
    "1F515": "no_bell",
    "1F516": "bookmark",
    "1F517": "link",
    "1F518": "radio_button",
    "1F519": "back",
    "1F51A": "end",
    "1F51B": "on",
    "1F51C": "soon",
    "1F51D": "top",
    "1F51E": [
      "no_one_under_18",
      "underage"
    ],
    "1F51F": "ten",
    "1F520": "capital_abcd",
    "1F521": "abcd",
    "1F522": "1234",
    "1F523": "symbols",
    "1F524": "abc",
    "1F525": "fire",
    "1F526": "flashlight",
    "1F527": "wrench",
    "1F528": "hammer",
    "1F529": "nut_and_bolt",
    "1F52A": "knife",
    "1F52B": [
      "gun",
      "pistol"
    ],
    "1F52C": "microscope",
    "1F52D": "telescope",
    "1F52E": "crystal_ball",
    "1F52F": "six_pointed_star",
    "1F530": "beginner",
    "1F531": "trident",
    "1F532": "black_square_button",
    "1F533": "white_square_button",
    "1F534": "red_circle",
    "1F535": "blue_circle",
    "1F536": "large_orange_diamond",
    "1F537": "large_blue_diamond",
    "1F538": "small_orange_diamond",
    "1F539": "small_blue_diamond",
    "1F53A": "small_red_triangle",
    "1F53B": "small_red_triangle_down",
    "1F53C": [
      "arrow_up_small",
      "up"
    ],
    "1F53D": [
      "arrow_down_small",
      "down"
    ],
    "1F549": "om",
    "1F54A": "dove",
    "1F54B": "kaaba",
    "1F54C": "mosque",
    "1F54D": "synagogue",
    "1F54E": "menorah",
    "1F550": "clock1",
    "1F551": "clock2",
    "1F552": "clock3",
    "1F553": "clock4",
    "1F554": "clock5",
    "1F555": "clock6",
    "1F556": "clock7",
    "1F557": "clock8",
    "1F558": "clock9",
    "1F559": "clock10",
    "1F55A": "clock11",
    "1F55B": "clock12",
    "1F55C": "clock130",
    "1F55D": "clock230",
    "1F55E": "clock330",
    "1F55F": "clock430",
    "1F560": "clock530",
    "1F561": "clock630",
    "1F562": "clock730",
    "1F563": "clock830",
    "1F564": "clock930",
    "1F565": "clock1030",
    "1F566": "clock1130",
    "1F567": "clock1230",
    "1F56F": "candle",
    "1F570": "clock",
    "1F573": "hole",
    "1F574": [
      "levitate",
      "levitating",
      "person_in_suit_levitating"
    ],
    "1F574-1F3FB": [
      "levitate_tone1",
      "levitating_tone1",
      "person_in_suit_levitating_tone1"
    ],
    "1F574-1F3FC": [
      "levitate_tone2",
      "levitating_tone2",
      "person_in_suit_levitating_tone2"
    ],
    "1F574-1F3FD": [
      "levitate_tone3",
      "levitating_tone3",
      "person_in_suit_levitating_tone3"
    ],
    "1F574-1F3FE": [
      "levitate_tone4",
      "levitating_tone4",
      "person_in_suit_levitating_tone4"
    ],
    "1F574-1F3FF": [
      "levitate_tone5",
      "levitating_tone5",
      "person_in_suit_levitating_tone5"
    ],
    "1F575": "detective",
    "1F575-1F3FB": "detective_tone1",
    "1F575-1F3FC": "detective_tone2",
    "1F575-1F3FD": "detective_tone3",
    "1F575-1F3FE": "detective_tone4",
    "1F575-1F3FF": "detective_tone5",
    "1F576": "sunglasses",
    "1F577": "spider",
    "1F578": "spider_web",
    "1F579": "joystick",
    "1F57A": "man_dancing",
    "1F57A-1F3FB": "man_dancing_tone1",
    "1F57A-1F3FC": "man_dancing_tone2",
    "1F57A-1F3FD": "man_dancing_tone3",
    "1F57A-1F3FE": "man_dancing_tone4",
    "1F57A-1F3FF": "man_dancing_tone5",
    "1F587": "paperclips",
    "1F58A": "pen",
    "1F58B": "fountain_pen",
    "1F58C": "paintbrush",
    "1F58D": "crayon",
    "1F590": "raised_hand_with_fingers_splayed",
    "1F590-1F3FB": "raised_hand_with_fingers_splayed_tone1",
    "1F590-1F3FC": "raised_hand_with_fingers_splayed_tone2",
    "1F590-1F3FD": "raised_hand_with_fingers_splayed_tone3",
    "1F590-1F3FE": "raised_hand_with_fingers_splayed_tone4",
    "1F590-1F3FF": "raised_hand_with_fingers_splayed_tone5",
    "1F595": "middle_finger",
    "1F595-1F3FB": "middle_finger_tone1",
    "1F595-1F3FC": "middle_finger_tone2",
    "1F595-1F3FD": "middle_finger_tone3",
    "1F595-1F3FE": "middle_finger_tone4",
    "1F595-1F3FF": "middle_finger_tone5",
    "1F596": "vulcan",
    "1F596-1F3FB": "vulcan_tone1",
    "1F596-1F3FC": "vulcan_tone2",
    "1F596-1F3FD": "vulcan_tone3",
    "1F596-1F3FE": "vulcan_tone4",
    "1F596-1F3FF": "vulcan_tone5",
    "1F5A4": "black_heart",
    "1F5A5": [
      "computer",
      "desktop_computer"
    ],
    "1F5A8": "printer",
    "1F5B1": "computer_mouse",
    "1F5B2": "trackball",
    "1F5BC": [
      "frame_with_picture",
      "framed_picture"
    ],
    "1F5C2": "card_index_dividers",
    "1F5C3": "card_file_box",
    "1F5C4": "file_cabinet",
    "1F5D1": [
      "trashcan",
      "wastebasket"
    ],
    "1F5D2": "notepad_spiral",
    "1F5D3": "calendar_spiral",
    "1F5DC": [
      "clamp",
      "compression"
    ],
    "1F5DD": "old_key",
    "1F5DE": "rolled_up_newspaper",
    "1F5E1": "dagger",
    "1F5E3": "speaking_head",
    "1F5E8": "left_speech_bubble",
    "1F5EF": "right_anger_bubble",
    "1F5F3": "ballot_box",
    "1F5FA": "world_map",
    "1F5FB": "mount_fuji",
    "1F5FC": "tokyo_tower",
    "1F5FD": "statue_of_liberty",
    "1F5FE": "japan_map",
    "1F5FF": [
      "moai",
      "moyai"
    ],
    "1F600": [
      "grinning",
      "grinning_face"
    ],
    "1F601": [
      "beaming_face",
      "grin"
    ],
    "1F602": [
      "joy",
      "lmao",
      "tears_of_joy"
    ],
    "1F603": [
      "grinning_face_with_big_eyes",
      "smiley"
    ],
    "1F604": [
      "grinning_face_with_closed_eyes",
      "smile"
    ],
    "1F605": [
      "grinning_face_with_sweat",
      "sweat_smile"
    ],
    "1F606": [
      "laughing",
      "lol",
      "satisfied",
      "squinting_face"
    ],
    "1F607": [
      "halo",
      "innocent"
    ],
    "1F608": "smiling_imp",
    "1F609": [
      "wink",
      "winking_face"
    ],
    "1F60A": [
      "blush",
      "smiling_face_with_closed_eyes"
    ],
    "1F60B": [
      "savoring_food",
      "yum"
    ],
    "1F60C": [
      "relieved",
      "relieved_face"
    ],
    "1F60D": [
      "heart_eyes",
      "smiling_face_with_heart_eyes"
    ],
    "1F60E": [
      "smiling_face_with_sunglasses",
      "sunglasses_cool",
      "too_cool"
    ],
    "1F60F": [
      "smirk",
      "smirking",
      "smirking_face"
    ],
    "1F610": [
      "neutral",
      "neutral_face"
    ],
    "1F611": [
      "expressionless",
      "expressionless_face"
    ],
    "1F612": [
      "unamused",
      "unamused_face"
    ],
    "1F613": [
      "downcast_face",
      "sweat"
    ],
    "1F614": [
      "pensive",
      "pensive_face"
    ],
    "1F615": [
      "confused",
      "confused_face"
    ],
    "1F616": [
      "confounded",
      "confounded_face"
    ],
    "1F617": [
      "kissing",
      "kissing_face"
    ],
    "1F618": [
      "blowing_a_kiss",
      "kissing_heart"
    ],
    "1F619": [
      "kissing_face_with_smiling_eyes",
      "kissing_smiling_eyes"
    ],
    "1F61A": [
      "kissing_closed_eyes",
      "kissing_face_with_closed_eyes"
    ],
    "1F61B": [
      "face_with_tongue",
      "stuck_out_tongue"
    ],
    "1F61C": "stuck_out_tongue_winking_eye",
    "1F61D": "stuck_out_tongue_closed_eyes",
    "1F61E": [
      "disappointed",
      "disappointed_face"
    ],
    "1F61F": [
      "worried",
      "worried_face"
    ],
    "1F620": [
      "angry",
      "angry_face"
    ],
    "1F621": [
      "pout",
      "pouting_face",
      "rage"
    ],
    "1F622": [
      "cry",
      "crying_face"
    ],
    "1F623": [
      "persevere",
      "persevering_face"
    ],
    "1F624": [
      "nose_steam",
      "triumph"
    ],
    "1F625": [
      "disappointed_relieved",
      "sad_relieved_face"
    ],
    "1F626": [
      "frowning",
      "frowning_face"
    ],
    "1F627": [
      "anguished",
      "anguished_face"
    ],
    "1F628": [
      "fearful",
      "fearful_face"
    ],
    "1F629": [
      "weary",
      "weary_face"
    ],
    "1F62A": [
      "sleepy",
      "sleepy_face"
    ],
    "1F62B": [
      "tired",
      "tired_face"
    ],
    "1F62C": [
      "grimacing",
      "grimacing_face"
    ],
    "1F62D": [
      "loudly_crying_face",
      "sob"
    ],
    "1F62E": [
      "face_with_open_mouth",
      "open_mouth"
    ],
    "1F62F": [
      "hushed",
      "hushed_face"
    ],
    "1F630": [
      "anxious",
      "anxious_face",
      "cold_sweat"
    ],
    "1F631": [
      "scream",
      "screaming_in_fear"
    ],
    "1F632": [
      "astonished",
      "astonished_face"
    ],
    "1F633": [
      "flushed",
      "flushed_face"
    ],
    "1F634": [
      "sleeping",
      "sleeping_face"
    ],
    "1F635": [
      "dizzy_face",
      "knocked_out"
    ],
    "1F636": "no_mouth",
    "1F637": [
      "mask",
      "medical_mask"
    ],
    "1F638": [
      "grinning_cat_with_closed_eyes",
      "smile_cat"
    ],
    "1F639": [
      "joy_cat",
      "tears_of_joy_cat"
    ],
    "1F63A": [
      "grinning_cat",
      "smiley_cat"
    ],
    "1F63B": [
      "heart_eyes_cat",
      "smiling_cat_with_heart_eyes"
    ],
    "1F63C": [
      "smirk_cat",
      "wry_smile_cat"
    ],
    "1F63D": "kissing_cat",
    "1F63E": "pouting_cat",
    "1F63F": "crying_cat",
    "1F640": [
      "scream_cat",
      "weary_cat"
    ],
    "1F641": "slightly_frowning_face",
    "1F642": "slightly_smiling_face",
    "1F643": "upside_down_face",
    "1F644": "rolling_eyes",
    "1F645": [
      "no_good",
      "person_gesturing_no"
    ],
    "1F645-1F3FB": [
      "no_good_tone1",
      "person_gesturing_no_tone1"
    ],
    "1F645-1F3FC": [
      "no_good_tone2",
      "person_gesturing_no_tone2"
    ],
    "1F645-1F3FD": [
      "no_good_tone3",
      "person_gesturing_no_tone3"
    ],
    "1F645-1F3FE": [
      "no_good_tone4",
      "person_gesturing_no_tone4"
    ],
    "1F645-1F3FF": [
      "no_good_tone5",
      "person_gesturing_no_tone5"
    ],
    "1F646": [
      "all_good",
      "person_gesturing_ok"
    ],
    "1F646-1F3FB": [
      "all_good_tone1",
      "person_gesturing_ok_tone1"
    ],
    "1F646-1F3FC": [
      "all_good_tone2",
      "person_gesturing_ok_tone2"
    ],
    "1F646-1F3FD": [
      "all_good_tone3",
      "person_gesturing_ok_tone3"
    ],
    "1F646-1F3FE": [
      "all_good_tone4",
      "person_gesturing_ok_tone4"
    ],
    "1F646-1F3FF": [
      "all_good_tone5",
      "person_gesturing_ok_tone5"
    ],
    "1F647": [
      "bow",
      "person_bowing"
    ],
    "1F647-1F3FB": [
      "bow_tone1",
      "person_bowing_tone1"
    ],
    "1F647-1F3FC": [
      "bow_tone2",
      "person_bowing_tone2"
    ],
    "1F647-1F3FD": [
      "bow_tone3",
      "person_bowing_tone3"
    ],
    "1F647-1F3FE": [
      "bow_tone4",
      "person_bowing_tone4"
    ],
    "1F647-1F3FF": [
      "bow_tone5",
      "person_bowing_tone5"
    ],
    "1F648": "see_no_evil",
    "1F649": "hear_no_evil",
    "1F64A": "speak_no_evil",
    "1F64B": "person_raising_hand",
    "1F64B-1F3FB": "person_raising_hand_tone1",
    "1F64B-1F3FC": "person_raising_hand_tone2",
    "1F64B-1F3FD": "person_raising_hand_tone3",
    "1F64B-1F3FE": "person_raising_hand_tone4",
    "1F64B-1F3FF": "person_raising_hand_tone5",
    "1F64C": "raised_hands",
    "1F64C-1F3FB": "raised_hands_tone1",
    "1F64C-1F3FC": "raised_hands_tone2",
    "1F64C-1F3FD": "raised_hands_tone3",
    "1F64C-1F3FE": "raised_hands_tone4",
    "1F64C-1F3FF": "raised_hands_tone5",
    "1F64D": "person_frowning",
    "1F64D-1F3FB": "person_frowning_tone1",
    "1F64D-1F3FC": "person_frowning_tone2",
    "1F64D-1F3FD": "person_frowning_tone3",
    "1F64D-1F3FE": "person_frowning_tone4",
    "1F64D-1F3FF": "person_frowning_tone5",
    "1F64E": [
      "person_pouting",
      "pouting"
    ],
    "1F64E-1F3FB": [
      "person_pouting_tone1",
      "pouting_tone1"
    ],
    "1F64E-1F3FC": [
      "person_pouting_tone2",
      "pouting_tone2"
    ],
    "1F64E-1F3FD": [
      "person_pouting_tone3",
      "pouting_tone3"
    ],
    "1F64E-1F3FE": [
      "person_pouting_tone4",
      "pouting_tone4"
    ],
    "1F64E-1F3FF": [
      "person_pouting_tone5",
      "pouting_tone5"
    ],
    "1F64F": [
      "folded_hands",
      "pray"
    ],
    "1F64F-1F3FB": [
      "folded_hands_tone1",
      "pray_tone1"
    ],
    "1F64F-1F3FC": [
      "folded_hands_tone2",
      "pray_tone2"
    ],
    "1F64F-1F3FD": [
      "folded_hands_tone3",
      "pray_tone3"
    ],
    "1F64F-1F3FE": [
      "folded_hands_tone4",
      "pray_tone4"
    ],
    "1F64F-1F3FF": [
      "folded_hands_tone5",
      "pray_tone5"
    ],
    "1F680": "rocket",
    "1F681": "helicopter",
    "1F682": "steam_locomotive",
    "1F683": "railway_car",
    "1F684": "bullettrain_side",
    "1F685": "bullettrain_front",
    "1F686": "train",
    "1F687": "metro",
    "1F688": "light_rail",
    "1F689": "station",
    "1F68A": "tram",
    "1F68B": "tram_car",
    "1F68C": "bus",
    "1F68D": "oncoming_bus",
    "1F68E": "trolleybus",
    "1F68F": "busstop",
    "1F690": "minibus",
    "1F691": "ambulance",
    "1F692": "fire_engine",
    "1F693": "police_car",
    "1F694": "oncoming_police_car",
    "1F695": "taxi",
    "1F696": "oncoming_taxi",
    "1F697": [
      "car",
      "red_car"
    ],
    "1F698": "oncoming_automobile",
    "1F699": [
      "blue_car",
      "suv"
    ],
    "1F69A": [
      "delivery_truck",
      "truck"
    ],
    "1F69B": "articulated_lorry",
    "1F69C": "tractor",
    "1F69D": "monorail",
    "1F69E": "mountain_railway",
    "1F69F": "suspension_railway",
    "1F6A0": "mountain_cableway",
    "1F6A1": "aerial_tramway",
    "1F6A2": "ship",
    "1F6A3": [
      "person_rowing_boat",
      "rowboat"
    ],
    "1F6A3-1F3FB": [
      "person_rowing_boat_tone1",
      "rowboat_tone1"
    ],
    "1F6A3-1F3FC": [
      "person_rowing_boat_tone2",
      "rowboat_tone2"
    ],
    "1F6A3-1F3FD": [
      "person_rowing_boat_tone3",
      "rowboat_tone3"
    ],
    "1F6A3-1F3FE": [
      "person_rowing_boat_tone4",
      "rowboat_tone4"
    ],
    "1F6A3-1F3FF": [
      "person_rowing_boat_tone5",
      "rowboat_tone5"
    ],
    "1F6A4": "speedboat",
    "1F6A5": "traffic_light",
    "1F6A6": "vertical_traffic_light",
    "1F6A7": "construction",
    "1F6A8": "rotating_light",
    "1F6A9": [
      "triangular_flag",
      "triangular_flag_on_post"
    ],
    "1F6AA": "door",
    "1F6AB": "no_entry_sign",
    "1F6AC": [
      "cigarette",
      "smoking"
    ],
    "1F6AD": "no_smoking",
    "1F6AE": [
      "litter_bin",
      "put_litter_in_its_place"
    ],
    "1F6AF": [
      "do_not_litter",
      "no_littering"
    ],
    "1F6B0": "potable_water",
    "1F6B1": "non-potable_water",
    "1F6B2": [
      "bicycle",
      "bike"
    ],
    "1F6B3": "no_bicycles",
    "1F6B4": [
      "bicyclist",
      "biking",
      "person_biking"
    ],
    "1F6B4-1F3FB": [
      "bicyclist_tone1",
      "biking_tone1",
      "person_biking_tone1"
    ],
    "1F6B4-1F3FC": [
      "bicyclist_tone2",
      "biking_tone2",
      "person_biking_tone2"
    ],
    "1F6B4-1F3FD": [
      "bicyclist_tone3",
      "biking_tone3",
      "person_biking_tone3"
    ],
    "1F6B4-1F3FE": [
      "bicyclist_tone4",
      "biking_tone4",
      "person_biking_tone4"
    ],
    "1F6B4-1F3FF": [
      "bicyclist_tone5",
      "biking_tone5",
      "person_biking_tone5"
    ],
    "1F6B5": [
      "mountain_bicyclist",
      "mountain_biking",
      "person_mountain_biking"
    ],
    "1F6B5-1F3FB": [
      "mountain_bicyclist_tone1",
      "mountain_biking_tone1",
      "person_mountain_biking_tone1"
    ],
    "1F6B5-1F3FC": [
      "mountain_bicyclist_tone2",
      "mountain_biking_tone2",
      "person_mountain_biking_tone2"
    ],
    "1F6B5-1F3FD": [
      "mountain_bicyclist_tone3",
      "mountain_biking_tone3",
      "person_mountain_biking_tone3"
    ],
    "1F6B5-1F3FE": [
      "mountain_bicyclist_tone4",
      "mountain_biking_tone4",
      "person_mountain_biking_tone4"
    ],
    "1F6B5-1F3FF": [
      "mountain_bicyclist_tone5",
      "mountain_biking_tone5",
      "person_mountain_biking_tone5"
    ],
    "1F6B6": [
      "person_walking",
      "walking"
    ],
    "1F6B6-1F3FB": [
      "person_walking_tone1",
      "walking_tone1"
    ],
    "1F6B6-1F3FC": [
      "person_walking_tone2",
      "walking_tone2"
    ],
    "1F6B6-1F3FD": [
      "person_walking_tone3",
      "walking_tone3"
    ],
    "1F6B6-1F3FE": [
      "person_walking_tone4",
      "walking_tone4"
    ],
    "1F6B6-1F3FF": [
      "person_walking_tone5",
      "walking_tone5"
    ],
    "1F6B7": "no_pedestrians",
    "1F6B8": "children_crossing",
    "1F6B9": "mens",
    "1F6BA": "womens",
    "1F6BB": [
      "bathroom",
      "restroom"
    ],
    "1F6BC": "baby_symbol",
    "1F6BD": "toilet",
    "1F6BE": [
      "water_closet",
      "wc"
    ],
    "1F6BF": "shower",
    "1F6C0": [
      "bath",
      "person_taking_bath"
    ],
    "1F6C0-1F3FB": [
      "bath_tone1",
      "person_taking_bath_tone1"
    ],
    "1F6C0-1F3FC": [
      "bath_tone2",
      "person_taking_bath_tone2"
    ],
    "1F6C0-1F3FD": [
      "bath_tone3",
      "person_taking_bath_tone3"
    ],
    "1F6C0-1F3FE": [
      "bath_tone4",
      "person_taking_bath_tone4"
    ],
    "1F6C0-1F3FF": [
      "bath_tone5",
      "person_taking_bath_tone5"
    ],
    "1F6C1": "bathtub",
    "1F6C2": "passport_control",
    "1F6C3": "customs",
    "1F6C4": "baggage_claim",
    "1F6C5": "left_luggage",
    "1F6CB": "couch_and_lamp",
    "1F6CC": [
      "person_in_bed",
      "sleeping_accommodation"
    ],
    "1F6CC-1F3FB": [
      "person_in_bed_tone1",
      "sleeping_accommodation_tone1"
    ],
    "1F6CC-1F3FC": [
      "person_in_bed_tone2",
      "sleeping_accommodation_tone2"
    ],
    "1F6CC-1F3FD": [
      "person_in_bed_tone3",
      "sleeping_accommodation_tone3"
    ],
    "1F6CC-1F3FE": [
      "person_in_bed_tone4",
      "sleeping_accommodation_tone4"
    ],
    "1F6CC-1F3FF": [
      "person_in_bed_tone5",
      "sleeping_accommodation_tone5"
    ],
    "1F6CD": "shopping_bags",
    "1F6CE": "bellhop",
    "1F6CF": "bed",
    "1F6D0": "place_of_worship",
    "1F6D1": [
      "octagonal_sign",
      "stop_sign"
    ],
    "1F6D2": "shopping_cart",
    "1F6D5": "hindu_temple",
    "1F6D6": "hut",
    "1F6D7": "elevator",
    "1F6DC": "wireless",
    "1F6DD": [
      "playground_slide",
      "slide"
    ],
    "1F6DE": "wheel",
    "1F6DF": [
      "lifebuoy",
      "ring_buoy"
    ],
    "1F6E0": "hammer_and_wrench",
    "1F6E1": "shield",
    "1F6E2": "oil_drum",
    "1F6E3": "motorway",
    "1F6E4": "railway_track",
    "1F6E5": "motorboat",
    "1F6E9": "small_airplane",
    "1F6EB": "airplane_departure",
    "1F6EC": "airplane_arriving",
    "1F6F0": "satellite",
    "1F6F3": [
      "cruise_ship",
      "passenger_ship"
    ],
    "1F6F4": "scooter",
    "1F6F5": "motor_scooter",
    "1F6F6": "canoe",
    "1F6F7": "sled",
    "1F6F8": "flying_saucer",
    "1F6F9": "skateboard",
    "1F6FA": "auto_rickshaw",
    "1F6FB": "pickup_truck",
    "1F6FC": "roller_skate",
    "1F7E0": "orange_circle",
    "1F7E1": "yellow_circle",
    "1F7E2": "green_circle",
    "1F7E3": "purple_circle",
    "1F7E4": "brown_circle",
    "1F7E5": "red_square",
    "1F7E6": "blue_square",
    "1F7E7": "orange_square",
    "1F7E8": "yellow_square",
    "1F7E9": "green_square",
    "1F7EA": "purple_square",
    "1F7EB": "brown_square",
    "1F7F0": "heavy_equals_sign",
    "1F90C": [
      "pinch",
      "pinched_fingers"
    ],
    "1F90C-1F3FB": [
      "pinch_tone1",
      "pinched_fingers_tone1"
    ],
    "1F90C-1F3FC": [
      "pinch_tone2",
      "pinched_fingers_tone2"
    ],
    "1F90C-1F3FD": [
      "pinch_tone3",
      "pinched_fingers_tone3"
    ],
    "1F90C-1F3FE": [
      "pinch_tone4",
      "pinched_fingers_tone4"
    ],
    "1F90C-1F3FF": [
      "pinch_tone5",
      "pinched_fingers_tone5"
    ],
    "1F90D": "white_heart",
    "1F90E": "brown_heart",
    "1F90F": "pinching_hand",
    "1F90F-1F3FB": "pinching_hand_tone1",
    "1F90F-1F3FC": "pinching_hand_tone2",
    "1F90F-1F3FD": "pinching_hand_tone3",
    "1F90F-1F3FE": "pinching_hand_tone4",
    "1F90F-1F3FF": "pinching_hand_tone5",
    "1F910": [
      "zipper_mouth",
      "zipper_mouth_face"
    ],
    "1F911": "money_mouth_face",
    "1F912": "face_with_thermometer",
    "1F913": [
      "nerd",
      "nerd_face"
    ],
    "1F914": [
      "thinking",
      "thinking_face",
      "wtf"
    ],
    "1F915": "face_with_head_bandage",
    "1F916": [
      "robot",
      "robot_face"
    ],
    "1F917": [
      "hug",
      "hugging",
      "hugging_face"
    ],
    "1F918": [
      "metal",
      "sign_of_the_horns"
    ],
    "1F918-1F3FB": [
      "metal_tone1",
      "sign_of_the_horns_tone1"
    ],
    "1F918-1F3FC": [
      "metal_tone2",
      "sign_of_the_horns_tone2"
    ],
    "1F918-1F3FD": [
      "metal_tone3",
      "sign_of_the_horns_tone3"
    ],
    "1F918-1F3FE": [
      "metal_tone4",
      "sign_of_the_horns_tone4"
    ],
    "1F918-1F3FF": [
      "metal_tone5",
      "sign_of_the_horns_tone5"
    ],
    "1F919": "call_me_hand",
    "1F919-1F3FB": "call_me_hand_tone1",
    "1F919-1F3FC": "call_me_hand_tone2",
    "1F919-1F3FD": "call_me_hand_tone3",
    "1F919-1F3FE": "call_me_hand_tone4",
    "1F919-1F3FF": "call_me_hand_tone5",
    "1F91A": "raised_back_of_hand",
    "1F91A-1F3FB": "raised_back_of_hand_tone1",
    "1F91A-1F3FC": "raised_back_of_hand_tone2",
    "1F91A-1F3FD": "raised_back_of_hand_tone3",
    "1F91A-1F3FE": "raised_back_of_hand_tone4",
    "1F91A-1F3FF": "raised_back_of_hand_tone5",
    "1F91B": "left_facing_fist",
    "1F91B-1F3FB": "left_facing_fist_tone1",
    "1F91B-1F3FC": "left_facing_fist_tone2",
    "1F91B-1F3FD": "left_facing_fist_tone3",
    "1F91B-1F3FE": "left_facing_fist_tone4",
    "1F91B-1F3FF": "left_facing_fist_tone5",
    "1F91C": "right_facing_fist",
    "1F91C-1F3FB": "right_facing_fist_tone1",
    "1F91C-1F3FC": "right_facing_fist_tone2",
    "1F91C-1F3FD": "right_facing_fist_tone3",
    "1F91C-1F3FE": "right_facing_fist_tone4",
    "1F91C-1F3FF": "right_facing_fist_tone5",
    "1F91D": "handshake",
    "1F91D-1F3FB": "handshake_tone1",
    "1F91D-1F3FC": "handshake_tone2",
    "1F91D-1F3FD": "handshake_tone3",
    "1F91D-1F3FE": "handshake_tone4",
    "1F91D-1F3FF": "handshake_tone5",
    "1FAF1-1F3FB-200D-1FAF2-1F3FC": "handshake_tone1-2",
    "1FAF1-1F3FB-200D-1FAF2-1F3FD": "handshake_tone1-3",
    "1FAF1-1F3FB-200D-1FAF2-1F3FE": "handshake_tone1-4",
    "1FAF1-1F3FB-200D-1FAF2-1F3FF": "handshake_tone1-5",
    "1FAF1-1F3FC-200D-1FAF2-1F3FB": "handshake_tone2-1",
    "1FAF1-1F3FC-200D-1FAF2-1F3FD": "handshake_tone2-3",
    "1FAF1-1F3FC-200D-1FAF2-1F3FE": "handshake_tone2-4",
    "1FAF1-1F3FC-200D-1FAF2-1F3FF": "handshake_tone2-5",
    "1FAF1-1F3FD-200D-1FAF2-1F3FB": "handshake_tone3-1",
    "1FAF1-1F3FD-200D-1FAF2-1F3FC": "handshake_tone3-2",
    "1FAF1-1F3FD-200D-1FAF2-1F3FE": "handshake_tone3-4",
    "1FAF1-1F3FD-200D-1FAF2-1F3FF": "handshake_tone3-5",
    "1FAF1-1F3FE-200D-1FAF2-1F3FB": "handshake_tone4-1",
    "1FAF1-1F3FE-200D-1FAF2-1F3FC": "handshake_tone4-2",
    "1FAF1-1F3FE-200D-1FAF2-1F3FD": "handshake_tone4-3",
    "1FAF1-1F3FE-200D-1FAF2-1F3FF": "handshake_tone4-5",
    "1FAF1-1F3FF-200D-1FAF2-1F3FB": "handshake_tone5-1",
    "1FAF1-1F3FF-200D-1FAF2-1F3FC": "handshake_tone5-2",
    "1FAF1-1F3FF-200D-1FAF2-1F3FD": "handshake_tone5-3",
    "1FAF1-1F3FF-200D-1FAF2-1F3FE": "handshake_tone5-4",
    "1F91E": "fingers_crossed",
    "1F91E-1F3FB": "fingers_crossed_tone1",
    "1F91E-1F3FC": "fingers_crossed_tone2",
    "1F91E-1F3FD": "fingers_crossed_tone3",
    "1F91E-1F3FE": "fingers_crossed_tone4",
    "1F91E-1F3FF": "fingers_crossed_tone5",
    "1F91F": "love_you_gesture",
    "1F91F-1F3FB": "love_you_gesture_tone1",
    "1F91F-1F3FC": "love_you_gesture_tone2",
    "1F91F-1F3FD": "love_you_gesture_tone3",
    "1F91F-1F3FE": "love_you_gesture_tone4",
    "1F91F-1F3FF": "love_you_gesture_tone5",
    "1F920": [
      "cowboy",
      "cowboy_face"
    ],
    "1F921": [
      "clown",
      "clown_face"
    ],
    "1F922": [
      "nauseated",
      "nauseated_face"
    ],
    "1F923": "rofl",
    "1F924": [
      "drooling",
      "drooling_face"
    ],
    "1F925": [
      "lying",
      "lying_face"
    ],
    "1F926": [
      "facepalm",
      "person_facepalming"
    ],
    "1F926-1F3FB": [
      "facepalm_tone1",
      "person_facepalming_tone1"
    ],
    "1F926-1F3FC": [
      "facepalm_tone2",
      "person_facepalming_tone2"
    ],
    "1F926-1F3FD": [
      "facepalm_tone3",
      "person_facepalming_tone3"
    ],
    "1F926-1F3FE": [
      "facepalm_tone4",
      "person_facepalming_tone4"
    ],
    "1F926-1F3FF": [
      "facepalm_tone5",
      "person_facepalming_tone5"
    ],
    "1F927": [
      "sneezing",
      "sneezing_face"
    ],
    "1F928": [
      "face_with_raised_eyebrow",
      "raised_eyebrow"
    ],
    "1F929": "star_struck",
    "1F92A": [
      "zany",
      "zany_face"
    ],
    "1F92B": [
      "shush",
      "shushing_face"
    ],
    "1F92C": [
      "censored",
      "face_with_symbols_on_mouth"
    ],
    "1F92D": [
      "face_with_hand_over_mouth",
      "hand_over_mouth"
    ],
    "1F92E": [
      "face_vomiting",
      "vomiting"
    ],
    "1F92F": "exploding_head",
    "1F930": "pregnant_woman",
    "1F930-1F3FB": "pregnant_woman_tone1",
    "1F930-1F3FC": "pregnant_woman_tone2",
    "1F930-1F3FD": "pregnant_woman_tone3",
    "1F930-1F3FE": "pregnant_woman_tone4",
    "1F930-1F3FF": "pregnant_woman_tone5",
    "1F931": "breast_feeding",
    "1F931-1F3FB": "breast_feeding_tone1",
    "1F931-1F3FC": "breast_feeding_tone2",
    "1F931-1F3FD": "breast_feeding_tone3",
    "1F931-1F3FE": "breast_feeding_tone4",
    "1F931-1F3FF": "breast_feeding_tone5",
    "1F932": "palms_up_together",
    "1F932-1F3FB": "palms_up_together_tone1",
    "1F932-1F3FC": "palms_up_together_tone2",
    "1F932-1F3FD": "palms_up_together_tone3",
    "1F932-1F3FE": "palms_up_together_tone4",
    "1F932-1F3FF": "palms_up_together_tone5",
    "1F933": "selfie",
    "1F933-1F3FB": "selfie_tone1",
    "1F933-1F3FC": "selfie_tone2",
    "1F933-1F3FD": "selfie_tone3",
    "1F933-1F3FE": "selfie_tone4",
    "1F933-1F3FF": "selfie_tone5",
    "1F934": "prince",
    "1F934-1F3FB": "prince_tone1",
    "1F934-1F3FC": "prince_tone2",
    "1F934-1F3FD": "prince_tone3",
    "1F934-1F3FE": "prince_tone4",
    "1F934-1F3FF": "prince_tone5",
    "1F935": "person_in_tuxedo",
    "1F935-1F3FB": "person_in_tuxedo_tone1",
    "1F935-1F3FC": "person_in_tuxedo_tone2",
    "1F935-1F3FD": "person_in_tuxedo_tone3",
    "1F935-1F3FE": "person_in_tuxedo_tone4",
    "1F935-1F3FF": "person_in_tuxedo_tone5",
    "1F936": "mrs_claus",
    "1F936-1F3FB": "mrs_claus_tone1",
    "1F936-1F3FC": "mrs_claus_tone2",
    "1F936-1F3FD": "mrs_claus_tone3",
    "1F936-1F3FE": "mrs_claus_tone4",
    "1F936-1F3FF": "mrs_claus_tone5",
    "1F937": [
      "person_shrugging",
      "shrug"
    ],
    "1F937-1F3FB": [
      "person_shrugging_tone1",
      "shrug_tone1"
    ],
    "1F937-1F3FC": [
      "person_shrugging_tone2",
      "shrug_tone2"
    ],
    "1F937-1F3FD": [
      "person_shrugging_tone3",
      "shrug_tone3"
    ],
    "1F937-1F3FE": [
      "person_shrugging_tone4",
      "shrug_tone4"
    ],
    "1F937-1F3FF": [
      "person_shrugging_tone5",
      "shrug_tone5"
    ],
    "1F938": [
      "cartwheeling",
      "person_cartwheel"
    ],
    "1F938-1F3FB": [
      "cartwheeling_tone1",
      "person_cartwheel_tone1"
    ],
    "1F938-1F3FC": [
      "cartwheeling_tone2",
      "person_cartwheel_tone2"
    ],
    "1F938-1F3FD": [
      "cartwheeling_tone3",
      "person_cartwheel_tone3"
    ],
    "1F938-1F3FE": [
      "cartwheeling_tone4",
      "person_cartwheel_tone4"
    ],
    "1F938-1F3FF": [
      "cartwheeling_tone5",
      "person_cartwheel_tone5"
    ],
    "1F939": [
      "juggler",
      "juggling",
      "person_juggling"
    ],
    "1F939-1F3FB": [
      "juggler_tone1",
      "juggling_tone1",
      "person_juggling_tone1"
    ],
    "1F939-1F3FC": [
      "juggler_tone2",
      "juggling_tone2",
      "person_juggling_tone2"
    ],
    "1F939-1F3FD": [
      "juggler_tone3",
      "juggling_tone3",
      "person_juggling_tone3"
    ],
    "1F939-1F3FE": [
      "juggler_tone4",
      "juggling_tone4",
      "person_juggling_tone4"
    ],
    "1F939-1F3FF": [
      "juggler_tone5",
      "juggling_tone5",
      "person_juggling_tone5"
    ],
    "1F93A": [
      "fencer",
      "fencing",
      "person_fencing"
    ],
    "1F93C": [
      "people_wrestling",
      "wrestlers",
      "wrestling"
    ],
    "1F93D": [
      "person_playing_water_polo",
      "water_polo"
    ],
    "1F93D-1F3FB": [
      "person_playing_water_polo_tone1",
      "water_polo_tone1"
    ],
    "1F93D-1F3FC": [
      "person_playing_water_polo_tone2",
      "water_polo_tone2"
    ],
    "1F93D-1F3FD": [
      "person_playing_water_polo_tone3",
      "water_polo_tone3"
    ],
    "1F93D-1F3FE": [
      "person_playing_water_polo_tone4",
      "water_polo_tone4"
    ],
    "1F93D-1F3FF": [
      "person_playing_water_polo_tone5",
      "water_polo_tone5"
    ],
    "1F93E": [
      "handball",
      "person_playing_handball"
    ],
    "1F93E-1F3FB": [
      "handball_tone1",
      "person_playing_handball_tone1"
    ],
    "1F93E-1F3FC": [
      "handball_tone2",
      "person_playing_handball_tone2"
    ],
    "1F93E-1F3FD": [
      "handball_tone3",
      "person_playing_handball_tone3"
    ],
    "1F93E-1F3FE": [
      "handball_tone4",
      "person_playing_handball_tone4"
    ],
    "1F93E-1F3FF": [
      "handball_tone5",
      "person_playing_handball_tone5"
    ],
    "1F93F": "diving_mask",
    "1F940": "wilted_flower",
    "1F941": "drum",
    "1F942": "clinking_glasses",
    "1F943": [
      "tumbler_glass",
      "whisky"
    ],
    "1F944": "spoon",
    "1F945": "goal_net",
    "1F947": [
      "1st",
      "first_place_medal"
    ],
    "1F948": [
      "2nd",
      "second_place_medal"
    ],
    "1F949": [
      "3rd",
      "third_place_medal"
    ],
    "1F94A": "boxing_glove",
    "1F94B": "martial_arts_uniform",
    "1F94C": "curling_stone",
    "1F94D": "lacrosse",
    "1F94E": "softball",
    "1F94F": "flying_disc",
    "1F950": "croissant",
    "1F951": "avocado",
    "1F952": "cucumber",
    "1F953": "bacon",
    "1F954": "potato",
    "1F955": "carrot",
    "1F956": "baguette_bread",
    "1F957": [
      "green_salad",
      "salad"
    ],
    "1F958": "shallow_pan_of_food",
    "1F959": "stuffed_flatbread",
    "1F95A": "egg",
    "1F95B": [
      "glass_of_milk",
      "milk"
    ],
    "1F95C": "peanuts",
    "1F95D": "kiwi",
    "1F95E": "pancakes",
    "1F95F": "dumpling",
    "1F960": "fortune_cookie",
    "1F961": "takeout_box",
    "1F962": "chopsticks",
    "1F963": "bowl_with_spoon",
    "1F964": "cup_with_straw",
    "1F965": "coconut",
    "1F966": "broccoli",
    "1F967": "pie",
    "1F968": "pretzel",
    "1F969": "cut_of_meat",
    "1F96A": "sandwich",
    "1F96B": "canned_food",
    "1F96C": "leafy_green",
    "1F96D": "mango",
    "1F96E": "moon_cake",
    "1F96F": "bagel",
    "1F970": "smiling_face_with_3_hearts",
    "1F971": [
      "yawn",
      "yawning",
      "yawning_face"
    ],
    "1F972": "smiling_face_with_tear",
    "1F973": [
      "hooray",
      "partying",
      "partying_face"
    ],
    "1F974": [
      "woozy",
      "woozy_face"
    ],
    "1F975": [
      "hot",
      "hot_face"
    ],
    "1F976": [
      "cold",
      "cold_face"
    ],
    "1F977": "ninja",
    "1F977-1F3FB": "ninja_tone1",
    "1F977-1F3FC": "ninja_tone2",
    "1F977-1F3FD": "ninja_tone3",
    "1F977-1F3FE": "ninja_tone4",
    "1F977-1F3FF": "ninja_tone5",
    "1F978": [
      "disguised",
      "disguised_face"
    ],
    "1F979": [
      "face_holding_back_tears",
      "watery_eyes"
    ],
    "1F97A": [
      "pleading",
      "pleading_face"
    ],
    "1F97B": "sari",
    "1F97C": "lab_coat",
    "1F97D": "goggles",
    "1F97E": "hiking_boot",
    "1F97F": [
      "flat_shoe",
      "womans_flat_shoe"
    ],
    "1F980": "crab",
    "1F981": [
      "lion",
      "lion_face"
    ],
    "1F982": "scorpion",
    "1F983": "turkey",
    "1F984": [
      "unicorn",
      "unicorn_face"
    ],
    "1F985": "eagle",
    "1F986": "duck",
    "1F987": "bat",
    "1F988": "shark",
    "1F989": "owl",
    "1F98A": [
      "fox",
      "fox_face"
    ],
    "1F98B": "butterfly",
    "1F98C": "deer",
    "1F98D": "gorilla",
    "1F98E": "lizard",
    "1F98F": [
      "rhino",
      "rhinoceros"
    ],
    "1F990": "shrimp",
    "1F991": "squid",
    "1F992": "giraffe",
    "1F993": "zebra",
    "1F994": "hedgehog",
    "1F995": "sauropod",
    "1F996": [
      "t-rex",
      "trex"
    ],
    "1F997": "cricket",
    "1F998": "kangaroo",
    "1F999": "llama",
    "1F99A": "peacock",
    "1F99B": "hippo",
    "1F99C": "parrot",
    "1F99D": "raccoon",
    "1F99E": "lobster",
    "1F99F": "mosquito",
    "1F9A0": "microbe",
    "1F9A1": "badger",
    "1F9A2": "swan",
    "1F9A3": "mammoth",
    "1F9A4": "dodo",
    "1F9A5": "sloth",
    "1F9A6": "otter",
    "1F9A7": "orangutan",
    "1F9A8": "skunk",
    "1F9A9": "flamingo",
    "1F9AA": "oyster",
    "1F9AB": "beaver",
    "1F9AC": "bison",
    "1F9AD": "seal",
    "1F9AE": "guide_dog",
    "1F9AF": [
      "probing_cane",
      "white_cane"
    ],
    "1F9B0": "red_hair",
    "1F9B1": "curly_hair",
    "1F9B2": "no_hair",
    "1F9B3": "white_hair",
    "1F9B4": "bone",
    "1F9B5": "leg",
    "1F9B5-1F3FB": "leg_tone1",
    "1F9B5-1F3FC": "leg_tone2",
    "1F9B5-1F3FD": "leg_tone3",
    "1F9B5-1F3FE": "leg_tone4",
    "1F9B5-1F3FF": "leg_tone5",
    "1F9B6": "foot",
    "1F9B6-1F3FB": "foot_tone1",
    "1F9B6-1F3FC": "foot_tone2",
    "1F9B6-1F3FD": "foot_tone3",
    "1F9B6-1F3FE": "foot_tone4",
    "1F9B6-1F3FF": "foot_tone5",
    "1F9B7": "tooth",
    "1F9B8": "superhero",
    "1F9B8-1F3FB": "superhero_tone1",
    "1F9B8-1F3FC": "superhero_tone2",
    "1F9B8-1F3FD": "superhero_tone3",
    "1F9B8-1F3FE": "superhero_tone4",
    "1F9B8-1F3FF": "superhero_tone5",
    "1F9B9": "supervillain",
    "1F9B9-1F3FB": "supervillain_tone1",
    "1F9B9-1F3FC": "supervillain_tone2",
    "1F9B9-1F3FD": "supervillain_tone3",
    "1F9B9-1F3FE": "supervillain_tone4",
    "1F9B9-1F3FF": "supervillain_tone5",
    "1F9BA": "safety_vest",
    "1F9BB": [
      "ear_with_hearing_aid",
      "hearing_aid"
    ],
    "1F9BB-1F3FB": [
      "ear_with_hearing_aid_tone1",
      "hearing_aid_tone1"
    ],
    "1F9BB-1F3FC": [
      "ear_with_hearing_aid_tone2",
      "hearing_aid_tone2"
    ],
    "1F9BB-1F3FD": [
      "ear_with_hearing_aid_tone3",
      "hearing_aid_tone3"
    ],
    "1F9BB-1F3FE": [
      "ear_with_hearing_aid_tone4",
      "hearing_aid_tone4"
    ],
    "1F9BB-1F3FF": [
      "ear_with_hearing_aid_tone5",
      "hearing_aid_tone5"
    ],
    "1F9BC": "motorized_wheelchair",
    "1F9BD": "manual_wheelchair",
    "1F9BE": "mechanical_arm",
    "1F9BF": "mechanical_leg",
    "1F9C0": "cheese",
    "1F9C1": "cupcake",
    "1F9C2": "salt",
    "1F9C3": [
      "beverage_box",
      "juice_box"
    ],
    "1F9C4": "garlic",
    "1F9C5": "onion",
    "1F9C6": "falafel",
    "1F9C7": "waffle",
    "1F9C8": "butter",
    "1F9C9": "mate",
    "1F9CA": [
      "ice",
      "ice_cube"
    ],
    "1F9CB": [
      "boba_drink",
      "bubble_tea"
    ],
    "1F9CC": "troll",
    "1F9CD": [
      "person_standing",
      "standing"
    ],
    "1F9CD-1F3FB": [
      "person_standing_tone1",
      "standing_tone1"
    ],
    "1F9CD-1F3FC": [
      "person_standing_tone2",
      "standing_tone2"
    ],
    "1F9CD-1F3FD": [
      "person_standing_tone3",
      "standing_tone3"
    ],
    "1F9CD-1F3FE": [
      "person_standing_tone4",
      "standing_tone4"
    ],
    "1F9CD-1F3FF": [
      "person_standing_tone5",
      "standing_tone5"
    ],
    "1F9CE": [
      "kneeling",
      "person_kneeling"
    ],
    "1F9CE-1F3FB": [
      "kneeling_tone1",
      "person_kneeling_tone1"
    ],
    "1F9CE-1F3FC": [
      "kneeling_tone2",
      "person_kneeling_tone2"
    ],
    "1F9CE-1F3FD": [
      "kneeling_tone3",
      "person_kneeling_tone3"
    ],
    "1F9CE-1F3FE": [
      "kneeling_tone4",
      "person_kneeling_tone4"
    ],
    "1F9CE-1F3FF": [
      "kneeling_tone5",
      "person_kneeling_tone5"
    ],
    "1F9CF": "deaf_person",
    "1F9CF-1F3FB": "deaf_person_tone1",
    "1F9CF-1F3FC": "deaf_person_tone2",
    "1F9CF-1F3FD": "deaf_person_tone3",
    "1F9CF-1F3FE": "deaf_person_tone4",
    "1F9CF-1F3FF": "deaf_person_tone5",
    "1F9D0": "face_with_monocle",
    "1F9D1": "adult",
    "1F9D1-1F3FB": "adult_tone1",
    "1F9D1-1F3FC": "adult_tone2",
    "1F9D1-1F3FD": "adult_tone3",
    "1F9D1-1F3FE": "adult_tone4",
    "1F9D1-1F3FF": "adult_tone5",
    "1F9D2": "child",
    "1F9D2-1F3FB": "child_tone1",
    "1F9D2-1F3FC": "child_tone2",
    "1F9D2-1F3FD": "child_tone3",
    "1F9D2-1F3FE": "child_tone4",
    "1F9D2-1F3FF": "child_tone5",
    "1F9D3": "older_adult",
    "1F9D3-1F3FB": "older_adult_tone1",
    "1F9D3-1F3FC": "older_adult_tone2",
    "1F9D3-1F3FD": "older_adult_tone3",
    "1F9D3-1F3FE": "older_adult_tone4",
    "1F9D3-1F3FF": "older_adult_tone5",
    "1F9D4": "person_bearded",
    "1F9D4-1F3FB": "person_bearded_tone1",
    "1F9D4-1F3FC": "person_bearded_tone2",
    "1F9D4-1F3FD": "person_bearded_tone3",
    "1F9D4-1F3FE": "person_bearded_tone4",
    "1F9D4-1F3FF": "person_bearded_tone5",
    "1F9D5": "woman_with_headscarf",
    "1F9D5-1F3FB": "woman_with_headscarf_tone1",
    "1F9D5-1F3FC": "woman_with_headscarf_tone2",
    "1F9D5-1F3FD": "woman_with_headscarf_tone3",
    "1F9D5-1F3FE": "woman_with_headscarf_tone4",
    "1F9D5-1F3FF": "woman_with_headscarf_tone5",
    "1F9D6": "person_in_steamy_room",
    "1F9D6-1F3FB": "person_in_steamy_room_tone1",
    "1F9D6-1F3FC": "person_in_steamy_room_tone2",
    "1F9D6-1F3FD": "person_in_steamy_room_tone3",
    "1F9D6-1F3FE": "person_in_steamy_room_tone4",
    "1F9D6-1F3FF": "person_in_steamy_room_tone5",
    "1F9D7": [
      "climbing",
      "person_climbing"
    ],
    "1F9D7-1F3FB": [
      "climbing_tone1",
      "person_climbing_tone1"
    ],
    "1F9D7-1F3FC": [
      "climbing_tone2",
      "person_climbing_tone2"
    ],
    "1F9D7-1F3FD": [
      "climbing_tone3",
      "person_climbing_tone3"
    ],
    "1F9D7-1F3FE": [
      "climbing_tone4",
      "person_climbing_tone4"
    ],
    "1F9D7-1F3FF": [
      "climbing_tone5",
      "person_climbing_tone5"
    ],
    "1F9D8": "person_in_lotus_position",
    "1F9D8-1F3FB": "person_in_lotus_position_tone1",
    "1F9D8-1F3FC": "person_in_lotus_position_tone2",
    "1F9D8-1F3FD": "person_in_lotus_position_tone3",
    "1F9D8-1F3FE": "person_in_lotus_position_tone4",
    "1F9D8-1F3FF": "person_in_lotus_position_tone5",
    "1F9D9": "mage",
    "1F9D9-1F3FB": "mage_tone1",
    "1F9D9-1F3FC": "mage_tone2",
    "1F9D9-1F3FD": "mage_tone3",
    "1F9D9-1F3FE": "mage_tone4",
    "1F9D9-1F3FF": "mage_tone5",
    "1F9DA": "fairy",
    "1F9DA-1F3FB": "fairy_tone1",
    "1F9DA-1F3FC": "fairy_tone2",
    "1F9DA-1F3FD": "fairy_tone3",
    "1F9DA-1F3FE": "fairy_tone4",
    "1F9DA-1F3FF": "fairy_tone5",
    "1F9DB": "vampire",
    "1F9DB-1F3FB": "vampire_tone1",
    "1F9DB-1F3FC": "vampire_tone2",
    "1F9DB-1F3FD": "vampire_tone3",
    "1F9DB-1F3FE": "vampire_tone4",
    "1F9DB-1F3FF": "vampire_tone5",
    "1F9DC": "merperson",
    "1F9DC-1F3FB": "merperson_tone1",
    "1F9DC-1F3FC": "merperson_tone2",
    "1F9DC-1F3FD": "merperson_tone3",
    "1F9DC-1F3FE": "merperson_tone4",
    "1F9DC-1F3FF": "merperson_tone5",
    "1F9DD": "elf",
    "1F9DD-1F3FB": "elf_tone1",
    "1F9DD-1F3FC": "elf_tone2",
    "1F9DD-1F3FD": "elf_tone3",
    "1F9DD-1F3FE": "elf_tone4",
    "1F9DD-1F3FF": "elf_tone5",
    "1F9DE": "genie",
    "1F9DF": "zombie",
    "1F9E0": "brain",
    "1F9E1": "orange_heart",
    "1F9E2": "billed_cap",
    "1F9E3": "scarf",
    "1F9E4": "gloves",
    "1F9E5": "coat",
    "1F9E6": "socks",
    "1F9E7": "red_envelope",
    "1F9E8": "firecracker",
    "1F9E9": [
      "jigsaw",
      "puzzle_piece"
    ],
    "1F9EA": "test_tube",
    "1F9EB": "petri_dish",
    "1F9EC": [
      "dna",
      "double_helix"
    ],
    "1F9ED": "compass",
    "1F9EE": "abacus",
    "1F9EF": "fire_extinguisher",
    "1F9F0": "toolbox",
    "1F9F1": "bricks",
    "1F9F2": "magnet",
    "1F9F3": "luggage",
    "1F9F4": "lotion_bottle",
    "1F9F5": "thread",
    "1F9F6": "yarn",
    "1F9F7": "safety_pin",
    "1F9F8": "teddy_bear",
    "1F9F9": "broom",
    "1F9FA": "basket",
    "1F9FB": [
      "roll_of_paper",
      "toilet_paper"
    ],
    "1F9FC": "soap",
    "1F9FD": "sponge",
    "1F9FE": "receipt",
    "1F9FF": "nazar_amulet",
    "1FA70": "ballet_shoes",
    "1FA71": "one_piece_swimsuit",
    "1FA72": "briefs",
    "1FA73": "shorts",
    "1FA74": "thong_sandal",
    "1FA75": "light_blue_heart",
    "1FA76": [
      "gray_heart",
      "grey_heart"
    ],
    "1FA77": "pink_heart",
    "1FA78": "drop_of_blood",
    "1FA79": [
      "adhesive_bandage",
      "bandaid"
    ],
    "1FA7A": "stethoscope",
    "1FA7B": [
      "x-ray",
      "xray"
    ],
    "1FA7C": "crutch",
    "1FA80": "yo_yo",
    "1FA81": "kite",
    "1FA82": "parachute",
    "1FA83": "boomerang",
    "1FA84": "magic_wand",
    "1FA85": "pinata",
    "1FA86": "nesting_dolls",
    "1FA87": "maracas",
    "1FA88": "flute",
    "1FA90": [
      "ringed_planet",
      "saturn"
    ],
    "1FA91": "chair",
    "1FA92": "razor",
    "1FA93": "axe",
    "1FA94": "diya_lamp",
    "1FA95": "banjo",
    "1FA96": "military_helmet",
    "1FA97": "accordion",
    "1FA98": "long_drum",
    "1FA99": "coin",
    "1FA9A": "carpentry_saw",
    "1FA9B": "screwdriver",
    "1FA9C": "ladder",
    "1FA9D": "hook",
    "1FA9E": "mirror",
    "1FA9F": "window",
    "1FAA0": "plunger",
    "1FAA1": "sewing_needle",
    "1FAA2": "knot",
    "1FAA3": "bucket",
    "1FAA4": "mouse_trap",
    "1FAA5": "toothbrush",
    "1FAA6": "headstone",
    "1FAA7": "placard",
    "1FAA8": "rock",
    "1FAA9": [
      "disco",
      "disco_ball",
      "mirror_ball"
    ],
    "1FAAA": "id_card",
    "1FAAB": "low_battery",
    "1FAAC": "hamsa",
    "1FAAD": "folding_fan",
    "1FAAE": "hair_pick",
    "1FAAF": "khanda",
    "1FAB0": "fly",
    "1FAB1": "worm",
    "1FAB2": "beetle",
    "1FAB3": "cockroach",
    "1FAB4": "potted_plant",
    "1FAB5": "wood",
    "1FAB6": "feather",
    "1FAB7": "lotus",
    "1FAB8": "coral",
    "1FAB9": [
      "empty_nest",
      "nest"
    ],
    "1FABA": "nest_with_eggs",
    "1FABB": "hyacinth",
    "1FABC": "jellyfish",
    "1FABD": "wing",
    "1FABF": "goose",
    "1FAC0": "anatomical_heart",
    "1FAC1": "lungs",
    "1FAC2": "people_hugging",
    "1FAC3": "pregnant_man",
    "1FAC3-1F3FB": "pregnant_man_tone1",
    "1FAC3-1F3FC": "pregnant_man_tone2",
    "1FAC3-1F3FD": "pregnant_man_tone3",
    "1FAC3-1F3FE": "pregnant_man_tone4",
    "1FAC3-1F3FF": "pregnant_man_tone5",
    "1FAC4": "pregnant_person",
    "1FAC4-1F3FB": "pregnant_person_tone1",
    "1FAC4-1F3FC": "pregnant_person_tone2",
    "1FAC4-1F3FD": "pregnant_person_tone3",
    "1FAC4-1F3FE": "pregnant_person_tone4",
    "1FAC4-1F3FF": "pregnant_person_tone5",
    "1FAC5": [
      "person_with_crown",
      "royalty"
    ],
    "1FAC5-1F3FB": [
      "person_with_crown_tone1",
      "royalty_tone1"
    ],
    "1FAC5-1F3FC": [
      "person_with_crown_tone2",
      "royalty_tone2"
    ],
    "1FAC5-1F3FD": [
      "person_with_crown_tone3",
      "royalty_tone3"
    ],
    "1FAC5-1F3FE": [
      "person_with_crown_tone4",
      "royalty_tone4"
    ],
    "1FAC5-1F3FF": [
      "person_with_crown_tone5",
      "royalty_tone5"
    ],
    "1FACE": "moose",
    "1FACF": "donkey",
    "1FAD0": "blueberries",
    "1FAD1": "bell_pepper",
    "1FAD2": "olive",
    "1FAD3": "flatbread",
    "1FAD4": "tamale",
    "1FAD5": "fondue",
    "1FAD6": "teapot",
    "1FAD7": [
      "pour",
      "pouring_liquid"
    ],
    "1FAD8": "beans",
    "1FAD9": "jar",
    "1FADA": "ginger",
    "1FADB": "pea",
    "1FAE0": [
      "melt",
      "melting_face"
    ],
    "1FAE1": [
      "salute",
      "saluting_face"
    ],
    "1FAE2": [
      "face_with_open_eyes_hand_over_mouth",
      "gasp"
    ],
    "1FAE3": [
      "face_with_peeking_eye",
      "peek"
    ],
    "1FAE4": "face_with_diagonal_mouth",
    "1FAE5": "dotted_line_face",
    "1FAE6": "biting_lip",
    "1FAE7": "bubbles",
    "1FAE8": [
      "shaking",
      "shaking_face"
    ],
    "1FAF0": "hand_with_index_finger_and_thumb_crossed",
    "1FAF0-1F3FB": "hand_with_index_finger_and_thumb_crossed_tone1",
    "1FAF0-1F3FC": "hand_with_index_finger_and_thumb_crossed_tone2",
    "1FAF0-1F3FD": "hand_with_index_finger_and_thumb_crossed_tone3",
    "1FAF0-1F3FE": "hand_with_index_finger_and_thumb_crossed_tone4",
    "1FAF0-1F3FF": "hand_with_index_finger_and_thumb_crossed_tone5",
    "1FAF1": "rightwards_hand",
    "1FAF1-1F3FB": "rightwards_hand_tone1",
    "1FAF1-1F3FC": "rightwards_hand_tone2",
    "1FAF1-1F3FD": "rightwards_hand_tone3",
    "1FAF1-1F3FE": "rightwards_hand_tone4",
    "1FAF1-1F3FF": "rightwards_hand_tone5",
    "1FAF2": "leftwards_hand",
    "1FAF2-1F3FB": "leftwards_hand_tone1",
    "1FAF2-1F3FC": "leftwards_hand_tone2",
    "1FAF2-1F3FD": "leftwards_hand_tone3",
    "1FAF2-1F3FE": "leftwards_hand_tone4",
    "1FAF2-1F3FF": "leftwards_hand_tone5",
    "1FAF3": "palm_down",
    "1FAF3-1F3FB": "palm_down_tone1",
    "1FAF3-1F3FC": "palm_down_tone2",
    "1FAF3-1F3FD": "palm_down_tone3",
    "1FAF3-1F3FE": "palm_down_tone4",
    "1FAF3-1F3FF": "palm_down_tone5",
    "1FAF4": "palm_up",
    "1FAF4-1F3FB": "palm_up_tone1",
    "1FAF4-1F3FC": "palm_up_tone2",
    "1FAF4-1F3FD": "palm_up_tone3",
    "1FAF4-1F3FE": "palm_up_tone4",
    "1FAF4-1F3FF": "palm_up_tone5",
    "1FAF5": "point_forward",
    "1FAF5-1F3FB": "point_forward_tone1",
    "1FAF5-1F3FC": "point_forward_tone2",
    "1FAF5-1F3FD": "point_forward_tone3",
    "1FAF5-1F3FE": "point_forward_tone4",
    "1FAF5-1F3FF": "point_forward_tone5",
    "1FAF6": "heart_hands",
    "1FAF6-1F3FB": "heart_hands_tone1",
    "1FAF6-1F3FC": "heart_hands_tone2",
    "1FAF6-1F3FD": "heart_hands_tone3",
    "1FAF6-1F3FE": "heart_hands_tone4",
    "1FAF6-1F3FF": "heart_hands_tone5",
    "1FAF7": "leftwards_pushing_hand",
    "1FAF7-1F3FB": "leftwards_pushing_hand_tone1",
    "1FAF7-1F3FC": "leftwards_pushing_hand_tone2",
    "1FAF7-1F3FD": "leftwards_pushing_hand_tone3",
    "1FAF7-1F3FE": "leftwards_pushing_hand_tone4",
    "1FAF7-1F3FF": "leftwards_pushing_hand_tone5",
    "1FAF8": "rightwards_pushing_hand",
    "1FAF8-1F3FB": "rightwards_pushing_hand_tone1",
    "1FAF8-1F3FC": "rightwards_pushing_hand_tone2",
    "1FAF8-1F3FD": "rightwards_pushing_hand_tone3",
    "1FAF8-1F3FE": "rightwards_pushing_hand_tone4",
    "1FAF8-1F3FF": "rightwards_pushing_hand_tone5",
    "0023-FE0F-20E3": [
      "hash",
      "number_sign"
    ],
    "002A-FE0F-20E3": "asterisk",
    "0030-FE0F-20E3": "zero",
    "0031-FE0F-20E3": "one",
    "0032-FE0F-20E3": "two",
    "0033-FE0F-20E3": "three",
    "0034-FE0F-20E3": "four",
    "0035-FE0F-20E3": "five",
    "0036-FE0F-20E3": "six",
    "0037-FE0F-20E3": "seven",
    "0038-FE0F-20E3": "eight",
    "0039-FE0F-20E3": "nine",
    "1F1E6-1F1E8": [
      "ascension_island",
      "flag_ac"
    ],
    "1F1E6-1F1E9": [
      "andorra",
      "flag_ad"
    ],
    "1F1E6-1F1EA": [
      "flag_ae",
      "united_arab_emirates"
    ],
    "1F1E6-1F1EB": [
      "afghanistan",
      "flag_af"
    ],
    "1F1E6-1F1EC": [
      "antigua_barbuda",
      "flag_ag"
    ],
    "1F1E6-1F1EE": [
      "anguilla",
      "flag_ai"
    ],
    "1F1E6-1F1F1": [
      "albania",
      "flag_al"
    ],
    "1F1E6-1F1F2": [
      "armenia",
      "flag_am"
    ],
    "1F1E6-1F1F4": [
      "angola",
      "flag_ao"
    ],
    "1F1E6-1F1F6": [
      "antarctica",
      "flag_aq"
    ],
    "1F1E6-1F1F7": [
      "argentina",
      "flag_ar"
    ],
    "1F1E6-1F1F8": [
      "american_samoa",
      "flag_as"
    ],
    "1F1E6-1F1F9": [
      "austria",
      "flag_at"
    ],
    "1F1E6-1F1FA": [
      "australia",
      "flag_au"
    ],
    "1F1E6-1F1FC": [
      "aruba",
      "flag_aw"
    ],
    "1F1E6-1F1FD": [
      "aland_islands",
      "flag_ax"
    ],
    "1F1E6-1F1FF": [
      "azerbaijan",
      "flag_az"
    ],
    "1F1E7-1F1E6": [
      "bosnia_herzegovina",
      "flag_ba"
    ],
    "1F1E7-1F1E7": [
      "barbados",
      "flag_bb"
    ],
    "1F1E7-1F1E9": [
      "bangladesh",
      "flag_bd"
    ],
    "1F1E7-1F1EA": [
      "belgium",
      "flag_be"
    ],
    "1F1E7-1F1EB": [
      "burkina_faso",
      "flag_bf"
    ],
    "1F1E7-1F1EC": [
      "bulgaria",
      "flag_bg"
    ],
    "1F1E7-1F1ED": [
      "bahrain",
      "flag_bh"
    ],
    "1F1E7-1F1EE": [
      "burundi",
      "flag_bi"
    ],
    "1F1E7-1F1EF": [
      "benin",
      "flag_bj"
    ],
    "1F1E7-1F1F1": [
      "flag_bl",
      "st_barthelemy"
    ],
    "1F1E7-1F1F2": [
      "bermuda",
      "flag_bm"
    ],
    "1F1E7-1F1F3": [
      "brunei",
      "flag_bn"
    ],
    "1F1E7-1F1F4": [
      "bolivia",
      "flag_bo"
    ],
    "1F1E7-1F1F6": [
      "caribbean_netherlands",
      "flag_bq"
    ],
    "1F1E7-1F1F7": [
      "brazil",
      "flag_br"
    ],
    "1F1E7-1F1F8": [
      "bahamas",
      "flag_bs"
    ],
    "1F1E7-1F1F9": [
      "bhutan",
      "flag_bt"
    ],
    "1F1E7-1F1FB": [
      "bouvet_island",
      "flag_bv"
    ],
    "1F1E7-1F1FC": [
      "botswana",
      "flag_bw"
    ],
    "1F1E7-1F1FE": [
      "belarus",
      "flag_by"
    ],
    "1F1E7-1F1FF": [
      "belize",
      "flag_bz"
    ],
    "1F1E8-1F1E6": [
      "canada",
      "flag_ca"
    ],
    "1F1E8-1F1E8": [
      "cocos_islands",
      "flag_cc"
    ],
    "1F1E8-1F1E9": [
      "congo_kinshasa",
      "flag_cd"
    ],
    "1F1E8-1F1EB": [
      "central_african_republic",
      "flag_cf"
    ],
    "1F1E8-1F1EC": [
      "congo_brazzaville",
      "flag_cg"
    ],
    "1F1E8-1F1ED": [
      "flag_ch",
      "switzerland"
    ],
    "1F1E8-1F1EE": [
      "cote_divoire",
      "flag_ci"
    ],
    "1F1E8-1F1F0": [
      "cook_islands",
      "flag_ck"
    ],
    "1F1E8-1F1F1": [
      "chile",
      "flag_cl"
    ],
    "1F1E8-1F1F2": [
      "cameroon",
      "flag_cm"
    ],
    "1F1E8-1F1F3": [
      "china",
      "flag_cn"
    ],
    "1F1E8-1F1F4": [
      "colombia",
      "flag_co"
    ],
    "1F1E8-1F1F5": [
      "clipperton_island",
      "flag_cp"
    ],
    "1F1E8-1F1F7": [
      "costa_rica",
      "flag_cr"
    ],
    "1F1E8-1F1FA": [
      "cuba",
      "flag_cu"
    ],
    "1F1E8-1F1FB": [
      "cape_verde",
      "flag_cv"
    ],
    "1F1E8-1F1FC": [
      "curacao",
      "flag_cw"
    ],
    "1F1E8-1F1FD": [
      "christmas_island",
      "flag_cx"
    ],
    "1F1E8-1F1FE": [
      "cyprus",
      "flag_cy"
    ],
    "1F1E8-1F1FF": [
      "czech_republic",
      "czechia",
      "flag_cz"
    ],
    "1F1E9-1F1EA": [
      "flag_de",
      "germany"
    ],
    "1F1E9-1F1EC": [
      "diego_garcia",
      "flag_dg"
    ],
    "1F1E9-1F1EF": [
      "djibouti",
      "flag_dj"
    ],
    "1F1E9-1F1F0": [
      "denmark",
      "flag_dk"
    ],
    "1F1E9-1F1F2": [
      "dominica",
      "flag_dm"
    ],
    "1F1E9-1F1F4": [
      "dominican_republic",
      "flag_do"
    ],
    "1F1E9-1F1FF": [
      "algeria",
      "flag_dz"
    ],
    "1F1EA-1F1E6": [
      "ceuta_melilla",
      "flag_ea"
    ],
    "1F1EA-1F1E8": [
      "ecuador",
      "flag_ec"
    ],
    "1F1EA-1F1EA": [
      "estonia",
      "flag_ee"
    ],
    "1F1EA-1F1EC": [
      "egypt",
      "flag_eg"
    ],
    "1F1EA-1F1ED": [
      "flag_eh",
      "western_sahara"
    ],
    "1F1EA-1F1F7": [
      "eritrea",
      "flag_er"
    ],
    "1F1EA-1F1F8": [
      "flag_es",
      "spain"
    ],
    "1F1EA-1F1F9": [
      "ethiopia",
      "flag_et"
    ],
    "1F1EA-1F1FA": [
      "european_union",
      "flag_eu"
    ],
    "1F1EB-1F1EE": [
      "finland",
      "flag_fi"
    ],
    "1F1EB-1F1EF": [
      "fiji",
      "flag_fj"
    ],
    "1F1EB-1F1F0": [
      "falkland_islands",
      "flag_fk"
    ],
    "1F1EB-1F1F2": [
      "flag_fm",
      "micronesia"
    ],
    "1F1EB-1F1F4": [
      "faroe_islands",
      "flag_fo"
    ],
    "1F1EB-1F1F7": [
      "flag_fr",
      "france"
    ],
    "1F1EC-1F1E6": [
      "flag_ga",
      "gabon"
    ],
    "1F1EC-1F1E7": [
      "flag_gb",
      "uk",
      "united_kingdom"
    ],
    "1F1EC-1F1E9": [
      "flag_gd",
      "grenada"
    ],
    "1F1EC-1F1EA": [
      "flag_ge",
      "georgia"
    ],
    "1F1EC-1F1EB": [
      "flag_gf",
      "french_guiana"
    ],
    "1F1EC-1F1EC": [
      "flag_gg",
      "guernsey"
    ],
    "1F1EC-1F1ED": [
      "flag_gh",
      "ghana"
    ],
    "1F1EC-1F1EE": [
      "flag_gi",
      "gibraltar"
    ],
    "1F1EC-1F1F1": [
      "flag_gl",
      "greenland"
    ],
    "1F1EC-1F1F2": [
      "flag_gm",
      "gambia"
    ],
    "1F1EC-1F1F3": [
      "flag_gn",
      "guinea"
    ],
    "1F1EC-1F1F5": [
      "flag_gp",
      "guadeloupe"
    ],
    "1F1EC-1F1F6": [
      "equatorial_guinea",
      "flag_gq"
    ],
    "1F1EC-1F1F7": [
      "flag_gr",
      "greece"
    ],
    "1F1EC-1F1F8": [
      "flag_gs",
      "south_georgia_south_sandwich_islands"
    ],
    "1F1EC-1F1F9": [
      "flag_gt",
      "guatemala"
    ],
    "1F1EC-1F1FA": [
      "flag_gu",
      "guam"
    ],
    "1F1EC-1F1FC": [
      "flag_gw",
      "guinea_bissau"
    ],
    "1F1EC-1F1FE": [
      "flag_gy",
      "guyana"
    ],
    "1F1ED-1F1F0": [
      "flag_hk",
      "hong_kong"
    ],
    "1F1ED-1F1F2": [
      "flag_hm",
      "heard_mcdonald_islands"
    ],
    "1F1ED-1F1F3": [
      "flag_hn",
      "honduras"
    ],
    "1F1ED-1F1F7": [
      "croatia",
      "flag_hr"
    ],
    "1F1ED-1F1F9": [
      "flag_ht",
      "haiti"
    ],
    "1F1ED-1F1FA": [
      "flag_hu",
      "hungary"
    ],
    "1F1EE-1F1E8": [
      "canary_islands",
      "flag_ic"
    ],
    "1F1EE-1F1E9": [
      "flag_id",
      "indonesia"
    ],
    "1F1EE-1F1EA": [
      "flag_ie",
      "ireland"
    ],
    "1F1EE-1F1F1": [
      "flag_il",
      "israel"
    ],
    "1F1EE-1F1F2": [
      "flag_im",
      "isle_of_man"
    ],
    "1F1EE-1F1F3": [
      "flag_in",
      "india"
    ],
    "1F1EE-1F1F4": [
      "british_indian_ocean_territory",
      "flag_io"
    ],
    "1F1EE-1F1F6": [
      "flag_iq",
      "iraq"
    ],
    "1F1EE-1F1F7": [
      "flag_ir",
      "iran"
    ],
    "1F1EE-1F1F8": [
      "flag_is",
      "iceland"
    ],
    "1F1EE-1F1F9": [
      "flag_it",
      "italy"
    ],
    "1F1EF-1F1EA": [
      "flag_je",
      "jersey"
    ],
    "1F1EF-1F1F2": [
      "flag_jm",
      "jamaica"
    ],
    "1F1EF-1F1F4": [
      "flag_jo",
      "jordan"
    ],
    "1F1EF-1F1F5": [
      "flag_jp",
      "japan"
    ],
    "1F1F0-1F1EA": [
      "flag_ke",
      "kenya"
    ],
    "1F1F0-1F1EC": [
      "flag_kg",
      "kyrgyzstan"
    ],
    "1F1F0-1F1ED": [
      "cambodia",
      "flag_kh"
    ],
    "1F1F0-1F1EE": [
      "flag_ki",
      "kiribati"
    ],
    "1F1F0-1F1F2": [
      "comoros",
      "flag_km"
    ],
    "1F1F0-1F1F3": [
      "flag_kn",
      "st_kitts_nevis"
    ],
    "1F1F0-1F1F5": [
      "flag_kp",
      "north_korea"
    ],
    "1F1F0-1F1F7": [
      "flag_kr",
      "south_korea"
    ],
    "1F1F0-1F1FC": [
      "flag_kw",
      "kuwait"
    ],
    "1F1F0-1F1FE": [
      "cayman_islands",
      "flag_ky"
    ],
    "1F1F0-1F1FF": [
      "flag_kz",
      "kazakhstan"
    ],
    "1F1F1-1F1E6": [
      "flag_la",
      "laos"
    ],
    "1F1F1-1F1E7": [
      "flag_lb",
      "lebanon"
    ],
    "1F1F1-1F1E8": [
      "flag_lc",
      "st_lucia"
    ],
    "1F1F1-1F1EE": [
      "flag_li",
      "liechtenstein"
    ],
    "1F1F1-1F1F0": [
      "flag_lk",
      "sri_lanka"
    ],
    "1F1F1-1F1F7": [
      "flag_lr",
      "liberia"
    ],
    "1F1F1-1F1F8": [
      "flag_ls",
      "lesotho"
    ],
    "1F1F1-1F1F9": [
      "flag_lt",
      "lithuania"
    ],
    "1F1F1-1F1FA": [
      "flag_lu",
      "luxembourg"
    ],
    "1F1F1-1F1FB": [
      "flag_lv",
      "latvia"
    ],
    "1F1F1-1F1FE": [
      "flag_ly",
      "libya"
    ],
    "1F1F2-1F1E6": [
      "flag_ma",
      "morocco"
    ],
    "1F1F2-1F1E8": [
      "flag_mc",
      "monaco"
    ],
    "1F1F2-1F1E9": [
      "flag_md",
      "moldova"
    ],
    "1F1F2-1F1EA": [
      "flag_me",
      "montenegro"
    ],
    "1F1F2-1F1EB": [
      "flag_mf",
      "st_martin"
    ],
    "1F1F2-1F1EC": [
      "flag_mg",
      "madagascar"
    ],
    "1F1F2-1F1ED": [
      "flag_mh",
      "marshall_islands"
    ],
    "1F1F2-1F1F0": [
      "flag_mk",
      "macedonia"
    ],
    "1F1F2-1F1F1": [
      "flag_ml",
      "mali"
    ],
    "1F1F2-1F1F2": [
      "burma",
      "flag_mm",
      "myanmar"
    ],
    "1F1F2-1F1F3": [
      "flag_mn",
      "mongolia"
    ],
    "1F1F2-1F1F4": [
      "flag_mo",
      "macao",
      "macau"
    ],
    "1F1F2-1F1F5": [
      "flag_mp",
      "northern_mariana_islands"
    ],
    "1F1F2-1F1F6": [
      "flag_mq",
      "martinique"
    ],
    "1F1F2-1F1F7": [
      "flag_mr",
      "mauritania"
    ],
    "1F1F2-1F1F8": [
      "flag_ms",
      "montserrat"
    ],
    "1F1F2-1F1F9": [
      "flag_mt",
      "malta"
    ],
    "1F1F2-1F1FA": [
      "flag_mu",
      "mauritius"
    ],
    "1F1F2-1F1FB": [
      "flag_mv",
      "maldives"
    ],
    "1F1F2-1F1FC": [
      "flag_mw",
      "malawi"
    ],
    "1F1F2-1F1FD": [
      "flag_mx",
      "mexico"
    ],
    "1F1F2-1F1FE": [
      "flag_my",
      "malaysia"
    ],
    "1F1F2-1F1FF": [
      "flag_mz",
      "mozambique"
    ],
    "1F1F3-1F1E6": [
      "flag_na",
      "namibia"
    ],
    "1F1F3-1F1E8": [
      "flag_nc",
      "new_caledonia"
    ],
    "1F1F3-1F1EA": [
      "flag_ne",
      "niger"
    ],
    "1F1F3-1F1EB": [
      "flag_nf",
      "norfolk_island"
    ],
    "1F1F3-1F1EC": [
      "flag_ng",
      "nigeria"
    ],
    "1F1F3-1F1EE": [
      "flag_ni",
      "nicaragua"
    ],
    "1F1F3-1F1F1": [
      "flag_nl",
      "netherlands"
    ],
    "1F1F3-1F1F4": [
      "flag_no",
      "norway"
    ],
    "1F1F3-1F1F5": [
      "flag_np",
      "nepal"
    ],
    "1F1F3-1F1F7": [
      "flag_nr",
      "nauru"
    ],
    "1F1F3-1F1FA": [
      "flag_nu",
      "niue"
    ],
    "1F1F3-1F1FF": [
      "flag_nz",
      "new_zealand"
    ],
    "1F1F4-1F1F2": [
      "flag_om",
      "oman"
    ],
    "1F1F5-1F1E6": [
      "flag_pa",
      "panama"
    ],
    "1F1F5-1F1EA": [
      "flag_pe",
      "peru"
    ],
    "1F1F5-1F1EB": [
      "flag_pf",
      "french_polynesia"
    ],
    "1F1F5-1F1EC": [
      "flag_pg",
      "papua_new_guinea"
    ],
    "1F1F5-1F1ED": [
      "flag_ph",
      "philippines"
    ],
    "1F1F5-1F1F0": [
      "flag_pk",
      "pakistan"
    ],
    "1F1F5-1F1F1": [
      "flag_pl",
      "poland"
    ],
    "1F1F5-1F1F2": [
      "flag_pm",
      "st_pierre_miquelon"
    ],
    "1F1F5-1F1F3": [
      "flag_pn",
      "pitcairn_islands"
    ],
    "1F1F5-1F1F7": [
      "flag_pr",
      "puerto_rico"
    ],
    "1F1F5-1F1F8": [
      "flag_ps",
      "palestinian_territories"
    ],
    "1F1F5-1F1F9": [
      "flag_pt",
      "portugal"
    ],
    "1F1F5-1F1FC": [
      "flag_pw",
      "palau"
    ],
    "1F1F5-1F1FE": [
      "flag_py",
      "paraguay"
    ],
    "1F1F6-1F1E6": [
      "flag_qa",
      "qatar"
    ],
    "1F1F7-1F1EA": [
      "flag_re",
      "reunion"
    ],
    "1F1F7-1F1F4": [
      "flag_ro",
      "romania"
    ],
    "1F1F7-1F1F8": [
      "flag_rs",
      "serbia"
    ],
    "1F1F7-1F1FA": [
      "flag_ru",
      "russia"
    ],
    "1F1F7-1F1FC": [
      "flag_rw",
      "rwanda"
    ],
    "1F1F8-1F1E6": [
      "flag_sa",
      "saudi_arabia"
    ],
    "1F1F8-1F1E7": [
      "flag_sb",
      "solomon_islands"
    ],
    "1F1F8-1F1E8": [
      "flag_sc",
      "seychelles"
    ],
    "1F1F8-1F1E9": [
      "flag_sd",
      "sudan"
    ],
    "1F1F8-1F1EA": [
      "flag_se",
      "sweden"
    ],
    "1F1F8-1F1EC": [
      "flag_sg",
      "singapore"
    ],
    "1F1F8-1F1ED": [
      "flag_sh",
      "st_helena"
    ],
    "1F1F8-1F1EE": [
      "flag_si",
      "slovenia"
    ],
    "1F1F8-1F1EF": [
      "flag_sj",
      "svalbard_jan_mayen"
    ],
    "1F1F8-1F1F0": [
      "flag_sk",
      "slovakia"
    ],
    "1F1F8-1F1F1": [
      "flag_sl",
      "sierra_leone"
    ],
    "1F1F8-1F1F2": [
      "flag_sm",
      "san_marino"
    ],
    "1F1F8-1F1F3": [
      "flag_sn",
      "senegal"
    ],
    "1F1F8-1F1F4": [
      "flag_so",
      "somalia"
    ],
    "1F1F8-1F1F7": [
      "flag_sr",
      "suriname"
    ],
    "1F1F8-1F1F8": [
      "flag_ss",
      "south_sudan"
    ],
    "1F1F8-1F1F9": [
      "flag_st",
      "sao_tome_principe"
    ],
    "1F1F8-1F1FB": [
      "el_salvador",
      "flag_sv"
    ],
    "1F1F8-1F1FD": [
      "flag_sx",
      "sint_maarten"
    ],
    "1F1F8-1F1FE": [
      "flag_sy",
      "syria"
    ],
    "1F1F8-1F1FF": [
      "eswatini",
      "flag_sz",
      "swaziland"
    ],
    "1F1F9-1F1E6": [
      "flag_ta",
      "tristan_da_cunha"
    ],
    "1F1F9-1F1E8": [
      "flag_tc",
      "turks_caicos_islands"
    ],
    "1F1F9-1F1E9": [
      "chad",
      "flag_td"
    ],
    "1F1F9-1F1EB": [
      "flag_tf",
      "french_southern_territories"
    ],
    "1F1F9-1F1EC": [
      "flag_tg",
      "togo"
    ],
    "1F1F9-1F1ED": [
      "flag_th",
      "thailand"
    ],
    "1F1F9-1F1EF": [
      "flag_tj",
      "tajikistan"
    ],
    "1F1F9-1F1F0": [
      "flag_tk",
      "tokelau"
    ],
    "1F1F9-1F1F1": [
      "flag_tl",
      "timor_leste"
    ],
    "1F1F9-1F1F2": [
      "flag_tm",
      "turkmenistan"
    ],
    "1F1F9-1F1F3": [
      "flag_tn",
      "tunisia"
    ],
    "1F1F9-1F1F4": [
      "flag_to",
      "tonga"
    ],
    "1F1F9-1F1F7": [
      "flag_tr",
      "turkey_tr"
    ],
    "1F1F9-1F1F9": [
      "flag_tt",
      "trinidad_tobago"
    ],
    "1F1F9-1F1FB": [
      "flag_tv",
      "tuvalu"
    ],
    "1F1F9-1F1FC": [
      "flag_tw",
      "taiwan"
    ],
    "1F1F9-1F1FF": [
      "flag_tz",
      "tanzania"
    ],
    "1F1FA-1F1E6": [
      "flag_ua",
      "ukraine"
    ],
    "1F1FA-1F1EC": [
      "flag_ug",
      "uganda"
    ],
    "1F1FA-1F1F2": [
      "flag_um",
      "us_outlying_islands"
    ],
    "1F1FA-1F1F3": [
      "flag_un",
      "un",
      "united_nations"
    ],
    "1F1FA-1F1F8": [
      "flag_us",
      "united_states",
      "usa"
    ],
    "1F1FA-1F1FE": [
      "flag_uy",
      "uruguay"
    ],
    "1F1FA-1F1FF": [
      "flag_uz",
      "uzbekistan"
    ],
    "1F1FB-1F1E6": [
      "flag_va",
      "vatican_city"
    ],
    "1F1FB-1F1E8": [
      "flag_vc",
      "st_vincent_grenadines"
    ],
    "1F1FB-1F1EA": [
      "flag_ve",
      "venezuela"
    ],
    "1F1FB-1F1EC": [
      "british_virgin_islands",
      "flag_vg"
    ],
    "1F1FB-1F1EE": [
      "flag_vi",
      "us_virgin_islands"
    ],
    "1F1FB-1F1F3": [
      "flag_vn",
      "vietnam"
    ],
    "1F1FB-1F1FA": [
      "flag_vu",
      "vanuatu"
    ],
    "1F1FC-1F1EB": [
      "flag_wf",
      "wallis_futuna"
    ],
    "1F1FC-1F1F8": [
      "flag_ws",
      "samoa"
    ],
    "1F1FD-1F1F0": [
      "flag_xk",
      "kosovo"
    ],
    "1F1FE-1F1EA": [
      "flag_ye",
      "yemen"
    ],
    "1F1FE-1F1F9": [
      "flag_yt",
      "mayotte"
    ],
    "1F1FF-1F1E6": [
      "flag_za",
      "south_africa"
    ],
    "1F1FF-1F1F2": [
      "flag_zm",
      "zambia"
    ],
    "1F1FF-1F1FC": [
      "flag_zw",
      "zimbabwe"
    ],
    "1F3F4-E0067-E0062-E0065-E006E-E0067-E007F": [
      "england",
      "flag_gbeng"
    ],
    "1F3F4-E0067-E0062-E0073-E0063-E0074-E007F": [
      "flag_gbsct",
      "scotland"
    ],
    "1F3F4-E0067-E0062-E0077-E006C-E0073-E007F": [
      "flag_gbwls",
      "wales"
    ],
    "1F468-200D-2764-FE0F-200D-1F468": "couple_with_heart_mm",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FB": "couple_with_heart_mm_tone1",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FC": "couple_with_heart_mm_tone1-2",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FD": "couple_with_heart_mm_tone1-3",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FE": "couple_with_heart_mm_tone1-4",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F468-1F3FF": "couple_with_heart_mm_tone1-5",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FB": "couple_with_heart_mm_tone2-1",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FC": "couple_with_heart_mm_tone2",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FD": "couple_with_heart_mm_tone2-3",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FE": "couple_with_heart_mm_tone2-4",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F468-1F3FF": "couple_with_heart_mm_tone2-5",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FB": "couple_with_heart_mm_tone3-1",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FC": "couple_with_heart_mm_tone3-2",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FD": "couple_with_heart_mm_tone3",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FE": "couple_with_heart_mm_tone3-4",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F468-1F3FF": "couple_with_heart_mm_tone3-5",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FB": "couple_with_heart_mm_tone4-1",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FC": "couple_with_heart_mm_tone4-2",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FD": "couple_with_heart_mm_tone4-3",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FE": "couple_with_heart_mm_tone4",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F468-1F3FF": "couple_with_heart_mm_tone4-5",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FB": "couple_with_heart_mm_tone5-1",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FC": "couple_with_heart_mm_tone5-2",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FD": "couple_with_heart_mm_tone5-3",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FE": "couple_with_heart_mm_tone5-4",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F468-1F3FF": "couple_with_heart_mm_tone5",
    "1F468-200D-2764-FE0F-200D-1F48B-200D-1F468": "kiss_mm",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": "kiss_mm_tone1",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": "kiss_mm_tone1-2",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": "kiss_mm_tone1-3",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": "kiss_mm_tone1-4",
    "1F468-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": "kiss_mm_tone1-5",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": "kiss_mm_tone2-1",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": "kiss_mm_tone2",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": "kiss_mm_tone2-3",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": "kiss_mm_tone2-4",
    "1F468-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": "kiss_mm_tone2-5",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": "kiss_mm_tone3-1",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": "kiss_mm_tone3-2",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": "kiss_mm_tone3",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": "kiss_mm_tone3-4",
    "1F468-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": "kiss_mm_tone3-5",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": "kiss_mm_tone4-1",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": "kiss_mm_tone4-2",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": "kiss_mm_tone4-3",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": "kiss_mm_tone4",
    "1F468-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": "kiss_mm_tone4-5",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": "kiss_mm_tone5-1",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": "kiss_mm_tone5-2",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": "kiss_mm_tone5-3",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": "kiss_mm_tone5-4",
    "1F468-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": "kiss_mm_tone5",
    "1F468-200D-1F466": "family_mb",
    "1F468-200D-1F466-200D-1F466": "family_mbb",
    "1F468-200D-1F467": "family_mg",
    "1F468-200D-1F467-200D-1F466": "family_mgb",
    "1F468-200D-1F467-200D-1F467": "family_mgg",
    "1F468-200D-1F468-200D-1F466": "family_mmb",
    "1F468-200D-1F468-200D-1F466-200D-1F466": "family_mmbb",
    "1F468-200D-1F468-200D-1F467": "family_mmg",
    "1F468-200D-1F468-200D-1F467-200D-1F466": "family_mmgb",
    "1F468-200D-1F468-200D-1F467-200D-1F467": "family_mmgg",
    "1F468-200D-1F469-200D-1F466": "family_mwb",
    "1F468-200D-1F469-200D-1F466-200D-1F466": "family_mwbb",
    "1F468-200D-1F469-200D-1F467": "family_mwg",
    "1F468-200D-1F469-200D-1F467-200D-1F466": "family_mwgb",
    "1F468-200D-1F469-200D-1F467-200D-1F467": "family_mwgg",
    "1F469-200D-2764-FE0F-200D-1F468": [
      "couple_with_heart_mw",
      "couple_with_heart_wm"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_mw_tone1",
      "couple_with_heart_wm_tone1"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_mw_tone1-2",
      "couple_with_heart_wm_tone1-2"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_mw_tone1-3",
      "couple_with_heart_wm_tone1-3"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_mw_tone1-4",
      "couple_with_heart_wm_tone1-4"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_mw_tone1-5",
      "couple_with_heart_wm_tone1-5"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_mw_tone2-1",
      "couple_with_heart_wm_tone2-1"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_mw_tone2",
      "couple_with_heart_wm_tone2"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_mw_tone2-3",
      "couple_with_heart_wm_tone2-3"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_mw_tone2-4",
      "couple_with_heart_wm_tone2-4"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_mw_tone2-5",
      "couple_with_heart_wm_tone2-5"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_mw_tone3-1",
      "couple_with_heart_wm_tone3-1"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_mw_tone3-2",
      "couple_with_heart_wm_tone3-2"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_mw_tone3",
      "couple_with_heart_wm_tone3"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_mw_tone3-4",
      "couple_with_heart_wm_tone3-4"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_mw_tone3-5",
      "couple_with_heart_wm_tone3-5"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_mw_tone4-1",
      "couple_with_heart_wm_tone4-1"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_mw_tone4-2",
      "couple_with_heart_wm_tone4-2"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_mw_tone4-3",
      "couple_with_heart_wm_tone4-3"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_mw_tone4",
      "couple_with_heart_wm_tone4"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_mw_tone4-5",
      "couple_with_heart_wm_tone4-5"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FB": [
      "couple_with_heart_mw_tone5-1",
      "couple_with_heart_wm_tone5-1"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FC": [
      "couple_with_heart_mw_tone5-2",
      "couple_with_heart_wm_tone5-2"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FD": [
      "couple_with_heart_mw_tone5-3",
      "couple_with_heart_wm_tone5-3"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FE": [
      "couple_with_heart_mw_tone5-4",
      "couple_with_heart_wm_tone5-4"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F468-1F3FF": [
      "couple_with_heart_mw_tone5",
      "couple_with_heart_wm_tone5"
    ],
    "1F469-200D-2764-FE0F-200D-1F469": "couple_with_heart_ww",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FB": "couple_with_heart_ww_tone1",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FC": "couple_with_heart_ww_tone1-2",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FD": "couple_with_heart_ww_tone1-3",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FE": "couple_with_heart_ww_tone1-4",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F469-1F3FF": "couple_with_heart_ww_tone1-5",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FB": "couple_with_heart_ww_tone2-1",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FC": "couple_with_heart_ww_tone2",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FD": "couple_with_heart_ww_tone2-3",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FE": "couple_with_heart_ww_tone2-4",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F469-1F3FF": "couple_with_heart_ww_tone2-5",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FB": "couple_with_heart_ww_tone3-1",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FC": "couple_with_heart_ww_tone3-2",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FD": "couple_with_heart_ww_tone3",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FE": "couple_with_heart_ww_tone3-4",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F469-1F3FF": "couple_with_heart_ww_tone3-5",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FB": "couple_with_heart_ww_tone4-1",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FC": "couple_with_heart_ww_tone4-2",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FD": "couple_with_heart_ww_tone4-3",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FE": "couple_with_heart_ww_tone4",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F469-1F3FF": "couple_with_heart_ww_tone4-5",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FB": "couple_with_heart_ww_tone5-1",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FC": "couple_with_heart_ww_tone5-2",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FD": "couple_with_heart_ww_tone5-3",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FE": "couple_with_heart_ww_tone5-4",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F469-1F3FF": "couple_with_heart_ww_tone5",
    "1F469-200D-2764-FE0F-200D-1F48B-200D-1F468": [
      "kiss_mw",
      "kiss_wm"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_mw_tone1",
      "kiss_wm_tone1"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_mw_tone1-2",
      "kiss_wm_tone1-2"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_mw_tone1-3",
      "kiss_wm_tone1-3"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_mw_tone1-4",
      "kiss_wm_tone1-4"
    ],
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_mw_tone1-5",
      "kiss_wm_tone1-5"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_mw_tone2-1",
      "kiss_wm_tone2-1"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_mw_tone2",
      "kiss_wm_tone2"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_mw_tone2-3",
      "kiss_wm_tone2-3"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_mw_tone2-4",
      "kiss_wm_tone2-4"
    ],
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_mw_tone2-5",
      "kiss_wm_tone2-5"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_mw_tone3-1",
      "kiss_wm_tone3-1"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_mw_tone3-2",
      "kiss_wm_tone3-2"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_mw_tone3",
      "kiss_wm_tone3"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_mw_tone3-4",
      "kiss_wm_tone3-4"
    ],
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_mw_tone3-5",
      "kiss_wm_tone3-5"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_mw_tone4-1",
      "kiss_wm_tone4-1"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_mw_tone4-2",
      "kiss_wm_tone4-2"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_mw_tone4-3",
      "kiss_wm_tone4-3"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_mw_tone4",
      "kiss_wm_tone4"
    ],
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_mw_tone4-5",
      "kiss_wm_tone4-5"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FB": [
      "kiss_mw_tone5-1",
      "kiss_wm_tone5-1"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FC": [
      "kiss_mw_tone5-2",
      "kiss_wm_tone5-2"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FD": [
      "kiss_mw_tone5-3",
      "kiss_wm_tone5-3"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FE": [
      "kiss_mw_tone5-4",
      "kiss_wm_tone5-4"
    ],
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F468-1F3FF": [
      "kiss_mw_tone5",
      "kiss_wm_tone5"
    ],
    "1F469-200D-2764-FE0F-200D-1F48B-200D-1F469": "kiss_ww",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": "kiss_ww_tone1",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": "kiss_ww_tone1-2",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": "kiss_ww_tone1-3",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": "kiss_ww_tone1-4",
    "1F469-1F3FB-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": "kiss_ww_tone1-5",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": "kiss_ww_tone2-1",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": "kiss_ww_tone2",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": "kiss_ww_tone2-3",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": "kiss_ww_tone2-4",
    "1F469-1F3FC-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": "kiss_ww_tone2-5",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": "kiss_ww_tone3-1",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": "kiss_ww_tone3-2",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": "kiss_ww_tone3",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": "kiss_ww_tone3-4",
    "1F469-1F3FD-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": "kiss_ww_tone3-5",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": "kiss_ww_tone4-1",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": "kiss_ww_tone4-2",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": "kiss_ww_tone4-3",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": "kiss_ww_tone4",
    "1F469-1F3FE-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": "kiss_ww_tone4-5",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FB": "kiss_ww_tone5-1",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FC": "kiss_ww_tone5-2",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FD": "kiss_ww_tone5-3",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FE": "kiss_ww_tone5-4",
    "1F469-1F3FF-200D-2764-FE0F-200D-1F48B-200D-1F469-1F3FF": "kiss_ww_tone5",
    "1F469-200D-1F466": "family_wb",
    "1F469-200D-1F466-200D-1F466": "family_wbb",
    "1F469-200D-1F467": "family_wg",
    "1F469-200D-1F467-200D-1F466": "family_wgb",
    "1F469-200D-1F467-200D-1F467": "family_wgg",
    "1F469-200D-1F469-200D-1F466": "family_wwb",
    "1F469-200D-1F469-200D-1F466-200D-1F466": "family_wwbb",
    "1F469-200D-1F469-200D-1F467": "family_wwg",
    "1F469-200D-1F469-200D-1F467-200D-1F466": "family_wwgb",
    "1F469-200D-1F469-200D-1F467-200D-1F467": "family_wwgg",
    "1F9D1-200D-1F91D-200D-1F9D1": "people_holding_hands",
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FB": "people_holding_hands_tone1",
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FC": "people_holding_hands_tone1-2",
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FD": "people_holding_hands_tone1-3",
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FE": "people_holding_hands_tone1-4",
    "1F9D1-1F3FB-200D-1F91D-200D-1F9D1-1F3FF": "people_holding_hands_tone1-5",
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FB": "people_holding_hands_tone2-1",
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FC": "people_holding_hands_tone2",
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FD": "people_holding_hands_tone2-3",
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FE": "people_holding_hands_tone2-4",
    "1F9D1-1F3FC-200D-1F91D-200D-1F9D1-1F3FF": "people_holding_hands_tone2-5",
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FB": "people_holding_hands_tone3-1",
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FC": "people_holding_hands_tone3-2",
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FD": "people_holding_hands_tone3",
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FE": "people_holding_hands_tone3-4",
    "1F9D1-1F3FD-200D-1F91D-200D-1F9D1-1F3FF": "people_holding_hands_tone3-5",
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FB": "people_holding_hands_tone4-1",
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FC": "people_holding_hands_tone4-2",
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FD": "people_holding_hands_tone4-3",
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FE": "people_holding_hands_tone4",
    "1F9D1-1F3FE-200D-1F91D-200D-1F9D1-1F3FF": "people_holding_hands_tone4-5",
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FB": "people_holding_hands_tone5-1",
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FC": "people_holding_hands_tone5-2",
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FD": "people_holding_hands_tone5-3",
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FE": "people_holding_hands_tone5-4",
    "1F9D1-1F3FF-200D-1F91D-200D-1F9D1-1F3FF": "people_holding_hands_tone5",
    "1F9D1-200D-1F9D1-200D-1F9D2": "family_aac",
    "1F9D1-200D-1F9D1-200D-1F9D2-200D-1F9D2": "family_aacc",
    "1F9D1-200D-1F9D2": "family_ac",
    "1F9D1-200D-1F9D2-200D-1F9D2": "family_acc",
    "1F3C3-200D-27A1-FE0F": "person_running_right",
    "1F3C3-1F3FB-200D-27A1-FE0F": "person_running_right_tone1",
    "1F3C3-1F3FC-200D-27A1-FE0F": "person_running_right_tone2",
    "1F3C3-1F3FD-200D-27A1-FE0F": "person_running_right_tone3",
    "1F3C3-1F3FE-200D-27A1-FE0F": "person_running_right_tone4",
    "1F3C3-1F3FF-200D-27A1-FE0F": "person_running_right_tone5",
    "1F468-200D-2695-FE0F": "man_health_worker",
    "1F468-1F3FB-200D-2695-FE0F": "man_health_worker_tone1",
    "1F468-1F3FC-200D-2695-FE0F": "man_health_worker_tone2",
    "1F468-1F3FD-200D-2695-FE0F": "man_health_worker_tone3",
    "1F468-1F3FE-200D-2695-FE0F": "man_health_worker_tone4",
    "1F468-1F3FF-200D-2695-FE0F": "man_health_worker_tone5",
    "1F468-200D-2696-FE0F": "man_judge",
    "1F468-1F3FB-200D-2696-FE0F": "man_judge_tone1",
    "1F468-1F3FC-200D-2696-FE0F": "man_judge_tone2",
    "1F468-1F3FD-200D-2696-FE0F": "man_judge_tone3",
    "1F468-1F3FE-200D-2696-FE0F": "man_judge_tone4",
    "1F468-1F3FF-200D-2696-FE0F": "man_judge_tone5",
    "1F468-200D-2708-FE0F": "man_pilot",
    "1F468-1F3FB-200D-2708-FE0F": "man_pilot_tone1",
    "1F468-1F3FC-200D-2708-FE0F": "man_pilot_tone2",
    "1F468-1F3FD-200D-2708-FE0F": "man_pilot_tone3",
    "1F468-1F3FE-200D-2708-FE0F": "man_pilot_tone4",
    "1F468-1F3FF-200D-2708-FE0F": "man_pilot_tone5",
    "1F468-200D-1F33E": "man_farmer",
    "1F468-1F3FB-200D-1F33E": "man_farmer_tone1",
    "1F468-1F3FC-200D-1F33E": "man_farmer_tone2",
    "1F468-1F3FD-200D-1F33E": "man_farmer_tone3",
    "1F468-1F3FE-200D-1F33E": "man_farmer_tone4",
    "1F468-1F3FF-200D-1F33E": "man_farmer_tone5",
    "1F468-200D-1F373": "man_cook",
    "1F468-1F3FB-200D-1F373": "man_cook_tone1",
    "1F468-1F3FC-200D-1F373": "man_cook_tone2",
    "1F468-1F3FD-200D-1F373": "man_cook_tone3",
    "1F468-1F3FE-200D-1F373": "man_cook_tone4",
    "1F468-1F3FF-200D-1F373": "man_cook_tone5",
    "1F468-200D-1F37C": "man_feeding_baby",
    "1F468-1F3FB-200D-1F37C": "man_feeding_baby_tone1",
    "1F468-1F3FC-200D-1F37C": "man_feeding_baby_tone2",
    "1F468-1F3FD-200D-1F37C": "man_feeding_baby_tone3",
    "1F468-1F3FE-200D-1F37C": "man_feeding_baby_tone4",
    "1F468-1F3FF-200D-1F37C": "man_feeding_baby_tone5",
    "1F468-200D-1F393": "man_student",
    "1F468-1F3FB-200D-1F393": "man_student_tone1",
    "1F468-1F3FC-200D-1F393": "man_student_tone2",
    "1F468-1F3FD-200D-1F393": "man_student_tone3",
    "1F468-1F3FE-200D-1F393": "man_student_tone4",
    "1F468-1F3FF-200D-1F393": "man_student_tone5",
    "1F468-200D-1F3A4": "man_singer",
    "1F468-1F3FB-200D-1F3A4": "man_singer_tone1",
    "1F468-1F3FC-200D-1F3A4": "man_singer_tone2",
    "1F468-1F3FD-200D-1F3A4": "man_singer_tone3",
    "1F468-1F3FE-200D-1F3A4": "man_singer_tone4",
    "1F468-1F3FF-200D-1F3A4": "man_singer_tone5",
    "1F468-200D-1F3A8": "man_artist",
    "1F468-1F3FB-200D-1F3A8": "man_artist_tone1",
    "1F468-1F3FC-200D-1F3A8": "man_artist_tone2",
    "1F468-1F3FD-200D-1F3A8": "man_artist_tone3",
    "1F468-1F3FE-200D-1F3A8": "man_artist_tone4",
    "1F468-1F3FF-200D-1F3A8": "man_artist_tone5",
    "1F468-200D-1F3EB": "man_teacher",
    "1F468-1F3FB-200D-1F3EB": "man_teacher_tone1",
    "1F468-1F3FC-200D-1F3EB": "man_teacher_tone2",
    "1F468-1F3FD-200D-1F3EB": "man_teacher_tone3",
    "1F468-1F3FE-200D-1F3EB": "man_teacher_tone4",
    "1F468-1F3FF-200D-1F3EB": "man_teacher_tone5",
    "1F468-200D-1F3ED": "man_factory_worker",
    "1F468-1F3FB-200D-1F3ED": "man_factory_worker_tone1",
    "1F468-1F3FC-200D-1F3ED": "man_factory_worker_tone2",
    "1F468-1F3FD-200D-1F3ED": "man_factory_worker_tone3",
    "1F468-1F3FE-200D-1F3ED": "man_factory_worker_tone4",
    "1F468-1F3FF-200D-1F3ED": "man_factory_worker_tone5",
    "1F468-200D-1F4BB": "man_technologist",
    "1F468-1F3FB-200D-1F4BB": "man_technologist_tone1",
    "1F468-1F3FC-200D-1F4BB": "man_technologist_tone2",
    "1F468-1F3FD-200D-1F4BB": "man_technologist_tone3",
    "1F468-1F3FE-200D-1F4BB": "man_technologist_tone4",
    "1F468-1F3FF-200D-1F4BB": "man_technologist_tone5",
    "1F468-200D-1F4BC": "man_office_worker",
    "1F468-1F3FB-200D-1F4BC": "man_office_worker_tone1",
    "1F468-1F3FC-200D-1F4BC": "man_office_worker_tone2",
    "1F468-1F3FD-200D-1F4BC": "man_office_worker_tone3",
    "1F468-1F3FE-200D-1F4BC": "man_office_worker_tone4",
    "1F468-1F3FF-200D-1F4BC": "man_office_worker_tone5",
    "1F468-200D-1F527": "man_mechanic",
    "1F468-1F3FB-200D-1F527": "man_mechanic_tone1",
    "1F468-1F3FC-200D-1F527": "man_mechanic_tone2",
    "1F468-1F3FD-200D-1F527": "man_mechanic_tone3",
    "1F468-1F3FE-200D-1F527": "man_mechanic_tone4",
    "1F468-1F3FF-200D-1F527": "man_mechanic_tone5",
    "1F468-200D-1F52C": "man_scientist",
    "1F468-1F3FB-200D-1F52C": "man_scientist_tone1",
    "1F468-1F3FC-200D-1F52C": "man_scientist_tone2",
    "1F468-1F3FD-200D-1F52C": "man_scientist_tone3",
    "1F468-1F3FE-200D-1F52C": "man_scientist_tone4",
    "1F468-1F3FF-200D-1F52C": "man_scientist_tone5",
    "1F468-200D-1F680": "man_astronaut",
    "1F468-1F3FB-200D-1F680": "man_astronaut_tone1",
    "1F468-1F3FC-200D-1F680": "man_astronaut_tone2",
    "1F468-1F3FD-200D-1F680": "man_astronaut_tone3",
    "1F468-1F3FE-200D-1F680": "man_astronaut_tone4",
    "1F468-1F3FF-200D-1F680": "man_astronaut_tone5",
    "1F468-200D-1F692": "man_firefighter",
    "1F468-1F3FB-200D-1F692": "man_firefighter_tone1",
    "1F468-1F3FC-200D-1F692": "man_firefighter_tone2",
    "1F468-1F3FD-200D-1F692": "man_firefighter_tone3",
    "1F468-1F3FE-200D-1F692": "man_firefighter_tone4",
    "1F468-1F3FF-200D-1F692": "man_firefighter_tone5",
    "1F468-200D-1F9AF": [
      "man_with_probing_cane",
      "man_with_white_cane"
    ],
    "1F468-1F3FB-200D-1F9AF": [
      "man_with_probing_cane_tone1",
      "man_with_white_cane_tone1"
    ],
    "1F468-1F3FC-200D-1F9AF": [
      "man_with_probing_cane_tone2",
      "man_with_white_cane_tone2"
    ],
    "1F468-1F3FD-200D-1F9AF": [
      "man_with_probing_cane_tone3",
      "man_with_white_cane_tone3"
    ],
    "1F468-1F3FE-200D-1F9AF": [
      "man_with_probing_cane_tone4",
      "man_with_white_cane_tone4"
    ],
    "1F468-1F3FF-200D-1F9AF": [
      "man_with_probing_cane_tone5",
      "man_with_white_cane_tone5"
    ],
    "1F468-200D-1F9AF-200D-27A1-FE0F": "man_with_white_cane_right",
    "1F468-1F3FB-200D-1F9AF-200D-27A1-FE0F": "man_with_white_cane_right_tone1",
    "1F468-1F3FC-200D-1F9AF-200D-27A1-FE0F": "man_with_white_cane_right_tone2",
    "1F468-1F3FD-200D-1F9AF-200D-27A1-FE0F": "man_with_white_cane_right_tone3",
    "1F468-1F3FE-200D-1F9AF-200D-27A1-FE0F": "man_with_white_cane_right_tone4",
    "1F468-1F3FF-200D-1F9AF-200D-27A1-FE0F": "man_with_white_cane_right_tone5",
    "1F468-200D-1F9BC": "man_in_motorized_wheelchair",
    "1F468-1F3FB-200D-1F9BC": "man_in_motorized_wheelchair_tone1",
    "1F468-1F3FC-200D-1F9BC": "man_in_motorized_wheelchair_tone2",
    "1F468-1F3FD-200D-1F9BC": "man_in_motorized_wheelchair_tone3",
    "1F468-1F3FE-200D-1F9BC": "man_in_motorized_wheelchair_tone4",
    "1F468-1F3FF-200D-1F9BC": "man_in_motorized_wheelchair_tone5",
    "1F468-200D-1F9BC-200D-27A1-FE0F": "man_in_motorized_wheelchair_right",
    "1F468-1F3FB-200D-1F9BC-200D-27A1-FE0F": "man_in_motorized_wheelchair_right_tone1",
    "1F468-1F3FC-200D-1F9BC-200D-27A1-FE0F": "man_in_motorized_wheelchair_right_tone2",
    "1F468-1F3FD-200D-1F9BC-200D-27A1-FE0F": "man_in_motorized_wheelchair_right_tone3",
    "1F468-1F3FE-200D-1F9BC-200D-27A1-FE0F": "man_in_motorized_wheelchair_right_tone4",
    "1F468-1F3FF-200D-1F9BC-200D-27A1-FE0F": "man_in_motorized_wheelchair_right_tone5",
    "1F468-200D-1F9BD": "man_in_manual_wheelchair",
    "1F468-1F3FB-200D-1F9BD": "man_in_manual_wheelchair_tone1",
    "1F468-1F3FC-200D-1F9BD": "man_in_manual_wheelchair_tone2",
    "1F468-1F3FD-200D-1F9BD": "man_in_manual_wheelchair_tone3",
    "1F468-1F3FE-200D-1F9BD": "man_in_manual_wheelchair_tone4",
    "1F468-1F3FF-200D-1F9BD": "man_in_manual_wheelchair_tone5",
    "1F468-200D-1F9BD-200D-27A1-FE0F": "man_in_manual_wheelchair_right",
    "1F468-1F3FB-200D-1F9BD-200D-27A1-FE0F": "man_in_manual_wheelchair_right_tone1",
    "1F468-1F3FC-200D-1F9BD-200D-27A1-FE0F": "man_in_manual_wheelchair_right_tone2",
    "1F468-1F3FD-200D-1F9BD-200D-27A1-FE0F": "man_in_manual_wheelchair_right_tone3",
    "1F468-1F3FE-200D-1F9BD-200D-27A1-FE0F": "man_in_manual_wheelchair_right_tone4",
    "1F468-1F3FF-200D-1F9BD-200D-27A1-FE0F": "man_in_manual_wheelchair_right_tone5",
    "1F469-200D-2695-FE0F": "woman_health_worker",
    "1F469-1F3FB-200D-2695-FE0F": "woman_health_worker_tone1",
    "1F469-1F3FC-200D-2695-FE0F": "woman_health_worker_tone2",
    "1F469-1F3FD-200D-2695-FE0F": "woman_health_worker_tone3",
    "1F469-1F3FE-200D-2695-FE0F": "woman_health_worker_tone4",
    "1F469-1F3FF-200D-2695-FE0F": "woman_health_worker_tone5",
    "1F469-200D-2696-FE0F": "woman_judge",
    "1F469-1F3FB-200D-2696-FE0F": "woman_judge_tone1",
    "1F469-1F3FC-200D-2696-FE0F": "woman_judge_tone2",
    "1F469-1F3FD-200D-2696-FE0F": "woman_judge_tone3",
    "1F469-1F3FE-200D-2696-FE0F": "woman_judge_tone4",
    "1F469-1F3FF-200D-2696-FE0F": "woman_judge_tone5",
    "1F469-200D-2708-FE0F": "woman_pilot",
    "1F469-1F3FB-200D-2708-FE0F": "woman_pilot_tone1",
    "1F469-1F3FC-200D-2708-FE0F": "woman_pilot_tone2",
    "1F469-1F3FD-200D-2708-FE0F": "woman_pilot_tone3",
    "1F469-1F3FE-200D-2708-FE0F": "woman_pilot_tone4",
    "1F469-1F3FF-200D-2708-FE0F": "woman_pilot_tone5",
    "1F469-200D-1F33E": "woman_farmer",
    "1F469-1F3FB-200D-1F33E": "woman_farmer_tone1",
    "1F469-1F3FC-200D-1F33E": "woman_farmer_tone2",
    "1F469-1F3FD-200D-1F33E": "woman_farmer_tone3",
    "1F469-1F3FE-200D-1F33E": "woman_farmer_tone4",
    "1F469-1F3FF-200D-1F33E": "woman_farmer_tone5",
    "1F469-200D-1F373": "woman_cook",
    "1F469-1F3FB-200D-1F373": "woman_cook_tone1",
    "1F469-1F3FC-200D-1F373": "woman_cook_tone2",
    "1F469-1F3FD-200D-1F373": "woman_cook_tone3",
    "1F469-1F3FE-200D-1F373": "woman_cook_tone4",
    "1F469-1F3FF-200D-1F373": "woman_cook_tone5",
    "1F469-200D-1F37C": "woman_feeding_baby",
    "1F469-1F3FB-200D-1F37C": "woman_feeding_baby_tone1",
    "1F469-1F3FC-200D-1F37C": "woman_feeding_baby_tone2",
    "1F469-1F3FD-200D-1F37C": "woman_feeding_baby_tone3",
    "1F469-1F3FE-200D-1F37C": "woman_feeding_baby_tone4",
    "1F469-1F3FF-200D-1F37C": "woman_feeding_baby_tone5",
    "1F469-200D-1F393": "woman_student",
    "1F469-1F3FB-200D-1F393": "woman_student_tone1",
    "1F469-1F3FC-200D-1F393": "woman_student_tone2",
    "1F469-1F3FD-200D-1F393": "woman_student_tone3",
    "1F469-1F3FE-200D-1F393": "woman_student_tone4",
    "1F469-1F3FF-200D-1F393": "woman_student_tone5",
    "1F469-200D-1F3A4": "woman_singer",
    "1F469-1F3FB-200D-1F3A4": "woman_singer_tone1",
    "1F469-1F3FC-200D-1F3A4": "woman_singer_tone2",
    "1F469-1F3FD-200D-1F3A4": "woman_singer_tone3",
    "1F469-1F3FE-200D-1F3A4": "woman_singer_tone4",
    "1F469-1F3FF-200D-1F3A4": "woman_singer_tone5",
    "1F469-200D-1F3A8": "woman_artist",
    "1F469-1F3FB-200D-1F3A8": "woman_artist_tone1",
    "1F469-1F3FC-200D-1F3A8": "woman_artist_tone2",
    "1F469-1F3FD-200D-1F3A8": "woman_artist_tone3",
    "1F469-1F3FE-200D-1F3A8": "woman_artist_tone4",
    "1F469-1F3FF-200D-1F3A8": "woman_artist_tone5",
    "1F469-200D-1F3EB": "woman_teacher",
    "1F469-1F3FB-200D-1F3EB": "woman_teacher_tone1",
    "1F469-1F3FC-200D-1F3EB": "woman_teacher_tone2",
    "1F469-1F3FD-200D-1F3EB": "woman_teacher_tone3",
    "1F469-1F3FE-200D-1F3EB": "woman_teacher_tone4",
    "1F469-1F3FF-200D-1F3EB": "woman_teacher_tone5",
    "1F469-200D-1F3ED": "woman_factory_worker",
    "1F469-1F3FB-200D-1F3ED": "woman_factory_worker_tone1",
    "1F469-1F3FC-200D-1F3ED": "woman_factory_worker_tone2",
    "1F469-1F3FD-200D-1F3ED": "woman_factory_worker_tone3",
    "1F469-1F3FE-200D-1F3ED": "woman_factory_worker_tone4",
    "1F469-1F3FF-200D-1F3ED": "woman_factory_worker_tone5",
    "1F469-200D-1F4BB": "woman_technologist",
    "1F469-1F3FB-200D-1F4BB": "woman_technologist_tone1",
    "1F469-1F3FC-200D-1F4BB": "woman_technologist_tone2",
    "1F469-1F3FD-200D-1F4BB": "woman_technologist_tone3",
    "1F469-1F3FE-200D-1F4BB": "woman_technologist_tone4",
    "1F469-1F3FF-200D-1F4BB": "woman_technologist_tone5",
    "1F469-200D-1F4BC": "woman_office_worker",
    "1F469-1F3FB-200D-1F4BC": "woman_office_worker_tone1",
    "1F469-1F3FC-200D-1F4BC": "woman_office_worker_tone2",
    "1F469-1F3FD-200D-1F4BC": "woman_office_worker_tone3",
    "1F469-1F3FE-200D-1F4BC": "woman_office_worker_tone4",
    "1F469-1F3FF-200D-1F4BC": "woman_office_worker_tone5",
    "1F469-200D-1F527": "woman_mechanic",
    "1F469-1F3FB-200D-1F527": "woman_mechanic_tone1",
    "1F469-1F3FC-200D-1F527": "woman_mechanic_tone2",
    "1F469-1F3FD-200D-1F527": "woman_mechanic_tone3",
    "1F469-1F3FE-200D-1F527": "woman_mechanic_tone4",
    "1F469-1F3FF-200D-1F527": "woman_mechanic_tone5",
    "1F469-200D-1F52C": "woman_scientist",
    "1F469-1F3FB-200D-1F52C": "woman_scientist_tone1",
    "1F469-1F3FC-200D-1F52C": "woman_scientist_tone2",
    "1F469-1F3FD-200D-1F52C": "woman_scientist_tone3",
    "1F469-1F3FE-200D-1F52C": "woman_scientist_tone4",
    "1F469-1F3FF-200D-1F52C": "woman_scientist_tone5",
    "1F469-200D-1F680": "woman_astronaut",
    "1F469-1F3FB-200D-1F680": "woman_astronaut_tone1",
    "1F469-1F3FC-200D-1F680": "woman_astronaut_tone2",
    "1F469-1F3FD-200D-1F680": "woman_astronaut_tone3",
    "1F469-1F3FE-200D-1F680": "woman_astronaut_tone4",
    "1F469-1F3FF-200D-1F680": "woman_astronaut_tone5",
    "1F469-200D-1F692": "woman_firefighter",
    "1F469-1F3FB-200D-1F692": "woman_firefighter_tone1",
    "1F469-1F3FC-200D-1F692": "woman_firefighter_tone2",
    "1F469-1F3FD-200D-1F692": "woman_firefighter_tone3",
    "1F469-1F3FE-200D-1F692": "woman_firefighter_tone4",
    "1F469-1F3FF-200D-1F692": "woman_firefighter_tone5",
    "1F469-200D-1F9AF": [
      "woman_with_probing_cane",
      "woman_with_white_cane"
    ],
    "1F469-1F3FB-200D-1F9AF": [
      "woman_with_probing_cane_tone1",
      "woman_with_white_cane_tone1"
    ],
    "1F469-1F3FC-200D-1F9AF": [
      "woman_with_probing_cane_tone2",
      "woman_with_white_cane_tone2"
    ],
    "1F469-1F3FD-200D-1F9AF": [
      "woman_with_probing_cane_tone3",
      "woman_with_white_cane_tone3"
    ],
    "1F469-1F3FE-200D-1F9AF": [
      "woman_with_probing_cane_tone4",
      "woman_with_white_cane_tone4"
    ],
    "1F469-1F3FF-200D-1F9AF": [
      "woman_with_probing_cane_tone5",
      "woman_with_white_cane_tone5"
    ],
    "1F469-200D-1F9AF-200D-27A1-FE0F": "woman_with_white_cane_right",
    "1F469-1F3FB-200D-1F9AF-200D-27A1-FE0F": "woman_with_white_cane_right_tone1",
    "1F469-1F3FC-200D-1F9AF-200D-27A1-FE0F": "woman_with_white_cane_right_tone2",
    "1F469-1F3FD-200D-1F9AF-200D-27A1-FE0F": "woman_with_white_cane_right_tone3",
    "1F469-1F3FE-200D-1F9AF-200D-27A1-FE0F": "woman_with_white_cane_right_tone4",
    "1F469-1F3FF-200D-1F9AF-200D-27A1-FE0F": "woman_with_white_cane_right_tone5",
    "1F469-200D-1F9BC": "woman_in_motorized_wheelchair",
    "1F469-1F3FB-200D-1F9BC": "woman_in_motorized_wheelchair_tone1",
    "1F469-1F3FC-200D-1F9BC": "woman_in_motorized_wheelchair_tone2",
    "1F469-1F3FD-200D-1F9BC": "woman_in_motorized_wheelchair_tone3",
    "1F469-1F3FE-200D-1F9BC": "woman_in_motorized_wheelchair_tone4",
    "1F469-1F3FF-200D-1F9BC": "woman_in_motorized_wheelchair_tone5",
    "1F469-200D-1F9BC-200D-27A1-FE0F": "woman_in_motorized_wheelchair_right",
    "1F469-1F3FB-200D-1F9BC-200D-27A1-FE0F": "woman_in_motorized_wheelchair_right_tone1",
    "1F469-1F3FC-200D-1F9BC-200D-27A1-FE0F": "woman_in_motorized_wheelchair_right_tone2",
    "1F469-1F3FD-200D-1F9BC-200D-27A1-FE0F": "woman_in_motorized_wheelchair_right_tone3",
    "1F469-1F3FE-200D-1F9BC-200D-27A1-FE0F": "woman_in_motorized_wheelchair_right_tone4",
    "1F469-1F3FF-200D-1F9BC-200D-27A1-FE0F": "woman_in_motorized_wheelchair_right_tone5",
    "1F469-200D-1F9BD": "woman_in_manual_wheelchair",
    "1F469-1F3FB-200D-1F9BD": "woman_in_manual_wheelchair_tone1",
    "1F469-1F3FC-200D-1F9BD": "woman_in_manual_wheelchair_tone2",
    "1F469-1F3FD-200D-1F9BD": "woman_in_manual_wheelchair_tone3",
    "1F469-1F3FE-200D-1F9BD": "woman_in_manual_wheelchair_tone4",
    "1F469-1F3FF-200D-1F9BD": "woman_in_manual_wheelchair_tone5",
    "1F469-200D-1F9BD-200D-27A1-FE0F": "woman_in_manual_wheelchair_right",
    "1F469-1F3FB-200D-1F9BD-200D-27A1-FE0F": "woman_in_manual_wheelchair_right_tone1",
    "1F469-1F3FC-200D-1F9BD-200D-27A1-FE0F": "woman_in_manual_wheelchair_right_tone2",
    "1F469-1F3FD-200D-1F9BD-200D-27A1-FE0F": "woman_in_manual_wheelchair_right_tone3",
    "1F469-1F3FE-200D-1F9BD-200D-27A1-FE0F": "woman_in_manual_wheelchair_right_tone4",
    "1F469-1F3FF-200D-1F9BD-200D-27A1-FE0F": "woman_in_manual_wheelchair_right_tone5",
    "1F6B6-200D-27A1-FE0F": "person_walking_right",
    "1F6B6-1F3FB-200D-27A1-FE0F": "person_walking_right_tone1",
    "1F6B6-1F3FC-200D-27A1-FE0F": "person_walking_right_tone2",
    "1F6B6-1F3FD-200D-27A1-FE0F": "person_walking_right_tone3",
    "1F6B6-1F3FE-200D-27A1-FE0F": "person_walking_right_tone4",
    "1F6B6-1F3FF-200D-27A1-FE0F": "person_walking_right_tone5",
    "1F9CE-200D-27A1-FE0F": "person_kneeling_right",
    "1F9CE-1F3FB-200D-27A1-FE0F": "person_kneeling_right_tone1",
    "1F9CE-1F3FC-200D-27A1-FE0F": "person_kneeling_right_tone2",
    "1F9CE-1F3FD-200D-27A1-FE0F": "person_kneeling_right_tone3",
    "1F9CE-1F3FE-200D-27A1-FE0F": "person_kneeling_right_tone4",
    "1F9CE-1F3FF-200D-27A1-FE0F": "person_kneeling_right_tone5",
    "1F9D1-200D-2695-FE0F": "health_worker",
    "1F9D1-1F3FB-200D-2695-FE0F": "health_worker_tone1",
    "1F9D1-1F3FC-200D-2695-FE0F": "health_worker_tone2",
    "1F9D1-1F3FD-200D-2695-FE0F": "health_worker_tone3",
    "1F9D1-1F3FE-200D-2695-FE0F": "health_worker_tone4",
    "1F9D1-1F3FF-200D-2695-FE0F": "health_worker_tone5",
    "1F9D1-200D-2696-FE0F": "judge",
    "1F9D1-1F3FB-200D-2696-FE0F": "judge_tone1",
    "1F9D1-1F3FC-200D-2696-FE0F": "judge_tone2",
    "1F9D1-1F3FD-200D-2696-FE0F": "judge_tone3",
    "1F9D1-1F3FE-200D-2696-FE0F": "judge_tone4",
    "1F9D1-1F3FF-200D-2696-FE0F": "judge_tone5",
    "1F9D1-200D-2708-FE0F": "pilot",
    "1F9D1-1F3FB-200D-2708-FE0F": "pilot_tone1",
    "1F9D1-1F3FC-200D-2708-FE0F": "pilot_tone2",
    "1F9D1-1F3FD-200D-2708-FE0F": "pilot_tone3",
    "1F9D1-1F3FE-200D-2708-FE0F": "pilot_tone4",
    "1F9D1-1F3FF-200D-2708-FE0F": "pilot_tone5",
    "1F9D1-200D-1F33E": "farmer",
    "1F9D1-1F3FB-200D-1F33E": "farmer_tone1",
    "1F9D1-1F3FC-200D-1F33E": "farmer_tone2",
    "1F9D1-1F3FD-200D-1F33E": "farmer_tone3",
    "1F9D1-1F3FE-200D-1F33E": "farmer_tone4",
    "1F9D1-1F3FF-200D-1F33E": "farmer_tone5",
    "1F9D1-200D-1F373": "cook",
    "1F9D1-1F3FB-200D-1F373": "cook_tone1",
    "1F9D1-1F3FC-200D-1F373": "cook_tone2",
    "1F9D1-1F3FD-200D-1F373": "cook_tone3",
    "1F9D1-1F3FE-200D-1F373": "cook_tone4",
    "1F9D1-1F3FF-200D-1F373": "cook_tone5",
    "1F9D1-200D-1F37C": "person_feeding_baby",
    "1F9D1-1F3FB-200D-1F37C": "person_feeding_baby_tone1",
    "1F9D1-1F3FC-200D-1F37C": "person_feeding_baby_tone2",
    "1F9D1-1F3FD-200D-1F37C": "person_feeding_baby_tone3",
    "1F9D1-1F3FE-200D-1F37C": "person_feeding_baby_tone4",
    "1F9D1-1F3FF-200D-1F37C": "person_feeding_baby_tone5",
    "1F9D1-200D-1F384": "mx_claus",
    "1F9D1-1F3FB-200D-1F384": "mx_claus_tone1",
    "1F9D1-1F3FC-200D-1F384": "mx_claus_tone2",
    "1F9D1-1F3FD-200D-1F384": "mx_claus_tone3",
    "1F9D1-1F3FE-200D-1F384": "mx_claus_tone4",
    "1F9D1-1F3FF-200D-1F384": "mx_claus_tone5",
    "1F9D1-200D-1F393": "student",
    "1F9D1-1F3FB-200D-1F393": "student_tone1",
    "1F9D1-1F3FC-200D-1F393": "student_tone2",
    "1F9D1-1F3FD-200D-1F393": "student_tone3",
    "1F9D1-1F3FE-200D-1F393": "student_tone4",
    "1F9D1-1F3FF-200D-1F393": "student_tone5",
    "1F9D1-200D-1F3A4": "singer",
    "1F9D1-1F3FB-200D-1F3A4": "singer_tone1",
    "1F9D1-1F3FC-200D-1F3A4": "singer_tone2",
    "1F9D1-1F3FD-200D-1F3A4": "singer_tone3",
    "1F9D1-1F3FE-200D-1F3A4": "singer_tone4",
    "1F9D1-1F3FF-200D-1F3A4": "singer_tone5",
    "1F9D1-200D-1F3A8": "artist",
    "1F9D1-1F3FB-200D-1F3A8": "artist_tone1",
    "1F9D1-1F3FC-200D-1F3A8": "artist_tone2",
    "1F9D1-1F3FD-200D-1F3A8": "artist_tone3",
    "1F9D1-1F3FE-200D-1F3A8": "artist_tone4",
    "1F9D1-1F3FF-200D-1F3A8": "artist_tone5",
    "1F9D1-200D-1F3EB": "teacher",
    "1F9D1-1F3FB-200D-1F3EB": "teacher_tone1",
    "1F9D1-1F3FC-200D-1F3EB": "teacher_tone2",
    "1F9D1-1F3FD-200D-1F3EB": "teacher_tone3",
    "1F9D1-1F3FE-200D-1F3EB": "teacher_tone4",
    "1F9D1-1F3FF-200D-1F3EB": "teacher_tone5",
    "1F9D1-200D-1F3ED": "factory_worker",
    "1F9D1-1F3FB-200D-1F3ED": "factory_worker_tone1",
    "1F9D1-1F3FC-200D-1F3ED": "factory_worker_tone2",
    "1F9D1-1F3FD-200D-1F3ED": "factory_worker_tone3",
    "1F9D1-1F3FE-200D-1F3ED": "factory_worker_tone4",
    "1F9D1-1F3FF-200D-1F3ED": "factory_worker_tone5",
    "1F9D1-200D-1F4BB": "technologist",
    "1F9D1-1F3FB-200D-1F4BB": "technologist_tone1",
    "1F9D1-1F3FC-200D-1F4BB": "technologist_tone2",
    "1F9D1-1F3FD-200D-1F4BB": "technologist_tone3",
    "1F9D1-1F3FE-200D-1F4BB": "technologist_tone4",
    "1F9D1-1F3FF-200D-1F4BB": "technologist_tone5",
    "1F9D1-200D-1F4BC": "office_worker",
    "1F9D1-1F3FB-200D-1F4BC": "office_worker_tone1",
    "1F9D1-1F3FC-200D-1F4BC": "office_worker_tone2",
    "1F9D1-1F3FD-200D-1F4BC": "office_worker_tone3",
    "1F9D1-1F3FE-200D-1F4BC": "office_worker_tone4",
    "1F9D1-1F3FF-200D-1F4BC": "office_worker_tone5",
    "1F9D1-200D-1F527": "mechanic",
    "1F9D1-1F3FB-200D-1F527": "mechanic_tone1",
    "1F9D1-1F3FC-200D-1F527": "mechanic_tone2",
    "1F9D1-1F3FD-200D-1F527": "mechanic_tone3",
    "1F9D1-1F3FE-200D-1F527": "mechanic_tone4",
    "1F9D1-1F3FF-200D-1F527": "mechanic_tone5",
    "1F9D1-200D-1F52C": "scientist",
    "1F9D1-1F3FB-200D-1F52C": "scientist_tone1",
    "1F9D1-1F3FC-200D-1F52C": "scientist_tone2",
    "1F9D1-1F3FD-200D-1F52C": "scientist_tone3",
    "1F9D1-1F3FE-200D-1F52C": "scientist_tone4",
    "1F9D1-1F3FF-200D-1F52C": "scientist_tone5",
    "1F9D1-200D-1F680": "astronaut",
    "1F9D1-1F3FB-200D-1F680": "astronaut_tone1",
    "1F9D1-1F3FC-200D-1F680": "astronaut_tone2",
    "1F9D1-1F3FD-200D-1F680": "astronaut_tone3",
    "1F9D1-1F3FE-200D-1F680": "astronaut_tone4",
    "1F9D1-1F3FF-200D-1F680": "astronaut_tone5",
    "1F9D1-200D-1F692": "firefighter",
    "1F9D1-1F3FB-200D-1F692": "firefighter_tone1",
    "1F9D1-1F3FC-200D-1F692": "firefighter_tone2",
    "1F9D1-1F3FD-200D-1F692": "firefighter_tone3",
    "1F9D1-1F3FE-200D-1F692": "firefighter_tone4",
    "1F9D1-1F3FF-200D-1F692": "firefighter_tone5",
    "1F9D1-200D-1F9AF": [
      "person_with_probing_cane",
      "person_with_white_cane"
    ],
    "1F9D1-1F3FB-200D-1F9AF": [
      "person_with_probing_cane_tone1",
      "person_with_white_cane_tone1"
    ],
    "1F9D1-1F3FC-200D-1F9AF": [
      "person_with_probing_cane_tone2",
      "person_with_white_cane_tone2"
    ],
    "1F9D1-1F3FD-200D-1F9AF": [
      "person_with_probing_cane_tone3",
      "person_with_white_cane_tone3"
    ],
    "1F9D1-1F3FE-200D-1F9AF": [
      "person_with_probing_cane_tone4",
      "person_with_white_cane_tone4"
    ],
    "1F9D1-1F3FF-200D-1F9AF": [
      "person_with_probing_cane_tone5",
      "person_with_white_cane_tone5"
    ],
    "1F9D1-200D-1F9AF-200D-27A1-FE0F": "person_with_white_cane_right",
    "1F9D1-1F3FB-200D-1F9AF-200D-27A1-FE0F": "person_with_white_cane_right_tone1",
    "1F9D1-1F3FC-200D-1F9AF-200D-27A1-FE0F": "person_with_white_cane_right_tone2",
    "1F9D1-1F3FD-200D-1F9AF-200D-27A1-FE0F": "person_with_white_cane_right_tone3",
    "1F9D1-1F3FE-200D-1F9AF-200D-27A1-FE0F": "person_with_white_cane_right_tone4",
    "1F9D1-1F3FF-200D-1F9AF-200D-27A1-FE0F": "person_with_white_cane_right_tone5",
    "1F9D1-200D-1F9BC": "person_in_motorized_wheelchair",
    "1F9D1-1F3FB-200D-1F9BC": "person_in_motorized_wheelchair_tone1",
    "1F9D1-1F3FC-200D-1F9BC": "person_in_motorized_wheelchair_tone2",
    "1F9D1-1F3FD-200D-1F9BC": "person_in_motorized_wheelchair_tone3",
    "1F9D1-1F3FE-200D-1F9BC": "person_in_motorized_wheelchair_tone4",
    "1F9D1-1F3FF-200D-1F9BC": "person_in_motorized_wheelchair_tone5",
    "1F9D1-200D-1F9BC-200D-27A1-FE0F": "person_in_motorized_wheelchair_right",
    "1F9D1-1F3FB-200D-1F9BC-200D-27A1-FE0F": "person_in_motorized_wheelchair_right_tone1",
    "1F9D1-1F3FC-200D-1F9BC-200D-27A1-FE0F": "person_in_motorized_wheelchair_right_tone2",
    "1F9D1-1F3FD-200D-1F9BC-200D-27A1-FE0F": "person_in_motorized_wheelchair_right_tone3",
    "1F9D1-1F3FE-200D-1F9BC-200D-27A1-FE0F": "person_in_motorized_wheelchair_right_tone4",
    "1F9D1-1F3FF-200D-1F9BC-200D-27A1-FE0F": "person_in_motorized_wheelchair_right_tone5",
    "1F9D1-200D-1F9BD": "person_in_manual_wheelchair",
    "1F9D1-1F3FB-200D-1F9BD": "person_in_manual_wheelchair_tone1",
    "1F9D1-1F3FC-200D-1F9BD": "person_in_manual_wheelchair_tone2",
    "1F9D1-1F3FD-200D-1F9BD": "person_in_manual_wheelchair_tone3",
    "1F9D1-1F3FE-200D-1F9BD": "person_in_manual_wheelchair_tone4",
    "1F9D1-1F3FF-200D-1F9BD": "person_in_manual_wheelchair_tone5",
    "1F9D1-200D-1F9BD-200D-27A1-FE0F": "person_in_manual_wheelchair_right",
    "1F9D1-1F3FB-200D-1F9BD-200D-27A1-FE0F": "person_in_manual_wheelchair_right_tone1",
    "1F9D1-1F3FC-200D-1F9BD-200D-27A1-FE0F": "person_in_manual_wheelchair_right_tone2",
    "1F9D1-1F3FD-200D-1F9BD-200D-27A1-FE0F": "person_in_manual_wheelchair_right_tone3",
    "1F9D1-1F3FE-200D-1F9BD-200D-27A1-FE0F": "person_in_manual_wheelchair_right_tone4",
    "1F9D1-1F3FF-200D-1F9BD-200D-27A1-FE0F": "person_in_manual_wheelchair_right_tone5",
    "26F9-FE0F-200D-2640-FE0F": "woman_bouncing_ball",
    "26F9-1F3FB-200D-2640-FE0F": "woman_bouncing_ball_tone1",
    "26F9-1F3FC-200D-2640-FE0F": "woman_bouncing_ball_tone2",
    "26F9-1F3FD-200D-2640-FE0F": "woman_bouncing_ball_tone3",
    "26F9-1F3FE-200D-2640-FE0F": "woman_bouncing_ball_tone4",
    "26F9-1F3FF-200D-2640-FE0F": "woman_bouncing_ball_tone5",
    "26F9-FE0F-200D-2642-FE0F": "man_bouncing_ball",
    "26F9-1F3FB-200D-2642-FE0F": "man_bouncing_ball_tone1",
    "26F9-1F3FC-200D-2642-FE0F": "man_bouncing_ball_tone2",
    "26F9-1F3FD-200D-2642-FE0F": "man_bouncing_ball_tone3",
    "26F9-1F3FE-200D-2642-FE0F": "man_bouncing_ball_tone4",
    "26F9-1F3FF-200D-2642-FE0F": "man_bouncing_ball_tone5",
    "1F3C3-200D-2640-FE0F": "woman_running",
    "1F3C3-1F3FB-200D-2640-FE0F": "woman_running_tone1",
    "1F3C3-1F3FC-200D-2640-FE0F": "woman_running_tone2",
    "1F3C3-1F3FD-200D-2640-FE0F": "woman_running_tone3",
    "1F3C3-1F3FE-200D-2640-FE0F": "woman_running_tone4",
    "1F3C3-1F3FF-200D-2640-FE0F": "woman_running_tone5",
    "1F3C3-200D-2640-FE0F-200D-27A1-FE0F": "woman_running_right",
    "1F3C3-1F3FB-200D-2640-FE0F-200D-27A1-FE0F": "woman_running_right_tone1",
    "1F3C3-1F3FC-200D-2640-FE0F-200D-27A1-FE0F": "woman_running_right_tone2",
    "1F3C3-1F3FD-200D-2640-FE0F-200D-27A1-FE0F": "woman_running_right_tone3",
    "1F3C3-1F3FE-200D-2640-FE0F-200D-27A1-FE0F": "woman_running_right_tone4",
    "1F3C3-1F3FF-200D-2640-FE0F-200D-27A1-FE0F": "woman_running_right_tone5",
    "1F3C3-200D-2642-FE0F": "man_running",
    "1F3C3-1F3FB-200D-2642-FE0F": "man_running_tone1",
    "1F3C3-1F3FC-200D-2642-FE0F": "man_running_tone2",
    "1F3C3-1F3FD-200D-2642-FE0F": "man_running_tone3",
    "1F3C3-1F3FE-200D-2642-FE0F": "man_running_tone4",
    "1F3C3-1F3FF-200D-2642-FE0F": "man_running_tone5",
    "1F3C3-200D-2642-FE0F-200D-27A1-FE0F": "man_running_right",
    "1F3C3-1F3FB-200D-2642-FE0F-200D-27A1-FE0F": "man_running_right_tone1",
    "1F3C3-1F3FC-200D-2642-FE0F-200D-27A1-FE0F": "man_running_right_tone2",
    "1F3C3-1F3FD-200D-2642-FE0F-200D-27A1-FE0F": "man_running_right_tone3",
    "1F3C3-1F3FE-200D-2642-FE0F-200D-27A1-FE0F": "man_running_right_tone4",
    "1F3C3-1F3FF-200D-2642-FE0F-200D-27A1-FE0F": "man_running_right_tone5",
    "1F3C4-200D-2640-FE0F": "woman_surfing",
    "1F3C4-1F3FB-200D-2640-FE0F": "woman_surfing_tone1",
    "1F3C4-1F3FC-200D-2640-FE0F": "woman_surfing_tone2",
    "1F3C4-1F3FD-200D-2640-FE0F": "woman_surfing_tone3",
    "1F3C4-1F3FE-200D-2640-FE0F": "woman_surfing_tone4",
    "1F3C4-1F3FF-200D-2640-FE0F": "woman_surfing_tone5",
    "1F3C4-200D-2642-FE0F": "man_surfing",
    "1F3C4-1F3FB-200D-2642-FE0F": "man_surfing_tone1",
    "1F3C4-1F3FC-200D-2642-FE0F": "man_surfing_tone2",
    "1F3C4-1F3FD-200D-2642-FE0F": "man_surfing_tone3",
    "1F3C4-1F3FE-200D-2642-FE0F": "man_surfing_tone4",
    "1F3C4-1F3FF-200D-2642-FE0F": "man_surfing_tone5",
    "1F3CA-200D-2640-FE0F": "woman_swimming",
    "1F3CA-1F3FB-200D-2640-FE0F": "woman_swimming_tone1",
    "1F3CA-1F3FC-200D-2640-FE0F": "woman_swimming_tone2",
    "1F3CA-1F3FD-200D-2640-FE0F": "woman_swimming_tone3",
    "1F3CA-1F3FE-200D-2640-FE0F": "woman_swimming_tone4",
    "1F3CA-1F3FF-200D-2640-FE0F": "woman_swimming_tone5",
    "1F3CA-200D-2642-FE0F": "man_swimming",
    "1F3CA-1F3FB-200D-2642-FE0F": "man_swimming_tone1",
    "1F3CA-1F3FC-200D-2642-FE0F": "man_swimming_tone2",
    "1F3CA-1F3FD-200D-2642-FE0F": "man_swimming_tone3",
    "1F3CA-1F3FE-200D-2642-FE0F": "man_swimming_tone4",
    "1F3CA-1F3FF-200D-2642-FE0F": "man_swimming_tone5",
    "1F3CB-FE0F-200D-2640-FE0F": "woman_lifting_weights",
    "1F3CB-1F3FB-200D-2640-FE0F": "woman_lifting_weights_tone1",
    "1F3CB-1F3FC-200D-2640-FE0F": "woman_lifting_weights_tone2",
    "1F3CB-1F3FD-200D-2640-FE0F": "woman_lifting_weights_tone3",
    "1F3CB-1F3FE-200D-2640-FE0F": "woman_lifting_weights_tone4",
    "1F3CB-1F3FF-200D-2640-FE0F": "woman_lifting_weights_tone5",
    "1F3CB-FE0F-200D-2642-FE0F": "man_lifting_weights",
    "1F3CB-1F3FB-200D-2642-FE0F": "man_lifting_weights_tone1",
    "1F3CB-1F3FC-200D-2642-FE0F": "man_lifting_weights_tone2",
    "1F3CB-1F3FD-200D-2642-FE0F": "man_lifting_weights_tone3",
    "1F3CB-1F3FE-200D-2642-FE0F": "man_lifting_weights_tone4",
    "1F3CB-1F3FF-200D-2642-FE0F": "man_lifting_weights_tone5",
    "1F3CC-FE0F-200D-2640-FE0F": "woman_golfing",
    "1F3CC-1F3FB-200D-2640-FE0F": "woman_golfing_tone1",
    "1F3CC-1F3FC-200D-2640-FE0F": "woman_golfing_tone2",
    "1F3CC-1F3FD-200D-2640-FE0F": "woman_golfing_tone3",
    "1F3CC-1F3FE-200D-2640-FE0F": "woman_golfing_tone4",
    "1F3CC-1F3FF-200D-2640-FE0F": "woman_golfing_tone5",
    "1F3CC-FE0F-200D-2642-FE0F": "man_golfing",
    "1F3CC-1F3FB-200D-2642-FE0F": "man_golfing_tone1",
    "1F3CC-1F3FC-200D-2642-FE0F": "man_golfing_tone2",
    "1F3CC-1F3FD-200D-2642-FE0F": "man_golfing_tone3",
    "1F3CC-1F3FE-200D-2642-FE0F": "man_golfing_tone4",
    "1F3CC-1F3FF-200D-2642-FE0F": "man_golfing_tone5",
    "1F46E-200D-2640-FE0F": "woman_police_officer",
    "1F46E-1F3FB-200D-2640-FE0F": "woman_police_officer_tone1",
    "1F46E-1F3FC-200D-2640-FE0F": "woman_police_officer_tone2",
    "1F46E-1F3FD-200D-2640-FE0F": "woman_police_officer_tone3",
    "1F46E-1F3FE-200D-2640-FE0F": "woman_police_officer_tone4",
    "1F46E-1F3FF-200D-2640-FE0F": "woman_police_officer_tone5",
    "1F46E-200D-2642-FE0F": "man_police_officer",
    "1F46E-1F3FB-200D-2642-FE0F": "man_police_officer_tone1",
    "1F46E-1F3FC-200D-2642-FE0F": "man_police_officer_tone2",
    "1F46E-1F3FD-200D-2642-FE0F": "man_police_officer_tone3",
    "1F46E-1F3FE-200D-2642-FE0F": "man_police_officer_tone4",
    "1F46E-1F3FF-200D-2642-FE0F": "man_police_officer_tone5",
    "1F46F-200D-2640-FE0F": "women_with_bunny_ears_partying",
    "1F46F-200D-2642-FE0F": "men_with_bunny_ears_partying",
    "1F470-200D-2640-FE0F": "woman_with_veil",
    "1F470-1F3FB-200D-2640-FE0F": "woman_with_veil_tone1",
    "1F470-1F3FC-200D-2640-FE0F": "woman_with_veil_tone2",
    "1F470-1F3FD-200D-2640-FE0F": "woman_with_veil_tone3",
    "1F470-1F3FE-200D-2640-FE0F": "woman_with_veil_tone4",
    "1F470-1F3FF-200D-2640-FE0F": "woman_with_veil_tone5",
    "1F470-200D-2642-FE0F": "man_with_veil",
    "1F470-1F3FB-200D-2642-FE0F": "man_with_veil_tone1",
    "1F470-1F3FC-200D-2642-FE0F": "man_with_veil_tone2",
    "1F470-1F3FD-200D-2642-FE0F": "man_with_veil_tone3",
    "1F470-1F3FE-200D-2642-FE0F": "man_with_veil_tone4",
    "1F470-1F3FF-200D-2642-FE0F": "man_with_veil_tone5",
    "1F471-200D-2640-FE0F": "woman_blond_haired",
    "1F471-1F3FB-200D-2640-FE0F": "woman_blond_haired_tone1",
    "1F471-1F3FC-200D-2640-FE0F": "woman_blond_haired_tone2",
    "1F471-1F3FD-200D-2640-FE0F": "woman_blond_haired_tone3",
    "1F471-1F3FE-200D-2640-FE0F": "woman_blond_haired_tone4",
    "1F471-1F3FF-200D-2640-FE0F": "woman_blond_haired_tone5",
    "1F471-200D-2642-FE0F": "man_blond_haired",
    "1F471-1F3FB-200D-2642-FE0F": "man_blond_haired_tone1",
    "1F471-1F3FC-200D-2642-FE0F": "man_blond_haired_tone2",
    "1F471-1F3FD-200D-2642-FE0F": "man_blond_haired_tone3",
    "1F471-1F3FE-200D-2642-FE0F": "man_blond_haired_tone4",
    "1F471-1F3FF-200D-2642-FE0F": "man_blond_haired_tone5",
    "1F473-200D-2640-FE0F": "woman_wearing_turban",
    "1F473-1F3FB-200D-2640-FE0F": "woman_wearing_turban_tone1",
    "1F473-1F3FC-200D-2640-FE0F": "woman_wearing_turban_tone2",
    "1F473-1F3FD-200D-2640-FE0F": "woman_wearing_turban_tone3",
    "1F473-1F3FE-200D-2640-FE0F": "woman_wearing_turban_tone4",
    "1F473-1F3FF-200D-2640-FE0F": "woman_wearing_turban_tone5",
    "1F473-200D-2642-FE0F": "man_wearing_turban",
    "1F473-1F3FB-200D-2642-FE0F": "man_wearing_turban_tone1",
    "1F473-1F3FC-200D-2642-FE0F": "man_wearing_turban_tone2",
    "1F473-1F3FD-200D-2642-FE0F": "man_wearing_turban_tone3",
    "1F473-1F3FE-200D-2642-FE0F": "man_wearing_turban_tone4",
    "1F473-1F3FF-200D-2642-FE0F": "man_wearing_turban_tone5",
    "1F477-200D-2640-FE0F": "woman_construction_worker",
    "1F477-1F3FB-200D-2640-FE0F": "woman_construction_worker_tone1",
    "1F477-1F3FC-200D-2640-FE0F": "woman_construction_worker_tone2",
    "1F477-1F3FD-200D-2640-FE0F": "woman_construction_worker_tone3",
    "1F477-1F3FE-200D-2640-FE0F": "woman_construction_worker_tone4",
    "1F477-1F3FF-200D-2640-FE0F": "woman_construction_worker_tone5",
    "1F477-200D-2642-FE0F": "man_construction_worker",
    "1F477-1F3FB-200D-2642-FE0F": "man_construction_worker_tone1",
    "1F477-1F3FC-200D-2642-FE0F": "man_construction_worker_tone2",
    "1F477-1F3FD-200D-2642-FE0F": "man_construction_worker_tone3",
    "1F477-1F3FE-200D-2642-FE0F": "man_construction_worker_tone4",
    "1F477-1F3FF-200D-2642-FE0F": "man_construction_worker_tone5",
    "1F481-200D-2640-FE0F": "woman_tipping_hand",
    "1F481-1F3FB-200D-2640-FE0F": "woman_tipping_hand_tone1",
    "1F481-1F3FC-200D-2640-FE0F": "woman_tipping_hand_tone2",
    "1F481-1F3FD-200D-2640-FE0F": "woman_tipping_hand_tone3",
    "1F481-1F3FE-200D-2640-FE0F": "woman_tipping_hand_tone4",
    "1F481-1F3FF-200D-2640-FE0F": "woman_tipping_hand_tone5",
    "1F481-200D-2642-FE0F": "man_tipping_hand",
    "1F481-1F3FB-200D-2642-FE0F": "man_tipping_hand_tone1",
    "1F481-1F3FC-200D-2642-FE0F": "man_tipping_hand_tone2",
    "1F481-1F3FD-200D-2642-FE0F": "man_tipping_hand_tone3",
    "1F481-1F3FE-200D-2642-FE0F": "man_tipping_hand_tone4",
    "1F481-1F3FF-200D-2642-FE0F": "man_tipping_hand_tone5",
    "1F482-200D-2640-FE0F": "woman_guard",
    "1F482-1F3FB-200D-2640-FE0F": "woman_guard_tone1",
    "1F482-1F3FC-200D-2640-FE0F": "woman_guard_tone2",
    "1F482-1F3FD-200D-2640-FE0F": "woman_guard_tone3",
    "1F482-1F3FE-200D-2640-FE0F": "woman_guard_tone4",
    "1F482-1F3FF-200D-2640-FE0F": "woman_guard_tone5",
    "1F482-200D-2642-FE0F": "man_guard",
    "1F482-1F3FB-200D-2642-FE0F": "man_guard_tone1",
    "1F482-1F3FC-200D-2642-FE0F": "man_guard_tone2",
    "1F482-1F3FD-200D-2642-FE0F": "man_guard_tone3",
    "1F482-1F3FE-200D-2642-FE0F": "man_guard_tone4",
    "1F482-1F3FF-200D-2642-FE0F": "man_guard_tone5",
    "1F486-200D-2640-FE0F": "woman_getting_massage",
    "1F486-1F3FB-200D-2640-FE0F": "woman_getting_massage_tone1",
    "1F486-1F3FC-200D-2640-FE0F": "woman_getting_massage_tone2",
    "1F486-1F3FD-200D-2640-FE0F": "woman_getting_massage_tone3",
    "1F486-1F3FE-200D-2640-FE0F": "woman_getting_massage_tone4",
    "1F486-1F3FF-200D-2640-FE0F": "woman_getting_massage_tone5",
    "1F486-200D-2642-FE0F": "man_getting_massage",
    "1F486-1F3FB-200D-2642-FE0F": "man_getting_massage_tone1",
    "1F486-1F3FC-200D-2642-FE0F": "man_getting_massage_tone2",
    "1F486-1F3FD-200D-2642-FE0F": "man_getting_massage_tone3",
    "1F486-1F3FE-200D-2642-FE0F": "man_getting_massage_tone4",
    "1F486-1F3FF-200D-2642-FE0F": "man_getting_massage_tone5",
    "1F487-200D-2640-FE0F": "woman_getting_haircut",
    "1F487-1F3FB-200D-2640-FE0F": "woman_getting_haircut_tone1",
    "1F487-1F3FC-200D-2640-FE0F": "woman_getting_haircut_tone2",
    "1F487-1F3FD-200D-2640-FE0F": "woman_getting_haircut_tone3",
    "1F487-1F3FE-200D-2640-FE0F": "woman_getting_haircut_tone4",
    "1F487-1F3FF-200D-2640-FE0F": "woman_getting_haircut_tone5",
    "1F487-200D-2642-FE0F": "man_getting_haircut",
    "1F487-1F3FB-200D-2642-FE0F": "man_getting_haircut_tone1",
    "1F487-1F3FC-200D-2642-FE0F": "man_getting_haircut_tone2",
    "1F487-1F3FD-200D-2642-FE0F": "man_getting_haircut_tone3",
    "1F487-1F3FE-200D-2642-FE0F": "man_getting_haircut_tone4",
    "1F487-1F3FF-200D-2642-FE0F": "man_getting_haircut_tone5",
    "1F575-FE0F-200D-2640-FE0F": "woman_detective",
    "1F575-1F3FB-200D-2640-FE0F": "woman_detective_tone1",
    "1F575-1F3FC-200D-2640-FE0F": "woman_detective_tone2",
    "1F575-1F3FD-200D-2640-FE0F": "woman_detective_tone3",
    "1F575-1F3FE-200D-2640-FE0F": "woman_detective_tone4",
    "1F575-1F3FF-200D-2640-FE0F": "woman_detective_tone5",
    "1F575-FE0F-200D-2642-FE0F": "man_detective",
    "1F575-1F3FB-200D-2642-FE0F": "man_detective_tone1",
    "1F575-1F3FC-200D-2642-FE0F": "man_detective_tone2",
    "1F575-1F3FD-200D-2642-FE0F": "man_detective_tone3",
    "1F575-1F3FE-200D-2642-FE0F": "man_detective_tone4",
    "1F575-1F3FF-200D-2642-FE0F": "man_detective_tone5",
    "1F645-200D-2640-FE0F": "woman_gesturing_no",
    "1F645-1F3FB-200D-2640-FE0F": "woman_gesturing_no_tone1",
    "1F645-1F3FC-200D-2640-FE0F": "woman_gesturing_no_tone2",
    "1F645-1F3FD-200D-2640-FE0F": "woman_gesturing_no_tone3",
    "1F645-1F3FE-200D-2640-FE0F": "woman_gesturing_no_tone4",
    "1F645-1F3FF-200D-2640-FE0F": "woman_gesturing_no_tone5",
    "1F645-200D-2642-FE0F": "man_gesturing_no",
    "1F645-1F3FB-200D-2642-FE0F": "man_gesturing_no_tone1",
    "1F645-1F3FC-200D-2642-FE0F": "man_gesturing_no_tone2",
    "1F645-1F3FD-200D-2642-FE0F": "man_gesturing_no_tone3",
    "1F645-1F3FE-200D-2642-FE0F": "man_gesturing_no_tone4",
    "1F645-1F3FF-200D-2642-FE0F": "man_gesturing_no_tone5",
    "1F646-200D-2640-FE0F": "woman_gesturing_ok",
    "1F646-1F3FB-200D-2640-FE0F": "woman_gesturing_ok_tone1",
    "1F646-1F3FC-200D-2640-FE0F": "woman_gesturing_ok_tone2",
    "1F646-1F3FD-200D-2640-FE0F": "woman_gesturing_ok_tone3",
    "1F646-1F3FE-200D-2640-FE0F": "woman_gesturing_ok_tone4",
    "1F646-1F3FF-200D-2640-FE0F": "woman_gesturing_ok_tone5",
    "1F646-200D-2642-FE0F": "man_gesturing_ok",
    "1F646-1F3FB-200D-2642-FE0F": "man_gesturing_ok_tone1",
    "1F646-1F3FC-200D-2642-FE0F": "man_gesturing_ok_tone2",
    "1F646-1F3FD-200D-2642-FE0F": "man_gesturing_ok_tone3",
    "1F646-1F3FE-200D-2642-FE0F": "man_gesturing_ok_tone4",
    "1F646-1F3FF-200D-2642-FE0F": "man_gesturing_ok_tone5",
    "1F647-200D-2640-FE0F": "woman_bowing",
    "1F647-1F3FB-200D-2640-FE0F": "woman_bowing_tone1",
    "1F647-1F3FC-200D-2640-FE0F": "woman_bowing_tone2",
    "1F647-1F3FD-200D-2640-FE0F": "woman_bowing_tone3",
    "1F647-1F3FE-200D-2640-FE0F": "woman_bowing_tone4",
    "1F647-1F3FF-200D-2640-FE0F": "woman_bowing_tone5",
    "1F647-200D-2642-FE0F": "man_bowing",
    "1F647-1F3FB-200D-2642-FE0F": "man_bowing_tone1",
    "1F647-1F3FC-200D-2642-FE0F": "man_bowing_tone2",
    "1F647-1F3FD-200D-2642-FE0F": "man_bowing_tone3",
    "1F647-1F3FE-200D-2642-FE0F": "man_bowing_tone4",
    "1F647-1F3FF-200D-2642-FE0F": "man_bowing_tone5",
    "1F64B-200D-2640-FE0F": "woman_raising_hand",
    "1F64B-1F3FB-200D-2640-FE0F": "woman_raising_hand_tone1",
    "1F64B-1F3FC-200D-2640-FE0F": "woman_raising_hand_tone2",
    "1F64B-1F3FD-200D-2640-FE0F": "woman_raising_hand_tone3",
    "1F64B-1F3FE-200D-2640-FE0F": "woman_raising_hand_tone4",
    "1F64B-1F3FF-200D-2640-FE0F": "woman_raising_hand_tone5",
    "1F64B-200D-2642-FE0F": "man_raising_hand",
    "1F64B-1F3FB-200D-2642-FE0F": "man_raising_hand_tone1",
    "1F64B-1F3FC-200D-2642-FE0F": "man_raising_hand_tone2",
    "1F64B-1F3FD-200D-2642-FE0F": "man_raising_hand_tone3",
    "1F64B-1F3FE-200D-2642-FE0F": "man_raising_hand_tone4",
    "1F64B-1F3FF-200D-2642-FE0F": "man_raising_hand_tone5",
    "1F64D-200D-2640-FE0F": "woman_frowning",
    "1F64D-1F3FB-200D-2640-FE0F": "woman_frowning_tone1",
    "1F64D-1F3FC-200D-2640-FE0F": "woman_frowning_tone2",
    "1F64D-1F3FD-200D-2640-FE0F": "woman_frowning_tone3",
    "1F64D-1F3FE-200D-2640-FE0F": "woman_frowning_tone4",
    "1F64D-1F3FF-200D-2640-FE0F": "woman_frowning_tone5",
    "1F64D-200D-2642-FE0F": "man_frowning",
    "1F64D-1F3FB-200D-2642-FE0F": "man_frowning_tone1",
    "1F64D-1F3FC-200D-2642-FE0F": "man_frowning_tone2",
    "1F64D-1F3FD-200D-2642-FE0F": "man_frowning_tone3",
    "1F64D-1F3FE-200D-2642-FE0F": "man_frowning_tone4",
    "1F64D-1F3FF-200D-2642-FE0F": "man_frowning_tone5",
    "1F64E-200D-2640-FE0F": "woman_pouting",
    "1F64E-1F3FB-200D-2640-FE0F": "woman_pouting_tone1",
    "1F64E-1F3FC-200D-2640-FE0F": "woman_pouting_tone2",
    "1F64E-1F3FD-200D-2640-FE0F": "woman_pouting_tone3",
    "1F64E-1F3FE-200D-2640-FE0F": "woman_pouting_tone4",
    "1F64E-1F3FF-200D-2640-FE0F": "woman_pouting_tone5",
    "1F64E-200D-2642-FE0F": "man_pouting",
    "1F64E-1F3FB-200D-2642-FE0F": "man_pouting_tone1",
    "1F64E-1F3FC-200D-2642-FE0F": "man_pouting_tone2",
    "1F64E-1F3FD-200D-2642-FE0F": "man_pouting_tone3",
    "1F64E-1F3FE-200D-2642-FE0F": "man_pouting_tone4",
    "1F64E-1F3FF-200D-2642-FE0F": "man_pouting_tone5",
    "1F6A3-200D-2640-FE0F": "woman_rowing_boat",
    "1F6A3-1F3FB-200D-2640-FE0F": "woman_rowing_boat_tone1",
    "1F6A3-1F3FC-200D-2640-FE0F": "woman_rowing_boat_tone2",
    "1F6A3-1F3FD-200D-2640-FE0F": "woman_rowing_boat_tone3",
    "1F6A3-1F3FE-200D-2640-FE0F": "woman_rowing_boat_tone4",
    "1F6A3-1F3FF-200D-2640-FE0F": "woman_rowing_boat_tone5",
    "1F6A3-200D-2642-FE0F": "man_rowing_boat",
    "1F6A3-1F3FB-200D-2642-FE0F": "man_rowing_boat_tone1",
    "1F6A3-1F3FC-200D-2642-FE0F": "man_rowing_boat_tone2",
    "1F6A3-1F3FD-200D-2642-FE0F": "man_rowing_boat_tone3",
    "1F6A3-1F3FE-200D-2642-FE0F": "man_rowing_boat_tone4",
    "1F6A3-1F3FF-200D-2642-FE0F": "man_rowing_boat_tone5",
    "1F6B4-200D-2640-FE0F": "woman_biking",
    "1F6B4-1F3FB-200D-2640-FE0F": "woman_biking_tone1",
    "1F6B4-1F3FC-200D-2640-FE0F": "woman_biking_tone2",
    "1F6B4-1F3FD-200D-2640-FE0F": "woman_biking_tone3",
    "1F6B4-1F3FE-200D-2640-FE0F": "woman_biking_tone4",
    "1F6B4-1F3FF-200D-2640-FE0F": "woman_biking_tone5",
    "1F6B4-200D-2642-FE0F": "man_biking",
    "1F6B4-1F3FB-200D-2642-FE0F": "man_biking_tone1",
    "1F6B4-1F3FC-200D-2642-FE0F": "man_biking_tone2",
    "1F6B4-1F3FD-200D-2642-FE0F": "man_biking_tone3",
    "1F6B4-1F3FE-200D-2642-FE0F": "man_biking_tone4",
    "1F6B4-1F3FF-200D-2642-FE0F": "man_biking_tone5",
    "1F6B5-200D-2640-FE0F": "woman_mountain_biking",
    "1F6B5-1F3FB-200D-2640-FE0F": "woman_mountain_biking_tone1",
    "1F6B5-1F3FC-200D-2640-FE0F": "woman_mountain_biking_tone2",
    "1F6B5-1F3FD-200D-2640-FE0F": "woman_mountain_biking_tone3",
    "1F6B5-1F3FE-200D-2640-FE0F": "woman_mountain_biking_tone4",
    "1F6B5-1F3FF-200D-2640-FE0F": "woman_mountain_biking_tone5",
    "1F6B5-200D-2642-FE0F": "man_mountain_biking",
    "1F6B5-1F3FB-200D-2642-FE0F": "man_mountain_biking_tone1",
    "1F6B5-1F3FC-200D-2642-FE0F": "man_mountain_biking_tone2",
    "1F6B5-1F3FD-200D-2642-FE0F": "man_mountain_biking_tone3",
    "1F6B5-1F3FE-200D-2642-FE0F": "man_mountain_biking_tone4",
    "1F6B5-1F3FF-200D-2642-FE0F": "man_mountain_biking_tone5",
    "1F6B6-200D-2640-FE0F": "woman_walking",
    "1F6B6-1F3FB-200D-2640-FE0F": "woman_walking_tone1",
    "1F6B6-1F3FC-200D-2640-FE0F": "woman_walking_tone2",
    "1F6B6-1F3FD-200D-2640-FE0F": "woman_walking_tone3",
    "1F6B6-1F3FE-200D-2640-FE0F": "woman_walking_tone4",
    "1F6B6-1F3FF-200D-2640-FE0F": "woman_walking_tone5",
    "1F6B6-200D-2640-FE0F-200D-27A1-FE0F": "woman_walking_right",
    "1F6B6-1F3FB-200D-2640-FE0F-200D-27A1-FE0F": "woman_walking_right_tone1",
    "1F6B6-1F3FC-200D-2640-FE0F-200D-27A1-FE0F": "woman_walking_right_tone2",
    "1F6B6-1F3FD-200D-2640-FE0F-200D-27A1-FE0F": "woman_walking_right_tone3",
    "1F6B6-1F3FE-200D-2640-FE0F-200D-27A1-FE0F": "woman_walking_right_tone4",
    "1F6B6-1F3FF-200D-2640-FE0F-200D-27A1-FE0F": "woman_walking_right_tone5",
    "1F6B6-200D-2642-FE0F": "man_walking",
    "1F6B6-1F3FB-200D-2642-FE0F": "man_walking_tone1",
    "1F6B6-1F3FC-200D-2642-FE0F": "man_walking_tone2",
    "1F6B6-1F3FD-200D-2642-FE0F": "man_walking_tone3",
    "1F6B6-1F3FE-200D-2642-FE0F": "man_walking_tone4",
    "1F6B6-1F3FF-200D-2642-FE0F": "man_walking_tone5",
    "1F6B6-200D-2642-FE0F-200D-27A1-FE0F": "man_walking_right",
    "1F6B6-1F3FB-200D-2642-FE0F-200D-27A1-FE0F": "man_walking_right_tone1",
    "1F6B6-1F3FC-200D-2642-FE0F-200D-27A1-FE0F": "man_walking_right_tone2",
    "1F6B6-1F3FD-200D-2642-FE0F-200D-27A1-FE0F": "man_walking_right_tone3",
    "1F6B6-1F3FE-200D-2642-FE0F-200D-27A1-FE0F": "man_walking_right_tone4",
    "1F6B6-1F3FF-200D-2642-FE0F-200D-27A1-FE0F": "man_walking_right_tone5",
    "1F926-200D-2640-FE0F": "woman_facepalming",
    "1F926-1F3FB-200D-2640-FE0F": "woman_facepalming_tone1",
    "1F926-1F3FC-200D-2640-FE0F": "woman_facepalming_tone2",
    "1F926-1F3FD-200D-2640-FE0F": "woman_facepalming_tone3",
    "1F926-1F3FE-200D-2640-FE0F": "woman_facepalming_tone4",
    "1F926-1F3FF-200D-2640-FE0F": "woman_facepalming_tone5",
    "1F926-200D-2642-FE0F": "man_facepalming",
    "1F926-1F3FB-200D-2642-FE0F": "man_facepalming_tone1",
    "1F926-1F3FC-200D-2642-FE0F": "man_facepalming_tone2",
    "1F926-1F3FD-200D-2642-FE0F": "man_facepalming_tone3",
    "1F926-1F3FE-200D-2642-FE0F": "man_facepalming_tone4",
    "1F926-1F3FF-200D-2642-FE0F": "man_facepalming_tone5",
    "1F935-200D-2640-FE0F": "woman_in_tuxedo",
    "1F935-1F3FB-200D-2640-FE0F": "woman_in_tuxedo_tone1",
    "1F935-1F3FC-200D-2640-FE0F": "woman_in_tuxedo_tone2",
    "1F935-1F3FD-200D-2640-FE0F": "woman_in_tuxedo_tone3",
    "1F935-1F3FE-200D-2640-FE0F": "woman_in_tuxedo_tone4",
    "1F935-1F3FF-200D-2640-FE0F": "woman_in_tuxedo_tone5",
    "1F935-200D-2642-FE0F": "man_in_tuxedo",
    "1F935-1F3FB-200D-2642-FE0F": "man_in_tuxedo_tone1",
    "1F935-1F3FC-200D-2642-FE0F": "man_in_tuxedo_tone2",
    "1F935-1F3FD-200D-2642-FE0F": "man_in_tuxedo_tone3",
    "1F935-1F3FE-200D-2642-FE0F": "man_in_tuxedo_tone4",
    "1F935-1F3FF-200D-2642-FE0F": "man_in_tuxedo_tone5",
    "1F937-200D-2640-FE0F": "woman_shrugging",
    "1F937-1F3FB-200D-2640-FE0F": "woman_shrugging_tone1",
    "1F937-1F3FC-200D-2640-FE0F": "woman_shrugging_tone2",
    "1F937-1F3FD-200D-2640-FE0F": "woman_shrugging_tone3",
    "1F937-1F3FE-200D-2640-FE0F": "woman_shrugging_tone4",
    "1F937-1F3FF-200D-2640-FE0F": "woman_shrugging_tone5",
    "1F937-200D-2642-FE0F": "man_shrugging",
    "1F937-1F3FB-200D-2642-FE0F": "man_shrugging_tone1",
    "1F937-1F3FC-200D-2642-FE0F": "man_shrugging_tone2",
    "1F937-1F3FD-200D-2642-FE0F": "man_shrugging_tone3",
    "1F937-1F3FE-200D-2642-FE0F": "man_shrugging_tone4",
    "1F937-1F3FF-200D-2642-FE0F": "man_shrugging_tone5",
    "1F938-200D-2640-FE0F": "woman_cartwheeling",
    "1F938-1F3FB-200D-2640-FE0F": "woman_cartwheeling_tone1",
    "1F938-1F3FC-200D-2640-FE0F": "woman_cartwheeling_tone2",
    "1F938-1F3FD-200D-2640-FE0F": "woman_cartwheeling_tone3",
    "1F938-1F3FE-200D-2640-FE0F": "woman_cartwheeling_tone4",
    "1F938-1F3FF-200D-2640-FE0F": "woman_cartwheeling_tone5",
    "1F938-200D-2642-FE0F": "man_cartwheeling",
    "1F938-1F3FB-200D-2642-FE0F": "man_cartwheeling_tone1",
    "1F938-1F3FC-200D-2642-FE0F": "man_cartwheeling_tone2",
    "1F938-1F3FD-200D-2642-FE0F": "man_cartwheeling_tone3",
    "1F938-1F3FE-200D-2642-FE0F": "man_cartwheeling_tone4",
    "1F938-1F3FF-200D-2642-FE0F": "man_cartwheeling_tone5",
    "1F939-200D-2640-FE0F": "woman_juggling",
    "1F939-1F3FB-200D-2640-FE0F": "woman_juggling_tone1",
    "1F939-1F3FC-200D-2640-FE0F": "woman_juggling_tone2",
    "1F939-1F3FD-200D-2640-FE0F": "woman_juggling_tone3",
    "1F939-1F3FE-200D-2640-FE0F": "woman_juggling_tone4",
    "1F939-1F3FF-200D-2640-FE0F": "woman_juggling_tone5",
    "1F939-200D-2642-FE0F": "man_juggling",
    "1F939-1F3FB-200D-2642-FE0F": "man_juggling_tone1",
    "1F939-1F3FC-200D-2642-FE0F": "man_juggling_tone2",
    "1F939-1F3FD-200D-2642-FE0F": "man_juggling_tone3",
    "1F939-1F3FE-200D-2642-FE0F": "man_juggling_tone4",
    "1F939-1F3FF-200D-2642-FE0F": "man_juggling_tone5",
    "1F93C-200D-2640-FE0F": "women_wrestling",
    "1F93C-200D-2642-FE0F": "men_wrestling",
    "1F93D-200D-2640-FE0F": "woman_playing_water_polo",
    "1F93D-1F3FB-200D-2640-FE0F": "woman_playing_water_polo_tone1",
    "1F93D-1F3FC-200D-2640-FE0F": "woman_playing_water_polo_tone2",
    "1F93D-1F3FD-200D-2640-FE0F": "woman_playing_water_polo_tone3",
    "1F93D-1F3FE-200D-2640-FE0F": "woman_playing_water_polo_tone4",
    "1F93D-1F3FF-200D-2640-FE0F": "woman_playing_water_polo_tone5",
    "1F93D-200D-2642-FE0F": "man_playing_water_polo",
    "1F93D-1F3FB-200D-2642-FE0F": "man_playing_water_polo_tone1",
    "1F93D-1F3FC-200D-2642-FE0F": "man_playing_water_polo_tone2",
    "1F93D-1F3FD-200D-2642-FE0F": "man_playing_water_polo_tone3",
    "1F93D-1F3FE-200D-2642-FE0F": "man_playing_water_polo_tone4",
    "1F93D-1F3FF-200D-2642-FE0F": "man_playing_water_polo_tone5",
    "1F93E-200D-2640-FE0F": "woman_playing_handball",
    "1F93E-1F3FB-200D-2640-FE0F": "woman_playing_handball_tone1",
    "1F93E-1F3FC-200D-2640-FE0F": "woman_playing_handball_tone2",
    "1F93E-1F3FD-200D-2640-FE0F": "woman_playing_handball_tone3",
    "1F93E-1F3FE-200D-2640-FE0F": "woman_playing_handball_tone4",
    "1F93E-1F3FF-200D-2640-FE0F": "woman_playing_handball_tone5",
    "1F93E-200D-2642-FE0F": "man_playing_handball",
    "1F93E-1F3FB-200D-2642-FE0F": "man_playing_handball_tone1",
    "1F93E-1F3FC-200D-2642-FE0F": "man_playing_handball_tone2",
    "1F93E-1F3FD-200D-2642-FE0F": "man_playing_handball_tone3",
    "1F93E-1F3FE-200D-2642-FE0F": "man_playing_handball_tone4",
    "1F93E-1F3FF-200D-2642-FE0F": "man_playing_handball_tone5",
    "1F9B8-200D-2640-FE0F": "woman_superhero",
    "1F9B8-1F3FB-200D-2640-FE0F": "woman_superhero_tone1",
    "1F9B8-1F3FC-200D-2640-FE0F": "woman_superhero_tone2",
    "1F9B8-1F3FD-200D-2640-FE0F": "woman_superhero_tone3",
    "1F9B8-1F3FE-200D-2640-FE0F": "woman_superhero_tone4",
    "1F9B8-1F3FF-200D-2640-FE0F": "woman_superhero_tone5",
    "1F9B8-200D-2642-FE0F": "man_superhero",
    "1F9B8-1F3FB-200D-2642-FE0F": "man_superhero_tone1",
    "1F9B8-1F3FC-200D-2642-FE0F": "man_superhero_tone2",
    "1F9B8-1F3FD-200D-2642-FE0F": "man_superhero_tone3",
    "1F9B8-1F3FE-200D-2642-FE0F": "man_superhero_tone4",
    "1F9B8-1F3FF-200D-2642-FE0F": "man_superhero_tone5",
    "1F9B9-200D-2640-FE0F": "woman_supervillain",
    "1F9B9-1F3FB-200D-2640-FE0F": "woman_supervillain_tone1",
    "1F9B9-1F3FC-200D-2640-FE0F": "woman_supervillain_tone2",
    "1F9B9-1F3FD-200D-2640-FE0F": "woman_supervillain_tone3",
    "1F9B9-1F3FE-200D-2640-FE0F": "woman_supervillain_tone4",
    "1F9B9-1F3FF-200D-2640-FE0F": "woman_supervillain_tone5",
    "1F9B9-200D-2642-FE0F": "man_supervillain",
    "1F9B9-1F3FB-200D-2642-FE0F": "man_supervillain_tone1",
    "1F9B9-1F3FC-200D-2642-FE0F": "man_supervillain_tone2",
    "1F9B9-1F3FD-200D-2642-FE0F": "man_supervillain_tone3",
    "1F9B9-1F3FE-200D-2642-FE0F": "man_supervillain_tone4",
    "1F9B9-1F3FF-200D-2642-FE0F": "man_supervillain_tone5",
    "1F9CD-200D-2640-FE0F": "woman_standing",
    "1F9CD-1F3FB-200D-2640-FE0F": "woman_standing_tone1",
    "1F9CD-1F3FC-200D-2640-FE0F": "woman_standing_tone2",
    "1F9CD-1F3FD-200D-2640-FE0F": "woman_standing_tone3",
    "1F9CD-1F3FE-200D-2640-FE0F": "woman_standing_tone4",
    "1F9CD-1F3FF-200D-2640-FE0F": "woman_standing_tone5",
    "1F9CD-200D-2642-FE0F": "man_standing",
    "1F9CD-1F3FB-200D-2642-FE0F": "man_standing_tone1",
    "1F9CD-1F3FC-200D-2642-FE0F": "man_standing_tone2",
    "1F9CD-1F3FD-200D-2642-FE0F": "man_standing_tone3",
    "1F9CD-1F3FE-200D-2642-FE0F": "man_standing_tone4",
    "1F9CD-1F3FF-200D-2642-FE0F": "man_standing_tone5",
    "1F9CE-200D-2640-FE0F": "woman_kneeling",
    "1F9CE-1F3FB-200D-2640-FE0F": "woman_kneeling_tone1",
    "1F9CE-1F3FC-200D-2640-FE0F": "woman_kneeling_tone2",
    "1F9CE-1F3FD-200D-2640-FE0F": "woman_kneeling_tone3",
    "1F9CE-1F3FE-200D-2640-FE0F": "woman_kneeling_tone4",
    "1F9CE-1F3FF-200D-2640-FE0F": "woman_kneeling_tone5",
    "1F9CE-200D-2640-FE0F-200D-27A1-FE0F": "woman_kneeling_right",
    "1F9CE-1F3FB-200D-2640-FE0F-200D-27A1-FE0F": "woman_kneeling_right_tone1",
    "1F9CE-1F3FC-200D-2640-FE0F-200D-27A1-FE0F": "woman_kneeling_right_tone2",
    "1F9CE-1F3FD-200D-2640-FE0F-200D-27A1-FE0F": "woman_kneeling_right_tone3",
    "1F9CE-1F3FE-200D-2640-FE0F-200D-27A1-FE0F": "woman_kneeling_right_tone4",
    "1F9CE-1F3FF-200D-2640-FE0F-200D-27A1-FE0F": "woman_kneeling_right_tone5",
    "1F9CE-200D-2642-FE0F": "man_kneeling",
    "1F9CE-1F3FB-200D-2642-FE0F": "man_kneeling_tone1",
    "1F9CE-1F3FC-200D-2642-FE0F": "man_kneeling_tone2",
    "1F9CE-1F3FD-200D-2642-FE0F": "man_kneeling_tone3",
    "1F9CE-1F3FE-200D-2642-FE0F": "man_kneeling_tone4",
    "1F9CE-1F3FF-200D-2642-FE0F": "man_kneeling_tone5",
    "1F9CE-200D-2642-FE0F-200D-27A1-FE0F": "man_kneeling_right",
    "1F9CE-1F3FB-200D-2642-FE0F-200D-27A1-FE0F": "man_kneeling_right_tone1",
    "1F9CE-1F3FC-200D-2642-FE0F-200D-27A1-FE0F": "man_kneeling_right_tone2",
    "1F9CE-1F3FD-200D-2642-FE0F-200D-27A1-FE0F": "man_kneeling_right_tone3",
    "1F9CE-1F3FE-200D-2642-FE0F-200D-27A1-FE0F": "man_kneeling_right_tone4",
    "1F9CE-1F3FF-200D-2642-FE0F-200D-27A1-FE0F": "man_kneeling_right_tone5",
    "1F9CF-200D-2640-FE0F": "deaf_woman",
    "1F9CF-1F3FB-200D-2640-FE0F": "deaf_woman_tone1",
    "1F9CF-1F3FC-200D-2640-FE0F": "deaf_woman_tone2",
    "1F9CF-1F3FD-200D-2640-FE0F": "deaf_woman_tone3",
    "1F9CF-1F3FE-200D-2640-FE0F": "deaf_woman_tone4",
    "1F9CF-1F3FF-200D-2640-FE0F": "deaf_woman_tone5",
    "1F9CF-200D-2642-FE0F": "deaf_man",
    "1F9CF-1F3FB-200D-2642-FE0F": "deaf_man_tone1",
    "1F9CF-1F3FC-200D-2642-FE0F": "deaf_man_tone2",
    "1F9CF-1F3FD-200D-2642-FE0F": "deaf_man_tone3",
    "1F9CF-1F3FE-200D-2642-FE0F": "deaf_man_tone4",
    "1F9CF-1F3FF-200D-2642-FE0F": "deaf_man_tone5",
    "1F9D4-200D-2640-FE0F": "woman_bearded",
    "1F9D4-1F3FB-200D-2640-FE0F": "woman_bearded_tone1",
    "1F9D4-1F3FC-200D-2640-FE0F": "woman_bearded_tone2",
    "1F9D4-1F3FD-200D-2640-FE0F": "woman_bearded_tone3",
    "1F9D4-1F3FE-200D-2640-FE0F": "woman_bearded_tone4",
    "1F9D4-1F3FF-200D-2640-FE0F": "woman_bearded_tone5",
    "1F9D4-200D-2642-FE0F": "man_bearded",
    "1F9D4-1F3FB-200D-2642-FE0F": "man_bearded_tone1",
    "1F9D4-1F3FC-200D-2642-FE0F": "man_bearded_tone2",
    "1F9D4-1F3FD-200D-2642-FE0F": "man_bearded_tone3",
    "1F9D4-1F3FE-200D-2642-FE0F": "man_bearded_tone4",
    "1F9D4-1F3FF-200D-2642-FE0F": "man_bearded_tone5",
    "1F9D6-200D-2640-FE0F": "woman_in_steamy_room",
    "1F9D6-1F3FB-200D-2640-FE0F": "woman_in_steamy_room_tone1",
    "1F9D6-1F3FC-200D-2640-FE0F": "woman_in_steamy_room_tone2",
    "1F9D6-1F3FD-200D-2640-FE0F": "woman_in_steamy_room_tone3",
    "1F9D6-1F3FE-200D-2640-FE0F": "woman_in_steamy_room_tone4",
    "1F9D6-1F3FF-200D-2640-FE0F": "woman_in_steamy_room_tone5",
    "1F9D6-200D-2642-FE0F": "man_in_steamy_room",
    "1F9D6-1F3FB-200D-2642-FE0F": "man_in_steamy_room_tone1",
    "1F9D6-1F3FC-200D-2642-FE0F": "man_in_steamy_room_tone2",
    "1F9D6-1F3FD-200D-2642-FE0F": "man_in_steamy_room_tone3",
    "1F9D6-1F3FE-200D-2642-FE0F": "man_in_steamy_room_tone4",
    "1F9D6-1F3FF-200D-2642-FE0F": "man_in_steamy_room_tone5",
    "1F9D7-200D-2640-FE0F": "woman_climbing",
    "1F9D7-1F3FB-200D-2640-FE0F": "woman_climbing_tone1",
    "1F9D7-1F3FC-200D-2640-FE0F": "woman_climbing_tone2",
    "1F9D7-1F3FD-200D-2640-FE0F": "woman_climbing_tone3",
    "1F9D7-1F3FE-200D-2640-FE0F": "woman_climbing_tone4",
    "1F9D7-1F3FF-200D-2640-FE0F": "woman_climbing_tone5",
    "1F9D7-200D-2642-FE0F": "man_climbing",
    "1F9D7-1F3FB-200D-2642-FE0F": "man_climbing_tone1",
    "1F9D7-1F3FC-200D-2642-FE0F": "man_climbing_tone2",
    "1F9D7-1F3FD-200D-2642-FE0F": "man_climbing_tone3",
    "1F9D7-1F3FE-200D-2642-FE0F": "man_climbing_tone4",
    "1F9D7-1F3FF-200D-2642-FE0F": "man_climbing_tone5",
    "1F9D8-200D-2640-FE0F": "woman_in_lotus_position",
    "1F9D8-1F3FB-200D-2640-FE0F": "woman_in_lotus_position_tone1",
    "1F9D8-1F3FC-200D-2640-FE0F": "woman_in_lotus_position_tone2",
    "1F9D8-1F3FD-200D-2640-FE0F": "woman_in_lotus_position_tone3",
    "1F9D8-1F3FE-200D-2640-FE0F": "woman_in_lotus_position_tone4",
    "1F9D8-1F3FF-200D-2640-FE0F": "woman_in_lotus_position_tone5",
    "1F9D8-200D-2642-FE0F": "man_in_lotus_position",
    "1F9D8-1F3FB-200D-2642-FE0F": "man_in_lotus_position_tone1",
    "1F9D8-1F3FC-200D-2642-FE0F": "man_in_lotus_position_tone2",
    "1F9D8-1F3FD-200D-2642-FE0F": "man_in_lotus_position_tone3",
    "1F9D8-1F3FE-200D-2642-FE0F": "man_in_lotus_position_tone4",
    "1F9D8-1F3FF-200D-2642-FE0F": "man_in_lotus_position_tone5",
    "1F9D9-200D-2640-FE0F": "woman_mage",
    "1F9D9-1F3FB-200D-2640-FE0F": "woman_mage_tone1",
    "1F9D9-1F3FC-200D-2640-FE0F": "woman_mage_tone2",
    "1F9D9-1F3FD-200D-2640-FE0F": "woman_mage_tone3",
    "1F9D9-1F3FE-200D-2640-FE0F": "woman_mage_tone4",
    "1F9D9-1F3FF-200D-2640-FE0F": "woman_mage_tone5",
    "1F9D9-200D-2642-FE0F": "man_mage",
    "1F9D9-1F3FB-200D-2642-FE0F": "man_mage_tone1",
    "1F9D9-1F3FC-200D-2642-FE0F": "man_mage_tone2",
    "1F9D9-1F3FD-200D-2642-FE0F": "man_mage_tone3",
    "1F9D9-1F3FE-200D-2642-FE0F": "man_mage_tone4",
    "1F9D9-1F3FF-200D-2642-FE0F": "man_mage_tone5",
    "1F9DA-200D-2640-FE0F": "woman_fairy",
    "1F9DA-1F3FB-200D-2640-FE0F": "woman_fairy_tone1",
    "1F9DA-1F3FC-200D-2640-FE0F": "woman_fairy_tone2",
    "1F9DA-1F3FD-200D-2640-FE0F": "woman_fairy_tone3",
    "1F9DA-1F3FE-200D-2640-FE0F": "woman_fairy_tone4",
    "1F9DA-1F3FF-200D-2640-FE0F": "woman_fairy_tone5",
    "1F9DA-200D-2642-FE0F": "man_fairy",
    "1F9DA-1F3FB-200D-2642-FE0F": "man_fairy_tone1",
    "1F9DA-1F3FC-200D-2642-FE0F": "man_fairy_tone2",
    "1F9DA-1F3FD-200D-2642-FE0F": "man_fairy_tone3",
    "1F9DA-1F3FE-200D-2642-FE0F": "man_fairy_tone4",
    "1F9DA-1F3FF-200D-2642-FE0F": "man_fairy_tone5",
    "1F9DB-200D-2640-FE0F": "woman_vampire",
    "1F9DB-1F3FB-200D-2640-FE0F": "woman_vampire_tone1",
    "1F9DB-1F3FC-200D-2640-FE0F": "woman_vampire_tone2",
    "1F9DB-1F3FD-200D-2640-FE0F": "woman_vampire_tone3",
    "1F9DB-1F3FE-200D-2640-FE0F": "woman_vampire_tone4",
    "1F9DB-1F3FF-200D-2640-FE0F": "woman_vampire_tone5",
    "1F9DB-200D-2642-FE0F": "man_vampire",
    "1F9DB-1F3FB-200D-2642-FE0F": "man_vampire_tone1",
    "1F9DB-1F3FC-200D-2642-FE0F": "man_vampire_tone2",
    "1F9DB-1F3FD-200D-2642-FE0F": "man_vampire_tone3",
    "1F9DB-1F3FE-200D-2642-FE0F": "man_vampire_tone4",
    "1F9DB-1F3FF-200D-2642-FE0F": "man_vampire_tone5",
    "1F9DC-200D-2640-FE0F": "mermaid",
    "1F9DC-1F3FB-200D-2640-FE0F": "mermaid_tone1",
    "1F9DC-1F3FC-200D-2640-FE0F": "mermaid_tone2",
    "1F9DC-1F3FD-200D-2640-FE0F": "mermaid_tone3",
    "1F9DC-1F3FE-200D-2640-FE0F": "mermaid_tone4",
    "1F9DC-1F3FF-200D-2640-FE0F": "mermaid_tone5",
    "1F9DC-200D-2642-FE0F": "merman",
    "1F9DC-1F3FB-200D-2642-FE0F": "merman_tone1",
    "1F9DC-1F3FC-200D-2642-FE0F": "merman_tone2",
    "1F9DC-1F3FD-200D-2642-FE0F": "merman_tone3",
    "1F9DC-1F3FE-200D-2642-FE0F": "merman_tone4",
    "1F9DC-1F3FF-200D-2642-FE0F": "merman_tone5",
    "1F9DD-200D-2640-FE0F": "woman_elf",
    "1F9DD-1F3FB-200D-2640-FE0F": "woman_elf_tone1",
    "1F9DD-1F3FC-200D-2640-FE0F": "woman_elf_tone2",
    "1F9DD-1F3FD-200D-2640-FE0F": "woman_elf_tone3",
    "1F9DD-1F3FE-200D-2640-FE0F": "woman_elf_tone4",
    "1F9DD-1F3FF-200D-2640-FE0F": "woman_elf_tone5",
    "1F9DD-200D-2642-FE0F": "man_elf",
    "1F9DD-1F3FB-200D-2642-FE0F": "man_elf_tone1",
    "1F9DD-1F3FC-200D-2642-FE0F": "man_elf_tone2",
    "1F9DD-1F3FD-200D-2642-FE0F": "man_elf_tone3",
    "1F9DD-1F3FE-200D-2642-FE0F": "man_elf_tone4",
    "1F9DD-1F3FF-200D-2642-FE0F": "man_elf_tone5",
    "1F9DE-200D-2640-FE0F": "woman_genie",
    "1F9DE-200D-2642-FE0F": "man_genie",
    "1F9DF-200D-2640-FE0F": "woman_zombie",
    "1F9DF-200D-2642-FE0F": "man_zombie",
    "1F468-200D-1F9B0": "man_red_haired",
    "1F468-1F3FB-200D-1F9B0": "man_red_haired_tone1",
    "1F468-1F3FC-200D-1F9B0": "man_red_haired_tone2",
    "1F468-1F3FD-200D-1F9B0": "man_red_haired_tone3",
    "1F468-1F3FE-200D-1F9B0": "man_red_haired_tone4",
    "1F468-1F3FF-200D-1F9B0": "man_red_haired_tone5",
    "1F468-200D-1F9B1": "man_curly_haired",
    "1F468-1F3FB-200D-1F9B1": "man_curly_haired_tone1",
    "1F468-1F3FC-200D-1F9B1": "man_curly_haired_tone2",
    "1F468-1F3FD-200D-1F9B1": "man_curly_haired_tone3",
    "1F468-1F3FE-200D-1F9B1": "man_curly_haired_tone4",
    "1F468-1F3FF-200D-1F9B1": "man_curly_haired_tone5",
    "1F468-200D-1F9B2": "man_bald",
    "1F468-1F3FB-200D-1F9B2": "man_bald_tone1",
    "1F468-1F3FC-200D-1F9B2": "man_bald_tone2",
    "1F468-1F3FD-200D-1F9B2": "man_bald_tone3",
    "1F468-1F3FE-200D-1F9B2": "man_bald_tone4",
    "1F468-1F3FF-200D-1F9B2": "man_bald_tone5",
    "1F468-200D-1F9B3": "man_white_haired",
    "1F468-1F3FB-200D-1F9B3": "man_white_haired_tone1",
    "1F468-1F3FC-200D-1F9B3": "man_white_haired_tone2",
    "1F468-1F3FD-200D-1F9B3": "man_white_haired_tone3",
    "1F468-1F3FE-200D-1F9B3": "man_white_haired_tone4",
    "1F468-1F3FF-200D-1F9B3": "man_white_haired_tone5",
    "1F469-200D-1F9B0": "woman_red_haired",
    "1F469-1F3FB-200D-1F9B0": "woman_red_haired_tone1",
    "1F469-1F3FC-200D-1F9B0": "woman_red_haired_tone2",
    "1F469-1F3FD-200D-1F9B0": "woman_red_haired_tone3",
    "1F469-1F3FE-200D-1F9B0": "woman_red_haired_tone4",
    "1F469-1F3FF-200D-1F9B0": "woman_red_haired_tone5",
    "1F469-200D-1F9B1": "woman_curly_haired",
    "1F469-1F3FB-200D-1F9B1": "woman_curly_haired_tone1",
    "1F469-1F3FC-200D-1F9B1": "woman_curly_haired_tone2",
    "1F469-1F3FD-200D-1F9B1": "woman_curly_haired_tone3",
    "1F469-1F3FE-200D-1F9B1": "woman_curly_haired_tone4",
    "1F469-1F3FF-200D-1F9B1": "woman_curly_haired_tone5",
    "1F469-200D-1F9B2": "woman_bald",
    "1F469-1F3FB-200D-1F9B2": "woman_bald_tone1",
    "1F469-1F3FC-200D-1F9B2": "woman_bald_tone2",
    "1F469-1F3FD-200D-1F9B2": "woman_bald_tone3",
    "1F469-1F3FE-200D-1F9B2": "woman_bald_tone4",
    "1F469-1F3FF-200D-1F9B2": "woman_bald_tone5",
    "1F469-200D-1F9B3": "woman_white_haired",
    "1F469-1F3FB-200D-1F9B3": "woman_white_haired_tone1",
    "1F469-1F3FC-200D-1F9B3": "woman_white_haired_tone2",
    "1F469-1F3FD-200D-1F9B3": "woman_white_haired_tone3",
    "1F469-1F3FE-200D-1F9B3": "woman_white_haired_tone4",
    "1F469-1F3FF-200D-1F9B3": "woman_white_haired_tone5",
    "1F9D1-200D-1F9B0": "red_haired",
    "1F9D1-1F3FB-200D-1F9B0": "red_haired_tone1",
    "1F9D1-1F3FC-200D-1F9B0": "red_haired_tone2",
    "1F9D1-1F3FD-200D-1F9B0": "red_haired_tone3",
    "1F9D1-1F3FE-200D-1F9B0": "red_haired_tone4",
    "1F9D1-1F3FF-200D-1F9B0": "red_haired_tone5",
    "1F9D1-200D-1F9B1": "curly_haired",
    "1F9D1-1F3FB-200D-1F9B1": "curly_haired_tone1",
    "1F9D1-1F3FC-200D-1F9B1": "curly_haired_tone2",
    "1F9D1-1F3FD-200D-1F9B1": "curly_haired_tone3",
    "1F9D1-1F3FE-200D-1F9B1": "curly_haired_tone4",
    "1F9D1-1F3FF-200D-1F9B1": "curly_haired_tone5",
    "1F9D1-200D-1F9B2": "bald",
    "1F9D1-1F3FB-200D-1F9B2": "bald_tone1",
    "1F9D1-1F3FC-200D-1F9B2": "bald_tone2",
    "1F9D1-1F3FD-200D-1F9B2": "bald_tone3",
    "1F9D1-1F3FE-200D-1F9B2": "bald_tone4",
    "1F9D1-1F3FF-200D-1F9B2": "bald_tone5",
    "1F9D1-200D-1F9B3": "white_haired",
    "1F9D1-1F3FB-200D-1F9B3": "white_haired_tone1",
    "1F9D1-1F3FC-200D-1F9B3": "white_haired_tone2",
    "1F9D1-1F3FD-200D-1F9B3": "white_haired_tone3",
    "1F9D1-1F3FE-200D-1F9B3": "white_haired_tone4",
    "1F9D1-1F3FF-200D-1F9B3": "white_haired_tone5",
    "26D3-FE0F-200D-1F4A5": "broken_chain",
    "2764-FE0F-200D-1F525": "heart_on_fire",
    "2764-FE0F-200D-1FA79": "mending_heart",
    "1F344-200D-1F7EB": "brown_mushroom",
    "1F34B-200D-1F7E9": "lime",
    "1F3F3-FE0F-200D-26A7-FE0F": "transgender_flag",
    "1F3F3-FE0F-200D-1F308": "rainbow_flag",
    "1F3F4-200D-2620-FE0F": [
      "jolly_roger",
      "pirate_flag"
    ],
    "1F408-200D-2B1B": "black_cat",
    "1F415-200D-1F9BA": "service_dog",
    "1F426-200D-2B1B": "black_bird",
    "1F426-200D-1F525": "phoenix",
    "1F43B-200D-2744-FE0F": [
      "polar_bear",
      "polar_bear_face"
    ],
    "1F441-FE0F-200D-1F5E8-FE0F": "eye_in_speech_bubble",
    "1F62E-200D-1F4A8": [
      "exhale",
      "exhaling"
    ],
    "1F635-200D-1F4AB": "dizzy_eyes",
    "1F636-200D-1F32B-FE0F": "in_clouds",
    "1F642-200D-2194-FE0F": "head_shaking_horizontally",
    "1F642-200D-2195-FE0F": "head_shaking_vertically"
  };
  var Fa = ((t) => (t.People = "People", t.Nature = "Nature", t.Food = "Food", t.Activity = "Activity", t.Travel = "Travel", t.Object = "Object", t.Symbol = "Symbol", t.Flag = "Flag", t))(Fa || {});
  const y6e = (t) => Toe[t] || Roe[t], vP = (t) => {
    const e = Toe[t] || Roe[t];
    return Array.isArray(e) ? e[0] : e;
  }, _P = v6e, yP = [
    {
      id: "People",
      order: 0,
      emojis: []
    },
    {
      id: "Nature",
      order: 1,
      emojis: []
    },
    {
      id: "Food",
      order: 2,
      emojis: []
    },
    {
      id: "Activity",
      order: 3,
      emojis: []
    },
    {
      id: "Travel",
      order: 4,
      emojis: []
    },
    {
      id: "Object",
      order: 5,
      emojis: []
    },
    {
      id: "Symbol",
      order: 6,
      emojis: []
    },
    {
      id: "Flag",
      order: 7,
      emojis: []
    }
  ], Ok = [];
  function b6e(t, e) {
    const n = yP[t];
    n && n.emojis.push(e);
  }
  function x6e(t) {
    if (t.group === 0 || t.group === 1) return 0;
    if (t.group === 3) return 1;
    if (t.group === 4) return 2;
    if (t.group === 6) return 3;
    if (t.group === 5) return 4;
    if (t.group === 7) return 5;
    if (t.group === 8 || typeof t.group > "u") return 6;
    if (t.group === 9) return 7;
  }
  _6e.forEach((t) => {
    const e = y6e(t.hexcode);
    if (!e || Array.isArray(e) && e.length === 0) return;
    const n = {
      ...t,
      shortcode: Array.isArray(e) ? e[0] ?? "" : e ?? "",
      shortcodes: Array.isArray(e) ? e : t.shortcodes
    }, r = x6e(n);
    r !== void 0 && (b6e(r, n), Ok.push(n));
  });
  const w6e = new RegExp(`${QSe}(${Doe})`, "g"), JW = (t) => !(t.parent && "name" in t.parent && t.parent.name === "code") && !(t.parent && "name" in t.parent && t.parent.name === "a"), fs = {
    attributes: {
      target: "_blank",
      rel: "noreferrer noopener"
    },
    validate: {
      url: (t) => /^(https|http|ftp|mailto|magnet)?:/.test(t)
    },
    ignoreTags: [
      "span"
    ]
  }, K4 = (t) => {
    try {
      return decodeURIComponent(t);
    } catch {
      return t;
    }
  }, D6e = (t) => {
    const e = t["data-mx-color"], n = t["data-mx-bg-color"], r = {};
    return typeof e == "string" && np(e) && (r.color = e), typeof n == "string" && np(n) && (r.backgroundColor = n), Object.keys(r).length > 0 ? r : void 0;
  }, C6e = (t) => {
    const { style: e, ...n } = bSe(t);
    return n;
  }, E6e = (t) => {
    if (typeof t != "string") return "noopener";
    const e = t.split(/\s+/).filter(Boolean);
    return e.includes("noopener") || e.push("noopener"), e.join(" ");
  };
  function XW({ math: t, displayMode: e, style: n }) {
    const [r, i] = p.useState(null);
    if (p.useEffect(() => {
      let s = true;
      return Promise.all([
        L1(() => import("./katex-DHMw6HUq.js"), []),
        L1(() => Promise.resolve({}), __vite__mapDeps([0]))
      ]).then(([l]) => {
        s && i(l.default.renderToString(t, {
          throwOnError: false,
          displayMode: e
        }));
      }), () => {
        s = false;
      };
    }, [
      t,
      e
    ]), r === null) return o.jsxs("code", {
      style: n,
      children: [
        e ? `$$
` : "$",
        t,
        e ? `
$$` : "$"
      ]
    });
    const a = e ? "div" : "span";
    return o.jsx(a, {
      style: n,
      dangerouslySetInnerHTML: {
        __html: r
      }
    });
  }
  const Jd = (t, e) => ({
    style: {
      cursor: "pointer"
    },
    target: "_blank",
    rel: "noreferrer noopener",
    role: "link",
    tabIndex: t ? 0 : -1,
    onKeyDown: t ? Vb(t) : void 0,
    onClick: t,
    children: e
  }), QW = (t, e, n) => e == null || typeof e == "string" && Y2e(t, e) ? n : e, _h = (t, e, n, r, i) => {
    var _a6;
    const a = N7(n);
    if (a) {
      const c = t.getRoom(e);
      return o.jsx("a", {
        href: n,
        ...r,
        className: Jy({
          highlight: t.getUserId() === a
        }),
        "data-mention-id": a,
        children: `@${(c && gr(c, a, i)) ?? _n(a)}`
      });
    }
    const s = QE(n);
    if (s) {
      const { roomIdOrAlias: c, viaServers: d } = s, u = t.getRoom(ml(c) ? eF(t, c) : c), h = u ? `#${u.name}` : c, f = QW(n, r.children, h);
      return o.jsx("a", {
        href: n,
        ...r,
        className: Jy({
          highlight: e === ((u == null ? void 0 : u.roomId) ?? c)
        }),
        "data-mention-id": (u == null ? void 0 : u.roomId) ?? c,
        "data-mention-via": d == null ? void 0 : d.join(","),
        children: f
      });
    }
    const l = ek(n);
    if (l) {
      const { roomIdOrAlias: c, eventId: d, viaServers: u } = l, h = t.getRoom(ml(c) ? eF(t, c) : c);
      let f = h ? `#${h.name}` : c;
      if (h) {
        const m = (_a6 = h.findEventById) == null ? void 0 : _a6.call(h, d);
        if (m) {
          const v = m.getContent(), y = typeof v.body == "string" ? v.body.trim() : "";
          if (y) {
            const w = y.replace(/\s+/g, " "), b = w.length > 72 ? `${w.slice(0, 69)}\u2026` : w;
            f = `#${h.name}: ${b}`;
          }
        }
      }
      const g = QW(n, r.children, f);
      return o.jsxs("a", {
        href: n,
        ...r,
        className: gt(Jy({
          highlight: e === ((h == null ? void 0 : h.roomId) ?? c)
        }), xoe),
        "data-mention-id": (h == null ? void 0 : h.roomId) ?? c,
        "data-mention-event-id": d,
        "data-mention-via": u == null ? void 0 : u.join(","),
        children: [
          o.jsx("span", {
            "aria-hidden": "true",
            className: woe,
            children: o.jsx(Q, {
              size: "50",
              src: q.Message
            })
          }),
          g
        ]
      });
    }
  }, Aoe = ({ href: t, section: e, focus: n, handleMentionClick: r }) => o.jsxs("a", {
    href: t,
    ...Jd(r),
    className: gt(Jy({}), xoe),
    "data-settings-link-section": e,
    "data-settings-link-focus": n,
    children: [
      o.jsx("span", {
        "aria-hidden": "true",
        className: woe,
        children: o.jsx(Q, {
          size: "50",
          src: q.Setting
        })
      }),
      vke(e, n)
    ]
  }), em = (t, e, n) => ({ tagName: i, attributes: a, content: s }) => {
    const l = a.href, c = l && K4(l);
    if (i === "a" && c && zc(c)) {
      const d = e(c);
      if (d) return d;
    }
    if (i === "a" && c) {
      const d = Ak(t, c);
      if (d) {
        const { section: u, focus: h } = d;
        return Aoe({
          href: c,
          section: u,
          focus: h,
          handleMentionClick: n
        });
      }
    }
    return o.jsx("a", {
      ...a,
      target: "_blank",
      rel: "noreferrer noopener",
      children: s
    });
  }, rF = (t) => Mk(t, w6e, (e, n) => o.jsx("span", {
    className: wu,
    children: o.jsx("span", {
      className: q4(),
      title: vP(_P(e[0])),
      children: e[0]
    })
  }, `scaleSystemEmoji-${n}`), (e) => e), a3 = (t) => {
    const e = t.map(ob).join("|");
    if (e) return new RegExp(e, "gi");
  }, ip = (t, e) => e.flatMap((n) => typeof n != "string" ? n : Mk(n, t, (r, i) => o.jsx("span", {
    className: YSe,
    children: r[0]
  }, `highlight-${i}`), (r) => r)), eq = (t) => {
    const e = (n) => {
      let r = "";
      return n.forEach((i) => {
        i.type === "text" ? r += i.data : i instanceof hg && i.children && (r += e(i.children));
      }), r;
    };
    return e(t).replace(/\n$/, "");
  }, tq = (t) => {
    var _a6;
    if (t) return (_a6 = t.split(/\s+/).find((e) => e.startsWith("language-"))) == null ? void 0 : _a6.replace("language-", "");
  }, Ioe = (t, e) => {
    const n = t.find((i) => i instanceof hg && i.name === "code"), r = n instanceof hg ? n.attribs : void 0;
    return (r == null ? void 0 : r["data-lang"]) ?? (e == null ? void 0 : e["data-lang"]) ?? tq(r == null ? void 0 : r.class) ?? tq(e == null ? void 0 : e.class);
  };
  function k6e({ children: t, attribs: e, opts: n }) {
    const r = Ioe(t, e), i = 14, a = p.useMemo(() => eq(t).split(`
`).length > i, [
      t
    ]), [s, l] = p.useState(false), [c, d] = Dp(), u = () => {
      Jo(eq(t)), d();
    }, h = () => {
      l(!s);
    };
    return o.jsxs(D, {
      size: "T300",
      as: "pre",
      className: zSe,
      children: [
        o.jsxs(wn, {
          variant: "Surface",
          size: "400",
          className: USe,
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "L400",
                truncate: true,
                children: r ?? "Code"
              })
            }),
            o.jsxs(E, {
              shrink: "No",
              gap: "200",
              children: [
                o.jsx(Qe, {
                  variant: c ? "Success" : "Surface",
                  fill: "None",
                  radii: "Pill",
                  onClick: u,
                  before: c && o.jsx(Q, {
                    size: "50",
                    src: q.Check
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: c ? "Copied" : "Copy"
                  })
                }),
                a && o.jsx(Oe, {
                  size: "300",
                  variant: "SurfaceVariant",
                  outlined: true,
                  radii: "300",
                  onClick: h,
                  "aria-label": s ? "Collapse" : "Expand",
                  children: o.jsx(Q, {
                    size: "50",
                    src: s ? q.ChevronTop : q.ChevronBottom
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(dn, {
          style: {
            maxHeight: a && !s ? He(300) : void 0,
            paddingBottom: a ? ee.space.S400 : void 0
          },
          direction: "Both",
          variant: "SurfaceVariant",
          size: "300",
          visibility: "Hover",
          hideTrack: true,
          children: o.jsx("div", {
            id: "code-block-content",
            className: VSe,
            children: uoe(t, n)
          })
        }),
        a && !s && o.jsx(E, {
          className: HSe
        })
      ]
    });
  }
  function B_({ fallback: t, ...e }) {
    const [n, r] = p.useState(false);
    return n ? o.jsx(o.Fragment, {
      children: t
    }) : o.jsx("img", {
      ...e,
      onError: () => r(true)
    });
  }
  const Ql = (t, e, n) => {
    const { replaceTextNode: r } = n, i = n.incomingInlineImagesDefaultHeight ?? 32, a = n.incomingInlineImagesMaxHeight ?? 64, s = (u) => {
      const h = typeof u == "number" ? u : typeof u == "string" ? Number.parseInt(u, 10) : NaN, f = i, g = Number.isFinite(h) ? h : f, m = Math.max(1, Math.min(4096, Math.round(g))), v = Math.max(1, Math.min(4096, Math.round(a)));
      return Math.min(m, v);
    }, l = (u) => {
      let h = rF(u);
      return n.highlightRegex && (h = ip(n.highlightRegex, h)), h;
    }, c = (u, h, f) => {
      const g = l(u);
      return h ? o.jsx(nF, {
        options: n.linkifyOpts,
        children: g
      }, f) : o.jsx(p.Fragment, {
        children: g
      }, f);
    }, d = {
      replace: (u) => {
        var _a6;
        if (r && u instanceof mw) {
          const h = r(u.data, (f, g) => c(f, JW(u), g));
          if (h !== void 0) return h;
        }
        if (u instanceof hg && "name" in u) {
          const { name: h, attribs: f, children: g, parent: m } = u, v = () => uoe(g, d), y = C6e(f), w = D6e(f);
          if (h === "h1") return o.jsx(D, {
            ...y,
            className: y0,
            size: "H2",
            children: v()
          });
          if (h === "h2") return o.jsx(D, {
            ...y,
            className: y0,
            size: "H3",
            children: v()
          });
          if (h === "h3") return o.jsx(D, {
            ...y,
            className: y0,
            size: "H4",
            children: v()
          });
          if (h === "h4") return o.jsx(D, {
            ...y,
            className: y0,
            size: "H4",
            children: v()
          });
          if (h === "h5") return o.jsx(D, {
            ...y,
            className: y0,
            size: "H5",
            children: v()
          });
          if (h === "h6") return o.jsx(D, {
            ...y,
            className: y0,
            size: "H6",
            children: v()
          });
          if (h === "p") return m instanceof hg && m.name === "li" ? o.jsx(o.Fragment, {
            children: v()
          }) : o.jsx(D, {
            ...y,
            className: gt(GA, OSe),
            size: "Inherit",
            children: v()
          });
          if (h === "sub") return o.jsx(D, {
            ...y,
            className: ZSe,
            size: "Inherit",
            children: v()
          });
          if (h === "hr") return o.jsx("hr", {
            ...y,
            className: JSe
          });
          if (h === "pre") return o.jsx(k6e, {
            attribs: f,
            opts: d,
            children: g
          });
          if (h === "blockquote") return o.jsx(D, {
            ...y,
            size: "Inherit",
            as: "blockquote",
            className: LSe,
            children: v()
          });
          if (h === "ul") return o.jsx("ul", {
            ...y,
            className: $Se,
            children: v()
          });
          if (h === "ol") return o.jsx("ol", {
            ...y,
            className: WSe,
            children: v()
          });
          if (h === "code") {
            if (m && "name" in m && m.name === "pre") {
              const b = v();
              if (typeof b != "string") return;
              const j = Ioe(m instanceof hg ? m.children : [], m instanceof hg ? m.attribs : void 0), k = b.replace(/\n$/, "");
              return o.jsx(joe, {
                code: k,
                language: j,
                allowDetect: false,
                className: typeof y.className == "string" ? y.className : void 0
              });
            }
            return o.jsx(D, {
              as: "code",
              size: "T300",
              className: nh,
              ...y,
              children: v()
            });
          }
          if (h === "a" && typeof y.href == "string") {
            const b = y.href, j = b && K4(b), k = v(), C = {
              ...y,
              target: "_blank",
              rel: E6e(y.rel)
            }, x = g.find((S) => !(S instanceof mw)) ? void 0 : g.map((S) => S instanceof mw ? S.data : "").join();
            if (j && zc(j)) {
              const S = _h(t, e, j, Jd(n.handleMentionClick, x), n.nicknames);
              if (S) return S;
            }
            if (j) {
              const S = Ak(n.settingsLinkBaseUrl, j);
              if (S) {
                const { section: T, focus: A } = S;
                return Aoe({
                  href: j,
                  section: T,
                  focus: A,
                  handleMentionClick: n.handleMentionClick
                });
              }
            }
            return o.jsx("a", {
              ...C,
              children: k
            });
          }
          if (h === "span" && "data-mx-spoiler" in y) return o.jsx("span", {
            ...y,
            role: "button",
            tabIndex: n.handleSpoilerClick ? 0 : -1,
            onKeyDown: n.handleSpoilerClick,
            onClick: n.handleSpoilerClick,
            className: NSe(),
            "aria-pressed": true,
            style: {
              ...w,
              cursor: "pointer"
            },
            children: v()
          });
          if (h === "span" && "data-mx-maths" in y) {
            const b = y["data-mx-maths"];
            if (typeof b == "string") return o.jsx(XW, {
              math: b,
              displayMode: false,
              style: w
            });
          }
          if (h === "div" && "data-mx-maths" in y) {
            const b = y["data-mx-maths"];
            if (typeof b == "string") return o.jsx(XW, {
              math: b,
              displayMode: true,
              style: w
            });
          }
          if (h === "span" && w) return o.jsx("span", {
            ...y,
            style: w,
            children: v()
          });
          if (h === "img") {
            if (!y.src) return null;
            const b = Cn(t, y.src, n.useAuthentication) ?? void 0, j = y.alt || y.title || "[media]", k = y.src.startsWith("mxc://") && !b;
            if (b && !y.src.startsWith("mxc://")) return o.jsx("a", {
              href: b,
              target: "_blank",
              rel: "noreferrer noopener",
              children: y.alt || y.title || b
            });
            if ("data-mx-emoticon" in y) {
              if (!b) {
                const S = y.alt || y.title || "";
                return o.jsx("span", {
                  title: S,
                  className: wu,
                  children: S ? `:${S}:` : ""
                });
              }
              const C = s(y.height);
              return (((_a6 = u.parent) == null ? void 0 : _a6.children.length) ?? 0) > 5 ? o.jsx("span", {
                className: wu,
                children: o.jsx("span", {
                  className: q4(),
                  children: n.autoplayEmojis ? o.jsx(B_, {
                    ...y,
                    src: b,
                    className: Fy,
                    height: C,
                    style: {
                      verticalAlign: "middle"
                    },
                    fallback: o.jsx("span", {
                      className: wu,
                      children: y.alt || y.title || "?"
                    })
                  }) : o.jsx(rp, {
                    src: b,
                    children: o.jsx(B_, {
                      ...y,
                      src: b,
                      className: Fy,
                      height: C,
                      style: {
                        verticalAlign: "middle"
                      },
                      fallback: o.jsx("span", {
                        className: wu,
                        children: y.alt || y.title || "?"
                      })
                    })
                  })
                })
              }) : o.jsx("span", {
                className: wu,
                children: o.jsx("span", {
                  className: q4(),
                  children: n.autoplayEmojis ? o.jsx(B_, {
                    ...y,
                    src: b,
                    className: Fy,
                    height: C,
                    fallback: o.jsx("span", {
                      className: wu,
                      children: y.alt || y.title || "?"
                    })
                  }) : o.jsx(rp, {
                    src: b,
                    children: o.jsx(B_, {
                      ...y,
                      src: b,
                      className: Fy,
                      height: C,
                      fallback: o.jsx("span", {
                        className: wu,
                        children: y.alt || y.title || "?"
                      })
                    })
                  })
                })
              });
            }
            if (k) return o.jsx("span", {
              title: `Failed to load media${y.alt ? `: ${y.alt}` : ""}`,
              children: j
            });
            if (b) return o.jsx(B_, {
              ...y,
              className: qSe,
              src: b,
              height: s(y.height),
              fallback: o.jsx("span", {
                title: `Failed to load media${y.alt ? `: ${y.alt}` : ""}`,
                children: y.alt || "[media]"
              })
            });
          }
        }
        if (u instanceof mw) {
          const h = JW(u), f = l(u.data);
          return h ? o.jsx(nF, {
            options: n.linkifyOpts,
            children: f
          }) : f;
        }
      }
    };
    return d;
  }, Xd = () => p.useCallback((e) => {
    const n = e.currentTarget;
    n.getAttribute("aria-pressed") === "true" && (e.stopPropagation(), n.setAttribute("aria-pressed", "false"), n.style.cursor = "initial");
  }, []);
  var S6e = Jr({
    defaultClassName: "layout_MessageBase__1r9nvasg _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      space: {
        0: "layout_MessageBase_space_0__1r9nvash layout_SpacingVariant_0__1r9nvas2",
        100: "layout_MessageBase_space_100__1r9nvasi layout_SpacingVariant_100__1r9nvas3",
        200: "layout_MessageBase_space_200__1r9nvasj layout_SpacingVariant_200__1r9nvas4",
        300: "layout_MessageBase_space_300__1r9nvask layout_SpacingVariant_300__1r9nvas5",
        400: "layout_MessageBase_space_400__1r9nvasl layout_SpacingVariant_400__1r9nvas6",
        500: "layout_MessageBase_space_500__1r9nvasm layout_SpacingVariant_500__1r9nvas7"
      },
      collapse: {
        true: "layout_MessageBase_collapse_true__1r9nvasn"
      },
      autoCollapse: {
        true: "layout_MessageBase_autoCollapse_true__1r9nvaso layout_AutoCollapse__1r9nvasf"
      },
      highlight: {
        true: "layout_MessageBase_highlight_true__1r9nvasp layout_HighlightVariant_true__1r9nvasa layout_messageJumpHighlight__1r9nvas9"
      },
      notifyHighlight: {
        silent: "layout_MessageBase_notifyHighlight_silent__1r9nvasq layout_NotifyHighlightVariant_silent__1r9nvasb",
        loud: "layout_MessageBase_notifyHighlight_loud__1r9nvasr layout_NotifyHighlightVariant_loud__1r9nvasc"
      },
      selected: {
        true: "layout_MessageBase_selected_true__1r9nvass layout_SelectedVariant_true__1r9nvasd"
      },
      isMarked: {
        true: "layout_MessageBase_isMarked_true__1r9nvast layout_MarkedVariant_true__1r9nvase"
      }
    },
    defaultVariants: {
      space: "400"
    },
    compoundVariants: []
  }), j6e = "layout_CompactHeader__1r9nvasu _1mqalmd1 _1mqalmd0 layout_StickySection__1r9nvas0", T6e = "layout_AvatarBase__1r9nvasv", R6e = "layout_ModernBefore__1r9nvasw", nq = "layout_BubbleBefore__1r9nvasx", A6e = "layout_BubbleWrapper__1r9nvasy", I6e = "layout_BubbleContent__1r9nvasz", B6e = "layout_BubbleContentArrowLeft__1r9nvas10", P6e = "layout_BubbleContentArrowRight__1r9nvas11", M6e = "layout_BubbleLeftArrow__1r9nvas12", O6e = "layout_BubbleRightArrow__1r9nvas13", L6e = "layout_Username__1r9nvas14", N6e = "layout_UsernameBold__1r9nvas15", z6e = "layout_PronounPill__1r9nvas16", U6e = Jr({
    defaultClassName: "layout_MessageTextBody__1r9nvas17",
    variantClassNames: {
      preWrap: {
        true: "layout_MessageTextBody_preWrap_true__1r9nvas18"
      },
      jumboEmoji: {
        none: "layout_MessageTextBody_jumboEmoji_none__1r9nvas19",
        extraSmall: "layout_MessageTextBody_jumboEmoji_extraSmall__1r9nvas1a",
        small: "layout_MessageTextBody_jumboEmoji_small__1r9nvas1b",
        normal: "layout_MessageTextBody_jumboEmoji_normal__1r9nvas1c",
        large: "layout_MessageTextBody_jumboEmoji_large__1r9nvas1d",
        extraLarge: "layout_MessageTextBody_jumboEmoji_extraLarge__1r9nvas1e"
      },
      emote: {
        true: "layout_MessageTextBody_emote_true__1r9nvas1f"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  });
  const Cp = ft(({ before: t, children: e, ...n }, r) => o.jsxs(E, {
    gap: "300",
    ...n,
    ref: r,
    children: [
      o.jsx(E, {
        className: R6e,
        shrink: "No",
        children: t
      }),
      o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        children: e
      })
    ]
  })), bP = ft(({ before: t, children: e, ...n }, r) => o.jsxs(E, {
    gap: "200",
    ...n,
    ref: r,
    children: [
      o.jsx(E, {
        className: j6e,
        gap: "200",
        shrink: "No",
        children: t
      }),
      e
    ]
  }));
  function V6e({ variant: t }) {
    return o.jsx("svg", {
      className: M6e,
      width: "9",
      height: "8",
      viewBox: "0 0 9 8",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: o.jsx("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M9.00004 8V0H4.82847C3.04666 0 2.15433 2.15428 3.41426 3.41421L8.00004 8H9.00004Z",
        fill: ct[t].Container
      })
    });
  }
  function H6e({ variant: t }) {
    return o.jsx("svg", {
      className: O6e,
      style: {
        transform: "scaleX(-1)"
      },
      width: "9",
      height: "8",
      viewBox: "0 0 9 8",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: o.jsx("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M9.00004 8V0H4.82847C3.04666 0 2.15433 2.15428 3.41426 3.41421L8.00004 8H9.00004Z",
        fill: ct[t].Container
      })
    });
  }
  const Boe = ft(({ hideBubble: t, before: e, header: n, align: r = "left", children: i, ...a }, s) => {
    const l = r === "right";
    return o.jsxs(E, {
      gap: "300",
      ...a,
      ref: s,
      children: [
        !l && o.jsx(E, {
          className: nq,
          shrink: "No",
          children: e
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          alignItems: l ? "End" : "Start",
          children: [
            n,
            t ? i : o.jsx(E, {
              className: A6e,
              children: o.jsxs(E, {
                className: t ? void 0 : gt(I6e, e && !l ? B6e : void 0, e && l ? P6e : void 0),
                direction: "Column",
                children: [
                  e && !l ? o.jsx(V6e, {
                    variant: "SurfaceVariant"
                  }) : null,
                  e && l ? o.jsx(H6e, {
                    variant: "SurfaceVariant"
                  }) : null,
                  i
                ]
              })
            })
          ]
        }),
        l && o.jsx(E, {
          className: nq,
          shrink: "No",
          children: e
        })
      ]
    });
  }), Xy = ft(({ className: t, highlight: e, notifyHighlight: n, selected: r, isMarked: i, collapse: a, autoCollapse: s, space: l, ...c }, d) => o.jsx("div", {
    className: gt(S6e({
      highlight: e,
      notifyHighlight: n,
      isMarked: i,
      selected: r,
      collapse: a,
      autoCollapse: s,
      space: l
    }), t),
    ...c,
    ref: d
  })), s3 = ft(({ className: t, ...e }, n) => o.jsx("span", {
    className: gt(T6e, t),
    ...e,
    ref: n
  })), l3 = ft(({ as: t = "span", className: e, ...n }, r) => o.jsx(t, {
    className: gt(L6e, e),
    ...n,
    ref: r
  })), iF = ft(({ as: t = "b", className: e, ...n }, r) => o.jsx(t, {
    className: gt(N6e, e),
    ...n,
    ref: r
  })), Poe = ft(({ as: t = "span", className: e, ...n }, r) => o.jsx(t, {
    className: gt(z6e, e),
    ...n,
    ref: r
  })), F1 = ft(({ as: t = "div", children: e, className: n, preWrap: r, jumboEmoji: i, emote: a, notice: s, ...l }, c) => o.jsx(D, {
    as: t,
    size: "T400",
    priority: s ? "300" : "400",
    className: gt(U6e({
      preWrap: r,
      jumboEmoji: i,
      emote: a
    }), n),
    ...l,
    ref: c,
    dir: "auto",
    children: e
  }));
  var $6e = Jr({
    defaultClassName: "LinePlaceholder_LinePlaceholder__xlxsai0 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      variant: {
        Background: "LinePlaceholder_LinePlaceholder_variant_Background__xlxsai1",
        Surface: "LinePlaceholder_LinePlaceholder_variant_Surface__xlxsai2",
        SurfaceVariant: "LinePlaceholder_LinePlaceholder_variant_SurfaceVariant__xlxsai3",
        Primary: "LinePlaceholder_LinePlaceholder_variant_Primary__xlxsai4",
        Secondary: "LinePlaceholder_LinePlaceholder_variant_Secondary__xlxsai5",
        Success: "LinePlaceholder_LinePlaceholder_variant_Success__xlxsai6",
        Warning: "LinePlaceholder_LinePlaceholder_variant_Warning__xlxsai7",
        Critical: "LinePlaceholder_LinePlaceholder_variant_Critical__xlxsai8"
      }
    },
    defaultVariants: {
      variant: "SurfaceVariant"
    },
    compoundVariants: []
  });
  const _f = ft(({ className: t, variant: e, ...n }, r) => o.jsx(E, {
    className: gt($6e({
      variant: e
    }), t),
    shrink: "No",
    ...n,
    ref: r
  })), W6e = ft(({ variant: t, ...e }, n) => {
    const r = p.useMemo(() => i1(40, 100), []), i = p.useMemo(() => i1(120, 500), []);
    return o.jsx(bP, {
      ...e,
      ref: n,
      before: o.jsxs(o.Fragment, {
        children: [
          o.jsx(_f, {
            variant: t,
            style: {
              maxWidth: He(50)
            }
          }),
          o.jsx(_f, {
            variant: t,
            style: {
              maxWidth: He(r)
            }
          })
        ]
      }),
      children: o.jsx(_f, {
        variant: t,
        style: {
          maxWidth: He(i)
        }
      })
    });
  }), q6e = {
    marginTop: He(3)
  }, Moe = ft(({ variant: t, ...e }, n) => {
    const r = p.useMemo(() => i1(40, 100), []), i = p.useMemo(() => i1(80, 200), []), a = p.useMemo(() => i1(80, 200), []);
    return o.jsx(Cp, {
      ...e,
      ref: n,
      before: o.jsx(xn, {
        style: {
          backgroundColor: ct[t ?? "SurfaceVariant"].Container
        },
        size: "300"
      }),
      children: o.jsxs(E, {
        style: q6e,
        grow: "Yes",
        direction: "Column",
        gap: "200",
        children: [
          o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            alignItems: "Center",
            justifyContent: "SpaceBetween",
            children: [
              o.jsx(_f, {
                variant: t,
                style: {
                  maxWidth: He(r)
                }
              }),
              o.jsx(_f, {
                variant: t,
                style: {
                  maxWidth: He(50)
                }
              })
            ]
          }),
          o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            wrap: "Wrap",
            children: [
              o.jsx(_f, {
                variant: t,
                style: {
                  maxWidth: He(i)
                }
              }),
              o.jsx(_f, {
                variant: t,
                style: {
                  maxWidth: He(a)
                }
              })
            ]
          })
        ]
      })
    });
  }), qr = vn({}), Ooe = vn(null, (t, e, n, r, i) => {
    const s = {
      ...t(qr)
    };
    r === void 0 || r.trim() === "" ? delete s[n] : s[n] = r.trim(), e(qr, s), i.setAccountData(Zr.SableNicknames, s);
  });
  var K6e = "Reaction_Reaction__1ofy2965 _1bugis90", G6e = "Reaction_ReactionText__1ofy2966 _1mqalmd1 _1mqalmd0", Y6e = "Reaction_ReactionImg__1ofy2967 _1mqalmd1 _1mqalmd0";
  const Loe = ft(({ className: t, mx: e, count: n, reaction: r, useAuthentication: i, ...a }, s) => {
    const [l, c] = p.useState(false);
    return o.jsxs(E, {
      as: "button",
      className: gt(K6e, t),
      alignItems: "Center",
      shrink: "No",
      gap: "200",
      ...a,
      ref: s,
      children: [
        o.jsx(D, {
          className: G6e,
          as: "span",
          size: "T400",
          children: r.startsWith("mxc://") ? l ? o.jsx("span", {
            title: "Failed to load emoji image",
            "aria-label": "Failed to load emoji image",
            children: o.jsx(Q, {
              size: "100",
              src: q.Warning,
              style: {
                opacity: 0.5
              }
            })
          }) : o.jsx("img", {
            className: Y6e,
            src: Cn(e, r, i) ?? r,
            alt: r,
            onError: () => c(true)
          }) : o.jsx(D, {
            as: "span",
            size: "Inherit",
            truncate: true,
            children: r
          })
        }),
        o.jsx(D, {
          as: "span",
          size: "T300",
          children: n
        })
      ]
    });
  });
  function Z6e({ room: t, reaction: e, events: n }) {
    var _a6;
    const i = ((_a6 = n.find(NB)) == null ? void 0 : _a6.getContent().shortcode) ?? vP(_P(e)) ?? e, a = Ze(qr), s = n.map((l) => gr(t, l.getSender() ?? "Unknown", a) ?? _n(l.getSender() ?? "Unknown") ?? "Unknown");
    return o.jsxs(o.Fragment, {
      children: [
        s.length === 1 && o.jsx("b", {
          children: s[0]
        }),
        s.length === 2 && o.jsxs(o.Fragment, {
          children: [
            o.jsx("b", {
              children: s[0]
            }),
            o.jsx(D, {
              as: "span",
              size: "Inherit",
              priority: "300",
              children: " and "
            }),
            o.jsx("b", {
              children: s[1]
            })
          ]
        }),
        s.length === 3 && o.jsxs(o.Fragment, {
          children: [
            o.jsx("b", {
              children: s[0]
            }),
            o.jsx(D, {
              as: "span",
              size: "Inherit",
              priority: "300",
              children: ", "
            }),
            o.jsx("b", {
              children: s[1]
            }),
            o.jsx(D, {
              as: "span",
              size: "Inherit",
              priority: "300",
              children: " and "
            }),
            o.jsx("b", {
              children: s[2]
            })
          ]
        }),
        s.length > 3 && o.jsxs(o.Fragment, {
          children: [
            o.jsx("b", {
              children: s[0]
            }),
            o.jsx(D, {
              as: "span",
              size: "Inherit",
              priority: "300",
              children: ", "
            }),
            o.jsx("b", {
              children: s[1]
            }),
            o.jsx(D, {
              as: "span",
              size: "Inherit",
              priority: "300",
              children: ", "
            }),
            o.jsx("b", {
              children: s[2]
            }),
            o.jsx(D, {
              as: "span",
              size: "Inherit",
              priority: "300",
              children: " and "
            }),
            o.jsxs("b", {
              children: [
                s.length - 3,
                " others"
              ]
            })
          ]
        }),
        o.jsx(D, {
          as: "span",
          size: "Inherit",
          priority: "300",
          children: " reacted with "
        }),
        ":",
        o.jsx("b", {
          children: i
        }),
        ":"
      ]
    });
  }
  var J6e = Jr({
    defaultClassName: "Attachment_Attachment__uox78s0",
    variantClassNames: {
      outlined: {
        true: "Attachment_Attachment_outlined_true__uox78s1"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), X6e = "Attachment_AttachmentHeader__uox78s2", Q6e = "Attachment_AttachmentBox__uox78s3 _1mqalmd1 _1mqalmd0", eje = "Attachment_AttachmentContent__uox78s4";
  const c3 = ft(({ className: t, outlined: e, ...n }, r) => o.jsx(E, {
    display: "InlineFlex",
    direction: "Column",
    className: gt(J6e({
      outlined: e
    }), t),
    ...n,
    ref: r
  })), d3 = ft(({ className: t, ...e }, n) => o.jsx(E, {
    shrink: "No",
    gap: "200",
    className: gt(X6e, t),
    ...e,
    ref: n
  })), LF = ft(({ className: t, ...e }, n) => o.jsx(E, {
    direction: "Column",
    className: gt(Q6e, t),
    ...e,
    ref: n
  })), Noe = ft(({ className: t, ...e }, n) => o.jsx(E, {
    direction: "Column",
    className: gt(eje, t),
    ...e,
    ref: n
  }));
  const { entries: zoe, setPrototypeOf: rq, isFrozen: tje, getPrototypeOf: nje, getOwnPropertyDescriptor: rje } = Object;
  let { freeze: us, seal: ql, create: LD } = Object, { apply: ZA, construct: JA } = typeof Reflect < "u" && Reflect;
  us || (us = function(e) {
    return e;
  });
  ql || (ql = function(e) {
    return e;
  });
  ZA || (ZA = function(e, n) {
    for (var r = arguments.length, i = new Array(r > 2 ? r - 2 : 0), a = 2; a < r; a++) i[a - 2] = arguments[a];
    return e.apply(n, i);
  });
  JA || (JA = function(e) {
    for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
    return new e(...r);
  });
  const vw = hs(Array.prototype.forEach), ije = hs(Array.prototype.lastIndexOf), iq = hs(Array.prototype.pop), P_ = hs(Array.prototype.push), oje = hs(Array.prototype.splice), ND = hs(String.prototype.toLowerCase), N9 = hs(String.prototype.toString), z9 = hs(String.prototype.match), M_ = hs(String.prototype.replace), aje = hs(String.prototype.indexOf), sje = hs(String.prototype.trim), Gs = hs(Object.prototype.hasOwnProperty), Qa = hs(RegExp.prototype.test), O_ = lje(TypeError);
  function hs(t) {
    return function(e) {
      e instanceof RegExp && (e.lastIndex = 0);
      for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
      return ZA(t, e, r);
    };
  }
  function lje(t) {
    return function() {
      for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
      return JA(t, n);
    };
  }
  function Ir(t, e) {
    let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ND;
    rq && rq(t, null);
    let r = e.length;
    for (; r--; ) {
      let i = e[r];
      if (typeof i == "string") {
        const a = n(i);
        a !== i && (tje(e) || (e[r] = a), i = a);
      }
      t[i] = true;
    }
    return t;
  }
  function cje(t) {
    for (let e = 0; e < t.length; e++) Gs(t, e) || (t[e] = null);
    return t;
  }
  function Fd(t) {
    const e = LD(null);
    for (const [n, r] of zoe(t)) Gs(t, n) && (Array.isArray(r) ? e[n] = cje(r) : r && typeof r == "object" && r.constructor === Object ? e[n] = Fd(r) : e[n] = r);
    return e;
  }
  function L_(t, e) {
    for (; t !== null; ) {
      const r = rje(t, e);
      if (r) {
        if (r.get) return hs(r.get);
        if (typeof r.value == "function") return hs(r.value);
      }
      t = nje(t);
    }
    function n() {
      return null;
    }
    return n;
  }
  const oq = us([
    "a",
    "abbr",
    "acronym",
    "address",
    "area",
    "article",
    "aside",
    "audio",
    "b",
    "bdi",
    "bdo",
    "big",
    "blink",
    "blockquote",
    "body",
    "br",
    "button",
    "canvas",
    "caption",
    "center",
    "cite",
    "code",
    "col",
    "colgroup",
    "content",
    "data",
    "datalist",
    "dd",
    "decorator",
    "del",
    "details",
    "dfn",
    "dialog",
    "dir",
    "div",
    "dl",
    "dt",
    "element",
    "em",
    "fieldset",
    "figcaption",
    "figure",
    "font",
    "footer",
    "form",
    "h1",
    "h2",
    "h3",
    "h4",
    "h5",
    "h6",
    "head",
    "header",
    "hgroup",
    "hr",
    "html",
    "i",
    "img",
    "input",
    "ins",
    "kbd",
    "label",
    "legend",
    "li",
    "main",
    "map",
    "mark",
    "marquee",
    "menu",
    "menuitem",
    "meter",
    "nav",
    "nobr",
    "ol",
    "optgroup",
    "option",
    "output",
    "p",
    "picture",
    "pre",
    "progress",
    "q",
    "rp",
    "rt",
    "ruby",
    "s",
    "samp",
    "search",
    "section",
    "select",
    "shadow",
    "slot",
    "small",
    "source",
    "spacer",
    "span",
    "strike",
    "strong",
    "style",
    "sub",
    "summary",
    "sup",
    "table",
    "tbody",
    "td",
    "template",
    "textarea",
    "tfoot",
    "th",
    "thead",
    "time",
    "tr",
    "track",
    "tt",
    "u",
    "ul",
    "var",
    "video",
    "wbr"
  ]), U9 = us([
    "svg",
    "a",
    "altglyph",
    "altglyphdef",
    "altglyphitem",
    "animatecolor",
    "animatemotion",
    "animatetransform",
    "circle",
    "clippath",
    "defs",
    "desc",
    "ellipse",
    "enterkeyhint",
    "exportparts",
    "filter",
    "font",
    "g",
    "glyph",
    "glyphref",
    "hkern",
    "image",
    "inputmode",
    "line",
    "lineargradient",
    "marker",
    "mask",
    "metadata",
    "mpath",
    "part",
    "path",
    "pattern",
    "polygon",
    "polyline",
    "radialgradient",
    "rect",
    "stop",
    "style",
    "switch",
    "symbol",
    "text",
    "textpath",
    "title",
    "tref",
    "tspan",
    "view",
    "vkern"
  ]), V9 = us([
    "feBlend",
    "feColorMatrix",
    "feComponentTransfer",
    "feComposite",
    "feConvolveMatrix",
    "feDiffuseLighting",
    "feDisplacementMap",
    "feDistantLight",
    "feDropShadow",
    "feFlood",
    "feFuncA",
    "feFuncB",
    "feFuncG",
    "feFuncR",
    "feGaussianBlur",
    "feImage",
    "feMerge",
    "feMergeNode",
    "feMorphology",
    "feOffset",
    "fePointLight",
    "feSpecularLighting",
    "feSpotLight",
    "feTile",
    "feTurbulence"
  ]), dje = us([
    "animate",
    "color-profile",
    "cursor",
    "discard",
    "font-face",
    "font-face-format",
    "font-face-name",
    "font-face-src",
    "font-face-uri",
    "foreignobject",
    "hatch",
    "hatchpath",
    "mesh",
    "meshgradient",
    "meshpatch",
    "meshrow",
    "missing-glyph",
    "script",
    "set",
    "solidcolor",
    "unknown",
    "use"
  ]), H9 = us([
    "math",
    "menclose",
    "merror",
    "mfenced",
    "mfrac",
    "mglyph",
    "mi",
    "mlabeledtr",
    "mmultiscripts",
    "mn",
    "mo",
    "mover",
    "mpadded",
    "mphantom",
    "mroot",
    "mrow",
    "ms",
    "mspace",
    "msqrt",
    "mstyle",
    "msub",
    "msup",
    "msubsup",
    "mtable",
    "mtd",
    "mtext",
    "mtr",
    "munder",
    "munderover",
    "mprescripts"
  ]), uje = us([
    "maction",
    "maligngroup",
    "malignmark",
    "mlongdiv",
    "mscarries",
    "mscarry",
    "msgroup",
    "mstack",
    "msline",
    "msrow",
    "semantics",
    "annotation",
    "annotation-xml",
    "mprescripts",
    "none"
  ]), aq = us([
    "#text"
  ]), sq = us([
    "accept",
    "action",
    "align",
    "alt",
    "autocapitalize",
    "autocomplete",
    "autopictureinpicture",
    "autoplay",
    "background",
    "bgcolor",
    "border",
    "capture",
    "cellpadding",
    "cellspacing",
    "checked",
    "cite",
    "class",
    "clear",
    "color",
    "cols",
    "colspan",
    "controls",
    "controlslist",
    "coords",
    "crossorigin",
    "datetime",
    "decoding",
    "default",
    "dir",
    "disabled",
    "disablepictureinpicture",
    "disableremoteplayback",
    "download",
    "draggable",
    "enctype",
    "enterkeyhint",
    "exportparts",
    "face",
    "for",
    "headers",
    "height",
    "hidden",
    "high",
    "href",
    "hreflang",
    "id",
    "inert",
    "inputmode",
    "integrity",
    "ismap",
    "kind",
    "label",
    "lang",
    "list",
    "loading",
    "loop",
    "low",
    "max",
    "maxlength",
    "media",
    "method",
    "min",
    "minlength",
    "multiple",
    "muted",
    "name",
    "nonce",
    "noshade",
    "novalidate",
    "nowrap",
    "open",
    "optimum",
    "part",
    "pattern",
    "placeholder",
    "playsinline",
    "popover",
    "popovertarget",
    "popovertargetaction",
    "poster",
    "preload",
    "pubdate",
    "radiogroup",
    "readonly",
    "rel",
    "required",
    "rev",
    "reversed",
    "role",
    "rows",
    "rowspan",
    "spellcheck",
    "scope",
    "selected",
    "shape",
    "size",
    "sizes",
    "slot",
    "span",
    "srclang",
    "start",
    "src",
    "srcset",
    "step",
    "style",
    "summary",
    "tabindex",
    "title",
    "translate",
    "type",
    "usemap",
    "valign",
    "value",
    "width",
    "wrap",
    "xmlns",
    "slot"
  ]), $9 = us([
    "accent-height",
    "accumulate",
    "additive",
    "alignment-baseline",
    "amplitude",
    "ascent",
    "attributename",
    "attributetype",
    "azimuth",
    "basefrequency",
    "baseline-shift",
    "begin",
    "bias",
    "by",
    "class",
    "clip",
    "clippathunits",
    "clip-path",
    "clip-rule",
    "color",
    "color-interpolation",
    "color-interpolation-filters",
    "color-profile",
    "color-rendering",
    "cx",
    "cy",
    "d",
    "dx",
    "dy",
    "diffuseconstant",
    "direction",
    "display",
    "divisor",
    "dur",
    "edgemode",
    "elevation",
    "end",
    "exponent",
    "fill",
    "fill-opacity",
    "fill-rule",
    "filter",
    "filterunits",
    "flood-color",
    "flood-opacity",
    "font-family",
    "font-size",
    "font-size-adjust",
    "font-stretch",
    "font-style",
    "font-variant",
    "font-weight",
    "fx",
    "fy",
    "g1",
    "g2",
    "glyph-name",
    "glyphref",
    "gradientunits",
    "gradienttransform",
    "height",
    "href",
    "id",
    "image-rendering",
    "in",
    "in2",
    "intercept",
    "k",
    "k1",
    "k2",
    "k3",
    "k4",
    "kerning",
    "keypoints",
    "keysplines",
    "keytimes",
    "lang",
    "lengthadjust",
    "letter-spacing",
    "kernelmatrix",
    "kernelunitlength",
    "lighting-color",
    "local",
    "marker-end",
    "marker-mid",
    "marker-start",
    "markerheight",
    "markerunits",
    "markerwidth",
    "maskcontentunits",
    "maskunits",
    "max",
    "mask",
    "mask-type",
    "media",
    "method",
    "mode",
    "min",
    "name",
    "numoctaves",
    "offset",
    "operator",
    "opacity",
    "order",
    "orient",
    "orientation",
    "origin",
    "overflow",
    "paint-order",
    "path",
    "pathlength",
    "patterncontentunits",
    "patterntransform",
    "patternunits",
    "points",
    "preservealpha",
    "preserveaspectratio",
    "primitiveunits",
    "r",
    "rx",
    "ry",
    "radius",
    "refx",
    "refy",
    "repeatcount",
    "repeatdur",
    "restart",
    "result",
    "rotate",
    "scale",
    "seed",
    "shape-rendering",
    "slope",
    "specularconstant",
    "specularexponent",
    "spreadmethod",
    "startoffset",
    "stddeviation",
    "stitchtiles",
    "stop-color",
    "stop-opacity",
    "stroke-dasharray",
    "stroke-dashoffset",
    "stroke-linecap",
    "stroke-linejoin",
    "stroke-miterlimit",
    "stroke-opacity",
    "stroke",
    "stroke-width",
    "style",
    "surfacescale",
    "systemlanguage",
    "tabindex",
    "tablevalues",
    "targetx",
    "targety",
    "transform",
    "transform-origin",
    "text-anchor",
    "text-decoration",
    "text-rendering",
    "textlength",
    "type",
    "u1",
    "u2",
    "unicode",
    "values",
    "viewbox",
    "visibility",
    "version",
    "vert-adv-y",
    "vert-origin-x",
    "vert-origin-y",
    "width",
    "word-spacing",
    "wrap",
    "writing-mode",
    "xchannelselector",
    "ychannelselector",
    "x",
    "x1",
    "x2",
    "xmlns",
    "y",
    "y1",
    "y2",
    "z",
    "zoomandpan"
  ]), lq = us([
    "accent",
    "accentunder",
    "align",
    "bevelled",
    "close",
    "columnsalign",
    "columnlines",
    "columnspan",
    "denomalign",
    "depth",
    "dir",
    "display",
    "displaystyle",
    "encoding",
    "fence",
    "frame",
    "height",
    "href",
    "id",
    "largeop",
    "length",
    "linethickness",
    "lspace",
    "lquote",
    "mathbackground",
    "mathcolor",
    "mathsize",
    "mathvariant",
    "maxsize",
    "minsize",
    "movablelimits",
    "notation",
    "numalign",
    "open",
    "rowalign",
    "rowlines",
    "rowspacing",
    "rowspan",
    "rspace",
    "rquote",
    "scriptlevel",
    "scriptminsize",
    "scriptsizemultiplier",
    "selection",
    "separator",
    "separators",
    "stretchy",
    "subscriptshift",
    "supscriptshift",
    "symmetric",
    "voffset",
    "width",
    "xmlns"
  ]), _w = us([
    "xlink:href",
    "xml:id",
    "xlink:title",
    "xml:space",
    "xmlns:xlink"
  ]), hje = ql(/\{\{[\w\W]*|[\w\W]*\}\}/gm), fje = ql(/<%[\w\W]*|[\w\W]*%>/gm), mje = ql(/\$\{[\w\W]*/gm), gje = ql(/^data-[\-\w.\u00B7-\uFFFF]+$/), pje = ql(/^aria-[\-\w]+$/), Uoe = ql(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Fje = ql(/^(?:\w+script|data):/i), vje = ql(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Voe = ql(/^html$/i), _je = ql(/^[a-z][.\w]*(-[.\w]+)+$/i);
  var cq = Object.freeze({
    __proto__: null,
    ARIA_ATTR: pje,
    ATTR_WHITESPACE: vje,
    CUSTOM_ELEMENT: _je,
    DATA_ATTR: gje,
    DOCTYPE_NAME: Voe,
    ERB_EXPR: fje,
    IS_ALLOWED_URI: Uoe,
    IS_SCRIPT_OR_DATA: Fje,
    MUSTACHE_EXPR: hje,
    TMPLIT_EXPR: mje
  });
  const N_ = {
    element: 1,
    text: 3,
    progressingInstruction: 7,
    comment: 8,
    document: 9
  }, yje = function() {
    return typeof window > "u" ? null : window;
  }, bje = function(e, n) {
    if (typeof e != "object" || typeof e.createPolicy != "function") return null;
    let r = null;
    const i = "data-tt-policy-suffix";
    n && n.hasAttribute(i) && (r = n.getAttribute(i));
    const a = "dompurify" + (r ? "#" + r : "");
    try {
      return e.createPolicy(a, {
        createHTML(s) {
          return s;
        },
        createScriptURL(s) {
          return s;
        }
      });
    } catch {
      return console.warn("TrustedTypes policy " + a + " could not be created."), null;
    }
  }, dq = function() {
    return {
      afterSanitizeAttributes: [],
      afterSanitizeElements: [],
      afterSanitizeShadowDOM: [],
      beforeSanitizeAttributes: [],
      beforeSanitizeElements: [],
      beforeSanitizeShadowDOM: [],
      uponSanitizeAttribute: [],
      uponSanitizeElement: [],
      uponSanitizeShadowNode: []
    };
  };
  function Hoe() {
    let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yje();
    const e = (vt) => Hoe(vt);
    if (e.version = "3.3.3", e.removed = [], !t || !t.document || t.document.nodeType !== N_.document || !t.Element) return e.isSupported = false, e;
    let { document: n } = t;
    const r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: s, Node: l, Element: c, NodeFilter: d, NamedNodeMap: u = t.NamedNodeMap || t.MozNamedAttrMap, HTMLFormElement: h, DOMParser: f, trustedTypes: g } = t, m = c.prototype, v = L_(m, "cloneNode"), y = L_(m, "remove"), w = L_(m, "nextSibling"), b = L_(m, "childNodes"), j = L_(m, "parentNode");
    if (typeof s == "function") {
      const vt = n.createElement("template");
      vt.content && vt.content.ownerDocument && (n = vt.content.ownerDocument);
    }
    let k, C = "";
    const { implementation: x, createNodeIterator: S, createDocumentFragment: T, getElementsByTagName: A } = n, { importNode: B } = r;
    let U = dq();
    e.isSupported = typeof zoe == "function" && typeof j == "function" && x && x.createHTMLDocument !== void 0;
    const { MUSTACHE_EXPR: z, ERB_EXPR: O, TMPLIT_EXPR: M, DATA_ATTR: I, ARIA_ATTR: N, IS_SCRIPT_OR_DATA: L, ATTR_WHITESPACE: H, CUSTOM_ELEMENT: V } = cq;
    let { IS_ALLOWED_URI: Z } = cq, Y = null;
    const oe = Ir({}, [
      ...oq,
      ...U9,
      ...V9,
      ...H9,
      ...aq
    ]);
    let ue = null;
    const ie = Ir({}, [
      ...sq,
      ...$9,
      ...lq,
      ..._w
    ]);
    let de = Object.seal(LD(null, {
      tagNameCheck: {
        writable: true,
        configurable: false,
        enumerable: true,
        value: null
      },
      attributeNameCheck: {
        writable: true,
        configurable: false,
        enumerable: true,
        value: null
      },
      allowCustomizedBuiltInElements: {
        writable: true,
        configurable: false,
        enumerable: true,
        value: false
      }
    })), ne = null, ae = null;
    const X = Object.seal(LD(null, {
      tagCheck: {
        writable: true,
        configurable: false,
        enumerable: true,
        value: null
      },
      attributeCheck: {
        writable: true,
        configurable: false,
        enumerable: true,
        value: null
      }
    }));
    let K = true, G = true, le = false, te = true, re = false, he = true, se = false, ye = false, we = false, Ee = false, ke = false, Ne = false, lt = true, Rt = false;
    const We = "user-content-";
    let yt = true, Xt = false, nn = {}, bt = null;
    const At = Ir({}, [
      "annotation-xml",
      "audio",
      "colgroup",
      "desc",
      "foreignobject",
      "head",
      "iframe",
      "math",
      "mi",
      "mn",
      "mo",
      "ms",
      "mtext",
      "noembed",
      "noframes",
      "noscript",
      "plaintext",
      "script",
      "style",
      "svg",
      "template",
      "thead",
      "title",
      "video",
      "xmp"
    ]);
    let $t = null;
    const Lt = Ir({}, [
      "audio",
      "video",
      "img",
      "source",
      "image",
      "track"
    ]);
    let wt = null;
    const st = Ir({}, [
      "alt",
      "class",
      "for",
      "id",
      "label",
      "name",
      "pattern",
      "placeholder",
      "role",
      "summary",
      "title",
      "value",
      "style",
      "xmlns"
    ]), Be = "http://www.w3.org/1998/Math/MathML", Re = "http://www.w3.org/2000/svg", Ue = "http://www.w3.org/1999/xhtml";
    let qe = Ue, tt = false, ht = null;
    const $e = Ir({}, [
      Be,
      Re,
      Ue
    ], N9);
    let Tt = Ir({}, [
      "mi",
      "mo",
      "mn",
      "ms",
      "mtext"
    ]), zt = Ir({}, [
      "annotation-xml"
    ]);
    const Vt = Ir({}, [
      "title",
      "style",
      "font",
      "a",
      "script"
    ]);
    let bn = null;
    const Zn = [
      "application/xhtml+xml",
      "text/html"
    ], Kn = "text/html";
    let Ce = null, Dt = null;
    const Ut = n.createElement("form"), Zt = function(je) {
      return je instanceof RegExp || je instanceof Function;
    }, ut = function() {
      let je = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      if (!(Dt && Dt === je)) {
        if ((!je || typeof je != "object") && (je = {}), je = Fd(je), bn = Zn.indexOf(je.PARSER_MEDIA_TYPE) === -1 ? Kn : je.PARSER_MEDIA_TYPE, Ce = bn === "application/xhtml+xml" ? N9 : ND, Y = Gs(je, "ALLOWED_TAGS") ? Ir({}, je.ALLOWED_TAGS, Ce) : oe, ue = Gs(je, "ALLOWED_ATTR") ? Ir({}, je.ALLOWED_ATTR, Ce) : ie, ht = Gs(je, "ALLOWED_NAMESPACES") ? Ir({}, je.ALLOWED_NAMESPACES, N9) : $e, wt = Gs(je, "ADD_URI_SAFE_ATTR") ? Ir(Fd(st), je.ADD_URI_SAFE_ATTR, Ce) : st, $t = Gs(je, "ADD_DATA_URI_TAGS") ? Ir(Fd(Lt), je.ADD_DATA_URI_TAGS, Ce) : Lt, bt = Gs(je, "FORBID_CONTENTS") ? Ir({}, je.FORBID_CONTENTS, Ce) : At, ne = Gs(je, "FORBID_TAGS") ? Ir({}, je.FORBID_TAGS, Ce) : Fd({}), ae = Gs(je, "FORBID_ATTR") ? Ir({}, je.FORBID_ATTR, Ce) : Fd({}), nn = Gs(je, "USE_PROFILES") ? je.USE_PROFILES : false, K = je.ALLOW_ARIA_ATTR !== false, G = je.ALLOW_DATA_ATTR !== false, le = je.ALLOW_UNKNOWN_PROTOCOLS || false, te = je.ALLOW_SELF_CLOSE_IN_ATTR !== false, re = je.SAFE_FOR_TEMPLATES || false, he = je.SAFE_FOR_XML !== false, se = je.WHOLE_DOCUMENT || false, Ee = je.RETURN_DOM || false, ke = je.RETURN_DOM_FRAGMENT || false, Ne = je.RETURN_TRUSTED_TYPE || false, we = je.FORCE_BODY || false, lt = je.SANITIZE_DOM !== false, Rt = je.SANITIZE_NAMED_PROPS || false, yt = je.KEEP_CONTENT !== false, Xt = je.IN_PLACE || false, Z = je.ALLOWED_URI_REGEXP || Uoe, qe = je.NAMESPACE || Ue, Tt = je.MATHML_TEXT_INTEGRATION_POINTS || Tt, zt = je.HTML_INTEGRATION_POINTS || zt, de = je.CUSTOM_ELEMENT_HANDLING || {}, je.CUSTOM_ELEMENT_HANDLING && Zt(je.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (de.tagNameCheck = je.CUSTOM_ELEMENT_HANDLING.tagNameCheck), je.CUSTOM_ELEMENT_HANDLING && Zt(je.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (de.attributeNameCheck = je.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), je.CUSTOM_ELEMENT_HANDLING && typeof je.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (de.allowCustomizedBuiltInElements = je.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), re && (G = false), ke && (Ee = true), nn && (Y = Ir({}, aq), ue = LD(null), nn.html === true && (Ir(Y, oq), Ir(ue, sq)), nn.svg === true && (Ir(Y, U9), Ir(ue, $9), Ir(ue, _w)), nn.svgFilters === true && (Ir(Y, V9), Ir(ue, $9), Ir(ue, _w)), nn.mathMl === true && (Ir(Y, H9), Ir(ue, lq), Ir(ue, _w))), Gs(je, "ADD_TAGS") || (X.tagCheck = null), Gs(je, "ADD_ATTR") || (X.attributeCheck = null), je.ADD_TAGS && (typeof je.ADD_TAGS == "function" ? X.tagCheck = je.ADD_TAGS : (Y === oe && (Y = Fd(Y)), Ir(Y, je.ADD_TAGS, Ce))), je.ADD_ATTR && (typeof je.ADD_ATTR == "function" ? X.attributeCheck = je.ADD_ATTR : (ue === ie && (ue = Fd(ue)), Ir(ue, je.ADD_ATTR, Ce))), je.ADD_URI_SAFE_ATTR && Ir(wt, je.ADD_URI_SAFE_ATTR, Ce), je.FORBID_CONTENTS && (bt === At && (bt = Fd(bt)), Ir(bt, je.FORBID_CONTENTS, Ce)), je.ADD_FORBID_CONTENTS && (bt === At && (bt = Fd(bt)), Ir(bt, je.ADD_FORBID_CONTENTS, Ce)), yt && (Y["#text"] = true), se && Ir(Y, [
          "html",
          "head",
          "body"
        ]), Y.table && (Ir(Y, [
          "tbody"
        ]), delete ne.tbody), je.TRUSTED_TYPES_POLICY) {
          if (typeof je.TRUSTED_TYPES_POLICY.createHTML != "function") throw O_('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
          if (typeof je.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw O_('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
          k = je.TRUSTED_TYPES_POLICY, C = k.createHTML("");
        } else k === void 0 && (k = bje(g, i)), k !== null && typeof C == "string" && (C = k.createHTML(""));
        us && us(je), Dt = je;
      }
    }, De = Ir({}, [
      ...U9,
      ...V9,
      ...dje
    ]), Ae = Ir({}, [
      ...H9,
      ...uje
    ]), Ge = function(je) {
      let Ve = j(je);
      (!Ve || !Ve.tagName) && (Ve = {
        namespaceURI: qe,
        tagName: "template"
      });
      const St = ND(je.tagName), pt = ND(Ve.tagName);
      return ht[je.namespaceURI] ? je.namespaceURI === Re ? Ve.namespaceURI === Ue ? St === "svg" : Ve.namespaceURI === Be ? St === "svg" && (pt === "annotation-xml" || Tt[pt]) : !!De[St] : je.namespaceURI === Be ? Ve.namespaceURI === Ue ? St === "math" : Ve.namespaceURI === Re ? St === "math" && zt[pt] : !!Ae[St] : je.namespaceURI === Ue ? Ve.namespaceURI === Re && !zt[pt] || Ve.namespaceURI === Be && !Tt[pt] ? false : !Ae[St] && (Vt[St] || !De[St]) : !!(bn === "application/xhtml+xml" && ht[je.namespaceURI]) : false;
    }, ot = function(je) {
      P_(e.removed, {
        element: je
      });
      try {
        j(je).removeChild(je);
      } catch {
        y(je);
      }
    }, Mt = function(je, Ve) {
      try {
        P_(e.removed, {
          attribute: Ve.getAttributeNode(je),
          from: Ve
        });
      } catch {
        P_(e.removed, {
          attribute: null,
          from: Ve
        });
      }
      if (Ve.removeAttribute(je), je === "is") if (Ee || ke) try {
        ot(Ve);
      } catch {
      }
      else try {
        Ve.setAttribute(je, "");
      } catch {
      }
    }, cn = function(je) {
      let Ve = null, St = null;
      if (we) je = "<remove></remove>" + je;
      else {
        const En = z9(je, /^[\r\n\t ]+/);
        St = En && En[0];
      }
      bn === "application/xhtml+xml" && qe === Ue && (je = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + je + "</body></html>");
      const pt = k ? k.createHTML(je) : je;
      if (qe === Ue) try {
        Ve = new f().parseFromString(pt, bn);
      } catch {
      }
      if (!Ve || !Ve.documentElement) {
        Ve = x.createDocument(qe, "template", null);
        try {
          Ve.documentElement.innerHTML = tt ? C : pt;
        } catch {
        }
      }
      const Ct = Ve.body || Ve.documentElement;
      return je && St && Ct.insertBefore(n.createTextNode(St), Ct.childNodes[0] || null), qe === Ue ? A.call(Ve, se ? "html" : "body")[0] : se ? Ve.documentElement : Ct;
    }, un = function(je) {
      return S.call(je.ownerDocument || je, je, d.SHOW_ELEMENT | d.SHOW_COMMENT | d.SHOW_TEXT | d.SHOW_PROCESSING_INSTRUCTION | d.SHOW_CDATA_SECTION, null);
    }, gn = function(je) {
      return je instanceof h && (typeof je.nodeName != "string" || typeof je.textContent != "string" || typeof je.removeChild != "function" || !(je.attributes instanceof u) || typeof je.removeAttribute != "function" || typeof je.setAttribute != "function" || typeof je.namespaceURI != "string" || typeof je.insertBefore != "function" || typeof je.hasChildNodes != "function");
    }, Ke = function(je) {
      return typeof l == "function" && je instanceof l;
    };
    function it(vt, je, Ve) {
      vw(vt, (St) => {
        St.call(e, je, Ve, Dt);
      });
    }
    const It = function(je) {
      let Ve = null;
      if (it(U.beforeSanitizeElements, je, null), gn(je)) return ot(je), true;
      const St = Ce(je.nodeName);
      if (it(U.uponSanitizeElement, je, {
        tagName: St,
        allowedTags: Y
      }), he && je.hasChildNodes() && !Ke(je.firstElementChild) && Qa(/<[/\w!]/g, je.innerHTML) && Qa(/<[/\w!]/g, je.textContent) || je.nodeType === N_.progressingInstruction || he && je.nodeType === N_.comment && Qa(/<[/\w]/g, je.data)) return ot(je), true;
      if (!(X.tagCheck instanceof Function && X.tagCheck(St)) && (!Y[St] || ne[St])) {
        if (!ne[St] && Sn(St) && (de.tagNameCheck instanceof RegExp && Qa(de.tagNameCheck, St) || de.tagNameCheck instanceof Function && de.tagNameCheck(St))) return false;
        if (yt && !bt[St]) {
          const pt = j(je) || je.parentNode, Ct = b(je) || je.childNodes;
          if (Ct && pt) {
            const En = Ct.length;
            for (let fn = En - 1; fn >= 0; --fn) {
              const ur = v(Ct[fn], true);
              ur.__removalCount = (je.__removalCount || 0) + 1, pt.insertBefore(ur, w(je));
            }
          }
        }
        return ot(je), true;
      }
      return je instanceof c && !Ge(je) || (St === "noscript" || St === "noembed" || St === "noframes") && Qa(/<\/no(script|embed|frames)/i, je.innerHTML) ? (ot(je), true) : (re && je.nodeType === N_.text && (Ve = je.textContent, vw([
        z,
        O,
        M
      ], (pt) => {
        Ve = M_(Ve, pt, " ");
      }), je.textContent !== Ve && (P_(e.removed, {
        element: je.cloneNode()
      }), je.textContent = Ve)), it(U.afterSanitizeElements, je, null), false);
    }, Pt = function(je, Ve, St) {
      if (ae[Ve] || lt && (Ve === "id" || Ve === "name") && (St in n || St in Ut)) return false;
      if (!(G && !ae[Ve] && Qa(I, Ve))) {
        if (!(K && Qa(N, Ve))) {
          if (!(X.attributeCheck instanceof Function && X.attributeCheck(Ve, je))) {
            if (!ue[Ve] || ae[Ve]) {
              if (!(Sn(je) && (de.tagNameCheck instanceof RegExp && Qa(de.tagNameCheck, je) || de.tagNameCheck instanceof Function && de.tagNameCheck(je)) && (de.attributeNameCheck instanceof RegExp && Qa(de.attributeNameCheck, Ve) || de.attributeNameCheck instanceof Function && de.attributeNameCheck(Ve, je)) || Ve === "is" && de.allowCustomizedBuiltInElements && (de.tagNameCheck instanceof RegExp && Qa(de.tagNameCheck, St) || de.tagNameCheck instanceof Function && de.tagNameCheck(St)))) return false;
            } else if (!wt[Ve]) {
              if (!Qa(Z, M_(St, H, ""))) {
                if (!((Ve === "src" || Ve === "xlink:href" || Ve === "href") && je !== "script" && aje(St, "data:") === 0 && $t[je])) {
                  if (!(le && !Qa(L, M_(St, H, "")))) {
                    if (St) return false;
                  }
                }
              }
            }
          }
        }
      }
      return true;
    }, Sn = function(je) {
      return je !== "annotation-xml" && z9(je, V);
    }, Mn = function(je) {
      it(U.beforeSanitizeAttributes, je, null);
      const { attributes: Ve } = je;
      if (!Ve || gn(je)) return;
      const St = {
        attrName: "",
        attrValue: "",
        keepAttr: true,
        allowedAttributes: ue,
        forceKeepAttr: void 0
      };
      let pt = Ve.length;
      for (; pt--; ) {
        const Ct = Ve[pt], { name: En, namespaceURI: fn, value: ur } = Ct, Lr = Ce(En), pn = ur;
        let nt = En === "value" ? pn : sje(pn);
        if (St.attrName = Lr, St.attrValue = nt, St.keepAttr = true, St.forceKeepAttr = void 0, it(U.uponSanitizeAttribute, je, St), nt = St.attrValue, Rt && (Lr === "id" || Lr === "name") && (Mt(En, je), nt = We + nt), he && Qa(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, nt)) {
          Mt(En, je);
          continue;
        }
        if (Lr === "attributename" && z9(nt, "href")) {
          Mt(En, je);
          continue;
        }
        if (St.forceKeepAttr) continue;
        if (!St.keepAttr) {
          Mt(En, je);
          continue;
        }
        if (!te && Qa(/\/>/i, nt)) {
          Mt(En, je);
          continue;
        }
        re && vw([
          z,
          O,
          M
        ], (On) => {
          nt = M_(nt, On, " ");
        });
        const an = Ce(je.nodeName);
        if (!Pt(an, Lr, nt)) {
          Mt(En, je);
          continue;
        }
        if (k && typeof g == "object" && typeof g.getAttributeType == "function" && !fn) switch (g.getAttributeType(an, Lr)) {
          case "TrustedHTML": {
            nt = k.createHTML(nt);
            break;
          }
          case "TrustedScriptURL": {
            nt = k.createScriptURL(nt);
            break;
          }
        }
        if (nt !== pn) try {
          fn ? je.setAttributeNS(fn, En, nt) : je.setAttribute(En, nt), gn(je) ? ot(je) : iq(e.removed);
        } catch {
          Mt(En, je);
        }
      }
      it(U.afterSanitizeAttributes, je, null);
    }, on = function vt(je) {
      let Ve = null;
      const St = un(je);
      for (it(U.beforeSanitizeShadowDOM, je, null); Ve = St.nextNode(); ) it(U.uponSanitizeShadowNode, Ve, null), It(Ve), Mn(Ve), Ve.content instanceof a && vt(Ve.content);
      it(U.afterSanitizeShadowDOM, je, null);
    };
    return e.sanitize = function(vt) {
      let je = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Ve = null, St = null, pt = null, Ct = null;
      if (tt = !vt, tt && (vt = "<!-->"), typeof vt != "string" && !Ke(vt)) if (typeof vt.toString == "function") {
        if (vt = vt.toString(), typeof vt != "string") throw O_("dirty is not a string, aborting");
      } else throw O_("toString is not a function");
      if (!e.isSupported) return vt;
      if (ye || ut(je), e.removed = [], typeof vt == "string" && (Xt = false), Xt) {
        if (vt.nodeName) {
          const ur = Ce(vt.nodeName);
          if (!Y[ur] || ne[ur]) throw O_("root node is forbidden and cannot be sanitized in-place");
        }
      } else if (vt instanceof l) Ve = cn("<!---->"), St = Ve.ownerDocument.importNode(vt, true), St.nodeType === N_.element && St.nodeName === "BODY" || St.nodeName === "HTML" ? Ve = St : Ve.appendChild(St);
      else {
        if (!Ee && !re && !se && vt.indexOf("<") === -1) return k && Ne ? k.createHTML(vt) : vt;
        if (Ve = cn(vt), !Ve) return Ee ? null : Ne ? C : "";
      }
      Ve && we && ot(Ve.firstChild);
      const En = un(Xt ? vt : Ve);
      for (; pt = En.nextNode(); ) It(pt), Mn(pt), pt.content instanceof a && on(pt.content);
      if (Xt) return vt;
      if (Ee) {
        if (ke) for (Ct = T.call(Ve.ownerDocument); Ve.firstChild; ) Ct.appendChild(Ve.firstChild);
        else Ct = Ve;
        return (ue.shadowroot || ue.shadowrootmode) && (Ct = B.call(r, Ct, true)), Ct;
      }
      let fn = se ? Ve.outerHTML : Ve.innerHTML;
      return se && Y["!doctype"] && Ve.ownerDocument && Ve.ownerDocument.doctype && Ve.ownerDocument.doctype.name && Qa(Voe, Ve.ownerDocument.doctype.name) && (fn = "<!DOCTYPE " + Ve.ownerDocument.doctype.name + `>
` + fn), re && vw([
        z,
        O,
        M
      ], (ur) => {
        fn = M_(fn, ur, " ");
      }), k && Ne ? k.createHTML(fn) : fn;
    }, e.setConfig = function() {
      let vt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      ut(vt), ye = true;
    }, e.clearConfig = function() {
      Dt = null, ye = false;
    }, e.isValidAttribute = function(vt, je, Ve) {
      Dt || ut({});
      const St = Ce(vt), pt = Ce(je);
      return Pt(St, pt, Ve);
    }, e.addHook = function(vt, je) {
      typeof je == "function" && P_(U[vt], je);
    }, e.removeHook = function(vt, je) {
      if (je !== void 0) {
        const Ve = ije(U[vt], je);
        return Ve === -1 ? void 0 : oje(U[vt], Ve, 1)[0];
      }
      return iq(U[vt]);
    }, e.removeHooks = function(vt) {
      U[vt] = [];
    }, e.removeAllHooks = function() {
      U = dq();
    }, e;
  }
  var zD = Hoe();
  const xje = 100, ab = "data-sable-img-src", wje = [
    "del",
    "h1",
    "h2",
    "h3",
    "h4",
    "h5",
    "h6",
    "blockquote",
    "p",
    "a",
    "ul",
    "ol",
    "sup",
    "sub",
    "li",
    "b",
    "i",
    "u",
    "strong",
    "em",
    "s",
    "code",
    "hr",
    "br",
    "div",
    "table",
    "thead",
    "tbody",
    "tr",
    "th",
    "td",
    "caption",
    "pre",
    "span",
    "img",
    "details",
    "summary"
  ], $oe = {
    span: [
      "data-mx-bg-color",
      "data-mx-color",
      "data-mx-spoiler",
      "data-mx-maths",
      "data-md"
    ],
    a: [
      "href",
      "data-md"
    ],
    img: [
      "width",
      "height",
      "alt",
      "title",
      "src",
      "data-mx-emoticon"
    ],
    ol: [
      "start",
      "data-md"
    ],
    ul: [
      "data-md"
    ],
    code: [
      "class",
      "data-md",
      "data-lang"
    ],
    pre: [
      "class",
      "data-md",
      "data-lang"
    ],
    div: [
      "data-mx-maths"
    ],
    blockquote: [
      "data-md"
    ],
    h1: [
      "data-md"
    ],
    h2: [
      "data-md"
    ],
    h3: [
      "data-md"
    ],
    h4: [
      "data-md"
    ],
    h5: [
      "data-md"
    ],
    h6: [
      "data-md"
    ],
    strong: [
      "data-md"
    ],
    i: [
      "data-md"
    ],
    em: [
      "data-md"
    ],
    u: [
      "data-md"
    ],
    s: [
      "data-md"
    ],
    del: [
      "data-md"
    ],
    sub: [
      "data-md"
    ],
    hr: [
      "data-md"
    ]
  }, Dje = Array.from(new Set(Object.values($oe).flat())), Cje = /* @__PURE__ */ new Set([
    "https",
    "http",
    "ftp",
    "mailto",
    "magnet"
  ]), Eje = [
    "mx-reply",
    "script",
    "style",
    "textarea",
    "option",
    "noscript"
  ], kje = /^language-[A-Za-z0-9_-]+$/, Sje = /^-?\d+$/, jje = /^(?:https?|ftp|mailto|magnet|mxc):/i;
  function Va(t) {
    const e = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#39;"
    };
    return t.replace(/[&<>'"]/g, (n) => e[n] || n);
  }
  function Tje(t, e) {
    const n = $oe[t];
    return n ? n.includes(e) : false;
  }
  function Rje(t) {
    try {
      const e = new URL(t);
      return Cje.has(e.protocol.slice(0, -1));
    } catch {
      return false;
    }
  }
  function Aje(t) {
    try {
      const e = new URL(t);
      return e.protocol === "mxc:" && e.host.length > 0 && e.pathname.length > 1 && e.username === "" && e.password === "" && e.search === "" && e.hash === "";
    } catch {
      return false;
    }
  }
  function Ije(t) {
    const e = t.split(/\s+/).filter(Boolean);
    if (!(e.length === 0 || e.some((n) => !kje.test(n)))) return e.join(" ");
  }
  function Woe(t, e, n) {
    if (e !== "style" && !((e === "data-mx-color" || e === "data-mx-bg-color") && !np(n)) && !(t === "a" && e === "href" && !Rje(n)) && !(t === "img" && e === "src" && !Aje(n)) && !(t === "ol" && e === "start" && !Sje.test(n))) return (t === "code" || t === "pre") && e === "class" ? Ije(n) : n;
  }
  function qoe(t, e) {
    const n = t ? e == null ? void 0 : e.get(t) : void 0;
    return typeof n == "string" ? Woe("img", "src", n) : void 0;
  }
  function Bje(t) {
    const e = /* @__PURE__ */ new Map();
    return {
      protectedHtml: t.replace(/<img\b[^>]*>/gi, (r) => {
        let i;
        return r.replace(/\s(src|srcset)\s*=\s*("([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/gi, (s, l, c, d, u, h) => {
          if (l.toLowerCase() !== "src" || i !== void 0) return "";
          const f = d ?? u ?? h ?? "";
          return i = `${e.size}`, e.set(i, f), ` ${ab}="${i}"`;
        });
      }),
      protectedSources: e
    };
  }
  function Pje(t, e) {
    return t.replace(new RegExp(`\\s${ab}="([^"]+)"`, "g"), (n, r) => {
      const i = qoe(r, e);
      return i ? ` src="${Va(i)}"` : "";
    });
  }
  const Mje = (t) => {
    const e = [], n = (r, i) => {
      Array.from(r.childNodes).forEach((a) => {
        if (!(a instanceof Element)) return;
        const s = i + 1;
        s > xje && e.push({
          depth: s,
          element: a
        }), n(a, s);
      });
    };
    n(t, 0), e.toSorted((r, i) => i.depth - r.depth).forEach(({ element: r }) => {
      r.parentNode && r.replaceWith(...Array.from(r.childNodes));
    });
  }, Oje = (t, e) => {
    t.querySelectorAll("img").forEach((n) => {
      const r = qoe(n.getAttribute(ab), e);
      !n.getAttribute("src") && !r && n.remove();
    });
  }, Lk = (t) => {
    if (typeof window > "u") return Va(t);
    const { protectedHtml: e, protectedSources: n } = Bje(t), r = zD(window), i = [
      ...Dje,
      ab
    ];
    r.addHook("uponSanitizeAttribute", (c, d) => {
      const u = c.tagName.toLowerCase(), h = d.attrName.toLowerCase();
      if (u === "img" && h === ab) {
        if (!n.has(d.attrValue)) {
          d.keepAttr = false;
          return;
        }
        d.forceKeepAttr = true;
        return;
      }
      if (!Tje(u, h)) {
        d.keepAttr = false;
        return;
      }
      const f = Woe(u, h, d.attrValue);
      if (f === void 0) {
        d.keepAttr = false;
        return;
      }
      d.attrValue = f, d.forceKeepAttr = true;
    });
    const a = r.sanitize(e, {
      ALLOWED_TAGS: [
        ...wje
      ],
      ALLOWED_ATTR: i,
      ALLOW_ARIA_ATTR: false,
      ALLOW_DATA_ATTR: true,
      FORBID_ATTR: [
        "style"
      ],
      FORBID_TAGS: [
        "mx-reply"
      ],
      FORBID_CONTENTS: Eje,
      KEEP_CONTENT: true,
      ALLOWED_URI_REGEXP: jje,
      RETURN_DOM_FRAGMENT: true
    });
    if (!(a instanceof window.DocumentFragment)) return Va(t);
    const s = a;
    Mje(s), Oje(s, n);
    const l = document.createElement("div");
    return l.append(s), Pje(l.innerHTML, n);
  }, Lje = (t, e) => {
    const n = be();
    return p.useCallback(async () => {
      var _a6, _b3;
      const i = await n.fetchRoomEvent(t.roomId, e), a = new to(i);
      if ((_b3 = (_a6 = i.unsigned) == null ? void 0 : _a6["m.relations"]) == null ? void 0 : _b3["m.replace"]) {
        const s = i.unsigned["m.relations"]["m.replace"];
        a.makeReplaced(new to(s));
      }
      return a.isEncrypted() && n.getCrypto() && await ca(a.attemptDecryption(n.getCrypto())), a;
    }, [
      n,
      t.roomId,
      e
    ]);
  }, Koe = (t, e, n) => {
    const r = be(), [, i] = p.useState(0), [a, s] = p.useState(0), l = p.useMemo(() => (n == null ? void 0 : n()) ?? t.findEventById(e), [
      t,
      e,
      n,
      a
    ]);
    p.useEffect(() => {
      if (l !== void 0) return;
      const f = (g) => {
        g.getId() === e && s((m) => m + 1);
      };
      return t.on(mt.Timeline, f), () => {
        t.off(mt.Timeline, f);
      };
    }, [
      t,
      l,
      e
    ]);
    const c = Lje(t, e), { data: d, error: u } = ol({
      enabled: l === void 0,
      queryKey: [
        t.roomId,
        e
      ],
      queryFn: c,
      staleTime: 1 / 0,
      gcTime: 3600 * 1e3,
      retry: 3,
      retryDelay: (f) => Math.min(1e3 * 2 ** f, 3e4)
    });
    p.useEffect(() => {
      if (!(d == null ? void 0 : d.isEncrypted()) || !d.isDecryptionFailure()) return;
      const f = r.getCrypto();
      if (!f) return;
      const g = async () => {
        const [y] = await ca(d.attemptDecryption(f));
        !y && !d.isDecryptionFailure() && i((w) => w + 1);
      }, m = t.getLiveTimeline().getEvents().slice(-50).filter((y) => y.isEncrypted()), v = () => {
        g();
      };
      return m.forEach((y) => y.on(or.Decrypted, v)), () => m.forEach((y) => y.off(or.Decrypted, v));
    }, [
      d,
      t,
      r
    ]);
    const h = l ?? d ?? void 0;
    if (p.useEffect(() => {
      if (!(h == null ? void 0 : h.isEncrypted())) return;
      const f = () => i((g) => g + 1);
      return h.on(or.Decrypted, f), () => {
        h.off(or.Decrypted, f);
      };
    }, [
      h
    ]), l) return l;
    if (d) return d;
    if (u) return null;
  }, vl = (t, e) => {
    p.useEffect(() => (t.on(qn.Events, e), () => {
      t.removeListener(qn.Events, e);
    }), [
      t,
      e
    ]);
  }, Nje = (t) => t + 1, Nk = () => {
    const [t, e] = p.useReducer(Nje, 0);
    return [
      t,
      () => e()
    ];
  }, $i = (t, e, n = "") => {
    const [r, i] = Nk();
    return vl(t.client, p.useCallback((a) => {
      a.getRoomId() === t.roomId && a.getType() === e && a.getStateKey() === n && i();
    }, [
      t,
      e,
      n,
      i
    ])), p.useMemo(() => ni(t, e, n), [
      t,
      e,
      n,
      r
    ]);
  }, Tu = {
    users_default: 0,
    state_default: 50,
    events_default: 0,
    invite: 0,
    redact: 50,
    kick: 50,
    ban: 50,
    historical: 0,
    events: {},
    users: {},
    notifications: {
      room: 50
    }
  }, zje = (t) => uo(t, (e) => (Object.keys(Tu).forEach((r) => {
    e[r] === void 0 && (e[r] = Tu[r] ?? 0);
  }), e.notifications && typeof e.notifications.room != "number" && (e.notifications.room = Tu.notifications.room), e)), Goe = (t) => {
    const e = t == null ? void 0 : t.getContent();
    return e ? zje(e) : Tu;
  };
  function Mo(t) {
    const e = $i(t, ce.RoomPowerLevels);
    return p.useMemo(() => Goe(e), [
      e
    ]);
  }
  const Yoe = p.createContext(null), Zoe = Yoe.Provider, Qd = () => {
    const t = p.useContext(Yoe);
    if (!t) throw new Error("PowerLevelContext is not initialized!");
    return t;
  }, Uje = (t) => {
    const e = be(), n = p.useCallback(() => {
      const a = /* @__PURE__ */ new Map();
      return t.forEach((s) => {
        const l = ni(s, ce.RoomPowerLevels, "");
        a.set(s.roomId, Goe(l));
      }), a;
    }, [
      t
    ]), [r, i] = p.useState(() => n());
    return vl(e, p.useCallback((a) => {
      const s = a.getRoomId();
      s && a.getType() === ce.RoomPowerLevels && a.getStateKey() === "" && t.find((l) => l.roomId === s) && i(n());
    }, [
      t,
      n
    ])), r;
  }, va = {
    user: (t, e) => {
      const { users_default: n, users: r } = t;
      return e && r && typeof r[e] == "number" ? r[e] : n ?? Tu.users_default;
    },
    event: (t, e) => {
      const { events: n, events_default: r } = t;
      return n && e && typeof n[e] == "number" ? n[e] : r ?? Tu.events_default;
    },
    state: (t, e) => {
      const { events: n, state_default: r } = t;
      return n && e && typeof n[e] == "number" ? n[e] : r ?? Tu.state_default;
    },
    action: (t, e) => {
      const n = t[e];
      return typeof n == "number" ? n : Tu[e];
    },
    notification: (t, e) => {
      var _a6;
      const n = (_a6 = t.notifications) == null ? void 0 : _a6[e];
      return typeof n == "number" ? n : Tu.notifications[e] ?? 50;
    }
  }, xP = (t) => p.useCallback((n) => va.user(t, n), [
    t
  ]), UD = (t, e) => "user" in e ? va.user(t, e.key) : "action" in e ? va.action(t, e.key) : "notification" in e ? va.notification(t, e.key) : "state" in e ? va.state(t, e.key) : va.event(t, e.key), uq = (t, e, n) => {
    if ("user" in e) {
      if (typeof e.key == "string") {
        const r = t.users ?? {};
        return r[e.key] = n, t.users = r, t;
      }
      return t.users_default = n, t;
    }
    if ("action" in e) return t[e.key] = n, t;
    if ("notification" in e) {
      const r = t.notifications ?? {};
      return r[e.key] = n, t.notifications = r, t;
    }
    if ("state" in e) {
      if (typeof e.key == "string") {
        const r = t.events ?? {};
        return r[e.key] = n, t.events = r, t;
      }
      return t.state_default = n, t;
    }
    if (typeof e.key == "string") {
      const r = t.events ?? {};
      return r[e.key] = n, t.events = r, t;
    }
    return t.events_default = n, t;
  }, Joe = (t) => {
    const e = t.getContent(), n = /* @__PURE__ */ new Set();
    return BF(e.room_version) && (t.event.sender && n.add(t.event.sender), "additional_creators" in e && Array.isArray(e.additional_creators) && e.additional_creators.forEach((r) => {
      typeof r == "string" && n.add(r);
    })), n;
  }, ri = (t) => {
    const e = $i(t, ce.RoomCreate);
    return p.useMemo(() => e ? Joe(e) : /* @__PURE__ */ new Set(), [
      e
    ]);
  }, Sf = (t, e) => {
    const n = t.getRoom(e);
    if (!n) return /* @__PURE__ */ new Set();
    const r = ni(n, ce.RoomCreate);
    return r ? Joe(r) : /* @__PURE__ */ new Set();
  }, { min: Vje, max: Hje } = Math, kg = (t, e = 0, n = 1) => Vje(Hje(e, t), n), wP = (t) => {
    t._clipped = false, t._unclipped = t.slice(0);
    for (let e = 0; e <= 3; e++) e < 3 ? ((t[e] < 0 || t[e] > 255) && (t._clipped = true), t[e] = kg(t[e], 0, 255)) : e === 3 && (t[e] = kg(t[e], 0, 1));
    return t;
  }, Xoe = {};
  for (let t of [
    "Boolean",
    "Number",
    "String",
    "Function",
    "Array",
    "Date",
    "RegExp",
    "Undefined",
    "Null"
  ]) Xoe[`[object ${t}]`] = t.toLowerCase();
  function Pr(t) {
    return Xoe[Object.prototype.toString.call(t)] || "object";
  }
  const Er = (t, e = null) => t.length >= 3 ? Array.prototype.slice.call(t) : Pr(t[0]) == "object" && e ? e.split("").filter((n) => t[0][n] !== void 0).map((n) => t[0][n]) : t[0].slice(0), NF = (t) => {
    if (t.length < 2) return null;
    const e = t.length - 1;
    return Pr(t[e]) == "string" ? t[e].toLowerCase() : null;
  }, { PI: zk, min: Qoe, max: eae } = Math, Vl = (t) => Math.round(t * 100) / 100, XA = (t) => Math.round(t * 100) / 100, Cu = zk * 2, W9 = zk / 3, $je = zk / 180, Wje = 180 / zk;
  function tae(t) {
    return [
      ...t.slice(0, 3).reverse(),
      ...t.slice(3)
    ];
  }
  const yr = {
    format: {},
    autodetect: []
  };
  class Gt {
    constructor(...e) {
      const n = this;
      if (Pr(e[0]) === "object" && e[0].constructor && e[0].constructor === this.constructor) return e[0];
      let r = NF(e), i = false;
      if (!r) {
        i = true, yr.sorted || (yr.autodetect = yr.autodetect.sort((a, s) => s.p - a.p), yr.sorted = true);
        for (let a of yr.autodetect) if (r = a.test(...e), r) break;
      }
      if (yr.format[r]) {
        const a = yr.format[r].apply(null, i ? e : e.slice(0, -1));
        n._rgb = wP(a);
      } else throw new Error("unknown format: " + e);
      n._rgb.length === 3 && n._rgb.push(1);
    }
    toString() {
      return Pr(this.hex) == "function" ? this.hex() : `[${this._rgb.join(",")}]`;
    }
  }
  const qje = "3.2.0", Br = (...t) => new Gt(...t);
  Br.version = qje;
  const oF = {
    aliceblue: "#f0f8ff",
    antiquewhite: "#faebd7",
    aqua: "#00ffff",
    aquamarine: "#7fffd4",
    azure: "#f0ffff",
    beige: "#f5f5dc",
    bisque: "#ffe4c4",
    black: "#000000",
    blanchedalmond: "#ffebcd",
    blue: "#0000ff",
    blueviolet: "#8a2be2",
    brown: "#a52a2a",
    burlywood: "#deb887",
    cadetblue: "#5f9ea0",
    chartreuse: "#7fff00",
    chocolate: "#d2691e",
    coral: "#ff7f50",
    cornflowerblue: "#6495ed",
    cornsilk: "#fff8dc",
    crimson: "#dc143c",
    cyan: "#00ffff",
    darkblue: "#00008b",
    darkcyan: "#008b8b",
    darkgoldenrod: "#b8860b",
    darkgray: "#a9a9a9",
    darkgreen: "#006400",
    darkgrey: "#a9a9a9",
    darkkhaki: "#bdb76b",
    darkmagenta: "#8b008b",
    darkolivegreen: "#556b2f",
    darkorange: "#ff8c00",
    darkorchid: "#9932cc",
    darkred: "#8b0000",
    darksalmon: "#e9967a",
    darkseagreen: "#8fbc8f",
    darkslateblue: "#483d8b",
    darkslategray: "#2f4f4f",
    darkslategrey: "#2f4f4f",
    darkturquoise: "#00ced1",
    darkviolet: "#9400d3",
    deeppink: "#ff1493",
    deepskyblue: "#00bfff",
    dimgray: "#696969",
    dimgrey: "#696969",
    dodgerblue: "#1e90ff",
    firebrick: "#b22222",
    floralwhite: "#fffaf0",
    forestgreen: "#228b22",
    fuchsia: "#ff00ff",
    gainsboro: "#dcdcdc",
    ghostwhite: "#f8f8ff",
    gold: "#ffd700",
    goldenrod: "#daa520",
    gray: "#808080",
    green: "#008000",
    greenyellow: "#adff2f",
    grey: "#808080",
    honeydew: "#f0fff0",
    hotpink: "#ff69b4",
    indianred: "#cd5c5c",
    indigo: "#4b0082",
    ivory: "#fffff0",
    khaki: "#f0e68c",
    laserlemon: "#ffff54",
    lavender: "#e6e6fa",
    lavenderblush: "#fff0f5",
    lawngreen: "#7cfc00",
    lemonchiffon: "#fffacd",
    lightblue: "#add8e6",
    lightcoral: "#f08080",
    lightcyan: "#e0ffff",
    lightgoldenrod: "#fafad2",
    lightgoldenrodyellow: "#fafad2",
    lightgray: "#d3d3d3",
    lightgreen: "#90ee90",
    lightgrey: "#d3d3d3",
    lightpink: "#ffb6c1",
    lightsalmon: "#ffa07a",
    lightseagreen: "#20b2aa",
    lightskyblue: "#87cefa",
    lightslategray: "#778899",
    lightslategrey: "#778899",
    lightsteelblue: "#b0c4de",
    lightyellow: "#ffffe0",
    lime: "#00ff00",
    limegreen: "#32cd32",
    linen: "#faf0e6",
    magenta: "#ff00ff",
    maroon: "#800000",
    maroon2: "#7f0000",
    maroon3: "#b03060",
    mediumaquamarine: "#66cdaa",
    mediumblue: "#0000cd",
    mediumorchid: "#ba55d3",
    mediumpurple: "#9370db",
    mediumseagreen: "#3cb371",
    mediumslateblue: "#7b68ee",
    mediumspringgreen: "#00fa9a",
    mediumturquoise: "#48d1cc",
    mediumvioletred: "#c71585",
    midnightblue: "#191970",
    mintcream: "#f5fffa",
    mistyrose: "#ffe4e1",
    moccasin: "#ffe4b5",
    navajowhite: "#ffdead",
    navy: "#000080",
    oldlace: "#fdf5e6",
    olive: "#808000",
    olivedrab: "#6b8e23",
    orange: "#ffa500",
    orangered: "#ff4500",
    orchid: "#da70d6",
    palegoldenrod: "#eee8aa",
    palegreen: "#98fb98",
    paleturquoise: "#afeeee",
    palevioletred: "#db7093",
    papayawhip: "#ffefd5",
    peachpuff: "#ffdab9",
    peru: "#cd853f",
    pink: "#ffc0cb",
    plum: "#dda0dd",
    powderblue: "#b0e0e6",
    purple: "#800080",
    purple2: "#7f007f",
    purple3: "#a020f0",
    rebeccapurple: "#663399",
    red: "#ff0000",
    rosybrown: "#bc8f8f",
    royalblue: "#4169e1",
    saddlebrown: "#8b4513",
    salmon: "#fa8072",
    sandybrown: "#f4a460",
    seagreen: "#2e8b57",
    seashell: "#fff5ee",
    sienna: "#a0522d",
    silver: "#c0c0c0",
    skyblue: "#87ceeb",
    slateblue: "#6a5acd",
    slategray: "#708090",
    slategrey: "#708090",
    snow: "#fffafa",
    springgreen: "#00ff7f",
    steelblue: "#4682b4",
    tan: "#d2b48c",
    teal: "#008080",
    thistle: "#d8bfd8",
    tomato: "#ff6347",
    turquoise: "#40e0d0",
    violet: "#ee82ee",
    wheat: "#f5deb3",
    white: "#ffffff",
    whitesmoke: "#f5f5f5",
    yellow: "#ffff00",
    yellowgreen: "#9acd32"
  }, Kje = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, Gje = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/, nae = (t) => {
    if (t.match(Kje)) {
      (t.length === 4 || t.length === 7) && (t = t.substr(1)), t.length === 3 && (t = t.split(""), t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2]);
      const e = parseInt(t, 16), n = e >> 16, r = e >> 8 & 255, i = e & 255;
      return [
        n,
        r,
        i,
        1
      ];
    }
    if (t.match(Gje)) {
      (t.length === 5 || t.length === 9) && (t = t.substr(1)), t.length === 4 && (t = t.split(""), t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]);
      const e = parseInt(t, 16), n = e >> 24 & 255, r = e >> 16 & 255, i = e >> 8 & 255, a = Math.round((e & 255) / 255 * 100) / 100;
      return [
        n,
        r,
        i,
        a
      ];
    }
    throw new Error(`unknown hex color: ${t}`);
  }, { round: yw } = Math, rae = (...t) => {
    let [e, n, r, i] = Er(t, "rgba"), a = NF(t) || "auto";
    i === void 0 && (i = 1), a === "auto" && (a = i < 1 ? "rgba" : "rgb"), e = yw(e), n = yw(n), r = yw(r);
    let l = "000000" + (e << 16 | n << 8 | r).toString(16);
    l = l.substr(l.length - 6);
    let c = "0" + yw(i * 255).toString(16);
    switch (c = c.substr(c.length - 2), a.toLowerCase()) {
      case "rgba":
        return `#${l}${c}`;
      case "argb":
        return `#${c}${l}`;
      default:
        return `#${l}`;
    }
  };
  Gt.prototype.name = function() {
    const t = rae(this._rgb, "rgb");
    for (let e of Object.keys(oF)) if (oF[e] === t) return e.toLowerCase();
    return t;
  };
  yr.format.named = (t) => {
    if (t = t.toLowerCase(), oF[t]) return nae(oF[t]);
    throw new Error("unknown color name: " + t);
  };
  yr.autodetect.push({
    p: 5,
    test: (t, ...e) => {
      if (!e.length && Pr(t) === "string" && oF[t.toLowerCase()]) return "named";
    }
  });
  Gt.prototype.alpha = function(t, e = false) {
    return t !== void 0 && Pr(t) === "number" ? e ? (this._rgb[3] = t, this) : new Gt([
      this._rgb[0],
      this._rgb[1],
      this._rgb[2],
      t
    ], "rgb") : this._rgb[3];
  };
  Gt.prototype.clipped = function() {
    return this._rgb._clipped || false;
  };
  const Od = {
    Kn: 18,
    labWhitePoint: "d65",
    Xn: 0.95047,
    Yn: 1,
    Zn: 1.08883,
    kE: 216 / 24389,
    kKE: 8,
    kK: 24389 / 27,
    RefWhiteRGB: {
      X: 0.95047,
      Y: 1,
      Z: 1.08883
    },
    MtxRGB2XYZ: {
      m00: 0.4124564390896922,
      m01: 0.21267285140562253,
      m02: 0.0193338955823293,
      m10: 0.357576077643909,
      m11: 0.715152155287818,
      m12: 0.11919202588130297,
      m20: 0.18043748326639894,
      m21: 0.07217499330655958,
      m22: 0.9503040785363679
    },
    MtxXYZ2RGB: {
      m00: 3.2404541621141045,
      m01: -0.9692660305051868,
      m02: 0.055643430959114726,
      m10: -1.5371385127977166,
      m11: 1.8760108454466942,
      m12: -0.2040259135167538,
      m20: -0.498531409556016,
      m21: 0.041556017530349834,
      m22: 1.0572251882231791
    },
    As: 0.9414285350000001,
    Bs: 1.040417467,
    Cs: 1.089532651,
    MtxAdaptMa: {
      m00: 0.8951,
      m01: -0.7502,
      m02: 0.0389,
      m10: 0.2664,
      m11: 1.7135,
      m12: -0.0685,
      m20: -0.1614,
      m21: 0.0367,
      m22: 1.0296
    },
    MtxAdaptMaI: {
      m00: 0.9869929054667123,
      m01: 0.43230526972339456,
      m02: -0.008528664575177328,
      m10: -0.14705425642099013,
      m11: 0.5183602715367776,
      m12: 0.04004282165408487,
      m20: 0.15996265166373125,
      m21: 0.0492912282128556,
      m22: 0.9684866957875502
    }
  }, Yje = /* @__PURE__ */ new Map([
    [
      "a",
      [
        1.0985,
        0.35585
      ]
    ],
    [
      "b",
      [
        1.0985,
        0.35585
      ]
    ],
    [
      "c",
      [
        0.98074,
        1.18232
      ]
    ],
    [
      "d50",
      [
        0.96422,
        0.82521
      ]
    ],
    [
      "d55",
      [
        0.95682,
        0.92149
      ]
    ],
    [
      "d65",
      [
        0.95047,
        1.08883
      ]
    ],
    [
      "e",
      [
        1,
        1,
        1
      ]
    ],
    [
      "f2",
      [
        0.99186,
        0.67393
      ]
    ],
    [
      "f7",
      [
        0.95041,
        1.08747
      ]
    ],
    [
      "f11",
      [
        1.00962,
        0.6435
      ]
    ],
    [
      "icc",
      [
        0.96422,
        0.82521
      ]
    ]
  ]);
  function Bu(t) {
    const e = Yje.get(String(t).toLowerCase());
    if (!e) throw new Error("unknown Lab illuminant " + t);
    Od.labWhitePoint = t, Od.Xn = e[0], Od.Zn = e[1];
  }
  function sb() {
    return Od.labWhitePoint;
  }
  const DP = (...t) => {
    t = Er(t, "lab");
    const [e, n, r] = t, [i, a, s] = Zje(e, n, r), [l, c, d] = iae(i, a, s);
    return [
      l,
      c,
      d,
      t.length > 3 ? t[3] : 1
    ];
  }, Zje = (t, e, n) => {
    const { kE: r, kK: i, kKE: a, Xn: s, Yn: l, Zn: c } = Od, d = (t + 16) / 116, u = 2e-3 * e + d, h = d - 5e-3 * n, f = u * u * u, g = h * h * h, m = f > r ? f : (116 * u - 16) / i, v = t > a ? Math.pow((t + 16) / 116, 3) : t / i, y = g > r ? g : (116 * h - 16) / i, w = m * s, b = v * l, j = y * c;
    return [
      w,
      b,
      j
    ];
  }, q9 = (t) => {
    const e = Math.sign(t);
    return t = Math.abs(t), (t <= 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 1 / 2.4) - 0.055) * e;
  }, iae = (t, e, n) => {
    const { MtxAdaptMa: r, MtxAdaptMaI: i, MtxXYZ2RGB: a, RefWhiteRGB: s, Xn: l, Yn: c, Zn: d } = Od, u = l * r.m00 + c * r.m10 + d * r.m20, h = l * r.m01 + c * r.m11 + d * r.m21, f = l * r.m02 + c * r.m12 + d * r.m22, g = s.X * r.m00 + s.Y * r.m10 + s.Z * r.m20, m = s.X * r.m01 + s.Y * r.m11 + s.Z * r.m21, v = s.X * r.m02 + s.Y * r.m12 + s.Z * r.m22, y = (t * r.m00 + e * r.m10 + n * r.m20) * (g / u), w = (t * r.m01 + e * r.m11 + n * r.m21) * (m / h), b = (t * r.m02 + e * r.m12 + n * r.m22) * (v / f), j = y * i.m00 + w * i.m10 + b * i.m20, k = y * i.m01 + w * i.m11 + b * i.m21, C = y * i.m02 + w * i.m12 + b * i.m22, x = q9(j * a.m00 + k * a.m10 + C * a.m20), S = q9(j * a.m01 + k * a.m11 + C * a.m21), T = q9(j * a.m02 + k * a.m12 + C * a.m22);
    return [
      x * 255,
      S * 255,
      T * 255
    ];
  }, CP = (...t) => {
    const [e, n, r, ...i] = Er(t, "rgb"), [a, s, l] = oae(e, n, r), [c, d, u] = Jje(a, s, l);
    return [
      c,
      d,
      u,
      ...i.length > 0 && i[0] < 1 ? [
        i[0]
      ] : []
    ];
  };
  function Jje(t, e, n) {
    const { Xn: r, Yn: i, Zn: a, kE: s, kK: l } = Od, c = t / r, d = e / i, u = n / a, h = c > s ? Math.pow(c, 1 / 3) : (l * c + 16) / 116, f = d > s ? Math.pow(d, 1 / 3) : (l * d + 16) / 116, g = u > s ? Math.pow(u, 1 / 3) : (l * u + 16) / 116;
    return [
      116 * f - 16,
      500 * (h - f),
      200 * (f - g)
    ];
  }
  function K9(t) {
    const e = Math.sign(t);
    return t = Math.abs(t), (t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4)) * e;
  }
  const oae = (t, e, n) => {
    t = K9(t / 255), e = K9(e / 255), n = K9(n / 255);
    const { MtxRGB2XYZ: r, MtxAdaptMa: i, MtxAdaptMaI: a, Xn: s, Yn: l, Zn: c, As: d, Bs: u, Cs: h } = Od;
    let f = t * r.m00 + e * r.m10 + n * r.m20, g = t * r.m01 + e * r.m11 + n * r.m21, m = t * r.m02 + e * r.m12 + n * r.m22;
    const v = s * i.m00 + l * i.m10 + c * i.m20, y = s * i.m01 + l * i.m11 + c * i.m21, w = s * i.m02 + l * i.m12 + c * i.m22;
    let b = f * i.m00 + g * i.m10 + m * i.m20, j = f * i.m01 + g * i.m11 + m * i.m21, k = f * i.m02 + g * i.m12 + m * i.m22;
    return b *= v / d, j *= y / u, k *= w / h, f = b * a.m00 + j * a.m10 + k * a.m20, g = b * a.m01 + j * a.m11 + k * a.m21, m = b * a.m02 + j * a.m12 + k * a.m22, [
      f,
      g,
      m
    ];
  };
  Gt.prototype.lab = function() {
    return CP(this._rgb);
  };
  const Xje = (...t) => new Gt(...t, "lab");
  Object.assign(Br, {
    lab: Xje,
    getLabWhitePoint: sb,
    setLabWhitePoint: Bu
  });
  yr.format.lab = DP;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "lab"), Pr(t) === "array" && t.length === 3) return "lab";
    }
  });
  Gt.prototype.darken = function(t = 1) {
    const e = this, n = e.lab();
    return n[0] -= Od.Kn * t, new Gt(n, "lab").alpha(e.alpha(), true);
  };
  Gt.prototype.brighten = function(t = 1) {
    return this.darken(-t);
  };
  Gt.prototype.darker = Gt.prototype.darken;
  Gt.prototype.brighter = Gt.prototype.brighten;
  Gt.prototype.get = function(t) {
    const [e, n] = t.split("."), r = this[e]();
    if (n) {
      const i = e.indexOf(n) - (e.substr(0, 2) === "ok" ? 2 : 0);
      if (i > -1) return r[i];
      throw new Error(`unknown channel ${n} in mode ${e}`);
    } else return r;
  };
  const { pow: Qje } = Math, e9e = 1e-7, t9e = 20;
  Gt.prototype.luminance = function(t, e = "rgb") {
    if (t !== void 0 && Pr(t) === "number") {
      if (t === 0) return new Gt([
        0,
        0,
        0,
        this._rgb[3]
      ], "rgb");
      if (t === 1) return new Gt([
        255,
        255,
        255,
        this._rgb[3]
      ], "rgb");
      let n = this.luminance(), r = t9e;
      const i = (s, l) => {
        const c = s.interpolate(l, 0.5, e), d = c.luminance();
        return Math.abs(t - d) < e9e || !r-- ? c : d > t ? i(s, c) : i(c, l);
      }, a = (n > t ? i(new Gt([
        0,
        0,
        0
      ]), this) : i(this, new Gt([
        255,
        255,
        255
      ]))).rgb();
      return new Gt([
        ...a,
        this._rgb[3]
      ]);
    }
    return n9e(...this._rgb.slice(0, 3));
  };
  const n9e = (t, e, n) => (t = G9(t), e = G9(e), n = G9(n), 0.2126 * t + 0.7152 * e + 0.0722 * n), G9 = (t) => (t /= 255, t <= 0.03928 ? t / 12.92 : Qje((t + 0.055) / 1.055, 2.4)), Wa = {}, aF = (t, e, n = 0.5, ...r) => {
    let i = r[0] || "lrgb";
    if (!Wa[i] && !r.length && (i = Object.keys(Wa)[0]), !Wa[i]) throw new Error(`interpolation mode ${i} is not defined`);
    return Pr(t) !== "object" && (t = new Gt(t)), Pr(e) !== "object" && (e = new Gt(e)), Wa[i](t, e, n).alpha(t.alpha() + n * (e.alpha() - t.alpha()));
  };
  Gt.prototype.mix = Gt.prototype.interpolate = function(t, e = 0.5, ...n) {
    return aF(this, t, e, ...n);
  };
  Gt.prototype.premultiply = function(t = false) {
    const e = this._rgb, n = e[3];
    return t ? (this._rgb = [
      e[0] * n,
      e[1] * n,
      e[2] * n,
      n
    ], this) : new Gt([
      e[0] * n,
      e[1] * n,
      e[2] * n,
      n
    ], "rgb");
  };
  const { sin: r9e, cos: i9e } = Math, aae = (...t) => {
    let [e, n, r] = Er(t, "lch");
    return isNaN(r) && (r = 0), r = r * $je, [
      e,
      i9e(r) * n,
      r9e(r) * n
    ];
  }, EP = (...t) => {
    t = Er(t, "lch");
    const [e, n, r] = t, [i, a, s] = aae(e, n, r), [l, c, d] = DP(i, a, s);
    return [
      l,
      c,
      d,
      t.length > 3 ? t[3] : 1
    ];
  }, o9e = (...t) => {
    const e = tae(Er(t, "hcl"));
    return EP(...e);
  }, { sqrt: a9e, atan2: s9e, round: l9e } = Math, sae = (...t) => {
    const [e, n, r] = Er(t, "lab"), i = a9e(n * n + r * r);
    let a = (s9e(r, n) * Wje + 360) % 360;
    return l9e(i * 1e4) === 0 && (a = Number.NaN), [
      e,
      i,
      a
    ];
  }, kP = (...t) => {
    const [e, n, r, ...i] = Er(t, "rgb"), [a, s, l] = CP(e, n, r), [c, d, u] = sae(a, s, l);
    return [
      c,
      d,
      u,
      ...i.length > 0 && i[0] < 1 ? [
        i[0]
      ] : []
    ];
  };
  Gt.prototype.lch = function() {
    return kP(this._rgb);
  };
  Gt.prototype.hcl = function() {
    return tae(kP(this._rgb));
  };
  const c9e = (...t) => new Gt(...t, "lch"), d9e = (...t) => new Gt(...t, "hcl");
  Object.assign(Br, {
    lch: c9e,
    hcl: d9e
  });
  yr.format.lch = EP;
  yr.format.hcl = o9e;
  [
    "lch",
    "hcl"
  ].forEach((t) => yr.autodetect.push({
    p: 2,
    test: (...e) => {
      if (e = Er(e, t), Pr(e) === "array" && e.length === 3) return t;
    }
  }));
  Gt.prototype.saturate = function(t = 1) {
    const e = this, n = e.lch();
    return n[1] += Od.Kn * t, n[1] < 0 && (n[1] = 0), new Gt(n, "lch").alpha(e.alpha(), true);
  };
  Gt.prototype.desaturate = function(t = 1) {
    return this.saturate(-t);
  };
  Gt.prototype.set = function(t, e, n = false) {
    const [r, i] = t.split("."), a = this[r]();
    if (i) {
      const s = r.indexOf(i) - (r.substr(0, 2) === "ok" ? 2 : 0);
      if (s > -1) {
        if (Pr(e) == "string") switch (e.charAt(0)) {
          case "+":
            a[s] += +e;
            break;
          case "-":
            a[s] += +e;
            break;
          case "*":
            a[s] *= +e.substr(1);
            break;
          case "/":
            a[s] /= +e.substr(1);
            break;
          default:
            a[s] = +e;
        }
        else if (Pr(e) === "number") a[s] = e;
        else throw new Error("unsupported value for Color.set");
        const l = new Gt(a, r);
        return n ? (this._rgb = l._rgb, this) : l;
      }
      throw new Error(`unknown channel ${i} in mode ${r}`);
    } else return a;
  };
  Gt.prototype.tint = function(t = 0.5, ...e) {
    return aF(this, "white", t, ...e);
  };
  Gt.prototype.shade = function(t = 0.5, ...e) {
    return aF(this, "black", t, ...e);
  };
  const u9e = (t, e, n) => {
    const r = t._rgb, i = e._rgb;
    return new Gt(r[0] + n * (i[0] - r[0]), r[1] + n * (i[1] - r[1]), r[2] + n * (i[2] - r[2]), "rgb");
  };
  Wa.rgb = u9e;
  const { sqrt: Y9, pow: b0 } = Math, h9e = (t, e, n) => {
    const [r, i, a] = t._rgb, [s, l, c] = e._rgb;
    return new Gt(Y9(b0(r, 2) * (1 - n) + b0(s, 2) * n), Y9(b0(i, 2) * (1 - n) + b0(l, 2) * n), Y9(b0(a, 2) * (1 - n) + b0(c, 2) * n), "rgb");
  };
  Wa.lrgb = h9e;
  const f9e = (t, e, n) => {
    const r = t.lab(), i = e.lab();
    return new Gt(r[0] + n * (i[0] - r[0]), r[1] + n * (i[1] - r[1]), r[2] + n * (i[2] - r[2]), "lab");
  };
  Wa.lab = f9e;
  const zF = (t, e, n, r) => {
    let i, a;
    r === "hsl" ? (i = t.hsl(), a = e.hsl()) : r === "hsv" ? (i = t.hsv(), a = e.hsv()) : r === "hcg" ? (i = t.hcg(), a = e.hcg()) : r === "hsi" ? (i = t.hsi(), a = e.hsi()) : r === "lch" || r === "hcl" ? (r = "hcl", i = t.hcl(), a = e.hcl()) : r === "oklch" && (i = t.oklch().reverse(), a = e.oklch().reverse());
    let s, l, c, d, u, h;
    (r.substr(0, 1) === "h" || r === "oklch") && ([s, c, u] = i, [l, d, h] = a);
    let f, g, m, v;
    return !isNaN(s) && !isNaN(l) ? (l > s && l - s > 180 ? v = l - (s + 360) : l < s && s - l > 180 ? v = l + 360 - s : v = l - s, g = s + n * v) : isNaN(s) ? isNaN(l) ? g = Number.NaN : (g = l, (u == 1 || u == 0) && r != "hsv" && (f = d)) : (g = s, (h == 1 || h == 0) && r != "hsv" && (f = c)), f === void 0 && (f = c + n * (d - c)), m = u + n * (h - u), r === "oklch" ? new Gt([
      m,
      f,
      g
    ], r) : new Gt([
      g,
      f,
      m
    ], r);
  }, lae = (t, e, n) => zF(t, e, n, "lch");
  Wa.lch = lae;
  Wa.hcl = lae;
  const m9e = (t) => {
    if (Pr(t) == "number" && t >= 0 && t <= 16777215) {
      const e = t >> 16, n = t >> 8 & 255, r = t & 255;
      return [
        e,
        n,
        r,
        1
      ];
    }
    throw new Error("unknown num color: " + t);
  }, g9e = (...t) => {
    const [e, n, r] = Er(t, "rgb");
    return (e << 16) + (n << 8) + r;
  };
  Gt.prototype.num = function() {
    return g9e(this._rgb);
  };
  const p9e = (...t) => new Gt(...t, "num");
  Object.assign(Br, {
    num: p9e
  });
  yr.format.num = m9e;
  yr.autodetect.push({
    p: 5,
    test: (...t) => {
      if (t.length === 1 && Pr(t[0]) === "number" && t[0] >= 0 && t[0] <= 16777215) return "num";
    }
  });
  const F9e = (t, e, n) => {
    const r = t.num(), i = e.num();
    return new Gt(r + n * (i - r), "num");
  };
  Wa.num = F9e;
  const { floor: v9e } = Math, _9e = (...t) => {
    t = Er(t, "hcg");
    let [e, n, r] = t, i, a, s;
    r = r * 255;
    const l = n * 255;
    if (n === 0) i = a = s = r;
    else {
      e === 360 && (e = 0), e > 360 && (e -= 360), e < 0 && (e += 360), e /= 60;
      const c = v9e(e), d = e - c, u = r * (1 - n), h = u + l * (1 - d), f = u + l * d, g = u + l;
      switch (c) {
        case 0:
          [i, a, s] = [
            g,
            f,
            u
          ];
          break;
        case 1:
          [i, a, s] = [
            h,
            g,
            u
          ];
          break;
        case 2:
          [i, a, s] = [
            u,
            g,
            f
          ];
          break;
        case 3:
          [i, a, s] = [
            u,
            h,
            g
          ];
          break;
        case 4:
          [i, a, s] = [
            f,
            u,
            g
          ];
          break;
        case 5:
          [i, a, s] = [
            g,
            u,
            h
          ];
          break;
      }
    }
    return [
      i,
      a,
      s,
      t.length > 3 ? t[3] : 1
    ];
  }, y9e = (...t) => {
    const [e, n, r] = Er(t, "rgb"), i = Qoe(e, n, r), a = eae(e, n, r), s = a - i, l = s * 100 / 255, c = i / (255 - s) * 100;
    let d;
    return s === 0 ? d = Number.NaN : (e === a && (d = (n - r) / s), n === a && (d = 2 + (r - e) / s), r === a && (d = 4 + (e - n) / s), d *= 60, d < 0 && (d += 360)), [
      d,
      l,
      c
    ];
  };
  Gt.prototype.hcg = function() {
    return y9e(this._rgb);
  };
  const b9e = (...t) => new Gt(...t, "hcg");
  Br.hcg = b9e;
  yr.format.hcg = _9e;
  yr.autodetect.push({
    p: 1,
    test: (...t) => {
      if (t = Er(t, "hcg"), Pr(t) === "array" && t.length === 3) return "hcg";
    }
  });
  const x9e = (t, e, n) => zF(t, e, n, "hcg");
  Wa.hcg = x9e;
  const { cos: x0 } = Math, w9e = (...t) => {
    t = Er(t, "hsi");
    let [e, n, r] = t, i, a, s;
    return isNaN(e) && (e = 0), isNaN(n) && (n = 0), e > 360 && (e -= 360), e < 0 && (e += 360), e /= 360, e < 1 / 3 ? (s = (1 - n) / 3, i = (1 + n * x0(Cu * e) / x0(W9 - Cu * e)) / 3, a = 1 - (s + i)) : e < 2 / 3 ? (e -= 1 / 3, i = (1 - n) / 3, a = (1 + n * x0(Cu * e) / x0(W9 - Cu * e)) / 3, s = 1 - (i + a)) : (e -= 2 / 3, a = (1 - n) / 3, s = (1 + n * x0(Cu * e) / x0(W9 - Cu * e)) / 3, i = 1 - (a + s)), i = kg(r * i * 3), a = kg(r * a * 3), s = kg(r * s * 3), [
      i * 255,
      a * 255,
      s * 255,
      t.length > 3 ? t[3] : 1
    ];
  }, { min: D9e, sqrt: C9e, acos: E9e } = Math, k9e = (...t) => {
    let [e, n, r] = Er(t, "rgb");
    e /= 255, n /= 255, r /= 255;
    let i;
    const a = D9e(e, n, r), s = (e + n + r) / 3, l = s > 0 ? 1 - a / s : 0;
    return l === 0 ? i = NaN : (i = (e - n + (e - r)) / 2, i /= C9e((e - n) * (e - n) + (e - r) * (n - r)), i = E9e(i), r > n && (i = Cu - i), i /= Cu), [
      i * 360,
      l,
      s
    ];
  };
  Gt.prototype.hsi = function() {
    return k9e(this._rgb);
  };
  const S9e = (...t) => new Gt(...t, "hsi");
  Br.hsi = S9e;
  yr.format.hsi = w9e;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "hsi"), Pr(t) === "array" && t.length === 3) return "hsi";
    }
  });
  const j9e = (t, e, n) => zF(t, e, n, "hsi");
  Wa.hsi = j9e;
  const QA = (...t) => {
    t = Er(t, "hsl");
    const [e, n, r] = t;
    let i, a, s;
    if (n === 0) i = a = s = r * 255;
    else {
      const l = [
        0,
        0,
        0
      ], c = [
        0,
        0,
        0
      ], d = r < 0.5 ? r * (1 + n) : r + n - r * n, u = 2 * r - d, h = e / 360;
      l[0] = h + 1 / 3, l[1] = h, l[2] = h - 1 / 3;
      for (let f = 0; f < 3; f++) l[f] < 0 && (l[f] += 1), l[f] > 1 && (l[f] -= 1), 6 * l[f] < 1 ? c[f] = u + (d - u) * 6 * l[f] : 2 * l[f] < 1 ? c[f] = d : 3 * l[f] < 2 ? c[f] = u + (d - u) * (2 / 3 - l[f]) * 6 : c[f] = u;
      [i, a, s] = [
        c[0] * 255,
        c[1] * 255,
        c[2] * 255
      ];
    }
    return t.length > 3 ? [
      i,
      a,
      s,
      t[3]
    ] : [
      i,
      a,
      s,
      1
    ];
  }, cae = (...t) => {
    t = Er(t, "rgba");
    let [e, n, r] = t;
    e /= 255, n /= 255, r /= 255;
    const i = Qoe(e, n, r), a = eae(e, n, r), s = (a + i) / 2;
    let l, c;
    return a === i ? (l = 0, c = Number.NaN) : l = s < 0.5 ? (a - i) / (a + i) : (a - i) / (2 - a - i), e == a ? c = (n - r) / (a - i) : n == a ? c = 2 + (r - e) / (a - i) : r == a && (c = 4 + (e - n) / (a - i)), c *= 60, c < 0 && (c += 360), t.length > 3 && t[3] !== void 0 ? [
      c,
      l,
      s,
      t[3]
    ] : [
      c,
      l,
      s
    ];
  };
  Gt.prototype.hsl = function() {
    return cae(this._rgb);
  };
  const T9e = (...t) => new Gt(...t, "hsl");
  Br.hsl = T9e;
  yr.format.hsl = QA;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "hsl"), Pr(t) === "array" && t.length === 3) return "hsl";
    }
  });
  const R9e = (t, e, n) => zF(t, e, n, "hsl");
  Wa.hsl = R9e;
  const { floor: A9e } = Math, I9e = (...t) => {
    t = Er(t, "hsv");
    let [e, n, r] = t, i, a, s;
    if (r *= 255, n === 0) i = a = s = r;
    else {
      e === 360 && (e = 0), e > 360 && (e -= 360), e < 0 && (e += 360), e /= 60;
      const l = A9e(e), c = e - l, d = r * (1 - n), u = r * (1 - n * c), h = r * (1 - n * (1 - c));
      switch (l) {
        case 0:
          [i, a, s] = [
            r,
            h,
            d
          ];
          break;
        case 1:
          [i, a, s] = [
            u,
            r,
            d
          ];
          break;
        case 2:
          [i, a, s] = [
            d,
            r,
            h
          ];
          break;
        case 3:
          [i, a, s] = [
            d,
            u,
            r
          ];
          break;
        case 4:
          [i, a, s] = [
            h,
            d,
            r
          ];
          break;
        case 5:
          [i, a, s] = [
            r,
            d,
            u
          ];
          break;
      }
    }
    return [
      i,
      a,
      s,
      t.length > 3 ? t[3] : 1
    ];
  }, { min: B9e, max: P9e } = Math, M9e = (...t) => {
    t = Er(t, "rgb");
    let [e, n, r] = t;
    const i = B9e(e, n, r), a = P9e(e, n, r), s = a - i;
    let l, c, d;
    return d = a / 255, a === 0 ? (l = Number.NaN, c = 0) : (c = s / a, e === a && (l = (n - r) / s), n === a && (l = 2 + (r - e) / s), r === a && (l = 4 + (e - n) / s), l *= 60, l < 0 && (l += 360)), [
      l,
      c,
      d
    ];
  };
  Gt.prototype.hsv = function() {
    return M9e(this._rgb);
  };
  const O9e = (...t) => new Gt(...t, "hsv");
  Br.hsv = O9e;
  yr.format.hsv = I9e;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "hsv"), Pr(t) === "array" && t.length === 3) return "hsv";
    }
  });
  const L9e = (t, e, n) => zF(t, e, n, "hsv");
  Wa.hsv = L9e;
  function G4(t, e) {
    let n = t.length;
    Array.isArray(t[0]) || (t = [
      t
    ]), Array.isArray(e[0]) || (e = e.map((s) => [
      s
    ]));
    let r = e[0].length, i = e[0].map((s, l) => e.map((c) => c[l])), a = t.map((s) => i.map((l) => Array.isArray(s) ? s.reduce((c, d, u) => c + d * (l[u] || 0), 0) : l.reduce((c, d) => c + d * s, 0)));
    return n === 1 && (a = a[0]), r === 1 ? a.map((s) => s[0]) : a;
  }
  const SP = (...t) => {
    t = Er(t, "lab");
    const [e, n, r, ...i] = t, [a, s, l] = N9e([
      e,
      n,
      r
    ]), [c, d, u] = iae(a, s, l);
    return [
      c,
      d,
      u,
      ...i.length > 0 && i[0] < 1 ? [
        i[0]
      ] : []
    ];
  };
  function N9e(t) {
    var e = [
      [
        1.2268798758459243,
        -0.5578149944602171,
        0.2813910456659647
      ],
      [
        -0.0405757452148008,
        1.112286803280317,
        -0.0717110580655164
      ],
      [
        -0.0763729366746601,
        -0.4214933324022432,
        1.5869240198367816
      ]
    ], n = [
      [
        1,
        0.3963377773761749,
        0.2158037573099136
      ],
      [
        1,
        -0.1055613458156586,
        -0.0638541728258133
      ],
      [
        1,
        -0.0894841775298119,
        -1.2914855480194092
      ]
    ], r = G4(n, t);
    return G4(e, r.map((i) => i ** 3));
  }
  const jP = (...t) => {
    const [e, n, r, ...i] = Er(t, "rgb"), a = oae(e, n, r);
    return [
      ...z9e(a),
      ...i.length > 0 && i[0] < 1 ? [
        i[0]
      ] : []
    ];
  };
  function z9e(t) {
    const e = [
      [
        0.819022437996703,
        0.3619062600528904,
        -0.1288737815209879
      ],
      [
        0.0329836539323885,
        0.9292868615863434,
        0.0361446663506424
      ],
      [
        0.0481771893596242,
        0.2642395317527308,
        0.6335478284694309
      ]
    ], n = [
      [
        0.210454268309314,
        0.7936177747023054,
        -0.0040720430116193
      ],
      [
        1.9779985324311684,
        -2.42859224204858,
        0.450593709617411
      ],
      [
        0.0259040424655478,
        0.7827717124575296,
        -0.8086757549230774
      ]
    ], r = G4(e, t);
    return G4(n, r.map((i) => Math.cbrt(i)));
  }
  Gt.prototype.oklab = function() {
    return jP(this._rgb);
  };
  const U9e = (...t) => new Gt(...t, "oklab");
  Object.assign(Br, {
    oklab: U9e
  });
  yr.format.oklab = SP;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "oklab"), Pr(t) === "array" && t.length === 3) return "oklab";
    }
  });
  const V9e = (t, e, n) => {
    const r = t.oklab(), i = e.oklab();
    return new Gt(r[0] + n * (i[0] - r[0]), r[1] + n * (i[1] - r[1]), r[2] + n * (i[2] - r[2]), "oklab");
  };
  Wa.oklab = V9e;
  const H9e = (t, e, n) => zF(t, e, n, "oklch");
  Wa.oklch = H9e;
  const { pow: Z9, sqrt: J9, PI: X9, cos: hq, sin: fq, atan2: $9e } = Math, W9e = (t, e = "lrgb", n = null) => {
    const r = t.length;
    n || (n = Array.from(new Array(r)).map(() => 1));
    const i = r / n.reduce(function(h, f) {
      return h + f;
    });
    if (n.forEach((h, f) => {
      n[f] *= i;
    }), t = t.map((h) => new Gt(h)), e === "lrgb") return q9e(t, n);
    const a = t.shift(), s = a.get(e), l = [];
    let c = 0, d = 0;
    for (let h = 0; h < s.length; h++) if (s[h] = (s[h] || 0) * n[0], l.push(isNaN(s[h]) ? 0 : n[0]), e.charAt(h) === "h" && !isNaN(s[h])) {
      const f = s[h] / 180 * X9;
      c += hq(f) * n[0], d += fq(f) * n[0];
    }
    let u = a.alpha() * n[0];
    t.forEach((h, f) => {
      const g = h.get(e);
      u += h.alpha() * n[f + 1];
      for (let m = 0; m < s.length; m++) if (!isNaN(g[m])) if (l[m] += n[f + 1], e.charAt(m) === "h") {
        const v = g[m] / 180 * X9;
        c += hq(v) * n[f + 1], d += fq(v) * n[f + 1];
      } else s[m] += g[m] * n[f + 1];
    });
    for (let h = 0; h < s.length; h++) if (e.charAt(h) === "h") {
      let f = $9e(d / l[h], c / l[h]) / X9 * 180;
      for (; f < 0; ) f += 360;
      for (; f >= 360; ) f -= 360;
      s[h] = f;
    } else s[h] = s[h] / l[h];
    return u /= r, new Gt(s, e).alpha(u > 0.99999 ? 1 : u, true);
  }, q9e = (t, e) => {
    const n = t.length, r = [
      0,
      0,
      0,
      0
    ];
    for (let i = 0; i < t.length; i++) {
      const a = t[i], s = e[i] / n, l = a._rgb;
      r[0] += Z9(l[0], 2) * s, r[1] += Z9(l[1], 2) * s, r[2] += Z9(l[2], 2) * s, r[3] += l[3] * s;
    }
    return r[0] = J9(r[0]), r[1] = J9(r[1]), r[2] = J9(r[2]), r[3] > 0.9999999 && (r[3] = 1), new Gt(wP(r));
  }, { pow: K9e } = Math;
  function Y4(t) {
    let e = "rgb", n = Br("#ccc"), r = 0, i = [
      0,
      1
    ], a = [
      0,
      1
    ], s = [], l = [
      0,
      0
    ], c = false, d = [], u = false, h = 0, f = 1, g = false, m = {}, v = true, y = 1;
    const w = function(T) {
      if (T = T || [
        "#fff",
        "#000"
      ], T && Pr(T) === "string" && Br.brewer && Br.brewer[T.toLowerCase()] && (T = Br.brewer[T.toLowerCase()]), Pr(T) === "array") {
        T.length === 1 && (T = [
          T[0],
          T[0]
        ]), T = T.slice(0);
        for (let A = 0; A < T.length; A++) T[A] = Br(T[A]);
        s.length = 0;
        for (let A = 0; A < T.length; A++) s.push(A / (T.length - 1));
      }
      return x(), d = T;
    }, b = function(T) {
      if (c != null) {
        const A = c.length - 1;
        let B = 0;
        for (; B < A && T >= c[B]; ) B++;
        return B - 1;
      }
      return 0;
    };
    let j = (T) => T, k = (T) => T;
    const C = function(T, A) {
      let B, U;
      if (A == null && (A = false), isNaN(T) || T === null) return n;
      A ? U = T : c && c.length > 2 ? U = b(T) / (c.length - 2) : f !== h ? U = (T - h) / (f - h) : U = 1, U = k(U), A || (U = j(U)), y !== 1 && (U = K9e(U, y)), U = l[0] + U * (1 - l[0] - l[1]), U = kg(U, 0, 1);
      const z = Math.floor(U * 1e4);
      if (v && m[z]) B = m[z];
      else {
        if (Pr(d) === "array") for (let O = 0; O < s.length; O++) {
          const M = s[O];
          if (U <= M) {
            B = d[O];
            break;
          }
          if (U >= M && O === s.length - 1) {
            B = d[O];
            break;
          }
          if (U > M && U < s[O + 1]) {
            U = (U - M) / (s[O + 1] - M), B = Br.interpolate(d[O], d[O + 1], U, e);
            break;
          }
        }
        else Pr(d) === "function" && (B = d(U));
        v && (m[z] = B);
      }
      return B;
    };
    var x = () => m = {};
    w(t);
    const S = function(T) {
      const A = Br(C(T));
      return u && A[u] ? A[u]() : A;
    };
    return S.classes = function(T) {
      if (T != null) {
        if (Pr(T) === "array") c = T, i = [
          T[0],
          T[T.length - 1]
        ];
        else {
          const A = Br.analyze(i);
          T === 0 ? c = [
            A.min,
            A.max
          ] : c = Br.limits(A, "e", T);
        }
        return S;
      }
      return c;
    }, S.domain = function(T) {
      if (!arguments.length) return a;
      a = T.slice(0), h = T[0], f = T[T.length - 1], s = [];
      const A = d.length;
      if (T.length === A && h !== f) for (let B of Array.from(T)) s.push((B - h) / (f - h));
      else {
        for (let B = 0; B < A; B++) s.push(B / (A - 1));
        if (T.length > 2) {
          const B = T.map((z, O) => O / (T.length - 1)), U = T.map((z) => (z - h) / (f - h));
          U.every((z, O) => B[O] === z) || (k = (z) => {
            if (z <= 0 || z >= 1) return z;
            let O = 0;
            for (; z >= U[O + 1]; ) O++;
            const M = (z - U[O]) / (U[O + 1] - U[O]);
            return B[O] + M * (B[O + 1] - B[O]);
          });
        }
      }
      return i = [
        h,
        f
      ], S;
    }, S.mode = function(T) {
      return arguments.length ? (e = T, x(), S) : e;
    }, S.range = function(T, A) {
      return w(T), S;
    }, S.out = function(T) {
      return u = T, S;
    }, S.spread = function(T) {
      return arguments.length ? (r = T, S) : r;
    }, S.correctLightness = function(T) {
      return T == null && (T = true), g = T, x(), g ? j = function(A) {
        const B = C(0, true).lab()[0], U = C(1, true).lab()[0], z = B > U;
        let O = C(A, true).lab()[0];
        const M = B + (U - B) * A;
        let I = O - M, N = 0, L = 1, H = 20;
        for (; Math.abs(I) > 0.01 && H-- > 0; ) (function() {
          return z && (I *= -1), I < 0 ? (N = A, A += (L - A) * 0.5) : (L = A, A += (N - A) * 0.5), O = C(A, true).lab()[0], I = O - M;
        })();
        return A;
      } : j = (A) => A, S;
    }, S.padding = function(T) {
      return T != null ? (Pr(T) === "number" && (T = [
        T,
        T
      ]), l = T, S) : l;
    }, S.colors = function(T, A) {
      arguments.length < 2 && (A = "hex");
      let B = [];
      if (arguments.length === 0) B = d.slice(0);
      else if (T === 1) B = [
        S(0.5)
      ];
      else if (T > 1) {
        const U = i[0], z = i[1] - U;
        B = G9e(0, T).map((O) => S(U + O / (T - 1) * z));
      } else {
        t = [];
        let U = [];
        if (c && c.length > 2) for (let z = 1, O = c.length, M = 1 <= O; M ? z < O : z > O; M ? z++ : z--) U.push((c[z - 1] + c[z]) * 0.5);
        else U = i;
        B = U.map((z) => S(z));
      }
      return Br[A] && (B = B.map((U) => U[A]())), B;
    }, S.cache = function(T) {
      return T != null ? (v = T, S) : v;
    }, S.gamma = function(T) {
      return T != null ? (y = T, S) : y;
    }, S.nodata = function(T) {
      return T != null ? (n = Br(T), S) : n;
    }, S;
  }
  function G9e(t, e, n) {
    let r = [], i = t < e, a = e;
    for (let s = t; i ? s < a : s > a; i ? s++ : s--) r.push(s);
    return r;
  }
  const Y9e = function(t) {
    let e = [
      1,
      1
    ];
    for (let n = 1; n < t; n++) {
      let r = [
        1
      ];
      for (let i = 1; i <= e.length; i++) r[i] = (e[i] || 0) + e[i - 1];
      e = r;
    }
    return e;
  }, Z9e = function(t) {
    let e, n, r, i;
    if (t = t.map((a) => new Gt(a)), t.length === 2) [n, r] = t.map((a) => a.lab()), e = function(a) {
      const s = [
        0,
        1,
        2
      ].map((l) => n[l] + a * (r[l] - n[l]));
      return new Gt(s, "lab");
    };
    else if (t.length === 3) [n, r, i] = t.map((a) => a.lab()), e = function(a) {
      const s = [
        0,
        1,
        2
      ].map((l) => (1 - a) * (1 - a) * n[l] + 2 * (1 - a) * a * r[l] + a * a * i[l]);
      return new Gt(s, "lab");
    };
    else if (t.length === 4) {
      let a;
      [n, r, i, a] = t.map((s) => s.lab()), e = function(s) {
        const l = [
          0,
          1,
          2
        ].map((c) => (1 - s) * (1 - s) * (1 - s) * n[c] + 3 * (1 - s) * (1 - s) * s * r[c] + 3 * (1 - s) * s * s * i[c] + s * s * s * a[c]);
        return new Gt(l, "lab");
      };
    } else if (t.length >= 5) {
      let a, s, l;
      a = t.map((c) => c.lab()), l = t.length - 1, s = Y9e(l), e = function(c) {
        const d = 1 - c, u = [
          0,
          1,
          2
        ].map((h) => a.reduce((f, g, m) => f + s[m] * d ** (l - m) * c ** m * g[h], 0));
        return new Gt(u, "lab");
      };
    } else throw new RangeError("No point in running bezier with only one color.");
    return e;
  }, J9e = (t) => {
    const e = Z9e(t);
    return e.scale = () => Y4(e), e;
  }, { round: dae } = Math;
  Gt.prototype.rgb = function(t = true) {
    return t === false ? this._rgb.slice(0, 3) : this._rgb.slice(0, 3).map(dae);
  };
  Gt.prototype.rgba = function(t = true) {
    return this._rgb.slice(0, 4).map((e, n) => n < 3 ? t === false ? e : dae(e) : e);
  };
  const X9e = (...t) => new Gt(...t, "rgb");
  Object.assign(Br, {
    rgb: X9e
  });
  yr.format.rgb = (...t) => {
    const e = Er(t, "rgba");
    return e[3] === void 0 && (e[3] = 1), e;
  };
  yr.autodetect.push({
    p: 3,
    test: (...t) => {
      if (t = Er(t, "rgba"), Pr(t) === "array" && (t.length === 3 || t.length === 4 && Pr(t[3]) == "number" && t[3] >= 0 && t[3] <= 1)) return "rgb";
    }
  });
  const Wc = (t, e, n) => {
    if (!Wc[n]) throw new Error("unknown blend mode " + n);
    return Wc[n](t, e);
  }, tm = (t) => (e, n) => {
    const r = Br(n).rgb(), i = Br(e).rgb();
    return Br.rgb(t(r, i));
  }, nm = (t) => (e, n) => {
    const r = [];
    return r[0] = t(e[0], n[0]), r[1] = t(e[1], n[1]), r[2] = t(e[2], n[2]), r;
  }, Q9e = (t) => t, e5e = (t, e) => t * e / 255, t5e = (t, e) => t > e ? e : t, n5e = (t, e) => t > e ? t : e, r5e = (t, e) => 255 * (1 - (1 - t / 255) * (1 - e / 255)), i5e = (t, e) => e < 128 ? 2 * t * e / 255 : 255 * (1 - 2 * (1 - t / 255) * (1 - e / 255)), o5e = (t, e) => 255 * (1 - (1 - e / 255) / (t / 255)), a5e = (t, e) => t === 255 ? 255 : (t = 255 * (e / 255) / (1 - t / 255), t > 255 ? 255 : t);
  Wc.normal = tm(nm(Q9e));
  Wc.multiply = tm(nm(e5e));
  Wc.screen = tm(nm(r5e));
  Wc.overlay = tm(nm(i5e));
  Wc.darken = tm(nm(t5e));
  Wc.lighten = tm(nm(n5e));
  Wc.dodge = tm(nm(a5e));
  Wc.burn = tm(nm(o5e));
  const { pow: s5e, sin: l5e, cos: c5e } = Math;
  function d5e(t = 300, e = -1.5, n = 1, r = 1, i = [
    0,
    1
  ]) {
    let a = 0, s;
    Pr(i) === "array" ? s = i[1] - i[0] : (s = 0, i = [
      i,
      i
    ]);
    const l = function(c) {
      const d = Cu * ((t + 120) / 360 + e * c), u = s5e(i[0] + s * c, r), f = (a !== 0 ? n[0] + c * a : n) * u * (1 - u) / 2, g = c5e(d), m = l5e(d), v = u + f * (-0.14861 * g + 1.78277 * m), y = u + f * (-0.29227 * g - 0.90649 * m), w = u + f * (1.97294 * g);
      return Br(wP([
        v * 255,
        y * 255,
        w * 255,
        1
      ]));
    };
    return l.start = function(c) {
      return c == null ? t : (t = c, l);
    }, l.rotations = function(c) {
      return c == null ? e : (e = c, l);
    }, l.gamma = function(c) {
      return c == null ? r : (r = c, l);
    }, l.hue = function(c) {
      return c == null ? n : (n = c, Pr(n) === "array" ? (a = n[1] - n[0], a === 0 && (n = n[1])) : a = 0, l);
    }, l.lightness = function(c) {
      return c == null ? i : (Pr(c) === "array" ? (i = c, s = c[1] - c[0]) : (i = [
        c,
        c
      ], s = 0), l);
    }, l.scale = () => Br.scale(l), l.hue(n), l;
  }
  const u5e = "0123456789abcdef", { floor: h5e, random: f5e } = Math, m5e = (t = f5e) => {
    let e = "#";
    for (let n = 0; n < 6; n++) e += u5e.charAt(h5e(t() * 16));
    return new Gt(e, "hex");
  }, { log: mq, pow: g5e, floor: p5e, abs: F5e } = Math;
  function uae(t, e = null) {
    const n = {
      min: Number.MAX_VALUE,
      max: Number.MAX_VALUE * -1,
      sum: 0,
      values: [],
      count: 0
    };
    return Pr(t) === "object" && (t = Object.values(t)), t.forEach((r) => {
      e && Pr(r) === "object" && (r = r[e]), r != null && !isNaN(r) && (n.values.push(r), n.sum += r, r < n.min && (n.min = r), r > n.max && (n.max = r), n.count += 1);
    }), n.domain = [
      n.min,
      n.max
    ], n.limits = (r, i) => hae(n, r, i), n;
  }
  function hae(t, e = "equal", n = 7) {
    Pr(t) == "array" && (t = uae(t));
    const { min: r, max: i } = t, a = t.values.sort((l, c) => l - c);
    if (n === 1) return [
      r,
      i
    ];
    const s = [];
    if (e.substr(0, 1) === "c" && (s.push(r), s.push(i)), e.substr(0, 1) === "e") {
      s.push(r);
      for (let l = 1; l < n; l++) s.push(r + l / n * (i - r));
      s.push(i);
    } else if (e.substr(0, 1) === "l") {
      if (r <= 0) throw new Error("Logarithmic scales are only possible for values > 0");
      const l = Math.LOG10E * mq(r), c = Math.LOG10E * mq(i);
      s.push(r);
      for (let d = 1; d < n; d++) s.push(g5e(10, l + d / n * (c - l)));
      s.push(i);
    } else if (e.substr(0, 1) === "q") {
      s.push(r);
      for (let l = 1; l < n; l++) {
        const c = (a.length - 1) * l / n, d = p5e(c);
        if (d === c) s.push(a[d]);
        else {
          const u = c - d;
          s.push(a[d] * (1 - u) + a[d + 1] * u);
        }
      }
      s.push(i);
    } else if (e.substr(0, 1) === "k") {
      let l;
      const c = a.length, d = new Array(c), u = new Array(n);
      let h = true, f = 0, g = null;
      g = [], g.push(r);
      for (let y = 1; y < n; y++) g.push(r + y / n * (i - r));
      for (g.push(i); h; ) {
        for (let w = 0; w < n; w++) u[w] = 0;
        for (let w = 0; w < c; w++) {
          const b = a[w];
          let j = Number.MAX_VALUE, k;
          for (let C = 0; C < n; C++) {
            const x = F5e(g[C] - b);
            x < j && (j = x, k = C), u[k]++, d[w] = k;
          }
        }
        const y = new Array(n);
        for (let w = 0; w < n; w++) y[w] = null;
        for (let w = 0; w < c; w++) l = d[w], y[l] === null ? y[l] = a[w] : y[l] += a[w];
        for (let w = 0; w < n; w++) y[w] *= 1 / u[w];
        h = false;
        for (let w = 0; w < n; w++) if (y[w] !== g[w]) {
          h = true;
          break;
        }
        g = y, f++, f > 200 && (h = false);
      }
      const m = {};
      for (let y = 0; y < n; y++) m[y] = [];
      for (let y = 0; y < c; y++) l = d[y], m[l].push(a[y]);
      let v = [];
      for (let y = 0; y < n; y++) v.push(m[y][0]), v.push(m[y][m[y].length - 1]);
      v = v.sort((y, w) => y - w), s.push(v[0]);
      for (let y = 1; y < v.length; y += 2) {
        const w = v[y];
        !isNaN(w) && s.indexOf(w) === -1 && s.push(w);
      }
    }
    return s;
  }
  const v5e = (t, e) => {
    t = new Gt(t), e = new Gt(e);
    const n = t.luminance(), r = e.luminance();
    return n > r ? (n + 0.05) / (r + 0.05) : (r + 0.05) / (n + 0.05);
  };
  const gq = 0.027, _5e = 5e-4, y5e = 0.1, pq = 1.14, bw = 0.022, Fq = 1.414, b5e = (t, e) => {
    t = new Gt(t), e = new Gt(e), t.alpha() < 1 && (t = aF(e, t, t.alpha(), "rgb"));
    const n = vq(...t.rgb()), r = vq(...e.rgb()), i = n >= bw ? n : n + Math.pow(bw - n, Fq), a = r >= bw ? r : r + Math.pow(bw - r, Fq), s = Math.pow(a, 0.56) - Math.pow(i, 0.57), l = Math.pow(a, 0.65) - Math.pow(i, 0.62), c = Math.abs(a - i) < _5e ? 0 : i < a ? s * pq : l * pq;
    return (Math.abs(c) < y5e ? 0 : c > 0 ? c - gq : c + gq) * 100;
  };
  function vq(t, e, n) {
    return 0.2126729 * Math.pow(t / 255, 2.4) + 0.7151522 * Math.pow(e / 255, 2.4) + 0.072175 * Math.pow(n / 255, 2.4);
  }
  const { sqrt: Fu, pow: Do, min: x5e, max: w5e, atan2: _q, abs: yq, cos: xw, sin: bq, exp: D5e, PI: xq } = Math;
  function C5e(t, e, n = 1, r = 1, i = 1) {
    var a = function(ue) {
      return 360 * ue / (2 * xq);
    }, s = function(ue) {
      return 2 * xq * ue / 360;
    };
    t = new Gt(t), e = new Gt(e);
    const [l, c, d] = Array.from(t.lab()), [u, h, f] = Array.from(e.lab()), g = (l + u) / 2, m = Fu(Do(c, 2) + Do(d, 2)), v = Fu(Do(h, 2) + Do(f, 2)), y = (m + v) / 2, w = 0.5 * (1 - Fu(Do(y, 7) / (Do(y, 7) + Do(25, 7)))), b = c * (1 + w), j = h * (1 + w), k = Fu(Do(b, 2) + Do(d, 2)), C = Fu(Do(j, 2) + Do(f, 2)), x = (k + C) / 2, S = a(_q(d, b)), T = a(_q(f, j)), A = S >= 0 ? S : S + 360, B = T >= 0 ? T : T + 360, U = yq(A - B) > 180 ? (A + B + 360) / 2 : (A + B) / 2, z = 1 - 0.17 * xw(s(U - 30)) + 0.24 * xw(s(2 * U)) + 0.32 * xw(s(3 * U + 6)) - 0.2 * xw(s(4 * U - 63));
    let O = B - A;
    O = yq(O) <= 180 ? O : B <= A ? O + 360 : O - 360, O = 2 * Fu(k * C) * bq(s(O) / 2);
    const M = u - l, I = C - k, N = 1 + 0.015 * Do(g - 50, 2) / Fu(20 + Do(g - 50, 2)), L = 1 + 0.045 * x, H = 1 + 0.015 * x * z, V = 30 * D5e(-Do((U - 275) / 25, 2)), Y = -(2 * Fu(Do(x, 7) / (Do(x, 7) + Do(25, 7)))) * bq(2 * s(V)), oe = Fu(Do(M / (n * N), 2) + Do(I / (r * L), 2) + Do(O / (i * H), 2) + Y * (I / (r * L)) * (O / (i * H)));
    return w5e(0, x5e(100, oe));
  }
  function E5e(t, e, n = "lab") {
    t = new Gt(t), e = new Gt(e);
    const r = t.get(n), i = e.get(n);
    let a = 0;
    for (let s in r) {
      const l = (r[s] || 0) - (i[s] || 0);
      a += l * l;
    }
    return Math.sqrt(a);
  }
  const k5e = (...t) => {
    try {
      return new Gt(...t), true;
    } catch {
      return false;
    }
  }, S5e = {
    cool() {
      return Y4([
        Br.hsl(180, 1, 0.9),
        Br.hsl(250, 0.7, 0.4)
      ]);
    },
    hot() {
      return Y4([
        "#000",
        "#f00",
        "#ff0",
        "#fff"
      ]).mode("rgb");
    }
  }, eI = {
    OrRd: [
      "#fff7ec",
      "#fee8c8",
      "#fdd49e",
      "#fdbb84",
      "#fc8d59",
      "#ef6548",
      "#d7301f",
      "#b30000",
      "#7f0000"
    ],
    PuBu: [
      "#fff7fb",
      "#ece7f2",
      "#d0d1e6",
      "#a6bddb",
      "#74a9cf",
      "#3690c0",
      "#0570b0",
      "#045a8d",
      "#023858"
    ],
    BuPu: [
      "#f7fcfd",
      "#e0ecf4",
      "#bfd3e6",
      "#9ebcda",
      "#8c96c6",
      "#8c6bb1",
      "#88419d",
      "#810f7c",
      "#4d004b"
    ],
    Oranges: [
      "#fff5eb",
      "#fee6ce",
      "#fdd0a2",
      "#fdae6b",
      "#fd8d3c",
      "#f16913",
      "#d94801",
      "#a63603",
      "#7f2704"
    ],
    BuGn: [
      "#f7fcfd",
      "#e5f5f9",
      "#ccece6",
      "#99d8c9",
      "#66c2a4",
      "#41ae76",
      "#238b45",
      "#006d2c",
      "#00441b"
    ],
    YlOrBr: [
      "#ffffe5",
      "#fff7bc",
      "#fee391",
      "#fec44f",
      "#fe9929",
      "#ec7014",
      "#cc4c02",
      "#993404",
      "#662506"
    ],
    YlGn: [
      "#ffffe5",
      "#f7fcb9",
      "#d9f0a3",
      "#addd8e",
      "#78c679",
      "#41ab5d",
      "#238443",
      "#006837",
      "#004529"
    ],
    Reds: [
      "#fff5f0",
      "#fee0d2",
      "#fcbba1",
      "#fc9272",
      "#fb6a4a",
      "#ef3b2c",
      "#cb181d",
      "#a50f15",
      "#67000d"
    ],
    RdPu: [
      "#fff7f3",
      "#fde0dd",
      "#fcc5c0",
      "#fa9fb5",
      "#f768a1",
      "#dd3497",
      "#ae017e",
      "#7a0177",
      "#49006a"
    ],
    Greens: [
      "#f7fcf5",
      "#e5f5e0",
      "#c7e9c0",
      "#a1d99b",
      "#74c476",
      "#41ab5d",
      "#238b45",
      "#006d2c",
      "#00441b"
    ],
    YlGnBu: [
      "#ffffd9",
      "#edf8b1",
      "#c7e9b4",
      "#7fcdbb",
      "#41b6c4",
      "#1d91c0",
      "#225ea8",
      "#253494",
      "#081d58"
    ],
    Purples: [
      "#fcfbfd",
      "#efedf5",
      "#dadaeb",
      "#bcbddc",
      "#9e9ac8",
      "#807dba",
      "#6a51a3",
      "#54278f",
      "#3f007d"
    ],
    GnBu: [
      "#f7fcf0",
      "#e0f3db",
      "#ccebc5",
      "#a8ddb5",
      "#7bccc4",
      "#4eb3d3",
      "#2b8cbe",
      "#0868ac",
      "#084081"
    ],
    Greys: [
      "#ffffff",
      "#f0f0f0",
      "#d9d9d9",
      "#bdbdbd",
      "#969696",
      "#737373",
      "#525252",
      "#252525",
      "#000000"
    ],
    YlOrRd: [
      "#ffffcc",
      "#ffeda0",
      "#fed976",
      "#feb24c",
      "#fd8d3c",
      "#fc4e2a",
      "#e31a1c",
      "#bd0026",
      "#800026"
    ],
    PuRd: [
      "#f7f4f9",
      "#e7e1ef",
      "#d4b9da",
      "#c994c7",
      "#df65b0",
      "#e7298a",
      "#ce1256",
      "#980043",
      "#67001f"
    ],
    Blues: [
      "#f7fbff",
      "#deebf7",
      "#c6dbef",
      "#9ecae1",
      "#6baed6",
      "#4292c6",
      "#2171b5",
      "#08519c",
      "#08306b"
    ],
    PuBuGn: [
      "#fff7fb",
      "#ece2f0",
      "#d0d1e6",
      "#a6bddb",
      "#67a9cf",
      "#3690c0",
      "#02818a",
      "#016c59",
      "#014636"
    ],
    Viridis: [
      "#440154",
      "#482777",
      "#3f4a8a",
      "#31678e",
      "#26838f",
      "#1f9d8a",
      "#6cce5a",
      "#b6de2b",
      "#fee825"
    ],
    Spectral: [
      "#9e0142",
      "#d53e4f",
      "#f46d43",
      "#fdae61",
      "#fee08b",
      "#ffffbf",
      "#e6f598",
      "#abdda4",
      "#66c2a5",
      "#3288bd",
      "#5e4fa2"
    ],
    RdYlGn: [
      "#a50026",
      "#d73027",
      "#f46d43",
      "#fdae61",
      "#fee08b",
      "#ffffbf",
      "#d9ef8b",
      "#a6d96a",
      "#66bd63",
      "#1a9850",
      "#006837"
    ],
    RdBu: [
      "#67001f",
      "#b2182b",
      "#d6604d",
      "#f4a582",
      "#fddbc7",
      "#f7f7f7",
      "#d1e5f0",
      "#92c5de",
      "#4393c3",
      "#2166ac",
      "#053061"
    ],
    PiYG: [
      "#8e0152",
      "#c51b7d",
      "#de77ae",
      "#f1b6da",
      "#fde0ef",
      "#f7f7f7",
      "#e6f5d0",
      "#b8e186",
      "#7fbc41",
      "#4d9221",
      "#276419"
    ],
    PRGn: [
      "#40004b",
      "#762a83",
      "#9970ab",
      "#c2a5cf",
      "#e7d4e8",
      "#f7f7f7",
      "#d9f0d3",
      "#a6dba0",
      "#5aae61",
      "#1b7837",
      "#00441b"
    ],
    RdYlBu: [
      "#a50026",
      "#d73027",
      "#f46d43",
      "#fdae61",
      "#fee090",
      "#ffffbf",
      "#e0f3f8",
      "#abd9e9",
      "#74add1",
      "#4575b4",
      "#313695"
    ],
    BrBG: [
      "#543005",
      "#8c510a",
      "#bf812d",
      "#dfc27d",
      "#f6e8c3",
      "#f5f5f5",
      "#c7eae5",
      "#80cdc1",
      "#35978f",
      "#01665e",
      "#003c30"
    ],
    RdGy: [
      "#67001f",
      "#b2182b",
      "#d6604d",
      "#f4a582",
      "#fddbc7",
      "#ffffff",
      "#e0e0e0",
      "#bababa",
      "#878787",
      "#4d4d4d",
      "#1a1a1a"
    ],
    PuOr: [
      "#7f3b08",
      "#b35806",
      "#e08214",
      "#fdb863",
      "#fee0b6",
      "#f7f7f7",
      "#d8daeb",
      "#b2abd2",
      "#8073ac",
      "#542788",
      "#2d004b"
    ],
    Set2: [
      "#66c2a5",
      "#fc8d62",
      "#8da0cb",
      "#e78ac3",
      "#a6d854",
      "#ffd92f",
      "#e5c494",
      "#b3b3b3"
    ],
    Accent: [
      "#7fc97f",
      "#beaed4",
      "#fdc086",
      "#ffff99",
      "#386cb0",
      "#f0027f",
      "#bf5b17",
      "#666666"
    ],
    Set1: [
      "#e41a1c",
      "#377eb8",
      "#4daf4a",
      "#984ea3",
      "#ff7f00",
      "#ffff33",
      "#a65628",
      "#f781bf",
      "#999999"
    ],
    Set3: [
      "#8dd3c7",
      "#ffffb3",
      "#bebada",
      "#fb8072",
      "#80b1d3",
      "#fdb462",
      "#b3de69",
      "#fccde5",
      "#d9d9d9",
      "#bc80bd",
      "#ccebc5",
      "#ffed6f"
    ],
    Dark2: [
      "#1b9e77",
      "#d95f02",
      "#7570b3",
      "#e7298a",
      "#66a61e",
      "#e6ab02",
      "#a6761d",
      "#666666"
    ],
    Paired: [
      "#a6cee3",
      "#1f78b4",
      "#b2df8a",
      "#33a02c",
      "#fb9a99",
      "#e31a1c",
      "#fdbf6f",
      "#ff7f00",
      "#cab2d6",
      "#6a3d9a",
      "#ffff99",
      "#b15928"
    ],
    Pastel2: [
      "#b3e2cd",
      "#fdcdac",
      "#cbd5e8",
      "#f4cae4",
      "#e6f5c9",
      "#fff2ae",
      "#f1e2cc",
      "#cccccc"
    ],
    Pastel1: [
      "#fbb4ae",
      "#b3cde3",
      "#ccebc5",
      "#decbe4",
      "#fed9a6",
      "#ffffcc",
      "#e5d8bd",
      "#fddaec",
      "#f2f2f2"
    ]
  }, fae = Object.keys(eI), wq = new Map(fae.map((t) => [
    t.toLowerCase(),
    t
  ])), j5e = typeof Proxy == "function" ? new Proxy(eI, {
    get(t, e) {
      const n = e.toLowerCase();
      if (wq.has(n)) return t[wq.get(n)];
    },
    getOwnPropertyNames() {
      return Object.getOwnPropertyNames(fae);
    }
  }) : eI, T5e = (...t) => {
    t = Er(t, "cmyk");
    const [e, n, r, i] = t, a = t.length > 4 ? t[4] : 1;
    return i === 1 ? [
      0,
      0,
      0,
      a
    ] : [
      e >= 1 ? 0 : 255 * (1 - e) * (1 - i),
      n >= 1 ? 0 : 255 * (1 - n) * (1 - i),
      r >= 1 ? 0 : 255 * (1 - r) * (1 - i),
      a
    ];
  }, { max: Dq } = Math, R5e = (...t) => {
    let [e, n, r] = Er(t, "rgb");
    e = e / 255, n = n / 255, r = r / 255;
    const i = 1 - Dq(e, Dq(n, r)), a = i < 1 ? 1 / (1 - i) : 0, s = (1 - e - i) * a, l = (1 - n - i) * a, c = (1 - r - i) * a;
    return [
      s,
      l,
      c,
      i
    ];
  };
  Gt.prototype.cmyk = function() {
    return R5e(this._rgb);
  };
  const A5e = (...t) => new Gt(...t, "cmyk");
  Object.assign(Br, {
    cmyk: A5e
  });
  yr.format.cmyk = T5e;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "cmyk"), Pr(t) === "array" && t.length === 4) return "cmyk";
    }
  });
  const I5e = (...t) => {
    const e = Er(t, "hsla");
    let n = NF(t) || "lsa";
    return e[0] = Vl(e[0] || 0) + "deg", e[1] = Vl(e[1] * 100) + "%", e[2] = Vl(e[2] * 100) + "%", n === "hsla" || e.length > 3 && e[3] < 1 ? (e[3] = "/ " + (e.length > 3 ? e[3] : 1), n = "hsla") : e.length = 3, `${n.substr(0, 3)}(${e.join(" ")})`;
  }, B5e = (...t) => {
    const e = Er(t, "lab");
    let n = NF(t) || "lab";
    return e[0] = Vl(e[0]) + "%", e[1] = Vl(e[1]), e[2] = Vl(e[2]), n === "laba" || e.length > 3 && e[3] < 1 ? e[3] = "/ " + (e.length > 3 ? e[3] : 1) : e.length = 3, `lab(${e.join(" ")})`;
  }, P5e = (...t) => {
    const e = Er(t, "lch");
    let n = NF(t) || "lab";
    return e[0] = Vl(e[0]) + "%", e[1] = Vl(e[1]), e[2] = isNaN(e[2]) ? "none" : Vl(e[2]) + "deg", n === "lcha" || e.length > 3 && e[3] < 1 ? e[3] = "/ " + (e.length > 3 ? e[3] : 1) : e.length = 3, `lch(${e.join(" ")})`;
  }, M5e = (...t) => {
    const e = Er(t, "lab");
    return e[0] = Vl(e[0] * 100) + "%", e[1] = XA(e[1]), e[2] = XA(e[2]), e.length > 3 && e[3] < 1 ? e[3] = "/ " + (e.length > 3 ? e[3] : 1) : e.length = 3, `oklab(${e.join(" ")})`;
  }, mae = (...t) => {
    const [e, n, r, ...i] = Er(t, "rgb"), [a, s, l] = jP(e, n, r), [c, d, u] = sae(a, s, l);
    return [
      c,
      d,
      u,
      ...i.length > 0 && i[0] < 1 ? [
        i[0]
      ] : []
    ];
  }, O5e = (...t) => {
    const e = Er(t, "lch");
    return e[0] = Vl(e[0] * 100) + "%", e[1] = XA(e[1]), e[2] = isNaN(e[2]) ? "none" : Vl(e[2]) + "deg", e.length > 3 && e[3] < 1 ? e[3] = "/ " + (e.length > 3 ? e[3] : 1) : e.length = 3, `oklch(${e.join(" ")})`;
  }, { round: Q9 } = Math, L5e = (...t) => {
    const e = Er(t, "rgba");
    let n = NF(t) || "rgb";
    if (n.substr(0, 3) === "hsl") return I5e(cae(e), n);
    if (n.substr(0, 3) === "lab") {
      const r = sb();
      Bu("d50");
      const i = B5e(CP(e), n);
      return Bu(r), i;
    }
    if (n.substr(0, 3) === "lch") {
      const r = sb();
      Bu("d50");
      const i = P5e(kP(e), n);
      return Bu(r), i;
    }
    return n.substr(0, 5) === "oklab" ? M5e(jP(e)) : n.substr(0, 5) === "oklch" ? O5e(mae(e)) : (e[0] = Q9(e[0]), e[1] = Q9(e[1]), e[2] = Q9(e[2]), (n === "rgba" || e.length > 3 && e[3] < 1) && (e[3] = "/ " + (e.length > 3 ? e[3] : 1), n = "rgba"), `${n.substr(0, 3)}(${e.slice(0, n === "rgb" ? 3 : 4).join(" ")})`);
  }, gae = (...t) => {
    t = Er(t, "lch");
    const [e, n, r, ...i] = t, [a, s, l] = aae(e, n, r), [c, d, u] = SP(a, s, l);
    return [
      c,
      d,
      u,
      ...i.length > 0 && i[0] < 1 ? [
        i[0]
      ] : []
    ];
  }, qu = /((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source, Mc = /((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source, Z4 = /((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source, Kl = /\s*/.source, UF = /\s+/.source, TP = /\s*,\s*/.source, Uk = /((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source, VF = /\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source, pae = new RegExp("^rgba?\\(" + Kl + [
    qu,
    qu,
    qu
  ].join(UF) + VF + "\\)$"), Fae = new RegExp("^rgb\\(" + Kl + [
    qu,
    qu,
    qu
  ].join(TP) + Kl + "\\)$"), vae = new RegExp("^rgba\\(" + Kl + [
    qu,
    qu,
    qu,
    Mc
  ].join(TP) + Kl + "\\)$"), _ae = new RegExp("^hsla?\\(" + Kl + [
    Uk,
    Z4,
    Z4
  ].join(UF) + VF + "\\)$"), yae = new RegExp("^hsl?\\(" + Kl + [
    Uk,
    Z4,
    Z4
  ].join(TP) + Kl + "\\)$"), bae = /^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/, xae = new RegExp("^lab\\(" + Kl + [
    Mc,
    Mc,
    Mc
  ].join(UF) + VF + "\\)$"), wae = new RegExp("^lch\\(" + Kl + [
    Mc,
    Mc,
    Uk
  ].join(UF) + VF + "\\)$"), Dae = new RegExp("^oklab\\(" + Kl + [
    Mc,
    Mc,
    Mc
  ].join(UF) + VF + "\\)$"), Cae = new RegExp("^oklch\\(" + Kl + [
    Mc,
    Mc,
    Uk
  ].join(UF) + VF + "\\)$"), { round: Eae } = Math, w0 = (t) => t.map((e, n) => n <= 2 ? kg(Eae(e), 0, 255) : e), Co = (t, e = 0, n = 100, r = false) => (typeof t == "string" && t.endsWith("%") && (t = parseFloat(t.substring(0, t.length - 1)) / 100, r ? t = e + (t + 1) * 0.5 * (n - e) : t = e + t * (n - e)), +t), es = (t, e) => t === "none" ? e : t, RP = (t) => {
    if (t = t.toLowerCase().trim(), t === "transparent") return [
      0,
      0,
      0,
      0
    ];
    let e;
    if (yr.format.named) try {
      return yr.format.named(t);
    } catch {
    }
    if ((e = t.match(pae)) || (e = t.match(Fae))) {
      let n = e.slice(1, 4);
      for (let i = 0; i < 3; i++) n[i] = +Co(es(n[i], 0), 0, 255);
      n = w0(n);
      const r = e[4] !== void 0 ? +Co(e[4], 0, 1) : 1;
      return n[3] = r, n;
    }
    if (e = t.match(vae)) {
      const n = e.slice(1, 5);
      for (let r = 0; r < 4; r++) n[r] = +Co(n[r], 0, 255);
      return n;
    }
    if ((e = t.match(_ae)) || (e = t.match(yae))) {
      const n = e.slice(1, 4);
      n[0] = +es(n[0].replace("deg", ""), 0), n[1] = +Co(es(n[1], 0), 0, 100) * 0.01, n[2] = +Co(es(n[2], 0), 0, 100) * 0.01;
      const r = w0(QA(n)), i = e[4] !== void 0 ? +Co(e[4], 0, 1) : 1;
      return r[3] = i, r;
    }
    if (e = t.match(bae)) {
      const n = e.slice(1, 4);
      n[1] *= 0.01, n[2] *= 0.01;
      const r = QA(n);
      for (let i = 0; i < 3; i++) r[i] = Eae(r[i]);
      return r[3] = +e[4], r;
    }
    if (e = t.match(xae)) {
      const n = e.slice(1, 4);
      n[0] = Co(es(n[0], 0), 0, 100), n[1] = Co(es(n[1], 0), -125, 125, true), n[2] = Co(es(n[2], 0), -125, 125, true);
      const r = sb();
      Bu("d50");
      const i = w0(DP(n));
      Bu(r);
      const a = e[4] !== void 0 ? +Co(e[4], 0, 1) : 1;
      return i[3] = a, i;
    }
    if (e = t.match(wae)) {
      const n = e.slice(1, 4);
      n[0] = Co(n[0], 0, 100), n[1] = Co(es(n[1], 0), 0, 150, false), n[2] = +es(n[2].replace("deg", ""), 0);
      const r = sb();
      Bu("d50");
      const i = w0(EP(n));
      Bu(r);
      const a = e[4] !== void 0 ? +Co(e[4], 0, 1) : 1;
      return i[3] = a, i;
    }
    if (e = t.match(Dae)) {
      const n = e.slice(1, 4);
      n[0] = Co(es(n[0], 0), 0, 1), n[1] = Co(es(n[1], 0), -0.4, 0.4, true), n[2] = Co(es(n[2], 0), -0.4, 0.4, true);
      const r = w0(SP(n)), i = e[4] !== void 0 ? +Co(e[4], 0, 1) : 1;
      return r[3] = i, r;
    }
    if (e = t.match(Cae)) {
      const n = e.slice(1, 4);
      n[0] = Co(es(n[0], 0), 0, 1), n[1] = Co(es(n[1], 0), 0, 0.4, false), n[2] = +es(n[2].replace("deg", ""), 0);
      const r = w0(gae(n)), i = e[4] !== void 0 ? +Co(e[4], 0, 1) : 1;
      return r[3] = i, r;
    }
  };
  RP.test = (t) => pae.test(t) || _ae.test(t) || xae.test(t) || wae.test(t) || Dae.test(t) || Cae.test(t) || Fae.test(t) || vae.test(t) || yae.test(t) || bae.test(t) || t === "transparent";
  Gt.prototype.css = function(t) {
    return L5e(this._rgb, t);
  };
  const N5e = (...t) => new Gt(...t, "css");
  Br.css = N5e;
  yr.format.css = RP;
  yr.autodetect.push({
    p: 5,
    test: (t, ...e) => {
      if (!e.length && Pr(t) === "string" && RP.test(t)) return "css";
    }
  });
  yr.format.gl = (...t) => {
    const e = Er(t, "rgba");
    return e[0] *= 255, e[1] *= 255, e[2] *= 255, e;
  };
  const z5e = (...t) => new Gt(...t, "gl");
  Br.gl = z5e;
  Gt.prototype.gl = function() {
    const t = this._rgb;
    return [
      t[0] / 255,
      t[1] / 255,
      t[2] / 255,
      t[3]
    ];
  };
  Gt.prototype.hex = function(t) {
    return rae(this._rgb, t);
  };
  const U5e = (...t) => new Gt(...t, "hex");
  Br.hex = U5e;
  yr.format.hex = nae;
  yr.autodetect.push({
    p: 4,
    test: (t, ...e) => {
      if (!e.length && Pr(t) === "string" && [
        3,
        4,
        5,
        6,
        7,
        8,
        9
      ].indexOf(t.length) >= 0) return "hex";
    }
  });
  const { log: ww } = Math, kae = (t) => {
    const e = t / 100;
    let n, r, i;
    return e < 66 ? (n = 255, r = e < 6 ? 0 : -155.25485562709179 - 0.44596950469579133 * (r = e - 2) + 104.49216199393888 * ww(r), i = e < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (i = e - 10) + 115.67994401066147 * ww(i)) : (n = 351.97690566805693 + 0.114206453784165 * (n = e - 55) - 40.25366309332127 * ww(n), r = 325.4494125711974 + 0.07943456536662342 * (r = e - 50) - 28.0852963507957 * ww(r), i = 255), [
      n,
      r,
      i,
      1
    ];
  }, { round: V5e } = Math, H5e = (...t) => {
    const e = Er(t, "rgb"), n = e[0], r = e[2];
    let i = 1e3, a = 4e4;
    const s = 0.4;
    let l;
    for (; a - i > s; ) {
      l = (a + i) * 0.5;
      const c = kae(l);
      c[2] / c[0] >= r / n ? a = l : i = l;
    }
    return V5e(l);
  };
  Gt.prototype.temp = Gt.prototype.kelvin = Gt.prototype.temperature = function() {
    return H5e(this._rgb);
  };
  const e5 = (...t) => new Gt(...t, "temp");
  Object.assign(Br, {
    temp: e5,
    kelvin: e5,
    temperature: e5
  });
  yr.format.temp = yr.format.kelvin = yr.format.temperature = kae;
  Gt.prototype.oklch = function() {
    return mae(this._rgb);
  };
  const $5e = (...t) => new Gt(...t, "oklch");
  Object.assign(Br, {
    oklch: $5e
  });
  yr.format.oklch = gae;
  yr.autodetect.push({
    p: 2,
    test: (...t) => {
      if (t = Er(t, "oklch"), Pr(t) === "array" && t.length === 3) return "oklch";
    }
  });
  Object.assign(Br, {
    analyze: uae,
    average: W9e,
    bezier: J9e,
    blend: Wc,
    brewer: j5e,
    Color: Gt,
    colors: oF,
    contrast: v5e,
    contrastAPCA: b5e,
    cubehelix: d5e,
    deltaE: C5e,
    distance: E5e,
    input: yr,
    interpolate: aF,
    limits: hae,
    mix: aF,
    random: m5e,
    scale: Y4,
    scales: S5e,
    valid: k5e
  });
  const Cq = (t, e) => {
    if (!Br.valid(e)) return e;
    let n = Br(e).lab()[0];
    return t === Rr.Dark && n < 60 && (n = 60), t === Rr.Light && n > 50 && (n = 50), Br(e).set("lab.l", n).hex();
  }, W5e = (t, e) => e - t, Sae = (t) => t.sort(W5e), HF = (t) => {
    const e = Object.keys(t).map((n) => {
      const r = parseInt(n, 10);
      if (!Number.isNaN(r)) return r;
    }).filter((n) => typeof n == "number");
    return Sae(e);
  }, jae = (t) => {
    const e = /* @__PURE__ */ new Set(), n = (r) => {
      Object.keys(r).forEach((i) => {
        const a = r[i];
        if (typeof a == "number") {
          e.add(a);
          return;
        }
        a && typeof a == "object" && n(a);
      });
    };
    return n(t), e;
  }, Eq = {
    9001: {
      name: "Goku",
      color: "#ff6a00"
    },
    150: {
      name: "Manager",
      color: "#ff6a7f"
    },
    101: {
      name: "Founder",
      color: "#0000ff"
    },
    100: {
      name: "Admin",
      color: "#0088ff"
    },
    50: {
      name: "Moderator",
      color: "#1fd81f"
    },
    0: {
      name: "Member",
      color: "#91cfdf"
    },
    [-1]: {
      name: "Muted",
      color: "#888888"
    }
  }, Tae = (t, e) => {
    const r = Sae(HF(t)).find((a) => a < e), i = typeof r == "number" ? t[r] : void 0;
    return {
      name: i ? `${i.name} ${e}` : `Team ${e}`
    };
  }, yh = (t, e) => {
    const n = $i(t, Pn.PowerLevelTags);
    return p.useMemo(() => {
      const a = {
        ...n == null ? void 0 : n.getContent()
      }, s = jae(e);
      return Array.from(s).forEach((l) => {
        var _a6;
        ((_a6 = a[l]) == null ? void 0 : _a6.name) === void 0 && (a[l] = Eq[l] ?? Tae(Eq, l));
      }), a;
    }, [
      e,
      n
    ]);
  }, tI = (t, e) => t[e] ?? Tae(t, e), q5e = {
    name: "Founder",
    color: "#0000ff"
  }, Ep = () => q5e, bh = (t, e, n) => {
    const r = Ep(), i = yh(t, n);
    return p.useCallback((s) => {
      if (e.has(s)) return r;
      const l = va.user(n, s);
      return tI(i, l);
    }, [
      e,
      r,
      n,
      i
    ]);
  }, qc = (t, e, n) => {
    var _a6;
    return ((_a6 = n == null ? void 0 : n.key) == null ? void 0 : _a6.startsWith("mxc://")) ? t.mxcUrlToHttp(n.key, 96, 96, "scale", void 0, void 0, e) ?? "\u{1F33B}" : n == null ? void 0 : n.key;
  }, Vk = (t, e, n) => p.useMemo(() => {
    const i = /* @__PURE__ */ new Map();
    return e.color && i.set(e.color, Cq(t, e.color)), Object.values(n).forEach((a) => {
      const { color: s } = a;
      s && i.set(s, Cq(t, s));
    }), i;
  }, [
    n,
    e,
    t
  ]), Rae = (t, e) => p.useMemo(() => {
    let r;
    const i = [];
    return t.forEach((a) => {
      const s = e(a.userId);
      s !== r && (r = s, i.push(s)), i.push(a);
    }), i;
  }, [
    t,
    e
  ]);
  function rm(t, e, n) {
    const r = yp(), i = Hc(t, e), a = Mo(e), s = ri(e), l = Ep(), c = yh(e, a), d = bh(e, s, a), u = Vk(r.kind, l, c);
    return p.useMemo(() => {
      if (!e || !t) return {
        color: void 0,
        font: void 0
      };
      let h = n ? i.heroNameColor : i.resolvedColor;
      if (!h) {
        const g = d(t);
        h = (g == null ? void 0 : g.color) ? u == null ? void 0 : u.get(g.color) : void 0;
      }
      return {
        color: h,
        font: i.resolvedFont
      };
    }, [
      e,
      t,
      n,
      i.heroNameColor,
      i.resolvedColor,
      i.resolvedFont,
      d,
      u
    ]);
  }
  const kp = () => {
    const t = vh(ce.IgnoredUserList);
    return p.useMemo(() => {
      const n = (t == null ? void 0 : t.getContent().ignored_users) ?? {};
      return Object.keys(n);
    }, [
      t
    ]);
  }, AP = () => Ze(SB), Hk = () => {
    const t = Fn(SB);
    return p.useCallback(() => {
      t(void 0);
    }, [
      t
    ]);
  }, Ls = () => {
    const t = Fn(SB);
    return p.useCallback((n, r, i, a, s, l) => {
      t({
        roomId: n,
        spaceId: r,
        userId: i,
        cords: a,
        position: s,
        initialProfile: l
      });
    }, [
      t
    ]);
  };
  function Li({ roomId: t, userId: e, userName: n }) {
    const i = be().getRoom(t), { color: a, font: s } = rm(e, i ?? {}), l = Ls(), c = p.useCallback((d) => {
      d.preventDefault(), d.stopPropagation(), l(t, void 0, e, d.currentTarget.getBoundingClientRect());
    }, [
      t,
      e,
      l
    ]);
    return o.jsx(D, {
      as: "a",
      onClick: c,
      truncate: true,
      children: o.jsxs("b", {
        style: {
          color: a,
          font: s
        },
        children: [
          n ?? e,
          " "
        ]
      })
    });
  }
  const IP = () => (e) => {
    const n = e.getContent(), r = e.getPrevContent(), i = e.getSender(), a = e.getStateKey(), s = e.getRoomId(), l = typeof n.reason == "string" ? n.reason : void 0;
    if (!i || !a) return {
      icon: q.User,
      body: "Broken membership event"
    };
    const c = _n(i), d = typeof n.displayname == "string" && n.displayname || _n(a);
    if (xk(e)) {
      if (n.membership === Ht.Invite) return r.membership === Ht.Knock ? {
        icon: q.ArrowGoRightPlus,
        body: o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            o.jsx(D, {
              children: " accepted "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                "'s join request ",
                l
              ]
            })
          ]
        })
      } : {
        icon: q.ArrowGoRightPlus,
        body: o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            o.jsx(D, {
              children: " invited "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsx(D, {
              children: l
            })
          ]
        })
      };
      if (n.membership === Ht.Knock) return {
        icon: q.Mail,
        body: o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                " requested to join room: ",
                o.jsx("i", {
                  children: l
                })
              ]
            })
          ]
        })
      };
      if (n.membership === Ht.Join) return {
        icon: q.ArrowGoRight,
        body: o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsx(D, {
              children: " joined the room"
            })
          ]
        })
      };
      if (n.membership === Ht.Leave) return r.membership === Ht.Invite ? {
        icon: q.ArrowGoRightCross,
        body: i === a ? o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                " rejected the invitation ",
                l
              ]
            })
          ]
        }) : o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            o.jsx(D, {
              children: " rejected "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                "'s join request ",
                l
              ]
            })
          ]
        })
      } : r.membership === Ht.Knock ? {
        icon: q.ArrowGoRightCross,
        body: i === a ? o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                " revoked joined request ",
                l
              ]
            })
          ]
        }) : o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            " revoked ",
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                "'s invite ",
                l
              ]
            })
          ]
        })
      } : r.membership === Ht.Ban ? {
        icon: q.ArrowGoLeft,
        body: o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            o.jsx(D, {
              children: " unbanned "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsx(D, {
              children: l
            })
          ]
        })
      } : {
        icon: q.ArrowGoLeft,
        body: i === a ? o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsxs(D, {
              children: [
                " left the room ",
                l
              ]
            })
          ]
        }) : o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            o.jsx(D, {
              children: " kicked "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsx(D, {
              children: l
            })
          ]
        })
      };
      if (n.membership === Ht.Ban) return {
        icon: q.ArrowGoLeft,
        body: o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: i,
              userName: c
            }),
            o.jsx(D, {
              children: " banned "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            }),
            o.jsx(D, {
              children: l
            })
          ]
        })
      };
    }
    if (n.displayname !== r.displayname) {
      const u = typeof r.displayname == "string" && r.displayname || _n(a);
      return {
        icon: q.Mention,
        body: typeof n.displayname == "string" ? o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: u
            }),
            o.jsx(D, {
              children: " changed display name to "
            }),
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: d
            })
          ]
        }) : o.jsxs(o.Fragment, {
          children: [
            o.jsx(Li, {
              roomId: s ?? "",
              userId: a,
              userName: u
            }),
            o.jsx(D, {
              children: " removed their display name "
            })
          ]
        })
      };
    }
    return n.avatar_url !== r.avatar_url ? {
      icon: q.User,
      body: n.avatar_url && typeof n.avatar_url == "string" ? o.jsxs(o.Fragment, {
        children: [
          o.jsx(Li, {
            roomId: s ?? "",
            userId: a,
            userName: d
          }),
          o.jsx(D, {
            children: " changed their avatar"
          })
        ]
      }) : o.jsxs(o.Fragment, {
        children: [
          o.jsx(Li, {
            roomId: s ?? "",
            userId: a,
            userName: d
          }),
          o.jsx(D, {
            children: " removed their avatar "
          })
        ]
      })
    } : {
      icon: q.User,
      body: "Membership event with no changes"
    };
  };
  function BP() {
    const t = br(), e = Za();
    return p.useCallback((n, r) => {
      const i = Wo(PF, e.pathname) ? void 0 : {
        backgroundLocation: e
      };
      t(ig(n, iP(r)), {
        state: i
      });
    }, [
      e,
      t
    ]);
  }
  const $F = (t, e) => {
    p.useEffect(() => (t == null ? void 0 : t.on(jt.Sync, e), () => {
      t == null ? void 0 : t.removeListener(jt.Sync, e);
    }), [
      t,
      e
    ]);
  }, qh = vn(/* @__PURE__ */ new Map()), vi = vn((t) => t(qh), (t, e, n) => {
    if (n.type === "INITIALIZE") {
      e(qh, n.roomToParents);
      return;
    }
    if (n.type === "PUT") {
      e(qh, uo(t(qh), (r) => {
        oie(r, n.parent, n.children);
      }));
      return;
    }
    if (n.type === "REMOVE_CHILD") {
      e(qh, uo(t(qh), (r) => {
        const i = r.get(n.child);
        i && (i.delete(n.parent), i.size === 0 ? r.delete(n.child) : r.set(n.child, i));
      }));
      return;
    }
    n.type === "DELETE" && e(qh, uo(t(qh), (r) => {
      const i = [];
      r.delete(n.roomId), r.forEach((a, s) => {
        a.delete(n.roomId), a.size === 0 && i.push(s);
      }), i.forEach((a) => r.delete(a));
    }));
  }), K5e = (t, e) => {
    const n = Fn(e), r = p.useCallback(() => n({
      type: "INITIALIZE",
      roomToParents: L4e(t)
    }), [
      t,
      n
    ]);
    $F(t, p.useCallback((i, a) => {
      (i === Nn.Prepared && a === null || i === Nn.Syncing && a !== Nn.Syncing) && r();
    }, [
      r
    ])), p.useEffect(() => {
      r();
      const i = (c) => {
        Uu(c) && c.getMyMembership() === Ht.Join && n({
          type: "PUT",
          parent: c.roomId,
          children: s4(c)
        });
      }, a = (c, d) => {
        if (Uu(c) && d !== Ht.Join) {
          n({
            type: "DELETE",
            roomId: c.roomId
          });
          return;
        }
        Uu(c) && d === Ht.Join && n({
          type: "PUT",
          parent: c.roomId,
          children: s4(c)
        });
      }, s = (c) => {
        if (c.getType() === ce.SpaceChild) {
          const d = c.getStateKey(), u = c.getRoomId();
          if (d && u) {
            const h = t.getRoom(u);
            if (!h || h.getMyMembership() !== Ht.Join) return;
            X1(c) ? n({
              type: "PUT",
              parent: u,
              children: [
                d
              ]
            }) : n({
              type: "REMOVE_CHILD",
              parent: u,
              child: d
            });
          }
        }
      }, l = (c) => {
        n({
          type: "DELETE",
          roomId: c
        });
      };
      return t.on(jt.Room, i), t.on(mt.MyMembership, a), t.on(qn.Events, s), t.on(jt.DeleteRoom, l), () => {
        t.removeListener(jt.Room, i), t.removeListener(mt.MyMembership, a), t.removeListener(qn.Events, s), t.removeListener(jt.DeleteRoom, l);
      };
    }, [
      t,
      n,
      r
    ]);
  }, kq = vn(/* @__PURE__ */ new Set()), gi = vn((t) => t(kq), (t, e, n) => {
    e(kq, n.rooms);
  }), G5e = (t, e) => {
    const n = Fn(e);
    p.useEffect(() => {
      const r = Qu(t, ce.Direct);
      r && n({
        type: "INITIALIZE",
        rooms: Hy(r)
      });
      const i = (a) => {
        a.getType() === ce.Direct && n({
          type: "UPDATE",
          rooms: Hy(a)
        });
      };
      return t.on(jt.AccountData, i), () => {
        t.removeListener(jt.AccountData, i);
      };
    }, [
      t,
      n
    ]);
  }, $k = () => {
    const t = be(), { spaceIdOrAlias: e } = Fl(), n = e && decodeURIComponent(e);
    return n && ml(n) ? eF(t, n) : n;
  }, Y5e = (t) => !!Ko({
    path: decodeURIComponent(Qg(t)),
    caseSensitive: true,
    end: false
  }), Z5e = (t) => !!Ko({
    path: decodeURIComponent(tP(t)),
    caseSensitive: true,
    end: false
  }), Wi = () => {
    const t = br(), e = be(), n = Ze(vi), r = Ze(gi), i = $k(), [a] = Fe(ge, "developerTools"), s = p.useCallback((c) => {
      const d = wi(e, c);
      t(Sk(d));
    }, [
      e,
      t
    ]), l = p.useCallback((c, d, u) => {
      const h = wi(e, c), f = a && i === c, g = f ? [
        c
      ] : aie(n, c);
      if (g.length > 0) {
        let m;
        i && g.includes(i) ? m = i : m = K2(e, c, g) ?? g[0] ?? c;
        const v = wi(e, m);
        t(tF(v, f ? c : h, d), u);
        return;
      }
      if (r.has(c)) {
        t(xp(h, d), u);
        return;
      }
      t(Xg(h, d), u);
    }, [
      e,
      t,
      i,
      n,
      r,
      a
    ]);
    return {
      navigateSpace: s,
      navigateRoom: l
    };
  }, PP = p.createContext(null), WF = PP.Provider;
  function im() {
    const t = p.useContext(PP);
    if (!t) throw new Error("Space not provided!");
    return t;
  }
  function ka() {
    return p.useContext(PP);
  }
  const om = (t) => {
    const e = be(), { navigateRoom: n, navigateSpace: r } = Wi(), i = br(), a = Ls(), s = ka(), l = BP();
    return p.useCallback((d) => {
      var _a6;
      d.stopPropagation(), d.preventDefault();
      const u = d.currentTarget, h = u.getAttribute("data-settings-link-section") || void 0;
      if (rP(h)) {
        const y = iP(u.getAttribute("data-settings-link-focus") || void 0);
        l(h, y);
        return;
      }
      const f = u.getAttribute("data-mention-id");
      if (typeof f != "string") return;
      if (co(f)) {
        a(t, s == null ? void 0 : s.roomId, f, u.getBoundingClientRect());
        return;
      }
      const g = u.getAttribute("data-mention-event-id") || void 0;
      if (Bc(f) && e.getRoom(f)) {
        ((_a6 = e.getRoom(f)) == null ? void 0 : _a6.isSpaceRoom()) ? r(f) : n(f, g);
        return;
      }
      const m = u.getAttribute("data-mention-via") || void 0, v = Xg(f, g);
      i(m ? gl(v, {
        viaServers: m
      }) : v);
    }, [
      e,
      i,
      n,
      r,
      a,
      l,
      t,
      s
    ]);
  }, dr = (t) => typeof t == "string", z_ = () => {
    let t, e;
    const n = new Promise((r, i) => {
      t = r, e = i;
    });
    return n.resolve = t, n.reject = e, n;
  }, Sq = (t) => t == null ? "" : "" + t, J5e = (t, e, n) => {
    t.forEach((r) => {
      e[r] && (n[r] = e[r]);
    });
  }, X5e = /###/g, jq = (t) => t && t.indexOf("###") > -1 ? t.replace(X5e, ".") : t, Tq = (t) => !t || dr(t), Qy = (t, e, n) => {
    const r = dr(e) ? e.split(".") : e;
    let i = 0;
    for (; i < r.length - 1; ) {
      if (Tq(t)) return {};
      const a = jq(r[i]);
      !t[a] && n && (t[a] = new n()), Object.prototype.hasOwnProperty.call(t, a) ? t = t[a] : t = {}, ++i;
    }
    return Tq(t) ? {} : {
      obj: t,
      k: jq(r[i])
    };
  }, Rq = (t, e, n) => {
    const { obj: r, k: i } = Qy(t, e, Object);
    if (r !== void 0 || e.length === 1) {
      r[i] = n;
      return;
    }
    let a = e[e.length - 1], s = e.slice(0, e.length - 1), l = Qy(t, s, Object);
    for (; l.obj === void 0 && s.length; ) a = `${s[s.length - 1]}.${a}`, s = s.slice(0, s.length - 1), l = Qy(t, s, Object), (l == null ? void 0 : l.obj) && typeof l.obj[`${l.k}.${a}`] < "u" && (l.obj = void 0);
    l.obj[`${l.k}.${a}`] = n;
  }, Q5e = (t, e, n, r) => {
    const { obj: i, k: a } = Qy(t, e, Object);
    i[a] = i[a] || [], i[a].push(n);
  }, J4 = (t, e) => {
    const { obj: n, k: r } = Qy(t, e);
    if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
  }, eTe = (t, e, n) => {
    const r = J4(t, n);
    return r !== void 0 ? r : J4(e, n);
  }, Aae = (t, e, n) => {
    for (const r in e) r !== "__proto__" && r !== "constructor" && (r in t ? dr(t[r]) || t[r] instanceof String || dr(e[r]) || e[r] instanceof String ? n && (t[r] = e[r]) : Aae(t[r], e[r], n) : t[r] = e[r]);
    return t;
  }, Bm = (t) => t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
  var tTe = {
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#39;",
    "/": "&#x2F;"
  };
  const nTe = (t) => dr(t) ? t.replace(/[&<>"'\/]/g, (e) => tTe[e]) : t;
  class rTe {
    constructor(e) {
      this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
    }
    getRegExp(e) {
      const n = this.regExpMap.get(e);
      if (n !== void 0) return n;
      const r = new RegExp(e);
      return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, r), this.regExpQueue.push(e), r;
    }
  }
  const iTe = [
    " ",
    ",",
    "?",
    "!",
    ";"
  ], oTe = new rTe(20), aTe = (t, e, n) => {
    e = e || "", n = n || "";
    const r = iTe.filter((s) => e.indexOf(s) < 0 && n.indexOf(s) < 0);
    if (r.length === 0) return true;
    const i = oTe.getRegExp(`(${r.map((s) => s === "?" ? "\\?" : s).join("|")})`);
    let a = !i.test(t);
    if (!a) {
      const s = t.indexOf(n);
      s > 0 && !i.test(t.substring(0, s)) && (a = true);
    }
    return a;
  }, nI = (t, e, n = ".") => {
    if (!t) return;
    if (t[e]) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
    const r = e.split(n);
    let i = t;
    for (let a = 0; a < r.length; ) {
      if (!i || typeof i != "object") return;
      let s, l = "";
      for (let c = a; c < r.length; ++c) if (c !== a && (l += n), l += r[c], s = i[l], s !== void 0) {
        if ([
          "string",
          "number",
          "boolean"
        ].indexOf(typeof s) > -1 && c < r.length - 1) continue;
        a += c - a + 1;
        break;
      }
      i = s;
    }
    return i;
  }, lb = (t) => t == null ? void 0 : t.replace(/_/g, "-"), sTe = {
    type: "logger",
    log(t) {
      this.output("log", t);
    },
    warn(t) {
      this.output("warn", t);
    },
    error(t) {
      this.output("error", t);
    },
    output(t, e) {
      var _a6, _b3;
      (_b3 = (_a6 = console == null ? void 0 : console[t]) == null ? void 0 : _a6.apply) == null ? void 0 : _b3.call(_a6, console, e);
    }
  };
  class X4 {
    constructor(e, n = {}) {
      this.init(e, n);
    }
    init(e, n = {}) {
      this.prefix = n.prefix || "i18next:", this.logger = e || sTe, this.options = n, this.debug = n.debug;
    }
    log(...e) {
      return this.forward(e, "log", "", true);
    }
    warn(...e) {
      return this.forward(e, "warn", "", true);
    }
    error(...e) {
      return this.forward(e, "error", "");
    }
    deprecate(...e) {
      return this.forward(e, "warn", "WARNING DEPRECATED: ", true);
    }
    forward(e, n, r, i) {
      return i && !this.debug ? null : (dr(e[0]) && (e[0] = `${r}${this.prefix} ${e[0]}`), this.logger[n](e));
    }
    create(e) {
      return new X4(this.logger, {
        prefix: `${this.prefix}:${e}:`,
        ...this.options
      });
    }
    clone(e) {
      return e = e || this.options, e.prefix = e.prefix || this.prefix, new X4(this.logger, e);
    }
  }
  var Bd = new X4();
  let Wk = class {
    constructor() {
      this.observers = {};
    }
    on(e, n) {
      return e.split(" ").forEach((r) => {
        this.observers[r] || (this.observers[r] = /* @__PURE__ */ new Map());
        const i = this.observers[r].get(n) || 0;
        this.observers[r].set(n, i + 1);
      }), this;
    }
    off(e, n) {
      if (this.observers[e]) {
        if (!n) {
          delete this.observers[e];
          return;
        }
        this.observers[e].delete(n);
      }
    }
    emit(e, ...n) {
      this.observers[e] && Array.from(this.observers[e].entries()).forEach(([i, a]) => {
        for (let s = 0; s < a; s++) i(...n);
      }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([i, a]) => {
        for (let s = 0; s < a; s++) i.apply(i, [
          e,
          ...n
        ]);
      });
    }
  };
  class Aq extends Wk {
    constructor(e, n = {
      ns: [
        "translation"
      ],
      defaultNS: "translation"
    }) {
      super(), this.data = e || {}, this.options = n, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
    }
    addNamespaces(e) {
      this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
    }
    removeNamespaces(e) {
      const n = this.options.ns.indexOf(e);
      n > -1 && this.options.ns.splice(n, 1);
    }
    getResource(e, n, r, i = {}) {
      var _a6, _b3;
      const a = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, s = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
      let l;
      e.indexOf(".") > -1 ? l = e.split(".") : (l = [
        e,
        n
      ], r && (Array.isArray(r) ? l.push(...r) : dr(r) && a ? l.push(...r.split(a)) : l.push(r)));
      const c = J4(this.data, l);
      return !c && !n && !r && e.indexOf(".") > -1 && (e = l[0], n = l[1], r = l.slice(2).join(".")), c || !s || !dr(r) ? c : nI((_b3 = (_a6 = this.data) == null ? void 0 : _a6[e]) == null ? void 0 : _b3[n], r, a);
    }
    addResource(e, n, r, i, a = {
      silent: false
    }) {
      const s = a.keySeparator !== void 0 ? a.keySeparator : this.options.keySeparator;
      let l = [
        e,
        n
      ];
      r && (l = l.concat(s ? r.split(s) : r)), e.indexOf(".") > -1 && (l = e.split("."), i = n, n = l[1]), this.addNamespaces(n), Rq(this.data, l, i), a.silent || this.emit("added", e, n, r, i);
    }
    addResources(e, n, r, i = {
      silent: false
    }) {
      for (const a in r) (dr(r[a]) || Array.isArray(r[a])) && this.addResource(e, n, a, r[a], {
        silent: true
      });
      i.silent || this.emit("added", e, n, r);
    }
    addResourceBundle(e, n, r, i, a, s = {
      silent: false,
      skipCopy: false
    }) {
      let l = [
        e,
        n
      ];
      e.indexOf(".") > -1 && (l = e.split("."), i = r, r = n, n = l[1]), this.addNamespaces(n);
      let c = J4(this.data, l) || {};
      s.skipCopy || (r = JSON.parse(JSON.stringify(r))), i ? Aae(c, r, a) : c = {
        ...c,
        ...r
      }, Rq(this.data, l, c), s.silent || this.emit("added", e, n, r);
    }
    removeResourceBundle(e, n) {
      this.hasResourceBundle(e, n) && delete this.data[e][n], this.removeNamespaces(n), this.emit("removed", e, n);
    }
    hasResourceBundle(e, n) {
      return this.getResource(e, n) !== void 0;
    }
    getResourceBundle(e, n) {
      return n || (n = this.options.defaultNS), this.getResource(e, n);
    }
    getDataByLanguage(e) {
      return this.data[e];
    }
    hasLanguageSomeTranslations(e) {
      const n = this.getDataByLanguage(e);
      return !!(n && Object.keys(n) || []).find((i) => n[i] && Object.keys(n[i]).length > 0);
    }
    toJSON() {
      return this.data;
    }
  }
  var Iae = {
    processors: {},
    addPostProcessor(t) {
      this.processors[t.name] = t;
    },
    handle(t, e, n, r, i) {
      return t.forEach((a) => {
        var _a6;
        e = ((_a6 = this.processors[a]) == null ? void 0 : _a6.process(e, n, r, i)) ?? e;
      }), e;
    }
  };
  const Bae = /* @__PURE__ */ Symbol("i18next/PATH_KEY");
  function lTe() {
    const t = [], e = /* @__PURE__ */ Object.create(null);
    let n;
    return e.get = (r, i) => {
      var _a6;
      return (_a6 = n == null ? void 0 : n.revoke) == null ? void 0 : _a6.call(n), i === Bae ? t : (t.push(i), n = Proxy.revocable(r, e), n.proxy);
    }, Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
  }
  function rI(t, e) {
    const { [Bae]: n } = t(lTe()), r = (e == null ? void 0 : e.keySeparator) ?? ".", i = (e == null ? void 0 : e.nsSeparator) ?? ":";
    if (n.length > 1 && i) {
      const a = e == null ? void 0 : e.ns;
      if ((a ? Array.isArray(a) ? a : [
        a
      ] : []).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
    }
    return n.join(r);
  }
  const Iq = {}, t5 = (t) => !dr(t) && typeof t != "boolean" && typeof t != "number";
  class Q4 extends Wk {
    constructor(e, n = {}) {
      super(), J5e([
        "resourceStore",
        "languageUtils",
        "pluralResolver",
        "interpolator",
        "backendConnector",
        "i18nFormat",
        "utils"
      ], e, this), this.options = n, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = Bd.create("translator");
    }
    changeLanguage(e) {
      e && (this.language = e);
    }
    exists(e, n = {
      interpolation: {}
    }) {
      const r = {
        ...n
      };
      if (e == null) return false;
      const i = this.resolve(e, r);
      if ((i == null ? void 0 : i.res) === void 0) return false;
      const a = t5(i.res);
      return !(r.returnObjects === false && a);
    }
    extractFromKey(e, n) {
      let r = n.nsSeparator !== void 0 ? n.nsSeparator : this.options.nsSeparator;
      r === void 0 && (r = ":");
      const i = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
      let a = n.ns || this.options.defaultNS || [];
      const s = r && e.indexOf(r) > -1, l = !this.options.userDefinedKeySeparator && !n.keySeparator && !this.options.userDefinedNsSeparator && !n.nsSeparator && !aTe(e, r, i);
      if (s && !l) {
        const c = e.match(this.interpolator.nestingRegexp);
        if (c && c.length > 0) return {
          key: e,
          namespaces: dr(a) ? [
            a
          ] : a
        };
        const d = e.split(r);
        (r !== i || r === i && this.options.ns.indexOf(d[0]) > -1) && (a = d.shift()), e = d.join(i);
      }
      return {
        key: e,
        namespaces: dr(a) ? [
          a
        ] : a
      };
    }
    translate(e, n, r) {
      let i = typeof n == "object" ? {
        ...n
      } : n;
      if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = {
        ...i
      }), i || (i = {}), e == null) return "";
      typeof e == "function" && (e = rI(e, {
        ...this.options,
        ...i
      })), Array.isArray(e) || (e = [
        String(e)
      ]);
      const a = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, { key: l, namespaces: c } = this.extractFromKey(e[e.length - 1], i), d = c[c.length - 1];
      let u = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
      u === void 0 && (u = ":");
      const h = i.lng || this.language, f = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
      if ((h == null ? void 0 : h.toLowerCase()) === "cimode") return f ? a ? {
        res: `${d}${u}${l}`,
        usedKey: l,
        exactUsedKey: l,
        usedLng: h,
        usedNS: d,
        usedParams: this.getUsedParamsDetails(i)
      } : `${d}${u}${l}` : a ? {
        res: l,
        usedKey: l,
        exactUsedKey: l,
        usedLng: h,
        usedNS: d,
        usedParams: this.getUsedParamsDetails(i)
      } : l;
      const g = this.resolve(e, i);
      let m = g == null ? void 0 : g.res;
      const v = (g == null ? void 0 : g.usedKey) || l, y = (g == null ? void 0 : g.exactUsedKey) || l, w = [
        "[object Number]",
        "[object Function]",
        "[object RegExp]"
      ], b = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, j = !this.i18nFormat || this.i18nFormat.handleAsObject, k = i.count !== void 0 && !dr(i.count), C = Q4.hasDefaultValue(i), x = k ? this.pluralResolver.getSuffix(h, i.count, i) : "", S = i.ordinal && k ? this.pluralResolver.getSuffix(h, i.count, {
        ordinal: false
      }) : "", T = k && !i.ordinal && i.count === 0, A = T && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${x}`] || i[`defaultValue${S}`] || i.defaultValue;
      let B = m;
      j && !m && C && (B = A);
      const U = t5(B), z = Object.prototype.toString.apply(B);
      if (j && B && U && w.indexOf(z) < 0 && !(dr(b) && Array.isArray(B))) {
        if (!i.returnObjects && !this.options.returnObjects) {
          this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
          const O = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(v, B, {
            ...i,
            ns: c
          }) : `key '${l} (${this.language})' returned an object instead of string.`;
          return a ? (g.res = O, g.usedParams = this.getUsedParamsDetails(i), g) : O;
        }
        if (s) {
          const O = Array.isArray(B), M = O ? [] : {}, I = O ? y : v;
          for (const N in B) if (Object.prototype.hasOwnProperty.call(B, N)) {
            const L = `${I}${s}${N}`;
            C && !m ? M[N] = this.translate(L, {
              ...i,
              defaultValue: t5(A) ? A[N] : void 0,
              joinArrays: false,
              ns: c
            }) : M[N] = this.translate(L, {
              ...i,
              joinArrays: false,
              ns: c
            }), M[N] === L && (M[N] = B[N]);
          }
          m = M;
        }
      } else if (j && dr(b) && Array.isArray(m)) m = m.join(b), m && (m = this.extendTranslation(m, e, i, r));
      else {
        let O = false, M = false;
        !this.isValidLookup(m) && C && (O = true, m = A), this.isValidLookup(m) || (M = true, m = l);
        const N = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && M ? void 0 : m, L = C && A !== m && this.options.updateMissing;
        if (M || O || L) {
          if (this.logger.log(L ? "updateKey" : "missingKey", h, d, l, L ? A : m), s) {
            const Y = this.resolve(l, {
              ...i,
              keySeparator: false
            });
            Y && Y.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
          }
          let H = [];
          const V = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
          if (this.options.saveMissingTo === "fallback" && V && V[0]) for (let Y = 0; Y < V.length; Y++) H.push(V[Y]);
          else this.options.saveMissingTo === "all" ? H = this.languageUtils.toResolveHierarchy(i.lng || this.language) : H.push(i.lng || this.language);
          const Z = (Y, oe, ue) => {
            var _a6;
            const ie = C && ue !== m ? ue : N;
            this.options.missingKeyHandler ? this.options.missingKeyHandler(Y, d, oe, ie, L, i) : ((_a6 = this.backendConnector) == null ? void 0 : _a6.saveMissing) && this.backendConnector.saveMissing(Y, d, oe, ie, L, i), this.emit("missingKey", Y, d, oe, m);
          };
          this.options.saveMissing && (this.options.saveMissingPlurals && k ? H.forEach((Y) => {
            const oe = this.pluralResolver.getSuffixes(Y, i);
            T && i[`defaultValue${this.options.pluralSeparator}zero`] && oe.indexOf(`${this.options.pluralSeparator}zero`) < 0 && oe.push(`${this.options.pluralSeparator}zero`), oe.forEach((ue) => {
              Z([
                Y
              ], l + ue, i[`defaultValue${ue}`] || A);
            });
          }) : Z(H, l, A));
        }
        m = this.extendTranslation(m, e, i, g, r), M && m === l && this.options.appendNamespaceToMissingKey && (m = `${d}${u}${l}`), (M || O) && this.options.parseMissingKeyHandler && (m = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}${u}${l}` : l, O ? m : void 0, i));
      }
      return a ? (g.res = m, g.usedParams = this.getUsedParamsDetails(i), g) : m;
    }
    extendTranslation(e, n, r, i, a) {
      var _a6, _b3;
      if ((_a6 = this.i18nFormat) == null ? void 0 : _a6.parse) e = this.i18nFormat.parse(e, {
        ...this.options.interpolation.defaultVariables,
        ...r
      }, r.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
        resolved: i
      });
      else if (!r.skipInterpolation) {
        r.interpolation && this.interpolator.init({
          ...r,
          interpolation: {
            ...this.options.interpolation,
            ...r.interpolation
          }
        });
        const c = dr(e) && (((_b3 = r == null ? void 0 : r.interpolation) == null ? void 0 : _b3.skipOnVariables) !== void 0 ? r.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
        let d;
        if (c) {
          const h = e.match(this.interpolator.nestingRegexp);
          d = h && h.length;
        }
        let u = r.replace && !dr(r.replace) ? r.replace : r;
        if (this.options.interpolation.defaultVariables && (u = {
          ...this.options.interpolation.defaultVariables,
          ...u
        }), e = this.interpolator.interpolate(e, u, r.lng || this.language || i.usedLng, r), c) {
          const h = e.match(this.interpolator.nestingRegexp), f = h && h.length;
          d < f && (r.nest = false);
        }
        !r.lng && i && i.res && (r.lng = this.language || i.usedLng), r.nest !== false && (e = this.interpolator.nest(e, (...h) => (a == null ? void 0 : a[0]) === h[0] && !r.context ? (this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`), null) : this.translate(...h, n), r)), r.interpolation && this.interpolator.reset();
      }
      const s = r.postProcess || this.options.postProcess, l = dr(s) ? [
        s
      ] : s;
      return e != null && (l == null ? void 0 : l.length) && r.applyPostProcessor !== false && (e = Iae.handle(l, e, n, this.options && this.options.postProcessPassResolved ? {
        i18nResolved: {
          ...i,
          usedParams: this.getUsedParamsDetails(r)
        },
        ...r
      } : r, this)), e;
    }
    resolve(e, n = {}) {
      let r, i, a, s, l;
      return dr(e) && (e = [
        e
      ]), e.forEach((c) => {
        if (this.isValidLookup(r)) return;
        const d = this.extractFromKey(c, n), u = d.key;
        i = u;
        let h = d.namespaces;
        this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
        const f = n.count !== void 0 && !dr(n.count), g = f && !n.ordinal && n.count === 0, m = n.context !== void 0 && (dr(n.context) || typeof n.context == "number") && n.context !== "", v = n.lngs ? n.lngs : this.languageUtils.toResolveHierarchy(n.lng || this.language, n.fallbackLng);
        h.forEach((y) => {
          var _a6, _b3;
          this.isValidLookup(r) || (l = y, !Iq[`${v[0]}-${y}`] && ((_a6 = this.utils) == null ? void 0 : _a6.hasLoadedNamespace) && !((_b3 = this.utils) == null ? void 0 : _b3.hasLoadedNamespace(l)) && (Iq[`${v[0]}-${y}`] = true, this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), v.forEach((w) => {
            var _a7;
            if (this.isValidLookup(r)) return;
            s = w;
            const b = [
              u
            ];
            if ((_a7 = this.i18nFormat) == null ? void 0 : _a7.addLookupKeys) this.i18nFormat.addLookupKeys(b, u, w, y, n);
            else {
              let k;
              f && (k = this.pluralResolver.getSuffix(w, n.count, n));
              const C = `${this.options.pluralSeparator}zero`, x = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
              if (f && (n.ordinal && k.indexOf(x) === 0 && b.push(u + k.replace(x, this.options.pluralSeparator)), b.push(u + k), g && b.push(u + C)), m) {
                const S = `${u}${this.options.contextSeparator || "_"}${n.context}`;
                b.push(S), f && (n.ordinal && k.indexOf(x) === 0 && b.push(S + k.replace(x, this.options.pluralSeparator)), b.push(S + k), g && b.push(S + C));
              }
            }
            let j;
            for (; j = b.pop(); ) this.isValidLookup(r) || (a = j, r = this.getResource(w, y, j, n));
          }));
        });
      }), {
        res: r,
        usedKey: i,
        exactUsedKey: a,
        usedLng: s,
        usedNS: l
      };
    }
    isValidLookup(e) {
      return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
    }
    getResource(e, n, r, i = {}) {
      var _a6;
      return ((_a6 = this.i18nFormat) == null ? void 0 : _a6.getResource) ? this.i18nFormat.getResource(e, n, r, i) : this.resourceStore.getResource(e, n, r, i);
    }
    getUsedParamsDetails(e = {}) {
      const n = [
        "defaultValue",
        "ordinal",
        "context",
        "replace",
        "lng",
        "lngs",
        "fallbackLng",
        "ns",
        "keySeparator",
        "nsSeparator",
        "returnObjects",
        "returnDetails",
        "joinArrays",
        "postProcess",
        "interpolation"
      ], r = e.replace && !dr(e.replace);
      let i = r ? e.replace : e;
      if (r && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
        ...this.options.interpolation.defaultVariables,
        ...i
      }), !r) {
        i = {
          ...i
        };
        for (const a of n) delete i[a];
      }
      return i;
    }
    static hasDefaultValue(e) {
      const n = "defaultValue";
      for (const r in e) if (Object.prototype.hasOwnProperty.call(e, r) && n === r.substring(0, n.length) && e[r] !== void 0) return true;
      return false;
    }
  }
  class Bq {
    constructor(e) {
      this.options = e, this.supportedLngs = this.options.supportedLngs || false, this.logger = Bd.create("languageUtils");
    }
    getScriptPartFromCode(e) {
      if (e = lb(e), !e || e.indexOf("-") < 0) return null;
      const n = e.split("-");
      return n.length === 2 || (n.pop(), n[n.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(n.join("-"));
    }
    getLanguagePartFromCode(e) {
      if (e = lb(e), !e || e.indexOf("-") < 0) return e;
      const n = e.split("-");
      return this.formatLanguageCode(n[0]);
    }
    formatLanguageCode(e) {
      if (dr(e) && e.indexOf("-") > -1) {
        let n;
        try {
          n = Intl.getCanonicalLocales(e)[0];
        } catch {
        }
        return n && this.options.lowerCaseLng && (n = n.toLowerCase()), n || (this.options.lowerCaseLng ? e.toLowerCase() : e);
      }
      return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
    }
    isSupportedCode(e) {
      return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
    }
    getBestMatchFromCodes(e) {
      if (!e) return null;
      let n;
      return e.forEach((r) => {
        if (n) return;
        const i = this.formatLanguageCode(r);
        (!this.options.supportedLngs || this.isSupportedCode(i)) && (n = i);
      }), !n && this.options.supportedLngs && e.forEach((r) => {
        if (n) return;
        const i = this.getScriptPartFromCode(r);
        if (this.isSupportedCode(i)) return n = i;
        const a = this.getLanguagePartFromCode(r);
        if (this.isSupportedCode(a)) return n = a;
        n = this.options.supportedLngs.find((s) => {
          if (s === a) return s;
          if (!(s.indexOf("-") < 0 && a.indexOf("-") < 0) && (s.indexOf("-") > 0 && a.indexOf("-") < 0 && s.substring(0, s.indexOf("-")) === a || s.indexOf(a) === 0 && a.length > 1)) return s;
        });
      }), n || (n = this.getFallbackCodes(this.options.fallbackLng)[0]), n;
    }
    getFallbackCodes(e, n) {
      if (!e) return [];
      if (typeof e == "function" && (e = e(n)), dr(e) && (e = [
        e
      ]), Array.isArray(e)) return e;
      if (!n) return e.default || [];
      let r = e[n];
      return r || (r = e[this.getScriptPartFromCode(n)]), r || (r = e[this.formatLanguageCode(n)]), r || (r = e[this.getLanguagePartFromCode(n)]), r || (r = e.default), r || [];
    }
    toResolveHierarchy(e, n) {
      const r = this.getFallbackCodes((n === false ? [] : n) || this.options.fallbackLng || [], e), i = [], a = (s) => {
        s && (this.isSupportedCode(s) ? i.push(s) : this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`));
      };
      return dr(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : dr(e) && a(this.formatLanguageCode(e)), r.forEach((s) => {
        i.indexOf(s) < 0 && a(this.formatLanguageCode(s));
      }), i;
    }
  }
  const Pq = {
    zero: 0,
    one: 1,
    two: 2,
    few: 3,
    many: 4,
    other: 5
  }, Mq = {
    select: (t) => t === 1 ? "one" : "other",
    resolvedOptions: () => ({
      pluralCategories: [
        "one",
        "other"
      ]
    })
  };
  class cTe {
    constructor(e, n = {}) {
      this.languageUtils = e, this.options = n, this.logger = Bd.create("pluralResolver"), this.pluralRulesCache = {};
    }
    clearCache() {
      this.pluralRulesCache = {};
    }
    getRule(e, n = {}) {
      const r = lb(e === "dev" ? "en" : e), i = n.ordinal ? "ordinal" : "cardinal", a = JSON.stringify({
        cleanedCode: r,
        type: i
      });
      if (a in this.pluralRulesCache) return this.pluralRulesCache[a];
      let s;
      try {
        s = new Intl.PluralRules(r, {
          type: i
        });
      } catch {
        if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), Mq;
        if (!e.match(/-|_/)) return Mq;
        const c = this.languageUtils.getLanguagePartFromCode(e);
        s = this.getRule(c, n);
      }
      return this.pluralRulesCache[a] = s, s;
    }
    needsPlural(e, n = {}) {
      let r = this.getRule(e, n);
      return r || (r = this.getRule("dev", n)), (r == null ? void 0 : r.resolvedOptions().pluralCategories.length) > 1;
    }
    getPluralFormsOfKey(e, n, r = {}) {
      return this.getSuffixes(e, r).map((i) => `${n}${i}`);
    }
    getSuffixes(e, n = {}) {
      let r = this.getRule(e, n);
      return r || (r = this.getRule("dev", n)), r ? r.resolvedOptions().pluralCategories.sort((i, a) => Pq[i] - Pq[a]).map((i) => `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
    }
    getSuffix(e, n, r = {}) {
      const i = this.getRule(e, r);
      return i ? `${this.options.prepend}${r.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(n)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", n, r));
    }
  }
  const Oq = (t, e, n, r = ".", i = true) => {
    let a = eTe(t, e, n);
    return !a && i && dr(n) && (a = nI(t, n, r), a === void 0 && (a = nI(e, n, r))), a;
  }, n5 = (t) => t.replace(/\$/g, "$$$$");
  class Lq {
    constructor(e = {}) {
      var _a6;
      this.logger = Bd.create("interpolator"), this.options = e, this.format = ((_a6 = e == null ? void 0 : e.interpolation) == null ? void 0 : _a6.format) || ((n) => n), this.init(e);
    }
    init(e = {}) {
      e.interpolation || (e.interpolation = {
        escapeValue: true
      });
      const { escape: n, escapeValue: r, useRawValueToEscape: i, prefix: a, prefixEscaped: s, suffix: l, suffixEscaped: c, formatSeparator: d, unescapeSuffix: u, unescapePrefix: h, nestingPrefix: f, nestingPrefixEscaped: g, nestingSuffix: m, nestingSuffixEscaped: v, nestingOptionsSeparator: y, maxReplaces: w, alwaysFormat: b } = e.interpolation;
      this.escape = n !== void 0 ? n : nTe, this.escapeValue = r !== void 0 ? r : true, this.useRawValueToEscape = i !== void 0 ? i : false, this.prefix = a ? Bm(a) : s || "{{", this.suffix = l ? Bm(l) : c || "}}", this.formatSeparator = d || ",", this.unescapePrefix = u ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = f ? Bm(f) : g || Bm("$t("), this.nestingSuffix = m ? Bm(m) : v || Bm(")"), this.nestingOptionsSeparator = y || ",", this.maxReplaces = w || 1e3, this.alwaysFormat = b !== void 0 ? b : false, this.resetRegExp();
    }
    reset() {
      this.options && this.init(this.options);
    }
    resetRegExp() {
      const e = (n, r) => (n == null ? void 0 : n.source) === r ? (n.lastIndex = 0, n) : new RegExp(r, "g");
      this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
    }
    interpolate(e, n, r, i) {
      var _a6;
      let a, s, l;
      const c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, d = (g) => {
        if (g.indexOf(this.formatSeparator) < 0) {
          const w = Oq(n, c, g, this.options.keySeparator, this.options.ignoreJSONStructure);
          return this.alwaysFormat ? this.format(w, void 0, r, {
            ...i,
            ...n,
            interpolationkey: g
          }) : w;
        }
        const m = g.split(this.formatSeparator), v = m.shift().trim(), y = m.join(this.formatSeparator).trim();
        return this.format(Oq(n, c, v, this.options.keySeparator, this.options.ignoreJSONStructure), y, r, {
          ...i,
          ...n,
          interpolationkey: v
        });
      };
      this.resetRegExp();
      const u = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, h = ((_a6 = i == null ? void 0 : i.interpolation) == null ? void 0 : _a6.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
      return [
        {
          regex: this.regexpUnescape,
          safeValue: (g) => n5(g)
        },
        {
          regex: this.regexp,
          safeValue: (g) => this.escapeValue ? n5(this.escape(g)) : n5(g)
        }
      ].forEach((g) => {
        for (l = 0; a = g.regex.exec(e); ) {
          const m = a[1].trim();
          if (s = d(m), s === void 0) if (typeof u == "function") {
            const y = u(e, a, i);
            s = dr(y) ? y : "";
          } else if (i && Object.prototype.hasOwnProperty.call(i, m)) s = "";
          else if (h) {
            s = a[0];
            continue;
          } else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`), s = "";
          else !dr(s) && !this.useRawValueToEscape && (s = Sq(s));
          const v = g.safeValue(s);
          if (e = e.replace(a[0], v), h ? (g.regex.lastIndex += s.length, g.regex.lastIndex -= a[0].length) : g.regex.lastIndex = 0, l++, l >= this.maxReplaces) break;
        }
      }), e;
    }
    nest(e, n, r = {}) {
      let i, a, s;
      const l = (c, d) => {
        const u = this.nestingOptionsSeparator;
        if (c.indexOf(u) < 0) return c;
        const h = c.split(new RegExp(`${Bm(u)}[ ]*{`));
        let f = `{${h[1]}`;
        c = h[0], f = this.interpolate(f, s);
        const g = f.match(/'/g), m = f.match(/"/g);
        (((g == null ? void 0 : g.length) ?? 0) % 2 === 0 && !m || ((m == null ? void 0 : m.length) ?? 0) % 2 !== 0) && (f = f.replace(/'/g, '"'));
        try {
          s = JSON.parse(f), d && (s = {
            ...d,
            ...s
          });
        } catch (v) {
          return this.logger.warn(`failed parsing options string in nesting for key ${c}`, v), `${c}${u}${f}`;
        }
        return s.defaultValue && s.defaultValue.indexOf(this.prefix) > -1 && delete s.defaultValue, c;
      };
      for (; i = this.nestingRegexp.exec(e); ) {
        let c = [];
        s = {
          ...r
        }, s = s.replace && !dr(s.replace) ? s.replace : s, s.applyPostProcessor = false, delete s.defaultValue;
        const d = /{.*}/.test(i[1]) ? i[1].lastIndexOf("}") + 1 : i[1].indexOf(this.formatSeparator);
        if (d !== -1 && (c = i[1].slice(d).split(this.formatSeparator).map((u) => u.trim()).filter(Boolean), i[1] = i[1].slice(0, d)), a = n(l.call(this, i[1].trim(), s), s), a && i[0] === e && !dr(a)) return a;
        dr(a) || (a = Sq(a)), a || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), a = ""), c.length && (a = c.reduce((u, h) => this.format(u, h, r.lng, {
          ...r,
          interpolationkey: i[1].trim()
        }), a.trim())), e = e.replace(i[0], a), this.regexp.lastIndex = 0;
      }
      return e;
    }
  }
  const dTe = (t) => {
    let e = t.toLowerCase().trim();
    const n = {};
    if (t.indexOf("(") > -1) {
      const r = t.split("(");
      e = r[0].toLowerCase().trim();
      const i = r[1].substring(0, r[1].length - 1);
      e === "currency" && i.indexOf(":") < 0 ? n.currency || (n.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? n.range || (n.range = i.trim()) : i.split(";").forEach((s) => {
        if (s) {
          const [l, ...c] = s.split(":"), d = c.join(":").trim().replace(/^'+|'+$/g, ""), u = l.trim();
          n[u] || (n[u] = d), d === "false" && (n[u] = false), d === "true" && (n[u] = true), isNaN(d) || (n[u] = parseInt(d, 10));
        }
      });
    }
    return {
      formatName: e,
      formatOptions: n
    };
  }, Nq = (t) => {
    const e = {};
    return (n, r, i) => {
      let a = i;
      i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
        ...a,
        [i.interpolationkey]: void 0
      });
      const s = r + JSON.stringify(a);
      let l = e[s];
      return l || (l = t(lb(r), i), e[s] = l), l(n);
    };
  }, uTe = (t) => (e, n, r) => t(lb(n), r)(e);
  class hTe {
    constructor(e = {}) {
      this.logger = Bd.create("formatter"), this.options = e, this.init(e);
    }
    init(e, n = {
      interpolation: {}
    }) {
      this.formatSeparator = n.interpolation.formatSeparator || ",";
      const r = n.cacheInBuiltFormats ? Nq : uTe;
      this.formats = {
        number: r((i, a) => {
          const s = new Intl.NumberFormat(i, {
            ...a
          });
          return (l) => s.format(l);
        }),
        currency: r((i, a) => {
          const s = new Intl.NumberFormat(i, {
            ...a,
            style: "currency"
          });
          return (l) => s.format(l);
        }),
        datetime: r((i, a) => {
          const s = new Intl.DateTimeFormat(i, {
            ...a
          });
          return (l) => s.format(l);
        }),
        relativetime: r((i, a) => {
          const s = new Intl.RelativeTimeFormat(i, {
            ...a
          });
          return (l) => s.format(l, a.range || "day");
        }),
        list: r((i, a) => {
          const s = new Intl.ListFormat(i, {
            ...a
          });
          return (l) => s.format(l);
        })
      };
    }
    add(e, n) {
      this.formats[e.toLowerCase().trim()] = n;
    }
    addCached(e, n) {
      this.formats[e.toLowerCase().trim()] = Nq(n);
    }
    format(e, n, r, i = {}) {
      const a = n.split(this.formatSeparator);
      if (a.length > 1 && a[0].indexOf("(") > 1 && a[0].indexOf(")") < 0 && a.find((l) => l.indexOf(")") > -1)) {
        const l = a.findIndex((c) => c.indexOf(")") > -1);
        a[0] = [
          a[0],
          ...a.splice(1, l)
        ].join(this.formatSeparator);
      }
      return a.reduce((l, c) => {
        var _a6;
        const { formatName: d, formatOptions: u } = dTe(c);
        if (this.formats[d]) {
          let h = l;
          try {
            const f = ((_a6 = i == null ? void 0 : i.formatParams) == null ? void 0 : _a6[i.interpolationkey]) || {}, g = f.locale || f.lng || i.locale || i.lng || r;
            h = this.formats[d](l, g, {
              ...u,
              ...i,
              ...f
            });
          } catch (f) {
            this.logger.warn(f);
          }
          return h;
        } else this.logger.warn(`there was no format function for ${d}`);
        return l;
      }, e);
    }
  }
  const fTe = (t, e) => {
    t.pending[e] !== void 0 && (delete t.pending[e], t.pendingCount--);
  };
  class mTe extends Wk {
    constructor(e, n, r, i = {}) {
      var _a6, _b3;
      super(), this.backend = e, this.store = n, this.services = r, this.languageUtils = r.languageUtils, this.options = i, this.logger = Bd.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (_b3 = (_a6 = this.backend) == null ? void 0 : _a6.init) == null ? void 0 : _b3.call(_a6, r, i.backend, i);
    }
    queueLoad(e, n, r, i) {
      const a = {}, s = {}, l = {}, c = {};
      return e.forEach((d) => {
        let u = true;
        n.forEach((h) => {
          const f = `${d}|${h}`;
          !r.reload && this.store.hasResourceBundle(d, h) ? this.state[f] = 2 : this.state[f] < 0 || (this.state[f] === 1 ? s[f] === void 0 && (s[f] = true) : (this.state[f] = 1, u = false, s[f] === void 0 && (s[f] = true), a[f] === void 0 && (a[f] = true), c[h] === void 0 && (c[h] = true)));
        }), u || (l[d] = true);
      }), (Object.keys(a).length || Object.keys(s).length) && this.queue.push({
        pending: s,
        pendingCount: Object.keys(s).length,
        loaded: {},
        errors: [],
        callback: i
      }), {
        toLoad: Object.keys(a),
        pending: Object.keys(s),
        toLoadLanguages: Object.keys(l),
        toLoadNamespaces: Object.keys(c)
      };
    }
    loaded(e, n, r) {
      const i = e.split("|"), a = i[0], s = i[1];
      n && this.emit("failedLoading", a, s, n), !n && r && this.store.addResourceBundle(a, s, r, void 0, void 0, {
        skipCopy: true
      }), this.state[e] = n ? -1 : 2, n && r && (this.state[e] = 0);
      const l = {};
      this.queue.forEach((c) => {
        Q5e(c.loaded, [
          a
        ], s), fTe(c, e), n && c.errors.push(n), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((d) => {
          l[d] || (l[d] = {});
          const u = c.loaded[d];
          u.length && u.forEach((h) => {
            l[d][h] === void 0 && (l[d][h] = true);
          });
        }), c.done = true, c.errors.length ? c.callback(c.errors) : c.callback());
      }), this.emit("loaded", l), this.queue = this.queue.filter((c) => !c.done);
    }
    read(e, n, r, i = 0, a = this.retryTimeout, s) {
      if (!e.length) return s(null, {});
      if (this.readingCalls >= this.maxParallelReads) {
        this.waitingReads.push({
          lng: e,
          ns: n,
          fcName: r,
          tried: i,
          wait: a,
          callback: s
        });
        return;
      }
      this.readingCalls++;
      const l = (d, u) => {
        if (this.readingCalls--, this.waitingReads.length > 0) {
          const h = this.waitingReads.shift();
          this.read(h.lng, h.ns, h.fcName, h.tried, h.wait, h.callback);
        }
        if (d && u && i < this.maxRetries) {
          setTimeout(() => {
            this.read.call(this, e, n, r, i + 1, a * 2, s);
          }, a);
          return;
        }
        s(d, u);
      }, c = this.backend[r].bind(this.backend);
      if (c.length === 2) {
        try {
          const d = c(e, n);
          d && typeof d.then == "function" ? d.then((u) => l(null, u)).catch(l) : l(null, d);
        } catch (d) {
          l(d);
        }
        return;
      }
      return c(e, n, l);
    }
    prepareLoading(e, n, r = {}, i) {
      if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
      dr(e) && (e = this.languageUtils.toResolveHierarchy(e)), dr(n) && (n = [
        n
      ]);
      const a = this.queueLoad(e, n, r, i);
      if (!a.toLoad.length) return a.pending.length || i(), null;
      a.toLoad.forEach((s) => {
        this.loadOne(s);
      });
    }
    load(e, n, r) {
      this.prepareLoading(e, n, {}, r);
    }
    reload(e, n, r) {
      this.prepareLoading(e, n, {
        reload: true
      }, r);
    }
    loadOne(e, n = "") {
      const r = e.split("|"), i = r[0], a = r[1];
      this.read(i, a, "read", void 0, void 0, (s, l) => {
        s && this.logger.warn(`${n}loading namespace ${a} for language ${i} failed`, s), !s && l && this.logger.log(`${n}loaded namespace ${a} for language ${i}`, l), this.loaded(e, s, l);
      });
    }
    saveMissing(e, n, r, i, a, s = {}, l = () => {
    }) {
      var _a6, _b3, _c3, _d4, _e13;
      if (((_b3 = (_a6 = this.services) == null ? void 0 : _a6.utils) == null ? void 0 : _b3.hasLoadedNamespace) && !((_d4 = (_c3 = this.services) == null ? void 0 : _c3.utils) == null ? void 0 : _d4.hasLoadedNamespace(n))) {
        this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
        return;
      }
      if (!(r == null || r === "")) {
        if ((_e13 = this.backend) == null ? void 0 : _e13.create) {
          const c = {
            ...s,
            isUpdate: a
          }, d = this.backend.create.bind(this.backend);
          if (d.length < 6) try {
            let u;
            d.length === 5 ? u = d(e, n, r, i, c) : u = d(e, n, r, i), u && typeof u.then == "function" ? u.then((h) => l(null, h)).catch(l) : l(null, u);
          } catch (u) {
            l(u);
          }
          else d(e, n, r, i, l, c);
        }
        !e || !e[0] || this.store.addResource(e[0], n, r, i);
      }
    }
  }
  const r5 = () => ({
    debug: false,
    initAsync: true,
    ns: [
      "translation"
    ],
    defaultNS: [
      "translation"
    ],
    fallbackLng: [
      "dev"
    ],
    fallbackNS: false,
    supportedLngs: false,
    nonExplicitSupportedLngs: false,
    load: "all",
    preload: false,
    simplifyPluralSuffix: true,
    keySeparator: ".",
    nsSeparator: ":",
    pluralSeparator: "_",
    contextSeparator: "_",
    partialBundledLanguages: false,
    saveMissing: false,
    updateMissing: false,
    saveMissingTo: "fallback",
    saveMissingPlurals: true,
    missingKeyHandler: false,
    missingInterpolationHandler: false,
    postProcess: false,
    postProcessPassResolved: false,
    returnNull: false,
    returnEmptyString: true,
    returnObjects: false,
    joinArrays: false,
    returnedObjectHandler: false,
    parseMissingKeyHandler: false,
    appendNamespaceToMissingKey: false,
    appendNamespaceToCIMode: false,
    overloadTranslationOptionHandler: (t) => {
      let e = {};
      if (typeof t[1] == "object" && (e = t[1]), dr(t[1]) && (e.defaultValue = t[1]), dr(t[2]) && (e.tDescription = t[2]), typeof t[2] == "object" || typeof t[3] == "object") {
        const n = t[3] || t[2];
        Object.keys(n).forEach((r) => {
          e[r] = n[r];
        });
      }
      return e;
    },
    interpolation: {
      escapeValue: true,
      format: (t) => t,
      prefix: "{{",
      suffix: "}}",
      formatSeparator: ",",
      unescapePrefix: "-",
      nestingPrefix: "$t(",
      nestingSuffix: ")",
      nestingOptionsSeparator: ",",
      maxReplaces: 1e3,
      skipOnVariables: true
    },
    cacheInBuiltFormats: true
  }), zq = (t) => {
    var _a6, _b3;
    return dr(t.ns) && (t.ns = [
      t.ns
    ]), dr(t.fallbackLng) && (t.fallbackLng = [
      t.fallbackLng
    ]), dr(t.fallbackNS) && (t.fallbackNS = [
      t.fallbackNS
    ]), ((_b3 = (_a6 = t.supportedLngs) == null ? void 0 : _a6.indexOf) == null ? void 0 : _b3.call(_a6, "cimode")) < 0 && (t.supportedLngs = t.supportedLngs.concat([
      "cimode"
    ])), typeof t.initImmediate == "boolean" && (t.initAsync = t.initImmediate), t;
  }, Dw = () => {
  }, gTe = (t) => {
    Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((n) => {
      typeof t[n] == "function" && (t[n] = t[n].bind(t));
    });
  }, Pae = "__i18next_supportNoticeShown", pTe = () => typeof globalThis < "u" && !!globalThis[Pae], FTe = () => {
    typeof globalThis < "u" && (globalThis[Pae] = true);
  }, vTe = (t) => {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3, _l3, _m2;
    return !!(((_c3 = (_b3 = (_a6 = t == null ? void 0 : t.modules) == null ? void 0 : _a6.backend) == null ? void 0 : _b3.name) == null ? void 0 : _c3.indexOf("Locize")) > 0 || ((_g4 = (_f4 = (_e13 = (_d4 = t == null ? void 0 : t.modules) == null ? void 0 : _d4.backend) == null ? void 0 : _e13.constructor) == null ? void 0 : _f4.name) == null ? void 0 : _g4.indexOf("Locize")) > 0 || ((_i7 = (_h4 = t == null ? void 0 : t.options) == null ? void 0 : _h4.backend) == null ? void 0 : _i7.backends) && t.options.backend.backends.some((e) => {
      var _a7, _b4, _c4;
      return ((_a7 = e == null ? void 0 : e.name) == null ? void 0 : _a7.indexOf("Locize")) > 0 || ((_c4 = (_b4 = e == null ? void 0 : e.constructor) == null ? void 0 : _b4.name) == null ? void 0 : _c4.indexOf("Locize")) > 0;
    }) || ((_k3 = (_j3 = t == null ? void 0 : t.options) == null ? void 0 : _j3.backend) == null ? void 0 : _k3.projectId) || ((_m2 = (_l3 = t == null ? void 0 : t.options) == null ? void 0 : _l3.backend) == null ? void 0 : _m2.backendOptions) && t.options.backend.backendOptions.some((e) => e == null ? void 0 : e.projectId));
  };
  class e2 extends Wk {
    constructor(e = {}, n) {
      if (super(), this.options = zq(e), this.services = {}, this.logger = Bd, this.modules = {
        external: []
      }, gTe(this), n && !this.isInitialized && !e.isClone) {
        if (!this.options.initAsync) return this.init(e, n), this;
        setTimeout(() => {
          this.init(e, n);
        }, 0);
      }
    }
    init(e = {}, n) {
      this.isInitializing = true, typeof e == "function" && (n = e, e = {}), e.defaultNS == null && e.ns && (dr(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
      const r = r5();
      this.options = {
        ...r,
        ...this.options,
        ...zq(e)
      }, this.options.interpolation = {
        ...r.interpolation,
        ...this.options.interpolation
      }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = r.overloadTranslationOptionHandler), this.options.showSupportNotice !== false && !vTe(this) && !pTe() && (typeof console < "u" && typeof console.info < "u" && console.info("\u{1F310} i18next is made possible by our own product, Locize \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}"), FTe());
      const i = (d) => d ? typeof d == "function" ? new d() : d : null;
      if (!this.options.isClone) {
        this.modules.logger ? Bd.init(i(this.modules.logger), this.options) : Bd.init(null, this.options);
        let d;
        this.modules.formatter ? d = this.modules.formatter : d = hTe;
        const u = new Bq(this.options);
        this.store = new Aq(this.options.resources, this.options);
        const h = this.services;
        h.logger = Bd, h.resourceStore = this.store, h.languageUtils = u, h.pluralResolver = new cTe(u, {
          prepend: this.options.pluralSeparator,
          simplifyPluralSuffix: this.options.simplifyPluralSuffix
        }), this.options.interpolation.format && this.options.interpolation.format !== r.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), d && (!this.options.interpolation.format || this.options.interpolation.format === r.interpolation.format) && (h.formatter = i(d), h.formatter.init && h.formatter.init(h, this.options), this.options.interpolation.format = h.formatter.format.bind(h.formatter)), h.interpolator = new Lq(this.options), h.utils = {
          hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
        }, h.backendConnector = new mTe(i(this.modules.backend), h.resourceStore, h, this.options), h.backendConnector.on("*", (g, ...m) => {
          this.emit(g, ...m);
        }), this.modules.languageDetector && (h.languageDetector = i(this.modules.languageDetector), h.languageDetector.init && h.languageDetector.init(h, this.options.detection, this.options)), this.modules.i18nFormat && (h.i18nFormat = i(this.modules.i18nFormat), h.i18nFormat.init && h.i18nFormat.init(this)), this.translator = new Q4(this.services, this.options), this.translator.on("*", (g, ...m) => {
          this.emit(g, ...m);
        }), this.modules.external.forEach((g) => {
          g.init && g.init(this);
        });
      }
      if (this.format = this.options.interpolation.format, n || (n = Dw), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
        const d = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
        d.length > 0 && d[0] !== "dev" && (this.options.lng = d[0]);
      }
      !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
        "getResource",
        "hasResourceBundle",
        "getResourceBundle",
        "getDataByLanguage"
      ].forEach((d) => {
        this[d] = (...u) => this.store[d](...u);
      }), [
        "addResource",
        "addResources",
        "addResourceBundle",
        "removeResourceBundle"
      ].forEach((d) => {
        this[d] = (...u) => (this.store[d](...u), this);
      });
      const l = z_(), c = () => {
        const d = (u, h) => {
          this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = true, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), l.resolve(h), n(u, h);
        };
        if (this.languages && !this.isInitialized) return d(null, this.t.bind(this));
        this.changeLanguage(this.options.lng, d);
      };
      return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), l;
    }
    loadResources(e, n = Dw) {
      var _a6, _b3;
      let r = n;
      const i = dr(e) ? e : this.language;
      if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
        if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
        const a = [], s = (l) => {
          if (!l || l === "cimode") return;
          this.services.languageUtils.toResolveHierarchy(l).forEach((d) => {
            d !== "cimode" && a.indexOf(d) < 0 && a.push(d);
          });
        };
        i ? s(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((c) => s(c)), (_b3 = (_a6 = this.options.preload) == null ? void 0 : _a6.forEach) == null ? void 0 : _b3.call(_a6, (l) => s(l)), this.services.backendConnector.load(a, this.options.ns, (l) => {
          !l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), r(l);
        });
      } else r(null);
    }
    reloadResources(e, n, r) {
      const i = z_();
      return typeof e == "function" && (r = e, e = void 0), typeof n == "function" && (r = n, n = void 0), e || (e = this.languages), n || (n = this.options.ns), r || (r = Dw), this.services.backendConnector.reload(e, n, (a) => {
        i.resolve(), r(a);
      }), i;
    }
    use(e) {
      if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
      if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
      return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && Iae.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
    }
    setResolvedLanguage(e) {
      if (!(!e || !this.languages) && !([
        "cimode",
        "dev"
      ].indexOf(e) > -1)) {
        for (let n = 0; n < this.languages.length; n++) {
          const r = this.languages[n];
          if (!([
            "cimode",
            "dev"
          ].indexOf(r) > -1) && this.store.hasLanguageSomeTranslations(r)) {
            this.resolvedLanguage = r;
            break;
          }
        }
        !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
      }
    }
    changeLanguage(e, n) {
      this.isLanguageChangingTo = e;
      const r = z_();
      this.emit("languageChanging", e);
      const i = (l) => {
        this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
      }, a = (l, c) => {
        c ? this.isLanguageChangingTo === e && (i(c), this.translator.changeLanguage(c), this.isLanguageChangingTo = void 0, this.emit("languageChanged", c), this.logger.log("languageChanged", c)) : this.isLanguageChangingTo = void 0, r.resolve((...d) => this.t(...d)), n && n(l, (...d) => this.t(...d));
      }, s = (l) => {
        var _a6, _b3;
        !e && !l && this.services.languageDetector && (l = []);
        const c = dr(l) ? l : l && l[0], d = this.store.hasLanguageSomeTranslations(c) ? c : this.services.languageUtils.getBestMatchFromCodes(dr(l) ? [
          l
        ] : l);
        d && (this.language || i(d), this.translator.language || this.translator.changeLanguage(d), (_b3 = (_a6 = this.services.languageDetector) == null ? void 0 : _a6.cacheUserLanguage) == null ? void 0 : _b3.call(_a6, d)), this.loadResources(d, (u) => {
          a(u, d);
        });
      };
      return !e && this.services.languageDetector && !this.services.languageDetector.async ? s(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(s) : this.services.languageDetector.detect(s) : s(e), r;
    }
    getFixedT(e, n, r) {
      const i = (a, s, ...l) => {
        let c;
        typeof s != "object" ? c = this.options.overloadTranslationOptionHandler([
          a,
          s
        ].concat(l)) : c = {
          ...s
        }, c.lng = c.lng || i.lng, c.lngs = c.lngs || i.lngs, c.ns = c.ns || i.ns, c.keyPrefix !== "" && (c.keyPrefix = c.keyPrefix || r || i.keyPrefix);
        const d = this.options.keySeparator || ".";
        let u;
        return c.keyPrefix && Array.isArray(a) ? u = a.map((h) => (typeof h == "function" && (h = rI(h, {
          ...this.options,
          ...s
        })), `${c.keyPrefix}${d}${h}`)) : (typeof a == "function" && (a = rI(a, {
          ...this.options,
          ...s
        })), u = c.keyPrefix ? `${c.keyPrefix}${d}${a}` : a), this.t(u, c);
      };
      return dr(e) ? i.lng = e : i.lngs = e, i.ns = n, i.keyPrefix = r, i;
    }
    t(...e) {
      var _a6;
      return (_a6 = this.translator) == null ? void 0 : _a6.translate(...e);
    }
    exists(...e) {
      var _a6;
      return (_a6 = this.translator) == null ? void 0 : _a6.exists(...e);
    }
    setDefaultNamespace(e) {
      this.options.defaultNS = e;
    }
    hasLoadedNamespace(e, n = {}) {
      if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), false;
      if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), false;
      const r = n.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : false, a = this.languages[this.languages.length - 1];
      if (r.toLowerCase() === "cimode") return true;
      const s = (l, c) => {
        const d = this.services.backendConnector.state[`${l}|${c}`];
        return d === -1 || d === 0 || d === 2;
      };
      if (n.precheck) {
        const l = n.precheck(this, s);
        if (l !== void 0) return l;
      }
      return !!(this.hasResourceBundle(r, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || s(r, e) && (!i || s(a, e)));
    }
    loadNamespaces(e, n) {
      const r = z_();
      return this.options.ns ? (dr(e) && (e = [
        e
      ]), e.forEach((i) => {
        this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
      }), this.loadResources((i) => {
        r.resolve(), n && n(i);
      }), r) : (n && n(), Promise.resolve());
    }
    loadLanguages(e, n) {
      const r = z_();
      dr(e) && (e = [
        e
      ]);
      const i = this.options.preload || [], a = e.filter((s) => i.indexOf(s) < 0 && this.services.languageUtils.isSupportedCode(s));
      return a.length ? (this.options.preload = i.concat(a), this.loadResources((s) => {
        r.resolve(), n && n(s);
      }), r) : (n && n(), Promise.resolve());
    }
    dir(e) {
      var _a6, _b3;
      if (e || (e = this.resolvedLanguage || (((_a6 = this.languages) == null ? void 0 : _a6.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
      try {
        const i = new Intl.Locale(e);
        if (i && i.getTextInfo) {
          const a = i.getTextInfo();
          if (a && a.direction) return a.direction;
        }
      } catch {
      }
      const n = [
        "ar",
        "shu",
        "sqr",
        "ssh",
        "xaa",
        "yhd",
        "yud",
        "aao",
        "abh",
        "abv",
        "acm",
        "acq",
        "acw",
        "acx",
        "acy",
        "adf",
        "ads",
        "aeb",
        "aec",
        "afb",
        "ajp",
        "apc",
        "apd",
        "arb",
        "arq",
        "ars",
        "ary",
        "arz",
        "auz",
        "avl",
        "ayh",
        "ayl",
        "ayn",
        "ayp",
        "bbz",
        "pga",
        "he",
        "iw",
        "ps",
        "pbt",
        "pbu",
        "pst",
        "prp",
        "prd",
        "ug",
        "ur",
        "ydd",
        "yds",
        "yih",
        "ji",
        "yi",
        "hbo",
        "men",
        "xmn",
        "fa",
        "jpr",
        "peo",
        "pes",
        "prs",
        "dv",
        "sam",
        "ckb"
      ], r = ((_b3 = this.services) == null ? void 0 : _b3.languageUtils) || new Bq(r5());
      return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : n.indexOf(r.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
    }
    static createInstance(e = {}, n) {
      const r = new e2(e, n);
      return r.createInstance = e2.createInstance, r;
    }
    cloneInstance(e = {}, n = Dw) {
      const r = e.forkResourceStore;
      r && delete e.forkResourceStore;
      const i = {
        ...this.options,
        ...e,
        isClone: true
      }, a = new e2(i);
      if ((e.debug !== void 0 || e.prefix !== void 0) && (a.logger = a.logger.clone(e)), [
        "store",
        "services",
        "language"
      ].forEach((l) => {
        a[l] = this[l];
      }), a.services = {
        ...this.services
      }, a.services.utils = {
        hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
      }, r) {
        const l = Object.keys(this.store.data).reduce((c, d) => (c[d] = {
          ...this.store.data[d]
        }, c[d] = Object.keys(c[d]).reduce((u, h) => (u[h] = {
          ...c[d][h]
        }, u), c[d]), c), {});
        a.store = new Aq(l, i), a.services.resourceStore = a.store;
      }
      if (e.interpolation) {
        const c = {
          ...r5().interpolation,
          ...this.options.interpolation,
          ...e.interpolation
        }, d = {
          ...i,
          interpolation: c
        };
        a.services.interpolator = new Lq(d);
      }
      return a.translator = new Q4(a.services, i), a.translator.on("*", (l, ...c) => {
        a.emit(l, ...c);
      }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = {
        hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
      }, a;
    }
    toJSON() {
      return {
        options: this.options,
        store: this.store,
        language: this.language,
        languages: this.languages,
        resolvedLanguage: this.resolvedLanguage
      };
    }
  }
  const ms = e2.createInstance();
  ms.createInstance;
  ms.dir;
  ms.init;
  ms.loadResources;
  ms.reloadResources;
  ms.use;
  ms.changeLanguage;
  ms.getFixedT;
  ms.t;
  ms.exists;
  ms.setDefaultNamespace;
  ms.hasLoadedNamespace;
  ms.loadNamespaces;
  ms.loadLanguages;
  const _Te = (t, e, n, r) => {
    var _a6, _b3, _c3, _d4;
    const i = [
      n,
      {
        code: e,
        ...r || {}
      }
    ];
    if ((_b3 = (_a6 = t == null ? void 0 : t.services) == null ? void 0 : _a6.logger) == null ? void 0 : _b3.forward) return t.services.logger.forward(i, "warn", "react-i18next::", true);
    op(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), ((_d4 = (_c3 = t == null ? void 0 : t.services) == null ? void 0 : _c3.logger) == null ? void 0 : _d4.warn) ? t.services.logger.warn(...i) : (console == null ? void 0 : console.warn) && console.warn(...i);
  }, Uq = {}, Mae = (t, e, n, r) => {
    op(n) && Uq[n] || (op(n) && (Uq[n] = /* @__PURE__ */ new Date()), _Te(t, e, n, r));
  }, Oae = (t, e) => () => {
    if (t.isInitialized) e();
    else {
      const n = () => {
        setTimeout(() => {
          t.off("initialized", n);
        }, 0), e();
      };
      t.on("initialized", n);
    }
  }, iI = (t, e, n) => {
    t.loadNamespaces(e, Oae(t, n));
  }, Vq = (t, e, n, r) => {
    if (op(n) && (n = [
      n
    ]), t.options.preload && t.options.preload.indexOf(e) > -1) return iI(t, n, r);
    n.forEach((i) => {
      t.options.ns.indexOf(i) < 0 && t.options.ns.push(i);
    }), t.loadLanguages(e, Oae(t, r));
  }, yTe = (t, e, n = {}) => !e.languages || !e.languages.length ? (Mae(e, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
    languages: e.languages
  }), true) : e.hasLoadedNamespace(t, {
    lng: n.lng,
    precheck: (r, i) => {
      if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && r.services.backendConnector.backend && r.isLanguageChangingTo && !i(r.isLanguageChangingTo, t)) return false;
    }
  }), op = (t) => typeof t == "string", bTe = (t) => typeof t == "object" && t !== null, xTe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, wTe = {
    "&amp;": "&",
    "&#38;": "&",
    "&lt;": "<",
    "&#60;": "<",
    "&gt;": ">",
    "&#62;": ">",
    "&apos;": "'",
    "&#39;": "'",
    "&quot;": '"',
    "&#34;": '"',
    "&nbsp;": " ",
    "&#160;": " ",
    "&copy;": "\xA9",
    "&#169;": "\xA9",
    "&reg;": "\xAE",
    "&#174;": "\xAE",
    "&hellip;": "\u2026",
    "&#8230;": "\u2026",
    "&#x2F;": "/",
    "&#47;": "/"
  }, DTe = (t) => wTe[t], CTe = (t) => t.replace(xTe, DTe);
  let oI = {
    bindI18n: "languageChanged",
    bindI18nStore: "",
    transEmptyNodeValue: "",
    transSupportBasicHtmlNodes: true,
    transWrapTextNodes: "",
    transKeepBasicHtmlNodesFor: [
      "br",
      "strong",
      "i",
      "p"
    ],
    useSuspense: true,
    unescape: CTe,
    transDefaultProps: void 0
  };
  const ETe = (t = {}) => {
    oI = {
      ...oI,
      ...t
    };
  }, kTe = () => oI;
  let Lae;
  const STe = (t) => {
    Lae = t;
  }, jTe = () => Lae, TTe = {
    type: "3rdParty",
    init(t) {
      ETe(t.options.react), STe(t);
    }
  }, RTe = p.createContext();
  class ATe {
    constructor() {
      this.usedNamespaces = {};
    }
    addUsedNamespaces(e) {
      e.forEach((n) => {
        this.usedNamespaces[n] || (this.usedNamespaces[n] = true);
      });
    }
    getUsedNamespaces() {
      return Object.keys(this.usedNamespaces);
    }
  }
  var i5 = {
    exports: {}
  }, o5 = {};
  var Hq;
  function ITe() {
    if (Hq) return o5;
    Hq = 1;
    var t = dh();
    function e(h, f) {
      return h === f && (h !== 0 || 1 / h === 1 / f) || h !== h && f !== f;
    }
    var n = typeof Object.is == "function" ? Object.is : e, r = t.useState, i = t.useEffect, a = t.useLayoutEffect, s = t.useDebugValue;
    function l(h, f) {
      var g = f(), m = r({
        inst: {
          value: g,
          getSnapshot: f
        }
      }), v = m[0].inst, y = m[1];
      return a(function() {
        v.value = g, v.getSnapshot = f, c(v) && y({
          inst: v
        });
      }, [
        h,
        g,
        f
      ]), i(function() {
        return c(v) && y({
          inst: v
        }), h(function() {
          c(v) && y({
            inst: v
          });
        });
      }, [
        h
      ]), s(g), g;
    }
    function c(h) {
      var f = h.getSnapshot;
      h = h.value;
      try {
        var g = f();
        return !n(h, g);
      } catch {
        return true;
      }
    }
    function d(h, f) {
      return f();
    }
    var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : l;
    return o5.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : u, o5;
  }
  var $q;
  function BTe() {
    return $q || ($q = 1, i5.exports = ITe()), i5.exports;
  }
  var PTe = BTe();
  const MTe = (t, e) => op(e) ? e : bTe(e) && op(e.defaultValue) ? e.defaultValue : Array.isArray(t) ? t[t.length - 1] : t, OTe = {
    t: MTe,
    ready: false
  }, LTe = () => () => {
  }, Nae = (t, e = {}) => {
    var _a6, _b3, _c3;
    const { i18n: n } = e, { i18n: r, defaultNS: i } = p.useContext(RTe) || {}, a = n || r || jTe();
    a && !a.reportNamespaces && (a.reportNamespaces = new ATe()), a || Mae(a, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
    const s = p.useMemo(() => {
      var _a7;
      return {
        ...kTe(),
        ...(_a7 = a == null ? void 0 : a.options) == null ? void 0 : _a7.react,
        ...e
      };
    }, [
      a,
      e
    ]), { useSuspense: l, keyPrefix: c } = s, d = i || ((_a6 = a == null ? void 0 : a.options) == null ? void 0 : _a6.defaultNS), u = op(d) ? [
      d
    ] : d || [
      "translation"
    ], h = p.useMemo(() => u, u);
    (_c3 = (_b3 = a == null ? void 0 : a.reportNamespaces) == null ? void 0 : _b3.addUsedNamespaces) == null ? void 0 : _c3.call(_b3, h);
    const f = p.useRef(0), g = p.useCallback((A) => {
      if (!a) return LTe;
      const { bindI18n: B, bindI18nStore: U } = s, z = () => {
        f.current += 1, A();
      };
      return B && a.on(B, z), U && a.store.on(U, z), () => {
        B && B.split(" ").forEach((O) => a.off(O, z)), U && U.split(" ").forEach((O) => a.store.off(O, z));
      };
    }, [
      a,
      s
    ]), m = p.useRef(), v = p.useCallback(() => {
      if (!a) return OTe;
      const A = !!(a.isInitialized || a.initializedStoreOnce) && h.every((I) => yTe(I, a, s)), B = e.lng || a.language, U = f.current, z = m.current;
      if (z && z.ready === A && z.lng === B && z.keyPrefix === c && z.revision === U) return z;
      const M = {
        t: a.getFixedT(B, s.nsMode === "fallback" ? h : h[0], c),
        ready: A,
        lng: B,
        keyPrefix: c,
        revision: U
      };
      return m.current = M, M;
    }, [
      a,
      h,
      c,
      s,
      e.lng
    ]), [y, w] = p.useState(0), { t: b, ready: j } = PTe.useSyncExternalStore(g, v, v);
    p.useEffect(() => {
      if (a && !j && !l) {
        const A = () => w((B) => B + 1);
        e.lng ? Vq(a, e.lng, h, A) : iI(a, h, A);
      }
    }, [
      a,
      e.lng,
      h,
      j,
      l,
      y
    ]);
    const k = a || {}, C = p.useRef(null), x = p.useRef(), S = (A) => {
      const B = Object.getOwnPropertyDescriptors(A);
      B.__original && delete B.__original;
      const U = Object.create(Object.getPrototypeOf(A), B);
      if (!Object.prototype.hasOwnProperty.call(U, "__original")) try {
        Object.defineProperty(U, "__original", {
          value: A,
          writable: false,
          enumerable: false,
          configurable: false
        });
      } catch {
      }
      return U;
    }, T = p.useMemo(() => {
      const A = k, B = A == null ? void 0 : A.language;
      let U = A;
      A && (C.current && C.current.__original === A ? x.current !== B ? (U = S(A), C.current = U, x.current = B) : U = C.current : (U = S(A), C.current = U, x.current = B));
      const z = [
        b,
        U,
        j
      ];
      return z.t = b, z.i18n = U, z.ready = j, z;
    }, [
      b,
      k,
      j,
      k.resolvedLanguage,
      k.language,
      k.languages
    ]);
    if (a && l && !j) throw new Promise((A) => {
      const B = () => A();
      e.lng ? Vq(a, e.lng, h, B) : iI(a, h, B);
    });
    return T;
  }, gs = () => {
    const t = la();
    return p.useMemo(() => PA(t.hashRouter), [
      t.hashRouter
    ]);
  }, NTe = [
    "image/jpeg",
    "image/gif",
    "image/png",
    "image/apng",
    "image/webp",
    "image/avif",
    "image/svg+xml"
  ], zTe = [
    "video/mp4",
    "video/webm",
    "video/ogg",
    "video/quicktime"
  ], UTe = [
    "audio/mp4",
    "audio/x-m4a",
    "audio/webm",
    "audio/aac",
    "audio/mpeg",
    "audio/ogg",
    "audio/wave",
    "audio/wav",
    "audio/x-wav",
    "audio/x-pn-wav",
    "audio/flac",
    "audio/x-flac"
  ], VTe = [
    "application/pdf",
    "application/json",
    "application/x-sh",
    "application/ecmascript",
    "application/javascript",
    "application/xhtml+xml",
    "application/xml"
  ], zae = [
    "text/plain",
    "text/html",
    "text/css",
    "text/javascript",
    "text/x-c",
    "text/csv",
    "text/tab-separated-values",
    "text/yaml",
    "text/x-java-source,java",
    "text/markdown"
  ], Uae = [
    "application/json",
    "application/x-sh",
    "application/ecmascript",
    "application/javascript",
    "application/xhtml+xml",
    "application/xml",
    ...zae
  ], Vae = {
    go: "text/go",
    rs: "text/rust",
    py: "text/python",
    swift: "text/swift",
    c: "text/c",
    cpp: "text/cpp",
    java: "text/java",
    kt: "text/kotlin",
    lua: "text/lua",
    php: "text/php",
    ts: "text/typescript",
    js: "text/javascript",
    jsx: "text/jsx",
    tsx: "text/tsx",
    html: "text/html",
    xhtml: "text/xhtml",
    xht: "text/xhtml",
    css: "text/css",
    scss: "text/scss",
    sass: "text/sass",
    json: "text/json",
    md: "text/markdown",
    yaml: "text/yaml",
    yni: "text/yni",
    xml: "text/xml",
    txt: "text/plain",
    text: "text/plain",
    conf: "text/conf",
    cfg: "text/conf",
    cnf: "text/conf",
    log: "text/log",
    me: "text/me",
    cvs: "text/cvs",
    tvs: "text/tvs",
    sql: "text/sql"
  }, HTe = [
    ...NTe,
    ...zTe,
    ...UTe,
    ...VTe,
    ...zae
  ], sF = "application/octet-stream", MP = (t) => {
    if (typeof t != "string") return sF;
    const [e] = t.split(";");
    return !e || !HTe.includes(e) ? sF : e === "video/quicktime" ? "video/mp4" : e;
  }, $Te = (t) => {
    const e = MP(t.type);
    return e !== t.type ? new File([
      t
    ], t.name, {
      type: e
    }) : t;
  }, aI = (t) => {
    const e = t.lastIndexOf("/") + 1;
    return t.slice(e);
  }, Hae = (t) => {
    const e = t.lastIndexOf(".") + 1;
    return t.slice(e);
  }, WTe = (t) => {
    const e = t.lastIndexOf(".");
    return e === 0 || e === -1 ? t : t.slice(0, e);
  };
  function qTe({ info: t, renderImage: e }) {
    const n = be(), r = hn(), [i, a] = Et(p.useCallback(async () => {
      var _a6;
      const s = t.thumbnail_info, l = ((_a6 = t.thumbnail_file) == null ? void 0 : _a6.url) ?? t.thumbnail_url, c = t.thumbnail_file;
      if (typeof l != "string" || typeof (s == null ? void 0 : s.mimetype) != "string") throw new Error("Failed to load thumbnail");
      const d = Cn(n, l, r);
      if (!d) throw new Error("Invalid media URL");
      if (c) {
        const u = await Qf(d, (h) => Xf(h, s.mimetype ?? sF, c));
        return URL.createObjectURL(u);
      }
      return d;
    }, [
      n,
      t,
      r
    ]));
    return p.useEffect(() => {
      a();
    }, [
      a
    ]), i.status === ve.Success ? e(i.data) : null;
  }
  var $ae = [
    "0",
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "A",
    "B",
    "C",
    "D",
    "E",
    "F",
    "G",
    "H",
    "I",
    "J",
    "K",
    "L",
    "M",
    "N",
    "O",
    "P",
    "Q",
    "R",
    "S",
    "T",
    "U",
    "V",
    "W",
    "X",
    "Y",
    "Z",
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
    "#",
    "$",
    "%",
    "*",
    "+",
    ",",
    "-",
    ".",
    ":",
    ";",
    "=",
    "?",
    "@",
    "[",
    "]",
    "^",
    "_",
    "{",
    "|",
    "}",
    "~"
  ], vy = (t) => {
    let e = 0;
    for (let n = 0; n < t.length; n++) {
      let r = t[n], i = $ae.indexOf(r);
      e = e * 83 + i;
    }
    return e;
  }, U_ = (t, e) => {
    var n = "";
    for (let r = 1; r <= e; r++) {
      let i = Math.floor(t) / Math.pow(83, e - r) % 83;
      n += $ae[Math.floor(i)];
    }
    return n;
  }, v1 = (t) => {
    let e = t / 255;
    return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
  }, _1 = (t) => {
    let e = Math.max(0, Math.min(1, t));
    return e <= 31308e-7 ? Math.trunc(e * 12.92 * 255 + 0.5) : Math.trunc((1.055 * Math.pow(e, 0.4166666666666667) - 0.055) * 255 + 0.5);
  }, KTe = (t) => t < 0 ? -1 : 1, y1 = (t, e) => KTe(t) * Math.pow(Math.abs(t), e), eE = class extends Error {
    constructor(e) {
      super(e), this.name = "ValidationError", this.message = e;
    }
  }, Wae = (t) => {
    if (!t || t.length < 6) throw new eE("The blurhash string must be at least 6 characters");
    let e = vy(t[0]), n = Math.floor(e / 9) + 1, r = e % 9 + 1;
    if (t.length !== 4 + 2 * r * n) throw new eE(`blurhash length mismatch: length is ${t.length} but it should be ${4 + 2 * r * n}`);
  }, GTe = (t) => {
    try {
      Wae(t);
    } catch (e) {
      return {
        result: false,
        errorReason: e.message
      };
    }
    return {
      result: true
    };
  }, YTe = (t) => {
    let e = t >> 16, n = t >> 8 & 255, r = t & 255;
    return [
      v1(e),
      v1(n),
      v1(r)
    ];
  }, ZTe = (t, e) => {
    let n = Math.floor(t / 361), r = Math.floor(t / 19) % 19, i = t % 19;
    return [
      y1((n - 9) / 9, 2) * e,
      y1((r - 9) / 9, 2) * e,
      y1((i - 9) / 9, 2) * e
    ];
  }, JTe = (t, e, n, r) => {
    Wae(t), r = r | 1;
    let i = vy(t[0]), a = Math.floor(i / 9) + 1, s = i % 9 + 1, l = (vy(t[1]) + 1) / 166, c = new Array(s * a);
    for (let h = 0; h < c.length; h++) if (h === 0) {
      let f = vy(t.substring(2, 6));
      c[h] = YTe(f);
    } else {
      let f = vy(t.substring(4 + h * 2, 6 + h * 2));
      c[h] = ZTe(f, l * r);
    }
    let d = e * 4, u = new Uint8ClampedArray(d * n);
    for (let h = 0; h < n; h++) for (let f = 0; f < e; f++) {
      let g = 0, m = 0, v = 0;
      for (let j = 0; j < a; j++) for (let k = 0; k < s; k++) {
        let C = Math.cos(Math.PI * f * k / e) * Math.cos(Math.PI * h * j / n), x = c[k + j * s];
        g += x[0] * C, m += x[1] * C, v += x[2] * C;
      }
      let y = _1(g), w = _1(m), b = _1(v);
      u[4 * f + 0 + h * d] = y, u[4 * f + 1 + h * d] = w, u[4 * f + 2 + h * d] = b, u[4 * f + 3 + h * d] = 255;
    }
    return u;
  }, XTe = JTe, Wq = 4, QTe = (t, e, n, r) => {
    let i = 0, a = 0, s = 0, l = e * Wq;
    for (let d = 0; d < e; d++) {
      let u = Wq * d;
      for (let h = 0; h < n; h++) {
        let f = u + h * l, g = r(d, h);
        i += g * v1(t[f]), a += g * v1(t[f + 1]), s += g * v1(t[f + 2]);
      }
    }
    let c = 1 / (e * n);
    return [
      i * c,
      a * c,
      s * c
    ];
  }, eRe = (t) => {
    let e = _1(t[0]), n = _1(t[1]), r = _1(t[2]);
    return (e << 16) + (n << 8) + r;
  }, tRe = (t, e) => {
    let n = Math.floor(Math.max(0, Math.min(18, Math.floor(y1(t[0] / e, 0.5) * 9 + 9.5)))), r = Math.floor(Math.max(0, Math.min(18, Math.floor(y1(t[1] / e, 0.5) * 9 + 9.5)))), i = Math.floor(Math.max(0, Math.min(18, Math.floor(y1(t[2] / e, 0.5) * 9 + 9.5))));
    return n * 19 * 19 + r * 19 + i;
  }, nRe = (t, e, n, r, i) => {
    if (r < 1 || r > 9 || i < 1 || i > 9) throw new eE("BlurHash must have between 1 and 9 components");
    if (e * n * 4 !== t.length) throw new eE("Width and height must match the pixels array");
    let a = [];
    for (let h = 0; h < i; h++) for (let f = 0; f < r; f++) {
      let g = f == 0 && h == 0 ? 1 : 2, m = QTe(t, e, n, (v, y) => g * Math.cos(Math.PI * f * v / e) * Math.cos(Math.PI * h * y / n));
      a.push(m);
    }
    let s = a[0], l = a.slice(1), c = "", d = r - 1 + (i - 1) * 9;
    c += U_(d, 1);
    let u;
    if (l.length > 0) {
      let h = Math.max(...l.map((g) => Math.max(...g))), f = Math.floor(Math.max(0, Math.min(82, Math.floor(h * 166 - 0.5))));
      u = (f + 1) / 166, c += U_(f, 1);
    } else u = 1, c += U_(0, 1);
    return c += U_(eRe(s), 4), l.forEach((h) => {
      c += U_(tRe(h, u), 2);
    }), c;
  }, rRe = nRe, iRe = Object.defineProperty, oRe = Object.defineProperties, aRe = Object.getOwnPropertyDescriptors, tE = Object.getOwnPropertySymbols, qae = Object.prototype.hasOwnProperty, Kae = Object.prototype.propertyIsEnumerable, qq = (t, e, n) => e in t ? iRe(t, e, {
    enumerable: true,
    configurable: true,
    writable: true,
    value: n
  }) : t[e] = n, sI = (t, e) => {
    for (var n in e || (e = {})) qae.call(e, n) && qq(t, n, e[n]);
    if (tE) for (var n of tE(e)) Kae.call(e, n) && qq(t, n, e[n]);
    return t;
  }, lI = (t, e) => oRe(t, aRe(e)), Gae = (t, e) => {
    var n = {};
    for (var r in t) qae.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
    if (t != null && tE) for (var r of tE(t)) e.indexOf(r) < 0 && Kae.call(t, r) && (n[r] = t[r]);
    return n;
  }, qk = class extends p.PureComponent {
    constructor() {
      super(...arguments), this.canvas = null, this.handleRef = (e) => {
        this.canvas = e, this.draw();
      }, this.draw = () => {
        let { hash: e, height: n, punch: r, width: i } = this.props;
        if (this.canvas) {
          let a = XTe(e, i, n, r), s = this.canvas.getContext("2d"), l = s.createImageData(i, n);
          l.data.set(a), s.putImageData(l, 0, 0);
        }
      };
    }
    componentDidUpdate() {
      this.draw();
    }
    render() {
      let e = this.props, { hash: n, height: r, width: i } = e, a = Gae(e, [
        "hash",
        "height",
        "width"
      ]);
      return p.createElement("canvas", lI(sI({}, a), {
        height: r,
        width: i,
        ref: this.handleRef
      }));
    }
  };
  qk.defaultProps = {
    height: 128,
    width: 128
  };
  var sRe = {
    position: "absolute",
    top: 0,
    bottom: 0,
    left: 0,
    right: 0,
    width: "100%",
    height: "100%"
  }, lRe = class extends p.PureComponent {
    componentDidUpdate() {
      if (this.props.resolutionX <= 0) throw new Error("resolutionX must be larger than zero");
      if (this.props.resolutionY <= 0) throw new Error("resolutionY must be larger than zero");
    }
    render() {
      let e = this.props, { hash: n, height: r, width: i, punch: a, resolutionX: s, resolutionY: l, style: c } = e, d = Gae(e, [
        "hash",
        "height",
        "width",
        "punch",
        "resolutionX",
        "resolutionY",
        "style"
      ]);
      return p.createElement("div", lI(sI({}, d), {
        style: lI(sI({
          display: "inline-block",
          height: r,
          width: i
        }, c), {
          position: "relative"
        })
      }), p.createElement(qk, {
        hash: n,
        height: l,
        width: s,
        punch: a,
        style: sRe
      }));
    }
  };
  lRe.defaultProps = {
    height: 128,
    width: 128,
    resolutionX: 32,
    resolutionY: 32
  };
  const OP = (t, e, n) => {
    const r = t instanceof HTMLVideoElement ? t.videoWidth : t.width, i = t instanceof HTMLVideoElement ? t.videoHeight : t.height, a = document.createElement("canvas");
    a.width = e || r, a.height = n || i;
    const s = a.getContext("2d");
    if (!s) return;
    s.drawImage(t, 0, 0, a.width, a.height);
    const l = s.getImageData(0, 0, a.width, a.height);
    return rRe(l.data, l.width, l.height, 4, 4);
  }, Yae = (t) => {
    if (typeof t == "string") return GTe(t).result ? t : void 0;
  };
  var Zae = "style_RelativeBase__8l6gic0 _1mqalmd1 _1mqalmd0", cRe = "style_ContainedMediaRoot__8l6gic1 _1mqalmd1 _1mqalmd0", Cc = "style_AbsoluteContainer__8l6gic2 _1mqalmd1 _1mqalmd0", Jae = "style_AbsoluteFooter__8l6gic3 _1mqalmd1 _1mqalmd0", cI = "style_Blur__8l6gic4 _1mqalmd1 _1mqalmd0";
  function dRe(t, e, n) {
    const r = Math.max(1, Math.round(t)), i = typeof e == "number" && Number.isFinite(e) && e > 0 ? e : r, a = typeof n == "number" && Number.isFinite(n) && n > 0 ? n : r, s = Math.max(i, a);
    if (s <= r) return {
      tw: Math.round(i),
      th: Math.round(a)
    };
    const l = r / s;
    return {
      tw: Math.max(1, Math.round(i * l)),
      th: Math.max(1, Math.round(a * l))
    };
  }
  const rh = ft(({ className: t, style: e, body: n, mimeType: r, url: i, info: a, encInfo: s, autoPlay: l, markedAsSpoiler: c, spoilerReason: d, renderViewer: u, renderImage: h, matrixThumbnailMaxEdge: f, mediaLayout: g = "default", containedStripMinPx: m, fillsPreviewSlot: v, ...y }, w) => {
    const b = be(), j = hn(), k = Yae(a == null ? void 0 : a[$g]), [C, x] = p.useState(false), [S, T] = p.useState(false), [A, B] = p.useState(false), [U, z] = p.useState(null), [O, M] = p.useState(c ?? false), [I, N] = p.useState(false), [L, H] = Et(p.useCallback(async () => {
      if (i.startsWith("http")) return i;
      if (typeof f == "number" && f > 0 && !s) {
        const { tw: re, th: he } = dRe(f, a == null ? void 0 : a.w, a == null ? void 0 : a.h), se = Cn(b, i, j, re, he, "scale", false);
        if (se) return se;
      }
      const te = Cn(b, i, j);
      if (!te) throw new Error("Invalid media URL");
      if (s) {
        const re = await Qf(te, (he) => Xf(he, r ?? sF, s));
        return URL.createObjectURL(re);
      }
      return te;
    }, [
      b,
      i,
      j,
      r,
      s,
      f,
      a == null ? void 0 : a.w,
      a == null ? void 0 : a.h
    ]));
    p.useEffect(() => {
      if (!A) {
        z(null);
        return;
      }
      if (typeof f != "number" || f <= 0 || s || i.startsWith("http")) return;
      let te = false;
      return (async () => {
        const re = Cn(b, i, j);
        !re || te || z(re);
      })(), () => {
        te = true;
      };
    }, [
      A,
      f,
      s,
      i,
      b,
      j
    ]);
    const V = () => {
      x(true);
    }, Z = () => {
      x(false), T(true);
    }, Y = () => {
      T(false), H();
    };
    p.useEffect(() => {
      l && H();
    }, [
      l,
      H
    ]);
    const oe = a == null ? void 0 : a.w, ue = a == null ? void 0 : a.h, ie = typeof oe == "number" && typeof ue == "number", de = g === "contained", ne = !!(v && de), ae = !ne && de && (L.status === ve.Loading || L.status === ve.Error || S || L.status === ve.Success && !C), X = de ? cRe : Zae, G = ne ? {} : de ? {
      minHeight: ae ? He(m ?? 56) : void 0
    } : ie ? {
      aspectRatio: `${oe} / ${ue}`
    } : {
      minHeight: "150px"
    }, le = ne ? {
      width: "100%",
      height: "100%"
    } : void 0;
    return o.jsxs(E, {
      className: gt(X, t),
      style: {
        ...le,
        ...G,
        ...e
      },
      ...y,
      ref: w,
      onPointerEnter: () => N(true),
      onPointerLeave: () => N(false),
      children: [
        L.status === ve.Success && o.jsx(Hn, {
          open: A,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => B(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                className: OF,
                size: "500",
                onContextMenu: (te) => te.stopPropagation(),
                children: u({
                  src: U ?? L.data,
                  alt: n,
                  requestClose: () => B(false)
                })
              })
            })
          })
        }),
        typeof k == "string" && !C && o.jsx(qk, {
          style: {
            width: "100%",
            height: "100%"
          },
          width: 32,
          height: 32,
          hash: k,
          punch: 1
        }),
        !l && !c && L.status === ve.Idle && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          onClick: H,
          children: o.jsx(xe, {
            variant: "Secondary",
            fill: "Solid",
            radii: "300",
            size: "300",
            onClick: H,
            before: o.jsx(Q, {
              size: "Inherit",
              src: q.Photo,
              filled: true
            }),
            children: o.jsx(D, {
              size: "B300",
              children: "View"
            })
          })
        }),
        L.status === ve.Success && o.jsx(E, {
          className: gt(ie && !de ? Cc : void 0, O && cI),
          style: {
            width: "100%"
          },
          children: h({
            alt: n,
            title: n,
            src: L.data,
            onLoad: V,
            onError: Z,
            onClick: () => {
              N(false), B(true);
            },
            tabIndex: 0
          })
        }),
        O && !S && L.status !== ve.Error && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          onClick: () => {
            M(false), L.status === ve.Idle && H();
          },
          children: o.jsx(Qe, {
            variant: "Secondary",
            radii: "Pill",
            size: "500",
            outlined: true,
            onClick: () => {
              M(false), L.status === ve.Idle && H();
            },
            children: o.jsx(D, {
              size: "B300",
              children: typeof d == "string" && d.length > 0 ? `Spoiler reason: ${d}` : "Spoilered"
            })
          })
        }),
        (L.status === ve.Loading || L.status === ve.Success) && !C && !O && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(dt, {
            variant: "Secondary"
          })
        }),
        (S || L.status === ve.Error) && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          onClick: Y,
          children: o.jsx(ar, {
            tooltip: o.jsx(pr, {
              variant: "Critical",
              children: o.jsx(D, {
                children: "Failed to load image!"
              })
            }),
            position: "Top",
            align: "Center",
            children: (te) => o.jsx(xe, {
              ref: te,
              size: "300",
              variant: "Critical",
              fill: "Soft",
              outlined: true,
              radii: "300",
              onClick: Y,
              before: o.jsx(Q, {
                size: "Inherit",
                src: q.Warning,
                filled: true
              }),
              children: o.jsx(D, {
                size: "B300",
                children: "Retry"
              })
            })
          })
        }),
        I && o.jsx(E, {
          style: {
            padding: ee.space.S200,
            right: 0,
            position: "absolute"
          },
          children: o.jsx(tn, {
            style: {
              padding: ee.space.S0
            },
            children: o.jsx(Ye, {
              size: "300",
              after: o.jsx(Q, {
                size: "200",
                src: O ? q.Eye : q.EyeBlind
              }),
              radii: "300",
              fill: "Soft",
              variant: "Secondary",
              title: O ? "Reveal Image" : "Hide Image",
              onClick: (te) => {
                te.preventDefault(), L.status === ve.Idle ? (H(), M(false)) : M(!O);
              }
            })
          })
        }),
        !C && typeof (a == null ? void 0 : a.size) == "number" && o.jsx(E, {
          className: Jae,
          justifyContent: "End",
          alignContent: "Center",
          gap: "200",
          children: o.jsx(Rn, {
            variant: "Secondary",
            fill: "Soft",
            children: o.jsx(D, {
              size: "L400",
              children: Wl(a.size)
            })
          })
        })
      ]
    });
  }), LP = ft(({ className: t, body: e, mimeType: n, url: r, info: i, encInfo: a, autoPlay: s, markedAsSpoiler: l, spoilerReason: c, renderThumbnail: d, renderVideo: u, ...h }, f) => {
    var _a6;
    const g = be(), m = hn(), v = Yae((_a6 = i.thumbnail_info) == null ? void 0 : _a6[$g]), [y, w] = p.useState(false), [b, j] = p.useState(false), [k, C] = p.useState(l ?? false), [x, S] = p.useState(false), [T, A] = Et(p.useCallback(async () => {
      if (r.startsWith("http")) return r;
      const O = Cn(g, r, m);
      if (!O) throw new Error("Invalid media URL");
      const M = a ? await Qf(O, (I) => Xf(I, n, a)) : await Gd(O);
      return URL.createObjectURL(M);
    }, [
      g,
      r,
      m,
      n,
      a
    ])), B = () => {
      w(true);
    }, U = () => {
      w(false), j(true);
    }, z = () => {
      j(false), A();
    };
    return p.useEffect(() => {
      s && A();
    }, [
      s,
      A
    ]), o.jsxs(E, {
      className: gt(Zae, t),
      ...h,
      ref: f,
      onPointerEnter: () => S(true),
      onPointerLeave: () => S(false),
      children: [
        typeof v == "string" && !y && o.jsx(qk, {
          style: {
            width: "100%",
            height: "100%"
          },
          width: 32,
          height: 32,
          hash: v,
          punch: 1
        }),
        d && !y && o.jsx(E, {
          className: gt(Cc, k && cI),
          alignItems: "Center",
          justifyContent: "Center",
          children: d()
        }),
        !s && !k && T.status === ve.Idle && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          onClick: A,
          children: o.jsx(xe, {
            variant: "Secondary",
            fill: "Solid",
            radii: "300",
            size: "300",
            onClick: A,
            before: o.jsx(Q, {
              size: "Inherit",
              src: q.Play,
              filled: true
            }),
            children: o.jsx(D, {
              size: "B300",
              children: "Watch"
            })
          })
        }),
        T.status === ve.Success && o.jsx(E, {
          className: gt(Cc, k && cI),
          children: u({
            title: e,
            src: T.data,
            onLoadedMetadata: B,
            onError: U,
            autoPlay: false,
            controls: true
          })
        }),
        k && !b && T.status !== ve.Error && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          onClick: () => {
            C(false), T.status === ve.Idle && A();
          },
          children: o.jsx(Qe, {
            variant: "Secondary",
            radii: "Pill",
            size: "500",
            outlined: true,
            onClick: () => {
              C(false), T.status === ve.Idle && A();
            },
            children: o.jsx(D, {
              size: "B300",
              children: typeof c == "string" && c.length > 0 ? `Spoiler reason: ${c}` : "Spoilered"
            })
          })
        }),
        (T.status === ve.Loading || T.status === ve.Success) && !y && !k && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(dt, {
            variant: "Secondary"
          })
        }),
        (b || T.status === ve.Error) && o.jsx(E, {
          className: Cc,
          alignItems: "Center",
          justifyContent: "Center",
          onClick: z,
          children: o.jsx(ar, {
            tooltip: o.jsx(pr, {
              variant: "Critical",
              children: o.jsx(D, {
                children: "Failed to load video!"
              })
            }),
            position: "Top",
            align: "Center",
            children: (O) => o.jsx(xe, {
              ref: O,
              size: "300",
              variant: "Critical",
              fill: "Soft",
              outlined: true,
              radii: "300",
              onClick: z,
              before: o.jsx(Q, {
                size: "Inherit",
                src: q.Warning,
                filled: true
              }),
              children: o.jsx(D, {
                size: "B300",
                children: "Retry"
              })
            })
          })
        }),
        x && o.jsx(E, {
          style: {
            padding: ee.space.S200,
            right: 0,
            position: "absolute"
          },
          children: o.jsx(tn, {
            style: {
              padding: ee.space.S0
            },
            children: o.jsx(Ye, {
              size: "300",
              after: o.jsx(Q, {
                size: "200",
                src: k ? q.Eye : q.EyeBlind
              }),
              radii: "300",
              fill: "Soft",
              variant: "Secondary",
              title: k ? "Reveal Video" : "Hide Video",
              onClick: (O) => {
                O.preventDefault(), T.status === ve.Idle ? (A(), C(false)) : C(!k);
              }
            })
          })
        }),
        !y && typeof i.size == "number" && o.jsxs(E, {
          className: Jae,
          justifyContent: "SpaceBetween",
          alignContent: "Center",
          gap: "200",
          children: [
            o.jsx(Rn, {
              variant: "Secondary",
              fill: "Soft",
              children: o.jsx(D, {
                size: "L400",
                children: Dye(i.duration ?? 0)
              })
            }),
            o.jsx(Rn, {
              variant: "Secondary",
              fill: "Soft",
              children: o.jsx(D, {
                size: "L400",
                children: Wl(i.size)
              })
            })
          ]
        })
      ]
    });
  });
  var V_ = {}, Ds = {}, H_ = {}, $_ = {}, Kq;
  function NP() {
    if (Kq) return $_;
    Kq = 1, Object.defineProperty($_, "__esModule", {
      value: true
    }), $_.Direction = void 0;
    var t;
    return (function(e) {
      e.Right = "to right", e.Left = "to left", e.Down = "to bottom", e.Up = "to top";
    })(t || ($_.Direction = t = {})), $_;
  }
  var Gq;
  function Xae() {
    return Gq || (Gq = 1, (function(t) {
      var e = H_ && H_.__spreadArray || function(z, O, M) {
        if (M || arguments.length === 2) for (var I = 0, N = O.length, L; I < N; I++) (L || !(I in O)) && (L || (L = Array.prototype.slice.call(O, 0, I)), L[I] = O[I]);
        return z.concat(L || Array.prototype.slice.call(O));
      };
      Object.defineProperty(t, "__esModule", {
        value: true
      }), t.isIOS = t.useThumbOverlap = t.assertUnreachable = t.voidFn = t.getTrackBackground = t.replaceAt = t.schd = t.translate = t.getClosestThumbIndex = t.translateThumbs = t.getPaddingAndBorder = t.getMargin = t.checkInitialOverlap = t.checkValuesAgainstBoundaries = t.checkBoundaries = t.isVertical = t.relativeValue = t.normalizeValue = t.isStepDivisible = t.isTouchEvent = t.getStepDecimals = void 0;
      var n = dh(), r = NP(), i = function(z) {
        var O = z.toString().split(".")[1];
        return O ? O.length : 0;
      };
      t.getStepDecimals = i;
      function a(z) {
        return z.touches && z.touches.length || z.changedTouches && z.changedTouches.length;
      }
      t.isTouchEvent = a;
      function s(z, O, M) {
        var I = (O - z) / M, N = 8, L = Number(I.toFixed(N));
        return parseInt(L.toString(), 10) === L;
      }
      t.isStepDivisible = s;
      function l(z, O, M, I, N, L, H) {
        var V = 1e11;
        if (z = Math.round(z * V) / V, !L) {
          var Z = H[O - 1], Y = H[O + 1];
          if (Z && Z > z) return Z;
          if (Y && Y < z) return Y;
        }
        if (z > I) return I;
        if (z < M) return M;
        var oe = Math.floor(z * V - M * V) % Math.floor(N * V), ue = Math.floor(z * V - Math.abs(oe)), ie = oe === 0 ? z : ue / V, de = Math.abs(oe / V) < N / 2 ? ie : ie + N, ne = (0, t.getStepDecimals)(N);
        return parseFloat(de.toFixed(ne));
      }
      t.normalizeValue = l;
      function c(z, O, M) {
        return (z - O) / (M - O);
      }
      t.relativeValue = c;
      function d(z) {
        return z === r.Direction.Up || z === r.Direction.Down;
      }
      t.isVertical = d;
      function u(z, O, M) {
        if (O >= M) throw new RangeError("min (".concat(O, ") is equal/bigger than max (").concat(M, ")"));
        if (z < O) throw new RangeError("value (".concat(z, ") is smaller than min (").concat(O, ")"));
        if (z > M) throw new RangeError("value (".concat(z, ") is bigger than max (").concat(M, ")"));
      }
      t.checkBoundaries = u;
      function h(z, O, M) {
        return z < O ? O : z > M ? M : z;
      }
      t.checkValuesAgainstBoundaries = h;
      function f(z) {
        if (!(z.length < 2) && !z.slice(1).every(function(O, M) {
          return z[M] <= O;
        })) throw new RangeError("values={[".concat(z, "]} needs to be sorted when allowOverlap={false}"));
      }
      t.checkInitialOverlap = f;
      function g(z) {
        var O = window.getComputedStyle(z);
        return {
          top: parseInt(O["margin-top"], 10),
          bottom: parseInt(O["margin-bottom"], 10),
          left: parseInt(O["margin-left"], 10),
          right: parseInt(O["margin-right"], 10)
        };
      }
      t.getMargin = g;
      function m(z) {
        var O = window.getComputedStyle(z);
        return {
          top: parseInt(O["padding-top"], 10) + parseInt(O["border-top-width"], 10),
          bottom: parseInt(O["padding-bottom"], 10) + parseInt(O["border-bottom-width"], 10),
          left: parseInt(O["padding-left"], 10) + parseInt(O["border-left-width"], 10),
          right: parseInt(O["padding-right"], 10) + parseInt(O["border-right-width"], 10)
        };
      }
      t.getPaddingAndBorder = m;
      function v(z, O, M) {
        var I = M ? -1 : 1;
        z.forEach(function(N, L) {
          return w(N, I * O[L].x, O[L].y);
        });
      }
      t.translateThumbs = v;
      function y(z, O, M, I) {
        for (var N = 0, L = B(z[0], O, M, I), H = 1; H < z.length; H++) {
          var V = B(z[H], O, M, I);
          V < L && (L = V, N = H);
        }
        return N;
      }
      t.getClosestThumbIndex = y;
      function w(z, O, M) {
        z.style.transform = "translate(".concat(O, "px, ").concat(M, "px)");
      }
      t.translate = w;
      var b = function(z) {
        var O = [], M = null, I = function() {
          for (var N = [], L = 0; L < arguments.length; L++) N[L] = arguments[L];
          O = N, !M && (M = requestAnimationFrame(function() {
            M = null, z.apply(void 0, O);
          }));
        };
        return I;
      };
      t.schd = b;
      function j(z, O, M) {
        var I = z.slice(0);
        return I[O] = M, I;
      }
      t.replaceAt = j;
      function k(z) {
        var O = z.values, M = z.colors, I = z.min, N = z.max, L = z.direction, H = L === void 0 ? r.Direction.Right : L, V = z.rtl, Z = V === void 0 ? false : V;
        Z && H === r.Direction.Right ? H = r.Direction.Left : Z && r.Direction.Left && (H = r.Direction.Right);
        var Y = O.slice(0).sort(function(ue, ie) {
          return ue - ie;
        }).map(function(ue) {
          return (ue - I) / (N - I) * 100;
        }), oe = Y.reduce(function(ue, ie, de) {
          return "".concat(ue, ", ").concat(M[de], " ").concat(ie, "%, ").concat(M[de + 1], " ").concat(ie, "%");
        }, "");
        return "linear-gradient(".concat(H, ", ").concat(M[0], " 0%").concat(oe, ", ").concat(M[M.length - 1], " 100%)");
      }
      t.getTrackBackground = k;
      function C() {
      }
      t.voidFn = C;
      function x(z) {
        throw new Error("Didn't expect to get here");
      }
      t.assertUnreachable = x;
      var S = function(z, O, M, I, N) {
        N === void 0 && (N = function(H) {
          return H;
        });
        var L = Math.ceil(e([
          z
        ], Array.from(z.children), true).reduce(function(H, V) {
          var Z = Math.ceil(V.getBoundingClientRect().width);
          if (V.innerText && V.innerText.includes(M) && V.childElementCount === 0) {
            var Y = V.cloneNode(true);
            Y.innerHTML = N(O.toFixed(I)), Y.style.visibility = "hidden", document.body.appendChild(Y), Z = Math.ceil(Y.getBoundingClientRect().width), document.body.removeChild(Y);
          }
          return Z > H ? Z : H;
        }, z.getBoundingClientRect().width));
        return L;
      }, T = function(z, O, M, I, N, L, H) {
        H === void 0 && (H = function(Y) {
          return Y;
        });
        var V = [], Z = function(Y) {
          var oe = S(M[Y], I[Y], N, L, H), ue = O[Y].x;
          O.forEach(function(ie, de) {
            var ne = ie.x, ae = S(M[de], I[de], N, L, H);
            Y !== de && (ue >= ne && ue <= ne + ae || ue + oe >= ne && ue + oe <= ne + ae) && (V.includes(de) || (V.push(Y), V.push(de), V = e(e([], V, true), [
              Y,
              de
            ], false), Z(de)));
          });
        };
        return Z(z), Array.from(new Set(V.sort()));
      }, A = function(z, O, M, I, N, L) {
        I === void 0 && (I = 0.1), N === void 0 && (N = " - "), L === void 0 && (L = function(de) {
          return de;
        });
        var H = (0, t.getStepDecimals)(I), V = (0, n.useState)({}), Z = V[0], Y = V[1], oe = (0, n.useState)(L(O[M].toFixed(H))), ue = oe[0], ie = oe[1];
        return (0, n.useEffect)(function() {
          if (z) {
            var de = z.getThumbs();
            if (de.length < 1) return;
            var ne = {}, ae = z.getOffsets(), X = T(M, ae, de, O, N, H, L), K = L(O[M].toFixed(H));
            if (X.length) {
              var G = X.reduce(function(se, ye, we, Ee) {
                return se.length ? e(e([], se, true), [
                  ae[Ee[we]].x
                ], false) : [
                  ae[Ee[we]].x
                ];
              }, []);
              if (Math.min.apply(Math, G) === ae[M].x) {
                var le = [];
                X.forEach(function(se) {
                  le.push(O[se].toFixed(H));
                }), K = Array.from(new Set(le.sort(function(se, ye) {
                  return parseFloat(se) - parseFloat(ye);
                }))).map(L).join(N);
                var te = Math.min.apply(Math, G), re = Math.max.apply(Math, G), he = de[X[G.indexOf(re)]].getBoundingClientRect().width;
                ne.left = "".concat(Math.abs(te - (re + he)) / 2, "px"), ne.transform = "translate(-50%, 0)";
              } else ne.visibility = "hidden";
            }
            ie(K), Y(ne);
          }
        }, [
          z,
          O
        ]), [
          ue,
          Z
        ];
      };
      t.useThumbOverlap = A;
      function B(z, O, M, I) {
        var N = z.getBoundingClientRect(), L = N.left, H = N.top, V = N.width, Z = N.height;
        return d(I) ? Math.abs(M - (H + Z / 2)) : Math.abs(O - (L + V / 2));
      }
      var U = function() {
        var z, O = ((z = navigator.userAgentData) === null || z === void 0 ? void 0 : z.platform) || navigator.platform;
        return [
          "iPad Simulator",
          "iPhone Simulator",
          "iPod Simulator",
          "iPad",
          "iPhone",
          "iPod"
        ].includes(O) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
      };
      t.isIOS = U;
    })(H_)), H_;
  }
  var Yq;
  function uRe() {
    if (Yq) return Ds;
    Yq = 1;
    var t = Ds && Ds.__extends || /* @__PURE__ */ (function() {
      var h = function(f, g) {
        return h = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(m, v) {
          m.__proto__ = v;
        } || function(m, v) {
          for (var y in v) Object.prototype.hasOwnProperty.call(v, y) && (m[y] = v[y]);
        }, h(f, g);
      };
      return function(f, g) {
        if (typeof g != "function" && g !== null) throw new TypeError("Class extends value " + String(g) + " is not a constructor or null");
        h(f, g);
        function m() {
          this.constructor = f;
        }
        f.prototype = g === null ? Object.create(g) : (m.prototype = g.prototype, new m());
      };
    })(), e = Ds && Ds.__createBinding || (Object.create ? (function(h, f, g, m) {
      m === void 0 && (m = g);
      var v = Object.getOwnPropertyDescriptor(f, g);
      (!v || ("get" in v ? !f.__esModule : v.writable || v.configurable)) && (v = {
        enumerable: true,
        get: function() {
          return f[g];
        }
      }), Object.defineProperty(h, m, v);
    }) : (function(h, f, g, m) {
      m === void 0 && (m = g), h[m] = f[g];
    })), n = Ds && Ds.__setModuleDefault || (Object.create ? (function(h, f) {
      Object.defineProperty(h, "default", {
        enumerable: true,
        value: f
      });
    }) : function(h, f) {
      h.default = f;
    }), r = Ds && Ds.__importStar || function(h) {
      if (h && h.__esModule) return h;
      var f = {};
      if (h != null) for (var g in h) g !== "default" && Object.prototype.hasOwnProperty.call(h, g) && e(f, h, g);
      return n(f, h), f;
    }, i = Ds && Ds.__spreadArray || function(h, f, g) {
      if (g || arguments.length === 2) for (var m = 0, v = f.length, y; m < v; m++) (y || !(m in f)) && (y || (y = Array.prototype.slice.call(f, 0, m)), y[m] = f[m]);
      return h.concat(y || Array.prototype.slice.call(f));
    };
    Object.defineProperty(Ds, "__esModule", {
      value: true
    });
    var a = r(dh()), s = Xae(), l = NP(), c = [
      "ArrowRight",
      "ArrowUp",
      "k",
      "PageUp"
    ], d = [
      "ArrowLeft",
      "ArrowDown",
      "j",
      "PageDown"
    ], u = (function(h) {
      t(f, h);
      function f(g) {
        var m = h.call(this, g) || this;
        if (m.trackRef = a.createRef(), m.thumbRefs = [], m.state = {
          draggedTrackPos: [
            -1,
            -1
          ],
          draggedThumbIndex: -1,
          thumbZIndexes: new Array(m.props.values.length).fill(0).map(function(v, y) {
            return y;
          }),
          isChanged: false,
          markOffsets: []
        }, m.getOffsets = function() {
          var v = m.props, y = v.direction, w = v.values, b = v.min, j = v.max, k = m.trackRef.current;
          if (!k) return console.warn("No track element found."), [];
          var C = k.getBoundingClientRect(), x = (0, s.getPaddingAndBorder)(k);
          return m.getThumbs().map(function(S, T) {
            var A = {
              x: 0,
              y: 0
            }, B = S.getBoundingClientRect(), U = (0, s.getMargin)(S);
            switch (y) {
              case l.Direction.Right:
                return A.x = (U.left + x.left) * -1, A.y = ((B.height - C.height) / 2 + x.top) * -1, A.x += C.width * (0, s.relativeValue)(w[T], b, j) - B.width / 2, A;
              case l.Direction.Left:
                return A.x = (U.right + x.right) * -1, A.y = ((B.height - C.height) / 2 + x.top) * -1, A.x += C.width - C.width * (0, s.relativeValue)(w[T], b, j) - B.width / 2, A;
              case l.Direction.Up:
                return A.x = ((B.width - C.width) / 2 + U.left + x.left) * -1, A.y = -x.left, A.y += C.height - C.height * (0, s.relativeValue)(w[T], b, j) - B.height / 2, A;
              case l.Direction.Down:
                return A.x = ((B.width - C.width) / 2 + U.left + x.left) * -1, A.y = -x.left, A.y += C.height * (0, s.relativeValue)(w[T], b, j) - B.height / 2, A;
              default:
                return (0, s.assertUnreachable)(y);
            }
          });
        }, m.getThumbs = function() {
          return m.trackRef && m.trackRef.current ? Array.from(m.trackRef.current.children).filter(function(v) {
            return v.hasAttribute("aria-valuenow");
          }) : (console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"), []);
        }, m.getTargetIndex = function(v) {
          return m.getThumbs().findIndex(function(y) {
            return y === v.target || y.contains(v.target);
          });
        }, m.addTouchEvents = function(v) {
          document.addEventListener("touchmove", m.schdOnTouchMove, {
            passive: false
          }), document.addEventListener("touchend", m.schdOnEnd, {
            passive: false
          }), document.addEventListener("touchcancel", m.schdOnEnd, {
            passive: false
          });
        }, m.addMouseEvents = function(v) {
          document.addEventListener("mousemove", m.schdOnMouseMove), document.addEventListener("mouseup", m.schdOnEnd);
        }, m.onMouseDownTrack = function(v) {
          var y;
          if (!(v.button !== 0 || (0, s.isIOS)())) if (v.persist(), v.preventDefault(), m.addMouseEvents(v.nativeEvent), m.props.values.length > 1 && m.props.draggableTrack) {
            if (m.thumbRefs.some(function(b) {
              var j;
              return (j = b.current) === null || j === void 0 ? void 0 : j.contains(v.target);
            })) return;
            m.setState({
              draggedTrackPos: [
                v.clientX,
                v.clientY
              ]
            }, function() {
              return m.onMove(v.clientX, v.clientY);
            });
          } else {
            var w = (0, s.getClosestThumbIndex)(m.thumbRefs.map(function(b) {
              return b.current;
            }), v.clientX, v.clientY, m.props.direction);
            (y = m.thumbRefs[w].current) === null || y === void 0 || y.focus(), m.setState({
              draggedThumbIndex: w
            }, function() {
              return m.onMove(v.clientX, v.clientY);
            });
          }
        }, m.onResize = function() {
          (0, s.translateThumbs)(m.getThumbs(), m.getOffsets(), m.props.rtl), m.calculateMarkOffsets();
        }, m.onTouchStartTrack = function(v) {
          var y;
          if (v.persist(), m.addTouchEvents(v.nativeEvent), m.props.values.length > 1 && m.props.draggableTrack) {
            if (m.thumbRefs.some(function(b) {
              var j;
              return (j = b.current) === null || j === void 0 ? void 0 : j.contains(v.target);
            })) return;
            m.setState({
              draggedTrackPos: [
                v.touches[0].clientX,
                v.touches[0].clientY
              ]
            }, function() {
              return m.onMove(v.touches[0].clientX, v.touches[0].clientY);
            });
          } else {
            var w = (0, s.getClosestThumbIndex)(m.thumbRefs.map(function(b) {
              return b.current;
            }), v.touches[0].clientX, v.touches[0].clientY, m.props.direction);
            (y = m.thumbRefs[w].current) === null || y === void 0 || y.focus(), m.setState({
              draggedThumbIndex: w
            }, function() {
              return m.onMove(v.touches[0].clientX, v.touches[0].clientY);
            });
          }
        }, m.onMouseOrTouchStart = function(v) {
          if (!m.props.disabled) {
            var y = (0, s.isTouchEvent)(v);
            if (!(!y && v.button !== 0)) {
              var w = m.getTargetIndex(v);
              w !== -1 && (y ? m.addTouchEvents(v) : m.addMouseEvents(v), m.setState({
                draggedThumbIndex: w,
                thumbZIndexes: m.state.thumbZIndexes.map(function(b, j) {
                  return j === w ? Math.max.apply(Math, m.state.thumbZIndexes) : b <= m.state.thumbZIndexes[w] ? b : b - 1;
                })
              }));
            }
          }
        }, m.onMouseMove = function(v) {
          v.preventDefault(), m.onMove(v.clientX, v.clientY);
        }, m.onTouchMove = function(v) {
          v.preventDefault(), m.onMove(v.touches[0].clientX, v.touches[0].clientY);
        }, m.onKeyDown = function(v) {
          var y = m.props, w = y.values, b = y.onChange, j = y.step, k = y.rtl, C = y.direction, x = m.state.isChanged, S = m.getTargetIndex(v.nativeEvent), T = k || C === l.Direction.Left || C === l.Direction.Down ? -1 : 1;
          S !== -1 && (c.includes(v.key) ? (v.preventDefault(), m.setState({
            draggedThumbIndex: S,
            isChanged: true
          }), b((0, s.replaceAt)(w, S, m.normalizeValue(w[S] + T * (v.key === "PageUp" ? j * 10 : j), S)))) : d.includes(v.key) ? (v.preventDefault(), m.setState({
            draggedThumbIndex: S,
            isChanged: true
          }), b((0, s.replaceAt)(w, S, m.normalizeValue(w[S] - T * (v.key === "PageDown" ? j * 10 : j), S)))) : v.key === "Tab" ? m.setState({
            draggedThumbIndex: -1
          }, function() {
            x && m.fireOnFinalChange();
          }) : x && m.fireOnFinalChange());
        }, m.onKeyUp = function(v) {
          var y = m.state.isChanged;
          m.setState({
            draggedThumbIndex: -1
          }, function() {
            y && m.fireOnFinalChange();
          });
        }, m.onMove = function(v, y) {
          var w = m.state, b = w.draggedThumbIndex, j = w.draggedTrackPos, k = m.props, C = k.direction, x = k.min, S = k.max, T = k.onChange, A = k.values, B = k.step, U = k.rtl;
          if (b === -1 && j[0] === -1 && j[1] === -1) return null;
          var z = m.trackRef.current;
          if (!z) return null;
          var O = z.getBoundingClientRect(), M = (0, s.isVertical)(C) ? O.height : O.width;
          if (j[0] !== -1 && j[1] !== -1) {
            var I = v - j[0], N = y - j[1], L = 0;
            switch (C) {
              case l.Direction.Right:
              case l.Direction.Left:
                L = I / M * (S - x);
                break;
              case l.Direction.Down:
              case l.Direction.Up:
                L = N / M * (S - x);
                break;
              default:
                (0, s.assertUnreachable)(C);
            }
            if (U && (L *= -1), Math.abs(L) >= B / 2) {
              for (var H = 0; H < m.thumbRefs.length; H++) {
                if (A[H] === S && Math.sign(L) === 1 || A[H] === x && Math.sign(L) === -1) return;
                var V = A[H] + L;
                V > S ? L = S - A[H] : V < x && (L = x - A[H]);
              }
              for (var Z = A.slice(0), H = 0; H < m.thumbRefs.length; H++) Z = (0, s.replaceAt)(Z, H, m.normalizeValue(A[H] + L, H));
              m.setState({
                draggedTrackPos: [
                  v,
                  y
                ]
              }), T(Z);
            }
          } else {
            var Y = 0;
            switch (C) {
              case l.Direction.Right:
                Y = (v - O.left) / M * (S - x) + x;
                break;
              case l.Direction.Left:
                Y = (M - (v - O.left)) / M * (S - x) + x;
                break;
              case l.Direction.Down:
                Y = (y - O.top) / M * (S - x) + x;
                break;
              case l.Direction.Up:
                Y = (M - (y - O.top)) / M * (S - x) + x;
                break;
              default:
                (0, s.assertUnreachable)(C);
            }
            U && (Y = S + x - Y), Math.abs(A[b] - Y) >= B / 2 && T((0, s.replaceAt)(A, b, m.normalizeValue(Y, b)));
          }
        }, m.normalizeValue = function(v, y) {
          var w = m.props, b = w.min, j = w.max, k = w.step, C = w.allowOverlap, x = w.values;
          return (0, s.normalizeValue)(v, y, b, j, k, C, x);
        }, m.onEnd = function(v) {
          if (v.preventDefault(), document.removeEventListener("mousemove", m.schdOnMouseMove), document.removeEventListener("touchmove", m.schdOnTouchMove), document.removeEventListener("mouseup", m.schdOnEnd), document.removeEventListener("touchend", m.schdOnEnd), document.removeEventListener("touchcancel", m.schdOnEnd), m.state.draggedThumbIndex === -1 && m.state.draggedTrackPos[0] === -1 && m.state.draggedTrackPos[1] === -1) return null;
          m.setState({
            draggedThumbIndex: -1,
            draggedTrackPos: [
              -1,
              -1
            ]
          }, function() {
            m.fireOnFinalChange();
          });
        }, m.fireOnFinalChange = function() {
          m.setState({
            isChanged: false
          });
          var v = m.props, y = v.onFinalChange, w = v.values;
          y && y(w);
        }, m.updateMarkRefs = function(v) {
          if (!v.renderMark) {
            m.numOfMarks = void 0, m.markRefs = void 0;
            return;
          }
          m.numOfMarks = (v.max - v.min) / m.props.step, m.markRefs = [];
          for (var y = 0; y < m.numOfMarks + 1; y++) m.markRefs[y] = a.createRef();
        }, m.calculateMarkOffsets = function() {
          if (!(!m.props.renderMark || !m.trackRef || !m.numOfMarks || !m.markRefs || m.trackRef.current === null)) {
            for (var v = window.getComputedStyle(m.trackRef.current), y = parseInt(v.width, 10), w = parseInt(v.height, 10), b = parseInt(v.paddingLeft, 10), j = parseInt(v.paddingTop, 10), k = [], C = 0; C < m.numOfMarks + 1; C++) {
              var x = 9999, S = 9999;
              if (m.markRefs[C].current) {
                var T = m.markRefs[C].current.getBoundingClientRect();
                x = T.height, S = T.width;
              }
              m.props.direction === l.Direction.Left || m.props.direction === l.Direction.Right ? k.push([
                Math.round(y / m.numOfMarks * C + b - S / 2),
                -Math.round((x - w) / 2)
              ]) : k.push([
                Math.round(w / m.numOfMarks * C + j - x / 2),
                -Math.round((S - y) / 2)
              ]);
            }
            m.setState({
              markOffsets: k
            });
          }
        }, g.step === 0) throw new Error('"step" property should be a positive number');
        return m.schdOnMouseMove = (0, s.schd)(m.onMouseMove), m.schdOnTouchMove = (0, s.schd)(m.onTouchMove), m.schdOnEnd = (0, s.schd)(m.onEnd), m.thumbRefs = g.values.map(function() {
          return a.createRef();
        }), m.updateMarkRefs(g), m;
      }
      return f.prototype.componentDidMount = function() {
        var g = this, m = this.props, v = m.values, y = m.min, w = m.step;
        this.resizeObserver = window.ResizeObserver ? new window.ResizeObserver(this.onResize) : {
          observe: function() {
            return window.addEventListener("resize", g.onResize);
          },
          unobserve: function() {
            return window.removeEventListener("resize", g.onResize);
          }
        }, document.addEventListener("touchstart", this.onMouseOrTouchStart, {
          passive: false
        }), document.addEventListener("mousedown", this.onMouseOrTouchStart, {
          passive: false
        }), !this.props.allowOverlap && (0, s.checkInitialOverlap)(this.props.values), this.props.values.forEach(function(b) {
          return (0, s.checkBoundaries)(b, g.props.min, g.props.max);
        }), this.resizeObserver.observe(this.trackRef.current), (0, s.translateThumbs)(this.getThumbs(), this.getOffsets(), this.props.rtl), this.calculateMarkOffsets(), v.forEach(function(b) {
          (0, s.isStepDivisible)(y, b, w) || console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.");
        });
      }, f.prototype.componentDidUpdate = function(g, m) {
        var v = this.props, y = v.max, w = v.min, b = v.step, j = v.values, k = v.rtl;
        (g.max !== y || g.min !== w || g.step !== b) && this.updateMarkRefs(this.props), (0, s.translateThumbs)(this.getThumbs(), this.getOffsets(), k), (g.max !== y || g.min !== w || g.step !== b || m.markOffsets.length !== this.state.markOffsets.length) && (this.calculateMarkOffsets(), j.forEach(function(C) {
          (0, s.isStepDivisible)(w, C, b) || console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.");
        }));
      }, f.prototype.componentWillUnmount = function() {
        var g = {
          passive: false
        };
        document.removeEventListener("mousedown", this.onMouseOrTouchStart, g), document.removeEventListener("mousemove", this.schdOnMouseMove), document.removeEventListener("touchmove", this.schdOnTouchMove), document.removeEventListener("touchstart", this.onMouseOrTouchStart), document.removeEventListener("mouseup", this.schdOnEnd), document.removeEventListener("touchend", this.schdOnEnd), this.resizeObserver.unobserve(this.trackRef.current);
      }, f.prototype.render = function() {
        var g = this, m = this.props, v = m.label, y = m.labelledBy, w = m.renderTrack, b = m.renderThumb, j = m.renderMark, k = j === void 0 ? function() {
          return null;
        } : j, C = m.values, x = m.min, S = m.max, T = m.allowOverlap, A = m.disabled, B = this.state, U = B.draggedThumbIndex, z = B.thumbZIndexes, O = B.markOffsets;
        return w({
          props: {
            style: {
              transform: "scale(1)",
              cursor: U > -1 ? "grabbing" : this.props.draggableTrack ? (0, s.isVertical)(this.props.direction) ? "ns-resize" : "ew-resize" : C.length === 1 && !A ? "pointer" : "inherit"
            },
            onMouseDown: A ? s.voidFn : this.onMouseDownTrack,
            onTouchStart: A ? s.voidFn : this.onTouchStartTrack,
            ref: this.trackRef
          },
          isDragged: this.state.draggedThumbIndex > -1,
          disabled: A,
          children: i(i([], O.map(function(M, I, N) {
            return k({
              props: {
                style: g.props.direction === l.Direction.Left || g.props.direction === l.Direction.Right ? {
                  position: "absolute",
                  left: "".concat(M[0], "px"),
                  marginTop: "".concat(M[1], "px")
                } : {
                  position: "absolute",
                  top: "".concat(M[0], "px"),
                  marginLeft: "".concat(M[1], "px")
                },
                key: "mark".concat(I),
                ref: g.markRefs[I]
              },
              index: I
            });
          }), true), C.map(function(M, I) {
            var N = g.state.draggedThumbIndex === I;
            return b({
              index: I,
              value: M,
              isDragged: N,
              props: {
                style: {
                  position: "absolute",
                  zIndex: z[I],
                  cursor: A ? "inherit" : N ? "grabbing" : "grab",
                  userSelect: "none",
                  touchAction: "none",
                  WebkitUserSelect: "none",
                  MozUserSelect: "none",
                  msUserSelect: "none"
                },
                key: I,
                tabIndex: A ? void 0 : 0,
                "aria-valuemax": T ? S : C[I + 1] || S,
                "aria-valuemin": T ? x : C[I - 1] || x,
                "aria-valuenow": M,
                draggable: false,
                ref: g.thumbRefs[I],
                "aria-label": v,
                "aria-labelledby": y,
                role: "slider",
                onKeyDown: A ? s.voidFn : g.onKeyDown,
                onKeyUp: A ? s.voidFn : g.onKeyUp
              }
            });
          }), true)
        });
      }, f.defaultProps = {
        label: "Accessibility label",
        labelledBy: null,
        step: 1,
        direction: l.Direction.Right,
        rtl: false,
        disabled: false,
        allowOverlap: false,
        draggableTrack: false,
        min: 0,
        max: 100
      }, f;
    })(a.Component);
    return Ds.default = u, Ds;
  }
  var Zq;
  function hRe() {
    return Zq || (Zq = 1, (function(t) {
      var e = V_ && V_.__importDefault || function(a) {
        return a && a.__esModule ? a : {
          default: a
        };
      };
      Object.defineProperty(t, "__esModule", {
        value: true
      }), t.checkValuesAgainstBoundaries = t.relativeValue = t.useThumbOverlap = t.Direction = t.getTrackBackground = t.Range = void 0;
      var n = e(uRe());
      t.Range = n.default;
      var r = Xae();
      Object.defineProperty(t, "getTrackBackground", {
        enumerable: true,
        get: function() {
          return r.getTrackBackground;
        }
      }), Object.defineProperty(t, "useThumbOverlap", {
        enumerable: true,
        get: function() {
          return r.useThumbOverlap;
        }
      }), Object.defineProperty(t, "relativeValue", {
        enumerable: true,
        get: function() {
          return r.relativeValue;
        }
      }), Object.defineProperty(t, "checkValuesAgainstBoundaries", {
        enumerable: true,
        get: function() {
          return r.checkValuesAgainstBoundaries;
        }
      });
      var i = NP();
      Object.defineProperty(t, "Direction", {
        enumerable: true,
        get: function() {
          return i.Direction;
        }
      });
    })(V_)), V_;
  }
  var Jq = hRe();
  const fRe = (t) => {
    const [e, n] = p.useState(false), r = p.useCallback((i) => {
      const a = t();
      a && (i ? a.play() : a.pause());
    }, [
      t
    ]);
    return p.useEffect(() => {
      const i = t(), a = () => {
        i && n(!i.paused);
      };
      return i == null ? void 0 : i.addEventListener("playing", a), i == null ? void 0 : i.addEventListener("play", a), i == null ? void 0 : i.addEventListener("pause", a), () => {
        i == null ? void 0 : i.removeEventListener("playing", a), i == null ? void 0 : i.removeEventListener("play", a), i == null ? void 0 : i.removeEventListener("pause", a);
      };
    }, [
      t
    ]), {
      playing: e,
      setPlaying: r
    };
  }, mRe = (t, e) => {
    p.useEffect(() => {
      const n = t(), r = () => {
        if (!n) return;
        const { duration: i, currentTime: a } = n;
        e(i, Number.isFinite(a) && a >= 0 ? a : 0);
      };
      return n == null ? void 0 : n.addEventListener("timeupdate", r), n == null ? void 0 : n.addEventListener("loadedmetadata", r), n == null ? void 0 : n.addEventListener("ended", r), () => {
        n == null ? void 0 : n.removeEventListener("timeupdate", r), n == null ? void 0 : n.removeEventListener("loadedmetadata", r), n == null ? void 0 : n.removeEventListener("ended", r);
      };
    }, [
      t,
      e
    ]);
  }, gRe = (t) => {
    const [e, n] = p.useState({
      seeking: false,
      seekable: void 0
    }), r = p.useCallback((i) => {
      const a = t();
      a && (a.currentTime = i);
    }, [
      t
    ]);
    return p.useEffect(() => {
      const i = t(), a = () => {
        i && n({
          seeking: i.seeking,
          seekable: i.seekable
        });
      };
      return i == null ? void 0 : i.addEventListener("loadedmetadata", a), i == null ? void 0 : i.addEventListener("seeked", a), i == null ? void 0 : i.addEventListener("seeking", a), () => {
        i == null ? void 0 : i.removeEventListener("loadedmetadata", a), i == null ? void 0 : i.removeEventListener("seeked", a), i == null ? void 0 : i.removeEventListener("seeking", a);
      };
    }, [
      t
    ]), {
      ...e,
      seek: r
    };
  }, pRe = (t) => {
    const [e, n] = p.useState({
      volume: 1,
      mute: false
    }), r = p.useCallback((a) => {
      const s = t();
      s && (s.muted = a);
    }, [
      t
    ]), i = p.useCallback((a) => {
      const s = t();
      s && (s.volume = a);
    }, [
      t
    ]);
    return p.useEffect(() => {
      const a = t(), s = () => {
        a && n({
          mute: a.muted,
          volume: Math.max(0, Math.min(a.volume, 1))
        });
      };
      return a == null ? void 0 : a.addEventListener("volumechange", s), () => {
        a == null ? void 0 : a.removeEventListener("volumechange", s);
      };
    }, [
      t
    ]), {
      ...e,
      setMute: r,
      setVolume: i
    };
  }, FRe = (t) => {
    const [e, n] = p.useState({
      loading: false,
      error: false
    });
    return p.useEffect(() => {
      const r = t(), i = () => {
        n({
          loading: true,
          error: false
        });
      }, a = () => {
        n({
          loading: false,
          error: false
        });
      }, s = () => {
        n({
          loading: false,
          error: true
        });
      };
      return r == null ? void 0 : r.addEventListener("loadstart", i), r == null ? void 0 : r.addEventListener("loadeddata", a), r == null ? void 0 : r.addEventListener("stalled", a), r == null ? void 0 : r.addEventListener("suspend", a), r == null ? void 0 : r.addEventListener("error", s), () => {
        r == null ? void 0 : r.removeEventListener("loadstart", i), r == null ? void 0 : r.removeEventListener("loadeddata", a), r == null ? void 0 : r.removeEventListener("stalled", a), r == null ? void 0 : r.removeEventListener("suspend", a), r == null ? void 0 : r.removeEventListener("error", s);
      };
    }, [
      t
    ]), e;
  };
  var vRe = "media_Image__1tng4ju0 _1mqalmd1 _1mqalmd0", _Re = "media_ImagePixelated__1tng4ju1", yRe = "media_Video__1tng4ju2 _1mqalmd1 _1mqalmd0";
  const as = p.forwardRef(({ className: t, alt: e, ...n }, r) => {
    const [i] = Fe(ge, "pixelatedImageRendering");
    return o.jsx("img", {
      className: gt(vRe, o4e(i) && _Re, t),
      alt: e,
      ...n,
      ref: r
    });
  }), Qae = p.forwardRef(({ className: t, ...e }, n) => o.jsx("video", {
    className: gt(yRe, t),
    ...e,
    ref: n
  })), nE = "mediaVolume";
  function bRe({ onVolumeChange: t, ...e }) {
    const n = p.useRef(null);
    return p.useEffect(() => {
      const r = localStorage.getItem(nE);
      if (n.current && r !== null) {
        const i = parseFloat(r);
        Number.isNaN(i) || (n.current.volume = i);
      }
    }, []), o.jsx(Qae, {
      ...e,
      ref: n,
      onVolumeChange: (r) => {
        localStorage.setItem(nE, String(r.target.volume)), t == null ? void 0 : t(r);
      }
    });
  }
  const ese = ft(({ before: t, after: e, leftControl: n, rightControl: r, children: i, ...a }, s) => o.jsxs(E, {
    grow: "Yes",
    direction: "Column",
    gap: "300",
    ...a,
    ref: s,
    children: [
      t && o.jsx(E, {
        direction: "Column",
        children: t
      }),
      o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          o.jsx(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "Inherit",
            children: n
          }),
          o.jsx(E, {
            justifyItems: "End",
            alignItems: "Center",
            gap: "Inherit",
            children: r
          })
        ]
      }),
      e && o.jsx(E, {
        direction: "Column",
        children: e
      }),
      i
    ]
  })), xRe = {
    wait: 500,
    immediate: true
  };
  function tse({ mimeType: t, url: e, info: n, encInfo: r, renderMediaControl: i }) {
    const a = be(), s = hn(), [l, c] = Et(p.useCallback(async () => {
      const I = Cn(a, e, s);
      if (!I) throw new Error("Invalid media URL");
      const N = r ? await Qf(I, (L) => Xf(L, t, r)) : await Gd(I);
      return URL.createObjectURL(N);
    }, [
      a,
      e,
      s,
      t,
      r
    ])), d = p.useRef(null);
    p.useEffect(() => {
      const I = localStorage.getItem(nE);
      if (d.current && I !== null) {
        const N = parseFloat(I);
        Number.isNaN(N) || (d.current.volume = N);
      }
    }, []);
    const [u, h] = p.useState(0), f = n.duration ?? 0, g = Number.isFinite(f) && f > 0 ? f / 1e3 : 0, [m, v] = p.useState(g), y = p.useCallback(() => d.current, []), { loading: w } = FRe(y), { playing: b, setPlaying: j } = fRe(y), { seek: k } = gRe(y), { volume: C, mute: x, setMute: S, setVolume: T } = pRe(y), A = p.useCallback((I, N) => {
      Number.isFinite(I) && I > 0 && v(I), Number.isFinite(N) && N >= 0 && h(N);
    }, []), B = m > 0 ? m : 1, U = m > 0 ? Math.min(Number.isFinite(u) ? u : 0, m) : 0, z = m > 0 ? m : 0, O = Number.isFinite(u) && u >= 0 ? u : 0;
    mRe(y, sP(A, xRe));
    const M = () => {
      l.status === ve.Success ? j(!b) : l.status !== ve.Loading && c();
    };
    return i({
      after: o.jsx(Jq.Range, {
        step: 1,
        min: 0,
        max: B,
        values: [
          U
        ],
        onChange: (I) => {
          if (!(m > 0)) return;
          const N = I[0] ?? 0;
          Number.isFinite(N) && k(Math.max(0, Math.min(N, m)));
        },
        renderTrack: (I) => {
          const { key: N, ...L } = I.props;
          return o.jsxs("div", {
            ...L,
            children: [
              I.children,
              o.jsx(O1, {
                as: "div",
                variant: "Secondary",
                size: "300",
                min: 0,
                max: B,
                value: U,
                radii: "300"
              })
            ]
          }, N);
        },
        renderThumb: (I) => {
          const { key: N, style: L, ...H } = I.props;
          return o.jsx(Rn, {
            size: "300",
            variant: "Secondary",
            fill: "Solid",
            radii: "Pill",
            outlined: true,
            ...H,
            style: {
              ...L,
              zIndex: 0
            }
          }, String(N));
        }
      }),
      leftControl: o.jsxs(o.Fragment, {
        children: [
          o.jsx(Qe, {
            onClick: M,
            variant: "Secondary",
            radii: "300",
            disabled: l.status === ve.Loading,
            before: l.status === ve.Loading || w ? o.jsx(dt, {
              variant: "Secondary",
              size: "50"
            }) : o.jsx(Q, {
              src: b ? q.Pause : q.Play,
              size: "50",
              filled: b
            }),
            children: o.jsx(D, {
              size: "B300",
              children: b ? "Pause" : "Play"
            })
          }),
          o.jsx(D, {
            size: "T200",
            children: `${VU(O)} / ${VU(z)}`
          })
        ]
      }),
      rightControl: o.jsxs(o.Fragment, {
        children: [
          o.jsx(Oe, {
            variant: "SurfaceVariant",
            size: "300",
            radii: "Pill",
            onClick: () => S(!x),
            "aria-pressed": x,
            children: o.jsx(Q, {
              src: x ? q.VolumeMute : q.VolumeHigh,
              size: "50"
            })
          }),
          o.jsx(Jq.Range, {
            step: 0.1,
            min: 0,
            max: 1,
            values: [
              C
            ],
            onChange: (I) => T(I[0] ?? 1),
            renderTrack: (I) => {
              const { key: N, ...L } = I.props;
              return o.jsxs("div", {
                ...L,
                children: [
                  I.children,
                  o.jsx(O1, {
                    style: {
                      width: He(48)
                    },
                    variant: "Secondary",
                    size: "300",
                    min: 0,
                    max: 1,
                    value: C,
                    radii: "300"
                  })
                ]
              }, N);
            },
            renderThumb: (I) => {
              const { key: N, style: L, ...H } = I.props;
              return o.jsx(Rn, {
                size: "300",
                variant: "Secondary",
                fill: "Solid",
                radii: "Pill",
                outlined: true,
                ...H,
                style: {
                  ...L,
                  zIndex: 0
                }
              }, String(N));
            }
          })
        ]
      }),
      children: o.jsx("audio", {
        controls: false,
        autoPlay: true,
        ref: d,
        onVolumeChange: (I) => {
          localStorage.setItem(nE, String(I.target.volume));
        },
        children: l.status === ve.Success && o.jsx("source", {
          src: l.data,
          type: t
        })
      })
    });
  }
  var VD = {
    exports: {}
  }, wRe = VD.exports, Xq;
  function DRe() {
    return Xq || (Xq = 1, (function(t, e) {
      (function(n, r) {
        r();
      })(wRe, function() {
        function n(d, u) {
          return typeof u > "u" ? u = {
            autoBom: false
          } : typeof u != "object" && (console.warn("Deprecated: Expected third argument to be a object"), u = {
            autoBom: !u
          }), u.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type) ? new Blob([
            "\uFEFF",
            d
          ], {
            type: d.type
          }) : d;
        }
        function r(d, u, h) {
          var f = new XMLHttpRequest();
          f.open("GET", d), f.responseType = "blob", f.onload = function() {
            c(f.response, u, h);
          }, f.onerror = function() {
            console.error("could not download file");
          }, f.send();
        }
        function i(d) {
          var u = new XMLHttpRequest();
          u.open("HEAD", d, false);
          try {
            u.send();
          } catch {
          }
          return 200 <= u.status && 299 >= u.status;
        }
        function a(d) {
          try {
            d.dispatchEvent(new MouseEvent("click"));
          } catch {
            var u = document.createEvent("MouseEvents");
            u.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), d.dispatchEvent(u);
          }
        }
        var s = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof sl == "object" && sl.global === sl ? sl : void 0, l = s.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), c = s.saveAs || (typeof window != "object" || window !== s ? function() {
        } : "download" in HTMLAnchorElement.prototype && !l ? function(d, u, h) {
          var f = s.URL || s.webkitURL, g = document.createElement("a");
          u = u || d.name || "download", g.download = u, g.rel = "noopener", typeof d == "string" ? (g.href = d, g.origin === location.origin ? a(g) : i(g.href) ? r(d, u, h) : a(g, g.target = "_blank")) : (g.href = f.createObjectURL(d), setTimeout(function() {
            f.revokeObjectURL(g.href);
          }, 4e4), setTimeout(function() {
            a(g);
          }, 0));
        } : "msSaveOrOpenBlob" in navigator ? function(d, u, h) {
          if (u = u || d.name || "download", typeof d != "string") navigator.msSaveOrOpenBlob(n(d, h), u);
          else if (i(d)) r(d, u, h);
          else {
            var f = document.createElement("a");
            f.href = d, f.target = "_blank", setTimeout(function() {
              a(f);
            });
          }
        } : function(d, u, h, f) {
          if (f = f || open("", "_blank"), f && (f.document.title = f.document.body.innerText = "downloading..."), typeof d == "string") return r(d, u, h);
          var g = d.type === "application/octet-stream", m = /constructor/i.test(s.HTMLElement) || s.safari, v = /CriOS\/[\d]+/.test(navigator.userAgent);
          if ((v || g && m || l) && typeof FileReader < "u") {
            var y = new FileReader();
            y.onloadend = function() {
              var j = y.result;
              j = v ? j : j.replace(/^data:[^;]*;/, "data:attachment/file;"), f ? f.location.href = j : location = j, f = null;
            }, y.readAsDataURL(d);
          } else {
            var w = s.URL || s.webkitURL, b = w.createObjectURL(d);
            f ? f.location = b : location.href = b, f = null, setTimeout(function() {
              w.revokeObjectURL(b);
            }, 4e4);
          }
        });
        s.saveAs = c.saveAs = c, t.exports = c;
      });
    })(VD)), VD.exports;
  }
  var CRe = DRe();
  const ap = da(CRe), zP = (t, e) => o.jsx(ar, {
    tooltip: o.jsx(pr, {
      variant: "Critical",
      children: o.jsx(D, {
        children: "Failed to load file!"
      })
    }),
    position: "Top",
    align: "Center",
    children: (n) => o.jsx(xe, {
      ref: n,
      size: "400",
      variant: "Critical",
      fill: "Soft",
      outlined: true,
      radii: "300",
      onClick: t,
      before: o.jsx(Q, {
        size: "100",
        src: q.Warning,
        filled: true
      }),
      children: o.jsx(D, {
        size: "B400",
        truncate: true,
        children: e
      })
    })
  });
  function ERe({ body: t, mimeType: e, url: n, encInfo: r, renderViewer: i }) {
    const a = be(), s = hn(), [l, c] = p.useState(false), [d, u] = Et(p.useCallback(async () => {
      const h = Cn(a, n, s);
      if (!h) throw new Error("Invalid media URL");
      const g = (r ? await Qf(h, (m) => Xf(m, e, r)) : await Gd(h)).text();
      return c(true), g;
    }, [
      a,
      s,
      e,
      r,
      n
    ]));
    return o.jsxs(o.Fragment, {
      children: [
        d.status === ve.Success && o.jsx(Hn, {
          open: l,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => c(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                className: OF,
                size: "500",
                onContextMenu: (h) => h.stopPropagation(),
                children: i({
                  name: t,
                  text: d.data,
                  langName: Uae.includes(e) ? aI(e) : aI(Vae[Hae(t)] ?? e),
                  requestClose: () => c(false)
                })
              })
            })
          })
        }),
        d.status === ve.Error ? zP(u, "Open File") : o.jsx(xe, {
          variant: "Secondary",
          fill: "Solid",
          radii: "300",
          size: "400",
          onClick: () => d.status === ve.Success ? c(true) : u(),
          disabled: d.status === ve.Loading,
          before: d.status === ve.Loading ? o.jsx(dt, {
            fill: "Solid",
            size: "100",
            variant: "Secondary"
          }) : o.jsx(Q, {
            size: "100",
            src: q.ArrowRight,
            filled: true
          }),
          children: o.jsx(D, {
            size: "B400",
            truncate: true,
            children: "Open File"
          })
        })
      ]
    });
  }
  function kRe({ body: t, mimeType: e, url: n, encInfo: r, renderViewer: i }) {
    const a = be(), s = hn(), [l, c] = p.useState(false), [d, u] = Et(p.useCallback(async () => {
      const h = Cn(a, n, s);
      if (!h) throw new Error("Invalid media URL");
      const f = r ? await Qf(h, (g) => Xf(g, e, r)) : await Gd(h);
      return c(true), URL.createObjectURL(f);
    }, [
      a,
      n,
      s,
      e,
      r
    ]));
    return o.jsxs(o.Fragment, {
      children: [
        d.status === ve.Success && o.jsx(Hn, {
          open: l,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => c(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                className: OF,
                size: "500",
                onContextMenu: (h) => h.stopPropagation(),
                children: i({
                  name: t,
                  src: d.data,
                  requestClose: () => c(false)
                })
              })
            })
          })
        }),
        d.status === ve.Error ? zP(u, "Open PDF") : o.jsx(xe, {
          variant: "Secondary",
          fill: "Solid",
          radii: "300",
          size: "400",
          onClick: () => d.status === ve.Success ? c(true) : u(),
          disabled: d.status === ve.Loading,
          before: d.status === ve.Loading ? o.jsx(dt, {
            fill: "Solid",
            size: "100",
            variant: "Secondary"
          }) : o.jsx(Q, {
            size: "100",
            src: q.ArrowRight,
            filled: true
          }),
          children: o.jsx(D, {
            size: "B400",
            truncate: true,
            children: "Open PDF"
          })
        })
      ]
    });
  }
  function SRe({ body: t, mimeType: e, url: n, info: r, encInfo: i }) {
    const a = be(), s = hn(), [l, c] = Et(p.useCallback(async () => {
      const d = Cn(a, n, s);
      if (!d) throw new Error("Invalid media URL");
      const u = i ? await Qf(d, (f) => Xf(f, e, i)) : await Gd(d), h = URL.createObjectURL(u);
      return ap.saveAs(h, t), h;
    }, [
      a,
      n,
      s,
      e,
      i,
      t
    ]));
    return l.status === ve.Error ? zP(c, `Retry Download (${Wl(r.size ?? 0)})`) : o.jsx(xe, {
      variant: "Secondary",
      fill: "Soft",
      radii: "300",
      size: "400",
      onClick: () => l.status === ve.Success ? ap.saveAs(l.data, t) : c(),
      disabled: l.status === ve.Loading,
      before: l.status === ve.Loading ? o.jsx(dt, {
        fill: "Soft",
        size: "100",
        variant: "Secondary"
      }) : o.jsx(Q, {
        size: "100",
        src: q.Download,
        filled: true
      }),
      children: o.jsx(D, {
        size: "B400",
        truncate: true,
        children: `Download (${Wl(r.size ?? 0)})`
      })
    });
  }
  const jRe = ft(({ body: t, mimeType: e, renderAsTextFile: n, renderAsPdfFile: r, children: i, ...a }, s) => o.jsxs(E, {
    direction: "Column",
    gap: "300",
    ...a,
    ref: s,
    children: [
      (Uae.includes(e) || Vae[Hae(t)]) && n(),
      e === "application/pdf" && r(),
      i
    ]
  })), Kk = {
    color: ct.Warning.Main,
    opacity: ee.opacity.P300
  }, Gk = {
    color: ct.Critical.Main,
    opacity: ee.opacity.P300
  }, rE = ft(({ reason: t, ...e }, n) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    gap: "100",
    style: Kk,
    ...e,
    ref: n,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Delete
      }),
      t ? o.jsxs("i", {
        children: [
          "This message has been deleted. ",
          t
        ]
      }) : o.jsx("i", {
        children: "This message has been deleted"
      })
    ]
  })), lF = ft(({ body: t, ...e }, n) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    direction: "Row",
    gap: "100",
    style: Gk,
    ...e,
    ref: n,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Warning
      }),
      o.jsxs("span", {
        className: Pi,
        style: {
          flex: "1 1 auto",
          minWidth: 0
        },
        children: [
          o.jsx("i", {
            children: "Unsupported message"
          }),
          t && `: ${t}`,
          !t && " (no body)"
        ]
      })
    ]
  })), TRe = ft(({ ...t }, e) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    gap: "100",
    style: Gk,
    ...t,
    ref: e,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Warning
      }),
      o.jsx("i", {
        children: "Failed to load message"
      })
    ]
  })), nse = ft(({ ...t }, e) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    gap: "100",
    style: Kk,
    ...t,
    ref: e,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Lock
      }),
      o.jsx("i", {
        children: "Unable to decrypt message"
      })
    ]
  })), UP = ft(({ ...t }, e) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    gap: "100",
    style: Kk,
    ...t,
    ref: e,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Lock
      }),
      o.jsx("i", {
        children: "This message is not decrypted yet"
      })
    ]
  })), rse = ft(({ body: t, ...e }, n) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    direction: "Row",
    gap: "100",
    style: Gk,
    ...e,
    ref: n,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Warning
      }),
      o.jsxs("span", {
        className: Pi,
        style: {
          flex: "1 1 auto",
          minWidth: 0
        },
        children: [
          o.jsx("i", {
            children: "Broken message"
          }),
          t && `: ${t}`,
          !t && " (no body)"
        ]
      })
    ]
  })), ise = ft(({ ...t }, e) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    gap: "100",
    style: Gk,
    ...t,
    ref: e,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Warning
      }),
      o.jsx("i", {
        children: "Empty message"
      })
    ]
  })), RRe = ft(({ ...t }, e) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    gap: "100",
    style: Kk,
    ...t,
    ref: e,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Cross
      }),
      o.jsx("i", {
        children: "Message from a blocked user"
      })
    ]
  })), t2 = ft(({ ...t }, e) => o.jsx(D, {
    as: "span",
    size: "T200",
    priority: "300",
    ...t,
    ref: e,
    children: " (edited)"
  }));
  function Kh({ messageLayout: t, time: e, iconSrc: n, content: r }) {
    const i = o.jsxs(E, {
      gap: "300",
      justifyContent: "SpaceBetween",
      alignItems: "Center",
      grow: "Yes",
      children: [
        t === Mr.Compact && e,
        o.jsx(E, {
          grow: t === Mr.Compact ? void 0 : "Yes",
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(Q, {
            style: {
              opacity: 0.6
            },
            size: "50",
            src: n
          })
        })
      ]
    }), a = o.jsxs(E, {
      justifyContent: "SpaceBetween",
      alignItems: "Baseline",
      gap: "200",
      children: [
        r,
        t !== Mr.Compact && e
      ]
    });
    return t === Mr.Compact ? o.jsx(bP, {
      before: i,
      children: a
    }) : t === Mr.Bubble ? o.jsx(Boe, {
      hideBubble: true,
      before: i,
      children: a
    }) : o.jsx(Cp, {
      before: i,
      children: a
    });
  }
  var ARe = "Reply_ThreadIndicator__1ew384n1", IRe = "Reply_Reply__1ew384n2", BRe = "Reply_ReplyContent__1ew384n3";
  const PRe = /* @__PURE__ */ new Set([
    ce.RoomMessage,
    ce.RoomMessageEncrypted,
    ce.Sticker
  ]), a5 = (t) => {
    if (typeof t != "string") return;
    const e = t.trim();
    return e.length > 0 ? e : void 0;
  }, MRe = /<img\b[^>]*\bdata-mx-emoticon\b/i, ORe = (t) => t.replaceAll(/<br\s*\/?>/gi, " ").replaceAll(/<[^>]+>/g, "").replaceAll(/\s+/g, " ").trim(), LRe = (t) => ORe(t) !== "" || MRe.test(t), NRe = (t, e, n) => {
    if (!t || !PRe.has(t)) return;
    if (n) return o.jsx(rE, {});
    if (t === ce.Sticker) {
      const c = a5(e.body);
      return c ? rF(c) : "Sticker";
    }
    const r = e.msgtype;
    if (typeof r != "string") return o.jsx(lF, {});
    const i = r, a = a5(typeof e.body == "string" ? Zg(e.body) : ""), s = a5(e.filename);
    if (a) return;
    const l = s;
    switch (i) {
      case Jn.Image:
        return l ?? "Image";
      case Jn.Video:
        return l ?? "Video";
      case Jn.Audio:
        return l ?? "Audio";
      case Jn.File:
        return l ?? "Attachment";
      case Jn.Location:
        return "Location";
      case Jn.Text:
      case Jn.Emote:
      case Jn.Notice:
        return o.jsx(ise, {});
      default:
        return o.jsx(lF, {});
    }
  }, zRe = ft(({ username: t, userColor: e, icon: n, className: r, mentioned: i, children: a, replyIcon: s, ...l }, c) => o.jsxs(E, {
    className: gt(IRe, r),
    alignItems: "Center",
    gap: "100",
    ...l,
    ref: c,
    children: [
      o.jsx(E, {
        style: {
          color: e
        },
        alignItems: "Center",
        shrink: "No",
        children: s || o.jsx(Q, {
          size: "100",
          src: q.ReplyArrow
        })
      }),
      !!n && o.jsx(Q, {
        style: {
          opacity: 0.6
        },
        size: "50",
        src: n
      }),
      o.jsxs(E, {
        style: {
          color: e,
          maxWidth: He(200)
        },
        alignItems: "Center",
        shrink: "No",
        children: [
          i && o.jsx(Q, {
            size: "100",
            src: q.Mention
          }),
          t
        ]
      }),
      o.jsx(E, {
        grow: "Yes",
        className: BRe,
        children: a
      })
    ]
  })), ose = ft(({ ...t }, e) => o.jsxs(E, {
    shrink: "No",
    className: ARe,
    alignItems: "Center",
    gap: "100",
    ...t,
    ref: e,
    children: [
      o.jsx(Q, {
        size: "50",
        src: q.Thread
      }),
      o.jsx(D, {
        size: "L400",
        children: "Thread"
      })
    ]
  })), URe = (t) => {
    const e = Lk(t);
    return sie(e).replaceAll(/<br\s*\/?>/gi, " ").replaceAll(/<\/p>\s*<p[^>]*>/gi, " ").replaceAll(/<\/?p[^>]*>/gi, "").replaceAll(/<\/li>\s*<li[^>]*>/gi, " ").replaceAll(/<\/?(ul|ol|li|blockquote|h[1-6]|pre|div)[^>]*>/gi, "").replaceAll(/(?:\r\n|\r|\n)/g, " ");
  }, Pu = ft(({ room: t, timelineSet: e, replyEventId: n, threadRootId: r, mentions: i, onClick: a, replyIcon: s, ...l }, c) => {
    var _a6;
    const d = p.useMemo(() => i1(40, 400), []), u = p.useCallback(() => e == null ? void 0 : e.findEventById(n), [
      e,
      n
    ]), h = Koe(t, n, u), f = Ub(), g = be(), { body: m, formatted_body: v, format: y } = (h == null ? void 0 : h.getContent()) ?? {}, w = h == null ? void 0 : h.getSender(), b = h == null ? void 0 : h.getType(), j = kp(), k = !!w && j.includes(w), { t: C } = Nae(), x = (h == null ? void 0 : h.isRedacted()) === true, S = IP(), { color: T, font: A } = rm(w ?? "", t), B = Ze(qr), U = hn(), z = gs(), [O] = Fe(ge, "incomingInlineImagesDefaultHeight"), [M] = Fe(ge, "incomingInlineImagesMaxHeight"), I = x ? o.jsx(rE, {}) : o.jsx(TRe, {}), N = (h == null ? void 0 : h.getContent().msgtype) === "m.bad.encrypted", L = om(t.roomId), H = y === "org.matrix.custom.html" && typeof v == "string", V = typeof m == "string" && m !== "", Z = h != null && h.isEncrypted() && !h.isDecryptionFailure() && !h.getClearContent();
    let Y = I, oe, ue = w != null && (((_a6 = i == null ? void 0 : i.user_ids) == null ? void 0 : _a6.includes(w)) ?? false);
    const ie = p.useMemo(() => ({
      ...fs,
      render: em(z, (ne) => _h(g, t.roomId, ne, Jd(L), B), L)
    }), [
      g,
      t.roomId,
      L,
      B,
      z
    ]);
    if (H && v !== "") {
      const ne = URe(v);
      if (LRe(ne)) {
        const ae = Ql(g, t.roomId, {
          settingsLinkBaseUrl: z,
          linkifyOpts: ie,
          useAuthentication: U,
          nicknames: B,
          handleMentionClick: L,
          incomingInlineImagesDefaultHeight: O,
          incomingInlineImagesMaxHeight: M
        });
        Y = Zd(ne, ae);
      } else if (V) {
        const ae = Zg(m).replaceAll(/(?:\r\n|\r|\n)/g, " ");
        Y = rF(ae);
      }
    } else if (V) {
      const ne = Zg(m).replaceAll(/(?:\r\n|\r|\n)/g, " ");
      Y = rF(ne);
    } else if (b === ce.RoomMember && h) {
      const ne = S(h);
      oe = ne.icon, ue = false, Y = o.jsxs(E, {
        direction: "Row",
        style: {
          columnGap: He(6)
        },
        children: [
          " ",
          ne.body,
          " "
        ]
      });
    } else if (b === ce.RoomName) oe = q.Hash, Y = C("Organisms.RoomCommon.changed_room_name");
    else if (b === ce.RoomTopic) oe = q.Hash, Y = " changed room topic";
    else if (b === ce.RoomAvatar) oe = q.Hash, Y = " changed room avatar";
    else if (b === ce.GroupCallMemberPrefix && h) {
      const ne = h.getContent().application;
      oe = ne ? q.Phone : q.PhoneDown, Y = ne ? " joined the call" : " ended the call";
    } else if (b === ce.RoomPinnedEvents && h) {
      const { pinned: ne } = h.getContent(), ae = h.getPrevContent().pinned, X = ae && ne && ne.filter((G) => !ae.includes(G)), K = ae && ne && ae.filter((G) => !ne.includes(G));
      oe = q.Pin, Y = o.jsxs(o.Fragment, {
        children: [
          (X == null ? void 0 : X.length) > 0 && `pinned ${X.length} message${X.length > 1 ? "s" : ""}` || "",
          (X == null ? void 0 : X.length) > 0 && (K == null ? void 0 : K.length) > 0 && " and " || "",
          (K == null ? void 0 : K.length) > 0 && `unpinned ${K.length} message${K.length > 1 ? "s" : ""}` || "",
          (!X || X.length <= 0) && (!K || K.length <= 0) && "has not changed the pins"
        ]
      });
    } else if (h && b) {
      const ne = NRe(b, h.getContent(), x);
      ne !== void 0 ? Y = ne : h.isState() ? (oe = q.Code, Y = o.jsxs(o.Fragment, {
        children: [
          " sent ",
          o.jsx("code", {
            className: nh,
            children: b
          }),
          " state event"
        ]
      })) : Y = o.jsx(lF, {});
    }
    let de = Y;
    return k ? de = o.jsx(RRe, {}) : N && (de = o.jsx(nse, {})), o.jsxs(E, {
      direction: "Row",
      gap: "200",
      alignItems: "Center",
      ...l,
      ref: c,
      children: [
        r && o.jsx(ose, {
          as: "button",
          "data-event-id": r,
          onClick: a
        }),
        o.jsx(zRe, {
          as: "button",
          userColor: T,
          icon: oe,
          replyIcon: s,
          mentioned: ue,
          username: w && b !== ce.RoomMember && o.jsx(D, {
            size: "T300",
            truncate: true,
            style: {
              fontFamily: A
            },
            children: o.jsx("b", {
              children: gr(t, w, B) ?? _n(w)
            })
          }),
          "data-event-id": n,
          onClick: h !== null && !k ? a : void 0,
          children: h !== void 0 && !Z ? o.jsx(D, {
            size: "T300",
            truncate: true,
            style: {
              unicodeBidi: "plaintext"
            },
            children: de
          }) : x && o.jsx(rE, {}) || o.jsx(_f, {
            style: {
              backgroundColor: ct.SurfaceVariant.ContainerActive,
              width: He(d),
              maxWidth: "100%"
            }
          })
        }),
        h === null && o.jsx(Qe, {
          variant: "Critical",
          radii: "Pill",
          before: o.jsx(Q, {
            size: "50",
            src: q.Reload
          }),
          onClick: (ne) => {
            ne.stopPropagation(), f.invalidateQueries({
              queryKey: [
                t.roomId,
                n
              ]
            });
          }
        })
      ]
    });
  });
  var HD = {
    exports: {}
  }, VRe = HD.exports, Qq;
  function HRe() {
    return Qq || (Qq = 1, (function(t, e) {
      (function(n, r) {
        t.exports = r();
      })(VRe, (function() {
        var n = 1e3, r = 6e4, i = 36e5, a = "millisecond", s = "second", l = "minute", c = "hour", d = "day", u = "week", h = "month", f = "quarter", g = "year", m = "date", v = "Invalid Date", y = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, w = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, b = {
          name: "en",
          weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
          months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
          ordinal: function(M) {
            var I = [
              "th",
              "st",
              "nd",
              "rd"
            ], N = M % 100;
            return "[" + M + (I[(N - 20) % 10] || I[N] || I[0]) + "]";
          }
        }, j = function(M, I, N) {
          var L = String(M);
          return !L || L.length >= I ? M : "" + Array(I + 1 - L.length).join(N) + M;
        }, k = {
          s: j,
          z: function(M) {
            var I = -M.utcOffset(), N = Math.abs(I), L = Math.floor(N / 60), H = N % 60;
            return (I <= 0 ? "+" : "-") + j(L, 2, "0") + ":" + j(H, 2, "0");
          },
          m: function M(I, N) {
            if (I.date() < N.date()) return -M(N, I);
            var L = 12 * (N.year() - I.year()) + (N.month() - I.month()), H = I.clone().add(L, h), V = N - H < 0, Z = I.clone().add(L + (V ? -1 : 1), h);
            return +(-(L + (N - H) / (V ? H - Z : Z - H)) || 0);
          },
          a: function(M) {
            return M < 0 ? Math.ceil(M) || 0 : Math.floor(M);
          },
          p: function(M) {
            return {
              M: h,
              y: g,
              w: u,
              d,
              D: m,
              h: c,
              m: l,
              s,
              ms: a,
              Q: f
            }[M] || String(M || "").toLowerCase().replace(/s$/, "");
          },
          u: function(M) {
            return M === void 0;
          }
        }, C = "en", x = {};
        x[C] = b;
        var S = "$isDayjsObject", T = function(M) {
          return M instanceof z || !(!M || !M[S]);
        }, A = function M(I, N, L) {
          var H;
          if (!I) return C;
          if (typeof I == "string") {
            var V = I.toLowerCase();
            x[V] && (H = V), N && (x[V] = N, H = V);
            var Z = I.split("-");
            if (!H && Z.length > 1) return M(Z[0]);
          } else {
            var Y = I.name;
            x[Y] = I, H = Y;
          }
          return !L && H && (C = H), H || !L && C;
        }, B = function(M, I) {
          if (T(M)) return M.clone();
          var N = typeof I == "object" ? I : {};
          return N.date = M, N.args = arguments, new z(N);
        }, U = k;
        U.l = A, U.i = T, U.w = function(M, I) {
          return B(M, {
            locale: I.$L,
            utc: I.$u,
            x: I.$x,
            $offset: I.$offset
          });
        };
        var z = (function() {
          function M(N) {
            this.$L = A(N.locale, null, true), this.parse(N), this.$x = this.$x || N.x || {}, this[S] = true;
          }
          var I = M.prototype;
          return I.parse = function(N) {
            this.$d = (function(L) {
              var H = L.date, V = L.utc;
              if (H === null) return /* @__PURE__ */ new Date(NaN);
              if (U.u(H)) return /* @__PURE__ */ new Date();
              if (H instanceof Date) return new Date(H);
              if (typeof H == "string" && !/Z$/i.test(H)) {
                var Z = H.match(y);
                if (Z) {
                  var Y = Z[2] - 1 || 0, oe = (Z[7] || "0").substring(0, 3);
                  return V ? new Date(Date.UTC(Z[1], Y, Z[3] || 1, Z[4] || 0, Z[5] || 0, Z[6] || 0, oe)) : new Date(Z[1], Y, Z[3] || 1, Z[4] || 0, Z[5] || 0, Z[6] || 0, oe);
                }
              }
              return new Date(H);
            })(N), this.init();
          }, I.init = function() {
            var N = this.$d;
            this.$y = N.getFullYear(), this.$M = N.getMonth(), this.$D = N.getDate(), this.$W = N.getDay(), this.$H = N.getHours(), this.$m = N.getMinutes(), this.$s = N.getSeconds(), this.$ms = N.getMilliseconds();
          }, I.$utils = function() {
            return U;
          }, I.isValid = function() {
            return this.$d.toString() !== v;
          }, I.isSame = function(N, L) {
            var H = B(N);
            return this.startOf(L) <= H && H <= this.endOf(L);
          }, I.isAfter = function(N, L) {
            return B(N) < this.startOf(L);
          }, I.isBefore = function(N, L) {
            return this.endOf(L) < B(N);
          }, I.$g = function(N, L, H) {
            return U.u(N) ? this[L] : this.set(H, N);
          }, I.unix = function() {
            return Math.floor(this.valueOf() / 1e3);
          }, I.valueOf = function() {
            return this.$d.getTime();
          }, I.startOf = function(N, L) {
            var H = this, V = !!U.u(L) || L, Z = U.p(N), Y = function(K, G) {
              var le = U.w(H.$u ? Date.UTC(H.$y, G, K) : new Date(H.$y, G, K), H);
              return V ? le : le.endOf(d);
            }, oe = function(K, G) {
              return U.w(H.toDate()[K].apply(H.toDate("s"), (V ? [
                0,
                0,
                0,
                0
              ] : [
                23,
                59,
                59,
                999
              ]).slice(G)), H);
            }, ue = this.$W, ie = this.$M, de = this.$D, ne = "set" + (this.$u ? "UTC" : "");
            switch (Z) {
              case g:
                return V ? Y(1, 0) : Y(31, 11);
              case h:
                return V ? Y(1, ie) : Y(0, ie + 1);
              case u:
                var ae = this.$locale().weekStart || 0, X = (ue < ae ? ue + 7 : ue) - ae;
                return Y(V ? de - X : de + (6 - X), ie);
              case d:
              case m:
                return oe(ne + "Hours", 0);
              case c:
                return oe(ne + "Minutes", 1);
              case l:
                return oe(ne + "Seconds", 2);
              case s:
                return oe(ne + "Milliseconds", 3);
              default:
                return this.clone();
            }
          }, I.endOf = function(N) {
            return this.startOf(N, false);
          }, I.$set = function(N, L) {
            var H, V = U.p(N), Z = "set" + (this.$u ? "UTC" : ""), Y = (H = {}, H[d] = Z + "Date", H[m] = Z + "Date", H[h] = Z + "Month", H[g] = Z + "FullYear", H[c] = Z + "Hours", H[l] = Z + "Minutes", H[s] = Z + "Seconds", H[a] = Z + "Milliseconds", H)[V], oe = V === d ? this.$D + (L - this.$W) : L;
            if (V === h || V === g) {
              var ue = this.clone().set(m, 1);
              ue.$d[Y](oe), ue.init(), this.$d = ue.set(m, Math.min(this.$D, ue.daysInMonth())).$d;
            } else Y && this.$d[Y](oe);
            return this.init(), this;
          }, I.set = function(N, L) {
            return this.clone().$set(N, L);
          }, I.get = function(N) {
            return this[U.p(N)]();
          }, I.add = function(N, L) {
            var H, V = this;
            N = Number(N);
            var Z = U.p(L), Y = function(ie) {
              var de = B(V);
              return U.w(de.date(de.date() + Math.round(ie * N)), V);
            };
            if (Z === h) return this.set(h, this.$M + N);
            if (Z === g) return this.set(g, this.$y + N);
            if (Z === d) return Y(1);
            if (Z === u) return Y(7);
            var oe = (H = {}, H[l] = r, H[c] = i, H[s] = n, H)[Z] || 1, ue = this.$d.getTime() + N * oe;
            return U.w(ue, this);
          }, I.subtract = function(N, L) {
            return this.add(-1 * N, L);
          }, I.format = function(N) {
            var L = this, H = this.$locale();
            if (!this.isValid()) return H.invalidDate || v;
            var V = N || "YYYY-MM-DDTHH:mm:ssZ", Z = U.z(this), Y = this.$H, oe = this.$m, ue = this.$M, ie = H.weekdays, de = H.months, ne = H.meridiem, ae = function(G, le, te, re) {
              return G && (G[le] || G(L, V)) || te[le].slice(0, re);
            }, X = function(G) {
              return U.s(Y % 12 || 12, G, "0");
            }, K = ne || function(G, le, te) {
              var re = G < 12 ? "AM" : "PM";
              return te ? re.toLowerCase() : re;
            };
            return V.replace(w, (function(G, le) {
              return le || (function(te) {
                switch (te) {
                  case "YY":
                    return String(L.$y).slice(-2);
                  case "YYYY":
                    return U.s(L.$y, 4, "0");
                  case "M":
                    return ue + 1;
                  case "MM":
                    return U.s(ue + 1, 2, "0");
                  case "MMM":
                    return ae(H.monthsShort, ue, de, 3);
                  case "MMMM":
                    return ae(de, ue);
                  case "D":
                    return L.$D;
                  case "DD":
                    return U.s(L.$D, 2, "0");
                  case "d":
                    return String(L.$W);
                  case "dd":
                    return ae(H.weekdaysMin, L.$W, ie, 2);
                  case "ddd":
                    return ae(H.weekdaysShort, L.$W, ie, 3);
                  case "dddd":
                    return ie[L.$W];
                  case "H":
                    return String(Y);
                  case "HH":
                    return U.s(Y, 2, "0");
                  case "h":
                    return X(1);
                  case "hh":
                    return X(2);
                  case "a":
                    return K(Y, oe, true);
                  case "A":
                    return K(Y, oe, false);
                  case "m":
                    return String(oe);
                  case "mm":
                    return U.s(oe, 2, "0");
                  case "s":
                    return String(L.$s);
                  case "ss":
                    return U.s(L.$s, 2, "0");
                  case "SSS":
                    return U.s(L.$ms, 3, "0");
                  case "Z":
                    return Z;
                }
                return null;
              })(G) || Z.replace(":", "");
            }));
          }, I.utcOffset = function() {
            return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
          }, I.diff = function(N, L, H) {
            var V, Z = this, Y = U.p(L), oe = B(N), ue = (oe.utcOffset() - this.utcOffset()) * r, ie = this - oe, de = function() {
              return U.m(Z, oe);
            };
            switch (Y) {
              case g:
                V = de() / 12;
                break;
              case h:
                V = de();
                break;
              case f:
                V = de() / 3;
                break;
              case u:
                V = (ie - ue) / 6048e5;
                break;
              case d:
                V = (ie - ue) / 864e5;
                break;
              case c:
                V = ie / i;
                break;
              case l:
                V = ie / r;
                break;
              case s:
                V = ie / n;
                break;
              default:
                V = ie;
            }
            return H ? V : U.a(V);
          }, I.daysInMonth = function() {
            return this.endOf(h).$D;
          }, I.$locale = function() {
            return x[this.$L];
          }, I.locale = function(N, L) {
            if (!N) return this.$L;
            var H = this.clone(), V = A(N, L, true);
            return V && (H.$L = V), H;
          }, I.clone = function() {
            return U.w(this.$d, this);
          }, I.toDate = function() {
            return new Date(this.valueOf());
          }, I.toJSON = function() {
            return this.isValid() ? this.toISOString() : null;
          }, I.toISOString = function() {
            return this.$d.toISOString();
          }, I.toString = function() {
            return this.$d.toUTCString();
          }, M;
        })(), O = z.prototype;
        return B.prototype = O, [
          [
            "$ms",
            a
          ],
          [
            "$s",
            s
          ],
          [
            "$m",
            l
          ],
          [
            "$H",
            c
          ],
          [
            "$W",
            d
          ],
          [
            "$M",
            h
          ],
          [
            "$y",
            g
          ],
          [
            "$D",
            m
          ]
        ].forEach((function(M) {
          O[M[1]] = function(I) {
            return this.$g(I, M[0], M[1]);
          };
        })), B.extend = function(M, I) {
          return M.$i || (M(I, z, B), M.$i = true), B;
        }, B.locale = A, B.isDayjs = T, B.unix = function(M) {
          return B(1e3 * M);
        }, B.en = x[C], B.Ls = x, B.p = {}, B;
      }));
    })(HD)), HD.exports;
  }
  var $Re = HRe();
  const ti = da($Re);
  var $D = {
    exports: {}
  }, WRe = $D.exports, eK;
  function qRe() {
    return eK || (eK = 1, (function(t, e) {
      (function(n, r) {
        t.exports = r();
      })(WRe, (function() {
        return function(n, r, i) {
          r.prototype.isToday = function() {
            var a = "YYYY-MM-DD", s = i();
            return this.format(a) === s.format(a);
          };
        };
      }));
    })($D)), $D.exports;
  }
  var KRe = qRe();
  const GRe = da(KRe);
  var WD = {
    exports: {}
  }, YRe = WD.exports, tK;
  function ZRe() {
    return tK || (tK = 1, (function(t, e) {
      (function(n, r) {
        t.exports = r();
      })(YRe, (function() {
        return function(n, r, i) {
          r.prototype.isYesterday = function() {
            var a = "YYYY-MM-DD", s = i().subtract(1, "day");
            return this.format(a) === s.format(a);
          };
        };
      }));
    })(WD)), WD.exports;
  }
  var JRe = ZRe();
  const XRe = da(JRe);
  ti.extend(GRe);
  ti.extend(XRe);
  const iE = (t) => ti(t).isToday(), oE = (t) => ti(t).isYesterday(), eu = (t, e) => ti(t).format(e ? "HH:mm" : "hh:mm A"), QRe = (t, e) => ti(t).format(e ? "HH:mm:ss" : "hh:mm:ss A"), cF = (t, e) => ti(t).format(e), qF = (t) => ti(t).format("D MMMM YYYY"), nK = (t, e) => ti(`${e}-${t}-1`).daysInMonth(), aE = (t, e, n) => ti(`${t}-${e}-${n}`).valueOf(), dI = (t, e) => {
    const n = new Date(t), r = new Date(e);
    return r.getFullYear() === n.getFullYear() && r.getMonth() === n.getMonth() && r.getDate() === n.getDate();
  }, eAe = (t, e) => {
    const n = new Date(t), r = new Date(e), i = Math.abs(r.getTime() - n.getTime());
    return Math.floor(i / 1e3 / 60);
  }, tAe = (t) => {
    const e = t % 12;
    return e === 0 ? 12 : e;
  }, Cw = (t, e) => t === 12 ? e ? 12 : 0 : e ? t + 12 : t, nAe = (t) => t * 1e3, uI = (t) => t * nAe(60), yf = (t) => t * uI(60), dF = (t) => t * yf(24), rAe = () => {
    const t = Date.now(), e = ti(t);
    return aE(e.year(), e.month() + 1, e.date());
  }, iAe = () => {
    const t = Date.now() - dF(1), e = ti(t);
    return aE(e.year(), e.month() + 1, e.date());
  }, Ma = ft(({ compact: t, hour24Clock: e, dateFormatString: n, ts: r, ...i }) => {
    const a = eu(r, e);
    let s = "";
    return t || iE(r) ? s = a : oE(r) ? s = `Yesterday ${a}` : s = `${cF(r, n)} ${a}`, o.jsx(ar, {
      delay: 400,
      position: "Top",
      style: {
        textAlign: "center"
      },
      tooltip: o.jsx(pr, {
        children: o.jsxs(D, {
          size: "H5",
          children: [
            cF(r, n),
            o.jsx("br", {}),
            QRe(r, e)
          ]
        })
      }),
      children: (l) => o.jsx(D, {
        as: "time",
        style: {
          flexShrink: 0
        },
        size: "T200",
        priority: "300",
        ...i,
        ref: l,
        children: s
      })
    });
  }), oAe = {
    maxWidth: He(100)
  };
  function ase({ filename: t, url: e, mimeType: n, encInfo: r }) {
    const i = be(), a = hn(), [s, l] = Et(p.useCallback(async () => {
      const u = Cn(i, e, a);
      if (!u) throw new Error("Invalid media URL");
      const h = r ? await Qf(u, (g) => Xf(g, n, r)) : await Gd(u), f = URL.createObjectURL(h);
      return ap.saveAs(f, t), f;
    }, [
      i,
      e,
      a,
      n,
      r,
      t
    ])), c = s.status === ve.Loading, d = s.status === ve.Error;
    return o.jsx(Oe, {
      disabled: c,
      onClick: l,
      variant: d ? "Critical" : "SurfaceVariant",
      size: "300",
      radii: "300",
      children: c ? o.jsx(dt, {
        size: "100",
        variant: d ? "Critical" : "Secondary"
      }) : o.jsx(Q, {
        size: "100",
        src: q.Download
      })
    });
  }
  const VP = ft(({ body: t, mimeType: e, after: n, ...r }, i) => o.jsxs(E, {
    alignItems: "Center",
    gap: "200",
    grow: "Yes",
    ...r,
    ref: i,
    children: [
      o.jsx(E, {
        shrink: "No",
        children: o.jsx(Rn, {
          style: oAe,
          variant: "Secondary",
          radii: "Pill",
          children: o.jsx(D, {
            size: "O400",
            truncate: true,
            children: aI(e)
          })
        })
      }),
      o.jsx(E, {
        grow: "Yes",
        children: o.jsx(D, {
          size: "T300",
          truncate: true,
          children: t
        })
      }),
      n
    ]
  }));
  var _a = ((t) => (t.Delete = "delete", t.Forward = "forward", t.Report = "report", t.Source = "source", t.Reactions = "reactions", t.EditHistory = "edit_history", t.ReadReceipts = "read_receipts", t))(_a || {});
  const tu = vn(null), sse = (t, e, n) => {
    const r = Fn(e);
    p.useEffect(() => {
      const i = (c) => !!n.find((d) => d === c.getMyMembership());
      r({
        type: "INITIALIZE",
        rooms: t.getRooms().filter(i).map((c) => c.roomId)
      });
      const a = (c) => {
        i(c) && r({
          type: "PUT",
          roomId: c.roomId
        });
      }, s = (c) => {
        i(c) ? r({
          type: "PUT",
          roomId: c.roomId
        }) : r({
          type: "DELETE",
          roomId: c.roomId
        });
      }, l = (c) => {
        r({
          type: "DELETE",
          roomId: c
        });
      };
      return t.on(jt.Room, a), t.on(mt.MyMembership, s), t.on(jt.DeleteRoom, l), () => {
        t.removeListener(jt.Room, a), t.removeListener(mt.MyMembership, s), t.removeListener(jt.DeleteRoom, l);
      };
    }, [
      t,
      n,
      r
    ]);
  }, aAe = (t, e) => t.length !== e.length ? false : t.every((n, r) => n === e[r]), s5 = vn([]), zr = vn((t) => t(s5), (t, e, n) => {
    if (n.type === "INITIALIZE") {
      e(s5, n.rooms);
      return;
    }
    e(s5, (r) => {
      const i = r.filter((a) => a !== n.roomId);
      return n.type === "PUT" && i.push(n.roomId), i;
    });
  }), sAe = (t, e) => {
    sse(t, e, p.useMemo(() => [
      Ht.Join
    ], []));
  }, td = () => {
    const t = Ze(zr);
    return p.useMemo(() => new Set(t), [
      t
    ]);
  }, ec = (t) => {
    const e = be();
    return p.useCallback((r) => {
      if (t.has(r)) return e.getRoom(r) ?? void 0;
    }, [
      e,
      t
    ]);
  }, Ku = (t) => (e, n) => {
    var _a6;
    const r = t.getRoom(e);
    return (((_a6 = t.getRoom(n)) == null ? void 0 : _a6.getLastActiveTimestamp()) ?? Number.MIN_SAFE_INTEGER) - ((r == null ? void 0 : r.getLastActiveTimestamp()) ?? Number.MIN_SAFE_INTEGER);
  }, Yk = (t) => (e, n) => {
    var _a6, _b3;
    let r = ((_a6 = t.getRoom(e)) == null ? void 0 : _a6.name) ?? "", i = ((_b3 = t.getRoom(n)) == null ? void 0 : _b3.name) ?? "";
    return r = r.replace(/#/g, ""), i = i.replace(/#/g, ""), r.toLowerCase() < i.toLowerCase() ? -1 : r.toLowerCase() > i.toLowerCase() ? 1 : 0;
  }, lse = (t, e) => t - e, cse = (t, e) => !t && !e ? 0 : e ? t && t < e ? -1 : 1 : -1;
  var dse = "styles_MessageBase__1op8o8v0", lAe = "styles_MessageBaseBubbleCollapsed__1op8o8v1", use = "styles_MessageOptionsBase__1op8o8v2 _1mqalmd1 _1mqalmd0", hse = "styles_MessageOptionsBar__1op8o8v3 _1mqalmd1 _1mqalmd0", cAe = "styles_BubbleAvatarBase__1op8o8v4", dAe = "styles_MessageAvatar__1op8o8v5", uAe = "styles_MessageQuickReaction__1op8o8v6", sE = "styles_MessageMenuGroup__1op8o8v7", Ha = "styles_MessageMenuItemText__1op8o8v8", hAe = "styles_ReactionsContainer__1op8o8v9", fAe = "styles_ReactionsTooltipText__1op8o8va", mAe = "styles_MessagePending__1op8o8vb", gAe = "styles_MessageFailed__1op8o8vc", rK = "styles_SendStatusRow__1op8o8vd";
  const pAe = (t, e) => jF(t, (n) => n.filter(e), aAe), KF = (t, e) => {
    const n = p.useMemo(() => pAe(t, e), [
      t,
      e
    ]);
    return Ze(n);
  }, fse = (t, e) => p.useCallback((n) => (r) => Jb(t.getRoom(r)) && e.has(r) && sa(e, r).has(n), [
    t,
    e
  ]), FAe = (t, e) => p.useCallback((n) => (r) => Uu(t.getRoom(r)) && e.has(r) && sa(e, r).has(n), [
    t,
    e
  ]), vAe = (t, e, n) => p.useCallback((r) => (i) => Jb(t.getRoom(i)) && !e.has(i) && n.has(i) && sa(n, i).has(r), [
    t,
    e,
    n
  ]), Zk = (t, e, n) => {
    const r = p.useMemo(() => n(e), [
      n,
      e
    ]);
    return KF(t, r);
  }, HP = (t, e) => {
    const n = p.useCallback((r) => Uu(t.getRoom(r)), [
      t
    ]);
    return KF(e, n);
  }, Jk = (t, e, n) => {
    const r = p.useCallback((i) => Uu(t.getRoom(i)) && !n.has(i), [
      t,
      n
    ]);
    return KF(e, r);
  }, $P = (t, e, n) => {
    const r = p.useCallback((i) => Jb(t.getRoom(i)) && !n.has(i), [
      t,
      n
    ]);
    return KF(e, r);
  }, mse = (t, e, n, r, i) => {
    const a = p.useCallback((s) => Jb(t.getRoom(s)) && !n.has(s) && (i || !r.has(s)), [
      t,
      n,
      r,
      i
    ]);
    return KF(e, a);
  }, u3 = (t, e, n) => {
    const r = p.useCallback((i) => Jb(t.getRoom(i)) && n.has(i), [
      t,
      n
    ]);
    return KF(e, r);
  }, qD = (t, e) => {
    let n = t.normalize((e == null ? void 0 : e.normalizeUnicode) ?? true ? "NFKC" : "NFC");
    return (e == null ? void 0 : e.caseSensitive) || (n = n.toLocaleLowerCase()), ((e == null ? void 0 : e.ignoreWhitespace) ?? true) && (n = n.replaceAll(/\s/g, "")), n;
  }, iK = (t, e, n) => (n == null ? void 0 : n.contain) ? t.includes(e) : t.startsWith(e), _Ae = (t, e, n, r) => {
    let i = [], a = 0, s = 0, l;
    const c = () => {
      i = [], a = 0, s = 0, l && clearTimeout(l), l = void 0;
    }, d = (h, f) => {
      const g = i.length;
      if (l = void 0, f === s) {
        for (s = globalThis.performance.now(); a < t.length; a += 1) {
          const m = t[a];
          if (m !== void 0 && e(m, h) && (i.push(m), typeof (r == null ? void 0 : r.limit) == "number" && i.length >= r.limit)) break;
          if (globalThis.performance.now() - s > 8) {
            const y = i.length, w = s;
            g !== y && n(i, h), a += 1, l = globalThis.setTimeout(() => d(h, w), 1);
            return;
          }
        }
        (g !== i.length || g === 0) && n(i, h), c();
      }
    };
    return [
      (h) => {
        if (c(), h === "") {
          n(i, h);
          return;
        }
        d(h, s);
      },
      c
    ];
  }, hI = (t, e, n) => {
    if (Array.isArray(t)) {
      const a = t.find((s) => iK(qD(s, n == null ? void 0 : n.normalizeOptions), e, n == null ? void 0 : n.matchOptions));
      return a ? qD(a, n == null ? void 0 : n.normalizeOptions) : void 0;
    }
    const r = qD(t, n == null ? void 0 : n.normalizeOptions);
    return iK(r, e, n == null ? void 0 : n.matchOptions) ? r : void 0;
  }, yAe = (t, e, n, r) => {
    const i = Array.from(e), a = new RegExp(`(\\b|_)${ob(t)}`), s = new RegExp(`(\\b|_)${ob(t)}(\\b|_)`);
    return i.sort((l, c) => {
      const d = hI(n(l, t), t, r), u = hI(n(c, t), t, r);
      if (d === void 0 && u === void 0) return 0;
      if (d === void 0) return 1;
      if (u === void 0) return -1;
      let h = 0, f = 0;
      const g = (k) => {
        d.length < u.length ? h += k : u.length < d.length && (f += k);
      };
      g(1);
      const m = d.indexOf(t), v = u.indexOf(t);
      m < v ? h += 2 : v < m ? f += 2 : g(2);
      const y = d.match(a), w = u.match(a);
      y && w ? g(4) : y ? h += 4 : w && (f += 4);
      const b = d.match(s), j = u.match(s);
      return b && j ? g(8) : b ? h += 8 : j && (f += 8), f - h;
    }), i;
  }, tc = (t, e, n) => {
    const [r, i] = p.useState(), [a, s] = p.useMemo(() => (i(void 0), _Ae(t, (h, f) => {
      const g = e(h, f);
      return typeof hI(g, f, n) == "string";
    }, (h, f) => i({
      query: f,
      items: yAe(f, h, e, n)
    }), n)), [
      t,
      n,
      e
    ]), l = p.useCallback((d) => {
      const u = qD(d, n == null ? void 0 : n.normalizeOptions);
      a(u);
    }, [
      a,
      n == null ? void 0 : n.normalizeOptions
    ]), c = p.useCallback(() => {
      s(), i(void 0);
    }, [
      s
    ]);
    return p.useEffect(() => () => {
      s();
    }, [
      s
    ]), [
      r,
      l,
      c
    ];
  };
  var gse = "RoomAvatar_RoomAvatar__cliw50";
  function bAe(t) {
    const r = document.createElement("canvas");
    r.width = 32, r.height = 32;
    const i = r.getContext("2d", {
      willReadFrequently: true
    });
    i.drawImage(t, 0, 0, 32, 32);
    const a = i.getImageData(0, 0, 32, 32).data, s = new Uint16Array(4096), l = new Uint32Array(4096 * 3);
    for (let N = 0, L = a.length; N < L; N += 4) if (a[N + 3] >= 16) {
      const H = Math.trunc(a[N] / 16), V = Math.trunc(a[N + 1] / 16), Z = Math.trunc(a[N + 2] / 16), Y = H * 256 + V * 16 + Z, oe = Y * 3;
      s[Y] += 1, l[oe] += a[N], l[oe + 1] += a[N + 1], l[oe + 2] += a[N + 2];
    }
    let c = -1, d = 0;
    for (let N = 0; N < 4096; N += 1) {
      const L = s[N];
      if (L > 0) {
        const H = N * 3, V = l[H] / L, Z = l[H + 1] / L, Y = l[H + 2] / L, oe = Math.max(V, Z, Y), ue = Math.min(V, Z, Y), ie = (oe - ue) / 255, de = (V * 0.2126 + Z * 0.7152 + Y * 0.0722) / 255, ne = Math.max(0.2, 1 - Math.abs(de - 0.5) * 1.2), ae = L * (1 + ie * 2) * ne;
        ae > c && (c = ae, d = N);
      }
    }
    const u = Math.trunc(d / 256) * 16 + 8, h = Math.trunc(d / 16) % 16 * 16 + 8, f = d % 16 * 16 + 8, g = u / 255, m = h / 255, v = f / 255, y = Math.max(g, m, v), w = Math.min(g, m, v), b = y - w;
    let j = 0, k = 0;
    const C = (y + w) / 2;
    b > 0 && (k = b / (1 - Math.abs(2 * C - 1)), y === g ? j = (m - v) / b % 6 : y === m ? j = (v - g) / b + 2 : j = (g - m) / b + 4, j = Math.round(j * 60), j < 0 && (j += 360));
    const x = C * 0.8, S = (1 - Math.abs(2 * x - 1)) * k, T = S * (1 - Math.abs(j / 60 % 2 - 1)), A = x - S / 2;
    let B = 0, U = 0, z = 0;
    j < 60 ? (B = S, U = T) : j < 120 ? (B = T, U = S) : j < 180 ? (U = S, z = T) : j < 240 ? (U = T, z = S) : j < 300 ? (B = T, z = S) : (B = S, z = T);
    const O = Math.round((B + A) * 255), M = Math.round((U + A) * 255), I = Math.round((z + A) * 255);
    return `rgb(${O}, ${M}, ${I})`;
  }
  function xAe({ src: t, alt: e, uniformIcons: n, onError: r }) {
    const [i] = Fe(ge, "uniformIcons"), [a, s] = p.useState(void 0), [l, c] = p.useState(t), d = i && n === true, u = d && a ? bAe(a) : void 0;
    p.useEffect(() => {
      let g = true, m = null;
      return (async () => {
        try {
          const y = await fetch(t, {
            mode: "cors"
          }), w = y.headers.get("content-type");
          if (w && w.includes("image/svg+xml")) {
            const b = await y.text(), k = new DOMParser().parseFromString(b, "image/svg+xml");
            k.querySelectorAll("animate, animateTransform, animateMotion").forEach((B) => B.setAttribute("repeatCount", "indefinite"));
            const x = k.createElementNS("http://www.w3.org/2000/svg", "style");
            x.textContent = "* { animation-iteration-count: infinite !important; }", k.documentElement.appendChild(x);
            const T = new XMLSerializer().serializeToString(k), A = new Blob([
              T
            ], {
              type: "image/svg+xml"
            });
            m = URL.createObjectURL(A), g && c(m);
          } else g && c(t);
        } catch {
          g && c(t);
        }
      })(), () => {
        g = false, m && URL.revokeObjectURL(m);
      };
    }, [
      t
    ]);
    const h = (g) => {
      g.currentTarget.setAttribute("data-image-loaded", "true"), s(g.currentTarget);
    }, f = l.startsWith("blob:");
    return o.jsx(Xu, {
      className: gse,
      style: {
        backgroundColor: d ? u : void 0
      },
      src: l,
      crossOrigin: f ? void 0 : "anonymous",
      alt: e,
      onError: () => {
        s(void 0), r();
      },
      onLoad: h,
      draggable: false
    });
  }
  function yi({ roomId: t, src: e, alt: n, renderFallback: r, uniformIcons: i }) {
    const [a, s] = p.useState(false);
    return p.useEffect(() => {
      s(false);
    }, [
      e
    ]), !e || a ? o.jsx(mp, {
      style: {
        backgroundColor: _p(t ?? ""),
        color: ct.Surface.Container
      },
      className: gse,
      children: r()
    }) : o.jsx(xAe, {
      src: e,
      alt: n,
      uniformIcons: i,
      onError: () => s(true)
    });
  }
  const Ya = p.forwardRef(({ joinRule: t, roomType: e, ...n }, r) => o.jsx(Q, {
    src: Sd(q, e, t),
    ...n,
    ref: r
  })), wAe = (t, e) => {
    const [n, r] = p.useState(e), i = p.useCallback(() => {
      r((l) => {
        const c = l + 1;
        return c >= t ? 0 : c;
      });
    }, [
      t
    ]), a = p.useCallback(() => {
      r((l) => {
        const c = l - 1;
        return c < 0 ? t - 1 : c;
      });
    }, [
      t
    ]), s = p.useCallback(() => {
      r(e);
    }, [
      e
    ]);
    return {
      index: n,
      next: i,
      previous: a,
      reset: s
    };
  };
  var Ea = ((t) => (t.OFF = "OFF", t.Notify = "Notify", t.NotifyLoud = "NotifyLoud", t))(Ea || {});
  const KD = (t) => {
    const e = t.find((r) => typeof r == "object" && r.set_tweak === z1.Sound), n = t.find((r) => typeof r == "string" && r === Rc.Notify);
    return n && e ? "NotifyLoud" : n ? "Notify" : "OFF";
  }, Oc = (t, e) => {
    if (t === "OFF") return [];
    const n = [
      Rc.Notify
    ];
    return t === "NotifyLoud" && n.push({
      set_tweak: z1.Sound,
      value: (e == null ? void 0 : e.soundValue) ?? "default"
    }), (e == null ? void 0 : e.highlight) && n.push({
      set_tweak: z1.Highlight,
      value: true
    }), n;
  }, WP = (t) => p.useCallback((n) => Oc(n, t), [
    t
  ]), qP = (t) => p.useMemo(() => KD(t), [
    t
  ]), pse = p.createContext(null), DAe = pse.Provider, h3 = () => {
    const t = p.useContext(pse);
    if (!t) throw new Error("No RoomsNotificationPreferences provided!");
    return t;
  }, CAe = () => {
    var _a6;
    const t = (_a6 = vh(ce.PushRules)) == null ? void 0 : _a6.getContent();
    return p.useMemo(() => {
      const n = t == null ? void 0 : t.global, r = (n == null ? void 0 : n.room) ?? [], i = (n == null ? void 0 : n.override) ?? [], a = {
        mute: /* @__PURE__ */ new Set(),
        specialMessages: /* @__PURE__ */ new Set(),
        allMessages: /* @__PURE__ */ new Set()
      };
      return i.forEach((s) => {
        Bc(s.rule_id) && KD(s.actions) === Ea.OFF && a.mute.add(s.rule_id);
      }), r.forEach((s) => {
        KD(s.actions) === Ea.OFF && a.specialMessages.add(s.rule_id);
      }), r.forEach((s) => {
        KD(s.actions) !== Ea.OFF && a.allMessages.add(s.rule_id);
      }), a;
    }, [
      t
    ]);
  };
  var Ts = ((t) => (t.Unset = "Unset", t.Mute = "Mute", t.SpecialMessages = "SpecialMessages", t.AllMessages = "AllMessages", t))(Ts || {});
  const Xk = (t, e) => t.mute.has(e) ? "Mute" : t.specialMessages.has(e) ? "SpecialMessages" : t.allMessages.has(e) ? "AllMessages" : "Unset", Qk = (t) => t === "Mute" ? q.BellMute : t === "SpecialMessages" ? q.BellPing : t === "AllMessages" ? q.BellRing : q.Bell, EAe = async (t, e, n, r) => {
    if ((r === "AllMessages" || r === "SpecialMessages") && await t.deletePushRule("global", Or.RoomSpecific, e), r === "Mute" && await t.deletePushRule("global", Or.Override, e), n !== "Unset") {
      if (n === "Mute") {
        await t.addPushRule("global", Or.Override, e, {
          conditions: [
            {
              kind: di.EventMatch,
              key: "room_id",
              pattern: e
            }
          ],
          actions: Oc(Ea.OFF)
        });
        return;
      }
      await t.addPushRule("global", Or.RoomSpecific, e, {
        actions: Oc(n === "AllMessages" ? Ea.NotifyLoud : Ea.OFF)
      });
    }
  }, kAe = (t) => {
    const e = be(), [n, r] = Et(p.useCallback((i, a) => EAe(e, t, i, a), [
      e,
      t
    ]));
    return {
      modeState: n,
      setMode: r
    };
  }, Fse = (t) => ({
    highlight: t.highlight,
    total: t.total,
    from: null
  }), oK = (t, e, n) => {
    const r = t.get(n.roomId) ?? {
      highlight: 0,
      total: 0
    };
    t.set(n.roomId, Fse(n));
    const i = n.highlight - r.highlight, a = n.total - r.total;
    e.forEach((s) => {
      const l = t.get(s) ?? {
        highlight: 0,
        total: 0,
        from: null
      };
      t.set(s, {
        highlight: l.highlight += i,
        total: l.total += a,
        from: /* @__PURE__ */ new Set([
          ...l.from ?? [],
          n.roomId
        ])
      });
    });
  }, aK = (t, e, n) => {
    const r = t.get(n);
    r && (t.delete(n), e.forEach((i) => {
      const a = t.get(i);
      if (!a) return;
      const s = new Set(a.from ?? n);
      if (s.delete(n), s.size === 0) {
        t.delete(i);
        return;
      }
      t.set(i, {
        highlight: a.highlight - r.highlight,
        total: a.total - r.total,
        from: s
      });
    }));
  }, vse = (t, e) => {
    if (!(t.highlight === e.highlight && t.total === e.total)) return false;
    const r = t.from, i = e.from;
    if (r === null && i === null) return true;
    if (r === null || i === null || r.size !== i.size) return false;
    let a = true;
    return r == null ? void 0 : r.forEach((s) => {
      (i == null ? void 0 : i.has(s)) || (a = false);
    }), a;
  }, pc = vn(/* @__PURE__ */ new Map()), qi = vn((t) => t(pc), (t, e, n) => {
    const r = (i) => sa(t(vi), i);
    if (n.type === "RESET") {
      const i = /* @__PURE__ */ new Map();
      n.unreadInfos.forEach((a) => {
        oK(i, r(a.roomId), a);
      }), e(pc, i);
      return;
    }
    if (n.type === "PUT") {
      const { unreadInfo: i } = n;
      if (i.total <= 0 && i.highlight <= 0) {
        t(pc).has(i.roomId) && e(pc, uo(t(pc), (s) => aK(s, r(i.roomId), i.roomId)));
        return;
      }
      const a = t(pc).get(i.roomId);
      if (a && vse(a, Fse(i))) return;
      e(pc, uo(t(pc), (s) => oK(s, r(i.roomId), i)));
      return;
    }
    n.type === "DELETE" && t(pc).has(n.roomId) && e(pc, uo(t(pc), (i) => aK(i, r(n.roomId), n.roomId)));
  }), SAe = (t, e) => {
    const n = Fn(e), r = h3(), i = Ze(gi), a = p.useRef(null), s = p.useCallback(() => $B(t).transport === "sliding", [
      t
    ]);
    p.useEffect(() => {
      n({
        type: "RESET",
        unreadInfos: dw(t, {
          applyFixup: s(),
          mDirects: i
        })
      });
    }, [
      t,
      n,
      s,
      i
    ]), $F(t, p.useCallback((l, c) => {
      (l === Nn.Prepared && c === null || l === Nn.Syncing && c !== Nn.Syncing) && n({
        type: "RESET",
        unreadInfos: dw(t, {
          applyFixup: s(),
          mDirects: i
        })
      });
    }, [
      t,
      n,
      s,
      i
    ])), p.useEffect(() => {
      const l = (c, d, u, h, f) => {
        if (!d || d.isSpaceRoom()) return;
        if (Yg(t, d.roomId) === rs.Mute) {
          n({
            type: "DELETE",
            roomId: d.roomId
          });
          return;
        }
        if (f.liveEvent && Vu(c)) {
          if (c.getSender() === t.getUserId()) return;
          const m = rf(d, {
            applyFixup: s(),
            mDirects: i
          });
          n({
            type: "PUT",
            unreadInfo: m
          });
          return;
        }
        const g = t.getUserId();
        if (!f.liveEvent && g && !d.getEventReadUpTo(g)) {
          const m = rf(d, {
            applyFixup: s(),
            mDirects: i
          });
          (m.total > 0 || m.highlight > 0) && n({
            type: "PUT",
            unreadInfo: m
          });
        }
      };
      return t.on(mt.Timeline, l), () => {
        t.removeListener(mt.Timeline, l);
      };
    }, [
      t,
      n,
      s,
      i
    ]), p.useEffect(() => {
      const l = (c, d) => {
        const u = t.getUserId();
        if (!u || d.isSpaceRoom()) return;
        const h = c.getContent();
        if (Object.keys(h).find((g) => Object.keys(h[g]).find((m) => h[g][m][u]))) {
          const g = rf(d, {
            applyFixup: s(),
            mDirects: i
          });
          if (g.total === 0 && g.highlight === 0) {
            n({
              type: "DELETE",
              roomId: d.roomId
            });
            return;
          }
          n({
            type: "PUT",
            unreadInfo: g
          });
        }
      };
      return t.on(mt.Receipt, l), () => {
        t.removeListener(mt.Receipt, l);
      };
    }, [
      t,
      n,
      s,
      i
    ]), p.useEffect(() => {
      const l = /* @__PURE__ */ new Map(), c = (d) => {
        if (l.has(d)) return;
        const u = () => {
          if (d.isSpaceRoom() || d.getMyMembership() !== Ht.Join) return;
          const h = rf(d, {
            applyFixup: false,
            mDirects: i
          });
          if (h.total === 0 && h.highlight === 0) {
            n({
              type: "DELETE",
              roomId: d.roomId
            });
            return;
          }
          n({
            type: "PUT",
            unreadInfo: h
          });
        };
        d.on(mt.UnreadNotifications, u), l.set(d, u);
      };
      return t.getRooms().forEach(c), t.on(jt.Room, c), () => {
        t.removeListener(jt.Room, c), l.forEach((d, u) => {
          u.removeListener(mt.UnreadNotifications, d);
        });
      };
    }, [
      t,
      n,
      s,
      i
    ]), p.useEffect(() => {
      const l = (c, d) => {
        if (d.isSpaceRoom() || c.getType() !== ce.FullyRead) return;
        const u = rf(d, {
          applyFixup: s(),
          mDirects: i
        });
        if (u.total === 0 && u.highlight === 0) {
          n({
            type: "DELETE",
            roomId: d.roomId
          });
          return;
        }
        n({
          type: "PUT",
          unreadInfo: u
        });
      };
      return t.on(mt.AccountData, l), () => {
        t.removeListener(mt.AccountData, l);
      };
    }, [
      t,
      n,
      s,
      i
    ]), p.useEffect(() => {
      n({
        type: "RESET",
        unreadInfos: dw(t, {
          applyFixup: s(),
          mDirects: i
        })
      });
    }, [
      t,
      n,
      r,
      s,
      i
    ]), p.useEffect(() => {
      const l = (c, d) => {
        d !== Ht.Join && n({
          type: "DELETE",
          roomId: c.roomId
        });
      };
      return t.on(mt.MyMembership, l), () => {
        t.removeListener(mt.MyMembership, l);
      };
    }, [
      t,
      n
    ]), p.useEffect(() => {
      const l = (c) => {
        if (c.isSpaceRoom() || c.getMyMembership() !== Ht.Join) return;
        const d = rf(c, {
          applyFixup: s(),
          mDirects: i
        });
        (d.total > 0 || d.highlight > 0) && n({
          type: "PUT",
          unreadInfo: d
        });
      };
      return t.on(jt.Room, l), () => {
        t.removeListener(jt.Room, l);
      };
    }, [
      t,
      n,
      s,
      i
    ]), p.useEffect(() => () => {
      a.current !== null && (window.clearTimeout(a.current), a.current = null);
    }, []), vl(t, p.useCallback((l) => {
      if (l.getType() === ce.SpaceChild) {
        const c = l.getRoomId();
        if (!c) return;
        const d = t.getRoom(c);
        if (!d || d.getMyMembership() !== Ht.Join) return;
        a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
          n({
            type: "RESET",
            unreadInfos: dw(t, {
              applyFixup: s(),
              mDirects: i
            })
          }), a.current = null;
        }, 150);
      }
    }, [
      t,
      n,
      s,
      i
    ]));
  };
  function _se({ highlight: t, count: e, dm: n, showUnreadCounts: r, badgeCountDMsOnly: i, showPingCounts: a }) {
    return e > 0 && (n && i || !n && r || t && a) ? "count" : "dot";
  }
  function jAe(t, e) {
    return t <= 999 ? t.toString() : t === 1e3 ? "1k" : e ? ":3" : "1k+";
  }
  const TAe = {
    minWidth: He(16)
  };
  function f3({ children: t }) {
    return o.jsx(E, {
      as: "span",
      style: TAe,
      shrink: "No",
      alignItems: "Center",
      justifyContent: "Center",
      children: t
    });
  }
  function Sp({ highlight: t, count: e, dm: n, mode: r }) {
    const [i] = Fe(ge, "showUnreadCounts"), [a] = Fe(ge, "badgeCountDMsOnly"), [s] = Fe(ge, "showPingCounts"), [l] = Fe(ge, "showEasterEggs"), c = r ?? _se({
      highlight: t,
      count: e,
      dm: n,
      showUnreadCounts: i,
      badgeCountDMsOnly: a,
      showPingCounts: s
    });
    return o.jsx(Rn, {
      variant: t ? "Success" : "Secondary",
      size: c === "count" ? "400" : "200",
      fill: "Solid",
      radii: "Pill",
      outlined: false,
      children: c === "count" && o.jsx(D, {
        as: "span",
        size: "L400",
        children: jAe(e, l)
      })
    });
  }
  const yse = vn(false), Ld = (t, e) => {
    p.useEffect(() => (t.addEventListener("keydown", e), () => {
      t.removeEventListener("keydown", e);
    }), [
      t,
      e
    ]);
  };
  var uF = ((t) => (t.Command = "\u2318", t.Shift = "\u21E7", t.Option = "\u2325", t.Control = "\u2303", t.Hyper = "\u2726", t.Super = "\u2756", t.Escape = "\u238B", t))(uF || {});
  const RAe = (t) => {
    if (t === "#") return "#";
    if (t === "*") return "*";
    if (t === "@") return "@";
  }, AAe = (t, e, n, r) => {
    const i = be();
    return p.useMemo(() => t === "*" ? r : t === "@" ? [
      ...n
    ].toSorted(Ku(i)).slice(0, 20) : t === "#" ? [
      ...e
    ].toSorted(Ku(i)).slice(0, 20) : [
      ...e,
      ...n
    ].toSorted(Ku(i)).slice(0, 20), [
      i,
      e,
      n,
      r,
      t
    ]);
  }, sK = (t, e, n) => {
    const r = e(t);
    return r && zB(r, n);
  }, IAe = (t, e, n, r) => p.useMemo(() => t === void 0 ? [
    ...e,
    ...n,
    ...r
  ] : t === "#" ? e : t === "*" ? r : t === "@" ? n : [], [
    e,
    r,
    n,
    t
  ]), BAe = {
    matchOptions: {
      contain: true
    },
    normalizeOptions: {
      ignoreWhitespace: false
    }
  };
  function bse({ requestClose: t, pickRoom: e }) {
    const n = be(), r = hn(), i = p.useRef(null), a = p.useRef(null), { navigateRoom: s, navigateSpace: l } = Wi(), c = Ze(qi), [d, u] = p.useState(), h = td(), f = ec(h), g = Ze(vi), m = Jk(n, zr, g), v = Ze(gi), y = $P(n, zr, v), w = HP(n, zr), b = u3(n, zr, v), j = p.useMemo(() => e ? new Set(e.eligibleRoomIds) : null, [
      e
    ]), k = AAe(d, y, b, w), C = IAe(d, y, b, w), x = p.useMemo(() => j ? k.filter((Z) => j.has(Z)) : k, [
      j,
      k
    ]), S = p.useMemo(() => j ? C.filter((Z) => j.has(Z)) : C, [
      j,
      C
    ]), T = p.useCallback((Z) => {
      var _a6;
      const Y = ((_a6 = f(Z)) == null ? void 0 : _a6.name) ?? Z;
      if (v.has(Z)) {
        const oe = sK(Z, f, n.getSafeUserId()), ue = oe && _n(oe);
        if (ue) return [
          Y,
          ue
        ];
      }
      return Y;
    }, [
      f,
      v,
      n
    ]), [A, B, U] = tc(S, T, BAe), z = $k(), O = p.useMemo(() => {
      const Z = A ? A.items : x;
      return z ? [
        ...Z
      ].toSorted((Y, oe) => {
        var _a6, _b3;
        const ue = ((_a6 = sa(g, Y)) == null ? void 0 : _a6.has(z)) ? 1 : 0;
        return (((_b3 = sa(g, oe)) == null ? void 0 : _b3.has(z)) ? 1 : 0) - ue;
      }) : Z;
    }, [
      A,
      x,
      z,
      g
    ]), M = wAe(O.length, 0), I = (A == null ? void 0 : A.query) ? a3(A.query.split(" ")) : void 0, N = (Z, Y) => {
      if (e) {
        if (e.busy) return;
        e.onPickRoom(Z);
        return;
      }
      Y ? l(Z) : s(Z), t();
    }, L = (Z) => {
      var _a6;
      M.reset();
      let oe = Z.currentTarget.value.trim();
      const ue = (_a6 = oe.match(/^[#@*]/)) == null ? void 0 : _a6[0], ie = typeof ue == "string" && RAe(ue);
      if (ie ? (oe = oe.slice(1), u(ie)) : u(void 0), oe === "") {
        U();
        return;
      }
      B(oe);
    }, H = (Z) => {
      const Y = O[M.index];
      if (Yt.isKeyHotkey("enter", Z) && Y) {
        N(Y, w.includes(Y));
        return;
      }
      if (Yt.isKeyHotkey("arrowdown", Z)) {
        Z.preventDefault(), M.next();
        return;
      }
      Yt.isKeyHotkey("arrowup", Z) && (Z.preventDefault(), M.previous());
    }, V = (Z) => {
      const Y = Z.currentTarget, oe = Y.getAttribute("data-room-id"), ue = Y.getAttribute("data-space") === "true";
      oe && N(oe, ue);
    };
    return p.useEffect(() => {
      const Z = i.current, Y = Z == null ? void 0 : Z.querySelector(`[data-focus-index="${M.index}"]`);
      Y && Z && Y.scrollIntoView({
        block: "center"
      });
    }, [
      M.index
    ]), o.jsx(Hn, {
      open: true,
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: () => a.current,
            returnFocusOnDeactivate: false,
            allowOutsideClick: true,
            clickOutsideDeactivates: true,
            onDeactivate: t,
            escapeDeactivates: (Z) => (Z.stopPropagation(), true)
          },
          children: o.jsxs(Go, {
            size: "400",
            style: {
              maxHeight: He(400),
              borderRadius: ee.radii.R500
            },
            children: [
              e && o.jsxs(E, {
                shrink: "No",
                direction: "Row",
                alignItems: "Center",
                justifyContent: "SpaceBetween",
                style: {
                  padding: `${ee.space.S400} ${ee.space.S400} ${ee.space.S200}`
                },
                children: [
                  o.jsx(D, {
                    size: "H4",
                    children: e.title
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: t,
                    radii: "300",
                    "aria-label": "Close",
                    disabled: e.busy,
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              (e == null ? void 0 : e.errorMessage) ? o.jsx(E, {
                shrink: "No",
                style: {
                  padding: `0 ${ee.space.S400} ${ee.space.S200}`
                },
                children: o.jsx(D, {
                  size: "T200",
                  color: "Critical600",
                  children: e.errorMessage
                })
              }) : null,
              o.jsx(E, {
                shrink: "No",
                style: {
                  padding: ee.space.S400,
                  paddingBottom: 0
                },
                direction: "Column",
                children: o.jsx(mn, {
                  ref: a,
                  size: "500",
                  variant: "Background",
                  radii: "400",
                  outlined: true,
                  placeholder: e ? "Search rooms" : "Search",
                  before: o.jsx(Q, {
                    size: "200",
                    src: q.Search
                  }),
                  onChange: L,
                  onKeyDown: H,
                  disabled: e == null ? void 0 : e.busy
                })
              }),
              o.jsxs(E, {
                grow: "Yes",
                children: [
                  O.length === 0 && o.jsxs(E, {
                    style: {
                      paddingTop: ee.space.S700
                    },
                    grow: "Yes",
                    alignItems: "Center",
                    justifyContent: "Center",
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "H6",
                        align: "Center",
                        children: e ? A ? "No Match Found" : e.eligibleRoomIds.length === 0 ? "No rooms to forward to" : "No rooms match this filter" : A ? "No Match Found" : "No Rooms"
                      }),
                      o.jsx(D, {
                        size: "T200",
                        align: "Center",
                        children: e ? A ? `No match found for "${A.query}".` : e.eligibleRoomIds.length === 0 ? "You cannot send messages in any joined room yet." : "Try another search, or use # for group rooms and @ for direct messages." : A ? `No match found for "${A.query}".` : "You do not have any Rooms to display yet."
                      })
                    ]
                  }),
                  O.length > 0 && o.jsx(dn, {
                    ref: i,
                    size: "300",
                    hideTrack: true,
                    children: o.jsx("div", {
                      style: {
                        padding: ee.space.S400,
                        paddingRight: ee.space.S200
                      },
                      children: O.map((Z, Y) => {
                        var _a6, _b3;
                        const oe = f(Z);
                        if (!oe) return null;
                        const ue = v.has(Z), ie = ue && sK(Z, f, n.getSafeUserId()), de = ie && _n(ie), ne = ie && bo(ie), ae = sa(g, Z), X = ae && m.filter((re) => ae.has(re)), K = X && K2(n, Z, X), G = g.get(Z), le = G && K2(n, Z, Array.from(G)), te = c.get(Z);
                        return o.jsx(Ye, {
                          as: "button",
                          "data-focus-index": Y,
                          "data-room-id": Z,
                          "data-space": oe.isSpaceRoom(),
                          onClick: V,
                          disabled: e == null ? void 0 : e.busy,
                          variant: M.index === Y ? "Primary" : "Surface",
                          "aria-pressed": M.index === Y,
                          radii: "400",
                          after: o.jsxs(E, {
                            gap: "100",
                            children: [
                              ne && o.jsx(D, {
                                size: "T200",
                                priority: "300",
                                truncate: true,
                                children: o.jsx("b", {
                                  children: ne
                                })
                              }),
                              !ue && K && o.jsx(D, {
                                size: "T200",
                                priority: "300",
                                truncate: true,
                                children: o.jsx("b", {
                                  children: ((_a6 = f(K)) == null ? void 0 : _a6.name) ?? K
                                })
                              }),
                              te && o.jsx(f3, {
                                children: o.jsx(Sp, {
                                  highlight: te.highlight > 0,
                                  count: te.highlight > 0 ? te.highlight : te.total
                                })
                              })
                            ]
                          }),
                          before: o.jsx(xn, {
                            size: "200",
                            radii: ue ? "400" : "300",
                            children: ue || oe.isSpaceRoom() ? o.jsx(yi, {
                              roomId: oe.roomId,
                              src: ue ? Jf(n, oe, 32, r) : Sa(n, oe, 32, r),
                              alt: oe.name,
                              renderFallback: () => o.jsx(D, {
                                as: "span",
                                size: "H6",
                                children: Vi(oe.name)
                              })
                            }) : o.jsx(Ya, {
                              size: "100",
                              joinRule: oe.getJoinRule(),
                              roomType: oe.getType()
                            })
                          }),
                          children: o.jsxs(E, {
                            grow: "Yes",
                            alignItems: "Center",
                            gap: "100",
                            children: [
                              o.jsx(D, {
                                size: "T400",
                                truncate: true,
                                children: I ? ip(I, [
                                  oe.name
                                ]) : oe.name
                              }),
                              de && o.jsxs(D, {
                                as: "span",
                                size: "T200",
                                priority: "300",
                                truncate: true,
                                children: [
                                  "@",
                                  I ? ip(I, [
                                    de
                                  ]) : de
                                ]
                              }),
                              !ue && le && le !== K && o.jsxs(D, {
                                size: "T200",
                                priority: "300",
                                truncate: true,
                                children: [
                                  "\u2014 ",
                                  ((_b3 = f(le)) == null ? void 0 : _b3.name) ?? le
                                ]
                              })
                            ]
                          })
                        }, Z);
                      })
                    })
                  })
                ]
              }),
              o.jsx(nr, {
                size: "300"
              }),
              o.jsx(E, {
                shrink: "No",
                justifyContent: "Center",
                style: {
                  padding: ee.space.S200
                },
                children: o.jsx(D, {
                  size: "T200",
                  priority: "300",
                  children: e ? o.jsxs(o.Fragment, {
                    children: [
                      "Type ",
                      o.jsx("b", {
                        children: "#"
                      }),
                      " for rooms and ",
                      o.jsx("b", {
                        children: "@"
                      }),
                      " for direct messages. Choose a room to forward this message."
                    ]
                  }) : o.jsxs(o.Fragment, {
                    children: [
                      "Type ",
                      o.jsx("b", {
                        children: "#"
                      }),
                      " for rooms, ",
                      o.jsx("b", {
                        children: "@"
                      }),
                      " for DMs and ",
                      o.jsx("b", {
                        children: "*"
                      }),
                      " for spaces. Hotkey:",
                      " ",
                      o.jsxs("b", {
                        children: [
                          U2() ? uF.Command : "Ctrl",
                          " + k"
                        ]
                      }),
                      " / ",
                      o.jsxs("b", {
                        children: [
                          U2() ? uF.Command : "Ctrl",
                          " + f"
                        ]
                      })
                    ]
                  })
                })
              })
            ]
          })
        })
      })
    });
  }
  function PAe() {
    const [t, e] = Fr(yse);
    return Ld(window, p.useCallback((n) => {
      if (Yt.isKeyHotkey("mod+k", n) || Yt.isKeyHotkey("mod+f", n)) {
        if (n.preventDefault(), t) {
          e(false);
          return;
        }
        const r = document.getElementById("portalContainer");
        if (r && r.children.length > 0) return;
        e(true);
      }
    }, [
      t,
      e
    ])), t && o.jsx(bse, {
      requestClose: () => e(false)
    });
  }
  const l5 = fo("MessageForward"), xse = ft(({ room: t, mEvent: e, onClose: n, ...r }) => {
    const i = Fn(tu), a = () => {
      i({
        type: _a.Forward,
        room: t,
        mEvent: e
      }), n == null ? void 0 : n();
    };
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.ArrowRight
      }),
      radii: "300",
      ...r,
      onClick: a,
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "Forward"
      })
    });
  }), MAe = (t) => {
    const r = new DOMParser().parseFromString(t, "text/html").querySelector("[data-forward-marker]");
    if (r) {
      const i = r.querySelector("blockquote");
      if (i) return i.innerHTML;
    }
    return t;
  };
  function OAe({ room: t, mEvent: e, onClose: n }) {
    const r = be(), [i, a] = p.useState(false), [s, l] = p.useState(null), c = Ze(zr), d = td(), u = ec(d), h = p.useMemo(() => c.filter((m) => {
      const v = u(m);
      return !!v && !v.isSpaceRoom() && v.maySendMessage();
    }).sort(Ku(r)), [
      c,
      u,
      r
    ]), f = p.useCallback((m) => {
      var _a6;
      a(true), l(null);
      const v = u(m), y = e.getId();
      if (!v || !y) {
        a(false);
        return;
      }
      const w = e.getType(), b = e.getContent(), j = b.msgtype === "m.text", k = typeof b.body == "string" ? b.body : "", C = b.format === "org.matrix.custom.html" && typeof b.formatted_body == "string" ? b.formatted_body : void 0, x = `(Forwarded message from ${PD(r, t) ? "a private room" : ((_a6 = u(t.roomId)) == null ? void 0 : _a6.name) ?? "a room"})`;
      let S = "", T = "";
      if (j) {
        const O = k.split(`
`).map((I) => `> ${I}`).join(`
`);
        S = k.length > 0 ? `${x}

${O}` : x;
        const M = C === void 0 ? Va(k).replaceAll(`
`, "<br>") : Lk(C);
        T = `<div data-forward-marker><p>${Va(x)}</p><blockquote>${M}</blockquote></div>`;
      }
      const A = j ? {
        body: S,
        format: "org.matrix.custom.html",
        formatted_body: T
      } : {}, B = {
        ...e.getContent()
      };
      delete B["m.relates_to"], delete B["m.mentions"], delete B[Vy];
      let U;
      PD(r, t) ? U = {
        ...B,
        ...A,
        [CA]: {
          v: 1,
          is_forwarded: true,
          original_timestamp: e.getTs(),
          original_event_private: true
        },
        [Y$]: {
          origin_server_ts: e.getTs()
        }
      } : U = {
        ...B,
        ...A,
        [CA]: {
          v: 1,
          is_forwarded: true,
          original_timestamp: e.getTs(),
          original_room_id: t.roomId,
          original_event_id: y,
          original_event_private: false
        },
        [Y$]: {
          event_id: y,
          room_id: t.roomId,
          origin_server_ts: e.getTs()
        }
      };
      const z = b.msgtype ?? "unknown";
      l5.info("ui", "Forwarding message", {
        sourceRoomId: t.roomId,
        targetRoomId: v.roomId,
        msgtype: z,
        isPrivate: PD(r, t)
      }), Vr("sable.message.forward.attempt", 1, {
        attributes: {
          msgtype: z
        }
      }), r.sendEvent(v.roomId, null, w, U).then(() => {
        l5.info("ui", "Message forwarded successfully", {
          sourceRoomId: t.roomId,
          targetRoomId: v.roomId
        }), Vr("sable.message.forward.success", 1), a(false), n();
      }).catch((O) => {
        const M = O instanceof Error ? O.message : String(O);
        l5.error("ui", "Message forward failed", {
          sourceRoomId: t.roomId,
          targetRoomId: v.roomId,
          error: M
        }), Vr("sable.message.forward.error", 1), a(false), l(M);
      });
    }, [
      u,
      e,
      r,
      n,
      t
    ]), g = p.useMemo(() => ({
      title: "Forward message",
      eligibleRoomIds: h,
      onPickRoom: (m) => {
        f(m);
      },
      errorMessage: s ? `Failed to forward: ${s}` : null,
      busy: i
    }), [
      s,
      h,
      f,
      i
    ]);
    return o.jsx(bse, {
      requestClose: n,
      pickRoom: g
    });
  }
  var c5, lK;
  function LAe() {
    if (lK) return c5;
    lK = 1, c5 = i;
    var t = "\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC", e = "A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF", n = new RegExp("^[^" + e + "]*[" + t + "]"), r = new RegExp("^[^" + t + "]*[" + e + "]");
    function i(a) {
      return a = String(a || ""), n.test(a) ? "rtl" : r.test(a) ? "ltr" : "neutral";
    }
    return c5;
  }
  var NAe = LAe();
  const wse = da(NAe);
  var d5, cK;
  function KP() {
    if (cK) return d5;
    cK = 1;
    function t(e) {
      var n = typeof e;
      return e != null && (n == "object" || n == "function");
    }
    return d5 = t, d5;
  }
  var u5, dK;
  function zAe() {
    if (dK) return u5;
    dK = 1;
    var t = typeof sl == "object" && sl && sl.Object === Object && sl;
    return u5 = t, u5;
  }
  var h5, uK;
  function Dse() {
    if (uK) return h5;
    uK = 1;
    var t = zAe(), e = typeof self == "object" && self && self.Object === Object && self, n = t || e || Function("return this")();
    return h5 = n, h5;
  }
  var f5, hK;
  function UAe() {
    if (hK) return f5;
    hK = 1;
    var t = Dse(), e = function() {
      return t.Date.now();
    };
    return f5 = e, f5;
  }
  var m5, fK;
  function VAe() {
    if (fK) return m5;
    fK = 1;
    var t = /\s/;
    function e(n) {
      for (var r = n.length; r-- && t.test(n.charAt(r)); ) ;
      return r;
    }
    return m5 = e, m5;
  }
  var g5, mK;
  function HAe() {
    if (mK) return g5;
    mK = 1;
    var t = VAe(), e = /^\s+/;
    function n(r) {
      return r && r.slice(0, t(r) + 1).replace(e, "");
    }
    return g5 = n, g5;
  }
  var p5, gK;
  function Cse() {
    if (gK) return p5;
    gK = 1;
    var t = Dse(), e = t.Symbol;
    return p5 = e, p5;
  }
  var F5, pK;
  function $Ae() {
    if (pK) return F5;
    pK = 1;
    var t = Cse(), e = Object.prototype, n = e.hasOwnProperty, r = e.toString, i = t ? t.toStringTag : void 0;
    function a(s) {
      var l = n.call(s, i), c = s[i];
      try {
        s[i] = void 0;
        var d = true;
      } catch {
      }
      var u = r.call(s);
      return d && (l ? s[i] = c : delete s[i]), u;
    }
    return F5 = a, F5;
  }
  var v5, FK;
  function WAe() {
    if (FK) return v5;
    FK = 1;
    var t = Object.prototype, e = t.toString;
    function n(r) {
      return e.call(r);
    }
    return v5 = n, v5;
  }
  var _5, vK;
  function qAe() {
    if (vK) return _5;
    vK = 1;
    var t = Cse(), e = $Ae(), n = WAe(), r = "[object Null]", i = "[object Undefined]", a = t ? t.toStringTag : void 0;
    function s(l) {
      return l == null ? l === void 0 ? i : r : a && a in Object(l) ? e(l) : n(l);
    }
    return _5 = s, _5;
  }
  var y5, _K;
  function KAe() {
    if (_K) return y5;
    _K = 1;
    function t(e) {
      return e != null && typeof e == "object";
    }
    return y5 = t, y5;
  }
  var b5, yK;
  function GAe() {
    if (yK) return b5;
    yK = 1;
    var t = qAe(), e = KAe(), n = "[object Symbol]";
    function r(i) {
      return typeof i == "symbol" || e(i) && t(i) == n;
    }
    return b5 = r, b5;
  }
  var x5, bK;
  function YAe() {
    if (bK) return x5;
    bK = 1;
    var t = HAe(), e = KP(), n = GAe(), r = NaN, i = /^[-+]0x[0-9a-f]+$/i, a = /^0b[01]+$/i, s = /^0o[0-7]+$/i, l = parseInt;
    function c(d) {
      if (typeof d == "number") return d;
      if (n(d)) return r;
      if (e(d)) {
        var u = typeof d.valueOf == "function" ? d.valueOf() : d;
        d = e(u) ? u + "" : u;
      }
      if (typeof d != "string") return d === 0 ? d : +d;
      d = t(d);
      var h = a.test(d);
      return h || s.test(d) ? l(d.slice(2), h ? 2 : 8) : i.test(d) ? r : +d;
    }
    return x5 = c, x5;
  }
  var w5, xK;
  function Ese() {
    if (xK) return w5;
    xK = 1;
    var t = KP(), e = UAe(), n = YAe(), r = "Expected a function", i = Math.max, a = Math.min;
    function s(l, c, d) {
      var u, h, f, g, m, v, y = 0, w = false, b = false, j = true;
      if (typeof l != "function") throw new TypeError(r);
      c = n(c) || 0, t(d) && (w = !!d.leading, b = "maxWait" in d, f = b ? i(n(d.maxWait) || 0, c) : f, j = "trailing" in d ? !!d.trailing : j);
      function k(O) {
        var M = u, I = h;
        return u = h = void 0, y = O, g = l.apply(I, M), g;
      }
      function C(O) {
        return y = O, m = setTimeout(T, c), w ? k(O) : g;
      }
      function x(O) {
        var M = O - v, I = O - y, N = c - M;
        return b ? a(N, f - I) : N;
      }
      function S(O) {
        var M = O - v, I = O - y;
        return v === void 0 || M >= c || M < 0 || b && I >= f;
      }
      function T() {
        var O = e();
        if (S(O)) return A(O);
        m = setTimeout(T, x(O));
      }
      function A(O) {
        return m = void 0, j && u ? k(O) : (u = h = void 0, g);
      }
      function B() {
        m !== void 0 && clearTimeout(m), y = 0, u = v = h = m = void 0;
      }
      function U() {
        return m === void 0 ? g : A(e());
      }
      function z() {
        var O = e(), M = S(O);
        if (u = arguments, h = this, v = O, M) {
          if (m === void 0) return C(v);
          if (b) return clearTimeout(m), m = setTimeout(T, c), k(v);
        }
        return m === void 0 && (m = setTimeout(T, c)), g;
      }
      return z.cancel = B, z.flush = U, z;
    }
    return w5 = s, w5;
  }
  var ZAe = Ese();
  const JAe = da(ZAe);
  var D5, wK;
  function XAe() {
    if (wK) return D5;
    wK = 1;
    var t = Ese(), e = KP(), n = "Expected a function";
    function r(i, a, s) {
      var l = true, c = true;
      if (typeof i != "function") throw new TypeError(n);
      return e(s) && (l = "leading" in s ? !!s.leading : l, c = "trailing" in s ? !!s.trailing : c), t(i, a, {
        leading: l,
        maxWait: a,
        trailing: c
      });
    }
    return D5 = r, D5;
  }
  var QAe = XAe();
  const eIe = da(QAe), DK = (t) => typeof t == "object" && t != null && t.nodeType === 1, CK = (t, e) => (!e || t !== "hidden") && t !== "visible" && t !== "clip", Ew = (t, e) => {
    if (t.clientHeight < t.scrollHeight || t.clientWidth < t.scrollWidth) {
      const n = getComputedStyle(t, null);
      return CK(n.overflowY, e) || CK(n.overflowX, e) || ((r) => {
        const i = ((a) => {
          if (!a.ownerDocument || !a.ownerDocument.defaultView) return null;
          try {
            return a.ownerDocument.defaultView.frameElement;
          } catch {
            return null;
          }
        })(r);
        return !!i && (i.clientHeight < r.scrollHeight || i.clientWidth < r.scrollWidth);
      })(t);
    }
    return false;
  }, kw = (t, e, n, r, i, a, s, l) => a < t && s > e || a > t && s < e ? 0 : a <= t && l <= n || s >= e && l >= n ? a - t - r : s > e && l < n || a < t && l > n ? s - e + i : 0, tIe = (t) => {
    const e = t.parentElement;
    return e ?? (t.getRootNode().host || null);
  }, EK = (t, e) => {
    var n, r, i, a;
    if (typeof document > "u") return [];
    const { scrollMode: s, block: l, inline: c, boundary: d, skipOverflowHiddenElements: u } = e, h = typeof d == "function" ? d : (N) => N !== d;
    if (!DK(t)) throw new TypeError("Invalid target");
    const f = document.scrollingElement || document.documentElement, g = [];
    let m = t;
    for (; DK(m) && h(m); ) {
      if (m = tIe(m), m === f) {
        g.push(m);
        break;
      }
      m != null && m === document.body && Ew(m) && !Ew(document.documentElement) || m != null && Ew(m, u) && g.push(m);
    }
    const v = (r = (n = window.visualViewport) == null ? void 0 : n.width) != null ? r : innerWidth, y = (a = (i = window.visualViewport) == null ? void 0 : i.height) != null ? a : innerHeight, { scrollX: w, scrollY: b } = window, { height: j, width: k, top: C, right: x, bottom: S, left: T } = t.getBoundingClientRect(), { top: A, right: B, bottom: U, left: z } = ((N) => {
      const L = window.getComputedStyle(N);
      return {
        top: parseFloat(L.scrollMarginTop) || 0,
        right: parseFloat(L.scrollMarginRight) || 0,
        bottom: parseFloat(L.scrollMarginBottom) || 0,
        left: parseFloat(L.scrollMarginLeft) || 0
      };
    })(t);
    let O = l === "start" || l === "nearest" ? C - A : l === "end" ? S + U : C + j / 2 - A + U, M = c === "center" ? T + k / 2 - z + B : c === "end" ? x + B : T - z;
    const I = [];
    for (let N = 0; N < g.length; N++) {
      const L = g[N], { height: H, width: V, top: Z, right: Y, bottom: oe, left: ue } = L.getBoundingClientRect();
      if (s === "if-needed" && C >= 0 && T >= 0 && S <= y && x <= v && (L === f && !Ew(L) || C >= Z && S <= oe && T >= ue && x <= Y)) return I;
      const ie = getComputedStyle(L), de = parseInt(ie.borderLeftWidth, 10), ne = parseInt(ie.borderTopWidth, 10), ae = parseInt(ie.borderRightWidth, 10), X = parseInt(ie.borderBottomWidth, 10);
      let K = 0, G = 0;
      const le = "offsetWidth" in L ? L.offsetWidth - L.clientWidth - de - ae : 0, te = "offsetHeight" in L ? L.offsetHeight - L.clientHeight - ne - X : 0, re = "offsetWidth" in L ? L.offsetWidth === 0 ? 0 : V / L.offsetWidth : 0, he = "offsetHeight" in L ? L.offsetHeight === 0 ? 0 : H / L.offsetHeight : 0;
      if (f === L) K = l === "start" ? O : l === "end" ? O - y : l === "nearest" ? kw(b, b + y, y, ne, X, b + O, b + O + j, j) : O - y / 2, G = c === "start" ? M : c === "center" ? M - v / 2 : c === "end" ? M - v : kw(w, w + v, v, de, ae, w + M, w + M + k, k), K = Math.max(0, K + b), G = Math.max(0, G + w);
      else {
        K = l === "start" ? O - Z - ne : l === "end" ? O - oe + X + te : l === "nearest" ? kw(Z, oe, H, ne, X + te, O, O + j, j) : O - (Z + H / 2) + te / 2, G = c === "start" ? M - ue - de : c === "center" ? M - (ue + V / 2) + le / 2 : c === "end" ? M - Y + ae + le : kw(ue, Y, V, de, ae + le, M, M + k, k);
        const { scrollLeft: se, scrollTop: ye } = L;
        K = he === 0 ? 0 : Math.max(0, Math.min(ye + K / he, L.scrollHeight - H / he + te)), G = re === 0 ? 0 : Math.max(0, Math.min(se + G / re, L.scrollWidth - V / re + le)), O += ye - K, M += se - G;
      }
      I.push({
        el: L,
        top: K,
        left: G
      });
    }
    return I;
  }, nIe = (t) => t === false ? {
    block: "end",
    inline: "nearest"
  } : ((e) => e === Object(e) && Object.keys(e).length !== 0)(t) ? t : {
    block: "start",
    inline: "nearest"
  };
  function rIe(t, e) {
    if (!t.isConnected || !((i) => {
      let a = i;
      for (; a && a.parentNode; ) {
        if (a.parentNode === document) return true;
        a = a.parentNode instanceof ShadowRoot ? a.parentNode.host : a.parentNode;
      }
      return false;
    })(t)) return;
    const n = ((i) => {
      const a = window.getComputedStyle(i);
      return {
        top: parseFloat(a.scrollMarginTop) || 0,
        right: parseFloat(a.scrollMarginRight) || 0,
        bottom: parseFloat(a.scrollMarginBottom) || 0,
        left: parseFloat(a.scrollMarginLeft) || 0
      };
    })(t);
    if (((i) => typeof i == "object" && typeof i.behavior == "function")(e)) return e.behavior(EK(t, e));
    const r = typeof e == "boolean" || e == null ? void 0 : e.behavior;
    for (const { el: i, top: a, left: s } of EK(t, nIe(e))) {
      const l = a - n.top + n.bottom, c = s - n.left + n.right;
      i.scroll({
        top: l,
        left: c,
        behavior: r
      });
    }
  }
  var iIe = {
    transform(t, e) {
      var { current: n, affinity: r } = t;
      if (n != null) {
        var i = Me.transform(n, e, {
          affinity: r
        });
        t.current = i, i == null && t.unref();
      }
    }
  }, oIe = {
    transform(t, e) {
      var { current: n, affinity: r } = t;
      if (n != null) {
        var i = ei.transform(n, e, {
          affinity: r
        });
        t.current = i, i == null && t.unref();
      }
    }
  }, aIe = {
    transform(t, e) {
      var { current: n, affinity: r } = t;
      if (n != null) {
        var i = _t.transform(n, e, {
          affinity: r
        });
        t.current = i, i == null && t.unref();
      }
    }
  }, lE = /* @__PURE__ */ new WeakMap(), cE = /* @__PURE__ */ new WeakMap(), n2 = /* @__PURE__ */ new WeakMap(), kse = /* @__PURE__ */ new WeakMap(), kK = /* @__PURE__ */ new WeakMap(), SK = /* @__PURE__ */ new WeakMap(), jK = /* @__PURE__ */ new WeakMap(), Me = {
    ancestors(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { reverse: n = false } = e, r = Me.levels(t, e);
      return n ? r = r.slice(1) : r = r.slice(0, -1), r;
    },
    common(t, e) {
      for (var n = [], r = 0; r < t.length && r < e.length; r++) {
        var i = t[r], a = e[r];
        if (i !== a) break;
        n.push(i);
      }
      return n;
    },
    compare(t, e) {
      for (var n = Math.min(t.length, e.length), r = 0; r < n; r++) {
        if (t[r] < e[r]) return -1;
        if (t[r] > e[r]) return 1;
      }
      return 0;
    },
    endsAfter(t, e) {
      var n = t.length - 1, r = t.slice(0, n), i = e.slice(0, n), a = t[n], s = e[n];
      return Me.equals(r, i) && a > s;
    },
    endsAt(t, e) {
      var n = t.length, r = t.slice(0, n), i = e.slice(0, n);
      return Me.equals(r, i);
    },
    endsBefore(t, e) {
      var n = t.length - 1, r = t.slice(0, n), i = e.slice(0, n), a = t[n], s = e[n];
      return Me.equals(r, i) && a < s;
    },
    equals(t, e) {
      return t.length === e.length && t.every((n, r) => n === e[r]);
    },
    hasPrevious(t) {
      return t[t.length - 1] > 0;
    },
    isAfter(t, e) {
      return Me.compare(t, e) === 1;
    },
    isAncestor(t, e) {
      return t.length < e.length && Me.compare(t, e) === 0;
    },
    isBefore(t, e) {
      return Me.compare(t, e) === -1;
    },
    isChild(t, e) {
      return t.length === e.length + 1 && Me.compare(t, e) === 0;
    },
    isCommon(t, e) {
      return t.length <= e.length && Me.compare(t, e) === 0;
    },
    isDescendant(t, e) {
      return t.length > e.length && Me.compare(t, e) === 0;
    },
    isParent(t, e) {
      return t.length + 1 === e.length && Me.compare(t, e) === 0;
    },
    isPath(t) {
      return Array.isArray(t) && t.every((e) => typeof e == "number");
    },
    isSibling(t, e) {
      if (t.length !== e.length) return false;
      var n = t.slice(0, -1), r = e.slice(0, -1), i = t[t.length - 1], a = e[e.length - 1];
      return i !== a && Me.equals(n, r);
    },
    levels(t) {
      for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { reverse: n = false } = e, r = [], i = 0; i <= t.length; i++) r.push(t.slice(0, i));
      return n && r.reverse(), r;
    },
    next(t) {
      if (t.length === 0) throw new Error("Cannot get the next path of a root path [".concat(t, "], because it has no next index."));
      var e = t[t.length - 1];
      return t.slice(0, -1).concat(e + 1);
    },
    operationCanTransformPath(t) {
      switch (t.type) {
        case "insert_node":
        case "remove_node":
        case "merge_node":
        case "split_node":
        case "move_node":
          return true;
        default:
          return false;
      }
    },
    parent(t) {
      if (t.length === 0) throw new Error("Cannot get the parent path of the root path [".concat(t, "]."));
      return t.slice(0, -1);
    },
    previous(t) {
      if (t.length === 0) throw new Error("Cannot get the previous path of a root path [".concat(t, "], because it has no previous index."));
      var e = t[t.length - 1];
      if (e <= 0) throw new Error("Cannot get the previous path of a first child path [".concat(t, "] because it would result in a negative index."));
      return t.slice(0, -1).concat(e - 1);
    },
    relative(t, e) {
      if (!Me.isAncestor(e, t) && !Me.equals(t, e)) throw new Error("Cannot get the relative path of [".concat(t, "] inside ancestor [").concat(e, "], because it is not above or equal to the path."));
      return t.slice(e.length);
    },
    transform(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      if (!t) return null;
      var r = [
        ...t
      ], { affinity: i = "forward" } = n;
      if (t.length === 0) return r;
      switch (e.type) {
        case "insert_node": {
          var { path: a } = e;
          (Me.equals(a, r) || Me.endsBefore(a, r) || Me.isAncestor(a, r)) && (r[a.length - 1] += 1);
          break;
        }
        case "remove_node": {
          var { path: s } = e;
          if (Me.equals(s, r) || Me.isAncestor(s, r)) return null;
          Me.endsBefore(s, r) && (r[s.length - 1] -= 1);
          break;
        }
        case "merge_node": {
          var { path: l, position: c } = e;
          Me.equals(l, r) || Me.endsBefore(l, r) ? r[l.length - 1] -= 1 : Me.isAncestor(l, r) && (r[l.length - 1] -= 1, r[l.length] += c);
          break;
        }
        case "split_node": {
          var { path: d, position: u } = e;
          if (Me.equals(d, r)) {
            if (i === "forward") r[r.length - 1] += 1;
            else if (i !== "backward") return null;
          } else Me.endsBefore(d, r) ? r[d.length - 1] += 1 : Me.isAncestor(d, r) && t[d.length] >= u && (r[d.length - 1] += 1, r[d.length] -= u);
          break;
        }
        case "move_node": {
          var { path: h, newPath: f } = e;
          if (Me.equals(h, f)) return r;
          if (Me.isAncestor(h, r) || Me.equals(h, r)) {
            var g = f.slice();
            return Me.endsBefore(h, f) && h.length < f.length && (g[h.length - 1] -= 1), g.concat(r.slice(h.length));
          } else Me.isSibling(h, f) && (Me.isAncestor(f, r) || Me.equals(f, r)) ? Me.endsBefore(h, r) ? r[h.length - 1] -= 1 : r[h.length - 1] += 1 : Me.endsBefore(f, r) || Me.equals(f, r) || Me.isAncestor(f, r) ? (Me.endsBefore(h, r) && (r[h.length - 1] -= 1), r[f.length - 1] += 1) : Me.endsBefore(h, r) && (Me.equals(f, r) && (r[f.length - 1] += 1), r[h.length - 1] -= 1);
          break;
        }
      }
      return r;
    }
  };
  function cb(t) {
    "@babel/helpers - typeof";
    return cb = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, cb(t);
  }
  function sIe(t, e) {
    if (cb(t) !== "object" || t === null) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (cb(r) !== "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function lIe(t) {
    var e = sIe(t, "string");
    return cb(e) === "symbol" ? e : String(e);
  }
  function ja(t, e, n) {
    return e = lIe(e), e in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function cIe(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function ih(t, e) {
    if (t == null) return {};
    var n = cIe(t, e), r, i;
    if (Object.getOwnPropertySymbols) {
      var a = Object.getOwnPropertySymbols(t);
      for (i = 0; i < a.length; i++) r = a[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }
  var dIe = [
    "anchor",
    "focus"
  ];
  function TK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function uIe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? TK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : TK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var _t = {
    edges(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { reverse: n = false } = e, { anchor: r, focus: i } = t;
      return _t.isBackward(t) === n ? [
        r,
        i
      ] : [
        i,
        r
      ];
    },
    end(t) {
      var [, e] = _t.edges(t);
      return e;
    },
    equals(t, e) {
      return ei.equals(t.anchor, e.anchor) && ei.equals(t.focus, e.focus);
    },
    surrounds(t, e) {
      var n = _t.intersection(t, e);
      return n ? _t.equals(n, e) : false;
    },
    includes(t, e) {
      if (vr.isRange(e)) {
        if (_t.includes(t, e.anchor) || _t.includes(t, e.focus)) return true;
        var [n, r] = _t.edges(t), [i, a] = _t.edges(e);
        return ei.isBefore(n, i) && ei.isAfter(r, a);
      }
      var [s, l] = _t.edges(t), c = false, d = false;
      return vr.isPoint(e) ? (c = ei.compare(e, s) >= 0, d = ei.compare(e, l) <= 0) : (c = Me.compare(e, s.path) >= 0, d = Me.compare(e, l.path) <= 0), c && d;
    },
    intersection(t, e) {
      var n = ih(t, dIe), [r, i] = _t.edges(t), [a, s] = _t.edges(e), l = ei.isBefore(r, a) ? a : r, c = ei.isBefore(i, s) ? i : s;
      return ei.isBefore(c, l) ? null : uIe({
        anchor: l,
        focus: c
      }, n);
    },
    isBackward(t) {
      var { anchor: e, focus: n } = t;
      return ei.isAfter(e, n);
    },
    isCollapsed(t) {
      var { anchor: e, focus: n } = t;
      return ei.equals(e, n);
    },
    isExpanded(t) {
      return !_t.isCollapsed(t);
    },
    isForward(t) {
      return !_t.isBackward(t);
    },
    isRange(t) {
      return La(t) && ei.isPoint(t.anchor) && ei.isPoint(t.focus);
    },
    *points(t) {
      yield [
        t.anchor,
        "anchor"
      ], yield [
        t.focus,
        "focus"
      ];
    },
    start(t) {
      var [e] = _t.edges(t);
      return e;
    },
    transform(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      if (t === null) return null;
      var { affinity: r = "inward" } = n, i, a;
      if (r === "inward") {
        var s = _t.isCollapsed(t);
        _t.isForward(t) ? (i = "forward", a = s ? i : "backward") : (i = "backward", a = s ? i : "forward");
      } else r === "outward" ? _t.isForward(t) ? (i = "backward", a = "forward") : (i = "forward", a = "backward") : (i = r, a = r);
      var l = ei.transform(t.anchor, e, {
        affinity: i
      }), c = ei.transform(t.focus, e, {
        affinity: a
      });
      return !l || !c ? null : {
        anchor: l,
        focus: c
      };
    }
  }, RK = function(e) {
    var { deep: n = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (!La(e)) return false;
    var r = typeof e.apply == "function";
    if (r) return false;
    var i = n ? Le.isNodeList(e.children) : Array.isArray(e.children);
    return i;
  }, Sg = {
    isAncestor(t) {
      var { deep: e = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return La(t) && Le.isNodeList(t.children, {
        deep: e
      });
    },
    isElement: RK,
    isElementList(t) {
      var { deep: e = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return Array.isArray(t) && t.every((n) => Sg.isElement(n, {
        deep: e
      }));
    },
    isElementProps(t) {
      return t.children !== void 0;
    },
    isElementType: function(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "type";
      return RK(e) && e[r] === n;
    },
    matches(t, e) {
      for (var n in e) if (n !== "children" && t[n] !== e[n]) return false;
      return true;
    }
  }, hIe = [
    "text"
  ], fIe = [
    "children"
  ];
  function AK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Sw(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? AK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : AK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Le = {
    ancestor(t, e) {
      var n = Le.get(t, e);
      if (Le.isText(n)) throw new Error("Cannot get the ancestor node at path [".concat(e, "] because it refers to a text node instead: ").concat(qo.stringify(n)));
      return n;
    },
    ancestors(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return (function* () {
        for (var r of Me.ancestors(e, n)) {
          var i = Le.ancestor(t, r), a = [
            i,
            r
          ];
          yield a;
        }
      })();
    },
    child(t, e) {
      if (Le.isText(t)) throw new Error("Cannot get the child of a text node: ".concat(qo.stringify(t)));
      var n = t.children[e];
      if (n == null) throw new Error("Cannot get child at index `".concat(e, "` in node: ").concat(qo.stringify(t)));
      return n;
    },
    children(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return (function* () {
        for (var { reverse: r = false } = n, i = Le.ancestor(t, e), { children: a } = i, s = r ? a.length - 1 : 0; r ? s >= 0 : s < a.length; ) {
          var l = Le.child(i, s), c = e.concat(s);
          yield [
            l,
            c
          ], s = r ? s - 1 : s + 1;
        }
      })();
    },
    common(t, e, n) {
      var r = Me.common(e, n), i = Le.get(t, r);
      return [
        i,
        r
      ];
    },
    descendant(t, e) {
      var n = Le.get(t, e);
      if (Le.isEditor(n)) throw new Error("Cannot get the descendant node at path [".concat(e, "] because it refers to the root editor node instead: ").concat(qo.stringify(n)));
      return n;
    },
    descendants(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return (function* () {
        for (var [n, r] of Le.nodes(t, e)) r.length !== 0 && (yield [
          n,
          r
        ]);
      })();
    },
    elements(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return (function* () {
        for (var [n, r] of Le.nodes(t, e)) Le.isElement(n) && (yield [
          n,
          r
        ]);
      })();
    },
    extractProps(t) {
      if (Le.isText(t)) {
        var e = ih(t, hIe);
        return e;
      } else {
        var e = ih(t, fIe);
        return e;
      }
    },
    first(t, e) {
      for (var n = e.slice(), r = Le.get(t, n); r && !(Le.isText(r) || r.children.length === 0); ) r = r.children[0], n.push(0);
      return [
        r,
        n
      ];
    },
    fragment(t, e) {
      var n = {
        children: t.children
      }, [r, i] = _t.edges(e), a = Le.nodes(n, {
        reverse: true,
        pass: (c) => {
          var [, d] = c;
          return !_t.includes(e, d);
        }
      }), s = function() {
        if (!_t.includes(e, l)) {
          var d = l[l.length - 1];
          Jm(n, Me.parent(l), (u) => fI(u, d, 1));
        }
        Me.equals(l, i.path) && uE(n, l, (u) => {
          var h = u.text.slice(0, i.offset);
          return Sw(Sw({}, u), {}, {
            text: h
          });
        }), Me.equals(l, r.path) && uE(n, l, (u) => {
          var h = u.text.slice(r.offset);
          return Sw(Sw({}, u), {}, {
            text: h
          });
        });
      };
      for (var [, l] of a) s();
      return n.children;
    },
    get(t, e) {
      var n = Le.getIf(t, e);
      if (n === void 0) throw new Error("Cannot find a descendant at path [".concat(e, "] in node: ").concat(qo.stringify(t)));
      return n;
    },
    getIf(t, e) {
      for (var n = t, r = 0; r < e.length; r++) {
        var i = e[r];
        if (Le.isText(n) || !n.children[i]) return;
        n = n.children[i];
      }
      return n;
    },
    has(t, e) {
      for (var n = t, r = 0; r < e.length; r++) {
        var i = e[r];
        if (Le.isText(n) || !n.children[i]) return false;
        n = n.children[i];
      }
      return true;
    },
    isAncestor(t) {
      return !Le.isText(t);
    },
    isEditor(t) {
      return typeof t.apply == "function";
    },
    isElement(t) {
      return Array.isArray(t.children) && typeof t.apply != "function";
    },
    isNode(t) {
      var { deep: e = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return Zo.isText(t) || Sg.isElement(t, {
        deep: e
      }) || fe.isEditor(t, {
        deep: e
      });
    },
    isNodeList(t) {
      var { deep: e = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return Array.isArray(t) && t.every((n) => Le.isNode(n, {
        deep: e
      }));
    },
    isText(t) {
      return typeof t.text == "string";
    },
    last(t, e) {
      for (var n = e.slice(), r = Le.get(t, n); r && !(Le.isText(r) || r.children.length === 0); ) {
        var i = r.children.length - 1;
        r = r.children[i], n.push(i);
      }
      return [
        r,
        n
      ];
    },
    leaf(t, e) {
      var n = Le.get(t, e);
      if (!Le.isText(n)) throw new Error("Cannot get the leaf node at path [".concat(e, "] because it refers to a non-leaf node: ").concat(qo.stringify(n)));
      return n;
    },
    levels(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return (function* () {
        for (var r of Me.levels(e, n)) {
          var i = Le.get(t, r);
          yield [
            i,
            r
          ];
        }
      })();
    },
    matches(t, e) {
      return Le.isElement(t) && Sg.isElementProps(e) && Sg.matches(t, e) || Le.isText(t) && Zo.isTextProps(e) && Zo.matches(t, e);
    },
    nodes(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return (function* () {
        for (var { pass: n, reverse: r = false } = e, { from: i = [], to: a } = e, s = /* @__PURE__ */ new Set(), l = [], c = t; !(a && (r ? Me.isBefore(l, a) : Me.isAfter(l, a))); ) {
          if (s.has(c) || (yield [
            c,
            l
          ]), !s.has(c) && !Le.isText(c) && c.children.length !== 0 && (n == null || n([
            c,
            l
          ]) === false)) {
            s.add(c);
            var d = r ? c.children.length - 1 : 0;
            Me.isAncestor(l, i) && (d = i[l.length]), l = l.concat(d), c = Le.get(t, l);
            continue;
          }
          if (l.length === 0) break;
          if (!r) {
            var u = Me.next(l);
            if (Le.has(t, u)) {
              l = u, c = Le.get(t, l);
              continue;
            }
          }
          if (r && l[l.length - 1] !== 0) {
            var h = Me.previous(l);
            l = h, c = Le.get(t, l);
            continue;
          }
          l = Me.parent(l), c = Le.get(t, l), s.add(c);
        }
      })();
    },
    parent(t, e) {
      var n = Me.parent(e), r = Le.get(t, n);
      if (Le.isText(r)) throw new Error("Cannot get the parent of path [".concat(e, "] because it does not exist in the root."));
      return r;
    },
    string(t) {
      return Le.isText(t) ? t.text : t.children.map(Le.string).join("");
    },
    texts(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return (function* () {
        for (var [n, r] of Le.nodes(t, e)) Le.isText(n) && (yield [
          n,
          r
        ]);
      })();
    }
  };
  function IK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Ni(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? IK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : IK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var bf = {
    isNodeOperation(t) {
      return bf.isOperation(t) && t.type.endsWith("_node");
    },
    isOperation(t) {
      if (!La(t)) return false;
      switch (t.type) {
        case "insert_node":
          return Me.isPath(t.path) && Le.isNode(t.node);
        case "insert_text":
          return typeof t.offset == "number" && typeof t.text == "string" && Me.isPath(t.path);
        case "merge_node":
          return typeof t.position == "number" && Me.isPath(t.path) && La(t.properties);
        case "move_node":
          return Me.isPath(t.path) && Me.isPath(t.newPath);
        case "remove_node":
          return Me.isPath(t.path) && Le.isNode(t.node);
        case "remove_text":
          return typeof t.offset == "number" && typeof t.text == "string" && Me.isPath(t.path);
        case "set_node":
          return Me.isPath(t.path) && La(t.properties) && La(t.newProperties);
        case "set_selection":
          return t.properties === null && _t.isRange(t.newProperties) || t.newProperties === null && _t.isRange(t.properties) || La(t.properties) && La(t.newProperties);
        case "split_node":
          return Me.isPath(t.path) && typeof t.position == "number" && La(t.properties);
        default:
          return false;
      }
    },
    isOperationList(t) {
      return Array.isArray(t) && t.every((e) => bf.isOperation(e));
    },
    isSelectionOperation(t) {
      return bf.isOperation(t) && t.type.endsWith("_selection");
    },
    isTextOperation(t) {
      return bf.isOperation(t) && t.type.endsWith("_text");
    },
    inverse(t) {
      switch (t.type) {
        case "insert_node":
          return Ni(Ni({}, t), {}, {
            type: "remove_node"
          });
        case "insert_text":
          return Ni(Ni({}, t), {}, {
            type: "remove_text"
          });
        case "merge_node":
          return Ni(Ni({}, t), {}, {
            type: "split_node",
            path: Me.previous(t.path)
          });
        case "move_node": {
          var { newPath: e, path: n } = t;
          if (Me.equals(e, n)) return t;
          if (Me.isSibling(n, e)) return Ni(Ni({}, t), {}, {
            path: e,
            newPath: n
          });
          var r = Me.transform(n, t), i = Me.transform(Me.next(n), t);
          return Ni(Ni({}, t), {}, {
            path: r,
            newPath: i
          });
        }
        case "remove_node":
          return Ni(Ni({}, t), {}, {
            type: "insert_node"
          });
        case "remove_text":
          return Ni(Ni({}, t), {}, {
            type: "insert_text"
          });
        case "set_node": {
          var { properties: a, newProperties: s } = t;
          return Ni(Ni({}, t), {}, {
            properties: s,
            newProperties: a
          });
        }
        case "set_selection": {
          var { properties: l, newProperties: c } = t;
          return l == null ? Ni(Ni({}, t), {}, {
            properties: c,
            newProperties: null
          }) : c == null ? Ni(Ni({}, t), {}, {
            properties: null,
            newProperties: l
          }) : Ni(Ni({}, t), {}, {
            properties: c,
            newProperties: l
          });
        }
        case "split_node":
          return Ni(Ni({}, t), {}, {
            type: "merge_node",
            path: Me.next(t.path)
          });
      }
    }
  }, La = (t) => typeof t == "object" && t !== null, Sse = (t, e) => {
    for (var n in t) {
      var r = t[n], i = e[n];
      if (Array.isArray(r) && Array.isArray(i)) {
        if (r.length !== i.length) return false;
        for (var a = 0; a < r.length; a++) if (r[a] !== i[a]) return false;
      } else if (La(r) && La(i)) {
        if (!Sse(r, i)) return false;
      } else if (r !== i) return false;
    }
    for (var s in e) if (t[s] === void 0 && e[s] !== void 0) return false;
    return true;
  }, GP = (t) => t.selection ? t.selection : t.children.length > 0 ? fe.end(t, []) : [
    0
  ], GF = (t, e) => {
    var [n] = fe.node(t, e);
    return (r) => r === n;
  }, YP = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, r = !n, i = n ? _Ie(e) : e, a = hr.None, s = hr.None, l = 0, c = null, d = null;
    for (var u of i) {
      var h = u.codePointAt(0);
      if (!h) break;
      var f = RIe(u, h);
      if ([a, s] = r ? [
        s,
        f
      ] : [
        f,
        a
      ], $0(a, hr.ZWJ) && $0(s, hr.ExtPict) && (r ? c = BK(e.substring(0, l)) : c = BK(e.substring(0, e.length - l)), !c) || $0(a, hr.RI) && $0(s, hr.RI) && (d !== null ? d = !d : r ? d = true : d = MIe(e.substring(0, e.length - l)), !d) || a !== hr.None && s !== hr.None && IIe(a, s)) break;
      l += u.length;
    }
    return l || 1;
  }, mIe = /\s/, gIe = /[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, pIe = /['\u2018\u2019]/, FIe = function(e) {
    for (var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, r = 0, i = false; e.length > 0; ) {
      var a = YP(e, n), [s, l] = ZP(e, a, n);
      if (vIe(s, l, n)) i = true, r += a;
      else if (!i) r += a;
      else break;
      e = l;
    }
    return r;
  }, ZP = (t, e, n) => {
    if (n) {
      var r = t.length - e;
      return [
        t.slice(r, t.length),
        t.slice(0, r)
      ];
    }
    return [
      t.slice(0, e),
      t.slice(e)
    ];
  }, vIe = function t(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    if (mIe.test(e)) return false;
    if (pIe.test(e)) {
      var i = YP(n, r), [a, s] = ZP(n, i, r);
      if (t(a, s, r)) return true;
    }
    return !gIe.test(e);
  }, _Ie = function* (e) {
    for (var n = e.length - 1, r = 0; r < e.length; r++) {
      var i = e.charAt(n - r);
      if (bIe(i.charCodeAt(0))) {
        var a = e.charAt(n - r - 1);
        if (yIe(a.charCodeAt(0))) {
          yield a + i, r++;
          continue;
        }
      }
      yield i;
    }
  }, yIe = (t) => t >= 55296 && t <= 56319, bIe = (t) => t >= 56320 && t <= 57343, hr;
  (function(t) {
    t[t.None = 0] = "None", t[t.Extend = 1] = "Extend", t[t.ZWJ = 2] = "ZWJ", t[t.RI = 4] = "RI", t[t.Prepend = 8] = "Prepend", t[t.SpacingMark = 16] = "SpacingMark", t[t.L = 32] = "L", t[t.V = 64] = "V", t[t.T = 128] = "T", t[t.LV = 256] = "LV", t[t.LVT = 512] = "LVT", t[t.ExtPict = 1024] = "ExtPict", t[t.Any = 2048] = "Any";
  })(hr || (hr = {}));
  var xIe = /^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/, wIe = /^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/, DIe = /^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/, CIe = /^[\u1100-\u115F\uA960-\uA97C]$/, EIe = /^[\u1160-\u11A7\uD7B0-\uD7C6]$/, kIe = /^[\u11A8-\u11FF\uD7CB-\uD7FB]$/, SIe = /^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/, jIe = /^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/, TIe = /^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/, RIe = (t, e) => {
    var n = hr.Any;
    return t.search(xIe) !== -1 && (n |= hr.Extend), e === 8205 && (n |= hr.ZWJ), e >= 127462 && e <= 127487 && (n |= hr.RI), t.search(wIe) !== -1 && (n |= hr.Prepend), t.search(DIe) !== -1 && (n |= hr.SpacingMark), t.search(CIe) !== -1 && (n |= hr.L), t.search(EIe) !== -1 && (n |= hr.V), t.search(kIe) !== -1 && (n |= hr.T), t.search(SIe) !== -1 && (n |= hr.LV), t.search(jIe) !== -1 && (n |= hr.LVT), t.search(TIe) !== -1 && (n |= hr.ExtPict), n;
  };
  function $0(t, e) {
    return (t & e) !== 0;
  }
  var AIe = [
    [
      hr.L,
      hr.L | hr.V | hr.LV | hr.LVT
    ],
    [
      hr.LV | hr.V,
      hr.V | hr.T
    ],
    [
      hr.LVT | hr.T,
      hr.T
    ],
    [
      hr.Any,
      hr.Extend | hr.ZWJ
    ],
    [
      hr.Any,
      hr.SpacingMark
    ],
    [
      hr.Prepend,
      hr.Any
    ],
    [
      hr.ZWJ,
      hr.ExtPict
    ],
    [
      hr.RI,
      hr.RI
    ]
  ];
  function IIe(t, e) {
    return AIe.findIndex((n) => $0(t, n[0]) && $0(e, n[1])) === -1;
  }
  var BIe = /(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/, BK = (t) => t.search(BIe) !== -1, PIe = /(?:\uD83C[\uDDE6-\uDDFF])+$/g, MIe = (t) => {
    var e = t.match(PIe);
    if (e === null) return false;
    var n = e[0].length / 2;
    return n % 2 === 1;
  }, OIe = function(e) {
    var { deep: n = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (!La(e)) return false;
    var r = typeof e.above == "function" && typeof e.addMark == "function" && typeof e.after == "function" && typeof e.apply == "function" && typeof e.before == "function" && typeof e.collapse == "function" && typeof e.delete == "function" && typeof e.deleteBackward == "function" && typeof e.deleteForward == "function" && typeof e.deleteFragment == "function" && typeof e.deselect == "function" && typeof e.edges == "function" && typeof e.elementReadOnly == "function" && typeof e.end == "function" && typeof e.first == "function" && typeof e.fragment == "function" && typeof e.getDirtyPaths == "function" && typeof e.getFragment == "function" && typeof e.getMarks == "function" && typeof e.hasBlocks == "function" && typeof e.hasInlines == "function" && typeof e.hasPath == "function" && typeof e.hasTexts == "function" && typeof e.insertBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertNodes == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertText == "function" && typeof e.isBlock == "function" && typeof e.isEdge == "function" && typeof e.isElementReadOnly == "function" && typeof e.isEmpty == "function" && typeof e.isEnd == "function" && typeof e.isInline == "function" && typeof e.isNormalizing == "function" && typeof e.isSelectable == "function" && typeof e.isStart == "function" && typeof e.isVoid == "function" && typeof e.last == "function" && typeof e.leaf == "function" && typeof e.levels == "function" && typeof e.liftNodes == "function" && typeof e.markableVoid == "function" && typeof e.mergeNodes == "function" && typeof e.move == "function" && typeof e.moveNodes == "function" && typeof e.next == "function" && typeof e.node == "function" && typeof e.nodes == "function" && typeof e.normalize == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.parent == "function" && typeof e.path == "function" && typeof e.pathRef == "function" && typeof e.pathRefs == "function" && typeof e.point == "function" && typeof e.pointRef == "function" && typeof e.pointRefs == "function" && typeof e.positions == "function" && typeof e.previous == "function" && typeof e.range == "function" && typeof e.rangeRef == "function" && typeof e.rangeRefs == "function" && typeof e.removeMark == "function" && typeof e.removeNodes == "function" && typeof e.select == "function" && typeof e.setNodes == "function" && typeof e.setNormalizing == "function" && typeof e.setPoint == "function" && typeof e.setSelection == "function" && typeof e.shouldMergeNodesRemovePrevNode == "function" && typeof e.shouldNormalize == "function" && typeof e.splitNodes == "function" && typeof e.start == "function" && typeof e.string == "function" && typeof e.unhangRange == "function" && typeof e.unsetNodes == "function" && typeof e.unwrapNodes == "function" && typeof e.void == "function" && typeof e.withoutNormalizing == "function" && typeof e.wrapNodes == "function" && (e.marks === null || La(e.marks)) && (e.selection === null || _t.isRange(e.selection)) && (n ? Le.isNodeList(e.children) && bf.isOperationList(e.operations) : Array.isArray(e.children) && Array.isArray(e.operations));
    return r;
  }, fe = {
    above(t, e) {
      return t.above(e);
    },
    addMark(t, e, n) {
      t.addMark(e, n);
    },
    after(t, e, n) {
      return t.after(e, n);
    },
    before(t, e, n) {
      return t.before(e, n);
    },
    deleteBackward(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { unit: n = "character" } = e;
      t.deleteBackward(n);
    },
    deleteForward(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { unit: n = "character" } = e;
      t.deleteForward(n);
    },
    deleteFragment(t, e) {
      t.deleteFragment(e);
    },
    edges(t, e) {
      return t.edges(e);
    },
    elementReadOnly(t) {
      var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return t.elementReadOnly(e);
    },
    end(t, e) {
      return t.end(e);
    },
    first(t, e) {
      return t.first(e);
    },
    fragment(t, e) {
      return t.fragment(e);
    },
    hasBlocks(t, e) {
      return t.hasBlocks(e);
    },
    hasInlines(t, e) {
      return t.hasInlines(e);
    },
    hasPath(t, e) {
      return t.hasPath(e);
    },
    hasTexts(t, e) {
      return t.hasTexts(e);
    },
    insertBreak(t) {
      t.insertBreak();
    },
    insertFragment(t, e, n) {
      t.insertFragment(e, n);
    },
    insertNode(t, e) {
      t.insertNode(e);
    },
    insertSoftBreak(t) {
      t.insertSoftBreak();
    },
    insertText(t, e) {
      t.insertText(e);
    },
    isBlock(t, e) {
      return t.isBlock(e);
    },
    isEdge(t, e, n) {
      return t.isEdge(e, n);
    },
    isEditor: OIe,
    isElementReadOnly(t, e) {
      return t.isElementReadOnly(e);
    },
    isEmpty(t, e) {
      return t.isEmpty(e);
    },
    isEnd(t, e, n) {
      return t.isEnd(e, n);
    },
    isInline(t, e) {
      return t.isInline(e);
    },
    isNormalizing(t) {
      return t.isNormalizing();
    },
    isSelectable(t, e) {
      return t.isSelectable(e);
    },
    isStart(t, e, n) {
      return t.isStart(e, n);
    },
    isVoid(t, e) {
      return t.isVoid(e);
    },
    last(t, e) {
      return t.last(e);
    },
    leaf(t, e, n) {
      return t.leaf(e, n);
    },
    levels(t, e) {
      return t.levels(e);
    },
    marks(t) {
      return t.getMarks();
    },
    next(t, e) {
      return t.next(e);
    },
    node(t, e, n) {
      return t.node(e, n);
    },
    nodes(t, e) {
      return t.nodes(e);
    },
    normalize(t, e) {
      t.normalize(e);
    },
    parent(t, e, n) {
      return t.parent(e, n);
    },
    path(t, e, n) {
      return t.path(e, n);
    },
    pathRef(t, e, n) {
      return t.pathRef(e, n);
    },
    pathRefs(t) {
      return t.pathRefs();
    },
    point(t, e, n) {
      return t.point(e, n);
    },
    pointRef(t, e, n) {
      return t.pointRef(e, n);
    },
    pointRefs(t) {
      return t.pointRefs();
    },
    positions(t, e) {
      return t.positions(e);
    },
    previous(t, e) {
      return t.previous(e);
    },
    range(t, e, n) {
      return t.range(e, n);
    },
    rangeRef(t, e, n) {
      return t.rangeRef(e, n);
    },
    rangeRefs(t) {
      return t.rangeRefs();
    },
    removeMark(t, e) {
      t.removeMark(e);
    },
    setNormalizing(t, e) {
      t.setNormalizing(e);
    },
    start(t, e) {
      return t.start(e);
    },
    string(t, e, n) {
      return t.string(e, n);
    },
    unhangRange(t, e, n) {
      return t.unhangRange(e, n);
    },
    void(t, e) {
      return t.void(e);
    },
    withoutNormalizing(t, e) {
      t.withoutNormalizing(e);
    },
    shouldMergeNodesRemovePrevNode: (t, e, n) => t.shouldMergeNodesRemovePrevNode(e, n)
  }, vr = {
    isLocation(t) {
      return Me.isPath(t) || ei.isPoint(t) || _t.isRange(t);
    },
    isPath(t) {
      return Array.isArray(t);
    },
    isPoint(t) {
      return "offset" in t;
    },
    isRange(t) {
      return "anchor" in t;
    },
    isSpan(t) {
      return Array.isArray(t) && Array.isArray(t[0]);
    }
  };
  function PK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function MK(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? PK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : PK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var ei = {
    compare(t, e) {
      var n = Me.compare(t.path, e.path);
      return n === 0 ? t.offset < e.offset ? -1 : t.offset > e.offset ? 1 : 0 : n;
    },
    isAfter(t, e) {
      return ei.compare(t, e) === 1;
    },
    isBefore(t, e) {
      return ei.compare(t, e) === -1;
    },
    equals(t, e) {
      return t.offset === e.offset && Me.equals(t.path, e.path);
    },
    isPoint(t) {
      return La(t) && typeof t.offset == "number" && Me.isPath(t.path);
    },
    transform(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      if (t === null) return null;
      var { affinity: r = "forward" } = n, { path: i, offset: a } = t;
      switch (e.type) {
        case "insert_node":
        case "move_node": {
          i = Me.transform(i, e, n);
          break;
        }
        case "insert_text": {
          Me.equals(e.path, i) && (e.offset < a || e.offset === a && r === "forward") && (a += e.text.length);
          break;
        }
        case "merge_node": {
          Me.equals(e.path, i) && (a += e.position), i = Me.transform(i, e, n);
          break;
        }
        case "remove_text": {
          Me.equals(e.path, i) && e.offset <= a && (a -= Math.min(a - e.offset, e.text.length));
          break;
        }
        case "remove_node": {
          if (Me.equals(e.path, i) || Me.isAncestor(e.path, i)) return null;
          i = Me.transform(i, e, n);
          break;
        }
        case "split_node": {
          if (Me.equals(e.path, i)) {
            if (e.position === a && r == null) return null;
            (e.position < a || e.position === a && r === "forward") && (a -= e.position, i = Me.transform(i, e, MK(MK({}, n), {}, {
              affinity: "forward"
            })));
          } else i = Me.transform(i, e, n);
          break;
        }
        default:
          return t;
      }
      return {
        path: i,
        offset: a
      };
    }
  }, OK = void 0, qo = {
    setScrubber(t) {
      OK = t;
    },
    stringify(t) {
      return JSON.stringify(t, OK);
    }
  }, LIe = [
    "text"
  ], NIe = [
    "anchor",
    "focus",
    "merge"
  ];
  function LK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function vu(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? LK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : LK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Zo = {
    equals(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { loose: r = false } = n;
      function i(a) {
        var s = ih(a, LIe);
        return s;
      }
      return Sse(r ? i(t) : t, r ? i(e) : e);
    },
    isText(t) {
      return La(t) && typeof t.text == "string";
    },
    isTextList(t) {
      return Array.isArray(t) && t.every((e) => Zo.isText(e));
    },
    isTextProps(t) {
      return t.text !== void 0;
    },
    matches(t, e) {
      for (var n in e) if (n !== "text" && (!t.hasOwnProperty(n) || t[n] !== e[n])) return false;
      return true;
    },
    decorations(t, e) {
      var n = [
        {
          leaf: vu({}, t)
        }
      ];
      for (var r of e) {
        var { anchor: i, focus: a, merge: s } = r, l = ih(r, NIe), [c, d] = _t.edges(r), u = [], h = 0, f = c.offset, g = d.offset, m = s ?? Object.assign;
        for (var { leaf: v } of n) {
          var { length: y } = v.text, w = h;
          if (h += y, f <= w && h <= g) {
            m(v, l), u.push({
              leaf: v
            });
            continue;
          }
          if (f !== g && (f === h || g === w) || f > h || g < w || g === w && w !== 0) {
            u.push({
              leaf: v
            });
            continue;
          }
          var b = v, j = void 0, k = void 0;
          if (g < h) {
            var C = g - w;
            k = {
              leaf: vu(vu({}, b), {}, {
                text: b.text.slice(C)
              })
            }, b = vu(vu({}, b), {}, {
              text: b.text.slice(0, C)
            });
          }
          if (f > w) {
            var x = f - w;
            j = {
              leaf: vu(vu({}, b), {}, {
                text: b.text.slice(0, x)
              })
            }, b = vu(vu({}, b), {}, {
              text: b.text.slice(x)
            });
          }
          m(b, l), j && u.push(j), u.push({
            leaf: b
          }), k && u.push(k);
        }
        n = u;
      }
      if (n.length > 1) {
        var S = 0;
        for (var [T, A] of n.entries()) {
          var B = S, U = B + A.leaf.text.length, z = {
            start: B,
            end: U
          };
          T === 0 && (z.isFirst = true), T === n.length - 1 && (z.isLast = true), A.position = z, S = U;
        }
      }
      return n;
    }
  };
  function NK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function dE(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? NK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : NK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var zK = function(e, n) {
    for (var r = arguments.length, i = new Array(r > 2 ? r - 2 : 0), a = 2; a < r; a++) i[a - 2] = arguments[a];
    return [
      ...e.slice(0, n),
      ...i,
      ...e.slice(n)
    ];
  }, db = function(e, n, r) {
    for (var i = arguments.length, a = new Array(i > 3 ? i - 3 : 0), s = 3; s < i; s++) a[s - 3] = arguments[s];
    return [
      ...e.slice(0, n),
      ...a,
      ...e.slice(n + r)
    ];
  }, fI = db, JP = (t, e, n) => {
    if (e.length === 0) throw new Error("Cannot modify the editor");
    for (var r = Le.get(t, e), i = e.slice(), a = n(r); i.length > 1; ) {
      var s = i.pop(), l = Le.get(t, i);
      a = dE(dE({}, l), {}, {
        children: db(l.children, s, 1, a)
      });
    }
    var c = i.pop();
    t.children = db(t.children, c, 1, a);
  }, Jm = (t, e, n) => {
    e.length === 0 ? t.children = n(t.children) : JP(t, e, (r) => {
      if (Le.isText(r)) throw new Error("Cannot get the element at path [".concat(e, "] because it refers to a leaf node: ").concat(qo.stringify(r)));
      return dE(dE({}, r), {}, {
        children: n(r.children)
      });
    });
  }, uE = (t, e, n) => JP(t, e, (r) => {
    if (!Le.isText(r)) throw new Error("Cannot get the leaf node at path [".concat(e, "] because it refers to a non-leaf node: ").concat(qo.stringify(r)));
    return n(r);
  });
  function UK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function po(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? UK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : UK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var zIe = {
    transform(t, e) {
      var n = false;
      switch (e.type) {
        case "insert_node": {
          var { path: r, node: i } = e;
          Jm(t, Me.parent(r), (G) => {
            var le = r[r.length - 1];
            if (le > G.length) throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r, "] because the destination is past the end of the node."));
            return zK(G, le, i);
          }), n = true;
          break;
        }
        case "insert_text": {
          var { path: a, offset: s, text: l } = e;
          if (l.length === 0) break;
          uE(t, a, (G) => {
            var le = G.text.slice(0, s), te = G.text.slice(s);
            return po(po({}, G), {}, {
              text: le + l + te
            });
          }), n = true;
          break;
        }
        case "merge_node": {
          var { path: c } = e, d = c[c.length - 1], u = Me.previous(c), h = u[u.length - 1];
          Jm(t, Me.parent(c), (G) => {
            var le = G[d], te = G[h], re;
            if (Le.isText(le) && Le.isText(te)) re = po(po({}, te), {}, {
              text: te.text + le.text
            });
            else if (Le.isElement(le) && Le.isElement(te)) re = po(po({}, te), {}, {
              children: te.children.concat(le.children)
            });
            else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(c, "] to nodes of different interfaces: ").concat(qo.stringify(le), " ").concat(qo.stringify(te)));
            return db(G, h, 2, re);
          }), n = true;
          break;
        }
        case "move_node": {
          var { path: f, newPath: g } = e, m = f[f.length - 1];
          if (Me.isAncestor(f, g)) throw new Error("Cannot move a path [".concat(f, "] to new path [").concat(g, "] because the destination is inside itself."));
          var v = Le.get(t, f);
          Jm(t, Me.parent(f), (G) => fI(G, m, 1));
          var y = Me.transform(f, e), w = y[y.length - 1];
          Jm(t, Me.parent(y), (G) => zK(G, w, v)), n = true;
          break;
        }
        case "remove_node": {
          var { path: b } = e, j = b[b.length - 1];
          if (Jm(t, Me.parent(b), (G) => fI(G, j, 1)), t.selection) {
            var k = po({}, t.selection);
            for (var [C, x] of _t.points(k)) {
              var S = ei.transform(C, e);
              if (k != null && S != null) k[x] = S;
              else {
                var T = void 0, A = void 0;
                for (var [B, U] of Le.texts(t)) if (Me.compare(U, b) === -1) T = [
                  B,
                  U
                ];
                else {
                  A = [
                    B,
                    U
                  ];
                  break;
                }
                var z = false;
                T && A && (Me.isSibling(T[1], b) ? z = false : Me.equals(A[1], b) ? z = true : z = Me.common(T[1], b).length < Me.common(A[1], b).length), T && !z ? k[x] = {
                  path: T[1],
                  offset: T[0].text.length
                } : A ? k[x] = {
                  path: A[1],
                  offset: 0
                } : k = null;
              }
            }
            (!k || !_t.equals(k, t.selection)) && (t.selection = k);
          }
          break;
        }
        case "remove_text": {
          var { path: O, offset: M, text: I } = e;
          if (I.length === 0) break;
          uE(t, O, (G) => {
            var le = G.text.slice(0, M), te = G.text.slice(M + I.length);
            return po(po({}, G), {}, {
              text: le + te
            });
          }), n = true;
          break;
        }
        case "set_node": {
          var { path: N, properties: L, newProperties: H } = e;
          if (N.length === 0) throw new Error("Cannot set properties on the root node!");
          JP(t, N, (G) => {
            var le = po({}, G);
            for (var te in H) {
              if (te === "children" || te === "text") throw new Error('Cannot set the "'.concat(te, '" property of nodes!'));
              var re = H[te];
              re == null ? delete le[te] : le[te] = re;
            }
            for (var he in L) H.hasOwnProperty(he) || delete le[he];
            return le;
          });
          break;
        }
        case "set_selection": {
          var { newProperties: V } = e;
          if (V == null) {
            t.selection = null;
            break;
          }
          if (t.selection == null) {
            if (!(V.anchor && V.focus)) throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(qo.stringify(V), " when there is no current selection."));
            t.selection = po({}, V);
            break;
          }
          var Z = po({}, t.selection);
          for (var Y in V) {
            var oe = V[Y];
            if (oe == null) {
              if (Y === "anchor" || Y === "focus") throw new Error('Cannot remove the "'.concat(Y, '" selection property'));
              delete Z[Y];
            } else Z[Y] = oe;
          }
          t.selection = Z;
          break;
        }
        case "split_node": {
          var { path: ue, position: ie, properties: de } = e, ne = ue[ue.length - 1];
          if (ue.length === 0) throw new Error('Cannot apply a "split_node" operation at path ['.concat(ue, "] because the root node cannot be split."));
          Jm(t, Me.parent(ue), (G) => {
            var le = G[ne], te, re;
            if (Le.isText(le)) {
              var he = le.text.slice(0, ie), se = le.text.slice(ie);
              te = po(po({}, le), {}, {
                text: he
              }), re = po(po({}, de), {}, {
                text: se
              });
            } else {
              var ye = le.children.slice(0, ie), we = le.children.slice(ie);
              te = po(po({}, le), {}, {
                children: ye
              }), re = po(po({}, de), {}, {
                children: we
              });
            }
            return db(G, ne, 1, te, re);
          }), n = true;
          break;
        }
      }
      if (n && t.selection) {
        var ae = po({}, t.selection);
        for (var [X, K] of _t.points(ae)) ae[K] = ei.transform(X, e);
        _t.equals(ae, t.selection) || (t.selection = ae);
      }
    }
  }, UIe = {
    insertNodes(t, e, n) {
      t.insertNodes(e, n);
    },
    liftNodes(t, e) {
      t.liftNodes(e);
    },
    mergeNodes(t, e) {
      t.mergeNodes(e);
    },
    moveNodes(t, e) {
      t.moveNodes(e);
    },
    removeNodes(t, e) {
      t.removeNodes(e);
    },
    setNodes(t, e, n) {
      t.setNodes(e, n);
    },
    splitNodes(t, e) {
      t.splitNodes(e);
    },
    unsetNodes(t, e, n) {
      t.unsetNodes(e, n);
    },
    unwrapNodes(t, e) {
      t.unwrapNodes(e);
    },
    wrapNodes(t, e, n) {
      t.wrapNodes(e, n);
    }
  }, VIe = {
    collapse(t, e) {
      t.collapse(e);
    },
    deselect(t) {
      t.deselect();
    },
    move(t, e) {
      t.move(e);
    },
    select(t, e) {
      t.select(e);
    },
    setPoint(t, e, n) {
      t.setPoint(e, n);
    },
    setSelection(t, e) {
      t.setSelection(e);
    }
  }, HIe = {
    delete(t, e) {
      t.delete(e);
    },
    insertFragment(t, e, n) {
      t.insertFragment(e, n);
    },
    insertText(t, e) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      fe.withoutNormalizing(t, () => {
        var { voids: r = false } = n, { at: i = GP(t) } = n;
        if (vr.isPath(i) && (i = fe.range(t, i)), vr.isRange(i)) if (_t.isCollapsed(i)) i = i.anchor;
        else {
          var a = _t.end(i);
          if (!r && fe.void(t, {
            at: a
          })) return;
          var s = _t.start(i), l = fe.pointRef(t, s), c = fe.pointRef(t, a);
          xt.delete(t, {
            at: i,
            voids: r
          });
          var d = l.unref(), u = c.unref();
          i = d || u, xt.setSelection(t, {
            anchor: i,
            focus: i
          });
        }
        if (!(!r && fe.void(t, {
          at: i
        }) || fe.elementReadOnly(t, {
          at: i
        }))) {
          var { path: h, offset: f } = i;
          e.length > 0 && t.apply({
            type: "insert_text",
            path: h,
            offset: f,
            text: e
          });
        }
      });
    }
  };
  function VK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function jw(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? VK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : VK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var xt = jw(jw(jw(jw({}, zIe), UIe), VIe), HIe), GD = /* @__PURE__ */ new WeakMap(), $Ie = (t) => GD.get(t) || false, WIe = (t, e, n) => {
    var r = GD.get(t) || false;
    GD.set(t, true);
    try {
      e(), n();
    } finally {
      GD.set(t, r);
    }
  };
  function jse(t, e, n) {
    var r = lE.get(t) || [], i = cE.get(t) || /* @__PURE__ */ new Set(), a, s, l = (h) => {
      if (h) {
        var f = h.join(",");
        s.has(f) || (s.add(f), a.push(h));
      }
    };
    if (n) {
      a = [], s = /* @__PURE__ */ new Set();
      for (var c of r) {
        var d = n(c);
        l(d);
      }
    } else a = r, s = i;
    for (var u of e) l(u);
    lE.set(t, a), cE.set(t, s);
  }
  var qIe = (t, e) => {
    for (var n of fe.pathRefs(t)) iIe.transform(n, e);
    for (var r of fe.pointRefs(t)) oIe.transform(r, e);
    for (var i of fe.rangeRefs(t)) aIe.transform(i, e);
    if (!$Ie(t)) {
      var a = Me.operationCanTransformPath(e) ? (s) => Me.transform(s, e) : void 0;
      jse(t, t.getDirtyPaths(e), a);
    }
    xt.transform(t, e), t.operations.push(e), fe.normalize(t, {
      operation: e
    }), e.type === "set_selection" && (t.marks = null), n2.get(t) || (n2.set(t, true), Promise.resolve().then(() => {
      n2.set(t, false), t.onChange({
        operation: e
      }), t.operations = [];
    }));
  }, KIe = (t, e) => {
    switch (e.type) {
      case "insert_text":
      case "remove_text":
      case "set_node": {
        var { path: n } = e;
        return Me.levels(n);
      }
      case "insert_node": {
        var { node: r, path: i } = e, a = Me.levels(i), s = Le.isText(r) ? [] : Array.from(Le.nodes(r), (B) => {
          var [, U] = B;
          return i.concat(U);
        });
        return [
          ...a,
          ...s
        ];
      }
      case "merge_node": {
        var { path: l } = e, c = Me.ancestors(l), d = Me.previous(l);
        return [
          ...c,
          d
        ];
      }
      case "move_node": {
        var { path: u, newPath: h } = e;
        if (Me.equals(u, h)) return [];
        var f = [], g = [];
        for (var m of Me.ancestors(u)) {
          var v = Me.transform(m, e);
          f.push(v);
        }
        for (var y of Me.ancestors(h)) {
          var w = Me.transform(y, e);
          g.push(w);
        }
        var b = g[g.length - 1], j = h[h.length - 1], k = b.concat(j);
        return [
          ...f,
          ...g,
          k
        ];
      }
      case "remove_node": {
        var { path: C } = e, x = Me.ancestors(C);
        return [
          ...x
        ];
      }
      case "split_node": {
        var { path: S } = e, T = Me.levels(S), A = Me.next(S);
        return [
          ...T,
          A
        ];
      }
      default:
        return [];
    }
  }, GIe = (t) => {
    var { selection: e } = t;
    return e ? Le.fragment(t, e) : [];
  }, YIe = (t, e, n) => {
    var [r, i] = e;
    if (!Le.isText(r)) {
      "children" in r || (r.children = []);
      var a = r;
      if (a !== t && a.children.length === 0) {
        var s = {
          text: ""
        };
        xt.insertNodes(t, s, {
          at: i.concat(0),
          voids: true
        }), a = Le.get(t, i);
      }
      var l = a !== t && (t.isInline(a) || Le.isText(a.children[0]) || t.isInline(a.children[0]));
      if (l) for (var c = 0; c < a.children.length; c++) {
        var d = a.children[c], u = a.children[c - 1];
        if (Le.isText(d)) u != null && Le.isText(u) && (d.text === "" ? (xt.removeNodes(t, {
          at: i.concat(c),
          voids: true
        }), a = Le.get(t, i), c--) : u.text === "" ? (xt.removeNodes(t, {
          at: i.concat(c - 1),
          voids: true
        }), a = Le.get(t, i), c--) : Zo.equals(d, u, {
          loose: true
        }) && (xt.mergeNodes(t, {
          at: i.concat(c),
          voids: true
        }), a = Le.get(t, i), c--));
        else if (t.isInline(d)) {
          if (u == null || !Le.isText(u)) {
            var h = {
              text: ""
            };
            xt.insertNodes(t, h, {
              at: i.concat(c),
              voids: true
            }), a = Le.get(t, i), c++;
          }
          if (c === a.children.length - 1) {
            var f = {
              text: ""
            };
            xt.insertNodes(t, f, {
              at: i.concat(c + 1),
              voids: true
            }), a = Le.get(t, i), c++;
          }
        } else xt.unwrapNodes(t, {
          at: i.concat(c),
          voids: true
        }), a = Le.get(t, i), c--;
      }
      else for (var g = 0; g < a.children.length; g++) {
        var m = a.children[g];
        (Le.isText(m) || t.isInline(m)) && (n != null && n.fallbackElement ? xt.wrapNodes(t, n.fallbackElement(), {
          at: i.concat(g),
          voids: true
        }) : xt.removeNodes(t, {
          at: i.concat(g),
          voids: true
        }), a = Le.get(t, i), g--);
      }
    }
  }, ZIe = (t, e) => {
    var { iteration: n, initialDirtyPathsLength: r } = e, i = r * 42;
    if (n > i) throw new Error("Could not completely normalize the editor after ".concat(i, " iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));
    return true;
  }, JIe = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { voids: r = false, mode: i = "lowest", at: a = e.selection, match: s } = n;
    if (a) {
      var l = fe.path(e, a);
      if (!vr.isRange(a) || Me.equals(a.focus.path, a.anchor.path)) {
        if (l.length === 0) return;
        l = Me.parent(l);
      }
      var c = i === "lowest", [d] = fe.levels(e, {
        at: l,
        voids: r,
        match: s,
        reverse: c
      });
      return d;
    }
  };
  function HK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function $K(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? HK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : HK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var XIe = (t, e, n) => {
    var { selection: r } = t;
    if (r) {
      var i = (h, f) => {
        if (!Le.isText(h)) return false;
        var [g, m] = fe.parent(t, f);
        return !t.isVoid(g) || t.markableVoid(g);
      }, a = _t.isExpanded(r), s = false;
      if (!a) {
        var [l, c] = fe.node(t, r);
        if (l && i(l, c)) {
          var [d] = fe.parent(t, c);
          s = d && t.markableVoid(d);
        }
      }
      if (a || s) xt.setNodes(t, {
        [e]: n
      }, {
        match: i,
        split: true,
        voids: true
      });
      else {
        var u = $K($K({}, fe.marks(t) || {}), {}, {
          [e]: n
        });
        t.marks = u, n2.get(t) || t.onChange();
      }
    }
  };
  function WK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function qK(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? WK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : WK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var QIe = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = fe.point(e, n, {
      edge: "end"
    }), a = fe.end(e, []), s = {
      anchor: i,
      focus: a
    }, { distance: l = 1 } = r, c = 0, d;
    for (var u of fe.positions(e, qK(qK({}, r), {}, {
      at: s
    }))) {
      if (c > l) break;
      c !== 0 && (d = u), c++;
    }
    return d;
  };
  function KK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function GK(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? KK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : KK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var e8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = fe.start(e, []), a = fe.point(e, n, {
      edge: "start"
    }), s = {
      anchor: i,
      focus: a
    }, { distance: l = 1 } = r, c = 0, d;
    for (var u of fe.positions(e, GK(GK({}, r), {}, {
      at: s,
      reverse: true
    }))) {
      if (c > l) break;
      c !== 0 && (d = u), c++;
    }
    return d;
  }, t8e = (t, e) => {
    var { selection: n } = t;
    n && _t.isCollapsed(n) && xt.delete(t, {
      unit: e,
      reverse: true
    });
  }, n8e = (t, e) => {
    var { selection: n } = t;
    n && _t.isCollapsed(n) && xt.delete(t, {
      unit: e
    });
  }, r8e = function(e) {
    var { direction: n = "forward" } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { selection: r } = e;
    r && _t.isExpanded(r) && xt.delete(e, {
      reverse: n === "backward"
    });
  }, i8e = (t, e) => [
    fe.start(t, e),
    fe.end(t, e)
  ];
  function YK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function ZK(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? YK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : YK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var o8e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return fe.above(e, ZK(ZK({}, n), {}, {
      match: (r) => Le.isElement(r) && fe.isElementReadOnly(e, r)
    }));
  }, a8e = (t, e) => fe.point(t, e, {
    edge: "end"
  }), s8e = (t, e) => {
    var n = fe.path(t, e, {
      edge: "start"
    });
    return fe.node(t, n);
  }, l8e = (t, e) => {
    var n = fe.range(t, e);
    return Le.fragment(t, n);
  };
  function JK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function XK(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? JK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : JK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var c8e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return fe.above(e, XK(XK({}, n), {}, {
      match: (r) => Le.isElement(r) && fe.isVoid(e, r)
    }));
  }, d8e = (t, e) => e.children.some((n) => Le.isElement(n) && fe.isBlock(t, n)), u8e = (t, e) => e.children.some((n) => Le.isText(n) || fe.isInline(t, n)), h8e = (t, e) => Le.has(t, e), f8e = (t, e) => e.children.every((n) => Le.isText(n)), m8e = (t) => {
    xt.splitNodes(t, {
      always: true
    });
  }, g8e = (t, e, n) => {
    xt.insertNodes(t, e, n);
  }, p8e = (t) => {
    xt.splitNodes(t, {
      always: true
    });
  };
  function QK(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function F8e(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? QK(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : QK(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var v8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { selection: i, marks: a } = e;
    if (i) {
      if (a) {
        var s = F8e({
          text: n
        }, a);
        xt.insertNodes(e, s, {
          at: r.at,
          voids: r.voids
        });
      } else xt.insertText(e, n, r);
      e.marks = null;
    }
  }, _8e = (t, e) => !t.isInline(e), y8e = (t, e, n) => fe.isStart(t, e, n) || fe.isEnd(t, e, n), b8e = (t, e) => {
    var { children: n } = e, [r] = n;
    return n.length === 0 || n.length === 1 && Le.isText(r) && r.text === "" && !t.isVoid(e);
  }, x8e = (t, e, n) => {
    var r = fe.end(t, n);
    return ei.equals(e, r);
  }, w8e = (t) => {
    var e = kse.get(t);
    return e === void 0 ? true : e;
  }, D8e = (t, e, n) => {
    if (e.offset !== 0) return false;
    var r = fe.start(t, n);
    return ei.equals(e, r);
  }, C8e = (t, e) => {
    var n = fe.path(t, e, {
      edge: "end"
    });
    return fe.node(t, n);
  }, E8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = fe.path(e, n, r), a = Le.leaf(e, i);
    return [
      a,
      i
    ];
  };
  function k8e(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return (function* () {
      var { at: n = t.selection, reverse: r = false, voids: i = false } = e, { match: a } = e;
      if (a == null && (a = () => true), !!n) {
        var s = [], l = fe.path(t, n);
        for (var [c, d] of Le.levels(t, l)) if (a(c, d) && (s.push([
          c,
          d
        ]), !i && Le.isElement(c) && fe.isVoid(t, c))) break;
        r && s.reverse(), yield* s;
      }
    })();
  }
  var S8e = [
    "text"
  ], j8e = [
    "text"
  ], T8e = function(e) {
    var { marks: n, selection: r } = e;
    if (!r) return null;
    var { anchor: i, focus: a } = r;
    if (n) return n;
    if (_t.isExpanded(r)) {
      var s = _t.isBackward(r);
      s && ([a, i] = [
        i,
        a
      ]);
      var l = fe.isEnd(e, i, i.path);
      if (l) {
        var c = fe.after(e, i);
        c && (i = c);
      }
      var [d] = fe.nodes(e, {
        match: Le.isText,
        at: {
          anchor: i,
          focus: a
        }
      });
      if (d) {
        var [u] = d, h = ih(u, S8e);
        return h;
      } else return {};
    }
    var { path: f } = i, [g] = fe.leaf(e, f);
    if (i.offset === 0) {
      var m = fe.previous(e, {
        at: f,
        match: Le.isText
      }), v = fe.above(e, {
        match: (C) => Le.isElement(C) && fe.isVoid(e, C) && e.markableVoid(C)
      });
      if (!v) {
        var y = fe.above(e, {
          match: (C) => Le.isElement(C) && fe.isBlock(e, C)
        });
        if (m && y) {
          var [w, b] = m, [, j] = y;
          Me.isAncestor(j, b) && (g = w);
        }
      }
    }
    var k = ih(g, j8e);
    return k;
  }, R8e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { mode: r = "lowest", voids: i = false } = n, { match: a, at: s = e.selection } = n;
    if (s) {
      var l = fe.after(e, s, {
        voids: i
      });
      if (l) {
        var [, c] = fe.last(e, []), d = [
          l.path,
          c
        ];
        if (vr.isPath(s) && s.length === 0) throw new Error("Cannot get the next node from the root node!");
        if (a == null) if (vr.isPath(s)) {
          var [u] = fe.parent(e, s);
          a = (f) => u.children.includes(f);
        } else a = () => true;
        var [h] = fe.nodes(e, {
          at: d,
          match: a,
          mode: r,
          voids: i
        });
        return h;
      }
    }
  }, A8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = fe.path(e, n, r), a = Le.get(e, i);
    return [
      a,
      i
    ];
  };
  function I8e(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return (function* () {
      var { at: n = t.selection, mode: r = "all", universal: i = false, reverse: a = false, voids: s = false, pass: l } = e, { match: c } = e;
      if (c || (c = () => true), !!n) {
        var d, u;
        if (vr.isSpan(n)) d = n[0], u = n[1];
        else {
          var h = fe.path(t, n, {
            edge: "start"
          }), f = fe.path(t, n, {
            edge: "end"
          });
          d = a ? f : h, u = a ? h : f;
        }
        var g = Le.nodes(t, {
          reverse: a,
          from: d,
          to: u,
          pass: (k) => {
            var [C, x] = k;
            return l && l([
              C,
              x
            ]) ? true : Le.isElement(C) ? !!(!s && (fe.isVoid(t, C) || fe.isElementReadOnly(t, C))) : false;
          }
        }), m = [], v;
        for (var [y, w] of g) {
          var b = v && Me.compare(w, v[1]) === 0;
          if (!(r === "highest" && b)) {
            if (!c(y, w)) {
              if (i && !b && Le.isText(y)) return;
              continue;
            }
            if (r === "lowest" && b) {
              v = [
                y,
                w
              ];
              continue;
            }
            var j = r === "lowest" ? v : [
              y,
              w
            ];
            j && (i ? m.push(j) : yield j), v = [
              y,
              w
            ];
          }
        }
        r === "lowest" && v && (i ? m.push(v) : yield v), i && (yield* m);
      }
    })();
  }
  var B8e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { force: r = false, operation: i } = n, a = (u) => lE.get(u) || [], s = (u) => cE.get(u) || /* @__PURE__ */ new Set(), l = (u) => {
      var h = a(u).pop(), f = h.join(",");
      return s(u).delete(f), h;
    };
    if (fe.isNormalizing(e)) {
      if (r) {
        var c = Array.from(Le.nodes(e), (u) => {
          var [, h] = u;
          return h;
        }), d = new Set(c.map((u) => u.join(",")));
        lE.set(e, c), cE.set(e, d);
      }
      a(e).length !== 0 && fe.withoutNormalizing(e, () => {
        for (var u of a(e)) if (Le.has(e, u)) {
          var h = fe.node(e, u), [f, g] = h;
          Le.isElement(f) && f.children.length === 0 && e.normalizeNode(h, {
            operation: i
          });
        }
        for (var m = a(e), v = m.length, y = 0; m.length !== 0; ) {
          if (!e.shouldNormalize({
            dirtyPaths: m,
            iteration: y,
            initialDirtyPathsLength: v,
            operation: i
          })) return;
          var w = l(e);
          if (Le.has(e, w)) {
            var b = fe.node(e, w);
            e.normalizeNode(b, {
              operation: i
            });
          }
          y++, m = a(e);
        }
      });
    }
  }, P8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = fe.path(e, n, r), a = Me.parent(i), s = fe.node(e, a);
    return s;
  }, M8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { affinity: i = "forward" } = r, a = {
      current: n,
      affinity: i,
      unref() {
        var { current: l } = a, c = fe.pathRefs(e);
        return c.delete(a), a.current = null, l;
      }
    }, s = fe.pathRefs(e);
    return s.add(a), a;
  }, O8e = (t) => {
    var e = kK.get(t);
    return e || (e = /* @__PURE__ */ new Set(), kK.set(t, e)), e;
  }, L8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { depth: i, edge: a } = r;
    if (vr.isPath(n)) {
      if (a === "start") {
        var [, s] = Le.first(e, n);
        n = s;
      } else if (a === "end") {
        var [, l] = Le.last(e, n);
        n = l;
      }
    }
    return vr.isRange(n) && (a === "start" ? n = _t.start(n) : a === "end" ? n = _t.end(n) : n = Me.common(n.anchor.path, n.focus.path)), vr.isPoint(n) && (n = n.path), i != null && (n = n.slice(0, i)), n;
  }, N8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { affinity: i = "forward" } = r, a = {
      current: n,
      affinity: i,
      unref() {
        var { current: l } = a, c = fe.pointRefs(e);
        return c.delete(a), a.current = null, l;
      }
    }, s = fe.pointRefs(e);
    return s.add(a), a;
  }, z8e = (t) => {
    var e = SK.get(t);
    return e || (e = /* @__PURE__ */ new Set(), SK.set(t, e)), e;
  }, U8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { edge: i = "start" } = r;
    if (vr.isPath(n)) {
      var a;
      if (i === "end") {
        var [, s] = Le.last(e, n);
        a = s;
      } else {
        var [, l] = Le.first(e, n);
        a = l;
      }
      var c = Le.get(e, a);
      if (!Le.isText(c)) throw new Error("Cannot get the ".concat(i, " point in the node at path [").concat(n, "] because it has no ").concat(i, " text node."));
      return {
        path: a,
        offset: i === "end" ? c.text.length : 0
      };
    }
    if (vr.isRange(n)) {
      var [d, u] = _t.edges(n);
      return i === "start" ? d : u;
    }
    return n;
  };
  function V8e(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return (function* () {
      var { at: n = t.selection, unit: r = "offset", reverse: i = false, voids: a = false } = e;
      if (!n) return;
      var s = fe.range(t, n), [l, c] = _t.edges(s), d = i ? c : l, u = false, h = "", f = 0, g = 0, m = 0, v = [], y = function* (x) {
        var S = v.some((O) => Me.isAncestor(O, x));
        function* T(O) {
          S || (yield O);
        }
        if (Le.isElement(b)) {
          if (!t.isSelectable(b)) {
            if (v.push(x), i) return Me.hasPrevious(x) && (yield* T(fe.end(t, Me.previous(x)))), 0;
            var A = Me.next(x);
            return fe.hasPath(t, A) && (yield* T(fe.start(t, A))), 0;
          }
          if (!a && (t.isVoid(b) || t.isElementReadOnly(b))) return yield* T(fe.start(t, x)), 0;
          if (t.isInline(b)) return 0;
          if (fe.hasInlines(t, b)) {
            var B = Me.isAncestor(x, c.path) ? c : fe.end(t, x), U = Me.isAncestor(x, l.path) ? l : fe.start(t, x);
            h = fe.string(t, {
              anchor: U,
              focus: B
            }, {
              voids: a
            }), u = true;
          }
        }
        if (Le.isText(b)) {
          var z = Me.equals(x, d.path);
          for (z ? (g = i ? d.offset : b.text.length - d.offset, m = d.offset) : (g = b.text.length, m = i ? g : 0), (z || u || r === "offset") && (yield* T({
            path: x,
            offset: m
          }), u = false); ; ) {
            if (f === 0) {
              if (h === "") break;
              f = k(h, r, i), h = ZP(h, f, i)[1];
            }
            if (m = i ? m - f : m + f, g = g - f, g < 0) {
              f = -g;
              break;
            }
            f = 0, yield* T({
              path: x,
              offset: m
            });
          }
        }
      }, w;
      for (var [b, j] of fe.nodes(t, {
        at: n,
        reverse: i,
        voids: a
      })) w = yield* y(j);
      function k(C, x, S) {
        return x === "character" ? YP(C, S) : x === "word" ? FIe(C, S) : x === "line" || x === "block" ? C.length : 1;
      }
    })();
  }
  var H8e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { mode: r = "lowest", voids: i = false } = n, { match: a, at: s = e.selection } = n;
    if (s) {
      var l = fe.before(e, s, {
        voids: i
      });
      if (l) {
        var [, c] = fe.first(e, []), d = [
          l.path,
          c
        ];
        if (vr.isPath(s) && s.length === 0) throw new Error("Cannot get the previous node from the root node!");
        if (a == null) if (vr.isPath(s)) {
          var [u] = fe.parent(e, s);
          a = (f) => u.children.includes(f);
        } else a = () => true;
        var [h] = fe.nodes(e, {
          reverse: true,
          at: d,
          match: a,
          mode: r,
          voids: i
        });
        return h;
      }
    }
  }, $8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { affinity: i = "forward" } = r, a = {
      current: n,
      affinity: i,
      unref() {
        var { current: l } = a, c = fe.rangeRefs(e);
        return c.delete(a), a.current = null, l;
      }
    }, s = fe.rangeRefs(e);
    return s.add(a), a;
  }, W8e = (t) => {
    var e = jK.get(t);
    return e || (e = /* @__PURE__ */ new Set(), jK.set(t, e)), e;
  }, q8e = (t, e, n) => {
    if (vr.isRange(e) && !n) return e;
    var r = fe.start(t, e), i = fe.end(t, n || e);
    return {
      anchor: r,
      focus: i
    };
  };
  function eG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function K8e(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? eG(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : eG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var G8e = (t, e) => {
    var { selection: n } = t;
    if (n) {
      var r = (u, h) => {
        if (!Le.isText(u)) return false;
        var [f, g] = fe.parent(t, h);
        return !t.isVoid(f) || t.markableVoid(f);
      }, i = _t.isExpanded(n), a = false;
      if (!i) {
        var [s, l] = fe.node(t, n);
        if (s && r(s, l)) {
          var [c] = fe.parent(t, l);
          a = c && t.markableVoid(c);
        }
      }
      if (i || a) xt.unsetNodes(t, e, {
        match: r,
        split: true,
        voids: true
      });
      else {
        var d = K8e({}, fe.marks(t) || {});
        delete d[e], t.marks = d, n2.get(t) || t.onChange();
      }
    }
  }, Y8e = (t, e) => {
    kse.set(t, e);
  }, Z8e = (t, e) => fe.point(t, e, {
    edge: "start"
  }), J8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { voids: i = false } = r, a = fe.range(e, n), [s, l] = _t.edges(a), c = "";
    for (var [d, u] of fe.nodes(e, {
      at: a,
      match: Le.isText,
      voids: i
    })) {
      var h = d.text;
      Me.equals(u, l.path) && (h = h.slice(0, l.offset)), Me.equals(u, s.path) && (h = h.slice(s.offset)), c += h;
    }
    return c;
  }, X8e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { voids: i = false } = r, [a, s] = _t.edges(n);
    if (a.offset !== 0 || s.offset !== 0 || _t.isCollapsed(n) || Me.hasPrevious(s.path)) return n;
    var l = fe.above(e, {
      at: s,
      match: (m) => Le.isElement(m) && fe.isBlock(e, m),
      voids: i
    }), c = l ? l[1] : [], d = fe.start(e, a), u = {
      anchor: d,
      focus: s
    }, h = true;
    for (var [f, g] of fe.nodes(e, {
      at: u,
      match: Le.isText,
      reverse: true,
      voids: i
    })) {
      if (h) {
        h = false;
        continue;
      }
      if (f.text !== "" || Me.isBefore(g, c)) {
        s = {
          path: g,
          offset: f.text.length
        };
        break;
      }
    }
    return {
      anchor: a,
      focus: s
    };
  }, Q8e = (t, e) => {
    var n = fe.isNormalizing(t);
    fe.setNormalizing(t, false);
    try {
      e();
    } finally {
      fe.setNormalizing(t, n);
    }
    fe.normalize(t);
  }, e7e = (t, e, n) => {
    var [r, i] = e;
    return Le.isElement(r) && fe.isEmpty(t, r) || Le.isText(r) && r.text === "" && i[i.length - 1] !== 0;
  }, t7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    fe.withoutNormalizing(e, () => {
      var r, i, { reverse: a = false, unit: s = "character", distance: l = 1, voids: c = false } = n, { at: d = e.selection, hanging: u = false } = n;
      if (d) {
        var h = false;
        if (vr.isRange(d) && _t.isCollapsed(d) && (h = true, d = d.anchor), vr.isPoint(d)) {
          var f = fe.void(e, {
            at: d,
            mode: "highest"
          });
          if (!c && f) {
            var [, g] = f;
            d = g;
          } else {
            var m = {
              unit: s,
              distance: l
            }, v = a ? fe.before(e, d, m) || fe.start(e, []) : fe.after(e, d, m) || fe.end(e, []);
            d = {
              anchor: d,
              focus: v
            }, u = true;
          }
        }
        if (vr.isPath(d)) {
          xt.removeNodes(e, {
            at: d,
            voids: c
          });
          return;
        }
        if (!_t.isCollapsed(d)) {
          if (!u) {
            var [, y] = _t.edges(d), w = fe.end(e, []);
            ei.equals(y, w) || (d = fe.unhangRange(e, d, {
              voids: c
            }));
          }
          var [b, j] = _t.edges(d), k = fe.above(e, {
            match: (he) => Le.isElement(he) && fe.isBlock(e, he),
            at: b,
            voids: c
          }), C = fe.above(e, {
            match: (he) => Le.isElement(he) && fe.isBlock(e, he),
            at: j,
            voids: c
          }), x = k && C && !Me.equals(k[1], C[1]), S = Me.equals(b.path, j.path), T = c ? null : (r = fe.void(e, {
            at: b,
            mode: "highest"
          })) !== null && r !== void 0 ? r : fe.elementReadOnly(e, {
            at: b,
            mode: "highest"
          }), A = c ? null : (i = fe.void(e, {
            at: j,
            mode: "highest"
          })) !== null && i !== void 0 ? i : fe.elementReadOnly(e, {
            at: j,
            mode: "highest"
          });
          if (T) {
            var B = fe.before(e, b);
            B && k && Me.isAncestor(k[1], B.path) && (b = B);
          }
          if (A) {
            var U = fe.after(e, j);
            U && C && Me.isAncestor(C[1], U.path) && (j = U);
          }
          var z = [], O;
          for (var M of fe.nodes(e, {
            at: d,
            voids: c
          })) {
            var [I, N] = M;
            O && Me.compare(N, O) === 0 || (!c && Le.isElement(I) && (fe.isVoid(e, I) || fe.isElementReadOnly(e, I)) || !Me.isCommon(N, b.path) && !Me.isCommon(N, j.path)) && (z.push(M), O = N);
          }
          var L = Array.from(z, (he) => {
            var [, se] = he;
            return fe.pathRef(e, se);
          }), H = fe.pointRef(e, b), V = fe.pointRef(e, j), Z = "";
          if (!S && !T) {
            var Y = H.current, [oe] = fe.leaf(e, Y), { path: ue } = Y, { offset: ie } = b, de = oe.text.slice(ie);
            de.length > 0 && (e.apply({
              type: "remove_text",
              path: ue,
              offset: ie,
              text: de
            }), Z = de);
          }
          if (L.reverse().map((he) => he.unref()).filter((he) => he !== null).forEach((he) => xt.removeNodes(e, {
            at: he,
            voids: c
          })), !A) {
            var ne = V.current, [ae] = fe.leaf(e, ne), { path: X } = ne, K = S ? b.offset : 0, G = ae.text.slice(K, j.offset);
            G.length > 0 && (e.apply({
              type: "remove_text",
              path: X,
              offset: K,
              text: G
            }), Z = G);
          }
          !S && x && V.current && H.current && xt.mergeNodes(e, {
            at: V.current,
            hanging: true,
            voids: c
          }), h && a && s === "character" && Z.length > 1 && Z.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/) && xt.insertText(e, Z.slice(0, Z.length - l));
          var le = H.unref(), te = V.unref(), re = a ? le || te : te || le;
          n.at == null && re && xt.select(e, re);
        }
      }
    });
  }, n7e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    fe.withoutNormalizing(e, () => {
      var { hanging: i = false, voids: a = false } = r, { at: s = GP(e), batchDirty: l = true } = r;
      if (n.length) {
        if (vr.isRange(s)) if (i || (s = fe.unhangRange(e, s, {
          voids: a
        })), _t.isCollapsed(s)) s = s.anchor;
        else {
          var [, c] = _t.edges(s);
          if (!a && fe.void(e, {
            at: c
          })) return;
          var d = fe.pointRef(e, c);
          xt.delete(e, {
            at: s
          }), s = d.unref();
        }
        else vr.isPath(s) && (s = fe.start(e, s));
        if (!(!a && fe.void(e, {
          at: s
        }))) {
          var u = fe.above(e, {
            at: s,
            match: (ue) => Le.isElement(ue) && fe.isInline(e, ue),
            mode: "highest",
            voids: a
          });
          if (u) {
            var [, h] = u;
            if (fe.isEnd(e, s, h)) {
              var f = fe.after(e, h);
              s = f;
            } else if (fe.isStart(e, s, h)) {
              var g = fe.before(e, h);
              s = g;
            }
          }
          var m = fe.above(e, {
            match: (ue) => Le.isElement(ue) && fe.isBlock(e, ue),
            at: s,
            voids: a
          }), [, v] = m, y = fe.isStart(e, s, v), w = fe.isEnd(e, s, v), b = y && w, [, j] = Le.first({
            children: n
          }, []), [, k] = Le.last({
            children: n
          }, []), C = (ue) => {
            var [ie, de] = ue, ne = de.length === 0;
            return ne ? false : b ? true : !(!y && Me.isAncestor(de, j) && Le.isElement(ie) && !e.isVoid(ie) && !e.isInline(ie) || !w && Me.isAncestor(de, k) && Le.isElement(ie) && !e.isVoid(ie) && !e.isInline(ie));
          }, x = true, S = [], T = [], A = [];
          for (var B of Le.nodes({
            children: n
          }, {
            pass: C
          })) {
            var [U, z] = B;
            x && Le.isElement(U) && !e.isInline(U) && !Me.isAncestor(z, j) && (x = false), C(B) && (Le.isElement(U) && !e.isInline(U) ? (x = false, T.push(U)) : x ? S.push(U) : A.push(U));
          }
          var [O] = fe.nodes(e, {
            at: s,
            match: (ue) => Le.isText(ue) || fe.isInline(e, ue),
            mode: "highest",
            voids: a
          }), [, M] = O, I = fe.isStart(e, s, M), N = fe.isEnd(e, s, M), L = fe.pathRef(e, w && !A.length ? Me.next(v) : v), H = fe.pathRef(e, N ? Me.next(M) : M), V = A.length > 0;
          xt.splitNodes(e, {
            at: s,
            match: (ue) => V ? Le.isElement(ue) && fe.isBlock(e, ue) : Le.isText(ue) || fe.isInline(e, ue),
            mode: V ? "lowest" : "highest",
            always: V && (!y || S.length > 0) && (!w || A.length > 0),
            voids: a
          });
          var Z = fe.pathRef(e, !I || I && N ? Me.next(M) : M);
          if (xt.insertNodes(e, S, {
            at: Z.current,
            match: (ue) => Le.isText(ue) || fe.isInline(e, ue),
            mode: "highest",
            voids: a,
            batchDirty: l
          }), b && !S.length && T.length && !A.length && xt.delete(e, {
            at: v,
            voids: a
          }), xt.insertNodes(e, T, {
            at: L.current,
            match: (ue) => Le.isElement(ue) && fe.isBlock(e, ue),
            mode: "lowest",
            voids: a,
            batchDirty: l
          }), xt.insertNodes(e, A, {
            at: H.current,
            match: (ue) => Le.isText(ue) || fe.isInline(e, ue),
            mode: "highest",
            voids: a,
            batchDirty: l
          }), !r.at) {
            var Y;
            if (A.length > 0 && H.current ? Y = Me.previous(H.current) : T.length > 0 && L.current ? Y = Me.previous(L.current) : Z.current && (Y = Me.previous(Z.current)), Y) {
              var oe = fe.end(e, Y);
              xt.select(e, oe);
            }
          }
          Z.unref(), L.unref(), H.unref();
        }
      }
    });
  }, r7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { edge: r = "anchor" } = n, { selection: i } = e;
    if (i) {
      if (r === "anchor") xt.select(e, i.anchor);
      else if (r === "focus") xt.select(e, i.focus);
      else if (r === "start") {
        var [a] = _t.edges(i);
        xt.select(e, a);
      } else if (r === "end") {
        var [, s] = _t.edges(i);
        xt.select(e, s);
      }
    } else return;
  }, i7e = (t) => {
    var { selection: e } = t;
    e && t.apply({
      type: "set_selection",
      properties: e,
      newProperties: null
    });
  }, o7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { selection: r } = e, { distance: i = 1, unit: a = "character", reverse: s = false } = n, { edge: l = null } = n;
    if (r) {
      l === "start" && (l = _t.isBackward(r) ? "focus" : "anchor"), l === "end" && (l = _t.isBackward(r) ? "anchor" : "focus");
      var { anchor: c, focus: d } = r, u = {
        distance: i,
        unit: a
      }, h = {};
      if (l == null || l === "anchor") {
        var f = s ? fe.before(e, c, u) : fe.after(e, c, u);
        f && (h.anchor = f);
      }
      if (l == null || l === "focus") {
        var g = s ? fe.before(e, d, u) : fe.after(e, d, u);
        g && (h.focus = g);
      }
      xt.setSelection(e, h);
    }
  }, a7e = (t, e) => {
    var { selection: n } = t;
    if (e = fe.range(t, e), n) {
      xt.setSelection(t, e);
      return;
    }
    if (!vr.isRange(e)) throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(qo.stringify(e)));
    t.apply({
      type: "set_selection",
      properties: n,
      newProperties: e
    });
  };
  function tG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function nG(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? tG(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : tG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var s7e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { selection: i } = e, { edge: a = "both" } = r;
    if (i) {
      a === "start" && (a = _t.isBackward(i) ? "focus" : "anchor"), a === "end" && (a = _t.isBackward(i) ? "anchor" : "focus");
      var { anchor: s, focus: l } = i, c = a === "anchor" ? s : l;
      xt.setSelection(e, {
        [a === "anchor" ? "anchor" : "focus"]: nG(nG({}, c), n)
      });
    }
  }, l7e = (t, e) => {
    var { selection: n } = t, r = {}, i = {};
    if (n) {
      for (var a in e) (a === "anchor" && e.anchor != null && !ei.equals(e.anchor, n.anchor) || a === "focus" && e.focus != null && !ei.equals(e.focus, n.focus) || a !== "anchor" && a !== "focus" && e[a] !== n[a]) && (r[a] = n[a], i[a] = e[a]);
      Object.keys(r).length > 0 && t.apply({
        type: "set_selection",
        properties: r,
        newProperties: i
      });
    }
  }, c7e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    fe.withoutNormalizing(e, () => {
      var { hanging: i = false, voids: a = false, mode: s = "lowest", batchDirty: l = true } = r, { at: c, match: d, select: u } = r;
      if (Le.isNode(n) && (n = [
        n
      ]), n.length !== 0) {
        var [h] = n;
        if (c || (c = GP(e), u !== false && (u = true)), u == null && (u = false), vr.isRange(c)) if (i || (c = fe.unhangRange(e, c, {
          voids: a
        })), _t.isCollapsed(c)) c = c.anchor;
        else {
          var [, f] = _t.edges(c), g = fe.pointRef(e, f);
          xt.delete(e, {
            at: c
          }), c = g.unref();
        }
        if (vr.isPoint(c)) {
          d == null && (Le.isText(h) ? d = (B) => Le.isText(B) : e.isInline(h) ? d = (B) => Le.isText(B) || fe.isInline(e, B) : d = (B) => Le.isElement(B) && fe.isBlock(e, B));
          var [m] = fe.nodes(e, {
            at: c.path,
            match: d,
            mode: s,
            voids: a
          });
          if (m) {
            var [, v] = m, y = fe.pathRef(e, v), w = fe.isEnd(e, c, v);
            xt.splitNodes(e, {
              at: c,
              match: d,
              mode: s,
              voids: a
            });
            var b = y.unref();
            c = w ? Me.next(b) : b;
          } else return;
        }
        var j = Me.parent(c), k = c[c.length - 1];
        if (!(!a && fe.void(e, {
          at: j
        }))) {
          if (l) {
            var C = [], x = Me.levels(j);
            WIe(e, () => {
              var B = function() {
                var O = j.concat(k);
                k++;
                var M = {
                  type: "insert_node",
                  path: O,
                  node: U
                };
                e.apply(M), c = Me.next(c), C.push(M), Le.isText(U) ? x.push(O) : x.push(...Array.from(Le.nodes(U), (I) => {
                  var [, N] = I;
                  return O.concat(N);
                }));
              };
              for (var U of n) B();
            }, () => {
              jse(e, x, (B) => {
                var U = B;
                for (var z of C) if (Me.operationCanTransformPath(z) && (U = Me.transform(U, z), !U)) return null;
                return U;
              });
            });
          } else for (var S of n) {
            var T = j.concat(k);
            k++, e.apply({
              type: "insert_node",
              path: T,
              node: S
            }), c = Me.next(c);
          }
          if (c = Me.previous(c), u) {
            var A = fe.end(e, c);
            A && xt.select(e, A);
          }
        }
      }
    });
  }, d7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    fe.withoutNormalizing(e, () => {
      var { at: r = e.selection, mode: i = "lowest", voids: a = false } = n, { match: s } = n;
      if (r) {
        s == null && (s = vr.isPath(r) ? GF(e, r) : (k) => Le.isElement(k) && fe.isBlock(e, k));
        var l = fe.nodes(e, {
          at: r,
          match: s,
          mode: i,
          voids: a
        }), c = Array.from(l, (k) => {
          var [, C] = k;
          return fe.pathRef(e, C);
        });
        for (var d of c) {
          var u = d.unref();
          if (u.length < 2) throw new Error("Cannot lift node at a path [".concat(u, "] because it has a depth of less than `2`."));
          var h = fe.node(e, Me.parent(u)), [f, g] = h, m = u[u.length - 1], { length: v } = f.children;
          if (v === 1) {
            var y = Me.next(g);
            xt.moveNodes(e, {
              at: u,
              to: y,
              voids: a
            }), xt.removeNodes(e, {
              at: g,
              voids: a
            });
          } else if (m === 0) xt.moveNodes(e, {
            at: u,
            to: g,
            voids: a
          });
          else if (m === v - 1) {
            var w = Me.next(g);
            xt.moveNodes(e, {
              at: u,
              to: w,
              voids: a
            });
          } else {
            var b = Me.next(u), j = Me.next(g);
            xt.splitNodes(e, {
              at: b,
              voids: a
            }), xt.moveNodes(e, {
              at: u,
              to: j,
              voids: a
            });
          }
        }
      }
    });
  }, u7e = [
    "text"
  ], h7e = [
    "children"
  ], Tse = (t, e) => e !== t && (Le.isText(e) || fe.isVoid(t, e) || e.children.length === 1 && Tse(t, e.children[0])), f7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    fe.withoutNormalizing(e, () => {
      var { match: r, at: i = e.selection } = n, { hanging: a = false, voids: s = false, mode: l = "lowest" } = n;
      if (i) {
        if (r == null) if (vr.isPath(i)) {
          var [c] = fe.parent(e, i);
          r = (B) => c.children.includes(B);
        } else r = (B) => Le.isElement(B) && fe.isBlock(e, B);
        if (!a && vr.isRange(i) && (i = fe.unhangRange(e, i, {
          voids: s
        })), vr.isRange(i)) if (_t.isCollapsed(i)) i = i.anchor;
        else {
          var [, d] = _t.edges(i), u = fe.pointRef(e, d);
          xt.delete(e, {
            at: i
          }), i = u.unref(), n.at == null && xt.select(e, i);
        }
        var [h] = fe.nodes(e, {
          at: i,
          match: r,
          voids: s,
          mode: l
        }), f = fe.previous(e, {
          at: i,
          match: r,
          voids: s,
          mode: l
        });
        if (!(!h || !f)) {
          var [g, m] = h, [v, y] = f;
          if (!(m.length === 0 || y.length === 0)) {
            var w = Me.next(y), b = Me.common(m, y), j = Me.isSibling(m, y), k = Array.from(fe.levels(e, {
              at: m
            }), (B) => {
              var [U] = B;
              return U;
            }).slice(b.length).slice(0, -1), C = fe.above(e, {
              at: m,
              mode: "highest",
              match: (B) => k.includes(B) && Tse(e, B)
            }), x = C && fe.pathRef(e, C[1]), S, T;
            if (Le.isText(g) && Le.isText(v)) {
              var A = ih(g, u7e);
              T = v.text.length, S = A;
            } else if (Le.isElement(g) && Le.isElement(v)) {
              var A = ih(g, h7e);
              T = v.children.length, S = A;
            } else throw new Error("Cannot merge the node at path [".concat(m, "] with the previous sibling because it is not the same kind: ").concat(qo.stringify(g), " ").concat(qo.stringify(v)));
            j || xt.moveNodes(e, {
              at: m,
              to: w,
              voids: s
            }), x && xt.removeNodes(e, {
              at: x.current,
              voids: s
            }), fe.shouldMergeNodesRemovePrevNode(e, f, h) ? xt.removeNodes(e, {
              at: y,
              voids: s
            }) : e.apply({
              type: "merge_node",
              path: w,
              position: T,
              properties: S
            }), x && x.unref();
          }
        }
      }
    });
  }, m7e = (t, e) => {
    fe.withoutNormalizing(t, () => {
      var { to: n, at: r = t.selection, mode: i = "lowest", voids: a = false } = e, { match: s } = e;
      if (r) {
        s == null && (s = vr.isPath(r) ? GF(t, r) : (g) => Le.isElement(g) && fe.isBlock(t, g));
        var l = fe.pathRef(t, n), c = fe.nodes(t, {
          at: r,
          match: s,
          mode: i,
          voids: a
        }), d = Array.from(c, (g) => {
          var [, m] = g;
          return fe.pathRef(t, m);
        });
        for (var u of d) {
          var h = u.unref(), f = l.current;
          h.length !== 0 && t.apply({
            type: "move_node",
            path: h,
            newPath: f
          }), l.current && Me.isSibling(f, h) && Me.isAfter(f, h) && (l.current = Me.next(l.current));
        }
        l.unref();
      }
    });
  }, g7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    fe.withoutNormalizing(e, () => {
      var { hanging: r = false, voids: i = false, mode: a = "lowest" } = n, { at: s = e.selection, match: l } = n;
      if (s) {
        l == null && (l = vr.isPath(s) ? GF(e, s) : (g) => Le.isElement(g) && fe.isBlock(e, g)), !r && vr.isRange(s) && (s = fe.unhangRange(e, s, {
          voids: i
        }));
        var c = fe.nodes(e, {
          at: s,
          match: l,
          mode: a,
          voids: i
        }), d = Array.from(c, (g) => {
          var [, m] = g;
          return fe.pathRef(e, m);
        });
        for (var u of d) {
          var h = u.unref();
          if (h) {
            var [f] = fe.node(e, h);
            e.apply({
              type: "remove_node",
              path: h,
              node: f
            });
          }
        }
      }
    });
  }, p7e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    fe.withoutNormalizing(e, () => {
      var { match: i, at: a = e.selection, compare: s, merge: l } = r, { hanging: c = false, mode: d = "lowest", split: u = false, voids: h = false } = r;
      if (a) {
        if (i == null && (i = vr.isPath(a) ? GF(e, a) : (T) => Le.isElement(T) && fe.isBlock(e, T)), !c && vr.isRange(a) && (a = fe.unhangRange(e, a, {
          voids: h
        })), u && vr.isRange(a)) {
          if (_t.isCollapsed(a) && fe.leaf(e, a.anchor)[0].text.length > 0) return;
          var f = fe.rangeRef(e, a, {
            affinity: "inward"
          }), [g, m] = _t.edges(a), v = d === "lowest" ? "lowest" : "highest", y = fe.isEnd(e, m, m.path);
          xt.splitNodes(e, {
            at: m,
            match: i,
            mode: v,
            voids: h,
            always: !y
          });
          var w = fe.isStart(e, g, g.path);
          xt.splitNodes(e, {
            at: g,
            match: i,
            mode: v,
            voids: h,
            always: !w
          }), a = f.unref(), r.at == null && xt.select(e, a);
        }
        s || (s = (T, A) => T !== A);
        for (var [b, j] of fe.nodes(e, {
          at: a,
          match: i,
          mode: d,
          voids: h
        })) {
          var k = {}, C = {};
          if (j.length !== 0) {
            var x = false;
            for (var S in n) S === "children" || S === "text" || s(n[S], b[S]) && (x = true, b.hasOwnProperty(S) && (k[S] = b[S]), l ? n[S] != null && (C[S] = l(b[S], n[S])) : n[S] != null && (C[S] = n[S]));
            x && e.apply({
              type: "set_node",
              path: j,
              properties: k,
              newProperties: C
            });
          }
        }
      }
    });
  }, F7e = (t, e) => {
    if (_t.isCollapsed(e)) return e.anchor;
    var [, n] = _t.edges(e), r = fe.pointRef(t, n);
    return xt.delete(t, {
      at: e
    }), r.unref();
  }, v7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    fe.withoutNormalizing(e, () => {
      var { mode: r = "lowest", voids: i = false } = n, { match: a, at: s = e.selection, height: l = 0, always: c = false } = n;
      if (s && (a == null && (a = (V) => Le.isElement(V) && fe.isBlock(e, V)), !(vr.isRange(s) && (s = F7e(e, s), !s)))) {
        if (vr.isPath(s)) {
          var d = s, u = fe.point(e, d), [h] = fe.parent(e, d);
          a = (V) => V === h, l = u.path.length - d.length + 1, s = u, c = true;
        }
        var f = fe.pointRef(e, s, {
          affinity: "backward"
        }), g;
        try {
          var [m] = fe.nodes(e, {
            at: s,
            match: a,
            mode: r,
            voids: i
          });
          if (!m) return;
          var v = fe.void(e, {
            at: s,
            mode: "highest"
          }), y = 0;
          if (!i && v) {
            var [w, b] = v;
            if (e.isInline(w)) {
              var j = fe.after(e, b);
              if (!j) {
                var k = {
                  text: ""
                }, C = Me.next(b);
                xt.insertNodes(e, k, {
                  at: C,
                  voids: i
                }), j = fe.point(e, C);
              }
              s = j, c = true;
            }
            var x = s.path.length - b.length;
            l = x + 1, c = true;
          }
          g = fe.pointRef(e, s);
          var S = s.path.length - l, [, T] = m, A = s.path.slice(0, S), B = l === 0 ? s.offset : s.path[S] + y;
          for (var [U, z] of fe.levels(e, {
            at: A,
            reverse: true,
            voids: i
          })) {
            var O = false;
            if (z.length < T.length || z.length === 0 || !i && Le.isElement(U) && fe.isVoid(e, U)) break;
            var M = f.current, I = fe.isEnd(e, M, z);
            if (c || !f || !fe.isEdge(e, M, z)) {
              O = true;
              var N = Le.extractProps(U);
              e.apply({
                type: "split_node",
                path: z,
                position: B,
                properties: N
              });
            }
            B = z[z.length - 1] + (O || I ? 1 : 0);
          }
          if (n.at == null) {
            var L = g.current || fe.end(e, []);
            xt.select(e, L);
          }
        } finally {
          var H;
          f.unref(), (H = g) === null || H === void 0 || H.unref();
        }
      }
    });
  }, _7e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    Array.isArray(n) || (n = [
      n
    ]);
    var i = {};
    for (var a of n) i[a] = null;
    xt.setNodes(e, i, r);
  }, y7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    fe.withoutNormalizing(e, () => {
      var { mode: r = "lowest", split: i = false, voids: a = false } = n, { at: s = e.selection, match: l } = n;
      if (s) {
        l == null && (l = vr.isPath(s) ? GF(e, s) : (g) => Le.isElement(g) && fe.isBlock(e, g)), vr.isPath(s) && (s = fe.range(e, s));
        var c = vr.isRange(s) ? fe.rangeRef(e, s) : null, d = fe.nodes(e, {
          at: s,
          match: l,
          mode: r,
          voids: a
        }), u = Array.from(d, (g) => {
          var [, m] = g;
          return fe.pathRef(e, m);
        }).reverse(), h = function() {
          var m = f.unref(), [v] = fe.node(e, m), y = fe.range(e, m);
          i && c && (y = _t.intersection(c.current, y)), xt.liftNodes(e, {
            at: y,
            match: (w) => !Le.isText(v) && v.children.includes(w),
            voids: a
          });
        };
        for (var f of u) h();
        c && c.unref();
      }
    });
  };
  function rG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function iG(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? rG(Object(n), true).forEach(function(r) {
        ja(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : rG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var b7e = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    fe.withoutNormalizing(e, () => {
      var { mode: i = "lowest", split: a = false, voids: s = false } = r, { match: l, at: c = e.selection } = r;
      if (c) {
        if (l == null && (vr.isPath(c) ? l = GF(e, c) : e.isInline(n) ? l = (w) => Le.isElement(w) && fe.isInline(e, w) || Le.isText(w) : l = (w) => Le.isElement(w) && fe.isBlock(e, w)), a && vr.isRange(c)) {
          var [d, u] = _t.edges(c), h = fe.rangeRef(e, c, {
            affinity: "inward"
          }), f = (w) => {
            var b = fe.above(e, {
              at: w,
              match: (j) => Le.isElement(j) && fe.isBlock(e, j)
            });
            return b && fe.isEdge(e, w, b[1]);
          };
          xt.splitNodes(e, {
            at: u,
            match: l,
            voids: s,
            always: !f(u)
          }), xt.splitNodes(e, {
            at: d,
            match: l,
            voids: s,
            always: !f(d)
          }), c = h.unref(), r.at == null && xt.select(e, c);
        }
        var g = Array.from(fe.nodes(e, {
          at: c,
          match: e.isInline(n) ? (w) => Le.isElement(w) && fe.isBlock(e, w) : (w) => Le.isEditor(w),
          mode: "lowest",
          voids: s
        })), m = function() {
          var b = vr.isRange(c) ? _t.intersection(c, fe.range(e, y)) : c;
          if (!b) return 0;
          var j = Array.from(fe.nodes(e, {
            at: b,
            match: l,
            mode: i,
            voids: s
          }));
          if (j.length > 0) {
            var [k] = j, C = j[j.length - 1], [, x] = k, [, S] = C;
            if (x.length === 0 && S.length === 0) return 0;
            var T = Me.equals(x, S) ? Me.parent(x) : Me.common(x, S), A = fe.range(e, x, S), B = fe.node(e, T), [U] = B, z = T.length + 1, O = Me.next(S.slice(0, z)), M = iG(iG({}, n), {}, {
              children: []
            });
            xt.insertNodes(e, M, {
              at: O,
              voids: s
            }), xt.moveNodes(e, {
              at: A,
              match: (I) => !Le.isText(U) && U.children.includes(I),
              to: O.concat(0),
              voids: s
            });
          }
        }, v;
        for (var [, y] of g) v = m();
      }
    });
  }, x7e = () => {
    var t = {
      children: [],
      operations: [],
      selection: null,
      marks: null,
      isElementReadOnly: () => false,
      isInline: () => false,
      isSelectable: () => true,
      isVoid: () => false,
      markableVoid: () => false,
      onChange: () => {
      },
      apply: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return qIe(t, ...r);
      },
      addMark: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return XIe(t, ...r);
      },
      deleteBackward: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return t8e(t, ...r);
      },
      deleteForward: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return n8e(t, ...r);
      },
      deleteFragment: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return r8e(t, ...r);
      },
      getFragment: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return GIe(t, ...r);
      },
      insertBreak: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return m8e(t, ...r);
      },
      insertSoftBreak: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return p8e(t, ...r);
      },
      insertFragment: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return n7e(t, ...r);
      },
      insertNode: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return g8e(t, ...r);
      },
      insertText: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return v8e(t, ...r);
      },
      normalizeNode: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return YIe(t, ...r);
      },
      removeMark: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return G8e(t, ...r);
      },
      getDirtyPaths: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return KIe(t, ...r);
      },
      shouldNormalize: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return ZIe(t, ...r);
      },
      above: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return JIe(t, ...r);
      },
      after: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return QIe(t, ...r);
      },
      before: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return e8e(t, ...r);
      },
      collapse: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return r7e(t, ...r);
      },
      delete: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return t7e(t, ...r);
      },
      deselect: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return i7e(t, ...r);
      },
      edges: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return i8e(t, ...r);
      },
      elementReadOnly: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return o8e(t, ...r);
      },
      end: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return a8e(t, ...r);
      },
      first: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return s8e(t, ...r);
      },
      fragment: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return l8e(t, ...r);
      },
      getMarks: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return T8e(t, ...r);
      },
      hasBlocks: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return d8e(t, ...r);
      },
      hasInlines: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return u8e(t, ...r);
      },
      hasPath: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return h8e(t, ...r);
      },
      hasTexts: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return f8e(t, ...r);
      },
      insertNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return c7e(t, ...r);
      },
      isBlock: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return _8e(t, ...r);
      },
      isEdge: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return y8e(t, ...r);
      },
      isEmpty: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return b8e(t, ...r);
      },
      isEnd: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return x8e(t, ...r);
      },
      isNormalizing: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return w8e(t, ...r);
      },
      isStart: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return D8e(t, ...r);
      },
      last: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return C8e(t, ...r);
      },
      leaf: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return E8e(t, ...r);
      },
      levels: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return k8e(t, ...r);
      },
      liftNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return d7e(t, ...r);
      },
      mergeNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return f7e(t, ...r);
      },
      move: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return o7e(t, ...r);
      },
      moveNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return m7e(t, ...r);
      },
      next: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return R8e(t, ...r);
      },
      node: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return A8e(t, ...r);
      },
      nodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return I8e(t, ...r);
      },
      normalize: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return B8e(t, ...r);
      },
      parent: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return P8e(t, ...r);
      },
      path: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return L8e(t, ...r);
      },
      pathRef: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return M8e(t, ...r);
      },
      pathRefs: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return O8e(t, ...r);
      },
      point: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return U8e(t, ...r);
      },
      pointRef: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return N8e(t, ...r);
      },
      pointRefs: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return z8e(t, ...r);
      },
      positions: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return V8e(t, ...r);
      },
      previous: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return H8e(t, ...r);
      },
      range: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return q8e(t, ...r);
      },
      rangeRef: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return $8e(t, ...r);
      },
      rangeRefs: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return W8e(t, ...r);
      },
      removeNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return g7e(t, ...r);
      },
      select: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return a7e(t, ...r);
      },
      setNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return p7e(t, ...r);
      },
      setNormalizing: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return Y8e(t, ...r);
      },
      setPoint: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return s7e(t, ...r);
      },
      setSelection: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return l7e(t, ...r);
      },
      splitNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return v7e(t, ...r);
      },
      start: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return Z8e(t, ...r);
      },
      string: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return J8e(t, ...r);
      },
      unhangRange: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return X8e(t, ...r);
      },
      unsetNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return _7e(t, ...r);
      },
      unwrapNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return y7e(t, ...r);
      },
      void: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return c8e(t, ...r);
      },
      withoutNormalizing: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return Q8e(t, ...r);
      },
      wrapNodes: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return b7e(t, ...r);
      },
      shouldMergeNodesRemovePrevNode: function() {
        for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
        return e7e(t, ...r);
      }
    };
    return t;
  }, Rse = globalThis.Node, w7e = globalThis.Text, XP = (t) => t && t.ownerDocument && t.ownerDocument.defaultView || null, D7e = (t) => Nf(t) && t.nodeType === 8, Nl = (t) => Nf(t) && t.nodeType === 1, Nf = (t) => {
    var e = XP(t);
    return !!e && t instanceof e.Node;
  }, mI = (t) => {
    var e = t && t.anchorNode && XP(t.anchorNode);
    return !!e && t instanceof e.Selection;
  }, Ase = (t) => Nf(t) && t.nodeType === 3, C7e = (t) => t.clipboardData && t.clipboardData.getData("text/plain") !== "" && t.clipboardData.types.length === 1, E7e = (t) => {
    var [e, n] = t;
    if (Nl(e) && e.childNodes.length) {
      var r = n === e.childNodes.length, i = r ? n - 1 : n;
      for ([e, i] = Ise(e, i, r ? "backward" : "forward"), r = i < n; Nl(e) && e.childNodes.length; ) {
        var a = r ? e.childNodes.length - 1 : 0;
        e = S7e(e, a, r ? "backward" : "forward");
      }
      n = r && e.textContent != null ? e.textContent.length : 0;
    }
    return [
      e,
      n
    ];
  }, k7e = (t) => {
    for (var e = t && t.parentNode; e; ) {
      if (e.toString() === "[object ShadowRoot]") return true;
      e = e.parentNode;
    }
    return false;
  }, Ise = (t, e, n) => {
    for (var { childNodes: r } = t, i = r[e], a = e, s = false, l = false; (D7e(i) || Nl(i) && i.childNodes.length === 0 || Nl(i) && i.getAttribute("contenteditable") === "false") && !(s && l); ) {
      if (a >= r.length) {
        s = true, a = e - 1, n = "backward";
        continue;
      }
      if (a < 0) {
        l = true, a = e + 1, n = "forward";
        continue;
      }
      i = r[a], e = a, a += n === "forward" ? 1 : -1;
    }
    return [
      i,
      e
    ];
  }, S7e = (t, e, n) => {
    var [r] = Ise(t, e, n);
    return r;
  }, Bse = (t) => {
    var e = "";
    if (Ase(t) && t.nodeValue) return t.nodeValue;
    if (Nl(t)) {
      for (var n of Array.from(t.childNodes)) e += Bse(n);
      var r = getComputedStyle(t).getPropertyValue("display");
      (r === "block" || r === "list" || t.tagName === "BR") && (e += `
`);
    }
    return e;
  }, j7e = /data-slate-fragment="(.+?)"/m, T7e = (t) => {
    var e = t.getData("text/html"), [, n] = e.match(j7e) || [];
    return n;
  }, r2 = (t) => t.getSelection != null ? t.getSelection() : document.getSelection(), QP = (t, e, n) => {
    var { target: r } = e;
    if (Nl(r) && r.matches('[contentEditable="false"]')) return false;
    var { document: i } = mr.getWindow(t);
    if (jg(i, r)) return mr.hasDOMNode(t, r, {
      editable: true
    });
    var a = n.find((s) => {
      var { addedNodes: l, removedNodes: c } = s;
      for (var d of l) if (d === r || jg(d, r)) return true;
      for (var u of c) if (u === r || jg(u, r)) return true;
    });
    return !a || a === e ? false : QP(t, a, n);
  }, R7e = () => {
    for (var t = document.activeElement; (e = t) !== null && e !== void 0 && e.shadowRoot && (n = t.shadowRoot) !== null && n !== void 0 && n.activeElement; ) {
      var e, n, r;
      t = (r = t) === null || r === void 0 || (r = r.shadowRoot) === null || r === void 0 ? void 0 : r.activeElement;
    }
    return t;
  }, oG = (t, e) => !!(t.compareDocumentPosition(e) & Rse.DOCUMENT_POSITION_PRECEDING), A7e = (t, e) => !!(t.compareDocumentPosition(e) & Rse.DOCUMENT_POSITION_FOLLOWING), aG = (t, e) => {
    if (!t) return null;
    for (var n = t; n; ) {
      if (n.matches && n.matches(e)) return n;
      if (n.parentElement) n = n.parentElement;
      else if (n.parentNode && "host" in n.parentNode) n = n.parentNode.host;
      else return null;
    }
    return null;
  }, jg = (t, e) => {
    if (!t || !e) return false;
    if (t.contains(e)) return true;
    for (var n = e; n; ) {
      if (n === t) return true;
      if (n.parentNode) "host" in n.parentNode ? n = n.parentNode.host : n = n.parentNode;
      else return false;
    }
    return false;
  }, C5, E5, I7e = typeof navigator < "u" && typeof window < "u" && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, sG = typeof navigator < "u" && /Mac OS X/.test(navigator.userAgent), $a = typeof navigator < "u" && /Android/.test(navigator.userAgent), W0 = typeof navigator < "u" && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Xm = typeof navigator < "u" && /AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent), B7e = typeof navigator < "u" && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent), eM = typeof navigator < "u" && /Chrome/i.test(navigator.userAgent), Pse = typeof navigator < "u" && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent), P7e = $a && typeof navigator < "u" && /Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent), M7e = typeof navigator < "u" && /^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent), O7e = typeof navigator < "u" && /.*UCBrowser/.test(navigator.userAgent), L7e = typeof navigator < "u" && /.*Wechat/.test(navigator.userAgent) && !/.*MacWechat/.test(navigator.userAgent) && (!eM || Pse), YD = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
  typeof navigator < "u" && /Safari/.test(navigator.userAgent) && /Version\/(\d+)/.test(navigator.userAgent) && ((C5 = navigator.userAgent.match(/Version\/(\d+)/)) !== null && C5 !== void 0 && C5[1] && parseInt((E5 = navigator.userAgent.match(/Version\/(\d+)/)) === null || E5 === void 0 ? void 0 : E5[1], 10) < 17);
  var Gh = (!Pse || !P7e) && !B7e && typeof globalThis < "u" && globalThis.InputEvent && typeof globalThis.InputEvent.prototype.getTargetRanges == "function";
  function ub(t) {
    "@babel/helpers - typeof";
    return ub = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, ub(t);
  }
  function N7e(t, e) {
    if (ub(t) !== "object" || t === null) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (ub(r) !== "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function z7e(t) {
    var e = N7e(t, "string");
    return ub(e) === "symbol" ? e : String(e);
  }
  function tM(t, e, n) {
    return e = z7e(e), e in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  var U7e = 0;
  class Mse {
    constructor() {
      tM(this, "id", void 0), this.id = "".concat(U7e++);
    }
  }
  var b1 = /* @__PURE__ */ new WeakMap(), q0 = /* @__PURE__ */ new WeakMap(), i2 = /* @__PURE__ */ new WeakMap(), Ose = /* @__PURE__ */ new WeakMap(), o2 = /* @__PURE__ */ new WeakMap(), gI = /* @__PURE__ */ new WeakMap(), hb = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), hE = /* @__PURE__ */ new WeakMap(), eS = /* @__PURE__ */ new WeakMap(), pI = /* @__PURE__ */ new WeakMap(), xf = /* @__PURE__ */ new WeakMap(), mg = /* @__PURE__ */ new WeakMap(), a2 = /* @__PURE__ */ new WeakMap(), FI = /* @__PURE__ */ new WeakMap(), nM = /* @__PURE__ */ new WeakMap(), Tc = /* @__PURE__ */ new WeakMap(), Mu = /* @__PURE__ */ new WeakMap(), Ss = /* @__PURE__ */ new WeakMap(), af = /* @__PURE__ */ new WeakMap(), Eu = /* @__PURE__ */ new WeakMap(), Lse = /* @__PURE__ */ new WeakMap(), hF = /* @__PURE__ */ Symbol("placeholder"), Nse = /* @__PURE__ */ Symbol("mark-placeholder"), mr = {
    androidPendingDiffs: (t) => Ss.get(t),
    androidScheduleFlush: (t) => {
      var e;
      (e = nM.get(t)) === null || e === void 0 || e();
    },
    blur: (t) => {
      var e = mr.toDOMNode(t, t), n = mr.findDocumentOrShadowRoot(t);
      xf.set(t, false), n.activeElement === e && e.blur();
    },
    deselect: (t) => {
      var { selection: e } = t, n = mr.findDocumentOrShadowRoot(t), r = r2(n);
      r && r.rangeCount > 0 && r.removeAllRanges(), e && xt.deselect(t);
    },
    findDocumentOrShadowRoot: (t) => {
      var e = mr.toDOMNode(t, t), n = e.getRootNode();
      return n instanceof Document || n instanceof ShadowRoot ? n : e.ownerDocument;
    },
    findEventRange: (t, e) => {
      "nativeEvent" in e && (e = e.nativeEvent);
      var { clientX: n, clientY: r, target: i } = e;
      if (n == null || r == null) throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(e));
      var a = mr.toSlateNode(t, e.target), s = mr.findPath(t, a);
      if (Le.isElement(a) && fe.isVoid(t, a)) {
        var l = i.getBoundingClientRect(), c = t.isInline(a) ? n - l.left < l.left + l.width - n : r - l.top < l.top + l.height - r, d = fe.point(t, s, {
          edge: c ? "start" : "end"
        }), u = c ? fe.before(t, d) : fe.after(t, d);
        if (u) {
          var h = fe.range(t, u);
          return h;
        }
      }
      var f, { document: g } = mr.getWindow(t);
      if (g.caretRangeFromPoint) f = g.caretRangeFromPoint(n, r);
      else {
        var m = g.caretPositionFromPoint(n, r);
        m && (f = g.createRange(), f.setStart(m.offsetNode, m.offset), f.setEnd(m.offsetNode, m.offset));
      }
      if (!f) throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(e));
      var v = mr.toSlateRange(t, f, {
        exactMatch: false,
        suppressThrow: false
      });
      return v;
    },
    findKey: (t, e) => {
      var n = hE.get(e);
      return n || (n = new Mse(), hE.set(e, n)), n;
    },
    findPath: (t, e) => {
      for (var n = [], r = e; ; ) {
        var i = i2.get(r);
        if (i == null) {
          if (r === t) return n;
          break;
        }
        var a = q0.get(r);
        if (a == null) break;
        n.unshift(a), r = i;
      }
      throw new Error("Unable to find the path for Slate node: ".concat(qo.stringify(e)));
    },
    focus: function(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        retries: 5
      };
      if (!xf.get(e) && o2.get(e)) {
        if (n.retries <= 0) throw new Error("Could not set focus, editor seems stuck with pending operations");
        if (e.operations.length > 0) {
          setTimeout(() => {
            mr.focus(e, {
              retries: n.retries - 1
            });
          }, 10);
          return;
        }
        var r = mr.toDOMNode(e, e), i = mr.findDocumentOrShadowRoot(e);
        if (i.activeElement !== r) {
          if (e.selection && i instanceof Document) {
            var a = r2(i), s = mr.toDOMRange(e, e.selection);
            a == null ? void 0 : a.removeAllRanges(), a == null ? void 0 : a.addRange(s);
          }
          e.selection || xt.select(e, fe.start(e, [])), xf.set(e, true), r.focus({
            preventScroll: true
          });
        }
      }
    },
    getWindow: (t) => {
      var e = Ose.get(t);
      if (!e) throw new Error("Unable to find a host window element for this editor");
      return e;
    },
    hasDOMNode: function(e, n) {
      var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, { editable: i = false } = r, a = mr.toDOMNode(e, e), s;
      try {
        s = Nl(n) ? n : n.parentElement;
      } catch (l) {
        if (l instanceof Error && !l.message.includes('Permission denied to access property "nodeType"')) throw l;
      }
      return s ? aG(s, "[data-slate-editor]") === a && (!i || s.isContentEditable ? true : typeof s.isContentEditable == "boolean" && aG(s, '[contenteditable="false"]') === a || !!s.getAttribute("data-slate-zero-width")) : false;
    },
    hasEditableTarget: (t, e) => Nf(e) && mr.hasDOMNode(t, e, {
      editable: true
    }),
    hasRange: (t, e) => {
      var { anchor: n, focus: r } = e;
      return fe.hasPath(t, n.path) && fe.hasPath(t, r.path);
    },
    hasSelectableTarget: (t, e) => mr.hasEditableTarget(t, e) || mr.isTargetInsideNonReadonlyVoid(t, e),
    hasTarget: (t, e) => Nf(e) && mr.hasDOMNode(t, e),
    insertData: (t, e) => {
      t.insertData(e);
    },
    insertFragmentData: (t, e) => t.insertFragmentData(e),
    insertTextData: (t, e) => t.insertTextData(e),
    isComposing: (t) => !!mg.get(t),
    isFocused: (t) => !!xf.get(t),
    isReadOnly: (t) => !!pI.get(t),
    isTargetInsideNonReadonlyVoid: (t, e) => {
      if (pI.get(t) || !mr.hasTarget(t, e)) return false;
      var n = mr.toSlateNode(t, e);
      return Le.isElement(n) && fe.isVoid(t, n);
    },
    setFragmentData: (t, e, n) => t.setFragmentData(e, n),
    toDOMNode: (t, e) => {
      var n, r = e === t ? o2.get(t) : (n = eS.get(t)) === null || n === void 0 ? void 0 : n.get(mr.findKey(t, e));
      if (!r) throw new Error("Cannot resolve a DOM node from Slate node: ".concat(qo.stringify(e)));
      return r;
    },
    toDOMPoint: (t, e) => {
      var [n] = fe.node(t, e.path), r = mr.toDOMNode(t, n), i;
      fe.void(t, {
        at: e
      }) && (e = {
        path: e.path,
        offset: 0
      });
      for (var a = "[data-slate-string], [data-slate-zero-width]", s = Array.from(r.querySelectorAll(a)), l = 0, c = 0; c < s.length; c++) {
        var d = s[c], u = d.childNodes[0];
        if (!(u == null || u.textContent == null)) {
          var { length: h } = u.textContent, f = d.getAttribute("data-slate-length"), g = f == null ? h : parseInt(f, 10), m = l + g, v = s[c + 1];
          if (e.offset === m && v !== null && v !== void 0 && v.hasAttribute("data-slate-mark-placeholder")) {
            var y, w = v.childNodes[0];
            i = [
              w instanceof w7e ? w : v,
              (y = v.textContent) !== null && y !== void 0 && y.startsWith("\uFEFF") ? 1 : 0
            ];
            break;
          }
          if (e.offset <= m) {
            var b = Math.min(h, Math.max(0, e.offset - l));
            i = [
              u,
              b
            ];
            break;
          }
          l = m;
        }
      }
      if (!i) throw new Error("Cannot resolve a DOM point from Slate point: ".concat(qo.stringify(e)));
      return i;
    },
    toDOMRange: (t, e) => {
      var { anchor: n, focus: r } = e, i = _t.isBackward(e), a = mr.toDOMPoint(t, n), s = _t.isCollapsed(e) ? a : mr.toDOMPoint(t, r), l = mr.getWindow(t), c = l.document.createRange(), [d, u] = i ? s : a, [h, f] = i ? a : s, g = Nl(d) ? d : d.parentElement, m = !!g.getAttribute("data-slate-zero-width"), v = Nl(h) ? h : h.parentElement, y = !!v.getAttribute("data-slate-zero-width");
      return c.setStart(d, m ? 1 : u), c.setEnd(h, y ? 1 : f), c;
    },
    toSlateNode: (t, e) => {
      var n = Nl(e) ? e : e.parentElement;
      n && !n.hasAttribute("data-slate-node") && (n = n.closest("[data-slate-node]"));
      var r = n ? hb.get(n) : null;
      if (!r) throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));
      return r;
    },
    toSlatePoint: (t, e, n) => {
      var { exactMatch: r, suppressThrow: i, searchDirection: a } = n, [s, l] = r ? e : E7e(e), c = s.parentNode, d = null, u = 0;
      if (c) {
        var h, f, g = mr.toDOMNode(t, t), m = c.closest('[data-slate-void="true"]'), v = m && jg(g, m) ? m : null, y = c.closest('[contenteditable="false"]'), w = y && jg(g, y) ? y : null, b = c.closest("[data-slate-leaf]"), j = null;
        if (b) {
          if (d = b.closest('[data-slate-node="text"]'), d) {
            var k = mr.getWindow(t), C = k.document.createRange();
            C.setStart(d, 0), C.setEnd(s, l);
            var x = C.cloneContents(), S = [
              ...Array.prototype.slice.call(x.querySelectorAll("[data-slate-zero-width]")),
              ...Array.prototype.slice.call(x.querySelectorAll("[contenteditable=false]"))
            ];
            S.forEach((ue) => {
              if ($a && !r && ue.hasAttribute("data-slate-zero-width") && ue.textContent.length > 0 && ue.textContext !== "\uFEFF") {
                ue.textContent.startsWith("\uFEFF") && (ue.textContent = ue.textContent.slice(1));
                return;
              }
              ue.parentNode.removeChild(ue);
            }), u = x.textContent.length, j = d;
          }
        } else if (v) {
          for (var T = v.querySelectorAll("[data-slate-leaf]"), A = 0; A < T.length; A++) {
            var B = T[A];
            if (mr.hasDOMNode(t, B)) {
              b = B;
              break;
            }
          }
          b ? (d = b.closest('[data-slate-node="text"]'), j = b, u = j.textContent.length, j.querySelectorAll("[data-slate-zero-width]").forEach((ue) => {
            u -= ue.textContent.length;
          })) : u = 1;
        } else if (w) {
          var U = (ue) => ue ? ue.querySelectorAll("[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])") : [], z = w.closest('[data-slate-node="element"]');
          if (a === "backward" || !a) {
            var O, M = [
              ...U(z == null ? void 0 : z.previousElementSibling),
              ...U(z)
            ];
            b = (O = M.findLast((ue) => oG(w, ue))) !== null && O !== void 0 ? O : null;
          }
          if (a === "forward" || !a) {
            var I, N = [
              ...U(z),
              ...U(z == null ? void 0 : z.nextElementSibling)
            ];
            b = (I = N.find((ue) => A7e(w, ue))) !== null && I !== void 0 ? I : null;
          }
          b && (d = b.closest('[data-slate-node="text"]'), j = b, a === "forward" ? u = 0 : (u = j.textContent.length, j.querySelectorAll("[data-slate-zero-width]").forEach((ue) => {
            u -= ue.textContent.length;
          })));
        }
        j && u === j.textContent.length && $a && j.getAttribute("data-slate-zero-width") === "z" && (h = j.textContent) !== null && h !== void 0 && h.startsWith("\uFEFF") && (c.hasAttribute("data-slate-zero-width") || W0 && (f = j.textContent) !== null && f !== void 0 && f.endsWith(`

`)) && u--;
      }
      if ($a && !d && !r) {
        var L = c.hasAttribute("data-slate-node") ? c : c.closest("[data-slate-node]");
        if (L && mr.hasDOMNode(t, L, {
          editable: true
        })) {
          var H = mr.toSlateNode(t, L), { path: V, offset: Z } = fe.start(t, mr.findPath(t, H));
          return L.querySelector("[data-slate-leaf]") || (Z = l), {
            path: V,
            offset: Z
          };
        }
      }
      if (!d) {
        if (i) return null;
        throw new Error("Cannot resolve a Slate point from DOM point: ".concat(e));
      }
      var Y = mr.toSlateNode(t, d), oe = mr.findPath(t, Y);
      return {
        path: oe,
        offset: u
      };
    },
    toSlateRange: (t, e, n) => {
      var r, { exactMatch: i, suppressThrow: a } = n, s = mI(e) ? e.anchorNode : e.startContainer, l, c, d, u, h;
      if (s) if (mI(e)) {
        if (W0 && e.rangeCount > 1) {
          d = e.focusNode;
          var f = e.getRangeAt(0), g = e.getRangeAt(e.rangeCount - 1);
          if (d instanceof HTMLTableRowElement && f.startContainer instanceof HTMLTableRowElement && g.startContainer instanceof HTMLTableRowElement) {
            let x = function(S) {
              return S.childElementCount > 0 ? x(S.children[0]) : S;
            };
            var m = f.startContainer, v = g.startContainer, y = x(m.children[f.startOffset]), w = x(v.children[g.startOffset]);
            u = 0, w.childNodes.length > 0 ? l = w.childNodes[0] : l = w, y.childNodes.length > 0 ? d = y.childNodes[0] : d = y, w instanceof HTMLElement ? c = w.innerHTML.length : c = 0;
          } else f.startContainer === d ? (l = g.endContainer, c = g.endOffset, u = f.startOffset) : (l = f.startContainer, c = f.endOffset, u = g.startOffset);
        } else l = e.anchorNode, c = e.anchorOffset, d = e.focusNode, u = e.focusOffset;
        eM && k7e(l) || W0 ? h = e.anchorNode === e.focusNode && e.anchorOffset === e.focusOffset : h = e.isCollapsed;
      } else l = e.startContainer, c = e.startOffset, d = e.endContainer, u = e.endOffset, h = e.collapsed;
      if (l == null || d == null || c == null || u == null) throw new Error("Cannot resolve a Slate range from DOM range: ".concat(e));
      W0 && (r = d.textContent) !== null && r !== void 0 && r.endsWith(`

`) && u === d.textContent.length && u--;
      var b = mr.toSlatePoint(t, [
        l,
        c
      ], {
        exactMatch: i,
        suppressThrow: a
      });
      if (!b) return null;
      var j = oG(l, d) || l === d && u < c, k = h ? b : mr.toSlatePoint(t, [
        d,
        u
      ], {
        exactMatch: i,
        suppressThrow: a,
        searchDirection: j ? "forward" : "backward"
      });
      if (!k) return null;
      var C = {
        anchor: b,
        focus: k
      };
      return _t.isExpanded(C) && _t.isForward(C) && Nl(d) && fe.void(t, {
        at: C.focus,
        mode: "highest"
      }) && (C = fe.unhangRange(t, C, {
        voids: true
      })), C;
    }
  };
  function V7e(t, e) {
    var { path: n, diff: r } = e;
    if (!fe.hasPath(t, n)) return false;
    var i = Le.get(t, n);
    if (!Le.isText(i)) return false;
    if (r.start !== i.text.length || r.text.length === 0) return i.text.slice(r.start, r.start + r.text.length) === r.text;
    var a = Me.next(n);
    if (!fe.hasPath(t, a)) return false;
    var s = Le.get(t, a);
    return Le.isText(s) && s.text.startsWith(r.text);
  }
  function zse(t) {
    for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r];
    return n.reduce((i, a) => i.slice(0, a.start) + a.text + i.slice(a.end), t);
  }
  function H7e(t, e) {
    for (var n = Math.min(t.length, e.length), r = 0; r < n; r++) if (t.charAt(r) !== e.charAt(r)) return r;
    return n;
  }
  function $7e(t, e, n) {
    for (var r = Math.min(t.length, e.length, n), i = 0; i < r; i++) if (t.charAt(t.length - i - 1) !== e.charAt(e.length - i - 1)) return i;
    return r;
  }
  function Use(t, e) {
    var { start: n, end: r, text: i } = e, a = t.slice(n, r), s = H7e(a, i), l = Math.min(a.length - s, i.length - s), c = $7e(a, i, l), d = {
      start: n + s,
      end: r - c,
      text: i.slice(s, i.length - c)
    };
    return d.start === d.end && d.text.length === 0 ? null : d;
  }
  function W7e(t, e, n) {
    var r = Math.min(e.start, n.start), i = Math.max(0, Math.min(e.start + e.text.length, n.end) - n.start), a = zse(t, e, n), s = Math.max(n.start + n.text.length, e.start + e.text.length + (e.start + e.text.length > n.start ? n.text.length : 0) - i), l = a.slice(r, s), c = Math.max(e.end, n.end - e.text.length + (e.end - e.start));
    return Use(t, {
      start: r,
      end: c,
      text: l
    });
  }
  function q7e(t) {
    var { path: e, diff: n } = t;
    return {
      anchor: {
        path: e,
        offset: n.start
      },
      focus: {
        path: e,
        offset: n.end
      }
    };
  }
  function vI(t, e) {
    var { path: n, offset: r } = e;
    if (!fe.hasPath(t, n)) return null;
    var i = Le.get(t, n);
    if (!Le.isText(i)) return null;
    var a = fe.above(t, {
      match: (l) => Le.isElement(l) && fe.isBlock(t, l),
      at: n
    });
    if (!a) return null;
    for (; r > i.text.length; ) {
      var s = fe.next(t, {
        at: n,
        match: Le.isText
      });
      if (!s || !Me.isDescendant(s[1], a[1])) return null;
      r -= i.text.length, i = s[0], n = s[1];
    }
    return {
      path: n,
      offset: r
    };
  }
  function lG(t, e) {
    var n = vI(t, e.anchor);
    if (!n) return null;
    if (_t.isCollapsed(e)) return {
      anchor: n,
      focus: n
    };
    var r = vI(t, e.focus);
    return r ? {
      anchor: n,
      focus: r
    } : null;
  }
  function _I(t, e, n) {
    var r = Ss.get(t), i = r == null ? void 0 : r.find((u) => {
      var { path: h } = u;
      return Me.equals(h, e.path);
    });
    if (!i || e.offset <= i.diff.start) return ei.transform(e, n, {
      affinity: "backward"
    });
    var { diff: a } = i;
    if (e.offset <= a.start + a.text.length) {
      var s = {
        path: e.path,
        offset: a.start
      }, l = ei.transform(s, n, {
        affinity: "backward"
      });
      return l ? {
        path: l.path,
        offset: l.offset + e.offset - a.start
      } : null;
    }
    var c = {
      path: e.path,
      offset: e.offset - a.text.length + a.end - a.start
    }, d = ei.transform(c, n, {
      affinity: "backward"
    });
    return d ? n.type === "split_node" && Me.equals(n.path, e.path) && c.offset < n.position && a.start < n.position ? d : {
      path: d.path,
      offset: d.offset + a.text.length - a.end + a.start
    } : null;
  }
  function cG(t, e, n) {
    var r = _I(t, e.anchor, n);
    if (!r) return null;
    if (_t.isCollapsed(e)) return {
      anchor: r,
      focus: r
    };
    var i = _I(t, e.focus, n);
    return i ? {
      anchor: r,
      focus: i
    } : null;
  }
  function K7e(t, e) {
    var { path: n, diff: r, id: i } = t;
    switch (e.type) {
      case "insert_text":
        return !Me.equals(e.path, n) || e.offset >= r.end ? t : e.offset <= r.start ? {
          diff: {
            start: e.text.length + r.start,
            end: e.text.length + r.end,
            text: r.text
          },
          id: i,
          path: n
        } : {
          diff: {
            start: r.start,
            end: r.end + e.text.length,
            text: r.text
          },
          id: i,
          path: n
        };
      case "remove_text":
        return !Me.equals(e.path, n) || e.offset >= r.end ? t : e.offset + e.text.length <= r.start ? {
          diff: {
            start: r.start - e.text.length,
            end: r.end - e.text.length,
            text: r.text
          },
          id: i,
          path: n
        } : {
          diff: {
            start: r.start,
            end: r.end - e.text.length,
            text: r.text
          },
          id: i,
          path: n
        };
      case "split_node":
        return !Me.equals(e.path, n) || e.position >= r.end ? {
          diff: r,
          id: i,
          path: Me.transform(n, e, {
            affinity: "backward"
          })
        } : e.position > r.start ? {
          diff: {
            start: r.start,
            end: Math.min(e.position, r.end),
            text: r.text
          },
          id: i,
          path: n
        } : {
          diff: {
            start: r.start - e.position,
            end: r.end - e.position,
            text: r.text
          },
          id: i,
          path: Me.transform(n, e, {
            affinity: "forward"
          })
        };
      case "merge_node":
        return Me.equals(e.path, n) ? {
          diff: {
            start: r.start + e.position,
            end: r.end + e.position,
            text: r.text
          },
          id: i,
          path: Me.transform(n, e)
        } : {
          diff: r,
          id: i,
          path: Me.transform(n, e)
        };
    }
    var a = Me.transform(n, e);
    return a ? {
      diff: r,
      path: a,
      id: i
    } : null;
  }
  var dG = (t, e) => {
    var n = (e.top + e.bottom) / 2;
    return t.top <= n && t.bottom >= n;
  }, uG = (t, e, n) => {
    var r = mr.toDOMRange(t, e).getBoundingClientRect(), i = mr.toDOMRange(t, n).getBoundingClientRect();
    return dG(r, i) && dG(i, r);
  }, G7e = (t, e) => {
    var n = fe.range(t, _t.end(e)), r = Array.from(fe.positions(t, {
      at: e
    })), i = 0, a = r.length, s = Math.floor(a / 2);
    if (uG(t, fe.range(t, r[i]), n)) return fe.range(t, r[i], n);
    if (r.length < 2) return fe.range(t, r[r.length - 1], n);
    for (; s !== r.length && s !== i; ) uG(t, fe.range(t, r[s]), n) ? a = s : i = s, s = Math.floor((i + a) / 2);
    return fe.range(t, r[i], n);
  };
  function hG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function fG(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? hG(Object(n), true).forEach(function(r) {
        tM(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : hG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Y7e = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "x-slate-fragment", r = e, { apply: i, onChange: a, deleteBackward: s, addMark: l, removeMark: c } = r;
    return eS.set(r, /* @__PURE__ */ new WeakMap()), r.addMark = (d, u) => {
      var h, f;
      (h = nM.get(r)) === null || h === void 0 || h(), !Tc.get(r) && (f = Ss.get(r)) !== null && f !== void 0 && f.length && Tc.set(r, null), Mu.delete(r), l(d, u);
    }, r.removeMark = (d) => {
      var u;
      !Tc.get(r) && (u = Ss.get(r)) !== null && u !== void 0 && u.length && Tc.set(r, null), Mu.delete(r), c(d);
    }, r.deleteBackward = (d) => {
      if (d !== "line") return s(d);
      if (r.selection && _t.isCollapsed(r.selection)) {
        var u = fe.above(r, {
          match: (m) => Le.isElement(m) && fe.isBlock(r, m),
          at: r.selection
        });
        if (u) {
          var [, h] = u, f = fe.range(r, h, r.selection.anchor), g = G7e(r, f);
          _t.isCollapsed(g) || xt.delete(r, {
            at: g
          });
        }
      }
    }, r.apply = (d) => {
      var u = [], h = [], f = Ss.get(r);
      if (f != null && f.length) {
        var g = f.map((M) => K7e(M, d)).filter(Boolean);
        Ss.set(r, g);
      }
      var m = Eu.get(r);
      m && Eu.set(r, cG(r, m, d));
      var v = af.get(r);
      if (v != null && v.at) {
        var y = vr.isPoint(v == null ? void 0 : v.at) ? _I(r, v.at, d) : cG(r, v.at, d);
        af.set(r, y ? fG(fG({}, v), {}, {
          at: y
        }) : null);
      }
      switch (d.type) {
        case "insert_text":
        case "remove_text":
        case "set_node":
        case "split_node": {
          u.push(...D0(r, d.path));
          break;
        }
        case "set_selection": {
          var w;
          (w = a2.get(r)) === null || w === void 0 || w.unref(), a2.delete(r);
          break;
        }
        case "insert_node":
        case "remove_node": {
          u.push(...D0(r, Me.parent(d.path)));
          break;
        }
        case "merge_node": {
          var b = Me.previous(d.path);
          u.push(...D0(r, b));
          break;
        }
        case "move_node": {
          var j = Me.common(Me.parent(d.path), Me.parent(d.newPath));
          u.push(...D0(r, j));
          var k;
          Me.isBefore(d.path, d.newPath) ? (u.push(...D0(r, Me.parent(d.path))), k = d.newPath) : (u.push(...D0(r, Me.parent(d.newPath))), k = d.path);
          var C = Le.get(e, Me.parent(k)), x = mr.findKey(r, C), S = fe.pathRef(r, Me.parent(k));
          h.push([
            S,
            x
          ]);
          break;
        }
      }
      switch (i(d), d.type) {
        case "insert_node":
        case "remove_node":
        case "merge_node":
        case "move_node":
        case "split_node":
        case "insert_text":
        case "remove_text":
        case "set_selection":
          b1.set(r, true);
      }
      for (var [T, A] of u) {
        var [B] = fe.node(r, T);
        hE.set(B, A);
      }
      for (var [U, z] of h) {
        if (U.current) {
          var [O] = fe.node(r, U.current);
          hE.set(O, z);
        }
        U.unref();
      }
    }, r.setFragmentData = (d) => {
      var { selection: u } = r;
      if (u) {
        var [h, f] = _t.edges(u), g = fe.void(r, {
          at: h.path
        }), m = fe.void(r, {
          at: f.path
        });
        if (!(_t.isCollapsed(u) && !g)) {
          var v = mr.toDOMRange(r, u), y = v.cloneContents(), w = y.childNodes[0];
          if (y.childNodes.forEach((B) => {
            B.textContent && B.textContent.trim() !== "" && (w = B);
          }), m) {
            var [b] = m, j = v.cloneRange(), k = mr.toDOMNode(r, b);
            j.setEndAfter(k), y = j.cloneContents();
          }
          if (g && (w = y.querySelector("[data-slate-spacer]")), Array.from(y.querySelectorAll("[data-slate-zero-width]")).forEach((B) => {
            var U = B.getAttribute("data-slate-zero-width") === "n";
            B.textContent = U ? `
` : "";
          }), Ase(w)) {
            var C = w.ownerDocument.createElement("span");
            C.style.whiteSpace = "pre", C.appendChild(w), y.appendChild(C), w = C;
          }
          var x = r.getFragment(), S = JSON.stringify(x), T = window.btoa(encodeURIComponent(S));
          w.setAttribute("data-slate-fragment", T), d.setData("application/".concat(n), T);
          var A = y.ownerDocument.createElement("div");
          return A.appendChild(y), A.setAttribute("hidden", "true"), y.ownerDocument.body.appendChild(A), d.setData("text/html", A.innerHTML), d.setData("text/plain", Bse(A)), y.ownerDocument.body.removeChild(A), d;
        }
      }
    }, r.insertData = (d) => {
      r.insertFragmentData(d) || r.insertTextData(d);
    }, r.insertFragmentData = (d) => {
      var u = d.getData("application/".concat(n)) || T7e(d);
      if (u) {
        var h = decodeURIComponent(window.atob(u)), f = JSON.parse(h);
        return r.insertFragment(f), true;
      }
      return false;
    }, r.insertTextData = (d) => {
      var u = d.getData("text/plain");
      if (u) {
        var h = u.split(/\r\n|\r|\n/), f = false;
        for (var g of h) f && xt.splitNodes(r, {
          always: true
        }), r.insertText(g), f = true;
        return true;
      }
      return false;
    }, r.onChange = (d) => {
      var u = FI.get(r);
      u && u(d), a(d);
    }, r;
  }, D0 = (t, e) => {
    var n = [];
    for (var [r, i] of fe.levels(t, {
      at: e
    })) {
      var a = mr.findKey(t, r);
      n.push([
        i,
        a
      ]);
    }
    return n;
  }, Z7e = 3, J7e = {
    bold: "mod+b",
    compose: [
      "down",
      "left",
      "right",
      "up",
      "backspace",
      "enter"
    ],
    moveBackward: "left",
    moveForward: "right",
    moveWordBackward: "ctrl+left",
    moveWordForward: "ctrl+right",
    deleteBackward: "shift?+backspace",
    deleteForward: "shift?+delete",
    extendBackward: "shift+left",
    extendForward: "shift+right",
    italic: "mod+i",
    insertSoftBreak: "shift+enter",
    splitBlock: "enter",
    undo: "mod+z"
  }, X7e = {
    moveLineBackward: "opt+up",
    moveLineForward: "opt+down",
    moveWordBackward: "opt+left",
    moveWordForward: "opt+right",
    deleteBackward: [
      "ctrl+backspace",
      "ctrl+h"
    ],
    deleteForward: [
      "ctrl+delete",
      "ctrl+d"
    ],
    deleteLineBackward: "cmd+shift?+backspace",
    deleteLineForward: [
      "cmd+shift?+delete",
      "ctrl+k"
    ],
    deleteWordBackward: "opt+shift?+backspace",
    deleteWordForward: "opt+shift?+delete",
    extendLineBackward: "opt+shift+up",
    extendLineForward: "opt+shift+down",
    redo: "cmd+shift+z",
    transposeCharacter: "ctrl+t"
  }, Q7e = {
    deleteWordBackward: "ctrl+shift?+backspace",
    deleteWordForward: "ctrl+shift?+delete",
    redo: [
      "ctrl+y",
      "ctrl+shift+z"
    ]
  }, zi = (t) => {
    var e = J7e[t], n = X7e[t], r = Q7e[t], i = e && Yt.isHotkey(e), a = n && Yt.isHotkey(n), s = r && Yt.isHotkey(r);
    return (l) => !!(i && i(l) || sG && a && a(l) || !sG && s && s(l));
  }, Zi = {
    isBold: zi("bold"),
    isCompose: zi("compose"),
    isMoveBackward: zi("moveBackward"),
    isMoveForward: zi("moveForward"),
    isDeleteBackward: zi("deleteBackward"),
    isDeleteForward: zi("deleteForward"),
    isDeleteLineBackward: zi("deleteLineBackward"),
    isDeleteLineForward: zi("deleteLineForward"),
    isDeleteWordBackward: zi("deleteWordBackward"),
    isDeleteWordForward: zi("deleteWordForward"),
    isExtendBackward: zi("extendBackward"),
    isExtendForward: zi("extendForward"),
    isExtendLineBackward: zi("extendLineBackward"),
    isExtendLineForward: zi("extendLineForward"),
    isItalic: zi("italic"),
    isMoveLineBackward: zi("moveLineBackward"),
    isMoveLineForward: zi("moveLineForward"),
    isMoveWordBackward: zi("moveWordBackward"),
    isMoveWordForward: zi("moveWordForward"),
    isRedo: zi("redo"),
    isSoftBreak: zi("insertSoftBreak"),
    isSplitBlock: zi("splitBlock"),
    isTransposeCharacter: zi("transposeCharacter"),
    isUndo: zi("undo")
  };
  function eBe(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function mG(t, e) {
    if (t == null) return {};
    var n = eBe(t, e), r, i;
    if (Object.getOwnPropertySymbols) {
      var a = Object.getOwnPropertySymbols(t);
      for (i = 0; i < a.length; i++) r = a[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }
  var tBe = [
    "anchor",
    "focus"
  ], nBe = [
    "anchor",
    "focus"
  ];
  function gG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function pG(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? gG(Object(n), true).forEach(function(r) {
        tM(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : gG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var rBe = (t, e) => Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((n) => e.hasOwnProperty(n) && t[n] === e[n]), Vse = (t, e) => {
    var n = mG(t, tBe), r = mG(e, nBe);
    return t[hF] === e[hF] && rBe(n, r);
  }, rM = (t, e) => {
    if (t === e) return true;
    if (!t || !e || t.length !== e.length) return false;
    for (var n = 0; n < t.length; n++) {
      var r = t[n], i = e[n];
      if (!_t.equals(r, i) || !Vse(r, i)) return false;
    }
    return true;
  }, Hse = (t, e) => {
    if (t === e) return true;
    if (!t || !e || t.length !== e.length) return false;
    for (var n = 0; n < t.length; n++) {
      var r = t[n], i = e[n];
      if (r.anchor.offset !== i.anchor.offset || r.focus.offset !== i.focus.offset || !Vse(r, i)) return false;
    }
    return true;
  }, iBe = (t, e, n) => {
    var r = Array.from(e.children, () => []);
    if (n.length === 0) return r;
    var i = mr.findPath(t, e), a = i.length, s = fe.range(t, i), l = new Array(e.children.length), c = (j) => {
      var k = l[j];
      if (k) return k;
      var C = fe.range(t, [
        ...i,
        j
      ]);
      return l[j] = C, C;
    };
    for (var d of n) {
      var u = _t.intersection(s, d);
      if (u) for (var [h, f] = _t.edges(u), g = h.path[a], m = f.path[a], v = g; v <= m; v++) {
        var y = r[v];
        if (y) {
          var w = c(v), b = _t.intersection(w, d);
          b && y.push(pG(pG({}, d), b));
        }
      }
    }
    return r;
  }, Rg = [], oBe = function() {
    return Rg.some(function(t) {
      return t.activeTargets.length > 0;
    });
  }, aBe = function() {
    return Rg.some(function(t) {
      return t.skippedTargets.length > 0;
    });
  }, FG = "ResizeObserver loop completed with undelivered notifications.", sBe = function() {
    var t;
    typeof ErrorEvent == "function" ? t = new ErrorEvent("error", {
      message: FG
    }) : (t = document.createEvent("Event"), t.initEvent("error", false, false), t.message = FG), window.dispatchEvent(t);
  }, fb;
  (function(t) {
    t.BORDER_BOX = "border-box", t.CONTENT_BOX = "content-box", t.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
  })(fb || (fb = {}));
  var Ag = function(t) {
    return Object.freeze(t);
  }, lBe = /* @__PURE__ */ (function() {
    function t(e, n) {
      this.inlineSize = e, this.blockSize = n, Ag(this);
    }
    return t;
  })(), $se = (function() {
    function t(e, n, r, i) {
      return this.x = e, this.y = n, this.width = r, this.height = i, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, Ag(this);
    }
    return t.prototype.toJSON = function() {
      var e = this, n = e.x, r = e.y, i = e.top, a = e.right, s = e.bottom, l = e.left, c = e.width, d = e.height;
      return {
        x: n,
        y: r,
        top: i,
        right: a,
        bottom: s,
        left: l,
        width: c,
        height: d
      };
    }, t.fromRect = function(e) {
      return new t(e.x, e.y, e.width, e.height);
    }, t;
  })(), iM = function(t) {
    return t instanceof SVGElement && "getBBox" in t;
  }, Wse = function(t) {
    if (iM(t)) {
      var e = t.getBBox(), n = e.width, r = e.height;
      return !n && !r;
    }
    var i = t, a = i.offsetWidth, s = i.offsetHeight;
    return !(a || s || t.getClientRects().length);
  }, vG = function(t) {
    var e;
    if (t instanceof Element) return true;
    var n = (e = t == null ? void 0 : t.ownerDocument) === null || e === void 0 ? void 0 : e.defaultView;
    return !!(n && t instanceof n.Element);
  }, cBe = function(t) {
    switch (t.tagName) {
      case "INPUT":
        if (t.type !== "image") break;
      case "VIDEO":
      case "AUDIO":
      case "EMBED":
      case "OBJECT":
      case "CANVAS":
      case "IFRAME":
      case "IMG":
        return true;
    }
    return false;
  }, s2 = typeof window < "u" ? window : {}, Tw = /* @__PURE__ */ new WeakMap(), _G = /auto|scroll/, dBe = /^tb|vertical/, uBe = /msie|trident/i.test(s2.navigator && s2.navigator.userAgent), hd = function(t) {
    return parseFloat(t || "0");
  }, x1 = function(t, e, n) {
    return t === void 0 && (t = 0), e === void 0 && (e = 0), n === void 0 && (n = false), new lBe((n ? e : t) || 0, (n ? t : e) || 0);
  }, yG = Ag({
    devicePixelContentBoxSize: x1(),
    borderBoxSize: x1(),
    contentBoxSize: x1(),
    contentRect: new $se(0, 0, 0, 0)
  }), qse = function(t, e) {
    if (e === void 0 && (e = false), Tw.has(t) && !e) return Tw.get(t);
    if (Wse(t)) return Tw.set(t, yG), yG;
    var n = getComputedStyle(t), r = iM(t) && t.ownerSVGElement && t.getBBox(), i = !uBe && n.boxSizing === "border-box", a = dBe.test(n.writingMode || ""), s = !r && _G.test(n.overflowY || ""), l = !r && _G.test(n.overflowX || ""), c = r ? 0 : hd(n.paddingTop), d = r ? 0 : hd(n.paddingRight), u = r ? 0 : hd(n.paddingBottom), h = r ? 0 : hd(n.paddingLeft), f = r ? 0 : hd(n.borderTopWidth), g = r ? 0 : hd(n.borderRightWidth), m = r ? 0 : hd(n.borderBottomWidth), v = r ? 0 : hd(n.borderLeftWidth), y = h + d, w = c + u, b = v + g, j = f + m, k = l ? t.offsetHeight - j - t.clientHeight : 0, C = s ? t.offsetWidth - b - t.clientWidth : 0, x = i ? y + b : 0, S = i ? w + j : 0, T = r ? r.width : hd(n.width) - x - C, A = r ? r.height : hd(n.height) - S - k, B = T + y + C + b, U = A + w + k + j, z = Ag({
      devicePixelContentBoxSize: x1(Math.round(T * devicePixelRatio), Math.round(A * devicePixelRatio), a),
      borderBoxSize: x1(B, U, a),
      contentBoxSize: x1(T, A, a),
      contentRect: new $se(h, c, T, A)
    });
    return Tw.set(t, z), z;
  }, Kse = function(t, e, n) {
    var r = qse(t, n), i = r.borderBoxSize, a = r.contentBoxSize, s = r.devicePixelContentBoxSize;
    switch (e) {
      case fb.DEVICE_PIXEL_CONTENT_BOX:
        return s;
      case fb.BORDER_BOX:
        return i;
      default:
        return a;
    }
  }, hBe = /* @__PURE__ */ (function() {
    function t(e) {
      var n = qse(e);
      this.target = e, this.contentRect = n.contentRect, this.borderBoxSize = Ag([
        n.borderBoxSize
      ]), this.contentBoxSize = Ag([
        n.contentBoxSize
      ]), this.devicePixelContentBoxSize = Ag([
        n.devicePixelContentBoxSize
      ]);
    }
    return t;
  })(), Gse = function(t) {
    if (Wse(t)) return 1 / 0;
    for (var e = 0, n = t.parentNode; n; ) e += 1, n = n.parentNode;
    return e;
  }, fBe = function() {
    var t = 1 / 0, e = [];
    Rg.forEach(function(s) {
      if (s.activeTargets.length !== 0) {
        var l = [];
        s.activeTargets.forEach(function(d) {
          var u = new hBe(d.target), h = Gse(d.target);
          l.push(u), d.lastReportedSize = Kse(d.target, d.observedBox), h < t && (t = h);
        }), e.push(function() {
          s.callback.call(s.observer, l, s.observer);
        }), s.activeTargets.splice(0, s.activeTargets.length);
      }
    });
    for (var n = 0, r = e; n < r.length; n++) {
      var i = r[n];
      i();
    }
    return t;
  }, bG = function(t) {
    Rg.forEach(function(n) {
      n.activeTargets.splice(0, n.activeTargets.length), n.skippedTargets.splice(0, n.skippedTargets.length), n.observationTargets.forEach(function(i) {
        i.isActive() && (Gse(i.target) > t ? n.activeTargets.push(i) : n.skippedTargets.push(i));
      });
    });
  }, mBe = function() {
    var t = 0;
    for (bG(t); oBe(); ) t = fBe(), bG(t);
    return aBe() && sBe(), t > 0;
  }, k5, Yse = [], gBe = function() {
    return Yse.splice(0).forEach(function(t) {
      return t();
    });
  }, pBe = function(t) {
    if (!k5) {
      var e = 0, n = document.createTextNode(""), r = {
        characterData: true
      };
      new MutationObserver(function() {
        return gBe();
      }).observe(n, r), k5 = function() {
        n.textContent = "".concat(e ? e-- : e++);
      };
    }
    Yse.push(t), k5();
  }, FBe = function(t) {
    pBe(function() {
      requestAnimationFrame(t);
    });
  }, ZD = 0, vBe = function() {
    return !!ZD;
  }, _Be = 250, yBe = {
    attributes: true,
    characterData: true,
    childList: true,
    subtree: true
  }, xG = [
    "resize",
    "load",
    "transitionend",
    "animationend",
    "animationstart",
    "animationiteration",
    "keyup",
    "keydown",
    "mouseup",
    "mousedown",
    "mouseover",
    "mouseout",
    "blur",
    "focus"
  ], wG = function(t) {
    return t === void 0 && (t = 0), Date.now() + t;
  }, S5 = false, bBe = (function() {
    function t() {
      var e = this;
      this.stopped = true, this.listener = function() {
        return e.schedule();
      };
    }
    return t.prototype.run = function(e) {
      var n = this;
      if (e === void 0 && (e = _Be), !S5) {
        S5 = true;
        var r = wG(e);
        FBe(function() {
          var i = false;
          try {
            i = mBe();
          } finally {
            if (S5 = false, e = r - wG(), !vBe()) return;
            i ? n.run(1e3) : e > 0 ? n.run(e) : n.start();
          }
        });
      }
    }, t.prototype.schedule = function() {
      this.stop(), this.run();
    }, t.prototype.observe = function() {
      var e = this, n = function() {
        return e.observer && e.observer.observe(document.body, yBe);
      };
      document.body ? n() : s2.addEventListener("DOMContentLoaded", n);
    }, t.prototype.start = function() {
      var e = this;
      this.stopped && (this.stopped = false, this.observer = new MutationObserver(this.listener), this.observe(), xG.forEach(function(n) {
        return s2.addEventListener(n, e.listener, true);
      }));
    }, t.prototype.stop = function() {
      var e = this;
      this.stopped || (this.observer && this.observer.disconnect(), xG.forEach(function(n) {
        return s2.removeEventListener(n, e.listener, true);
      }), this.stopped = true);
    }, t;
  })(), yI = new bBe(), DG = function(t) {
    !ZD && t > 0 && yI.start(), ZD += t, !ZD && yI.stop();
  }, xBe = function(t) {
    return !iM(t) && !cBe(t) && getComputedStyle(t).display === "inline";
  }, wBe = (function() {
    function t(e, n) {
      this.target = e, this.observedBox = n || fb.CONTENT_BOX, this.lastReportedSize = {
        inlineSize: 0,
        blockSize: 0
      };
    }
    return t.prototype.isActive = function() {
      var e = Kse(this.target, this.observedBox, true);
      return xBe(this.target) && (this.lastReportedSize = e), this.lastReportedSize.inlineSize !== e.inlineSize || this.lastReportedSize.blockSize !== e.blockSize;
    }, t;
  })(), DBe = /* @__PURE__ */ (function() {
    function t(e, n) {
      this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = e, this.callback = n;
    }
    return t;
  })(), Rw = /* @__PURE__ */ new WeakMap(), CG = function(t, e) {
    for (var n = 0; n < t.length; n += 1) if (t[n].target === e) return n;
    return -1;
  }, Aw = (function() {
    function t() {
    }
    return t.connect = function(e, n) {
      var r = new DBe(e, n);
      Rw.set(e, r);
    }, t.observe = function(e, n, r) {
      var i = Rw.get(e), a = i.observationTargets.length === 0;
      CG(i.observationTargets, n) < 0 && (a && Rg.push(i), i.observationTargets.push(new wBe(n, r && r.box)), DG(1), yI.schedule());
    }, t.unobserve = function(e, n) {
      var r = Rw.get(e), i = CG(r.observationTargets, n), a = r.observationTargets.length === 1;
      i >= 0 && (a && Rg.splice(Rg.indexOf(r), 1), r.observationTargets.splice(i, 1), DG(-1));
    }, t.disconnect = function(e) {
      var n = this, r = Rw.get(e);
      r.observationTargets.slice().forEach(function(i) {
        return n.unobserve(e, i.target);
      }), r.activeTargets.splice(0, r.activeTargets.length);
    }, t;
  })(), CBe = (function() {
    function t(e) {
      if (arguments.length === 0) throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
      if (typeof e != "function") throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
      Aw.connect(this, e);
    }
    return t.prototype.observe = function(e, n) {
      if (arguments.length === 0) throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
      if (!vG(e)) throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
      Aw.observe(this, e, n);
    }, t.prototype.unobserve = function(e) {
      if (arguments.length === 0) throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
      if (!vG(e)) throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
      Aw.unobserve(this, e);
    }, t.prototype.disconnect = function() {
      Aw.disconnect(this);
    }, t.toString = function() {
      return "function ResizeObserver () { [polyfill code] }";
    }, t;
  })();
  function EBe(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function fE(t, e) {
    if (t == null) return {};
    var n = EBe(t, e), r, i;
    if (Object.getOwnPropertySymbols) {
      var a = Object.getOwnPropertySymbols(t);
      for (i = 0; i < a.length; i++) r = a[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }
  function mb(t) {
    "@babel/helpers - typeof";
    return mb = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, mb(t);
  }
  function kBe(t, e) {
    if (mb(t) !== "object" || t === null) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (mb(r) !== "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function SBe(t) {
    var e = kBe(t, "string");
    return mb(e) === "symbol" ? e : String(e);
  }
  function Bi(t, e, n) {
    return e = SBe(e), e in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  var oM = p.createContext(null), nd = () => {
    var t = p.useContext(oM);
    if (!t) throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");
    return t;
  }, Bt = mr;
  function EG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Iw(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? EG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : EG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var jBe = 25, TBe = 200, RBe = function() {
  }, ABe = (t) => (t == null ? void 0 : t.constructor.name) === "DataTransfer";
  function IBe(t) {
    var { editor: e, scheduleOnDOMSelectionChange: n, onDOMSelectionChange: r } = t, i = false, a = null, s = null, l = null, c = 0, d = false, u = () => {
      var z = Eu.get(e);
      if (Eu.delete(e), z) {
        var { selection: O } = e, M = lG(e, z);
        M && (!O || !_t.equals(M, O)) && xt.select(e, M);
      }
    }, h = () => {
      var z = af.get(e);
      if (af.delete(e), !!z) {
        if (z.at) {
          var O = vr.isPoint(z.at) ? vI(e, z.at) : lG(e, z.at);
          if (!O) return;
          var M = fe.range(e, O);
          (!e.selection || !_t.equals(e.selection, M)) && xt.select(e, O);
        }
        z.run();
      }
    }, f = () => {
      if (s && (clearTimeout(s), s = null), l && (clearTimeout(l), l = null), !k() && !j()) {
        u();
        return;
      }
      i || (i = true, setTimeout(() => i = false)), j() && (i = "action");
      var z = e.selection && fe.rangeRef(e, e.selection, {
        affinity: "forward"
      });
      Mu.set(e, e.marks), RBe("flush", af.get(e), Ss.get(e));
      for (var O = k(), M; M = (I = Ss.get(e)) === null || I === void 0 ? void 0 : I[0]; ) {
        var I, N, L = Tc.get(e);
        L !== void 0 && (Tc.delete(e), e.marks = L), L && d === false && (d = null);
        var H = q7e(M);
        (!e.selection || !_t.equals(e.selection, H)) && xt.select(e, H), M.diff.text ? fe.insertText(e, M.diff.text) : fe.deleteFragment(e), Ss.set(e, (N = Ss.get(e)) === null || N === void 0 ? void 0 : N.filter((Y) => {
          var { id: oe } = Y;
          return oe !== M.id;
        })), V7e(e, M) || (O = false, af.delete(e), Mu.delete(e), i = "action", Eu.delete(e), n.cancel(), r.cancel(), z == null ? void 0 : z.unref());
      }
      var V = z == null ? void 0 : z.unref();
      if (V && !Eu.get(e) && (!e.selection || !_t.equals(V, e.selection)) && xt.select(e, V), j()) {
        h();
        return;
      }
      O && n(), n.flush(), r.flush(), u();
      var Z = Mu.get(e);
      Mu.delete(e), Z !== void 0 && (e.marks = Z, e.onChange());
    }, g = (z) => {
      a && clearTimeout(a), a = setTimeout(() => {
        mg.set(e, false), f();
      }, jBe);
    }, m = (z) => {
      mg.set(e, true), a && (clearTimeout(a), a = null);
    }, v = function() {
      var O = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, M = gI.get(e);
      if (M) {
        if (k() || O) {
          M.style.display = "none";
          return;
        }
        M.style.removeProperty("display");
      }
    }, y = (z, O) => {
      var M, I = (M = Ss.get(e)) !== null && M !== void 0 ? M : [];
      Ss.set(e, I);
      var N = Le.leaf(e, z), L = I.findIndex((Z) => Me.equals(Z.path, z));
      if (L < 0) {
        var H = Use(N.text, O);
        H && I.push({
          path: z,
          diff: O,
          id: c++
        }), v();
        return;
      }
      var V = W7e(N.text, I[L].diff, O);
      if (!V) {
        I.splice(L, 1), v();
        return;
      }
      I[L] = Iw(Iw({}, I[L]), {}, {
        diff: V
      });
    }, w = function(O) {
      var { at: M } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      d = false, Eu.delete(e), n.cancel(), r.cancel(), j() && f(), af.set(e, {
        at: M,
        run: O
      }), l = setTimeout(f);
    }, b = (z) => {
      var O;
      if (s && (clearTimeout(s), s = null), !b1.get(e)) {
        var { inputType: M } = z, I = null, N = z.dataTransfer || z.data || void 0;
        d !== false && M !== "insertText" && M !== "insertCompositionText" && (d = false);
        var [L] = z.getTargetRanges();
        L && (I = Bt.toSlateRange(e, L, {
          exactMatch: false,
          suppressThrow: true
        }));
        var H = Bt.getWindow(e), V = H.getSelection();
        if (!I && V && (L = V, I = Bt.toSlateRange(e, V, {
          exactMatch: false,
          suppressThrow: true
        })), I = (O = I) !== null && O !== void 0 ? O : e.selection, !!I) {
          var Z = true;
          if (M.startsWith("delete")) {
            var Y = M.endsWith("Backward") ? "backward" : "forward", [oe, ue] = _t.edges(I), [ie, de] = fe.leaf(e, oe.path);
            if (_t.isExpanded(I) && ie.text.length === oe.offset && ue.offset === 0) {
              var ne = fe.next(e, {
                at: oe.path,
                match: Le.isText
              });
              ne && Me.equals(ne[1], ue.path) && (Y === "backward" ? (I = {
                anchor: ue,
                focus: ue
              }, oe = ue, [ie, de] = ne) : (I = {
                anchor: oe,
                focus: oe
              }, ue = oe));
            }
            var ae = {
              text: "",
              start: oe.offset,
              end: ue.offset
            }, X = Ss.get(e), K = X == null ? void 0 : X.find((bt) => Me.equals(bt.path, de)), G = K ? [
              K.diff,
              ae
            ] : [
              ae
            ], le = zse(ie.text, ...G);
            if (le.length === 0 && (Z = false), _t.isExpanded(I)) {
              if (Z && Me.equals(I.anchor.path, I.focus.path)) {
                var te = {
                  path: I.anchor.path,
                  offset: oe.offset
                }, re = fe.range(e, te, te);
                return S(re), y(I.anchor.path, {
                  text: "",
                  end: ue.offset,
                  start: oe.offset
                });
              }
              return w(() => fe.deleteFragment(e, {
                direction: Y
              }), {
                at: I
              });
            }
          }
          switch (M) {
            case "deleteByComposition":
            case "deleteByCut":
            case "deleteByDrag":
              return w(() => fe.deleteFragment(e), {
                at: I
              });
            case "deleteContent":
            case "deleteContentForward": {
              var { anchor: he } = I;
              if (Z && _t.isCollapsed(I)) {
                var se = Le.leaf(e, he.path);
                if (he.offset < se.text.length) return y(he.path, {
                  text: "",
                  start: he.offset,
                  end: he.offset + 1
                });
              }
              return w(() => fe.deleteForward(e), {
                at: I
              });
            }
            case "deleteContentBackward": {
              var ye, { anchor: we } = I, Ee = mI(L) ? L.isCollapsed : !!((ye = L) !== null && ye !== void 0 && ye.collapsed);
              return Z && Ee && _t.isCollapsed(I) && we.offset > 0 ? y(we.path, {
                text: "",
                start: we.offset - 1,
                end: we.offset
              }) : w(() => fe.deleteBackward(e), {
                at: I
              });
            }
            case "deleteEntireSoftLine":
              return w(() => {
                fe.deleteBackward(e, {
                  unit: "line"
                }), fe.deleteForward(e, {
                  unit: "line"
                });
              }, {
                at: I
              });
            case "deleteHardLineBackward":
              return w(() => fe.deleteBackward(e, {
                unit: "block"
              }), {
                at: I
              });
            case "deleteSoftLineBackward":
              return w(() => fe.deleteBackward(e, {
                unit: "line"
              }), {
                at: I
              });
            case "deleteHardLineForward":
              return w(() => fe.deleteForward(e, {
                unit: "block"
              }), {
                at: I
              });
            case "deleteSoftLineForward":
              return w(() => fe.deleteForward(e, {
                unit: "line"
              }), {
                at: I
              });
            case "deleteWordBackward":
              return w(() => fe.deleteBackward(e, {
                unit: "word"
              }), {
                at: I
              });
            case "deleteWordForward":
              return w(() => fe.deleteForward(e, {
                unit: "word"
              }), {
                at: I
              });
            case "insertLineBreak":
              return w(() => fe.insertSoftBreak(e), {
                at: I
              });
            case "insertParagraph":
              return w(() => fe.insertBreak(e), {
                at: I
              });
            case "insertCompositionText":
            case "deleteCompositionText":
            case "insertFromComposition":
            case "insertFromDrop":
            case "insertFromPaste":
            case "insertFromYank":
            case "insertReplacementText":
            case "insertText": {
              if (ABe(N)) return w(() => Bt.insertData(e, N), {
                at: I
              });
              var ke = N ?? "";
              if (Tc.get(e) && (ke = ke.replace("\uFEFF", "")), M === "insertText" && /.*\n.*\n$/.test(ke) && (ke = ke.slice(0, -1)), ke.includes(`
`)) return w(() => {
                var bt = ke.split(`
`);
                bt.forEach((At, $t) => {
                  At && fe.insertText(e, At), $t !== bt.length - 1 && fe.insertSoftBreak(e);
                });
              }, {
                at: I
              });
              if (Me.equals(I.anchor.path, I.focus.path)) {
                var [Ne, lt] = _t.edges(I), Rt = {
                  start: Ne.offset,
                  end: lt.offset,
                  text: ke
                };
                if (ke && d && M === "insertCompositionText") {
                  var We = d.start + d.text.search(/\S|$/), yt = Rt.start + Rt.text.search(/\S|$/);
                  yt === We + 1 && Rt.end === d.start + d.text.length ? (Rt.start -= 1, d = null, B()) : d = false;
                } else M === "insertText" ? d === null ? d = Rt : d && _t.isCollapsed(I) && d.end + d.text.length === Ne.offset ? d = Iw(Iw({}, d), {}, {
                  text: d.text + ke
                }) : d = false : d = false;
                if (Z) {
                  var Xt = e.selection;
                  if (y(Ne.path, Rt), Xt) {
                    var nn = {
                      path: Ne.path,
                      offset: Ne.offset + ke.length
                    };
                    w(() => {
                      xt.select(e, {
                        anchor: nn,
                        focus: nn
                      });
                    }, {
                      at: nn
                    });
                  }
                  return;
                }
              }
              return w(() => fe.insertText(e, ke), {
                at: I
              });
            }
          }
        }
      }
    }, j = () => !!af.get(e), k = () => {
      var z;
      return !!((z = Ss.get(e)) !== null && z !== void 0 && z.length);
    }, C = () => j() || k(), x = () => i, S = (z) => {
      Eu.set(e, z), s && (clearTimeout(s), s = null);
      var { selection: O } = e;
      if (z) {
        var M = !O || !Me.equals(O.anchor.path, z.anchor.path), I = !O || !Me.equals(O.anchor.path.slice(0, -1), z.anchor.path.slice(0, -1));
        (M && d || I) && (d = false), (M || k()) && (s = setTimeout(f, TBe));
      }
    }, T = () => {
      (j() || !k()) && f();
    }, A = (z) => {
      k() || (v(true), setTimeout(v));
    }, B = () => {
      j() || (l = setTimeout(f));
    }, U = (z) => {
      if (!(k() || j()) && z.some((M) => QP(e, M, z))) {
        var O;
        (O = Lse.get(e)) === null || O === void 0 || O();
      }
    };
    return {
      flush: f,
      scheduleFlush: B,
      hasPendingDiffs: k,
      hasPendingAction: j,
      hasPendingChanges: C,
      isFlushing: x,
      handleUserSelect: S,
      handleCompositionEnd: g,
      handleCompositionStart: m,
      handleDOMBeforeInput: b,
      handleKeyDown: A,
      handleDomMutations: U,
      handleInput: T
    };
  }
  function BBe() {
    var t = p.useRef(false);
    return p.useEffect(() => (t.current = true, () => {
      t.current = false;
    }), []), t.current;
  }
  var $d = YD ? p.useLayoutEffect : p.useEffect;
  function PBe(t, e, n) {
    var [r] = p.useState(() => new MutationObserver(e));
    $d(() => {
      r.takeRecords();
    }), p.useEffect(() => {
      if (!t.current) throw new Error("Failed to attach MutationObserver, `node` is undefined");
      return r.observe(t.current, n), () => r.disconnect();
    }, [
      r,
      t,
      n
    ]);
  }
  var MBe = [
    "node"
  ];
  function kG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function OBe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? kG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : kG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var LBe = {
    subtree: true,
    childList: true,
    characterData: true
  }, NBe = $a ? (t) => {
    var { node: e } = t, n = fE(t, MBe);
    if (!$a) return null;
    var r = nd(), i = BBe(), [a] = p.useState(() => IBe(OBe({
      editor: r
    }, n)));
    return PBe(e, a.handleDomMutations, LBe), nM.set(r, a.scheduleFlush), i && a.flush(), a;
  } : () => null;
  function SG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function zBe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? SG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : SG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var UBe = (t) => {
    var { isLast: e, leaf: n, parent: r, text: i } = t, a = nd(), s = Bt.findPath(a, i), l = Me.parent(s), c = !!n[Nse];
    return a.isVoid(r) ? yn.createElement(j5, {
      length: Le.string(r).length
    }) : n.text === "" && r.children[r.children.length - 1] === i && !a.isInline(r) && fe.string(a, l) === "" ? yn.createElement(j5, {
      isLineBreak: true,
      isMarkPlaceholder: c
    }) : n.text === "" ? yn.createElement(j5, {
      isMarkPlaceholder: c
    }) : e && n.text.slice(-1) === `
` ? yn.createElement(jG, {
      isTrailing: true,
      text: n.text
    }) : yn.createElement(jG, {
      text: n.text
    });
  }, jG = (t) => {
    var { text: e, isTrailing: n = false } = t, r = p.useRef(null), i = () => "".concat(e ?? "").concat(n ? `
` : ""), [a] = p.useState(i);
    return $d(() => {
      var s = i();
      r.current && r.current.textContent !== s && (r.current.textContent = s);
    }), yn.createElement(VBe, {
      ref: r
    }, a);
  }, VBe = p.memo(p.forwardRef((t, e) => yn.createElement("span", {
    "data-slate-string": true,
    ref: e
  }, t.children))), j5 = (t) => {
    var { length: e = 0, isLineBreak: n = false, isMarkPlaceholder: r = false } = t, i = {
      "data-slate-zero-width": n ? "n" : "z",
      "data-slate-length": e
    };
    return r && (i["data-slate-mark-placeholder"] = true), yn.createElement("span", zBe({}, i), !$a || !n ? "\uFEFF" : null, n ? yn.createElement("br", null) : null);
  };
  function TG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Zse(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? TG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : TG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var HBe = $a ? 300 : 0;
  function $Be(t, e) {
    t.current && (t.current.disconnect(), e && (t.current = null));
  }
  function RG(t) {
    t.current && (clearTimeout(t.current), t.current = null);
  }
  var WBe = (t) => yn.createElement(GBe, Zse({}, t)), qBe = (t) => {
    var { leaf: e, isLast: n, text: r, parent: i, renderPlaceholder: a, renderLeaf: s = WBe, leafPosition: l } = t, c = nd(), d = p.useRef(null), u = p.useRef(null), [h, f] = p.useState(false), g = p.useRef(null), m = p.useCallback((j) => {
      if ($Be(d, j == null), j == null) {
        var k;
        gI.delete(c), (k = e.onPlaceholderResize) === null || k === void 0 || k.call(e, null);
      } else {
        if (gI.set(c, j), !d.current) {
          var C = window.ResizeObserver || CBe;
          d.current = new C(() => {
            var x;
            (x = e.onPlaceholderResize) === null || x === void 0 || x.call(e, j);
          });
        }
        d.current.observe(j), u.current = j;
      }
    }, [
      u,
      e,
      c
    ]), v = yn.createElement(UBe, {
      isLast: n,
      leaf: e,
      parent: i,
      text: r
    }), y = !!e[hF];
    if (p.useEffect(() => (y ? g.current || (g.current = setTimeout(() => {
      f(true), g.current = null;
    }, HBe)) : (RG(g), f(false)), () => RG(g)), [
      y,
      f
    ]), y && h) {
      var w = {
        children: e.placeholder,
        attributes: {
          "data-slate-placeholder": true,
          style: {
            position: "absolute",
            top: 0,
            pointerEvents: "none",
            width: "100%",
            maxWidth: "100%",
            display: "block",
            opacity: "0.333",
            userSelect: "none",
            textDecoration: "none",
            WebkitUserModify: Xm ? "inherit" : void 0
          },
          contentEditable: false,
          ref: m
        }
      };
      v = yn.createElement(yn.Fragment, null, v, a(w));
    }
    var b = {
      "data-slate-leaf": true
    };
    return s({
      attributes: b,
      children: v,
      leaf: e,
      text: r,
      leafPosition: l
    });
  }, KBe = yn.memo(qBe, (t, e) => e.parent === t.parent && e.isLast === t.isLast && e.renderLeaf === t.renderLeaf && e.renderPlaceholder === t.renderPlaceholder && e.text === t.text && Zo.equals(e.leaf, t.leaf) && e.leaf[hF] === t.leaf[hF]), GBe = (t) => {
    var { attributes: e, children: n } = t;
    return yn.createElement("span", Zse({}, e), n);
  };
  function Jse(t, e) {
    var [, n] = p.useReducer((d) => d + 1, 0), r = p.useRef(), i = p.useRef(() => null), a = p.useRef(null), s;
    try {
      if (t !== i.current || r.current) {
        var l = t();
        e(a.current, l) ? s = a.current : s = l;
      } else s = a.current;
    } catch (d) {
      throw r.current && YBe(d) && (d.message += `
The error may be correlated with this previous error:
`.concat(r.current.stack, `

`)), d;
    }
    i.current = t, a.current = s, r.current = void 0;
    var c = p.useCallback(() => {
      try {
        var d = i.current();
        if (e(a.current, d)) return;
        a.current = d;
      } catch (u) {
        u instanceof Error ? r.current = u : r.current = new Error(String(u));
      }
      n();
    }, []);
    return [
      s,
      c
    ];
  }
  function YBe(t) {
    return t instanceof Error;
  }
  var Xse = p.createContext({}), Qse = (t, e) => {
    var n = nd(), { decorate: r, addEventListener: i } = p.useContext(Xse), a = () => {
      var d = Bt.findPath(n, t);
      return r([
        t,
        d
      ]);
    }, s = Le.isText(t) ? Hse : rM, [l, c] = Jse(a, s);
    return $d(() => {
      var d = i(c);
      return c(), d;
    }, [
      i,
      c
    ]), p.useMemo(() => [
      ...l,
      ...e
    ], [
      l,
      e
    ]);
  }, ZBe = (t) => {
    var e = p.useRef(/* @__PURE__ */ new Set()), n = p.useRef(t);
    $d(() => {
      n.current = t, e.current.forEach((a) => a());
    }, [
      t
    ]);
    var r = p.useCallback((a) => n.current(a), []), i = p.useCallback((a) => (e.current.add(a), () => {
      e.current.delete(a);
    }), []);
    return p.useMemo(() => ({
      decorate: r,
      addEventListener: i
    }), [
      r,
      i
    ]);
  };
  function AG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function ele(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? AG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : AG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var JBe = (t) => yn.createElement(QBe, ele({}, t)), XBe = (t) => {
    for (var { decorations: e, isLast: n, parent: r, renderPlaceholder: i, renderLeaf: a, renderText: s = JBe, text: l } = t, c = nd(), d = p.useRef(null), u = Qse(l, e), h = Zo.decorations(l, u), f = Bt.findKey(c, l), g = [], m = 0; m < h.length; m++) {
      var { leaf: v, position: y } = h[m];
      g.push(yn.createElement(KBe, {
        isLast: n && m === h.length - 1,
        key: "".concat(f.id, "-").concat(m),
        renderPlaceholder: i,
        leaf: v,
        leafPosition: y,
        text: l,
        parent: r,
        renderLeaf: a
      }));
    }
    var w = p.useCallback((j) => {
      var k = eS.get(c);
      j ? (k == null ? void 0 : k.set(f, j), Tg.set(l, j), hb.set(j, l)) : (k == null ? void 0 : k.delete(f), Tg.delete(l), d.current && hb.delete(d.current)), d.current = j;
    }, [
      d,
      c,
      f,
      l
    ]), b = {
      "data-slate-node": "text",
      ref: w
    };
    return s({
      text: l,
      children: g,
      attributes: b
    });
  }, tle = yn.memo(XBe, (t, e) => e.parent === t.parent && e.isLast === t.isLast && e.renderText === t.renderText && e.renderLeaf === t.renderLeaf && e.renderPlaceholder === t.renderPlaceholder && e.text === t.text && Hse(e.decorations, t.decorations)), QBe = (t) => {
    var { attributes: e, children: n } = t;
    return yn.createElement("span", ele({}, e), n);
  };
  function IG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function bI(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? IG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : IG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var ePe = (t) => yn.createElement(rPe, bI({}, t)), tPe = (t) => {
    var { decorations: e, element: n, renderElement: r = ePe, renderChunk: i, renderPlaceholder: a, renderLeaf: s, renderText: l } = t, c = nd(), d = mPe(), u = c.isInline(n), h = Qse(n, e), f = Bt.findKey(c, n), g = p.useCallback((k) => {
      var C = eS.get(c);
      k ? (C == null ? void 0 : C.set(f, k), Tg.set(n, k), hb.set(k, n)) : (C == null ? void 0 : C.delete(f), Tg.delete(n));
    }, [
      c,
      f,
      n
    ]), m = ole({
      decorations: h,
      node: n,
      renderElement: r,
      renderChunk: i,
      renderPlaceholder: a,
      renderLeaf: s,
      renderText: l
    }), v = {
      "data-slate-node": "element",
      ref: g
    };
    if (u && (v["data-slate-inline"] = true), !u && fe.hasInlines(c, n)) {
      var y = Le.string(n), w = wse(y);
      w === "rtl" && (v.dir = w);
    }
    if (fe.isVoid(c, n)) {
      v["data-slate-void"] = true, !d && u && (v.contentEditable = false);
      var b = u ? "span" : "div", [[j]] = Le.texts(n);
      m = yn.createElement(b, {
        "data-slate-spacer": true,
        style: {
          height: "0",
          color: "transparent",
          outline: "none",
          position: "absolute"
        }
      }, yn.createElement(tle, {
        renderPlaceholder: a,
        decorations: [],
        isLast: false,
        parent: n,
        text: j
      })), q0.set(j, 0), i2.set(j, n);
    }
    return r({
      attributes: v,
      children: m,
      element: n
    });
  }, nPe = yn.memo(tPe, (t, e) => t.element === e.element && t.renderElement === e.renderElement && t.renderChunk === e.renderChunk && t.renderText === e.renderText && t.renderLeaf === e.renderLeaf && t.renderPlaceholder === e.renderPlaceholder && rM(t.decorations, e.decorations)), rPe = (t) => {
    var { attributes: e, children: n, element: r } = t, i = nd(), a = i.isInline(r) ? "span" : "div";
    return yn.createElement(a, bI(bI({}, e), {}, {
      style: {
        position: "relative"
      }
    }), n);
  };
  class iPe {
    constructor(e, n) {
      var { chunkSize: r, debug: i } = n;
      Bi(this, "root", void 0), Bi(this, "chunkSize", void 0), Bi(this, "debug", void 0), Bi(this, "reachedEnd", void 0), Bi(this, "pointerChunk", void 0), Bi(this, "pointerIndex", void 0), Bi(this, "pointerIndexStack", void 0), Bi(this, "cachedPointerNode", void 0), this.root = e, this.chunkSize = r, this.debug = i ?? false, this.pointerChunk = e, this.pointerIndex = -1, this.pointerIndexStack = [], this.reachedEnd = false, this.validateState();
    }
    readLeaf() {
      if (this.reachedEnd) return null;
      for (; ; ) if (this.pointerIndex + 1 < this.pointerSiblings.length) {
        this.pointerIndex++, this.cachedPointerNode = void 0;
        break;
      } else {
        if (this.pointerChunk.type === "root") return this.reachedEnd = true, null;
        this.exitChunk();
      }
      return this.validateState(), this.enterChunkUntilLeaf(false), this.pointerNode;
    }
    returnToPreviousLeaf() {
      if (this.reachedEnd) {
        this.reachedEnd = false, this.enterChunkUntilLeaf(true);
        return;
      }
      for (; ; ) if (this.pointerIndex >= 1) {
        this.pointerIndex--, this.cachedPointerNode = void 0;
        break;
      } else if (this.pointerChunk.type === "root") {
        this.pointerIndex = -1;
        return;
      } else this.exitChunk();
      this.validateState(), this.enterChunkUntilLeaf(true);
    }
    insertBefore(e) {
      this.returnToPreviousLeaf(), this.insertAfter(e), this.readLeaf();
    }
    insertAfter(e) {
      if (e.length !== 0) {
        for (var n = 0, r = 0; this.pointerChunk.type === "chunk" && this.pointerIndex === this.pointerSiblings.length - 1; ) {
          var i = this.chunkSize - this.pointerSiblings.length, a = Math.min(i, e.length);
          if (a > 0) {
            var s = e.splice(0, a);
            this.rawInsertAfter(s, n);
          }
          this.exitChunk(), n++;
        }
        if (e.length !== 0) {
          var l = this.savePointer(), c = null;
          if (this.readLeaf()) for (; this.pointerChunk.type === "chunk" && this.pointerIndex === 0; ) {
            var d = this.chunkSize - this.pointerSiblings.length, u = Math.min(d, e.length);
            if (u > 0) {
              var h = e.splice(-u, u);
              this.pointerIndex = -1, this.cachedPointerNode = void 0, this.rawInsertAfter(h, r), c || (c = this.savePointer());
            }
            this.exitChunk(), r++;
          }
          this.restorePointer(l);
          var f = Math.max(n, r);
          this.rawInsertAfter(e, f), c && this.restorePointer(c), this.validateState();
        }
      }
    }
    remove() {
      this.pointerSiblings.splice(this.pointerIndex--, 1), this.cachedPointerNode = void 0, this.pointerSiblings.length === 0 && this.pointerChunk.type === "chunk" ? (this.exitChunk(), this.remove()) : this.invalidateChunk(), this.validateState();
    }
    invalidateChunk() {
      for (var e = this.pointerChunk; e.type === "chunk"; e = e.parent) this.root.modifiedChunks.add(e);
    }
    get atStart() {
      return this.pointerChunk.type === "root" && this.pointerIndex === -1;
    }
    get pointerSiblings() {
      return this.pointerChunk.children;
    }
    getPointerNode() {
      return this.reachedEnd || this.pointerIndex === -1 ? null : this.pointerSiblings[this.pointerIndex];
    }
    get pointerNode() {
      if (this.cachedPointerNode !== void 0) return this.cachedPointerNode;
      var e = this.getPointerNode();
      return this.cachedPointerNode = e, e;
    }
    getChunkPath(e) {
      for (var n = [], r = e; r.type === "chunk"; r = r.parent) {
        var i = r.parent.children.indexOf(r);
        if (i === -1) return null;
        n.unshift(i);
      }
      return n;
    }
    savePointer() {
      if (this.atStart) return "start";
      if (!this.pointerNode) throw new Error("Cannot save pointer when pointerNode is null");
      return {
        chunk: this.pointerChunk,
        node: this.pointerNode
      };
    }
    restorePointer(e) {
      if (e === "start") {
        this.pointerChunk = this.root, this.pointerIndex = -1, this.pointerIndexStack = [], this.reachedEnd = false, this.cachedPointerNode = void 0;
        return;
      }
      var { chunk: n, node: r } = e, i = n.children.indexOf(r);
      if (i === -1) throw new Error("Cannot restore point because saved node is no longer in saved chunk");
      var a = this.getChunkPath(n);
      if (!a) throw new Error("Cannot restore point because saved chunk is no longer connected to root");
      this.pointerChunk = n, this.pointerIndex = i, this.pointerIndexStack = a, this.reachedEnd = false, this.cachedPointerNode = r, this.validateState();
    }
    enterChunk(e) {
      var n;
      if (((n = this.pointerNode) === null || n === void 0 ? void 0 : n.type) !== "chunk") throw new Error("Cannot enter non-chunk");
      if (this.pointerIndexStack.push(this.pointerIndex), this.pointerChunk = this.pointerNode, this.pointerIndex = e ? this.pointerSiblings.length - 1 : 0, this.cachedPointerNode = void 0, this.validateState(), this.pointerChunk.children.length === 0) throw new Error("Cannot enter empty chunk");
    }
    enterChunkUntilLeaf(e) {
      for (; ((n = this.pointerNode) === null || n === void 0 ? void 0 : n.type) === "chunk"; ) {
        var n;
        this.enterChunk(e);
      }
    }
    exitChunk() {
      if (this.pointerChunk.type === "root") throw new Error("Cannot exit root");
      var e = this.pointerChunk;
      this.pointerChunk = e.parent, this.pointerIndex = this.pointerIndexStack.pop(), this.cachedPointerNode = void 0, this.validateState();
    }
    rawInsertAfter(e, n) {
      if (e.length !== 0) {
        for (var r = (u, h, f) => {
          if (f === 1) return u;
          for (var g = [], m = 0; m < this.chunkSize; m++) {
            var v = u.slice(m * f, (m + 1) * f);
            if (v.length === 0) break;
            var y = {
              type: "chunk",
              key: new Mse(),
              parent: h,
              children: []
            };
            y.children = r(v, y, f / this.chunkSize), g.push(y);
          }
          return g;
        }, i = this.pointerSiblings.length + e.length, a = 0, s = this.chunkSize; s < i; s *= this.chunkSize) a++;
        var l = Math.max(a, n), c = Math.pow(this.chunkSize, l), d = r(e, this.pointerChunk, c);
        this.pointerSiblings.splice(this.pointerIndex + 1, 0, ...d), this.pointerIndex += d.length, this.cachedPointerNode = void 0, this.invalidateChunk(), this.validateState();
      }
    }
    validateState() {
      if (this.debug) {
        var e = (r) => {
          if (r.type === "chunk") {
            var { parent: i, children: a } = r;
            if (!i.children.includes(r)) throw new Error("Debug: Chunk ".concat(r.key.id, " has an incorrect parent property"));
            a.forEach(e);
          }
        };
        if (this.root.children.forEach(e), this.cachedPointerNode !== void 0 && this.cachedPointerNode !== this.getPointerNode()) throw new Error("Debug: The cached pointer is incorrect and has not been invalidated");
        var n = this.getChunkPath(this.pointerChunk);
        if (!n) throw new Error("Debug: The pointer chunk is not connected to the root");
        if (!Me.equals(this.pointerIndexStack, n)) throw new Error("Debug: The cached index stack [".concat(this.pointerIndexStack.join(", "), "] does not match the path of the pointer chunk [").concat(n.join(", "), "]"));
      }
    }
  }
  class oPe {
    constructor(e, n) {
      Bi(this, "editor", void 0), Bi(this, "children", void 0), Bi(this, "cachedKeys", void 0), Bi(this, "pointerIndex", void 0), this.editor = e, this.children = n, this.cachedKeys = new Array(n.length), this.pointerIndex = 0;
    }
    read(e) {
      if (e === 1) return [
        this.children[this.pointerIndex++]
      ];
      var n = this.remaining(e);
      return this.pointerIndex += e, n;
    }
    remaining(e) {
      return e === void 0 ? this.children.slice(this.pointerIndex) : this.children.slice(this.pointerIndex, this.pointerIndex + e);
    }
    get reachedEnd() {
      return this.pointerIndex >= this.children.length;
    }
    lookAhead(e, n) {
      var r = this.children.indexOf(e, this.pointerIndex);
      if (r > -1) return r - this.pointerIndex;
      for (var i = this.pointerIndex; i < this.children.length; i++) {
        var a = this.children[i], s = this.findKey(a, i);
        if (s === n) return i - this.pointerIndex;
      }
      return -1;
    }
    toChunkLeaves(e, n) {
      return e.map((r, i) => ({
        type: "leaf",
        node: r,
        key: this.findKey(r, n + i),
        index: n + i
      }));
    }
    findKey(e, n) {
      var r = this.cachedKeys[n];
      if (r) return r;
      var i = Bt.findKey(this.editor, e);
      return this.cachedKeys[n] = i, i;
    }
  }
  var aPe = (t, e) => {
    for (var { chunkTree: n, children: r, chunkSize: i, rerenderChildren: a = [], onInsert: s, onUpdate: l, onIndexChange: c, debug: d } = e, u = new iPe(n, {
      chunkSize: i,
      debug: d
    }), h = new oPe(t, r), f, g = function() {
      var w = h.lookAhead(f.node, f.key), b = w > 0 && n.movedNodeKeys.has(f.key);
      if (w === -1 || b) return u.remove(), 1;
      var j = h.pointerIndex, k = h.read(w + 1), C = k.pop();
      if (k.length) {
        var x = h.toChunkLeaves(k, j);
        u.insertBefore(x), k.forEach((T, A) => {
          s == null ? void 0 : s(T, j + A);
        });
      }
      var S = h.pointerIndex - 1;
      f.node !== C && (f.node = C, u.invalidateChunk(), l == null ? void 0 : l(C, S)), f.index !== S && (f.index = S, c == null ? void 0 : c(C, S)), a.includes(S) && u.invalidateChunk();
    }; f = u.readLeaf(); ) g();
    if (!h.reachedEnd) {
      var m = h.remaining(), v = h.toChunkLeaves(m, h.pointerIndex);
      u.returnToPreviousLeaf(), u.insertAfter(v), m.forEach((y, w) => {
        s == null ? void 0 : s(y, h.pointerIndex + w);
      });
    }
    n.movedNodeKeys.clear();
  };
  function BG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function sPe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? BG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : BG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var PG = /* @__PURE__ */ new WeakMap(), nle = function(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = Bt.findKey(e, n), a = PG.get(i);
    return a || (a = {
      type: "root",
      movedNodeKeys: /* @__PURE__ */ new Set(),
      modifiedChunks: /* @__PURE__ */ new Set(),
      children: []
    }, PG.set(i, a)), r.reconcile && aPe(e, sPe({
      chunkTree: a,
      children: n.children
    }, r.reconcile)), a;
  };
  function MG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function lPe(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? MG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : MG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var cPe = (t) => {
    var { children: e } = t;
    return e;
  }, rle = (t) => {
    var { root: e, ancestor: n, renderElement: r, renderChunk: i = cPe } = t;
    return n.children.map((a) => {
      if (a.type === "chunk") {
        var s = a.key.id, l = i({
          highest: n === e,
          lowest: a.children.some((d) => d.type === "leaf"),
          attributes: {
            "data-slate-chunk": true
          },
          children: yn.createElement(uPe, {
            root: e,
            ancestor: a,
            renderElement: r,
            renderChunk: i
          })
        });
        return yn.createElement(p.Fragment, {
          key: s
        }, l);
      }
      var c = a.node;
      return r(c, a.index, a.key);
    });
  }, dPe = (t) => (p.useEffect(() => {
    t.root.modifiedChunks.clear();
  }), yn.createElement(rle, lPe({}, t))), uPe = yn.memo(rle, (t, e) => t.root === e.root && t.renderElement === e.renderElement && t.renderChunk === e.renderChunk && !e.root.modifiedChunks.has(e.ancestor)), ile = p.createContext(null), hPe = () => p.useContext(ile), ole = (t) => {
    var { decorations: e, node: n, renderElement: r, renderChunk: i, renderPlaceholder: a, renderText: s, renderLeaf: l } = t, c = nd();
    b1.set(c, false);
    var d = Le.isElement(n) && !c.isInline(n), u = d && fe.hasInlines(c, n), h = u ? null : c.getChunkSize(n), f = !!h, { decorationsByChild: g, childrenToRedecorate: m } = fPe(c, n, e);
    f || n.children.forEach((b, j) => {
      q0.set(b, j), i2.set(b, n);
    });
    var v = p.useCallback((b, j, k) => {
      var C = k ?? Bt.findKey(c, b);
      return yn.createElement(ile.Provider, {
        key: "provider-".concat(C.id),
        value: b
      }, yn.createElement(nPe, {
        decorations: g[j],
        element: b,
        key: C.id,
        renderElement: r,
        renderChunk: i,
        renderPlaceholder: a,
        renderLeaf: l,
        renderText: s
      }));
    }, [
      c,
      g,
      r,
      i,
      a,
      l,
      s
    ]), y = (b, j) => {
      var k = Bt.findKey(c, b);
      return yn.createElement(tle, {
        decorations: g[j],
        key: k.id,
        isLast: j === n.children.length - 1,
        parent: n,
        renderPlaceholder: a,
        renderLeaf: l,
        renderText: s,
        text: b
      });
    };
    if (!f) return n.children.map((b, j) => Le.isText(b) ? y(b, j) : v(b, j));
    var w = nle(c, n, {
      reconcile: {
        chunkSize: h,
        rerenderChildren: m,
        onInsert: (b, j) => {
          q0.set(b, j), i2.set(b, n);
        },
        onUpdate: (b, j) => {
          q0.set(b, j), i2.set(b, n);
        },
        onIndexChange: (b, j) => {
          q0.set(b, j);
        }
      }
    });
    return yn.createElement(dPe, {
      root: w,
      ancestor: w,
      renderElement: v,
      renderChunk: i
    });
  }, fPe = (t, e, n) => {
    var r = iBe(t, e, n), i = p.useRef(r).current, a = [];
    i.length = r.length;
    for (var s = 0; s < r.length; s++) {
      var l, c = r[s], d = (l = i[s]) !== null && l !== void 0 ? l : null;
      rM(d, c) || (i[s] = c, a.push(s));
    }
    return {
      decorationsByChild: i,
      childrenToRedecorate: a
    };
  }, ale = p.createContext(false), mPe = () => p.useContext(ale), tS = p.createContext({}), gPe = (t, e) => t === e;
  function pPe(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : gPe, { deferred: n } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = p.useContext(tS);
    if (!r) throw new Error("The `useSlateSelector` hook must be used inside the <Slate> component's context.");
    var { addEventListener: i } = r, a = nd(), s = p.useCallback(() => t(a), [
      a,
      t
    ]), [l, c] = Jse(s, e);
    return $d(() => {
      var d = i(c, {
        deferred: n
      });
      return c(), d;
    }, [
      i,
      c,
      n
    ]), l;
  }
  function FPe() {
    var t = p.useRef(/* @__PURE__ */ new Set()), e = p.useRef(/* @__PURE__ */ new Set()), n = p.useCallback(() => {
      t.current.forEach((s) => s());
    }, []), r = p.useCallback(() => {
      e.current.forEach((s) => s()), e.current.clear();
    }, []), i = p.useCallback(function(s) {
      var { deferred: l = false } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = l ? () => e.current.add(s) : s;
      return t.current.add(c), () => {
        t.current.delete(c);
      };
    }, []), a = p.useMemo(() => ({
      addEventListener: i,
      flushDeferred: r
    }), [
      i,
      r
    ]);
    return {
      selectorContext: a,
      onChange: n
    };
  }
  function vPe() {
    var { flushDeferred: t } = p.useContext(tS);
    $d(t);
  }
  var m3 = () => {
    var { addEventListener: t } = p.useContext(tS), [, e] = p.useReducer((n) => n + 1, 0);
    if (!t) throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");
    return $d(() => t(e), [
      t
    ]), nd();
  };
  function _Pe() {
    var t = nd(), e = p.useRef(false), n = p.useRef(0), r = p.useCallback(() => {
      if (!e.current) {
        e.current = true;
        var i = Bt.getWindow(t);
        i.cancelAnimationFrame(n.current), n.current = i.requestAnimationFrame(() => {
          e.current = false;
        });
      }
    }, [
      t
    ]);
    return p.useEffect(() => () => cancelAnimationFrame(n.current), []), {
      receivedUserInput: e,
      onUserInput: r
    };
  }
  var yPe = (t, e) => {
    var n = [], r = () => {
      n = [];
    }, i = (s) => {
      if (e.current) {
        var l = s.filter((c) => QP(t, c, s));
        n.push(...l);
      }
    };
    function a() {
      n.length > 0 && (n.reverse().forEach((s) => {
        s.type !== "characterData" && (s.removedNodes.forEach((l) => {
          s.target.insertBefore(l, s.nextSibling);
        }), s.addedNodes.forEach((l) => {
          s.target.removeChild(l);
        }));
      }), r());
    }
    return {
      registerMutations: i,
      restoreDOM: a,
      clear: r
    };
  }, bPe = {
    subtree: true,
    childList: true,
    characterData: true,
    characterDataOldValue: true
  };
  class sle extends p.Component {
    constructor() {
      super(...arguments), Bi(this, "context", null), Bi(this, "manager", null), Bi(this, "mutationObserver", null);
    }
    observe() {
      var e, { node: n } = this.props;
      if (!n.current) throw new Error("Failed to attach MutationObserver, `node` is undefined");
      (e = this.mutationObserver) === null || e === void 0 || e.observe(n.current, bPe);
    }
    componentDidMount() {
      var { receivedUserInput: e } = this.props, n = this.context;
      this.manager = yPe(n, e), this.mutationObserver = new MutationObserver(this.manager.registerMutations), this.observe();
    }
    getSnapshotBeforeUpdate() {
      var e, n, r, i = (e = this.mutationObserver) === null || e === void 0 ? void 0 : e.takeRecords();
      if (i != null && i.length) {
        var a;
        (a = this.manager) === null || a === void 0 || a.registerMutations(i);
      }
      return (n = this.mutationObserver) === null || n === void 0 || n.disconnect(), (r = this.manager) === null || r === void 0 || r.restoreDOM(), null;
    }
    componentDidUpdate() {
      var e;
      (e = this.manager) === null || e === void 0 || e.clear(), this.observe();
    }
    componentWillUnmount() {
      var e;
      (e = this.mutationObserver) === null || e === void 0 || e.disconnect();
    }
    render() {
      return this.props.children;
    }
  }
  Bi(sle, "contextType", oM);
  var xPe = $a ? sle : (t) => {
    var { children: e } = t;
    return yn.createElement(yn.Fragment, null, e);
  }, wPe = p.createContext(false), DPe = [
    "autoFocus",
    "decorate",
    "onDOMBeforeInput",
    "placeholder",
    "readOnly",
    "renderElement",
    "renderChunk",
    "renderLeaf",
    "renderText",
    "renderPlaceholder",
    "scrollSelectionIntoView",
    "style",
    "as",
    "disableDefaultStyles"
  ], CPe = [
    "text"
  ];
  function OG(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function vd(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? OG(Object(n), true).forEach(function(r) {
        Bi(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : OG(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var EPe = (t) => yn.createElement(yn.Fragment, null, ole(t)), kPe = p.forwardRef((t, e) => {
    var n = p.useCallback((K) => yn.createElement(SPe, vd({}, K)), []), { autoFocus: r, decorate: i = jPe, onDOMBeforeInput: a, placeholder: s, readOnly: l = false, renderElement: c, renderChunk: d, renderLeaf: u, renderText: h, renderPlaceholder: f = n, scrollSelectionIntoView: g = TPe, style: m = {}, as: v = "div", disableDefaultStyles: y = false } = t, w = fE(t, DPe), b = m3(), [j, k] = p.useState(false), C = p.useRef(null), x = p.useRef([]), [S, T] = p.useState(), A = p.useRef(false), { onUserInput: B, receivedUserInput: U } = _Pe(), [, z] = p.useReducer((K) => K + 1, 0);
    Lse.set(b, z), pI.set(b, l);
    var O = p.useMemo(() => ({
      isDraggingInternally: false,
      isUpdatingSelection: false,
      latestElement: null,
      hasMarkPlaceholder: false
    }), []);
    p.useEffect(() => {
      C.current && r && C.current.focus();
    }, [
      r
    ]);
    var M = p.useRef(), I = p.useMemo(() => eIe(() => {
      if (b1.get(b)) {
        I();
        return;
      }
      var K = Bt.toDOMNode(b, b), G = K.getRootNode();
      if (!A.current && Xm && G instanceof ShadowRoot) {
        A.current = true;
        var le = R7e();
        le ? document.execCommand("indent") : xt.deselect(b), A.current = false;
        return;
      }
      var te = M.current;
      if (($a || !Bt.isComposing(b)) && (!O.isUpdatingSelection || te != null && te.isFlushing()) && !O.isDraggingInternally) {
        var re = Bt.findDocumentOrShadowRoot(b), { activeElement: he } = re, se = Bt.toDOMNode(b, b), ye = r2(re);
        if (he === se ? (O.latestElement = he, xf.set(b, true)) : xf.delete(b), !ye) return xt.deselect(b);
        var { anchorNode: we, focusNode: Ee } = ye, ke = Bt.hasEditableTarget(b, we) || Bt.isTargetInsideNonReadonlyVoid(b, we), Ne = Bt.hasTarget(b, Ee);
        if (ke && Ne) {
          var lt = Bt.toSlateRange(b, ye, {
            exactMatch: false,
            suppressThrow: true
          });
          lt && (!Bt.isComposing(b) && !(te != null && te.hasPendingChanges()) && !(te != null && te.isFlushing()) ? xt.select(b, lt) : te == null ? void 0 : te.handleUserSelect(lt));
        }
        l && (!ke || !Ne) && xt.deselect(b);
      }
    }, 100), [
      b,
      l,
      O
    ]), N = p.useMemo(() => JAe(I, 0), [
      I
    ]);
    M.current = NBe({
      node: C,
      onDOMSelectionChange: I,
      scheduleOnDOMSelectionChange: N
    }), $d(() => {
      var K, G, le;
      C.current && (le = XP(C.current)) ? (Ose.set(b, le), o2.set(b, C.current), Tg.set(b, C.current), hb.set(C.current, b)) : Tg.delete(b);
      var { selection: te } = b, re = Bt.findDocumentOrShadowRoot(b), he = r2(re);
      if (!(!he || !Bt.isFocused(b) || (K = M.current) !== null && K !== void 0 && K.hasPendingAction())) {
        var se = (ke) => {
          var Ne = he.type !== "None";
          if (!(!te && !Ne)) {
            var lt = he.focusNode, Rt;
            if (W0 && he.rangeCount > 1) {
              var We = he.getRangeAt(0), yt = he.getRangeAt(he.rangeCount - 1);
              We.startContainer === lt ? Rt = yt.endContainer : Rt = We.startContainer;
            } else Rt = he.anchorNode;
            var Xt = o2.get(b), nn = false;
            if (jg(Xt, Rt) && jg(Xt, lt) && (nn = true), Ne && nn && te && !ke) {
              var bt = Bt.toSlateRange(b, he, {
                exactMatch: true,
                suppressThrow: true
              });
              if (bt && _t.equals(bt, te)) {
                var At;
                if (!O.hasMarkPlaceholder || (At = Rt) !== null && At !== void 0 && (At = At.parentElement) !== null && At !== void 0 && At.hasAttribute("data-slate-mark-placeholder")) return;
              }
            }
            if (te && !Bt.hasRange(b, te)) {
              b.selection = Bt.toSlateRange(b, he, {
                exactMatch: false,
                suppressThrow: true
              });
              return;
            }
            O.isUpdatingSelection = true;
            var $t = null;
            try {
              $t = te && Bt.toDOMRange(b, te);
            } catch {
            }
            return $t ? (Bt.isComposing(b) && !$a ? he.collapseToEnd() : _t.isBackward(te) ? he.setBaseAndExtent($t.endContainer, $t.endOffset, $t.startContainer, $t.startOffset) : he.setBaseAndExtent($t.startContainer, $t.startOffset, $t.endContainer, $t.endOffset), g(b, $t)) : he.removeAllRanges(), $t;
          }
        };
        he.rangeCount <= 1 && se();
        var ye = ((G = M.current) === null || G === void 0 ? void 0 : G.isFlushing()) === "action";
        if (!$a || !ye) {
          setTimeout(() => {
            O.isUpdatingSelection = false;
          });
          return;
        }
        var we = null, Ee = requestAnimationFrame(() => {
          if (ye) {
            var ke = (Ne) => {
              try {
                var lt = Bt.toDOMNode(b, b);
                lt.focus(), se(Ne);
              } catch {
              }
            };
            ke(), we = setTimeout(() => {
              ke(true), O.isUpdatingSelection = false;
            });
          }
        });
        return () => {
          cancelAnimationFrame(Ee), we && clearTimeout(we);
        };
      }
    });
    var L = p.useCallback((K) => {
      LG(b, K);
      var G = Bt.toDOMNode(b, b), le = G.getRootNode();
      if (A != null && A.current && Xm && le instanceof ShadowRoot) {
        var te = K.getTargetRanges(), re = te[0], he = new window.Range();
        he.setStart(re.startContainer, re.startOffset), he.setEnd(re.endContainer, re.endOffset);
        var se = Bt.toSlateRange(b, he, {
          exactMatch: false,
          suppressThrow: false
        });
        xt.select(b, se), K.preventDefault(), K.stopImmediatePropagation();
        return;
      }
      if (B(), !l && Bt.hasEditableTarget(b, K.target) && !RPe(K, a)) {
        var ye;
        if (M.current) return M.current.handleDOMBeforeInput(K);
        N.flush(), I.flush();
        var { selection: we } = b, { inputType: Ee } = K, ke = K.dataTransfer || K.data || void 0, Ne = Ee === "insertCompositionText" || Ee === "deleteCompositionText";
        if (Ne && Bt.isComposing(b)) return;
        var lt = false;
        if (Ee === "insertText" && we && _t.isCollapsed(we) && K.data && K.data.length === 1 && /[a-z ]/i.test(K.data) && we.anchor.offset !== 0 && (lt = true, b.marks && (lt = false), !b1.get(b))) {
          var Rt, We, { anchor: yt } = we, [Xt, nn] = Bt.toDOMPoint(b, yt), bt = (Rt = Xt.parentElement) === null || Rt === void 0 ? void 0 : Rt.closest("a"), At = Bt.getWindow(b);
          if (lt && bt && Bt.hasDOMNode(b, bt)) {
            var $t, Lt = At == null ? void 0 : At.document.createTreeWalker(bt, NodeFilter.SHOW_TEXT).lastChild();
            Lt === Xt && (($t = Lt.textContent) === null || $t === void 0 ? void 0 : $t.length) === nn && (lt = false);
          }
          if (lt && Xt.parentElement && (At == null || (We = At.getComputedStyle(Xt.parentElement)) === null || We === void 0 ? void 0 : We.whiteSpace) === "pre") {
            var wt = fe.above(b, {
              at: yt.path,
              match: (tt) => Le.isElement(tt) && fe.isBlock(b, tt)
            });
            wt && Le.string(wt[0]).includes("	") && (lt = false);
          }
        }
        if ((!Ee.startsWith("delete") || Ee.startsWith("deleteBy")) && !b1.get(b)) {
          var [st] = K.getTargetRanges();
          if (st) {
            var Be = Bt.toSlateRange(b, st, {
              exactMatch: false,
              suppressThrow: false
            });
            if (!we || !_t.equals(we, Be)) {
              lt = false;
              var Re = !Ne && b.selection && fe.rangeRef(b, b.selection);
              xt.select(b, Be), Re && a2.set(b, Re);
            }
          }
        }
        if (Ne) return;
        if (lt || K.preventDefault(), we && _t.isExpanded(we) && Ee.startsWith("delete")) {
          var Ue = Ee.endsWith("Backward") ? "backward" : "forward";
          fe.deleteFragment(b, {
            direction: Ue
          });
          return;
        }
        switch (Ee) {
          case "deleteByComposition":
          case "deleteByCut":
          case "deleteByDrag": {
            fe.deleteFragment(b);
            break;
          }
          case "deleteContent":
          case "deleteContentForward": {
            fe.deleteForward(b);
            break;
          }
          case "deleteContentBackward": {
            fe.deleteBackward(b);
            break;
          }
          case "deleteEntireSoftLine": {
            fe.deleteBackward(b, {
              unit: "line"
            }), fe.deleteForward(b, {
              unit: "line"
            });
            break;
          }
          case "deleteHardLineBackward": {
            fe.deleteBackward(b, {
              unit: "block"
            });
            break;
          }
          case "deleteSoftLineBackward": {
            fe.deleteBackward(b, {
              unit: "line"
            });
            break;
          }
          case "deleteHardLineForward": {
            fe.deleteForward(b, {
              unit: "block"
            });
            break;
          }
          case "deleteSoftLineForward": {
            fe.deleteForward(b, {
              unit: "line"
            });
            break;
          }
          case "deleteWordBackward": {
            fe.deleteBackward(b, {
              unit: "word"
            });
            break;
          }
          case "deleteWordForward": {
            fe.deleteForward(b, {
              unit: "word"
            });
            break;
          }
          case "insertLineBreak":
            fe.insertSoftBreak(b);
            break;
          case "insertParagraph": {
            fe.insertBreak(b);
            break;
          }
          case "insertFromComposition":
          case "insertFromDrop":
          case "insertFromPaste":
          case "insertFromYank":
          case "insertReplacementText":
          case "insertText": {
            Ee === "insertFromComposition" && Bt.isComposing(b) && (k(false), mg.set(b, false)), (ke == null ? void 0 : ke.constructor.name) === "DataTransfer" ? Bt.insertData(b, ke) : typeof ke == "string" && (lt ? x.current.push(() => fe.insertText(b, ke)) : fe.insertText(b, ke));
            break;
          }
        }
        var qe = (ye = a2.get(b)) === null || ye === void 0 ? void 0 : ye.unref();
        a2.delete(b), qe && (!b.selection || !_t.equals(b.selection, qe)) && xt.select(b, qe);
      }
    }, [
      b,
      I,
      B,
      a,
      l,
      N
    ]), H = p.useCallback((K) => {
      K == null ? (I.cancel(), N.cancel(), o2.delete(b), Tg.delete(b), C.current && Gh && C.current.removeEventListener("beforeinput", L)) : Gh && K.addEventListener("beforeinput", L), C.current = K, typeof e == "function" ? e(K) : e && (e.current = K);
    }, [
      I,
      N,
      b,
      L,
      e
    ]);
    $d(() => {
      var K = Bt.getWindow(b), G = (te) => {
        var { target: re } = te, he = re instanceof HTMLElement ? re : null, se = he == null ? void 0 : he.tagName;
        se === "INPUT" || se === "TEXTAREA" || N();
      };
      K.document.addEventListener("selectionchange", G);
      var le = () => {
        O.isDraggingInternally = false;
      };
      return K.document.addEventListener("dragend", le), K.document.addEventListener("drop", le), () => {
        K.document.removeEventListener("selectionchange", G), K.document.removeEventListener("dragend", le), K.document.removeEventListener("drop", le);
      };
    }, [
      N,
      O
    ]);
    var V = i([
      b,
      []
    ]), Z = ZBe(i), Y = s && b.children.length === 1 && Array.from(Le.texts(b)).length === 1 && Le.string(b) === "" && !j, oe = p.useCallback((K) => {
      if (K && Y) {
        var G;
        T((G = K.getBoundingClientRect()) === null || G === void 0 ? void 0 : G.height);
      } else T(void 0);
    }, [
      Y
    ]);
    if (Y) {
      var ue = fe.start(b, []);
      V.push({
        [hF]: true,
        placeholder: s,
        onPlaceholderResize: oe,
        anchor: ue,
        focus: ue
      });
    }
    var { marks: ie } = b;
    if (O.hasMarkPlaceholder = false, b.selection && _t.isCollapsed(b.selection) && ie) {
      var { anchor: de } = b.selection, ne = Le.leaf(b, de.path), ae = fE(ne, CPe);
      if (!Zo.equals(ne, ie, {
        loose: true
      })) {
        O.hasMarkPlaceholder = true;
        var X = Object.fromEntries(Object.keys(ae).map((K) => [
          K,
          null
        ]));
        V.push(vd(vd(vd({
          [Nse]: true
        }, X), ie), {}, {
          anchor: de,
          focus: de
        }));
      }
    }
    return p.useEffect(() => {
      setTimeout(() => {
        var { selection: K } = b;
        if (K) {
          var { anchor: G } = K, le = Le.leaf(b, G.path);
          if (ie && !Zo.equals(le, ie, {
            loose: true
          })) {
            Tc.set(b, ie);
            return;
          }
        }
        Tc.delete(b);
      });
    }), vPe(), yn.createElement(ale.Provider, {
      value: l
    }, yn.createElement(wPe.Provider, {
      value: j
    }, yn.createElement(Xse.Provider, {
      value: Z
    }, yn.createElement(xPe, {
      node: C,
      receivedUserInput: U
    }, yn.createElement(v, vd(vd({
      role: l ? void 0 : "textbox",
      "aria-multiline": l ? void 0 : true,
      translate: "no"
    }, w), {}, {
      spellCheck: Gh || !YD ? w.spellCheck : false,
      autoCorrect: Gh || !YD ? w.autoCorrect : "false",
      autoCapitalize: Gh || !YD ? w.autoCapitalize : "false",
      "data-slate-editor": true,
      "data-slate-node": "value",
      contentEditable: !l,
      zindex: -1,
      suppressContentEditableWarning: true,
      ref: H,
      style: vd(vd({}, y ? {} : vd({
        position: "relative",
        whiteSpace: "pre-wrap",
        wordWrap: "break-word"
      }, S ? {
        minHeight: S
      } : {})), m),
      onBeforeInput: p.useCallback((K) => {
        if (!Gh && !l && !ts(K, w.onBeforeInput) && Bt.hasSelectableTarget(b, K.target) && (K.preventDefault(), !Bt.isComposing(b))) {
          var G = K.data;
          fe.insertText(b, G);
        }
      }, [
        w.onBeforeInput,
        b,
        l
      ]),
      onInput: p.useCallback((K) => {
        if (!ts(K, w.onInput)) {
          if (M.current) {
            M.current.handleInput();
            return;
          }
          for (var G of x.current) G();
          x.current = [], Bt.isFocused(b) || LG(b, K.nativeEvent);
        }
      }, [
        w.onInput,
        b
      ]),
      onBlur: p.useCallback((K) => {
        if (!(l || O.isUpdatingSelection || !Bt.hasSelectableTarget(b, K.target) || ts(K, w.onBlur))) {
          var G = Bt.findDocumentOrShadowRoot(b);
          if (O.latestElement !== G.activeElement) {
            var { relatedTarget: le } = K, te = Bt.toDOMNode(b, b);
            if (le !== te && !(Nl(le) && le.hasAttribute("data-slate-spacer"))) {
              if (le != null && Nf(le) && Bt.hasDOMNode(b, le)) {
                var re = Bt.toSlateNode(b, le);
                if (Le.isElement(re) && !b.isVoid(re)) return;
              }
              if (Xm) {
                var he = r2(G);
                he == null ? void 0 : he.removeAllRanges();
              }
              xf.delete(b);
            }
          }
        }
      }, [
        l,
        O.isUpdatingSelection,
        O.latestElement,
        b,
        w.onBlur
      ]),
      onClick: p.useCallback((K) => {
        if (Bt.hasTarget(b, K.target) && !ts(K, w.onClick) && Nf(K.target)) {
          var G = Bt.toSlateNode(b, K.target), le = Bt.findPath(b, G);
          if (!fe.hasPath(b, le) || Le.get(b, le) !== G) return;
          if (K.detail === Z7e && le.length >= 1) {
            var te = le;
            if (!(Le.isElement(G) && fe.isBlock(b, G))) {
              var re, he = fe.above(b, {
                match: (lt) => Le.isElement(lt) && fe.isBlock(b, lt),
                at: le
              });
              te = (re = he == null ? void 0 : he[1]) !== null && re !== void 0 ? re : le.slice(0, 1);
            }
            var se = fe.range(b, te);
            xt.select(b, se);
            return;
          }
          if (l) return;
          var ye = fe.start(b, le), we = fe.end(b, le), Ee = fe.void(b, {
            at: ye
          }), ke = fe.void(b, {
            at: we
          });
          if (Ee && ke && Me.equals(Ee[1], ke[1])) {
            var Ne = fe.range(b, ye);
            xt.select(b, Ne);
          }
        }
      }, [
        b,
        w.onClick,
        l
      ]),
      onCompositionEnd: p.useCallback((K) => {
        if (!W_(K) && Bt.hasSelectableTarget(b, K.target)) {
          var G;
          if (Bt.isComposing(b) && Promise.resolve().then(() => {
            k(false), mg.set(b, false);
          }), (G = M.current) === null || G === void 0 || G.handleCompositionEnd(K), ts(K, w.onCompositionEnd) || $a) return;
          if (!Xm && !M7e && !I7e && !L7e && !O7e && K.data) {
            var le = Tc.get(b);
            Tc.delete(b), le !== void 0 && (Mu.set(b, b.marks), b.marks = le), fe.insertText(b, K.data);
            var te = Mu.get(b);
            Mu.delete(b), te !== void 0 && (b.marks = te);
          }
        }
      }, [
        w.onCompositionEnd,
        b
      ]),
      onCompositionUpdate: p.useCallback((K) => {
        Bt.hasSelectableTarget(b, K.target) && !ts(K, w.onCompositionUpdate) && !W_(K) && (Bt.isComposing(b) || (k(true), mg.set(b, true)));
      }, [
        w.onCompositionUpdate,
        b
      ]),
      onCompositionStart: p.useCallback((K) => {
        if (!W_(K) && Bt.hasSelectableTarget(b, K.target)) {
          var G;
          if ((G = M.current) === null || G === void 0 || G.handleCompositionStart(K), ts(K, w.onCompositionStart) || $a) return;
          k(true);
          var { selection: le } = b;
          if (le && _t.isExpanded(le)) {
            fe.deleteFragment(b);
            return;
          }
        }
      }, [
        w.onCompositionStart,
        b
      ]),
      onCopy: p.useCallback((K) => {
        Bt.hasSelectableTarget(b, K.target) && !ts(K, w.onCopy) && !W_(K) && (K.preventDefault(), Bt.setFragmentData(b, K.clipboardData, "copy"));
      }, [
        w.onCopy,
        b
      ]),
      onCut: p.useCallback((K) => {
        if (!l && Bt.hasSelectableTarget(b, K.target) && !ts(K, w.onCut) && !W_(K)) {
          K.preventDefault(), Bt.setFragmentData(b, K.clipboardData, "cut");
          var { selection: G } = b;
          if (G) if (_t.isExpanded(G)) fe.deleteFragment(b);
          else {
            var le = Le.parent(b, G.anchor.path);
            fe.isVoid(b, le) && xt.delete(b);
          }
        }
      }, [
        l,
        b,
        w.onCut
      ]),
      onDragOver: p.useCallback((K) => {
        if (Bt.hasTarget(b, K.target) && !ts(K, w.onDragOver)) {
          var G = Bt.toSlateNode(b, K.target);
          Le.isElement(G) && fe.isVoid(b, G) && K.preventDefault();
        }
      }, [
        w.onDragOver,
        b
      ]),
      onDragStart: p.useCallback((K) => {
        if (!l && Bt.hasTarget(b, K.target) && !ts(K, w.onDragStart)) {
          var G = Bt.toSlateNode(b, K.target), le = Bt.findPath(b, G), te = Le.isElement(G) && fe.isVoid(b, G) || fe.void(b, {
            at: le,
            voids: true
          });
          if (te) {
            var re = fe.range(b, le);
            xt.select(b, re);
          }
          O.isDraggingInternally = true, Bt.setFragmentData(b, K.dataTransfer, "drag");
        }
      }, [
        l,
        b,
        w.onDragStart,
        O
      ]),
      onDrop: p.useCallback((K) => {
        if (!l && Bt.hasTarget(b, K.target) && !ts(K, w.onDrop)) {
          K.preventDefault();
          var G = b.selection, le = Bt.findEventRange(b, K), te = K.dataTransfer;
          xt.select(b, le), O.isDraggingInternally && G && !_t.equals(G, le) && !fe.void(b, {
            at: le,
            voids: true
          }) && xt.delete(b, {
            at: G
          }), Bt.insertData(b, te), Bt.isFocused(b) || Bt.focus(b);
        }
      }, [
        l,
        b,
        w.onDrop,
        O
      ]),
      onDragEnd: p.useCallback((K) => {
        !l && O.isDraggingInternally && w.onDragEnd && Bt.hasTarget(b, K.target) && w.onDragEnd(K);
      }, [
        l,
        O,
        w,
        b
      ]),
      onFocus: p.useCallback((K) => {
        if (!l && !O.isUpdatingSelection && Bt.hasEditableTarget(b, K.target) && !ts(K, w.onFocus)) {
          var G = Bt.toDOMNode(b, b), le = Bt.findDocumentOrShadowRoot(b);
          if (O.latestElement = le.activeElement, W0 && K.target !== G) {
            G.focus();
            return;
          }
          xf.set(b, true);
        }
      }, [
        l,
        O,
        b,
        w.onFocus
      ]),
      onKeyDown: p.useCallback((K) => {
        if (!l && Bt.hasEditableTarget(b, K.target)) {
          var G;
          (G = M.current) === null || G === void 0 || G.handleKeyDown(K);
          var { nativeEvent: le } = K;
          if (Bt.isComposing(b) && le.isComposing === false && (mg.set(b, false), k(false)), ts(K, w.onKeyDown) || Bt.isComposing(b)) return;
          var { selection: te } = b, re = b.children[te !== null ? te.focus.path[0] : 0], he = wse(Le.string(re)) === "rtl";
          if (Zi.isRedo(le)) {
            K.preventDefault();
            var se = b;
            typeof se.redo == "function" && se.redo();
            return;
          }
          if (Zi.isUndo(le)) {
            K.preventDefault();
            var ye = b;
            typeof ye.undo == "function" && ye.undo();
            return;
          }
          if (Zi.isMoveLineBackward(le)) {
            K.preventDefault(), xt.move(b, {
              unit: "line",
              reverse: true
            });
            return;
          }
          if (Zi.isMoveLineForward(le)) {
            K.preventDefault(), xt.move(b, {
              unit: "line"
            });
            return;
          }
          if (Zi.isExtendLineBackward(le)) {
            K.preventDefault(), xt.move(b, {
              unit: "line",
              edge: "focus",
              reverse: true
            });
            return;
          }
          if (Zi.isExtendLineForward(le)) {
            K.preventDefault(), xt.move(b, {
              unit: "line",
              edge: "focus"
            });
            return;
          }
          if (Zi.isMoveBackward(le)) {
            K.preventDefault(), te && _t.isCollapsed(te) ? xt.move(b, {
              reverse: !he
            }) : xt.collapse(b, {
              edge: he ? "end" : "start"
            });
            return;
          }
          if (Zi.isMoveForward(le)) {
            K.preventDefault(), te && _t.isCollapsed(te) ? xt.move(b, {
              reverse: he
            }) : xt.collapse(b, {
              edge: he ? "start" : "end"
            });
            return;
          }
          if (Zi.isMoveWordBackward(le)) {
            K.preventDefault(), te && _t.isExpanded(te) && xt.collapse(b, {
              edge: "focus"
            }), xt.move(b, {
              unit: "word",
              reverse: !he
            });
            return;
          }
          if (Zi.isMoveWordForward(le)) {
            K.preventDefault(), te && _t.isExpanded(te) && xt.collapse(b, {
              edge: "focus"
            }), xt.move(b, {
              unit: "word",
              reverse: he
            });
            return;
          }
          if (Gh) {
            if ((eM || Xm) && te && (Zi.isDeleteBackward(le) || Zi.isDeleteForward(le)) && _t.isCollapsed(te)) {
              var we = Le.parent(b, te.anchor.path);
              if (Le.isElement(we) && fe.isVoid(b, we) && (fe.isInline(b, we) || fe.isBlock(b, we))) {
                K.preventDefault(), fe.deleteBackward(b, {
                  unit: "block"
                });
                return;
              }
            }
          } else {
            if (Zi.isBold(le) || Zi.isItalic(le) || Zi.isTransposeCharacter(le)) {
              K.preventDefault();
              return;
            }
            if (Zi.isSoftBreak(le)) {
              K.preventDefault(), fe.insertSoftBreak(b);
              return;
            }
            if (Zi.isSplitBlock(le)) {
              K.preventDefault(), fe.insertBreak(b);
              return;
            }
            if (Zi.isDeleteBackward(le)) {
              K.preventDefault(), te && _t.isExpanded(te) ? fe.deleteFragment(b, {
                direction: "backward"
              }) : fe.deleteBackward(b);
              return;
            }
            if (Zi.isDeleteForward(le)) {
              K.preventDefault(), te && _t.isExpanded(te) ? fe.deleteFragment(b, {
                direction: "forward"
              }) : fe.deleteForward(b);
              return;
            }
            if (Zi.isDeleteLineBackward(le)) {
              K.preventDefault(), te && _t.isExpanded(te) ? fe.deleteFragment(b, {
                direction: "backward"
              }) : fe.deleteBackward(b, {
                unit: "line"
              });
              return;
            }
            if (Zi.isDeleteLineForward(le)) {
              K.preventDefault(), te && _t.isExpanded(te) ? fe.deleteFragment(b, {
                direction: "forward"
              }) : fe.deleteForward(b, {
                unit: "line"
              });
              return;
            }
            if (Zi.isDeleteWordBackward(le)) {
              K.preventDefault(), te && _t.isExpanded(te) ? fe.deleteFragment(b, {
                direction: "backward"
              }) : fe.deleteBackward(b, {
                unit: "word"
              });
              return;
            }
            if (Zi.isDeleteWordForward(le)) {
              K.preventDefault(), te && _t.isExpanded(te) ? fe.deleteFragment(b, {
                direction: "forward"
              }) : fe.deleteForward(b, {
                unit: "word"
              });
              return;
            }
          }
        }
      }, [
        l,
        b,
        w.onKeyDown
      ]),
      onPaste: p.useCallback((K) => {
        !l && Bt.hasEditableTarget(b, K.target) && !ts(K, w.onPaste) && (!Gh || C7e(K.nativeEvent) || Xm) && (K.preventDefault(), Bt.insertData(b, K.clipboardData));
      }, [
        l,
        b,
        w.onPaste
      ])
    }), yn.createElement(EPe, {
      decorations: V,
      node: b,
      renderElement: c,
      renderChunk: d,
      renderPlaceholder: f,
      renderLeaf: u,
      renderText: h
    }))))));
  }), SPe = (t) => {
    var { attributes: e, children: n } = t;
    return yn.createElement("span", vd({}, e), n, $a && yn.createElement("br", null));
  }, jPe = () => [], TPe = (t, e) => {
    var n = !!t.selection && _t.isBackward(t.selection), r = e.cloneRange();
    if (r.collapse(n), r.getBoundingClientRect) {
      var i = r.startContainer.parentElement, a = r.getBoundingClientRect(), s = a.width === 0 && a.height === 0 && a.x === 0 && a.y === 0;
      if (s) {
        var l = i.getBoundingClientRect(), c = l.width > 0 || l.height > 0;
        if (c) return;
      }
      i.getBoundingClientRect = r.getBoundingClientRect.bind(r), rIe(i, {
        scrollMode: "if-needed"
      }), delete i.getBoundingClientRect;
    }
  }, ts = (t, e) => {
    if (!e) return false;
    var n = e(t);
    return n ?? (t.isDefaultPrevented() || t.isPropagationStopped());
  }, W_ = (t) => Nf(t.target) && (t.target instanceof HTMLInputElement || t.target instanceof HTMLTextAreaElement), RPe = (t, e) => {
    if (!e) return false;
    var n = e(t);
    return n ?? t.defaultPrevented;
  }, LG = (t, e) => {
    var n = t;
    if (e.inputType === "historyUndo" && typeof n.undo == "function") {
      n.undo();
      return;
    }
    if (e.inputType === "historyRedo" && typeof n.redo == "function") {
      n.redo();
      return;
    }
  }, lle = p.createContext(false), aM = () => p.useContext(lle), cle = parseInt(yn.version.split(".")[0], 10), APe = [
    "editor",
    "children",
    "onChange",
    "onSelectionChange",
    "onValueChange",
    "initialValue"
  ], IPe = (t) => {
    var { editor: e, children: n, onChange: r, onSelectionChange: i, onValueChange: a, initialValue: s } = t, l = fE(t, APe);
    yn.useState(() => {
      if (!Le.isNodeList(s)) throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(qo.stringify(s)));
      if (!fe.isEditor(e)) throw new Error("[Slate] editor is invalid! You passed: ".concat(qo.stringify(e)));
      e.children = s, Object.assign(e, l);
    });
    var { selectorContext: c, onChange: d } = FPe(), u = p.useCallback(() => {
      r && r(e.children), i && e.operations.find((g) => g.type === "set_selection") && i(e.selection), a && e.operations.find((g) => g.type !== "set_selection") && a(e.children), d();
    }, [
      e,
      d,
      r,
      i,
      a
    ]);
    p.useEffect(() => (FI.set(e, u), () => {
      FI.set(e, () => {
      });
    }), [
      e,
      u
    ]);
    var [h, f] = p.useState(Bt.isFocused(e));
    return p.useEffect(() => {
      f(Bt.isFocused(e));
    }, [
      e
    ]), $d(() => {
      var g = () => f(Bt.isFocused(e));
      return cle >= 17 ? (document.addEventListener("focusin", g), document.addEventListener("focusout", g), () => {
        document.removeEventListener("focusin", g), document.removeEventListener("focusout", g);
      }) : (document.addEventListener("focus", g, true), document.addEventListener("blur", g, true), () => {
        document.removeEventListener("focus", g, true), document.removeEventListener("blur", g, true);
      });
    }, []), yn.createElement(tS.Provider, {
      value: c
    }, yn.createElement(oM.Provider, {
      value: e
    }, yn.createElement(lle.Provider, {
      value: h
    }, n)));
  }, sM = () => {
    var t = hPe();
    if (!t) return false;
    var e = p.useCallback((n) => {
      if (!n.selection) return false;
      var r = Bt.findPath(n, t), i = fe.range(n, r);
      return !!_t.intersection(i, n.selection);
    }, [
      t
    ]);
    return pPe(e, void 0, {
      deferred: true
    });
  }, BPe = function(e) {
    var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "x-slate-fragment", r = e;
    r = Y7e(r, n);
    var { onChange: i, apply: a, insertText: s } = r;
    return r.getChunkSize = () => null, $a && (r.insertText = (l, c) => (Eu.delete(r), s(l, c))), r.onChange = (l) => {
      var c = cle < 18 ? aee.unstable_batchedUpdates : (d) => d();
      c(() => {
        i(l);
      });
    }, r.apply = (l) => {
      if (l.type === "move_node") {
        var c = Le.parent(r, l.path), d = !!r.getChunkSize(c);
        if (d) {
          var u = Le.get(r, l.path), h = nle(r, c), f = Bt.findKey(r, u);
          h.movedNodeKeys.add(f);
        }
      }
      a(l);
    }, r;
  }, PPe = "AutocompleteMenu_AutocompleteMenuBase__1mohgn80 _1mqalmd1 _1mqalmd0", MPe = "AutocompleteMenu_AutocompleteMenuContainer__1mohgn81 _1mqalmd1 _1mqalmd0", dle = "AutocompleteMenu_AutocompleteMenu__1mohgn82 _1mqalmd1 _1mqalmd0", OPe = "AutocompleteMenu_AutocompleteMenuHeader__1mohgn83 _1mqalmd1 _1mqalmd0", LPe = "AutocompleteMenu_AutocompleteNotice__1mohgn84 AutocompleteMenu_AutocompleteMenuHeader__1mohgn83 _1mqalmd1 _1mqalmd0";
  function ule({ children: t }) {
    return o.jsx("div", {
      className: PPe,
      children: o.jsx("div", {
        className: MPe,
        "data-autocomplete-menu": "true",
        children: t
      })
    });
  }
  function nS({ headerContent: t, requestClose: e, children: n, editor: r }) {
    const i = Kr(), a = p.useRef(null), s = () => {
      i() && e();
    }, [l, c] = p.useState(true);
    p.useEffect(() => Bt.focus(r), [
      r,
      l
    ]);
    function d(u) {
      u && (Yt.isKeyHotkey("arrowdown", u) || Yt.isKeyHotkey("arrowup", u) || Yt.isKeyHotkey("tab", u) || Yt.isKeyHotkey("esc", u) || Yt.isKeyHotkey("Enter", u) || c(false));
    }
    return o.jsx(ule, {
      children: o.jsx(Ft, {
        active: l,
        focusTrapOptions: {
          initialFocus: false,
          onPostDeactivate: s,
          returnFocusOnDeactivate: false,
          clickOutsideDeactivates: true,
          allowOutsideClick: true,
          isKeyForward: (u) => Yt.isKeyHotkey("arrowdown", u),
          isKeyBackward: (u) => Yt.isKeyHotkey("arrowup", u),
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          className: dle,
          onKeyDown: (u) => d(u),
          children: [
            o.jsx(wn, {
              className: OPe,
              size: "400",
              children: t
            }),
            o.jsx(dn, {
              style: {
                flexGrow: 1
              },
              onKeyDown: Hte,
              children: o.jsx("div", {
                ref: a,
                style: {
                  padding: ee.space.S200
                },
                children: n
              })
            })
          ]
        })
      })
    });
  }
  var al = ((t) => (t.RoomMention = "#", t.UserMention = "@", t.Emoticon = ":", t.Command = "/", t.Reaction = "+:", t))(al || {});
  const xI = [
    "#",
    "@",
    ":"
  ], NPe = [
    "/",
    "+:"
  ], zPe = (t, e, n) => {
    const r = fe.string(t, e);
    return n.find((i) => r.startsWith(i));
  }, UPe = (t, e, n) => fe.string(t, e).slice(n.length), fF = (t, e, n) => {
    const r = zPe(t, e, n);
    if (r) return {
      range: e,
      prefix: r,
      text: UPe(t, e, r)
    };
  };
  var Cr = ((t) => (t.Paragraph = "paragraph", t.Mention = "mention", t.Emoticon = "emoticon", t.Link = "link", t.Command = "command", t))(Cr || {});
  const hle = (t) => t.startsWith("@") ? t : `@${t}`, fle = (t, e) => {
    const n = ((e == null ? void 0 : e.room) && gr(e.room, t, e.nicknames)) ?? _n(t) ?? t;
    return hle(n);
  }, VPe = (t, e, n) => e === "@room" ? "@room" : fle(t, n), JD = (t) => t === "@room" ? "@room" : t.startsWith("#") ? t : `#${t}`, NG = (t, e, n) => {
    const r = e.trim();
    return r === "@room" ? "@room" : r ? JD(r) : (n == null ? void 0 : n.room) && (n.room.roomId === t || n.room.getCanonicalAlias() === t) ? JD(n.room.name || t) : JD(t);
  }, HPe = (t, e) => (e == null ? void 0 : e.mxUserId) === t, zG = (t, e) => {
    if (!(e == null ? void 0 : e.room)) return true;
    const { roomId: n } = e.room, r = e.room.getCanonicalAlias();
    return n === t || r === t;
  }, $Pe = (t) => co(t.id) ? hle(t.name) : t.name === "@room" ? "@room" : JD(t.name), M0 = (t) => {
    xt.delete(t, {
      at: {
        anchor: fe.start(t, []),
        focus: fe.end(t, [])
      }
    }), xt.setNodes(t, {
      type: Cr.Paragraph
    });
  }, Bw = (t) => {
    t.history = {
      undos: [],
      redos: []
    };
  }, Ig = (t, e, n, r, i) => ({
    type: Cr.Mention,
    id: t,
    eventId: r,
    viaServers: i,
    highlight: n,
    name: e,
    children: [
      {
        text: ""
      }
    ]
  }), YF = (t, e) => ({
    type: Cr.Emoticon,
    key: t,
    shortcode: e,
    children: [
      {
        text: ""
      }
    ]
  }), WPe = (t, e) => ({
    type: Cr.Link,
    href: t,
    children: typeof e == "string" ? [
      {
        text: e
      }
    ] : e
  }), qPe = (t) => ({
    type: Cr.Command,
    command: t,
    children: [
      {
        text: ""
      }
    ]
  }), g3 = (t, e, n) => {
    xt.select(t, e), xt.insertNodes(t, n), xt.collapse(t, {
      edge: "end"
    });
  }, Gl = (t, e) => {
    xt.move(t), e && t.insertText(" "), xt.collapse(t, {
      edge: "end"
    });
  }, KPe = (t, e, n) => {
    let r, i, a;
    const s = fe.positions(t, {
      at: {
        anchor: fe.start(t, []),
        focus: fe.point(t, e, {
          edge: "start"
        })
      },
      unit: "character",
      reverse: n.reverse
    });
    for (const l of s) {
      if (!ei.equals(l, e) && i) {
        if (a = fe.string(t, {
          anchor: l,
          focus: i
        }), n.match(a)) break;
        r = l;
      }
      i = l;
    }
    return r;
  }, gb = (t) => {
    const { selection: e } = t;
    if (!e || !_t.isCollapsed(e)) return;
    const [n] = _t.edges(e), r = KPe(t, n, {
      reverse: true,
      match: (i) => /\s|^$/.test(i)
    });
    return r && fe.range(t, r, n);
  }, XD = (t) => {
    const e = t.children[0];
    return e && Sg.isElement(e) ? t.children.length === 1 && fe.isEmpty(t, e) : false;
  }, mle = (t) => {
    const e = t.children[0];
    if (!Sg.isElement(e) || e.type !== Cr.Paragraph) return;
    const [n, r] = e.children;
    if (Zo.isText(n) && n.text.trim() === "" && Sg.isElement(r) && r.type === Cr.Command) return r.command;
  }, rS = (t) => {
    const e = [];
    let n;
    for (let r = 0; r < t.length; r += 1) if (t[r] === "`") {
      let i = r;
      for (; i < t.length && t[i] === "`"; ) i += 1;
      const a = i - r;
      n ? n.length === a && (e.push([
        n.start,
        i
      ]), n = void 0) : n = {
        start: r,
        length: a
      }, r = i - 1;
    }
    return e;
  }, lM = (t, e, n) => n.some(([r, i]) => t > r && e < i), gle = (t, e) => ml(`#${e}`) ? `#${e}` : `#${e}${e.endsWith(":") ? "" : ":"}${bo(t.getUserId() ?? "")}`;
  function GPe({ query: t, handleAutocomplete: e }) {
    const n = be(), r = gle(n, t.text), i = () => e(r, r);
    return o.jsx(Ye, {
      as: "button",
      radii: "300",
      onKeyDown: (a) => zd(a, i),
      onClick: i,
      before: o.jsx(xn, {
        size: "200",
        children: o.jsx(Q, {
          src: q.Hash,
          size: "100"
        })
      }),
      children: o.jsx(D, {
        style: {
          flexGrow: 1
        },
        size: "B400",
        children: r
      })
    });
  }
  const YPe = {
    matchOptions: {
      contain: true
    }
  };
  function ple({ roomId: t, editor: e, query: n, requestClose: r }) {
    const i = be(), a = Ze(gi), s = Ze(zr), l = p.useMemo(() => s.toSorted(Ku(i)), [
      s,
      i
    ]), [c, d, u] = tc(l, p.useCallback((g) => {
      const m = i.getRoom(g);
      if (!m) return "Unknown Room";
      const v = m.getCanonicalAlias();
      return v ? [
        m.name,
        v
      ] : m.name;
    }, [
      i
    ]), YPe), h = c ? c.items.slice(0, 20) : l.slice(0, 20);
    p.useEffect(() => {
      n.text ? d(n.text) : u();
    }, [
      n.text,
      d,
      u
    ]);
    const f = (g, m) => {
      var _a6;
      const v = i.getRoom(g), y = v ? Xc(v) : void 0, w = Ig(g, m.startsWith("#") ? m : `#${m}`, t === g || ((_a6 = i.getRoom(t)) == null ? void 0 : _a6.getCanonicalAlias()) === g, void 0, y);
      g3(e, n.range, w), Gl(e, true), Bt.focus(e), r();
    };
    return Ld(window, (g) => {
      zd(g, () => {
        if (h.length === 0) {
          const w = gle(i, n.text);
          f(w, w);
          return;
        }
        const m = h[0], v = i.getRoom(m), y = (v == null ? void 0 : v.name) ?? m;
        f((v == null ? void 0 : v.getCanonicalAlias()) ?? m ?? "", y);
      });
    }), o.jsx(nS, {
      headerContent: o.jsx(D, {
        size: "L400",
        children: "Rooms"
      }),
      requestClose: r,
      editor: e,
      children: h.length === 0 ? o.jsx(GPe, {
        query: n,
        handleAutocomplete: f
      }) : h.map((g) => {
        const m = i.getRoom(g);
        if (!m) return null;
        const v = a.has(m.roomId), y = () => f(m.getCanonicalAlias() ?? g, m.name);
        return o.jsx(Ye, {
          as: "button",
          radii: "300",
          onKeyDown: (w) => zd(w, y),
          onClick: y,
          after: o.jsx(D, {
            size: "T200",
            priority: "300",
            truncate: true,
            children: m.getCanonicalAlias() ?? ""
          }),
          before: o.jsx(xn, {
            size: "200",
            children: v ? o.jsx(yi, {
              roomId: m.roomId,
              src: Jf(i, m),
              alt: m.name,
              renderFallback: () => o.jsx(Ya, {
                size: "50",
                joinRule: m.getJoinRule() ?? kn.Restricted,
                roomType: m.getType(),
                filled: true
              })
            }) : o.jsx(Ya, {
              size: "100",
              joinRule: m.getJoinRule(),
              roomType: m.getType()
            })
          }),
          children: o.jsx(D, {
            style: {
              flexGrow: 1
            },
            size: "B400",
            truncate: true,
            children: m.name
          })
        }, g);
      })
    });
  }
  const iS = (t, e) => {
    const [n, r] = p.useState([]);
    return p.useEffect(() => {
      const i = t.getRoom(e);
      let a = true, s = false;
      const l = (d) => {
        !i || s || d && d.getRoomId() !== e || a || r(i.getMembers());
      };
      i && (r(i.getMembers()), i.loadMembersIfNeeded().then(() => {
        a = false, !s && l();
      }));
      const c = (d) => {
        d.getRoomId() === e && d.getType() === ce.RoomMember && l(d);
      };
      return t.on(Ui.Membership, l), t.on(Ui.PowerLevel, l), t.on(qn.Events, c), () => {
        s = true, t.removeListener(Ui.Membership, l), t.removeListener(Ui.PowerLevel, l), t.removeListener(qn.Events, c);
      };
    }, [
      t,
      e
    ]), n;
  }, T5 = (t, e) => co(`@${e}`) ? `@${e}` : `@${e}${e.endsWith(":") ? "" : ":"}${bo(t.getUserId() ?? "")}`;
  function UG({ userId: t, name: e, handleAutocomplete: n }) {
    return o.jsx(Ye, {
      as: "button",
      radii: "300",
      onKeyDown: (r) => zd(r, () => n(t, e)),
      onClick: () => n(t, e),
      before: o.jsx(xn, {
        size: "200",
        children: o.jsx(Si, {
          userId: t,
          renderFallback: () => o.jsx(Q, {
            size: "50",
            src: q.User,
            filled: true
          })
        })
      }),
      children: o.jsx(D, {
        style: {
          flexGrow: 1
        },
        size: "B400",
        children: e
      })
    });
  }
  const ZPe = (t) => t.membership === Ht.Join || t.membership === Ht.Invite || t.membership === Ht.Knock, JPe = {
    limit: 1e3,
    matchOptions: {
      contain: true
    }
  }, XPe = (t) => _n(t) ?? t, QPe = (t, e) => BB(t, e, XPe);
  function Fle({ room: t, editor: e, query: n, requestClose: r }) {
    const i = be(), a = hn(), s = Ze(qr), l = t.roomId, c = t.getCanonicalAlias() || l, d = iS(i, l), [u, h, f] = tc(d, QPe, JPe), g = (u ? u.items.slice(0, 20) : d.slice(0, 20)).filter(ZPe);
    p.useEffect(() => {
      n.text ? h(n.text) : f();
    }, [
      n.text,
      h,
      f
    ]);
    const m = (y, w) => {
      const b = w === "@room", j = l === y || t.getCanonicalAlias() === y || c === y, k = Ig(y, VPe(y, w, {
        room: t,
        nicknames: s
      }), b ? j : i.getUserId() === y || j);
      g3(e, n.range, k), Gl(e, true), Bt.focus(e), r();
    };
    function v(y) {
      return gr(t, y.userId, s) ?? _n(y.userId) ?? y.userId;
    }
    return Ld(window, (y) => {
      zd(y, () => {
        if (n.text === "room") {
          m(c, "@room");
          return;
        }
        if (g.length === 0) {
          const b = T5(i, n.text);
          m(b, b);
          return;
        }
        const w = g[0];
        m(w.userId, v(w));
      });
    }), o.jsxs(nS, {
      headerContent: o.jsx(D, {
        size: "L400",
        children: "Mentions"
      }),
      requestClose: r,
      editor: e,
      children: [
        n.text === "room" && o.jsx(UG, {
          userId: c,
          name: "@room",
          handleAutocomplete: m
        }),
        g.length === 0 ? o.jsx(UG, {
          userId: T5(i, n.text),
          name: T5(i, n.text),
          handleAutocomplete: m
        }) : g.map((y) => {
          const w = y.getMxcAvatarUrl(), b = w ? i.mxcUrlToHttp(w, 32, 32, "crop", void 0, false, a) : void 0;
          return o.jsx(Ye, {
            as: "button",
            radii: "300",
            onKeyDown: (j) => zd(j, () => m(y.userId, v(y))),
            onClick: () => m(y.userId, v(y)),
            after: o.jsx(D, {
              size: "T200",
              priority: "300",
              truncate: true,
              children: y.userId
            }),
            before: o.jsx(xn, {
              size: "200",
              children: o.jsx(Si, {
                userId: y.userId,
                src: b ?? void 0,
                alt: v(y),
                renderFallback: () => o.jsx(Q, {
                  size: "50",
                  src: q.User,
                  filled: true
                })
              })
            }),
            children: o.jsx(D, {
              style: {
                flexGrow: 1
              },
              size: "B400",
              truncate: true,
              children: v(y)
            })
          }, y.userId);
        })
      ]
    });
  }
  const VG = (t, e) => {
    var _a6;
    const r = (_a6 = Qu(t, Zr.ElementRecentEmoji)) == null ? void 0 : _a6.getContent().recent_emoji;
    return Array.isArray(r) ? r.toSorted((i, a) => a[1] - i[1]).slice(0, e).reduce((i, [a]) => {
      const s = Ok.find((l) => l.unicode === a);
      return s && i.push(s), i;
    }, []) : [];
  };
  function eMe(t, e) {
    var _a6;
    const r = (_a6 = Qu(t, Zr.ElementRecentEmoji)) == null ? void 0 : _a6.getContent(), i = r && Array.isArray(r.recent_emoji) ? structuredClone(r.recent_emoji) : [], a = i.findIndex(([l]) => l === e);
    let s;
    a < 0 ? s = [
      e,
      1
    ] : (s = i.splice(a, 1)[0] ?? [
      e,
      1
    ], s[1] += 1), i.unshift(s), t.setAccountData(Zr.ElementRecentEmoji, {
      recent_emoji: i.slice(0, 100)
    });
  }
  const cM = (t, e) => {
    const [n, r] = p.useState(() => VG(t, e));
    return p.useEffect(() => {
      const i = (a) => {
        a.getType() === Zr.ElementRecentEmoji && r(VG(t, e));
      };
      return t.on(jt.AccountData, i), () => {
        t.removeListener(jt.AccountData, i);
      };
    }, [
      t,
      e
    ]), n;
  }, dM = (t, e) => {
    if (!t && !e) return true;
    if (!t || !e) return false;
    const n = Array.from(t.images.collection.entries()), r = Array.from(e.images.collection.entries());
    return n.length !== r.length || !n.every(([a, s], l) => {
      const c = r[l];
      if (!c) return false;
      const [d, u] = c;
      return a !== d ? false : s.url === u.url && s.body === u.body && JSON.stringify(s.usage) === JSON.stringify(u.usage) && JSON.stringify(s.info) === JSON.stringify(u.info);
    }) ? false : t.id === e.id && t.deleted === e.deleted && t.meta.name === e.meta.name && t.meta.avatar === e.meta.avatar && t.meta.attribution === e.meta.attribution && JSON.stringify(t.meta.usage) === JSON.stringify(e.meta.usage);
  }, mE = (t, e) => t.length !== e.length ? false : t.every((n, r) => dM(n, e[r])), uM = () => {
    const t = be(), [e, n] = p.useState(() => {
      const r = eW(t);
      if (r) return r;
      const i = t.getUserId();
      if (i) return eEe(i, tW()) ?? void 0;
    });
    return p.useEffect(() => {
      const r = t.getUserId();
      r && hie(r, tW(), e);
    }, [
      t,
      e
    ]), bp(t, p.useCallback((r) => {
      r.getType() === Zr.PoniesUserEmotes && n((i) => {
        const a = eW(t);
        return dM(i, a) ? i : a;
      });
    }, [
      t
    ])), e;
  }, vle = () => {
    const t = be(), [e, n] = p.useState(() => {
      const r = BD(t);
      if (r.length > 0) return r;
      const i = t.getUserId();
      if (!i) return r;
      const a = Qb(i, nW());
      return a.length > 0 ? a : r;
    });
    return p.useEffect(() => {
      const r = t.getUserId();
      r && wk(r, nW(), e);
    }, [
      t,
      e
    ]), bp(t, p.useCallback((r) => {
      r.getType() === Zr.PoniesEmoteRooms && n((i) => {
        const a = BD(t);
        return mE(i, a) ? i : a;
      });
    }, [
      t
    ])), vl(t, p.useCallback((r) => {
      const i = r.getType(), a = r.getRoomId(), s = r.getStateKey();
      i === Pn.PoniesRoomEmotes && a && typeof s == "string" && n((l) => {
        if (!!!l.find((u) => u.address && u.address.roomId === a && u.address.stateKey === s)) return l;
        const d = BD(t);
        return mE(l, d) ? l : d;
      });
    }, [
      t
    ])), e;
  }, tMe = (t, e) => {
    const n = be(), [r, i] = p.useState(() => {
      const a = Q$(t, e);
      if (a) return a;
      const s = n.getUserId();
      if (s) return Qb(s, Q1(t.roomId)).find((l) => {
        var _a6;
        return ((_a6 = l.address) == null ? void 0 : _a6.stateKey) === e;
      });
    });
    return p.useEffect(() => {
      const a = n.getUserId();
      if (!a) return;
      const s = Q1(t.roomId);
      hie(a, s, r);
    }, [
      n,
      t.roomId,
      r
    ]), vl(n, p.useCallback((a) => {
      a.getRoomId() === t.roomId && a.getType() === Pn.PoniesRoomEmotes && a.getStateKey() === e && i((s) => {
        const l = Q$(t, e);
        return dM(s, l) ? s : l;
      });
    }, [
      t,
      e
    ])), r;
  }, nMe = (t) => {
    const e = be(), [n, r] = p.useState(() => {
      const i = f1(t);
      if (i.length > 0) return i;
      const a = e.getUserId();
      if (!a) return i;
      const s = Qb(a, Q1(t.roomId));
      return s.length > 0 ? s : i;
    });
    return p.useEffect(() => {
      const i = e.getUserId();
      i && wk(i, Q1(t.roomId), n);
    }, [
      e,
      t.roomId,
      n
    ]), vl(e, p.useCallback((i) => {
      i.getRoomId() === t.roomId && i.getType() === Pn.PoniesRoomEmotes && r((a) => {
        const s = f1(t);
        return mE(a, s) ? a : s;
      });
    }, [
      t
    ])), n;
  }, _le = (t) => {
    const e = be(), [n, r] = p.useState(() => {
      const i = t.flatMap(f1);
      if (i.length > 0) return i;
      const a = e.getUserId();
      if (!a) return i;
      const s = t.flatMap((l) => {
        const c = f1(l);
        return c.length > 0 ? c : Qb(a, Q1(l.roomId));
      });
      return s.length > 0 ? s : i;
    });
    return p.useEffect(() => {
      const i = e.getUserId();
      if (!i) return;
      const a = /* @__PURE__ */ new Map();
      n.forEach((s) => {
        if (!s.address) return;
        const l = a.get(s.address.roomId) ?? [];
        l.push(s), a.set(s.address.roomId, l);
      }), a.forEach((s, l) => {
        wk(i, Q1(l), s);
      });
    }, [
      e,
      n
    ]), vl(e, p.useCallback((i) => {
      t.find((a) => a.roomId === i.getRoomId()) && i.getType() === Pn.PoniesRoomEmotes && r((a) => {
        const s = t.flatMap(f1);
        return mE(a, s) ? a : s;
      });
    }, [
      t
    ])), n;
  }, yle = (t, e) => {
    const n = uM(), r = vle(), i = _le(e);
    return p.useMemo(() => {
      const s = n ? [
        n
      ] : [], l = new Set(r.map((d) => d.id));
      return s.concat(r, i.filter((d) => !l.has(d.id))).filter((d) => d.getImages(t).length > 0);
    }, [
      n,
      r,
      i,
      t
    ]);
  }, ble = (t) => {
    const e = `:${t.shortcode}:`;
    if (t instanceof Jg) return t.body ? [
      e,
      t.body
    ] : e;
    const n = [
      e,
      t.label
    ];
    return Array.isArray(t.shortcodes) ? n.concat(t.shortcodes) : n;
  }, rMe = {
    matchOptions: {
      contain: true
    }
  };
  function pb({ title: t, imagePackRooms: e, editor: n, query: r, requestClose: i, onEmoticonSelected: a }) {
    const s = be(), l = hn(), c = yle(Hr.Emoticon, e), d = cM(s, 20), [u] = Fe(ge, "emojiSuggestThreshold"), h = p.useMemo(() => [
      ...c.flatMap((w) => w.getImages(Hr.Emoticon)),
      ...Ok
    ], [
      c
    ]), [f, g, m] = tc(h, ble, rMe), v = p.useMemo(() => r.text.length < u ? [] : f ? f.items.slice(0, 20) : d, [
      r.text.length,
      u,
      f,
      d
    ]);
    p.useEffect(() => {
      r.text && r.text.length >= u ? g(r.text) : m();
    }, [
      r.text,
      g,
      m,
      u
    ]);
    const y = a ?? ((w, b) => {
      const j = YF(w, b);
      g3(n, r.range, j), Gl(n, true), Bt.focus(n), i();
    });
    return Ld(window, (w) => {
      zd(w, () => {
        if (v.length === 0) return;
        const b = v[0], j = "url" in b ? b.url : b.unicode;
        y(j, b.shortcode);
      });
    }), v.length === 0 ? null : o.jsx(nS, {
      headerContent: o.jsx(D, {
        size: "L400",
        children: t ?? "Emojis"
      }),
      requestClose: i,
      editor: n,
      children: v.map((w) => {
        const b = "url" in w, j = b ? w.url : w.unicode, k = Cn(s, j, l);
        return o.jsx(Ye, {
          as: "button",
          radii: "300",
          onKeyDown: (C) => zd(C, () => y(j, w.shortcode)),
          onClick: () => y(j, w.shortcode),
          before: b && k ? o.jsx(E, {
            shrink: "No",
            as: "img",
            src: k,
            alt: w.shortcode,
            style: {
              width: He(24),
              height: He(24),
              objectFit: "contain"
            }
          }) : o.jsx(E, {
            shrink: "No",
            as: "span",
            display: "InlineFlex",
            style: {
              fontSize: He(24),
              lineHeight: He(24)
            },
            children: j
          }),
          children: o.jsxs(D, {
            style: {
              flexGrow: 1
            },
            size: "B400",
            truncate: true,
            children: [
              ":",
              w.shortcode,
              ":"
            ]
          })
        }, w.shortcode + j);
      })
    });
  }
  function HG(t) {
    return Object.prototype.toString.call(t) === "[object Object]";
  }
  function iMe(t) {
    var e, n;
    return HG(t) === false ? false : (e = t.constructor, e === void 0 ? true : (n = e.prototype, !(HG(n) === false || n.hasOwnProperty("isPrototypeOf") === false)));
  }
  var oMe = {
    isHistory(t) {
      return iMe(t) && Array.isArray(t.redos) && Array.isArray(t.undos) && (t.redos.length === 0 || bf.isOperationList(t.redos[0].operations)) && (t.undos.length === 0 || bf.isOperationList(t.undos[0].operations));
    }
  }, R5 = /* @__PURE__ */ new WeakMap(), Pm = /* @__PURE__ */ new WeakMap(), Pw = /* @__PURE__ */ new WeakMap(), jd = {
    isHistoryEditor(t) {
      return oMe.isHistory(t.history) && fe.isEditor(t);
    },
    isMerging(t) {
      return Pm.get(t);
    },
    isSplittingOnce(t) {
      return Pw.get(t);
    },
    setSplittingOnce(t, e) {
      Pw.set(t, e);
    },
    isSaving(t) {
      return R5.get(t);
    },
    redo(t) {
      t.redo();
    },
    undo(t) {
      t.undo();
    },
    withMerging(t, e) {
      var n = jd.isMerging(t);
      Pm.set(t, true), e(), Pm.set(t, n);
    },
    withNewBatch(t, e) {
      var n = jd.isMerging(t);
      Pm.set(t, true), Pw.set(t, true), e(), Pm.set(t, n), Pw.delete(t);
    },
    withoutMerging(t, e) {
      var n = jd.isMerging(t);
      Pm.set(t, false), e(), Pm.set(t, n);
    },
    withoutSaving(t, e) {
      var n = jd.isSaving(t);
      R5.set(t, false);
      try {
        e();
      } finally {
        R5.set(t, n);
      }
    }
  }, aMe = (t) => {
    var e = t, { apply: n } = e;
    return e.history = {
      undos: [],
      redos: []
    }, e.redo = () => {
      var { history: r } = e, { redos: i } = r;
      if (i.length > 0) {
        var a = i[i.length - 1];
        a.selectionBefore && xt.setSelection(e, a.selectionBefore), jd.withoutSaving(e, () => {
          fe.withoutNormalizing(e, () => {
            for (var s of a.operations) e.apply(s);
          });
        }), r.redos.pop(), e.writeHistory("undos", a);
      }
    }, e.undo = () => {
      var { history: r } = e, { undos: i } = r;
      if (i.length > 0) {
        var a = i[i.length - 1];
        jd.withoutSaving(e, () => {
          fe.withoutNormalizing(e, () => {
            var s = a.operations.map(bf.inverse).reverse();
            for (var l of s) e.apply(l);
            a.selectionBefore && xt.setSelection(e, a.selectionBefore);
          });
        }), e.writeHistory("redos", a), r.undos.pop();
      }
    }, e.apply = (r) => {
      var { operations: i, history: a } = e, { undos: s } = a, l = s[s.length - 1], c = l && l.operations[l.operations.length - 1], d = jd.isSaving(e), u = jd.isMerging(e);
      if (d == null && (d = lMe(r)), d) {
        if (u == null && (l == null ? u = false : i.length !== 0 ? u = true : u = sMe(r, c)), jd.isSplittingOnce(e) && (u = false, jd.setSplittingOnce(e, void 0)), l && u) l.operations.push(r);
        else {
          var h = {
            operations: [
              r
            ],
            selectionBefore: e.selection
          };
          e.writeHistory("undos", h);
        }
        for (; s.length > 100; ) s.shift();
        a.redos = [];
      }
      n(r);
    }, e.writeHistory = (r, i) => {
      e.history[r].push(i);
    }, e;
  }, sMe = (t, e) => !!(e && t.type === "insert_text" && e.type === "insert_text" && t.offset === e.offset + e.text.length && Me.equals(t.path, e.path) || e && t.type === "remove_text" && e.type === "remove_text" && t.offset + t.text.length === e.offset && Me.equals(t.path, e.path)), lMe = (t, e) => t.type !== "set_selection";
  function cMe() {
    return o.jsx("span", {
      className: KSe,
      contentEditable: false,
      children: String.fromCodePoint(160)
    });
  }
  function dMe({ attributes: t, element: e, children: n }) {
    const r = sM(), i = aM(), s = Ze(qr)[e.id], l = s ? `@${s}` : $Pe(e);
    return o.jsxs("span", {
      ...t,
      className: Jy({
        highlight: e.highlight,
        focus: r && i
      }),
      contentEditable: false,
      children: [
        l,
        n
      ]
    });
  }
  function uMe({ attributes: t, element: e, children: n }) {
    const r = sM(), i = aM(), a = m3();
    return o.jsxs("span", {
      ...t,
      className: GSe({
        focus: r && i,
        active: mle(a) === e.command
      }),
      contentEditable: false,
      children: [
        `/${e.command}`,
        n
      ]
    });
  }
  function hMe({ attributes: t, element: e, children: n }) {
    const r = be(), i = hn(), a = sM(), s = aM();
    return o.jsx("span", {
      className: wu,
      ...t,
      children: o.jsxs("span", {
        className: q4({
          focus: a && s
        }),
        contentEditable: false,
        children: [
          e.key.startsWith("mxc://") ? o.jsx("img", {
            className: Fy,
            src: Cn(r, e.key, i) ?? e.key,
            alt: e.shortcode
          }) : e.key,
          n
        ]
      })
    });
  }
  function fMe({ attributes: t, element: e, children: n }) {
    return o.jsxs("a", {
      href: e.href,
      ...t,
      children: [
        o.jsx(cMe, {}),
        n
      ]
    });
  }
  function mMe({ attributes: t, element: e, children: n }) {
    switch (e.type) {
      case Cr.Paragraph:
        return o.jsx(D, {
          ...t,
          className: GA,
          style: {
            fontSize: "1rem",
            lineHeight: "inherit"
          },
          children: n
        });
      case Cr.Mention:
        return o.jsx(dMe, {
          attributes: t,
          element: e,
          children: n
        });
      case Cr.Emoticon:
        return o.jsx(hMe, {
          attributes: t,
          element: e,
          children: n
        });
      case Cr.Link:
        return o.jsx(fMe, {
          attributes: t,
          element: e,
          children: n
        });
      case Cr.Command:
        return o.jsx(uMe, {
          attributes: t,
          element: e,
          children: n
        });
      default:
        return o.jsx(D, {
          className: GA,
          ...t,
          style: {
            fontSize: "1rem",
            lineHeight: "inherit"
          },
          children: n
        });
    }
  }
  function gMe({ attributes: t, children: e }) {
    return o.jsx("span", {
      ...t,
      children: e
    });
  }
  var pMe = "Editor_Editor__1a1o97c0 _1mqalmd1 _1mqalmd0", FMe = "Editor_EditorRow__1a1o97c1", vMe = "Editor_EditorRowMultiline__1a1o97c2", _Me = "Editor_EditorRowMultilineWithResponsiveAfter__1a1o97c3", $G = "Editor_EditorOptions__1a1o97c4 _1mqalmd1 _1mqalmd0", WG = "Editor_EditorOptionsMultiline__1a1o97c5", yMe = "Editor_EditorOptionsAfterMultiline__1a1o97c6", bMe = "Editor_EditorTextareaScroll__1a1o97c7", xMe = "Editor_EditorTextareaScrollMultiline__1a1o97c8", wMe = "Editor_EditorTextarea__1a1o97c9 _1mqalmd1 _1mqalmd0", DMe = "Editor_EditorResponsiveAfterMultiline__1a1o97ca Editor_EditorOptions__1a1o97c4 _1mqalmd1 _1mqalmd0", CMe = "Editor_EditorPlaceholderContainer__1a1o97cb _1mqalmd1 _1mqalmd0", EMe = "Editor_EditorPlaceholderTextVisual__1a1o97cc _1mqalmd1 _1mqalmd0", kMe = "Editor_EditorToolbarBase__1a1o97cd", SMe = "Editor_EditorToolbar__1a1o97ce";
  const sf = {
    "mod+b": "**",
    "mod+i": "*",
    "mod+u": "__",
    "mod+s": "~~",
    "mod+[": "`",
    "mod+h": "||"
  }, jMe = Object.keys(sf), K0 = {
    "mod+7": "1. ",
    "mod+8": "- ",
    "mod+'": "> ",
    "mod+;": "```\n"
  }, TMe = Object.keys(K0), RMe = Yt.isKeyHotkey("mod+1"), AMe = Yt.isKeyHotkey("mod+2"), IMe = Yt.isKeyHotkey("mod+3"), xle = (t, e) => {
    if (t.selection && _t.isExpanded(t.selection)) {
      const n = fe.string(t, t.selection);
      xt.insertText(t, `${e}${n}${e}`);
    } else xt.insertText(t, `${e}${e}`), xt.move(t, {
      distance: e.length,
      reverse: true
    });
  }, G0 = (t, e) => {
    if (t.selection) {
      const n = t.selection.anchor.path, r = fe.start(t, n);
      xt.insertText(t, e, {
        at: r
      });
    }
  }, BMe = (t, e) => Yt.isKeyHotkey("escape", e) ? false : TMe.find((i) => Yt.isKeyHotkey(i, e) ? (e.preventDefault(), G0(t, K0[i]), true) : false) ? true : RMe(e) ? (e.preventDefault(), G0(t, "# "), true) : AMe(e) ? (e.preventDefault(), G0(t, "## "), true) : IMe(e) ? (e.preventDefault(), G0(t, "### "), true) : !!jMe.find((i) => Yt.isKeyHotkey(i, e) ? (e.preventDefault(), xle(t, sf[i]), true) : false), PMe = (t) => {
    const { isInline: e } = t;
    return t.isInline = (n) => [
      Cr.Mention,
      Cr.Emoticon,
      Cr.Link,
      Cr.Command
    ].includes(n.type) || e(n), t;
  }, MMe = (t) => {
    const { isVoid: e } = t;
    return t.isVoid = (n) => [
      Cr.Mention,
      Cr.Emoticon,
      Cr.Command
    ].includes(n.type) || e(n), t;
  }, p3 = () => {
    const [t] = p.useState(() => PMe(MMe(BPe(aMe(x7e())))));
    return t;
  }, OMe = 2, LMe = 1, NMe = "\u200B", zMe = (t) => /[ \t]+$/.test(t) ? `${t}${NMe}` : t, oS = p.forwardRef(({ editableName: t, top: e, bottom: n, before: r, after: i, responsiveAfter: a, forceMultilineLayout: s = false, maxHeight: l = "50vh", editor: c, placeholder: d, onKeyDown: u, onKeyUp: h, onChange: f, onPaste: g, className: m, variant: v = "SurfaceVariant" }, y) => {
    const [w] = p.useState(() => [
      {
        type: Cr.Paragraph,
        children: [
          {
            text: ""
          }
        ]
      }
    ]), b = p.useRef(null), j = p.useRef(null), k = p.useRef(null), C = p.useRef(null), x = p.useRef(null), S = p.useRef(null), T = p.useRef(null), A = p.useRef(null), B = p.useRef(0), U = p.useRef(0), z = p.useRef(c.children), O = p.useRef(false), [M, I] = p.useState(false), [N, L] = p.useState(0), H = !!r, V = !!i, Z = !!a, Y = M || s, oe = Z && Y, ue = Z && !oe, ie = p.useCallback((te) => {
      b.current = te, typeof y == "function" ? y(te) : y && Reflect.set(y, "current", te);
    }, [
      y
    ]), de = p.useCallback((te = c.children) => {
      var _a6, _b3;
      const re = te.length > 1, he = te.map((ke) => Le.string(ke)).join(""), se = he.includes(`
`), ye = j.current, we = k.current, Ee = S.current;
      if (ye && we && Ee) {
        const ke = ye.parentElement, Ne = getComputedStyle(ye), lt = ((_a6 = C.current) == null ? void 0 : _a6.offsetWidth) ?? 0, Rt = ((_b3 = x.current) == null ? void 0 : _b3.offsetWidth) ?? 0, We = we.offsetWidth - lt - Rt;
        if (!Y && ke) {
          const bt = ke.clientWidth;
          bt > 0 && (U.current = Math.max(0, We - bt));
        }
        const Xt = Math.max(0, We - U.current);
        if (he.length > 0 && Xt <= 0 && B.current < OMe) {
          B.current += 1, A.current !== null && cancelAnimationFrame(A.current), A.current = requestAnimationFrame(() => {
            A.current = null, de();
          });
          return;
        }
        B.current = 0;
        let nn = re || se;
        if (!nn && he.length > 0) {
          const bt = [
            Ne.font,
            Ne.lineHeight,
            Ne.letterSpacing,
            Ne.fontKerning,
            Ne.fontFeatureSettings,
            Ne.fontVariationSettings,
            Ne.textTransform,
            Ne.textIndent,
            Ne.tabSize
          ].join("|"), At = T.current;
          if ((At == null ? void 0 : At.text) === he && At.singleLineWidth === Xt && At.styleKey === bt) nn = At.result;
          else {
            Ee.style.font = Ne.font, Ee.style.lineHeight = Ne.lineHeight, Ee.style.letterSpacing = Ne.letterSpacing, Ee.style.fontKerning = Ne.fontKerning, Ee.style.fontFeatureSettings = Ne.fontFeatureSettings, Ee.style.fontVariationSettings = Ne.fontVariationSettings, Ee.style.textTransform = Ne.textTransform, Ee.style.textIndent = Ne.textIndent, Ee.style.tabSize = Ne.tabSize;
            const $t = (st, Be) => (Ee.style.width = Be, Ee.textContent = zMe(st), Ee.scrollHeight), Lt = $t("M", "max-content");
            nn = $t(he, `${Math.max(Xt, 0)}px`) > Lt + LMe, T.current = {
              result: nn,
              singleLineWidth: Xt,
              styleKey: bt,
              text: he
            };
          }
        } else T.current = null;
        O.current = nn, I(nn);
      } else {
        const ke = re || se;
        O.current = ke, I(ke);
      }
    }, [
      c,
      Y
    ]);
    p.useEffect(() => {
      const te = b.current;
      if (!te) return;
      const re = document.createElement("div"), he = document.createElement("div");
      return re.setAttribute("aria-hidden", "true"), he.setAttribute("aria-hidden", "true"), t && (he.dataset.editorMeasurer = t), Object.assign(re.style, {
        position: "absolute",
        inset: "0",
        width: "0",
        height: "0",
        overflow: "hidden",
        pointerEvents: "none",
        visibility: "hidden",
        zIndex: "-1"
      }), Object.assign(he.style, {
        padding: "0",
        border: "0",
        margin: "0",
        whiteSpace: "pre-wrap",
        overflowWrap: "break-word",
        wordBreak: "break-word",
        boxSizing: "border-box"
      }), re.appendChild(he), te.appendChild(re), S.current = he, () => {
        T.current = null, S.current = null, re.remove();
      };
    }, [
      t
    ]), p.useEffect(() => () => {
      A.current !== null && cancelAnimationFrame(A.current), T.current = null, B.current = 0;
    }, []);
    const ne = p.useCallback((te = true) => {
      A.current !== null && cancelAnimationFrame(A.current), te && (B.current = 0), A.current = requestAnimationFrame(() => {
        A.current = null, de();
      });
    }, [
      de
    ]);
    p.useEffect(() => {
      if (typeof ResizeObserver > "u") return;
      const te = new ResizeObserver(() => {
        ne();
      });
      return [
        k.current,
        C.current,
        x.current
      ].filter((he) => he !== null).forEach((he) => te.observe(he)), () => te.disconnect();
    }, [
      ne,
      de,
      H,
      V,
      ue
    ]), p.useLayoutEffect(() => {
      de(z.current);
    }, [
      N,
      de
    ]);
    const ae = p.useCallback((te) => {
      z.current = te, T.current = null, A.current !== null && (cancelAnimationFrame(A.current), A.current = null), L((re) => re + 1), f == null ? void 0 : f(te);
    }, [
      f
    ]), X = p.useCallback((te) => o.jsx(mMe, {
      ...te
    }), []), K = p.useCallback((te) => o.jsx(gMe, {
      ...te
    }), []), G = p.useCallback((te) => {
      if (Dr() && te.key === "Enter" && !te.shiftKey) return;
      u == null ? void 0 : u(te), BMe(c, te) && te.preventDefault();
    }, [
      c,
      u
    ]), le = p.useCallback(({ attributes: te, children: re }) => o.jsx("span", {
      ...te,
      className: CMe,
      children: o.jsx(D, {
        as: "span",
        className: EMe,
        truncate: true,
        children: re
      })
    }), []);
    return o.jsx("div", {
      className: `${pMe} ${m || ""}`,
      ref: ie,
      children: o.jsxs(IPe, {
        editor: c,
        initialValue: w,
        onChange: ae,
        children: [
          e,
          o.jsxs(E, {
            ref: k,
            className: `${FMe} ${Y ? vMe : ""} ${oe ? _Me : ""}`,
            alignItems: "Start",
            style: {
              display: i ? "grid" : "flex"
            },
            children: [
              H && o.jsx(E, {
                ref: C,
                className: `${$G} ${Y ? WG : ""}`,
                alignItems: "Center",
                gap: "100",
                shrink: "No",
                children: r
              }),
              o.jsx(dn, {
                className: `${bMe} ${Y ? xMe : ""}`,
                variant: v,
                style: {
                  maxHeight: oe ? void 0 : l
                },
                size: "300",
                visibility: "Always",
                hideTrack: true,
                children: o.jsx(kPe, {
                  ref: j,
                  "data-editable-name": t,
                  className: wMe,
                  placeholder: d,
                  renderPlaceholder: le,
                  renderElement: X,
                  renderLeaf: K,
                  onKeyDown: G,
                  onKeyUp: h,
                  onPaste: g,
                  autoCapitalize: "sentences",
                  onBlur: () => {
                    Dr() && Bt.focus(c);
                  }
                })
              }),
              (V || ue) && o.jsxs(E, {
                ref: x,
                className: `${$G} ${Y ? WG : ""} ${Y ? yMe : ""}`,
                alignItems: "Center",
                gap: "100",
                shrink: "No",
                children: [
                  ue && a,
                  i
                ]
              }),
              oe && o.jsx(E, {
                className: DMe,
                alignItems: "Center",
                justifyContent: "End",
                gap: "100",
                children: a
              })
            ]
          }),
          n
        ]
      })
    });
  }), wle = "(?<!(?:https?|ftp|mailto|magnet):\\/\\/\\S*)", Dle = "[*_~`|<>]", UMe = `${wle}${Dle}`, VMe = (t) => {
    const e = new RegExp(`${wle}\\\\(${Dle})`, "g");
    return Mk(t, e, (r) => {
      const [, i] = r;
      return i ?? "";
    }, (r) => r).join("");
  }, qG = "\uE000", KG = "\uE001", HMe = (t) => {
    const e = [], n = (a) => `${qG}${a}${KG}`;
    let r = t.replace(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi, (a) => (e.push(a), n(e.length - 1)));
    return r = r.replace(/<code\b[^>]*>[\s\S]*?<\/code>/gi, (a) => (e.push(a), n(e.length - 1))), VMe(r).replace(new RegExp(`${qG}(\\d+)${KG}`, "g"), (a, s) => e[parseInt(s, 10)] ?? "");
  }, hM = (t) => {
    const e = new RegExp(`(${UMe})`, "g");
    let r = Mk(t, e, (i) => {
      const [, a] = i;
      return `\\${a}`;
    }, (i) => i).join("");
    return r = r.replace(/(^|\n)-(# +)/gm, (i, a, s) => `${a}\\-${s}`), r;
  }, $Me = (t) => t.replace(/^(\s*)>(?![ \t])/gm, "$1\\>");
  function fM() {
    return {
      async: false,
      breaks: false,
      extensions: null,
      gfm: true,
      hooks: null,
      pedantic: false,
      renderer: null,
      silent: false,
      tokenizer: null,
      walkTokens: null
    };
  }
  var jp = fM();
  function Cle(t) {
    jp = t;
  }
  var og = {
    exec: () => null
  };
  function $r(t, e = "") {
    let n = typeof t == "string" ? t : t.source, r = {
      replace: (i, a) => {
        let s = typeof a == "string" ? a : a.source;
        return s = s.replace(qa.caret, "$1"), n = n.replace(i, s), r;
      },
      getRegex: () => new RegExp(n, e)
    };
    return r;
  }
  var WMe = ((t = "") => {
    try {
      return !!new RegExp("(?<=1)(?<!1)" + t);
    } catch {
      return false;
    }
  })(), qa = {
    codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
    outputLinkReplace: /\\([\[\]])/g,
    indentCodeCompensation: /^(\s+)(?:```)/,
    beginningSpace: /^\s+/,
    endingHash: /#$/,
    startingSpaceChar: /^ /,
    endingSpaceChar: / $/,
    nonSpaceChar: /[^ ]/,
    newLineCharGlobal: /\n/g,
    tabCharGlobal: /\t/g,
    multipleSpaceGlobal: /\s+/g,
    blankLine: /^[ \t]*$/,
    doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
    blockquoteStart: /^ {0,3}>/,
    blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
    blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
    listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
    listIsTask: /^\[[ xX]\] +\S/,
    listReplaceTask: /^\[[ xX]\] +/,
    listTaskCheckbox: /\[[ xX]\]/,
    anyLine: /\n.*\n/,
    hrefBrackets: /^<(.*)>$/,
    tableDelimiter: /[:|]/,
    tableAlignChars: /^\||\| *$/g,
    tableRowBlankLine: /\n[ \t]*$/,
    tableAlignRight: /^ *-+: *$/,
    tableAlignCenter: /^ *:-+: *$/,
    tableAlignLeft: /^ *:-+ *$/,
    startATag: /^<a /i,
    endATag: /^<\/a>/i,
    startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
    endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
    startAngleBracket: /^</,
    endAngleBracket: />$/,
    pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
    unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
    escapeTest: /[&<>"']/,
    escapeReplace: /[&<>"']/g,
    escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
    escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
    caret: /(^|[^\[])\^/g,
    percentDecode: /%25/g,
    findPipe: /\|/g,
    splitPipe: / \|/,
    slashPipe: /\\\|/g,
    carriageReturn: /\r\n|\r/g,
    spaceLine: /^ +$/gm,
    notSpaceStart: /^\S*/,
    endingNewline: /\n$/,
    listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[	 ][^\\n]*)?(?:\\n|$))`),
    nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),
    hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
    fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`),
    headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`),
    htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"),
    blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`)
  }, qMe = /^(?:[ \t]*(?:\n|$))+/, KMe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, GMe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, F3 = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, YMe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, mM = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ele = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, kle = $r(Ele).replace(/bull/g, mM).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ZMe = $r(Ele).replace(/bull/g, mM).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), gM = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, JMe = /^[^\n]+/, pM = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, XMe = $r(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pM).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), QMe = $r(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, mM).getRegex(), aS = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", FM = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, eOe = $r("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))", "i").replace("comment", FM).replace("tag", aS).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Sle = $r(gM).replace("hr", F3).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", aS).getRegex(), tOe = $r(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Sle).getRegex(), vM = {
    blockquote: tOe,
    code: KMe,
    def: XMe,
    fences: GMe,
    heading: YMe,
    hr: F3,
    html: eOe,
    lheading: kle,
    list: QMe,
    newline: qMe,
    paragraph: Sle,
    table: og,
    text: JMe
  }, GG = $r("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", F3).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}	)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", aS).getRegex(), nOe = {
    ...vM,
    lheading: ZMe,
    table: GG,
    paragraph: $r(gM).replace("hr", F3).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", GG).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", aS).getRegex()
  }, rOe = {
    ...vM,
    html: $r(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", FM).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
    def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
    heading: /^(#{1,6})(.*)(?:\n+|$)/,
    fences: og,
    lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
    paragraph: $r(gM).replace("hr", F3).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", kle).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
  }, iOe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, oOe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, jle = /^( {2,}|\\)\n(?!\s*$)/, aOe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, ZF = /[\p{P}\p{S}]/u, sS = /[\s\p{P}\p{S}]/u, _M = /[^\s\p{P}\p{S}]/u, sOe = $r(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, sS).getRegex(), Tle = /(?!~)[\p{P}\p{S}]/u, lOe = /(?!~)[\s\p{P}\p{S}]/u, cOe = /(?:[^\s\p{P}\p{S}]|~)/u, dOe = $r(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", WMe ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rle = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, uOe = $r(Rle, "u").replace(/punct/g, ZF).getRegex(), hOe = $r(Rle, "u").replace(/punct/g, Tle).getRegex(), Ale = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", fOe = $r(Ale, "gu").replace(/notPunctSpace/g, _M).replace(/punctSpace/g, sS).replace(/punct/g, ZF).getRegex(), mOe = $r(Ale, "gu").replace(/notPunctSpace/g, cOe).replace(/punctSpace/g, lOe).replace(/punct/g, Tle).getRegex(), gOe = $r("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, _M).replace(/punctSpace/g, sS).replace(/punct/g, ZF).getRegex(), pOe = $r(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ZF).getRegex(), FOe = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", vOe = $r(FOe, "gu").replace(/notPunctSpace/g, _M).replace(/punctSpace/g, sS).replace(/punct/g, ZF).getRegex(), _Oe = $r(/\\(punct)/, "gu").replace(/punct/g, ZF).getRegex(), yOe = $r(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), bOe = $r(FM).replace("(?:-->|$)", "-->").getRegex(), xOe = $r("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", bOe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), gE = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, wOe = $r(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", gE).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ile = $r(/^!?\[(label)\]\[(ref)\]/).replace("label", gE).replace("ref", pM).getRegex(), Ble = $r(/^!?\[(ref)\](?:\[\])?/).replace("ref", pM).getRegex(), DOe = $r("reflink|nolink(?!\\()", "g").replace("reflink", Ile).replace("nolink", Ble).getRegex(), YG = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, yM = {
    _backpedal: og,
    anyPunctuation: _Oe,
    autolink: yOe,
    blockSkip: dOe,
    br: jle,
    code: oOe,
    del: og,
    delLDelim: og,
    delRDelim: og,
    emStrongLDelim: uOe,
    emStrongRDelimAst: fOe,
    emStrongRDelimUnd: gOe,
    escape: iOe,
    link: wOe,
    nolink: Ble,
    punctuation: sOe,
    reflink: Ile,
    reflinkSearch: DOe,
    tag: xOe,
    text: aOe,
    url: og
  }, COe = {
    ...yM,
    link: $r(/^!?\[(label)\]\((.*?)\)/).replace("label", gE).getRegex(),
    reflink: $r(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", gE).getRegex()
  }, wI = {
    ...yM,
    emStrongRDelimAst: mOe,
    emStrongLDelim: hOe,
    delLDelim: pOe,
    delRDelim: vOe,
    url: $r(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", YG).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
    _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
    del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
    text: $r(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", YG).getRegex()
  }, EOe = {
    ...wI,
    br: $r(jle).replace("{2,}", "*").getRegex(),
    text: $r(wI.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
  }, Mw = {
    normal: vM,
    gfm: nOe,
    pedantic: rOe
  }, q_ = {
    normal: yM,
    gfm: wI,
    breaks: EOe,
    pedantic: COe
  }, kOe = {
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#39;"
  }, ZG = (t) => kOe[t];
  function _d(t, e) {
    if (e) {
      if (qa.escapeTest.test(t)) return t.replace(qa.escapeReplace, ZG);
    } else if (qa.escapeTestNoEncode.test(t)) return t.replace(qa.escapeReplaceNoEncode, ZG);
    return t;
  }
  function JG(t) {
    try {
      t = encodeURI(t).replace(qa.percentDecode, "%");
    } catch {
      return null;
    }
    return t;
  }
  function XG(t, e) {
    var _a6;
    let n = t.replace(qa.findPipe, (a, s, l) => {
      let c = false, d = s;
      for (; --d >= 0 && l[d] === "\\"; ) c = !c;
      return c ? "|" : " |";
    }), r = n.split(qa.splitPipe), i = 0;
    if (r[0].trim() || r.shift(), r.length > 0 && !((_a6 = r.at(-1)) == null ? void 0 : _a6.trim()) && r.pop(), e) if (r.length > e) r.splice(e);
    else for (; r.length < e; ) r.push("");
    for (; i < r.length; i++) r[i] = r[i].trim().replace(qa.slashPipe, "|");
    return r;
  }
  function Yh(t, e, n) {
    let r = t.length;
    if (r === 0) return "";
    let i = 0;
    for (; i < r && t.charAt(r - i - 1) === e; ) i++;
    return t.slice(0, r - i);
  }
  function QG(t) {
    let e = t.split(`
`), n = e.length - 1;
    for (; n >= 0 && qa.blankLine.test(e[n]); ) n--;
    return e.length - n <= 2 ? t : e.slice(0, n + 1).join(`
`);
  }
  function SOe(t, e) {
    if (t.indexOf(e[1]) === -1) return -1;
    let n = 0;
    for (let r = 0; r < t.length; r++) if (t[r] === "\\") r++;
    else if (t[r] === e[0]) n++;
    else if (t[r] === e[1] && (n--, n < 0)) return r;
    return n > 0 ? -2 : -1;
  }
  function jOe(t, e = 0) {
    let n = e, r = "";
    for (let i of t) if (i === "	") {
      let a = 4 - n % 4;
      r += " ".repeat(a), n += a;
    } else r += i, n++;
    return r;
  }
  function eY(t, e, n, r, i) {
    let a = e.href, s = e.title || null, l = t[1].replace(i.other.outputLinkReplace, "$1");
    r.state.inLink = true;
    let c = {
      type: t[0].charAt(0) === "!" ? "image" : "link",
      raw: n,
      href: a,
      title: s,
      text: l,
      tokens: r.inlineTokens(l)
    };
    return r.state.inLink = false, c;
  }
  function TOe(t, e, n) {
    let r = t.match(n.other.indentCodeCompensation);
    if (r === null) return e;
    let i = r[1];
    return e.split(`
`).map((a) => {
      let s = a.match(n.other.beginningSpace);
      if (s === null) return a;
      let [l] = s;
      return l.length >= i.length ? a.slice(i.length) : a;
    }).join(`
`);
  }
  var pE = class {
    constructor(e) {
      __publicField(this, "options");
      __publicField(this, "rules");
      __publicField(this, "lexer");
      this.options = e || jp;
    }
    space(e) {
      let n = this.rules.block.newline.exec(e);
      if (n && n[0].length > 0) return {
        type: "space",
        raw: n[0]
      };
    }
    code(e) {
      let n = this.rules.block.code.exec(e);
      if (n) {
        let r = this.options.pedantic ? n[0] : QG(n[0]), i = r.replace(this.rules.other.codeRemoveIndent, "");
        return {
          type: "code",
          raw: r,
          codeBlockStyle: "indented",
          text: i
        };
      }
    }
    fences(e) {
      let n = this.rules.block.fences.exec(e);
      if (n) {
        let r = n[0], i = TOe(r, n[3] || "", this.rules);
        return {
          type: "code",
          raw: r,
          lang: n[2] ? n[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : n[2],
          text: i
        };
      }
    }
    heading(e) {
      let n = this.rules.block.heading.exec(e);
      if (n) {
        let r = n[2].trim();
        if (this.rules.other.endingHash.test(r)) {
          let i = Yh(r, "#");
          (this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (r = i.trim());
        }
        return {
          type: "heading",
          raw: Yh(n[0], `
`),
          depth: n[1].length,
          text: r,
          tokens: this.lexer.inline(r)
        };
      }
    }
    hr(e) {
      let n = this.rules.block.hr.exec(e);
      if (n) return {
        type: "hr",
        raw: Yh(n[0], `
`)
      };
    }
    blockquote(e) {
      let n = this.rules.block.blockquote.exec(e);
      if (n) {
        let r = Yh(n[0], `
`).split(`
`), i = "", a = "", s = [];
        for (; r.length > 0; ) {
          let l = false, c = [], d;
          for (d = 0; d < r.length; d++) if (this.rules.other.blockquoteStart.test(r[d])) c.push(r[d]), l = true;
          else if (!l) c.push(r[d]);
          else break;
          r = r.slice(d);
          let u = c.join(`
`), h = u.replace(this.rules.other.blockquoteSetextReplace, `
    $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
          i = i ? `${i}
${u}` : u, a = a ? `${a}
${h}` : h;
          let f = this.lexer.state.top;
          if (this.lexer.state.top = true, this.lexer.blockTokens(h, s, true), this.lexer.state.top = f, r.length === 0) break;
          let g = s.at(-1);
          if ((g == null ? void 0 : g.type) === "code") break;
          if ((g == null ? void 0 : g.type) === "blockquote") {
            let m = g, v = m.raw + `
` + r.join(`
`), y = this.blockquote(v);
            s[s.length - 1] = y, i = i.substring(0, i.length - m.raw.length) + y.raw, a = a.substring(0, a.length - m.text.length) + y.text;
            break;
          } else if ((g == null ? void 0 : g.type) === "list") {
            let m = g, v = m.raw + `
` + r.join(`
`), y = this.list(v);
            s[s.length - 1] = y, i = i.substring(0, i.length - g.raw.length) + y.raw, a = a.substring(0, a.length - m.raw.length) + y.raw, r = v.substring(s.at(-1).raw.length).split(`
`);
            continue;
          }
        }
        return {
          type: "blockquote",
          raw: i,
          tokens: s,
          text: a
        };
      }
    }
    list(e) {
      var _a6, _b3;
      let n = this.rules.block.list.exec(e);
      if (n) {
        let r = n[1].trim(), i = r.length > 1, a = {
          type: "list",
          raw: "",
          ordered: i,
          start: i ? +r.slice(0, -1) : "",
          loose: false,
          items: []
        };
        r = i ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = i ? r : "[*+-]");
        let s = this.rules.other.listItemRegex(r), l = false;
        for (; e; ) {
          let d = false, u = "", h = "";
          if (!(n = s.exec(e)) || this.rules.block.hr.test(e)) break;
          u = n[0], e = e.substring(u.length);
          let f = jOe(n[2].split(`
`, 1)[0], n[1].length), g = e.split(`
`, 1)[0], m = !f.trim(), v = 0;
          if (this.options.pedantic ? (v = 2, h = f.trimStart()) : m ? v = n[1].length + 1 : (v = f.search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, h = f.slice(v), v += n[1].length), m && this.rules.other.blankLine.test(g) && (u += g + `
`, e = e.substring(g.length + 1), d = true), !d) {
            let y = this.rules.other.nextBulletRegex(v), w = this.rules.other.hrRegex(v), b = this.rules.other.fencesBeginRegex(v), j = this.rules.other.headingBeginRegex(v), k = this.rules.other.htmlBeginRegex(v), C = this.rules.other.blockquoteBeginRegex(v);
            for (; e; ) {
              let x = e.split(`
`, 1)[0], S;
              if (g = x, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, "  "), S = g) : S = g.replace(this.rules.other.tabCharGlobal, "    "), b.test(g) || j.test(g) || k.test(g) || C.test(g) || y.test(g) || w.test(g)) break;
              if (S.search(this.rules.other.nonSpaceChar) >= v || !g.trim()) h += `
` + S.slice(v);
              else {
                if (m || f.replace(this.rules.other.tabCharGlobal, "    ").search(this.rules.other.nonSpaceChar) >= 4 || b.test(f) || j.test(f) || w.test(f)) break;
                h += `
` + g;
              }
              m = !g.trim(), u += x + `
`, e = e.substring(x.length + 1), f = S.slice(v);
            }
          }
          a.loose || (l ? a.loose = true : this.rules.other.doubleBlankLine.test(u) && (l = true)), a.items.push({
            type: "list_item",
            raw: u,
            task: !!this.options.gfm && this.rules.other.listIsTask.test(h),
            loose: false,
            text: h,
            tokens: []
          }), a.raw += u;
        }
        let c = a.items.at(-1);
        if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
        else return;
        a.raw = a.raw.trimEnd();
        for (let d of a.items) {
          if (this.lexer.state.top = false, d.tokens = this.lexer.blockTokens(d.text, []), d.task) {
            if (d.text = d.text.replace(this.rules.other.listReplaceTask, ""), ((_a6 = d.tokens[0]) == null ? void 0 : _a6.type) === "text" || ((_b3 = d.tokens[0]) == null ? void 0 : _b3.type) === "paragraph") {
              d.tokens[0].raw = d.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), d.tokens[0].text = d.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
              for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
                this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
                break;
              }
            }
            let u = this.rules.other.listTaskCheckbox.exec(d.raw);
            if (u) {
              let h = {
                type: "checkbox",
                raw: u[0] + " ",
                checked: u[0] !== "[ ]"
              };
              d.checked = h.checked, a.loose ? d.tokens[0] && [
                "paragraph",
                "text"
              ].includes(d.tokens[0].type) && "tokens" in d.tokens[0] && d.tokens[0].tokens ? (d.tokens[0].raw = h.raw + d.tokens[0].raw, d.tokens[0].text = h.raw + d.tokens[0].text, d.tokens[0].tokens.unshift(h)) : d.tokens.unshift({
                type: "paragraph",
                raw: h.raw,
                text: h.raw,
                tokens: [
                  h
                ]
              }) : d.tokens.unshift(h);
            }
          }
          if (!a.loose) {
            let u = d.tokens.filter((f) => f.type === "space"), h = u.length > 0 && u.some((f) => this.rules.other.anyLine.test(f.raw));
            a.loose = h;
          }
        }
        if (a.loose) for (let d of a.items) {
          d.loose = true;
          for (let u of d.tokens) u.type === "text" && (u.type = "paragraph");
        }
        return a;
      }
    }
    html(e) {
      let n = this.rules.block.html.exec(e);
      if (n) {
        let r = QG(n[0]);
        return {
          type: "html",
          block: true,
          raw: r,
          pre: n[1] === "pre" || n[1] === "script" || n[1] === "style",
          text: r
        };
      }
    }
    def(e) {
      let n = this.rules.block.def.exec(e);
      if (n) {
        let r = n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), i = n[2] ? n[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", a = n[3] ? n[3].substring(1, n[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : n[3];
        return {
          type: "def",
          tag: r,
          raw: Yh(n[0], `
`),
          href: i,
          title: a
        };
      }
    }
    table(e) {
      var _a6;
      let n = this.rules.block.table.exec(e);
      if (!n || !this.rules.other.tableDelimiter.test(n[2])) return;
      let r = XG(n[1]), i = n[2].replace(this.rules.other.tableAlignChars, "").split("|"), a = ((_a6 = n[3]) == null ? void 0 : _a6.trim()) ? n[3].replace(this.rules.other.tableRowBlankLine, "").split(`
`) : [], s = {
        type: "table",
        raw: Yh(n[0], `
`),
        header: [],
        align: [],
        rows: []
      };
      if (r.length === i.length) {
        for (let l of i) this.rules.other.tableAlignRight.test(l) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? s.align.push("left") : s.align.push(null);
        for (let l = 0; l < r.length; l++) s.header.push({
          text: r[l],
          tokens: this.lexer.inline(r[l]),
          header: true,
          align: s.align[l]
        });
        for (let l of a) s.rows.push(XG(l, s.header.length).map((c, d) => ({
          text: c,
          tokens: this.lexer.inline(c),
          header: false,
          align: s.align[d]
        })));
        return s;
      }
    }
    lheading(e) {
      let n = this.rules.block.lheading.exec(e);
      if (n) {
        let r = n[1].trim();
        return {
          type: "heading",
          raw: Yh(n[0], `
`),
          depth: n[2].charAt(0) === "=" ? 1 : 2,
          text: r,
          tokens: this.lexer.inline(r)
        };
      }
    }
    paragraph(e) {
      let n = this.rules.block.paragraph.exec(e);
      if (n) {
        let r = n[1].charAt(n[1].length - 1) === `
` ? n[1].slice(0, -1) : n[1];
        return {
          type: "paragraph",
          raw: n[0],
          text: r,
          tokens: this.lexer.inline(r)
        };
      }
    }
    text(e) {
      let n = this.rules.block.text.exec(e);
      if (n) return {
        type: "text",
        raw: n[0],
        text: n[0],
        tokens: this.lexer.inline(n[0])
      };
    }
    escape(e) {
      let n = this.rules.inline.escape.exec(e);
      if (n) return {
        type: "escape",
        raw: n[0],
        text: n[1]
      };
    }
    tag(e) {
      let n = this.rules.inline.tag.exec(e);
      if (n) return !this.lexer.state.inLink && this.rules.other.startATag.test(n[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(n[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(n[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(n[0]) && (this.lexer.state.inRawBlock = false), {
        type: "html",
        raw: n[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        block: false,
        text: n[0]
      };
    }
    link(e) {
      let n = this.rules.inline.link.exec(e);
      if (n) {
        let r = n[2].trim();
        if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
          if (!this.rules.other.endAngleBracket.test(r)) return;
          let s = Yh(r.slice(0, -1), "\\");
          if ((r.length - s.length) % 2 === 0) return;
        } else {
          let s = SOe(n[2], "()");
          if (s === -2) return;
          if (s > -1) {
            let l = (n[0].indexOf("!") === 0 ? 5 : 4) + n[1].length + s;
            n[2] = n[2].substring(0, s), n[0] = n[0].substring(0, l).trim(), n[3] = "";
          }
        }
        let i = n[2], a = "";
        if (this.options.pedantic) {
          let s = this.rules.other.pedanticHrefTitle.exec(i);
          s && (i = s[1], a = s[3]);
        } else a = n[3] ? n[3].slice(1, -1) : "";
        return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i = i.slice(1) : i = i.slice(1, -1)), eY(n, {
          href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
          title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
        }, n[0], this.lexer, this.rules);
      }
    }
    reflink(e, n) {
      let r;
      if ((r = this.rules.inline.reflink.exec(e)) || (r = this.rules.inline.nolink.exec(e))) {
        let i = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), a = n[i.toLowerCase()];
        if (!a) {
          let s = r[0].charAt(0);
          return {
            type: "text",
            raw: s,
            text: s
          };
        }
        return eY(r, a, r[0], this.lexer, this.rules);
      }
    }
    emStrong(e, n, r = "") {
      let i = this.rules.inline.emStrongLDelim.exec(e);
      if (!(!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(i[1] || i[3]) || !r || this.rules.inline.punctuation.exec(r))) {
        let a = [
          ...i[0]
        ].length - 1, s, l, c = a, d = 0, u = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
        for (u.lastIndex = 0, n = n.slice(-1 * e.length + a); (i = u.exec(n)) !== null; ) {
          if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue;
          if (l = [
            ...s
          ].length, i[3] || i[4]) {
            c += l;
            continue;
          } else if ((i[5] || i[6]) && a % 3 && !((a + l) % 3)) {
            d += l;
            continue;
          }
          if (c -= l, c > 0) continue;
          l = Math.min(l, l + c + d);
          let h = [
            ...i[0]
          ][0].length, f = e.slice(0, a + i.index + h + l);
          if (Math.min(a, l) % 2) {
            let m = f.slice(1, -1);
            return {
              type: "em",
              raw: f,
              text: m,
              tokens: this.lexer.inlineTokens(m)
            };
          }
          let g = f.slice(2, -2);
          return {
            type: "strong",
            raw: f,
            text: g,
            tokens: this.lexer.inlineTokens(g)
          };
        }
      }
    }
    codespan(e) {
      let n = this.rules.inline.code.exec(e);
      if (n) {
        let r = n[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(r), a = this.rules.other.startingSpaceChar.test(r) && this.rules.other.endingSpaceChar.test(r);
        return i && a && (r = r.substring(1, r.length - 1)), {
          type: "codespan",
          raw: n[0],
          text: r
        };
      }
    }
    br(e) {
      let n = this.rules.inline.br.exec(e);
      if (n) return {
        type: "br",
        raw: n[0]
      };
    }
    del(e, n, r = "") {
      let i = this.rules.inline.delLDelim.exec(e);
      if (i && (!i[1] || !r || this.rules.inline.punctuation.exec(r))) {
        let a = [
          ...i[0]
        ].length - 1, s, l, c = a, d = this.rules.inline.delRDelim;
        for (d.lastIndex = 0, n = n.slice(-1 * e.length + a); (i = d.exec(n)) !== null; ) {
          if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (l = [
            ...s
          ].length, l !== a)) continue;
          if (i[3] || i[4]) {
            c += l;
            continue;
          }
          if (c -= l, c > 0) continue;
          l = Math.min(l, l + c);
          let u = [
            ...i[0]
          ][0].length, h = e.slice(0, a + i.index + u + l), f = h.slice(a, -a);
          return {
            type: "del",
            raw: h,
            text: f,
            tokens: this.lexer.inlineTokens(f)
          };
        }
      }
    }
    autolink(e) {
      let n = this.rules.inline.autolink.exec(e);
      if (n) {
        let r, i;
        return n[2] === "@" ? (r = n[1], i = "mailto:" + r) : (r = n[1], i = r), {
          type: "link",
          raw: n[0],
          text: r,
          href: i,
          tokens: [
            {
              type: "text",
              raw: r,
              text: r
            }
          ]
        };
      }
    }
    url(e) {
      var _a6;
      let n;
      if (n = this.rules.inline.url.exec(e)) {
        let r, i;
        if (n[2] === "@") r = n[0], i = "mailto:" + r;
        else {
          let a;
          do
            a = n[0], n[0] = ((_a6 = this.rules.inline._backpedal.exec(n[0])) == null ? void 0 : _a6[0]) ?? "";
          while (a !== n[0]);
          r = n[0], n[1] === "www." ? i = "http://" + n[0] : i = n[0];
        }
        return {
          type: "link",
          raw: n[0],
          text: r,
          href: i,
          tokens: [
            {
              type: "text",
              raw: r,
              text: r
            }
          ]
        };
      }
    }
    inlineText(e) {
      let n = this.rules.inline.text.exec(e);
      if (n) {
        let r = this.lexer.state.inRawBlock;
        return {
          type: "text",
          raw: n[0],
          text: n[0],
          escaped: r
        };
      }
    }
  }, Ec = class DI {
    constructor(e) {
      __publicField(this, "tokens");
      __publicField(this, "options");
      __publicField(this, "state");
      __publicField(this, "inlineQueue");
      __publicField(this, "tokenizer");
      this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || jp, this.options.tokenizer = this.options.tokenizer || new pE(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
        inLink: false,
        inRawBlock: false,
        top: true
      };
      let n = {
        other: qa,
        block: Mw.normal,
        inline: q_.normal
      };
      this.options.pedantic ? (n.block = Mw.pedantic, n.inline = q_.pedantic) : this.options.gfm && (n.block = Mw.gfm, this.options.breaks ? n.inline = q_.breaks : n.inline = q_.gfm), this.tokenizer.rules = n;
    }
    static get rules() {
      return {
        block: Mw,
        inline: q_
      };
    }
    static lex(e, n) {
      return new DI(n).lex(e);
    }
    static lexInline(e, n) {
      return new DI(n).inlineTokens(e);
    }
    lex(e) {
      e = e.replace(qa.carriageReturn, `
`), this.blockTokens(e, this.tokens);
      for (let n = 0; n < this.inlineQueue.length; n++) {
        let r = this.inlineQueue[n];
        this.inlineTokens(r.src, r.tokens);
      }
      return this.inlineQueue = [], this.tokens;
    }
    blockTokens(e, n = [], r = false) {
      var _a6, _b3, _c3;
      this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(qa.tabCharGlobal, "    ").replace(qa.spaceLine, ""));
      let i = 1 / 0;
      for (; e; ) {
        if (e.length < i) i = e.length;
        else {
          this.infiniteLoopError(e.charCodeAt(0));
          break;
        }
        let a;
        if ((_b3 = (_a6 = this.options.extensions) == null ? void 0 : _a6.block) == null ? void 0 : _b3.some((l) => (a = l.call({
          lexer: this
        }, e, n)) ? (e = e.substring(a.raw.length), n.push(a), true) : false)) continue;
        if (a = this.tokenizer.space(e)) {
          e = e.substring(a.raw.length);
          let l = n.at(-1);
          a.raw.length === 1 && l !== void 0 ? l.raw += `
` : n.push(a);
          continue;
        }
        if (a = this.tokenizer.code(e)) {
          e = e.substring(a.raw.length);
          let l = n.at(-1);
          (l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
`) ? "" : `
`) + a.raw, l.text += `
` + a.text, this.inlineQueue.at(-1).src = l.text) : n.push(a);
          continue;
        }
        if (a = this.tokenizer.fences(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.heading(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.hr(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.blockquote(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.list(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.html(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.def(e)) {
          e = e.substring(a.raw.length);
          let l = n.at(-1);
          (l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
`) ? "" : `
`) + a.raw, l.text += `
` + a.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[a.tag] || (this.tokens.links[a.tag] = {
            href: a.href,
            title: a.title
          }, n.push(a));
          continue;
        }
        if (a = this.tokenizer.table(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        if (a = this.tokenizer.lheading(e)) {
          e = e.substring(a.raw.length), n.push(a);
          continue;
        }
        let s = e;
        if ((_c3 = this.options.extensions) == null ? void 0 : _c3.startBlock) {
          let l = 1 / 0, c = e.slice(1), d;
          this.options.extensions.startBlock.forEach((u) => {
            d = u.call({
              lexer: this
            }, c), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
          }), l < 1 / 0 && l >= 0 && (s = e.substring(0, l + 1));
        }
        if (this.state.top && (a = this.tokenizer.paragraph(s))) {
          let l = n.at(-1);
          r && (l == null ? void 0 : l.type) === "paragraph" ? (l.raw += (l.raw.endsWith(`
`) ? "" : `
`) + a.raw, l.text += `
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(a), r = s.length !== e.length, e = e.substring(a.raw.length);
          continue;
        }
        if (a = this.tokenizer.text(e)) {
          e = e.substring(a.raw.length);
          let l = n.at(-1);
          (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
`) ? "" : `
`) + a.raw, l.text += `
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(a);
          continue;
        }
        if (e) {
          this.infiniteLoopError(e.charCodeAt(0));
          break;
        }
      }
      return this.state.top = true, n;
    }
    inline(e, n = []) {
      return this.inlineQueue.push({
        src: e,
        tokens: n
      }), n;
    }
    inlineTokens(e, n = []) {
      var _a6, _b3, _c3, _d4, _e13;
      this.tokenizer.lexer = this;
      let r = e, i = null;
      if (this.tokens.links) {
        let d = Object.keys(this.tokens.links);
        if (d.length > 0) for (; (i = this.tokenizer.rules.inline.reflinkSearch.exec(r)) !== null; ) d.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
      }
      for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(r)) !== null; ) r = r.slice(0, i.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
      let a;
      for (; (i = this.tokenizer.rules.inline.blockSkip.exec(r)) !== null; ) a = i[2] ? i[2].length : 0, r = r.slice(0, i.index + a) + "[" + "a".repeat(i[0].length - a - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
      r = ((_b3 = (_a6 = this.options.hooks) == null ? void 0 : _a6.emStrongMask) == null ? void 0 : _b3.call({
        lexer: this
      }, r)) ?? r;
      let s = false, l = "", c = 1 / 0;
      for (; e; ) {
        if (e.length < c) c = e.length;
        else {
          this.infiniteLoopError(e.charCodeAt(0));
          break;
        }
        s || (l = ""), s = false;
        let d;
        if ((_d4 = (_c3 = this.options.extensions) == null ? void 0 : _c3.inline) == null ? void 0 : _d4.some((h) => (d = h.call({
          lexer: this
        }, e, n)) ? (e = e.substring(d.raw.length), n.push(d), true) : false)) continue;
        if (d = this.tokenizer.escape(e)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.tag(e)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.link(e)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.reflink(e, this.tokens.links)) {
          e = e.substring(d.raw.length);
          let h = n.at(-1);
          d.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += d.raw, h.text += d.text) : n.push(d);
          continue;
        }
        if (d = this.tokenizer.emStrong(e, r, l)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.codespan(e)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.br(e)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.del(e, r, l)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (d = this.tokenizer.autolink(e)) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        if (!this.state.inLink && (d = this.tokenizer.url(e))) {
          e = e.substring(d.raw.length), n.push(d);
          continue;
        }
        let u = e;
        if ((_e13 = this.options.extensions) == null ? void 0 : _e13.startInline) {
          let h = 1 / 0, f = e.slice(1), g;
          this.options.extensions.startInline.forEach((m) => {
            g = m.call({
              lexer: this
            }, f), typeof g == "number" && g >= 0 && (h = Math.min(h, g));
          }), h < 1 / 0 && h >= 0 && (u = e.substring(0, h + 1));
        }
        if (d = this.tokenizer.inlineText(u)) {
          e = e.substring(d.raw.length), d.raw.slice(-1) !== "_" && (l = d.raw.slice(-1)), s = true;
          let h = n.at(-1);
          (h == null ? void 0 : h.type) === "text" ? (h.raw += d.raw, h.text += d.text) : n.push(d);
          continue;
        }
        if (e) {
          this.infiniteLoopError(e.charCodeAt(0));
          break;
        }
      }
      return n;
    }
    infiniteLoopError(e) {
      let n = "Infinite loop on byte: " + e;
      if (this.options.silent) console.error(n);
      else throw new Error(n);
    }
  }, FE = class {
    constructor(e) {
      __publicField(this, "options");
      __publicField(this, "parser");
      this.options = e || jp;
    }
    space(e) {
      return "";
    }
    code({ text: e, lang: n, escaped: r }) {
      var _a6;
      let i = (_a6 = (n || "").match(qa.notSpaceStart)) == null ? void 0 : _a6[0], a = e.replace(qa.endingNewline, "") + `
`;
      return i ? '<pre><code class="language-' + _d(i) + '">' + (r ? a : _d(a, true)) + `</code></pre>
` : "<pre><code>" + (r ? a : _d(a, true)) + `</code></pre>
`;
    }
    blockquote({ tokens: e }) {
      return `<blockquote>
${this.parser.parse(e)}</blockquote>
`;
    }
    html({ text: e }) {
      return e;
    }
    def(e) {
      return "";
    }
    heading({ tokens: e, depth: n }) {
      return `<h${n}>${this.parser.parseInline(e)}</h${n}>
`;
    }
    hr(e) {
      return `<hr>
`;
    }
    list(e) {
      let n = e.ordered, r = e.start, i = "";
      for (let l = 0; l < e.items.length; l++) {
        let c = e.items[l];
        i += this.listitem(c);
      }
      let a = n ? "ol" : "ul", s = n && r !== 1 ? ' start="' + r + '"' : "";
      return "<" + a + s + `>
` + i + "</" + a + `>
`;
    }
    listitem(e) {
      return `<li>${this.parser.parse(e.tokens)}</li>
`;
    }
    checkbox({ checked: e }) {
      return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
    }
    paragraph({ tokens: e }) {
      return `<p>${this.parser.parseInline(e)}</p>
`;
    }
    table(e) {
      let n = "", r = "";
      for (let a = 0; a < e.header.length; a++) r += this.tablecell(e.header[a]);
      n += this.tablerow({
        text: r
      });
      let i = "";
      for (let a = 0; a < e.rows.length; a++) {
        let s = e.rows[a];
        r = "";
        for (let l = 0; l < s.length; l++) r += this.tablecell(s[l]);
        i += this.tablerow({
          text: r
        });
      }
      return i && (i = `<tbody>${i}</tbody>`), `<table>
<thead>
` + n + `</thead>
` + i + `</table>
`;
    }
    tablerow({ text: e }) {
      return `<tr>
${e}</tr>
`;
    }
    tablecell(e) {
      let n = this.parser.parseInline(e.tokens), r = e.header ? "th" : "td";
      return (e.align ? `<${r} align="${e.align}">` : `<${r}>`) + n + `</${r}>
`;
    }
    strong({ tokens: e }) {
      return `<strong>${this.parser.parseInline(e)}</strong>`;
    }
    em({ tokens: e }) {
      return `<em>${this.parser.parseInline(e)}</em>`;
    }
    codespan({ text: e }) {
      return `<code>${_d(e, true)}</code>`;
    }
    br(e) {
      return "<br>";
    }
    del({ tokens: e }) {
      return `<del>${this.parser.parseInline(e)}</del>`;
    }
    link({ href: e, title: n, tokens: r }) {
      let i = this.parser.parseInline(r), a = JG(e);
      if (a === null) return i;
      e = a;
      let s = '<a href="' + e + '"';
      return n && (s += ' title="' + _d(n) + '"'), s += ">" + i + "</a>", s;
    }
    image({ href: e, title: n, text: r, tokens: i }) {
      i && (r = this.parser.parseInline(i, this.parser.textRenderer));
      let a = JG(e);
      if (a === null) return _d(r);
      e = a;
      let s = `<img src="${e}" alt="${_d(r)}"`;
      return n && (s += ` title="${_d(n)}"`), s += ">", s;
    }
    text(e) {
      return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : _d(e.text);
    }
  }, bM = class {
    strong({ text: e }) {
      return e;
    }
    em({ text: e }) {
      return e;
    }
    codespan({ text: e }) {
      return e;
    }
    del({ text: e }) {
      return e;
    }
    html({ text: e }) {
      return e;
    }
    text({ text: e }) {
      return e;
    }
    link({ text: e }) {
      return "" + e;
    }
    image({ text: e }) {
      return "" + e;
    }
    br() {
      return "";
    }
    checkbox({ raw: e }) {
      return e;
    }
  }, kc = class CI {
    constructor(e) {
      __publicField(this, "options");
      __publicField(this, "renderer");
      __publicField(this, "textRenderer");
      this.options = e || jp, this.options.renderer = this.options.renderer || new FE(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new bM();
    }
    static parse(e, n) {
      return new CI(n).parse(e);
    }
    static parseInline(e, n) {
      return new CI(n).parseInline(e);
    }
    parse(e) {
      var _a6, _b3;
      this.renderer.parser = this;
      let n = "";
      for (let r = 0; r < e.length; r++) {
        let i = e[r];
        if ((_b3 = (_a6 = this.options.extensions) == null ? void 0 : _a6.renderers) == null ? void 0 : _b3[i.type]) {
          let s = i, l = this.options.extensions.renderers[s.type].call({
            parser: this
          }, s);
          if (l !== false || ![
            "space",
            "hr",
            "heading",
            "code",
            "table",
            "blockquote",
            "list",
            "html",
            "def",
            "paragraph",
            "text"
          ].includes(s.type)) {
            n += l || "";
            continue;
          }
        }
        let a = i;
        switch (a.type) {
          case "space": {
            n += this.renderer.space(a);
            break;
          }
          case "hr": {
            n += this.renderer.hr(a);
            break;
          }
          case "heading": {
            n += this.renderer.heading(a);
            break;
          }
          case "code": {
            n += this.renderer.code(a);
            break;
          }
          case "table": {
            n += this.renderer.table(a);
            break;
          }
          case "blockquote": {
            n += this.renderer.blockquote(a);
            break;
          }
          case "list": {
            n += this.renderer.list(a);
            break;
          }
          case "checkbox": {
            n += this.renderer.checkbox(a);
            break;
          }
          case "html": {
            n += this.renderer.html(a);
            break;
          }
          case "def": {
            n += this.renderer.def(a);
            break;
          }
          case "paragraph": {
            n += this.renderer.paragraph(a);
            break;
          }
          case "text": {
            n += this.renderer.text(a);
            break;
          }
          default: {
            let s = 'Token with "' + a.type + '" type was not found.';
            if (this.options.silent) return console.error(s), "";
            throw new Error(s);
          }
        }
      }
      return n;
    }
    parseInline(e, n = this.renderer) {
      var _a6, _b3;
      this.renderer.parser = this;
      let r = "";
      for (let i = 0; i < e.length; i++) {
        let a = e[i];
        if ((_b3 = (_a6 = this.options.extensions) == null ? void 0 : _a6.renderers) == null ? void 0 : _b3[a.type]) {
          let l = this.options.extensions.renderers[a.type].call({
            parser: this
          }, a);
          if (l !== false || ![
            "escape",
            "html",
            "link",
            "image",
            "strong",
            "em",
            "codespan",
            "br",
            "del",
            "text"
          ].includes(a.type)) {
            r += l || "";
            continue;
          }
        }
        let s = a;
        switch (s.type) {
          case "escape": {
            r += n.text(s);
            break;
          }
          case "html": {
            r += n.html(s);
            break;
          }
          case "link": {
            r += n.link(s);
            break;
          }
          case "image": {
            r += n.image(s);
            break;
          }
          case "checkbox": {
            r += n.checkbox(s);
            break;
          }
          case "strong": {
            r += n.strong(s);
            break;
          }
          case "em": {
            r += n.em(s);
            break;
          }
          case "codespan": {
            r += n.codespan(s);
            break;
          }
          case "br": {
            r += n.br(s);
            break;
          }
          case "del": {
            r += n.del(s);
            break;
          }
          case "text": {
            r += n.text(s);
            break;
          }
          default: {
            let l = 'Token with "' + s.type + '" type was not found.';
            if (this.options.silent) return console.error(l), "";
            throw new Error(l);
          }
        }
      }
      return r;
    }
  }, _y = (_k2 = class {
    constructor(t) {
      __publicField(this, "options");
      __publicField(this, "block");
      this.options = t || jp;
    }
    preprocess(t) {
      return t;
    }
    postprocess(t) {
      return t;
    }
    processAllTokens(t) {
      return t;
    }
    emStrongMask(t) {
      return t;
    }
    provideLexer(t = this.block) {
      return t ? Ec.lex : Ec.lexInline;
    }
    provideParser(t = this.block) {
      return t ? kc.parse : kc.parseInline;
    }
  }, __publicField(_k2, "passThroughHooks", /* @__PURE__ */ new Set([
    "preprocess",
    "postprocess",
    "processAllTokens",
    "emStrongMask"
  ])), __publicField(_k2, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set([
    "preprocess",
    "postprocess",
    "processAllTokens"
  ])), _k2), ROe = class {
    constructor(...e) {
      __publicField(this, "defaults", fM());
      __publicField(this, "options", this.setOptions);
      __publicField(this, "parse", this.parseMarkdown(true));
      __publicField(this, "parseInline", this.parseMarkdown(false));
      __publicField(this, "Parser", kc);
      __publicField(this, "Renderer", FE);
      __publicField(this, "TextRenderer", bM);
      __publicField(this, "Lexer", Ec);
      __publicField(this, "Tokenizer", pE);
      __publicField(this, "Hooks", _y);
      this.use(...e);
    }
    walkTokens(e, n) {
      var _a6, _b3;
      let r = [];
      for (let i of e) switch (r = r.concat(n.call(this, i)), i.type) {
        case "table": {
          let a = i;
          for (let s of a.header) r = r.concat(this.walkTokens(s.tokens, n));
          for (let s of a.rows) for (let l of s) r = r.concat(this.walkTokens(l.tokens, n));
          break;
        }
        case "list": {
          let a = i;
          r = r.concat(this.walkTokens(a.items, n));
          break;
        }
        default: {
          let a = i;
          ((_b3 = (_a6 = this.defaults.extensions) == null ? void 0 : _a6.childTokens) == null ? void 0 : _b3[a.type]) ? this.defaults.extensions.childTokens[a.type].forEach((s) => {
            let l = a[s].flat(1 / 0);
            r = r.concat(this.walkTokens(l, n));
          }) : a.tokens && (r = r.concat(this.walkTokens(a.tokens, n)));
        }
      }
      return r;
    }
    use(...e) {
      let n = this.defaults.extensions || {
        renderers: {},
        childTokens: {}
      };
      return e.forEach((r) => {
        let i = {
          ...r
        };
        if (i.async = this.defaults.async || i.async || false, r.extensions && (r.extensions.forEach((a) => {
          if (!a.name) throw new Error("extension name required");
          if ("renderer" in a) {
            let s = n.renderers[a.name];
            s ? n.renderers[a.name] = function(...l) {
              let c = a.renderer.apply(this, l);
              return c === false && (c = s.apply(this, l)), c;
            } : n.renderers[a.name] = a.renderer;
          }
          if ("tokenizer" in a) {
            if (!a.level || a.level !== "block" && a.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
            let s = n[a.level];
            s ? s.unshift(a.tokenizer) : n[a.level] = [
              a.tokenizer
            ], a.start && (a.level === "block" ? n.startBlock ? n.startBlock.push(a.start) : n.startBlock = [
              a.start
            ] : a.level === "inline" && (n.startInline ? n.startInline.push(a.start) : n.startInline = [
              a.start
            ]));
          }
          "childTokens" in a && a.childTokens && (n.childTokens[a.name] = a.childTokens);
        }), i.extensions = n), r.renderer) {
          let a = this.defaults.renderer || new FE(this.defaults);
          for (let s in r.renderer) {
            if (!(s in a)) throw new Error(`renderer '${s}' does not exist`);
            if ([
              "options",
              "parser"
            ].includes(s)) continue;
            let l = s, c = r.renderer[l], d = a[l];
            a[l] = (...u) => {
              let h = c.apply(a, u);
              return h === false && (h = d.apply(a, u)), h || "";
            };
          }
          i.renderer = a;
        }
        if (r.tokenizer) {
          let a = this.defaults.tokenizer || new pE(this.defaults);
          for (let s in r.tokenizer) {
            if (!(s in a)) throw new Error(`tokenizer '${s}' does not exist`);
            if ([
              "options",
              "rules",
              "lexer"
            ].includes(s)) continue;
            let l = s, c = r.tokenizer[l], d = a[l];
            a[l] = (...u) => {
              let h = c.apply(a, u);
              return h === false && (h = d.apply(a, u)), h;
            };
          }
          i.tokenizer = a;
        }
        if (r.hooks) {
          let a = this.defaults.hooks || new _y();
          for (let s in r.hooks) {
            if (!(s in a)) throw new Error(`hook '${s}' does not exist`);
            if ([
              "options",
              "block"
            ].includes(s)) continue;
            let l = s, c = r.hooks[l], d = a[l];
            _y.passThroughHooks.has(s) ? a[l] = (u) => {
              if (this.defaults.async && _y.passThroughHooksRespectAsync.has(s)) return (async () => {
                let f = await c.call(a, u);
                return d.call(a, f);
              })();
              let h = c.call(a, u);
              return d.call(a, h);
            } : a[l] = (...u) => {
              if (this.defaults.async) return (async () => {
                let f = await c.apply(a, u);
                return f === false && (f = await d.apply(a, u)), f;
              })();
              let h = c.apply(a, u);
              return h === false && (h = d.apply(a, u)), h;
            };
          }
          i.hooks = a;
        }
        if (r.walkTokens) {
          let a = this.defaults.walkTokens, s = r.walkTokens;
          i.walkTokens = function(l) {
            let c = [];
            return c.push(s.call(this, l)), a && (c = c.concat(a.call(this, l))), c;
          };
        }
        this.defaults = {
          ...this.defaults,
          ...i
        };
      }), this;
    }
    setOptions(e) {
      return this.defaults = {
        ...this.defaults,
        ...e
      }, this;
    }
    lexer(e, n) {
      return Ec.lex(e, n ?? this.defaults);
    }
    parser(e, n) {
      return kc.parse(e, n ?? this.defaults);
    }
    parseMarkdown(e) {
      return (n, r) => {
        let i = {
          ...r
        }, a = {
          ...this.defaults,
          ...i
        }, s = this.onError(!!a.silent, !!a.async);
        if (this.defaults.async === true && i.async === false) return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
        if (typeof n > "u" || n === null) return s(new Error("marked(): input parameter is undefined or null"));
        if (typeof n != "string") return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
        if (a.hooks && (a.hooks.options = a, a.hooks.block = e), a.async) return (async () => {
          let l = a.hooks ? await a.hooks.preprocess(n) : n, c = await (a.hooks ? await a.hooks.provideLexer(e) : e ? Ec.lex : Ec.lexInline)(l, a), d = a.hooks ? await a.hooks.processAllTokens(c) : c;
          a.walkTokens && await Promise.all(this.walkTokens(d, a.walkTokens));
          let u = await (a.hooks ? await a.hooks.provideParser(e) : e ? kc.parse : kc.parseInline)(d, a);
          return a.hooks ? await a.hooks.postprocess(u) : u;
        })().catch(s);
        try {
          a.hooks && (n = a.hooks.preprocess(n));
          let l = (a.hooks ? a.hooks.provideLexer(e) : e ? Ec.lex : Ec.lexInline)(n, a);
          a.hooks && (l = a.hooks.processAllTokens(l)), a.walkTokens && this.walkTokens(l, a.walkTokens);
          let c = (a.hooks ? a.hooks.provideParser(e) : e ? kc.parse : kc.parseInline)(l, a);
          return a.hooks && (c = a.hooks.postprocess(c)), c;
        } catch (l) {
          return s(l);
        }
      };
    }
    onError(e, n) {
      return (r) => {
        if (r.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
          let i = "<p>An error occurred:</p><pre>" + _d(r.message + "", true) + "</pre>";
          return n ? Promise.resolve(i) : i;
        }
        if (n) return Promise.reject(r);
        throw r;
      };
    }
  }, sp = new ROe();
  function fi(t, e) {
    return sp.parse(t, e);
  }
  fi.options = fi.setOptions = function(t) {
    return sp.setOptions(t), fi.defaults = sp.defaults, Cle(fi.defaults), fi;
  };
  fi.getDefaults = fM;
  fi.defaults = jp;
  fi.use = function(...t) {
    return sp.use(...t), fi.defaults = sp.defaults, Cle(fi.defaults), fi;
  };
  fi.walkTokens = function(t, e) {
    return sp.walkTokens(t, e);
  };
  fi.parseInline = sp.parseInline;
  fi.Parser = kc;
  fi.parser = kc.parse;
  fi.Renderer = FE;
  fi.TextRenderer = bM;
  fi.Lexer = Ec;
  fi.lexer = Ec.lex;
  fi.Tokenizer = pE;
  fi.Hooks = _y;
  fi.parse = fi;
  fi.options;
  fi.setOptions;
  fi.use;
  fi.walkTokens;
  fi.parseInline;
  kc.parse;
  Ec.lex;
  const AOe = {
    name: "spoiler",
    level: "inline",
    start(t) {
      return t.indexOf("||");
    },
    tokenizer(t) {
      if (!t.startsWith("||")) return;
      const n = /^\|\|(.+?)\|\|/.exec(t);
      if (n) {
        const r = {
          type: "spoiler",
          raw: n[0],
          text: n[1],
          tokens: []
        };
        return this.lexer.inlineTokens(r.text, r.tokens), r;
      }
    },
    renderer(t) {
      const e = t.tokens || [];
      return `<span data-mx-spoiler>${this.parser.parseInline(e)}</span>`;
    }
  }, Ple = "\uE020", Mle = "\uE023";
  function IOe(t) {
    return t.replace(/(^|\n)-#( +)/g, `$1${Mle}#$2`);
  }
  function QD(t) {
    return IOe(t.replace(/\$/g, Ple));
  }
  function BOe(t, e, n, r) {
    let i = e;
    for (; i < t.length && t[i] !== `
`; ) if (t[i] === n) {
      let a = 0;
      for (; i + a < t.length && t[i + a] === n; ) a++;
      if (a >= r) return i;
      i += a;
    } else i++;
    return -1;
  }
  function POe(t, e, n, r) {
    var _a6;
    let i = e;
    for (; i <= t.length; ) {
      const a = t.indexOf(`
`, i), s = i, l = a === -1 ? t.length : a, c = t.slice(s, l), u = (_a6 = n === "`" ? /^ {0,3}(`{3,})\s*$/.exec(c) : /^ {0,3}(~{3,})\s*$/.exec(c)) == null ? void 0 : _a6[1];
      if (u && u.length >= r && u[0] === n) return {
        blockEnd: a === -1 ? t.length : a + 1,
        contentEnd: s
      };
      if (a === -1) return null;
      i = a + 1;
    }
    return null;
  }
  function MOe(t, e) {
    if (!(e === 0 || t[e - 1] === `
`)) return null;
    const r = t.slice(e), i = /^(\s{0,3})(`{3,}|~{3,})/.exec(r);
    if (!(i == null ? void 0 : i[2])) return null;
    const a = i[2], s = a.charAt(0), l = a.length, c = e + i[0].length;
    if (c < t.length && t[c] === `
`) {
      const g = c + 1, m = POe(t, g, s, l);
      if (!m) {
        const w = t.slice(g, t.length), b = QD(w);
        return {
          text: t.slice(e, g) + b,
          end: t.length
        };
      }
      const v = t.slice(g, m.contentEnd), y = QD(v);
      return {
        text: t.slice(e, g) + y + t.slice(m.contentEnd, m.blockEnd),
        end: m.blockEnd
      };
    }
    const d = BOe(t, c, s, l);
    if (d < 0) return null;
    let u = 0;
    for (; d + u < t.length && t[d + u] === s; ) u++;
    const h = t.slice(c, d), f = QD(h);
    return {
      text: t.slice(e, c) + f + t.slice(d, d + u),
      end: d + u
    };
  }
  function OOe(t, e) {
    if (t[e] !== "`") return null;
    let n = 0;
    for (; e + n < t.length && t[e + n] === "`"; ) n++;
    const r = e + n;
    let i = r;
    for (; i < t.length; ) if (t[i] === "`") {
      let a = 0;
      for (; i + a < t.length && t[i + a] === "`"; ) a++;
      if (a === n) {
        const s = t.slice(r, i), l = QD(s);
        return {
          text: t.slice(e, r) + l + t.slice(i, i + n),
          end: i + n
        };
      }
      i += a;
    } else i++;
    return null;
  }
  function LOe(t) {
    const e = t.replace(/\r\n/g, `
`);
    let n = "", r = 0;
    const i = e.length;
    for (; r < i; ) {
      if (r === 0 || e[r - 1] === `
`) {
        const s = MOe(e, r);
        if (s) {
          n += s.text, r = s.end;
          continue;
        }
      }
      if (e[r] === "`") {
        const s = OOe(e, r);
        if (s) {
          n += s.text, r = s.end;
          continue;
        }
      }
      n += e[r], r++;
    }
    return n;
  }
  function NOe(t) {
    return t.replaceAll(Ple, "$");
  }
  function zOe(t) {
    return t.replaceAll(`${Mle}#`, "-#");
  }
  const tY = "\uE021", nY = "\uE022";
  function UOe(t) {
    const e = [], n = /\$\$([^$]+)\$\$\n?/g;
    let r, i = "", a = 0;
    for (; (r = n.exec(t)) !== null; ) i += t.slice(a, r.index), e.push(r[0]), i += `${tY}${e.length - 1}${nY}`, a = r.index + r[0].length;
    return i += t.slice(a), i = i.replace(/\${2,}/g, (s) => s.replace(/\$/g, () => "\\$")), i.replace(new RegExp(`${tY}(\\d+)${nY}`, "g"), (s, l) => e[parseInt(l, 10)] ?? "");
  }
  function Ole(t) {
    return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
  }
  function Lle(t) {
    const e = t.replace(/[\u200B-\u200D\uFEFF]/g, "").trim();
    return e === "" ? true : /^\$+$/.test(e);
  }
  function VOe(t) {
    if (t.startsWith("$") && !(t.startsWith("$$") && (t.length < 3 || t.charAt(2) !== "$")) && !(t.length < 3 || /\s/.test(t.charAt(1)))) for (let e = 1; e < t.length; e++) {
      if (t.charAt(e) !== "$") continue;
      const n = t.charAt(e - 1);
      if (/\s/.test(n)) continue;
      const r = e + 1 < t.length ? t.charAt(e + 1) : "";
      if (r !== "" && /[0-9]/.test(r)) continue;
      const i = t.slice(1, e);
      if (!Lle(i) && !i.trimStart().startsWith("$$")) return {
        type: "math",
        raw: t.slice(0, e + 1),
        latex: i
      };
    }
  }
  const HOe = {
    name: "math",
    level: "inline",
    start(t) {
      return /^\$\[(?:fg|bg)\.color=/.test(t) ? -1 : t.indexOf("$");
    },
    tokenizer(t) {
      return VOe(t);
    },
    renderer(t) {
      return `<span data-mx-maths="${Ole(t.latex)}">${t.latex}</span>`;
    }
  }, $Oe = {
    name: "mathBlock",
    level: "block",
    start(t) {
      return t.indexOf("$$");
    },
    tokenizer(t) {
      var _a6;
      const e = /^\$\$([^$]+)\$\$\n?/.exec(t);
      if (e) {
        const n = ((_a6 = e[1]) == null ? void 0 : _a6.trim()) ?? "";
        return Lle(n) ? void 0 : {
          type: "mathBlock",
          raw: e[0],
          latex: n
        };
      }
    },
    renderer(t) {
      return `<div data-mx-maths="${Ole(t.latex)}">${t.latex}</div>`;
    }
  }, WOe = {
    name: "subscript",
    level: "block",
    tokenizer(t) {
      const e = /^-# +([^\n]+)/.exec(t);
      if (!e) return;
      const n = {
        type: "subscript",
        raw: e[0],
        text: e[1],
        tokens: []
      };
      return this.lexer.inlineTokens(n.text, n.tokens), n;
    },
    renderer(t) {
      const e = t.tokens || [];
      return `<sub data-md="-#">${this.parser.parseInline(e)}</sub>`;
    }
  }, Nle = "\uE000", EI = "\uE001", kI = "\uE002";
  function qOe(t, e) {
    return `${Nle}${t}${EI}${e}${kI}`;
  }
  function xM(t) {
    if (!t.startsWith("mxc://")) return false;
    try {
      const e = new URL(t);
      return !(e.protocol !== "mxc:" || !e.host || !e.pathname || e.pathname.length < 1 || e.username || e.password || e.search || e.hash);
    } catch {
      return false;
    }
  }
  const KOe = {
    name: "emoticon",
    level: "inline",
    start(t) {
      return t.indexOf("data-mx-emoticon");
    },
    tokenizer(t) {
      const n = /^<img\s+[^>]*data-mx-emoticon[^>]*(?:\/>|>(?=\s*<\/img>))/i.exec(t);
      if (!n) return;
      const r = n[0], i = /src\s*=\s*["']([^"']*)["']/i.exec(r);
      if (!i) return;
      const a = i[1];
      if (!(!a || !xM(a))) return {
        type: "emoticon",
        raw: r,
        html: r
      };
    },
    renderer(t) {
      return t.html;
    }
  };
  function GOe(t) {
    return t.replace(/<img\s+[^>]*data-mx-emoticon[^>]*>/gi, (e) => {
      const n = /src\s*=\s*["']([^"']*)["']/i.exec(e);
      if (!n) return e;
      const r = n[1];
      return !r || !xM(r) ? "" : e;
    });
  }
  function zle(t) {
    return xM(t);
  }
  const YOe = {
    name: "matrixUnderline",
    level: "inline",
    start(t) {
      return t.indexOf("__");
    },
    tokenizer(t) {
      if (!t.startsWith("__")) return;
      const n = /^__(.+?)__/.exec(t);
      if (n) {
        const r = {
          type: "matrixUnderline",
          raw: n[0],
          text: n[1],
          tokens: []
        };
        return this.lexer.inlineTokens(r.text, r.tokens), r;
      }
    },
    renderer(t) {
      const e = t.tokens || [];
      return `<u data-md="__">${this.parser.parseInline(e)}</u>`;
    }
  }, ZOe = /^\$\[(?=(?:fg\.color|bg\.color)=)/, JOe = new RegExp(`^((?:(?:fg|bg)\\.color=${Coe}\\s*)+)`);
  function XOe(t) {
    const e = t.trim();
    if (!e) return;
    const n = {}, r = e.split(/\s+/);
    for (const i of r) {
      const a = new RegExp(`^(fg|bg)\\.color=(${Coe})$`).exec(i);
      if (!a) return;
      const s = r6e(a[2]);
      if (!s) return;
      a[1] === "fg" ? n.fg = s : n.bg = s;
    }
    return n.fg !== void 0 || n.bg !== void 0 ? n : void 0;
  }
  function QOe(t) {
    const e = [];
    return t.fg && e.push(`fg.color=${t.fg.replace(/^#/, "").toLowerCase()}`), t.bg && e.push(`bg.color=${t.bg.replace(/^#/, "").toLowerCase()}`), `$[${e.join(" ")}`;
  }
  function eLe(t) {
    if (!ZOe.test(t)) return;
    const e = t.indexOf("]");
    if (e <= 2) return;
    const n = t.slice(2, e), r = JOe.exec(n);
    if (!r) return;
    const i = r[1].trimEnd(), a = n.slice(r[0].length).trimStart();
    if (!a) return;
    const s = XOe(i);
    if (s) return {
      raw: t.slice(0, e + 1),
      args: s,
      text: a,
      dataMd: `$[${i}`
    };
  }
  const tLe = {
    name: "mfmColor",
    level: "inline",
    start(t) {
      const e = t.indexOf("$[fg.color="), n = t.indexOf("$[bg.color=");
      return e === -1 ? n : n === -1 ? e : Math.min(e, n);
    },
    tokenizer(t) {
      const e = eLe(t);
      if (!e) return;
      const n = {
        type: "mfmColor",
        raw: e.raw,
        text: e.text,
        mfmArgs: e.args,
        dataMd: e.dataMd,
        tokens: []
      };
      return this.lexer.inlineTokens(e.text, n.tokens), n;
    },
    renderer(t) {
      const e = t, n = this.parser.parseInline(e.tokens ?? []), r = [
        `data-md="${e.dataMd}"`
      ];
      return e.mfmArgs.fg && r.push(`data-mx-color="${e.mfmArgs.fg}"`), e.mfmArgs.bg && r.push(`data-mx-bg-color="${e.mfmArgs.bg}"`), `<span ${r.join(" ")}>${n}</span>`;
    }
  };
  function nLe(t, e, n, r) {
    let i = e;
    for (; i < t.length && t[i] !== `
`; ) if (t[i] === n) {
      let a = 0;
      for (; i + a < t.length && t[i + a] === n; ) a++;
      if (a >= r) return i;
      i += a;
    } else i++;
    return -1;
  }
  function rLe(t, e, n, r) {
    var _a6;
    let i = e;
    for (; i <= t.length; ) {
      const a = t.indexOf(`
`, i), s = i, l = a === -1 ? t.length : a, c = t.slice(s, l), u = (_a6 = n === "`" ? /^ {0,3}(`{3,})\s*$/.exec(c) : /^ {0,3}(~{3,})\s*$/.exec(c)) == null ? void 0 : _a6[1];
      if (u && u.length >= r && u[0] === n) return {
        blockEnd: a === -1 ? t.length : a + 1,
        contentEnd: s
      };
      if (a === -1) return null;
      i = a + 1;
    }
    return null;
  }
  function iLe(t, e) {
    if (!(e === 0 || t[e - 1] === `
`)) return null;
    const r = t.slice(e), i = /^(\s{0,3})(`{3,}|~{3,})/.exec(r);
    if (!(i == null ? void 0 : i[2])) return null;
    const a = i[2], s = a.charAt(0), l = a.length, c = e + i[0].length;
    if (c < t.length && t[c] === `
`) {
      const h = c + 1, f = rLe(t, h, s, l);
      return f ? f.blockEnd : t.length;
    }
    const d = nLe(t, c, s, l);
    if (d < 0) return null;
    let u = 0;
    for (; d + u < t.length && t[d + u] === s; ) u++;
    return d + u;
  }
  function oLe(t) {
    let e = 0;
    for (; e < t.length && e < 3 && t[e] === " "; ) e++;
    return t.slice(e);
  }
  function lS(t) {
    const e = oLe(t);
    if (e.length === 0) return null;
    let n = 0;
    for (; n < e.length && e[n] === "\\"; ) n++;
    return n % 2 === 1 ? null : e.slice(n);
  }
  function aLe(t) {
    return t.length === 0 ? false : !!(/^#{1,6}(?:\s|$)/.test(t) || /^-# +/.test(t) || /^>\s/.test(t) || /^[-*+]\s/.test(t) || /^\d{1,9}\.\s/.test(t) || /^(?:`{3,}|~{3,})/.test(t) || t.startsWith("$$") || /^(?:-{3,}|\*{3,}|_{3,})\s*$/.test(t));
  }
  function wM(t, e) {
    let n = e - 1;
    for (; n >= 0 && t[n] !== `
`; ) n--;
    return t.slice(n + 1, e);
  }
  function cS(t, e) {
    const n = e + 1;
    if (n >= t.length) return "";
    const r = t.indexOf(`
`, n);
    return r === -1 ? t.slice(n) : t.slice(n, r);
  }
  function rY(t, e) {
    const n = lS(wM(t, e));
    return n === null ? false : /^>\s/.test(n);
  }
  function iY(t, e) {
    const n = lS(cS(t, e));
    return n === null ? false : n.startsWith(">");
  }
  function sLe(t, e) {
    const n = lS(cS(t, e));
    return n === null ? false : aLe(n);
  }
  function vE(t) {
    let e = 0;
    for (; e < t.length && t[e] === " "; ) e++;
    return e;
  }
  function SI(t) {
    const e = lS(t);
    return e === null ? false : /^\d{1,9}\.\s/.test(e) || /^[-*+]\s/.test(e);
  }
  function lLe(t, e) {
    const n = wM(t, e), r = cS(t, e);
    return SI(r) ? vE(r) > vE(n) : false;
  }
  function cLe(t, e) {
    const n = wM(t, e), r = cS(t, e);
    return !SI(n) || !SI(r) ? false : vE(n) === vE(r);
  }
  function dLe(t, e) {
    return rY(t, e) && iY(t, e) || cLe(t, e) || lLe(t, e) ? false : !!(sLe(t, e) || rY(t, e) && !iY(t, e));
  }
  function uLe(t) {
    const e = t.replace(/\r\n/g, `
`);
    let n = "", r = 0;
    const i = e.length;
    for (; r < i; ) {
      if (r === 0 || e[r - 1] === `
`) {
        const s = iLe(e, r);
        if (s !== null) {
          n += e.slice(r, s), r = s;
          continue;
        }
      }
      if (e[r] === `
` && (r === 0 || e[r - 1] !== `
`) && (r + 1 >= i || e[r + 1] !== `
`) && dLe(e, r)) {
        n += `

`, r += 1;
        continue;
      }
      n += e[r], r += 1;
    }
    return n;
  }
  const Ule = /* @__PURE__ */ new Set([
    "a",
    "blockquote",
    "br",
    "code",
    "del",
    "details",
    "div",
    "em",
    "h1",
    "h2",
    "h3",
    "h4",
    "h5",
    "h6",
    "hr",
    "img",
    "li",
    "mx-reply",
    "ol",
    "p",
    "pre",
    "s",
    "span",
    "strong",
    "sub",
    "summary",
    "table",
    "tbody",
    "td",
    "th",
    "thead",
    "tr",
    "u",
    "ul"
  ]), hLe = /* @__PURE__ */ new Set([
    "br",
    "hr",
    "img"
  ]), Vle = (t) => Ule.has(t.toLowerCase()), fLe = /<\/?([a-zA-Z][\da-zA-Z-]*)(?:\s(?:[^>"']|"[^"]*"|'[^']*')*)?\s*\/?>/g, Hle = "\uE000", $le = "\uE001", mLe = (t) => t.replaceAll("<", "&lt;").replaceAll(">", "&gt;"), gLe = (t, e) => {
    let n = 0;
    for (let r = e - 1; r >= 0 && t[r] === "\\"; r -= 1) n += 1;
    return n % 2 === 1;
  }, pLe = (t, e) => hLe.has(t.toLowerCase()) || /\/>\s*$/.test(e), FLe = (t) => {
    const e = [], n = new RegExp(fLe.source, "g");
    let r;
    for (; (r = n.exec(t)) !== null; ) {
      const i = r[0], a = r[1].toLowerCase(), l = i.startsWith("</") ? "close" : pLe(a, i) ? "void" : "open";
      e.push({
        index: r.index,
        length: i.length,
        raw: i,
        tagName: a,
        kind: l
      });
    }
    return e;
  }, vLe = (t, e) => {
    const n = /* @__PURE__ */ new Set(), r = [];
    for (const i of e) {
      if (gLe(t, i.index)) continue;
      if (!Vle(i.tagName)) {
        n.add(i.index);
        continue;
      }
      if (i.kind === "void") continue;
      if (i.kind === "open") {
        r.push({
          tagName: i.tagName,
          index: i.index
        });
        continue;
      }
      const a = r[r.length - 1];
      a && a.tagName === i.tagName ? r.pop() : n.add(i.index);
    }
    for (const { index: i } of r) n.add(i);
    return n;
  }, _Le = (t, e, n) => {
    if (n.size === 0) return t;
    let r = "", i = 0;
    for (const a of e) r += t.slice(i, a.index), r += n.has(a.index) ? mLe(a.raw) : a.raw, i = a.index + a.length;
    return r + t.slice(i);
  }, yLe = (t) => {
    const e = [], n = (a) => `${Hle}CODE${a}${$le}`;
    let r = t.replace(/```[^\n`]*\n[\s\S]*?```/g, (a) => (e.push(a), n(e.length - 1)));
    r = r.replace(/```[\s\S]*?```/g, (a) => (e.push(a), n(e.length - 1)));
    const i = rS(r);
    for (let a = i.length - 1; a >= 0; a -= 1) {
      const [s, l] = i[a], c = r.slice(s, l);
      e.push(c), r = `${r.slice(0, s)}${n(e.length - 1)}${r.slice(l)}`;
    }
    return {
      masked: r,
      chunks: e
    };
  }, bLe = (t, e) => t.replace(new RegExp(`${Hle}CODE(\\d+)${$le}`, "g"), (n, r) => e[parseInt(r, 10)] ?? ""), xLe = (t) => {
    const e = FLe(t);
    if (e.length === 0) return t;
    const n = vLe(t, e);
    return _Le(t, e, n);
  }, oY = (t) => {
    const { masked: e, chunks: n } = yLe(t), r = xLe(e);
    return bLe(r, n);
  }, wLe = fi.use({
    breaks: true,
    extensions: [
      tLe,
      YOe,
      AOe,
      HOe,
      $Oe,
      WOe,
      KOe
    ]
  }), DLe = (t) => {
    const e = {
      "&lt;": "<",
      "&gt;": ">",
      "&amp;": "&",
      "&quot;": '"',
      "&#39;": "'",
      "&nbsp;": " "
    };
    let n = t;
    for (const [r, i] of Object.entries(e)) n = n.split(r).join(i);
    return n;
  }, CLe = "MATRIXTORAWLINKTOKEN", ELe = /^-?\d+$/, kLe = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), SLe = (t) => {
    const e = /* @__PURE__ */ new Map();
    let n = 0;
    return {
      shielded: t.replace(new RegExp("(?<!\\]\\()https?:\\/\\/matrix\\.to\\/[^\\s<)]+", "gi"), (i) => {
        const a = `${CLe}${n++}X`;
        return e.set(a, i), a;
      }),
      placeholders: e
    };
  }, jLe = (t, e) => {
    let n = t;
    const r = [
      ...e.keys()
    ].toSorted((i, a) => a.length - i.length);
    for (const i of r) {
      const a = e.get(i);
      a && (n = n.split(i).join(kLe(a)));
    }
    return n;
  }, aY = (t) => {
    const n = t.trim().match(/^<p\b[^>]*>([\s\S]*)<\/p>$/i);
    if (!n) return t;
    const r = n[1] ?? "";
    return /<\/p>/i.test(r) ? t : r;
  }, TLe = (t) => {
    const e = t.trim(), n = e.match(/^<p\b[^>]*>([\s\S]*?)<\/p>/i);
    if (!n) return null;
    const r = n[1] ?? "";
    if (/<\/p>/i.test(r)) return null;
    const i = e.slice(n[0].length).trimStart();
    return i.length > 0 ? `${r}${i}` : r;
  };
  function sY(t, e) {
    const n = DLe(t), r = $Me(n), i = oY(r), a = GOe(i), s = uLe(a), { shielded: l, placeholders: c } = SLe(s), d = UOe(LOe(l)), u = wLe.parse(d), h = HMe(u), f = oY(h);
    zD.addHook("afterSanitizeAttributes", (b) => {
      if (b.tagName === "OL") {
        const j = b.getAttribute("start");
        j !== null && !ELe.test(j) && b.removeAttribute("start");
      }
    });
    const g = zD.sanitize(f, {
      ALLOWED_TAGS: [
        ...Ule
      ],
      ALLOWED_ATTR: [
        "href",
        "src",
        "alt",
        "title",
        "height",
        "width",
        "data-mx-emoticon",
        "data-mx-spoiler",
        "data-mx-maths",
        "data-md",
        "data-mx-color",
        "data-mx-bg-color",
        "data-lang",
        "class",
        "start",
        "type",
        "open"
      ],
      ADD_ATTR: [
        "height",
        "width"
      ],
      ADD_URI_SAFE_ATTR: [
        "start"
      ],
      FORCE_BODY: false,
      ALLOWED_URI_REGEXP: /^(?:https?|ftp|mailto|magnet|mxc):/i
    });
    zD.removeHook("afterSanitizeAttributes");
    const v = zOe(NOe(g)).replace(/<img\b([^>]*\bdata-mx-emoticon\b[^>]*)>/gi, (b, j) => /\bheight\s*=/i.test(j) ? b : `<img${j} height="32">`), w = jLe(v, c).replace(/<li>(<p><\/p>)?<\/li>/gi, "<li><br></li>");
    return (e == null ? void 0 : e.emote) ? TLe(w) ?? aY(w) : aY(w);
  }
  var RLe = [
    "animateMotion",
    "animateTransform",
    "clipPath",
    "feBlend",
    "feColorMatrix",
    "feComponentTransfer",
    "feComposite",
    "feConvolveMatrix",
    "feDiffuseLighting",
    "feDisplacementMap",
    "feDropShadow",
    "feFlood",
    "feFuncA",
    "feFuncB",
    "feFuncG",
    "feFuncR",
    "feGaussianBlur",
    "feImage",
    "feMerge",
    "feMergeNode",
    "feMorphology",
    "feOffset",
    "fePointLight",
    "feSpecularLighting",
    "feSpotLight",
    "feTile",
    "feTurbulence",
    "foreignObject",
    "linearGradient",
    "radialGradient",
    "textPath"
  ], ALe = RLe.reduce(function(t, e) {
    return t[e.toLowerCase()] = e, t;
  }, {}), Wle = "\r", ILe = new RegExp(Wle, "g"), qle = "__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(), "__"), BLe = new RegExp(qle, "g"), Di;
  (function(t) {
    t.Root = "root", t.Text = "text", t.Directive = "directive", t.Comment = "comment", t.Script = "script", t.Style = "style", t.Tag = "tag", t.CDATA = "cdata", t.Doctype = "doctype";
  })(Di || (Di = {}));
  function PLe(t) {
    return t.type === Di.Tag || t.type === Di.Script || t.type === Di.Style;
  }
  Di.Root;
  Di.Text;
  Di.Directive;
  Di.Comment;
  Di.Script;
  Di.Style;
  Di.Tag;
  Di.CDATA;
  Di.Doctype;
  let Kle = class {
    constructor() {
      this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
    }
    get parentNode() {
      return this.parent;
    }
    set parentNode(e) {
      this.parent = e;
    }
    get previousSibling() {
      return this.prev;
    }
    set previousSibling(e) {
      this.prev = e;
    }
    get nextSibling() {
      return this.next;
    }
    set nextSibling(e) {
      this.next = e;
    }
    cloneNode(e = false) {
      return Xle(this, e);
    }
  };
  class DM extends Kle {
    constructor(e) {
      super(), this.data = e;
    }
    get nodeValue() {
      return this.data;
    }
    set nodeValue(e) {
      this.data = e;
    }
  }
  class Gle extends DM {
    constructor() {
      super(...arguments), this.type = Di.Text;
    }
    get nodeType() {
      return 3;
    }
  }
  class Yle extends DM {
    constructor() {
      super(...arguments), this.type = Di.Comment;
    }
    get nodeType() {
      return 8;
    }
  }
  class Zle extends DM {
    constructor(e, n) {
      super(n), this.name = e, this.type = Di.Directive;
    }
    get nodeType() {
      return 1;
    }
  }
  class CM extends Kle {
    constructor(e) {
      super(), this.children = e;
    }
    get firstChild() {
      var e;
      return (e = this.children[0]) !== null && e !== void 0 ? e : null;
    }
    get lastChild() {
      return this.children.length > 0 ? this.children[this.children.length - 1] : null;
    }
    get childNodes() {
      return this.children;
    }
    set childNodes(e) {
      this.children = e;
    }
  }
  class MLe extends CM {
    constructor() {
      super(...arguments), this.type = Di.CDATA;
    }
    get nodeType() {
      return 4;
    }
  }
  let OLe = class extends CM {
    constructor() {
      super(...arguments), this.type = Di.Root;
    }
    get nodeType() {
      return 9;
    }
  }, Jle = class extends CM {
    constructor(e, n, r = [], i = e === "script" ? Di.Script : e === "style" ? Di.Style : Di.Tag) {
      super(r), this.name = e, this.attribs = n, this.type = i;
    }
    get nodeType() {
      return 1;
    }
    get tagName() {
      return this.name;
    }
    set tagName(e) {
      this.name = e;
    }
    get attributes() {
      return Object.keys(this.attribs).map((e) => {
        var n, r;
        return {
          name: e,
          value: this.attribs[e],
          namespace: (n = this["x-attribsNamespace"]) === null || n === void 0 ? void 0 : n[e],
          prefix: (r = this["x-attribsPrefix"]) === null || r === void 0 ? void 0 : r[e]
        };
      });
    }
  };
  function LLe(t) {
    return PLe(t);
  }
  function NLe(t) {
    return t.type === Di.CDATA;
  }
  function zLe(t) {
    return t.type === Di.Text;
  }
  function ULe(t) {
    return t.type === Di.Comment;
  }
  function VLe(t) {
    return t.type === Di.Directive;
  }
  function HLe(t) {
    return t.type === Di.Root;
  }
  function Xle(t, e = false) {
    let n;
    if (zLe(t)) n = new Gle(t.data);
    else if (ULe(t)) n = new Yle(t.data);
    else if (LLe(t)) {
      const r = e ? A5(t.children) : [], i = new Jle(t.name, {
        ...t.attribs
      }, r);
      r.forEach((a) => a.parent = i), t.namespace != null && (i.namespace = t.namespace), t["x-attribsNamespace"] && (i["x-attribsNamespace"] = {
        ...t["x-attribsNamespace"]
      }), t["x-attribsPrefix"] && (i["x-attribsPrefix"] = {
        ...t["x-attribsPrefix"]
      }), n = i;
    } else if (NLe(t)) {
      const r = e ? A5(t.children) : [], i = new MLe(r);
      r.forEach((a) => a.parent = i), n = i;
    } else if (HLe(t)) {
      const r = e ? A5(t.children) : [], i = new OLe(r);
      r.forEach((a) => a.parent = i), t["x-mode"] && (i["x-mode"] = t["x-mode"]), n = i;
    } else if (VLe(t)) {
      const r = new Zle(t.name, t.data);
      t["x-name"] != null && (r["x-name"] = t["x-name"], r["x-publicId"] = t["x-publicId"], r["x-systemId"] = t["x-systemId"]), n = r;
    } else throw new Error(`Not implemented yet: ${t.type}`);
    return n.startIndex = t.startIndex, n.endIndex = t.endIndex, t.sourceCodeLocation != null && (n.sourceCodeLocation = t.sourceCodeLocation), n;
  }
  function A5(t) {
    const e = t.map((n) => Xle(n, true));
    for (let n = 1; n < e.length; n++) e[n].prev = e[n - 1], e[n - 1].next = e[n];
    return e;
  }
  function $Le(t) {
    return ALe[t];
  }
  function WLe(t) {
    for (var e = {}, n = 0, r = t.length; n < r; n++) {
      var i = t[n];
      e[i.name] = i.value;
    }
    return e;
  }
  function qLe(t) {
    t = t.toLowerCase();
    var e = $Le(t);
    return e || t;
  }
  function Ow(t, e) {
    var n = "<" + e, r = t.toLowerCase().indexOf(n);
    if (r === -1) return false;
    var i = t[r + n.length];
    return i === ">" || i === " " || i === "	" || i === `
` || i === "\r" || i === "/";
  }
  function KLe(t) {
    return t.replace(ILe, qle);
  }
  function GLe(t) {
    return t.replace(BLe, Wle);
  }
  function Qle(t, e, n) {
    var r, i, a, s;
    e === void 0 && (e = null);
    for (var l = [], c, d = 0, u = t.length; d < u; d++) {
      var h = t[d];
      switch (h.nodeType) {
        case 1: {
          var f = qLe(h.nodeName);
          c = new Jle(f, WLe(h.attributes)), c.children = Qle(f === "template" ? h.content.childNodes : h.childNodes, c);
          break;
        }
        case 3:
          c = new Gle(GLe((r = h.nodeValue) !== null && r !== void 0 ? r : ""));
          break;
        case 8:
          c = new Yle((i = h.nodeValue) !== null && i !== void 0 ? i : "");
          break;
        default:
          continue;
      }
      var g = (a = l[d - 1]) !== null && a !== void 0 ? a : null;
      g && (g.next = c), c.parent = e, c.prev = g, c.next = null, l.push(c);
    }
    return n && (c = new Zle(n.substring(0, n.indexOf(" ")).toLowerCase(), n), c.next = (s = l[0]) !== null && s !== void 0 ? s : null, c.parent = e, l.unshift(c), l[1] && (l[1].prev = l[0])), l;
  }
  var lY = "html", Lw = "head", C0 = "body", YLe = /<([a-zA-Z]+[0-9]?)/, _E = function(t, e) {
    throw new Error("This browser does not support `document.implementation.createHTMLDocument`");
  }, jI = function(t, e) {
    throw new Error("This browser does not support `DOMParser.prototype.parseFromString`");
  }, cY = typeof window == "object" && window.DOMParser;
  if (typeof cY == "function") {
    var ZLe = new cY(), JLe = "text/html";
    jI = function(t, e) {
      return e && (t = "<".concat(e, ">").concat(t, "</").concat(e, ">")), ZLe.parseFromString(t, JLe);
    }, _E = jI;
  }
  if (typeof document == "object" && document.implementation) {
    var Nw = document.implementation.createHTMLDocument();
    _E = function(t, e) {
      if (e) {
        var n = Nw.documentElement.querySelector(e);
        return n && (n.innerHTML = t), Nw;
      }
      return Nw.documentElement.innerHTML = t, Nw;
    };
  }
  var zw = typeof document == "object" && document.createElement("template"), TI;
  zw && zw.content && (TI = function(t) {
    return zw.innerHTML = t, zw.content.childNodes;
  });
  var dY = function() {
    return document.createDocumentFragment().childNodes;
  };
  function XLe(t) {
    var e, n, r, i, a, s;
    t = KLe(t);
    var l = YLe.exec(t), c = (e = l == null ? void 0 : l[1]) === null || e === void 0 ? void 0 : e.toLowerCase();
    switch (c) {
      case lY: {
        var d = jI(t);
        if (!Ow(t, Lw)) {
          var u = d.querySelector(Lw);
          (n = u == null ? void 0 : u.parentNode) === null || n === void 0 || n.removeChild(u);
        }
        if (!Ow(t, C0)) {
          var u = d.querySelector(C0);
          (r = u == null ? void 0 : u.parentNode) === null || r === void 0 || r.removeChild(u);
        }
        return d.querySelectorAll(lY);
      }
      case Lw:
      case C0: {
        var h = _E(t).querySelectorAll(c);
        return Ow(t, C0) && Ow(t, Lw) ? (a = (i = h[0].parentNode) === null || i === void 0 ? void 0 : i.childNodes) !== null && a !== void 0 ? a : dY() : h;
      }
      default: {
        if (TI) return TI(t);
        var u = _E(t, C0).querySelector(C0);
        return (s = u == null ? void 0 : u.childNodes) !== null && s !== void 0 ? s : dY();
      }
    }
  }
  var QLe = /<(![a-zA-Z\s]+)>/;
  function eNe(t) {
    if (typeof t != "string") throw new TypeError("First argument must be a string");
    if (!t) return [];
    var e = QLe.exec(t), n = e ? e[1] : void 0;
    return Qle(XLe(t), null, n);
  }
  var ds;
  (function(t) {
    t.Root = "root", t.Text = "text", t.Directive = "directive", t.Comment = "comment", t.Script = "script", t.Style = "style", t.Tag = "tag", t.CDATA = "cdata", t.Doctype = "doctype";
  })(ds || (ds = {}));
  function tNe(t) {
    return t.type === ds.Tag || t.type === ds.Script || t.type === ds.Style;
  }
  ds.Root;
  ds.Text;
  ds.Directive;
  ds.Comment;
  ds.Script;
  ds.Style;
  ds.Tag;
  ds.CDATA;
  ds.Doctype;
  function pl(t) {
    return tNe(t);
  }
  function Fb(t) {
    return t.type === ds.Text;
  }
  const ece = "    ";
  function vb(t) {
    const e = eNe(t);
    return nNe(e).trim();
  }
  function uY(t) {
    return !t || !pl(t) ? false : [
      "p",
      "div",
      "h1",
      "h2",
      "h3",
      "h4",
      "h5",
      "h6",
      "ul",
      "ol",
      "li",
      "blockquote",
      "pre",
      "hr",
      "table",
      "details",
      "summary"
    ].includes(t.name.toLowerCase());
  }
  function nNe(t) {
    const e = t.filter((r, i) => {
      if (Fb(r) && /^\s*$/.test(r.data)) {
        const a = t[i - 1], s = t[i + 1];
        if ((!a || uY(a)) && (!s || uY(s))) return false;
      }
      return true;
    }), n = [];
    for (let r = 0; r < e.length; r += 1) {
      const i = e[r], a = e[r - 1];
      if (r > 0 && a && pl(a) && pl(i)) {
        const s = a.name.toLowerCase(), l = i.name.toLowerCase();
        (s === "p" && l === "p" || s === "blockquote" && l === "blockquote") && n.push(`
`);
      }
      n.push(Ga(i));
    }
    return n.join("");
  }
  function Ga(t, e = 0, n = false) {
    if (Fb(t)) return n ? t.data : hM(t.data);
    if (!pl(t)) return "";
    const r = t.name.toLowerCase();
    if (r === "span") {
      if (t.attribs["data-mx-spoiler"] !== void 0) return vNe(t, e, n);
      if (t.attribs["data-mx-maths"] !== void 0) return fY(t, "inline");
      if (t.attribs["data-md"] !== void 0) {
        const i = t.attribs["data-md"];
        return typeof i == "string" && i.startsWith("$[") ? hY(t, e, n) : _Ne(t, e, n);
      }
      if (t.attribs["data-mx-color"] !== void 0 || t.attribs["data-mx-bg-color"] !== void 0) return hY(t, e, n);
    }
    if (r === "div" && t.attribs["data-mx-maths"] !== void 0) return fY(t, "block");
    switch (r) {
      case "h1":
      case "h2":
      case "h3":
      case "h4":
      case "h5":
      case "h6":
        return dNe(t, r, e, n);
      case "p":
        return uNe(t, e, n);
      case "strong":
      case "b":
        return Uw(t, "**", e, n);
      case "em":
      case "i":
        return Uw(t, "*", e, n);
      case "u": {
        const i = t.attribs["data-md"];
        return Uw(t, i ?? "__");
      }
      case "s":
      case "del":
        return Uw(t, "~~", e, n);
      case "code":
        return lNe(t, e);
      case "pre":
        return cNe(t, e);
      case "blockquote":
        return hNe(t, e, n);
      case "ul":
        return fNe(t, e, n);
      case "ol":
        return mNe(t, e, n);
      case "li":
        return gNe(t, e, n);
      case "a":
        return FNe(t, e, n);
      case "br":
        return `
`;
      case "hr":
        return `---
`;
      case "sub":
        return pNe(t, e, n);
      case "img":
        return yNe(t);
      default:
        return Vle(r) ? tce(t, e, n) : iNe(t, e, n);
    }
  }
  function rNe(t) {
    return Object.entries(t).map(([e, n]) => ` ${e}="${n}"`).join("");
  }
  function iNe(t, e = 0, n = false) {
    const r = Tp(t.children, e, n), i = rNe(t.attribs), a = `<${t.name}${i}>${r}</${t.name}>`;
    return hM(a);
  }
  function oNe(t, e = 0, n = false) {
    const r = tce(t, e, n), i = Object.entries(t.attribs).map(([a, s]) => ` ${a}="${s}"`).join("");
    return `<${t.name}${i}>${r}</${t.name}>`;
  }
  function tce(t, e = 0, n = false) {
    return Tp(t.children, e, n);
  }
  function aNe(t) {
    const e = t.trim();
    return e === "<" || e === "&lt;" || e === "&#60;" || e === "&#x3c;";
  }
  function sNe(t) {
    const e = t.trim();
    return e === ">" || e === "&gt;" || e === "&#62;" || e === "&#x3e;";
  }
  function Tp(t, e = 0, n = false) {
    const r = [];
    for (let i = 0; i < t.length; i += 1) {
      const a = t[i], s = t[i + 1], l = t[i + 2];
      if (a && s && l && Fb(a) && aNe(a.data) && pl(s) && s.name.toLowerCase() === "a" && Fb(l) && sNe(l.data)) {
        const c = s.attribs.href ?? "", d = s.children.map((u) => Ga(u, e, n)).join("");
        zc(c) ? r.push(`[${d}](${c})`) : r.push(`[${d}](<${c}>)`), i += 2;
        continue;
      }
      a && r.push(Ga(a, e, n));
    }
    return r.join("");
  }
  function Uw(t, e, n = 0, r = false) {
    const i = Tp(t.children, n, r);
    return `${e}${i}${e}`;
  }
  function lNe(t, e = 0) {
    const n = t.children.map((r) => Ga(r, e, true)).join("");
    return t.parent && pl(t.parent) && t.parent.name === "pre" ? n : `\`${n}\``;
  }
  function cNe(t, e = 0) {
    const n = t.children.find((l) => pl(l) && l.name === "code"), i = ((n == null ? void 0 : n.attribs.class) ?? "").match(/language-(\S+)/), a = i ? i[1] : "", s = n ? n.children.map((l) => Ga(l, e, true)).join("") : t.children.map((l) => Ga(l, e, true)).join("");
    return `\`\`\`${a}
${s}\`\`\`
`;
  }
  function dNe(t, e, n = 0, r = false) {
    const i = e.charAt(1), a = Tp(t.children, n, r);
    return `${"#".repeat(parseInt(i, 10))} ${a}
`;
  }
  function uNe(t, e = 0, n = false) {
    return `${Tp(t.children, e, n)}
`;
  }
  function nce(t, e, n) {
    const r = [], i = (s) => {
      r.push(s);
    }, a = (s) => {
      for (const l of s.split(`
`)) i(l);
    };
    for (const s of t.children) {
      if (Fb(s)) {
        if (/^\s*$/.test(s.data)) continue;
        const c = n ? s.data : hM(s.data);
        a(c);
        continue;
      }
      if (!pl(s)) continue;
      const l = s.name.toLowerCase();
      l === "p" ? a(Tp(s.children, e, n)) : l === "br" ? i("") : l === "blockquote" ? r.push(...nce(s, e, n)) : a(Ga(s, e, n).trimEnd());
    }
    return r;
  }
  function hNe(t, e = 0, n = false) {
    const r = t.attribs["data-md"] ? `${t.attribs["data-md"]} ` : "> ";
    return `${nce(t, e, n).map((s) => s.length === 0 ? r.trimEnd() : `${r}${s}`).join(`
`)}
`;
  }
  function rce(t, e, n = false) {
    const r = [], i = [];
    t.children.forEach((s) => {
      pl(s) && (s.name === "ul" || s.name === "ol") ? i.push(Ga(s, e + 1, n)) : pl(s) && s.name === "p" ? r.push(s.children.map((l) => Ga(l, e, n)).join("")) : r.push(Ga(s, e, n));
    });
    let a = r.join("").trim();
    return i.length > 0 && (a += `
` + i.join("").trimEnd()), a;
  }
  function fNe(t, e = 0, n = false) {
    const r = t.attribs["data-md"] || "-", i = ece.repeat(e);
    return t.children.filter((s) => pl(s) && s.name === "li").map((s) => {
      const l = rce(s, e, n);
      return `${i}${r} ${l}`;
    }).join(`
`) + `
`;
  }
  function mNe(t, e = 0, n = false) {
    const r = t.attribs["data-md"] || "1.", [i] = r.match(/^\*|-$/) ?? [], a = i || (r.endsWith(".") ? r : `${r}.`), s = ece.repeat(e);
    return t.children.filter((c) => pl(c) && c.name === "li").map((c, d) => {
      let u = a;
      if (!i) {
        const f = parseInt(t.attribs.start || r, 10);
        isNaN(f) || (u = `${f + d}.`);
      }
      const h = rce(c, e, n);
      return `${s}${u} ${h}`;
    }).join(`
`) + `
`;
  }
  function gNe(t, e = 0, n = false) {
    return `- ${t.children.map((i) => pl(i) && i.name === "p" ? i.children.map((a) => Ga(a, e, n)).join("") : Ga(i, e, n)).join("")}
`;
  }
  function pNe(t, e = 0, n = false) {
    return `-# ${t.children.map((i) => Ga(i, e, n)).join("")}
`;
  }
  function FNe(t, e = 0, n = false) {
    const r = t.attribs.href ?? "";
    return `[${t.children.map((a) => Ga(a, e, n)).join("")}](${r})`;
  }
  function hY(t, e = 0, n = false) {
    const r = Tp(t.children, e, n), i = t.attribs["data-md"];
    if (typeof i == "string" && i.startsWith("$[")) return `${i} ${r}]`;
    const a = {}, s = t.attribs["data-mx-color"], l = t.attribs["data-mx-bg-color"];
    return typeof s == "string" && np(s) && (a.fg = s), typeof l == "string" && np(l) && (a.bg = l), a.fg !== void 0 || a.bg !== void 0 ? `${QOe(a)} ${r}]` : oNe(t, e, n);
  }
  function vNe(t, e = 0, n = false) {
    return `||${t.children.map((i) => Ga(i, e, n)).join("")}||`;
  }
  function fY(t, e) {
    const n = t.attribs["data-mx-maths"] ?? "";
    return e === "block" ? `$$${n}$$` : `$${n}$`;
  }
  function _Ne(t, e = 0, n = false) {
    const r = t.attribs["data-md"] ?? "", i = t.children.map((a) => Ga(a, e, n)).join("");
    return `${r}${i}${r}`;
  }
  function yNe(t) {
    if (t.attribs["data-mx-emoticon"] === void 0) return "";
    const e = t.attribs.src ?? "", n = t.attribs.alt ?? t.attribs.title ?? "";
    if (!zle(e)) return "";
    const r = n.replace(/^:|:$/g, "");
    return r ? qOe(e, r) : "";
  }
  function bNe(t) {
    return t = t.replace(/<h([1-6])([^>]*)>/g, (e, n, r) => {
      if (r.includes("data-md")) return `<h${n}${r}>`;
      const i = "#".repeat(parseInt(n, 10));
      return `<h${n} data-md="${i}"${r}>`;
    }), t = t.replace(/<blockquote([^>]*)>/g, (e, n) => n.includes("data-md") ? `<blockquote${n}>` : `<blockquote data-md=">"${n}>`), t = t.replace(/<pre([^>]*)><code([^>]*)>/g, (e, n, r) => n.includes("data-md") ? `<pre${n}><code${r}>` : `<pre data-md="\`\`\`"${n}><code${r}>`), t = t.replace(/<hr([^>]*)>/g, (e, n) => n.includes("data-md") ? `<hr${n}>` : `<hr data-md="---"${n}>`), t = t.replace(/<sub([^>]*)>/g, (e, n) => n.includes("data-md") ? `<sub${n}>` : `<sub data-md="-#"${n}>`), t = t.replace(/<ol([^>]*)>/g, (e, n) => n.includes("data-md") ? `<ol${n}>` : `<ol data-md="1."${n}>`), t = t.replace(/<ul([^>]*)>/g, (e, n) => n.includes("data-md") ? `<ul${n}>` : `<ul data-md="-"${n}>`), t = t.replace(/<strong([^>]*)>([^<]*)<\/strong>/g, (e, n, r) => n.includes("data-md") ? `<strong${n}>${r}</strong>` : `<strong data-md="**"${n}>${r}</strong>`), t = t.replace(/<b([^>]*)>([^<]*)<\/b>/g, (e, n, r) => n.includes("data-md") ? `<b${n}>${r}</b>` : `<b data-md="**"${n}>${r}</b>`), t = t.replace(/<em([^>]*)>([^<]*)<\/em>/g, (e, n, r) => n.includes("data-md") ? `<em${n}>${r}</em>` : `<em data-md="*"${n}>${r}</em>`), t = t.replace(/<i([^>]*)>([^<]*)<\/i>/g, (e, n, r) => n.includes("data-md") ? `<i${n}>${r}</i>` : `<i data-md="*"${n}>${r}</i>`), t = t.replace(/<u([^>]*)>([^<]*)<\/u>/g, (e, n, r) => n.includes("data-md") ? `<u${n}>${r}</u>` : `<u data-md="__"${n}>${r}</u>`), t = t.replace(/<s([^>]*)>([^<]*)<\/s>/g, (e, n, r) => n.includes("data-md") ? `<s${n}>${r}</s>` : `<s data-md="~~"${n}>${r}</s>`), t = t.replace(/<del([^>]*)>([^<]*)<\/del>/g, (e, n, r) => n.includes("data-md") ? `<del${n}>${r}</del>` : `<del data-md="~~"${n}>${r}</del>`), t = t.replace(/<span([^>]*data-mx-color="(#[0-9a-fA-F]{6})"[^>]*)>([^<]*)<\/span>/g, (e, n, r, i) => {
      if (n.includes("data-md")) return e;
      const a = /data-mx-bg-color="(#[0-9a-fA-F]{6})"/.exec(n), s = r, l = a == null ? void 0 : a[1], c = [
        `fg.color=${s.replace(/^#/, "").toLowerCase()}`
      ];
      return l && c.push(`bg.color=${l.replace(/^#/, "").toLowerCase()}`), `<span data-md="$[${c.join(" ")}"${n}>${i}</span>`;
    }), t = t.replace(/<span([^>]*data-mx-bg-color="(#[0-9a-fA-F]{6})"[^>]*)>([^<]*)<\/span>/g, (e, n, r, i) => n.includes("data-md") || n.includes("data-mx-color") ? e : `<span data-md="$[bg.color=${r.replace(/^#/, "").toLowerCase()}"${n}>${i}</span>`), t = t.replace(/<code([^>]*)>([^<]*)<\/code>/g, (e, n, r) => n.includes("data-md") ? `<code${n}>${r}</code>` : r.includes(`
`) ? `<code${n}>${r}</code>` : `<code data-md="\`"${n}>${r}</code>`), t;
  }
  const xNe = (t) => Va(t.text), wNe = (t, e) => {
    const n = t.trim();
    if (!n || n.includes("]")) return e;
    for (let r = 0; r < n.length; r++) if (n.charCodeAt(r) <= 31) return e;
    return n;
  }, DNe = (t, e) => {
    const n = _n(t) ?? t;
    if (!e) return n;
    const r = gr(e, t);
    return wNe(r ?? "", n);
  }, CNe = (t, e, n) => {
    switch (t.type) {
      case Cr.Paragraph:
        return `${e}<br/>`;
      case Cr.Mention: {
        let r = t.id;
        t.eventId && (r += `/${t.eventId}`), t.viaServers && t.viaServers.length > 0 && (r += `?${t.viaServers.map((a) => `via=${a}`).join("&")}`);
        const i = `${jc}#/${r}`;
        return t.name === "@room" ? `[@room](${encodeURI(i)})` : co(t.id) ? `[${DNe(t.id, n.room)}](${encodeURI(i)})` : Va(i);
      }
      case Cr.Emoticon:
        return t.key.startsWith("mxc://") ? `<img data-mx-emoticon src="${t.key}" alt="${Va(t.shortcode)}" title="${Va(t.shortcode)}" height="32" />` : Va(t.key);
      case Cr.Link:
        return zc(t.href) ? Va(t.href) : `<a href="${encodeURI(t.href)}">${e}</a>`;
      case Cr.Command:
        return `/${Va(t.command)}`;
      default:
        return e;
    }
  }, lp = (t, e) => {
    let n = "";
    const r = (a, s, l) => {
      var _a6;
      if ("type" in a && a.type === Cr.Paragraph) {
        let d = lp(a, e);
        if (d = d.replace(/<br\/>$/, `
`).replace(/^(\\*)&gt;/, "$1>"), e.stripNickname && e.nickNameReplacement && ((_a6 = e.nickNameReplacement) == null ? void 0 : _a6.keys().forEach((u) => {
          const h = e.nickNameReplacement.get(u) ?? "";
          d = d.replaceAll(u, h);
        })), n += d, s === l.length - 1) {
          const u = sY(n, {
            emote: e.forEmote
          });
          return bNe(u);
        }
        return "";
      }
      const c = sY(n, {
        emote: e.forEmote
      });
      return n = "", `${c}${lp(a, e)}`;
    };
    if (Array.isArray(t)) return t.map((a, s, l) => r(a, s, l)).join("");
    if (Zo.isText(t)) return xNe(t);
    const i = t.children.map((a, s, l) => r(a, s, l)).join("");
    return CNe(t, i, e);
  }, ENe = (t, e) => {
    switch (t.type) {
      case Cr.Paragraph:
        return `${e}
`;
      case Cr.Mention:
        return t.name === "@room" ? t.name : t.id;
      case Cr.Emoticon:
        return t.key.startsWith("mxc://") ? `:${t.shortcode}:` : t.key;
      case Cr.Link:
        return `[${e}](${t.href})`;
      case Cr.Command:
        return `/${t.command}`;
      default:
        return e;
    }
  }, kNe = /\|\|.+?\|\|/g, EM = "(https?:\\/\\/.[A-Za-z0-9-._~:/?#[\\()@!$&'*+,;%=]+)", yE = new RegExp(`\\(?(${EM})\\)?`, "g"), ice = new RegExp(`<(${EM})>`, "g"), SNe = new RegExp(`\\|\\|(${EM})\\|\\|`, "g"), Hl = (t, e = false, n) => {
    if (Array.isArray(t)) return t.map((i) => Hl(i, e, n)).join("");
    if (Zo.isText(t)) {
      let { text: i } = t;
      return i = i.replaceAll(kNe, "[Spoiler]"), i = i.replaceAll(ice, "$1"), e && n && (n == null ? void 0 : n.keys().forEach((a) => {
        const s = n.get(a) ?? "";
        i = i.replaceAll(a, s);
      })), i;
    }
    const r = t.children.map((i) => Hl(i, e, n)).join("");
    return ENe(t, r);
  }, RI = (t) => {
    if (Array.isArray(t)) return t.map(RI).join("");
    if (Zo.isText(t)) return t.text;
    const e = t.children.map(RI).join("");
    switch (t.type) {
      case Cr.Paragraph:
        return `${e}
`;
      case Cr.Link:
        return `[${e}](${t.href})`;
      case Cr.Emoticon:
        return t.key.startsWith("mxc://") ? `:${t.shortcode}:` : t.key;
      case Cr.Mention:
        return t.name === "@room" ? t.name : t.id;
      case Cr.Command:
        return `/${t.command}`;
      default:
        return e;
    }
  }, AI = (t, e) => t.replaceAll("<br/>", `
`) === Va(e), _b = (t) => t.replaceAll(/<br\/>$/g, "").trim(), mY = (t, e) => {
    const n = ob(t), i = new RegExp(`^(?:\\s+)?(?:<p>)?(?:\\/${n})(?:[^\\S
]+)?`, "i").exec(e);
    return i ? e.slice(i[0].length) : e;
  }, II = (t, e, n) => {
    const r = {
      room: false,
      users: /* @__PURE__ */ new Set()
    }, i = (a) => {
      if (!Zo.isText(a)) {
        if (a.type === Cr.Mention) {
          a.name === "@room" && (r.room = true), co(a.id) && a.id !== t.getUserId() && r.users.add(a.id);
          return;
        }
        a.children.forEach(i);
      }
    };
    return n.children.forEach(i), r;
  }, oce = (t) => {
    const e = RI(t), n = /* @__PURE__ */ new Set(), r = e.matchAll(yE), i = [
      ...e.matchAll(ice)
    ].map((c) => c[1]), a = [
      ...e.matchAll(SNe)
    ].map((c) => c[1]), s = /* @__PURE__ */ new Set([
      ...i,
      ...a
    ]), l = rS(e);
    for (const c of r) {
      let d = c[1];
      const u = c[0], h = c.index;
      u.startsWith("(") && u.endsWith(")") ? d = u.substring(1, u.length - 1) : u.startsWith("(") ? d = u.substring(1) : u.endsWith("/)") && (d = u.substring(0, u.length - 1)), !s.has(d) && (lM(h, h + u.length, l) || d.startsWith(jc) || n.add(d));
    }
    return Array.from(n);
  }, gY = /\[((?:[^\]\]\\]|\\.)*)\]\((?:<([^>]+)>|([^)]+))\)/g, jNe = (t, e, n) => {
    const r = e.trim();
    if (!G2e(r)) return null;
    const i = N7(r);
    if (i) return Ig(i, fle(i, n), HPe(i, n));
    const a = ek(r);
    if (a) return Ig(a.roomIdOrAlias, NG(a.roomIdOrAlias, t, n), zG(a.roomIdOrAlias, n), a.eventId, a.viaServers);
    const s = QE(r);
    return s ? Ig(s.roomIdOrAlias, NG(s.roomIdOrAlias, t, n), zG(s.roomIdOrAlias, n), void 0, s.viaServers) : null;
  }, pY = (t, e) => {
    const n = rS(t), r = [];
    let i = 0;
    gY.lastIndex = 0;
    let a;
    for (; (a = gY.exec(t)) !== null; ) {
      const s = a.index, l = s + a[0].length;
      if (lM(s, l, n)) continue;
      const c = a[1] ?? "", d = (a[2] ?? a[3] ?? "").trim();
      s > i && r.push({
        text: t.slice(i, s)
      });
      const u = jNe(c, d, e);
      u ? r.push(u) : r.push({
        text: a[0]
      }), i = l;
    }
    return i < t.length && r.push({
      text: t.slice(i)
    }), r.length > 0 ? r : [
      {
        text: ""
      }
    ];
  }, I5 = new RegExp(`${Nle}([^${EI}]+)${EI}([^${kI}]+)${kI}`, "g");
  function TNe(t) {
    const e = [];
    for (const n of t) {
      if ("type" in n) {
        e.push(n);
        continue;
      }
      const r = e[e.length - 1];
      r && !("type" in r) ? r.text += n.text : e.push({
        ...n
      });
    }
    return e.length > 0 ? e : [
      {
        text: ""
      }
    ];
  }
  function RNe(t, e) {
    I5.lastIndex = 0;
    const n = [];
    let r = 0, i;
    for (; (i = I5.exec(t)) !== null; ) {
      i.index > r && n.push(...pY(t.slice(r, i.index), e));
      const [, a, s] = i;
      a && s && zle(a) ? n.push(YF(a, s)) : s && n.push({
        text: `:${s.replace(/^:|:$/g, "")}:`
      }), r = I5.lastIndex;
    }
    return r < t.length && n.push(...pY(t.slice(r), e)), TNe(n);
  }
  const jf = (t, e) => t.split(`
`).map((r) => ({
    type: Cr.Paragraph,
    children: RNe(r, e)
  }));
  var ANe = "Composer_floatingEditor__mdjff80", INe = "Composer_floatingToolbar__mdjff81";
  function Ys({ text: t, shortCode: e }) {
    return o.jsx(pr, {
      style: {
        padding: ee.space.S300
      },
      children: o.jsxs(E, {
        gap: "200",
        direction: "Column",
        alignItems: "Center",
        children: [
          o.jsx(D, {
            align: "Center",
            children: t
          }),
          e && o.jsx(Rn, {
            as: "kbd",
            radii: "300",
            size: "500",
            children: o.jsx(D, {
              size: "T200",
              align: "Center",
              children: e
            })
          })
        ]
      })
    });
  }
  function E0({ marker: t, icon: e, tooltip: n }) {
    const r = m3(), i = () => {
      xle(r, t), Bt.focus(r);
    };
    return o.jsx(ar, {
      tooltip: n,
      delay: 500,
      children: (a) => o.jsx(Oe, {
        ref: a,
        variant: "SurfaceVariant",
        onClick: i,
        size: "400",
        radii: "300",
        children: o.jsx(Q, {
          size: "200",
          src: e
        })
      })
    });
  }
  function Vw({ prefix: t, icon: e, tooltip: n }) {
    const r = m3(), i = () => {
      G0(r, t), Bt.focus(r);
    };
    return o.jsx(ar, {
      tooltip: n,
      delay: 500,
      children: (a) => o.jsx(Oe, {
        ref: a,
        variant: "SurfaceVariant",
        onClick: i,
        size: "400",
        radii: "300",
        children: o.jsx(Q, {
          size: "200",
          src: e
        })
      })
    });
  }
  function BNe() {
    const t = m3(), [e, n] = p.useState(), r = U2() ? uF.Command : "Ctrl", i = (s) => {
      n(void 0), G0(t, s), Bt.focus(t);
    }, a = (s) => {
      n(s.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: e,
      offset: 5,
      position: "Top",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => n(void 0),
          clickOutsideDeactivates: true,
          isKeyForward: (s) => s.key === "ArrowDown" || s.key === "ArrowRight",
          isKeyBackward: (s) => s.key === "ArrowUp" || s.key === "ArrowLeft",
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          style: {
            padding: ee.space.S100
          },
          children: o.jsxs(E, {
            gap: "100",
            children: [
              o.jsx(ar, {
                tooltip: o.jsx(Ys, {
                  text: "Heading 1",
                  shortCode: `${r} + 1`
                }),
                delay: 500,
                children: (s) => o.jsx(Oe, {
                  ref: s,
                  onClick: () => i("# "),
                  size: "400",
                  radii: "300",
                  children: o.jsx(Q, {
                    size: "200",
                    src: q.Heading1
                  })
                })
              }),
              o.jsx(ar, {
                tooltip: o.jsx(Ys, {
                  text: "Heading 2",
                  shortCode: `${r} + 2`
                }),
                delay: 500,
                children: (s) => o.jsx(Oe, {
                  ref: s,
                  onClick: () => i("## "),
                  size: "400",
                  radii: "300",
                  children: o.jsx(Q, {
                    size: "200",
                    src: q.Heading2
                  })
                })
              }),
              o.jsx(ar, {
                tooltip: o.jsx(Ys, {
                  text: "Heading 3",
                  shortCode: `${r} + 3`
                }),
                delay: 500,
                children: (s) => o.jsx(Oe, {
                  ref: s,
                  onClick: () => i("### "),
                  size: "400",
                  radii: "300",
                  children: o.jsx(Q, {
                    size: "200",
                    src: q.Heading3
                  })
                })
              })
            ]
          })
        })
      }),
      children: o.jsxs(Oe, {
        style: {
          width: "unset"
        },
        variant: "SurfaceVariant",
        onClick: a,
        size: "400",
        radii: "300",
        "aria-haspopup": "menu",
        "aria-expanded": !!e,
        children: [
          o.jsx(Q, {
            size: "200",
            src: q.Heading1
          }),
          o.jsx(Q, {
            size: "200",
            src: q.ChevronBottom
          })
        ]
      })
    });
  }
  function PNe() {
    const t = U2() ? uF.Command : "Ctrl";
    return o.jsx(E, {
      className: `${kMe} ${INe}`,
      children: o.jsx(dn, {
        direction: "Horizontal",
        size: "0",
        children: o.jsxs(E, {
          className: SMe,
          alignItems: "Center",
          gap: "300",
          children: [
            o.jsxs(E, {
              shrink: "No",
              gap: "100",
              children: [
                o.jsx(E0, {
                  marker: sf["mod+b"],
                  icon: q.Bold,
                  tooltip: o.jsx(Ys, {
                    text: "Bold",
                    shortCode: `${t} + B`
                  })
                }),
                o.jsx(E0, {
                  marker: sf["mod+i"],
                  icon: q.Italic,
                  tooltip: o.jsx(Ys, {
                    text: "Italic",
                    shortCode: `${t} + I`
                  })
                }),
                o.jsx(E0, {
                  marker: sf["mod+u"],
                  icon: q.Underline,
                  tooltip: o.jsx(Ys, {
                    text: "Underline",
                    shortCode: `${t} + U`
                  })
                }),
                o.jsx(E0, {
                  marker: sf["mod+s"],
                  icon: q.Strike,
                  tooltip: o.jsx(Ys, {
                    text: "Strike Through",
                    shortCode: `${t} + S`
                  })
                }),
                o.jsx(E0, {
                  marker: sf["mod+["],
                  icon: q.Code,
                  tooltip: o.jsx(Ys, {
                    text: "Inline Code",
                    shortCode: `${t} + [`
                  })
                }),
                o.jsx(E0, {
                  marker: sf["mod+h"],
                  icon: q.EyeBlind,
                  tooltip: o.jsx(Ys, {
                    text: "Spoiler",
                    shortCode: `${t} + H`
                  })
                })
              ]
            }),
            o.jsx(nr, {
              variant: "SurfaceVariant",
              direction: "Vertical",
              style: {
                height: He(12)
              }
            }),
            o.jsxs(E, {
              shrink: "No",
              gap: "100",
              children: [
                o.jsx(Vw, {
                  prefix: K0["mod+'"],
                  icon: q.BlockQuote,
                  tooltip: o.jsx(Ys, {
                    text: "Block Quote",
                    shortCode: `${t} + '`
                  })
                }),
                o.jsx(Vw, {
                  prefix: K0["mod+;"],
                  icon: q.BlockCode,
                  tooltip: o.jsx(Ys, {
                    text: "Block Code",
                    shortCode: `${t} + ;`
                  })
                }),
                o.jsx(Vw, {
                  prefix: K0["mod+7"],
                  icon: q.OrderList,
                  tooltip: o.jsx(Ys, {
                    text: "Ordered List",
                    shortCode: `${t} + 7`
                  })
                }),
                o.jsx(Vw, {
                  prefix: K0["mod+8"],
                  icon: q.UnorderList,
                  tooltip: o.jsx(Ys, {
                    text: "Unordered List",
                    shortCode: `${t} + 8`
                  })
                }),
                o.jsx(BNe, {})
              ]
            })
          ]
        })
      })
    });
  }
  function dS({ variant: t }) {
    const [e] = Fe(ge, "editorToolbar"), [n, r] = Fe(ge, "composerToolbarOpen");
    return p.useEffect(() => {
      e || r(false);
    }, [
      e,
      r
    ]), e ? o.jsx(Oe, {
      variant: t,
      size: "300",
      radii: "300",
      title: n ? "Hide formatting toolbar" : "Show formatting toolbar",
      "aria-pressed": n,
      "aria-label": n ? "Hide formatting toolbar" : "Show formatting toolbar",
      onClick: () => r(!n),
      children: o.jsx(Q, {
        src: n ? q.AlphabetUnderline : q.Alphabet
      })
    }) : null;
  }
  function uS() {
    const [t] = Fe(ge, "editorToolbar"), [e] = Fe(ge, "composerToolbarOpen");
    return !t || !e ? null : o.jsxs("div", {
      children: [
        o.jsx(nr, {
          variant: "SurfaceVariant",
          size: "300"
        }),
        o.jsx(PNe, {})
      ]
    });
  }
  function MNe() {
    return o.jsx(D, {
      children: o.jsx(nse, {})
    });
  }
  function ss({ reason: t }) {
    return o.jsx(D, {
      children: o.jsx(rE, {
        reason: t
      })
    });
  }
  function ONe({ body: t }) {
    return o.jsx(D, {
      children: o.jsx(lF, {
        body: t
      })
    });
  }
  function zf({ body: t }) {
    return o.jsx(D, {
      children: o.jsx(rse, {
        body: t
      })
    });
  }
  const kM = (t, e) => {
    const n = typeof t.body == "string" ? t.body : "", r = typeof t.formatted_body == "string" ? t.formatted_body : void 0, a = Zg(n).match(yE);
    let s = a ? [
      ...new Set(a)
    ] : void 0;
    if (s = s == null ? void 0 : s.map((c) => c.startsWith("(") && c.endsWith(")") && c.substring(1, c.length - 1) || c.startsWith("(") && c.substring(1) || c.endsWith("/)") && c.substring(0, c.length - 1) || c), s && r) {
      const u = r.replace(/<pre[^>]*>.*?<\/pre>/gs, "").replace(/<code[^>]*>.*?<\/code>/gs, "").replace(/<[^a][^>]*>/g, "").match(yE);
      let h = u ? [
        ...new Set(u)
      ] : [];
      h = h.map((g) => g.startsWith("(") && g.endsWith(")") && g.substring(1, g.length - 1) || g.startsWith("(") && g.substring(1) || g.endsWith("/)") && g.substring(0, g.length - 1) || g);
      const f = new Set(h);
      s = s.filter((g) => f.has(g) && !g.startsWith(jc));
    }
    let l = t[DA];
    try {
      l = l == null ? void 0 : l.filter((c) => !!(s == null ? void 0 : s.includes(c.matched_url))), e && l && (s = l.map((c) => c.matched_url));
    } catch {
      s = [];
    }
    return {
      urls: s,
      bundleContent: l
    };
  };
  function B5({ edited: t, content: e, renderBody: n, renderUrlsPreview: r, renderBundledPreviews: i, style: a }) {
    var _a6;
    const [s] = Fe(ge, "jumboEmojiSize"), l = typeof e.body == "string" ? e.body : "", c = typeof e.formatted_body == "string" ? e.formatted_body : void 0, d = p.useMemo(() => c == null ? void 0 : c.replace(/<li>(<p><\/p>)?<\/li>/gi, "<li><br></li>"), [
      c
    ]), u = p.useMemo(() => Zg(l), [
      l
    ]), h = p.useMemo(() => MAe(d ?? c ?? l), [
      d,
      c,
      l
    ]), f = p.useMemo(() => typeof e[CA] == "object", [
      e
    ]), g = p.useMemo(() => d == null ? void 0 : d.replace(/<strong[^>]*data-mx-profile-fallback[^>]*>(.*?):\s*<\/strong>/i, ""), [
      d
    ]), m = p.useMemo(() => {
      var _a7;
      return !u || u.length >= 500 ? false : ((_a7 = g ?? d ?? c) == null ? void 0 : _a7.match(/^(<img[^>]*data-mx-emoticon[^>]*\/>){1,20}$/i)) ? true : !(!Pk.test(u) || u.includes(":") && !(c && /<img[^>]*>/i.test(c)));
    }, [
      g,
      d,
      u,
      c
    ]), { urls: v, bundleContent: y } = kM(e, r);
    return ((_a6 = e[Vy]) == null ? void 0 : _a6.has_fallback) ? o.jsxs(o.Fragment, {
      children: [
        o.jsxs(F1, {
          preWrap: typeof d != "string",
          style: a,
          jumboEmoji: m ? s : "none",
          children: [
            n({
              body: u,
              customBody: g
            }),
            t && o.jsx(t2, {})
          ]
        }),
        r && v && v.length > 0 && r(v) || i && y && y.length > 0 && i(y)
      ]
    }) : f && h ? o.jsxs(F1, {
      preWrap: typeof h != "string",
      style: a,
      children: [
        n({
          body: u,
          customBody: h
        }),
        t && o.jsx(t2, {}),
        r && v && v.length > 0 && r(v) || i && y && y.length > 0 && i(y)
      ]
    }) : o.jsxs(o.Fragment, {
      children: [
        o.jsxs(F1, {
          preWrap: typeof d != "string",
          jumboEmoji: m ? s : "none",
          style: a,
          children: [
            n({
              body: u,
              customBody: typeof d == "string" ? d : void 0
            }),
            t && o.jsx(t2, {})
          ]
        }),
        r && v && v.length > 0 && r(v) || i && y && y.length > 0 && i(y)
      ]
    });
  }
  function LNe({ displayName: t, edited: e, content: n, renderBody: r, renderUrlsPreview: i, renderBundledPreviews: a }) {
    const { body: s, formatted_body: l } = n, c = p.useMemo(() => typeof l == "string" ? l.replace(/<li>(<p><\/p>)?<\/li>/gi, "<li><br></li>") : void 0, [
      l
    ]), [d] = Fe(ge, "jumboEmojiSize");
    if (typeof s != "string") return o.jsx(zf, {
      body: typeof l == "string" ? l : void 0
    });
    const u = Zg(s), h = Pk.test(u), { urls: f, bundleContent: g } = kM(n, i);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsxs(F1, {
          emote: true,
          preWrap: typeof c != "string",
          jumboEmoji: h ? d : "none",
          children: [
            o.jsx("b", {
              children: `${t} `
            }),
            r({
              body: u,
              customBody: typeof c == "string" ? c : void 0
            }),
            e && o.jsx(t2, {})
          ]
        }),
        i && f && f.length > 0 && i(f) || a && g && g.length > 0 && a(g)
      ]
    });
  }
  function NNe({ edited: t, content: e, renderBody: n, renderUrlsPreview: r, renderBundledPreviews: i }) {
    const { body: a, formatted_body: s } = e, l = p.useMemo(() => typeof s == "string" ? s.replace(/<li>(<p><\/p>)?<\/li>/gi, "<li><br></li>") : void 0, [
      s
    ]), [c] = Fe(ge, "jumboEmojiSize");
    if (typeof a != "string") return o.jsx(zf, {
      body: typeof s == "string" ? s : void 0
    });
    const d = Zg(a), u = Pk.test(d), { urls: h, bundleContent: f } = kM(e, r);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsxs(F1, {
          notice: true,
          preWrap: typeof l != "string",
          jumboEmoji: u ? c : "none",
          children: [
            n({
              body: d,
              customBody: typeof l == "string" ? l : void 0
            }),
            t && o.jsx(t2, {})
          ]
        }),
        r && h && h.length > 0 && r(h) || i && f && f.length > 0 && i(f)
      ]
    });
  }
  function zNe({ content: t, renderImageContent: e, outlined: n }) {
    var _a6;
    const r = t == null ? void 0 : t.info, i = ((_a6 = t.file) == null ? void 0 : _a6.url) ?? t.url;
    if (typeof i != "string") return o.jsx(zf, {
      body: t.body ?? t.filename
    });
    const a = 400, s = (r == null ? void 0 : r.w) ?? a, l = (r == null ? void 0 : r.h) ?? a, c = (r == null ? void 0 : r.w) && (r == null ? void 0 : r.h) ? `${s} / ${l}` : void 0, d = l > s ? Math.round(a * (s / l)) : a;
    return o.jsx(c3, {
      style: {
        flexGrow: 1,
        flexShrink: 0,
        width: He(d)
      },
      outlined: n,
      children: o.jsx(LF, {
        style: {
          aspectRatio: c,
          maxHeight: He(a)
        },
        children: e({
          body: t.filename || "Image",
          info: r,
          mimeType: r == null ? void 0 : r.mimetype,
          url: i,
          encInfo: t.file,
          markedAsSpoiler: t[bk],
          spoilerReason: t[nie]
        })
      })
    });
  }
  function UNe({ content: t, renderAsFile: e, renderVideoContent: n, outlined: r }) {
    var _a6;
    const i = t == null ? void 0 : t.info, a = ((_a6 = t.file) == null ? void 0 : _a6.url) ?? t.url, s = MP((i == null ? void 0 : i.mimetype) ?? "");
    if (!i || !s.startsWith("video") || typeof a != "string") return a ? e() : o.jsx(zf, {
      body: t.body ?? t.filename
    });
    const l = Math.min(GE(i.w || 400, 400, i.h || 400), 400), c = t.filename ?? t.body ?? "Video";
    return o.jsxs(c3, {
      style: {
        flexGrow: 1,
        flexShrink: 0
      },
      outlined: r,
      children: [
        o.jsx(d3, {
          children: o.jsx(VP, {
            body: c,
            mimeType: s,
            after: o.jsx(ase, {
              filename: c,
              url: a,
              mimeType: s,
              encInfo: t.file
            })
          })
        }),
        o.jsx(LF, {
          style: {
            height: He(l < 48 ? 48 : l)
          },
          children: n({
            body: t.body || "Video",
            info: i,
            mimeType: s,
            url: a,
            encInfo: t.file,
            markedAsSpoiler: t[bk],
            spoilerReason: t[nie]
          })
        })
      ]
    });
  }
  const VNe = (t, e) => {
    const n = e == null ? void 0 : e.duration;
    if (typeof n == "number" && Number.isFinite(n) && n > 0) return n;
    const r = t["org.matrix.msc3245.voice.v2"];
    if (r && typeof r == "object") {
      const a = r.duration;
      if (typeof a == "number" && Number.isFinite(a) && a > 0) return a * 1e3;
    }
    const i = t["org.matrix.msc1767.audio"];
    if (i && typeof i == "object") {
      const a = i.duration;
      if (typeof a == "number" && Number.isFinite(a) && a > 0) return a;
    }
  };
  function HNe({ content: t, renderAsFile: e, renderAudioContent: n, outlined: r }) {
    var _a6;
    const i = t == null ? void 0 : t.info, a = ((_a6 = t.file) == null ? void 0 : _a6.url) ?? t.url, s = MP((i == null ? void 0 : i.mimetype) ?? "");
    if (!i || !s.startsWith("audio") || typeof a != "string") return a ? e() : o.jsx(zf, {
      body: t.body ?? t.filename
    });
    const l = t.filename ?? t.body ?? "Audio", c = VNe(t, i), d = c !== void 0 ? {
      ...i,
      duration: c
    } : i;
    return o.jsxs(c3, {
      outlined: r,
      children: [
        o.jsx(d3, {
          children: o.jsx(VP, {
            body: l,
            mimeType: s,
            after: o.jsx(ase, {
              filename: l,
              url: a,
              mimeType: s,
              encInfo: t.file
            })
          })
        }),
        o.jsx(LF, {
          children: o.jsx(Noe, {
            children: n({
              info: d,
              mimeType: s,
              url: a,
              encInfo: t.file
            })
          })
        })
      ]
    });
  }
  function $Ne({ content: t, renderFileContent: e, outlined: n }) {
    var _a6;
    const r = t == null ? void 0 : t.info, i = ((_a6 = t.file) == null ? void 0 : _a6.url) ?? t.url;
    return typeof i != "string" ? o.jsx(zf, {
      body: t.body ?? t.filename
    }) : o.jsxs(c3, {
      outlined: n,
      children: [
        o.jsx(d3, {
          children: o.jsx(VP, {
            body: t.filename ?? t.body ?? "Unnamed File",
            mimeType: (r == null ? void 0 : r.mimetype) ?? sF
          })
        }),
        o.jsx(LF, {
          children: o.jsx(Noe, {
            children: e({
              body: t.filename ?? t.body ?? "File",
              info: r ?? {},
              mimeType: (r == null ? void 0 : r.mimetype) ?? sF,
              url: i,
              encInfo: t.file
            })
          })
        })
      ]
    });
  }
  function WNe({ content: t }) {
    const e = t.geo_uri;
    if (typeof e != "string") return o.jsx(zf, {
      body: typeof t.body == "string" ? t.body : void 0
    });
    const n = Eye(e);
    return n ? o.jsxs(E, {
      direction: "Column",
      alignItems: "Start",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "T400",
          children: e
        }),
        o.jsx(Qe, {
          as: "a",
          size: "400",
          href: `https://www.openstreetmap.org/?mlat=${n.latitude}&mlon=${n.longitude}#map=16/${n.latitude}/${n.longitude}`,
          target: "_blank",
          rel: "noreferrer noopener",
          variant: "Primary",
          radii: "Pill",
          before: o.jsx(Q, {
            src: q.External,
            size: "50"
          }),
          children: o.jsx(D, {
            size: "B300",
            children: "Open Location"
          })
        })
      ]
    }) : o.jsx(zf, {});
  }
  function cp({ content: t, renderImageContent: e }) {
    var _a6;
    const n = t == null ? void 0 : t.info, r = ((_a6 = t.file) == null ? void 0 : _a6.url) ?? t.url;
    if (typeof r != "string") return o.jsx(rse, {
      body: t.body
    });
    const i = GE((n == null ? void 0 : n.w) || 152, 152, (n == null ? void 0 : n.h) || 152);
    return o.jsx(LF, {
      style: {
        height: He(i < 48 ? 48 : i),
        width: He(152)
      },
      children: e({
        body: t.body || "Sticker",
        info: n,
        mimeType: n == null ? void 0 : n.mimetype,
        url: r,
        encInfo: t.file
      })
    });
  }
  const qNe = (t) => {
    const e = /* @__PURE__ */ new Map();
    return t.forEach(({ term: n, definition: r }) => {
      const i = n.trim();
      i && e.set(i.toLowerCase(), r);
    }), e;
  }, P5 = (t, e) => {
    if (e.size === 0) return [
      {
        id: "txt-0",
        text: t
      }
    ];
    const r = [
      ...e.keys()
    ].toSorted((l, c) => c.length - l.length).map((l) => l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), i = new RegExp(`\\b(${r.join("|")})\\b`, "gi"), a = [];
    let s = 0;
    return Array.from(t.matchAll(i)).forEach((l) => {
      const c = l.index;
      c > s && a.push({
        id: `txt-${a.length}`,
        text: t.slice(s, c)
      }), a.push({
        id: `txt-${a.length}`,
        text: l[0],
        termKey: l[0].toLowerCase()
      }), s = c + l[0].length;
    }), s < t.length && a.push({
      id: `txt-${a.length}`,
      text: t.slice(s)
    }), a.length > 0 ? a : [
      {
        id: "txt-0",
        text: t
      }
    ];
  }, ace = /* @__PURE__ */ new Map(), sce = p.createContext(ace), SM = () => p.useContext(sce), KNe = (t) => {
    const e = be(), n = Ze(vi), [r, i] = Nk();
    return vl(e, p.useCallback((a) => {
      if (a.getType() !== Pn.RoomAbbreviations) return;
      const s = a.getRoomId();
      s && (s === t.roomId || sa(n, t.roomId).has(s)) && i();
    }, [
      t.roomId,
      n,
      i
    ])), p.useMemo(() => {
      var _a6;
      const s = Array.from(sa(n, t.roomId)).flatMap((d) => {
        var _a7;
        const u = e.getRoom(d);
        if (!u) return [];
        const h = (_a7 = ni(u, Pn.RoomAbbreviations)) == null ? void 0 : _a7.getContent();
        return Array.isArray(h == null ? void 0 : h.entries) ? h.entries : [];
      }), l = (_a6 = ni(t, Pn.RoomAbbreviations)) == null ? void 0 : _a6.getContent(), c = Array.isArray(l == null ? void 0 : l.entries) ? l.entries : [];
      return s.length === 0 && c.length === 0 ? ace : qNe([
        ...s,
        ...c
      ]);
    }, [
      e,
      n,
      t,
      r
    ]);
  };
  function GNe(t, e) {
    const n = rF(t);
    return e ? ip(e, n) : n;
  }
  function FY(t, e, n, r) {
    return o.jsx(nF, {
      options: e,
      children: GNe(t, n)
    }, r);
  }
  function lce(t, e, n) {
    if (e.size === 0) return [
      {
        id: "txt-0",
        text: t
      }
    ];
    const r = yoe(t, n).filter((l) => l.isLink);
    if (r.length === 0) return P5(t, e);
    const i = [];
    let a = 0;
    if (r.forEach(({ start: l, end: c }) => {
      l > a && P5(t.slice(a, l), e).forEach(({ text: d, termKey: u }) => {
        i.push({
          text: d,
          termKey: u
        });
      }), i.push({
        text: t.slice(l, c)
      }), a = c;
    }), a < t.length && P5(t.slice(a), e).forEach(({ text: l, termKey: c }) => {
      i.push({
        text: l,
        termKey: c
      });
    }), i.length === 0) return [
      {
        id: "txt-0",
        text: t
      }
    ];
    const s = i;
    for (let l = 0; l < s.length; l += 1) s[l].id = `txt-${l}`;
    return s;
  }
  function cce({ text: t, definition: e }) {
    const [n, r] = p.useState(), i = (c) => {
      r((d) => d ? void 0 : c.getBoundingClientRect());
    }, a = (c) => {
      c.stopPropagation(), i(c.currentTarget);
    }, s = (c) => {
      c.key !== "Enter" && c.key !== " " || (c.preventDefault(), c.stopPropagation(), i(c.currentTarget));
    };
    p.useEffect(() => {
      if (!n) return;
      const c = () => r(void 0);
      return document.addEventListener("click", c, {
        once: true
      }), () => document.removeEventListener("click", c);
    }, [
      n
    ]);
    const l = o.jsx(pr, {
      style: {
        maxWidth: He(250)
      },
      children: o.jsx(D, {
        size: "T200",
        children: e
      })
    });
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(ar, {
          position: "Top",
          tooltip: l,
          children: (c) => o.jsx("abbr", {
            ref: c,
            onClick: a,
            onKeyDown: s,
            role: "button",
            tabIndex: 0,
            style: {
              textDecoration: "underline dotted",
              cursor: "help"
            },
            children: t
          })
        }),
        n && o.jsx(ln, {
          anchor: n,
          position: "Top",
          align: "Center",
          content: l,
          children: null
        })
      ]
    });
  }
  function dce(t, e) {
    if (t.size !== 0) return function(r, i) {
      const a = lce(r, t, e);
      if (a.some((s) => s.termKey !== void 0)) return o.jsx(o.Fragment, {
        children: a.map((s) => s.termKey !== void 0 ? o.jsx(cce, {
          text: s.text,
          definition: t.get(s.termKey) ?? ""
        }, s.id) : i(s.text, s.id))
      });
    };
  }
  function hS({ body: t, customBody: e, highlightRegex: n, htmlReactParserOptions: r, linkifyOpts: i }) {
    const a = SM();
    if (e) return Zd(Lk(e), r);
    if (t === "") return o.jsx(ise, {});
    if (a.size > 0) {
      const s = lce(t, a, i);
      if (s.some((l) => l.termKey !== void 0)) return o.jsx(o.Fragment, {
        children: s.map((l) => {
          if (l.termKey !== void 0) {
            const c = a.get(l.termKey) ?? "";
            return o.jsx(cce, {
              text: l.text,
              definition: c
            }, l.id);
          }
          return FY(l.text, i, n, l.id);
        })
      });
    }
    return FY(t, i, n);
  }
  const YNe = () => {
    const t = vn([]);
    return vn((e) => e(t), (e, n, r) => {
      const i = e(t), a = Array.isArray(r.item) ? r.item : [
        r.item
      ];
      if (r.type === "DELETE") {
        n(t, i.filter((s) => !a.includes(s)));
        return;
      }
      if (r.type === "PUT") {
        n(t, [
          ...i,
          ...a
        ]);
        return;
      }
      r.type === "REPLACE" && n(t, i.map((s) => s === r.item ? r.replacement : s));
    });
  }, ZNe = Gf(YNe), BI = Hke(), JNe = () => vn([]), XNe = Gf(() => JNe()), QNe = () => vn(void 0), mF = Gf(() => QNe()), uce = p.createContext(null), eze = uce.Provider;
  function hce() {
    const t = p.useContext(uce);
    if (!t) throw new Error("Media configs are not provided!");
    return t;
  }
  function k0(t, e, n) {
    let r = n.initialDeps ?? [], i, a = true;
    function s() {
      var l, c, d;
      let u;
      n.key && ((l = n.debug) != null && l.call(n)) && (u = Date.now());
      const h = t();
      if (!(h.length !== r.length || h.some((m, v) => r[v] !== m))) return i;
      r = h;
      let g;
      if (n.key && ((c = n.debug) != null && c.call(n)) && (g = Date.now()), i = e(...h), n.key && ((d = n.debug) != null && d.call(n))) {
        const m = Math.round((Date.now() - u) * 100) / 100, v = Math.round((Date.now() - g) * 100) / 100, y = v / 16, w = (b, j) => {
          for (b = String(b); b.length < j; ) b = " " + b;
          return b;
        };
        console.info(`%c\u23F1 ${w(v, 5)} /${w(m, 5)} ms`, `
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0, Math.min(120 - 120 * y, 120))}deg 100% 31%);`, n == null ? void 0 : n.key);
      }
      return (n == null ? void 0 : n.onChange) && !(a && n.skipInitialOnChange) && n.onChange(i), a = false, i;
    }
    return s.updateDeps = (l) => {
      r = l;
    }, s;
  }
  function vY(t, e) {
    if (t === void 0) throw new Error("Unexpected undefined");
    return t;
  }
  const tze = (t, e) => Math.abs(t - e) < 1.01, nze = (t, e, n) => {
    let r;
    return function(...i) {
      t.clearTimeout(r), r = t.setTimeout(() => e.apply(this, i), n);
    };
  }, _Y = (t) => {
    const { offsetWidth: e, offsetHeight: n } = t;
    return {
      width: e,
      height: n
    };
  }, rze = (t) => t, ize = (t) => {
    const e = Math.max(t.startIndex - t.overscan, 0), n = Math.min(t.endIndex + t.overscan, t.count - 1), r = [];
    for (let i = e; i <= n; i++) r.push(i);
    return r;
  }, oze = (t, e) => {
    const n = t.scrollElement;
    if (!n) return;
    const r = t.targetWindow;
    if (!r) return;
    const i = (s) => {
      const { width: l, height: c } = s;
      e({
        width: Math.round(l),
        height: Math.round(c)
      });
    };
    if (i(_Y(n)), !r.ResizeObserver) return () => {
    };
    const a = new r.ResizeObserver((s) => {
      const l = () => {
        const c = s[0];
        if (c == null ? void 0 : c.borderBoxSize) {
          const d = c.borderBoxSize[0];
          if (d) {
            i({
              width: d.inlineSize,
              height: d.blockSize
            });
            return;
          }
        }
        i(_Y(n));
      };
      t.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
    });
    return a.observe(n, {
      box: "border-box"
    }), () => {
      a.unobserve(n);
    };
  }, yY = {
    passive: true
  }, bY = typeof window > "u" ? true : "onscrollend" in window, aze = (t, e) => {
    const n = t.scrollElement;
    if (!n) return;
    const r = t.targetWindow;
    if (!r) return;
    let i = 0;
    const a = t.options.useScrollendEvent && bY ? () => {
    } : nze(r, () => {
      e(i, false);
    }, t.options.isScrollingResetDelay), s = (u) => () => {
      const { horizontal: h, isRtl: f } = t.options;
      i = h ? n.scrollLeft * (f && -1 || 1) : n.scrollTop, a(), e(i, u);
    }, l = s(true), c = s(false);
    n.addEventListener("scroll", l, yY);
    const d = t.options.useScrollendEvent && bY;
    return d && n.addEventListener("scrollend", c, yY), () => {
      n.removeEventListener("scroll", l), d && n.removeEventListener("scrollend", c);
    };
  }, sze = (t, e, n) => {
    if (e == null ? void 0 : e.borderBoxSize) {
      const r = e.borderBoxSize[0];
      if (r) return Math.round(r[n.options.horizontal ? "inlineSize" : "blockSize"]);
    }
    return t[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
  }, lze = (t, { adjustments: e = 0, behavior: n }, r) => {
    var i, a;
    const s = t + e;
    (a = (i = r.scrollElement) == null ? void 0 : i.scrollTo) == null || a.call(i, {
      [r.options.horizontal ? "left" : "top"]: s,
      behavior: n
    });
  };
  class cze {
    constructor(e) {
      this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = false, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = false, this.lanesSettling = false, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
        var n, r, i;
        return ((i = (r = (n = this.targetWindow) == null ? void 0 : n.performance) == null ? void 0 : r.now) == null ? void 0 : i.call(r)) ?? Date.now();
      }, this.observer = /* @__PURE__ */ (() => {
        let n = null;
        const r = () => n || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : n = new this.targetWindow.ResizeObserver((i) => {
          i.forEach((a) => {
            const s = () => {
              this._measureElement(a.target, a);
            };
            this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(s) : s();
          });
        }));
        return {
          disconnect: () => {
            var i;
            (i = r()) == null || i.disconnect(), n = null;
          },
          observe: (i) => {
            var a;
            return (a = r()) == null ? void 0 : a.observe(i, {
              box: "border-box"
            });
          },
          unobserve: (i) => {
            var a;
            return (a = r()) == null ? void 0 : a.unobserve(i);
          }
        };
      })(), this.range = null, this.setOptions = (n) => {
        Object.entries(n).forEach(([r, i]) => {
          typeof i > "u" && delete n[r];
        }), this.options = {
          debug: false,
          initialOffset: 0,
          overscan: 1,
          paddingStart: 0,
          paddingEnd: 0,
          scrollPaddingStart: 0,
          scrollPaddingEnd: 0,
          horizontal: false,
          getItemKey: rze,
          rangeExtractor: ize,
          onChange: () => {
          },
          measureElement: sze,
          initialRect: {
            width: 0,
            height: 0
          },
          scrollMargin: 0,
          gap: 0,
          indexAttribute: "data-index",
          initialMeasurementsCache: [],
          lanes: 1,
          isScrollingResetDelay: 150,
          enabled: true,
          isRtl: false,
          useScrollendEvent: false,
          useAnimationFrameWithResizeObserver: false,
          ...n
        };
      }, this.notify = (n) => {
        var r, i;
        (i = (r = this.options).onChange) == null || i.call(r, this, n);
      }, this.maybeNotify = k0(() => (this.calculateRange(), [
        this.isScrolling,
        this.range ? this.range.startIndex : null,
        this.range ? this.range.endIndex : null
      ]), (n) => {
        this.notify(n);
      }, {
        key: false,
        debug: () => this.options.debug,
        initialDeps: [
          this.isScrolling,
          this.range ? this.range.startIndex : null,
          this.range ? this.range.endIndex : null
        ]
      }), this.cleanup = () => {
        this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
      }, this._didMount = () => () => {
        this.cleanup();
      }, this._willUpdate = () => {
        var n;
        const r = this.options.enabled ? this.options.getScrollElement() : null;
        if (this.scrollElement !== r) {
          if (this.cleanup(), !r) {
            this.maybeNotify();
            return;
          }
          this.scrollElement = r, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.elementsCache.forEach((i) => {
            this.observer.observe(i);
          }), this.unsubs.push(this.options.observeElementRect(this, (i) => {
            this.scrollRect = i, this.maybeNotify();
          })), this.unsubs.push(this.options.observeElementOffset(this, (i, a) => {
            this.scrollAdjustments = 0, this.scrollDirection = a ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = a, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
          })), this._scrollToOffset(this.getScrollOffset(), {
            adjustments: void 0,
            behavior: void 0
          });
        }
      }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (n, r) => {
        const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
        for (let s = r - 1; s >= 0; s--) {
          const l = n[s];
          if (i.has(l.lane)) continue;
          const c = a.get(l.lane);
          if (c == null || l.end > c.end ? a.set(l.lane, l) : l.end < c.end && i.set(l.lane, true), i.size === this.options.lanes) break;
        }
        return a.size === this.options.lanes ? Array.from(a.values()).sort((s, l) => s.end === l.end ? s.index - l.index : s.end - l.end)[0] : void 0;
      }, this.getMeasurementOptions = k0(() => [
        this.options.count,
        this.options.paddingStart,
        this.options.scrollMargin,
        this.options.getItemKey,
        this.options.enabled,
        this.options.lanes
      ], (n, r, i, a, s, l) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = true), this.prevLanes = l, this.pendingMeasuredCacheIndexes = [], {
        count: n,
        paddingStart: r,
        scrollMargin: i,
        getItemKey: a,
        enabled: s,
        lanes: l
      }), {
        key: false
      }), this.getMeasurements = k0(() => [
        this.getMeasurementOptions(),
        this.itemSizeCache
      ], ({ count: n, paddingStart: r, scrollMargin: i, getItemKey: a, enabled: s, lanes: l }, c) => {
        if (!s) return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
        if (this.laneAssignments.size > n) for (const f of this.laneAssignments.keys()) f >= n && this.laneAssignments.delete(f);
        this.lanesChangedFlag && (this.lanesChangedFlag = false, this.lanesSettling = true, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((f) => {
          this.itemSizeCache.set(f.key, f.size);
        }));
        const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
        this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === n && (this.lanesSettling = false);
        const u = this.measurementsCache.slice(0, d), h = new Array(l).fill(void 0);
        for (let f = 0; f < d; f++) {
          const g = u[f];
          g && (h[g.lane] = f);
        }
        for (let f = d; f < n; f++) {
          const g = a(f), m = this.laneAssignments.get(f);
          let v, y;
          if (m !== void 0 && this.options.lanes > 1) {
            v = m;
            const k = h[v], C = k !== void 0 ? u[k] : void 0;
            y = C ? C.end + this.options.gap : r + i;
          } else {
            const k = this.options.lanes === 1 ? u[f - 1] : this.getFurthestMeasurement(u, f);
            y = k ? k.end + this.options.gap : r + i, v = k ? k.lane : f % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(f, v);
          }
          const w = c.get(g), b = typeof w == "number" ? w : this.options.estimateSize(f), j = y + b;
          u[f] = {
            index: f,
            start: y,
            size: b,
            end: j,
            key: g,
            lane: v
          }, h[v] = f;
        }
        return this.measurementsCache = u, u;
      }, {
        key: false,
        debug: () => this.options.debug
      }), this.calculateRange = k0(() => [
        this.getMeasurements(),
        this.getSize(),
        this.getScrollOffset(),
        this.options.lanes
      ], (n, r, i, a) => this.range = n.length > 0 && r > 0 ? dze({
        measurements: n,
        outerSize: r,
        scrollOffset: i,
        lanes: a
      }) : null, {
        key: false,
        debug: () => this.options.debug
      }), this.getVirtualIndexes = k0(() => {
        let n = null, r = null;
        const i = this.calculateRange();
        return i && (n = i.startIndex, r = i.endIndex), this.maybeNotify.updateDeps([
          this.isScrolling,
          n,
          r
        ]), [
          this.options.rangeExtractor,
          this.options.overscan,
          this.options.count,
          n,
          r
        ];
      }, (n, r, i, a, s) => a === null || s === null ? [] : n({
        startIndex: a,
        endIndex: s,
        overscan: r,
        count: i
      }), {
        key: false,
        debug: () => this.options.debug
      }), this.indexFromElement = (n) => {
        const r = this.options.indexAttribute, i = n.getAttribute(r);
        return i ? parseInt(i, 10) : (console.warn(`Missing attribute name '${r}={index}' on measured element.`), -1);
      }, this.shouldMeasureDuringScroll = (n) => {
        var r;
        if (!this.scrollState || this.scrollState.behavior !== "smooth") return true;
        const i = this.scrollState.index ?? ((r = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : r.index);
        if (i !== void 0 && this.range) {
          const a = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), s = Math.max(0, i - a), l = Math.min(this.options.count - 1, i + a);
          return n >= s && n <= l;
        }
        return true;
      }, this._measureElement = (n, r) => {
        if (!n.isConnected) {
          this.observer.unobserve(n);
          return;
        }
        const i = this.indexFromElement(n), a = this.measurementsCache[i];
        if (!a) return;
        const s = a.key, l = this.elementsCache.get(s);
        l !== n && (l && this.observer.unobserve(l), this.observer.observe(n), this.elementsCache.set(s, n)), this.shouldMeasureDuringScroll(i) && this.resizeItem(i, this.options.measureElement(n, r, this));
      }, this.resizeItem = (n, r) => {
        var i;
        const a = this.measurementsCache[n];
        if (!a) return;
        const s = this.itemSizeCache.get(a.key) ?? a.size, l = r - s;
        l !== 0 && (((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(a, l, this) : a.start < this.getScrollOffset() + this.scrollAdjustments) && this._scrollToOffset(this.getScrollOffset(), {
          adjustments: this.scrollAdjustments += l,
          behavior: void 0
        }), this.pendingMeasuredCacheIndexes.push(a.index), this.itemSizeCache = new Map(this.itemSizeCache.set(a.key, r)), this.notify(false));
      }, this.measureElement = (n) => {
        if (!n) {
          this.elementsCache.forEach((r, i) => {
            r.isConnected || (this.observer.unobserve(r), this.elementsCache.delete(i));
          });
          return;
        }
        this._measureElement(n, void 0);
      }, this.getVirtualItems = k0(() => [
        this.getVirtualIndexes(),
        this.getMeasurements()
      ], (n, r) => {
        const i = [];
        for (let a = 0, s = n.length; a < s; a++) {
          const l = n[a], c = r[l];
          i.push(c);
        }
        return i;
      }, {
        key: false,
        debug: () => this.options.debug
      }), this.getVirtualItemForOffset = (n) => {
        const r = this.getMeasurements();
        if (r.length !== 0) return vY(r[fce(0, r.length - 1, (i) => vY(r[i]).start, n)]);
      }, this.getMaxScrollOffset = () => {
        if (!this.scrollElement) return 0;
        if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
        {
          const n = this.scrollElement.document.documentElement;
          return this.options.horizontal ? n.scrollWidth - this.scrollElement.innerWidth : n.scrollHeight - this.scrollElement.innerHeight;
        }
      }, this.getOffsetForAlignment = (n, r, i = 0) => {
        if (!this.scrollElement) return 0;
        const a = this.getSize(), s = this.getScrollOffset();
        r === "auto" && (r = n >= s + a ? "end" : "start"), r === "center" ? n += (i - a) / 2 : r === "end" && (n -= a);
        const l = this.getMaxScrollOffset();
        return Math.max(Math.min(l, n), 0);
      }, this.getOffsetForIndex = (n, r = "auto") => {
        n = Math.max(0, Math.min(n, this.options.count - 1));
        const i = this.getSize(), a = this.getScrollOffset(), s = this.measurementsCache[n];
        if (!s) return;
        if (r === "auto") if (s.end >= a + i - this.options.scrollPaddingEnd) r = "end";
        else if (s.start <= a + this.options.scrollPaddingStart) r = "start";
        else return [
          a,
          r
        ];
        if (r === "end" && n === this.options.count - 1) return [
          this.getMaxScrollOffset(),
          r
        ];
        const l = r === "end" ? s.end + this.options.scrollPaddingEnd : s.start - this.options.scrollPaddingStart;
        return [
          this.getOffsetForAlignment(l, r, s.size),
          r
        ];
      }, this.scrollToOffset = (n, { align: r = "start", behavior: i = "auto" } = {}) => {
        const a = this.getOffsetForAlignment(n, r), s = this.now();
        this.scrollState = {
          index: null,
          align: r,
          behavior: i,
          startedAt: s,
          lastTargetOffset: a,
          stableFrames: 0
        }, this._scrollToOffset(a, {
          adjustments: void 0,
          behavior: i
        }), this.scheduleScrollReconcile();
      }, this.scrollToIndex = (n, { align: r = "auto", behavior: i = "auto" } = {}) => {
        n = Math.max(0, Math.min(n, this.options.count - 1));
        const a = this.getOffsetForIndex(n, r);
        if (!a) return;
        const [s, l] = a, c = this.now();
        this.scrollState = {
          index: n,
          align: l,
          behavior: i,
          startedAt: c,
          lastTargetOffset: s,
          stableFrames: 0
        }, this._scrollToOffset(s, {
          adjustments: void 0,
          behavior: i
        }), this.scheduleScrollReconcile();
      }, this.scrollBy = (n, { behavior: r = "auto" } = {}) => {
        const i = this.getScrollOffset() + n, a = this.now();
        this.scrollState = {
          index: null,
          align: "start",
          behavior: r,
          startedAt: a,
          lastTargetOffset: i,
          stableFrames: 0
        }, this._scrollToOffset(i, {
          adjustments: void 0,
          behavior: r
        }), this.scheduleScrollReconcile();
      }, this.getTotalSize = () => {
        var n;
        const r = this.getMeasurements();
        let i;
        if (r.length === 0) i = this.options.paddingStart;
        else if (this.options.lanes === 1) i = ((n = r[r.length - 1]) == null ? void 0 : n.end) ?? 0;
        else {
          const a = Array(this.options.lanes).fill(null);
          let s = r.length - 1;
          for (; s >= 0 && a.some((l) => l === null); ) {
            const l = r[s];
            a[l.lane] === null && (a[l.lane] = l.end), s--;
          }
          i = Math.max(...a.filter((l) => l !== null));
        }
        return Math.max(i - this.options.scrollMargin + this.options.paddingEnd, 0);
      }, this._scrollToOffset = (n, { adjustments: r, behavior: i }) => {
        this.options.scrollToFn(n, {
          behavior: i,
          adjustments: r
        }, this);
      }, this.measure = () => {
        this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(false);
      }, this.setOptions(e);
    }
    scheduleScrollReconcile() {
      if (!this.targetWindow) {
        this.scrollState = null;
        return;
      }
      this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
        this.rafId = null, this.reconcileScroll();
      }));
    }
    reconcileScroll() {
      if (!this.scrollState || !this.scrollElement) return;
      if (this.now() - this.scrollState.startedAt > 5e3) {
        this.scrollState = null;
        return;
      }
      const r = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, i = r ? r[0] : this.scrollState.lastTargetOffset, a = 1, s = i !== this.scrollState.lastTargetOffset;
      if (!s && tze(i, this.getScrollOffset())) {
        if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= a) {
          this.scrollState = null;
          return;
        }
      } else this.scrollState.stableFrames = 0, s && (this.scrollState.lastTargetOffset = i, this.scrollState.behavior = "auto", this._scrollToOffset(i, {
        adjustments: void 0,
        behavior: "auto"
      }));
      this.scheduleScrollReconcile();
    }
  }
  const fce = (t, e, n, r) => {
    for (; t <= e; ) {
      const i = (t + e) / 2 | 0, a = n(i);
      if (a < r) t = i + 1;
      else if (a > r) e = i - 1;
      else return i;
    }
    return t > 0 ? t - 1 : 0;
  };
  function dze({ measurements: t, outerSize: e, scrollOffset: n, lanes: r }) {
    const i = t.length - 1, a = (c) => t[c].start;
    if (t.length <= r) return {
      startIndex: 0,
      endIndex: i
    };
    let s = fce(0, i, a, n), l = s;
    if (r === 1) for (; l < i && t[l].end < n + e; ) l++;
    else if (r > 1) {
      const c = Array(r).fill(0);
      for (; l < i && c.some((u) => u < n + e); ) {
        const u = t[l];
        c[u.lane] = u.end, l++;
      }
      const d = Array(r).fill(n + e);
      for (; s >= 0 && d.some((u) => u >= n); ) {
        const u = t[s];
        d[u.lane] = u.start, s--;
      }
      s = Math.max(0, s - s % r), l = Math.min(i, l + (r - 1 - l % r));
    }
    return {
      startIndex: s,
      endIndex: l
    };
  }
  const xY = typeof document < "u" ? p.useLayoutEffect : p.useEffect;
  function uze({ useFlushSync: t = true, ...e }) {
    const n = p.useReducer(() => ({}), {})[1], r = {
      ...e,
      onChange: (a, s) => {
        var l;
        t && s ? DF.flushSync(n) : n(), (l = e.onChange) == null || l.call(e, a, s);
      }
    }, [i] = p.useState(() => new cze(r));
    return i.setOptions(r), xY(() => i._didMount(), []), xY(() => i._willUpdate()), i;
  }
  function nc(t) {
    return uze({
      observeElementRect: oze,
      observeElementOffset: aze,
      scrollToFn: lze,
      ...t
    });
  }
  function Rp(t, e) {
    const n = p.useRef(), { wait: r, immediate: i } = e ?? {};
    return p.useCallback((...s) => {
      n.current ? (clearTimeout(n.current), n.current = void 0) : i && t(...s), n.current = window.setTimeout(() => {
        t(...s), n.current = void 0;
      }, r);
    }, [
      t,
      r,
      i
    ]);
  }
  var hze = "style_VirtualTile__h2brcl0 _1mqalmd1 _1mqalmd0";
  const Rs = ft(({ className: t, virtualItem: e, style: n, ...r }, i) => o.jsx("div", {
    className: gt(hze, t),
    style: {
      top: e.start,
      ...n
    },
    "data-index": e.index,
    ...r,
    ref: i
  })), fze = () => p.useMemo(() => ({
    [Fa.People]: q.Smile,
    [Fa.Nature]: q.Leaf,
    [Fa.Food]: q.Cup,
    [Fa.Activity]: q.Ball,
    [Fa.Travel]: q.Photo,
    [Fa.Object]: q.Bulb,
    [Fa.Symbol]: q.Peace,
    [Fa.Flag]: q.Flag
  }), []), mce = () => p.useMemo(() => ({
    [Fa.People]: "Smileys & People",
    [Fa.Nature]: "Animals & Nature",
    [Fa.Food]: "Food & Drinks",
    [Fa.Activity]: "Activity",
    [Fa.Travel]: "Travel & Places",
    [Fa.Object]: "Objects",
    [Fa.Symbol]: "Symbols",
    [Fa.Flag]: "Flags"
  }), []);
  function mze({ query: t, onChange: e, allowTextCustomEmoji: n, onTextCustomEmojiSelect: r }) {
    const i = p.useRef(null), a = () => {
      var _a6;
      const s = (_a6 = i.current) == null ? void 0 : _a6.value.trim();
      s && (r == null ? void 0 : r(s));
    };
    return o.jsx(mn, {
      ref: i,
      variant: "SurfaceVariant",
      size: "400",
      placeholder: n ? "Search or Text Reaction " : "Search",
      maxLength: 50,
      after: n && t ? o.jsx(Qe, {
        variant: "Primary",
        radii: "Pill",
        after: o.jsx(Q, {
          src: q.ArrowRight,
          size: "50"
        }),
        outlined: true,
        onClick: a,
        children: o.jsx(D, {
          size: "L400",
          children: "React"
        })
      }) : o.jsx(Q, {
        src: q.Search,
        size: "50"
      }),
      onChange: e,
      autoFocus: !Dr()
    });
  }
  var xa = ((t) => (t.Emoji = "Emoji", t.Sticker = "Sticker", t))(xa || {}), Bg = ((t) => (t.Emoji = "emoji", t.CustomEmoji = "customEmoji", t.Sticker = "sticker", t))(Bg || {});
  const wY = {
    cursor: "pointer"
  };
  function gze({ tab: t, onTabChange: e }) {
    return o.jsxs(E, {
      gap: "100",
      children: [
        o.jsx(Rn, {
          style: wY,
          as: "button",
          variant: "Secondary",
          fill: t === xa.Sticker ? "Solid" : "None",
          size: "500",
          onClick: () => e(xa.Sticker),
          children: o.jsx(D, {
            as: "span",
            size: "L400",
            children: "Sticker"
          })
        }),
        o.jsx(Rn, {
          style: wY,
          as: "button",
          variant: "Secondary",
          fill: t === xa.Emoji ? "Solid" : "None",
          size: "500",
          onClick: () => e(xa.Emoji),
          children: o.jsx(D, {
            as: "span",
            size: "L400",
            children: "Emoji"
          })
        })
      ]
    });
  }
  var pze = "styles_Base__1n9oudo0", Fze = "styles_Header__1n9oudo1", vze = "styles_Sidebar__1n9oudo2", _ze = "styles_SidebarContent__1n9oudo3", yze = "styles_SidebarStack__1n9oudo4", bze = "styles_SidebarDivider__1n9oudo5", xze = "styles_SidebarBtnImg__1n9oudo6", wze = "styles_Preview__1n9oudo7", Dze = "styles_PreviewEmoji__1n9oudo8 _1mqalmd1 _1mqalmd0", Cze = "styles_PreviewImg__1n9oudo9 _1mqalmd1 _1mqalmd0", Eze = "styles_EmojiGroup__1n9oudoa", kze = "styles_EmojiGroupLabel__1n9oudob", Sze = "styles_EmojiGroupContent__1n9oudoc _1mqalmd1 _1mqalmd0", gce = "styles_EmojiItem__1n9oudod _1mqalmd1 _1mqalmd0 _1bugis90", jze = "styles_StickerItem__1n9oudoe styles_EmojiItem__1n9oudod _1mqalmd1 _1mqalmd0 _1bugis90", Tze = "styles_CustomEmojiImg__1n9oudof _1mqalmd1 _1mqalmd0", Rze = "styles_StickerImg__1n9oudog _1mqalmd1 _1mqalmd0";
  function pce({ children: t }) {
    return o.jsx(E, {
      className: vze,
      shrink: "No",
      children: o.jsx(dn, {
        size: "0",
        children: o.jsx(E, {
          className: _ze,
          direction: "Column",
          alignItems: "Center",
          gap: "100",
          children: t
        })
      })
    });
  }
  const eC = ft(({ className: t, children: e, ...n }, r) => o.jsx(E, {
    className: gt(yze, t),
    direction: "Column",
    alignItems: "Center",
    gap: "100",
    ...n,
    ref: r,
    children: e
  }));
  function DY() {
    return o.jsx(nr, {
      className: bze,
      size: "300",
      variant: "Surface"
    });
  }
  function Fce({ active: t, label: e, id: n, onClick: r, children: i }) {
    return o.jsx(ar, {
      delay: 500,
      position: "Left",
      tooltip: o.jsx(pr, {
        id: `SidebarStackItem-${n}-label`,
        children: o.jsx(D, {
          size: "T300",
          children: e
        })
      }),
      children: (a) => o.jsx(Oe, {
        "aria-pressed": t,
        "aria-labelledby": `SidebarStackItem-${n}-label`,
        ref: a,
        onClick: () => r(n),
        size: "400",
        radii: "300",
        variant: "Surface",
        children: i
      })
    });
  }
  function CY({ active: t, id: e, label: n, icon: r, onClick: i }) {
    return o.jsx(Fce, {
      active: t,
      id: e,
      label: n,
      onClick: i,
      children: o.jsx(Q, {
        src: r,
        filled: t
      })
    });
  }
  function vce({ active: t, id: e, label: n, url: r, onClick: i }) {
    return o.jsx(Fce, {
      active: t,
      id: e,
      label: n,
      onClick: i,
      children: r ? o.jsx("img", {
        className: xze,
        src: r,
        alt: n
      }) : o.jsx(Q, {
        src: q.Photo,
        filled: t
      })
    });
  }
  function Aze() {
    return o.jsxs(E, {
      style: {
        padding: `${He(60)} ${ee.space.S500}`
      },
      alignItems: "Center",
      justifyContent: "Center",
      direction: "Column",
      gap: "300",
      children: [
        o.jsx(Q, {
          size: "600",
          src: q.Sticker
        }),
        o.jsxs(E, {
          direction: "Inherit",
          children: [
            o.jsx(D, {
              align: "Center",
              children: "No Sticker Packs!"
            }),
            o.jsx(D, {
              priority: "300",
              align: "Center",
              size: "T200",
              children: "Add stickers from user, room or space settings."
            })
          ]
        })
      ]
    });
  }
  const Ize = (t) => vn(t);
  function Bze({ previewAtom: t }) {
    const e = be(), n = hn(), { key: r, shortcode: i } = Ze(t) ?? {};
    return i ? o.jsxs(E, {
      shrink: "No",
      className: wze,
      gap: "300",
      alignItems: "Center",
      children: [
        r && o.jsx(E, {
          display: "InlineFlex",
          className: Dze,
          alignItems: "Center",
          justifyContent: "Center",
          children: r.startsWith("mxc://") ? o.jsx("img", {
            className: Cze,
            src: Cn(e, r, n) ?? r,
            alt: i
          }) : r
        }),
        o.jsxs(D, {
          size: "H5",
          truncate: true,
          children: [
            ":",
            i,
            ":"
          ]
        })
      ]
    }) : null;
  }
  const Pze = /* @__PURE__ */ new Set([
    "image/gif",
    "image/apng"
  ]), Mze = (t) => {
    var _a6, _b3, _c3;
    const e = (_b3 = (_a6 = t.info) == null ? void 0 : _a6.mimetype) == null ? void 0 : _b3.toLowerCase();
    if (e && Pze.has(e)) return true;
    const n = (_c3 = t.body) == null ? void 0 : _c3.toLowerCase();
    return !!n && (n.endsWith(".gif") || n.endsWith(".webp") || n.endsWith(".apng"));
  }, _ce = (t, e, n, r, i, a) => Mze(e) || !r ? Cn(t, e.url, n) ?? "" : Cn(t, e.url, n, i, a) ?? "", yce = (t) => {
    const e = t.getAttribute("title"), n = t.getAttribute("data-emoji-type"), r = t.getAttribute("data-emoji-data"), i = t.getAttribute("data-emoji-shortcode");
    if (n && r && i && e) return {
      type: n,
      data: r,
      shortcode: i,
      label: e
    };
  };
  function Oze({ emoji: t }) {
    return o.jsx(E, {
      as: "button",
      type: "button",
      alignItems: "Center",
      justifyContent: "Center",
      className: gce,
      title: t.label,
      "aria-label": `${t.label} emoji`,
      "data-emoji-type": Bg.Emoji,
      "data-emoji-data": t.unicode,
      "data-emoji-shortcode": t.shortcode,
      children: t.unicode
    });
  }
  function Lze({ mx: t, useAuthentication: e, image: n, saveStickerEmojiBandwidth: r }) {
    return o.jsx(E, {
      as: "button",
      type: "button",
      alignItems: "Center",
      justifyContent: "Center",
      className: gce,
      title: n.body || n.shortcode,
      "aria-label": `${n.body || n.shortcode} emoji`,
      "data-emoji-type": Bg.CustomEmoji,
      "data-emoji-data": n.url,
      "data-emoji-shortcode": n.shortcode,
      children: o.jsx("img", {
        loading: "lazy",
        className: Tze,
        alt: n.body || n.shortcode,
        src: _ce(t, n, e, r, 32, 32)
      })
    });
  }
  function Nze({ mx: t, useAuthentication: e, image: n, saveStickerEmojiBandwidth: r }) {
    return o.jsx(E, {
      as: "button",
      type: "button",
      alignItems: "Center",
      justifyContent: "Center",
      className: jze,
      title: n.body || n.shortcode,
      "aria-label": `${n.body || n.shortcode} emoji`,
      "data-emoji-type": Bg.Sticker,
      "data-emoji-data": n.url,
      "data-emoji-shortcode": n.shortcode,
      children: o.jsx("img", {
        loading: "lazy",
        className: Rze,
        alt: n.body || n.shortcode,
        src: _ce(t, n, e, r, 125, 125)
      })
    });
  }
  const zze = (t) => `EmojiBoardGroup-${t}`, EY = ft(({ className: t, id: e, label: n, children: r, ...i }, a) => o.jsxs(E, {
    id: zze(e),
    "data-group-id": e,
    className: gt(Eze, t),
    direction: "Column",
    gap: "200",
    ...i,
    ref: a,
    children: [
      o.jsx(D, {
        id: `EmojiGroup-${e}-label`,
        as: "label",
        className: kze,
        size: "O400",
        children: n
      }),
      o.jsx("div", {
        "aria-labelledby": `EmojiGroup-${e}-label`,
        className: Sze,
        children: o.jsx(E, {
          wrap: "Wrap",
          justifyContent: "Center",
          children: r
        })
      })
    ]
  })), Uze = ft(({ className: t, header: e, sidebar: n, children: r, ...i }, a) => o.jsxs(E, {
    display: "InlineFlex",
    className: gt(pze, t),
    direction: "Row",
    ...i,
    ref: a,
    children: [
      o.jsxs(E, {
        direction: "Column",
        grow: "Yes",
        children: [
          o.jsx(E, {
            className: Fze,
            direction: "Column",
            shrink: "No",
            children: e
          }),
          r
        ]
      }),
      o.jsx(nr, {
        size: "300",
        direction: "Vertical"
      }),
      n
    ]
  })), PI = "recent_group", Vze = "search_group", Hze = (t, e) => {
    const n = be(), r = cM(n, 21), i = mce(), a = p.useMemo(() => {
      const l = [];
      return t !== xa.Emoji || (l.push({
        id: PI,
        name: "Recent",
        items: r
      }), e.forEach((c) => {
        var _a6;
        let d = c.meta.name;
        d || (d = co(c.id) ? "Personal Pack" : (_a6 = n.getRoom(c.id)) == null ? void 0 : _a6.name), l.push({
          id: c.id,
          name: d ?? "Unknown",
          items: c.getImages(Hr.Emoticon).toSorted((u, h) => u.shortcode.localeCompare(h.shortcode))
        });
      }), yP.forEach((c) => {
        l.push({
          id: c.id,
          name: i[c.id],
          items: c.emojis
        });
      })), l;
    }, [
      n,
      r,
      i,
      e,
      t
    ]), s = p.useMemo(() => {
      const l = [];
      return t !== xa.Sticker || e.forEach((c) => {
        var _a6;
        let d = c.meta.name;
        d || (d = co(c.id) ? "Personal Pack" : (_a6 = n.getRoom(c.id)) == null ? void 0 : _a6.name), l.push({
          id: c.id,
          name: d ?? "Unknown",
          items: c.getImages(Hr.Sticker).toSorted((u, h) => u.shortcode.localeCompare(h.shortcode))
        });
      }), l;
    }, [
      n,
      e,
      t
    ]);
    return [
      a,
      s
    ];
  }, $ze = (t, e) => {
    const n = be(), r = hn();
    return (a, s) => "unicode" in a ? o.jsx(Oze, {
      emoji: a
    }, a.unicode + s) : t === xa.Sticker ? o.jsx(Nze, {
      mx: n,
      useAuthentication: r,
      image: a,
      saveStickerEmojiBandwidth: e
    }, a.shortcode + s) : o.jsx(Lze, {
      mx: n,
      useAuthentication: r,
      image: a,
      saveStickerEmojiBandwidth: e
    }, a.shortcode + s);
  };
  function Wze({ activeGroupAtom: t, packs: e, saveStickerEmojiBandwidth: n, onScrollToGroup: r }) {
    const i = be(), a = hn(), [s, l] = Fr(t), c = Hr.Emoticon, d = mce(), u = fze(), h = (f) => {
      l(f), r(f);
    };
    return o.jsxs(pce, {
      children: [
        o.jsx(eC, {
          children: o.jsx(CY, {
            active: s === PI,
            id: PI,
            label: "Recent",
            icon: q.RecentClock,
            onClick: h
          })
        }),
        e.length > 0 && o.jsxs(eC, {
          children: [
            o.jsx(DY, {}),
            e.map((f) => {
              var _a6;
              let g = f.meta.name;
              g || (g = co(f.id) ? "Personal Pack" : (_a6 = i.getRoom(f.id)) == null ? void 0 : _a6.name);
              const m = n ? Cn(i, f.getAvatarUrl(c) ?? "", a, 36, 36) : Cn(i, f.getAvatarUrl(c) ?? "", a);
              return o.jsx(vce, {
                active: s === f.id,
                id: f.id,
                label: g ?? "Unknown Pack",
                url: m ?? void 0,
                onClick: h
              }, f.id);
            })
          ]
        }),
        o.jsxs(eC, {
          style: {
            position: "sticky",
            bottom: "-67%",
            zIndex: 1
          },
          children: [
            o.jsx(DY, {}),
            yP.map((f) => o.jsx(CY, {
              active: s === f.id,
              id: f.id,
              label: d[f.id],
              icon: u[f.id],
              onClick: h
            }, f.id))
          ]
        })
      ]
    });
  }
  function qze({ activeGroupAtom: t, packs: e, saveStickerEmojiBandwidth: n, onScrollToGroup: r }) {
    const i = be(), a = hn(), [s, l] = Fr(t), c = Hr.Sticker, d = (u) => {
      l(u), r(u);
    };
    return o.jsx(pce, {
      children: o.jsx(eC, {
        children: e.map((u) => {
          var _a6;
          let h = u.meta.name;
          h || (h = co(u.id) ? "Personal Pack" : (_a6 = i.getRoom(u.id)) == null ? void 0 : _a6.name);
          const f = n ? Cn(i, u.getAvatarUrl(c) ?? "", a, 36, 36) : Cn(i, u.getAvatarUrl(c) ?? "", a);
          return o.jsx(vce, {
            active: s === u.id,
            id: u.id,
            label: h ?? "Unknown Pack",
            url: f ?? void 0,
            onClick: d
          }, u.id);
        })
      })
    });
  }
  function Kze({ contentScrollRef: t, previewAtom: e, onGroupItemClick: n, children: r }) {
    const i = Fn(e), a = p.useCallback((d) => {
      const u = yce(d);
      u && i({
        key: u.data,
        shortcode: u.shortcode
      });
    }, [
      i
    ]), s = sP(a, {
      wait: 200,
      immediate: true
    }), l = (d) => {
      const u = Kie(d.nativeEvent, "button");
      u && s(u);
    }, c = (d) => {
      const u = d.target;
      a(u);
    };
    return o.jsx(dn, {
      ref: t,
      size: "400",
      onKeyDown: Hte,
      hideTrack: true,
      children: o.jsx(E, {
        onClick: n,
        onMouseMove: l,
        onFocus: c,
        direction: "Column",
        children: r
      })
    });
  }
  const Gze = {
    key: "\u{1F642}",
    shortcode: "slight_smile"
  }, Yze = {
    limit: 1e3,
    matchOptions: {
      contain: true
    }
  }, Zze = 2;
  function JF({ tab: t = xa.Emoji, onTabChange: e, imagePackRooms: n, requestClose: r, returnFocusOnDeactivate: i, onEmojiSelect: a, onCustomEmojiSelect: s, onStickerSelect: l, allowTextCustomEmoji: c, addToRecentEmoji: d = true }) {
    const u = be(), [h] = Fe(ge, "saveStickerEmojiBandwidth"), f = t === xa.Emoji, g = f ? Hr.Emoticon : Hr.Sticker, m = p.useMemo(() => Ize(f ? Gze : void 0), [
      f
    ]), v = p.useMemo(() => vn(void 0), []), y = Fn(v), w = yle(g, n), [b, j] = Hze(t, w), k = f ? b : j, C = $ze(t, h), x = p.useMemo(() => {
      let V = [];
      return V = V.concat(w.flatMap((Z) => Z.getImages(g))), f && (V = V.concat(Ok)), V;
    }, [
      f,
      g,
      w
    ]), [S, T, A] = tc(x, ble, Yze), B = S == null ? void 0 : S.items.slice(0, 100), U = Rp(p.useCallback((V) => {
      const Z = V.target.value;
      Z ? T(Z) : A();
    }, [
      T,
      A
    ]), {
      wait: 200
    }), z = p.useRef(null), O = p.useRef(null), M = nc({
      count: k.length,
      getScrollElement: () => z.current,
      estimateSize: (V) => {
        const Z = k[V];
        if (!Z) return f ? 320 : 420;
        const Y = f ? 48 : 112, oe = Math.max(1, Math.floor(280 / Y)), ue = Math.ceil(Z.items.length / oe);
        return Math.ceil((52 + ue * Y) * 1.05);
      },
      overscan: Zze
    }), I = M.getVirtualItems(), N = (V) => {
      const Z = Kie(V.nativeEvent, "button"), Y = Z && yce(Z);
      Y && (Y.type === Bg.Emoji && (a == null ? void 0 : a(Y.data, Y.shortcode), !V.altKey && !V.shiftKey && d && eMe(u, Y.data)), Y.type === Bg.CustomEmoji && (s == null ? void 0 : s(Y.data, Y.shortcode)), Y.type === Bg.Sticker && (l == null ? void 0 : l(Y.data, Y.shortcode, Y.label)), !V.altKey && !V.shiftKey && r());
    }, L = (V) => {
      s == null ? void 0 : s(V, V), r();
    }, H = (V) => {
      const Z = k.findIndex((Y) => Y.id === V);
      M.scrollToIndex(Z, {
        align: "start"
      });
    };
    return p.useEffect(() => {
      var _a6;
      const V = z.current;
      if (V) {
        const Z = V.offsetTop + V.scrollTop, Y = ((_a6 = O.current) == null ? void 0 : _a6.offsetTop) ?? 0, oe = I.find((ie) => Z < Y + ie.end), ue = oe ? k[oe == null ? void 0 : oe.index] : void 0;
        y(ue == null ? void 0 : ue.id);
      }
    }, [
      I,
      k,
      y,
      S == null ? void 0 : S.query
    ]), p.useEffect(() => {
      const V = z.current;
      V && V.scrollTo({
        top: 0
      });
    }, [
      S == null ? void 0 : S.query
    ]), p.useEffect(() => {
      k.length > 0 && M.scrollToIndex(0, {
        align: "start"
      });
    }, [
      t,
      M,
      k.length
    ]), o.jsx(Ft, {
      focusTrapOptions: {
        returnFocusOnDeactivate: i,
        initialFocus: false,
        onDeactivate: r,
        clickOutsideDeactivates: true,
        allowOutsideClick: true,
        isKeyForward: (V) => !NA() && Yt.isKeyHotkey([
          "arrowdown",
          "arrowright"
        ], V),
        isKeyBackward: (V) => !NA() && Yt.isKeyHotkey([
          "arrowup",
          "arrowleft"
        ], V),
        escapeDeactivates: kt
      },
      children: o.jsxs(Uze, {
        header: o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            e && o.jsx(gze, {
              tab: t,
              onTabChange: e
            }),
            o.jsx(mze, {
              query: S == null ? void 0 : S.query,
              onChange: U,
              allowTextCustomEmoji: c,
              onTextCustomEmojiSelect: L
            }, t)
          ]
        }),
        sidebar: f ? o.jsx(Wze, {
          activeGroupAtom: v,
          packs: w,
          saveStickerEmojiBandwidth: h,
          onScrollToGroup: H
        }) : o.jsx(qze, {
          activeGroupAtom: v,
          packs: w,
          saveStickerEmojiBandwidth: h,
          onScrollToGroup: H
        }),
        children: [
          o.jsx(E, {
            grow: "Yes",
            children: o.jsxs(Kze, {
              contentScrollRef: z,
              previewAtom: m,
              onGroupItemClick: N,
              children: [
                B && o.jsx(EY, {
                  id: Vze,
                  label: B.length ? "Search Results" : "No Results found",
                  children: B.map((V, Z) => C(V, Z))
                }),
                o.jsx("div", {
                  ref: O,
                  style: {
                    position: "relative",
                    height: M.getTotalSize()
                  },
                  children: I.map((V) => {
                    const Z = k[V.index];
                    return o.jsx(Rs, {
                      virtualItem: V,
                      style: {
                        paddingTop: ee.space.S200
                      },
                      ref: M.measureElement,
                      children: o.jsx(EY, {
                        id: Z.id,
                        label: Z.name,
                        children: Z.items.map(C)
                      }, Z.id)
                    }, V.index);
                  })
                }),
                t === xa.Sticker && k.length === 0 && o.jsx(Aze, {})
              ]
            }, t)
          }),
          o.jsx(Bze, {
            previewAtom: m
          })
        ]
      })
    });
  }
  var Jze = "UploadDescriptionEditor_DescriptionEditorContainer__1961xoa0";
  function Xze({ value: t, isSaving: e, imagePackRooms: n, onSave: r, onCancel: i }) {
    const a = p3(), [s] = Fe(ge, "enterForNewline"), [l, c] = p.useState(), d = p.useRef(t), u = p.useRef(false), h = p.useCallback(() => {
      const y = Hl(a.children).trim(), w = _b(lp(a.children, {}));
      r(y, w || y);
    }, [
      a,
      r
    ]);
    p.useEffect(() => {
      const y = d.current !== t, w = !u.current && t !== void 0;
      if (y || w) {
        d.current = t;
        let b = t;
        typeof b == "object" && b !== null && "formatted_body" in b && (b = b.formatted_body);
        const j = typeof b == "string" ? b : "", k = Hl(jf(j.includes("<") ? vb(j) : j)).trim();
        if (Hl(a.children).trim() === k && u.current) return;
        const x = j.includes("<") || j.includes(">"), S = jf(x ? vb(j) : j);
        a.children = S, fe.normalize(a, {
          force: true
        }), xt.select(a, fe.start(a, [])), u.current = true;
      }
    }, [
      t,
      a
    ]);
    const f = p.useCallback((y) => {
      (Yt.isKeyHotkey("mod+enter", y) || !s && Yt.isKeyHotkey("enter", y)) && (y.preventDefault(), h());
    }, [
      h,
      s
    ]), g = p.useCallback((y) => {
      if (Yt.isKeyHotkey("escape", y)) {
        y.preventDefault(), i();
        return;
      }
      const w = gb(a), b = w ? fF(a, w, [
        al.Emoticon
      ]) : void 0;
      c(b);
    }, [
      a,
      i
    ]), m = p.useCallback(() => {
      Bt.focus(a), c(void 0);
    }, [
      a
    ]), v = (y, w) => {
      a.insertNode(YF(y, w)), Gl(a);
    };
    return o.jsx(E, {
      direction: "Column",
      gap: "100",
      children: o.jsxs(E, {
        className: Jze,
        direction: "Column",
        style: {
          position: "relative"
        },
        children: [
          (l == null ? void 0 : l.prefix) === al.Emoticon && o.jsx(pb, {
            imagePackRooms: n || [],
            editor: a,
            query: l,
            requestClose: m
          }),
          o.jsx(oS, {
            editor: a,
            placeholder: "File Description...",
            onKeyDown: f,
            onKeyUp: g,
            maxHeight: "200px",
            variant: "Background",
            bottom: o.jsxs(E, {
              direction: "Column",
              style: {
                backgroundColor: "var(--sable-bg-container)"
              },
              children: [
                o.jsx(uS, {}),
                o.jsxs(E, {
                  style: {
                    padding: ee.space.S200,
                    paddingTop: 0
                  },
                  alignItems: "End",
                  justifyContent: "SpaceBetween",
                  gap: "100",
                  children: [
                    o.jsxs(E, {
                      gap: "200",
                      children: [
                        o.jsx(E, {
                          gap: "200",
                          alignItems: "Center",
                          children: o.jsx(Qe, {
                            onClick: h,
                            variant: "Primary",
                            radii: "Pill",
                            outlined: true,
                            before: e ? o.jsx(dt, {
                              variant: "Primary",
                              fill: "Soft",
                              size: "100"
                            }) : void 0,
                            children: o.jsx(D, {
                              size: "B300",
                              children: e ? "Saving" : "Save"
                            })
                          })
                        }),
                        o.jsx(E, {
                          gap: "200",
                          alignItems: "Center",
                          children: o.jsx(Qe, {
                            onClick: i,
                            variant: "Warning",
                            radii: "Pill",
                            outlined: true,
                            before: e ? o.jsx(dt, {
                              variant: "Primary",
                              fill: "Soft",
                              size: "100"
                            }) : void 0,
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Cancel"
                            })
                          })
                        })
                      ]
                    }),
                    o.jsxs(E, {
                      gap: "Inherit",
                      children: [
                        o.jsx(dS, {
                          variant: "Background"
                        }),
                        o.jsx(Hi, {
                          initial: void 0,
                          children: (y, w) => o.jsx(ln, {
                            anchor: y,
                            alignOffset: -8,
                            position: "Top",
                            align: "End",
                            content: o.jsx(JF, {
                              imagePackRooms: n ?? [],
                              returnFocusOnDeactivate: false,
                              onEmojiSelect: v,
                              onCustomEmojiSelect: v,
                              requestClose: () => w((b) => {
                                if (b) {
                                  Dr() || Bt.focus(a);
                                  return;
                                }
                                return b;
                              })
                            }),
                            children: o.jsx(Oe, {
                              "aria-pressed": y !== void 0,
                              variant: "Background",
                              size: "300",
                              radii: "300",
                              onClick: (b) => w(b.currentTarget.getBoundingClientRect()),
                              children: o.jsx(Q, {
                                size: "400",
                                src: q.Smile,
                                filled: y !== void 0
                              })
                            })
                          })
                        })
                      ]
                    })
                  ]
                })
              ]
            })
          })
        ]
      })
    });
  }
  function Qze({ fileItem: t }) {
    const { originalFile: e, metadata: n } = t, r = Xl(e);
    return o.jsx("img", {
      style: {
        objectFit: "contain",
        width: "100%",
        height: He(152),
        filter: n.markedAsSpoiler ? "blur(44px)" : void 0
      },
      alt: e.name,
      src: r
    });
  }
  function eUe({ fileItem: t }) {
    const { originalFile: e, metadata: n } = t, r = Xl(e);
    return o.jsx("video", {
      style: {
        objectFit: "contain",
        width: "100%",
        height: He(152),
        filter: n.markedAsSpoiler ? "blur(44px)" : void 0
      },
      src: r
    });
  }
  const Mm = 44;
  function tUe(t) {
    if (!Number.isFinite(t) || t < 0) return "0:00";
    const e = Math.floor(t / 60), n = Math.floor(t % 60);
    return `${e}:${n.toString().padStart(2, "0")}`;
  }
  function nUe({ fileItem: t }) {
    const { originalFile: e, metadata: n } = t, r = Xl(e), { waveform: i, audioDuration: a } = n, s = a ?? 0, [l, c] = p.useState(false), [d, u] = p.useState(0), h = p.useRef(null), f = p.useRef(null), g = p.useMemo(() => {
      if (!i || i.length === 0) return Array(Mm).fill(0.3);
      if (i.length <= Mm) {
        const S = (i.length - 1) / (Mm - 1);
        return Array.from({
          length: Mm
        }, (T, A) => {
          const B = A * S, U = Math.floor(B), z = Math.min(Math.ceil(B), i.length - 1), O = B - U;
          return U === z ? i[U] ?? 0.3 : (i[U] ?? 0.3) * (1 - O) + (i[z] ?? 0.3) * O;
        });
      }
      const x = i.length / Mm;
      return Array.from({
        length: Mm
      }, (S, T) => {
        const A = Math.floor(T * x), B = Math.floor((T + 1) * x), U = i.slice(A, B);
        return U.length > 0 ? Math.max(...U) : 0.3;
      });
    }, [
      i
    ]), m = s > 0 ? Math.min(d / s, 1) : 0, v = p.useMemo(() => g.map((x, S) => ({
      id: `upload-audio-bar-${S}`,
      level: x,
      ratio: S / Mm
    })), [
      g
    ]);
    p.useEffect(() => {
      if (!r) return;
      const x = new Audio(r);
      x.preload = "auto", x.load(), h.current = x;
      const S = () => {
        c(false), u(0), f.current !== null && (cancelAnimationFrame(f.current), f.current = null);
      };
      return x.addEventListener("ended", S), () => {
        x.pause(), x.removeEventListener("ended", S), f.current !== null && cancelAnimationFrame(f.current);
      };
    }, [
      r
    ]);
    const y = (x) => {
      const S = () => {
        u(x.currentTime), f.current = requestAnimationFrame(S);
      };
      f.current = requestAnimationFrame(S);
    }, w = () => {
      f.current !== null && (cancelAnimationFrame(f.current), f.current = null);
    }, b = () => {
      const x = h.current;
      x && (l ? (x.pause(), c(false), w()) : (x.play().catch(() => {
      }), c(true), y(x)));
    }, j = (x, S) => {
      const T = x;
      T.seekable.length > 0 ? (T.currentTime = S, u(S)) : T.addEventListener("loadedmetadata", () => {
        T.currentTime = S, u(S);
      }, {
        once: true
      });
    }, k = (x) => {
      const S = h.current;
      if (!S || !s) return;
      const T = x.currentTarget.getBoundingClientRect(), A = Math.max(0, Math.min(1, (x.clientX - T.left) / T.width));
      j(S, A * s);
    }, C = (x) => {
      const S = h.current;
      if (!S || !s) return;
      const T = 5;
      let A = d;
      if (x.key === "ArrowLeft" || x.key === "ArrowDown") x.preventDefault(), A = Math.max(0, d - T);
      else if (x.key === "ArrowRight" || x.key === "ArrowUp") x.preventDefault(), A = Math.min(s, d + T);
      else if (x.key === "Home") x.preventDefault(), A = 0;
      else if (x.key === "End") x.preventDefault(), A = s;
      else return;
      j(S, A);
    };
    return o.jsxs(E, {
      alignItems: "Center",
      gap: "200",
      className: Kke,
      children: [
        o.jsx(Oe, {
          variant: "Secondary",
          size: "400",
          radii: "300",
          onClick: b,
          title: l ? "Pause" : "Play voice message",
          "aria-label": l ? "Pause" : "Play voice message",
          "aria-pressed": l,
          children: l ? o.jsx(oSe, {
            size: 20,
            weight: "fill"
          }) : o.jsx(aSe, {
            size: 20,
            weight: "fill"
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          alignItems: "Center",
          gap: "100",
          onClick: k,
          onKeyDown: C,
          className: Gke,
          tabIndex: 0,
          role: "slider",
          "aria-label": "Audio position",
          "aria-valuemin": 0,
          "aria-valuemax": s,
          "aria-valuenow": Math.floor(d),
          title: "Seek",
          children: v.map((x) => {
            const S = m > 0 && x.ratio <= m;
            return o.jsx("div", {
              className: `${Yke} ${S ? Zke : Jke}`,
              style: {
                height: Math.max(3, Math.round(x.level * 24))
              }
            }, x.id);
          })
        }),
        o.jsx(D, {
          size: "T200",
          className: Xke,
          children: tUe(l ? d : s)
        })
      ]
    });
  }
  function kY({ fileItem: t, onSpoiler: e, children: n }) {
    const { originalFile: r, metadata: i } = t;
    return Xl(r) ? o.jsxs(E, {
      style: {
        borderRadius: ee.radii.R300,
        overflow: "hidden",
        backgroundColor: "black",
        position: "relative"
      },
      children: [
        n,
        o.jsx(E, {
          justifyContent: "End",
          style: {
            position: "absolute",
            bottom: ee.space.S100,
            left: ee.space.S100,
            right: ee.space.S100
          },
          children: o.jsx(Qe, {
            variant: i.markedAsSpoiler ? "Warning" : "Secondary",
            fill: "Soft",
            radii: "Pill",
            "aria-pressed": i.markedAsSpoiler,
            before: o.jsx(Q, {
              src: q.EyeBlind,
              size: "50"
            }),
            onClick: () => e(!i.markedAsSpoiler),
            children: o.jsx(D, {
              size: "B300",
              children: "Spoiler"
            })
          })
        })
      ]
    }) : null;
  }
  function rUe({ isEncrypted: t, fileItem: e, setMetadata: n, setDesc: r, onRemove: i, onComplete: a, roomId: s }) {
    const l = be(), d = hce()["m.upload.size"] || 1 / 0, u = BI(e.file), { metadata: h } = e, { upload: f, startUpload: g, cancelUpload: m } = toe(l, u, t), { file: v } = f, y = v.size >= d, [w, b] = p.useState(false);
    f.status === Xi.Idle && !y && g();
    const j = (z) => {
      n(e, {
        ...h,
        markedAsSpoiler: z
      });
    }, k = () => {
      m(), i(v);
    };
    p.useEffect(() => {
      f.status === Xi.Success && (a == null ? void 0 : a(f));
    }, [
      f,
      a
    ]);
    const C = p.useMemo(() => ({
      ...fs
    }), []), x = Xd(), S = hn(), T = gs(), [A] = Fe(ge, "incomingInlineImagesDefaultHeight"), [B] = Fe(ge, "incomingInlineImagesMaxHeight"), U = p.useMemo(() => Ql(l, s, {
      settingsLinkBaseUrl: T,
      linkifyOpts: C,
      useAuthentication: S,
      handleSpoilerClick: x,
      incomingInlineImagesDefaultHeight: A,
      incomingInlineImagesMaxHeight: B
    }), [
      C,
      l,
      s,
      T,
      x,
      S,
      A,
      B
    ]);
    return o.jsxs(noe, {
      radii: "300",
      before: o.jsx(Q, {
        src: tte(q, v.type)
      }),
      after: o.jsxs(o.Fragment, {
        children: [
          f.status === Xi.Error && o.jsx(Qe, {
            as: "button",
            onClick: g,
            "aria-label": "Retry Upload",
            variant: "Critical",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "B300",
              children: "Retry"
            })
          }),
          !w && o.jsx(Oe, {
            onClick: () => {
              b(true);
            },
            "aria-label": "Add Upload Description",
            variant: "SurfaceVariant",
            radii: "Pill",
            size: "300",
            children: o.jsx(Q, {
              src: q.Pencil,
              size: "50"
            })
          }),
          w && o.jsx(ar, {
            delay: 400,
            position: "Top",
            style: {
              textAlign: "center"
            },
            tooltip: o.jsx(pr, {
              children: o.jsx(D, {
                size: "H5",
                children: "Don't forget to save your description before sending the message!"
              })
            }),
            children: (z) => o.jsx(Q, {
              ref: z,
              src: q.Info,
              size: "50"
            })
          }),
          o.jsx(Oe, {
            onClick: k,
            "aria-label": "Cancel Upload",
            variant: "SurfaceVariant",
            radii: "Pill",
            size: "300",
            children: o.jsx(Q, {
              src: q.Cross,
              size: "200"
            })
          })
        ]
      }),
      bottom: o.jsxs(o.Fragment, {
        children: [
          e.originalFile.type.startsWith("image") && o.jsx(kY, {
            fileItem: e,
            onSpoiler: j,
            children: o.jsx(Qze, {
              fileItem: e
            })
          }),
          e.originalFile.type.startsWith("video") && o.jsx(kY, {
            fileItem: e,
            onSpoiler: j,
            children: o.jsx(eUe, {
              fileItem: e
            })
          }),
          e.metadata.waveform && o.jsx(nUe, {
            fileItem: e
          }),
          f.status === Xi.Idle && !y && o.jsx(_W, {
            sentBytes: 0,
            totalBytes: v.size
          }),
          f.status === Xi.Loading && o.jsx(_W, {
            sentBytes: f.progress.loaded,
            totalBytes: v.size
          }),
          f.status === Xi.Error && o.jsx(v4, {
            children: o.jsx(D, {
              size: "T200",
              children: f.error.message
            })
          }),
          f.status === Xi.Idle && y && o.jsx(v4, {
            children: o.jsxs(D, {
              size: "T200",
              children: [
                "The file size exceeds the limit. Maximum allowed size is",
                " ",
                o.jsx("b", {
                  children: Wl(d)
                }),
                ", but the uploaded file is",
                " ",
                o.jsx("b", {
                  children: Wl(v.size)
                }),
                "."
              ]
            })
          }),
          w && o.jsx(Xze, {
            value: e.formatted_body || e.body,
            onSave: (z, O) => {
              r(e, z, O), b(false);
            },
            onCancel: () => b(false)
          }),
          !w && e.body && e.body.length > 0 && o.jsx(dn, {
            direction: "Vertical",
            variant: "SurfaceVariant",
            visibility: "Always",
            size: "300",
            style: {
              backgroundColor: "var(--sable-bg-container)",
              borderRadius: ee.radii.R400,
              maxHeight: "180px",
              marginTop: ee.space.S0,
              overflowY: "auto"
            },
            children: o.jsx(E, {
              style: {
                padding: ee.space.S200,
                wordBreak: "break-word"
              },
              children: o.jsx(D, {
                size: "T200",
                priority: "400",
                as: "div",
                children: o.jsx(hS, {
                  body: e.body,
                  customBody: e.formatted_body,
                  htmlReactParserOptions: U,
                  linkifyOpts: C
                })
              })
            })
          })
        ]
      }),
      children: [
        o.jsx(D, {
          size: "H6",
          truncate: true,
          children: v.name
        }),
        f.status === Xi.Success && o.jsx(Q, {
          style: {
            color: ct.Success.Main
          },
          src: q.Check,
          size: "100"
        })
      ]
    });
  }
  function xh({ isEncrypted: t, uploadAtom: e, onRemove: n, onComplete: r }) {
    const i = be(), s = hce()["m.upload.size"] || 1 / 0, { upload: l, startUpload: c, cancelUpload: d } = toe(i, e, t), { file: u } = l, h = u.size >= s;
    l.status === Xi.Idle && !h && c();
    const f = () => {
      d(), n(u);
    };
    return p.useEffect(() => {
      l.status === Xi.Success && (r == null ? void 0 : r(l));
    }, [
      l,
      r
    ]), o.jsx(noe, {
      compact: true,
      outlined: true,
      radii: "300",
      before: o.jsx(Q, {
        src: tte(q, u.type)
      }),
      after: o.jsxs(o.Fragment, {
        children: [
          l.status === Xi.Error && o.jsx(Qe, {
            as: "button",
            onClick: c,
            "aria-label": "Retry Upload",
            variant: "Critical",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "B300",
              children: "Retry"
            })
          }),
          o.jsx(Oe, {
            onClick: f,
            "aria-label": "Cancel Upload",
            variant: "SurfaceVariant",
            radii: "Pill",
            size: "300",
            children: o.jsx(Q, {
              src: q.Cross,
              size: "200"
            })
          })
        ]
      }),
      children: l.status === Xi.Success ? o.jsxs(o.Fragment, {
        children: [
          o.jsx(D, {
            size: "H6",
            truncate: true,
            children: u.name
          }),
          o.jsx(Q, {
            style: {
              color: ct.Success.Main
            },
            src: q.Check,
            size: "100"
          })
        ]
      }) : o.jsxs(o.Fragment, {
        children: [
          l.status === Xi.Idle && !h && o.jsx(yW, {
            sentBytes: 0,
            totalBytes: u.size
          }),
          l.status === Xi.Loading && o.jsx(yW, {
            sentBytes: l.progress.loaded,
            totalBytes: u.size
          }),
          l.status === Xi.Error && o.jsx(v4, {
            children: o.jsx(D, {
              size: "T200",
              children: l.error.message
            })
          }),
          l.status === Xi.Idle && h && o.jsx(v4, {
            children: o.jsxs(D, {
              size: "T200",
              children: [
                "The file size exceeds the limit. Maximum allowed size is",
                " ",
                o.jsx("b", {
                  children: Wl(s)
                }),
                ", but the uploaded file is",
                " ",
                o.jsx("b", {
                  children: Wl(u.size)
                }),
                "."
              ]
            })
          })
        ]
      })
    });
  }
  const bce = p.createContext(null), iUe = bce.Provider;
  function XF() {
    const t = p.useContext(bce);
    if (!t) throw new Error("Capabilities are not provided!");
    return t;
  }
  var w1 = ((t) => (t.Online = "online", t.Unavailable = "unavailable", t.Offline = "offline", t))(w1 || {});
  const M5 = (t) => ({
    presence: t.presence,
    status: t.presenceStatusMsg,
    active: t.currentlyActive,
    lastActiveTs: t.getLastActiveTs()
  }), v3 = (t) => {
    const n = be().getUser(t), [r, i] = p.useState(() => n ? M5(n) : void 0);
    return p.useEffect(() => {
      if (!n) {
        i(void 0);
        return;
      }
      i(M5(n));
      const a = (s, l) => {
        l.userId === n.userId && i(M5(n));
      };
      return n.on(Vo.Presence, a), n.on(Vo.CurrentlyActive, a), n.on(Vo.LastPresenceTs, a), () => {
        n.removeListener(Vo.Presence, a), n.removeListener(Vo.CurrentlyActive, a), n.removeListener(Vo.LastPresenceTs, a);
      };
    }, [
      n
    ]), r;
  }, oUe = () => p.useMemo(() => ({
    online: "Active",
    unavailable: "Busy",
    offline: "Away"
  }), []);
  function aUe({ current: t, onSave: e }) {
    const [n, r] = p.useState(t ?? ""), i = p.useMemo(() => Intl.supportedValuesOf("timeZone"), []);
    p.useEffect(() => r(t ?? ""), [
      t
    ]);
    const a = () => {
      const d = Intl.DateTimeFormat().resolvedOptions().timeZone;
      r(d), e(d);
    }, s = () => {
      r(""), e("");
    }, l = () => {
      const d = n.trim().slice(0, 64), u = i.find((h) => h.toLowerCase() === d.toLowerCase());
      u && u !== t && (e(u), r(u));
    }, c = (d) => {
      r(d.currentTarget.value);
    };
    return o.jsx(Ie, {
      title: "Timezone",
      focusId: "timezone",
      description: "Set manually or sync with your system.",
      after: o.jsxs(E, {
        gap: "200",
        alignItems: "Center",
        children: [
          o.jsx(mn, {
            list: "tz-list",
            value: n,
            size: "300",
            radii: "300",
            variant: "Secondary",
            placeholder: "e.g. Europe/London",
            onChange: c,
            onBlur: l,
            onKeyDown: (d) => d.key === "Enter" && l(),
            style: {
              width: "180px"
            }
          }),
          o.jsx("datalist", {
            id: "tz-list",
            children: i.map((d) => o.jsx("option", {
              value: d,
              children: d
            }, d))
          }),
          o.jsx(xe, {
            variant: "Secondary",
            fill: "Soft",
            size: "300",
            radii: "300",
            outlined: true,
            onClick: a,
            children: o.jsx(D, {
              size: "B300",
              children: "System"
            })
          }),
          o.jsx(Oe, {
            size: "300",
            variant: "Critical",
            fill: "None",
            onClick: s,
            radii: "300",
            title: "Reset",
            children: o.jsx(Q, {
              src: q.Cross,
              size: "100"
            })
          })
        ]
      })
    });
  }
  function bE(t) {
    return !t || typeof t != "string" ? [] : t.split(",").map((e) => e == null ? void 0 : e.trim()).filter(Boolean).map((e) => {
      const n = e.split(":");
      if (n.length === 1) return {
        summary: (n[0] ?? "").trim().slice(0, 16),
        language: "en"
      };
      const [r, i] = n;
      return {
        language: (r ?? "en").trim().toLowerCase() || "en",
        summary: (i ?? "").trim().slice(0, 16)
      };
    });
  }
  function sUe(t) {
    return bE(t);
  }
  const O5 = (t) => ({
    ...t,
    summary: ((t == null ? void 0 : t.summary) ?? "").slice(0, 16)
  });
  function xce(t, e, n) {
    if (!Array.isArray(t)) return [];
    if (!e) return t.map(O5);
    const r = new Set((n ?? []).filter((a) => typeof a == "string").map((a) => a.trim().toLowerCase())), i = t.filter((a) => {
      const s = ((a == null ? void 0 : a.language) ?? "en").trim().toLowerCase();
      return r.has(s);
    }).map(O5);
    return i.length > 0 ? i : t.map(O5);
  }
  const Hw = /* @__PURE__ */ new Map();
  function lUe(t, e) {
    if (!e || !t || typeof t != "string") return {
      cleanedDisplayName: t ?? "",
      inlinePronoun: null
    };
    const n = Hw.get(t);
    if (n) return n;
    const r = /(?:\(([a-zA-Z]+\/[a-zA-Z]+(?:\/[a-zA-Z]+)?)\)|\[([a-zA-Z]+\/[a-zA-Z]+(?:\/[a-zA-Z]+)?)\])/, i = t.match(r);
    let a = {
      cleanedDisplayName: t.trim(),
      inlinePronoun: null
    };
    if (i) {
      const s = i[0], l = (i[1] ?? i[2] ?? "").toLowerCase().slice(0, 16);
      a = {
        cleanedDisplayName: t.replace(s, "").trim() || t,
        inlinePronoun: l || null
      };
    }
    return Hw.size > 1e3 && Hw.clear(), Hw.set(t, a), a;
  }
  function wce({ title: t, current: e, onSave: n, disabled: r }) {
    const i = Array.isArray(e) ? e.map((d) => `${d.language ? `${d.language}:` : ""}${d.summary}`).join(", ") : "", [a, s] = p.useState(i);
    p.useEffect(() => s(i), [
      i
    ]);
    const l = () => {
      if (a === i) return;
      const d = a.slice(0, 128), u = bE(d);
      n(u);
    }, c = (d) => {
      s(d.currentTarget.value);
    };
    return o.jsx(Ie, {
      title: t,
      focusId: "pronouns",
      description: "Separate sets with commas (e.g. 'en:they/them, en:it/its, de:sie/ihr').",
      after: o.jsx(mn, {
        value: a,
        size: "300",
        radii: "300",
        disabled: r ?? false,
        variant: "Secondary",
        placeholder: "Add pronouns...",
        onChange: c,
        onBlur: l,
        onKeyDown: (d) => d.key === "Enter" && l(),
        style: {
          width: "232px"
        }
      })
    });
  }
  var cUe = "BioEditor_BioEditorContainer__1e39fec0";
  function dUe({ value: t, isSaving: e, imagePackRooms: n, onSave: r }) {
    const i = p3(), [a] = Fe(ge, "enterForNewline"), [s, l] = p.useState(), [c, d] = p.useState(false), u = p.useRef(t), h = p.useRef(false), f = p.useCallback(() => {
      const w = Hl(i.children).trim(), b = _b(lp(i.children, {}));
      r(b || w, w), d(false);
    }, [
      i,
      r
    ]);
    p.useEffect(() => {
      const w = u.current !== t, b = !h.current && t !== void 0;
      if (w || b) {
        u.current = t;
        let j = t;
        typeof j == "object" && j !== null && "formatted_body" in j && (j = j.formatted_body);
        const k = typeof j == "string" ? j : "", C = Hl(jf(k.includes("<") ? vb(k) : k)).trim();
        if (Hl(i.children).trim() === C && h.current) return;
        const S = k.includes("<") || k.includes(">"), T = jf(S ? vb(k) : k);
        i.children = T, fe.normalize(i, {
          force: true
        }), xt.select(i, fe.start(i, [])), h.current = true, d(false);
      }
    }, [
      t,
      i
    ]);
    const g = p.useCallback((w) => {
      (Yt.isKeyHotkey("mod+enter", w) || !a && Yt.isKeyHotkey("enter", w)) && (w.preventDefault(), f());
    }, [
      f,
      a
    ]), m = p.useCallback((w) => {
      if (Yt.isKeyHotkey("escape", w)) {
        w.preventDefault();
        return;
      }
      const b = gb(i), j = b ? fF(i, b, [
        al.Emoticon
      ]) : void 0;
      l(j);
    }, [
      i
    ]), v = p.useCallback(() => {
      Bt.focus(i), l(void 0);
    }, [
      i
    ]), y = (w, b) => {
      i.insertNode(YF(w, b)), Gl(i), d(true);
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(Ie, {
          title: "About You",
          focusId: "about-you",
          description: "Customize your bio."
        }),
        o.jsxs(E, {
          className: cUe,
          direction: "Column",
          style: {
            position: "relative"
          },
          children: [
            (s == null ? void 0 : s.prefix) === al.Emoticon && o.jsx(pb, {
              imagePackRooms: n || [],
              editor: i,
              query: s,
              requestClose: v
            }),
            o.jsx(oS, {
              editor: i,
              placeholder: "Write a bio...",
              onChange: () => {
                c || d(true);
              },
              onKeyDown: g,
              onKeyUp: m,
              maxHeight: "200px",
              variant: "Background",
              bottom: o.jsxs(E, {
                direction: "Column",
                style: {
                  backgroundColor: "var(--sable-bg-container)"
                },
                children: [
                  o.jsx(uS, {}),
                  o.jsxs(E, {
                    style: {
                      padding: ee.space.S200,
                      paddingTop: 0
                    },
                    alignItems: "End",
                    justifyContent: "SpaceBetween",
                    gap: "100",
                    children: [
                      o.jsx(E, {
                        gap: "200",
                        alignItems: "Center",
                        children: c && o.jsx(Qe, {
                          onClick: f,
                          variant: "Primary",
                          radii: "Pill",
                          disabled: e,
                          outlined: true,
                          before: e ? o.jsx(dt, {
                            variant: "Primary",
                            fill: "Soft",
                            size: "100"
                          }) : void 0,
                          children: o.jsx(D, {
                            size: "B300",
                            children: e ? "Saving" : "Save"
                          })
                        })
                      }),
                      o.jsxs(E, {
                        gap: "Inherit",
                        children: [
                          o.jsx(dS, {
                            variant: "Background"
                          }),
                          o.jsx(Hi, {
                            initial: void 0,
                            children: (w, b) => o.jsx(ln, {
                              anchor: w,
                              alignOffset: -8,
                              position: "Top",
                              align: "End",
                              content: o.jsx(JF, {
                                imagePackRooms: n ?? [],
                                returnFocusOnDeactivate: false,
                                onEmojiSelect: y,
                                onCustomEmojiSelect: y,
                                requestClose: () => b((j) => {
                                  if (j) {
                                    Dr() || Bt.focus(i);
                                    return;
                                  }
                                  return j;
                                })
                              }),
                              children: o.jsx(Oe, {
                                "aria-pressed": w !== void 0,
                                variant: "Background",
                                size: "300",
                                radii: "300",
                                onClick: (j) => b(j.currentTarget.getBoundingClientRect()),
                                children: o.jsx(Q, {
                                  size: "400",
                                  src: q.Smile,
                                  filled: w !== void 0
                                })
                              })
                            })
                          })
                        ]
                      })
                    ]
                  })
                ]
              })
            })
          ]
        })
      ]
    });
  }
  function fS() {
    return (fS = Object.assign || function(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e];
        for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
      }
      return t;
    }).apply(this, arguments);
  }
  function Dce(t, e) {
    if (t == null) return {};
    var n, r, i = {}, a = Object.keys(t);
    for (r = 0; r < a.length; r++) e.indexOf(n = a[r]) >= 0 || (i[n] = t[n]);
    return i;
  }
  function MI(t) {
    var e = p.useRef(t), n = p.useRef(function(r) {
      e.current && e.current(r);
    });
    return e.current = t, n.current;
  }
  var yb = function(t, e, n) {
    return e === void 0 && (e = 0), n === void 0 && (n = 1), t > n ? n : t < e ? e : t;
  }, l2 = function(t) {
    return "touches" in t;
  }, OI = function(t) {
    return t && t.ownerDocument.defaultView || self;
  }, SY = function(t, e, n) {
    var r = t.getBoundingClientRect(), i = l2(e) ? (function(a, s) {
      for (var l = 0; l < a.length; l++) if (a[l].identifier === s) return a[l];
      return a[0];
    })(e.touches, n) : e;
    return {
      left: yb((i.pageX - (r.left + OI(t).pageXOffset)) / r.width),
      top: yb((i.pageY - (r.top + OI(t).pageYOffset)) / r.height)
    };
  }, jY = function(t) {
    !l2(t) && t.preventDefault();
  }, Cce = yn.memo(function(t) {
    var e = t.onMove, n = t.onKey, r = Dce(t, [
      "onMove",
      "onKey"
    ]), i = p.useRef(null), a = MI(e), s = MI(n), l = p.useRef(null), c = p.useRef(false), d = p.useMemo(function() {
      var g = function(y) {
        jY(y), (l2(y) ? y.touches.length > 0 : y.buttons > 0) && i.current ? a(SY(i.current, y, l.current)) : v(false);
      }, m = function() {
        return v(false);
      };
      function v(y) {
        var w = c.current, b = OI(i.current), j = y ? b.addEventListener : b.removeEventListener;
        j(w ? "touchmove" : "mousemove", g), j(w ? "touchend" : "mouseup", m);
      }
      return [
        function(y) {
          var w = y.nativeEvent, b = i.current;
          if (b && (jY(w), !(function(k, C) {
            return C && !l2(k);
          })(w, c.current) && b)) {
            if (l2(w)) {
              c.current = true;
              var j = w.changedTouches || [];
              j.length && (l.current = j[0].identifier);
            }
            b.focus(), a(SY(b, w, l.current)), v(true);
          }
        },
        function(y) {
          var w = y.which || y.keyCode;
          w < 37 || w > 40 || (y.preventDefault(), s({
            left: w === 39 ? 0.05 : w === 37 ? -0.05 : 0,
            top: w === 40 ? 0.05 : w === 38 ? -0.05 : 0
          }));
        },
        v
      ];
    }, [
      s,
      a
    ]), u = d[0], h = d[1], f = d[2];
    return p.useEffect(function() {
      return f;
    }, [
      f
    ]), yn.createElement("div", fS({}, r, {
      onTouchStart: u,
      onMouseDown: u,
      className: "react-colorful__interactive",
      ref: i,
      onKeyDown: h,
      tabIndex: 0,
      role: "slider"
    }));
  }), jM = function(t) {
    return t.filter(Boolean).join(" ");
  }, Ece = function(t) {
    var e = t.color, n = t.left, r = t.top, i = r === void 0 ? 0.5 : r, a = jM([
      "react-colorful__pointer",
      t.className
    ]);
    return yn.createElement("div", {
      className: a,
      style: {
        top: 100 * i + "%",
        left: 100 * n + "%"
      }
    }, yn.createElement("div", {
      className: "react-colorful__pointer-fill",
      style: {
        backgroundColor: e
      }
    }));
  }, Ca = function(t, e, n) {
    return e === void 0 && (e = 0), n === void 0 && (n = Math.pow(10, e)), Math.round(n * t) / n;
  }, uUe = function(t) {
    return pUe(LI(t));
  }, LI = function(t) {
    return t[0] === "#" && (t = t.substring(1)), t.length < 6 ? {
      r: parseInt(t[0] + t[0], 16),
      g: parseInt(t[1] + t[1], 16),
      b: parseInt(t[2] + t[2], 16),
      a: t.length === 4 ? Ca(parseInt(t[3] + t[3], 16) / 255, 2) : 1
    } : {
      r: parseInt(t.substring(0, 2), 16),
      g: parseInt(t.substring(2, 4), 16),
      b: parseInt(t.substring(4, 6), 16),
      a: t.length === 8 ? Ca(parseInt(t.substring(6, 8), 16) / 255, 2) : 1
    };
  }, hUe = function(t) {
    return gUe(mUe(t));
  }, fUe = function(t) {
    var e = t.s, n = t.v, r = t.a, i = (200 - e) * n / 100;
    return {
      h: Ca(t.h),
      s: Ca(i > 0 && i < 200 ? e * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
      l: Ca(i / 2),
      a: Ca(r, 2)
    };
  }, NI = function(t) {
    var e = fUe(t);
    return "hsl(" + e.h + ", " + e.s + "%, " + e.l + "%)";
  }, mUe = function(t) {
    var e = t.h, n = t.s, r = t.v, i = t.a;
    e = e / 360 * 6, n /= 100, r /= 100;
    var a = Math.floor(e), s = r * (1 - n), l = r * (1 - (e - a) * n), c = r * (1 - (1 - e + a) * n), d = a % 6;
    return {
      r: Ca(255 * [
        r,
        l,
        s,
        s,
        c,
        r
      ][d]),
      g: Ca(255 * [
        c,
        r,
        r,
        l,
        s,
        s
      ][d]),
      b: Ca(255 * [
        s,
        s,
        c,
        r,
        r,
        l
      ][d]),
      a: Ca(i, 2)
    };
  }, $w = function(t) {
    var e = t.toString(16);
    return e.length < 2 ? "0" + e : e;
  }, gUe = function(t) {
    var e = t.r, n = t.g, r = t.b, i = t.a, a = i < 1 ? $w(Ca(255 * i)) : "";
    return "#" + $w(e) + $w(n) + $w(r) + a;
  }, pUe = function(t) {
    var e = t.r, n = t.g, r = t.b, i = t.a, a = Math.max(e, n, r), s = a - Math.min(e, n, r), l = s ? a === e ? (n - r) / s : a === n ? 2 + (r - e) / s : 4 + (e - n) / s : 0;
    return {
      h: Ca(60 * (l < 0 ? l + 6 : l)),
      s: Ca(a ? s / a * 100 : 0),
      v: Ca(a / 255 * 100),
      a: i
    };
  }, FUe = yn.memo(function(t) {
    var e = t.hue, n = t.onChange, r = jM([
      "react-colorful__hue",
      t.className
    ]);
    return yn.createElement("div", {
      className: r
    }, yn.createElement(Cce, {
      onMove: function(i) {
        n({
          h: 360 * i.left
        });
      },
      onKey: function(i) {
        n({
          h: yb(e + 360 * i.left, 0, 360)
        });
      },
      "aria-label": "Hue",
      "aria-valuenow": Ca(e),
      "aria-valuemax": "360",
      "aria-valuemin": "0"
    }, yn.createElement(Ece, {
      className: "react-colorful__hue-pointer",
      left: e / 360,
      color: NI({
        h: e,
        s: 100,
        v: 100,
        a: 1
      })
    })));
  }), vUe = yn.memo(function(t) {
    var e = t.hsva, n = t.onChange, r = {
      backgroundColor: NI({
        h: e.h,
        s: 100,
        v: 100,
        a: 1
      })
    };
    return yn.createElement("div", {
      className: "react-colorful__saturation",
      style: r
    }, yn.createElement(Cce, {
      onMove: function(i) {
        n({
          s: 100 * i.left,
          v: 100 - 100 * i.top
        });
      },
      onKey: function(i) {
        n({
          s: yb(e.s + 100 * i.left, 0, 100),
          v: yb(e.v - 100 * i.top, 0, 100)
        });
      },
      "aria-label": "Color",
      "aria-valuetext": "Saturation " + Ca(e.s) + "%, Brightness " + Ca(e.v) + "%"
    }, yn.createElement(Ece, {
      className: "react-colorful__saturation-pointer",
      top: 1 - e.v / 100,
      left: e.s / 100,
      color: NI(e)
    })));
  }), kce = function(t, e) {
    if (t === e) return true;
    for (var n in t) if (t[n] !== e[n]) return false;
    return true;
  }, _Ue = function(t, e) {
    return t.toLowerCase() === e.toLowerCase() || kce(LI(t), LI(e));
  };
  function yUe(t, e, n) {
    var r = MI(n), i = p.useState(function() {
      return t.toHsva(e);
    }), a = i[0], s = i[1], l = p.useRef({
      color: e,
      hsva: a
    });
    p.useEffect(function() {
      if (!t.equal(e, l.current.color)) {
        var d = t.toHsva(e);
        l.current = {
          hsva: d,
          color: e
        }, s(d);
      }
    }, [
      e,
      t
    ]), p.useEffect(function() {
      var d;
      kce(a, l.current.hsva) || t.equal(d = t.fromHsva(a), l.current.color) || (l.current = {
        hsva: a,
        color: d
      }, r(d));
    }, [
      a,
      t,
      r
    ]);
    var c = p.useCallback(function(d) {
      s(function(u) {
        return Object.assign({}, u, d);
      });
    }, []);
    return [
      a,
      c
    ];
  }
  var bUe = typeof window < "u" ? p.useLayoutEffect : p.useEffect, xUe = function() {
    return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0;
  }, TY = /* @__PURE__ */ new Map(), wUe = function(t) {
    bUe(function() {
      var e = t.current ? t.current.ownerDocument : document;
      if (e !== void 0 && !TY.has(e)) {
        var n = e.createElement("style");
        n.innerHTML = `.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`, TY.set(e, n);
        var r = xUe();
        r && n.setAttribute("nonce", r), e.head.appendChild(n);
      }
    }, []);
  }, DUe = function(t) {
    var e = t.className, n = t.colorModel, r = t.color, i = r === void 0 ? n.defaultColor : r, a = t.onChange, s = Dce(t, [
      "className",
      "colorModel",
      "color",
      "onChange"
    ]), l = p.useRef(null);
    wUe(l);
    var c = yUe(n, i, a), d = c[0], u = c[1], h = jM([
      "react-colorful",
      e
    ]);
    return yn.createElement("div", fS({}, s, {
      ref: l,
      className: h
    }), yn.createElement(vUe, {
      hsva: d,
      onChange: u
    }), yn.createElement(FUe, {
      hue: d.h,
      onChange: u,
      className: "react-colorful__last-control"
    }));
  }, CUe = {
    defaultColor: "000",
    toHsva: uUe,
    fromHsva: function(t) {
      return hUe({
        h: t.h,
        s: t.s,
        v: t.v,
        a: 1
      });
    },
    equal: _Ue
  }, Sce = function(t) {
    return yn.createElement(DUe, fS({}, t, {
      colorModel: CUe
    }));
  };
  function jce({ picker: t, onRemove: e, children: n }) {
    const [r, i] = p.useState(), a = (s) => {
      i(s.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: r,
      position: "Bottom",
      align: "Center",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          onDeactivate: () => i(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          style: {
            padding: ee.space.S100,
            borderRadius: ee.radii.R500,
            overflow: "initial"
          },
          children: o.jsxs(E, {
            direction: "Column",
            gap: "200",
            children: [
              t,
              e && o.jsx(xe, {
                size: "300",
                variant: "Secondary",
                fill: "Soft",
                radii: "400",
                onClick: () => e(),
                children: o.jsx(D, {
                  size: "B300",
                  children: "Remove"
                })
              })
            ]
          })
        })
      }),
      children: n(a, !!r)
    });
  }
  const Ww = (t) => t ? t.replaceAll(/^["']|["']$/g, "") : "";
  function yy({ title: t, description: e, focusId: n, current: r, onSave: i, disabled: a }) {
    const [s, l] = p.useState(Ww(r) || "#FFFFFF"), [c, d] = p.useState(false);
    p.useEffect(() => {
      const g = Ww(r);
      l(g || "#FFFFFF");
    }, [
      r
    ]);
    const u = (g) => {
      let m = Ww(g);
      m = m.startsWith("#") ? m : `#${m}`, l(m);
      const v = Ww(r) || "#FFFFFF";
      d(m.toUpperCase() !== v.toUpperCase());
    }, h = () => {
      /^#[0-9A-F]{6}$/i.test(s) && (i(s), d(false));
    }, f = () => {
      i(null), d(false), l("#FFFFFF");
    };
    return o.jsx(E, {
      direction: "Column",
      gap: "100",
      children: o.jsx(Ie, {
        title: t,
        focusId: n,
        description: e,
        after: o.jsx(E, {
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          gap: "300",
          style: {
            padding: ee.space.S100,
            backgroundColor: "var(--sable-surface-container)",
            borderRadius: ee.radii.R400
          },
          children: o.jsxs(E, {
            alignItems: "Center",
            gap: "300",
            grow: "Yes",
            children: [
              c && o.jsx(xe, {
                variant: "Primary",
                size: "300",
                radii: "Pill",
                onClick: h,
                disabled: !/^#[0-9A-F]{6}$/i.test(s),
                children: o.jsx(D, {
                  size: "B300",
                  children: "Save"
                })
              }),
              o.jsx(jce, {
                picker: o.jsx(Sce, {
                  color: s,
                  onChange: u
                }),
                children: (g, m) => o.jsx(xe, {
                  onClick: g,
                  size: "400",
                  variant: "Secondary",
                  fill: "None",
                  radii: "300",
                  disabled: a ?? false,
                  style: {
                    padding: ee.space.S100,
                    border: `2px solid ${m ? "var(--sable-primary-main)" : "var(--sable-border-focus)"}`
                  },
                  children: o.jsx(E, {
                    style: {
                      width: "32px",
                      height: "32px",
                      borderRadius: "50%",
                      backgroundColor: s,
                      boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.1)"
                    }
                  })
                })
              }),
              o.jsxs(E, {
                direction: "Row",
                alignItems: "Center",
                gap: "100",
                children: [
                  o.jsx(mn, {
                    value: s,
                    onChange: (g) => u(g.currentTarget.value),
                    placeholder: "#FFFFFF",
                    variant: "Background",
                    size: "300",
                    radii: "300",
                    disabled: a ?? false,
                    style: {
                      textTransform: "uppercase",
                      fontFamily: "monospace",
                      width: "100px"
                    }
                  }),
                  r && o.jsx(Oe, {
                    variant: "Secondary",
                    size: "300",
                    radii: "300",
                    disabled: a ?? false,
                    onClick: f,
                    title: "Reset to default",
                    children: o.jsx(Q, {
                      src: q.Cross,
                      size: "100"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function EUe({ current: t = "", onSave: e }) {
    const [n, r] = p.useState(t), [i, a] = p.useState(false);
    p.useEffect(() => {
      r(t);
    }, [
      t
    ]);
    const s = (u) => {
      r(u.currentTarget.value);
    }, l = () => {
      r(t);
    }, c = async (u) => {
      if (u.preventDefault(), !i && n !== t) {
        a(true);
        try {
          await e(n);
        } finally {
          a(false);
        }
      }
    }, d = n !== t;
    return o.jsx(Ie, {
      title: "Status",
      focusId: "status",
      children: o.jsx(E, {
        direction: "Column",
        grow: "Yes",
        gap: "100",
        children: o.jsxs(E, {
          as: "form",
          onSubmit: c,
          gap: "200",
          "aria-disabled": i,
          grow: "Yes",
          children: [
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(mn, {
                name: "statusInput",
                value: n,
                onChange: s,
                placeholder: "What's on your mind?",
                variant: "Secondary",
                radii: "300",
                style: {
                  paddingRight: ee.space.S200
                },
                readOnly: i,
                after: d && !i && o.jsx(Oe, {
                  type: "reset",
                  onClick: l,
                  size: "300",
                  radii: "300",
                  variant: "Secondary",
                  children: o.jsx(Q, {
                    src: q.Cross,
                    size: "100"
                  })
                })
              })
            }),
            o.jsxs(xe, {
              size: "400",
              variant: d ? "Success" : "Secondary",
              fill: d ? "Solid" : "Soft",
              outlined: true,
              radii: "300",
              disabled: !d || i,
              type: "submit",
              children: [
                i && o.jsx(dt, {
                  variant: "Success",
                  fill: "Solid",
                  size: "300"
                }),
                o.jsx(D, {
                  size: "B400",
                  children: "Save"
                })
              ]
            })
          ]
        })
      })
    });
  }
  function kUe({ profile: t, userId: e }) {
    var _a6, _b3;
    const n = be(), r = Fn(z2), [i, a] = Fe(ge, "renderAnimals"), s = t.isCat || ((_a6 = t.extended) == null ? void 0 : _a6[qg]) === true, l = t.hasCats || ((_b3 = t.extended) == null ? void 0 : _b3[Kg]) === true, c = p.useCallback(async (d, u) => {
      var _a7;
      await ((_a7 = n.setExtendedProfileProperty) == null ? void 0 : _a7.call(n, d, u)), r((h) => {
        const f = {
          ...h
        };
        return delete f[e], f;
      });
    }, [
      n,
      e,
      r
    ]);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Animal Identity"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Render Animals",
            focusId: "render-animals",
            description: "Render animals as animals as opposed to normal humans.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: i,
              onChange: a
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Is Cat",
            focusId: "is-cat",
            description: "Marks you as a cat.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: s,
              onChange: () => c(qg, !s)
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Has Cats",
            focusId: "has-cats",
            description: "Marks that you have cats.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: l,
              onChange: () => c(Kg, !l)
            })
          })
        })
      ]
    });
  }
  function SUe({ profile: t, userId: e }) {
    var _a6;
    const n = be(), r = hn(), i = XF(), [a, s] = p.useState(false), l = ((_a6 = i["m.set_avatar_url"]) == null ? void 0 : _a6.enabled) === false, c = t.displayName ?? _n(e) ?? e, d = t.avatarUrl ? Cn(n, t.avatarUrl, r, 96, 96, "crop") ?? void 0 : void 0, [u, h] = p.useState(), f = Xl(u), g = p.useMemo(() => {
      if (u) return Yd(u);
    }, [
      u
    ]), m = ed(h, false), v = p.useCallback(() => {
      h(void 0);
    }, []), y = p.useCallback((b) => {
      const { mxc: j } = b;
      n.setAvatarUrl(j), v();
    }, [
      n,
      v
    ]), w = () => {
      n.setAvatarUrl(""), s(false);
    };
    return o.jsxs(Ie, {
      title: "Avatar",
      focusId: "avatar",
      after: o.jsx(xn, {
        size: "500",
        radii: "300",
        children: o.jsx(Si, {
          userId: e,
          src: d,
          renderFallback: () => o.jsx(D, {
            size: "H4",
            children: Vi(c)
          })
        })
      }),
      children: [
        g ? o.jsx(E, {
          gap: "200",
          direction: "Column",
          children: o.jsx(xh, {
            uploadAtom: g,
            onRemove: v,
            onComplete: y
          })
        }) : o.jsxs(E, {
          gap: "200",
          children: [
            o.jsx(xe, {
              onClick: () => m("image/*"),
              size: "300",
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              radii: "300",
              disabled: l,
              children: o.jsx(D, {
                size: "B300",
                children: "Upload"
              })
            }),
            d && o.jsx(xe, {
              size: "300",
              variant: "Critical",
              fill: "None",
              radii: "300",
              disabled: l,
              onClick: () => s(true),
              children: o.jsx(D, {
                size: "B300",
                children: "Remove"
              })
            })
          ]
        }),
        f && o.jsx(Hn, {
          open: false,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: v,
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                className: OF,
                variant: "Surface",
                size: "500",
                children: o.jsx(eoe, {
                  name: (u == null ? void 0 : u.name) ?? "Unnamed",
                  url: f,
                  requestClose: v
                })
              })
            })
          })
        }),
        o.jsx(Hn, {
          open: a,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => s(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsxs(lr, {
                variant: "Surface",
                children: [
                  o.jsxs(wn, {
                    style: {
                      padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                      borderBottomWidth: ee.borderWidth.B300
                    },
                    variant: "Surface",
                    size: "500",
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: "Remove Avatar"
                        })
                      }),
                      o.jsx(Oe, {
                        size: "300",
                        onClick: () => s(false),
                        radii: "300",
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    style: {
                      padding: ee.space.S400
                    },
                    direction: "Column",
                    gap: "400",
                    children: [
                      o.jsx(E, {
                        direction: "Column",
                        gap: "200",
                        children: o.jsx(D, {
                          priority: "400",
                          children: "Are you sure you want to remove profile avatar?"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Critical",
                        onClick: w,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Remove"
                        })
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function jUe({ profile: t }) {
    const e = be(), n = hn(), [r, i] = p.useState(false), [a, s] = p.useState(), [l, c] = p.useState(false), d = t.bannerUrl ? Cn(e, t.bannerUrl, n) ?? void 0 : void 0;
    p.useEffect(() => {
      d && s(void 0);
    }, [
      d
    ]);
    const [u, h] = p.useState(), f = Xl(u), g = p.useMemo(() => {
      if (u) return Yd(u);
    }, [
      u
    ]), m = ed(h, false), v = p.useCallback(() => {
      c(false), s(void 0), m("image/*");
    }, [
      m
    ]), y = p.useCallback(() => {
      h(void 0);
    }, []), w = p.useCallback((k) => {
      var _a6;
      const { mxc: C } = k;
      f && s(f), (_a6 = e.setExtendedProfileProperty) == null ? void 0 : _a6.call(e, J1, C), h(void 0);
    }, [
      e,
      f
    ]), b = async () => {
      var _a6;
      c(true), s(void 0), h(void 0), await ((_a6 = e.setExtendedProfileProperty) == null ? void 0 : _a6.call(e, J1, null)), i(false);
    }, j = l ? void 0 : f || a || d;
    return o.jsxs(Ie, {
      title: "Banner",
      focusId: "banner",
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "300",
          grow: "Yes",
          children: [
            o.jsx(E, {
              style: {
                height: "100px",
                width: "100%",
                borderRadius: ee.radii.R400,
                overflow: "hidden",
                backgroundColor: "var(--sable-surface-container)",
                position: "relative",
                display: "flex",
                alignItems: "center",
                justifyContent: "center"
              },
              children: j ? o.jsx("img", {
                src: j,
                style: {
                  width: "100%",
                  height: "100%",
                  objectFit: "cover"
                },
                alt: "Banner Preview"
              }, j) : o.jsx(E, {
                justifyContent: "Center",
                alignItems: "Center",
                children: o.jsx(D, {
                  priority: "300",
                  size: "T200",
                  children: "No Banner Set"
                })
              })
            }),
            g ? o.jsx(E, {
              gap: "200",
              direction: "Column",
              children: o.jsx(xh, {
                uploadAtom: g,
                onRemove: y,
                onComplete: w
              })
            }) : o.jsxs(E, {
              gap: "200",
              children: [
                o.jsx(xe, {
                  onClick: v,
                  size: "300",
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  children: o.jsx(D, {
                    size: "B300",
                    children: d ? "Change Banner" : "Upload Banner"
                  })
                }),
                d && o.jsx(xe, {
                  size: "300",
                  variant: "Critical",
                  fill: "None",
                  radii: "300",
                  onClick: () => i(true),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Remove"
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(Hn, {
          open: r,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => i(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsxs(lr, {
                variant: "Surface",
                children: [
                  o.jsxs(wn, {
                    style: {
                      padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                      borderBottomWidth: ee.borderWidth.B300
                    },
                    variant: "Surface",
                    size: "500",
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: "Remove Banner"
                        })
                      }),
                      o.jsx(Oe, {
                        size: "300",
                        onClick: () => i(false),
                        radii: "300",
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    style: {
                      padding: ee.space.S400
                    },
                    direction: "Column",
                    gap: "400",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        children: "Are you sure you want to remove profile banner?"
                      }),
                      o.jsx(xe, {
                        variant: "Critical",
                        onClick: b,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Remove"
                        })
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function TUe({ profile: t, userId: e }) {
    var _a6;
    const n = be(), i = ((_a6 = XF()["m.set_displayname"]) == null ? void 0 : _a6.enabled) === false, a = t.displayName ?? _n(e) ?? e, [s, l] = p.useState(a), [c, d] = Et(p.useCallback((v) => n.setDisplayName(v), [
      n
    ])), u = c.status === ve.Loading;
    p.useEffect(() => {
      l(a);
    }, [
      a
    ]);
    const h = (v) => {
      const y = v.currentTarget.value;
      l(y);
    }, f = () => {
      l(a);
    }, g = (v) => {
      var _a7, _b3;
      if (v.preventDefault(), u) return;
      const b = (_b3 = (_a7 = v.target) == null ? void 0 : _a7.displayNameInput) == null ? void 0 : _b3.value;
      b && d(b);
    }, m = s !== a;
    return o.jsx(Ie, {
      title: "Display Name",
      focusId: "display-name",
      children: o.jsx(E, {
        direction: "Column",
        grow: "Yes",
        gap: "100",
        children: o.jsxs(E, {
          as: "form",
          onSubmit: g,
          gap: "200",
          "aria-disabled": u || i,
          children: [
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(mn, {
                required: true,
                name: "displayNameInput",
                value: s,
                onChange: h,
                variant: "Secondary",
                radii: "300",
                style: {
                  paddingRight: ee.space.S200
                },
                readOnly: u || i,
                after: m && !u && o.jsx(Oe, {
                  type: "reset",
                  onClick: f,
                  size: "300",
                  radii: "300",
                  variant: "Secondary",
                  children: o.jsx(Q, {
                    src: q.Cross,
                    size: "100"
                  })
                })
              })
            }),
            o.jsxs(xe, {
              size: "400",
              variant: m ? "Success" : "Secondary",
              fill: m ? "Solid" : "Soft",
              outlined: true,
              radii: "300",
              disabled: !m || u,
              type: "submit",
              children: [
                u && o.jsx(dt, {
                  variant: "Success",
                  fill: "Solid",
                  size: "300"
                }),
                o.jsx(D, {
                  size: "B400",
                  children: "Save"
                })
              ]
            })
          ]
        })
      })
    });
  }
  function RUe({ profile: t, userId: e }) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3, _l3, _m2;
    const n = be(), r = Fn(z2), i = t.pronouns || [], a = v3(e), s = (a == null ? void 0 : a.status) || "", l = /* @__PURE__ */ new Set([
      qg,
      Kg
    ]), c = Object.entries(t.extended || {}).filter(([h]) => !l.has(h)), d = p.useCallback(async (h, f) => {
      var _a7;
      await ((_a7 = n.setExtendedProfileProperty) == null ? void 0 : _a7.call(n, h, f)), r((g) => {
        const m = {
          ...g
        };
        return delete m[e], m;
      });
    }, [
      n,
      e,
      r
    ]), u = p.useCallback(async (h) => {
      const f = (a == null ? void 0 : a.presence) || "online";
      await n.setPresence({
        presence: f,
        status_msg: h
      });
    }, [
      n,
      a
    ]);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Extended Profile"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(EUe, {
            current: s,
            onSave: u
          })
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(yy, {
              title: "General Global Name Color",
              description: "Custom name color everywhere names have color!",
              focusId: "name-color",
              current: t.nameColor || ((_a6 = t.extended) == null ? void 0 : _a6[Z1]),
              onSave: (h) => d(Z1, h)
            }),
            o.jsx(yy, {
              title: "Dark theme Global Name Color",
              description: "Your name's color for a dark theme user.",
              focusId: "name-color-dark-theme",
              current: t.nameColorDark || ((_b3 = t.extended) == null ? void 0 : _b3[$2]),
              onSave: (h) => d($2, h)
            }),
            o.jsx(yy, {
              title: "Light theme Global Name Color",
              description: "Your name's color for a light theme user.",
              focusId: "name-color-light-theme",
              current: t.nameColorLight || ((_c3 = t.extended) == null ? void 0 : _c3[W2]),
              onSave: (h) => d(W2, h)
            })
          ]
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(wce, {
            title: "Pronouns",
            current: i,
            onSave: (h) => d(Of, h)
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(aUe, {
            current: t.timezone,
            onSave: (h) => {
              d(V2, h), d(H2, h);
            }
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(dUe, {
            value: ((_g4 = (_f4 = (_e13 = (_d4 = t.extended) == null ? void 0 : _d4[i4]) == null ? void 0 : _e13["m.text"]) == null ? void 0 : _f4[0]) == null ? void 0 : _g4.body) || ((_h4 = t.extended) == null ? void 0 : _h4[Wg]) || ((_i7 = t.extended) == null ? void 0 : _i7[Gg]) || t.bio,
            onSave: (h, f) => {
              d(Wg, h), d(i4, {
                "m.text": [
                  {
                    body: h,
                    mimetype: "text/html"
                  },
                  {
                    body: f
                  }
                ]
              });
              const g = h.replaceAll("<br/></blockquote>", "</blockquote>");
              d(Gg, {
                format: "org.matrix.custom.html",
                formatted_body: g
              });
            }
          })
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(yy, {
              title: "Background Color",
              description: "The background color that will be used when making your profile card",
              focusId: "user-hero-color",
              current: (_j3 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _j3.color,
              onSave: (h) => {
                var _a7;
                return d(o4, {
                  color: h,
                  brightness: h ? (_a7 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _a7.brightness : null
                });
              }
            }),
            o.jsx(Oe, {
              variant: ((_k3 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _k3.brightness) === "dark" ? "Primary" : "Warning",
              onClick: () => {
                var _a7, _b4;
                return d(o4, {
                  color: (_a7 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _a7.color,
                  brightness: ((_b4 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _b4.brightness) === "dark" ? "light" : "dark"
                });
              },
              children: o.jsxs(E, {
                gap: "200",
                direction: "Row",
                children: [
                  o.jsx(D, {
                    truncate: true,
                    children: ((_l3 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _l3.brightness) === "dark" ? "Dark Mode" : "Light Mode"
                  }),
                  o.jsx(Q, {
                    src: ((_m2 = t == null ? void 0 : t.heroColorScheme) == null ? void 0 : _m2.brightness) === "dark" ? q.Star : q.Sun,
                    size: "200"
                  })
                ]
              })
            })
          ]
        }),
        c.length > 0 && c.map(([h, f]) => {
          if (typeof f != "string" && typeof f != "number" && typeof f != "boolean") return null;
          const g = String(f);
          return typeof f != "string" && typeof f != "number" && typeof f != "boolean" || g.length > 256 ? null : o.jsx(Te, {
            className: Xe,
            variant: "SurfaceVariant",
            direction: "Column",
            gap: "400",
            children: o.jsx(Ie, {
              focusId: `profile-field-${MF(h)}`,
              showSettingLinkAction: false,
              title: h.split(".").pop() || h,
              description: h,
              after: o.jsx(D, {
                size: "T300",
                truncate: true,
                children: g
              })
            }, h)
          }, h);
        })
      ]
    });
  }
  function AUe() {
    const e = be().getUserId(), n = Hc(e);
    return o.jsxs(E, {
      direction: "Column",
      gap: "700",
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Profile"
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(jUe, {
                profile: n
              })
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(SUe, {
                userId: e,
                profile: n
              })
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(TUe, {
                userId: e,
                profile: n
              })
            })
          ]
        }),
        o.jsx(RUe, {
          userId: e,
          profile: n
        }),
        o.jsx(kUe, {
          userId: e,
          profile: n
        })
      ]
    });
  }
  function IUe() {
    var _a6;
    const t = be(), [e, n] = Et(p.useCallback(() => t.getThreePids(), [
      t
    ])), i = (_a6 = e.status === ve.Success ? e.data.threepids : void 0) == null ? void 0 : _a6.filter((a) => a.medium === "email");
    return p.useEffect(() => {
      n();
    }, [
      n
    ]), o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Contact Information"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Email Address",
            focusId: "email-address",
            description: "Email address attached to your account.",
            children: o.jsx(E, {
              children: i == null ? void 0 : i.map((a) => o.jsx(Qe, {
                as: "span",
                variant: "Secondary",
                radii: "Pill",
                children: o.jsx(D, {
                  size: "T200",
                  children: a.address
                })
              }, a.address))
            })
          })
        })
      ]
    });
  }
  function BUe({ userList: t }) {
    const e = be(), [n, r] = p.useState(""), i = Kr(), [a, s] = Et(p.useCallback(async (h) => {
      await e.setIgnoredUsers([
        ...t,
        h
      ]);
    }, [
      e,
      t
    ])), l = a.status === ve.Loading, c = (h) => {
      const f = h.currentTarget.value;
      r(f);
    }, d = () => {
      r("");
    }, u = (h) => {
      var _a6, _b3;
      if (h.preventDefault(), l) return;
      const m = (_b3 = (_a6 = h.target) == null ? void 0 : _a6.userIdInput) == null ? void 0 : _b3.value.trim();
      m && co(m) && s(m).then(() => {
        i() && r("");
      });
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: u,
      gap: "200",
      "aria-disabled": l,
      children: [
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsx(mn, {
            required: true,
            name: "userIdInput",
            value: n,
            onChange: c,
            variant: "Secondary",
            radii: "300",
            style: {
              paddingRight: ee.space.S200
            },
            readOnly: l,
            after: n && !l && o.jsx(Oe, {
              type: "reset",
              onClick: d,
              size: "300",
              radii: "300",
              variant: "Secondary",
              children: o.jsx(Q, {
                src: q.Cross,
                size: "100"
              })
            })
          })
        }),
        o.jsxs(xe, {
          size: "400",
          variant: "Secondary",
          fill: "Soft",
          outlined: true,
          radii: "300",
          type: "submit",
          disabled: l,
          children: [
            l && o.jsx(dt, {
              variant: "Secondary",
              size: "300"
            }),
            o.jsx(D, {
              size: "B400",
              children: "Block"
            })
          ]
        })
      ]
    });
  }
  function PUe({ userId: t, userList: e }) {
    const n = be(), [r, i] = Et(p.useCallback(() => n.setIgnoredUsers(e.filter((l) => l !== t)), [
      n,
      t,
      e
    ])), a = () => i(), s = r.status === ve.Loading;
    return o.jsx(Qe, {
      variant: "Secondary",
      radii: "Pill",
      after: s ? o.jsx(dt, {
        variant: "Secondary",
        size: "100"
      }) : o.jsx(Q, {
        src: q.Cross,
        size: "100"
      }),
      onClick: a,
      disabled: s,
      children: o.jsx(D, {
        size: "T200",
        truncate: true,
        children: t
      })
    });
  }
  function MUe() {
    const t = kp();
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(E, {
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          gap: "200",
          children: o.jsx(D, {
            size: "L400",
            children: "Blocked Users"
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Select User",
            focusId: "blocked-users",
            description: "Prevent receiving messages or invites from user by adding their userId.",
            children: o.jsxs(E, {
              direction: "Column",
              gap: "300",
              children: [
                o.jsx(BUe, {
                  userList: t
                }),
                t.length > 0 && o.jsxs(E, {
                  direction: "Inherit",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Users"
                    }),
                    o.jsx(E, {
                      wrap: "Wrap",
                      gap: "200",
                      children: t.map((e) => o.jsx(PUe, {
                        userId: e,
                        userList: t
                      }, e))
                    })
                  ]
                })
              ]
            })
          })
        })
      ]
    });
  }
  function OUe({ requestBack: t, requestClose: e }) {
    return o.jsx(Qc, {
      title: "Account",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsx(AUe, {}),
                o.jsx(Oke, {}),
                o.jsx(IUe, {}),
                o.jsx(MUe, {})
              ]
            })
          })
        })
      })
    });
  }
  function Kc({ value: t, options: e, onSelect: n, disabled: r = false, loading: i = false, position: a = "Bottom", align: s = "End", offset: l = 5, renderTrigger: c, renderOption: d }) {
    const [u, h] = p.useState(), f = e.find((j) => j.value === t) ?? e[0], g = (f == null ? void 0 : f.label) ?? t, m = r || i, v = (j) => {
      m || h(j.currentTarget.getBoundingClientRect());
    }, y = () => {
      h(void 0);
    }, w = (j) => {
      y(), n(j);
    }, b = c ? c({
      value: t,
      selectedOption: f ?? {
        value: t,
        label: g
      },
      opened: !!u,
      loading: i,
      disabled: m,
      openMenu: v
    }) : o.jsx(xe, {
      size: "300",
      variant: "Secondary",
      outlined: true,
      fill: "Soft",
      radii: "300",
      after: i ? o.jsx(dt, {
        variant: "Secondary",
        size: "300"
      }) : o.jsx(Q, {
        size: "300",
        src: q.ChevronBottom
      }),
      onClick: v,
      disabled: m,
      children: o.jsx(D, {
        size: "T300",
        children: g
      })
    });
    return o.jsxs(o.Fragment, {
      children: [
        b,
        o.jsx(ln, {
          anchor: u,
          offset: l,
          position: a,
          align: s,
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              fallbackFocus: () => document.body,
              onDeactivate: y,
              clickOutsideDeactivates: true,
              isKeyForward: (j) => j.key === "ArrowDown" || j.key === "ArrowRight",
              isKeyBackward: (j) => j.key === "ArrowUp" || j.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: e.map((j) => {
                  const k = j.value === t, C = () => {
                    j.disabled || w(j.value);
                  };
                  return d ? o.jsx(Ye, {
                    size: "300",
                    variant: "Surface",
                    radii: "300",
                    "aria-selected": k,
                    disabled: j.disabled || m,
                    onClick: C,
                    children: d({
                      option: j,
                      selected: k,
                      select: C
                    })
                  }, j.value) : o.jsx(Ye, {
                    size: "300",
                    variant: "Surface",
                    "aria-selected": k,
                    radii: "300",
                    disabled: j.disabled || m,
                    onClick: C,
                    before: j.icon,
                    children: o.jsx(E, {
                      grow: "Yes",
                      children: o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "T300",
                            children: j.label
                          }),
                          j.description && o.jsx(D, {
                            size: "T200",
                            priority: "300",
                            children: j.description
                          })
                        ]
                      })
                    })
                  }, j.value);
                })
              })
            })
          })
        })
      ]
    });
  }
  function LUe({ open: t, onEnable: e, onDecline: n }) {
    const r = p.useRef(false), i = p.useCallback(() => {
      r.current = true, e();
    }, [
      e
    ]), a = p.useCallback(() => {
      r.current = true, n();
    }, [
      n
    ]), s = p.useCallback(() => {
      if (r.current) {
        r.current = false;
        return;
      }
      n();
    }, [
      n
    ]);
    return o.jsx(Hn, {
      open: t,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: s,
            clickOutsideDeactivates: false,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Remote themes"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    variant: "Secondary",
                    fill: "Soft",
                    outlined: true,
                    radii: "300",
                    onClick: a,
                    "aria-label": "Close",
                    children: o.jsx(Q, {
                      src: q.Cross,
                      size: "100"
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsx(D, {
                    priority: "400",
                    children: "Load themes from the official Sable theme catalog on GitHub? You can browse previews, save favorites locally, and sync them with light and dark mode. If you choose not to, you can keep using the built-in Light and Dark themes only."
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(xe, {
                        variant: "Primary",
                        fill: "Soft",
                        outlined: true,
                        size: "300",
                        radii: "300",
                        onClick: i,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Yes, use the catalog"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Secondary",
                        fill: "Soft",
                        outlined: true,
                        size: "300",
                        radii: "300",
                        onClick: a,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "No, built-in themes only"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function NUe(t, e) {
    const [n, r] = p.useState(false);
    p.useEffect(() => {
      t || r(true);
    }, [
      t
    ]);
    const i = p.useCallback(() => {
      r(false), e(true);
    }, [
      e
    ]), a = p.useCallback(() => {
      r(false), e(false);
    }, [
      e
    ]), s = p.useCallback(() => {
      r(true);
    }, []);
    return {
      open: n,
      openOnboarding: s,
      dialog: o.jsx(LUe, {
        open: n,
        onEnable: i,
        onDecline: a
      })
    };
  }
  const zUe = /^\s*(--(?:sable|tc)-[a-zA-Z0-9-]+)\s*:\s*([^;]+?)\s*;?\s*$/, UUe = /url\s*\(|@import|expression\s*\(|javascript:|\\0|<!--|--!?>|<script/i, VUe = /* @__PURE__ */ new Set([
    "--sable-bg-container",
    "--sable-bg-on-container",
    "--sable-primary-main",
    "--sable-primary-on-main",
    "--sable-surface-container",
    "--sable-surface-container-line",
    "--sable-surface-on-container"
  ]);
  function Tce(t) {
    const e = t.replace(/\/\*[\s\S]*?\*\//g, ""), n = {};
    return e.split(/\r?\n/).forEach((r) => {
      const i = r.trim();
      if (i && !i.startsWith("@")) {
        const a = i.match(zUe);
        if (a && a[1] && a[2]) {
          const s = a[1];
          if (!VUe.has(s)) return;
          const l = a[2].trim();
          !UUe.test(l) && l.length <= 2e3 && (n[s] = l);
        }
      }
    }), n;
  }
  function Rce(t, e = "sable-theme-preview") {
    const n = Object.entries(t).map(([r, i]) => `  ${r}: ${i};`).join(`
`);
    return n ? `.${e} {
${n}
}` : "";
  }
  function HUe(t) {
    return (t || "theme").replace(/[^a-zA-Z0-9_-]/g, "-") || "theme";
  }
  function zI({ title: t, subtitle: e, beforePreview: n, previewCssText: r, scopeSlug: i, copyText: a, isFavorited: s, onToggleFavorite: l, systemTheme: c, onApplyLight: d, onApplyDark: u, onApplyManual: h, isAppliedLight: f, isAppliedDark: g, isAppliedManual: m, onRevert: v, canRevert: y, thirdParty: w, onExport: b }) {
    const [j, k] = Dp(), C = p.useMemo(() => `sable-theme-preview--${HUe(i)}`, [
      i
    ]), x = p.useMemo(() => {
      const T = Tce(r);
      return Rce(T, C);
    }, [
      r,
      C
    ]), S = p.useCallback(async () => {
      a && await Jo(a) && k();
    }, [
      a,
      k
    ]);
    return o.jsxs(E, {
      direction: "Column",
      gap: "300",
      style: {
        padding: He(12),
        borderRadius: ee.radii.R300,
        border: `${He(1)} solid var(--sable-surface-container-line)`,
        background: "var(--sable-surface-container)",
        width: "100%",
        maxWidth: "100%"
      },
      children: [
        o.jsxs(E, {
          direction: "Row",
          alignItems: "Start",
          justifyContent: "SpaceBetween",
          gap: "200",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              grow: "Yes",
              children: [
                o.jsxs(E, {
                  direction: "Row",
                  gap: "100",
                  alignItems: "Center",
                  wrap: "Wrap",
                  children: [
                    o.jsx(D, {
                      size: "H6",
                      children: t
                    }),
                    w && o.jsx(ar, {
                      position: "Top",
                      tooltip: o.jsx(pr, {
                        style: {
                          maxWidth: He(280)
                        },
                        children: o.jsx(D, {
                          size: "T200",
                          children: "Third-party theme. Only use themes from Providers you trust."
                        })
                      }),
                      children: (T) => o.jsx(Q, {
                        ref: T,
                        src: q.Warning,
                        size: "100",
                        filled: true,
                        style: {
                          color: "var(--sable-warn-on-container)",
                          flexShrink: 0
                        },
                        "aria-label": "Third-party theme"
                      })
                    })
                  ]
                }),
                e && o.jsx(D, {
                  size: "T200",
                  priority: "300",
                  style: {
                    wordBreak: "break-word"
                  },
                  children: e
                })
              ]
            }),
            o.jsxs(E, {
              direction: "Row",
              gap: "100",
              alignItems: "Center",
              shrink: "No",
              children: [
                a && o.jsx(Oe, {
                  size: "300",
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  "aria-label": j ? "Copied theme link" : "Copy theme link",
                  onClick: () => {
                    S().catch(() => {
                    });
                  },
                  children: o.jsx(Q, {
                    size: "200",
                    src: j ? q.Check : q.Link
                  })
                }),
                b && o.jsx(Oe, {
                  size: "300",
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  "aria-label": "Export theme CSS",
                  onClick: () => {
                    b();
                  },
                  children: o.jsx(Q, {
                    size: "200",
                    src: q.Download
                  })
                }),
                typeof s == "boolean" && l && o.jsx(Oe, {
                  size: "300",
                  variant: s ? "Primary" : "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  "aria-label": s ? "Remove from saved" : "Save theme",
                  onClick: () => {
                    Promise.resolve(l()).catch(() => {
                    });
                  },
                  children: o.jsx(Q, {
                    size: "200",
                    src: q.Star,
                    filled: s
                  })
                })
              ]
            })
          ]
        }),
        n,
        x ? o.jsxs(o.Fragment, {
          children: [
            o.jsx("style", {
              children: x
            }),
            o.jsxs(E, {
              className: C,
              direction: "Column",
              gap: "200",
              style: {
                padding: He(12),
                borderRadius: ee.radii.R300,
                background: "var(--sable-bg-container)",
                border: `${He(1)} solid var(--sable-surface-container-line)`
              },
              children: [
                o.jsx(D, {
                  size: "T300",
                  style: {
                    color: "var(--sable-bg-on-container)"
                  },
                  children: "Sample text"
                }),
                o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  wrap: "Wrap",
                  children: [
                    o.jsx("span", {
                      style: {
                        display: "inline-flex",
                        alignItems: "center",
                        padding: `${He(6)} ${He(12)}`,
                        borderRadius: ee.radii.Pill,
                        background: "var(--sable-primary-main)",
                        color: "var(--sable-primary-on-main)",
                        fontSize: He(12),
                        fontWeight: 500
                      },
                      children: "Primary"
                    }),
                    o.jsx("span", {
                      style: {
                        display: "inline-flex",
                        alignItems: "center",
                        padding: `${He(6)} ${He(12)}`,
                        borderRadius: ee.radii.Pill,
                        background: "var(--sable-surface-container)",
                        color: "var(--sable-surface-on-container)",
                        fontSize: He(12)
                      },
                      children: "Surface"
                    })
                  ]
                })
              ]
            })
          ]
        }) : o.jsx(D, {
          size: "T300",
          priority: "300",
          children: "No preview tokens"
        }),
        o.jsxs(E, {
          direction: "Row",
          gap: "200",
          wrap: "Wrap",
          alignItems: "Center",
          style: {
            width: "100%"
          },
          children: [
            c ? o.jsxs(o.Fragment, {
              children: [
                d && o.jsx(xe, {
                  variant: f ? "Primary" : "Secondary",
                  fill: "Soft",
                  outlined: true,
                  size: "300",
                  radii: "300",
                  style: {
                    flex: "1 1 0"
                  },
                  disabled: !!f,
                  onClick: () => Promise.resolve(d()).catch(() => {
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Use when OS light"
                  })
                }),
                u && o.jsx(xe, {
                  variant: g ? "Primary" : "Secondary",
                  fill: "Soft",
                  outlined: true,
                  size: "300",
                  radii: "300",
                  style: {
                    flex: "1 1 0"
                  },
                  disabled: !!g,
                  onClick: () => Promise.resolve(u()).catch(() => {
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Use when OS dark"
                  })
                })
              ]
            }) : h && o.jsx(xe, {
              variant: m ? "Primary" : "Secondary",
              fill: "Soft",
              outlined: true,
              size: "300",
              radii: "300",
              style: {
                flex: v ? "1 1 0" : void 0,
                width: v ? void 0 : "100%"
              },
              disabled: !!m,
              onClick: () => Promise.resolve(h()).catch(() => {
              }),
              children: o.jsx(D, {
                size: "B300",
                children: "Use theme"
              })
            }),
            v && o.jsx(xe, {
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              size: "300",
              radii: "300",
              disabled: !y,
              style: {
                flex: "1 1 0"
              },
              onClick: v,
              children: o.jsx(D, {
                size: "B300",
                children: "Revert"
              })
            })
          ]
        })
      ]
    });
  }
  function _3() {
    const t = SF();
    return p.useCallback((e) => {
      const n = {
        ...t.get(ge),
        ...e
      };
      t.set(ge, n);
    }, [
      t
    ]);
  }
  const $Ue = "sable-theme-cache", WUe = 1, bb = "themes";
  function Ace() {
    return new Promise((t, e) => {
      const n = indexedDB.open($Ue, WUe);
      n.addEventListener("error", () => e(n.error)), n.addEventListener("success", () => t(n.result)), n.addEventListener("upgradeneeded", () => {
        n.result.createObjectStore(bb, {
          keyPath: "url"
        });
      });
    });
  }
  async function Qm(t) {
    const e = await Ace();
    return new Promise((n, r) => {
      const a = e.transaction(bb, "readonly").objectStore(bb).get(t);
      a.addEventListener("error", () => r(a.error)), a.addEventListener("success", () => {
        const s = a.result;
        n(s == null ? void 0 : s.cssText);
      });
    });
  }
  async function Fo(t, e) {
    const n = await Ace(), r = {
      url: t,
      cssText: e,
      cachedAt: Date.now()
    };
    return new Promise((i, a) => {
      const s = n.transaction(bb, "readwrite");
      s.objectStore(bb).put(r), s.addEventListener("complete", () => i()), s.addEventListener("error", () => a(s.error));
    });
  }
  const Ice = "@sable-theme", Bce = "@sable-tweak";
  function xb(t) {
    let e = 0;
    for (; e < t.length; ) {
      const n = t.indexOf("/*", e);
      if (n === -1) break;
      const r = t.indexOf("*/", n + 2);
      if (r === -1) break;
      const i = t.slice(n + 2, r);
      if (i.indexOf(Bce) !== -1) return "tweak";
      if (i.indexOf(Ice) !== -1) return "theme";
      e = r + 2;
    }
    return "unknown";
  }
  function Pce(t, e) {
    let n = 0;
    for (; n < t.length; ) {
      const r = t.indexOf("/*", n);
      if (r === -1) return "";
      const i = t.indexOf("*/", r + 2);
      if (i === -1) return "";
      const a = t.slice(r + 2, i);
      if (a.indexOf(e) !== -1) return a;
      n = i + 2;
    }
    return "";
  }
  function Mce(t) {
    return Pce(t, Ice);
  }
  function Uf(t) {
    const e = Mce(t);
    if (!e) return {};
    const n = e.split(/\r?\n/).map((i) => i.replace(/^\s*\*?\s?/, "").trim()), r = {};
    return n.filter((i) => !(i.startsWith("@") || i === "---" || i === "")).filter((i) => i.indexOf(":") !== -1).forEach((i) => {
      const a = i.indexOf(":"), s = i.slice(0, a).trim().toLowerCase(), l = i.slice(a + 1).trim();
      switch (s) {
        case "id":
          r.id = l;
          break;
        case "name":
          r.name = l;
          break;
        case "author":
          r.author = l;
          break;
        case "kind":
          r.kind = l === "dark" ? Rr.Dark : Rr.Light;
          break;
        case "contrast":
          r.contrast = l === "high" ? "high" : "low";
          break;
        case "tags":
          r.tags = l.split(",").map((c) => c.trim()).filter(Boolean);
          break;
        case "fullthemeurl":
        case "full_theme_url":
          r.fullThemeUrl = l;
          break;
      }
    }), r;
  }
  function Tf(t) {
    const e = Pce(t, Bce);
    if (!e) return {};
    const n = e.split(/\r?\n/).map((i) => i.replace(/^\s*\*?\s?/, "").trim()), r = {};
    return n.filter((i) => !(i.startsWith("@") || i === "---" || i === "")).filter((i) => i.indexOf(":") !== -1).forEach((i) => {
      const a = i.indexOf(":"), s = i.slice(0, a).trim().toLowerCase(), l = i.slice(a + 1).trim();
      switch (s) {
        case "id":
          r.id = l;
          break;
        case "name":
          r.name = l;
          break;
        case "description":
          r.description = l;
          break;
        case "author":
          r.author = l;
          break;
        case "tags":
          r.tags = l.split(",").map((c) => c.trim()).filter(Boolean);
          break;
      }
    }), r;
  }
  function mS(t) {
    var _a6;
    const e = Uf(t);
    if (e.fullThemeUrl && /^https:\/\//i.test(e.fullThemeUrl)) return e.fullThemeUrl;
    const n = Mce(t);
    return n ? (_a6 = n.match(/fullThemeUrl:\s*(https:\/\/[^\s*]+)/i)) == null ? void 0 : _a6[1] : void 0;
  }
  function Zs(t) {
    try {
      return (new URL(t).pathname.split("/").pop() ?? "theme").replace(/\.(preview\.)?sable\.css$/i, "");
    } catch {
      return "theme";
    }
  }
  function Y0(t) {
    return t.kind === Rr.Dark ? "dark" : (t.kind === Rr.Light, "light");
  }
  function xE(t, e) {
    var _a6, _b3;
    return (((_a6 = t.id) == null ? void 0 : _a6.trim()) || ((_b3 = t.name) == null ? void 0 : _b3.trim()) || (e ? e.replace(/\.[^.]+$/, "") : "") || "tweak").replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-|-$/g, "") || "tweak";
  }
  async function qUe(t) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4;
    const e = t.trim();
    if (!/^https:\/\//i.test(e)) return {
      ok: false,
      error: "URL must start with https://"
    };
    try {
      const n = await fetch(e, {
        mode: "cors"
      });
      if (!n.ok) return {
        ok: false,
        error: `Download failed (${n.status}).`
      };
      const r = await n.text();
      if (xb(r) === "tweak") {
        await Fo(e, r);
        const d = Tf(r), u = ((_a6 = d.name) == null ? void 0 : _a6.trim()) || Zs(e);
        return {
          ok: true,
          role: "tweak",
          fullUrl: e,
          displayName: u,
          basename: xE(d),
          description: (_b3 = d.description) == null ? void 0 : _b3.trim(),
          importedLocal: false
        };
      }
      const a = Uf(r), s = mS(r), l = /\.preview\.sable\.css(\?|#|$)/i.test(e);
      if (s && /^https:\/\//i.test(s)) {
        if (s === e) {
          await Fo(e, r);
          const f = ((_c3 = a.name) == null ? void 0 : _c3.trim()) || Zs(e);
          return {
            ok: true,
            role: "theme",
            fullUrl: e,
            previewCssForCard: r,
            displayName: f,
            basename: Zs(e),
            kind: Y0(a),
            importedLocal: false
          };
        }
        const d = await fetch(s, {
          mode: "cors"
        });
        if (!d.ok) return {
          ok: false,
          error: `Full theme download failed (${d.status}).`
        };
        const u = await d.text();
        await Fo(s, u), await Fo(e, r);
        const h = ((_d4 = a.name) == null ? void 0 : _d4.trim()) || Zs(s);
        return {
          ok: true,
          role: "theme",
          fullUrl: s,
          previewCssForCard: r,
          displayName: h,
          basename: Zs(s),
          kind: Y0(a),
          importedLocal: false
        };
      }
      if (l) {
        const d = e.replace(/\.preview\.sable\.css(\?|#|$)/i, ".sable.css$1");
        if (d !== e) {
          const u = await fetch(d, {
            mode: "cors"
          });
          if (u.ok) {
            const h = await u.text();
            if (xb(h) === "tweak") {
              await Fo(d, h), await Fo(e, r);
              const m = Tf(h), v = ((_e13 = m.name) == null ? void 0 : _e13.trim()) || Zs(d);
              return {
                ok: true,
                role: "tweak",
                fullUrl: d,
                displayName: v,
                basename: xE(m),
                description: (_f4 = m.description) == null ? void 0 : _f4.trim(),
                importedLocal: false
              };
            }
            await Fo(d, h), await Fo(e, r);
            const g = ((_g4 = a.name) == null ? void 0 : _g4.trim()) || Zs(d);
            return {
              ok: true,
              role: "theme",
              fullUrl: d,
              previewCssForCard: r,
              displayName: g,
              basename: Zs(d),
              kind: Y0(a),
              importedLocal: false
            };
          }
        }
      }
      await Fo(e, r);
      const c = ((_h4 = a.name) == null ? void 0 : _h4.trim()) || Zs(e);
      return {
        ok: true,
        role: "theme",
        fullUrl: e,
        previewCssForCard: r,
        displayName: c,
        basename: Zs(e),
        kind: Y0(a),
        importedLocal: false
      };
    } catch {
      return {
        ok: false,
        error: "Network error while downloading theme."
      };
    }
  }
  async function KUe(t, e) {
    var _a6, _b3, _c3, _d4, _e13, _f4;
    const n = t.trim();
    if (!n) return {
      ok: false,
      error: "No CSS content."
    };
    if (xb(n) === "tweak") {
      const h = Tf(n), f = ((_a6 = h.name) == null ? void 0 : _a6.trim()) || (e ? e.replace(/\.[^.]+$/, "") : "") || "Imported tweak", g = xE(h, e), m = b4e(), v = D4e(m);
      return await Fo(v, n), {
        ok: true,
        role: "tweak",
        fullUrl: v,
        displayName: f,
        basename: g,
        description: (_b3 = h.description) == null ? void 0 : _b3.trim(),
        importedLocal: true
      };
    }
    const i = Uf(n), a = mS(n), s = ((_c3 = i.name) == null ? void 0 : _c3.trim()) || (e ? e.replace(/\.[^.]+$/, "") : "") || "Imported theme", l = s.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-|-$/g, "") || "imported";
    if (a && /^https:\/\//i.test(a)) try {
      const h = await fetch(a, {
        mode: "cors"
      });
      if (h.ok) {
        const f = await h.text();
        if (xb(f) === "tweak") {
          await Fo(a, f);
          const v = Tf(f);
          return {
            ok: true,
            role: "tweak",
            fullUrl: a,
            displayName: ((_d4 = v.name) == null ? void 0 : _d4.trim()) || Zs(a),
            basename: xE(v),
            description: (_e13 = v.description) == null ? void 0 : _e13.trim(),
            importedLocal: false
          };
        }
        await Fo(a, f);
        const m = Uf(n);
        return {
          ok: true,
          role: "theme",
          fullUrl: a,
          previewCssForCard: n,
          displayName: ((_f4 = m.name) == null ? void 0 : _f4.trim()) || Zs(a),
          basename: Zs(a),
          kind: Y0(i),
          importedLocal: false
        };
      }
    } catch {
    }
    const c = y4e(), d = x4e(c), u = w4e(c);
    return await Fo(d, n), await Fo(u, n), {
      ok: true,
      role: "theme",
      fullUrl: d,
      previewCssForCard: n,
      displayName: s,
      basename: l,
      kind: Y0(i),
      importedLocal: true
    };
  }
  function GUe({ open: t, onClose: e }) {
    const n = _3(), [r] = Fe(ge, "themeRemoteFavorites"), [i] = Fe(ge, "themeRemoteTweakFavorites"), [a] = Fe(ge, "themeRemoteEnabledTweakFullUrls"), [s] = Fe(ge, "themeRemoteManualFullUrl"), [l] = Fe(ge, "themeRemoteLightFullUrl"), [c] = Fe(ge, "themeRemoteDarkFullUrl"), [d, u] = p.useState(""), [h, f] = p.useState(""), [g, m] = p.useState(null), [v, y] = p.useState(null), [w, b] = p.useState(false), [j, k] = p.useState(void 0), C = p.useRef(null), x = p.useMemo(() => [
      s,
      l,
      c
    ].filter((I) => !!(I && I.trim().length > 0)), [
      c,
      l,
      s
    ]), S = p.useCallback((I, N) => {
      const L = new Set(N);
      return I.filter((H) => H.pinned === true || L.has(H.fullUrl));
    }, []), T = p.useCallback((I, N) => {
      const L = new Set(N);
      return I.filter((H) => H.pinned === true || L.has(H.fullUrl));
    }, []);
    p.useEffect(() => {
      t || (u(""), f(""), m(null), y(null), k(void 0), C.current && (C.current.value = ""));
    }, [
      t
    ]);
    const A = (I) => u(I.target.value), B = (I) => f(I.target.value), U = p.useCallback((I) => {
      if (I.role === "tweak") {
        if (i.find((oe) => oe.fullUrl === I.fullUrl)) {
          y("That tweak is already saved.");
          return;
        }
        const Z = {
          fullUrl: I.fullUrl,
          displayName: I.displayName,
          basename: I.basename,
          pinned: true,
          importedLocal: I.importedLocal
        }, Y = a.includes(I.fullUrl) ? [
          ...a
        ] : [
          ...a,
          I.fullUrl
        ];
        n({
          themeRemoteTweakFavorites: T([
            ...i,
            Z
          ], Y),
          themeRemoteEnabledTweakFullUrls: Y
        }), e();
        return;
      }
      if (r.find((V) => V.fullUrl === I.fullUrl)) {
        y("That theme is already saved.");
        return;
      }
      const L = {
        fullUrl: I.fullUrl,
        displayName: I.displayName,
        basename: I.basename,
        kind: I.kind,
        pinned: true,
        importedLocal: I.importedLocal
      }, H = Array.from(new Set([
        ...x,
        I.fullUrl
      ].filter((V) => !!(V && V.trim().length > 0))));
      n({
        themeRemoteFavorites: S([
          ...r,
          L
        ], H)
      }), e();
    }, [
      x,
      a,
      r,
      e,
      n,
      S,
      T,
      i
    ]), z = (I) => {
      var _a6;
      const N = (_a6 = I.target.files) == null ? void 0 : _a6[0];
      if (!N) return;
      k(N.name), f("");
      const L = new FileReader();
      L.addEventListener("load", () => {
        m(typeof L.result == "string" ? L.result : "");
      }), L.readAsText(N);
    }, O = p.useCallback(async () => {
      y(null);
      const I = d.trim();
      if (/^https:\/\//i.test(I)) {
        b(true);
        try {
          const V = await qUe(I);
          if (!V.ok) {
            y(V.error);
            return;
          }
          U(V);
        } finally {
          b(false);
        }
        return;
      }
      const N = h.trim(), L = g == null ? void 0 : g.trim(), H = L || N;
      if (!H) {
        y("Enter an URL, paste CSS, or choose a file.");
        return;
      }
      b(true);
      try {
        const V = await KUe(H, L ? j : void 0);
        if (!V.ok) {
          y(V.error);
          return;
        }
        U(V);
      } finally {
        b(false);
      }
    }, [
      U,
      j,
      h,
      d,
      g
    ]), M = p.useCallback(() => {
      w || e();
    }, [
      w,
      e
    ]);
    return t ? o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: M,
            clickOutsideDeactivates: false,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            "aria-labelledby": "theme-import-title",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      id: "theme-import-title",
                      size: "H4",
                      children: "Import a theme or tweak"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    radii: "300",
                    onClick: M,
                    disabled: w,
                    "aria-label": "Close",
                    children: o.jsx(Q, {
                      src: q.Cross,
                      size: "100"
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(D, {
                    priority: "400",
                    children: [
                      "Paste a link to a ",
                      o.jsx("strong", {
                        children: ".sable.css"
                      }),
                      " file, or paste CSS / upload a file. Files whose first metadata block uses ",
                      o.jsx("strong", {
                        children: "@sable-tweak"
                      }),
                      " are saved as tweaks (applied on top of your current theme and turned on immediately). Themes use",
                      " ",
                      o.jsx("strong", {
                        children: "@sable-theme"
                      }),
                      ". If theme CSS includes ",
                      o.jsx("strong", {
                        children: "fullThemeUrl"
                      }),
                      " ",
                      "and that URL loads, it is used; otherwise the theme is stored only on this device."
                    ]
                  }),
                  o.jsxs(Te, {
                    className: Xe,
                    variant: "SurfaceVariant",
                    direction: "Column",
                    gap: "300",
                    children: [
                      o.jsx(mn, {
                        size: "300",
                        radii: "300",
                        outlined: true,
                        placeholder: "https://\u2026",
                        value: d,
                        onChange: A
                      }),
                      j && g !== null && o.jsxs(E, {
                        direction: "Row",
                        gap: "200",
                        alignItems: "Center",
                        wrap: "Wrap",
                        children: [
                          o.jsxs(D, {
                            size: "T300",
                            priority: "300",
                            children: [
                              "Loaded file: ",
                              o.jsx("strong", {
                                children: j
                              }),
                              "."
                            ]
                          }),
                          o.jsx(xe, {
                            variant: "Secondary",
                            fill: "Soft",
                            outlined: true,
                            size: "300",
                            radii: "300",
                            disabled: w,
                            onClick: () => {
                              m(null), k(void 0), C.current && (C.current.value = "");
                            },
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Clear file"
                            })
                          })
                        ]
                      }),
                      o.jsx("textarea", {
                        value: h,
                        onChange: B,
                        placeholder: "Paste .preview.sable.css, .sable.css, or tweak CSS, or pick a file below\u2026",
                        rows: 6,
                        disabled: !!g,
                        style: {
                          width: "100%",
                          boxSizing: "border-box",
                          padding: He(10),
                          borderRadius: He(8),
                          border: `${He(1)} solid var(--sable-surface-container-line)`,
                          background: "var(--sable-surface-container)",
                          color: "inherit",
                          font: "inherit",
                          resize: "vertical",
                          minHeight: He(120)
                        }
                      }),
                      o.jsx("input", {
                        ref: C,
                        type: "file",
                        accept: ".css,text/css",
                        style: {
                          display: "none"
                        },
                        onChange: z
                      }),
                      o.jsxs(E, {
                        direction: "Row",
                        gap: "200",
                        wrap: "Wrap",
                        alignItems: "Center",
                        children: [
                          o.jsx(xe, {
                            variant: "Secondary",
                            fill: "Soft",
                            outlined: true,
                            size: "300",
                            radii: "300",
                            disabled: w,
                            onClick: () => {
                              var _a6;
                              return (_a6 = C.current) == null ? void 0 : _a6.click();
                            },
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Choose .css file"
                            })
                          }),
                          o.jsx(xe, {
                            variant: "Primary",
                            fill: "Soft",
                            outlined: true,
                            size: "300",
                            radii: "300",
                            disabled: w,
                            onClick: () => {
                              O().catch(() => {
                              });
                            },
                            children: o.jsx(D, {
                              size: "B300",
                              children: w ? "Importing\u2026" : "Import"
                            })
                          })
                        ]
                      }),
                      v && o.jsx(D, {
                        size: "T300",
                        style: {
                          color: "var(--sable-error)"
                        },
                        children: v
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    }) : null;
  }
  const YUe = /^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)(?:\/(.*))?$/;
  function ZUe(t) {
    const n = t.trim().replace(/\/+$/, "").match(YUe);
    if (!n || !n[1] || !n[2] || !n[3]) return null;
    const r = n[1], i = n[2], a = n[3], l = (n[4] ?? "").replace(/^\/+|\/+$/g, "");
    return {
      owner: r,
      repo: i,
      ref: a,
      directoryPath: l
    };
  }
  function UI(t, e) {
    const n = t.directoryPath ? `${t.directoryPath}/` : "";
    return `https://raw.githubusercontent.com/${t.owner}/${t.repo}/${t.ref}/${n}${e}`;
  }
  const RY = ".preview.sable.css", VI = ".sable.css";
  function JUe(t) {
    const e = t.trim();
    if (!e) return null;
    const n = e.endsWith("/") ? e : `${e}/`;
    try {
      return new URL("catalog.json", n).href;
    } catch {
      return null;
    }
  }
  function XUe(t) {
    return t.map((e) => {
      if (!e || typeof e != "object") return null;
      const { basename: n, previewUrl: r, fullUrl: i } = e;
      return typeof n != "string" || typeof r != "string" || typeof i != "string" || !n || !r || !i ? null : {
        basename: n,
        previewUrl: r,
        fullUrl: i
      };
    }).filter((e) => e !== null);
  }
  function QUe(t) {
    return t.map((e) => {
      if (!e || typeof e != "object") return null;
      const { basename: n, fullUrl: r } = e;
      return typeof n != "string" || typeof r != "string" || !n || !r ? null : {
        basename: n,
        fullUrl: r
      };
    }).filter((e) => e !== null);
  }
  async function eVe(t) {
    const e = await fetch(t, {
      mode: "cors"
    });
    if (!e.ok) return null;
    let n;
    try {
      n = await e.json();
    } catch {
      return null;
    }
    if (!n || typeof n != "object") return null;
    const { themes: r, tweaks: i } = n;
    if (!Array.isArray(r)) return null;
    const a = XUe(r), s = Array.isArray(i) ? QUe(i) : [];
    return {
      themes: a,
      tweaks: s
    };
  }
  function tVe(t) {
    return t ? t.split("/").filter(Boolean).map((e) => encodeURIComponent(e)).join("/") : "";
  }
  async function Oce(t) {
    const e = tVe(t.directoryPath), n = e ? `/${e}` : "", r = `https://api.github.com/repos/${t.owner}/${t.repo}/contents${n}?ref=${encodeURIComponent(t.ref)}`, i = await fetch(r, {
      headers: {
        Accept: "application/vnd.github+json"
      }
    });
    if (!i.ok) throw new Error(`theme catalog list failed: ${i.status}`);
    const a = await i.json();
    return Array.isArray(a) ? a : [
      a
    ];
  }
  async function nVe(t) {
    const e = t.directoryPath ? `${t.directoryPath}/tweaks` : "tweaks";
    let n;
    try {
      n = await Oce({
        ...t,
        directoryPath: e
      });
    } catch {
      return [];
    }
    return n.filter((r) => r.type === "file" && r.name.endsWith(VI)).map((r) => ({
      basename: r.name.slice(0, -VI.length),
      fullUrl: r.download_url ?? UI({
        ...t,
        directoryPath: e
      }, r.name)
    })).filter((r) => !!r.fullUrl);
  }
  async function rVe(t) {
    const e = t.directoryPath ? `${t.directoryPath}/themes` : "themes", n = {
      ...t,
      directoryPath: e
    }, r = await Oce(n);
    return r.filter((a) => a.type === "file" && a.name.endsWith(RY)).map((a) => {
      const s = a.name.slice(0, -RY.length), l = `${s}${VI}`, c = r.find((h) => h.type === "file" && h.name === l);
      if (!c) return null;
      const d = a.download_url ?? UI(n, a.name), u = c.download_url ?? UI(n, l);
      return !d || !u ? null : {
        basename: s,
        previewUrl: d,
        fullUrl: u
      };
    }).filter((a) => a !== null);
  }
  async function iVe(t, e) {
    var _a6;
    const n = ((_a6 = e == null ? void 0 : e.manifestUrl) == null ? void 0 : _a6.trim()) || JUe(t) || void 0;
    if (n) {
      const s = await eVe(n);
      if (s !== null) return s;
    }
    const r = ZUe(t);
    if (!r) return {
      themes: [],
      tweaks: []
    };
    const i = await rVe(r), a = await nVe(r);
    return {
      themes: i,
      tweaks: a
    };
  }
  const oVe = "*";
  function aVe(t) {
    return (t == null ? void 0 : t.length) ? t.map((e) => e.trim()).filter(Boolean) : [];
  }
  function wb(t, e) {
    const n = t.trim();
    if (!/^https:\/\//i.test(n)) return false;
    const r = aVe(e);
    return r.length === 0 ? false : r.some((i) => i === oVe) ? true : r.some((i) => n.startsWith(i));
  }
  function by(t, e) {
    const n = t.trim();
    return /^https:\/\//i.test(n) ? !wb(n, e) : false;
  }
  const TM = "https://raw.githubusercontent.com/SableClient/themes/main";
  function sVe(t) {
    return `${ho(t && t.length > 0 ? t : TM)}/`;
  }
  function RM(t) {
    return /^https:\/\//i.test(t) && /\.sable\.css(\?|#|$)/i.test(t) && !/\.preview\.sable\.css(\?|#|$)/i.test(t);
  }
  function lVe(t) {
    if (/\.sable\.css$/i.test(t)) return t.replace(/\.sable\.css$/i, ".preview.sable.css");
  }
  function cVe(t, e) {
    if (e && /^https:\/\//i.test(e)) return e;
    if (/\.preview\.sable\.css(\?|#|$)/i.test(t)) return t.replace(/\.preview\.sable\.css(\?|#|$)/i, ".sable.css$1");
  }
  function AY({ displayName: t, description: e, copyUrl: n, thirdPartyChip: r, isFavorited: i, onToggleFavorite: a, isOn: s, onSetApplied: l, onExport: c }) {
    const [d, u] = Dp(), h = p.useCallback(async () => {
      n && await Jo(n) && u();
    }, [
      n,
      u
    ]);
    return o.jsx(E, {
      direction: "Column",
      gap: "200",
      style: {
        padding: He(12),
        borderRadius: ee.radii.R300,
        border: `${He(1)} solid var(--sable-surface-container-line)`,
        background: "var(--sable-surface-container)"
      },
      children: o.jsxs(E, {
        direction: "Row",
        alignItems: "Start",
        justifyContent: "SpaceBetween",
        gap: "200",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            grow: "Yes",
            style: {
              minWidth: 0
            },
            children: [
              o.jsx(D, {
                size: "H6",
                children: t
              }),
              o.jsx(D, {
                size: "T200",
                priority: "300",
                style: {
                  wordBreak: "break-word"
                },
                children: e
              })
            ]
          }),
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            alignItems: "End",
            shrink: "No",
            children: [
              r && o.jsx(Qe, {
                variant: "Critical",
                outlined: true,
                radii: "Pill",
                children: o.jsx(D, {
                  size: "B300",
                  children: "Third-party URL"
                })
              }),
              o.jsxs(E, {
                direction: "Row",
                gap: "100",
                alignItems: "Center",
                children: [
                  n && o.jsx(Oe, {
                    size: "300",
                    variant: "Secondary",
                    fill: "Soft",
                    outlined: true,
                    radii: "300",
                    "aria-label": d ? "Copied tweak link" : "Copy tweak link",
                    onClick: () => {
                      h().catch(() => {
                      });
                    },
                    children: o.jsx(Q, {
                      size: "200",
                      src: d ? q.Check : q.Link
                    })
                  }),
                  c && o.jsx(Oe, {
                    size: "300",
                    variant: "Secondary",
                    fill: "Soft",
                    outlined: true,
                    radii: "300",
                    "aria-label": "Export tweak CSS",
                    onClick: () => {
                      c();
                    },
                    children: o.jsx(Q, {
                      size: "200",
                      src: q.Download
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    variant: i ? "Primary" : "Secondary",
                    fill: "Soft",
                    outlined: true,
                    radii: "300",
                    "aria-label": i ? "Remove tweak from saved" : "Save tweak",
                    onClick: () => {
                      Promise.resolve(a()).catch(() => {
                      });
                    },
                    children: o.jsx(Q, {
                      size: "200",
                      src: q.Star,
                      filled: i
                    })
                  }),
                  o.jsx(Jt, {
                    variant: "Primary",
                    value: s,
                    onChange: l
                  })
                ]
              })
            ]
          })
        ]
      })
    });
  }
  function dVe({ mode: t = "full", onBrowseOpenChange: e }) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3;
    const n = la(), r = _3(), i = Ub(), a = (_a6 = n.themeCatalogBaseUrl) == null ? void 0 : _a6.trim(), s = sVe(a), l = ((_b3 = n.themeCatalogManifestUrl) == null ? void 0 : _b3.trim()) || void 0, c = t === "appearance", [d, u] = p.useState(false), [h, f] = p.useState(false), g = p.useRef(false), m = p.useRef(/* @__PURE__ */ new Set());
    p.useEffect(() => {
      c && (e == null ? void 0 : e(d));
    }, [
      d,
      c,
      e
    ]);
    const v = t === "remote" || t === "full" || c && d, y = t === "chat" || t === "full" || c && !d, w = t === "full" || t === "local" || c && !d, b = (t === "full" || t === "local" || c) && !(c && d), [j] = Fe(ge, "themeRemoteFavorites"), [k, C] = p.useState(j || []), [x] = Fe(ge, "themeRemoteTweakFavorites"), [S] = Fe(ge, "themeRemoteEnabledTweakFullUrls"), [T, A] = Fe(ge, "useSystemTheme"), [B] = Fe(ge, "themeRemoteManualFullUrl"), [U] = Fe(ge, "themeRemoteLightFullUrl"), [z] = Fe(ge, "themeRemoteDarkFullUrl"), [O, M] = Fe(ge, "themeChatSableWidgetsEnabled"), [I, N] = Fe(ge, "themeChatAutoPreviewApprovedUrls"), [L, H] = Fe(ge, "themeChatAutoPreviewAnyUrl");
    p.useEffect(() => {
      if (!c) {
        g.current = false;
        return;
      }
      d && !g.current && (m.current = new Set(x.map((Ce) => Ce.fullUrl.trim()).filter(Boolean))), g.current = d;
    }, [
      d,
      c,
      x
    ]);
    const [V, Z] = p.useState(""), [Y, oe] = p.useState(""), [ue, ie] = p.useState("all"), [de, ne] = p.useState("all"), [ae, X] = p.useState("all");
    p.useEffect(() => C(j || []), [
      j
    ]);
    const K = (Ce) => Z(Ce.target.value), G = (Ce) => oe(Ce.target.value), le = p.useMemo(() => [
      B,
      U,
      z
    ].filter((Ce) => !!(Ce && Ce.trim().length > 0)), [
      z,
      U,
      B
    ]), te = p.useCallback((Ce, Dt) => {
      const Ut = new Set(Dt);
      return Ce.filter((Zt) => Zt.pinned === true || Ut.has(Zt.fullUrl));
    }, []), re = p.useCallback((Ce, Dt) => {
      const Ut = new Set(Dt);
      return Ce.filter((Zt) => Zt.pinned === true || Ut.has(Zt.fullUrl));
    }, []), he = p.useCallback((Ce) => {
      const Dt = {};
      return U === Ce && (Dt.themeRemoteLightFullUrl = void 0, Dt.themeRemoteLightKind = void 0), z === Ce && (Dt.themeRemoteDarkFullUrl = void 0, Dt.themeRemoteDarkKind = void 0), B === Ce && (Dt.themeRemoteManualFullUrl = void 0, Dt.themeRemoteManualKind = void 0), Dt;
    }, [
      z,
      U,
      B
    ]), se = ol({
      queryKey: [
        "theme-catalog-bundle",
        s,
        l ?? ""
      ],
      queryFn: () => iVe(s, {
        manifestUrl: l
      }),
      enabled: v,
      staleTime: 5 * 6e4
    }), ye = ol({
      queryKey: [
        "theme-catalog-previews",
        s,
        ((_d4 = (_c3 = se.data) == null ? void 0 : _c3.themes) == null ? void 0 : _d4.map((Ce) => Ce.previewUrl).join("|")) ?? ""
      ],
      queryFn: async () => {
        var _a7;
        const Ce = ((_a7 = se.data) == null ? void 0 : _a7.themes) ?? [];
        return await Promise.all(Ce.map(async (Ut) => {
          var _a8, _b4;
          const Zt = await fetch(Ut.previewUrl, {
            mode: "cors"
          }), ut = Zt.ok ? await Zt.text() : "", De = Uf(ut), Ae = mS(ut), Ge = Ae && /^https:\/\//i.test(Ae) ? Ae : Ut.fullUrl, ot = De.kind ?? Rr.Light, Mt = De.contrast === "high" ? "high" : "low";
          return {
            ...Ut,
            previewText: ut,
            displayName: ((_a8 = De.name) == null ? void 0 : _a8.trim()) || Ut.basename,
            author: ((_b4 = De.author) == null ? void 0 : _b4.trim()) || void 0,
            kind: ot,
            contrast: Mt,
            tags: De.tags ?? [],
            fullInstallUrl: Ge
          };
        }));
      },
      enabled: v && !!((_f4 = (_e13 = se.data) == null ? void 0 : _e13.themes) == null ? void 0 : _f4.length),
      staleTime: 10 * 6e4
    }), we = ol({
      queryKey: [
        "theme-catalog-tweak-details",
        s,
        ((_h4 = (_g4 = se.data) == null ? void 0 : _g4.tweaks) == null ? void 0 : _h4.map((Ce) => Ce.fullUrl).join("|")) ?? ""
      ],
      queryFn: async () => {
        var _a7;
        const Ce = ((_a7 = se.data) == null ? void 0 : _a7.tweaks) ?? [];
        return await Promise.all(Ce.map(async (Ut) => {
          var _a8, _b4, _c4;
          try {
            let Zt;
            if (gy(Ut.fullUrl)) Zt = await Qm(Ut.fullUrl) ?? "";
            else {
              const De = await fetch(Ut.fullUrl, {
                mode: "cors"
              });
              Zt = De.ok ? await De.text() : "";
            }
            const ut = Tf(Zt);
            return {
              ...Ut,
              fullCssText: Zt,
              displayName: ((_a8 = ut.name) == null ? void 0 : _a8.trim()) || Ut.basename,
              description: ((_b4 = ut.description) == null ? void 0 : _b4.trim()) || void 0,
              author: ((_c4 = ut.author) == null ? void 0 : _c4.trim()) || void 0,
              tags: ut.tags ?? []
            };
          } catch {
            return {
              ...Ut,
              fullCssText: "",
              displayName: Ut.basename,
              tags: []
            };
          }
        }));
      },
      enabled: v && !!((_j3 = (_i7 = se.data) == null ? void 0 : _i7.tweaks) == null ? void 0 : _j3.length),
      staleTime: 10 * 6e4
    }), Ee = p.useMemo(() => {
      const Ce = we.data ?? [], Dt = Y.trim().toLowerCase();
      return Dt ? Ce.filter((Ut) => `${Ut.displayName} ${Ut.basename} ${Ut.description ?? ""} ${Ut.tags.join(" ")}`.toLowerCase().includes(Dt)) : Ce;
    }, [
      we.data,
      Y
    ]), ke = p.useMemo(() => ae === "all" ? Ee : ae === "enabled" ? Ee.filter((Ce) => S.includes(Ce.fullUrl)) : Ee.filter((Ce) => !S.includes(Ce.fullUrl)), [
      Ee,
      S,
      ae
    ]), Ne = p.useMemo(() => {
      const Ce = ye.data ?? [], Dt = V.trim().toLowerCase();
      return Ce.filter((Ut) => {
        if (ue !== "all") {
          const Zt = ue === "dark" ? Rr.Dark : Rr.Light;
          if (Ut.kind !== Zt) return false;
        }
        return !(de !== "all" && Ut.contrast !== de || Dt && !`${Ut.displayName} ${Ut.basename} ${Ut.tags.join(" ")}`.toLowerCase().includes(Dt));
      });
    }, [
      ye.data,
      V,
      ue,
      de
    ]), lt = ol({
      queryKey: [
        "theme-local-previews",
        k.map((Ce) => Ce.fullUrl).join("|")
      ],
      enabled: b && k.length > 0,
      staleTime: 10 * 6e4,
      queryFn: async () => (await Promise.all(k.map(async (Dt) => {
        var _a7, _b4;
        const Ut = lVe(Dt.fullUrl);
        if (Ut) try {
          let Zt, ut = "";
          if (RB(Ut)) Zt = await Qm(Ut) ?? "";
          else {
            const cn = await fetch(Ut, {
              mode: "cors"
            });
            if (!cn.ok) return;
            Zt = await cn.text();
          }
          if (gy(Dt.fullUrl)) ut = await Qm(Dt.fullUrl) ?? "";
          else {
            const cn = await fetch(Dt.fullUrl, {
              mode: "cors"
            });
            cn.ok && (ut = await cn.text());
          }
          const De = Uf(Zt), Ae = ((_a7 = De.name) == null ? void 0 : _a7.trim()) || Dt.displayName || Dt.basename, Ge = De.contrast === "high" ? "high" : "low", ot = (_b4 = De.author) == null ? void 0 : _b4.trim();
          return {
            ...Dt,
            previewUrl: Ut,
            previewText: Zt,
            fullCssText: ut,
            displayName: Ae,
            contrast: Ge,
            tags: De.tags ?? [],
            importedLocal: Dt.importedLocal,
            ...ot ? {
              author: ot
            } : {}
          };
        } catch {
          return;
        }
      }))).filter((Dt) => !!Dt)
    }), Rt = ol({
      queryKey: [
        "theme-local-tweaks",
        x.map((Ce) => Ce.fullUrl).join("|")
      ],
      enabled: b && x.length > 0,
      staleTime: 10 * 6e4,
      queryFn: async () => (await Promise.all(x.map(async (Dt) => {
        var _a7, _b4, _c4;
        try {
          let Ut;
          if (gy(Dt.fullUrl)) Ut = await Qm(Dt.fullUrl) ?? "";
          else {
            const Ae = await fetch(Dt.fullUrl, {
              mode: "cors"
            });
            if (!Ae.ok) return;
            Ut = await Ae.text();
          }
          const Zt = Tf(Ut), ut = (_a7 = Zt.author) == null ? void 0 : _a7.trim();
          return {
            ...Dt,
            fullCssText: Ut,
            displayName: ((_b4 = Zt.name) == null ? void 0 : _b4.trim()) || Dt.displayName || Dt.basename,
            description: ((_c4 = Zt.description) == null ? void 0 : _c4.trim()) || void 0,
            tags: Zt.tags ?? [],
            importedLocal: Dt.importedLocal,
            ...ut ? {
              author: ut
            } : {}
          };
        } catch {
          return;
        }
      }))).filter((Dt) => !!Dt)
    }), We = p.useCallback((Ce) => {
      const Dt = k.filter((ut) => ut.fullUrl !== Ce), Ut = he(Ce), Zt = [
        B,
        U,
        z
      ].filter((ut) => !!(ut && ut.trim().length > 0)).filter((ut) => ut !== Ce);
      r({
        ...Ut,
        themeRemoteFavorites: te(Dt, Zt)
      });
    }, [
      he,
      z,
      k,
      U,
      B,
      r,
      te
    ]), yt = p.useCallback((Ce) => {
      r({
        themeRemoteLightFullUrl: Ce.fullUrl,
        themeRemoteLightKind: Ce.kind
      });
    }, [
      r
    ]), Xt = p.useCallback((Ce) => {
      r({
        themeRemoteDarkFullUrl: Ce.fullUrl,
        themeRemoteDarkKind: Ce.kind
      });
    }, [
      r
    ]), nn = p.useCallback((Ce) => {
      r({
        themeRemoteManualFullUrl: Ce.fullUrl,
        themeRemoteManualKind: Ce.kind
      });
    }, [
      r
    ]), bt = p.useCallback(() => r({
      themeRemoteLightFullUrl: void 0,
      themeRemoteLightKind: void 0
    }), [
      r
    ]), At = p.useCallback(() => r({
      themeRemoteDarkFullUrl: void 0,
      themeRemoteDarkKind: void 0
    }), [
      r
    ]), $t = p.useCallback(() => r({
      themeRemoteManualFullUrl: void 0,
      themeRemoteManualKind: void 0,
      themeId: "light-theme"
    }), [
      r
    ]), Lt = p.useCallback(() => r({
      themeRemoteManualFullUrl: void 0,
      themeRemoteManualKind: void 0,
      themeId: "dark-theme"
    }), [
      r
    ]), wt = p.useCallback(async (Ce) => {
      try {
        if (gy(Ce)) return !!await Qm(Ce);
        const Dt = await fetch(Ce, {
          mode: "cors"
        });
        if (!Dt.ok) return false;
        const Ut = await Dt.text();
        return await Fo(Ce, Ut), true;
      } catch {
        return false;
      }
    }, []), st = p.useCallback(async (Ce) => {
      if (k.find((De) => De.fullUrl === Ce.fullInstallUrl)) {
        const De = k.filter((ot) => ot.fullUrl !== Ce.fullInstallUrl), Ae = he(Ce.fullInstallUrl), Ge = le.filter((ot) => ot !== Ce.fullInstallUrl);
        r({
          ...Ae,
          themeRemoteFavorites: te(De, Ge)
        });
        return;
      }
      if (!await wt(Ce.fullInstallUrl)) return;
      const Zt = Ce.kind === Rr.Dark ? "dark" : "light", ut = {
        fullUrl: Ce.fullInstallUrl,
        displayName: Ce.displayName,
        basename: Ce.basename,
        kind: Zt,
        pinned: true
      };
      r({
        themeRemoteFavorites: [
          ...k,
          ut
        ]
      });
    }, [
      le,
      he,
      k,
      r,
      wt,
      te
    ]), Be = p.useCallback(async (Ce) => {
      const Dt = Ce.kind === Rr.Dark ? "dark" : "light", Ut = Array.from(new Set([
        B,
        z,
        Ce.fullInstallUrl
      ].filter(Boolean)));
      let Zt = k;
      if (!k.find((De) => De.fullUrl === Ce.fullInstallUrl)) {
        if (!await wt(Ce.fullInstallUrl)) return;
        Zt = [
          ...k,
          {
            fullUrl: Ce.fullInstallUrl,
            displayName: Ce.displayName,
            basename: Ce.basename,
            kind: Dt,
            pinned: false
          }
        ];
      }
      r({
        themeRemoteLightFullUrl: Ce.fullInstallUrl,
        themeRemoteLightKind: Dt,
        themeRemoteFavorites: te(Zt, Ut)
      });
    }, [
      z,
      k,
      B,
      r,
      wt,
      te
    ]), Re = p.useCallback(async (Ce) => {
      const Dt = Ce.kind === Rr.Dark ? "dark" : "light", Ut = Array.from(new Set([
        B,
        U,
        Ce.fullInstallUrl
      ].filter(Boolean)));
      let Zt = k;
      if (!k.find((De) => De.fullUrl === Ce.fullInstallUrl)) {
        if (!await wt(Ce.fullInstallUrl)) return;
        Zt = [
          ...k,
          {
            fullUrl: Ce.fullInstallUrl,
            displayName: Ce.displayName,
            basename: Ce.basename,
            kind: Dt,
            pinned: false
          }
        ];
      }
      r({
        themeRemoteDarkFullUrl: Ce.fullInstallUrl,
        themeRemoteDarkKind: Dt,
        themeRemoteFavorites: te(Zt, Ut)
      });
    }, [
      k,
      U,
      B,
      r,
      wt,
      te
    ]), Ue = p.useCallback(async (Ce) => {
      const Dt = Ce.kind === Rr.Dark ? "dark" : "light", Ut = Array.from(new Set([
        U,
        z,
        Ce.fullInstallUrl
      ].filter(Boolean)));
      let Zt = k;
      if (!k.find((De) => De.fullUrl === Ce.fullInstallUrl)) {
        if (!await wt(Ce.fullInstallUrl)) return;
        Zt = [
          ...k,
          {
            fullUrl: Ce.fullInstallUrl,
            displayName: Ce.displayName,
            basename: Ce.basename,
            kind: Dt,
            pinned: false
          }
        ];
      }
      r({
        themeRemoteManualFullUrl: Ce.fullInstallUrl,
        themeRemoteManualKind: Dt,
        themeRemoteFavorites: te(Zt, Ut)
      });
    }, [
      z,
      k,
      U,
      r,
      wt,
      te
    ]), qe = p.useCallback(() => {
      r({
        themeRemoteManualFullUrl: void 0,
        themeRemoteManualKind: void 0,
        themeRemoteLightFullUrl: void 0,
        themeRemoteLightKind: void 0,
        themeRemoteDarkFullUrl: void 0,
        themeRemoteDarkKind: void 0
      });
    }, [
      r
    ]), tt = p.useCallback(async (Ce, Dt, Ut) => {
      var _a7, _b4;
      const Zt = Ce.trim();
      if (Zt) if (Dt) {
        if (!await wt(Zt)) return;
        const De = S.includes(Zt) ? [
          ...S
        ] : [
          ...S,
          Zt
        ], Ae = [
          ...x
        ];
        if (!Ae.some((Ge) => Ge.fullUrl === Zt)) {
          const Ge = await Qm(Zt) ?? "", ot = Tf(Ge), Mt = Zt.replace(/\.sable\.css(\?.*)?$/i, "").split("/").pop() ?? "tweak";
          Ae.push({
            fullUrl: Zt,
            displayName: (Ut == null ? void 0 : Ut.displayName) ?? ((_a7 = ot.name) == null ? void 0 : _a7.trim()) ?? Mt,
            basename: (Ut == null ? void 0 : Ut.basename) ?? ((_b4 = ot.id) == null ? void 0 : _b4.trim()) ?? Mt,
            pinned: false
          });
        }
        r({
          themeRemoteEnabledTweakFullUrls: De,
          themeRemoteTweakFavorites: re(Ae, De)
        });
      } else {
        const ut = S.filter((De) => De !== Zt);
        if (Ut == null ? void 0 : Ut.pruneUnpinnedFavoriteOnDisable) {
          const De = new Set(ut), Ae = m.current, Ge = x.filter((ot) => ot.pinned === true || De.has(ot.fullUrl) || Ae.has(ot.fullUrl.trim()));
          r({
            themeRemoteEnabledTweakFullUrls: ut,
            themeRemoteTweakFavorites: Ge
          });
        } else r({
          themeRemoteEnabledTweakFullUrls: ut
        });
      }
    }, [
      S,
      r,
      wt,
      re,
      x
    ]), ht = p.useCallback(async (Ce) => {
      if (x.find((ut) => ut.fullUrl === Ce.fullUrl)) {
        const ut = x.filter((Ae) => Ae.fullUrl !== Ce.fullUrl), De = S.filter((Ae) => Ae !== Ce.fullUrl);
        r({
          themeRemoteTweakFavorites: re(ut, De),
          themeRemoteEnabledTweakFullUrls: De
        });
        return;
      }
      if (!await wt(Ce.fullUrl)) return;
      const Zt = {
        fullUrl: Ce.fullUrl,
        displayName: Ce.displayName,
        basename: Ce.basename,
        pinned: true
      };
      r({
        themeRemoteTweakFavorites: re([
          ...x,
          Zt
        ], S)
      });
    }, [
      S,
      r,
      wt,
      re,
      x
    ]), $e = p.useCallback((Ce) => {
      const Dt = x.filter((Zt) => Zt.fullUrl !== Ce), Ut = S.filter((Zt) => Zt !== Ce);
      r({
        themeRemoteTweakFavorites: re(Dt, Ut),
        themeRemoteEnabledTweakFullUrls: Ut
      });
    }, [
      S,
      r,
      re,
      x
    ]), Tt = p.useCallback((Ce) => {
      const Dt = `${Ce.basename || "theme"}.sable.css`;
      vW(Ce.fullCssText, Dt);
    }, []), zt = p.useCallback((Ce) => {
      const Dt = `${Ce.basename || "tweak"}.sable.css`;
      vW(Ce.fullCssText, Dt);
    }, []), Vt = se.data, bn = (Vt == null ? void 0 : Vt.themes.length) ?? 0, Zn = (Vt == null ? void 0 : Vt.tweaks.length) ?? 0, Kn = bn + Zn > 0;
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        w && o.jsxs(o.Fragment, {
          children: [
            o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(Ie, {
                  title: "Sync with system theme",
                  focusId: "theme-local-sync-system",
                  description: "When enabled, use different themes for OS light vs dark mode. When disabled, one manual theme is used.",
                  after: o.jsx(Jt, {
                    variant: "Primary",
                    value: T,
                    onChange: A
                  })
                }),
                T ? o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  wrap: "Wrap",
                  alignItems: "Center",
                  children: [
                    o.jsx(xe, {
                      variant: "Secondary",
                      fill: "Soft",
                      outlined: true,
                      size: "300",
                      radii: "300",
                      onClick: bt,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Built-in (OS light)"
                      })
                    }),
                    o.jsx(xe, {
                      variant: "Secondary",
                      fill: "Soft",
                      outlined: true,
                      size: "300",
                      radii: "300",
                      onClick: At,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Built-in (OS dark)"
                      })
                    })
                  ]
                }) : o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  wrap: "Wrap",
                  alignItems: "Center",
                  children: [
                    o.jsx(xe, {
                      variant: "Secondary",
                      fill: "Soft",
                      outlined: true,
                      size: "300",
                      radii: "300",
                      onClick: $t,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Built-in Light"
                      })
                    }),
                    o.jsx(xe, {
                      variant: "Secondary",
                      fill: "Soft",
                      outlined: true,
                      size: "300",
                      radii: "300",
                      onClick: Lt,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Built-in Dark"
                      })
                    })
                  ]
                })
              ]
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsx(Ie, {
                title: "Clear theme assignments",
                focusId: "theme-catalog-clear-remote",
                description: "Clears which saved themes apply to light/dark or manual mode. Favorites stay available.",
                after: o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  size: "300",
                  radii: "300",
                  onClick: qe,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Clear"
                  })
                })
              })
            })
          ]
        }),
        b && o.jsxs(o.Fragment, {
          children: [
            o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(D, {
                  size: "T300",
                  children: "Saved themes"
                }),
                lt.isPending && k.length > 0 && o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  alignItems: "Center",
                  children: [
                    o.jsx(dt, {
                      variant: "Primary",
                      size: "400"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      children: "Loading local previews\u2026"
                    })
                  ]
                }),
                k.length === 0 && o.jsx(D, {
                  size: "T300",
                  priority: "300",
                  children: "No saved themes yet. Star themes in the catalog to download them locally."
                }),
                lt.isSuccess && k.length > 0 && o.jsx(o.Fragment, {
                  children: lt.data.length === 0 ? o.jsx(D, {
                    size: "T300",
                    priority: "300",
                    children: "Could not load local previews. If this happens, the theme preview file may be missing or not paired as `*.preview.sable.css`."
                  }) : o.jsx(E, {
                    style: {
                      display: "grid",
                      gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
                      gap: He(16)
                    },
                    children: lt.data.map((Ce) => {
                      const Dt = Ce.basename.replace(/[^a-zA-Z0-9_-]/g, "-") || "theme", Zt = `${Ce.kind === "dark" ? "Dark" : "Light"} \xB7 ${Ce.contrast} contrast`, ut = `${Ce.author ? `by ${Ce.author}` : ""}${Ce.tags.length > 0 ? `${Ce.author ? " \xB7 " : ""}${Ce.tags.join(", ")}` : ""}`.trim(), De = o.jsxs(o.Fragment, {
                        children: [
                          Zt,
                          ut ? o.jsxs(o.Fragment, {
                            children: [
                              o.jsx("br", {}),
                              ut
                            ]
                          }) : null
                        ]
                      });
                      return o.jsx(zI, {
                        title: Ce.displayName,
                        subtitle: De,
                        previewCssText: Ce.previewText,
                        scopeSlug: `local-${Dt}`,
                        copyText: Ce.importedLocal ? void 0 : Ce.previewUrl,
                        thirdParty: !Ce.importedLocal && by(Ce.fullUrl, n.themeCatalogApprovedHostPrefixes),
                        isFavorited: true,
                        onToggleFavorite: () => We(Ce.fullUrl),
                        onExport: () => Tt(Ce),
                        systemTheme: T,
                        onApplyLight: T ? () => yt(Ce) : void 0,
                        onApplyDark: T ? () => Xt(Ce) : void 0,
                        onApplyManual: T ? void 0 : () => nn(Ce),
                        isAppliedLight: U === Ce.fullUrl,
                        isAppliedDark: z === Ce.fullUrl,
                        isAppliedManual: B === Ce.fullUrl
                      }, Ce.fullUrl);
                    })
                  })
                })
              ]
            }),
            o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(D, {
                  size: "T300",
                  children: "Saved tweaks"
                }),
                Rt.isPending && x.length > 0 && o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  alignItems: "Center",
                  children: [
                    o.jsx(dt, {
                      variant: "Primary",
                      size: "400"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      children: "Loading tweaks\u2026"
                    })
                  ]
                }),
                x.length === 0 && o.jsx(D, {
                  size: "T300",
                  priority: "300",
                  children: "No saved tweaks. Favorite tweaks in the catalog to keep them here, or enable a tweak to cache it automatically."
                }),
                Rt.isSuccess && x.length > 0 && o.jsx(E, {
                  direction: "Column",
                  gap: "200",
                  children: Rt.data.length === 0 ? o.jsx(D, {
                    size: "T300",
                    priority: "300",
                    children: "Could not load tweak CSS. Check the URL or your connection."
                  }) : Rt.data.map((Ce) => {
                    const Dt = S.includes(Ce.fullUrl), Zt = [
                      Ce.description,
                      Ce.author ? `by ${Ce.author}` : "",
                      Ce.tags.length > 0 ? Ce.tags.join(", ") : ""
                    ].filter(Boolean).join(" \xB7 ") || "Applies on top of your current theme after it loads.";
                    return o.jsx(AY, {
                      displayName: Ce.displayName,
                      description: Zt,
                      copyUrl: Ce.importedLocal ? void 0 : Ce.fullUrl,
                      thirdPartyChip: !Ce.importedLocal && by(Ce.fullUrl, n.themeCatalogApprovedHostPrefixes),
                      isFavorited: true,
                      onToggleFavorite: () => $e(Ce.fullUrl),
                      onExport: () => zt(Ce),
                      isOn: Dt,
                      onSetApplied: (ut) => tt(Ce.fullUrl, ut, {
                        displayName: Ce.displayName,
                        basename: Ce.basename
                      })
                    }, Ce.fullUrl);
                  })
                })
              ]
            })
          ]
        }),
        c && !d && o.jsxs(o.Fragment, {
          children: [
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsx(Ie, {
                title: "Browse catalog",
                focusId: "theme-browse-remote",
                description: "Download themes and tweaks from the official catalog.",
                after: o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  size: "300",
                  radii: "300",
                  onClick: () => u(true),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Browse catalog\u2026"
                  })
                })
              })
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsx(Ie, {
                title: "Import a theme or tweak",
                focusId: "theme-import-open",
                description: "Add a theme or @sable-tweak overlay from a link or a CSS file on your device.",
                after: o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  size: "300",
                  radii: "300",
                  onClick: () => f(true),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Import\u2026"
                  })
                })
              })
            }),
            o.jsx(GUe, {
              open: h,
              onClose: () => f(false)
            })
          ]
        }),
        v && o.jsxs(o.Fragment, {
          children: [
            !c && o.jsx(D, {
              size: "L400",
              children: "Browse catalog"
            }),
            c && d || se.isPending || se.isError || se.isSuccess && (bn > 0 && ye.isPending || Zn > 0 && we.isPending) ? o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              style: {
                overflowX: "hidden",
                minWidth: 0
              },
              children: [
                c && d && o.jsxs(E, {
                  alignItems: "Center",
                  justifyContent: "SpaceBetween",
                  gap: "200",
                  children: [
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx(D, {
                          size: "T300",
                          children: "Browse catalog"
                        }),
                        o.jsx(D, {
                          size: "T200",
                          priority: "300",
                          children: "Download themes and tweaks from the catalog."
                        })
                      ]
                    }),
                    o.jsxs(E, {
                      direction: "Row",
                      gap: "100",
                      alignItems: "Center",
                      shrink: "No",
                      children: [
                        o.jsx(xe, {
                          variant: "Secondary",
                          fill: "Soft",
                          outlined: true,
                          size: "300",
                          radii: "300",
                          onClick: () => i.invalidateQueries({
                            queryKey: [
                              "theme-catalog-bundle"
                            ]
                          }),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Refresh catalog"
                          })
                        }),
                        o.jsx(xe, {
                          variant: "Secondary",
                          fill: "Soft",
                          outlined: true,
                          size: "300",
                          radii: "300",
                          onClick: () => u(false),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Back"
                          })
                        })
                      ]
                    })
                  ]
                }),
                (se.isPending || se.isError) && o.jsxs(E, {
                  direction: "Column",
                  gap: "200",
                  children: [
                    se.isPending && o.jsxs(E, {
                      direction: "Row",
                      gap: "200",
                      alignItems: "Center",
                      children: [
                        o.jsx(dt, {
                          variant: "Primary",
                          size: "400"
                        }),
                        o.jsx(D, {
                          size: "T300",
                          children: "Loading catalog\u2026"
                        })
                      ]
                    }),
                    se.isError && o.jsx(D, {
                      size: "T300",
                      style: {
                        color: "var(--sable-crit-main)"
                      },
                      children: ((_k3 = se.error) == null ? void 0 : _k3.message) ?? "Failed to load catalog"
                    })
                  ]
                }),
                se.isSuccess && bn > 0 && ye.isPending && o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  alignItems: "Center",
                  children: [
                    o.jsx(dt, {
                      variant: "Primary",
                      size: "400"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      children: "Loading previews\u2026"
                    })
                  ]
                }),
                se.isSuccess && Zn > 0 && we.isPending && o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  alignItems: "Center",
                  children: [
                    o.jsx(dt, {
                      variant: "Primary",
                      size: "400"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      children: "Loading tweaks\u2026"
                    })
                  ]
                })
              ]
            }) : null,
            se.isSuccess && Kn && bn > 0 && ye.isSuccess && o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "300",
              children: [
                o.jsx(Ie, {
                  title: "Themes",
                  focusId: "catalog-themes"
                }),
                o.jsx(mn, {
                  size: "300",
                  radii: "300",
                  outlined: true,
                  placeholder: "Search themes\u2026",
                  value: V,
                  onChange: K
                }),
                o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  wrap: "Wrap",
                  alignItems: "Center",
                  children: [
                    o.jsx(D, {
                      size: "T300",
                      children: "Kind:"
                    }),
                    [
                      "all",
                      "light",
                      "dark"
                    ].map((Ce) => o.jsx(Qe, {
                      type: "button",
                      variant: ue === Ce ? "Primary" : "Secondary",
                      outlined: ue === Ce,
                      radii: "Pill",
                      onClick: () => ie(Ce),
                      children: o.jsx(D, {
                        size: "B300",
                        children: Ce === "all" ? "All" : Ce
                      })
                    }, Ce)),
                    o.jsx(D, {
                      size: "T300",
                      children: "Contrast:"
                    }),
                    [
                      "all",
                      "low",
                      "high"
                    ].map((Ce) => o.jsx(Qe, {
                      type: "button",
                      variant: de === Ce ? "Primary" : "Secondary",
                      outlined: de === Ce,
                      radii: "Pill",
                      onClick: () => ne(Ce),
                      children: o.jsx(D, {
                        size: "B300",
                        children: Ce === "all" ? "All" : Ce
                      })
                    }, Ce))
                  ]
                }),
                o.jsx(dn, {
                  direction: "Vertical",
                  size: "300",
                  hideTrack: true,
                  visibility: "Hover",
                  style: {
                    height: "min(33vh, 16rem)",
                    minHeight: 0,
                    maxWidth: "100%"
                  },
                  children: o.jsxs(E, {
                    direction: "Column",
                    gap: "400",
                    children: [
                      o.jsx(E, {
                        style: {
                          display: "grid",
                          gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
                          gap: He(16)
                        },
                        children: Ne.map((Ce) => {
                          const Dt = Ce.basename.replace(/[^a-zA-Z0-9_-]/g, "-") || "theme", Ut = Ce.kind === Rr.Dark ? "Dark" : "Light", Zt = k.some((Ge) => Ge.fullUrl === Ce.fullInstallUrl), ut = `${Ut} \xB7 ${Ce.contrast} contrast`, De = `${Ce.author ? `by ${Ce.author}` : ""}${Ce.tags.length > 0 ? `${Ce.author ? " \xB7 " : ""}${Ce.tags.join(", ")}` : ""}`.trim(), Ae = o.jsxs(o.Fragment, {
                            children: [
                              ut,
                              De ? o.jsxs(o.Fragment, {
                                children: [
                                  o.jsx("br", {}),
                                  De
                                ]
                              }) : null
                            ]
                          });
                          return o.jsx(zI, {
                            title: Ce.displayName,
                            subtitle: Ae,
                            previewCssText: Ce.previewText,
                            scopeSlug: `catalog-${Dt}`,
                            copyText: Ce.previewUrl,
                            thirdParty: by(Ce.previewUrl, n.themeCatalogApprovedHostPrefixes),
                            isFavorited: Zt,
                            onToggleFavorite: () => st(Ce),
                            systemTheme: T,
                            onApplyLight: T ? () => Be(Ce) : void 0,
                            onApplyDark: T ? () => Re(Ce) : void 0,
                            onApplyManual: T ? void 0 : () => Ue(Ce),
                            isAppliedLight: U === Ce.fullInstallUrl,
                            isAppliedDark: z === Ce.fullInstallUrl,
                            isAppliedManual: B === Ce.fullInstallUrl
                          }, Ce.basename);
                        })
                      }),
                      Ne.length === 0 && o.jsx(D, {
                        size: "T300",
                        priority: "300",
                        children: "No themes match filters."
                      })
                    ]
                  })
                })
              ]
            }),
            se.isSuccess && Kn && Zn > 0 && we.isSuccess && o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "300",
              children: [
                o.jsx(Ie, {
                  title: "Tweaks",
                  focusId: "catalog-tweaks"
                }),
                o.jsx(mn, {
                  size: "300",
                  radii: "300",
                  outlined: true,
                  placeholder: "Search tweaks\u2026",
                  value: Y,
                  onChange: G
                }),
                o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  wrap: "Wrap",
                  alignItems: "Center",
                  children: [
                    o.jsx(D, {
                      size: "T300",
                      children: "Status:"
                    }),
                    [
                      "all",
                      "enabled",
                      "disabled"
                    ].map((Ce) => o.jsx(Qe, {
                      type: "button",
                      variant: ae === Ce ? "Primary" : "Secondary",
                      outlined: ae === Ce,
                      radii: "Pill",
                      onClick: () => X(Ce),
                      children: o.jsx(D, {
                        size: "B300",
                        children: {
                          all: "All",
                          enabled: "Enabled",
                          disabled: "Disabled"
                        }[Ce]
                      })
                    }, Ce))
                  ]
                }),
                o.jsx(dn, {
                  direction: "Vertical",
                  size: "300",
                  hideTrack: true,
                  visibility: "Hover",
                  style: {
                    height: "min(33vh, 16rem)",
                    minHeight: 0,
                    maxWidth: "100%"
                  },
                  children: o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      ke.map((Ce) => {
                        const Dt = x.some((De) => De.fullUrl === Ce.fullUrl), Ut = S.includes(Ce.fullUrl), ut = [
                          Ce.description,
                          Ce.author ? `by ${Ce.author}` : "",
                          Ce.tags.length > 0 ? Ce.tags.join(", ") : ""
                        ].filter(Boolean).join(" \xB7 ") || "Applies on top of your current theme after it loads.";
                        return o.jsx(AY, {
                          displayName: Ce.displayName,
                          description: ut,
                          copyUrl: Ce.fullUrl,
                          thirdPartyChip: by(Ce.fullUrl, n.themeCatalogApprovedHostPrefixes),
                          isFavorited: Dt,
                          onToggleFavorite: () => ht(Ce),
                          isOn: Ut,
                          onSetApplied: (De) => tt(Ce.fullUrl, De, {
                            displayName: Ce.displayName,
                            basename: Ce.basename,
                            pruneUnpinnedFavoriteOnDisable: true
                          })
                        }, Ce.fullUrl);
                      }),
                      Ee.length === 0 && o.jsx(D, {
                        size: "T300",
                        priority: "300",
                        children: "No tweaks match your search."
                      }),
                      Ee.length > 0 && ke.length === 0 && o.jsx(D, {
                        size: "T300",
                        priority: "300",
                        children: "No tweaks match this status filter."
                      })
                    ]
                  })
                })
              ]
            })
          ]
        }),
        y && o.jsxs(o.Fragment, {
          children: [
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsx(Ie, {
                title: "Theme & tweak links in chat",
                focusId: "theme-chat-sable-widgets",
                description: "When disabled, messages do not show theme or tweak cards (or placeholders) for Sable CSS links, only a plain link.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: O,
                  onChange: M
                })
              })
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsx(Ie, {
                title: "Theme & tweak previews from approved URLs",
                focusId: "theme-chat-auto-approved",
                description: "When enabled, approved catalog hosts fetch and show a preview. When disabled, a \u201CLoad preview\u201D control is shown.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: I,
                  onChange: N,
                  disabled: !O
                })
              })
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Theme & tweak previews from any URL",
                focusId: "theme-chat-auto-any",
                description: "Strongy discouraged. When enabled, potentially dangerous third-party Sable CSS links also fetch automatically. When disabled, those links never load until you use Load preview on the card.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: L,
                  onChange: H,
                  disabled: !O
                })
              })
            })
          ]
        })
      ]
    });
  }
  function HI(t, e) {
    return t.map((n) => ({
      value: n.id,
      label: e[n.id] ?? n.id
    }));
  }
  function uVe({ disabled: t }) {
    var _a6;
    const e = AB(), n = Qre(), [r, i] = Fe(ge, "themeId"), a = HI(e, n), s = ((_a6 = a.find((l) => l.value === r)) == null ? void 0 : _a6.value) ?? Hg.id;
    return o.jsx(Kc, {
      value: s,
      options: a,
      onSelect: i,
      disabled: t
    });
  }
  function hVe() {
    var _a6, _b3;
    const t = Qre(), e = AB(), [n, r] = Fe(ge, "lightThemeId"), [i, a] = Fe(ge, "darkThemeId"), s = e.filter((f) => f.kind === Rr.Light), l = e.filter((f) => f.kind === Rr.Dark), c = HI(s, t), d = HI(l, t), u = ((_a6 = c.find((f) => f.value === n)) == null ? void 0 : _a6.value) ?? Hg.id, h = ((_b3 = d.find((f) => f.value === i)) == null ? void 0 : _b3.value) ?? Zb.id;
    return o.jsxs(E, {
      wrap: "Wrap",
      gap: "400",
      children: [
        o.jsx(Ie, {
          title: "Light Theme:",
          focusId: "light-theme",
          after: o.jsx(Kc, {
            value: u,
            options: c,
            onSelect: r
          })
        }),
        o.jsx(Ie, {
          title: "Dark Theme:",
          focusId: "dark-theme",
          after: o.jsx(Kc, {
            value: h,
            options: d,
            onSelect: a
          })
        })
      ]
    });
  }
  function fVe({ onRequestCatalogEnable: t }) {
    const [e, n] = Fe(ge, "useSystemTheme");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "System Theme",
              focusId: "system-theme",
              description: "Sync with your device's light/dark mode.",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: e,
                onChange: n
              })
            }),
            e && o.jsx(hVe, {})
          ]
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Manual Theme",
            focusId: "manual-theme",
            description: "Active when System Theme is disabled.",
            after: o.jsx(uVe, {
              disabled: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Enable catalog",
            focusId: "browse-remote-catalog",
            description: "Load remote themes and tweaks from the official catalog. You will be asked to confirm before any catalog content is fetched.",
            after: o.jsx(xe, {
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              size: "300",
              radii: "300",
              onClick: t,
              children: o.jsx(D, {
                size: "B300",
                children: "Enable catalog"
              })
            })
          })
        })
      ]
    });
  }
  function mVe({ onBrowseOpenChange: t }) {
    return o.jsx(dVe, {
      mode: "appearance",
      onBrowseOpenChange: t
    });
  }
  function gVe({ onBrowseOpenChange: t } = {}) {
    const e = SF(), [n] = Fe(ge, "themeCatalogOnboardingDone"), [r] = Fe(ge, "themeRemoteCatalogEnabled");
    p.useEffect(() => {
      r || (t == null ? void 0 : t(false));
    }, [
      r,
      t
    ]);
    const i = p.useCallback((l) => {
      const c = {
        ...e.get(ge),
        themeCatalogOnboardingDone: true
      };
      c.themeRemoteCatalogEnabled = l, e.set(ge, c);
    }, [
      e
    ]), { dialog: a, openOnboarding: s } = NUe(n, i);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Theme"
        }),
        a,
        r ? o.jsx(mVe, {
          onBrowseOpenChange: t
        }) : o.jsx(fVe, {
          onRequestCatalogEnable: s
        })
      ]
    });
  }
  const pVe = () => p.useMemo(() => [
    {
      layout: Ic.Always,
      name: "Always"
    },
    {
      layout: Ic.Smart,
      name: "Smart"
    },
    {
      layout: Ic.Never,
      name: "Never"
    }
  ], []), FVe = () => p.useMemo(() => [
    {
      layout: void 0,
      name: "Default"
    },
    {
      layout: Ic.Always,
      name: "Always"
    },
    {
      layout: Ic.Smart,
      name: "Smart"
    },
    {
      layout: Ic.Never,
      name: "Never"
    }
  ], []), vVe = () => p.useMemo(() => [
    {
      layout: "roomSidebarWidth",
      name: "Room Panel Width"
    },
    {
      layout: "memberSidebarWidth",
      name: "Member Panel Width"
    },
    {
      layout: "threadSidebarWidth",
      name: "Thread Panel Width"
    },
    {
      layout: "threadRootHeight",
      name: "Thread Root Height"
    },
    {
      layout: "vcmsgSidebarWidth",
      name: "VoiceCall Msg Panel Width"
    },
    {
      layout: "widgetSidebarWidth",
      name: "Widget Panel Width"
    },
    {
      layout: "roomBannerHeight",
      name: "Room Banner Height"
    }
  ], []), Lce = p.createContext(null), dp = Lce.Provider;
  function cr() {
    const t = p.useContext(Lce);
    if (!t) throw new Error("Room not provided!");
    return t;
  }
  const Nce = p.createContext(false), wE = Nce.Provider, zce = () => p.useContext(Nce);
  var hi = "styles_SequenceCardStyle__1ph2gwe0";
  function Uce({ roomId: t }) {
    var _a6, _b3;
    const [e, n] = p.useState(), r = FVe(), [i, a] = Fe(ge, "perRoomShowRoomIcon"), s = (_a6 = i == null ? void 0 : i.find((d) => d.roomId === t)) == null ? void 0 : _a6.display, l = (d) => {
      n(d.currentTarget.getBoundingClientRect());
    }, c = (d) => {
      let u = i.filter((h) => h.roomId !== t);
      d && (u = [
        ...u,
        {
          roomId: t,
          display: d
        }
      ]), a(u), n(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: l,
          children: o.jsx(D, {
            size: "T300",
            children: ((_b3 = r.find((d) => d.layout === s)) == null ? void 0 : _b3.name) ?? s
          })
        }),
        o.jsx(ln, {
          anchor: e,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => n(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (d) => d.key === "ArrowDown" || d.key === "ArrowRight",
              isKeyBackward: (d) => d.key === "ArrowUp" || d.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: r.map((d) => o.jsx(Ye, {
                  size: "300",
                  variant: s === d.layout ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => c(d.layout),
                  children: o.jsx(D, {
                    size: "T300",
                    children: d.name
                  })
                }, d.layout))
              })
            })
          })
        })
      ]
    });
  }
  function _Ve({ requestClose: t }) {
    const e = cr();
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Appearance"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "700",
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Visual Tweaks"
                    }),
                    o.jsx(Te, {
                      className: hi,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      children: o.jsx(Ie, {
                        title: "Show Room Icons In Sidebar",
                        description: "When do you want to show the specific room icons in the sidebar within this space?",
                        after: o.jsx(Uce, {
                          roomId: e.roomId
                        })
                      })
                    })
                  ]
                })
              })
            })
          })
        })
      ]
    });
  }
  const L5 = (t) => Math.max(1, Math.min(4096, t));
  function c2(t) {
    return (t ? M9(t) : [
      ...M9("light"),
      ...M9("dark")
    ]).map((n) => ({
      value: n.id,
      label: c6e(n.id)
    }));
  }
  function IY({ selectedLabel: t, onClick: e, active: n, disabled: r }) {
    return o.jsx(Qe, {
      type: "button",
      variant: n ? "Primary" : "Secondary",
      outlined: n,
      radii: "Pill",
      after: o.jsx(Q, {
        size: "200",
        src: q.ChevronBottom
      }),
      onClick: e,
      disabled: r,
      children: o.jsx(D, {
        size: "B300",
        children: t
      })
    });
  }
  function yVe({ disabled: t }) {
    var _a6, _b3, _c3;
    const e = yk(), [n, r] = Fe(ge, "arboriumThemeId"), [i] = Fe(ge, "arboriumLightTheme"), [a] = Fe(ge, "arboriumDarkTheme"), s = c2(), l = e.kind === Rr.Dark ? ((_a6 = c2("dark").find((d) => d.value === a)) == null ? void 0 : _a6.value) ?? pP : ((_b3 = c2("light").find((d) => d.value === i)) == null ? void 0 : _b3.value) ?? gP, c = ((_c3 = s.find((d) => d.value === n)) == null ? void 0 : _c3.value) ?? l;
    return o.jsx(Kc, {
      value: c,
      options: s,
      onSelect: r,
      disabled: t
    });
  }
  function bVe() {
    var _a6, _b3;
    const t = yk(), [e, n] = Fe(ge, "arboriumLightTheme"), [r, i] = Fe(ge, "arboriumDarkTheme"), a = c2("light"), s = c2("dark"), l = ((_a6 = a.find((d) => d.value === e)) == null ? void 0 : _a6.value) ?? gP, c = ((_b3 = s.find((d) => d.value === r)) == null ? void 0 : _b3.value) ?? pP;
    return o.jsxs(E, {
      wrap: "Wrap",
      gap: "400",
      children: [
        o.jsx(Ie, {
          title: "Light Theme:",
          focusId: "code-block-light-theme",
          after: o.jsx(Kc, {
            value: l,
            options: a,
            onSelect: n,
            renderTrigger: ({ selectedOption: d, openMenu: u, disabled: h }) => o.jsx(IY, {
              selectedLabel: d.label,
              onClick: u,
              active: t.kind === Rr.Light,
              disabled: h
            })
          })
        }),
        o.jsx(Ie, {
          title: "Dark Theme:",
          focusId: "code-block-dark-theme",
          after: o.jsx(Kc, {
            value: c,
            options: s,
            onSelect: i,
            renderTrigger: ({ selectedOption: d, openMenu: u, disabled: h }) => o.jsx(IY, {
              selectedLabel: d.label,
              onClick: u,
              active: t.kind === Rr.Dark,
              disabled: h
            })
          })
        })
      ]
    });
  }
  function xVe() {
    const [t, e] = Fe(ge, "useSystemArboriumTheme");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Code Block Theme"
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "System Theme",
              focusId: "code-block-system-theme",
              description: "Sync highlighted code with the app's active light/dark theme.",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: t,
                onChange: e
              })
            }),
            t && o.jsx(bVe, {})
          ]
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Manual Theme",
            focusId: "code-block-manual-theme",
            description: "Active when System Theme is disabled.",
            after: o.jsx(yVe, {
              disabled: t
            })
          })
        })
      ]
    });
  }
  function wVe() {
    const [t, e] = Fe(ge, "saturationLevel"), [n, r] = Fe(ge, "underlineLinks"), [i, a] = Fe(ge, "reducedMotion"), [s, l] = Fe(ge, "autoplayGifs"), [c, d] = Fe(ge, "autoplayStickers"), [u, h] = Fe(ge, "autoplayEmojis"), [f, g] = Fe(ge, "pixelatedImageRendering"), m = [
      {
        value: "both",
        label: "Both"
      },
      {
        value: "chat",
        label: "Chat"
      },
      {
        value: "viewer",
        label: "Image viewer"
      },
      {
        value: "none",
        label: "Neither"
      }
    ], [v, y] = Fe(ge, "incomingInlineImagesDefaultHeight"), [w, b] = Fe(ge, "incomingInlineImagesMaxHeight"), [j, k] = Fe(ge, "linkPreviewImageMaxHeight"), [C, x] = p.useState(v.toString()), [S, T] = p.useState(w.toString()), [A, B] = p.useState(j.toString()), [U, z] = Fe(ge, "showRoomBanners"), O = (L) => {
      const H = L.target.value;
      x(H);
      const V = Number.parseInt(H, 10);
      Number.isNaN(V) || y(L5(V));
    }, M = (L) => {
      const H = L.target.value;
      T(H);
      const V = Number.parseInt(H, 10);
      Number.isNaN(V) || b(L5(V));
    }, I = (L) => {
      const H = L.target.value;
      B(H);
      const V = Number.parseInt(H, 10);
      Number.isNaN(V) || k(L5(V));
    }, N = (L) => (H) => {
      Yt.isKeyHotkey("escape", H) && (H.stopPropagation(), L(), H.target.blur()), Yt.isKeyHotkey("enter", H) && H.target.blur();
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Display"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Saturation",
            focusId: "saturation",
            description: `${t}%`,
            after: o.jsx("input", {
              type: "range",
              min: "0",
              max: "100",
              step: "1",
              value: t,
              onChange: (L) => e(Number.parseInt(L.target.value, 10)),
              style: {
                width: He(160),
                cursor: "pointer",
                appearance: "none",
                height: He(6),
                borderRadius: ee.radii.Pill,
                backgroundColor: "var(--sable-surface-container-line)",
                accentColor: "var(--sable-primary-main)"
              }
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Underline Links",
            focusId: "underline-links",
            description: "Always show underlines on links in chat, bios and room descriptions.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: n,
              onChange: r
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Reduced Motion",
            focusId: "reduced-motion",
            description: "Stops animations and sliding UI elements.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: i,
              onChange: a
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Autoplay GIFs",
            focusId: "autoplay-gifs",
            description: "Automatically play animated image uploads and links.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: s,
              onChange: l
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Pixelated image scaling",
            focusId: "pixelated-image-rendering",
            description: "Use crisp nearest-neighbor scaling where selected. Improves pixel art but makes normal images worse.",
            after: o.jsx(Kc, {
              value: f,
              options: m,
              onSelect: g
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Autoplay Stickers",
            focusId: "autoplay-stickers",
            description: "Automatically play animated stickers.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: c,
              onChange: d
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Autoplay Emojis",
            focusId: "autoplay-emojis",
            description: "Automatically play animated custom emojis.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: u,
              onChange: h
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Display Room banners",
            focusId: "display-room-banners",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: U,
              onChange: z
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Incoming inline images default height",
            focusId: "incoming-inline-images-default-height",
            description: "Default height for incoming inline images that don't specify a height.",
            after: o.jsx(mn, {
              style: {
                width: He(100)
              },
              variant: Number.parseInt(C, 10) === v ? "Secondary" : "Success",
              size: "300",
              radii: "300",
              type: "number",
              min: "1",
              max: "4096",
              value: C,
              onChange: O,
              onKeyDown: N(() => x(v.toString())),
              after: o.jsx(D, {
                size: "T300",
                children: "px"
              }),
              outlined: true
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Incoming inline images max height",
            focusId: "incoming-inline-images-max-height",
            description: "Maximum height for incoming inline images. Any incoming height above this is clamped down.",
            after: o.jsx(mn, {
              style: {
                width: He(100)
              },
              variant: Number.parseInt(S, 10) === w ? "Secondary" : "Success",
              size: "300",
              radii: "300",
              type: "number",
              min: "1",
              max: "4096",
              value: S,
              onChange: M,
              onKeyDown: N(() => T(w.toString())),
              after: o.jsx(D, {
                size: "T300",
                children: "px"
              }),
              outlined: true
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Link preview image max height",
            focusId: "link-preview-image-max-height",
            description: "Maximum height for URL / Open Graph preview media (image or playable og:video), including bundled previews.",
            after: o.jsx(mn, {
              style: {
                width: He(100)
              },
              variant: Number.parseInt(A, 10) === j ? "Secondary" : "Success",
              size: "300",
              radii: "300",
              type: "number",
              min: "1",
              max: "4096",
              value: A,
              onChange: I,
              onKeyDown: N(() => B(j.toString())),
              after: o.jsx(D, {
                size: "T300",
                children: "px"
              }),
              outlined: true
            })
          })
        })
      ]
    });
  }
  function DVe() {
    const [t, e] = Fe(ge, "subspaceHierarchyLimit"), [n, r] = p.useState(t.toString()), i = (s) => {
      const l = s.target.value;
      r(l);
      const c = parseInt(l, 10);
      !Number.isNaN(c) && c >= 2 && c <= 10 && e(c);
    }, a = (s) => {
      Yt.isKeyHotkey("escape", s) && (s.stopPropagation(), r(t.toString()), s.target.blur()), Yt.isKeyHotkey("enter", s) && s.target.blur();
    };
    return o.jsx(mn, {
      style: {
        width: He(80)
      },
      variant: parseInt(n, 10) === t ? "Secondary" : "Success",
      size: "300",
      radii: "300",
      type: "number",
      min: "1",
      max: "10",
      value: n,
      onChange: i,
      onKeyDown: a,
      outlined: true
    });
  }
  function CVe() {
    const [t, e] = Fe(ge, "pageZoom"), [n, r] = p.useState(`${t}`), i = (s) => {
      r(s.target.value);
    }, a = (s) => {
      if (Yt.isKeyHotkey("escape", s) && (s.stopPropagation(), r(t.toString())), Yt.isKeyHotkey("enter", s) && "value" in s.target && typeof s.target.value == "string") {
        const l = Number.parseInt(s.target.value, 10);
        if (Number.isNaN(l)) return;
        const c = Math.max(Math.min(l, 150), 75);
        e(c), r(c.toString());
      }
    };
    return o.jsx(mn, {
      style: {
        width: He(100)
      },
      variant: t === Number.parseInt(n, 10) ? "Secondary" : "Success",
      size: "300",
      radii: "300",
      type: "number",
      min: "75",
      max: "150",
      value: n,
      onChange: i,
      onKeyDown: a,
      after: o.jsx(D, {
        size: "T300",
        children: "%"
      }),
      outlined: true
    });
  }
  function EVe({ sidebarSelector: t, setSidebarSelector: e }) {
    var _a6;
    const [n, r] = p.useState(), i = vVe(), a = (l) => {
      r(l.currentTarget.getBoundingClientRect());
    }, s = (l) => {
      e(l.layout), r(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: a,
          children: o.jsx(D, {
            size: "T300",
            children: ((_a6 = i.find((l) => l.layout === t)) == null ? void 0 : _a6.name) ?? t
          })
        }),
        o.jsx(ln, {
          anchor: n,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => r(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: i.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: t === l.layout ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => s(l),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.layout))
              })
            })
          })
        })
      ]
    });
  }
  function kVe({ sidebarSelector: t }) {
    const [e, n] = Fe(ge, "roomSidebarWidth"), [r, i] = Fe(ge, "memberSidebarWidth"), [a, s] = Fe(ge, "threadSidebarWidth"), [l, c] = Fe(ge, "threadRootHeight"), [d, u] = Fe(ge, "vcmsgSidebarWidth"), [h, f] = Fe(ge, "widgetSidebarWidth"), [g, m] = Fe(ge, "roomBannerHeight"), v = p.useMemo(() => {
      if (t === "roomSidebarWidth") return e;
      if (t === "memberSidebarWidth") return r;
      if (t === "threadSidebarWidth") return a;
      if (t === "threadRootHeight") return l;
      if (t === "vcmsgSidebarWidth") return d;
      if (t === "widgetSidebarWidth") return h;
      if (t === "roomBannerHeight") return g;
    }, [
      t,
      e,
      r,
      a,
      l,
      d,
      h,
      g
    ]), [y, w] = p.useState(v), b = (S) => {
      t === "roomSidebarWidth" && n(S), t === "memberSidebarWidth" && i(S), t === "threadSidebarWidth" && s(S), t === "threadRootHeight" && c(S), t === "vcmsgSidebarWidth" && u(S), t === "widgetSidebarWidth" && f(S), t === "roomBannerHeight" && m(S);
    };
    p.useEffect(() => {
      k(y == null ? void 0 : y.toString());
    }, [
      y
    ]), p.useEffect(() => {
      w(v);
    }, [
      v
    ]);
    const [j, k] = p.useState(y == null ? void 0 : y.toString()), C = (S) => {
      const T = S.target.value;
      k(T);
      const A = parseInt(T, 10);
      Number.isNaN(A) || b(A);
    }, x = (S) => {
      Yt.isKeyHotkey("escape", S) && (S.stopPropagation(), k(y == null ? void 0 : y.toString()), S.target.blur()), Yt.isKeyHotkey("enter", S) && S.target.blur();
    };
    return o.jsx(mn, {
      style: {
        width: He(80)
      },
      variant: parseInt(j ?? "", 10) === y ? "Secondary" : "Success",
      size: "300",
      radii: "300",
      type: "number",
      min: "0",
      max: "1000",
      value: j,
      onChange: C,
      onKeyDown: x,
      outlined: true
    });
  }
  function SVe() {
    var _a6;
    const [t, e] = p.useState(), [n, r] = Fe(ge, "showRoomIcon"), i = pVe(), a = (l) => {
      e(l.currentTarget.getBoundingClientRect());
    }, s = (l) => {
      l && (r(l), e(void 0));
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: a,
          children: o.jsx(D, {
            size: "T300",
            children: ((_a6 = i.find((l) => l.layout === n)) == null ? void 0 : _a6.name) ?? n
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: i.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: n === l.layout ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => s(l.layout),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.layout))
              })
            })
          })
        })
      ]
    });
  }
  function jVe({ onThemeBrowserOpenChange: t } = {}) {
    const [e, n] = p.useState("roomSidebarWidth"), [r, i] = Fe(ge, "twitterEmoji"), [a, s] = Fe(ge, "customDMCards"), [l, c] = Fe(ge, "showEasterEggs"), [d, u] = p.useState(false), [h, f] = Fe(ge, "closeFoldersByDefault");
    return o.jsxs(E, {
      direction: "Column",
      gap: "700",
      children: [
        o.jsx(gVe, {
          onBrowseOpenChange: (g) => {
            u(g), t == null ? void 0 : t(g);
          }
        }),
        !d && o.jsxs(o.Fragment, {
          children: [
            o.jsx(wVe, {}),
            o.jsx(xVe, {}),
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Visual Tweaks"
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Twitter Emoji",
                    focusId: "twitter-emoji",
                    description: "Use Twitter-style emojis instead of system native ones.",
                    after: o.jsx(Jt, {
                      variant: "Primary",
                      value: r,
                      onChange: i
                    })
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Close Space Folders by Default",
                    focusId: "collapse-folders-by-default",
                    description: "Collapse sidebar folders upon loading.",
                    after: o.jsx(Jt, {
                      variant: "Primary",
                      value: h,
                      onChange: f
                    })
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Customize DM cards",
                    focusId: "customize-dm-cards",
                    description: "Show a custom DM card instead of the DM-ed's details",
                    after: o.jsx(Jt, {
                      variant: "Primary",
                      value: a,
                      onChange: s
                    })
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Show Easter Eggs",
                    focusId: "show-easter-eggs",
                    description: "Lets the interface keep a little mischief turned on.",
                    after: o.jsx(Jt, {
                      variant: "Primary",
                      value: l,
                      onChange: c
                    })
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Page Zoom",
                    focusId: "page-zoom",
                    after: o.jsx(CVe, {})
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Subspace Hierarchy Limit",
                    focusId: "subspace-hierarchy-limit",
                    description: "The maximum nesting depth for Subspaces in the sidebar. Once this limit is reached, deeper Subspaces appear as links instead of nested folders.",
                    after: o.jsx(DVe, {})
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Show Room Icons In Sidebars",
                    focusId: "show-room-icons",
                    description: "When do you want to show the specific room icons in the sidebar as opposed to the default room icons?",
                    after: o.jsx(SVe, {})
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Show Room Icons In Home menu sidebar",
                    focusId: "show-room-home-icons",
                    description: "Show Room icons in the home menu? (overrides setting above if set)",
                    after: o.jsx(Uce, {
                      roomId: "Home"
                    })
                  })
                }),
                o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  children: o.jsx(Ie, {
                    title: "Sidebar Size",
                    focusId: "sidebar-size",
                    description: "The Size of the sidebar, it can be changed either here numerically or by hovering and dragging the lighting bar",
                    after: o.jsxs(o.Fragment, {
                      children: [
                        o.jsx(EVe, {
                          sidebarSelector: e,
                          setSidebarSelector: n
                        }),
                        o.jsx(kVe, {
                          sidebarSelector: e
                        })
                      ]
                    })
                  })
                })
              ]
            })
          ]
        })
      ]
    });
  }
  const TVe = (t) => {
    if (t === void 0) return false;
    if (typeof t == "boolean") return t;
    const e = t.trim().toLowerCase();
    return e === "false" || e === "0" || e === "off" || e === "no" ? false : e === "true" || e === "1" || e === "on" || e === "yes";
  };
  function RVe(t) {
    return t.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
  }
  function AVe() {
    const [t, e] = p.useState(false), [n, r] = p.useState(""), i = (l, c) => {
      const d = Ol();
      Wre({
        ...d,
        filterPronounsBasedOnLanguage: l,
        filterPronounsLanguages: RVe(c)
      });
    }, a = (l) => {
      const c = l.target.value.trim();
      r(c), i(Ol().filterPronounsBasedOnLanguage ?? false, c);
    };
    p.useEffect(() => {
      var _a6;
      e(TVe(Ol().filterPronounsBasedOnLanguage ?? false)), r(((_a6 = Ol().filterPronounsLanguages) == null ? void 0 : _a6.join(",")) || "");
    }, []);
    const s = (l) => {
      var _a6;
      i(l, ((_a6 = Ol().filterPronounsLanguages) == null ? void 0 : _a6.join(",")) || ""), e(l);
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Language Specific Pronouns"
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(Ie, {
              title: "Show pronouns only in selected language",
              focusId: "show-pronouns-only-in-selected-language",
              description: "If enabled, pronouns are only shown when they match your selected language. This helps if your contacts set pronouns in different languages. It doesn't affect how your pronouns are shared with others.",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: t,
                onChange: s
              })
            }),
            t && o.jsx(Ie, {
              title: "Selected language for pronouns",
              focusId: "selected-language-for-pronouns",
              description: "The language to show pronouns for when the above setting is enabled.",
              after: o.jsx(mn, {
                value: n,
                size: "300",
                radii: "300",
                variant: "Secondary",
                placeholder: "Language code (e.g. 'en', 'de', 'en,de')",
                disabled: !t,
                onChange: a,
                style: {
                  width: "232px"
                }
              })
            })
          ]
        })
      ]
    });
  }
  function IVe({ disabled: t }) {
    const [e, n] = Fe(ge, "pronounPillMaxCount"), [r, i] = p.useState(e.toString()), a = (l) => {
      const c = l.target.value;
      i(c);
      const d = Number.parseInt(c, 10);
      !Number.isNaN(d) && d >= 1 && d <= 10 && n(d);
    }, s = (l) => {
      Yt.isKeyHotkey("escape", l) && (l.stopPropagation(), i(e.toString()), l.target.blur()), Yt.isKeyHotkey("enter", l) && l.target.blur();
    };
    return o.jsx(mn, {
      style: {
        width: He(80)
      },
      variant: Number.parseInt(r, 10) === e ? "Secondary" : "Success",
      size: "300",
      radii: "300",
      type: "number",
      min: "1",
      max: "10",
      value: r,
      onChange: a,
      onKeyDown: s,
      disabled: t,
      outlined: true
    });
  }
  function BVe({ disabled: t }) {
    const [e, n] = Fe(ge, "pronounPillMaxLength"), [r, i] = p.useState(e.toString()), a = (l) => {
      const c = l.target.value;
      i(c);
      const d = Number.parseInt(c, 10);
      !Number.isNaN(d) && d >= 1 && d <= 64 && n(d);
    }, s = (l) => {
      Yt.isKeyHotkey("escape", l) && (l.stopPropagation(), i(e.toString()), l.target.blur()), Yt.isKeyHotkey("enter", l) && l.target.blur();
    };
    return o.jsx(mn, {
      style: {
        width: He(80)
      },
      variant: Number.parseInt(r, 10) === e ? "Secondary" : "Success",
      size: "300",
      radii: "300",
      type: "number",
      min: "1",
      max: "64",
      value: r,
      onChange: a,
      onKeyDown: s,
      disabled: t,
      outlined: true
    });
  }
  const BY = [
    {
      id: "none",
      name: "None (Same size as text)"
    },
    {
      id: "extraSmall",
      name: "Extra Small"
    },
    {
      id: "small",
      name: "Small"
    },
    {
      id: "normal",
      name: "Normal"
    },
    {
      id: "large",
      name: "Large"
    },
    {
      id: "extraLarge",
      name: "Extra Large"
    }
  ];
  function PVe() {
    var _a6;
    const [t, e] = p.useState(), [n, r] = Fe(ge, "jumboEmojiSize"), i = (l) => {
      e(l.currentTarget.getBoundingClientRect());
    }, a = (l) => {
      r(l), e(void 0);
    }, s = ((_a6 = BY.find((l) => l.id === n)) == null ? void 0 : _a6.name) ?? "Normal";
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: i,
          children: o.jsx(D, {
            size: "T300",
            children: s
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: BY.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: n === l.id ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => a(l.id),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.id))
              })
            })
          })
        })
      ]
    });
  }
  const PY = [
    {
      id: "both",
      name: "Light & dark"
    },
    {
      id: "light",
      name: "Light only"
    },
    {
      id: "dark",
      name: "Dark only"
    },
    {
      id: "none",
      name: "Off"
    }
  ];
  function MVe() {
    var _a6;
    const [t, e] = p.useState(), [n, r] = Fe(ge, "renderUserCards"), i = (l) => {
      e(l.currentTarget.getBoundingClientRect());
    }, a = (l) => {
      r(l), e(void 0);
    }, s = ((_a6 = PY.find((l) => l.id === n)) == null ? void 0 : _a6.name) ?? "Light & dark";
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: i,
          children: o.jsx(D, {
            size: "T300",
            children: s
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: PY.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: n === l.id ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => a(l.id),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.id))
              })
            })
          })
        })
      ]
    });
  }
  function OVe() {
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Jumbo Emoji"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Jumbo Emoji Size",
            focusId: "jumbo-emoji-size",
            description: "Adjust the size of emojis sent without text.",
            after: o.jsx(PVe, {})
          })
        })
      ]
    });
  }
  function LVe() {
    const [t, e] = Fe(ge, "privacyBlur"), [n, r] = Fe(ge, "privacyBlurAvatars"), [i, a] = Fe(ge, "privacyBlurEmotes");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Privacy & Security"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Blur Media",
            focusId: "blur-media",
            description: "Blurs images and videos in the timeline.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Blur Avatars",
            focusId: "blur-avatars",
            description: "Blurs user profile pictures and room icons.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: n,
              onChange: r
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Blur Emotes",
            focusId: "blur-emotes",
            description: "Blurs emoticons within messages.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: i,
              onChange: a
            })
          })
        })
      ]
    });
  }
  function NVe() {
    const [t, e] = Fe(ge, "legacyUsernameColor"), [n, r] = Fe(ge, "showPronouns"), [i, a] = Fe(ge, "parsePronouns"), [s, l] = Fe(ge, "renderGlobalNameColors"), [c, d] = Fe(ge, "renderRoomColors"), [u, h] = Fe(ge, "renderRoomFonts"), [f, g] = Fe(ge, "uniformIcons");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Identity"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Colorful Names",
            focusId: "colorful-names",
            description: "Assign unique colors to users based on their ID. Does not override room/space custom colors. Will override default role colors.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Show Pronoun Pills",
            focusId: "show-pronoun-pills",
            description: "Display user pronouns in the message timeline.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: n,
              onChange: r
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          style: {
            opacity: n ? 1 : 0.5
          },
          children: o.jsx(Ie, {
            title: "Max Pronoun Pills",
            focusId: "pronoun-pill-max-count",
            description: "Maximum number of pronoun pills shown per user in the timeline. Additional pronouns appear behind the ... pill.",
            after: o.jsx(IVe, {
              disabled: !n
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          style: {
            opacity: n ? 1 : 0.5
          },
          children: o.jsx(Ie, {
            title: "Max Pronoun Pill Length",
            focusId: "pronoun-pill-max-length",
            description: "Maximum characters shown in each pronoun pill before truncation.",
            after: o.jsx(BVe, {
              disabled: !n
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Pronoun Pills for All",
            focusId: "pronoun-pills-for-all",
            description: "Attempts to convert pronouns in names into pills (e.g. [they/them] or (it/its) turns into a pill).",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: i,
              onChange: a
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Render Custom Profile Cards",
            focusId: "custom-profile-cards",
            description: "Choose whose profile card colors to show: everyone with a scheme, only light or dark schemes, or hide them.",
            after: o.jsx(MVe, {})
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Render Global Username Colors",
            focusId: "render-global-username-colors",
            description: "Display the username colors anyone can set in their account settings.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: s,
              onChange: l
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Render Space/Room Username Colors",
            focusId: "render-space-room-username-colors",
            description: "Display the username colors that can be set with /color.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: c,
              onChange: d
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Render Space/Room Fonts",
            focusId: "render-space-room-fonts",
            description: "Display the username fonts that can be set with /font.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: u,
              onChange: h
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Consistent Icon Style",
            focusId: "consistent-icon-style",
            description: "Harmonize icon appearance with background fill",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: f,
              onChange: g
            })
          })
        })
      ]
    });
  }
  function zVe({ requestBack: t, requestClose: e }) {
    const [n, r] = p.useState(false), i = p.useRef(null);
    return p.useEffect(() => {
      let a;
      const s = i.current;
      if (n && s) {
        const l = () => {
          s.scrollTop = 0;
        };
        l(), requestAnimationFrame(l), a = window.setTimeout(l, 0);
      }
      return () => {
        a !== void 0 && window.clearTimeout(a);
      };
    }, [
      n
    ]), o.jsx(Qc, {
      title: "Appearance",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          ref: i,
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsx(jVe, {
                  onThemeBrowserOpenChange: r
                }),
                !n && o.jsxs(o.Fragment, {
                  children: [
                    o.jsx(NVe, {}),
                    o.jsx(OVe, {}),
                    o.jsx(LVe, {}),
                    o.jsx(AVe, {})
                  ]
                })
              ]
            })
          })
        })
      })
    });
  }
  class Qi {
    constructor(e, n, r) {
      __publicField(this, "start");
      __publicField(this, "end");
      __publicField(this, "direction");
      this.start = e, this.end = n, this.direction = r;
    }
    static fromTextAreaElement(e) {
      return new Qi(e.selectionStart, e.selectionEnd, e.selectionDirection);
    }
    get selection() {
      return this.start !== this.end;
    }
    get length() {
      return this.end - this.start;
    }
  }
  class UVe {
    constructor(e, n, r) {
      __publicField(this, "textArea");
      __publicField(this, "operations");
      __publicField(this, "size");
      __publicField(this, "str");
      __publicField(this, "intentReg");
      this.textArea = n, this.operations = r, this.size = e, this.intentReg = /^\s*/, this.str = "";
      for (let i = 0; i < e; i += 1) this.str += " ";
    }
    lineIntent(e) {
      const n = this.textArea.cursorLines(e), i = this.textArea.selection(n).match(this.intentReg);
      return i ? i[0] : "";
    }
    moveForward(e) {
      const n = this.textArea.cursorLines(e), i = this.textArea.selection(n).split(`
`), a = i.map((l) => `${this.str}${l}`);
      this.operations.insert(n, a.join(`
`));
      const s = i.length * this.str.length;
      return new Qi(e.start === n.start ? e.start : e.start + this.str.length, e.end + s, e.direction);
    }
    moveBackward(e) {
      var _a6, _b3;
      const n = this.textArea.cursorLines(e), i = this.textArea.selection(n).split(`
`), a = i.map((f) => f.startsWith(this.str) ? f.substring(this.str.length) : f.replace(this.intentReg, "")), s = this.operations.insert(n, a.join(`
`)), l = (((_a6 = i[0]) == null ? void 0 : _a6.length) ?? 0) - (((_b3 = a[0]) == null ? void 0 : _b3.length) ?? 0), c = this.textArea.cursorLines(new Qi(s.end, s.end, "none")), d = Math.max(e.start - l, n.start), u = n.length - s.length, h = Math.max(c.start, e.end - u);
      return new Qi(d, h, e.direction);
    }
    addNewLine(e) {
      const r = `
${this.lineIntent(e)}`, i = this.operations.insert(e, r);
      return new Qi(i.end, i.end, "none");
    }
    addNextLine(e) {
      const r = `
${this.lineIntent(e)}`, i = this.textArea.cursorLines(e), a = new Qi(i.end, i.end, "none"), s = this.operations.insert(a, r);
      return new Qi(s.end, s.end, "none");
    }
    addPreviousLine(e) {
      var _a6;
      const r = `
${this.lineIntent(e)}`, a = ((_a6 = this.textArea.prevLine(e)) == null ? void 0 : _a6.end) ?? 0, s = new Qi(a, a, "none"), l = this.operations.insert(s, r);
      return new Qi(l.end, l.end, "none");
    }
  }
  class VVe {
    constructor(e) {
      __publicField(this, "getTarget");
      this.getTarget = e;
    }
    get target() {
      return this.getTarget();
    }
    selection(e) {
      return this.target.value.substring(e.start, e.end);
    }
    lineBeginIndex(e) {
      return this.target.value.substring(0, e.start).lastIndexOf(`
`) + 1;
    }
    lineEndIndex(e) {
      const n = this.target.value.substring(e.end), r = n.indexOf(`
`);
      return e.end + (r === -1 ? n.length : r);
    }
    cursorLines(e) {
      const n = this.lineBeginIndex(e), r = this.lineEndIndex(e);
      return new Qi(n, r, "none");
    }
    prevLine(e) {
      const r = this.lineBeginIndex(e) - 1;
      return r < 0 ? void 0 : this.cursorLines(new Qi(r, r, "none"));
    }
    nextLine(e) {
      const r = this.lineEndIndex(e) + 1;
      return r > this.target.value.length ? void 0 : this.cursorLines(new Qi(r, r, "none"));
    }
  }
  class HVe {
    constructor(e) {
      __publicField(this, "getTarget");
      this.getTarget = e;
    }
    get target() {
      return this.getTarget();
    }
    select(e) {
      this.target.setSelectionRange(e.start, e.end, e.direction);
    }
    deselect(e) {
      if (e.direction === "backward") {
        this.target.setSelectionRange(e.start, e.start, "none");
        return;
      }
      this.target.setSelectionRange(e.end, e.end, "none");
    }
    insert(e, n) {
      const { value: r } = this.target;
      return this.target.value = `${r.substring(0, e.start)}${n}${r.substring(e.end)}`, new Qi(e.start, e.start + n.length, e.direction);
    }
  }
  const $Ve = (t, e, n) => p.useCallback((i) => {
    const a = i.currentTarget;
    if (Yt.isKeyHotkey("tab", i)) {
      i.preventDefault();
      const s = Qi.fromTextAreaElement(a);
      t.selection(s) ? e.select(n.moveForward(s)) : e.deselect(e.insert(s, n.str)), a.focus();
    }
    if (Yt.isKeyHotkey("shift+tab", i)) {
      i.preventDefault();
      const s = Qi.fromTextAreaElement(a), l = n.moveBackward(s);
      t.selection(s) ? e.select(l) : e.deselect(l), a.focus();
    }
    if (Yt.isKeyHotkey("enter", i) || Yt.isKeyHotkey("shift+enter", i)) {
      i.preventDefault();
      const s = Qi.fromTextAreaElement(a);
      e.select(n.addNewLine(s));
    }
    if (Yt.isKeyHotkey("mod+enter", i)) {
      i.preventDefault();
      const s = Qi.fromTextAreaElement(a);
      e.select(n.addNextLine(s));
    }
    if (Yt.isKeyHotkey("mod+shift+enter", i)) {
      i.preventDefault();
      const s = Qi.fromTextAreaElement(a);
      e.select(n.addPreviousLine(s));
    }
  }, [
    t,
    e,
    n
  ]), AM = (t, e) => {
    const n = p.useCallback(() => {
      const c = t.current;
      if (!c) throw new Error("TextArea element not found!");
      return c;
    }, [
      t
    ]), { textArea: r, operations: i, intent: a } = p.useMemo(() => {
      const c = new VVe(n), d = new HVe(n);
      return {
        textArea: c,
        operations: d,
        intent: new UVe(e, c, d)
      };
    }, [
      n,
      e
    ]), s = $Ve(r, i, a);
    return {
      handleKeyDown: (c) => {
        if (s(c), Yt.isKeyHotkey("escape", c)) {
          const d = Qi.fromTextAreaElement(n());
          i.deselect(d);
        }
      },
      textArea: r,
      intent: a,
      getTarget: n,
      operations: i
    };
  };
  var WVe = "TextViewer_TextViewer__urqxv00 _1mqalmd1 _1mqalmd0", qVe = "TextViewer_TextViewerHeader__urqxv01 _1mqalmd1 _1mqalmd0", KVe = "TextViewer_TextViewerContent__urqxv02 _1mqalmd1 _1mqalmd0", GVe = "TextViewer_TextViewerPre__urqxv03 _1mqalmd1 _1mqalmd0", YVe = "TextViewer_TextViewerPrePadding__urqxv04";
  const gS = p.forwardRef(({ text: t, langName: e, size: n, className: r, ...i }, a) => o.jsx(D, {
    as: "pre",
    size: n,
    className: gt(GVe, `language-${e}`, r),
    ...i,
    ref: a,
    children: o.jsx(joe, {
      code: t,
      language: e,
      allowDetect: true
    })
  })), Vce = ft(({ className: t, name: e, text: n, langName: r, requestClose: i, ...a }, s) => {
    const l = () => {
      Jo(n);
    };
    return o.jsxs(E, {
      className: gt(WVe, t),
      direction: "Column",
      ...a,
      ref: s,
      children: [
        o.jsxs(wn, {
          className: qVe,
          size: "400",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Oe, {
                  size: "300",
                  radii: "300",
                  onClick: i,
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.ArrowLeft
                  })
                }),
                o.jsx(D, {
                  size: "T300",
                  truncate: true,
                  children: e
                })
              ]
            }),
            o.jsx(E, {
              shrink: "No",
              alignItems: "Center",
              gap: "200",
              children: o.jsx(Qe, {
                variant: "Primary",
                radii: "300",
                onClick: l,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Copy All"
                })
              })
            })
          ]
        }),
        o.jsx(E, {
          grow: "Yes",
          className: KVe,
          direction: "Column",
          children: o.jsx(dn, {
            hideTrack: true,
            variant: "Background",
            visibility: "Always",
            children: o.jsx(gS, {
              className: YVe,
              text: n,
              langName: r
            })
          })
        })
      ]
    });
  }), $I = 2;
  function ZVe({ type: t, defaultContent: e, submitChange: n, onCancel: r, onSave: i }) {
    const a = Kr(), s = p.useRef(null), [l, c] = p.useState(), { handleKeyDown: d, operations: u, getTarget: h } = AM(s, $I), [f, g] = Et(n), m = f.status === ve.Loading, v = (y) => {
      if (y.preventDefault(), m) return;
      const w = y.target, b = w == null ? void 0 : w.typeInput, j = w == null ? void 0 : w.contentTextArea;
      if (!b || !j) return;
      const k = b.value.trim(), C = j.value.trim();
      let x;
      try {
        x = JSON.parse(C);
      } catch (S) {
        c(S);
        return;
      }
      c(void 0), !(!k || x === null || e === JSON.stringify(x, null, $I)) && g(k, x).then(() => {
        a() && i({
          type: k,
          content: x
        });
      });
    };
    return p.useEffect(() => {
      var _a6;
      if (l) {
        const y = aP(l) ?? 0, w = new Qi(y, y, "none");
        u.select(w), (_a6 = h()) == null ? void 0 : _a6.focus();
      }
    }, [
      l,
      u,
      h
    ]), o.jsxs(E, {
      as: "form",
      onSubmit: v,
      grow: "Yes",
      style: {
        padding: ee.space.S400
      },
      direction: "Column",
      gap: "400",
      "aria-disabled": m,
      children: [
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Account Data"
            }),
            o.jsxs(E, {
              gap: "300",
              children: [
                o.jsx(E, {
                  grow: "Yes",
                  direction: "Column",
                  children: o.jsx(mn, {
                    variant: t.length > 0 || m ? "SurfaceVariant" : "Background",
                    name: "typeInput",
                    size: "400",
                    radii: "300",
                    readOnly: t.length > 0 || m,
                    defaultValue: t,
                    required: true
                  })
                }),
                o.jsx(xe, {
                  variant: "Success",
                  size: "400",
                  radii: "300",
                  type: "submit",
                  disabled: m,
                  before: m && o.jsx(dt, {
                    variant: "Primary",
                    fill: "Solid",
                    size: "300"
                  }),
                  children: o.jsx(D, {
                    size: "B400",
                    children: "Save"
                  })
                }),
                o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  size: "400",
                  radii: "300",
                  type: "button",
                  onClick: r,
                  disabled: m,
                  children: o.jsx(D, {
                    size: "B400",
                    children: "Cancel"
                  })
                })
              ]
            }),
            f.status === ve.Error && o.jsx(D, {
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: f.error.message
              })
            })
          ]
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(E, {
              shrink: "No",
              children: o.jsx(D, {
                size: "L400",
                children: "JSON Content"
              })
            }),
            o.jsx(js, {
              ref: s,
              name: "contentTextArea",
              style: {
                fontFamily: "var(--font-monospace)"
              },
              onKeyDown: d,
              defaultValue: e,
              resize: "None",
              spellCheck: "false",
              required: true,
              readOnly: m
            }),
            l && o.jsx(D, {
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsxs("b", {
                children: [
                  l.name,
                  ": ",
                  l.message
                ]
              })
            })
          ]
        })
      ]
    });
  }
  function JVe({ type: t, defaultContent: e, onEdit: n }) {
    return o.jsxs(E, {
      direction: "Column",
      style: {
        padding: ee.space.S400
      },
      gap: "400",
      children: [
        o.jsxs(E, {
          shrink: "No",
          gap: "300",
          alignItems: "End",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Account Data"
                }),
                o.jsx(mn, {
                  variant: "SurfaceVariant",
                  size: "400",
                  radii: "300",
                  readOnly: true,
                  defaultValue: t,
                  required: true
                })
              ]
            }),
            o.jsx(xe, {
              variant: "Secondary",
              size: "400",
              radii: "300",
              onClick: n,
              children: o.jsx(D, {
                size: "B400",
                children: "Edit"
              })
            })
          ]
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "JSON Content"
            }),
            o.jsx(Te, {
              variant: "SurfaceVariant",
              children: o.jsx(dn, {
                visibility: "Always",
                size: "300",
                hideTrack: true,
                children: o.jsx(gS, {
                  size: "T300",
                  style: {
                    padding: `${ee.space.S300} ${ee.space.S100} ${ee.space.S300} ${ee.space.S300}`
                  },
                  text: e,
                  langName: "JSON"
                })
              })
            })
          ]
        })
      ]
    });
  }
  function Hce({ type: t, content: e, submitChange: n, requestClose: r }) {
    const [i, a] = p.useState({
      type: t ?? "",
      content: e ?? {}
    }), [s, l] = p.useState(!t), c = p.useCallback(() => {
      if (!t) {
        r();
        return;
      }
      l(false);
    }, [
      t,
      r
    ]), d = p.useCallback((h) => {
      a(h), l(false);
    }, []), u = p.useMemo(() => JSON.stringify(i.content, null, $I), [
      i.content
    ]);
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          balance: true,
          children: o.jsxs(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                alignItems: "Inherit",
                grow: "Yes",
                gap: "200",
                children: o.jsx(Qe, {
                  size: "500",
                  radii: "Pill",
                  onClick: r,
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowLeft
                  }),
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Developer Tools"
                  })
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: r,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: s ? o.jsx(ZVe, {
            type: i.type,
            defaultContent: u,
            submitChange: n,
            onCancel: c,
            onSave: d
          }) : o.jsx(JVe, {
            type: i.type,
            defaultContent: u,
            onEdit: () => l(true)
          })
        })
      ]
    });
  }
  var XVe = "CutoutCard_CutoutCard__1v9t7v70";
  const Gc = ft(({ as: t = "div", className: e, variant: n = "Surface", ...r }, i) => o.jsx(t, {
    className: gt(ro({
      variant: n
    }), XVe, e),
    ...r,
    ref: i
  }));
  function QVe({ expand: t, onExpandToggle: e, onSelect: n }) {
    const r = be(), [i, a] = p.useState(() => Array.from(r.store.accountData.keys()));
    return bp(r, p.useCallback(() => {
      a(Array.from(r.store.accountData.keys()));
    }, [
      r
    ])), o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Account Data"
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "Global",
              focusId: "global-account-data",
              description: "Data stored in your global account data.",
              after: o.jsx(xe, {
                onClick: () => e(!t),
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                outlined: true,
                before: o.jsx(Q, {
                  src: t ? q.ChevronTop : q.ChevronBottom,
                  size: "100",
                  filled: true
                }),
                children: o.jsx(D, {
                  size: "B300",
                  children: t ? "Collapse" : "Expand"
                })
              })
            }),
            t && o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsxs(E, {
                  justifyContent: "SpaceBetween",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Events"
                    }),
                    o.jsxs(D, {
                      size: "L400",
                      children: [
                        "Total: ",
                        i.length
                      ]
                    })
                  ]
                }),
                o.jsxs(Gc, {
                  children: [
                    o.jsx(Ye, {
                      variant: "Surface",
                      fill: "None",
                      size: "300",
                      radii: "0",
                      before: o.jsx(Q, {
                        size: "50",
                        src: q.Plus
                      }),
                      onClick: () => n(null),
                      children: o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "T200",
                          truncate: true,
                          children: "Add New"
                        })
                      })
                    }),
                    i.toSorted().map((s) => o.jsx(Ye, {
                      variant: "Surface",
                      fill: "None",
                      size: "300",
                      radii: "0",
                      after: o.jsx(Q, {
                        size: "50",
                        src: q.ChevronRight
                      }),
                      onClick: () => n(s),
                      children: o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "T200",
                          truncate: true,
                          children: s
                        })
                      })
                    }, s))
                  ]
                })
              ]
            })
          ]
        })
      ]
    });
  }
  const eHe = (t) => {
    let e = 0, n = 0, r = 0, i = 0, a = 0, s = 0;
    return t.forEach((l) => {
      var _a6;
      const c = l.getMyMembership();
      c === Ht.Join && (e += 1), c === Ht.Invite && (n += 1), (!l.name || l.name.trim().length === 0) && (r += 1);
      const d = l.getMxcAvatarUrl(), u = (_a6 = l.getAvatarFallbackMember()) == null ? void 0 : _a6.getMxcAvatarUrl();
      !d && !u && (i += 1);
      const h = l.getLiveTimeline();
      h.getEvents().length === 0 && (a += 1), h.getPaginationToken(Tn.Backward) && (s += 1);
    }), {
      totalRooms: t.length,
      joinedRooms: e,
      inviteRooms: n,
      roomsMissingName: r,
      roomsMissingAvatar: i,
      roomsWithoutLiveEvents: a,
      roomsWithBackPagination: s
    };
  }, tHe = (t) => {
    const e = t.getUserId();
    return e ? t.getRooms().filter((n) => !n.isSpaceRoom() && n.getMyMembership() === Ht.Join).reduce((n, r) => {
      var _a6, _b3, _c3;
      const i = rf(r), a = r.getUnreadNotificationCount(ir.Total), s = r.getUnreadNotificationCount(ir.Highlight);
      if (a <= 0 && s <= 0 || i.total <= 0 && i.highlight <= 0) return n;
      const c = ((_a6 = [
        ...r.getLiveTimeline().getEvents()
      ].toReversed().find((f) => !f.isSending() && Vu(f))) == null ? void 0 : _a6.getId()) ?? null;
      if (!c || !r.hasUserReadEvent(e, c) || s > 0) return n;
      const u = r.getEventReadUpTo(e) ?? null, h = ((_c3 = (_b3 = r.getAccountData(ce.FullyRead)) == null ? void 0 : _b3.getContent()) == null ? void 0 : _c3.event_id) ?? null;
      return n.push({
        roomId: r.roomId,
        roomName: r.name || r.roomId,
        sdkTotal: a,
        sdkHighlight: s,
        latestNotificationEventId: c,
        readUpToEventId: u,
        fullyReadEventId: h
      }), n;
    }, []) : [];
  }, nHe = (t, e) => t <= 0 ? "0/0" : `${Math.max(0, Math.min(t, e + 1))}/${t}`, rHe = (t) => t === "sliding_active" ? "Sliding Sync active" : t === "sliding_disabled_server" ? "Server-side sliding sync disabled" : t === "session_opt_out" ? "Session opt-in is off" : t === "missing_proxy" ? "Sliding proxy URL missing" : t === "cold_cache_bootstrap" ? "Cold-cache bootstrap (classic for this run)" : t === "probe_failed_fallback" ? "Sliding probe failed, using fallback" : t;
  function iHe() {
    const t = be(), [, e] = p.useState(0), [n, r] = p.useState(false);
    p.useEffect(() => {
      const l = window.setInterval(() => e((c) => c + 1), 1e3);
      return () => window.clearInterval(l);
    }, []);
    const i = $B(t), a = eHe(t.getRooms()), s = tHe(t);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Sync Diagnostics"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "100",
          children: o.jsxs(E, {
            direction: "Column",
            gap: "100",
            style: {
              padding: "12px"
            },
            children: [
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Transport: ",
                  i.transport,
                  i.fallbackFromSliding ? " (fallback)" : ""
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "State: ",
                  i.syncState ?? "null"
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Sliding configured: ",
                  i.slidingConfigured ? "yes" : "no"
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Sliding server-enabled: ",
                  i.slidingEnabledOnServer ? "yes" : "no"
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Sliding session opt-in: ",
                  i.sessionOptIn ? "yes" : "no"
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Sliding requested: ",
                  i.slidingRequested ? "yes" : "no"
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Sync reason: ",
                  rHe(i.reason)
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Room counts: ",
                  a.totalRooms,
                  " total, ",
                  a.joinedRooms,
                  " joined,",
                  " ",
                  a.inviteRooms,
                  " invites"
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Rooms missing name: ",
                  a.roomsMissingName
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Rooms missing avatar: ",
                  a.roomsMissingAvatar
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Rooms without live events: ",
                  a.roomsWithoutLiveEvents
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Rooms with additional history available: ",
                  a.roomsWithBackPagination
                ]
              }),
              o.jsxs(D, {
                size: "T300",
                children: [
                  "Unread drift rooms: ",
                  s.length
                ]
              }),
              s.slice(0, 10).map((l) => o.jsxs(D, {
                size: "T200",
                priority: "300",
                children: [
                  l.roomName,
                  ": sdk ",
                  l.sdkTotal,
                  "/",
                  l.sdkHighlight,
                  " | latest",
                  " ",
                  l.latestNotificationEventId ?? "null",
                  " | readUpTo ",
                  l.readUpToEventId ?? "null",
                  " ",
                  "| fullyRead ",
                  l.fullyReadEventId ?? "null"
                ]
              }, l.roomId)),
              i.sliding && o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsxs(E, {
                    justifyContent: "SpaceBetween",
                    alignItems: "Center",
                    children: [
                      o.jsx(D, {
                        size: "T300",
                        children: "Sliding Sync"
                      }),
                      o.jsx(xe, {
                        size: "300",
                        variant: "Secondary",
                        fill: "Soft",
                        outlined: true,
                        radii: "300",
                        before: o.jsx(Q, {
                          src: n ? q.ChevronTop : q.ChevronBottom
                        }),
                        onClick: () => r((l) => !l),
                        children: o.jsx(D, {
                          size: "B300",
                          children: n ? "Collapse" : "Expand"
                        })
                      })
                    ]
                  }),
                  n && o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsxs(D, {
                        size: "T300",
                        children: [
                          "Sliding proxy: ",
                          i.sliding.proxyBaseUrl
                        ]
                      }),
                      o.jsxs(D, {
                        size: "T300",
                        children: [
                          "Room timeline limit: ",
                          i.sliding.timelineLimit,
                          " | page size:",
                          " ",
                          i.sliding.listPageSize
                        ]
                      }),
                      i.sliding.lists.map((l) => o.jsxs(D, {
                        size: "T300",
                        children: [
                          "List `",
                          l.key,
                          "` coverage:",
                          " ",
                          nHe(l.knownCount, l.rangeEnd)
                        ]
                      }, l.key))
                    ]
                  })
                ]
              })
            ]
          })
        })
      ]
    });
  }
  const Db = Sc(), pS = u3e(() => Db.getLogs()), $ce = vn(Db.isEnabled(), (t, e, n) => {
    Db.setEnabled(n), e($ce, n), e(pS);
  });
  vn((t) => t(pS));
  const oHe = vn(null, (t, e) => {
    Db.clear(), e(pS);
  });
  vn(null, () => Db.exportLogs());
  const aHe = (t) => new Date(t).toLocaleTimeString("en-US", {
    hour12: false,
    hour: "2-digit",
    minute: "2-digit",
    second: "2-digit",
    fractionalSecondDigits: 3
  }), sHe = (t) => {
    switch (t) {
      case "error":
        return ct.Critical.Main;
      case "warn":
        return ct.Warning.Main;
      case "info":
        return ct.Success.Main;
      default:
        return ct.Secondary.Main;
    }
  }, lHe = (t) => {
    switch (t) {
      case "error":
        return "Critical";
      case "sync":
        return "Primary";
      case "notification":
        return "Success";
      case "message":
        return "Secondary";
      case "call":
        return "Warning";
      default:
        return "Secondary";
    }
  };
  function cHe({ entry: t }) {
    const [e, n] = p.useState(false);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      style: {
        padding: ee.space.S200,
        backgroundColor: ct.Surface.Container,
        borderRadius: ee.radii.R300,
        fontSize: "11px",
        fontFamily: "monospace"
      },
      children: [
        o.jsxs(E, {
          gap: "200",
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "Center",
              children: [
                o.jsx(D, {
                  size: "T200",
                  style: {
                    color: sHe(t.level),
                    fontWeight: "bold",
                    minWidth: "50px"
                  },
                  children: t.level.toUpperCase()
                }),
                o.jsx(Rn, {
                  variant: lHe(t.category),
                  fill: "Soft",
                  size: "300",
                  children: o.jsx(D, {
                    size: "T200",
                    children: t.category
                  })
                }),
                o.jsx(D, {
                  size: "T200",
                  style: {
                    opacity: 0.6
                  },
                  children: aHe(t.timestamp)
                }),
                o.jsxs(D, {
                  size: "T200",
                  style: {
                    opacity: 0.8
                  },
                  children: [
                    "[",
                    t.namespace,
                    "]"
                  ]
                })
              ]
            }),
            t.data != null && o.jsx(xe, {
              variant: "Secondary",
              fill: "None",
              size: "300",
              radii: "300",
              onClick: () => n(!e),
              children: o.jsxs(D, {
                size: "T200",
                children: [
                  e ? "Hide" : "Show",
                  " Data"
                ]
              })
            })
          ]
        }),
        o.jsx(D, {
          size: "T200",
          style: {
            wordBreak: "break-word"
          },
          children: t.message
        }),
        e && t.data != null && o.jsx(E, {
          direction: "Column",
          style: {
            padding: ee.space.S200,
            backgroundColor: ct.Surface.ContainerActive,
            borderRadius: ee.radii.R300,
            maxHeight: "200px",
            overflow: "auto"
          },
          children: o.jsx(D, {
            as: "pre",
            size: "T200",
            style: {
              whiteSpace: "pre-wrap",
              wordBreak: "break-word",
              margin: 0
            },
            children: JSON.stringify(t.data, null, 2)
          })
        })
      ]
    });
  }
  function dHe() {
    const [t, e] = Fr($ce), n = Ze(pS), r = Fn(oHe), [i, a] = p.useState(true), s = p.useState(null)[0], [l, c] = p.useState("all"), [d, u] = p.useState("all"), [h, f] = p.useState(), [g, m] = p.useState(), v = (k) => {
      k.stopPropagation(), f(k.currentTarget.getBoundingClientRect());
    }, y = (k) => {
      k.stopPropagation(), m(k.currentTarget.getBoundingClientRect());
    }, w = p.useMemo(() => l === "all" && d === "all" ? n : Sc().getFilteredLogs({
      level: l !== "all" ? l : void 0,
      category: d !== "all" ? d : void 0
    }), [
      n,
      l,
      d
    ]);
    p.useEffect(() => t ? Sc().addListener(() => {
    }) : void 0, [
      t
    ]), p.useEffect(() => {
      i && s && (s.scrollTop = s.scrollHeight);
    }, [
      w,
      i,
      s
    ]);
    const b = p.useCallback((k) => {
      const C = Sc();
      let x;
      if (k && (l !== "all" || d !== "all")) {
        const U = C.getFilteredLogs({
          level: l !== "all" ? l : void 0,
          category: d !== "all" ? d : void 0
        });
        x = JSON.stringify({
          exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
          build: "v1.17.0",
          filters: {
            level: l !== "all" ? l : "none",
            category: d !== "all" ? d : "none"
          },
          logsCount: U.length,
          logs: U.map((z) => ({
            ...z,
            timestamp: new Date(z.timestamp).toISOString()
          }))
        }, null, 2);
      } else x = C.exportLogs();
      const S = new Blob([
        x
      ], {
        type: "application/json"
      }), T = URL.createObjectURL(S), A = document.createElement("a");
      A.href = T;
      const B = k && (l !== "all" || d !== "all") ? `-${d !== "all" ? d : "all"}-${l !== "all" ? l : "all"}` : "";
      A.download = `sable-debug-logs${B}-${(/* @__PURE__ */ new Date()).toISOString()}.json`, document.body.appendChild(A), A.click(), document.body.removeChild(A), URL.revokeObjectURL(T);
    }, [
      l,
      d
    ]), j = p.useCallback((k) => {
      const C = Sc();
      let x;
      if (k && (l !== "all" || d !== "all")) {
        const S = C.getFilteredLogs({
          level: l !== "all" ? l : void 0,
          category: d !== "all" ? d : void 0
        });
        x = JSON.stringify({
          exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
          build: "v1.17.0",
          filters: {
            level: l !== "all" ? l : "none",
            category: d !== "all" ? d : "none"
          },
          logsCount: S.length,
          logs: S.map((T) => ({
            ...T,
            timestamp: new Date(T.timestamp).toISOString()
          }))
        }, null, 2);
      } else x = C.exportLogs();
      navigator.clipboard.writeText(x);
    }, [
      l,
      d
    ]);
    return o.jsx(E, {
      direction: "Column",
      gap: "100",
      children: o.jsxs(E, {
        style: {
          display: "flex",
          flexDirection: "column",
          gap: ee.space.S400
        },
        children: [
          o.jsxs(E, {
            alignItems: "Center",
            justifyContent: "SpaceBetween",
            children: [
              o.jsx(D, {
                size: "L400",
                children: "Debug Log Status"
              }),
              o.jsx(Rn, {
                variant: t ? "Success" : "Secondary",
                fill: "Solid",
                children: o.jsx(D, {
                  size: "B300",
                  children: t ? "Active" : "Inactive"
                })
              })
            ]
          }),
          o.jsx(D, {
            size: "T300",
            style: {
              opacity: 0.8
            },
            children: "Internal debug logging captures sync state, network events, notifications, messages, calls, UI component lifecycle, and timeline operations. Logs are stored in memory (max 1000 entries) and cleared when you close the app."
          }),
          o.jsxs(E, {
            gap: "200",
            alignItems: "Center",
            style: {
              flexWrap: "wrap"
            },
            children: [
              o.jsx(D, {
                size: "T300",
                style: {
                  opacity: 0.8
                },
                children: "Filters:"
              }),
              o.jsx(ln, {
                anchor: h,
                offset: 4,
                alignOffset: -4,
                position: "Bottom",
                align: "Start",
                content: o.jsxs(tn, {
                  children: [
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("all"), f(void 0);
                      },
                      disabled: d === "all",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "All Categories"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("sync"), f(void 0);
                      },
                      disabled: d === "sync",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Sync"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("network"), f(void 0);
                      },
                      disabled: d === "network",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Network"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("notification"), f(void 0);
                      },
                      disabled: d === "notification",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Notification"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("message"), f(void 0);
                      },
                      disabled: d === "message",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Message"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("call"), f(void 0);
                      },
                      disabled: d === "call",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Call"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("ui"), f(void 0);
                      },
                      disabled: d === "ui",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "UI"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("timeline"), f(void 0);
                      },
                      disabled: d === "timeline",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Timeline"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("general"), f(void 0);
                      },
                      disabled: d === "general",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "General"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        u("error"), f(void 0);
                      },
                      disabled: d === "error",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Error"
                      })
                    })
                  ]
                }),
                children: o.jsx(xe, {
                  onClick: v,
                  variant: "Secondary",
                  fill: "Soft",
                  size: "300",
                  radii: "300",
                  children: o.jsxs(D, {
                    size: "B300",
                    children: [
                      "Category: ",
                      d === "all" ? "All" : d
                    ]
                  })
                })
              }),
              o.jsx(ln, {
                anchor: g,
                offset: 4,
                alignOffset: -4,
                position: "Bottom",
                align: "Start",
                content: o.jsxs(tn, {
                  children: [
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        c("all"), m(void 0);
                      },
                      disabled: l === "all",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "All Levels"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        c("debug"), m(void 0);
                      },
                      disabled: l === "debug",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Debug"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        c("info"), m(void 0);
                      },
                      disabled: l === "info",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Info"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        c("warn"), m(void 0);
                      },
                      disabled: l === "warn",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Warning"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        c("error"), m(void 0);
                      },
                      disabled: l === "error",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Error"
                      })
                    })
                  ]
                }),
                children: o.jsx(xe, {
                  onClick: y,
                  variant: "Secondary",
                  fill: "Soft",
                  size: "300",
                  radii: "300",
                  children: o.jsxs(D, {
                    size: "B300",
                    children: [
                      "Level: ",
                      l === "all" ? "All" : l
                    ]
                  })
                })
              }),
              (l !== "all" || d !== "all") && o.jsx(xe, {
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: () => {
                  c("all"), u("all");
                },
                children: o.jsx(D, {
                  size: "B300",
                  children: "Clear Filters"
                })
              })
            ]
          }),
          o.jsxs(E, {
            gap: "200",
            style: {
              flexWrap: "wrap"
            },
            children: [
              o.jsx(xe, {
                variant: t ? "Critical" : "Success",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: () => e(!t),
                children: o.jsx(D, {
                  size: "B300",
                  children: t ? "Disable Logging" : "Enable Logging"
                })
              }),
              o.jsx(xe, {
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: () => b(false),
                disabled: n.length === 0,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Export All"
                })
              }),
              o.jsx(xe, {
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: () => b(true),
                disabled: w.length === 0,
                children: o.jsxs(D, {
                  size: "B300",
                  children: [
                    "Export Filtered (",
                    w.length,
                    ")"
                  ]
                })
              }),
              o.jsx(xe, {
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: () => j(true),
                disabled: w.length === 0,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Copy Filtered"
                })
              }),
              o.jsx(xe, {
                variant: "Critical",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: r,
                disabled: n.length === 0,
                children: o.jsxs(D, {
                  size: "B300",
                  children: [
                    "Clear Logs (",
                    n.length,
                    ")"
                  ]
                })
              })
            ]
          }),
          t && o.jsxs(Te, {
            className: Xe,
            variant: "SurfaceVariant",
            direction: "Column",
            gap: "200",
            children: [
              o.jsxs(E, {
                alignItems: "Center",
                justifyContent: "SpaceBetween",
                children: [
                  o.jsxs(D, {
                    size: "L400",
                    children: [
                      "Recent Logs (",
                      l !== "all" || d !== "all" ? `${w.length}/${n.length}` : `${n.length}/1000`,
                      ")"
                    ]
                  }),
                  o.jsx(xe, {
                    variant: "Secondary",
                    fill: "None",
                    size: "300",
                    radii: "300",
                    onClick: () => a(!i),
                    children: o.jsxs(D, {
                      size: "T200",
                      children: [
                        "Auto-scroll: ",
                        i ? "On" : "Off"
                      ]
                    })
                  })
                ]
              }),
              o.jsx(E, {
                direction: "Column",
                gap: "200",
                style: {
                  maxHeight: "500px",
                  overflow: "auto",
                  padding: ee.space.S200
                },
                children: w.length === 0 ? o.jsx(E, {
                  style: {
                    padding: ee.space.S700,
                    textAlign: "center",
                    opacity: 0.6
                  },
                  children: o.jsx(D, {
                    size: "T300",
                    children: n.length === 0 ? "No logs captured yet. Use the app to generate log entries." : "No logs match the current filters."
                  })
                }) : w.map((k) => o.jsx(cHe, {
                  entry: k
                }, `${k.timestamp}-${k.namespace}`))
              })
            ]
          })
        ]
      })
    });
  }
  const MY = [
    "sync",
    "network",
    "notification",
    "message",
    "call",
    "ui",
    "timeline",
    "error",
    "general"
  ];
  function uHe() {
    const [t, e] = p.useState(() => {
      const h = Sc();
      return Object.fromEntries(MY.map((f) => [
        f,
        h.getBreadcrumbCategoryEnabled(f)
      ]));
    }), [n, r] = p.useState(() => Sc().getSentryStats());
    p.useEffect(() => {
      const h = setInterval(() => {
        r(Sc().getSentryStats());
      }, 5e3);
      return () => clearInterval(h);
    }, []);
    const i = (h, f) => {
      Sc().setBreadcrumbCategoryEnabled(h, f), e((g) => ({
        ...g,
        [h]: f
      }));
    }, a = () => {
      const h = Sc().exportLogs(), f = new Blob([
        h
      ], {
        type: "application/json"
      }), g = URL.createObjectURL(f), m = document.createElement("a");
      m.href = g, m.download = `sable-debug-logs-${Date.now()}.json`, m.click(), URL.revokeObjectURL(g);
    }, s = false, l = localStorage.getItem("sable_sentry_enabled") === "true";
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Error Tracking (Sentry)"
        }),
        o.jsxs(D, {
          size: "T200",
          style: {
            opacity: 0.7
          },
          children: [
            "Error reporting toggles are in ",
            o.jsx("strong", {
              children: "Settings \u2192 General \u2192 Diagnostics & Privacy"
            }),
            "."
          ]
        }),
        !s && o.jsx(E, {
          style: {
            padding: "12px",
            backgroundColor: "rgba(255, 193, 7, 0.1)",
            borderRadius: "8px"
          },
          children: o.jsx(D, {
            size: "T300",
            style: {
              color: "orange"
            },
            children: "Sentry is not configured. Set VITE_SENTRY_DSN to enable error tracking."
          })
        }),
        s && l && o.jsxs(o.Fragment, {
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Performance Metrics"
            }),
            o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(Ie, {
                  title: "Traces & Profiles",
                  focusId: "traces-profiles",
                  description: "Current environment: production. Sample rate: 10%"
                }),
                o.jsx(Ie, {
                  title: "Session Replay",
                  focusId: "session-replay",
                  description: "Session sample rate: 10% \xB7 On-error rate: 100%"
                }),
                o.jsx(Ie, {
                  title: "Session Error Budget",
                  focusId: "session-error-budget",
                  description: "At most 50 error events are forwarded to Sentry per page load to prevent quota exhaustion."
                })
              ]
            }),
            o.jsx(D, {
              size: "L400",
              children: "Breadcrumb Categories"
            }),
            o.jsx(D, {
              size: "T200",
              style: {
                opacity: 0.7
              },
              children: "Control which log categories are included as breadcrumbs in Sentry error reports. Disabling a category reduces noise without affecting error capture."
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: MY.map((h) => o.jsx(Ie, {
                focusId: `sentry-category-${MF(h)}`,
                title: h.charAt(0).toUpperCase() + h.slice(1),
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: t[h],
                  onChange: (f) => i(h, f)
                })
              }, h))
            }),
            o.jsx(D, {
              size: "L400",
              children: "Debug Logs"
            }),
            o.jsxs(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(Ie, {
                  title: "Session Activity",
                  focusId: "session-activity",
                  description: `Errors captured: ${n.errors} \xB7 Warnings captured: ${n.warnings} (updates every 5 s)`
                }),
                o.jsx(Ie, {
                  title: "Export Debug Logs",
                  focusId: "export-debug-logs",
                  description: "Download the current in-memory debug log buffer as a JSON file for offline analysis.",
                  after: o.jsx(xe, {
                    variant: "Secondary",
                    size: "300",
                    onClick: a,
                    children: "Export JSON"
                  })
                })
              ]
            })
          ]
        })
      ]
    });
  }
  function hHe({ requestBack: t, requestClose: e }) {
    var _a6;
    const n = be(), [r, i] = Fe(ge, "developerTools"), [a, s] = p.useState(false), [l, c] = p.useState(), d = p.useCallback(async (u, h) => {
      await n.setAccountData(u, h);
    }, [
      n
    ]);
    return l !== void 0 ? o.jsx(Hce, {
      type: l ?? void 0,
      content: l ? (_a6 = n.getAccountData(l)) == null ? void 0 : _a6.getContent() : void 0,
      submitChange: d,
      requestClose: () => c(void 0)
    }) : o.jsx(Qc, {
      title: "Developer Tools",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Options"
                    }),
                    o.jsx(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: o.jsx(Ie, {
                        title: "Enable Developer Tools",
                        focusId: "enable-developer-tools",
                        after: o.jsx(Jt, {
                          variant: "Primary",
                          value: r,
                          onChange: i
                        })
                      })
                    }),
                    r && o.jsx(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: o.jsx(Ie, {
                        title: "Access Token",
                        focusId: "access-token",
                        description: "Copy access token to clipboard.",
                        after: o.jsx(xe, {
                          onClick: () => Jo(n.getAccessToken() ?? "<NO_ACCESS_TOKEN_FOUND>"),
                          variant: "Secondary",
                          fill: "Soft",
                          size: "300",
                          radii: "300",
                          outlined: true,
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Copy"
                          })
                        })
                      })
                    })
                  ]
                }),
                r && o.jsx(iHe, {}),
                r && o.jsx(QVe, {
                  expand: a,
                  onExpandToggle: s,
                  onSelect: c
                }),
                r && o.jsx(E, {
                  direction: "Column",
                  gap: "100",
                  children: o.jsx(dHe, {})
                }),
                r && o.jsx(E, {
                  direction: "Column",
                  gap: "100",
                  children: o.jsx(uHe, {})
                })
              ]
            })
          })
        })
      })
    });
  }
  const fHe = (t) => `m.secret_storage.key.${t}`, mHe = () => {
    var _a6;
    return (_a6 = vh("m.secret_storage.default_key")) == null ? void 0 : _a6.getContent().key;
  }, gHe = (t) => {
    var _a6;
    return (_a6 = vh(fHe(t))) == null ? void 0 : _a6.getContent();
  };
  var xy = ((t) => (t[t.Idle = 0] = "Idle", t[t.Fetching = 1] = "Fetching", t[t.Loading = 2] = "Loading", t[t.Done = 3] = "Done", t))(xy || {});
  const qw = vn({
    status: 0
  }), Wce = vn((t) => t(qw), (t, e, n) => {
    if (n.stage === aH.Fetch) {
      e(qw, {
        status: 1
      });
      return;
    }
    if (n.stage === aH.LoadKeys) {
      const { total: r, successes: i, failures: a } = n, s = i + a;
      if (s === r) {
        e(qw, {
          status: 3
        });
        return;
      }
      e(qw, {
        status: 2,
        data: {
          downloaded: s,
          successes: i,
          failures: a,
          total: r
        }
      });
    }
  }), IM = (t) => {
    const e = be();
    p.useEffect(() => (e.on(oi.KeyBackupStatus, t), () => {
      e.removeListener(oi.KeyBackupStatus, t);
    }), [
      e,
      t
    ]);
  }, pHe = (t) => {
    const e = Kr(), [n, r] = p.useState(false);
    return p.useEffect(() => {
      t.getActiveSessionBackupVersion().then((i) => {
        e() && r(typeof i == "string");
      });
    }, [
      t,
      e
    ]), IM(r), n;
  }, qce = (t) => {
    const e = be();
    p.useEffect(() => (e.on(oi.KeyBackupSessionsRemaining, t), () => {
      e.removeListener(oi.KeyBackupSessionsRemaining, t);
    }), [
      e,
      t
    ]);
  }, FHe = (t) => {
    const e = be();
    p.useEffect(() => (e.on(oi.KeyBackupFailed, t), () => {
      e.removeListener(oi.KeyBackupFailed, t);
    }), [
      e,
      t
    ]);
  }, Kce = (t) => {
    const e = be();
    p.useEffect(() => (e.on(oi.KeyBackupDecryptionKeyCached, t), () => {
      e.removeListener(oi.KeyBackupDecryptionKeyCached, t);
    }), [
      e,
      t
    ]);
  }, vHe = () => {
    const [t, e] = p.useState(0), [n, r] = p.useState();
    return qce(p.useCallback((i) => {
      e(i), r(void 0);
    }, [])), FHe(p.useCallback((i) => {
      typeof i == "string" && (wa({
        category: "crypto",
        message: "Key backup failed",
        level: "error",
        data: {
          errcode: i
        }
      }), Vr("sable.crypto.key_backup_failures", 1, {
        attributes: {
          errcode: i
        }
      }), r(i), e(0));
    }, [])), [
      t,
      n
    ];
  }, _He = (t) => {
    const e = Kr(), [n, r] = p.useState(), i = p.useCallback(() => {
      t.getKeyBackupInfo().then((a) => {
        e() && r(a);
      });
    }, [
      t,
      e
    ]);
    return p.useEffect(() => {
      i();
    }, [
      i
    ]), IM(i), qce(p.useCallback((a) => {
      a === 0 && i();
    }, [
      i
    ])), n;
  }, yHe = (t, e) => {
    const n = Kr(), [r, i] = p.useState(), a = p.useCallback(() => {
      t.isKeyBackupTrusted(e).then((s) => {
        n() && i(s);
      });
    }, [
      t,
      n,
      e
    ]);
    return p.useEffect(() => {
      a();
    }, [
      a
    ]), IM(a), Kce(a), r;
  }, bHe = () => {
    const t = Fn(Wce), e = be();
    Kce(p.useCallback(() => {
      const n = e.getCrypto();
      n && n.restoreKeyBackup({
        progressCallback(r) {
          t(r);
        }
      });
    }, [
      e,
      t
    ]));
  };
  function xHe({ enabled: t }) {
    return o.jsxs(E, {
      as: "span",
      gap: "100",
      alignItems: "Center",
      children: [
        o.jsx(Rn, {
          variant: t ? "Success" : "Critical",
          fill: "Solid",
          size: "200",
          radii: "Pill"
        }),
        o.jsx(D, {
          as: "span",
          size: "L400",
          style: {
            color: t ? ct.Success.Main : ct.Critical.Main
          },
          children: t ? "Connected" : "Disconnected"
        })
      ]
    });
  }
  function wHe({ count: t }) {
    return o.jsxs(E, {
      as: "span",
      gap: "100",
      alignItems: "Center",
      children: [
        o.jsx(dt, {
          size: "50",
          variant: "Primary",
          fill: "Soft"
        }),
        o.jsxs(D, {
          as: "span",
          size: "L400",
          style: {
            color: ct.Primary.Main
          },
          children: [
            "Syncing (",
            t,
            ")"
          ]
        })
      ]
    });
  }
  function OY() {
    return o.jsxs(E, {
      grow: "Yes",
      gap: "200",
      alignItems: "Center",
      children: [
        o.jsx(Rn, {
          variant: "Secondary",
          fill: "Solid",
          radii: "300",
          children: o.jsx(D, {
            size: "L400",
            children: "Restoring: 0%"
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsx(O1, {
            variant: "Secondary",
            size: "300",
            min: 0,
            max: 1,
            value: 0
          })
        }),
        o.jsx(dt, {
          size: "50",
          variant: "Secondary",
          fill: "Soft"
        })
      ]
    });
  }
  function DHe({ total: t, downloaded: e }) {
    return o.jsxs(E, {
      grow: "Yes",
      gap: "200",
      alignItems: "Center",
      children: [
        o.jsx(Rn, {
          variant: "Secondary",
          fill: "Solid",
          radii: "300",
          children: o.jsxs(D, {
            size: "L400",
            children: [
              "Restoring: ",
              `${Math.round(Nb(0, t, e))}%`
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsx(O1, {
            variant: "Secondary",
            size: "300",
            min: 0,
            max: t,
            value: e
          })
        }),
        o.jsx(Rn, {
          variant: "Secondary",
          fill: "Soft",
          radii: "Pill",
          children: o.jsxs(D, {
            size: "L400",
            children: [
              e,
              " / ",
              t
            ]
          })
        })
      ]
    });
  }
  function CHe({ crypto: t, backupInfo: e }) {
    const n = yHe(t, e);
    return n ? o.jsxs(E, {
      direction: "Column",
      children: [
        n.matchesDecryptionKey ? o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Success.Main
          },
          children: o.jsx("b", {
            children: "Backup has trusted decryption key."
          })
        }) : o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: "Backup does not have trusted decryption key!"
          })
        }),
        n.trusted ? o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Success.Main
          },
          children: o.jsx("b", {
            children: "Backup has trusted by signature."
          })
        }) : o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: "Backup does not have trusted signature!"
          })
        })
      ]
    }) : null;
  }
  function EHe({ crypto: t }) {
    const [e, n] = Fr(Wce), r = e.status === xy.Fetching || e.status === xy.Loading, i = pHe(t), a = _He(t), [s, l] = vHe(), [c, d] = p.useState(), u = (m) => {
      d(m.currentTarget.getBoundingClientRect());
    }, [h, f] = Et(p.useCallback(async () => {
      await t.restoreKeyBackup({
        progressCallback(m) {
          n(m);
        }
      });
    }, [
      t,
      n
    ])), g = () => {
      d(void 0), f();
    };
    return o.jsxs(Lf, {
      variant: "Surface",
      title: "Encryption Backup",
      after: o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          s === 0 ? o.jsx(xHe, {
            enabled: i
          }) : o.jsx(wHe, {
            count: s
          }),
          o.jsx(Oe, {
            "aria-pressed": !!c,
            size: "300",
            variant: "Surface",
            radii: "300",
            onClick: u,
            children: o.jsx(Q, {
              size: "100",
              src: q.VerticalDots
            })
          }),
          o.jsx(ln, {
            anchor: c,
            offset: 5,
            position: "Bottom",
            align: "End",
            content: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => d(void 0),
                clickOutsideDeactivates: true,
                isKeyForward: (m) => m.key === "ArrowDown" || m.key === "ArrowRight",
                isKeyBackward: (m) => m.key === "ArrowUp" || m.key === "ArrowLeft",
                escapeDeactivates: kt
              },
              children: o.jsx(tn, {
                style: {
                  padding: ee.space.S100
                },
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(E, {
                      direction: "Column",
                      gap: "200",
                      children: o.jsx(Lf, {
                        variant: "SurfaceVariant",
                        title: "Backup Details",
                        description: o.jsxs(o.Fragment, {
                          children: [
                            o.jsxs("span", {
                              children: [
                                "Version: ",
                                (a == null ? void 0 : a.version) ?? "NIL"
                              ]
                            }),
                            o.jsx("br", {}),
                            o.jsxs("span", {
                              children: [
                                "Keys: ",
                                (a == null ? void 0 : a.count) ?? "NIL"
                              ]
                            })
                          ]
                        })
                      })
                    }),
                    o.jsx(xe, {
                      size: "300",
                      variant: "Success",
                      radii: "300",
                      "aria-disabled": h.status === ve.Loading || r,
                      onClick: h.status === ve.Loading || r ? void 0 : g,
                      before: o.jsx(Q, {
                        size: "100",
                        src: q.Download
                      }),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Restore Backup"
                      })
                    })
                  ]
                })
              })
            })
          })
        ]
      }),
      children: [
        l && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: l
          })
        }),
        !i && a === null && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: "No backup present on server!"
          })
        }),
        !l && !i && a && o.jsx(CHe, {
          crypto: t,
          backupInfo: a
        }),
        h.status === ve.Loading && !r && o.jsx(OY, {}),
        e.status === xy.Fetching && o.jsx(OY, {}),
        e.status === xy.Loading && o.jsx(DHe, {
          total: e.data.total,
          downloaded: e.data.downloaded
        }),
        h.status === ve.Error && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: h.error.message
          })
        })
      ]
    });
  }
  function kHe() {
    return bHe(), null;
  }
  const Yl = p.forwardRef(({ variant: t = "Background", size: e, style: n, after: r, ...i }, a) => {
    const s = e === "500" ? ee.space.S300 : ee.space.S200;
    return o.jsx(Hi, {
      initial: false,
      children: (l, c) => o.jsx(mn, {
        ...i,
        ref: a,
        style: {
          paddingRight: s,
          ...n
        },
        type: l ? "text" : "password",
        size: e,
        variant: t,
        after: o.jsxs(o.Fragment, {
          children: [
            r,
            o.jsx(Oe, {
              onClick: () => c(!l),
              type: "button",
              variant: l ? "Warning" : t,
              size: "300",
              radii: "300",
              children: o.jsx(Q, {
                style: {
                  opacity: ee.opacity.P300
                },
                size: "100",
                src: l ? q.Eye : q.EyeBlind
              })
            })
          ]
        })
      })
    });
  });
  function BM({ initialValue: t, children: e }) {
    const [n, r] = p.useState(t), i = p.useRef(null), a = p.useRef(null), s = Rp(p.useCallback(() => {
      var _a6, _b3;
      const l = (_a6 = i.current) == null ? void 0 : _a6.value, c = (_b3 = a.current) == null ? void 0 : _b3.value;
      if (!c) {
        r(t);
        return;
      }
      r(l === c);
    }, [
      t
    ]), {
      wait: 500,
      immediate: false
    });
    return e(n, s, i, a);
  }
  const SHe = Po("MegolmExportEncryption"), wf = globalThis.crypto.subtle;
  class jHe extends Error {
    constructor(e, n) {
      super(e);
      __publicField(this, "friendlyText");
      this.friendlyText = n, this.name = "FriendlyError";
    }
  }
  function Bl(t, e) {
    return new jHe(t, e);
  }
  function Df() {
    return "Your browser does not support the required cryptography extensions";
  }
  function ag(t) {
    const e = new ArrayBuffer(t.byteLength), n = new Uint8Array(e);
    return n.set(t), n;
  }
  function THe(t) {
    const e = String.fromCodePoint.apply(null, Array.from(t));
    return globalThis.btoa(e);
  }
  function RHe(t) {
    const e = globalThis.atob(t), n = new Uint8Array(new ArrayBuffer(e.length));
    for (let r = 0; r < e.length; r += 1) n[r] = e.charCodeAt(r);
    return n;
  }
  const Gce = "-----BEGIN MEGOLM SESSION DATA-----", Yce = "-----END MEGOLM SESSION DATA-----";
  function AHe(t) {
    const e = new TextDecoder().decode(new Uint8Array(t));
    let n = 0;
    for (; ; ) {
      const a = e.indexOf(`
`, n);
      if (a < 0) throw new Error("Header line not found");
      const s = e.slice(n, a).trim();
      if (n = a + 1, s === Gce) break;
    }
    const r = n;
    for (; ; ) {
      const a = e.indexOf(`
`, n);
      if (e.slice(n, a < 0 ? void 0 : a).trim() === Yce) break;
      if (a < 0) throw new Error("Trailer line not found");
      n = a + 1;
    }
    const i = n;
    return RHe(e.slice(r, i));
  }
  function IHe(t) {
    const n = Math.ceil(t.length / 96), r = Array.from({
      length: n + 3
    });
    r[0] = Gce;
    let i = 0, a;
    for (a = 1; a <= n; a += 1) r[a] = THe(t.subarray(i, i + 96)), i += 96;
    return r[a++] = Yce, r[a] = "", new TextEncoder().encode(r.join(`
`)).buffer;
  }
  async function Zce(t, e, n) {
    const r = /* @__PURE__ */ new Date();
    let i;
    try {
      i = await wf.importKey("raw", new TextEncoder().encode(n), {
        name: "PBKDF2"
      }, false, [
        "deriveBits"
      ]);
    } catch (h) {
      throw Bl(`subtleCrypto.importKey failed: ${String(h)}`, Df());
    }
    let a;
    try {
      a = await wf.deriveBits({
        name: "PBKDF2",
        salt: t,
        iterations: e,
        hash: "SHA-512"
      }, i, 512);
    } catch (h) {
      throw Bl(`subtleCrypto.deriveBits failed: ${String(h)}`, Df());
    }
    const s = /* @__PURE__ */ new Date();
    SHe.log(`E2e import/export: deriveKeys took ${s.getTime() - r.getTime()}ms`);
    const l = a.slice(0, 32), c = a.slice(32), d = wf.importKey("raw", l, {
      name: "AES-CTR"
    }, false, [
      "encrypt",
      "decrypt"
    ]).catch((h) => {
      throw Bl(`subtleCrypto.importKey failed for AES key: ${String(h)}`, Df());
    }), u = wf.importKey("raw", c, {
      name: "HMAC",
      hash: {
        name: "SHA-256"
      }
    }, false, [
      "sign",
      "verify"
    ]).catch((h) => {
      throw Bl(`subtleCrypto.importKey failed for HMAC key: ${String(h)}`, Df());
    });
    return Promise.all([
      d,
      u
    ]);
  }
  async function BHe(t, e) {
    const n = AHe(t);
    if (n.length < 1) throw Bl("Invalid file: too short", "Not a valid keyfile");
    if (n[0] !== 1) throw Bl("Unsupported version", "Not a valid keyfile");
    const i = n.length - 69;
    if (i < 0) throw Bl("Invalid file: too short", "Not a valid keyfile");
    const a = ag(n.subarray(1, 17)), s = ag(n.subarray(17, 33)), l = new DataView(n.buffer, n.byteOffset + 33, 4).getInt32(0), c = ag(n.subarray(37, 37 + i)), d = ag(n.subarray(-32)), [u, h] = await Zce(a, l, e), f = ag(n.subarray(0, -32));
    let g;
    try {
      g = await wf.verify({
        name: "HMAC"
      }, h, d, f);
    } catch (v) {
      throw Bl(`subtleCrypto.verify failed: ${String(v)}`, Df());
    }
    if (!g) throw Bl("hmac mismatch", "Authentication check failed: Incorrect password?");
    let m;
    try {
      m = await wf.decrypt({
        name: "AES-CTR",
        counter: s,
        length: 64
      }, u, c);
    } catch (v) {
      throw Bl(`subtleCrypto.decrypt failed: ${String(v)}`, Df());
    }
    return new TextDecoder().decode(new Uint8Array(m));
  }
  async function PHe(t, e, n) {
    const i = {}.kdf_rounds || 5e5, a = new Uint8Array(new ArrayBuffer(16));
    globalThis.crypto.getRandomValues(a);
    const s = new Uint8Array(new ArrayBuffer(16));
    globalThis.crypto.getRandomValues(s), s[8] &= 127;
    const [l, c] = await Zce(a, i, e), d = ag(new TextEncoder().encode(t));
    let u;
    try {
      u = await wf.encrypt({
        name: "AES-CTR",
        counter: s,
        length: 64
      }, l, d);
    } catch (b) {
      throw Bl(`subtleCrypto.encrypt failed: ${String(b)}`, Df());
    }
    const h = new Uint8Array(u), f = 1 + a.length + s.length + 4 + h.length + 32, g = new Uint8Array(new ArrayBuffer(f));
    let m = 0;
    g[m++] = 1, g.set(a, m), m += a.length, g.set(s, m), m += s.length, g[m++] = i >> 24, g[m++] = i >> 16 & 255, g[m++] = i >> 8 & 255, g[m++] = i & 255, g.set(h, m), m += h.length;
    const v = ag(g.subarray(0, m));
    let y;
    try {
      y = await wf.sign({
        name: "HMAC"
      }, c, v);
    } catch (b) {
      throw Bl(`subtleCrypto.sign failed: ${String(b)}`, Df());
    }
    const w = new Uint8Array(y);
    return g.set(w, m), IHe(g);
  }
  function Jce(t) {
    return "friendlyText" in t ? t.friendlyText : t.message;
  }
  function MHe() {
    const t = be(), e = Kr(), [n, r] = Et(p.useCallback(async (s) => {
      const l = t.getCrypto();
      if (!l) throw new Error("Unexpected Error! Crypto module not found!");
      const c = await l.exportRoomKeysAsJson(), d = await PHe(c, s), u = new Blob([
        d
      ], {
        type: "text/plain;charset=us-ascii"
      });
      ap.saveAs(u, "cinny-keys.txt");
    }, [
      t
    ])), i = n.status === ve.Loading, a = (s) => {
      if (s.preventDefault(), i) return;
      const { passwordInput: l, confirmPasswordInput: c } = s.target, d = l.value, u = c.value;
      d === u && r(d).then(() => {
        e() && (l.value = "", c.value = "");
      });
    };
    return o.jsx(Ie, {
      focusId: "export-messages-data",
      children: o.jsxs(E, {
        as: "form",
        onSubmit: a,
        direction: "Column",
        gap: "100",
        children: [
          o.jsxs(E, {
            gap: "200",
            alignItems: "End",
            children: [
              o.jsx(BM, {
                initialValue: true,
                children: (s, l, c, d) => o.jsxs(o.Fragment, {
                  children: [
                    o.jsxs(E, {
                      grow: "Yes",
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx(D, {
                          size: "L400",
                          children: "New Password"
                        }),
                        o.jsx(Yl, {
                          ref: c,
                          name: "passwordInput",
                          size: "400",
                          variant: "Secondary",
                          radii: "300",
                          required: true,
                          onChange: l,
                          readOnly: i,
                          autoFocus: true
                        })
                      ]
                    }),
                    o.jsxs(E, {
                      grow: "Yes",
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx(D, {
                          size: "L400",
                          children: "Confirm Password"
                        }),
                        o.jsx(Yl, {
                          ref: d,
                          style: {
                            color: s ? void 0 : ct.Critical.Main
                          },
                          name: "confirmPasswordInput",
                          size: "400",
                          variant: "Secondary",
                          radii: "300",
                          required: true,
                          onChange: l,
                          readOnly: i
                        })
                      ]
                    })
                  ]
                })
              }),
              o.jsx(xe, {
                type: "submit",
                size: "400",
                variant: "Secondary",
                fill: "Soft",
                outlined: true,
                radii: "300",
                disabled: i,
                before: i ? o.jsx(dt, {
                  size: "200",
                  variant: "Secondary",
                  fill: "Soft"
                }) : void 0,
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Export"
                })
              })
            ]
          }),
          n.status === ve.Error && o.jsx(D, {
            size: "T200",
            style: {
              color: ct.Critical.Main
            },
            children: o.jsx("b", {
              children: Jce(n.error)
            })
          })
        ]
      })
    });
  }
  function OHe() {
    const [t, e] = p.useState(false);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Ie, {
          title: "Export Messages Data",
          focusId: "export-messages-data",
          description: "Save password protected copy of encryption data on your device to decrypt messages later.",
          after: o.jsx(E, {
            children: o.jsx(xe, {
              type: "button",
              onClick: () => e(!t),
              size: "300",
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              radii: "300",
              before: o.jsx(Q, {
                size: "100",
                src: t ? q.ChevronTop : q.ChevronBottom,
                filled: true
              }),
              children: o.jsx(D, {
                as: "span",
                size: "B300",
                truncate: true,
                children: t ? "Collapse" : "Expand"
              })
            })
          })
        }),
        t && o.jsx(MHe, {})
      ]
    });
  }
  function LHe({ file: t, onDone: e }) {
    const n = be(), r = Kr(), [i, a] = Et(p.useCallback(async (c) => {
      const d = n.getCrypto();
      if (!d) throw new Error("Unexpected Error! Crypto module not found!");
      const u = await t.arrayBuffer(), h = await BHe(u, c);
      await d.importRoomKeysAsJson(h);
    }, [
      t,
      n
    ])), s = i.status === ve.Loading;
    p.useEffect(() => {
      i.status === ve.Success && (e == null ? void 0 : e());
    }, [
      e,
      i
    ]);
    const l = (c) => {
      if (c.preventDefault(), s) return;
      const { passwordInput: d } = c.target, u = d.value;
      u && a(u).then(() => {
        r() && (d.value = "");
      });
    };
    return o.jsx(Ie, {
      focusId: "import-messages-data",
      children: o.jsxs(E, {
        as: "form",
        onSubmit: l,
        direction: "Column",
        gap: "100",
        children: [
          o.jsxs(E, {
            gap: "200",
            alignItems: "End",
            children: [
              o.jsxs(E, {
                grow: "Yes",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Password"
                  }),
                  o.jsx(Yl, {
                    name: "passwordInput",
                    size: "400",
                    variant: "Secondary",
                    radii: "300",
                    required: true,
                    autoFocus: true,
                    readOnly: s
                  })
                ]
              }),
              o.jsx(xe, {
                type: "submit",
                size: "400",
                variant: "Secondary",
                fill: "Soft",
                outlined: true,
                radii: "300",
                disabled: s,
                before: s ? o.jsx(dt, {
                  size: "200",
                  variant: "Secondary",
                  fill: "Soft"
                }) : void 0,
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Decrypt"
                })
              })
            ]
          }),
          i.status === ve.Error && o.jsx(D, {
            size: "T200",
            style: {
              color: ct.Critical.Main
            },
            children: o.jsx("b", {
              children: Jce(i.error)
            })
          })
        ]
      })
    });
  }
  function NHe() {
    const [t, e] = p.useState(), n = ed(e), r = p.useCallback(() => {
      e(void 0);
    }, []);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Ie, {
          title: "Import Messages Data",
          focusId: "import-messages-data",
          description: "Load password protected copy of encryption data from device to decrypt your messages.",
          after: o.jsx(E, {
            children: t ? o.jsx(xe, {
              style: {
                maxWidth: He(200)
              },
              type: "button",
              onClick: () => e(void 0),
              size: "300",
              variant: "Warning",
              fill: "Solid",
              radii: "300",
              before: o.jsx(Q, {
                size: "100",
                src: q.File,
                filled: true
              }),
              after: o.jsx(Q, {
                size: "100",
                src: q.Cross
              }),
              children: o.jsx(D, {
                as: "span",
                size: "B300",
                truncate: true,
                children: t.name
              })
            }) : o.jsx(xe, {
              type: "button",
              onClick: () => n("text/plain"),
              size: "300",
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              radii: "300",
              before: o.jsx(Q, {
                size: "100",
                src: q.ArrowRight
              }),
              children: o.jsx(D, {
                as: "span",
                size: "B300",
                children: "Import"
              })
            })
          })
        }),
        t && o.jsx(LHe, {
          file: t,
          onDone: r
        })
      ]
    });
  }
  function zHe() {
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Local Backup"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(OHe, {})
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(NHe, {})
        })
      ]
    });
  }
  function WI() {
    return o.jsx(Te, {
      className: Xe,
      style: {
        height: He(66)
      },
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400"
    });
  }
  function UHe({ ts: t }) {
    const [e] = Fe(ge, "hour24Clock"), [n] = Fe(ge, "dateFormatString");
    return o.jsxs(D, {
      className: Pi,
      size: "T200",
      children: [
        o.jsx(D, {
          size: "Inherit",
          as: "span",
          priority: "300",
          children: "Last activity: "
        }),
        o.jsxs(o.Fragment, {
          children: [
            iE(t) && "Today",
            oE(t) && "Yesterday",
            !iE(t) && !oE(t) && cF(t, n),
            " ",
            eu(t, e)
          ]
        })
      ]
    });
  }
  function VHe({ device: t }) {
    return o.jsxs(o.Fragment, {
      children: [
        typeof t.device_id == "string" && o.jsxs(D, {
          className: Pi,
          size: "T200",
          priority: "300",
          children: [
            "Device ID: ",
            o.jsx("i", {
              children: t.device_id
            })
          ]
        }),
        typeof t.last_seen_ip == "string" && o.jsxs(D, {
          className: Pi,
          size: "T200",
          priority: "300",
          children: [
            "IP Address: ",
            o.jsx("i", {
              children: t.last_seen_ip
            })
          ]
        })
      ]
    });
  }
  function HHe({ crypto: t }) {
    const [e, n] = Et(p.useCallback(() => t.getOwnDeviceKeys(), [
      t
    ]));
    return p.useEffect(() => {
      n();
    }, [
      n
    ]), e.status === ve.Error ? null : o.jsxs(D, {
      className: Pi,
      size: "T200",
      priority: "300",
      children: [
        "Device Key:",
        " ",
        o.jsx("i", {
          children: e.status === ve.Success ? e.data.ed25519 : "loading..."
        })
      ]
    });
  }
  function $He({ device: t, onCancel: e, onRename: n, refreshDeviceList: r }) {
    const i = be(), [a, s] = Et(p.useCallback(async (d) => {
      await i.setDeviceDetails(t.device_id, {
        display_name: d
      }), await r();
    }, [
      i,
      t.device_id,
      r
    ])), l = a.status === ve.Loading;
    p.useEffect(() => {
      a.status === ve.Success && n();
    }, [
      a,
      n
    ]);
    const c = (d) => {
      var _a6;
      if (d.preventDefault(), l) return;
      const h = (_a6 = d.target) == null ? void 0 : _a6.nameInput;
      if (!h) return;
      const f = h.value.trim();
      !f || f === t.display_name || s(f);
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: c,
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Device Name"
        }),
        o.jsxs(E, {
          gap: "200",
          children: [
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(mn, {
                name: "nameInput",
                size: "300",
                variant: "Secondary",
                radii: "300",
                defaultValue: t.display_name,
                autoFocus: true,
                required: true,
                readOnly: l
              })
            }),
            o.jsxs(E, {
              shrink: "No",
              gap: "200",
              children: [
                o.jsx(xe, {
                  type: "submit",
                  size: "300",
                  variant: "Success",
                  radii: "300",
                  fill: "Solid",
                  disabled: l,
                  before: l && o.jsx(dt, {
                    size: "100",
                    variant: "Success",
                    fill: "Solid"
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Save"
                  })
                }),
                o.jsx(xe, {
                  type: "button",
                  size: "300",
                  variant: "Secondary",
                  radii: "300",
                  fill: "Soft",
                  onClick: e,
                  disabled: l,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Cancel"
                  })
                })
              ]
            })
          ]
        }),
        a.status === ve.Error ? o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: a.error.message
        }) : o.jsx(D, {
          size: "T200",
          children: "Device names are visible to public."
        })
      ]
    });
  }
  function WHe() {
    const [t, e] = p.useState(false), n = () => e(false);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Qe, {
          variant: "Secondary",
          fill: "Soft",
          radii: "Pill",
          onClick: () => e(true),
          children: o.jsx(D, {
            size: "B300",
            children: "Logout"
          })
        }),
        t && o.jsx(Hn, {
          open: true,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                onDeactivate: n,
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Pie, {
                handleClose: n
              })
            })
          })
        })
      ]
    });
  }
  function LY({ deviceId: t, deleted: e, onDeleteToggle: n, disabled: r }) {
    return e ? o.jsx(Qe, {
      variant: "Critical",
      fill: "None",
      radii: "Pill",
      onClick: () => n(t),
      disabled: r,
      children: o.jsx(D, {
        size: "B300",
        children: "Undo"
      })
    }) : o.jsx(Qe, {
      variant: "Secondary",
      fill: "None",
      radii: "Pill",
      onClick: () => n(t),
      disabled: r,
      children: o.jsx(Q, {
        size: "50",
        src: q.Delete
      })
    });
  }
  function Xce({ device: t, deleted: e, refreshDeviceList: n, disabled: r, options: i, children: a }) {
    const s = t.last_seen_ts, [l, c] = p.useState(false), [d, u] = p.useState(false), h = p.useCallback(() => {
      u(false);
    }, []);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsxs(Ie, {
          focusId: `device-${MF(t.device_id)}`,
          showSettingLinkAction: false,
          before: o.jsx(Oe, {
            variant: e ? "Critical" : "Secondary",
            outlined: e,
            radii: "300",
            onClick: () => c(!l),
            children: o.jsx(Q, {
              size: "50",
              src: l ? q.ChevronBottom : q.ChevronRight
            })
          }),
          after: !d && o.jsxs(E, {
            shrink: "No",
            alignItems: "Center",
            gap: "200",
            children: [
              i,
              !e && o.jsx(Qe, {
                variant: "Secondary",
                radii: "Pill",
                onClick: () => u(true),
                disabled: r,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Edit"
                })
              })
            ]
          }),
          children: [
            o.jsx(D, {
              size: "T300",
              children: t.display_name ?? t.device_id
            }),
            o.jsxs(E, {
              direction: "Column",
              children: [
                typeof s == "number" && o.jsx(UHe, {
                  ts: s
                }),
                l && o.jsxs(o.Fragment, {
                  children: [
                    o.jsx(VHe, {
                      device: t
                    }),
                    a
                  ]
                })
              ]
            })
          ]
        }),
        d && o.jsx($He, {
          device: t,
          onCancel: () => u(false),
          onRename: h,
          refreshDeviceList: n
        })
      ]
    });
  }
  const qHe = (t, e) => t.filter((r) => r.stages.every((i) => e.includes(i))), KHe = (t) => t.completed ?? [], GHe = (t) => t.params ?? {}, YHe = (t) => t.session ?? void 0, Qce = (t) => "errcode" in t && typeof t.errcode == "string" ? t.errcode : void 0, ede = (t) => "error" in t && typeof t.error == "string" ? t.error : void 0, ZHe = (t, e) => {
    const n = t.filter((r) => r.stages.length < e.length ? false : r.stages.length > e.length ? r.stages.length > e.length + 1 || e.includes(sr.Dummy) ? false : !!r.stages.includes(sr.Dummy) : true).filter((r) => e.every((i) => r.stages.includes(i)));
    if (n.length !== 0) return n.sort((r, i) => r.stages.length - i.stages.length), n[0];
  }, tC = (t, e) => t.some((n) => n.stages.includes(e)), Kw = (t, e) => t.every((n) => n.stages.includes(e)), JHe = (t) => {
    var _a6, _b3;
    const e = t[sr.Terms];
    if (e && "policies" in e && typeof e.policies == "object") {
      if (e.policies === null) return;
      if ("privacy_policy" in e.policies && typeof e.policies.privacy_policy == "object") {
        if (e.policies.privacy_policy === null) return;
        const n = e.policies.privacy_policy, r = (_a6 = n.en) == null ? void 0 : _a6.url;
        if (typeof r == "string") return r;
        const i = Object.keys(n)[0];
        if (i) return (_b3 = n[i]) == null ? void 0 : _b3.url;
      }
    }
  };
  sr.Dummy, sr.Password, sr.Email, sr.Terms, sr.Recaptcha, sr.RegistrationToken;
  const tde = (t, e) => p.useMemo(() => qHe(t, e), [
    t,
    e
  ]), PM = (t) => p.useMemo(() => KHe(t), [
    t
  ]), nde = (t) => p.useMemo(() => GHe(t), [
    t
  ]), XHe = (t) => p.useMemo(() => YHe(t), [
    t
  ]), QHe = (t) => p.useMemo(() => Qce(t), [
    t
  ]), e$e = (t) => p.useMemo(() => ede(t), [
    t
  ]), rde = (t, e) => {
    const n = PM(t), r = nde(t), i = XHe(t), a = QHe(t), s = e$e(t), l = p.useCallback(() => {
      const { stages: u } = e, h = u.find((g) => !n.includes(g));
      if (!h) return;
      const f = r[h];
      return {
        type: h,
        info: f,
        session: i,
        errorCode: a,
        error: s
      };
    }, [
      e,
      n,
      r,
      a,
      s,
      i
    ]), c = p.useCallback((u) => e.stages.includes(u), [
      e
    ]), d = p.useCallback((u) => {
      if (c(u)) return r[u];
    }, [
      c,
      r
    ]);
    return {
      getStageToComplete: l,
      hasStage: c,
      getStageInfo: d
    };
  }, t$e = (t) => t ? t.httpStatus === 401 ? [
    t.data,
    void 0
  ] : [
    void 0,
    t
  ] : [
    void 0,
    void 0
  ];
  function MM({ currentStep: t, stepCount: e, children: n, onCancel: r }) {
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          escapeDeactivates: false
        },
        children: o.jsxs(E, {
          style: {
            height: "100%"
          },
          direction: "Column",
          grow: "Yes",
          gap: "400",
          children: [
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              alignItems: "Center",
              justifyContent: "Center",
              children: n
            }),
            o.jsxs(E, {
              style: {
                padding: ee.space.S200
              },
              shrink: "No",
              justifyContent: "Center",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Qe, {
                  as: "div",
                  radii: "Pill",
                  outlined: true,
                  children: o.jsx(D, {
                    as: "span",
                    size: "T300",
                    children: `Step ${t}/${e}`
                  })
                }),
                o.jsx(ar, {
                  tooltip: o.jsx(pr, {
                    variant: "Critical",
                    children: o.jsx(D, {
                      children: "Exit"
                    })
                  }),
                  position: "Top",
                  children: (i) => o.jsx(Oe, {
                    ref: i,
                    variant: "Critical",
                    size: "300",
                    onClick: r,
                    radii: "Pill",
                    outlined: true,
                    children: o.jsx(Q, {
                      size: "50",
                      src: q.Cross
                    })
                  })
                })
              ]
            })
          ]
        })
      })
    });
  }
  function n$e({ title: t, message: e, onRetry: n, onCancel: r }) {
    return o.jsx(lr, {
      children: o.jsxs(E, {
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "H4",
                children: t
              }),
              o.jsx(D, {
                children: e
              })
            ]
          }),
          o.jsx(xe, {
            variant: "Critical",
            onClick: n,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Retry"
            })
          }),
          o.jsx(xe, {
            variant: "Critical",
            fill: "None",
            outlined: true,
            onClick: r,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Cancel"
            })
          })
        ]
      })
    });
  }
  function r$e({ stageData: t, submitAuthDict: e, onCancel: n }) {
    const { errorCode: r, error: i, session: a } = t, s = p.useCallback(() => {
      e({
        type: sr.Dummy,
        session: a
      });
    }, [
      a,
      e
    ]);
    return p.useEffect(() => {
      r || s();
    }, [
      s,
      r
    ]), r ? o.jsx(n$e, {
      title: r,
      message: i ?? "Failed to register.",
      onRetry: s,
      onCancel: n
    }) : null;
  }
  function NY({ title: t, message: e, defaultEmail: n, onRetry: r, onCancel: i }) {
    const a = (s) => {
      s.preventDefault();
      const { retryEmailInput: l } = s.target, c = l.value;
      r(c);
    };
    return o.jsx(lr, {
      children: o.jsxs(E, {
        as: "form",
        onSubmit: a,
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "H4",
                children: t
              }),
              o.jsx(D, {
                children: e
              }),
              o.jsx(D, {
                as: "label",
                size: "L400",
                style: {
                  paddingTop: ee.space.S400
                },
                children: "Email"
              }),
              o.jsx(mn, {
                name: "retryEmailInput",
                variant: "Background",
                size: "500",
                outlined: true,
                defaultValue: n,
                required: true
              })
            ]
          }),
          o.jsx(xe, {
            variant: "Primary",
            type: "submit",
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Send Verification Email"
            })
          }),
          o.jsx(xe, {
            variant: "Critical",
            fill: "None",
            outlined: true,
            type: "button",
            onClick: i,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Cancel"
            })
          })
        ]
      })
    });
  }
  function ide({ email: t, clientSecret: e, stageData: n, emailTokenState: r, requestEmailToken: i, submitAuthDict: a, onCancel: s }) {
    var _a6, _b3;
    const { errorCode: l, error: c, session: d } = n, u = p.useCallback((f) => {
      const g = {
        sid: f,
        client_secret: e
      };
      a({
        type: sr.Email,
        threepid_creds: g,
        threepidCreds: g,
        session: d
      });
    }, [
      a,
      d,
      e
    ]), h = p.useCallback((f) => {
      i(f, e);
    }, [
      e,
      i
    ]);
    return p.useEffect(() => {
      t && !l && r.status === ve.Idle && i(t, e);
    }, [
      t,
      l,
      e,
      r,
      i
    ]), r.status === ve.Loading ? o.jsxs(E, {
      direction: "Column",
      alignItems: "Center",
      gap: "400",
      children: [
        o.jsx(dt, {
          variant: "Secondary",
          size: "600"
        }),
        o.jsx(D, {
          style: {
            color: ct.Secondary.Main
          },
          children: "Sending verification email..."
        })
      ]
    }) : r.status === ve.Error ? o.jsx(NY, {
      title: r.error.errcode ?? "Verify Email",
      message: ((_b3 = (_a6 = r.error) == null ? void 0 : _a6.data) == null ? void 0 : _b3.error) ?? r.error.message ?? "Failed to send verification Email request.",
      onRetry: h,
      onCancel: s
    }) : r.status === ve.Success ? o.jsx(lr, {
      children: o.jsxs(E, {
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "H4",
                children: "Verification Request Sent"
              }),
              o.jsx(D, {
                children: `Please check your email "${r.data.email}" and validate before continuing further.`
              }),
              l && o.jsx(D, {
                style: {
                  color: ct.Critical.Main
                },
                children: `${l}: ${c}`
              })
            ]
          }),
          o.jsx(xe, {
            variant: "Primary",
            onClick: () => u(r.data.result.sid),
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Continue"
            })
          })
        ]
      })
    }) : t ? null : o.jsx(NY, {
      title: "Provide Email",
      message: "Please provide email to send verification request.",
      onRetry: h,
      onCancel: s
    });
  }
  var vo = ((t) => (t.M_FORBIDDEN = "M_FORBIDDEN", t.M_UNKNOWN_TOKEN = "M_UNKNOWN_TOKEN", t.M_MISSING_TOKEN = "M_MISSING_TOKEN", t.M_BAD_JSON = "M_BAD_JSON", t.M_NOT_JSON = "M_NOT_JSON", t.M_NOT_FOUND = "M_NOT_FOUND", t.M_LIMIT_EXCEEDED = "M_LIMIT_EXCEEDED", t.M_UNRECOGNIZED = "M_UNRECOGNIZED", t.M_UNKNOWN = "M_UNKNOWN", t.M_UNAUTHORIZED = "M_UNAUTHORIZED", t.M_USER_DEACTIVATED = "M_USER_DEACTIVATED", t.M_USER_IN_USE = "M_USER_IN_USE", t.M_INVALID_USERNAME = "M_INVALID_USERNAME", t.M_WEAK_PASSWORD = "M_WEAK_PASSWORD", t.M_PASSWORD_TOO_SHORT = "M_PASSWORD_TOO_SHORT", t.M_ROOM_IN_USE = "M_ROOM_IN_USE", t.M_INVALID_ROOM_STATE = "M_INVALID_ROOM_STATE", t.M_THREEPID_IN_USE = "M_THREEPID_IN_USE", t.M_THREEPID_NOT_FOUND = "M_THREEPID_NOT_FOUND", t.M_THREEPID_AUTH_FAILED = "M_THREEPID_AUTH_FAILED", t.M_THREEPID_DENIED = "M_THREEPID_DENIED", t.M_SERVER_NOT_TRUSTED = "M_SERVER_NOT_TRUSTED", t.M_UNSUPPORTED_ROOM_VERSION = "M_UNSUPPORTED_ROOM_VERSION", t.M_INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION", t.M_BAD_STATE = "M_BAD_STATE", t.M_GUEST_ACCESS_FORBIDDEN = "M_GUEST_ACCESS_FORBIDDEN", t.M_CAPTCHA_NEEDED = "M_CAPTCHA_NEEDED", t.M_CAPTCHA_INVALID = "M_CAPTCHA_INVALID", t.M_MISSING_PARAM = "M_MISSING_PARAM", t.M_INVALID_PARAM = "M_INVALID_PARAM", t.M_TOO_LARGE = "M_TOO_LARGE", t.M_EXCLUSIVE = "M_EXCLUSIVE", t.M_RESOURCE_LIMIT_EXCEEDED = "M_RESOURCE_LIMIT_EXCEEDED", t.M_CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM", t.M_MAX_DELAY_EXCEEDED = "M_MAX_DELAY_EXCEEDED", t))(vo || {});
  function i$e({ stageData: t, submitAuthDict: e, onCancel: n, userId: r }) {
    const { errorCode: i, error: a, session: s } = t, l = (c) => {
      c.preventDefault();
      const { passwordInput: d } = c.target, u = d.value;
      u && e({
        type: sr.Password,
        identifier: {
          type: "m.id.user",
          user: r
        },
        password: u,
        session: s
      });
    };
    return o.jsxs(lr, {
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "Account Password"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: n,
              radii: "300",
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsxs(E, {
          as: "form",
          onSubmit: l,
          style: {
            padding: `0 ${ee.space.S400} ${ee.space.S400}`
          },
          direction: "Column",
          gap: "400",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(D, {
                  size: "T200",
                  children: "To perform this action you need to authenticate yourself by entering you account password."
                }),
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Password"
                    }),
                    o.jsx(Yl, {
                      size: "400",
                      name: "passwordInput",
                      outlined: true,
                      autoFocus: true,
                      required: true
                    }),
                    i && o.jsxs(E, {
                      alignItems: "Center",
                      gap: "100",
                      style: {
                        color: ct.Critical.Main
                      },
                      children: [
                        o.jsx(Q, {
                          size: "50",
                          src: q.Warning,
                          filled: true
                        }),
                        o.jsx(D, {
                          size: "T200",
                          children: o.jsx("b", {
                            children: i === vo.M_FORBIDDEN ? "Invalid Password!" : `${i}: ${a}`
                          })
                        })
                      ]
                    })
                  ]
                })
              ]
            }),
            o.jsx(xe, {
              variant: "Primary",
              type: "submit",
              children: o.jsx(D, {
                as: "span",
                size: "B400",
                children: "Continue"
              })
            })
          ]
        })
      ]
    });
  }
  var o$e = Ate();
  const qs = da(o$e);
  function qI() {
    return qI = Object.assign || function(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e];
        for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
      }
      return t;
    }, qI.apply(this, arguments);
  }
  function a$e(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function Gw(t) {
    if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return t;
  }
  function s$e(t, e) {
    t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e;
  }
  var FS = (function(t) {
    s$e(e, t);
    function e() {
      var r;
      return r = t.call(this) || this, r.handleExpired = r.handleExpired.bind(Gw(r)), r.handleErrored = r.handleErrored.bind(Gw(r)), r.handleChange = r.handleChange.bind(Gw(r)), r.handleRecaptchaRef = r.handleRecaptchaRef.bind(Gw(r)), r;
    }
    var n = e.prototype;
    return n.getValue = function() {
      return this.props.grecaptcha && this._widgetId !== void 0 ? this.props.grecaptcha.getResponse(this._widgetId) : null;
    }, n.getWidgetId = function() {
      return this.props.grecaptcha && this._widgetId !== void 0 ? this._widgetId : null;
    }, n.execute = function() {
      var i = this.props.grecaptcha;
      if (i && this._widgetId !== void 0) return i.execute(this._widgetId);
      this._executeRequested = true;
    }, n.executeAsync = function() {
      var i = this;
      return new Promise(function(a, s) {
        i.executionResolve = a, i.executionReject = s, i.execute();
      });
    }, n.reset = function() {
      this.props.grecaptcha && this._widgetId !== void 0 && this.props.grecaptcha.reset(this._widgetId);
    }, n.handleExpired = function() {
      this.props.onExpired ? this.props.onExpired() : this.handleChange(null);
    }, n.handleErrored = function() {
      this.props.onErrored && this.props.onErrored(), this.executionReject && (this.executionReject(), delete this.executionResolve, delete this.executionReject);
    }, n.handleChange = function(i) {
      this.props.onChange && this.props.onChange(i), this.executionResolve && (this.executionResolve(i), delete this.executionReject, delete this.executionResolve);
    }, n.explicitRender = function() {
      if (this.props.grecaptcha && this.props.grecaptcha.render && this._widgetId === void 0) {
        var i = document.createElement("div");
        this._widgetId = this.props.grecaptcha.render(i, {
          sitekey: this.props.sitekey,
          callback: this.handleChange,
          theme: this.props.theme,
          type: this.props.type,
          tabindex: this.props.tabindex,
          "expired-callback": this.handleExpired,
          "error-callback": this.handleErrored,
          size: this.props.size,
          stoken: this.props.stoken,
          hl: this.props.hl,
          badge: this.props.badge
        }), this.captcha.appendChild(i);
      }
      this._executeRequested && this.props.grecaptcha && this._widgetId !== void 0 && (this._executeRequested = false, this.execute());
    }, n.componentDidMount = function() {
      this.explicitRender();
    }, n.componentDidUpdate = function() {
      this.explicitRender();
    }, n.componentWillUnmount = function() {
      this._widgetId !== void 0 && (this.delayOfCaptchaIframeRemoving(), this.reset());
    }, n.delayOfCaptchaIframeRemoving = function() {
      var i = document.createElement("div");
      for (document.body.appendChild(i), i.style.display = "none"; this.captcha.firstChild; ) i.appendChild(this.captcha.firstChild);
      setTimeout(function() {
        document.body.removeChild(i);
      }, 5e3);
    }, n.handleRecaptchaRef = function(i) {
      this.captcha = i;
    }, n.render = function() {
      var i = this.props;
      i.sitekey, i.onChange, i.theme, i.type, i.tabindex, i.onExpired, i.onErrored, i.size, i.stoken, i.grecaptcha, i.badge, i.hl;
      var a = a$e(i, [
        "sitekey",
        "onChange",
        "theme",
        "type",
        "tabindex",
        "onExpired",
        "onErrored",
        "size",
        "stoken",
        "grecaptcha",
        "badge",
        "hl"
      ]);
      return yn.createElement("div", qI({}, a, {
        ref: this.handleRecaptchaRef
      }));
    }, e;
  })(yn.Component);
  FS.displayName = "ReCAPTCHA";
  FS.propTypes = {
    sitekey: qs.string.isRequired,
    onChange: qs.func,
    grecaptcha: qs.object,
    theme: qs.oneOf([
      "dark",
      "light"
    ]),
    type: qs.oneOf([
      "image",
      "audio"
    ]),
    tabindex: qs.number,
    onExpired: qs.func,
    onErrored: qs.func,
    size: qs.oneOf([
      "compact",
      "normal",
      "invisible"
    ]),
    stoken: qs.string,
    hl: qs.string,
    badge: qs.oneOf([
      "bottomright",
      "bottomleft",
      "inline"
    ])
  };
  FS.defaultProps = {
    onChange: function() {
    },
    theme: "light",
    type: "image",
    tabindex: 0,
    size: "normal",
    badge: "bottomright"
  };
  var N5 = {
    exports: {}
  }, ii = {};
  var zY;
  function l$e() {
    if (zY) return ii;
    zY = 1;
    var t = typeof Symbol == "function" && Symbol.for, e = t ? /* @__PURE__ */ Symbol.for("react.element") : 60103, n = t ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = t ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, i = t ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, a = t ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, s = t ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, l = t ? /* @__PURE__ */ Symbol.for("react.context") : 60110, c = t ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, d = t ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, u = t ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, h = t ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, f = t ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, g = t ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, m = t ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v = t ? /* @__PURE__ */ Symbol.for("react.block") : 60121, y = t ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, w = t ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, b = t ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
    function j(C) {
      if (typeof C == "object" && C !== null) {
        var x = C.$$typeof;
        switch (x) {
          case e:
            switch (C = C.type, C) {
              case c:
              case d:
              case r:
              case a:
              case i:
              case h:
                return C;
              default:
                switch (C = C && C.$$typeof, C) {
                  case l:
                  case u:
                  case m:
                  case g:
                  case s:
                    return C;
                  default:
                    return x;
                }
            }
          case n:
            return x;
        }
      }
    }
    function k(C) {
      return j(C) === d;
    }
    return ii.AsyncMode = c, ii.ConcurrentMode = d, ii.ContextConsumer = l, ii.ContextProvider = s, ii.Element = e, ii.ForwardRef = u, ii.Fragment = r, ii.Lazy = m, ii.Memo = g, ii.Portal = n, ii.Profiler = a, ii.StrictMode = i, ii.Suspense = h, ii.isAsyncMode = function(C) {
      return k(C) || j(C) === c;
    }, ii.isConcurrentMode = k, ii.isContextConsumer = function(C) {
      return j(C) === l;
    }, ii.isContextProvider = function(C) {
      return j(C) === s;
    }, ii.isElement = function(C) {
      return typeof C == "object" && C !== null && C.$$typeof === e;
    }, ii.isForwardRef = function(C) {
      return j(C) === u;
    }, ii.isFragment = function(C) {
      return j(C) === r;
    }, ii.isLazy = function(C) {
      return j(C) === m;
    }, ii.isMemo = function(C) {
      return j(C) === g;
    }, ii.isPortal = function(C) {
      return j(C) === n;
    }, ii.isProfiler = function(C) {
      return j(C) === a;
    }, ii.isStrictMode = function(C) {
      return j(C) === i;
    }, ii.isSuspense = function(C) {
      return j(C) === h;
    }, ii.isValidElementType = function(C) {
      return typeof C == "string" || typeof C == "function" || C === r || C === d || C === a || C === i || C === h || C === f || typeof C == "object" && C !== null && (C.$$typeof === m || C.$$typeof === g || C.$$typeof === s || C.$$typeof === l || C.$$typeof === u || C.$$typeof === y || C.$$typeof === w || C.$$typeof === b || C.$$typeof === v);
    }, ii.typeOf = j, ii;
  }
  var UY;
  function c$e() {
    return UY || (UY = 1, N5.exports = l$e()), N5.exports;
  }
  var z5, VY;
  function d$e() {
    if (VY) return z5;
    VY = 1;
    var t = c$e(), e = {
      childContextTypes: true,
      contextType: true,
      contextTypes: true,
      defaultProps: true,
      displayName: true,
      getDefaultProps: true,
      getDerivedStateFromError: true,
      getDerivedStateFromProps: true,
      mixins: true,
      propTypes: true,
      type: true
    }, n = {
      name: true,
      length: true,
      prototype: true,
      caller: true,
      callee: true,
      arguments: true,
      arity: true
    }, r = {
      $$typeof: true,
      render: true,
      defaultProps: true,
      displayName: true,
      propTypes: true
    }, i = {
      $$typeof: true,
      compare: true,
      defaultProps: true,
      displayName: true,
      propTypes: true,
      type: true
    }, a = {};
    a[t.ForwardRef] = r, a[t.Memo] = i;
    function s(m) {
      return t.isMemo(m) ? i : a[m.$$typeof] || e;
    }
    var l = Object.defineProperty, c = Object.getOwnPropertyNames, d = Object.getOwnPropertySymbols, u = Object.getOwnPropertyDescriptor, h = Object.getPrototypeOf, f = Object.prototype;
    function g(m, v, y) {
      if (typeof v != "string") {
        if (f) {
          var w = h(v);
          w && w !== f && g(m, w, y);
        }
        var b = c(v);
        d && (b = b.concat(d(v)));
        for (var j = s(m), k = s(v), C = 0; C < b.length; ++C) {
          var x = b[C];
          if (!n[x] && !(y && y[x]) && !(k && k[x]) && !(j && j[x])) {
            var S = u(v, x);
            try {
              l(m, x, S);
            } catch {
            }
          }
        }
      }
      return m;
    }
    return z5 = g, z5;
  }
  var u$e = d$e();
  const h$e = da(u$e);
  function KI() {
    return KI = Object.assign || function(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e];
        for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
      }
      return t;
    }, KI.apply(this, arguments);
  }
  function f$e(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function m$e(t, e) {
    t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e;
  }
  var Fc = {}, g$e = 0;
  function p$e(t, e) {
    return e = e || {}, function(r) {
      var i = r.displayName || r.name || "Component", a = (function(l) {
        m$e(c, l);
        function c(u, h) {
          var f;
          return f = l.call(this, u, h) || this, f.state = {}, f.__scriptURL = "", f;
        }
        var d = c.prototype;
        return d.asyncScriptLoaderGetScriptLoaderID = function() {
          return this.__scriptLoaderID || (this.__scriptLoaderID = "async-script-loader-" + g$e++), this.__scriptLoaderID;
        }, d.setupScriptURL = function() {
          return this.__scriptURL = typeof t == "function" ? t() : t, this.__scriptURL;
        }, d.asyncScriptLoaderHandleLoad = function(h) {
          var f = this;
          this.setState(h, function() {
            return f.props.asyncScriptOnLoad && f.props.asyncScriptOnLoad(f.state);
          });
        }, d.asyncScriptLoaderTriggerOnScriptLoaded = function() {
          var h = Fc[this.__scriptURL];
          if (!h || !h.loaded) throw new Error("Script is not loaded.");
          for (var f in h.observers) h.observers[f](h);
          delete window[e.callbackName];
        }, d.componentDidMount = function() {
          var h = this, f = this.setupScriptURL(), g = this.asyncScriptLoaderGetScriptLoaderID(), m = e, v = m.globalName, y = m.callbackName, w = m.scriptId;
          if (v && typeof window[v] < "u" && (Fc[f] = {
            loaded: true,
            observers: {}
          }), Fc[f]) {
            var b = Fc[f];
            if (b && (b.loaded || b.errored)) {
              this.asyncScriptLoaderHandleLoad(b);
              return;
            }
            b.observers[g] = function(S) {
              return h.asyncScriptLoaderHandleLoad(S);
            };
            return;
          }
          var j = {};
          j[g] = function(S) {
            return h.asyncScriptLoaderHandleLoad(S);
          }, Fc[f] = {
            loaded: false,
            observers: j
          };
          var k = document.createElement("script");
          k.src = f, k.async = true;
          for (var C in e.attributes) k.setAttribute(C, e.attributes[C]);
          w && (k.id = w);
          var x = function(T) {
            if (Fc[f]) {
              var A = Fc[f], B = A.observers;
              for (var U in B) T(B[U]) && delete B[U];
            }
          };
          y && typeof window < "u" && (window[y] = function() {
            return h.asyncScriptLoaderTriggerOnScriptLoaded();
          }), k.onload = function() {
            var S = Fc[f];
            S && (S.loaded = true, x(function(T) {
              return y ? false : (T(S), true);
            }));
          }, k.onerror = function() {
            var S = Fc[f];
            S && (S.errored = true, x(function(T) {
              return T(S), true;
            }));
          }, document.body.appendChild(k);
        }, d.componentWillUnmount = function() {
          var h = this.__scriptURL;
          if (e.removeOnUnmount === true) for (var f = document.getElementsByTagName("script"), g = 0; g < f.length; g += 1) f[g].src.indexOf(h) > -1 && f[g].parentNode && f[g].parentNode.removeChild(f[g]);
          var m = Fc[h];
          m && (delete m.observers[this.asyncScriptLoaderGetScriptLoaderID()], e.removeOnUnmount === true && delete Fc[h]);
        }, d.render = function() {
          var h = e.globalName, f = this.props;
          f.asyncScriptOnLoad;
          var g = f.forwardedRef, m = f$e(f, [
            "asyncScriptOnLoad",
            "forwardedRef"
          ]);
          return h && typeof window < "u" && (m[h] = typeof window[h] < "u" ? window[h] : void 0), m.ref = g, p.createElement(r, m);
        }, c;
      })(p.Component), s = p.forwardRef(function(l, c) {
        return p.createElement(a, KI({}, l, {
          forwardedRef: c
        }));
      });
      return s.displayName = "AsyncScriptLoader(" + i + ")", s.propTypes = {
        asyncScriptOnLoad: qs.func
      }, h$e(s, r);
    };
  }
  var ode = "onloadcallback", F$e = "grecaptcha";
  function v$e() {
    return typeof window < "u" && window.recaptchaOptions || {};
  }
  function _$e() {
    var t = v$e(), e = t.useRecaptchaNet ? "recaptcha.net" : "www.google.com";
    return "https://" + e + "/recaptcha/api.js?onload=" + ode + "&render=explicit";
  }
  const y$e = p$e(_$e, {
    callbackName: ode,
    globalName: F$e
  })(FS);
  function b$e({ title: t, message: e, onCancel: n }) {
    return o.jsx(lr, {
      children: o.jsxs(E, {
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "H4",
                children: t
              }),
              o.jsx(D, {
                children: e
              })
            ]
          }),
          o.jsx(xe, {
            variant: "Critical",
            fill: "None",
            outlined: true,
            onClick: n,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Cancel"
            })
          })
        ]
      })
    });
  }
  function x$e({ stageData: t, submitAuthDict: e, onCancel: n }) {
    const { info: r, session: i } = t, a = r == null ? void 0 : r.public_key, s = (l) => {
      e({
        type: sr.Recaptcha,
        response: l,
        session: i
      });
    };
    return typeof a != "string" || !i ? o.jsx(b$e, {
      title: "Invalid Data",
      message: "No valid data found to proceed with ReCAPTCHA.",
      onCancel: n
    }) : o.jsx(lr, {
      children: o.jsxs(E, {
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsx(D, {
            children: "Please check the box below to proceed."
          }),
          o.jsx(y$e, {
            sitekey: a,
            onChange: s
          })
        ]
      })
    });
  }
  function HY({ title: t, message: e, defaultToken: n, onRetry: r, onCancel: i }) {
    const a = (s) => {
      s.preventDefault();
      const { retryTokenInput: l } = s.target, c = l.value;
      r(c);
    };
    return o.jsx(lr, {
      children: o.jsxs(E, {
        as: "form",
        onSubmit: a,
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "H4",
                children: t
              }),
              o.jsx(D, {
                children: e
              }),
              o.jsx(D, {
                as: "label",
                size: "L400",
                style: {
                  paddingTop: ee.space.S400
                },
                children: "Registration Token"
              }),
              o.jsx(mn, {
                name: "retryTokenInput",
                variant: "Background",
                size: "500",
                outlined: true,
                defaultValue: n,
                required: true
              })
            ]
          }),
          o.jsx(xe, {
            variant: "Critical",
            type: "submit",
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Retry"
            })
          }),
          o.jsx(xe, {
            variant: "Critical",
            fill: "None",
            outlined: true,
            type: "button",
            onClick: i,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Cancel"
            })
          })
        ]
      })
    });
  }
  function w$e({ token: t, stageData: e, submitAuthDict: n, onCancel: r }) {
    const { errorCode: i, error: a, session: s } = e, l = p.useCallback((c) => {
      n({
        type: sr.RegistrationToken,
        token: c,
        session: s
      });
    }, [
      s,
      n
    ]);
    return p.useEffect(() => {
      t && !i && l(t);
    }, [
      l,
      t,
      i
    ]), i ? o.jsx(HY, {
      defaultToken: t,
      title: i,
      message: a ?? "Invalid registration token provided.",
      onRetry: l,
      onCancel: r
    }) : t ? null : o.jsx(HY, {
      defaultToken: t,
      title: "Registration Token",
      message: "Please submit registration token provided by you homeserver admin.",
      onRetry: l,
      onCancel: r
    });
  }
  function D$e({ ssoRedirectURL: t, stageData: e, submitAuthDict: n, onCancel: r }) {
    const { errorCode: i, error: a, session: s } = e, [l, c] = p.useState(), d = p.useCallback(() => {
      n({
        session: s
      });
    }, [
      n,
      s
    ]), u = () => {
      const h = window.open(t, "_blank");
      c(h ?? void 0);
    };
    return p.useEffect(() => {
      const h = (f) => {
        f.origin === new URL(t).origin && l && f.data === "authDone" && f.source === l && (l.close(), c(void 0), d());
      };
      return window.addEventListener("message", h), () => {
        window.removeEventListener("message", h);
      };
    }, [
      l,
      d,
      t
    ]), o.jsxs(lr, {
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "SSO Login"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: r,
              radii: "300",
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsxs(E, {
          style: {
            padding: `0 ${ee.space.S400} ${ee.space.S400}`
          },
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(D, {
              size: "T200",
              children: "To perform this action you need to authenticate yourself by SSO login."
            }),
            i && o.jsxs(E, {
              alignItems: "Center",
              gap: "100",
              style: {
                color: ct.Critical.Main
              },
              children: [
                o.jsx(Q, {
                  size: "50",
                  src: q.Warning,
                  filled: true
                }),
                o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: `${i}: ${a}`
                  })
                })
              ]
            }),
            l ? o.jsx(xe, {
              variant: "Primary",
              onClick: d,
              children: o.jsx(D, {
                as: "span",
                size: "B400",
                children: "Continue"
              })
            }) : o.jsx(xe, {
              variant: "Primary",
              onClick: u,
              children: o.jsx(D, {
                as: "span",
                size: "B400",
                children: "Continue with SSO"
              })
            })
          ]
        })
      ]
    });
  }
  function C$e({ title: t, message: e, onRetry: n, onCancel: r }) {
    return o.jsx(lr, {
      children: o.jsxs(E, {
        style: {
          padding: ee.space.S400
        },
        direction: "Column",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "H4",
                children: t
              }),
              o.jsx(D, {
                children: e
              })
            ]
          }),
          o.jsx(xe, {
            variant: "Critical",
            onClick: n,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Retry"
            })
          }),
          o.jsx(xe, {
            variant: "Critical",
            fill: "None",
            outlined: true,
            onClick: r,
            children: o.jsx(D, {
              as: "span",
              size: "B400",
              children: "Cancel"
            })
          })
        ]
      })
    });
  }
  function E$e({ stageData: t, submitAuthDict: e, onCancel: n }) {
    const { errorCode: r, error: i, session: a } = t, s = p.useCallback(() => e({
      type: sr.Terms,
      session: a
    }), [
      a,
      e
    ]);
    return p.useEffect(() => {
      r || s();
    }, [
      a,
      r,
      s
    ]), r ? o.jsx(C$e, {
      title: r,
      message: i ?? "Failed to submit Terms and Condition Acceptance.",
      onRetry: s,
      onCancel: n
    }) : null;
  }
  const k$e = [
    sr.Password,
    sr.Sso
  ];
  function ade({ authData: t, ongoingFlow: e, action: n, onCancel: r }) {
    const i = be(), a = PM(t), { getStageToComplete: s } = rde(t, e), l = s();
    return l ? o.jsxs(MM, {
      currentStep: a.length + 1,
      stepCount: e.stages.length,
      onCancel: r,
      children: [
        l.type === sr.Password && o.jsx(i$e, {
          userId: i.getUserId(),
          stageData: l,
          onCancel: r,
          submitAuthDict: n
        }),
        l.type === sr.Sso && l.session && o.jsx(D$e, {
          ssoRedirectURL: i.getFallbackAuthUrl(sr.Sso, l.session),
          stageData: l,
          onCancel: r,
          submitAuthDict: n
        })
      ]
    }) : null;
  }
  function sde({ authData: t, unsupported: e, children: n }) {
    const r = tde(t.flows ?? [], k$e), i = r.length > 0 ? r[0] : void 0;
    return i ? n(i) : e();
  }
  function S$e({ crypto: t, userId: e, deviceId: n, children: r }) {
    const i = Ek(t, e, n);
    return r(i);
  }
  const lde = p.createContext(void 0), j$e = lde.Provider, cde = () => p.useContext(lde), dde = () => p.useMemo(() => ({
    profile: "org.matrix.profile",
    sessionsList: "org.matrix.sessions_list",
    sessionView: "org.matrix.session_view",
    sessionEnd: "org.matrix.session_end",
    accountDeactivate: "org.matrix.account_deactivate",
    crossSigningReset: "org.matrix.cross_signing_reset"
  }), []);
  function T$e({ processing: t, keyContent: e, passphraseContent: n, onDecodedRecoveryKey: r }) {
    const i = be(), a = Kr(), [s, l] = Et(p.useCallback(async (h, f, g, m) => {
      const v = await lxe(h, f, g, m);
      if (!await i.secretStorage.checkKey(v, e)) throw new Error("Invalid recovery passphrase.");
      return v;
    }, [
      i,
      e
    ])), d = s.status === ve.Loading || t, u = (h) => {
      var _a6;
      if (d) return;
      h.preventDefault();
      const g = (_a6 = h.target) == null ? void 0 : _a6.recoveryPassphraseInput;
      if (!g) return;
      const m = g.value.trim();
      if (!m) return;
      const { salt: v, iterations: y, bits: w } = n;
      l(m, v, y, w).then((b) => {
        a() && (g.value = "", r(b));
      });
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: u,
      direction: "Column",
      gap: "100",
      children: [
        o.jsxs(E, {
          gap: "200",
          alignItems: "End",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Recovery Passphrase"
                }),
                o.jsx(Yl, {
                  name: "recoveryPassphraseInput",
                  size: "400",
                  variant: "Secondary",
                  radii: "300",
                  autoFocus: true,
                  required: true,
                  outlined: true,
                  readOnly: d
                })
              ]
            }),
            o.jsx(E, {
              shrink: "No",
              gap: "200",
              children: o.jsx(xe, {
                type: "submit",
                variant: "Success",
                size: "400",
                radii: "300",
                disabled: d,
                before: d && o.jsx(dt, {
                  size: "200",
                  variant: "Success",
                  fill: "Solid"
                }),
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Verify"
                })
              })
            })
          ]
        }),
        s.status === ve.Error && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: s.error.message
          })
        })
      ]
    });
  }
  function R$e({ processing: t, keyContent: e, onDecodedRecoveryKey: n }) {
    const r = be(), i = Kr(), [a, s] = Et(p.useCallback(async (u) => {
      const h = axe(u);
      if (!await r.secretStorage.checkKey(h, e)) throw new Error("Invalid recovery key.");
      return h;
    }, [
      r,
      e
    ])), c = a.status === ve.Loading || t, d = (u) => {
      var _a6;
      u.preventDefault();
      const f = (_a6 = u.target) == null ? void 0 : _a6.recoveryKeyInput;
      if (!f) return;
      const g = f.value.trim();
      g && s(g).then((m) => {
        i() && (f.value = "", n(m));
      });
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: d,
      direction: "Column",
      gap: "100",
      children: [
        o.jsxs(E, {
          gap: "200",
          alignItems: "End",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Recovery Key"
                }),
                o.jsx(Yl, {
                  name: "recoveryKeyInput",
                  size: "400",
                  variant: "Secondary",
                  radii: "300",
                  autoFocus: true,
                  required: true,
                  outlined: true,
                  readOnly: c
                })
              ]
            }),
            o.jsx(E, {
              shrink: "No",
              gap: "200",
              children: o.jsx(xe, {
                type: "submit",
                variant: "Success",
                size: "400",
                radii: "300",
                disabled: c,
                before: c && o.jsx(dt, {
                  size: "200",
                  variant: "Success",
                  fill: "Solid"
                }),
                children: o.jsx(D, {
                  as: "span",
                  size: "B400",
                  children: "Verify"
                })
              })
            })
          ]
        }),
        a.status === ve.Error && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: a.error.message
          })
        })
      ]
    });
  }
  function A$e({ value: t, onChange: e }) {
    const [n, r] = p.useState(), i = (s) => {
      r(s.currentTarget.getBoundingClientRect());
    }, a = (s) => {
      r(void 0), e(s);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Qe, {
          type: "button",
          variant: "Secondary",
          fill: "Soft",
          radii: "Pill",
          before: o.jsx(Q, {
            size: "100",
            src: q.ChevronBottom
          }),
          onClick: i,
          children: o.jsxs(D, {
            as: "span",
            size: "B300",
            children: [
              t === "passphrase" && "Recovery Passphrase",
              t === "key" && "Recovery Key"
            ]
          })
        }),
        o.jsx(ln, {
          anchor: n,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => r(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (s) => s.key === "ArrowDown" || s.key === "ArrowRight",
              isKeyBackward: (s) => s.key === "ArrowUp" || s.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: [
                  o.jsx(Ye, {
                    size: "300",
                    variant: "Surface",
                    "aria-selected": t === "passphrase",
                    radii: "300",
                    onClick: () => a("passphrase"),
                    children: o.jsx(E, {
                      grow: "Yes",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Recovery Passphrase"
                      })
                    })
                  }),
                  o.jsx(Ye, {
                    size: "300",
                    variant: "Surface",
                    "aria-selected": t === "key",
                    radii: "300",
                    onClick: () => a("key"),
                    children: o.jsx(E, {
                      grow: "Yes",
                      children: o.jsx(D, {
                        size: "T300",
                        children: "Recovery Key"
                      })
                    })
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function I$e({ secretStorageKeyId: t, secretStorageKeyContent: e, options: n }) {
    const r = be(), i = !!e.passphrase, [a, s] = p.useState(i ? "passphrase" : "key"), l = p.useCallback(async (h) => {
      const f = r.getCrypto();
      if (!f) throw new Error("Unexpected Error! Crypto object not found.");
      FEe(t, h), await f.bootstrapCrossSigning({}), await f.bootstrapSecretStorage({}), await f.loadSessionBackupPrivateKeyFromSecretStorage();
    }, [
      r,
      t
    ]), [c, d] = Et(l), u = c.status === ve.Loading;
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      children: [
        o.jsx(Ie, {
          title: "Verify Manually",
          description: i ? "Select a verification method." : "Provide recovery key.",
          after: o.jsxs(E, {
            alignItems: "Center",
            gap: "200",
            children: [
              i && o.jsx(A$e, {
                value: a,
                onChange: s
              }),
              n
            ]
          })
        }),
        c.status === ve.Success ? o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Success.Main
          },
          children: o.jsx("b", {
            children: "Device verified!"
          })
        }) : o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            a === "key" && o.jsx(R$e, {
              processing: u,
              keyContent: e,
              onDecodedRecoveryKey: d
            }),
            a === "passphrase" && e.passphrase && o.jsx(T$e, {
              processing: u,
              keyContent: e,
              passphraseContent: e.passphrase,
              onDecodedRecoveryKey: d
            }),
            c.status === ve.Error && o.jsx(D, {
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: c.error.message
              })
            })
          ]
        })
      ]
    });
  }
  const B$e = (t) => {
    const e = be();
    p.useEffect(() => (e.on(oi.VerificationRequestReceived, t), () => {
      e.removeListener(oi.VerificationRequestReceived, t);
    }), [
      e,
      t
    ]);
  }, P$e = (t, e) => {
    p.useEffect(() => (t.on(iH.Change, e), () => {
      t.removeListener(iH.Change, e);
    }), [
      t,
      e
    ]);
  }, M$e = (t) => {
    const [e, n] = p.useState(() => t.phase);
    return P$e(t, p.useCallback(() => {
      n(t.phase);
    }, [
      t
    ])), e;
  }, O$e = (t, e) => {
    p.useEffect(() => (t.on(GC.Cancel, e), () => {
      t.removeListener(GC.Cancel, e);
    }), [
      t,
      e
    ]);
  }, L$e = (t, e) => {
    p.useEffect(() => (t.on(GC.ShowSas, e), () => {
      t.removeListener(GC.ShowSas, e);
    }), [
      t,
      e
    ]);
  }, N$e = {
    padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
    borderBottomWidth: ee.borderWidth.B300
  };
  function vS({ message: t }) {
    return o.jsxs(E, {
      alignItems: "Center",
      gap: "200",
      children: [
        o.jsx(dt, {
          variant: "Secondary",
          size: "200"
        }),
        o.jsx(D, {
          size: "T300",
          children: t
        })
      ]
    });
  }
  function z$e({ message: t, onClose: e }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          children: t
        }),
        o.jsx(xe, {
          variant: "Secondary",
          fill: "Soft",
          onClick: e,
          children: o.jsx(D, {
            size: "B400",
            children: "Close"
          })
        })
      ]
    });
  }
  function U$e() {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          children: "Please accept the request from other device."
        }),
        o.jsx(vS, {
          message: "Waiting for request to be accepted..."
        })
      ]
    });
  }
  function V$e({ onAccept: t }) {
    const [e, n] = Et(t), r = e.status === ve.Loading;
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          children: "Click accept to start the verification process."
        }),
        o.jsx(xe, {
          variant: "Primary",
          fill: "Solid",
          onClick: n,
          before: r && o.jsx(dt, {
            size: "100",
            variant: "Primary",
            fill: "Solid"
          }),
          disabled: r,
          children: o.jsx(D, {
            size: "B400",
            children: "Accept"
          })
        })
      ]
    });
  }
  function H$e() {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          children: "Verification request has been accepted."
        }),
        o.jsx(vS, {
          message: "Waiting for the response from other device..."
        })
      ]
    });
  }
  function $$e({ onStart: t }) {
    return p.useEffect(() => {
      t();
    }, [
      t
    ]), o.jsx(E, {
      direction: "Column",
      gap: "400",
      children: o.jsx(vS, {
        message: "Starting verification using emoji comparison..."
      })
    });
  }
  function W$e({ sasData: t }) {
    const [e, n] = Et(p.useCallback(() => t.confirm(), [
      t
    ])), r = p.useMemo(() => (t.sas.emoji ?? []).map(([a, s], l) => ({
      id: `emoji-${l}`,
      emoji: a,
      name: s
    })), [
      t
    ]), i = e.status === ve.Loading || e.status === ve.Success;
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          children: "Confirm the emoji below are displayed on both devices, in the same order:"
        }),
        o.jsx(E, {
          className: ro({
            variant: "SurfaceVariant"
          }),
          style: {
            borderRadius: ee.radii.R400,
            padding: ee.space.S500
          },
          gap: "700",
          wrap: "Wrap",
          justifyContent: "Center",
          children: r.map(({ id: a, emoji: s, name: l }) => o.jsxs(E, {
            direction: "Column",
            gap: "100",
            justifyContent: "Center",
            alignItems: "Center",
            children: [
              o.jsx(D, {
                size: "H1",
                children: s
              }),
              o.jsx(D, {
                size: "T200",
                children: l
              })
            ]
          }, a))
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            o.jsx(xe, {
              variant: "Primary",
              fill: "Soft",
              onClick: n,
              disabled: i,
              before: i && o.jsx(dt, {
                size: "100",
                variant: "Primary"
              }),
              children: o.jsx(D, {
                size: "B400",
                children: "They Match"
              })
            }),
            o.jsx(xe, {
              variant: "Primary",
              fill: "Soft",
              onClick: () => t.mismatch(),
              disabled: i,
              children: o.jsx(D, {
                size: "B400",
                children: "Do not Match"
              })
            })
          ]
        })
      ]
    });
  }
  function q$e({ verifier: t, onCancel: e }) {
    const [n, r] = p.useState();
    return L$e(t, r), O$e(t, e), p.useEffect(() => {
      t.verify();
    }, [
      t
    ]), n ? o.jsx(W$e, {
      sasData: n
    }) : o.jsx(E, {
      direction: "Column",
      gap: "400",
      children: o.jsx(vS, {
        message: "Starting verification using emoji comparison..."
      })
    });
  }
  function K$e({ onExit: t }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx("div", {
          children: o.jsx(D, {
            children: "Your device is verified."
          })
        }),
        o.jsx(xe, {
          variant: "Primary",
          fill: "Solid",
          onClick: t,
          children: o.jsx(D, {
            size: "B400",
            children: "Okay"
          })
        })
      ]
    });
  }
  function G$e({ onClose: t }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          children: "Verification has been canceled."
        }),
        o.jsx(xe, {
          variant: "Secondary",
          fill: "Soft",
          onClick: t,
          children: o.jsx(D, {
            size: "B400",
            children: "Close"
          })
        })
      ]
    });
  }
  function ude({ request: t, onExit: e }) {
    const n = M$e(t), r = p.useCallback(() => {
      t.phase !== hu.Done && t.phase !== hu.Cancelled && t.cancel(), e();
    }, [
      t,
      e
    ]), i = p.useCallback(() => t.accept(), [
      t
    ]), a = p.useCallback(async () => {
      await t.startVerification(JCe.Sas);
    }, [
      t
    ]);
    return p.useEffect(() => {
      n === hu.Done ? Vr("sable.crypto.verification_outcome", 1, {
        attributes: {
          outcome: "completed"
        }
      }) : n === hu.Cancelled && Vr("sable.crypto.verification_outcome", 1, {
        attributes: {
          outcome: "cancelled"
        }
      });
    }, [
      n
    ]), o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            clickOutsideDeactivates: false,
            escapeDeactivates: false
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: N$e,
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Device Verification"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    radii: "300",
                    onClick: r,
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  n === hu.Requested && (t.initiatedByMe ? o.jsx(U$e, {}) : o.jsx(V$e, {
                    onAccept: i
                  })),
                  n === hu.Ready && (t.initiatedByMe ? o.jsx($$e, {
                    onStart: a
                  }) : o.jsx(H$e, {})),
                  n === hu.Started && (t.verifier ? o.jsx(q$e, {
                    verifier: t.verifier,
                    onCancel: r
                  }) : o.jsx(z$e, {
                    message: "Unexpected Error! Verification is started but verifier is missing.",
                    onClose: r
                  })),
                  n === hu.Done && o.jsx(K$e, {
                    onExit: e
                  }),
                  n === hu.Cancelled && o.jsx(G$e, {
                    onClose: r
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function Y$e() {
    const [t, e] = p.useState();
    B$e(e);
    const n = p.useCallback(() => {
      e(void 0);
    }, []);
    return !t || !t.isSelfVerification ? null : o.jsx(ude, {
      request: t,
      onExit: n
    });
  }
  function Z$e(t, e, n, r) {
    return {
      authData: t,
      callback: async (a) => {
        const [s, l] = await ca(e(a));
        if (s instanceof Un && s.httpStatus === 401) return [
          s.data,
          void 0
        ];
        if (s) throw r(s), s;
        return n(l), [
          void 0,
          l
        ];
      },
      cancelCallback: r
    };
  }
  function hde({ onComplete: t }) {
    const e = be(), n = Kr(), [r, i] = p.useState(), [a, s] = p.useState(), l = p.useCallback(async (m) => {
      if (!r) throw new Error("Unexpected Error! UIA action is perform without data.");
      n() && s(null);
      const [v] = await r.callback(m);
      n() && v && s(v);
    }, [
      r,
      n
    ]), c = p.useCallback(() => {
      n() && (i(void 0), s(void 0));
    }, [
      n
    ]), d = p.useCallback((m) => new Promise((v, y) => {
      m(null).then(() => {
        v(), c();
      }).catch((w) => {
        if (w instanceof Un && w.httpStatus === 401) {
          const b = w.data, j = Z$e(b, m, v, (k) => {
            c(), y(k);
          });
          n() ? i(j) : y(new Error("Authentication failed! Failed to setup device verification."));
          return;
        }
        y(w);
      });
    }), [
      n,
      c
    ]), [u, h] = Et(p.useCallback(async (m) => {
      const v = e.getCrypto();
      if (!v) throw new Error("Unexpected Error! Crypto module not found!");
      const y = await v.createRecoveryKeyFromPassphrase(m);
      if (!y.encodedPrivateKey) throw new Error("Unexpected Error! Failed to create recovery key.");
      yEe(), await v.bootstrapSecretStorage({
        createSecretStorageKey: async () => y,
        setupNewSecretStorage: true
      }), await v.bootstrapCrossSigning({
        authUploadDeviceSigningKeys: d,
        setupNewCrossSigning: true
      }), await v.resetKeyBackup(), t(y.encodedPrivateKey);
    }, [
      e,
      t,
      d
    ])), f = u.status === ve.Loading, g = (m) => {
      var _a6;
      if (m.preventDefault(), f) return;
      const y = (_a6 = m.target) == null ? void 0 : _a6.passphraseInput;
      let w;
      y && y.value.length > 0 && (w = y.value), h(w);
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: g,
      direction: "Column",
      gap: "400",
      children: [
        o.jsxs(D, {
          size: "T300",
          children: [
            "Generate a ",
            o.jsx("b", {
              children: "Recovery Key"
            }),
            " for verifying identity if you do not have access to other devices. Additionally, setup a passphrase as a memorable alternative."
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Passphrase (Optional)"
            }),
            o.jsx(Yl, {
              name: "passphraseInput",
              size: "400",
              readOnly: f
            })
          ]
        }),
        o.jsx(xe, {
          type: "submit",
          disabled: f,
          before: f && o.jsx(dt, {
            size: "200",
            variant: "Primary",
            fill: "Solid"
          }),
          children: o.jsx(D, {
            size: "B400",
            children: "Continue"
          })
        }),
        u.status === ve.Error && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: o.jsx("b", {
            children: u.error ? u.error.message : "Unexpected Error!"
          })
        }),
        a !== null && r && o.jsx(sde, {
          authData: a ?? r.authData,
          unsupported: () => o.jsx(D, {
            size: "T200",
            children: "Authentication steps to perform this action are not supported by client."
          }),
          children: (m) => o.jsx(ade, {
            authData: a ?? r.authData,
            ongoingFlow: m,
            action: l,
            onCancel: r.cancelCallback
          })
        })
      ]
    });
  }
  function fde({ recoveryKey: t }) {
    const [e, n] = p.useState(false), r = () => {
      Jo(t);
    }, i = () => {
      const s = new Blob([
        t
      ], {
        type: "text/plain;charset=us-ascii"
      });
      ap.saveAs(s, "recovery-key.txt");
    }, a = e ? t : t.replaceAll(/[^\s]/g, "*");
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(D, {
          size: "T300",
          children: "Store the Recovery Key in a safe place for future use, as you will need it to verify your identity if you do not have access to other devices."
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Recovery Key"
            }),
            o.jsxs(E, {
              className: ro({
                variant: "SurfaceVariant"
              }),
              style: {
                padding: ee.space.S300,
                borderRadius: ee.radii.R400
              },
              alignItems: "Center",
              justifyContent: "Center",
              gap: "400",
              children: [
                o.jsx(D, {
                  style: {
                    fontFamily: "var(--font-monospace)"
                  },
                  size: "T200",
                  priority: "300",
                  children: a
                }),
                o.jsx(Qe, {
                  onClick: () => n(!e),
                  variant: "Secondary",
                  radii: "Pill",
                  children: o.jsx(D, {
                    size: "B300",
                    children: e ? "Hide" : "Show"
                  })
                })
              ]
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            o.jsx(xe, {
              onClick: r,
              children: o.jsx(D, {
                size: "B400",
                children: "Copy"
              })
            }),
            o.jsx(xe, {
              onClick: i,
              fill: "Soft",
              children: o.jsx(D, {
                size: "B400",
                children: "Download"
              })
            })
          ]
        })
      ]
    });
  }
  const J$e = p.forwardRef(({ onCancel: t }, e) => {
    const [n, r] = p.useState();
    return o.jsxs(lr, {
      ref: e,
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
            borderBottomWidth: ee.borderWidth.B300
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "Setup Device Verification"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              radii: "300",
              onClick: t,
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsx(E, {
          style: {
            padding: ee.space.S400
          },
          direction: "Column",
          gap: "400",
          children: n ? o.jsx(fde, {
            recoveryKey: n
          }) : o.jsx(hde, {
            onComplete: r
          })
        })
      ]
    });
  }), X$e = p.forwardRef(({ onCancel: t }, e) => {
    const [n, r] = p.useState(false);
    return o.jsxs(lr, {
      ref: e,
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
            borderBottomWidth: ee.borderWidth.B300
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "Reset Device Verification"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              radii: "300",
              onClick: t,
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        n ? o.jsx(E, {
          style: {
            padding: ee.space.S400
          },
          direction: "Column",
          gap: "400",
          children: o.jsx(Hi, {
            initial: void 0,
            children: (i, a) => i ? o.jsx(fde, {
              recoveryKey: i
            }) : o.jsx(hde, {
              onComplete: a
            })
          })
        }) : o.jsxs(E, {
          style: {
            padding: ee.space.S400
          },
          direction: "Column",
          gap: "400",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "200",
              children: [
                o.jsx(D, {
                  size: "H1",
                  children: "\u270B\u{1F9D1}\u200D\u{1F692}\u{1F91A}"
                }),
                o.jsx(D, {
                  size: "T300",
                  children: "Resetting device verification is permanent."
                }),
                o.jsxs(D, {
                  size: "T300",
                  children: [
                    "Anyone you have verified with will see security alerts and your encryption backup will be lost. You almost certainly do not want to do this, unless you have lost",
                    " ",
                    o.jsx("b", {
                      children: "Recovery Key"
                    }),
                    " or ",
                    o.jsx("b", {
                      children: "Recovery Passphrase"
                    }),
                    " and every device you can verify from."
                  ]
                })
              ]
            }),
            o.jsx(xe, {
              variant: "Critical",
              onClick: () => r(true),
              children: o.jsx(D, {
                size: "B400",
                children: "Reset"
              })
            })
          ]
        })
      ]
    });
  });
  function Q$e({ verificationStatus: t, otherUnverifiedCount: e }) {
    return t === Wu.Unknown || typeof e != "number" ? o.jsx(dt, {
      size: "400",
      variant: "Secondary"
    }) : t === Wu.Unverified ? o.jsx(Rn, {
      variant: "Critical",
      fill: "Solid",
      size: "500",
      children: o.jsx(D, {
        size: "L400",
        children: "Unverified"
      })
    }) : e > 0 ? o.jsx(Rn, {
      variant: "Warning",
      fill: "Solid",
      size: "500",
      children: o.jsxs(D, {
        size: "L400",
        children: [
          e,
          " Unverified"
        ]
      })
    }) : o.jsx(Rn, {
      variant: "Success",
      fill: "Solid",
      size: "500",
      children: o.jsx(D, {
        size: "L400",
        children: "Verified"
      })
    });
  }
  function eWe() {
    return o.jsxs(E, {
      direction: "Column",
      children: [
        o.jsx(D, {
          size: "T200",
          children: "Steps to verify from other device."
        }),
        o.jsx(D, {
          as: "div",
          size: "T200",
          children: o.jsxs("ul", {
            style: {
              margin: `${ee.space.S100} 0`
            },
            children: [
              o.jsx("li", {
                children: "Open your other verified device."
              }),
              o.jsxs("li", {
                children: [
                  "Open ",
                  o.jsx("i", {
                    children: "Settings"
                  }),
                  "."
                ]
              }),
              o.jsxs("li", {
                children: [
                  "Find this device in ",
                  o.jsx("i", {
                    children: "Devices/Sessions"
                  }),
                  " section."
                ]
              }),
              o.jsx("li", {
                children: "Initiate verification."
              })
            ]
          })
        }),
        o.jsxs(D, {
          size: "T200",
          children: [
            "If you do not have any verified device press the ",
            o.jsx("i", {
              children: '"Verify Manually"'
            }),
            " button."
          ]
        })
      ]
    });
  }
  function tWe({ secretStorageKeyId: t, secretStorageKeyContent: e }) {
    const [n, r] = p.useState(false), [i, a] = p.useState(false), s = () => a(false);
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Lf, {
          variant: "Critical",
          title: "Unverified",
          description: o.jsxs(o.Fragment, {
            children: [
              "Start verification from other device or verify manually.",
              " ",
              o.jsx(D, {
                as: "a",
                size: "T200",
                onClick: () => r(!n),
                children: o.jsx("b", {
                  children: n ? "View Less" : "Learn More"
                })
              })
            ]
          }),
          after: !i && o.jsx(xe, {
            size: "300",
            variant: "Critical",
            fill: "Soft",
            radii: "300",
            outlined: true,
            onClick: () => a(true),
            children: o.jsx(D, {
              as: "span",
              size: "B300",
              children: "Verify Manually"
            })
          }),
          children: n && o.jsx(eWe, {})
        }),
        i && o.jsx(I$e, {
          secretStorageKeyId: t,
          secretStorageKeyContent: e,
          options: o.jsx(Qe, {
            type: "button",
            variant: "Secondary",
            fill: "Soft",
            radii: "Pill",
            onClick: s,
            children: o.jsx(Q, {
              size: "100",
              src: q.Cross
            })
          })
        })
      ]
    });
  }
  function nWe({ crypto: t, deviceId: e }) {
    const n = be(), [r, i] = p.useState({
      status: ve.Idle
    }), a = YE(p.useCallback(() => t.requestDeviceVerification(n.getSafeUserId(), e), [
      n,
      t,
      e
    ]), i), s = p.useCallback(() => {
      i({
        status: ve.Idle
      });
    }, []), l = r.status === ve.Loading;
    return o.jsxs(Lf, {
      variant: "Warning",
      title: "Unverified",
      description: "Verify device identity and grant access to encrypted messages.",
      after: o.jsx(xe, {
        size: "300",
        variant: "Warning",
        radii: "300",
        onClick: a,
        before: l && o.jsx(dt, {
          size: "100",
          variant: "Warning",
          fill: "Solid"
        }),
        disabled: l,
        children: o.jsx(D, {
          as: "span",
          size: "B300",
          children: "Verify"
        })
      }),
      children: [
        r.status === ve.Error && o.jsx(D, {
          size: "T200",
          children: r.error.message
        }),
        r.status === ve.Success && o.jsx(ude, {
          request: r.data,
          onExit: s
        })
      ]
    });
  }
  function rWe({ visible: t }) {
    const [e, n] = p.useState(false), r = p.useCallback(() => n(false), []);
    return o.jsxs(o.Fragment, {
      children: [
        t && o.jsx(xe, {
          size: "300",
          radii: "300",
          onClick: () => n(true),
          children: o.jsx(D, {
            as: "span",
            size: "B300",
            children: "Enable"
          })
        }),
        e && o.jsx(Hn, {
          open: true,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                clickOutsideDeactivates: false,
                escapeDeactivates: false
              },
              children: o.jsx(J$e, {
                onCancel: r
              })
            })
          })
        })
      ]
    });
  }
  function iWe() {
    const [t, e] = p.useState(), n = cde(), r = dde(), [i, a] = p.useState(false), s = p.useCallback(() => {
      a(false);
    }, []), l = (d) => {
      e(d.currentTarget.getBoundingClientRect());
    }, c = () => {
      if (e(void 0), n) {
        const d = n.account_management_uri ?? n.issuer;
        window.open(gl(d, {
          action: r.crossSigningReset
        }), "_blank");
        return;
      }
      a(true);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Oe, {
          "aria-pressed": !!t,
          variant: "SurfaceVariant",
          size: "300",
          radii: "300",
          onClick: l,
          children: o.jsx(Q, {
            size: "100",
            src: q.VerticalDots
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "Center",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (d) => d.key === "ArrowDown" || d.key === "ArrowRight",
              isKeyBackward: (d) => d.key === "ArrowUp" || d.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: o.jsx(Ye, {
                  variant: "Critical",
                  onClick: c,
                  size: "300",
                  radii: "300",
                  fill: "None",
                  children: o.jsx(D, {
                    as: "span",
                    size: "T300",
                    truncate: true,
                    children: "Reset"
                  })
                })
              })
            })
          })
        }),
        i && o.jsx(Hn, {
          open: true,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                clickOutsideDeactivates: false,
                escapeDeactivates: false
              },
              children: o.jsx(X$e, {
                onCancel: s
              })
            })
          })
        })
      ]
    });
  }
  function oWe({ devices: t, refreshDeviceList: e, showVerification: n }) {
    const r = be(), i = r.getCrypto(), a = cde(), s = dde(), [l, c] = p.useState(/* @__PURE__ */ new Set()), d = p.useCallback(() => {
      const k = (a == null ? void 0 : a.account_management_uri) ?? (a == null ? void 0 : a.issuer);
      k && window.open(gl(k, {
        action: s.sessionsList
      }), "_blank");
    }, [
      a,
      s
    ]), u = p.useCallback((k) => {
      const C = (a == null ? void 0 : a.account_management_uri) ?? (a == null ? void 0 : a.issuer);
      C && window.open(gl(C, {
        action: s.sessionEnd,
        device_id: k
      }), "_blank");
    }, [
      a,
      s
    ]), h = p.useCallback((k) => {
      c((C) => {
        const x = new Set(C);
        return x.has(k) ? x.delete(k) : x.add(k), x;
      });
    }, []), [f, g] = p.useState({
      status: ve.Idle
    }), m = YE(p.useCallback(async (k) => {
      await r.deleteMultipleDevices(Array.from(l), k);
    }, [
      r,
      l
    ]), p.useCallback((k) => {
      k.status === ve.Success && (c(/* @__PURE__ */ new Set()), e()), g(k);
    }, [
      e
    ])), [v, y] = t$e(f.status === ve.Error ? f.error : void 0), w = f.status === ve.Loading || v !== void 0, b = () => c(/* @__PURE__ */ new Set()), j = p.useCallback(() => {
      g({
        status: ve.Idle
      });
    }, []);
    return t.length > 0 ? o.jsxs(o.Fragment, {
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Others"
            }),
            a && o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Device Dashboard",
                focusId: "device-dashboard",
                description: "Manage your devices on OIDC dashboard.",
                after: o.jsx(xe, {
                  size: "300",
                  variant: "Secondary",
                  fill: "Soft",
                  radii: "300",
                  outlined: true,
                  onClick: d,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Open"
                  })
                })
              })
            }),
            t.toSorted((k, C) => !k.last_seen_ts || !C.last_seen_ts ? 0 : k.last_seen_ts < C.last_seen_ts ? 1 : -1).map((k) => o.jsxs(Te, {
              className: Xe,
              variant: l.has(k.device_id) ? "Critical" : "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(Xce, {
                  device: k,
                  deleted: l.has(k.device_id),
                  refreshDeviceList: e,
                  disabled: w,
                  options: a ? o.jsx(LY, {
                    deviceId: k.device_id,
                    deleted: false,
                    onDeleteToggle: u
                  }) : o.jsx(LY, {
                    deviceId: k.device_id,
                    deleted: l.has(k.device_id),
                    onDeleteToggle: h,
                    disabled: w
                  })
                }),
                n && i && o.jsx(S$e, {
                  crypto: i,
                  userId: r.getSafeUserId(),
                  deviceId: k.device_id,
                  children: (C) => C === Wu.Unverified && o.jsx(nWe, {
                    crypto: i,
                    deviceId: k.device_id
                  })
                })
              ]
            }, k.device_id))
          ]
        }),
        l.size > 0 && o.jsx(tn, {
          style: {
            position: "sticky",
            padding: ee.space.S200,
            paddingLeft: ee.space.S400,
            bottom: ee.space.S400,
            left: ee.space.S400,
            right: 0,
            zIndex: 1
          },
          variant: "Critical",
          children: o.jsxs(E, {
            alignItems: "Center",
            gap: "400",
            children: [
              o.jsxs(E, {
                grow: "Yes",
                direction: "Column",
                children: [
                  y ? o.jsx(D, {
                    size: "T200",
                    children: o.jsxs("b", {
                      children: [
                        "Failed to logout devices! Please try again. ",
                        y.message
                      ]
                    })
                  }) : o.jsx(D, {
                    size: "T200",
                    children: o.jsxs("b", {
                      children: [
                        "Logout from selected devices. (",
                        l.size,
                        " selected)"
                      ]
                    })
                  }),
                  v && o.jsx(sde, {
                    authData: v,
                    unsupported: () => o.jsx(D, {
                      size: "T200",
                      children: "Authentication steps to perform this action are not supported by client."
                    }),
                    children: (k) => o.jsx(ade, {
                      authData: v,
                      ongoingFlow: k,
                      action: m,
                      onCancel: j
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                shrink: "No",
                gap: "200",
                children: [
                  o.jsx(xe, {
                    size: "300",
                    variant: "Critical",
                    fill: "None",
                    radii: "300",
                    disabled: w,
                    onClick: b,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Cancel"
                    })
                  }),
                  o.jsx(xe, {
                    size: "300",
                    variant: "Critical",
                    radii: "300",
                    disabled: w,
                    before: w && o.jsx(dt, {
                      variant: "Critical",
                      fill: "Solid",
                      size: "100"
                    }),
                    onClick: () => m(),
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Logout"
                    })
                  })
                ]
              })
            ]
          })
        })
      ]
    }) : null;
  }
  function aWe() {
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(WI, {}),
        o.jsx(WI, {})
      ]
    });
  }
  function sWe({ requestBack: t, requestClose: e }) {
    const n = be(), r = n.getCrypto(), i = WB(), [a, s] = Rie(), [l, c] = Iie(a), d = Ek(r, n.getSafeUserId(), l == null ? void 0 : l.device_id), u = Aie(c), h = Bie(r, n.getSafeUserId(), u), f = mHe(), g = gHe(f ?? "");
    return o.jsx(Qc, {
      title: "Devices",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Security"
                    }),
                    o.jsx(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: o.jsx(Ie, {
                        title: "Device Verification",
                        focusId: "device-verification",
                        description: "To verify device identity and grant access to encrypted messages.",
                        after: o.jsxs(o.Fragment, {
                          children: [
                            o.jsx(rWe, {
                              visible: !i
                            }),
                            i && o.jsxs(E, {
                              gap: "200",
                              alignItems: "Center",
                              children: [
                                o.jsx(Q$e, {
                                  verificationStatus: d,
                                  otherUnverifiedCount: h
                                }),
                                o.jsx(iWe, {})
                              ]
                            })
                          ]
                        })
                      })
                    })
                  ]
                }),
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Current"
                    }),
                    l ? o.jsxs(Te, {
                      className: Xe,
                      variant: "SurfaceVariant",
                      direction: "Column",
                      gap: "400",
                      children: [
                        o.jsx(Xce, {
                          device: l,
                          refreshDeviceList: s,
                          options: o.jsx(WHe, {}),
                          children: r && o.jsx(HHe, {
                            crypto: r
                          })
                        }),
                        i && d === Wu.Unverified && f && g && o.jsx(tWe, {
                          secretStorageKeyId: f,
                          secretStorageKeyContent: g
                        }),
                        r && d === Wu.Verified && o.jsx(EHe, {
                          crypto: r
                        })
                      ]
                    }) : o.jsx(WI, {})
                  ]
                }),
                a === void 0 && o.jsx(aWe, {}),
                c && o.jsx(oWe, {
                  devices: c,
                  refreshDeviceList: s,
                  showVerification: i && d === Wu.Verified
                }),
                o.jsx(zHe, {})
              ]
            })
          })
        })
      })
    });
  }
  const Gu = (t, e) => ({
    event: (r, i) => {
      if (t.has(i)) return true;
      const a = va.user(e, i), s = va.event(e, r);
      return a >= s;
    },
    stateEvent: (r, i) => {
      if (t.has(i)) return true;
      const a = va.user(e, i), s = va.state(e, r);
      return a >= s;
    },
    action: (r, i) => {
      if (t.has(i)) return true;
      const a = va.user(e, i), s = va.action(e, r);
      return a >= s;
    },
    notificationAction: (r, i) => {
      if (t.has(i)) return true;
      const a = va.user(e, i), s = va.notification(e, r);
      return a >= s;
    }
  }), Ki = (t, e) => p.useMemo(() => Gu(t, e), [
    t,
    e
  ]);
  var OM = "style_ImagePackImage__1ja32hp0 _1mqalmd1 _1mqalmd0", lWe = "style_DeleteImageShortcode__1ja32hp1 _1mqalmd1 _1mqalmd0", cWe = "style_ImagePackImageInputs__1ja32hp2 _1mqalmd1 _1mqalmd0", dWe = "style_UnsavedMenu__1ja32hp3";
  const LM = () => (e) => {
    const n = e.includes(Hr.Sticker), r = e.includes(Hr.Emoticon);
    return n && r ? "Both" : n ? "Sticker" : r ? "Emoji" : "Both";
  };
  function uWe({ selected: t, onChange: e }) {
    const n = LM(), r = n(t), i = (s) => n(s) === r, a = p.useMemo(() => [
      [
        Hr.Emoticon
      ],
      [
        Hr.Sticker
      ],
      [
        Hr.Sticker,
        Hr.Emoticon
      ]
    ], []);
    return o.jsx(E, {
      direction: "Column",
      gap: "100",
      style: {
        padding: ee.space.S100
      },
      children: a.map((s) => o.jsx(Ye, {
        size: "300",
        variant: i(s) ? "SurfaceVariant" : "Surface",
        "aria-selected": i(s),
        radii: "300",
        onClick: () => e(s),
        children: o.jsx(E, {
          grow: "Yes",
          children: o.jsx(D, {
            size: "T300",
            children: n(s)
          })
        })
      }, n(s)))
    });
  }
  function mde({ usage: t, onChange: e, canEdit: n }) {
    const r = LM(), [i, a] = p.useState(), s = (l) => {
      a(l.currentTarget.getBoundingClientRect());
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          variant: "Secondary",
          fill: "Soft",
          size: "300",
          radii: "300",
          type: "button",
          outlined: true,
          "aria-disabled": !n,
          after: n && o.jsx(Q, {
            src: q.ChevronBottom,
            size: "100"
          }),
          onClick: n ? s : void 0,
          children: o.jsx(D, {
            size: "B300",
            children: r(t)
          })
        }),
        o.jsx(ln, {
          anchor: i,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => a(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(uWe, {
                selected: t,
                onChange: (l) => {
                  a(void 0), e(l);
                }
              })
            })
          })
        })
      ]
    });
  }
  function hWe({ defaultShortcode: t, image: e, packUsage: n, useAuthentication: r, canEdit: i, onEdit: a, onDeleteToggle: s, deleted: l }) {
    const c = be(), d = LM();
    return o.jsx(Ie, {
      before: o.jsx("img", {
        className: OM,
        src: Cn(c, e.url, r) ?? "",
        alt: e.shortcode,
        loading: "lazy"
      }),
      title: l ? o.jsx("span", {
        className: lWe,
        children: e.shortcode
      }) : e.shortcode,
      description: o.jsxs(E, {
        as: "span",
        gap: "200",
        children: [
          e.usage && d(e.usage) !== d(n) && o.jsx(Rn, {
            as: "span",
            variant: "Secondary",
            size: "400",
            radii: "300",
            outlined: true,
            children: o.jsx(D, {
              as: "span",
              size: "L400",
              children: d(e.usage)
            })
          }),
          e.body
        ]
      }),
      after: i ? o.jsxs(E, {
        shrink: "No",
        alignItems: "Center",
        gap: "200",
        children: [
          o.jsx(Qe, {
            variant: l ? "Critical" : "Secondary",
            fill: "None",
            radii: "Pill",
            onClick: () => s == null ? void 0 : s(t),
            children: l ? o.jsx(D, {
              size: "B300",
              children: "Undo"
            }) : o.jsx(Q, {
              size: "50",
              src: q.Delete
            })
          }),
          !l && o.jsx(Qe, {
            variant: "Secondary",
            radii: "Pill",
            onClick: () => a == null ? void 0 : a(t, e),
            children: o.jsx(D, {
              size: "B300",
              children: "Edit"
            })
          })
        ]
      }) : void 0
    });
  }
  function fWe({ file: t, children: e }) {
    const n = Xl(t), r = p.useMemo(() => Yd(t), [
      t
    ]);
    return o.jsx(Ie, {
      before: o.jsx("img", {
        className: OM,
        src: n,
        alt: t.name
      }),
      children: e(r)
    });
  }
  function mWe({ defaultShortcode: t, useAuthentication: e, packUsage: n, image: r, onCancel: i, onSave: a }) {
    const s = be(), l = r.usage ?? n, [c, d] = p.useState(l), u = (h) => {
      h.preventDefault();
      const f = h.target, g = f == null ? void 0 : f.shortcodeInput, m = f == null ? void 0 : f.bodyInput;
      if (!g || !m) return;
      const v = Og(g.value.trim()), y = m.value.trim() || void 0, w = c;
      if (!v) return;
      if (v === r.shortcode && y === r.body && EA(w, l)) {
        i(t);
        return;
      }
      const b = new Jg(v, r.url, {
        info: r.info,
        body: y,
        usage: EA(w, n) ? void 0 : w
      });
      a(t, b);
    };
    return o.jsx(Ie, {
      before: o.jsx("img", {
        className: OM,
        src: Cn(s, r.url, e) ?? "",
        alt: r.shortcode,
        loading: "lazy"
      }),
      children: o.jsxs(E, {
        as: "form",
        onSubmit: u,
        direction: "Column",
        gap: "200",
        children: [
          o.jsxs(E, {
            direction: "Column",
            className: cWe,
            children: [
              o.jsx(mn, {
                before: o.jsx(D, {
                  size: "L400",
                  children: "Shortcode:"
                }),
                defaultValue: r.shortcode,
                name: "shortcodeInput",
                variant: "Secondary",
                size: "300",
                radii: "0",
                required: true,
                autoFocus: true
              }),
              o.jsx(mn, {
                before: o.jsx(D, {
                  size: "L400",
                  children: "Body:"
                }),
                defaultValue: r.body,
                name: "bodyInput",
                variant: "Secondary",
                size: "300",
                radii: "0"
              })
            ]
          }),
          o.jsxs(E, {
            gap: "200",
            children: [
              o.jsx(E, {
                shrink: "No",
                direction: "Column",
                children: o.jsx(mde, {
                  usage: c,
                  onChange: d,
                  canEdit: true
                })
              }),
              o.jsx(E, {
                grow: "Yes"
              }),
              o.jsx(xe, {
                type: "submit",
                variant: "Success",
                size: "300",
                radii: "300",
                children: o.jsx(D, {
                  size: "B300",
                  children: "Save"
                })
              }),
              o.jsx(xe, {
                type: "reset",
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: () => i(t),
                children: o.jsx(D, {
                  size: "B300",
                  children: "Cancel"
                })
              })
            ]
          })
        ]
      })
    });
  }
  function gde({ url: t, name: e }) {
    return o.jsx(xn, {
      size: "500",
      className: ro({
        variant: "Secondary"
      }),
      children: t ? o.jsx(Xu, {
        src: t,
        alt: e ?? "Unknown"
      }) : o.jsx(mp, {
        children: o.jsx(D, {
          size: "H2",
          children: Vi(e ?? "Unknown")
        })
      })
    });
  }
  function gWe({ meta: t, canEdit: e, onEdit: n }) {
    const r = be(), i = hn(), a = t.avatar ? Cn(r, t.avatar, i) ?? void 0 : void 0;
    return o.jsxs(E, {
      gap: "400",
      children: [
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          gap: "300",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  className: Pi,
                  size: "H5",
                  children: t.name ?? "Unknown"
                }),
                t.attribution && o.jsx(D, {
                  className: Pi,
                  size: "T200",
                  children: o.jsx(nF, {
                    options: fs,
                    children: t.attribution
                  })
                })
              ]
            }),
            e && o.jsx(E, {
              gap: "200",
              children: o.jsx(Qe, {
                variant: "Secondary",
                fill: "Soft",
                radii: "300",
                before: o.jsx(Q, {
                  size: "50",
                  src: q.Pencil
                }),
                onClick: n,
                outlined: true,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Edit"
                })
              })
            })
          ]
        }),
        o.jsx(E, {
          shrink: "No",
          children: o.jsx(gde, {
            url: a,
            name: t.name
          })
        })
      ]
    });
  }
  function pWe({ meta: t, onCancel: e, onSave: n }) {
    const r = be(), i = hn(), [a, s] = p.useState(t.avatar), l = a ? Cn(r, a, i) ?? void 0 : void 0, [c, d] = p.useState(), u = Xl(c), h = u ? a === t.avatar : false, f = p.useMemo(() => {
      if (c) return Yd(c);
    }, [
      c
    ]), g = ed(d, false), m = p.useCallback(() => {
      d(void 0), s(t.avatar);
    }, [
      t.avatar
    ]), v = p.useCallback((w) => {
      s(w.mxc);
    }, []), y = (w) => {
      if (w.preventDefault(), h) return;
      const b = w.target, j = b == null ? void 0 : b.nameInput, k = b == null ? void 0 : b.attributionTextArea;
      if (!j || !k) return;
      const C = j.value.trim(), x = k.value.trim();
      if (!C) return;
      const S = new l4({
        avatar_url: a,
        display_name: C,
        attribution: x
      });
      n(S);
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: y,
      direction: "Column",
      gap: "400",
      children: [
        o.jsxs(E, {
          gap: "400",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Pack Avatar"
                }),
                f ? o.jsx(E, {
                  gap: "200",
                  direction: "Column",
                  children: o.jsx(xh, {
                    uploadAtom: f,
                    onRemove: m,
                    onComplete: v
                  })
                }) : o.jsxs(E, {
                  gap: "200",
                  children: [
                    o.jsx(xe, {
                      type: "button",
                      size: "300",
                      variant: "Secondary",
                      fill: "Soft",
                      radii: "300",
                      onClick: () => g("image/*"),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Upload"
                      })
                    }),
                    !a && t.avatar && o.jsx(xe, {
                      type: "button",
                      size: "300",
                      variant: "Success",
                      fill: "None",
                      radii: "300",
                      onClick: () => s(t.avatar),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Reset"
                      })
                    }),
                    a && o.jsx(xe, {
                      type: "button",
                      size: "300",
                      variant: "Critical",
                      fill: "None",
                      radii: "300",
                      onClick: () => s(void 0),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Remove"
                      })
                    })
                  ]
                })
              ]
            }),
            o.jsx(E, {
              shrink: "No",
              children: o.jsx(gde, {
                url: u ?? l,
                name: t.name
              })
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Inherit",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Name"
            }),
            o.jsx(mn, {
              name: "nameInput",
              defaultValue: t.name,
              variant: "Secondary",
              radii: "300",
              required: true
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Inherit",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Attribution"
            }),
            o.jsx(js, {
              name: "attributionTextArea",
              defaultValue: t.attribution,
              variant: "Secondary",
              radii: "300"
            })
          ]
        }),
        o.jsxs(E, {
          gap: "300",
          children: [
            o.jsx(xe, {
              type: "submit",
              variant: "Success",
              size: "300",
              radii: "300",
              disabled: h,
              children: o.jsx(D, {
                size: "B300",
                children: "Save"
              })
            }),
            o.jsx(xe, {
              type: "reset",
              onClick: e,
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              radii: "300",
              children: o.jsx(D, {
                size: "B300",
                children: "Cancel"
              })
            })
          ]
        })
      ]
    });
  }
  const pde = ft(({ imagePack: t, canEdit: e, onUpdate: n, ...r }, i) => {
    const a = hn(), [s, l] = p.useState(false), [c, d] = p.useState(), u = c ?? t.meta, h = p.useMemo(() => Array.from(t.images.collection.values()), [
      t
    ]), [f, g] = p.useState([]), [m, v] = p.useState([]), [y, w] = p.useState(/* @__PURE__ */ new Set()), [b, j] = p.useState(/* @__PURE__ */ new Map()), [k, C] = p.useState(/* @__PURE__ */ new Set()), x = p.useCallback((ie) => t.images.collection.has(ie) || m.find((X) => X.shortcode === ie) !== void 0 ? true : Array.from(b).find(([, X]) => X.shortcode === ie) !== void 0, [
      t,
      b,
      m
    ]), S = ed(p.useCallback((ie) => {
      const de = ie.map((ne) => {
        const ae = Og(ne.name);
        if (x(ae)) {
          const X = yR(ae, x);
          return FW(ne, X);
        }
        return ae !== ne.name ? FW(ne, ae) : ne;
      });
      g((ne) => [
        ...ne,
        ...de
      ]);
    }, [
      x
    ]), true), T = p.useCallback((ie) => {
      l(false), d((de) => new l4({
        ...t.meta.content,
        ...de == null ? void 0 : de.content,
        ...ie.content
      }));
    }, [
      t.meta
    ]), A = () => l(false), B = p.useCallback((ie) => {
      d((de) => new l4({
        ...t.meta.content,
        ...de == null ? void 0 : de.content,
        usage: ie
      }));
    }, [
      t.meta
    ]), U = p.useCallback((ie) => {
      g((de) => de.filter((ne) => ne !== ie));
    }, []), z = p.useCallback(async (ie) => {
      const de = await oP(Zie(ie.file)), ne = {
        url: ie.mxc,
        info: LB(de, ie.file)
      }, ae = Jg.fromPackImage(WTe(ie.file.name), ne);
      ae && (U(ie.file), v((X) => [
        ae,
        ...X
      ]));
    }, [
      U
    ]), O = (ie) => {
      w((de) => {
        const ne = new Set(de);
        return ne.add(ie), ne;
      });
    }, M = (ie) => {
      C((de) => {
        const ne = new Set(de);
        return ne.has(ie) ? ne.delete(ie) : ne.add(ie), ne;
      });
    }, I = (ie) => {
      w((de) => {
        const ne = new Set(de);
        return ne.delete(ie), ne;
      });
    }, N = (ie, de) => {
      I(ie);
      const ne = ie !== de.shortcode && x(de.shortcode) ? new Jg(yR(de.shortcode, x), de.url, de.content) : de;
      j((ae) => {
        const X = new Map(ae);
        return X.set(ie, ne), X;
      });
    }, L = () => {
      d(void 0), g([]), v([]), j(/* @__PURE__ */ new Map()), C(/* @__PURE__ */ new Set());
    }, [H, V] = Et(p.useCallback(async () => {
      const ie = {
        pack: (c == null ? void 0 : c.content) ?? t.meta.content,
        images: {}
      }, de = (ne) => {
        if (k.has(ne.shortcode) || !ie.images) return;
        const ae = b.get(ne.shortcode) ?? ne;
        ie.images[ae.shortcode] = ae.content;
      };
      return m.forEach((ne) => de(ne)), h.forEach((ne) => de(ne)), n == null ? void 0 : n(ie);
    }, [
      t,
      h,
      c,
      m,
      b,
      k,
      n
    ]));
    p.useEffect(() => {
      H.status === ve.Success && L();
    }, [
      H
    ]);
    const Z = c && !Y4e(t.meta, c) || m.length > 0 || b.size > 0 || k.size > 0, Y = !s && y.size === 0 && f.length === 0, oe = H.status === ve.Loading, ue = (ie) => o.jsx(Te, {
      style: {
        padding: ee.space.S300
      },
      variant: k.has(ie.shortcode) ? "Critical" : "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: y.has(ie.shortcode) ? o.jsx(mWe, {
        defaultShortcode: ie.shortcode,
        image: b.get(ie.shortcode) ?? ie,
        packUsage: u.usage,
        useAuthentication: a,
        onCancel: I,
        onSave: N
      }) : o.jsx(hWe, {
        defaultShortcode: ie.shortcode,
        image: b.get(ie.shortcode) ?? ie,
        packUsage: u.usage,
        useAuthentication: a,
        canEdit: e,
        onEdit: O,
        deleted: k.has(ie.shortcode),
        onDeleteToggle: M
      })
    }, ie.shortcode);
    return o.jsxs(E, {
      grow: "Yes",
      direction: "Column",
      gap: "700",
      ...r,
      ref: i,
      children: [
        Z && o.jsx(tn, {
          className: dWe,
          variant: "Success",
          children: o.jsxs(E, {
            alignItems: "Center",
            gap: "400",
            children: [
              o.jsx(E, {
                grow: "Yes",
                direction: "Column",
                children: H.status === ve.Error ? o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Failed to apply changes! Please try again."
                  })
                }) : o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Changes saved! Apply when ready."
                  })
                })
              }),
              o.jsxs(E, {
                shrink: "No",
                gap: "200",
                children: [
                  o.jsx(xe, {
                    size: "300",
                    variant: "Success",
                    fill: "None",
                    radii: "300",
                    disabled: !Y || oe,
                    onClick: L,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Reset"
                    })
                  }),
                  o.jsx(xe, {
                    size: "300",
                    variant: "Success",
                    radii: "300",
                    disabled: !Y || oe,
                    before: oe && o.jsx(dt, {
                      variant: "Success",
                      fill: "Solid",
                      size: "100"
                    }),
                    onClick: V,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Apply Changes"
                    })
                  })
                ]
              })
            ]
          })
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Pack"
            }),
            o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: s ? o.jsx(pWe, {
                meta: u,
                onCancel: A,
                onSave: T
              }) : o.jsx(gWe, {
                meta: u,
                canEdit: e,
                onEdit: () => l(true)
              })
            }),
            o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Images Usage",
                description: "Select how the images are being used: as emojis, as stickers, or as both.",
                after: o.jsx(mde, {
                  usage: u.usage,
                  canEdit: e,
                  onChange: B
                })
              })
            })
          ]
        }),
        h.length === 0 && !e ? null : o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Images"
            }),
            e && o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Upload Images",
                description: "Select images from your storage to upload them in pack.",
                after: o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  size: "300",
                  radii: "300",
                  type: "button",
                  outlined: true,
                  onClick: () => S("image/*"),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Select"
                  })
                })
              })
            }),
            f.map((ie) => o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(fWe, {
                file: ie,
                children: (de) => o.jsx(xh, {
                  uploadAtom: de,
                  onRemove: U,
                  onComplete: z
                })
              })
            }, ie.name)),
            m.map(ue),
            h.map(ue)
          ]
        })
      ]
    });
  });
  function FWe({ room: t, stateKey: e }) {
    const n = be(), r = n.getUserId(), i = Mo(t), a = ri(t), l = Ki(a, i).stateEvent(Pn.PoniesRoomEmotes, r), c = p.useMemo(() => {
      const h = nte(4);
      return new gh(h, {}, {
        roomId: t.roomId,
        stateKey: e
      });
    }, [
      t.roomId,
      e
    ]), d = tMe(t, e) ?? c, u = p.useCallback(async (h) => {
      const { address: f } = d;
      f && await n.sendStateEvent(f.roomId, Pn.PoniesRoomEmotes, h, f.stateKey);
    }, [
      n,
      d
    ]);
    return o.jsx(pde, {
      imagePack: d,
      canEdit: l,
      onUpdate: u
    });
  }
  function vWe() {
    const t = be(), e = p.useMemo(() => new gh(t.getUserId() ?? "", {}, void 0), [
      t
    ]), n = uM(), r = p.useCallback(async (i) => {
      await t.setAccountData(Zr.PoniesUserEmotes, i);
    }, [
      t
    ]);
    return o.jsx(pde, {
      imagePack: n ?? e,
      canEdit: true,
      onUpdate: r
    });
  }
  function Fde({ address: t, requestClose: e }) {
    const n = be(), r = t && n.getRoom(t.roomId);
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          balance: true,
          children: o.jsxs(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                alignItems: "Inherit",
                grow: "Yes",
                gap: "200",
                children: o.jsx(Qe, {
                  size: "500",
                  radii: "Pill",
                  onClick: e,
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowLeft
                  }),
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Emojis & Stickers"
                  })
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: e,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: r && t ? o.jsx(FWe, {
                room: r,
                stateKey: t.stateKey
              }) : o.jsx(vWe, {})
            })
          })
        })
      ]
    });
  }
  function _We({ packs: t, useAuthentication: e, onSelect: n }) {
    const r = be(), i = p.useMemo(() => {
      const h = /* @__PURE__ */ new Map();
      return t.filter((f) => !f.deleted).forEach((f) => {
        if (!f.address) return;
        const g = h.get(f.address.roomId) ?? [];
        g.push(f), h.set(f.address.roomId, g);
      }), h;
    }, [
      t
    ]), [a, s] = p.useState([]), l = (h) => {
      s((f) => {
        const g = f.filter((m) => !Ll(m, h));
        return g.length !== f.length || g.push(h), g;
      });
    }, c = (h) => {
      s((f) => {
        const g = Array.from(f);
        return h.forEach((m) => {
          g.find((v) => Ll(v, m)) || g.push(m);
        }), g;
      });
    }, d = (h) => {
      s((f) => f.filter((m) => !h.find((v) => Ll(m, v))));
    }, u = a.length > 0;
    return o.jsxs(E, {
      grow: "Yes",
      direction: "Column",
      children: [
        o.jsxs(wn, {
          size: "400",
          variant: "Surface",
          style: {
            padding: `0 ${ee.space.S300}`
          },
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "L400",
                truncate: true,
                children: "Room Packs"
              })
            }),
            o.jsx(E, {
              shrink: "No",
              children: o.jsx(Qe, {
                radii: "Pill",
                variant: u ? "Success" : "SurfaceVariant",
                outlined: u,
                onClick: () => n(a),
                children: o.jsx(D, {
                  size: "B300",
                  children: u ? "Save" : "Close"
                })
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            size: "300",
            hideTrack: true,
            visibility: "Hover",
            children: o.jsxs(E, {
              direction: "Column",
              gap: "400",
              style: {
                paddingLeft: ee.space.S300,
                paddingTop: ee.space.S300,
                paddingBottom: ee.space.S300,
                paddingRight: ee.space.S100
              },
              children: [
                Array.from(i.entries()).map(([h, f]) => {
                  const g = r.getRoom(h);
                  if (!g) return null;
                  const m = f.map((y) => y.address).filter((y) => y !== void 0), v = m.every((y) => a.find((w) => Ll(y, w)));
                  return o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsxs(E, {
                        alignItems: "Center",
                        children: [
                          o.jsx(E, {
                            grow: "Yes",
                            children: o.jsx(D, {
                              size: "L400",
                              children: g.name
                            })
                          }),
                          o.jsx(E, {
                            shrink: "No",
                            children: o.jsx(Qe, {
                              variant: v ? "Critical" : "Surface",
                              radii: "Pill",
                              onClick: () => {
                                if (v) {
                                  d(m);
                                  return;
                                }
                                c(m);
                              },
                              children: o.jsx(D, {
                                size: "B300",
                                children: v ? "Unselect All" : "Select All"
                              })
                            })
                          })
                        ]
                      }),
                      f.map((y) => {
                        const w = y.getAvatarUrl(Hr.Emoticon), b = w ? Cn(r, w, e) : void 0, { address: j } = y;
                        if (!j) return null;
                        const k = !!a.find((C) => Ll(C, j));
                        return o.jsx(Te, {
                          className: Xe,
                          variant: k ? "Success" : "SurfaceVariant",
                          direction: "Column",
                          gap: "400",
                          children: o.jsx(Ie, {
                            title: y.meta.name ?? "Unknown",
                            focusId: `room-pack-${MF(y.id)}`,
                            showSettingLinkAction: false,
                            description: o.jsx("span", {
                              className: KB,
                              children: y.meta.attribution
                            }),
                            before: o.jsx(E, {
                              alignItems: "Center",
                              gap: "300",
                              children: o.jsx(xn, {
                                size: "300",
                                radii: "300",
                                children: b ? o.jsx(Xu, {
                                  style: {
                                    objectFit: "contain"
                                  },
                                  src: b
                                }) : o.jsx(mp, {
                                  children: o.jsx(Q, {
                                    size: "400",
                                    src: q.Sticker,
                                    filled: true
                                  })
                                })
                              })
                            }),
                            after: o.jsx(Rd, {
                              checked: k,
                              variant: "Success",
                              onClick: () => l(j)
                            })
                          })
                        }, y.id);
                      })
                    ]
                  }, h);
                }),
                i.size === 0 && o.jsx(Te, {
                  className: Xe,
                  variant: "SurfaceVariant",
                  direction: "Column",
                  gap: "400",
                  children: o.jsxs(E, {
                    justifyContent: "Center",
                    direction: "Column",
                    gap: "200",
                    style: {
                      padding: `${ee.space.S700} ${ee.space.S400}`,
                      maxWidth: He(300),
                      margin: "auto"
                    },
                    children: [
                      o.jsx(D, {
                        size: "H5",
                        align: "Center",
                        children: "No Packs"
                      }),
                      o.jsx(D, {
                        size: "T200",
                        align: "Center",
                        children: "Pack from rooms will appear here. You do not have any room with packs yet."
                      })
                    ]
                  })
                })
              ]
            })
          })
        })
      ]
    });
  }
  function yWe({ onViewPack: t }) {
    const e = be(), n = hn(), r = vle(), [i, a] = p.useState(), s = Ze(zr), l = p.useMemo(() => {
      const A = [];
      return s.forEach((B) => {
        const U = e.getRoom(B);
        U && A.push(U);
      }), A;
    }, [
      e,
      s
    ]), c = _le(l), d = p.useMemo(() => c.filter((A) => !r.find((B) => Ll(A.address, B.address))), [
      c,
      r
    ]), [u, h] = p.useState([]), [f, g] = p.useState([]), m = p.useMemo(() => d.filter((A) => !u.find((B) => Ll(A.address, B))), [
      u,
      d
    ]), v = (A) => {
      g((B) => [
        ...B,
        A
      ]);
    }, y = (A) => {
      g((B) => B.filter((U) => !Ll(U, A)));
    }, w = (A) => {
      a(void 0), A.length > 0 && h((B) => [
        ...A,
        ...B
      ]);
    }, [b, j] = Et(p.useCallback(async () => {
      var _a6;
      const A = ((_a6 = e.getAccountData(Zr.PoniesEmoteRooms)) == null ? void 0 : _a6.getContent()) ?? {}, B = JSON.parse(JSON.stringify(A));
      u.forEach((U) => {
        const z = B.rooms ?? {}, O = z[U.roomId] ?? {};
        O[U.stateKey] = {}, z[U.roomId] = O, B.rooms = z;
      }), f.forEach((U) => {
        var _a7, _b3;
        ((_b3 = (_a7 = B.rooms) == null ? void 0 : _a7[U.roomId]) == null ? void 0 : _b3[U.stateKey]) && delete B.rooms[U.roomId][U.stateKey];
      }), await e.setAccountData(Zr.PoniesEmoteRooms, B);
    }, [
      e,
      u,
      f
    ])), k = p.useCallback(() => {
      h([]), g([]);
    }, []);
    p.useEffect(() => {
      b.status === ve.Success && k();
    }, [
      b,
      k
    ]);
    const C = (A) => {
      a(A.currentTarget.getBoundingClientRect());
    }, x = b.status === ve.Loading, S = f.length > 0 || u.length > 0, T = (A) => {
      const B = A.getAvatarUrl(Hr.Emoticon), U = B ? Cn(e, B, n) : void 0, { address: z } = A;
      if (!z) return null;
      const O = !!f.find((M) => Ll(M, z));
      return o.jsx(Te, {
        className: Xe,
        variant: O ? "Critical" : "SurfaceVariant",
        direction: "Column",
        gap: "400",
        children: o.jsx(Ie, {
          focusId: `selected-pack-${MF(A.id)}`,
          showSettingLinkAction: false,
          title: o.jsx("span", {
            style: {
              textDecoration: O ? "line-through" : void 0
            },
            children: A.meta.name ?? "Unknown"
          }),
          description: o.jsx("span", {
            className: KB,
            children: A.meta.attribution
          }),
          before: o.jsxs(E, {
            alignItems: "Center",
            gap: "300",
            children: [
              O ? o.jsx(Oe, {
                size: "300",
                radii: "Pill",
                variant: "Critical",
                onClick: () => y(z),
                disabled: x,
                children: o.jsx(Q, {
                  src: q.Plus,
                  size: "100"
                })
              }) : o.jsx(Oe, {
                size: "300",
                radii: "Pill",
                variant: "Secondary",
                onClick: () => v(z),
                disabled: x,
                children: o.jsx(Q, {
                  src: q.Cross,
                  size: "100"
                })
              }),
              o.jsx(xn, {
                size: "300",
                radii: "300",
                children: U ? o.jsx(Xu, {
                  style: {
                    objectFit: "contain"
                  },
                  src: U
                }) : o.jsx(mp, {
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.Sticker,
                    filled: true
                  })
                })
              })
            ]
          }),
          after: !O && o.jsx(xe, {
            variant: "Secondary",
            fill: "Soft",
            size: "300",
            radii: "300",
            outlined: true,
            onClick: () => t(A),
            children: o.jsx(D, {
              size: "B300",
              children: "View"
            })
          })
        })
      }, A.id);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Favorite Packs"
            }),
            o.jsx(Te, {
              className: Xe,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: "Select Pack",
                focusId: "select-pack",
                description: "Pick emojis and stickers pack from rooms to use in all rooms.",
                after: o.jsxs(o.Fragment, {
                  children: [
                    o.jsx(xe, {
                      onClick: C,
                      variant: "Secondary",
                      fill: "Soft",
                      size: "300",
                      radii: "300",
                      outlined: true,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Select"
                      })
                    }),
                    o.jsx(ln, {
                      anchor: i,
                      position: "Bottom",
                      align: "End",
                      content: o.jsx(Ft, {
                        focusTrapOptions: {
                          initialFocus: false,
                          onDeactivate: () => a(void 0),
                          clickOutsideDeactivates: true,
                          isKeyForward: (A) => A.key === "ArrowDown" || A.key === "ArrowRight",
                          isKeyBackward: (A) => A.key === "ArrowUp" || A.key === "ArrowLeft",
                          escapeDeactivates: kt
                        },
                        children: o.jsx(tn, {
                          style: {
                            display: "flex",
                            maxWidth: He(400),
                            width: "100vw",
                            maxHeight: He(500)
                          },
                          children: o.jsx(_We, {
                            packs: m,
                            useAuthentication: n,
                            onSelect: w
                          })
                        })
                      })
                    })
                  ]
                })
              })
            }),
            r.map(T),
            d.filter((A) => !!u.find((B) => Ll(A.address, B))).map(T)
          ]
        }),
        S && o.jsx(tn, {
          style: {
            position: "sticky",
            padding: ee.space.S200,
            paddingLeft: ee.space.S400,
            bottom: ee.space.S400,
            left: ee.space.S400,
            right: 0,
            zIndex: 1
          },
          variant: "Success",
          children: o.jsxs(E, {
            alignItems: "Center",
            gap: "400",
            children: [
              o.jsx(E, {
                grow: "Yes",
                direction: "Column",
                children: b.status === ve.Error ? o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Failed to apply changes! Please try again."
                  })
                }) : o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Changes saved! Apply when ready."
                  })
                })
              }),
              o.jsxs(E, {
                shrink: "No",
                gap: "200",
                children: [
                  o.jsx(xe, {
                    size: "300",
                    variant: "Success",
                    fill: "None",
                    radii: "300",
                    disabled: x,
                    onClick: k,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Reset"
                    })
                  }),
                  o.jsx(xe, {
                    size: "300",
                    variant: "Success",
                    radii: "300",
                    disabled: x,
                    before: x && o.jsx(dt, {
                      variant: "Success",
                      fill: "Solid",
                      size: "100"
                    }),
                    onClick: j,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Apply Changes"
                    })
                  })
                ]
              })
            ]
          })
        })
      ]
    });
  }
  function bWe({ onViewPack: t }) {
    const e = be(), n = hn(), r = uM(), i = r == null ? void 0 : r.getAvatarUrl(Hr.Emoticon), a = i ? Cn(e, i, n) : void 0, s = () => {
      if (r) t(r);
      else {
        const l = new gh(e.getUserId() ?? "", {}, void 0);
        t(l);
      }
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Default Pack"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: (r == null ? void 0 : r.meta.name) ?? "Unknown",
            focusId: "default-pack",
            description: r == null ? void 0 : r.meta.attribution,
            before: o.jsx(xn, {
              size: "300",
              radii: "300",
              children: a ? o.jsx(Xu, {
                style: {
                  objectFit: "contain"
                },
                src: a
              }) : o.jsx(mp, {
                children: o.jsx(Q, {
                  size: "400",
                  src: q.Sticker,
                  filled: true
                })
              })
            }),
            after: o.jsx(xe, {
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              radii: "300",
              outlined: true,
              onClick: s,
              children: o.jsx(D, {
                size: "B300",
                children: "View"
              })
            })
          })
        })
      ]
    });
  }
  function xWe({ requestBack: t, requestClose: e }) {
    const [n, r] = p.useState(), i = () => {
      r(void 0);
    };
    return n ? o.jsx(Fde, {
      address: n.address,
      requestClose: i
    }) : o.jsx(Qc, {
      title: "Emojis & Stickers",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsx(bWe, {
                  onViewPack: r
                }),
                o.jsx(yWe, {
                  onViewPack: r
                })
              ]
            })
          })
        })
      })
    });
  }
  const wWe = () => p.useMemo(() => [
    {
      layout: Mr.Modern,
      name: "Modern"
    },
    {
      layout: Mr.Compact,
      name: "Compact"
    },
    {
      layout: Mr.Bubble,
      name: "Bubble"
    }
  ], []), DWe = () => p.useMemo(() => [
    {
      layout: Ua.Above,
      name: "Above"
    },
    {
      layout: Ua.Inline,
      name: "Inline"
    },
    {
      layout: Ua.Hidden,
      name: "Hidden"
    },
    {
      layout: Ua.Below,
      name: "Below"
    }
  ], []), CWe = () => p.useMemo(() => [
    {
      spacing: "0",
      name: "None"
    },
    {
      spacing: "100",
      name: "Ultra Small"
    },
    {
      spacing: "200",
      name: "Extra Small"
    },
    {
      spacing: "300",
      name: "Small"
    },
    {
      spacing: "400",
      name: "Normal"
    },
    {
      spacing: "500",
      name: "Large"
    }
  ], []), EWe = () => p.useMemo(() => [
    {
      format: "D MMM YYYY",
      name: "D MMM YYYY"
    },
    {
      format: "DD/MM/YYYY",
      name: "DD/MM/YYYY"
    },
    {
      format: "MM/DD/YYYY",
      name: "MM/DD/YYYY"
    },
    {
      format: "YYYY/MM/DD",
      name: "YYYY/MM/DD"
    },
    {
      format: "",
      name: "Custom"
    }
  ], []), vde = /* @__PURE__ */ new Set([
    "usePushNotifications",
    "useInAppNotifications",
    "useSystemNotifications",
    "pageZoom",
    "isPeopleDrawer",
    "isWidgetDrawer",
    "memberSortFilterIndex",
    "developerTools",
    "settingsSyncEnabled"
  ]), NM = 1, kWe = (t) => {
    const e = {
      ...t
    };
    return vde.forEach((n) => delete e[n]), {
      v: NM,
      settings: e
    };
  }, GI = (t, e) => {
    if (!t || typeof t != "object") return null;
    const n = t;
    if (n.v !== NM) return null;
    const r = n.settings;
    if (!r || typeof r != "object" || Array.isArray(r)) return null;
    const i = {
      ...e,
      ...r
    };
    return vde.forEach((a) => {
      i[a] = e[a];
    }), i;
  }, SWe = (t) => {
    const e = JSON.stringify({
      v: NM,
      settings: t
    }, null, 2), n = new Blob([
      e
    ], {
      type: "application/json"
    }), r = URL.createObjectURL(n), i = document.createElement("a");
    i.href = r, i.download = `sable-settings-${Date.now()}.json`, i.click(), URL.revokeObjectURL(r);
  }, jWe = (t) => new Promise((e) => {
    const n = document.createElement("input");
    n.type = "file", n.accept = "application/json,.json", n.addEventListener("change", () => {
      var _a6;
      const r = (_a6 = n.files) == null ? void 0 : _a6[0];
      if (!r) {
        e(null);
        return;
      }
      const i = new FileReader();
      i.addEventListener("load", (a) => {
        var _a7;
        try {
          const s = JSON.parse((_a7 = a.target) == null ? void 0 : _a7.result);
          e(GI(s, t));
        } catch {
          e(null);
        }
      }), i.addEventListener("error", () => e(null)), i.readAsText(r);
    }), n.click();
  }), TWe = 2e3, _de = vn(null), yde = vn("idle");
  function RWe() {
    const t = be(), [e, n] = Fr(ge), r = Fn(_de), i = Fn(yde), a = p.useRef(e);
    a.current = e;
    const s = e.settingsSyncEnabled;
    p.useEffect(() => {
      if (!s) return;
      const u = t.getAccountData(Zr.SableSettings);
      if (!u) return;
      const { synctoken: h, ...f } = u.getContent(), g = GI(f, a.current);
      g && (JSON.stringify(g) !== JSON.stringify(a.current) && n(g), r(Date.now()));
    }, [
      t,
      s,
      n,
      r
    ]);
    const l = p.useRef(null), c = p.useCallback((u) => {
      if (u.getType() !== Zr.SableSettings || !a.current.settingsSyncEnabled) return;
      const h = u.getContent();
      if (typeof h.synctoken == "string" && h.synctoken === l.current) {
        l.current = null, r(Date.now()), i("idle");
        return;
      }
      const { synctoken: f, ...g } = h, m = GI(g, a.current);
      m && JSON.stringify(m) !== JSON.stringify(a.current) ? (n(m), r(Date.now())) : m && r(Date.now());
    }, [
      n,
      r,
      i
    ]);
    bp(t, c);
    const d = p.useRef();
    p.useEffect(() => {
      if (s) return clearTimeout(d.current), d.current = setTimeout(() => {
        i("syncing");
        const u = Math.random().toString(36).slice(2, 10);
        l.current = u;
        const h = {
          ...kWe(a.current),
          synctoken: u
        };
        t.setAccountData(Zr.SableSettings, h).catch(() => {
          l.current = null, i("error");
        });
      }, TWe), () => clearTimeout(d.current);
    }, [
      t,
      e,
      s,
      i
    ]);
  }
  function AWe({ hasChanges: t, handleReset: e }) {
    const [n, r] = p.useState(), i = {
      padding: ee.space.S200,
      paddingTop: 0
    }, a = (s) => {
      r(s.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: n,
      position: "Top",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => r(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          style: {
            maxHeight: "85vh",
            overflowY: "auto"
          },
          children: [
            o.jsx(wn, {
              size: "300",
              style: {
                padding: `0 ${ee.space.S200}`
              },
              children: o.jsx(D, {
                size: "L400",
                children: "Formatting"
              })
            }),
            o.jsxs(E, {
              direction: "Column",
              children: [
                o.jsxs(E, {
                  style: i,
                  direction: "Column",
                  children: [
                    o.jsx(wn, {
                      size: "300",
                      children: o.jsx(D, {
                        size: "L400",
                        children: "Year"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      tabIndex: 0,
                      gap: "100",
                      children: [
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "YY",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Two-digit year"
                              ]
                            }),
                            " "
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "YYYY",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Four-digit year"
                              ]
                            })
                          ]
                        })
                      ]
                    })
                  ]
                }),
                o.jsxs(E, {
                  style: i,
                  direction: "Column",
                  children: [
                    o.jsx(wn, {
                      size: "300",
                      children: o.jsx(D, {
                        size: "L400",
                        children: "Month"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      tabIndex: 0,
                      gap: "100",
                      children: [
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "M",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "The month"
                              ]
                            })
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "MM",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Two-digit month"
                              ]
                            }),
                            " "
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "MMM",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Short month name"
                              ]
                            })
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "MMMM",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Full month name"
                              ]
                            })
                          ]
                        })
                      ]
                    })
                  ]
                }),
                o.jsxs(E, {
                  style: i,
                  direction: "Column",
                  children: [
                    o.jsx(wn, {
                      size: "300",
                      children: o.jsx(D, {
                        size: "L400",
                        children: "Day of the Month"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      tabIndex: 0,
                      gap: "100",
                      children: [
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "D",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Day of the month"
                              ]
                            })
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "DD",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Two-digit day of the month"
                              ]
                            })
                          ]
                        })
                      ]
                    })
                  ]
                }),
                o.jsxs(E, {
                  style: i,
                  direction: "Column",
                  children: [
                    o.jsx(wn, {
                      size: "300",
                      children: o.jsx(D, {
                        size: "L400",
                        children: "Day of the Week"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      tabIndex: 0,
                      gap: "100",
                      children: [
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "d",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Day of the week (Sunday = 0)"
                              ]
                            })
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "dd",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Two-letter day name"
                              ]
                            })
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "ddd",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Short day name"
                              ]
                            })
                          ]
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "dddd",
                            o.jsxs(D, {
                              as: "span",
                              size: "Inherit",
                              priority: "300",
                              children: [
                                ": ",
                                "Full day name"
                              ]
                            })
                          ]
                        })
                      ]
                    })
                  ]
                })
              ]
            })
          ]
        })
      }),
      children: t ? o.jsx(Oe, {
        tabIndex: -1,
        onClick: e,
        type: "reset",
        variant: "Secondary",
        size: "300",
        radii: "300",
        children: o.jsx(Q, {
          src: q.Cross,
          size: "100"
        })
      }) : o.jsx(Oe, {
        tabIndex: -1,
        onClick: a,
        type: "button",
        variant: "Secondary",
        size: "300",
        radii: "300",
        "aria-pressed": !!n,
        children: o.jsx(Q, {
          style: {
            opacity: ee.opacity.P300
          },
          size: "100",
          src: q.Info
        })
      })
    });
  }
  function IWe({ value: t, onChange: e }) {
    const [n, r] = p.useState(t);
    p.useEffect(() => {
      r(t);
    }, [
      t
    ]);
    const i = (c) => {
      const d = c.currentTarget.value;
      r(d);
    }, a = () => {
      r(t);
    }, s = (c) => {
      var _a6, _b3;
      c.preventDefault();
      const h = (_b3 = (_a6 = c.target) == null ? void 0 : _a6.customDateFormatInput) == null ? void 0 : _b3.value;
      h && e(h);
    }, l = n !== t;
    return o.jsx(Ie, {
      focusId: "custom-date-format",
      children: o.jsxs(E, {
        as: "form",
        onSubmit: s,
        gap: "200",
        children: [
          o.jsx(E, {
            grow: "Yes",
            direction: "Column",
            children: o.jsx(mn, {
              required: true,
              name: "customDateFormatInput",
              value: n,
              onChange: i,
              maxLength: 16,
              autoComplete: "off",
              variant: "Secondary",
              radii: "300",
              style: {
                paddingRight: ee.space.S200
              },
              after: o.jsx(AWe, {
                hasChanges: l,
                handleReset: a
              })
            })
          }),
          o.jsx(xe, {
            size: "400",
            variant: l ? "Success" : "Secondary",
            fill: l ? "Solid" : "Soft",
            outlined: true,
            radii: "300",
            disabled: !l,
            type: "submit",
            children: o.jsx(D, {
              size: "B400",
              children: "Save"
            })
          })
        ]
      })
    });
  }
  function BWe({ value: t, onChange: e }) {
    var _a6;
    const [n, r] = p.useState(), i = EWe(), a = (c) => c === "" ? "Custom" : ti().format(c), s = (c) => {
      r(c.currentTarget.getBoundingClientRect());
    }, l = (c) => {
      e(c), r(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: s,
          children: o.jsx(D, {
            size: "T300",
            children: a(((_a6 = i.find((c) => c.format === t)) == null ? void 0 : _a6.format) ?? t)
          })
        }),
        o.jsx(ln, {
          anchor: n,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => r(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (c) => c.key === "ArrowDown" || c.key === "ArrowRight",
              isKeyBackward: (c) => c.key === "ArrowUp" || c.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: i.map((c) => o.jsx(Ye, {
                  size: "300",
                  variant: t === c.format ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => l(c.format),
                  children: o.jsx(D, {
                    size: "T300",
                    children: a(c.format)
                  })
                }, c.format))
              })
            })
          })
        })
      ]
    });
  }
  function PWe() {
    const [t, e] = Fe(ge, "dateFormatString"), [n, r] = p.useState(t), i = n === "", a = (s) => {
      r(s), s !== "" && e(s);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Ie, {
          title: "Date Format",
          focusId: "date-format",
          description: i ? ti().format(t) : "",
          after: o.jsx(BWe, {
            value: n,
            onChange: a
          })
        }),
        i && o.jsx(IWe, {
          value: t,
          onChange: e
        })
      ]
    });
  }
  function MWe(t, e) {
    return t ? 'Tombstone events are always shown when "Show Hidden Events" is enabled.' : e ? "Disable to hide redacted messages entirely instead of showing a tombstone." : "Enable to show tombstone events for redacted messages instead of hiding them entirely.";
  }
  function OWe() {
    const [t, e] = Fe(ge, "hour24Clock");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Date & Time"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "24-Hour Time Format",
            focusId: "twenty-four-hour-time-format",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(PWe, {})
        })
      ]
    });
  }
  function LWe({ isMobile: t }) {
    const [e, n] = Fe(ge, "enterForNewline"), [r, i] = Fe(ge, "editorToolbar"), [a, s] = Fe(ge, "hideActivity"), [l, c] = Fe(ge, "hideReads"), [d, u] = Fe(ge, "sendPresence"), [h, f] = Fe(ge, "mentionInReplies");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Editor"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          style: {
            opacity: t ? 0.5 : 1
          },
          children: o.jsx(Ie, {
            title: "ENTER for Newline",
            focusId: "enter-for-newline",
            description: `Use ${U2() ? uF.Command : "Ctrl"} + ENTER to send message. ${t ? "(Disabled on Mobile)" : ""}`,
            after: o.jsx(Jt, {
              variant: "Primary",
              value: e,
              onChange: n,
              disabled: t
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Message Formatting Toolbar",
            focusId: "composer-formatting-toolbar",
            description: "Enable the formatting toolbar in the message composer.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: r,
              onChange: i
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Hide Typing Indicators",
            focusId: "hide-typing-indicators",
            description: "Turn off typing status.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: a,
              onChange: s
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Hide Read Receipts",
            focusId: "hide-read-receipts",
            description: "Turn off read receipts.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: l,
              onChange: c
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Presence Status",
            focusId: "presence-status",
            description: "Show and receive online status from other users.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: d,
              onChange: u
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Send notifications for replies",
            focusId: "reply-notifications",
            description: "Disable to use silent replies by default. You can still toggle reply notifications for each reply.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: h,
              onChange: f
            })
          })
        })
      ]
    });
  }
  function NWe() {
    var _a6;
    const [t, e] = p.useState(), [n, r] = Fe(ge, "messageLayout"), i = wWe(), a = (l) => {
      e(l.currentTarget.getBoundingClientRect());
    }, s = (l) => {
      r(l), e(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: a,
          children: o.jsx(D, {
            size: "T300",
            children: ((_a6 = i.find((l) => l.layout === n)) == null ? void 0 : _a6.name) ?? n
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: i.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: n === l.layout ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => s(l.layout),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.layout))
              })
            })
          })
        })
      ]
    });
  }
  function zWe() {
    var _a6;
    const [t, e] = p.useState(), [n, r] = Fe(ge, "captionPosition"), i = DWe(), a = (l) => {
      e(l.currentTarget.getBoundingClientRect());
    }, s = (l) => {
      r(l), e(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: a,
          children: o.jsx(D, {
            size: "T300",
            children: ((_a6 = i.find((l) => l.layout === n)) == null ? void 0 : _a6.name) ?? n
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: i.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: n === l.layout ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => s(l.layout),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.layout))
              })
            })
          })
        })
      ]
    });
  }
  function UWe() {
    var _a6;
    const [t, e] = p.useState(), [n, r] = Fe(ge, "messageSpacing"), i = CWe(), a = (l) => {
      e(l.currentTarget.getBoundingClientRect());
    }, s = (l) => {
      r(l), e(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: a,
          children: o.jsx(D, {
            size: "T300",
            children: ((_a6 = i.find((l) => l.spacing === n)) == null ? void 0 : _a6.name) ?? n
          })
        }),
        o.jsx(ln, {
          anchor: t,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => e(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
              isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: i.map((l) => o.jsx(Ye, {
                  size: "300",
                  variant: n === l.spacing ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => s(l.spacing),
                  children: o.jsx(D, {
                    size: "T300",
                    children: l.name
                  })
                }, l.spacing))
              })
            })
          })
        })
      ]
    });
  }
  function VWe({ disabled: t }) {
    var _a6;
    const [e, n] = p.useState(), [r, i] = Fe(ge, "rightSwipeAction"), a = [
      {
        id: G1.Reply,
        name: "Reply to Message"
      },
      {
        id: G1.Members,
        name: "Open Member List"
      }
    ], s = (c) => {
      n(c.currentTarget.getBoundingClientRect());
    }, l = (c) => {
      i(c), n(void 0);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(xe, {
          size: "300",
          variant: "Secondary",
          outlined: true,
          fill: "Soft",
          radii: "300",
          disabled: t,
          after: o.jsx(Q, {
            size: "300",
            src: q.ChevronBottom
          }),
          onClick: s,
          children: o.jsx(D, {
            size: "T300",
            children: ((_a6 = a.find((c) => c.id === r)) == null ? void 0 : _a6.name) ?? r
          })
        }),
        o.jsx(ln, {
          anchor: e,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => n(void 0),
              clickOutsideDeactivates: true,
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: a.map((c) => o.jsx(Ye, {
                  size: "300",
                  variant: r === c.id ? "Primary" : "Surface",
                  radii: "300",
                  onClick: () => l(c.id),
                  children: o.jsx(D, {
                    size: "T300",
                    children: c.name
                  })
                }, c.id))
              })
            })
          })
        })
      ]
    });
  }
  function HWe({ isMobile: t }) {
    const [e, n] = Fe(ge, "mobileGestures");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      style: {
        opacity: t ? 1 : 0.5
      },
      children: [
        o.jsxs(D, {
          size: "L400",
          children: [
            "Gestures ",
            !t && "(Mobile Only)"
          ]
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Enable Swiping",
            focusId: "enable-swiping",
            description: "Swipe left for rooms, swipe right for actions.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: e,
              onChange: n,
              disabled: !t
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Right Swipe Action",
            focusId: "right-swipe-action",
            description: "What happens when you swipe right on a message.",
            after: o.jsx(VWe, {
              disabled: !t || !e
            })
          })
        })
      ]
    });
  }
  function $We() {
    const [t, e] = Fe(ge, "emojiSuggestThreshold"), [n, r] = p.useState(t.toString()), i = (s) => {
      const l = s.target.value;
      r(l);
      const c = Number.parseInt(l, 10);
      !Number.isNaN(c) && c >= 1 && c <= 10 && e(c);
    }, a = (s) => {
      Yt.isKeyHotkey("escape", s) && (s.stopPropagation(), r(t.toString()), s.target.blur()), Yt.isKeyHotkey("enter", s) && s.target.blur();
    };
    return o.jsx(mn, {
      style: {
        width: He(80)
      },
      variant: Number.parseInt(n, 10) === t ? "Secondary" : "Success",
      size: "300",
      radii: "300",
      type: "number",
      min: "1",
      max: "10",
      value: n,
      onChange: i,
      onKeyDown: a,
      outlined: true
    });
  }
  function WWe() {
    const [t, e] = Fe(ge, "alwaysShowCallButton"), [n, r] = Fe(ge, "joinCallOnSingleClick");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Calls"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Show Call Button for Large Rooms",
            focusId: "large-room-call-button",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Join voice calls by just clicking the room's icon",
            focusId: "join-on-click-voicecalls",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: n,
              onChange: r
            })
          })
        })
      ]
    });
  }
  function qWe() {
    const [t, e] = Fe(ge, "hideMembershipEvents"), [n, r] = Fe(ge, "hideNickAvatarEvents"), [i, a] = Fe(ge, "mediaAutoLoad"), [s, l] = Fe(ge, "showHiddenEvents"), [c, d] = Fe(ge, "showTombstoneEvents"), [u, h] = Fe(ge, "hideMembershipInReadOnly"), [f] = Fe(ge, "messageLayout"), [g, m] = Fe(ge, "useRightBubbles");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Messages"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Message Layout",
            focusId: "message-layout",
            after: o.jsx(NWe, {})
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Message Spacing",
            focusId: "message-spacing",
            after: o.jsx(UWe, {})
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "File description placement",
            focusId: "file-description-placement",
            after: o.jsx(zWe, {})
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Emoji Selector Character Threshold",
            focusId: "emoji-selector-threshold",
            after: o.jsx($We, {})
          })
        }),
        f === Mr.Bubble && o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Right Aligned Bubbles",
            focusId: "right-aligned-bubbles",
            description: "While using bubble layout, have your bubbles right aligned.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: g,
              onChange: m
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Disable Media Auto Load",
            focusId: "disable-media-auto-load",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: !i,
              onChange: (v) => a(!v)
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Hide Membership Change",
            focusId: "hide-membership-change",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Hide Profile Change",
            focusId: "hide-profile-change",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: n,
              onChange: r
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Hide Member Events in Read-Only Rooms",
            focusId: "hide-member-events-read-only-rooms",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: u,
              onChange: h
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Show Hidden Events",
            focusId: "show-hidden-events",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: s,
              onChange: l,
              title: s ? "Disable to hide hidden events" : "Enable to show hidden events, this will cause visual clutter in busy rooms."
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Show Tombstones for Redacted Messages",
            focusId: "show-redacted-message-tombstones",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: c || s,
              onChange: d,
              disabled: s,
              title: MWe(s, c)
            })
          })
        })
      ]
    });
  }
  function KWe() {
    const [t, e] = Fe(ge, "multiplePreviews"), [n, r] = Fe(ge, "bundledPreview"), [i, a] = Fe(ge, "urlPreview"), [s, l] = Fe(ge, "encUrlPreview"), [c, d] = Fe(ge, "clientUrlPreview"), [u, h] = Fe(ge, "encClientUrlPreview"), [f, g] = Fe(ge, "clientPreviewYoutube");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Embeds"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Display Multiple Embeds",
            focusId: "display-multiple-embeds",
            description: "Display the embeds of all the links. Turning it off makes it only show the embed of the 1st item",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Display Bundled Embeds",
            focusId: "display-bundled-embeds",
            description: "Show embeds when provided by the message itself. The embeds may be fabricated or incorrect.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: n,
              onChange: r
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Server-side Embeds",
            focusId: "url-preview",
            description: "Send the links from inside the messages to your homeserver to generate previews of the linked pages.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: i,
              onChange: a
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Server-side Embeds in Encrypted Room",
            focusId: "encrypted-room-url-preview",
            description: "Request server-side embeds in E2EE chats. This partially decreases secrecy by revealing sent links to your homeserver",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: s,
              onChange: l
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Client-side Embeds",
            focusId: "client-side-embeds",
            description: "Attempt to preview supported urls (e.g. YouTube) on the client, without involving the homeserver. This will expose your IP Address to third party services.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: c,
              onChange: d,
              title: c ? "Disable client-side embeds" : "Enable client-side embeds"
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          style: c ? {} : {
            display: "none"
          },
          children: o.jsx(Ie, {
            title: "Client-side Embeds in Encrypted Rooms",
            focusId: "encrypted-room-embeds",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: u,
              onChange: h,
              title: u ? "Disable client-side embeds in encrypted rooms" : "Enable client-side embeds in encrypted rooms"
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          style: c ? {} : {
            display: "none"
          },
          children: o.jsx(Ie, {
            title: "Embed YouTube Links",
            focusId: "embed-youtube-links",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: f,
              onChange: g,
              title: f ? "Disable client-side Youtube video embeds" : "Enable client-side Youtube video embeds"
            })
          })
        })
      ]
    });
  }
  function GWe() {
    var _a6;
    const t = la(), e = Ze(th), n = Ze(Fh), r = Fn(th), i = e.find((c) => c.userId === n) ?? e[0], a = Die((_a6 = t.slidingSync) == null ? void 0 : _a6.enabled), s = (i == null ? void 0 : i.slidingSyncOptIn) === true, l = (c) => {
      i && (r({
        type: "PUT",
        session: {
          ...i,
          slidingSyncOptIn: c
        }
      }), window.location.reload());
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          style: {
            opacity: a ? 1 : 0.5
          },
          children: "Sync"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          style: {
            opacity: a ? 1 : 0.5
          },
          children: o.jsx(Ie, {
            title: "Use Sliding Sync",
            focusId: "use-sliding-sync",
            description: a ? o.jsxs(o.Fragment, {
              children: [
                "Enable Sliding Sync for this current login/session. Requires server support and admin configuration.",
                " ",
                o.jsx("a", {
                  href: "https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md",
                  target: "_blank",
                  rel: "noreferrer",
                  children: "More info/Documentation"
                }),
                ".",
                " ",
                o.jsx("a", {
                  href: "https://github.com/SableClient/Sable/issues/39",
                  target: "_blank",
                  rel: "noreferrer",
                  children: "Known issues (Sable GitHub)"
                }),
                "."
              ]
            }) : o.jsxs(o.Fragment, {
              children: [
                "Unavailable: the server has disabled Sliding Sync in its config.",
                " ",
                o.jsx("a", {
                  href: "https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md",
                  target: "_blank",
                  rel: "noreferrer",
                  children: "More info"
                }),
                "."
              ]
            }),
            after: o.jsx(Jt, {
              variant: "Primary",
              value: s,
              onChange: l,
              disabled: !a
            })
          })
        })
      ]
    });
  }
  function YWe() {
    const [t, e] = Fe(ge, "settingsSyncEnabled"), n = Ze(_de), r = Ze(yde), i = Ze(ge), a = Fn(ge), [s, l] = p.useState(null), c = async () => {
      l(null);
      const u = await jWe(i);
      if (u === null) {
        l("Could not import \u2014 file was invalid or you cancelled.");
        return;
      }
      a(u);
    }, d = {
      idle: n ? `Last synced at ${ti(n).format("HH:mm:ss")}` : "Not yet synced this session",
      syncing: "Syncing\u2026",
      error: "Sync failed \u2014 will retry on next change"
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Settings Sync & Backup"
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "Sync across devices",
              focusId: "sync-across-devices",
              description: "Store your settings in your Matrix account so they follow you to any Sable instance. Notification and zoom preferences are kept per-device.",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: t,
                onChange: e
              })
            }),
            t && o.jsx(Ie, {
              focusId: "sync-status",
              title: "Sync status",
              description: d[r]
            })
          ]
        }),
        o.jsxs(E, {
          gap: "200",
          wrap: "Wrap",
          style: {
            paddingTop: "4px"
          },
          children: [
            o.jsx(xe, {
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              radii: "300",
              before: o.jsx(Q, {
                src: q.Download,
                size: "100"
              }),
              onClick: () => SWe(i),
              children: o.jsx(D, {
                size: "B300",
                children: "Export Settings"
              })
            }),
            o.jsx(xe, {
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              radii: "300",
              before: o.jsx(Q, {
                src: q.ArrowTop,
                size: "100"
              }),
              onClick: c,
              children: o.jsx(D, {
                size: "B300",
                children: "Import Settings"
              })
            })
          ]
        }),
        s && o.jsx(D, {
          size: "T200",
          style: {
            color: "var(--mx-color-critical-container-on)"
          },
          children: s
        })
      ]
    });
  }
  function ZWe() {
    const [t, e] = p.useState(localStorage.getItem("sable_sentry_enabled") === "true"), [n, r] = p.useState(localStorage.getItem("sable_sentry_replay_enabled") === "true"), [i, a] = p.useState(false), s = false, l = (d) => {
      e(d), d ? localStorage.setItem("sable_sentry_enabled", "true") : localStorage.setItem("sable_sentry_enabled", "false"), a(true);
    }, c = (d) => {
      r(d), d ? localStorage.setItem("sable_sentry_replay_enabled", "true") : localStorage.removeItem("sable_sentry_replay_enabled"), a(true);
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Diagnostics & Privacy"
        }),
        i && o.jsx(E, {
          style: {
            padding: "12px",
            backgroundColor: "rgba(33, 150, 243, 0.1)",
            borderRadius: "8px"
          },
          children: o.jsx(D, {
            size: "T300",
            style: {
              color: "rgb(33, 150, 243)"
            },
            children: "Please refresh the page for these settings to take effect."
          })
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "Error Reporting",
              focusId: "error-reporting",
              description: s ? "Send anonymous crash reports to help improve Sable. No messages, room names, or personal data are included." : "Error reporting is not configured for this build.",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: t,
                onChange: l,
                disabled: !s
              })
            }),
            t && s && o.jsx(Ie, {
              title: "Session Replay",
              focusId: "session-replay",
              description: "Allow recording of UI interactions to help debug errors. All text, media, and inputs are fully masked before sending.",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: n,
                onChange: c
              })
            })
          ]
        }),
        o.jsx(E, {
          gap: "200",
          wrap: "Wrap",
          style: {
            paddingTop: "4px"
          },
          children: o.jsx(xe, {
            as: "a",
            href: "https://github.com/SableClient/Sable/blob/dev/docs/PRIVACY.md",
            rel: "noreferrer noopener",
            target: "_blank",
            variant: "Secondary",
            fill: "Soft",
            size: "300",
            radii: "300",
            before: o.jsx(Q, {
              src: q.Shield,
              size: "100",
              filled: true
            }),
            children: o.jsx(D, {
              size: "B300",
              children: "Privacy Policy"
            })
          })
        })
      ]
    });
  }
  function JWe({ requestBack: t, requestClose: e }) {
    return o.jsx(Qc, {
      title: "General",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsx(OWe, {}),
                o.jsx(HWe, {
                  isMobile: Dr()
                }),
                o.jsx(LWe, {
                  isMobile: Dr()
                }),
                o.jsx(qWe, {}),
                o.jsx(KWe, {}),
                o.jsx(WWe, {}),
                o.jsx(YWe, {}),
                o.jsx(ZWe, {})
              ]
            })
          })
        })
      })
    });
  }
  function XWe() {
    const [t, e] = Fe(ge, "saveStickerEmojiBandwidth");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Save Bandwidth for Sticker and Emoji Images"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "100",
          children: o.jsx(Ie, {
            title: "Enable bandwidth saving for stickers and emojis",
            focusId: "bandwidth-saving-emojis",
            description: "If enabled, sticker and emoji images will be optimized to save bandwidth. This helps reduce data usage when viewing these images. But will increase server computation load.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        })
      ]
    });
  }
  function QWe() {
    const [t, e] = Fe(ge, "enableMSC4268CMD");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Enable Sharing of Encrypted History"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "100",
          children: o.jsx(Ie, {
            title: "Enable the /sharehistory command",
            focusId: "sharehistory-command",
            description: "If enabled, this command will allow users to share encrypted history with other newly joined users, as per MSC4268.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e,
              title: t ? "Disable /sharehistory command" : "Enable /sharehistory command"
            })
          })
        })
      ]
    });
  }
  function eqe() {
    const [t, e] = Fe(ge, "showPersonaSetting");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Personas (Per-Message Profiles)"
        }),
        o.jsx(Te, {
          className: hi,
          variant: "SurfaceVariant",
          direction: "Column",
          children: o.jsx(Ie, {
            title: "Show Personas Tab",
            focusId: "show-personas-tab",
            description: "Enables the personas tab in the settings menu for per-message profiles",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: t,
              onChange: e
            })
          })
        })
      ]
    });
  }
  function tqe({ requestBack: t, requestClose: e }) {
    return o.jsx(Qc, {
      title: "Experimental",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsxs(Xr, {
            children: [
              o.jsx(Lf, {
                before: o.jsx(Q, {
                  src: q.Warning,
                  size: "100",
                  filled: true
                }),
                variant: "Warning",
                description: o.jsxs(o.Fragment, {
                  children: [
                    "The features listed below may be unstable or incomplete,",
                    " ",
                    o.jsx("strong", {
                      children: "use at your own risk"
                    }),
                    ".",
                    o.jsx("br", {}),
                    "Please report any new issues potentially caused by these features!"
                  ]
                })
              }),
              o.jsx("br", {}),
              o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsx(GWe, {}),
                  o.jsx(QWe, {}),
                  o.jsx(XWe, {}),
                  o.jsx(eqe, {})
                ]
              })
            ]
          })
        })
      })
    });
  }
  function nqe(t) {
    const e = typeof navigator < "u" && navigator.platform.toUpperCase().indexOf("MAC") >= 0;
    return t.replace(/\bmod\b/g, e ? "\u2318" : "Ctrl").replace(/\balt\b/gi, e ? "\u2325" : "Alt").replace(/\bshift\b/gi, "\u21E7");
  }
  const rqe = [
    {
      name: "Navigation",
      shortcuts: [
        {
          keys: "Alt+N",
          description: "Jump to the highest-priority unread room"
        },
        {
          keys: "Alt+Shift+Down",
          description: "Go to next unread room (cycle)"
        },
        {
          keys: "Alt+Shift+Up",
          description: "Go to previous unread room (cycle)"
        }
      ]
    },
    {
      name: "Messages",
      shortcuts: [
        {
          keys: "Ctrl+Z / \u2318+Z",
          description: "Undo in message editor"
        },
        {
          keys: "Ctrl+Shift+Z / \u2318+Shift+Z",
          description: "Redo in message editor"
        },
        {
          keys: "Ctrl+B / \u2318+B",
          description: "Bold"
        },
        {
          keys: "Ctrl+I / \u2318+I",
          description: "Italic"
        },
        {
          keys: "Ctrl+U / \u2318+U",
          description: "Underline"
        }
      ]
    }
  ];
  function iqe({ keys: t, description: e }) {
    const n = t.split("/").map((r) => r.trim());
    return o.jsxs("div", {
      style: {
        display: "flex",
        alignItems: "center",
        justifyContent: "space-between",
        gap: ee.space.S400,
        padding: `${ee.space.S100} 0`
      },
      children: [
        o.jsx(D, {
          size: "T300",
          style: {
            flex: 1,
            minWidth: 0
          },
          children: e
        }),
        o.jsx("span", {
          style: {
            flexShrink: 0
          },
          "aria-label": n.join(" or "),
          children: n.map((r, i) => o.jsxs("span", {
            children: [
              r.split("+").map((a, s, l) => o.jsxs("span", {
                children: [
                  o.jsx("kbd", {
                    style: {
                      fontFamily: "monospace",
                      fontWeight: "bold",
                      padding: `0 ${ee.space.S100}`,
                      borderRadius: "3px",
                      border: "1px solid currentColor",
                      opacity: 0.8,
                      fontSize: "0.85em"
                    },
                    children: nqe(a)
                  }),
                  s < l.length - 1 && o.jsx("span", {
                    "aria-hidden": "true",
                    style: {
                      margin: "0 2px"
                    },
                    children: "+"
                  })
                ]
              }, a)),
              i < n.length - 1 && o.jsx(D, {
                as: "span",
                size: "T200",
                priority: "300",
                style: {
                  margin: `0 ${ee.space.S100}`
                },
                children: " / "
              })
            ]
          }, r))
        })
      ]
    });
  }
  function oqe({ requestBack: t, requestClose: e }) {
    return o.jsx(Qc, {
      title: "Keyboard Shortcuts",
      titleAs: "h1",
      actionLabel: "Close keyboard shortcuts",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsx(E, {
              direction: "Column",
              gap: "600",
              children: rqe.map((n) => o.jsxs(E, {
                direction: "Column",
                gap: "200",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    as: "h2",
                    children: n.name
                  }),
                  o.jsx("dl", {
                    style: {
                      margin: 0
                    },
                    children: n.shortcuts.map((r) => o.jsxs("div", {
                      children: [
                        o.jsx("dt", {
                          style: {
                            display: "none"
                          },
                          children: r.keys
                        }),
                        o.jsx("dd", {
                          style: {
                            margin: 0
                          },
                          children: o.jsx(iqe, {
                            keys: r.keys,
                            description: r.description
                          })
                        })
                      ]
                    }, r.description))
                  })
                ]
              }, n.name))
            })
          })
        })
      })
    });
  }
  const aqe = () => "Notification" in window ? window.Notification.permission === "default" ? "prompt" : window.Notification.permission : "denied";
  function sqe(t, e = "prompt") {
    const [n, r] = p.useState(e);
    return p.useEffect(() => {
      let i;
      function a() {
        r(this.state);
      }
      return navigator.permissions.query({
        name: t
      }).then((s) => {
        i = s, a.apply(s), s.addEventListener("change", a);
      }).catch(() => {
      }), () => {
        i == null ? void 0 : i.removeEventListener("change", a);
      };
    }, [
      t
    ]), n;
  }
  const lqe = () => {
    const t = be(), [e, n] = ZE(p.useCallback(async () => {
      var _a6, _b3;
      const i = ((_a6 = await t.getThreePids()) == null ? void 0 : _a6.threepids).filter((l) => l.medium === "email").map((l) => l.address);
      if (i.length === 0) return {
        enabled: false
      };
      const s = ((_b3 = await t.getPushers()) == null ? void 0 : _b3.pushers).find((l) => l.app_id === "m.email" && i.includes(l.pushkey));
      return (s == null ? void 0 : s.pushkey) ? {
        enabled: true,
        email: s.pushkey
      } : {
        enabled: false,
        email: i[0]
      };
    }, [
      t
    ]));
    return e.status === ve.Success ? [
      e.data,
      n
    ] : e.status === ve.Error ? [
      null,
      n
    ] : [
      void 0,
      n
    ];
  }, cqe = "webPushSubscription", U5 = ph(cqe, (t) => Ps(t, null), (t, e) => {
    Vd(t, e);
  }), zM = vn((t) => t(U5), (t, e, n) => {
    if (n) {
      const r = n.toJSON();
      e(U5, r);
    } else e(U5, null);
  }), Il = fo("PushNotifications");
  async function dqe() {
    if (!("Notification" in window)) return Il.warn("notification", "Notification API not available in this browser"), "denied";
    try {
      Il.info("notification", "Requesting browser notification permission");
      const t = await Notification.requestPermission();
      return Il.info("notification", "Notification permission result", {
        permission: t
      }), t;
    } catch (t) {
      return Il.error("notification", "Failed to request notification permission", {
        error: t instanceof Error ? t.message : String(t)
      }), "denied";
    }
  }
  async function YI(t, e, n) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4;
    if (!("serviceWorker" in navigator) || !("PushManager" in window)) throw Il.error("notification", "Push messaging not supported - missing serviceWorker or PushManager"), new Error("Push messaging is not supported in this browser.");
    Il.info("notification", "Enabling push notifications");
    const [r, i] = n, a = await navigator.serviceWorker.ready, s = await a.pushManager.getSubscription();
    if (s && r && s.endpoint === r.endpoint) {
      Il.info("notification", "Push subscription already exists and is valid - reusing", {
        endpoint: r.endpoint
      });
      const { keys: h } = r;
      if (!(h == null ? void 0 : h.p256dh) || !h.auth) return;
      const f = {
        kind: "http",
        app_id: (_a6 = e.pushNotificationDetails) == null ? void 0 : _a6.webPushAppID,
        pushkey: h.p256dh,
        app_display_name: "Cinny",
        device_display_name: "This Browser",
        lang: navigator.language || "en",
        data: {
          url: (_b3 = e.pushNotificationDetails) == null ? void 0 : _b3.pushNotifyUrl,
          format: "event_id_only",
          endpoint: r.endpoint,
          p256dh: h.p256dh,
          auth: h.auth
        },
        append: false
      };
      (_c3 = navigator.serviceWorker.controller) == null ? void 0 : _c3.postMessage({
        url: t.baseUrl,
        type: "togglePush",
        pusherData: f,
        token: t.getAccessToken()
      });
      return;
    }
    s && (Il.info("notification", "Unsubscribing old push subscription"), await s.unsubscribe()), Il.info("notification", "Creating new push subscription");
    const l = await a.pushManager.subscribe({
      userVisibleOnly: true,
      applicationServerKey: (_d4 = e.pushNotificationDetails) == null ? void 0 : _d4.vapidPublicKey
    });
    Il.info("notification", "Push subscription created successfully", {
      endpoint: l.endpoint
    }), i(l);
    const c = l.toJSON(), { keys: d } = c;
    if (!(d == null ? void 0 : d.p256dh) || !d.auth) throw Il.error("notification", "Push subscription missing required keys"), new Error("Push subscription keys missing.");
    const u = {
      kind: "http",
      app_id: (_e13 = e.pushNotificationDetails) == null ? void 0 : _e13.webPushAppID,
      pushkey: d.p256dh,
      app_display_name: "Cinny",
      device_display_name: (await t.getDevice(t.getDeviceId() ?? "")).display_name ?? "Unknown Device",
      lang: navigator.language || "en",
      data: {
        url: (_f4 = e.pushNotificationDetails) == null ? void 0 : _f4.pushNotifyUrl,
        format: "event_id_only",
        endpoint: l.endpoint,
        p256dh: d.p256dh,
        auth: d.auth
      },
      append: false
    };
    (_g4 = navigator.serviceWorker.controller) == null ? void 0 : _g4.postMessage({
      url: t.baseUrl,
      type: "togglePush",
      pusherData: u,
      token: t.getAccessToken()
    });
  }
  async function bde(t, e, n) {
    var _a6, _b3, _c3;
    Il.info("notification", "Disabling push notifications");
    const [r] = n, i = {
      kind: null,
      app_id: (_a6 = e.pushNotificationDetails) == null ? void 0 : _a6.webPushAppID,
      pushkey: (_b3 = r == null ? void 0 : r.keys) == null ? void 0 : _b3.p256dh
    };
    (_c3 = navigator.serviceWorker.controller) == null ? void 0 : _c3.postMessage({
      url: t.baseUrl,
      type: "togglePush",
      pusherData: i,
      token: t.getAccessToken()
    });
  }
  async function $Y(t) {
    const n = (await t.getPushers()).pushers || [];
    if (n.length === 0) return;
    const r = n.map((i) => {
      const a = {
        kind: null,
        app_id: i.app_id,
        pushkey: i.pushkey
      };
      return t.setPusher(a);
    });
    await Promise.allSettled(r);
  }
  async function uqe(t, e, n, r, i, a = false) {
    r && (n && !a ? await bde(t, e, i) : await YI(t, e, i));
  }
  function hqe({ onClose: t, onConfirm: e, isLoading: n }) {
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            clickOutsideDeactivates: true,
            onDeactivate: t
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S400}`
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Reset All Push Notifications"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    radii: "300",
                    onClick: t,
                    disabled: n,
                    children: o.jsx(Q, {
                      size: "100",
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsx(D, {
                    children: "This will remove push notifications from all your sessions and devices. This action cannot be undone. Are you sure you want to continue?"
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    style: {
                      paddingTop: ee.space.S200
                    },
                    children: [
                      o.jsx(xe, {
                        variant: "Critical",
                        fill: "Solid",
                        onClick: e,
                        disabled: n,
                        before: n && o.jsx(dt, {
                          size: "100",
                          variant: "Critical"
                        }),
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Reset All"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Secondary",
                        fill: "Soft",
                        onClick: t,
                        disabled: n,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Cancel"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function fqe() {
    const t = be(), [e] = Et($Y), [n, r] = p.useState(false), [, i] = Fe(ge, "usePushNotifications"), [, a] = Fr(zM), s = () => {
      r(true);
    }, l = () => {
      e.status !== ve.Loading && r(false);
    }, c = async () => {
      await $Y(t), i(false), a(null), r(false);
    };
    return o.jsxs(o.Fragment, {
      children: [
        n && o.jsx(hqe, {
          onClose: l,
          onConfirm: c,
          isLoading: e.status === ve.Loading
        }),
        o.jsxs(Ie, {
          title: "Reset All Push Notifications",
          focusId: "reset-all-push-notifications",
          description: o.jsxs(o.Fragment, {
            children: [
              "This will remove push notifications from all your sessions/devices.",
              o.jsx("br", {}),
              "You will need to re-enable them on each device individually."
            ]
          }),
          after: o.jsx(xe, {
            size: "300",
            radii: "300",
            variant: "Critical",
            fill: "Soft",
            onClick: s,
            children: o.jsx(D, {
              size: "B300",
              children: "Reset All"
            })
          }),
          children: [
            e.status === ve.Error && o.jsxs(D, {
              as: "span",
              style: {
                color: ct.Critical.Main
              },
              size: "T200",
              children: [
                o.jsx("br", {}),
                "Failed to deregister devices. Please try again."
              ]
            }),
            e.status === ve.Success && o.jsxs(D, {
              as: "span",
              style: {
                color: ct.Success.Main
              },
              size: "T200",
              children: [
                o.jsx("br", {}),
                "Successfully deregistered all devices."
              ]
            })
          ]
        })
      ]
    });
  }
  function mqe() {
    const t = be(), [e, n] = lqe(), [r, i] = Et(p.useCallback(async (s, l) => {
      if (l) {
        await t.setPusher({
          kind: "email",
          app_id: "m.email",
          pushkey: s,
          app_display_name: "Email Notifications",
          device_display_name: s,
          lang: "en",
          data: {
            brand: "Sable"
          },
          append: true
        });
        return;
      }
      await t.setPusher({
        pushkey: s,
        app_id: "m.email",
        kind: null
      });
    }, [
      t
    ])), a = (s) => {
      e && e.email && i(e.email, s).then(() => {
        n();
      });
    };
    return o.jsx(Ie, {
      title: "Email Notification",
      focusId: "email-notification",
      description: o.jsxs(o.Fragment, {
        children: [
          e && !e.email && o.jsx(D, {
            as: "span",
            style: {
              color: ct.Critical.Main
            },
            size: "T200",
            children: "Your account does not have any email attached."
          }),
          e && e.email && o.jsxs(o.Fragment, {
            children: [
              "Send notification to your email. ",
              `("${e.email}")`
            ]
          }),
          e === null && o.jsx(D, {
            as: "span",
            style: {
              color: ct.Critical.Main
            },
            size: "T200",
            children: "Unexpected Error!"
          }),
          e === void 0 && "Send notification to your email."
        ]
      }),
      after: o.jsxs(o.Fragment, {
        children: [
          r.status !== ve.Loading && typeof e == "object" && (e == null ? void 0 : e.email) && o.jsx(Jt, {
            value: e.enabled,
            onChange: a
          }),
          (r.status === ve.Loading || e === void 0) && o.jsx(dt, {
            variant: "Secondary"
          })
        ]
      })
    });
  }
  function gqe() {
    const t = be(), e = la(), [n, r] = p.useState(true), [i, a] = Fe(ge, "usePushNotifications"), s = Fr(zM), l = sqe("notifications", aqe());
    p.useEffect(() => {
      r(false);
    }, []);
    const c = async () => {
      r(true);
      try {
        await dqe() === "granted" && (await YI(t, e, s), a(true));
      } finally {
        r(false);
      }
    }, d = async (u) => {
      r(true);
      try {
        u ? await YI(t, e, s) : await bde(t, e, s), a(u);
      } finally {
        r(false);
      }
    };
    return o.jsx(Ie, {
      title: "Background Push Notifications",
      focusId: "background-push-notifications",
      description: l === "denied" ? o.jsx(D, {
        as: "span",
        style: {
          color: ct.Critical.Main
        },
        size: "T200",
        children: "Permission blocked. Please allow notifications in your browser settings."
      }) : "Receive notifications when the app is closed or in the background.",
      after: n ? o.jsx(dt, {
        variant: "Secondary"
      }) : l === "prompt" ? o.jsx(xe, {
        size: "300",
        radii: "300",
        onClick: c,
        children: o.jsx(D, {
          size: "B300",
          children: "Enable"
        })
      }) : l === "granted" ? o.jsx(Jt, {
        value: i,
        onChange: d
      }) : null
    });
  }
  function pqe() {
    const [t, e] = Fe(ge, "useInAppNotifications"), [n, r] = Fe(ge, "useSystemNotifications"), [i, a] = Fe(ge, "isNotificationSounds"), [s, l] = Fe(ge, "showMessageContentInNotifications"), [c, d] = Fe(ge, "showMessageContentInEncryptedNotifications"), [u, h] = Fe(ge, "clearNotificationsOnRead"), [f, g] = Fe(ge, "showUnreadCounts"), [m, v] = Fe(ge, "badgeCountDMsOnly"), [y, w] = Fe(ge, "showPingCounts"), [b, j] = Fe(ge, "faviconForMentionsOnly"), [k, C] = Fe(ge, "highlightMentions"), x = () => {
      const S = m, T = f, A = y;
      return S && T && A ? "All unread messages\u2014DMs, Rooms, and mentions\u2014show a number count." : !S && !T && !A ? "Badges show a plain dot for all unread activity\u2014no numbers displayed." : S && !T && !A ? "Only Direct Messages show a number count. Rooms and mentions show a plain dot." : !S && T && !A ? "Only Rooms and spaces show a number count. DMs and mentions show a plain dot." : !S && !T && A ? "Only mentions and keywords show a number count. All other activity shows a plain dot." : S && T && !A ? "DMs and Rooms show a number count. Mentions show a plain dot." : S && !T && A ? "DMs and mentions show a number count. Rooms and spaces show a plain dot." : !S && T && A ? "Rooms and mentions show a number count. Direct Messages show a plain dot." : "";
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "System & Notifications"
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "In-App Notifications",
            focusId: "in-app-notifications",
            description: "Show a notification banner inside the app when a message arrives.",
            after: o.jsx(Jt, {
              value: t,
              onChange: e
            })
          })
        }),
        Dr() && o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(gqe, {})
        }),
        !Dr() && o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "System Notifications",
            focusId: "system-notifications",
            description: "Show an OS-level notification banner when a message arrives while the app is open.",
            after: o.jsx(Jt, {
              value: n,
              onChange: r
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "In-App Notification Sound",
            focusId: "in-app-notification-sound",
            description: "Play a sound inside the app when a new message arrives.",
            after: o.jsx(Jt, {
              value: i,
              onChange: a
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Show Message Content",
            focusId: "show-message-content",
            description: "Include message text in notification bodies.",
            after: o.jsx(Jt, {
              value: s,
              onChange: l
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Show Encrypted Message Content",
            focusId: "show-encrypted-message-content",
            description: "Allow message text from encrypted rooms in notification bodies. May not work on some platforms due to technical limitations.",
            after: o.jsx(Jt, {
              value: c,
              onChange: d,
              disabled: !s
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Clear Notifications When Read Elsewhere",
            focusId: "clear-notifications-when-read-elsewhere",
            description: "Automatically dismiss notifications on this device when you read messages on another device.",
            after: o.jsx(Jt, {
              value: u,
              onChange: h
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(mqe, {})
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(fqe, {})
        }),
        o.jsx(D, {
          size: "L400",
          style: {
            paddingTop: ee.space.S700
          },
          children: "Badges"
        }),
        o.jsx(D, {
          size: "T300",
          style: {
            opacity: 0.7
          },
          children: x()
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Favicon Dot: Mentions Only",
            focusId: "favicon-dot-mentions-only",
            description: "Only change the browser tab favicon when you have mentions or keywords. Unreads without mentions won't affect the favicon.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: b,
              onChange: j
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Show Room Counts",
            focusId: "show-room-counts",
            description: "Displays a number for unread activity in Rooms and Spaces.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: f,
              onChange: g
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Show DM Counts",
            focusId: "show-dm-counts",
            description: "Displays a number for unread Direct Messages.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: m,
              onChange: v
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Show Mention Counts",
            focusId: "show-mention-counts",
            description: "Displays a number for mentions and keyword alerts.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: y,
              onChange: w
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Highlight Mentions",
            focusId: "highlight-mentions",
            description: "Highlight the full background message when it contains a mention/keyword.",
            after: o.jsx(Jt, {
              variant: "Primary",
              value: k,
              onChange: C
            })
          })
        })
      ]
    });
  }
  const y3 = (t, e, n, r, i, a, s) => ({
    kind: t,
    pushRule: {
      rule_id: e,
      default: true,
      enabled: true,
      pattern: i,
      conditions: r,
      actions: n
    }
  }), Fqe = [
    Or.Override,
    Or.ContentSpecific,
    Or.RoomSpecific,
    Or.SenderSpecific,
    Or.Underride
  ], vqe = (t, e) => {
    const { global: n } = t;
    let r;
    return Fqe.some((i) => {
      var _a6;
      const s = (_a6 = n[i]) == null ? void 0 : _a6.find((l) => l.rule_id === e);
      return s ? (r = {
        kind: i,
        pushRule: s
      }, true) : false;
    }), r;
  }, xde = (t, e) => p.useMemo(() => vqe(t, e), [
    t,
    e
  ]);
  function UM() {
    const [t, e] = p.useState(), n = (i) => {
      e(i.currentTarget.getBoundingClientRect());
    }, r = {
      padding: ee.space.S200,
      paddingTop: 0
    };
    return o.jsx(ln, {
      anchor: t,
      position: "Bottom",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => e(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          style: {
            maxWidth: "280px"
          },
          children: [
            o.jsx(wn, {
              size: "300",
              style: {
                padding: `0 ${ee.space.S200}`
              },
              children: o.jsx(D, {
                size: "L400",
                children: "Notification Levels"
              })
            }),
            o.jsxs(E, {
              direction: "Column",
              style: r,
              gap: "300",
              tabIndex: 0,
              children: [
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Disable"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      priority: "300",
                      children: "The rule is muted. No notifications of any kind."
                    })
                  ]
                }),
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Notify Silent"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      priority: "300",
                      children: "Visual notification (badge and banner) when a relevant message arrives. No sound."
                    })
                  ]
                }),
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Notify Loud"
                    }),
                    o.jsx(D, {
                      size: "T300",
                      priority: "300",
                      children: "Visual highlight plus sound. Respects the Notification Sound setting above, and triggers sound and vibration on mobile push."
                    })
                  ]
                })
              ]
            })
          ]
        })
      }),
      children: o.jsx(Oe, {
        onClick: n,
        type: "button",
        variant: "Secondary",
        size: "300",
        radii: "300",
        "aria-pressed": !!t,
        children: o.jsx(Q, {
          style: {
            opacity: ee.opacity.P300
          },
          size: "100",
          src: q.Info
        })
      })
    });
  }
  const VM = [
    {
      value: Ea.NotifyLoud,
      label: "Notify Loud"
    },
    {
      value: Ea.Notify,
      label: "Notify Silent"
    },
    {
      value: Ea.OFF,
      label: "Disable"
    }
  ], _qe = (t, e, n) => {
    const r = [];
    return n && r.push({
      kind: di.RoomMemberCount,
      is: "2"
    }), r.push({
      kind: di.EventMatch,
      key: "type",
      pattern: e ? "m.room.encrypted" : "m.room.message"
    }), {
      kind: Or.Underride,
      pushRule: {
        rule_id: t,
        default: true,
        enabled: true,
        conditions: r,
        actions: Oc(Ea.NotifyLoud)
      }
    };
  };
  function Yw({ ruleId: t, pushRules: e, encrypted: n = false, oneToOne: r = false }) {
    const i = be(), a = _qe(t, n, r), { kind: s, pushRule: l } = xde(e, t) ?? a, c = WP(), d = qP(l.actions), [u, h] = Et(p.useCallback(async (f) => {
      const g = c(f);
      await i.setPushRuleActions("global", s, t, g);
    }, [
      i,
      c,
      s,
      t
    ]));
    return o.jsx(Kc, {
      value: d,
      options: VM,
      onSelect: h,
      loading: u.status === ve.Loading
    });
  }
  function yqe() {
    const t = vh(ce.PushRules), e = p.useMemo(() => (t == null ? void 0 : t.getContent()) ?? {
      global: {}
    }, [
      t
    ]);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsxs(E, {
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          gap: "200",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "All Messages"
            }),
            o.jsxs(E, {
              gap: "100",
              alignItems: "Center",
              children: [
                o.jsx(UM, {}),
                o.jsx(D, {
                  size: "T200",
                  children: "Badge: "
                }),
                o.jsx(Rn, {
                  radii: "300",
                  variant: "Secondary",
                  fill: "Solid",
                  children: o.jsx(D, {
                    size: "L400",
                    children: "1"
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(D, {
          size: "T300",
          priority: "300",
          children: "Default notification level for all messages in rooms where no per-room override is set."
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Direct Messages",
            focusId: "direct-messages",
            description: "Includes 1-to-1, group DMs, and bridged conversations.",
            after: o.jsx(Yw, {
              pushRules: e,
              ruleId: Yr.DM,
              oneToOne: true
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Direct Messages (Encrypted)",
            focusId: "direct-messages-encrypted",
            description: "Includes 1-to-1, group DMs, and bridged conversations.",
            after: o.jsx(Yw, {
              pushRules: e,
              ruleId: Yr.EncryptedDM,
              encrypted: true,
              oneToOne: true
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Rooms",
            focusId: "rooms",
            after: o.jsx(Yw, {
              pushRules: e,
              ruleId: Yr.Message
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Rooms (Encrypted)",
            focusId: "rooms-encrypted",
            after: o.jsx(Yw, {
              pushRules: e,
              ruleId: Yr.EncryptedMessage,
              encrypted: true
            })
          })
        })
      ]
    });
  }
  const bqe = {
    highlight: true
  }, xqe = (t) => y3(Or.Override, Yr.IsUserMention, Oc(Ea.NotifyLoud, {
    highlight: true
  }), [
    {
      kind: di.EventPropertyContains,
      key: "content.m\\.mentions.user_ids",
      value: t
    }
  ]), wqe = y3(Or.Override, Yr.ContainsDisplayName, Oc(Ea.NotifyLoud, {
    highlight: true
  }), [
    {
      kind: di.ContainsDisplayName
    }
  ]), Dqe = (t) => y3(Or.ContentSpecific, Yr.ContainsUserName, Oc(Ea.NotifyLoud, {
    highlight: true
  }), void 0, t), Cqe = y3(Or.Override, Yr.IsRoomMention, Oc(Ea.Notify, {
    highlight: true
  }), [
    {
      kind: di.EventPropertyIs,
      key: "content.m\\.mentions.room",
      value: true
    },
    {
      kind: di.SenderNotificationPermission,
      key: "room"
    }
  ]), Eqe = y3(Or.Override, Yr.AtRoomNotification, Oc(Ea.Notify, {
    highlight: true
  }), [
    {
      kind: di.EventMatch,
      key: "content.body",
      pattern: "@room"
    },
    {
      kind: di.SenderNotificationPermission,
      key: "room"
    }
  ]);
  function K_({ ruleId: t, pushRules: e, defaultPushRuleData: n }) {
    const r = be(), { kind: i, pushRule: a } = xde(e, t) ?? n, s = WP(bqe), l = qP(a.actions), [c, d] = Et(p.useCallback(async (u) => {
      const h = s(u);
      await r.setPushRuleActions("global", i, t, h);
    }, [
      r,
      s,
      i,
      t
    ]));
    return o.jsx(Kc, {
      value: l,
      options: VM,
      onSelect: d,
      loading: c.status === ve.Loading
    });
  }
  function kqe() {
    const t = be(), e = t.getUserId(), { displayName: n } = Hc(e), r = vh(ce.PushRules), i = p.useMemo(() => (r == null ? void 0 : r.getContent()) ?? {
      global: {}
    }, [
      r
    ]), a = t.supportsIntentionalMentions();
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsxs(E, {
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          gap: "200",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Special Messages"
            }),
            o.jsxs(E, {
              gap: "100",
              alignItems: "Center",
              children: [
                o.jsx(UM, {}),
                o.jsx(D, {
                  size: "T200",
                  children: "Badge: "
                }),
                o.jsx(Rn, {
                  radii: "300",
                  variant: "Success",
                  fill: "Solid",
                  children: o.jsx(D, {
                    size: "L400",
                    children: "1"
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(D, {
          size: "T300",
          priority: "300",
          children: "Overrides the All Messages level for messages that mention you or match a keyword."
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: `Mention User ID ("${e}")`,
            focusId: "mention-user-id",
            after: o.jsx(K_, {
              pushRules: i,
              ruleId: Yr.IsUserMention,
              defaultPushRuleData: xqe(e)
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: `Contains Displayname ${n ? `("${n}")` : ""}`,
            focusId: "contains-display-name",
            after: o.jsx(K_, {
              pushRules: i,
              ruleId: Yr.ContainsDisplayName,
              defaultPushRuleData: wqe
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: `Contains Username ("${_n(e)}")`,
            focusId: "contains-username",
            after: o.jsx(K_, {
              pushRules: i,
              ruleId: Yr.ContainsUserName,
              defaultPushRuleData: Dqe(_n(e) ?? e)
            })
          })
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Mention @room",
            focusId: "mention-room",
            description: "Only triggers if the sender has permission to notify the whole room.",
            after: a ? o.jsx(K_, {
              pushRules: i,
              ruleId: Yr.IsRoomMention,
              defaultPushRuleData: Cqe
            }) : o.jsx(K_, {
              pushRules: i,
              ruleId: Yr.AtRoomNotification,
              defaultPushRuleData: Eqe
            })
          })
        })
      ]
    });
  }
  const wde = {
    highlight: true
  };
  function Sqe() {
    const t = be(), [e, n] = p.useState(""), [r, i] = Et(p.useCallback(async (d) => {
      t.addPushRule("global", Or.ContentSpecific, d, {
        actions: Oc(Ea.Notify, wde),
        pattern: d
      }), n("");
    }, [
      t
    ])), a = r.status === ve.Loading, s = (d) => {
      const u = d.currentTarget.value;
      n(u);
    }, l = () => {
      n("");
    }, c = (d) => {
      var _a6, _b3;
      if (d.preventDefault(), a) return;
      const f = (_b3 = (_a6 = d.target) == null ? void 0 : _a6.keywordInput) == null ? void 0 : _b3.value.trim();
      f && i(f);
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: c,
      gap: "200",
      "aria-disabled": a,
      children: [
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsx(mn, {
            required: true,
            name: "keywordInput",
            value: e,
            onChange: s,
            variant: "Secondary",
            radii: "300",
            style: {
              paddingRight: ee.space.S200
            },
            readOnly: a,
            after: e && !a && o.jsx(Oe, {
              type: "reset",
              onClick: l,
              size: "300",
              radii: "300",
              variant: "Secondary",
              children: o.jsx(Q, {
                src: q.Cross,
                size: "100"
              })
            })
          })
        }),
        o.jsxs(xe, {
          size: "400",
          variant: "Secondary",
          fill: "Soft",
          outlined: true,
          radii: "300",
          type: "submit",
          disabled: a,
          children: [
            a && o.jsx(dt, {
              variant: "Secondary",
              size: "300"
            }),
            o.jsx(D, {
              size: "B400",
              children: "Save"
            })
          ]
        })
      ]
    });
  }
  function jqe({ pushRule: t }) {
    const e = be(), [n, r] = Et(p.useCallback(() => e.deletePushRule("global", Or.ContentSpecific, t.rule_id), [
      e,
      t
    ])), i = n.status === ve.Loading;
    return o.jsx(Oe, {
      onClick: r,
      size: "300",
      radii: "Pill",
      variant: "Secondary",
      disabled: i,
      children: i ? o.jsx(dt, {
        size: "100"
      }) : o.jsx(Q, {
        src: q.Cross,
        size: "100"
      })
    });
  }
  function Tqe({ pushRule: t }) {
    const e = be(), n = WP(wde), r = qP(t.actions), [i, a] = Et(p.useCallback(async (s) => {
      const l = n(s);
      await e.setPushRuleActions("global", Or.ContentSpecific, t.rule_id, l);
    }, [
      e,
      n,
      t
    ]));
    return o.jsx(Kc, {
      value: r,
      options: VM,
      onSelect: a,
      loading: i.status === ve.Loading
    });
  }
  function Rqe() {
    const t = vh(ce.PushRules), e = p.useMemo(() => (t == null ? void 0 : t.getContent()) ?? {
      global: {}
    }, [
      t
    ]), n = p.useMemo(() => (e.global.content ?? []).filter((i) => !i.default && typeof i.pattern == "string"), [
      e
    ]);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsxs(E, {
          alignItems: "Center",
          justifyContent: "SpaceBetween",
          gap: "200",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Keyword Messages"
            }),
            o.jsxs(E, {
              gap: "100",
              alignItems: "Center",
              children: [
                o.jsx(UM, {}),
                o.jsx(D, {
                  size: "T200",
                  children: "Badge: "
                }),
                o.jsx(Rn, {
                  radii: "300",
                  variant: "Success",
                  fill: "Solid",
                  children: o.jsx(D, {
                    size: "L400",
                    children: "1"
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(D, {
          size: "T300",
          priority: "300",
          children: "Custom keywords that trigger notifications when matched in a message body."
        }),
        o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: "Select Keyword",
            focusId: "select-keyword",
            description: "Set a notification preference for message containing given keyword.",
            children: o.jsx(Sqe, {})
          })
        }),
        n.map((r) => o.jsx(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: o.jsx(Ie, {
            title: `"${r.pattern}"`,
            focusId: `keyword-${MF(r.pattern ?? r.rule_id ?? "custom-keyword")}`,
            showSettingLinkAction: false,
            before: o.jsx(jqe, {
              pushRule: r
            }),
            after: o.jsx(Tqe, {
              pushRule: r
            })
          })
        }, r.rule_id))
      ]
    });
  }
  function Aqe({ requestBack: t, requestClose: e }) {
    return o.jsx(Qc, {
      title: "Notifications",
      requestBack: t,
      requestClose: e,
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "700",
              children: [
                o.jsx(pqe, {}),
                o.jsx(yqe, {}),
                o.jsx(kqe, {}),
                o.jsx(Rqe, {})
              ]
            })
          })
        })
      })
    });
  }
  const _o = Zr.SablePerProfileMessageProfiles;
  function V5(t, e) {
    var _a6;
    const n = {
      id: t.id,
      displayname: t.name,
      avatar_url: t.avatarUrl,
      [Of]: t.pronouns,
      has_fallback: e
    };
    return (!t.name || (t == null ? void 0 : t.name.trim().length) === 0) && delete n.displayname, t.avatarUrl || delete n.avatar_url, (!t.pronouns || ((_a6 = t.pronouns) == null ? void 0 : _a6.length) === 0) && delete n[Of], e || delete n.has_fallback, n;
  }
  function Iqe(t) {
    return {
      id: t.id,
      name: t.displayname ?? "",
      avatarUrl: t.avatar_url,
      pronouns: t[Of]
    };
  }
  function Bqe(t) {
    const e = t.regexString.match(/^\/([\s\S]*)\/([gimsuy]*)$/), n = (e == null ? void 0 : e[1]) ?? t.regexString, r = (e == null ? void 0 : e[2]) ?? "";
    return {
      profileId: t.profileId,
      regex: new RegExp(n, r),
      setAt: t.setAt
    };
  }
  function _S(t) {
    return (t == null ? void 0 : t.associations) ? t.associations instanceof Map ? t.associations : new Map(Object.entries(t.associations)) : /* @__PURE__ */ new Map();
  }
  function ZI(t) {
    return Object.fromEntries(t);
  }
  function HM(t) {
    return (t == null ? void 0 : t.associations) ? t.associations instanceof Map ? t.associations : new Map(Object.entries(t.associations)) : /* @__PURE__ */ new Map();
  }
  function Dde(t) {
    return Object.fromEntries(t);
  }
  async function b3(t, e) {
    const n = t.getAccountData(`${_o}.${e}`);
    return n ? n.getContent() : void 0;
  }
  async function wy(t) {
    var _a6, _b3;
    const n = ((_b3 = (_a6 = t.getAccountData(`${_o}.index`)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.profileIds) || [];
    return (await Promise.all(n.map((i) => b3(t, i)))).filter((i) => i !== void 0);
  }
  function gF(t, e) {
    var _a6, _b3;
    const n = t.getAccountData(`${_o}.index`), r = {
      ...e,
      compat: {
        version: 1,
        compatDate: "2026-03-26"
      }
    };
    if ((_a6 = n == null ? void 0 : n.getContent()) == null ? void 0 : _a6.profileIds.includes(e.id)) return t.setAccountData(`${_o}.${e.id}`, r);
    const i = [
      ...((_b3 = n == null ? void 0 : n.getContent()) == null ? void 0 : _b3.profileIds) || [],
      e.id
    ];
    return Promise.all([
      t.setAccountData(`${_o}.index`, {
        profileIds: i
      }),
      t.setAccountData(`${_o}.${e.id}`, r)
    ]);
  }
  async function Pqe(t, e) {
    var _a6, _b3;
    const i = (((_b3 = (_a6 = t.getAccountData(`${_o}.index`)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.profileIds) || []).filter((a) => a !== e);
    await t.setAccountData(`${_o}.index`, {
      profileIds: i
    });
  }
  async function Mqe(t, e) {
    var _a6;
    const r = (_a6 = t.getAccountData(`${_o}.roomassociation`)) == null ? void 0 : _a6.getContent(), i = _S(r), a = [];
    return Array.from(i.entries()).forEach(([s, l]) => {
      (l == null ? void 0 : l.profileId) === e && a.push(s);
    }), a;
  }
  async function WY(t, e, n, r, i) {
    var _a6;
    const s = (_a6 = t.getAccountData(`${_o}.roomassociation`)) == null ? void 0 : _a6.getContent(), l = _S(s);
    if (i) {
      l.delete(e), t.setAccountData(`${_o}.roomassociation`, {
        associations: ZI(l)
      });
      return;
    }
    if (!n) throw new Error("profile Id is empty, yet it isn't a reset");
    l.set(e, {
      profileId: n,
      validUntil: r
    }), t.setAccountData(`${_o}.roomassociation`, {
      associations: ZI(l)
    });
  }
  async function Oqe(t, e, n, r, i) {
    var _a6;
    const a = HM((_a6 = t.getAccountData(`${_o}.proxyassociation`)) == null ? void 0 : _a6.getContent());
    if (!e) throw new Error("profileId might not be undefined");
    e && a.set(n, {
      profileId: e,
      regexString: r.toString()
    }), t.setAccountData(`${_o}.proxyassociation`, {
      associations: Dde(a)
    });
  }
  async function Lqe(t) {
    var _a6;
    const e = (_a6 = t.getAccountData(`${_o}.proxyassociation`)) == null ? void 0 : _a6.getContent();
    if (!e) return [];
    const n = HM(e), r = new Array();
    return n.values().forEach((i) => r.push(i)), r;
  }
  async function Nqe(t, e) {
    var _a6;
    const n = HM((_a6 = t.getAccountData(`${_o}.proxyassociation`)) == null ? void 0 : _a6.getContent());
    n && (n.delete(e), t.setAccountData(`${_o}.proxyassociation`, {
      associations: Dde(n)
    }));
  }
  async function zqe(t, e) {
    var _a6;
    const r = (_a6 = t.getAccountData(`${_o}.roomassociation`)) == null ? void 0 : _a6.getContent();
    if (!r) return;
    const i = _S(r), a = await Mqe(t, e);
    a.length !== 0 && (a.forEach((s) => {
      i.delete(s);
    }), await t.setAccountData(`${_o}.roomassociation`, {
      associations: ZI(i)
    }));
  }
  async function $M(t, e) {
    await zqe(t, e), await t.setAccountData(`${_o}.${e}`, {}), await Pqe(t, e);
  }
  async function Uqe(t, e, n) {
    const r = await b3(t, e);
    if (!r) throw new Error("Profile not found");
    const i = {
      ...r,
      id: n
    };
    await gF(t, i), await $M(t, e);
  }
  async function H5(t, e) {
    var _a6, _b3;
    const r = (_a6 = t.getAccountData(`${_o}.roomassociation`)) == null ? void 0 : _a6.getContent(), a = (_b3 = _S(r).get(e)) == null ? void 0 : _b3.profileId, s = a ? await b3(t, a) : void 0;
    return a ? s : void 0;
  }
  function Cde(t) {
    return crypto.randomUUID().replaceAll("-", "").substring(0, t);
  }
  function Vqe({ mx: t, profileId: e, avatarMxcUrl: n, displayName: r, pronouns: i = Array(), onChange: a, onDelete: s }) {
    const l = hn(), [c, d] = p.useState(r ?? ""), [u, h] = p.useState(e), [f, g] = p.useState(e);
    console.warn(i);
    const [m, v] = p.useState(i), [y, w] = p.useState(i), b = p.useMemo(() => Array.isArray(m) ? m.map((te) => `${te.language ? `${te.language}:` : ""}${te.summary}`).join(", ") : "", [
      m
    ]), [j, k] = p.useState(() => Array.isArray(y) ? y.map((re) => `${re.language ? `${re.language}:` : ""}${re.summary}`).join(", ") : ""), [C, x] = p.useState(c), [S, T] = p.useState(), [A, B] = p.useState(false), [U, z] = p.useState(n), O = Xl(S), M = p.useMemo(() => {
      if (O) return O;
      if (U) return Cn(t, U, l, 96, 96, "crop") ?? void 0;
    }, [
      O,
      U,
      t,
      l
    ]), I = p.useMemo(() => {
      if (S) return Yd(S);
    }, [
      S
    ]), N = ed(T, false), L = p.useCallback(() => {
      T(void 0), B(true);
    }, []), H = p.useCallback((te) => {
      (te == null ? void 0 : te.status) === "success" && (z(te.mxc), a && a({
        id: e,
        name: C,
        avatarUrl: te.mxc
      }), B(true)), T(void 0);
    }, [
      a,
      e,
      C
    ]), V = p.useCallback((te) => {
      x(te.target.value);
    }, []), [Z, Y] = p.useState(false), [oe, ue] = p.useState(false), ie = p.useMemo(() => f !== u, [
      f,
      u
    ]), de = p.useMemo(() => C !== (c ?? "") || j !== b || ie || A, [
      C,
      c,
      j,
      b,
      ie,
      A
    ]), ne = p.useCallback(() => {
      x(c ?? "");
    }, [
      c
    ]), ae = p.useCallback(() => {
      w(m), k(b);
    }, [
      m,
      b
    ]), X = p.useCallback(() => {
      gF(t, {
        id: e,
        name: C,
        avatarUrl: U,
        pronouns: y
      }).then(() => {
        d(C), v(y), B(false), Y(false), ue(false), ie && Uqe(t, e, f).then(() => {
          h(f);
        });
      });
    }, [
      t,
      e,
      C,
      U,
      y,
      ie,
      f
    ]), K = p.useCallback(() => {
      $M(t, e).then(() => {
        d(""), v([]), s && s(e);
      });
    }, [
      t,
      e,
      s
    ]), G = p.useCallback((te) => {
      g(te.target.value);
    }, []), le = p.useCallback((te) => (k(te.target.value), w(sUe(te.target.value))), []);
    return o.jsx(E, {
      direction: "Column",
      gap: "200",
      grow: "Yes",
      style: {
        width: "100%",
        minWidth: 500,
        paddingTop: ee.space.S400,
        paddingBottom: ee.space.S400,
        alignItems: "center",
        justifyContent: "center"
      },
      role: "form",
      "aria-labelledby": `profile-editor-title-${e}`,
      children: o.jsxs(Te, {
        className: Xe,
        variant: "SurfaceVariant",
        direction: "Column",
        gap: "300",
        style: {
          width: "100%",
          minWidth: 500,
          minHeight: 100,
          maxHeight: 240,
          boxSizing: "border-box",
          display: "flex",
          flexDirection: "column",
          alignItems: "stretch",
          justifyContent: "flex-start",
          position: "relative",
          overflow: "visible"
        },
        children: [
          o.jsxs(E, {
            direction: "Row",
            gap: "200",
            alignItems: "Center",
            style: {
              width: "100%",
              marginBottom: ee.space.S200
            },
            children: [
              o.jsx(D, {
                size: "H6",
                id: `profile-editor-title-${e}`,
                style: {
                  minWidth: 90
                },
                children: "Profile ID:"
              }),
              o.jsx(mn, {
                required: true,
                name: "idInput",
                id: `idInput-${e}`,
                value: f,
                onChange: G,
                variant: "Secondary",
                radii: "300",
                style: {
                  flex: 1,
                  minWidth: 0,
                  maxWidth: "clamp(200px, 60vw, 480px)",
                  paddingRight: ee.space.S200,
                  fontSize: 16,
                  height: 50
                },
                placeholder: "Profile ID",
                "aria-label": "profile id",
                title: "profile id"
              })
            ]
          }),
          o.jsxs(E, {
            direction: "Row",
            children: [
              o.jsxs(E, {
                direction: "Column",
                alignItems: "Center",
                justifyContent: "Center",
                gap: "100",
                style: {
                  minWidth: 80,
                  maxWidth: 100,
                  maxHeight: 100,
                  flexShrink: 0,
                  overflow: "visible",
                  marginTop: 20
                },
                "aria-label": "Avatar and upload",
                children: [
                  o.jsx(xn, {
                    size: "300",
                    radii: "300",
                    style: {
                      width: "clamp(25px, 8vw, 50px)",
                      height: "clamp(25px, 8vw, 50px)",
                      minWidth: 48,
                      minHeight: 48,
                      maxWidth: 72,
                      maxHeight: 72
                    },
                    "aria-label": "Profile avatar",
                    children: o.jsx(Si, {
                      userId: e,
                      src: M,
                      renderFallback: () => o.jsx(D, {
                        size: "H4",
                        "aria-label": "Avatar fallback",
                        children: "p"
                      }),
                      alt: `Avatar for profile ${e}`
                    })
                  }),
                  o.jsx(xe, {
                    onClick: () => N("image/*"),
                    size: "300",
                    variant: "Secondary",
                    fill: "Soft",
                    outlined: true,
                    radii: "300",
                    style: {
                      width: "clamp(30px, 6vw, 60px)",
                      marginTop: ee.space.S100,
                      overflow: "visible",
                      fontSize: 14,
                      padding: "0 8px"
                    },
                    "aria-label": "Upload avatar image",
                    children: o.jsx(D, {
                      size: "T200",
                      children: "Upload"
                    })
                  }),
                  I && o.jsx(E, {
                    gap: "100",
                    direction: "Column",
                    style: {
                      width: "100%",
                      maxWidth: 100,
                      maxHeight: 100,
                      overflow: "visible"
                    },
                    "aria-label": "Upload area",
                    children: o.jsx(xh, {
                      uploadAtom: I,
                      onRemove: L,
                      onComplete: H
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                direction: "Column",
                alignItems: "Center",
                justifyContent: "Center",
                style: {
                  flex: 1,
                  minWidth: 0,
                  height: "100%"
                },
                "aria-label": "Display name input",
                children: [
                  o.jsx(D, {
                    size: "T300",
                    style: {
                      marginBottom: ee.space.S200,
                      alignSelf: "flex-start"
                    },
                    children: "Display Name:"
                  }),
                  o.jsx(mn, {
                    required: true,
                    name: "displayNameInput",
                    id: `displayNameInput-${e}`,
                    value: C,
                    onChange: V,
                    variant: "Secondary",
                    radii: "300",
                    style: {
                      flex: 1,
                      minWidth: 0,
                      width: "100%",
                      maxWidth: "clamp(200px, 60vw, 480px)",
                      paddingRight: ee.space.S200,
                      fontSize: 16,
                      height: 50
                    },
                    placeholder: "Display name",
                    readOnly: Z || oe,
                    "aria-label": `Display name for ${e}`,
                    title: `Display name for ${e}`,
                    after: C !== (c ?? "") && !Z && o.jsx(Oe, {
                      type: "reset",
                      onClick: ne,
                      size: "300",
                      radii: "300",
                      variant: "Secondary",
                      "aria-label": "Reset display name",
                      title: "Reset display name",
                      children: o.jsx(Q, {
                        src: q.Cross,
                        size: "100",
                        "aria-label": "Reset icon"
                      })
                    })
                  }),
                  o.jsx(D, {
                    size: "T300",
                    style: {
                      marginTop: ee.space.S100,
                      marginBottom: ee.space.S200,
                      alignSelf: "flex-start"
                    },
                    children: "Pronouns:"
                  }),
                  o.jsx(mn, {
                    required: true,
                    name: "pronounsInput",
                    id: `pronounsInput-${e}`,
                    value: j,
                    onChange: le,
                    variant: "Secondary",
                    radii: "300",
                    style: {
                      flex: 1,
                      minWidth: 0,
                      width: "100%",
                      maxWidth: "clamp(200px, 60vw, 480px)",
                      paddingRight: ee.space.S200,
                      fontSize: 16,
                      height: 50
                    },
                    placeholder: "Pronouns",
                    readOnly: Z || oe,
                    "aria-label": `Pronouns for ${e}`,
                    title: `Pronouns for ${e}`,
                    after: j !== b && o.jsx(Oe, {
                      type: "reset",
                      onClick: ae,
                      size: "300",
                      radii: "300",
                      variant: "Secondary",
                      "aria-label": "Reset pronouns",
                      title: "Reset pronouns",
                      children: o.jsx(Q, {
                        src: q.Cross,
                        size: "100",
                        "aria-label": "Reset icon"
                      })
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                direction: "Column",
                alignItems: "Center",
                justifyContent: "Center",
                style: {
                  minWidth: 120,
                  maxWidth: 140,
                  flexShrink: 0,
                  height: "100%"
                },
                "aria-label": `Save button area for ${e}`,
                children: [
                  o.jsx(xe, {
                    onClick: X,
                    size: "300",
                    radii: "300",
                    variant: "Primary",
                    disabled: !de,
                    style: {
                      minWidth: 120,
                      height: "clamp(30px, 6vw, 50px)",
                      display: "flex",
                      alignItems: "center",
                      justifyContent: "center"
                    },
                    "aria-label": `Save profile changes for ${e}`,
                    title: `Save profile changes for ${e}`,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Save"
                    })
                  }),
                  o.jsx(xe, {
                    onClick: K,
                    size: "300",
                    radii: "300",
                    variant: "Critical",
                    fill: "None",
                    style: {
                      minWidth: 120,
                      height: "clamp(30px, 6vw, 50px)",
                      marginTop: ee.space.S100,
                      display: "flex",
                      alignItems: "center",
                      justifyContent: "center"
                    },
                    "aria-label": `Delete profile ${e}`,
                    title: `Delete profile ${e}`,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Delete"
                    })
                  })
                ]
              })
            ]
          })
        ]
      })
    });
  }
  function Hqe() {
    const t = be(), [e, n] = p.useState([]);
    p.useEffect(() => {
      (async () => {
        const a = await wy(t);
        n(a);
      })();
    }, [
      t
    ]);
    const r = (i) => {
      n((a) => a.filter((s) => s.id !== i));
    };
    return o.jsxs(E, {
      gap: "100",
      direction: "Column",
      alignItems: "Start",
      children: [
        o.jsxs(E, {
          direction: "Row",
          gap: "100",
          alignItems: "Center",
          children: [
            o.jsx(D, {
              size: "H4",
              children: "Per-Message Profiles"
            }),
            o.jsx(xe, {
              onClick: () => {
                const i = {
                  id: Cde(5),
                  name: "New Profile"
                };
                gF(t, i).then(() => {
                  n((a) => [
                    ...a,
                    i
                  ]);
                });
              },
              variant: "Primary",
              children: o.jsx(D, {
                size: "H5",
                children: "Add"
              })
            })
          ]
        }),
        e.map((i) => o.jsx(Vqe, {
          mx: t,
          profileId: i.id,
          avatarMxcUrl: i.avatarUrl,
          displayName: i.name,
          pronouns: i.pronouns,
          onDelete: r
        }, `profile-list-item-${i.id}`))
      ]
    });
  }
  function $qe() {
    const [t, e] = Fe(ge, "pkCompat"), [n, r] = Fe(ge, "pmpProxying");
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Limited Compatibility with PluralKit-like functions"
        }),
        o.jsxs(Te, {
          className: Xe,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(Ie, {
              focusId: "enable-pk-commands",
              title: "Enable PK commands",
              description: "If enabled, it will enable a few pk style commands, currently verry limited",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: t,
                onChange: e,
                title: t ? "disable pk; commands" : "enable pk; commands"
              })
            }),
            o.jsx(Ie, {
              focusId: "enable-pk-shorthands",
              title: "Enable Shorthands",
              description: "If enabled, you can use shorthands to use a Persona for one message only (eg. '\u2728:test')",
              after: o.jsx(Jt, {
                variant: "Primary",
                value: n,
                onChange: r,
                title: n ? "disable checking typed messages for shorthands" : "enable checking typed messages for shorthands"
              })
            })
          ]
        })
      ]
    });
  }
  function Wqe({ requestBack: t, requestClose: e }) {
    return o.jsx(Qc, {
      title: "Persona",
      requestBack: t,
      requestClose: e,
      children: o.jsx(mh, {
        children: o.jsxs(E, {
          grow: "Yes",
          gap: "200",
          style: {
            paddingLeft: "20px",
            paddingRight: "20px",
            paddingTop: "10px",
            marginRight: "5px",
            marginLeft: "5px"
          },
          direction: "Column",
          shrink: "No",
          children: [
            o.jsx($qe, {}),
            o.jsx(Hqe, {})
          ]
        })
      })
    });
  }
  const Zw = Bke.split(" ").filter(Boolean), qqe = (t) => t.closest('[data-sequence-card="true"]') ?? t.parentElement ?? t, Kqe = (t) => document.getElementById(t) ?? Array.from(document.querySelectorAll("[data-settings-focus]")).find((e) => e.getAttribute("data-settings-focus") === t) ?? null, $5 = "settingsFocusHandledKey";
  function Gqe() {
    var _a6;
    const t = br(), e = Za(), n = new URLSearchParams(e.search).get("focus"), r = n ? `${e.pathname}${e.search}` : void 0, i = (_a6 = e.state) == null ? void 0 : _a6[$5], a = p.useRef(null), s = p.useRef(void 0);
    p.useEffect(() => () => {
      var _a7;
      s.current !== void 0 && (window.clearTimeout(s.current), s.current = void 0), (_a7 = a.current) == null ? void 0 : _a7.classList.remove(...Zw), a.current = null;
    }, []), p.useEffect(() => {
      var _a7;
      if (!n || !r || i === r) return;
      const l = Kqe(n);
      if (!l) return;
      const c = qqe(l);
      a.current && a.current !== c && a.current.classList.remove(...Zw), s.current !== void 0 && (window.clearTimeout(s.current), s.current = void 0), (_a7 = l.scrollIntoView) == null ? void 0 : _a7.call(l, {
        block: "center",
        behavior: "smooth"
      }), c.classList.add(...Zw), a.current = c, t({
        pathname: e.pathname,
        search: e.search,
        hash: e.hash
      }, {
        replace: true,
        state: e.state && typeof e.state == "object" ? {
          ...e.state,
          [$5]: r
        } : {
          [$5]: r
        }
      }), s.current = window.setTimeout(() => {
        c.classList.remove(...Zw), a.current === c && (a.current = null), s.current = void 0;
      }, 3e3);
    }, [
      n,
      r,
      i,
      e.hash,
      e.pathname,
      e.search,
      e.state,
      t
    ]);
  }
  const Yqe = {
    general: {
      icon: q.Setting
    },
    account: {
      icon: q.User
    },
    persona: {
      icon: q.User
    },
    appearance: {
      icon: q.Alphabet,
      activeIcon: q.AlphabetUnderline
    },
    notifications: {
      icon: q.Bell
    },
    devices: {
      icon: q.Monitor
    },
    emojis: {
      icon: q.Smile
    },
    "developer-tools": {
      icon: q.Terminal
    },
    experimental: {
      icon: q.Funnel
    },
    about: {
      icon: q.Info
    },
    "keyboard-shortcuts": {
      icon: q.BlockCode
    }
  }, Zqe = {
    0: "general",
    1: "account",
    2: "persona",
    3: "notifications",
    4: "devices",
    5: "emojis",
    6: "appearance",
    7: "developer-tools",
    8: "experimental",
    9: "about",
    10: "keyboard-shortcuts"
  }, Jqe = {
    general: 0,
    account: 1,
    persona: 2,
    appearance: 6,
    notifications: 3,
    devices: 4,
    emojis: 5,
    "developer-tools": 7,
    experimental: 8,
    about: 9,
    "keyboard-shortcuts": 10
  }, Xqe = {
    general: JWe,
    account: OUe,
    persona: Wqe,
    appearance: zVe,
    notifications: Aqe,
    devices: sWe,
    emojis: xWe,
    "developer-tools": hHe,
    experimental: tqe,
    about: Mke,
    "keyboard-shortcuts": oqe
  };
  function Qqe({ section: t, requestBack: e, requestClose: n }) {
    Gqe();
    const r = Xqe[t];
    return o.jsx(r, {
      requestBack: e,
      requestClose: n
    });
  }
  function eKe({ activeSection: t, onSelectSection: e, onBack: n, requestClose: r, initialPage: i }) {
    const a = be(), s = hn(), l = a.getUserId(), c = Hc(l), d = c.displayName ?? _n(l) ?? l, u = c.avatarUrl ? Cn(a, c.avatarUrl, s, 96, 96, "crop") ?? void 0 : void 0, [h] = Fe(ge, "showPersonaSetting"), f = gs(), g = fr(), m = t !== void 0, [v, y] = p.useState(() => i === 2 && !h ? 0 : i || (g === sn.Mobile ? void 0 : 0)), w = p.useMemo(() => {
      if (m) return t;
      if (v === void 0) return null;
      const T = Zqe[v];
      return T === "persona" && !h ? "general" : T;
    }, [
      t,
      m,
      v,
      h
    ]), b = p.useMemo(() => Rk.filter((T) => h || T.id !== "persona").map((T) => {
      const A = Yqe[T.id];
      return {
        id: T.id,
        name: T.label,
        ...A
      };
    }), [
      h
    ]), j = (T) => {
      if (m) {
        e == null ? void 0 : e(T);
        return;
      }
      y(Jqe[T]);
    }, k = () => {
      if (m) {
        r();
        return;
      }
      if (g === sn.Mobile) {
        y(void 0);
        return;
      }
      r();
    }, C = () => {
      if (m) {
        n == null ? void 0 : n();
        return;
      }
      if (g === sn.Mobile) {
        y(void 0);
        return;
      }
      y(0);
    }, S = w !== null && g === sn.Mobile ? C : void 0;
    return o.jsx(df, {
      nav: g === sn.Mobile && w !== null ? void 0 : o.jsxs(qf, {
        size: "300",
        children: [
          o.jsx(Kf, {
            className: Qie,
            size: "600",
            children: o.jsxs(E, {
              grow: "Yes",
              gap: "200",
              children: [
                o.jsxs(E, {
                  grow: "Yes",
                  alignItems: "Center",
                  gap: "200",
                  children: [
                    o.jsx(xn, {
                      size: "200",
                      radii: "300",
                      children: o.jsx(Si, {
                        userId: l,
                        src: u,
                        renderFallback: () => o.jsx(D, {
                          size: "H6",
                          children: Vi(d)
                        })
                      })
                    }),
                    o.jsx(D, {
                      size: "H4",
                      truncate: true,
                      children: "Settings"
                    })
                  ]
                }),
                o.jsx(E, {
                  shrink: "No",
                  children: w === null && o.jsx(Oe, {
                    "aria-label": "Close settings",
                    onClick: k,
                    variant: "Background",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                })
              ]
            })
          }),
          o.jsxs(E, {
            grow: "Yes",
            direction: "Column",
            children: [
              o.jsx(mh, {
                children: o.jsx("div", {
                  style: {
                    flexGrow: 1
                  },
                  children: b.map((T) => {
                    const A = w === T.id && T.activeIcon ? T.activeIcon : T.icon;
                    return o.jsx(Ye, {
                      variant: "Background",
                      radii: "400",
                      "aria-pressed": w === T.id,
                      before: o.jsx(Q, {
                        src: A,
                        size: g === sn.Mobile ? "200" : "100",
                        filled: w === T.id
                      }),
                      onClick: () => j(T.id),
                      children: o.jsx(D, {
                        style: {
                          fontWeight: w === T.id ? ee.fontWeight.W600 : void 0
                        },
                        size: g === sn.Mobile ? "T400" : "T300",
                        truncate: true,
                        children: T.name
                      })
                    }, T.id);
                  })
                })
              }),
              o.jsx(E, {
                style: {
                  padding: ee.space.S200
                },
                shrink: "No",
                direction: "Column",
                children: o.jsx(Hi, {
                  initial: false,
                  children: (T, A) => o.jsxs(o.Fragment, {
                    children: [
                      o.jsx(xe, {
                        size: "300",
                        variant: "Critical",
                        fill: "None",
                        radii: "Pill",
                        before: o.jsx(Q, {
                          src: q.Power,
                          size: "100"
                        }),
                        onClick: () => A(true),
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Logout"
                        })
                      }),
                      T && o.jsx(Hn, {
                        open: true,
                        backdrop: o.jsx($n, {}),
                        children: o.jsx(Wn, {
                          children: o.jsx(Ft, {
                            focusTrapOptions: {
                              onDeactivate: () => A(false),
                              clickOutsideDeactivates: true,
                              escapeDeactivates: kt
                            },
                            children: o.jsx(Pie, {
                              handleClose: () => A(false)
                            })
                          })
                        })
                      })
                    ]
                  })
                })
              })
            ]
          })
        ]
      }),
      children: w && o.jsx(Cke, {
        value: {
          section: w,
          baseUrl: f
        },
        children: o.jsx(Qqe, {
          section: w,
          requestBack: S,
          requestClose: k
        })
      })
    });
  }
  function Ede(t) {
    const e = t == null ? void 0 : t.backgroundLocation;
    return e ? {
      to: {
        pathname: e.pathname,
        search: e.search,
        hash: e.hash
      },
      state: e.state
    } : {
      to: $c()
    };
  }
  function tKe(t, e, n) {
    return t === void 0 ? e === sn.Mobile ? null : "general" : !rP(t) || t === "persona" && !n ? null : t;
  }
  function kde({ routeSection: t }) {
    var _a6;
    const { section: e } = Fl(), n = t ?? e, r = br(), i = Za(), a = fr(), [s] = Fe(ge, "showPersonaSetting"), l = i.state, c = a !== sn.Mobile && !!(l == null ? void 0 : l.backgroundLocation), d = ho(i.pathname), u = i.pathname.length > d.length && d.startsWith("/settings"), h = typeof window < "u" && typeof ((_a6 = window.history.state) == null ? void 0 : _a6.idx) == "number" ? window.history.state.idx : null, f = typeof h == "number" && h > 0 || i.key !== "default", g = tKe(n, a, s), m = n === void 0 && a !== sn.Mobile, v = n !== void 0 && g === null;
    if (p.useEffect(() => {
      if (u) {
        r({
          pathname: d,
          search: i.search,
          hash: i.hash
        }, {
          replace: true,
          state: l
        });
        return;
      }
      if (m) {
        r(ig("general"), {
          replace: true,
          state: (l == null ? void 0 : l.backgroundLocation) ? l : {
            redirectedFromDesktopRoot: true
          }
        });
        return;
      }
      v && r(ig(), {
        replace: true,
        state: l
      });
    }, [
      d,
      i.hash,
      i.search,
      r,
      l,
      u,
      m,
      v
    ]), u || m || v) return null;
    const y = () => {
      if (n === void 0) return;
      if (a === sn.Mobile) {
        if (f) {
          r(-1);
          return;
        }
        r(ig(), {
          replace: true,
          state: (l == null ? void 0 : l.backgroundLocation) ? l : void 0
        });
        return;
      }
      let j;
      (l == null ? void 0 : l.backgroundLocation) ? j = l : (l == null ? void 0 : l.redirectedFromDesktopRoot) && (j = {
        redirectedFromDesktopRoot: true
      }), r(ig("general"), {
        replace: true,
        state: j
      });
    }, w = () => {
      const j = Ede(l);
      r(j.to, {
        replace: true,
        state: j.state
      });
    }, b = (j) => {
      j !== g && r(ig(j), {
        replace: c,
        state: i.state
      });
    };
    return o.jsx(eKe, {
      activeSection: g,
      onBack: y,
      onSelectSection: b,
      requestClose: w
    });
  }
  function yS({ requestClose: t, children: e }) {
    const n = p.useRef(null);
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            fallbackFocus: () => n.current ?? document.body,
            clickOutsideDeactivates: true,
            onDeactivate: t,
            escapeDeactivates: kt
          },
          children: o.jsx(Go, {
            ref: n,
            tabIndex: -1,
            size: "500",
            variant: "Background",
            children: e
          })
        })
      })
    });
  }
  const WM = (t, e, n) => n === sn.Mobile || !Wo(PF, t) ? false : !!(e == null ? void 0 : e.backgroundLocation);
  function nKe() {
    const t = xee(), e = Za(), n = fr(), r = p.useRef(t);
    return WM(e.pathname, e.state, n) ? r.current : (r.current = t, t);
  }
  function rKe() {
    const t = br(), e = Za(), n = fr(), r = e.state, i = Wo(PF, e.pathname);
    if (!WM(e.pathname, e.state, n) || !i) return null;
    const a = () => {
      const s = Ede(r);
      t(s.to, {
        replace: true,
        state: s.state
      });
    };
    return o.jsx(yS, {
      requestClose: a,
      children: o.jsx(kde, {
        routeSection: i.params.section
      })
    });
  }
  async function As(t, e, n) {
    const r = t.getRoom(e);
    if (!r) return;
    const i = r.getLiveTimeline().getEvents(), a = r.getEventReadUpTo(t.getUserId()), s = () => {
      for (let d = i.length - 1; d >= 0; d -= 1) {
        const u = i[d];
        if (u) {
          if (u.getId() === a) return null;
          if (!u.isSending()) return u;
        }
      }
      return null;
    };
    if (i.length === 0) return;
    const l = s();
    if (l === null) return;
    const c = l.getId();
    c && (n ? await t.setRoomReadMarkers(e, c, void 0, l) : await t.setRoomReadMarkers(e, c, l), await t.sendReadReceipt(l, n ? ia.ReadPrivate : ia.Read));
  }
  const Sde = p.createContext(null), jde = Sde.Provider, am = () => {
    const t = p.useContext(Sde);
    if (!t) throw new Error("Auto Discovery Info not loaded");
    return t;
  }, Tde = (t) => {
    const e = t["org.matrix.msc4143.rtc_foci"];
    return Array.isArray(e) && e.some((n) => typeof n.livekit_service_url == "string");
  }, iKe = () => {
    const t = am();
    return Tde(t);
  }, QF = (t) => {
    const e = be(), [n, r] = p.useState(e.matrixRTC.getRoomSession(t));
    return p.useEffect(() => {
      const i = (s) => {
        s === t.roomId && r(e.matrixRTC.getRoomSession(t));
      }, a = (s) => {
        s === t.roomId && r(e.matrixRTC.getRoomSession(t));
      };
      return e.matrixRTC.on(Id.SessionStarted, i), e.matrixRTC.on(Id.SessionEnded, a), () => {
        e.matrixRTC.off(Id.SessionStarted, i), e.matrixRTC.off(Id.SessionEnded, a);
      };
    }, [
      e,
      t
    ]), n;
  }, x3 = (t, e) => {
    const [n, r] = p.useState(rl.sessionMembershipsForRoom(t, e.sessionDescription));
    return p.useEffect(() => {
      const i = () => {
        r(rl.sessionMembershipsForRoom(t, e.sessionDescription));
      };
      return i(), e.on(Js.MembershipsChanged, i), () => {
        e.removeListener(Js.MembershipsChanged, i);
      };
    }, [
      e,
      t
    ]), n;
  }, oKe = (t, e) => {
    p.useEffect(() => (t.on(Js.MembershipsChanged, e), () => {
      t.removeListener(Js.MembershipsChanged, e);
    }), [
      t,
      e
    ]);
  };
  function aKe(t, e, n) {
    const r = /* @__PURE__ */ new Set();
    return r.add(Bn.MatrixCapabilities.Screenshots), r.add(Bn.MatrixCapabilities.AlwaysOnScreen), r.add(Bn.MatrixCapabilities.MSC3846TurnServers), r.add(Bn.MatrixCapabilities.MSC4157SendDelayedEvent), r.add(Bn.MatrixCapabilities.MSC4157UpdateDelayedEvent), r.add("moe.sable.thumbnails"), r.add("moe.sable.media_proxy"), r.add(`org.matrix.msc2762.timeline:${t}`), r.add(`org.matrix.msc2762.state:${t}`), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Receive, ce.RoomMember).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Receive, "org.matrix.msc3401.call").raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Receive, ce.RoomEncryption).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Receive, ce.RoomName).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Send, "org.matrix.msc3401.call.member", e).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Send, "org.matrix.msc3401.call.member", `_${e}_${n}_m.call`).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Send, "org.matrix.msc3401.call.member", `${e}_${n}_m.call`).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Send, "org.matrix.msc3401.call.member", `_${e}_${n}`).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Send, "org.matrix.msc3401.call.member", `${e}_${n}`).raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Receive, "org.matrix.msc3401.call.member").raw), r.add(Bn.WidgetEventCapability.forStateEvent(Bn.EventDirection.Receive, ce.RoomCreate).raw), [
      "io.element.call.encryption_keys",
      "org.matrix.rageshake_request",
      ce.Reaction,
      ce.RoomRedaction,
      "io.element.call.reaction",
      "org.matrix.msc4310.rtc.decline",
      "org.matrix.msc4075.call.notify",
      "org.matrix.msc4075.rtc.notification",
      "org.matrix.msc4143.rtc.member"
    ].forEach((i) => {
      r.add(Bn.WidgetEventCapability.forRoomEvent(Bn.EventDirection.Send, i).raw), r.add(Bn.WidgetEventCapability.forRoomEvent(Bn.EventDirection.Receive, i).raw);
    }), [
      ce.CallInvite,
      ce.CallCandidates,
      ce.CallAnswer,
      ce.CallHangup,
      ce.CallReject,
      ce.CallSelectAnswer,
      ce.CallNegotiate,
      ce.CallSDPStreamMetadataChanged,
      ce.CallSDPStreamMetadataChangedPrefix,
      ce.CallReplaces,
      ce.CallEncryptionKeysPrefix
    ].forEach((i) => {
      r.add(Bn.WidgetEventCapability.forToDeviceEvent(Bn.EventDirection.Send, i).raw), r.add(Bn.WidgetEventCapability.forToDeviceEvent(Bn.EventDirection.Receive, i).raw);
    }), r;
  }
  const G_ = fo("CallWidgetDriver");
  class sKe extends Bn.WidgetDriver {
    constructor(e, n) {
      super();
      __publicField(this, "allowedCapabilities");
      __publicField(this, "mx");
      this.inRoomId = n, this.mx = e;
      const r = e.getDeviceId();
      if (!r) throw G_.error("call", "Failed to initialize CallWidgetDriver - no device ID"), new Error("Failed to initialize CallWidgetDriver! Device ID not found.");
      G_.info("call", "Initializing CallWidgetDriver", {
        roomId: n,
        deviceId: r
      }), this.allowedCapabilities = aKe(n, e.getSafeUserId(), r);
    }
    async validateCapabilities(e) {
      const n = Array.from(e).filter((r) => this.allowedCapabilities.has(r));
      return new Set(n);
    }
    async sendEvent(e, n, r = null, i = null) {
      const a = this.mx, s = i || this.inRoomId;
      if (!a || !s) throw G_.error("call", "Cannot send event - no client or room", {
        eventType: e,
        roomId: s
      }), new Error("Not in a room or not attached to a client");
      G_.info("call", "Sending call event", {
        eventType: e,
        roomId: s,
        hasStateKey: r !== null
      });
      let l;
      return typeof r == "string" ? l = await a.sendStateEvent(s, e, n, r) : e === ce.RoomRedaction ? l = await a.redactEvent(s, n.redacts) : l = await a.sendEvent(s, e, n), G_.info("call", "Call event sent successfully", {
        eventId: l.event_id,
        eventType: e
      }), {
        roomId: s,
        eventId: l.event_id
      };
    }
    async sendDelayedEvent(e, n, r, i, a = null, s = null) {
      const l = this.mx, c = s || this.inRoomId;
      if (!l || !c) throw new Error("Not in a room or not attached to a client");
      let d;
      if (e !== null) d = {
        delay: e,
        ...n !== null && {
          parent_delay_id: n
        }
      };
      else if (n !== null) d = {
        parent_delay_id: n
      };
      else throw new Error("Must provide at least one of delay or parentDelayId");
      let u;
      return a !== null ? u = await l._unstable_sendDelayedStateEvent(c, d, r, i, a) : u = await l._unstable_sendDelayedEvent(c, d, null, r, i), {
        roomId: c,
        delayId: u.delay_id
      };
    }
    async updateDelayedEvent(e, n) {
      const r = this.mx;
      if (!r) throw new Error("Not in a room or not attached to a client");
      await r._unstable_updateDelayedEvent(e, n);
    }
    async cancelScheduledDelayedEvent(e) {
      await this.updateDelayedEvent(e, Bn.UpdateDelayedEventAction.Cancel);
    }
    async restartScheduledDelayedEvent(e) {
      await this.updateDelayedEvent(e, Bn.UpdateDelayedEventAction.Restart);
    }
    async sendScheduledDelayedEvent(e) {
      await this.updateDelayedEvent(e, Bn.UpdateDelayedEventAction.Send);
    }
    async sendToDevice(e, n, r) {
      const i = this.mx;
      if (n) {
        const a = i.getCrypto();
        if (!a) throw new Error("E2EE not enabled");
        const s = {};
        for (const l of Object.keys(r)) {
          const c = r[l];
          if (c) for (const d of Object.keys(c)) {
            const u = c[d], h = JSON.stringify(u);
            s[h] = s[h] || [], s[h].push({
              userId: l,
              deviceId: d
            });
          }
        }
        await Promise.all(Object.entries(s).map(async ([l, c]) => {
          const d = await a.encryptToDeviceMessages(e, c, JSON.parse(l));
          await i.queueToDevice(d);
        }));
      } else await i.queueToDevice({
        eventType: e,
        batch: Object.entries(r).flatMap(([a, s]) => Object.entries(s).map(([l, c]) => ({
          userId: a,
          deviceId: l,
          payload: c
        })))
      });
    }
    async readRoomTimeline(e, n, r, i, a, s) {
      const l = a > 0 ? Math.min(a, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER, c = this.mx.getRoom(e);
      if (c === null) return [];
      const d = [], u = c.getLiveTimeline().getEvents();
      for (let h = u.length - 1; h >= 0; h -= 1) {
        const f = u[h];
        if (f) {
          if (d.length >= l || s !== void 0 && f.getId() === s) break;
          f.getType() === n && !f.isState() && (n !== ce.RoomMessage || !r || r === f.getContent().msgtype) && (f.getStateKey() === void 0 || i === void 0 || f.getStateKey() === i) && d.push(f);
        }
      }
      return d.map((h) => h.getEffectiveEvent());
    }
    async askOpenID(e) {
      return e.update({
        state: Bn.OpenIDRequestState.Allowed,
        token: await this.mx.getOpenIdToken()
      });
    }
    async readRoomState(e, n, r) {
      const i = this.mx.getRoom(e);
      if (i === null) return [];
      const a = i.getLiveTimeline().getState(Tn.Forward);
      if (a === void 0) return [];
      if (r === void 0) return a.getStateEvents(n).map((l) => l.getEffectiveEvent());
      const s = a.getStateEvents(n, r);
      return s === null ? [] : [
        s.getEffectiveEvent()
      ];
    }
    async readEventRelations(e, n, r, i, a, s, l, c) {
      const d = this.mx, u = c, h = n ?? this.inRoomId ?? void 0;
      if (typeof h != "string") throw new Error("Error while reading the current room");
      const { events: f, nextBatch: g, prevBatch: m } = await d.relations(h, e, r ?? null, i ?? null, {
        from: a,
        to: s,
        limit: l,
        dir: u
      });
      return {
        chunk: f.map((v) => v.getEffectiveEvent()),
        nextBatch: g ?? void 0,
        prevBatch: m ?? void 0
      };
    }
    async searchUserDirectory(e, n) {
      const r = this.mx, { limited: i, results: a } = await r.searchUserDirectory({
        term: e,
        limit: n
      });
      return {
        limited: i,
        results: a.map((s) => ({
          userId: s.user_id,
          displayName: s.display_name,
          avatarUrl: s.avatar_url
        }))
      };
    }
    async getMediaConfig() {
      return this.mx.getMediaConfig();
    }
    async uploadFile(e) {
      return {
        contentUri: (await this.mx.uploadContent(e)).content_uri
      };
    }
    async downloadFile(e) {
      const n = Cn(this.mx, e, true);
      if (!n) throw new Error("Call widget failed to download file! No http url!");
      return {
        file: await Gd(n)
      };
    }
    getKnownRooms() {
      return this.mx.getVisibleRooms().map((e) => e.roomId);
    }
    processError(e) {
      return e instanceof Un ? {
        matrix_api_error: e.asWidgetApiErrorData()
      } : void 0;
    }
  }
  var eg = ((t) => (t.StartCall = "start_call", t.JoinExisting = "join_existing", t.StartCallDM = "start_call_dm", t.JoinExistingDM = "join_existing_dm", t.StartCallDMVoice = "start_call_dm_voice", t.JoinExistingDMVoice = "join_existing_dm_voice", t))(eg || {}), Ou = ((t) => (t.JoinCall = "io.element.join", t.HangupCall = "im.vector.hangup", t.Close = "io.element.close", t.DeviceMute = "io.element.device_mute", t))(Ou || {}), W5 = {
    exports: {}
  }, qY;
  function lKe() {
    return qY || (qY = 1, (function(t) {
      var e = Object.prototype.hasOwnProperty, n = "~";
      function r() {
      }
      Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (n = false));
      function i(c, d, u) {
        this.fn = c, this.context = d, this.once = u || false;
      }
      function a(c, d, u, h, f) {
        if (typeof u != "function") throw new TypeError("The listener must be a function");
        var g = new i(u, h || c, f), m = n ? n + d : d;
        return c._events[m] ? c._events[m].fn ? c._events[m] = [
          c._events[m],
          g
        ] : c._events[m].push(g) : (c._events[m] = g, c._eventsCount++), c;
      }
      function s(c, d) {
        --c._eventsCount === 0 ? c._events = new r() : delete c._events[d];
      }
      function l() {
        this._events = new r(), this._eventsCount = 0;
      }
      l.prototype.eventNames = function() {
        var d = [], u, h;
        if (this._eventsCount === 0) return d;
        for (h in u = this._events) e.call(u, h) && d.push(n ? h.slice(1) : h);
        return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(u)) : d;
      }, l.prototype.listeners = function(d) {
        var u = n ? n + d : d, h = this._events[u];
        if (!h) return [];
        if (h.fn) return [
          h.fn
        ];
        for (var f = 0, g = h.length, m = new Array(g); f < g; f++) m[f] = h[f].fn;
        return m;
      }, l.prototype.listenerCount = function(d) {
        var u = n ? n + d : d, h = this._events[u];
        return h ? h.fn ? 1 : h.length : 0;
      }, l.prototype.emit = function(d, u, h, f, g, m) {
        var v = n ? n + d : d;
        if (!this._events[v]) return false;
        var y = this._events[v], w = arguments.length, b, j;
        if (y.fn) {
          switch (y.once && this.removeListener(d, y.fn, void 0, true), w) {
            case 1:
              return y.fn.call(y.context), true;
            case 2:
              return y.fn.call(y.context, u), true;
            case 3:
              return y.fn.call(y.context, u, h), true;
            case 4:
              return y.fn.call(y.context, u, h, f), true;
            case 5:
              return y.fn.call(y.context, u, h, f, g), true;
            case 6:
              return y.fn.call(y.context, u, h, f, g, m), true;
          }
          for (j = 1, b = new Array(w - 1); j < w; j++) b[j - 1] = arguments[j];
          y.fn.apply(y.context, b);
        } else {
          var k = y.length, C;
          for (j = 0; j < k; j++) switch (y[j].once && this.removeListener(d, y[j].fn, void 0, true), w) {
            case 1:
              y[j].fn.call(y[j].context);
              break;
            case 2:
              y[j].fn.call(y[j].context, u);
              break;
            case 3:
              y[j].fn.call(y[j].context, u, h);
              break;
            case 4:
              y[j].fn.call(y[j].context, u, h, f);
              break;
            default:
              if (!b) for (C = 1, b = new Array(w - 1); C < w; C++) b[C - 1] = arguments[C];
              y[j].fn.apply(y[j].context, b);
          }
        }
        return true;
      }, l.prototype.on = function(d, u, h) {
        return a(this, d, u, h, false);
      }, l.prototype.once = function(d, u, h) {
        return a(this, d, u, h, true);
      }, l.prototype.removeListener = function(d, u, h, f) {
        var g = n ? n + d : d;
        if (!this._events[g]) return this;
        if (!u) return s(this, g), this;
        var m = this._events[g];
        if (m.fn) m.fn === u && (!f || m.once) && (!h || m.context === h) && s(this, g);
        else {
          for (var v = 0, y = [], w = m.length; v < w; v++) (m[v].fn !== u || f && !m[v].once || h && m[v].context !== h) && y.push(m[v]);
          y.length ? this._events[g] = y.length === 1 ? y[0] : y : s(this, g);
        }
        return this;
      }, l.prototype.removeAllListeners = function(d) {
        var u;
        return d ? (u = n ? n + d : d, this._events[u] && s(this, u)) : (this._events = new r(), this._eventsCount = 0), this;
      }, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = n, l.EventEmitter = l, t.exports = l;
    })(W5)), W5.exports;
  }
  var cKe = lKe();
  const dKe = da(cKe);
  class D1 {
    constructor(e, n, r, i = false, a = false) {
      __publicField(this, "microphone");
      __publicField(this, "video");
      __publicField(this, "sound");
      __publicField(this, "screenshare");
      __publicField(this, "spotlight");
      this.microphone = e, this.video = n, this.sound = r, this.screenshare = i, this.spotlight = a;
    }
  }
  var JI = ((t) => (t.StateUpdate = "state_update", t))(JI || {});
  let uKe = class extends dKe {
    constructor(e, n, r) {
      super();
      __publicField(this, "state");
      __publicField(this, "call");
      __publicField(this, "iframe");
      __publicField(this, "controlMutationObserver");
      this.state = e, this.call = n, this.iframe = r, this.controlMutationObserver = new MutationObserver(this.onControlMutation.bind(this));
    }
    get document() {
      var _a6;
      return this.iframe.contentDocument ?? ((_a6 = this.iframe.contentWindow) == null ? void 0 : _a6.document);
    }
    get screenshareButton() {
      var _a6;
      return ((_a6 = this.document) == null ? void 0 : _a6.querySelector('[data-testid="incall_screenshare"]')) ?? void 0;
    }
    get settingsButton() {
      var _a6, _b3;
      return ((_b3 = (_a6 = this.document) == null ? void 0 : _a6.querySelector('[data-testid="incall_leave"]')) == null ? void 0 : _b3.previousElementSibling) ?? void 0;
    }
    get reactionsButton() {
      var _a6;
      return ((_a6 = this.settingsButton) == null ? void 0 : _a6.previousElementSibling) ?? void 0;
    }
    get spotlightButton() {
      var _a6;
      return ((_a6 = this.document) == null ? void 0 : _a6.querySelector('input[value="spotlight"]')) ?? void 0;
    }
    get gridButton() {
      var _a6;
      return ((_a6 = this.document) == null ? void 0 : _a6.querySelector('input[value="grid"]')) ?? void 0;
    }
    getState() {
      return this.state;
    }
    get microphone() {
      return this.state.microphone;
    }
    get video() {
      return this.state.video;
    }
    get sound() {
      return this.state.sound;
    }
    get screenshare() {
      return this.state.screenshare;
    }
    get spotlight() {
      return this.state.spotlight;
    }
    async applyState() {
      await this.setMediaState({
        audio_enabled: this.microphone,
        video_enabled: this.video
      }), this.setSound(this.sound), this.emitStateUpdate();
    }
    startObserving() {
      this.controlMutationObserver.disconnect();
      const e = this.screenshareButton;
      e && this.controlMutationObserver.observe(e, {
        attributes: true,
        attributeFilter: [
          "data-kind"
        ]
      });
      const n = this.spotlightButton;
      n && this.controlMutationObserver.observe(n, {
        attributes: true
      }), this.onControlMutation();
    }
    applySound() {
      this.setSound(this.sound);
    }
    setMediaState(e) {
      return this.call.transport.send(Ou.DeviceMute, e);
    }
    setSound(e) {
      var _a6;
      const n = this.iframe.contentDocument ?? ((_a6 = this.iframe.contentWindow) == null ? void 0 : _a6.document);
      n && n.querySelectorAll("audio").forEach((r) => {
        r.muted = !e;
      });
    }
    onMediaState(e) {
      const { data: n } = e.detail;
      if (!n) return;
      const r = new D1(n.audio_enabled ?? this.microphone, n.video_enabled ?? this.video, this.sound, this.screenshare, this.spotlight);
      this.state = r, this.emitStateUpdate(), this.microphone && !this.sound && this.toggleSound();
    }
    onControlMutation() {
      var _a6, _b3;
      const e = ((_a6 = this.screenshareButton) == null ? void 0 : _a6.getAttribute("data-kind")) === "primary", n = ((_b3 = this.spotlightButton) == null ? void 0 : _b3.checked) ?? false;
      this.state = new D1(this.microphone, this.video, this.sound, e, n), this.emitStateUpdate();
    }
    toggleMicrophone() {
      const e = {
        audio_enabled: !this.microphone,
        video_enabled: this.video
      };
      return this.setMediaState(e);
    }
    toggleVideo() {
      const e = {
        audio_enabled: this.microphone,
        video_enabled: !this.video
      };
      return this.setMediaState(e);
    }
    toggleSound() {
      const e = !this.sound;
      this.setSound(e);
      const n = new D1(this.microphone, this.video, e, this.screenshare, this.spotlight);
      this.state = n, this.emitStateUpdate(), !this.sound && this.microphone && this.toggleMicrophone();
    }
    toggleScreenshare() {
      var _a6;
      (_a6 = this.screenshareButton) == null ? void 0 : _a6.click();
    }
    toggleSpotlight() {
      var _a6, _b3;
      if (this.spotlight) {
        (_a6 = this.gridButton) == null ? void 0 : _a6.click();
        return;
      }
      (_b3 = this.spotlightButton) == null ? void 0 : _b3.click();
    }
    toggleReactions() {
      var _a6;
      (_a6 = this.reactionsButton) == null ? void 0 : _a6.click();
    }
    toggleSettings() {
      var _a6;
      (_a6 = this.settingsButton) == null ? void 0 : _a6.click();
    }
    dispose() {
      this.controlMutationObserver.disconnect();
    }
    emitStateUpdate() {
      this.emit("state_update");
    }
  };
  const Y_ = fo("CallEmbed");
  class d2 {
    constructor(e, n, r, i, a) {
      __publicField(this, "mx");
      __publicField(this, "call");
      __publicField(this, "iframe");
      __publicField(this, "room");
      __publicField(this, "joined", false);
      __publicField(this, "control");
      __publicField(this, "container");
      __publicField(this, "readUpToMap", {});
      __publicField(this, "eventsToFeed", /* @__PURE__ */ new WeakSet());
      __publicField(this, "disposables", []);
      Y_.info("call", "Initializing call embed", {
        roomId: n.roomId
      });
      const s = d2.getIframe(r.getCompleteUrl({
        currentUserId: e.getSafeUserId()
      }));
      i.append(s);
      const l = new sKe(e, n.roomId), c = new Bn.ClientWidgetApi(r, s, l);
      this.mx = e, this.call = c, this.room = n, this.iframe = s, this.container = i;
      const d = a ?? new D1(true, false, true);
      this.control = new uKe(d, c, s), this.disposables.push(this.listenAction(Bn.WidgetApiFromWidgetAction.UpdateAlwaysOnScreen, (h) => {
        h.preventDefault(), this.call.transport.reply(h.detail, {
          success: true
        });
      })), this.disposables.push(this.listenAction(Ou.Close, (h) => {
        h.preventDefault(), this.call.transport.reply(h.detail, {});
      }));
      let u = true;
      this.disposables.push(this.listenAction(Ou.DeviceMute, (h) => {
        if (h.preventDefault(), this.call.transport.reply(h.detail, {}), u) {
          u = false, this.control.applyState();
          return;
        }
        this.control.onMediaState(h);
      })), this.start();
    }
    static getIntent(e, n, r) {
      return e ? n ? r ? eg.JoinExistingDM : eg.JoinExistingDMVoice : r ? eg.StartCallDM : eg.StartCallDMVoice : r ? eg.JoinExisting : eg.JoinExistingDMVoice;
    }
    static getWidget(e, n, r, i) {
      const a = e.getSafeUserId(), s = e.getDeviceId() ?? "", l = window.location.origin, c = "call-embed", d = new URLSearchParams({
        widgetId: c,
        parentUrl: l,
        baseUrl: e.baseUrl,
        roomId: n.roomId,
        userId: a,
        deviceId: s,
        intent: r,
        skipLobby: "true",
        confineToRoom: "true",
        appPrompt: "false",
        perParticipantE2EE: n.hasEncryptionStateEvent().toString(),
        lang: "en-EN",
        theme: i
      }), u = new URL(`${ho("/sable")}/public/element-call/index.html`, window.location.origin);
      u.search = d.toString();
      const h = {
        id: c,
        creatorUserId: a,
        name: "Call",
        type: "m.call",
        url: u.href,
        waitForIframeLoad: false,
        data: {}
      };
      return new Bn.Widget(h);
    }
    static getIframe(e) {
      const n = document.createElement("iframe");
      return n.title = "Call Embed", n.sandbox = "allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-downloads", n.allow = "microphone; camera; display-capture; autoplay; clipboard-write;", n.src = e, n.style.width = "100%", n.style.height = "100%", n.style.border = "none", n;
    }
    get roomId() {
      return this.room.roomId;
    }
    get document() {
      var _a6;
      return this.iframe.contentDocument ?? ((_a6 = this.iframe.contentWindow) == null ? void 0 : _a6.document);
    }
    setTheme(e) {
      return this.call.transport.send(Bn.WidgetApiToWidgetAction.ThemeChange, {
        name: e
      });
    }
    hangup() {
      return Y_.info("call", "Hanging up call", {
        roomId: this.roomId
      }), this.call.transport.send(Ou.HangupCall, {});
    }
    onPreparing(e) {
      return this.listenEvent("preparing", e);
    }
    onPreparingError(e) {
      return this.listenEvent("error:preparing", e);
    }
    onReady(e) {
      return this.listenEvent("ready", e);
    }
    onCapabilitiesNotified(e) {
      return this.listenEvent("capabilitiesNotified", e);
    }
    start() {
      Y_.info("call", "Starting call widget", {
        roomId: this.roomId
      }), this.call.setViewedRoomId(this.roomId), this.disposables.push(this.listenAction(Ou.JoinCall, this.onCallJoined.bind(this))), this.mx.getRooms().forEach((a) => {
        var _a6;
        const s = ((_a6 = a.getLiveTimeline()) == null ? void 0 : _a6.getEvents()) || [], l = s[s.length - 1];
        l && (this.readUpToMap[a.roomId] = l.getId());
      });
      const e = this.onEvent.bind(this), n = this.onEventDecrypted.bind(this), r = this.onStateUpdate.bind(this), i = this.onToDeviceEvent.bind(this);
      this.mx.on(jt.Event, e), this.mx.on(or.Decrypted, n), this.mx.on(qn.Events, r), this.mx.on(jt.ToDeviceEvent, i), this.disposables.push(() => {
        this.mx.off(jt.Event, e), this.mx.off(or.Decrypted, n), this.mx.off(qn.Events, r), this.mx.off(jt.ToDeviceEvent, i);
      });
    }
    dispose() {
      Y_.info("call", "Disposing call widget", {
        roomId: this.roomId
      }), this.disposables.forEach((e) => {
        e();
      }), this.call.stop(), this.container.removeChild(this.iframe), this.control.dispose(), this.readUpToMap = {}, this.eventsToFeed = /* @__PURE__ */ new WeakSet();
    }
    onCallJoined(e) {
      e.preventDefault(), this.call.transport.reply(e.detail, {}), Y_.info("call", "Call joined", {
        roomId: this.roomId
      }), this.joined = true, this.applyStyles(), this.control.startObserving();
    }
    applyStyles() {
      var _a6, _b3;
      const e = this.document;
      if (!e) return;
      e.body.style.setProperty("background", "none", "important");
      const n = (_b3 = (_a6 = e.body.querySelector('[data-testid="incall_leave"]')) == null ? void 0 : _a6.parentElement) == null ? void 0 : _b3.parentElement;
      n && (n.style.setProperty("position", "absolute"), n.style.setProperty("visibility", "hidden"));
    }
    onEvent(e) {
      this.mx.decryptEventIfNeeded(e), this.feedEvent(e);
    }
    onEventDecrypted(e) {
      this.feedEvent(e);
    }
    onStateUpdate(e) {
      if (this.call === null) return;
      const n = e.getEffectiveEvent();
      this.call.feedStateUpdate(n).catch((r) => {
        console.error("Error sending state update to widget: ", r);
      });
    }
    async onToDeviceEvent(e) {
      var _a6;
      await this.mx.decryptEventIfNeeded(e), !e.isDecryptionFailure() && await ((_a6 = this.call) == null ? void 0 : _a6.feedToDevice(e.getEffectiveEvent(), e.isEncrypted()));
    }
    relatesToUnknown(e) {
      if (!e.relationEventId || e.replyEventId) return false;
      const n = this.mx.getRoom(e.getRoomId());
      return n === null || !n.findEventById(e.relationEventId);
    }
    advanceReadUpToMarker(e) {
      const n = e.getId();
      if (n === void 0) return false;
      const r = e.getRoomId();
      if (r === void 0) return false;
      const i = this.mx.getRoom(r);
      if (i === null) return false;
      const a = this.readUpToMap[e.getRoomId()];
      if (!a) return this.readUpToMap[r] = n, true;
      if (a === n) return false;
      const l = [
        ...i.getLiveTimeline().getEvents()
      ].toReversed().slice(0, 100);
      function c(u) {
        return u.getId() === a || u.getId() === e.getId();
      }
      const d = l.find(c);
      return (d == null ? void 0 : d.getId()) === a ? false : (d == null ? void 0 : d.getId()) === e.getId() ? (this.readUpToMap[r] = n, true) : false;
    }
    isFromInvite(e) {
      var _a6;
      return ((_a6 = this.mx.getRoom(e.getRoomId())) == null ? void 0 : _a6.getMyMembership()) === Ht.Invite;
    }
    feedEvent(e) {
      if (this.call !== null && (this.eventsToFeed.delete(e) || this.relatesToUnknown(e) || this.isFromInvite(e) || this.advanceReadUpToMarker(e))) if (e.isBeingDecrypted() || e.isDecryptionFailure()) this.eventsToFeed.add(e);
      else {
        const n = e.getEffectiveEvent();
        this.call.feedEvent(n).catch((r) => {
          console.error("Error sending event to widget: ", r);
        });
      }
    }
    listenAction(e, n) {
      return this.listenEvent(`action:${e}`, n);
    }
    listenEvent(e, n) {
      return this.call.on(e, n), () => {
        this.call.off(e, n);
      };
    }
  }
  const qM = (t, e, n) => {
    p.useEffect(() => (t == null ? void 0 : t.on(`action:${e}`, n), () => {
      t == null ? void 0 : t.off(`action:${e}`, n);
    }), [
      t,
      e,
      n
    ]);
  }, Rde = (t) => {
    const [e, n] = p.useState(t.getState());
    return p.useEffect(() => {
      const r = () => {
        n(t.getState());
      };
      return t.on(JI.StateUpdate, r), () => {
        t.off(JI.StateUpdate, r);
      };
    }, [
      t
    ]), e;
  }, q5 = vn(void 0);
  let Jw = null;
  const ev = vn((t) => t(q5), (t, e, n) => {
    const r = t(q5);
    n !== r && (r && (Jw !== null && (oa("sable.call.embed_lifetime_ms", performance.now() - Jw, {
      attributes: {
        reason: n === void 0 ? "disposed" : "replaced"
      }
    }), Jw = null), r.dispose()), n !== void 0 && (Jw = performance.now()), e(q5, n));
  }), tv = vn(false), Ade = vn(null), Ide = vn(null), XI = vn(null), K5 = fo("useCallEmbed"), Bde = p.createContext(void 0), hKe = Bde.Provider, sm = () => p.useContext(Bde), Pde = p.createContext(void 0), fKe = Pde.Provider, Mde = () => {
    const t = p.useContext(Pde);
    if (!t) throw new Error("CallEmbedRef is not provided!");
    return t;
  }, mKe = (t, e, n, r, i, a) => {
    const s = t.matrixRTC.getRoomSession(e), l = rl.sessionMembershipsForRoom(e, s.sessionDescription).length > 0, c = d2.getIntent(n, l, a == null ? void 0 : a.video), d = d2.getWidget(t, e, c, r), u = a && new D1(a.microphone, a.video, a.sound);
    return new d2(t, e, d, i, u);
  }, bS = (t = false) => {
    const e = be(), n = yp(), r = Fn(ev), i = Mde();
    return p.useCallback((s, l) => {
      const c = i.current;
      if (!c) throw K5.error("call", "Failed to start call \u2014 no embed container", {
        roomId: s.roomId
      }), Vr("sable.call.start.error", 1, {
        attributes: {
          reason: "no_container"
        }
      }), new Error("Failed to start call, No embed container element found!");
      try {
        K5.info("call", "Starting call", {
          roomId: s.roomId,
          dm: t
        }), Vr("sable.call.start.attempt", 1, {
          attributes: {
            dm: String(t)
          }
        });
        const d = mKe(e, s, t, n.kind, c, l);
        r(d);
      } catch (d) {
        throw K5.error("call", "Call embed creation failed", {
          roomId: s.roomId,
          error: d instanceof Error ? d.message : String(d)
        }), Vr("sable.call.start.error", 1, {
          attributes: {
            reason: "embed_create_failed"
          }
        }), d;
      }
    }, [
      e,
      t,
      n,
      r,
      i
    ]);
  }, Ap = (t) => {
    const [e, n] = p.useState((t == null ? void 0 : t.joined) ?? false);
    return qM(t == null ? void 0 : t.call, Ou.JoinCall, p.useCallback(() => {
      n(true);
    }, [])), p.useEffect(() => {
      t || n(false);
    }, [
      t
    ]), e;
  }, gKe = (t, e) => {
    qM(t.call, Ou.HangupCall, e);
  }, pKe = (t) => {
    const e = QF(t.room);
    oKe(e, p.useCallback(() => t.control.applySound(), [
      t
    ]));
  }, FKe = (t) => {
    const e = yp();
    p.useEffect(() => {
      const n = e.kind === Rr.Dark ? "dark" : "light";
      t.setTheme(n);
    }, [
      e.kind,
      t
    ]);
  }, vKe = (t) => {
    const e = Mde(), n = p.useCallback(() => {
      const r = e.current, i = t.current;
      if (!r || !i) return;
      const a = i.getBoundingClientRect();
      r.style.position = "fixed", r.style.top = `${a.top}px`, r.style.left = `${a.left}px`, r.style.width = `${a.width}px`, r.style.height = `${a.height}px`;
    }, [
      e,
      t
    ]);
    Ete(n, p.useCallback(() => t.current, [
      t
    ])), p.useEffect(() => (n(), window.addEventListener("scroll", n, true), () => window.removeEventListener("scroll", n, true)), [
      n
    ]);
  };
  var _Ke = "styles_CallViewContent__1lpu2sv0", Ode = "styles_ControlCard__1lpu2sv1", yKe = "styles_ControlDivider__1lpu2sv2", Lde = "styles_CallMemberCard__1lpu2sv3", bKe = "styles_CallControlContainer__1lpu2sv4", xKe = "styles_PrescreenMessage__1lpu2sv5";
  function wKe({ member: t }) {
    var _a6;
    const e = be(), n = hn(), r = cr(), i = Ls(), a = t.sender;
    if (!a) return null;
    const s = gr(r, a) ?? _n(a) ?? a, l = Jc(r, a), c = l ? Cn(e, l, n, 96, 96) ?? void 0 : void 0, d = ((_a6 = t.membershipData) == null ? void 0 : _a6["m.call.intent"]) === "audio";
    return o.jsx(Te, {
      as: "button",
      className: Lde,
      variant: "SurfaceVariant",
      radii: "500",
      onClick: (u) => i(r.roomId, void 0, a, wp(u.nativeEvent), "Right"),
      children: o.jsxs(E, {
        grow: "Yes",
        gap: "300",
        alignItems: "Center",
        children: [
          o.jsx(xn, {
            size: "200",
            radii: "400",
            children: o.jsx(Si, {
              userId: a,
              src: c,
              alt: s,
              renderFallback: () => o.jsx(Q, {
                size: "50",
                src: q.User,
                filled: true
              })
            })
          }),
          o.jsx(E, {
            grow: "Yes",
            children: o.jsx(D, {
              size: "L400",
              truncate: true,
              children: s
            })
          }),
          d && o.jsx(Q, {
            src: q.VideoCameraMute,
            size: "100"
          })
        ]
      })
    }, t.membershipID);
  }
  function DKe({ members: t, max: e = 4 }) {
    const [n, r] = p.useState(false), i = n ? t : t.slice(0, 4), a = t.length - i.length;
    return o.jsxs(o.Fragment, {
      children: [
        i.map((s) => o.jsx(wKe, {
          member: s
        }, s.membershipID)),
        t.length > e && o.jsxs(Te, {
          as: "button",
          className: Lde,
          variant: "SurfaceVariant",
          radii: "500",
          onClick: () => r(!n),
          children: [
            o.jsx(E, {
              grow: "Yes",
              gap: "300",
              alignItems: "Center",
              children: n ? o.jsx(D, {
                size: "L400",
                truncate: true,
                children: "Collapse"
              }) : o.jsx(D, {
                size: "L400",
                truncate: true,
                children: a === 0 ? `+${a} Other` : `+${a} Others`
              })
            }),
            o.jsx(Q, {
              src: n ? q.ChevronTop : q.ChevronBottom,
              size: "100"
            })
          ]
        })
      ]
    });
  }
  function QI() {
    return o.jsx(nr, {
      variant: "SurfaceVariant",
      size: "300",
      direction: "Vertical",
      className: yKe
    });
  }
  function Nde({ enabled: t, onToggle: e }) {
    return o.jsx(ar, {
      position: "Top",
      delay: 500,
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Turn Off Microphone" : "Turn On Microphone"
        })
      }),
      children: (n) => o.jsx(Oe, {
        ref: n,
        variant: t ? "Surface" : "Warning",
        fill: "Soft",
        radii: "400",
        size: "400",
        onClick: () => e(),
        outlined: true,
        children: o.jsx(Q, {
          size: "400",
          src: t ? q.Mic : q.MicMute,
          filled: !t
        })
      })
    });
  }
  function zde({ enabled: t, onToggle: e }) {
    return o.jsx(ar, {
      position: "Top",
      delay: 500,
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Turn Off Sound" : "Turn On Sound"
        })
      }),
      children: (n) => o.jsx(Oe, {
        ref: n,
        variant: t ? "Surface" : "Warning",
        fill: "Soft",
        radii: "400",
        size: "400",
        onClick: () => e(),
        outlined: true,
        children: o.jsx(Q, {
          size: "400",
          src: t ? q.Headphone : q.HeadphoneMute,
          filled: !t
        })
      })
    });
  }
  function Ude({ enabled: t, onToggle: e }) {
    return o.jsx(ar, {
      position: "Top",
      delay: 500,
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Stop Camera" : "Start Camera"
        })
      }),
      children: (n) => o.jsx(Oe, {
        ref: n,
        variant: t ? "Success" : "Surface",
        fill: "Soft",
        radii: "400",
        size: "400",
        onClick: () => e(),
        outlined: true,
        children: o.jsx(Q, {
          size: "400",
          src: t ? q.VideoCamera : q.VideoCameraMute,
          filled: t
        })
      })
    });
  }
  function CKe({ enabled: t, onToggle: e }) {
    return o.jsx(ar, {
      position: "Top",
      delay: 500,
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Stop Screenshare" : "Start Screenshare"
        })
      }),
      children: (n) => o.jsx(Oe, {
        ref: n,
        variant: t ? "Success" : "Surface",
        fill: "Soft",
        radii: "400",
        size: "400",
        onClick: () => e(),
        outlined: true,
        children: o.jsx(Q, {
          size: "400",
          src: q.ScreenShare,
          filled: t
        })
      })
    });
  }
  function Vde() {
    const [t, e] = Fr(tv);
    return o.jsx(ar, {
      position: "Top",
      delay: 500,
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Close Chat" : "Open Chat"
        })
      }),
      children: (n) => o.jsx(Oe, {
        ref: n,
        variant: t ? "Success" : "Surface",
        fill: "Soft",
        radii: "400",
        size: "400",
        onClick: () => e(!t),
        outlined: true,
        children: o.jsx(Q, {
          size: "400",
          src: q.Message,
          filled: t
        })
      })
    });
  }
  const Hde = p.createContext(null), EKe = Hde.Provider, $de = () => {
    const t = p.useContext(Hde);
    if (!t) throw new Error("CallPreferencesAtom not provided!");
    return t;
  }, KM = () => {
    const t = $de(), [e, n] = Fr(t), r = p.useCallback(() => {
      const s = !e.microphone;
      n({
        microphone: s,
        video: e.video,
        sound: !e.sound && s ? true : e.sound
      });
    }, [
      n,
      e
    ]), i = p.useCallback(() => {
      const s = !e.video;
      n({
        microphone: e.microphone,
        video: s,
        sound: e.sound
      });
    }, [
      n,
      e
    ]), a = p.useCallback(() => {
      const s = !e.sound;
      n({
        microphone: s ? e.microphone : false,
        video: e.video,
        sound: s
      });
    }, [
      n,
      e
    ]);
    return {
      ...e,
      toggleMicrophone: r,
      toggleVideo: i,
      toggleSound: a,
      setPreferences: n
    };
  };
  function kKe({ canJoin: t }) {
    const e = cr(), n = sm(), r = Ap(n), i = zce(), s = fr() === sn.Mobile, l = n && n.roomId !== e.roomId, c = bS(i), d = (n == null ? void 0 : n.roomId) === e.roomId && !r, u = l || !t, { microphone: h, video: f, sound: g, toggleMicrophone: m, toggleVideo: v, toggleSound: y } = KM();
    return o.jsx(E, {
      justifyContent: "Center",
      alignItems: "Center",
      style: {
        maxWidth: "100%",
        padding: s ? `0 ${He(8)}` : void 0,
        overflowX: "auto"
      },
      children: o.jsxs(Te, {
        className: Ode,
        variant: "SurfaceVariant",
        gap: s ? "100" : "200",
        radii: "500",
        alignItems: "Center",
        justifyContent: "Center",
        direction: "Row",
        children: [
          o.jsxs(E, {
            shrink: "No",
            alignItems: "Center",
            justifyContent: "Center",
            gap: s ? "100" : "200",
            direction: "Row",
            children: [
              o.jsx(Nde, {
                enabled: h,
                onToggle: m
              }),
              o.jsx(zde, {
                enabled: g,
                onToggle: y
              })
            ]
          }),
          !s && o.jsx(QI, {}),
          o.jsxs(E, {
            shrink: "No",
            alignItems: "Center",
            justifyContent: "Center",
            gap: s ? "100" : "200",
            direction: "Row",
            children: [
              o.jsx(Ude, {
                enabled: f,
                onToggle: v
              }),
              (e == null ? void 0 : e.isCallRoom()) && o.jsx(Vde, {})
            ]
          }),
          o.jsx(E, {
            shrink: "No",
            alignItems: "Center",
            justifyContent: "Center",
            direction: "Row",
            children: o.jsx(xe, {
              style: {
                minWidth: He(s ? 48 : 88),
                padding: s ? 0 : void 0
              },
              variant: u ? "Secondary" : "Success",
              fill: u ? "Soft" : "Solid",
              onClick: () => c(e, {
                microphone: h,
                video: f,
                sound: g
              }),
              disabled: u || d,
              before: d ? o.jsx(dt, {
                variant: "Success",
                fill: "Solid",
                size: "200"
              }) : o.jsx(Q, {
                src: q.Phone,
                size: "200",
                filled: true
              }),
              children: !s && o.jsx(D, {
                size: "B400",
                children: "Join"
              })
            })
          })
        ]
      })
    });
  }
  function SKe({ callEmbed: t }) {
    const e = cr(), n = p.useRef(null), i = fr() === sn.Mobile, { microphone: a, video: s, sound: l, screenshare: c, spotlight: d } = Rde(t.control), { setPreferences: u } = KM();
    p.useEffect(() => {
      u({
        microphone: a,
        video: s,
        sound: l
      });
    }, [
      a,
      s,
      l,
      u
    ]);
    const [h, f] = p.useState(), g = (k) => {
      f(k.currentTarget.getBoundingClientRect());
    }, m = () => {
      t.control.toggleSpotlight(), f(void 0);
    }, v = () => {
      t.control.toggleReactions(), f(void 0);
    }, y = () => {
      t.control.toggleSettings(), f(void 0);
    }, [w, b] = Et(p.useCallback(() => t.hangup(), [
      t
    ])), j = w.status === ve.Loading || w.status === ve.Success;
    return o.jsx(E, {
      ref: n,
      className: bKe,
      justifyContent: "Center",
      alignItems: "Center",
      style: {
        maxWidth: "100%",
        padding: i ? `0 ${He(8)}` : void 0,
        overflowX: "auto"
      },
      children: o.jsxs(Te, {
        className: Ode,
        variant: "SurfaceVariant",
        gap: i ? "100" : "200",
        radii: "500",
        alignItems: "Center",
        justifyContent: "Center",
        direction: "Row",
        children: [
          o.jsxs(E, {
            shrink: "No",
            alignItems: "Center",
            justifyContent: "Center",
            gap: i ? "100" : "200",
            direction: "Row",
            children: [
              o.jsx(Nde, {
                enabled: a,
                onToggle: () => t.control.toggleMicrophone()
              }),
              o.jsx(zde, {
                enabled: l,
                onToggle: () => t.control.toggleSound()
              })
            ]
          }),
          !i && o.jsx(QI, {}),
          o.jsxs(E, {
            shrink: "No",
            alignItems: "Center",
            justifyContent: "Center",
            gap: i ? "100" : "200",
            direction: "Row",
            children: [
              o.jsx(Ude, {
                enabled: s,
                onToggle: () => t.control.toggleVideo()
              }),
              o.jsx(CKe, {
                enabled: c,
                onToggle: () => t.control.toggleScreenshare()
              })
            ]
          }),
          !i && o.jsx(QI, {}),
          o.jsxs(E, {
            shrink: "No",
            alignItems: "Center",
            justifyContent: "Center",
            gap: i ? "100" : "200",
            direction: "Row",
            children: [
              (e == null ? void 0 : e.isCallRoom()) && o.jsx(Vde, {}),
              o.jsx(ln, {
                anchor: h,
                position: "Top",
                align: "Center",
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    onDeactivate: () => f(void 0),
                    clickOutsideDeactivates: true,
                    isKeyForward: (k) => k.key === "ArrowDown",
                    isKeyBackward: (k) => k.key === "ArrowUp",
                    escapeDeactivates: kt
                  },
                  children: o.jsx(tn, {
                    children: o.jsxs(E, {
                      direction: "Column",
                      style: {
                        padding: ee.space.S100
                      },
                      children: [
                        o.jsx(Ye, {
                          size: "300",
                          variant: "Surface",
                          radii: "300",
                          onClick: m,
                          children: o.jsx(D, {
                            size: "B300",
                            truncate: true,
                            children: d ? "Grid View" : "Spotlight View"
                          })
                        }),
                        o.jsx(Ye, {
                          size: "300",
                          variant: "Surface",
                          radii: "300",
                          onClick: v,
                          children: o.jsx(D, {
                            size: "B300",
                            truncate: true,
                            children: "Reactions"
                          })
                        }),
                        o.jsx(Ye, {
                          size: "300",
                          variant: "Surface",
                          radii: "300",
                          onClick: y,
                          children: o.jsx(D, {
                            size: "B300",
                            truncate: true,
                            children: "Settings"
                          })
                        })
                      ]
                    })
                  })
                }),
                children: o.jsx(Oe, {
                  variant: "Surface",
                  fill: "Soft",
                  radii: "400",
                  size: "400",
                  onClick: g,
                  outlined: true,
                  "aria-pressed": !!h,
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.VerticalDots
                  })
                })
              }),
              o.jsx(xe, {
                style: {
                  minWidth: He(i ? 48 : 88),
                  padding: i ? 0 : void 0
                },
                variant: "Critical",
                fill: "Solid",
                onClick: b,
                before: j ? o.jsx(dt, {
                  variant: "Critical",
                  fill: "Solid",
                  size: "200"
                }) : o.jsx(Q, {
                  src: q.PhoneDown,
                  size: "200",
                  filled: true
                }),
                disabled: j,
                children: !i && o.jsx(D, {
                  size: "B400",
                  children: "End"
                })
              })
            ]
          })
        ]
      })
    });
  }
  function jKe() {
    return o.jsx(D, {
      style: {
        margin: "auto",
        color: ct.Critical.Main
      },
      size: "L400",
      align: "Center",
      children: "Your homeserver does not support calling. But you can still join call started by others."
    });
  }
  function TKe({ hasParticipant: t, livekitSupported: e }) {
    return t ? null : e === false ? o.jsx(jKe, {}) : o.jsx(D, {
      style: {
        margin: "auto"
      },
      size: "L400",
      align: "Center",
      children: "Voice chat's empty \u2014 Be the first to hop in!"
    });
  }
  function RKe() {
    return o.jsx(D, {
      style: {
        margin: "auto"
      },
      size: "L400",
      align: "Center",
      children: "You don't have permission to join!"
    });
  }
  function AKe() {
    return o.jsx(D, {
      style: {
        margin: "auto",
        color: ct.Warning.Main
      },
      size: "L400",
      align: "Center",
      children: "Already in another call \u2014 End the current call to join!"
    });
  }
  function IKe() {
    const t = be(), e = cr(), n = iKe(), r = Qd(), i = ri(e), s = Ki(i, r).event(ce.GroupCallMemberPrefix, t.getSafeUserId()), l = QF(e), c = x3(e, l), d = c.length > 0, u = sm(), h = u && u.roomId !== e.roomId, f = s && (n || d);
    return o.jsx(dn, {
      variant: "Surface",
      hideTrack: true,
      children: o.jsx(E, {
        className: _Ke,
        alignItems: "Center",
        justifyContent: "Center",
        children: o.jsxs(E, {
          style: {
            maxWidth: He(382),
            width: "100%"
          },
          direction: "Column",
          gap: "100",
          children: [
            d && o.jsxs(wn, {
              size: "300",
              children: [
                o.jsx(E, {
                  grow: "Yes",
                  alignItems: "Center",
                  children: o.jsx(D, {
                    size: "L400",
                    children: "Participant"
                  })
                }),
                o.jsx(Rn, {
                  variant: "Critical",
                  fill: "Solid",
                  size: "400",
                  children: o.jsxs(D, {
                    as: "span",
                    size: "L400",
                    truncate: true,
                    children: [
                      c.length,
                      " Live"
                    ]
                  })
                })
              ]
            }),
            o.jsx(DKe, {
              members: c
            }),
            o.jsx(kKe, {
              canJoin: f
            }),
            o.jsxs(E, {
              className: xKe,
              alignItems: "Center",
              children: [
                !h && (s ? o.jsx(TKe, {
                  hasParticipant: d,
                  livekitSupported: n
                }) : o.jsx(RKe, {})),
                h && o.jsx(AKe, {})
              ]
            })
          ]
        })
      })
    });
  }
  function BKe({ joined: t, containerRef: e }) {
    const n = sm();
    return o.jsxs(E, {
      grow: "Yes",
      direction: "Column",
      style: {
        position: "relative"
      },
      children: [
        o.jsx(E, {
          grow: "Yes",
          ref: e,
          style: {
            height: "100%",
            width: "100%"
          }
        }),
        n && t && o.jsx("div", {
          style: {
            position: "absolute",
            bottom: He(16),
            left: 0,
            right: 0,
            zIndex: 50,
            display: "flex",
            justifyContent: "center",
            pointerEvents: "none"
          },
          children: o.jsx("div", {
            style: {
              pointerEvents: "all",
              maxWidth: "100%"
            },
            children: o.jsx(SKe, {
              callEmbed: n
            })
          })
        })
      ]
    });
  }
  function Wde({ resizable: t }) {
    const e = cr(), r = fr() === sn.Mobile, i = p.useRef(null), a = p.useRef(null);
    vKe(a);
    const s = sm(), l = Ap(s), c = (s == null ? void 0 : s.roomId) === e.roomId && l, [d, u] = p.useState(r ? 240 : 380), [h, f] = p.useState(false), g = p.useRef(false), m = p.useCallback((j) => {
      if (!g.current || !i.current) return;
      const { top: k } = i.current.getBoundingClientRect();
      u(Math.max(r ? 120 : 150, Math.min(j - k, window.innerHeight * 0.8)));
    }, [
      r
    ]), v = p.useCallback((j) => m(j.clientY), [
      m
    ]), y = p.useCallback((j) => {
      j.cancelable && j.preventDefault(), j.touches[0] && m(j.touches[0].clientY);
    }, [
      m
    ]), w = p.useCallback(() => {
      g.current = false, f(false), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", w), document.removeEventListener("touchmove", y), document.removeEventListener("touchend", w), document.body.style.userSelect = "auto";
    }, [
      v,
      y
    ]), b = p.useCallback(() => {
      g.current = true, f(true), document.addEventListener("mousemove", v), document.addEventListener("mouseup", w), document.addEventListener("touchmove", y, {
        passive: false
      }), document.addEventListener("touchend", w), document.body.style.userSelect = "none";
    }, [
      v,
      y,
      w
    ]);
    return o.jsxs(E, {
      ref: i,
      grow: "Yes",
      className: ro({
        variant: "Surface"
      }),
      style: {
        position: "relative",
        minWidth: He(280),
        height: t ? `${d}px` : void 0,
        borderBottom: "1px solid var(--sable-surface-container-line)",
        zIndex: 20,
        backgroundColor: c ? "transparent" : void 0,
        pointerEvents: c ? "none" : "all"
      },
      children: [
        h && o.jsx("div", {
          style: {
            position: "absolute",
            inset: 0,
            zIndex: 50,
            cursor: "ns-resize",
            pointerEvents: "all"
          }
        }),
        !c && o.jsx(IKe, {}),
        o.jsx(BKe, {
          joined: c,
          containerRef: a
        }),
        t && o.jsx("button", {
          type: "button",
          onMouseDown: b,
          onTouchStart: b,
          "aria-label": "Resize call view",
          style: {
            position: "absolute",
            bottom: "-12px",
            left: 0,
            right: 0,
            height: "24px",
            cursor: "ns-resize",
            zIndex: 100,
            display: "flex",
            alignItems: "center",
            justifyContent: "center",
            background: "transparent",
            border: "none",
            padding: 0,
            outline: "none",
            pointerEvents: "all",
            touchAction: "none"
          },
          children: o.jsx("div", {
            style: {
              width: "40px",
              height: "4px",
              borderRadius: "2px",
              background: "var(--sable-surface-container-line)",
              opacity: 0.8
            }
          })
        })
      ]
    });
  }
  const PKe = (t, e, n, r, i, a, s) => {
    const l = (s == null ? void 0 : s.getDeviceId()) ?? "", c = (s == null ? void 0 : s.baseUrl) ?? "", d = "dev.nullptr.app", u = navigator.language || "en", h = document.body.classList.contains("dark-theme") ? "dark" : "light";
    let f = t.replaceAll("$matrix_user_id", encodeURIComponent(n)).replaceAll("$matrix_room_id", encodeURIComponent(e)).replaceAll("$matrix_display_name", encodeURIComponent(r)).replaceAll("$matrix_avatar_url", encodeURIComponent(i)).replaceAll("$matrix_widget_id", encodeURIComponent(a)).replaceAll("$org.matrix.msc2873.client_id", encodeURIComponent(d)).replaceAll("$org.matrix.msc2873.client_theme", encodeURIComponent(h)).replaceAll("$org.matrix.msc2873.client_language", encodeURIComponent(u)).replaceAll("$org.matrix.msc3819.matrix_device_id", encodeURIComponent(l)).replaceAll("$org.matrix.msc4039.matrix_base_url", encodeURIComponent(c));
    try {
      const g = new URL(f);
      g.searchParams.has("widgetId") || g.searchParams.set("widgetId", a), g.searchParams.has("parentUrl") || g.searchParams.set("parentUrl", window.location.href), f = g.toString();
    } catch {
    }
    return f;
  }, qde = (t) => {
    if (t.includes("$matrix_") || t.includes("$org.matrix.")) return t;
    const e = [
      "matrix_user_id=$matrix_user_id",
      "matrix_display_name=$matrix_display_name",
      "matrix_avatar_url=$matrix_avatar_url",
      "matrix_room_id=$matrix_room_id",
      "matrix_widget_id=$matrix_widget_id",
      "theme=$org.matrix.msc2873.client_theme",
      "matrix_client_id=$org.matrix.msc2873.client_id",
      "matrix_client_language=$org.matrix.msc2873.client_language",
      "matrix_device_id=$org.matrix.msc3819.matrix_device_id",
      "matrix_base_url=$org.matrix.msc4039.matrix_base_url"
    ].join("&");
    try {
      const n = new URL(t);
      if (n.hash.includes("?")) return `${t}&${e}`;
      if (n.hash) return `${t}?${e}`;
      const r = n.search ? "&" : "?";
      return `${t}${r}${e}`;
    } catch {
      return t;
    }
  }, Kde = (t) => {
    const [e, n] = Nk();
    return vl(t.client, p.useCallback((r) => {
      r.getRoomId() === t.roomId && r.getType() === Pn.RoomWidget && n();
    }, [
      t.roomId,
      n
    ])), p.useMemo(() => Ud(t, Pn.RoomWidget).reduce((i, a) => {
      const s = a.getContent();
      if (!(s == null ? void 0 : s.url) || Object.keys(s).length === 0) return i;
      const l = a.getStateKey();
      return l && i.push({
        id: s.id || l,
        creatorUserId: s.creatorUserId || a.getSender() || "",
        type: s.type || "m.custom",
        url: s.url,
        name: s.name || "Widget",
        data: s.data || {},
        waitForIframeLoad: s.waitForIframeLoad ?? true,
        eventId: a.getId(),
        sender: a.getSender() || void 0
      }), i;
    }, []), [
      t,
      e
    ]);
  };
  class MKe extends Bn.WidgetDriver {
    constructor(e, n, r, i, a) {
      super();
      __publicField(this, "mxClient");
      __publicField(this, "approveCapabilities");
      this.forWidget = n, this.forWidgetKind = r, this.inRoomId = i, this.mxClient = e, this.approveCapabilities = a ?? (async (s) => s);
    }
    async validateCapabilities(e) {
      return this.approveCapabilities(e);
    }
    async sendEvent(e, n, r = null, i = null) {
      const a = this.mxClient, s = i || this.inRoomId;
      if (!a || !s) throw new Error("Not in a room or not attached to a client");
      let l;
      return r !== null ? l = await a.sendStateEvent(s, e, n, r) : e === ce.RoomRedaction ? l = await a.redactEvent(s, n.redacts) : l = await a.sendEvent(s, e, n), {
        roomId: s,
        eventId: l.event_id
      };
    }
    async sendDelayedEvent(e, n, r, i, a = null, s = null) {
      const l = this.mxClient, c = s || this.inRoomId;
      if (!l || !c) throw new Error("Not in a room or not attached to a client");
      let d;
      if (e !== null) d = {
        delay: e,
        ...n !== null && {
          parent_delay_id: n
        }
      };
      else if (n !== null) d = {
        parent_delay_id: n
      };
      else throw new Error("Must provide at least one of delay or parentDelayId");
      let u;
      return a !== null ? u = await l._unstable_sendDelayedStateEvent(c, d, r, i, a) : u = await l._unstable_sendDelayedEvent(c, d, null, r, i), {
        roomId: c,
        delayId: u.delay_id
      };
    }
    async updateDelayedEvent(e, n) {
      await this.mxClient._unstable_updateDelayedEvent(e, n);
    }
    async cancelScheduledDelayedEvent(e) {
      await this.updateDelayedEvent(e, Bn.UpdateDelayedEventAction.Cancel);
    }
    async restartScheduledDelayedEvent(e) {
      await this.updateDelayedEvent(e, Bn.UpdateDelayedEventAction.Restart);
    }
    async sendScheduledDelayedEvent(e) {
      await this.updateDelayedEvent(e, Bn.UpdateDelayedEventAction.Send);
    }
    async sendToDevice(e, n, r) {
      const i = this.mxClient;
      if (n) {
        const a = i.getCrypto();
        if (!a) throw new Error("E2EE not enabled");
        const s = {};
        Object.entries(r).forEach(([l, c]) => {
          Object.entries(c).forEach(([d, u]) => {
            const h = JSON.stringify(u), f = s[h] ?? [];
            f.push({
              userId: l,
              deviceId: d
            }), s[h] = f;
          });
        }), await Promise.all(Object.entries(s).map(async ([l, c]) => {
          const d = await a.encryptToDeviceMessages(e, c, JSON.parse(l));
          await i.queueToDevice(d);
        }));
      } else await i.queueToDevice({
        eventType: e,
        batch: Object.entries(r).flatMap(([a, s]) => Object.entries(s).map(([l, c]) => ({
          userId: a,
          deviceId: l,
          payload: c
        })))
      });
    }
    async readRoomTimeline(e, n, r, i, a, s) {
      const l = a > 0 ? Math.min(a, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER, c = this.mxClient.getRoom(e);
      if (!c) return [];
      const d = [], u = c.getLiveTimeline().getEvents();
      for (let h = u.length - 1; h >= 0; h -= 1) {
        const f = u[h];
        if (!f) break;
        const g = d.length >= l, m = s !== void 0 && f.getId() === s;
        if (g || m) break;
        const v = f.getType() === n && !f.isState(), y = n !== ce.RoomMessage || !r || r === f.getContent().msgtype, w = f.getStateKey();
        v && y && (w === void 0 || i === void 0 || w === i) && d.push(f);
      }
      return d.map((h) => h.getEffectiveEvent());
    }
    async askOpenID(e) {
      return e.update({
        state: Bn.OpenIDRequestState.Allowed,
        token: await this.mxClient.getOpenIdToken()
      });
    }
    async readRoomState(e, n, r) {
      const i = this.mxClient.getRoom(e);
      if (!i) return [];
      const a = i.getLiveTimeline().getState(Tn.Forward);
      if (!a) return [];
      if (r === void 0) return a.getStateEvents(n).map((l) => l.getEffectiveEvent());
      const s = a.getStateEvents(n, r);
      return s === null ? [] : [
        s.getEffectiveEvent()
      ];
    }
    async readEventRelations(e, n, r, i, a, s, l, c) {
      const d = n ?? this.inRoomId;
      if (typeof d != "string") throw new Error("Error while reading the current room");
      const { events: u, nextBatch: h, prevBatch: f } = await this.mxClient.relations(d, e, r ?? null, i ?? null, {
        from: a,
        to: s,
        limit: l,
        dir: c
      });
      return {
        chunk: u.map((g) => g.getEffectiveEvent()),
        nextBatch: h ?? void 0,
        prevBatch: f ?? void 0
      };
    }
    async searchUserDirectory(e, n) {
      const { limited: r, results: i } = await this.mxClient.searchUserDirectory({
        term: e,
        limit: n
      });
      return {
        limited: r,
        results: i.map((a) => ({
          userId: a.user_id,
          displayName: a.display_name,
          avatarUrl: a.avatar_url
        }))
      };
    }
    async getMediaConfig() {
      return this.mxClient.getMediaConfig();
    }
    async uploadFile(e) {
      return {
        contentUri: (await this.mxClient.uploadContent(e)).content_uri
      };
    }
    getKnownRooms() {
      return this.mxClient.getVisibleRooms().map((e) => e.roomId);
    }
    processError(e) {
      return e instanceof Un ? {
        matrix_api_error: e.asWidgetApiErrorData()
      } : void 0;
    }
  }
  const OKe = Po("WidgetIframe");
  function LKe({ widget: t, roomId: e, mx: n, onCapabilityRequest: r }) {
    var _a6, _b3;
    const i = p.useRef(null), a = p.useRef(null), [, s] = p.useState(false), l = n.getUserId() || "", c = ((_a6 = n.getUser(l)) == null ? void 0 : _a6.displayName) || l, d = ((_b3 = n.getUser(l)) == null ? void 0 : _b3.avatarUrl) || "", u = PKe(t.url || "", e, l, c, d, t.id, n);
    p.useEffect(() => {
      const f = i.current;
      if (!f) return;
      const g = new Bn.Widget(t), m = new MKe(n, g, Bn.WidgetKind.Room, e, r), v = new Bn.ClientWidgetApi(g, f, m);
      a.current = v, v.setViewedRoomId(e), v.once("ready", () => s(true)), f.src = u, v.on("action:org.matrix.msc2876.read_events", (C) => {
        var _a7;
        const x = n.getRoom(e), S = [], { type: T } = C.detail.data;
        if (C.preventDefault(), x === null) {
          v.transport.reply(C.detail, {
            events: S
          });
          return;
        }
        const A = x.getLiveTimeline().getState(Tn.Forward);
        if (A === void 0) {
          v.transport.reply(C.detail, {
            events: S
          });
          return;
        }
        const B = (_a7 = A.events) == null ? void 0 : _a7.get(T);
        Array.from((B == null ? void 0 : B.values()) ?? []).forEach((U) => {
          S.push(U.event);
        }), v.transport.reply(C.detail, {
          events: S
        });
      });
      const y = {};
      n.getRooms().forEach((C) => {
        var _a7;
        const x = ((_a7 = C.getLiveTimeline()) == null ? void 0 : _a7.getEvents()) || [], S = x[x.length - 1];
        if (S) {
          const T = S.getId();
          T && (y[C.roomId] = T);
        }
      });
      const w = (C) => {
        if (!a.current || C.isBeingDecrypted() || C.isDecryptionFailure()) return;
        const x = C.getEffectiveEvent();
        a.current.feedEvent(x).catch((S) => {
          OKe.warn("Failed to feed widget iframe event:", S);
        });
      }, b = (C) => {
        n.decryptEventIfNeeded(C), w(C);
      }, j = (C) => {
        w(C);
      }, k = async (C) => {
        var _a7;
        await n.decryptEventIfNeeded(C), !C.isDecryptionFailure() && await ((_a7 = a.current) == null ? void 0 : _a7.feedToDevice(C.getEffectiveEvent(), C.isEncrypted()));
      };
      return n.on(jt.Event, b), n.on(or.Decrypted, j), n.on(jt.ToDeviceEvent, k), () => {
        n.removeListener(jt.Event, b), n.removeListener(or.Decrypted, j), n.removeListener(jt.ToDeviceEvent, k), v.stop(), v.removeAllListeners(), a.current = null, s(false);
      };
    }, [
      t,
      e,
      n,
      r,
      u
    ]);
    const h = t.name ?? "Widget";
    return o.jsx("iframe", {
      ref: i,
      title: h,
      sandbox: "allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-downloads",
      allow: "camera;microphone;clipboard-write;display-capture;autoplay;encrypted-media",
      style: {
        width: "100%",
        height: "100%",
        border: "none",
        display: "block",
        flexGrow: 1
      }
    });
  }
  var NKe = "WidgetsDrawer_WidgetsDrawer__1imyxfs0", zKe = "WidgetsDrawer_WidgetsDrawerHeader__1imyxfs1", UKe = "WidgetsDrawer_WidgetIframeContainer__1imyxfs2", VKe = "WidgetsDrawer_AddWidgetForm__1imyxfs3", KY = "WidgetsDrawer_AddWidgetInput__1imyxfs4";
  const HKe = [
    {
      apiUrl: "https://scalar.vector.im/api",
      uiUrl: "https://scalar.vector.im"
    }
  ];
  async function $Ke(t) {
    var _a6;
    const e = [];
    try {
      const n = t.getHomeserverUrl(), i = `https://${new URL(n).hostname}/.well-known/matrix/client`, a = await fetch(i, {
        method: "GET"
      });
      if (a.ok) {
        const l = (_a6 = await a.json()) == null ? void 0 : _a6["m.integrations"];
        (l == null ? void 0 : l.managers) && Array.isArray(l.managers) && l.managers.forEach((c) => {
          c.api_url && c.ui_url && e.push({
            apiUrl: c.api_url,
            uiUrl: c.ui_url
          });
        });
      }
    } catch {
    }
    try {
      const n = t.getAccountData("m.widgets");
      if (n) {
        const r = n.getContent();
        Object.values(r).forEach((i) => {
          var _a7;
          (i == null ? void 0 : i.type) === "m.integration_manager" && (i == null ? void 0 : i.url) && (e.some((s) => s.uiUrl === i.url) || e.push({
            apiUrl: ((_a7 = i.data) == null ? void 0 : _a7.api_url) || i.url,
            uiUrl: i.url
          }));
        });
      }
    } catch {
    }
    return e.length === 0 ? HKe : e;
  }
  async function WKe(t, e) {
    var _a6;
    try {
      const n = await t.getOpenIdToken(), r = await fetch(`${e}/register`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json"
        },
        body: JSON.stringify(n)
      });
      return r.ok ? ((_a6 = await r.json()) == null ? void 0 : _a6.scalar_token) ?? null : null;
    } catch {
      return null;
    }
  }
  function qKe(t, e, n, r, i) {
    const a = new URL(t);
    return a.pathname = "/index.html", e && a.searchParams.set("scalar_token", e), a.searchParams.set("room_id", n), a.toString();
  }
  function KKe() {
    const t = be(), [e, n] = p.useState({
      managers: [],
      scalarToken: null,
      loading: true,
      error: null
    }), r = p.useCallback(async () => {
      n((i) => ({
        ...i,
        loading: true,
        error: null
      }));
      try {
        const i = await $Ke(t);
        let a = null;
        i.length > 0 && i[0] && (a = await WKe(t, i[0].apiUrl)), n({
          managers: i,
          scalarToken: a,
          loading: false,
          error: null
        });
      } catch (i) {
        n({
          managers: [],
          scalarToken: null,
          loading: false,
          error: i instanceof Error ? i.message : "Failed to load integration managers"
        });
      }
    }, [
      t
    ]);
    return p.useEffect(() => {
      r();
    }, [
      r
    ]), {
      ...e,
      refresh: r
    };
  }
  var GKe = "IntegrationManager_IntegrationManagerOverlay__17d42d80", YKe = "IntegrationManager_IntegrationManagerHeader__17d42d81", ZKe = "IntegrationManager_IntegrationManagerIframe__17d42d82";
  function JKe({ room: t, open: e, onClose: n }) {
    const { managers: r, scalarToken: i, loading: a, error: s } = KKe(), l = p.useRef(null), [c, d] = p.useState(false), u = r[0], h = u ? qKe(u.uiUrl, i, t.roomId) : null;
    return p.useEffect(() => {
      if (!e) return;
      const f = (g) => {
        var _a6, _b3;
        if (u) {
          try {
            const m = new URL(u.uiUrl).origin;
            if (g.origin !== m) return;
          } catch {
            return;
          }
          (((_a6 = g.data) == null ? void 0 : _a6.action) === "close_scalar" || ((_b3 = g.data) == null ? void 0 : _b3.action) === "close") && n();
        }
      };
      return window.addEventListener("message", f), () => window.removeEventListener("message", f);
    }, [
      e,
      u,
      n
    ]), p.useEffect(() => {
      e || d(false);
    }, [
      e
    ]), o.jsx(Hn, {
      open: e,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            clickOutsideDeactivates: true,
            onDeactivate: n
          },
          children: o.jsxs(E, {
            className: GKe,
            direction: "Column",
            children: [
              o.jsx(wn, {
                className: YKe,
                variant: "Background",
                size: "600",
                children: o.jsxs(E, {
                  grow: "Yes",
                  alignItems: "Center",
                  gap: "200",
                  children: [
                    o.jsx(E, {
                      grow: "Yes",
                      alignItems: "Center",
                      gap: "200",
                      children: o.jsx(D, {
                        size: "H5",
                        truncate: true,
                        children: "Integration Manager"
                      })
                    }),
                    o.jsx(E, {
                      shrink: "No",
                      alignItems: "Center",
                      children: o.jsx(Oe, {
                        variant: "Background",
                        onClick: n,
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    })
                  ]
                })
              }),
              o.jsxs(E, {
                grow: "Yes",
                direction: "Column",
                alignItems: "Center",
                justifyContent: "Center",
                children: [
                  a && o.jsxs(E, {
                    direction: "Column",
                    alignItems: "Center",
                    gap: "300",
                    children: [
                      o.jsx(dt, {
                        size: "400"
                      }),
                      o.jsx(D, {
                        size: "T300",
                        priority: "300",
                        children: "Connecting to integration manager..."
                      })
                    ]
                  }),
                  s && o.jsx(E, {
                    direction: "Column",
                    alignItems: "Center",
                    gap: "300",
                    children: o.jsxs(D, {
                      size: "T300",
                      priority: "300",
                      children: [
                        "Failed to connect: ",
                        s
                      ]
                    })
                  }),
                  !a && !s && !u && o.jsx(E, {
                    direction: "Column",
                    alignItems: "Center",
                    gap: "300",
                    children: o.jsx(D, {
                      size: "T300",
                      priority: "300",
                      children: "No integration manager available for this homeserver."
                    })
                  }),
                  !a && !s && h && o.jsxs(o.Fragment, {
                    children: [
                      !c && o.jsxs(E, {
                        direction: "Column",
                        alignItems: "Center",
                        gap: "300",
                        style: {
                          position: "absolute"
                        },
                        children: [
                          o.jsx(dt, {
                            size: "400"
                          }),
                          o.jsx(D, {
                            size: "T300",
                            priority: "300",
                            children: "Loading..."
                          })
                        ]
                      }),
                      o.jsx("iframe", {
                        ref: l,
                        className: ZKe,
                        title: "Integration Manager",
                        src: h,
                        sandbox: "allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",
                        allow: "microphone; camera; encrypted-media; autoplay; clipboard-write; display-capture",
                        onLoad: () => d(true),
                        style: {
                          opacity: c ? 1 : 0
                        }
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  var XKe = "SidebarResizer_SidebarResizerDockRight__ivgh150", QKe = "SidebarResizer_SidebarResizerDockLeft__ivgh151", eGe = "SidebarResizer_SidebarResizerDockTop__ivgh152", tGe = Jr({
    defaultClassName: "SidebarResizer_SidebarResizer__ivgh153",
    variantClassNames: {
      topSided: {
        true: "SidebarResizer_SidebarResizer_topSided_true__ivgh154",
        false: "SidebarResizer_SidebarResizer_topSided_false__ivgh155"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), nGe = "SidebarResizer_SidebarResizerHover__ivgh156", rGe = "SidebarResizer_SideBarResizerAnimation__ivgh157";
  function Zl({ sidebarWidth: t, setSidebarWidth: e, setCurWidth: n, minValue: r, maxValue: i, instep: a, outstep: s, isReversed: l, topSided: c }) {
    const [d, u] = p.useState(false), [h, f] = p.useState(false), [g, m] = p.useState(0), [v, y] = p.useState(0), [w, b] = p.useState(0);
    p.useEffect(() => {
      const S = l ? -(g - w) : g - w;
      let T = Math.min(Math.max(t - S, r), i);
      a && s && T > a && T < s && (T = T > (a + s) / 2 ? s : a), S && e(T);
    }, [
      w
    ]), p.useEffect(() => {
      const S = l ? -(g - v) : g - v;
      let T = Math.min(Math.max(t - S, r), i);
      a && s && T > a && T < s && (T = T > (a + s) / 2 ? s : a), S && n && n(T);
    }, [
      v
    ]);
    const j = p.useCallback((S) => {
      S.preventDefault(), y(c ? S.clientY : S.clientX);
    }, []), k = p.useCallback((S) => {
      S.preventDefault(), b(c ? S.clientY : S.clientX), f(false), window.removeEventListener("pointerup", k), window.removeEventListener("pointermove", j);
    }, []), C = p.useCallback((S) => {
      S.preventDefault(), S.currentTarget.setPointerCapture(S.pointerId), m(c ? S.clientY : S.clientX), f(true), window.addEventListener("pointerup", k), window.addEventListener("pointermove", j);
    }, [
      k,
      j
    ]), x = c ? eGe : l ? QKe : XKe;
    return o.jsx(E, {
      className: `${tGe({
        topSided: !!c
      })} ${x} ${d || h ? nGe : ""}`,
      onPointerEnter: () => u(true),
      onPointerLeave: () => u(false),
      onPointerDown: C,
      shrink: "No",
      children: o.jsx(E, {
        shrink: "No",
        className: rGe,
        style: {
          opacity: d || h ? "100%" : "0%"
        }
      })
    });
  }
  const Gde = Po("WidgetsDrawer");
  function iGe({ activeWidget: t, onBack: e }) {
    const n = _k(ge, "isWidgetDrawer");
    return o.jsx(wn, {
      className: zKe,
      variant: "Background",
      size: "600",
      children: o.jsxs(E, {
        grow: "Yes",
        alignItems: "Center",
        gap: "200",
        children: [
          t && o.jsx(E, {
            shrink: "No",
            alignItems: "Center",
            children: o.jsx(Oe, {
              fill: "None",
              onClick: e,
              children: o.jsx(Q, {
                src: q.ArrowLeft
              })
            })
          }),
          o.jsx(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: o.jsx(D, {
              size: "H5",
              truncate: true,
              children: t ? t.name || "Widget" : "Widgets"
            })
          }),
          o.jsx(E, {
            shrink: "No",
            alignItems: "Center",
            children: o.jsx(ar, {
              position: "Bottom",
              align: "End",
              offset: 4,
              tooltip: o.jsx(pr, {
                children: o.jsx(D, {
                  children: "Close"
                })
              }),
              children: (r) => o.jsx(Oe, {
                ref: r,
                variant: "Background",
                onClick: () => n(false),
                children: o.jsx(Q, {
                  src: q.Cross
                })
              })
            })
          })
        ]
      })
    });
  }
  function oGe({ room: t, onAdded: e }) {
    const n = be(), [r, i] = p.useState(""), [a, s] = p.useState(""), [l, c] = p.useState(false), d = async (u) => {
      if (u.preventDefault(), !(!r.trim() || !a.trim())) {
        c(true);
        try {
          const h = `${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
          await n.sendStateEvent(t.roomId, Pn.RoomWidget, {
            type: "m.custom",
            url: qde(a.trim()),
            name: r.trim(),
            id: h,
            creatorUserId: n.getUserId()
          }, h), i(""), s(""), e();
        } catch (h) {
          Gde.error("Failed to add widget:", h);
        } finally {
          c(false);
        }
      }
    };
    return o.jsx("form", {
      onSubmit: d,
      children: o.jsxs(E, {
        className: VKe,
        direction: "Column",
        gap: "200",
        children: [
          o.jsx(D, {
            size: "L400",
            priority: "300",
            children: "Add Widget"
          }),
          o.jsx(mn, {
            className: KY,
            size: "300",
            placeholder: "Widget Name",
            value: r,
            onChange: (u) => i(u.target.value)
          }),
          o.jsx(mn, {
            className: KY,
            size: "300",
            placeholder: "Widget URL (https://...)",
            value: a,
            onChange: (u) => s(u.target.value)
          }),
          o.jsx(xe, {
            type: "submit",
            size: "300",
            variant: "Primary",
            disabled: l || !r.trim() || !a.trim(),
            children: o.jsx(D, {
              size: "B300",
              children: l ? "Adding..." : "Add Widget"
            })
          })
        ]
      })
    });
  }
  function aGe({ widget: t, onSelect: e, onRemove: n, canRemove: r }) {
    const i = (a) => {
      a.stopPropagation(), n(t);
    };
    return o.jsx(Ye, {
      onClick: () => e(t),
      size: "300",
      radii: "300",
      after: r ? o.jsx(ar, {
        position: "Left",
        tooltip: o.jsx(pr, {
          children: o.jsx(D, {
            children: "Remove Widget"
          })
        }),
        children: (a) => o.jsx(Oe, {
          ref: a,
          size: "300",
          variant: "Critical",
          fill: "None",
          onClick: i,
          children: o.jsx(Q, {
            size: "100",
            src: q.Delete
          })
        })
      }) : void 0,
      children: o.jsxs(E, {
        grow: "Yes",
        direction: "Column",
        children: [
          o.jsx(D, {
            size: "T300",
            truncate: true,
            children: t.name || "Unnamed Widget"
          }),
          o.jsx(D, {
            size: "T200",
            priority: "300",
            truncate: true,
            children: t.type || "m.custom"
          })
        ]
      })
    });
  }
  function sGe({ room: t }) {
    const e = be(), n = Kde(t), [r, i] = p.useState(null), [a, s] = p.useState(false), [l, c] = p.useState(false), d = Qd(), u = ri(t), f = Ki(u, d).stateEvent(Pn.RoomWidget, e.getSafeUserId()), [g, m] = Fe(ge, "widgetSidebarWidth"), [v, y] = p.useState(g);
    p.useEffect(() => {
      y(g);
    }, [
      g
    ]);
    const w = async (j) => {
      try {
        await e.sendStateEvent(t.roomId, Pn.RoomWidget, {}, j.id), (r == null ? void 0 : r.id) === j.id && i(null);
      } catch (k) {
        Gde.error("Failed to remove widget:", k);
      }
    }, b = () => i(null);
    return o.jsxs(E, {
      className: NKe,
      shrink: "No",
      direction: "Column",
      style: {
        position: "relative",
        width: Dr() ? "inherit" : He(v)
      },
      children: [
        !Dr() && o.jsx(Zl, {
          setCurWidth: y,
          sidebarWidth: g,
          setSidebarWidth: m,
          minValue: 50,
          maxValue: 1200,
          isReversed: true
        }),
        o.jsx(iGe, {
          activeWidget: r,
          onBack: b
        }),
        r ? o.jsx(E, {
          className: UKe,
          grow: "Yes",
          children: o.jsx(LKe, {
            widget: r,
            roomId: t.roomId,
            mx: e
          }, r.id)
        }) : o.jsx(dn, {
          variant: "Background",
          visibility: "Hover",
          children: o.jsxs(E, {
            direction: "Column",
            gap: "100",
            style: {
              padding: ee.space.S200
            },
            children: [
              n.length === 0 && !a && o.jsx(E, {
                style: {
                  padding: ee.space.S300
                },
                children: o.jsx(D, {
                  size: "T300",
                  priority: "300",
                  children: "No widgets in this room."
                })
              }),
              n.map((j) => o.jsx(aGe, {
                widget: j,
                onSelect: i,
                onRemove: w,
                canRemove: f
              }, j.id)),
              f && o.jsxs(o.Fragment, {
                children: [
                  o.jsx(nr, {
                    variant: "Surface",
                    size: "300"
                  }),
                  a ? o.jsx(oGe, {
                    room: t,
                    onAdded: () => s(false)
                  }) : o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    style: {
                      padding: `${ee.space.S100} ${ee.space.S300}`
                    },
                    children: [
                      o.jsx(xe, {
                        size: "300",
                        variant: "Primary",
                        fill: "Soft",
                        onClick: () => c(true),
                        before: o.jsx(Q, {
                          size: "100",
                          src: q.Category
                        }),
                        children: o.jsx(D, {
                          size: "B300",
                          children: "Integration Manager"
                        })
                      }),
                      o.jsx(xe, {
                        size: "300",
                        variant: "Secondary",
                        fill: "Soft",
                        onClick: () => s(true),
                        before: o.jsx(Q, {
                          size: "100",
                          src: q.Plus
                        }),
                        children: o.jsx(D, {
                          size: "B300",
                          children: "Add Custom Widget"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        }),
        o.jsx(JKe, {
          room: t,
          open: l,
          onClose: () => c(false)
        })
      ]
    });
  }
  const lGe = () => vn(void 0), GM = Gf(() => lGe()), cGe = () => vn(false), Yde = Gf(() => cGe());
  var dGe = "style_ModalFlex__1dvy9cn0", uGe = "style_ModalHeader__1dvy9cn1", hGe = "style_ModalScroll__1dvy9cn2", fGe = "style_ModalContent__1dvy9cn3", mGe = "style_ModalTopic__1dvy9cn4";
  const Vf = ft(({ name: t, topic: e, requestClose: n, className: r, ...i }, a) => o.jsxs(Go, {
    size: "300",
    flexHeight: true,
    className: gt(dGe, r),
    ...i,
    ref: a,
    children: [
      o.jsxs(wn, {
        className: uGe,
        variant: "Surface",
        size: "500",
        children: [
          o.jsx(E, {
            grow: "Yes",
            children: o.jsx(D, {
              size: "H4",
              truncate: true,
              children: t
            })
          }),
          o.jsx(Oe, {
            size: "300",
            onClick: n,
            radii: "300",
            children: o.jsx(Q, {
              src: q.Cross
            })
          })
        ]
      }),
      o.jsx(dn, {
        "data-room-topic": true,
        className: hGe,
        size: "300",
        hideTrack: true,
        children: o.jsx(E, {
          className: fGe,
          direction: "Column",
          gap: "100",
          children: o.jsx(D, {
            size: "T300",
            className: mGe,
            priority: "400",
            children: o.jsx(nF, {
              options: fs,
              children: rF(e)
            })
          })
        })
      })
    ]
  })), Zde = (t, e) => !t || !e ? false : vse(t, e), gGe = (t, e) => t.reduce((r, i) => {
    var _a6;
    const a = e.get(i);
    if (!a) return r;
    const s = r ?? {
      total: 0,
      highlight: 0,
      from: /* @__PURE__ */ new Set()
    };
    return s.total += a.total, s.highlight += a.highlight, (_a6 = s.from) == null ? void 0 : _a6.add(i), s;
  }, void 0), wh = (t, e) => {
    const n = p.useCallback((r) => gGe(t, r), [
      t
    ]);
    return Ze(jF(e, n, Zde));
  }, w3 = (t, e) => {
    const n = p.useCallback((r) => r.get(t), [
      t
    ]);
    return Ze(jF(e, n, Zde));
  }, GY = fo("LeaveRoomPrompt");
  function YM({ roomId: t, onDone: e, onCancel: n }) {
    const r = be(), [i, a] = Et(p.useCallback(async () => {
      GY.info("ui", "Leave room button clicked", {
        roomId: t
      }), r.leave(t);
    }, [
      r,
      t
    ])), s = () => {
      a();
    };
    return p.useEffect(() => {
      i.status === ve.Success && (GY.info("ui", "Successfully left room", {
        roomId: t
      }), e());
    }, [
      i,
      e,
      t
    ]), o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: n,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Leave Room"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: n,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        children: "Are you sure you want to leave this room?"
                      }),
                      i.status === ve.Error && o.jsxs(D, {
                        style: {
                          color: ct.Critical.Main
                        },
                        size: "T300",
                        children: [
                          "Failed to leave room! ",
                          i.error.message
                        ]
                      })
                    ]
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    variant: "Critical",
                    onClick: s,
                    before: i.status === ve.Loading ? o.jsx(dt, {
                      fill: "Solid",
                      variant: "Critical",
                      size: "200"
                    }) : void 0,
                    "aria-disabled": i.status === ve.Loading || i.status === ve.Success,
                    children: o.jsx(D, {
                      size: "B400",
                      children: i.status === ve.Loading ? "Leaving..." : "Leave"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  const ZM = (t) => Ze(qr)[t], pGe = () => {
    const t = be(), e = Fn(Ooe);
    return p.useCallback((n, r) => {
      e(n, r, t);
    }, [
      t,
      e
    ]);
  }, FGe = (t) => {
    const e = Fn(qr);
    p.useEffect(() => {
      if (!t) return;
      const n = t.getAccountData(Zr.SableNicknames);
      n && e(n.getContent() || {});
    }, [
      t,
      e
    ]), bp(t, p.useCallback((n) => {
      n.getType() === Zr.SableNicknames && e(n.getContent() || {});
    }, [
      e
    ]));
  }, Ip = (t, e) => {
    var _a6;
    const n = $i(t, ce.RoomAvatar);
    if (e) return (_a6 = t.getAvatarFallbackMember()) == null ? void 0 : _a6.getMxcAvatarUrl();
    const r = n == null ? void 0 : n.getContent();
    return r && typeof r.url == "string" ? r.url : void 0;
  }, rc = (t) => {
    const e = t.guessDMUserId(), n = ZM(e || ""), i = Ze(gi).has(t.roomId), [a, s] = p.useState(t.name);
    return p.useEffect(() => {
      const l = () => {
        t.name === "Empty room" && t.recalculate();
        const c = i && n ? n : t.name;
        s((d) => d !== c ? c : d);
      };
      return l(), t.on(mt.Name, l), t.on(qn.Members, l), () => {
        t.removeListener(mt.Name, l), t.removeListener(qn.Members, l);
      };
    }, [
      t,
      n,
      i
    ]), a;
  }, D3 = (t) => {
    var _a6;
    const n = (_a6 = $i(t, ce.RoomTopic)) == null ? void 0 : _a6.getContent();
    return n && typeof n.topic == "string" ? n.topic : void 0;
  }, xS = (t) => {
    var _a6;
    return (_a6 = $i(t, ce.RoomJoinRules)) == null ? void 0 : _a6.getContent();
  }, JM = vn(void 0);
  function ic({ children: t }) {
    const e = br(), n = Za(), r = Fn(JM), i = p.useCallback(() => {
      var _a6, _b3;
      const l = (_a6 = [
        GB,
        YB,
        ZB
      ].map((h) => Wo({
        path: h,
        end: false
      }, n.pathname)).find((h) => h !== null)) == null ? void 0 : _a6.params.roomIdOrAlias;
      if (l && r(decodeURIComponent(l)), Wo({
        path: J2,
        caseSensitive: true,
        end: false
      }, n.pathname)) {
        e($c());
        return;
      }
      if (Wo({
        path: X2,
        caseSensitive: true,
        end: false
      }, n.pathname)) {
        e(eP());
        return;
      }
      const d = (_b3 = Wo({
        path: Q2,
        caseSensitive: true,
        end: false
      }, n.pathname)) == null ? void 0 : _b3.params.spaceIdOrAlias, u = d && decodeURIComponent(d);
      if (u) {
        e(Sk(u));
        return;
      }
      if (Wo({
        path: eb,
        caseSensitive: true,
        end: false
      }, n.pathname)) {
        e(nb());
        return;
      }
      Wo({
        path: tb,
        caseSensitive: true,
        end: false
      }, n.pathname) && e(nP());
    }, [
      e,
      n,
      r
    ]);
    return t(i);
  }
  const XM = (t) => {
    const e = $i(t, ce.RoomPinnedEvents);
    return p.useMemo(() => {
      var _a6;
      return ((_a6 = e == null ? void 0 : e.getContent()) == null ? void 0 : _a6.pinned) ?? [];
    }, [
      e
    ]);
  };
  var Ao = ((t) => (t[t.GeneralPage = 0] = "GeneralPage", t[t.MembersPage = 1] = "MembersPage", t[t.PermissionsPage = 2] = "PermissionsPage", t[t.EmojisStickersPage = 3] = "EmojisStickersPage", t[t.DeveloperToolsPage = 4] = "DeveloperToolsPage", t[t.CosmeticsPage = 5] = "CosmeticsPage", t[t.AbbreviationsPage = 6] = "AbbreviationsPage", t))(Ao || {});
  const QM = vn(void 0), vGe = () => Ze(QM), _Ge = () => {
    const t = Fn(QM);
    return p.useCallback(() => {
      t(void 0);
    }, [
      t
    ]);
  }, Bp = () => {
    const t = Fn(QM);
    return p.useCallback((n, r, i) => {
      t({
        roomId: n,
        spaceId: r,
        page: i
      });
    }, [
      t
    ]);
  }, yGe = {
    [Ts.Unset]: "Default",
    [Ts.AllMessages]: "All Messages",
    [Ts.SpecialMessages]: "Mention & Keywords",
    [Ts.Mute]: "Mute"
  }, bGe = [
    Ts.Unset,
    Ts.AllMessages,
    Ts.SpecialMessages,
    Ts.Mute
  ].map((t) => ({
    value: t,
    label: yGe[t],
    description: t === Ts.Unset ? "Follows your global notification rules" : void 0
  }));
  function Jde({ roomId: t, value: e = Ts.Unset, children: n }) {
    const { modeState: r, setMode: i } = kAe(t), a = r.status === ve.Loading;
    return o.jsx(Kc, {
      value: e,
      options: bGe,
      onSelect: (s) => i(s, e),
      loading: a,
      offset: 5,
      position: "Right",
      align: "Start",
      renderTrigger: ({ openMenu: s, opened: l }) => n(s, l, a),
      renderOption: ({ option: s, selected: l }) => o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        style: s.value === Ts.Unset ? {
          minHeight: "48px"
        } : void 0,
        children: [
          o.jsx(Q, {
            size: "100",
            src: Qk(s.value),
            filled: l
          }),
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "T300",
                children: l ? o.jsx("b", {
                  children: s.label
                }) : s.label
              }),
              s.description && o.jsx(D, {
                size: "T200",
                priority: "300",
                children: s.description
              })
            ]
          })
        ]
      })
    });
  }
  const Xde = () => {
    var _a6;
    const e = (_a6 = vh(ce.Direct)) == null ? void 0 : _a6.getContent(), n = td(), r = ec(n);
    return p.useMemo(() => typeof e != "object" ? [] : Object.keys(e).filter((s) => {
      const l = e[s];
      return Array.isArray(l) ? l.some((d) => typeof d == "string" && !!r(d)) : false;
    }), [
      e,
      r
    ]);
  }, xGe = {
    limit: 1e3,
    matchOptions: {
      contain: true
    }
  }, wGe = (t) => _n(t) ?? t;
  function Pp({ room: t, requestClose: e }) {
    const n = be(), r = Kr(), i = p.useRef(null), a = Xde(), [s, l] = p.useState(), c = p.useMemo(() => a.filter((C) => {
      var _a6;
      return ((_a6 = t.getMember(C)) == null ? void 0 : _a6.membership) !== Ht.Join;
    }), [
      a,
      t
    ]), [d, u, h] = tc(c, wGe, xGe), f = (d == null ? void 0 : d.query) ? a3(d.query.split(" ")) : void 0, [g, m] = Et(p.useCallback(async (C, x) => {
      await n.invite(t.roomId, C, x);
    }, [
      n,
      t
    ])), v = g.status === ve.Loading, y = () => {
      i.current && (i.current.value = ""), l(void 0), h();
    }, w = (C) => {
      C.preventDefault();
      const x = C.target;
      if (v || !s) return;
      const S = x == null ? void 0 : x.reasonInput, T = S == null ? void 0 : S.value.trim();
      m(s, T || void 0).then(() => {
        r() && (y(), S && (S.value = ""));
      });
    }, b = (C) => {
      const x = C.currentTarget.value.trim();
      if (co(x)) l(x);
      else {
        l(void 0);
        const S = _n(x) ?? (x.startsWith("@") ? x.slice(1) : x);
        S ? u(S) : h();
      }
    }, j = (C) => {
      i.current && (i.current.value = C, l(C), h(), i.current.focus());
    }, k = (C) => {
      if (Yt.isKeyHotkey("escape", C)) {
        h();
        return;
      }
      if (Yt.isKeyHotkey("tab", C) && d && d.items.length > 0) {
        C.preventDefault();
        const x = d.items[0];
        if (!x) return;
        j(x);
      }
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: () => i.current,
            clickOutsideDeactivates: true,
            onDeactivate: e,
            escapeDeactivates: kt
          },
          children: o.jsx(lr, {
            children: o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              children: [
                o.jsxs(wn, {
                  size: "500",
                  style: {
                    padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`
                  },
                  children: [
                    o.jsx(E, {
                      grow: "Yes",
                      children: o.jsx(D, {
                        size: "H4",
                        truncate: true,
                        children: "Invite"
                      })
                    }),
                    o.jsx(E, {
                      shrink: "No",
                      children: o.jsx(Oe, {
                        size: "300",
                        radii: "300",
                        onClick: e,
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    })
                  ]
                }),
                o.jsxs(E, {
                  as: "form",
                  onSubmit: w,
                  shrink: "No",
                  style: {
                    padding: ee.space.S400
                  },
                  direction: "Column",
                  gap: "400",
                  children: [
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx(D, {
                          size: "L400",
                          children: "User ID"
                        }),
                        o.jsxs("div", {
                          children: [
                            o.jsx(mn, {
                              size: "500",
                              ref: i,
                              onChange: b,
                              onKeyDown: k,
                              placeholder: "@username:server",
                              name: "userIdInput",
                              variant: "Background",
                              disabled: v,
                              autoComplete: "off",
                              required: true
                            }),
                            d && d.items.length > 0 && o.jsx(Ft, {
                              focusTrapOptions: {
                                initialFocus: false,
                                onDeactivate: h,
                                returnFocusOnDeactivate: false,
                                clickOutsideDeactivates: true,
                                allowOutsideClick: true,
                                isKeyForward: (C) => Yt.isKeyHotkey("arrowdown", C),
                                isKeyBackward: (C) => Yt.isKeyHotkey("arrowup", C),
                                escapeDeactivates: kt
                              },
                              children: o.jsx(E, {
                                style: {
                                  position: "relative"
                                },
                                children: o.jsx(tn, {
                                  style: {
                                    position: "absolute",
                                    top: 0,
                                    zIndex: 1,
                                    width: "100%"
                                  },
                                  children: o.jsx(dn, {
                                    size: "300",
                                    style: {
                                      maxHeight: He(100)
                                    },
                                    children: o.jsx("div", {
                                      style: {
                                        padding: ee.space.S100
                                      },
                                      children: d.items.map((C) => {
                                        const x = `${_n(C)}`, S = bo(C);
                                        return o.jsx(Ye, {
                                          type: "button",
                                          size: "300",
                                          variant: "Surface",
                                          radii: "300",
                                          onClick: () => j(C),
                                          after: o.jsx(D, {
                                            size: "T200",
                                            truncate: true,
                                            children: S
                                          }),
                                          disabled: v,
                                          children: o.jsx(E, {
                                            grow: "Yes",
                                            children: o.jsx(D, {
                                              size: "T300",
                                              truncate: true,
                                              children: o.jsx("b", {
                                                children: f ? ip(f, [
                                                  x ?? C
                                                ]) : x
                                              })
                                            })
                                          })
                                        }, C);
                                      })
                                    })
                                  })
                                })
                              })
                            })
                          ]
                        })
                      ]
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx(D, {
                          size: "L400",
                          children: "Reason (Optional)"
                        }),
                        o.jsx(js, {
                          size: "500",
                          name: "reasonInput",
                          variant: "Background",
                          rows: 4,
                          resize: "None"
                        })
                      ]
                    }),
                    g.status === ve.Error && o.jsx(D, {
                      size: "T200",
                      style: {
                        color: ct.Critical.Main
                      },
                      className: Pi,
                      children: o.jsx("b", {
                        children: g.error.message
                      })
                    }),
                    o.jsx(xe, {
                      type: "submit",
                      disabled: !s || v,
                      before: v && o.jsx(dt, {
                        size: "200",
                        variant: "Primary",
                        fill: "Solid"
                      }),
                      children: o.jsx(D, {
                        size: "B400",
                        children: "Invite"
                      })
                    })
                  ]
                })
              ]
            })
          })
        })
      })
    });
  }
  function Qde({ onCancel: t, onInviteDirect: e, onConvertAndInvite: n, converting: r, convertError: i }) {
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: t,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Invite another Member"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: t,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsxs(D, {
                        size: "T300",
                        children: [
                          "This is a ",
                          o.jsx("b", {
                            children: "Direct Message"
                          }),
                          " room, intended for a conversation between two persons. Would you like to convert it into a ",
                          o.jsx("b", {
                            children: "group chat"
                          }),
                          " before continuing?"
                        ]
                      }),
                      i && o.jsxs(D, {
                        style: {
                          color: ct.Critical.Main
                        },
                        size: "T300",
                        children: [
                          "Failed to convert direct message to room! ",
                          i
                        ]
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(xe, {
                        variant: "Primary",
                        onClick: n,
                        disabled: r,
                        before: r ? o.jsx(dt, {
                          fill: "Solid",
                          variant: "Primary",
                          size: "200"
                        }) : void 0,
                        "aria-disabled": r,
                        children: o.jsx(D, {
                          size: "B400",
                          children: r ? "Converting..." : "Convert to Group Chat and Invite"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Warning",
                        fill: "Soft",
                        onClick: e,
                        disabled: r,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Invite to Direct Message anyway"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Secondary",
                        fill: "Soft",
                        onClick: t,
                        disabled: r,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Cancel"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  var eue = "styles_PickerMenu__1vcya4p0", tue = "styles_PickerContainer__1vcya4p1", DGe = "styles_PickerColumnLabel__1vcya4p2", CGe = "styles_PickerColumnContent__1vcya4p3";
  function C1({ title: t, children: e }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          className: DGe,
          size: "L400",
          children: t
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(Gc, {
            variant: "Background",
            children: o.jsx(dn, {
              variant: "Background",
              size: "300",
              hideTrack: true,
              children: o.jsx(E, {
                className: CGe,
                direction: "Column",
                gap: "100",
                children: e
              })
            })
          })
        })
      ]
    });
  }
  const nue = p.forwardRef(({ min: t, max: e, value: n, onChange: r }, i) => {
    const [a] = Fe(ge, "hour24Clock"), s = ti(n).hour(), l = a ? s : tAe(s), c = ti(n).minute(), d = s >= 12, u = (x) => {
      r(Math.min(Math.max(t, x), e));
    }, h = (x) => {
      const S = yf(a ? x : Cw(x, d)), T = yf(s), A = n + (S - T);
      u(A);
    }, f = (x) => {
      const S = uI(x), T = uI(c), A = n + (S - T);
      u(A);
    }, g = (x) => {
      const S = yf(Cw(l, x)), T = yf(s), A = n + (S - T);
      u(A);
    }, m = ti(t).hour(), v = ti(e).hour(), y = ti(t).minute(), w = ti(e).minute(), b = m >= 12, j = v >= 12, k = dI(t, n), C = dI(e, n);
    return o.jsx(tn, {
      className: eue,
      ref: i,
      children: o.jsxs(E, {
        direction: "Row",
        gap: "200",
        className: tue,
        children: [
          o.jsx(C1, {
            title: "Hour",
            children: a ? Array.from({
              length: 24
            }, (x, S) => S).map((x) => o.jsx(Qe, {
              size: "500",
              variant: x === l ? "Primary" : "Background",
              fill: "None",
              radii: "300",
              "aria-selected": x === l,
              onClick: () => h(x),
              disabled: k && x < m || C && x > v,
              children: o.jsx(D, {
                size: "T300",
                children: x < 10 ? `0${x}` : x
              })
            }, x)) : Array.from({
              length: 12
            }, (x, S) => S === 0 ? 12 : S).map((x) => o.jsx(Qe, {
              size: "500",
              variant: x === l ? "Primary" : "Background",
              fill: "None",
              radii: "300",
              "aria-selected": x === l,
              onClick: () => h(x),
              disabled: k && Cw(x, d) < m || C && Cw(x, d) > v,
              children: o.jsx(D, {
                size: "T300",
                children: x < 10 ? `0${x}` : x
              })
            }, x))
          }),
          o.jsx(C1, {
            title: "Minutes",
            children: Array.from({
              length: 60
            }, (x, S) => S).map((x) => o.jsx(Qe, {
              size: "500",
              variant: x === c ? "Primary" : "Background",
              fill: "None",
              radii: "300",
              "aria-selected": x === c,
              onClick: () => f(x),
              disabled: k && s === m && x < y || C && s === v && x > w,
              children: o.jsx(D, {
                size: "T300",
                children: x < 10 ? `0${x}` : x
              })
            }, x))
          }),
          !a && o.jsxs(C1, {
            title: "Period",
            children: [
              o.jsx(Qe, {
                size: "500",
                variant: d ? "SurfaceVariant" : "Primary",
                fill: "None",
                radii: "300",
                "aria-selected": !d,
                onClick: () => g(false),
                disabled: k && b,
                children: o.jsx(D, {
                  size: "T300",
                  children: "AM"
                })
              }),
              o.jsx(Qe, {
                size: "500",
                variant: d ? "Primary" : "SurfaceVariant",
                fill: "None",
                radii: "300",
                "aria-selected": d,
                onClick: () => g(true),
                disabled: C && !j,
                children: o.jsx(D, {
                  size: "T300",
                  children: "PM"
                })
              })
            ]
          })
        ]
      })
    });
  }), rue = p.forwardRef(({ min: t, max: e, value: n, onChange: r }, i) => {
    const a = ti(n).year(), s = ti(n).month() + 1, l = ti(n).date(), c = (k) => {
      r(Math.min(Math.max(t, k), e));
    }, d = (k) => {
      const C = dF(k), x = dF(l), S = n + (C - x);
      c(S);
    }, u = (k, C) => {
      const x = nK(k, C), S = aE(a, s, l), T = n - S, B = aE(C, k, Math.min(x, l)) + T;
      c(B);
    }, h = (k) => {
      u(k, a);
    }, f = (k) => {
      u(s, k);
    }, g = ti(t).year(), m = ti(e).year(), v = m - g + 1, y = ti(t).month() + 1, w = ti(e).month() + 1, b = ti(t).date(), j = ti(e).date();
    return o.jsx(tn, {
      className: eue,
      ref: i,
      children: o.jsxs(E, {
        direction: "Row",
        gap: "200",
        className: tue,
        children: [
          o.jsx(C1, {
            title: "Day",
            children: Array.from({
              length: nK(s, a)
            }, (k, C) => C + 1).map((k) => o.jsx(Qe, {
              size: "500",
              variant: l === k ? "Primary" : "SurfaceVariant",
              fill: "None",
              radii: "300",
              "aria-selected": l === k,
              onClick: () => d(k),
              disabled: a === g && s === y && k < b || a === m && s === w && k > j,
              children: o.jsx(D, {
                size: "T300",
                children: k
              })
            }, k))
          }),
          o.jsx(C1, {
            title: "Month",
            children: Array.from({
              length: 12
            }, (k, C) => C + 1).map((k) => o.jsx(Qe, {
              size: "500",
              variant: s === k ? "Primary" : "SurfaceVariant",
              fill: "None",
              radii: "300",
              "aria-selected": s === k,
              onClick: () => h(k),
              disabled: a === g && k < y || a === m && k > w,
              children: o.jsx(D, {
                size: "T300",
                children: ti().month(k - 1).format("MMM")
              })
            }, k))
          }),
          o.jsx(C1, {
            title: "Year",
            children: Array.from({
              length: v
            }, (k, C) => g + C).map((k) => o.jsx(Qe, {
              size: "500",
              variant: a === k ? "Primary" : "SurfaceVariant",
              fill: "None",
              radii: "300",
              "aria-selected": a === k,
              onClick: () => f(k),
              children: o.jsx(D, {
                size: "T300",
                children: k
              })
            }, k))
          })
        ]
      })
    });
  });
  function EGe({ onCancel: t, onSubmit: e }) {
    const n = be(), r = cr(), i = Kr(), a = $i(r, ce.RoomCreate), s = rAe(), l = iAe(), c = p.useMemo(() => (a == null ? void 0 : a.getTs()) ?? 0, [
      a
    ]), [d, u] = p.useState(() => Date.now()), [h] = Fe(ge, "hour24Clock"), [f, g] = p.useState(), [m, v] = p.useState(), y = (T) => {
      g(T.currentTarget.getBoundingClientRect());
    }, w = (T) => {
      v(T.currentTarget.getBoundingClientRect());
    }, b = () => {
      u(s < c ? c : s);
    }, j = () => {
      u(l < c ? c : l);
    }, k = () => u(c), [C, x] = Et(p.useCallback(async (T) => (await n.timestampToEvent(r.roomId, T, Tn.Forward)).event_id, [
      n,
      r
    ])), S = () => {
      x(d).then((T) => {
        i() && e(T);
      });
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: t,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Jump to Time"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: t,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "500",
                children: [
                  o.jsxs(E, {
                    direction: "Row",
                    gap: "300",
                    children: [
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            priority: "400",
                            children: "Time"
                          }),
                          o.jsxs(E, {
                            gap: "100",
                            alignItems: "Center",
                            children: [
                              o.jsx(Qe, {
                                size: "500",
                                variant: "Surface",
                                fill: "None",
                                outlined: true,
                                radii: "300",
                                "aria-pressed": !!f,
                                after: o.jsx(Q, {
                                  size: "50",
                                  src: q.ChevronBottom
                                }),
                                onClick: y,
                                children: o.jsx(D, {
                                  size: "B300",
                                  children: eu(d, h)
                                })
                              }),
                              o.jsx(ln, {
                                anchor: f,
                                offset: 5,
                                position: "Bottom",
                                align: "Center",
                                content: o.jsx(Ft, {
                                  focusTrapOptions: {
                                    initialFocus: false,
                                    onDeactivate: () => g(void 0),
                                    clickOutsideDeactivates: true,
                                    isKeyForward: (T) => T.key === "ArrowDown" || T.key === "ArrowRight",
                                    isKeyBackward: (T) => T.key === "ArrowUp" || T.key === "ArrowLeft",
                                    escapeDeactivates: kt
                                  },
                                  children: o.jsx(nue, {
                                    min: c,
                                    max: Date.now(),
                                    value: d,
                                    onChange: u
                                  })
                                })
                              })
                            ]
                          })
                        ]
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            priority: "400",
                            children: "Date"
                          }),
                          o.jsxs(E, {
                            gap: "100",
                            alignItems: "Center",
                            children: [
                              o.jsx(Qe, {
                                size: "500",
                                variant: "Surface",
                                fill: "None",
                                outlined: true,
                                radii: "300",
                                "aria-pressed": !!m,
                                after: o.jsx(Q, {
                                  size: "50",
                                  src: q.ChevronBottom
                                }),
                                onClick: w,
                                children: o.jsx(D, {
                                  size: "B300",
                                  children: qF(d)
                                })
                              }),
                              o.jsx(ln, {
                                anchor: m,
                                offset: 5,
                                position: "Bottom",
                                align: "Center",
                                content: o.jsx(Ft, {
                                  focusTrapOptions: {
                                    initialFocus: false,
                                    onDeactivate: () => v(void 0),
                                    clickOutsideDeactivates: true,
                                    isKeyForward: (T) => T.key === "ArrowDown" || T.key === "ArrowRight",
                                    isKeyBackward: (T) => T.key === "ArrowUp" || T.key === "ArrowLeft",
                                    escapeDeactivates: kt
                                  },
                                  children: o.jsx(rue, {
                                    min: c,
                                    max: Date.now(),
                                    value: d,
                                    onChange: u
                                  })
                                })
                              })
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Preset"
                      }),
                      o.jsxs(E, {
                        gap: "200",
                        children: [
                          c < s && o.jsx(Qe, {
                            variant: d === s ? "Success" : "SurfaceVariant",
                            radii: "Pill",
                            "aria-pressed": d === s,
                            onClick: b,
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Today"
                            })
                          }),
                          c < l && o.jsx(Qe, {
                            variant: d === l ? "Success" : "SurfaceVariant",
                            radii: "Pill",
                            "aria-pressed": d === l,
                            onClick: j,
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Yesterday"
                            })
                          }),
                          o.jsx(Qe, {
                            variant: d === c ? "Success" : "SurfaceVariant",
                            radii: "Pill",
                            "aria-pressed": d === c,
                            onClick: k,
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Beginning"
                            })
                          })
                        ]
                      })
                    ]
                  }),
                  C.status === ve.Error && o.jsx(D, {
                    style: {
                      color: ct.Critical.Main
                    },
                    size: "T300",
                    children: C.error.message
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    variant: "Primary",
                    before: C.status === ve.Loading ? o.jsx(dt, {
                      fill: "Solid",
                      variant: "Primary",
                      size: "200"
                    }) : void 0,
                    "aria-disabled": C.status === ve.Loading || C.status === ve.Success,
                    onClick: S,
                    children: o.jsx(D, {
                      size: "B400",
                      children: "Open Timeline"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  const wS = (t, e, n) => (r, i, ...a) => {
    const s = t[r];
    return s ? s(...a) : i && e ? e(...a) : !i && n ? n(...a) : null;
  };
  var kGe = "UrlPreview_UrlPreview__13bxqqi0 _1mqalmd1 _1mqalmd0", YY = "UrlPreview_UrlPreviewMediaWell__13bxqqi2 _1mqalmd1 _1mqalmd0", SGe = "UrlPreview_UrlPreviewContent__13bxqqi3 _1mqalmd1 _1mqalmd0", jGe = "UrlPreview_UrlPreviewDescription__13bxqqi4 _1mqalmd1 _1mqalmd0";
  const iue = ft(({ className: t, ...e }, n) => o.jsx(E, {
    shrink: "No",
    className: gt(kGe, t),
    ...e,
    ref: n
  })), ZY = ft(({ className: t, ...e }, n) => o.jsx(E, {
    grow: "Yes",
    shrink: "No",
    direction: "Column",
    gap: "100",
    className: gt(SGe, t),
    ...e,
    ref: n
  })), TGe = ft(({ className: t, ...e }, n) => o.jsx("span", {
    className: gt(jGe, t),
    ...e,
    ref: n
  }));
  var RGe = "UrlPreviewCard_UrlPreviewAudio__uws74d0 _1mqalmd1 _1mqalmd0", JY = Jr({
    defaultClassName: "UrlPreviewCard_UrlPreviewHolderGradient__uws74d1 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      position: {
        Left: "UrlPreviewCard_UrlPreviewHolderGradient_position_Left__uws74d2",
        Right: "UrlPreviewCard_UrlPreviewHolderGradient_position_Right__uws74d3"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), XY = Jr({
    defaultClassName: "UrlPreviewCard_UrlPreviewHolderBtn__uws74d4 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      position: {
        Left: "UrlPreviewCard_UrlPreviewHolderBtn_position_Left__uws74d5",
        Right: "UrlPreviewCard_UrlPreviewHolderBtn_position_Right__uws74d6"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  });
  function QY(t, e, n) {
    return {
      x: e.width / 2 - (t.clientX - e.x - n.x),
      y: e.height / 2 - (t.clientY - e.y - n.y)
    };
  }
  const oue = (t, e = 0.2, n = 0.1, r = 500) => {
    const [i, a] = p.useState({
      zoom: 1,
      pan: {
        x: 0,
        y: 0
      }
    }), [s, l] = p.useState("grab"), [c, d] = p.useState(true), u = p.useRef(true), [h, f] = p.useState(1), g = p.useRef(null), m = p.useRef(null), v = p.useCallback((V) => {
      u.current = V, d(V);
    }, []), y = p.useCallback(() => v(true), [
      v
    ]), w = p.useCallback(() => v(false), [
      v
    ]), b = p.useRef(/* @__PURE__ */ new Map()), j = p.useRef(0), k = p.useRef(0), C = p.useCallback(() => {
      const V = m.current;
      V && (V.style.transition = "");
    }, []), x = p.useCallback((V) => {
      a((Z) => typeof V == "function" ? {
        ...Z,
        zoom: V(Z.zoom)
      } : {
        ...Z,
        zoom: V
      });
    }, []), S = p.useCallback((V) => {
      w(), C(), x(V);
    }, [
      w,
      C,
      x
    ]), T = p.useCallback((V) => {
      C(), x(V);
    }, [
      C,
      x
    ]), A = p.useCallback((V) => {
      a((Z) => typeof V == "function" ? {
        ...Z,
        pan: V(Z.pan)
      } : {
        ...Z,
        pan: V
      });
    }, []), B = p.useCallback(() => {
      a({
        zoom: 1,
        pan: {
          x: 0,
          y: 0
        }
      });
    }, []), U = p.useCallback((V) => {
      if (V.pointerType === "mouse" && V.button === 2) return;
      w(), C(), V.stopPropagation();
      const Z = V.target;
      Z.setPointerCapture(V.pointerId);
      const Y = Date.now();
      if (Y - k.current < 300 && Y - k.current > 30) {
        if (b.current.size === 2) {
          const ie = Array.from(b.current.values());
          j.current = Math.hypot(ie[0].x - ie[1].x, ie[0].y - ie[1].y);
          return;
        }
        const ue = (Z.parentElement ?? Z).getBoundingClientRect();
        a((ie) => {
          if (ie.zoom !== 1) return {
            zoom: 1,
            pan: {
              x: 0,
              y: 0
            }
          };
          const de = QY(V, ue, ie.pan);
          return {
            zoom: 2,
            pan: {
              x: de.x + ie.pan.x,
              y: de.y + ie.pan.y
            }
          };
        }), k.current = 0;
        return;
      }
      if (k.current = Y, b.current.set(V.pointerId, {
        x: V.clientX,
        y: V.clientY
      }), l("grabbing"), b.current.size === 2) {
        const oe = Array.from(b.current.values());
        j.current = Math.hypot(oe[0].x - oe[1].x, oe[0].y - oe[1].y);
      }
    }, [
      t,
      w,
      C
    ]), z = p.useCallback((V) => {
      if (b.current.has(V.pointerId)) {
        if (b.current.set(V.pointerId, {
          x: V.clientX,
          y: V.clientY
        }), V.target instanceof HTMLElement && (V.target.style.transition = "none"), b.current.size === 2) {
          const Z = Array.from(b.current.values()), Y = Math.hypot(Z[0].x - Z[1].x, Z[0].y - Z[1].y), oe = Y / j.current;
          S((ue) => Math.min(Math.max(ue * oe, n), r)), j.current = Y;
          return;
        }
        b.current.size === 1 && A((Z) => ({
          x: Z.x + V.movementX,
          y: Z.y + V.movementY
        }));
      }
    }, [
      S,
      n,
      r,
      A
    ]), O = p.useCallback((V) => {
      b.current.delete(V.pointerId), b.current.size === 0 && l("grab"), b.current.size < 2 && (j.current = 0);
    }, [
      t
    ]);
    p.useEffect(() => (window.addEventListener("pointermove", z), window.addEventListener("pointerup", O), window.addEventListener("pointercancel", O), () => {
      window.removeEventListener("pointermove", z), window.removeEventListener("pointerup", O), window.removeEventListener("pointercancel", O);
    }), [
      z,
      O
    ]);
    const M = p.useCallback((V, Z) => {
      const Y = m.current;
      if (!Y || !u.current || !Y.naturalWidth || !Y.naturalHeight) return;
      const oe = Z / Y.naturalHeight, ue = V / Y.naturalWidth, ie = Math.min(oe, ue);
      Y.style.transition = "none", f(ie), x(ie), setTimeout(() => {
        Y.style.transition = "";
      }, 15);
    }, [
      x
    ]);
    gp(() => g.current, M);
    const I = p.useCallback((V) => {
      const Z = V.currentTarget;
      m.current = Z;
      const Y = g.current;
      if (!Y) return;
      const oe = Z.naturalHeight, ue = Z.naturalWidth, ie = Y.clientHeight || 0, de = Y.clientWidth || 0, ne = ie / oe, ae = de / ue, X = Math.min(ne, ae, 1);
      Z.style.transition = "none", f(X), x(X), setTimeout(() => {
        Z.style.transition = "";
      }, 15);
    }, [
      x
    ]), N = p.useCallback(() => {
      w(), C(), a((V) => {
        const Z = Math.min(V.zoom * (1 + e), r), Y = Z / V.zoom;
        return {
          zoom: Z,
          pan: {
            x: V.pan.x * Y,
            y: V.pan.y * Y
          }
        };
      });
    }, [
      e,
      r,
      w,
      C
    ]), L = p.useCallback(() => {
      w(), C(), a((V) => {
        const Z = Math.min(V.zoom / (1 + e), r), Y = Z / V.zoom;
        return {
          zoom: Z,
          pan: {
            x: V.pan.x * Y,
            y: V.pan.y * Y
          }
        };
      });
    }, [
      e,
      r,
      w,
      C
    ]), H = p.useCallback((V) => {
      const { deltaY: Z } = V;
      if (!Number.isInteger(Z)) return;
      w(), C();
      const Y = V.currentTarget.getBoundingClientRect();
      a((oe) => {
        const ue = Z < 0 ? Math.min(oe.zoom * (1 + e), r) : Math.max(oe.zoom / (1 + e), n), ie = ue / oe.zoom - 1, de = QY(V, Y, oe.pan);
        return {
          zoom: ue,
          pan: {
            x: de.x * ie + oe.pan.x,
            y: de.y * ie + oe.pan.y
          }
        };
      });
    }, [
      r,
      n,
      e,
      w,
      C
    ]);
    return {
      transforms: i,
      cursor: s,
      onPointerDown: U,
      handleWheel: H,
      handleImageLoad: I,
      setZoom: S,
      setZoomSilently: T,
      setPan: A,
      setTransforms: a,
      resetTransforms: B,
      zoomIn: N,
      zoomOut: L,
      fitRatio: h,
      imageRef: m,
      containerRef: g,
      shouldResizeWithWindow: c,
      shouldResizeWithWindowRef: u,
      enableResizeWithWindow: y,
      disableResizeWithWindow: w
    };
  };
  var AGe = "ImageViewer_ImageViewer__ewyykf0 _1mqalmd1 _1mqalmd0", IGe = "ImageViewer_ImageViewerHeader__ewyykf1 _1mqalmd1 _1mqalmd0", BGe = "ImageViewer_ImageViewerContent__ewyykf2 _1mqalmd1 _1mqalmd0", PGe = "ImageViewer_ImageViewerInput__ewyykf3 _1mqalmd1 _1mqalmd0", MGe = "ImageViewer_ImageViewerImg__ewyykf4 _1mqalmd1 _1mqalmd0", OGe = "ImageViewer_ImageViewerImgPixelated__ewyykf5";
  const Yc = ft(({ className: t, alt: e, src: n, requestClose: r, ...i }, a) => {
    const s = p.useRef(null), [l] = Fe(ge, "pixelatedImageRendering"), [c, d] = p.useState(false), [u, h] = p.useState(false), [f, g] = p.useState("100"), { transforms: m, cursor: v, handleWheel: y, onPointerDown: w, resetTransforms: b, zoomIn: j, zoomOut: k, setZoom: C, fitRatio: x, imageRef: S, containerRef: T, handleImageLoad: A, enableResizeWithWindow: B } = oue(true, 0.2, 0.1);
    p.useEffect(() => {
      d(false), B(), h(false), g("100"), S.current && (S.current = null);
    }, [
      n,
      B,
      S
    ]), p.useEffect(() => {
      u || g(Math.round(m.zoom * 100).toString());
    }, [
      u,
      m.zoom
    ]), p.useEffect(() => {
      var _a6;
      u && ((_a6 = s.current) == null ? void 0 : _a6.focus());
    }, [
      u
    ]);
    const U = async () => {
      const z = await Gd(n);
      ap.saveAs(z, e);
    };
    return o.jsxs(E, {
      className: gt(AGe, t),
      direction: "Column",
      ...i,
      ref: a,
      children: [
        o.jsxs(wn, {
          className: IGe,
          size: "400",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Oe, {
                  size: "300",
                  radii: "300",
                  onClick: r,
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.ArrowLeft
                  })
                }),
                o.jsx(D, {
                  size: "T300",
                  truncate: true,
                  children: e
                })
              ]
            }),
            o.jsxs(E, {
              shrink: "No",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Oe, {
                  variant: "Surface",
                  style: {
                    display: x !== 1 && m.zoom !== 1 ? "flex" : "none"
                  },
                  size: "300",
                  radii: "Pill",
                  onClick: () => {
                    C(1);
                  },
                  "aria-label": "View Original Size",
                  title: "View Original Size",
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.Photo
                  })
                }),
                o.jsx(Oe, {
                  variant: "Surface",
                  style: {
                    display: m.zoom !== x || m.pan.x !== 0 || m.pan.y !== 0 ? "flex" : "none"
                  },
                  size: "300",
                  radii: "Pill",
                  onClick: () => {
                    b(), B(), C(x);
                  },
                  "aria-label": "Reset Zoom",
                  title: "Zoom to Fill Container",
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.Reload
                  })
                }),
                o.jsx(Oe, {
                  variant: m.zoom < 1 ? "Success" : "SurfaceVariant",
                  outlined: m.zoom < 1,
                  size: "300",
                  radii: "Pill",
                  onClick: k,
                  "aria-label": "Zoom Out",
                  title: "Zoom Out",
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.Minus
                  })
                }),
                o.jsx(Qe, {
                  variant: "SurfaceVariant",
                  radii: "Pill",
                  style: {
                    minWidth: "4em"
                  },
                  onClick: () => {
                    g(Math.round(m.zoom * 100).toString()), h(true);
                  },
                  title: "Update Zoom",
                  children: o.jsx(D, {
                    size: "B300",
                    style: {
                      cursor: "text",
                      margin: "auto"
                    },
                    children: u ? o.jsxs("span", {
                      children: [
                        o.jsx("input", {
                          className: PGe,
                          ref: s,
                          type: "text",
                          "aria-label": "Set Zoom Level",
                          value: f,
                          onChange: (z) => {
                            g(z.target.value);
                          },
                          onBlur: () => {
                            const z = parseInt(f, 10);
                            Number.isNaN(z) || C(z / 100), h(false);
                          },
                          onKeyDown: (z) => {
                            if (z.key === "Enter") {
                              const O = parseInt(f, 10);
                              Number.isNaN(O) || C(O / 100), h(false);
                            }
                          }
                        }),
                        o.jsx("span", {
                          children: "%"
                        })
                      ]
                    }) : `${Math.round(m.zoom * 100)}%`
                  })
                }),
                o.jsx(Oe, {
                  variant: m.zoom > 1 ? "Success" : "SurfaceVariant",
                  outlined: m.zoom > 1,
                  size: "300",
                  radii: "Pill",
                  onClick: j,
                  "aria-label": "Zoom In",
                  title: "Zoom In",
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.Plus
                  })
                }),
                o.jsx(Qe, {
                  variant: "Primary",
                  onClick: U,
                  radii: "300",
                  before: o.jsx(Q, {
                    size: "50",
                    src: q.Download
                  }),
                  outlined: true,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Download"
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(E, {
          grow: "Yes",
          ref: T,
          onWheel: y,
          className: BGe,
          "data-gestures": "ignore",
          justifyContent: "Center",
          alignItems: "Center",
          style: {
            overflow: "hidden",
            touchAction: "none",
            cursor: v
          },
          onPointerDown: w,
          children: o.jsx("img", {
            className: gt(MGe, a4e(l) && OGe),
            draggable: false,
            "data-gestures": "ignore",
            style: {
              cursor: v,
              opacity: c ? 1 : 0,
              transform: `translate(${m.pan.x}px, ${m.pan.y}px) scale(${m.zoom})`
            },
            src: n,
            alt: e,
            onPointerDown: w,
            onLoad: (z) => {
              A(z), d(true);
            }
          })
        })
      ]
    });
  }), eZ = {
    color: ct.Success.Main
  }, tZ = /* @__PURE__ */ new WeakMap(), LGe = (t) => {
    let e = tZ.get(t);
    return e || (e = /* @__PURE__ */ new Map(), tZ.set(t, e)), e;
  }, NGe = async (t) => {
    if (!t) {
      console.warn("Attempted to open an empty url");
      return;
    }
    const e = await Gd(t), n = URL.createObjectURL(e);
    window.open(n, "_blank");
  };
  function Xw(t) {
    if (typeof t == "number" && Number.isFinite(t) && t > 0) return t;
    if (typeof t == "string") {
      const e = Number.parseFloat(t);
      if (Number.isFinite(e) && e > 0) return e;
    }
  }
  function zGe(t) {
    const e = t["og:video"];
    if (typeof e != "string") return false;
    const n = e.trim();
    if (!n) return false;
    const r = typeof t["og:video:type"] == "string" ? t["og:video:type"].toLowerCase().trim() : "";
    return r.startsWith("video/") ? true : /^mxc:\/\//i.test(n) ? r.startsWith("video/") || /\.(mp4|webm|ogg|mov|m4v)(\?|$)/i.test(n) : /^https?:\/\//i.test(n) ? /\.(mp4|webm|ogg|mov|m4v)(\?|$)/i.test(n) || r.startsWith("video/") : false;
  }
  const G5 = ft(({ urlPreview: t, url: e, ts: n, mediaType: r, bundle: i, ...a }, s) => {
    const l = be(), c = hn(), [d] = Fe(ge, "linkPreviewImageMaxHeight"), u = !!r, [h, f] = Et(p.useCallback(() => {
      if (u || !n && !i) return Promise.resolve(null);
      if (t && n) {
        const v = LGe(l), y = v.get(e);
        if (y !== void 0) return y;
        const w = l == null ? void 0 : l.getUrlPreview(e, n);
        return v.set(e, w), w.finally(() => v.delete(e)), w;
      }
      return Promise.resolve(i);
    }, [
      u,
      n,
      i,
      t,
      l,
      e
    ]));
    if (p.useEffect(() => {
      f();
    }, [
      e,
      f
    ]), h.status === ve.Error) return null;
    const g = (v) => {
      const y = v["og:site_name"], w = v["og:title"], b = v["og:description"], j = Cn(l, v["og:image"] || "", c, 256, 256, "scale", false), k = (M) => {
        if (!v["og:image"]) {
          console.warn("No image");
          return;
        }
        if (M.button === 1) {
          M.preventDefault();
          const I = Cn(l, v["og:image"], true);
          if (!I) {
            console.error("Error converting mxc:// url.");
            return;
          }
          NGe(I);
        }
      }, C = v["og:video"] ? Xw(v["og:video:width"]) : void 0, x = v["og:video"] ? Xw(v["og:video:height"]) : void 0, S = Xw(v["og:image:width"]), T = Xw(v["og:image:height"]), A = C && x ? `${C} / ${x}` : S && T ? `${S} / ${T}` : void 0, B = typeof v["matrix:image:blurhash"] == "string" ? v["matrix:image:blurhash"].trim() : "", U = (() => {
        const M = v["matrix:image:size"], I = typeof M == "number" && Number.isFinite(M) ? M : void 0;
        if (S && T) return {
          w: S,
          h: T,
          ...I !== void 0 ? {
            size: I
          } : {},
          ...B ? {
            [$g]: B
          } : {}
        };
        if (B || I !== void 0) return {
          w: 16,
          h: 9,
          ...I !== void 0 ? {
            size: I
          } : {},
          ...B ? {
            [$g]: B
          } : {}
        };
      })(), z = Math.min(2048, Math.max(1, Math.round(Math.max(1, d) * 2))), O = zGe(v);
      return o.jsxs(E, {
        grow: "Yes",
        direction: "Column",
        style: {
          overflow: "hidden",
          width: "100%"
        },
        children: [
          o.jsxs(ZY, {
            style: {
              minWidth: 0,
              display: "flex",
              flexDirection: "column",
              justifyContent: "center"
            },
            children: [
              o.jsxs(D, {
                style: eZ,
                truncate: true,
                as: "a",
                href: e,
                target: "_blank",
                rel: "noreferrer",
                size: "T200",
                priority: "300",
                children: [
                  typeof y == "string" && `${y} | `,
                  K4(e)
                ]
              }),
              w && o.jsx(D, {
                truncate: true,
                priority: "400",
                children: o.jsx("b", {
                  children: w
                })
              }),
              b && o.jsx(D, {
                size: "T200",
                priority: "300",
                children: o.jsx(TGe, {
                  children: b
                })
              })
            ]
          }),
          O && o.jsx(E, {
            shrink: "No",
            className: YY,
            style: {
              width: "100%",
              maxHeight: He(d),
              aspectRatio: A ?? "16 / 9",
              flexShrink: 1,
              minHeight: 0,
              overflow: "hidden",
              position: "relative"
            },
            children: o.jsx(LP, {
              style: {
                position: "absolute",
                inset: 0,
                width: "100%",
                height: "100%"
              },
              body: v["og:title"],
              info: {},
              url: v["og:video"].trim(),
              mimeType: v["og:video:type"] ?? "",
              renderVideo: (M) => o.jsx(Qae, {
                style: {
                  width: "100%",
                  height: "100%",
                  objectFit: "contain"
                },
                ...M
              }),
              renderThumbnail: () => o.jsx(as, {
                src: j ?? void 0
              })
            })
          }),
          !O && v["og:image"] && o.jsx(E, {
            shrink: "No",
            className: YY,
            style: {
              width: "100%",
              maxHeight: He(d),
              aspectRatio: A ?? "16 / 9",
              flexShrink: 1,
              minHeight: 0,
              overflow: "hidden",
              position: "relative"
            },
            children: o.jsx(rh, {
              style: {
                position: "absolute",
                inset: 0,
                width: "100%",
                height: "100%"
              },
              mediaLayout: "contained",
              fillsPreviewSlot: true,
              autoPlay: true,
              onAuxClick: k,
              body: v["og:title"],
              url: v["og:image"],
              info: U,
              matrixThumbnailMaxEdge: z,
              renderViewer: (M) => o.jsx(Yc, {
                ...M
              }),
              renderImage: (M) => o.jsx(as, {
                ...M,
                style: {
                  display: "block",
                  maxWidth: "100%",
                  maxHeight: "100%",
                  width: "auto",
                  height: "auto",
                  objectFit: "contain",
                  objectPosition: "center"
                }
              })
            })
          }),
          !O && !v["og:image"] && v["og:audio"] && o.jsx(E, {
            className: RGe,
            style: {
              flexShrink: 0
            },
            children: o.jsx(tse, {
              url: v["og:audio"] ?? "",
              mimeType: v["og:audio:type"] ?? "",
              info: {},
              renderMediaControl: (M) => o.jsx(ese, {
                ...M
              })
            })
          })
        ]
      });
    };
    let m;
    return h.status === ve.Success ? m = h.data ? g(h.data) : o.jsx(ZY, {
      children: o.jsx(D, {
        style: eZ,
        truncate: true,
        as: "a",
        href: e,
        target: "_blank",
        rel: "noreferrer",
        size: "T200",
        priority: "300",
        children: K4(e)
      })
    }) : m = o.jsx(E, {
      grow: "Yes",
      alignItems: "Center",
      justifyContent: "Center",
      children: o.jsx(dt, {
        variant: "Secondary",
        size: "400"
      })
    }), o.jsx(iue, {
      ...a,
      ref: s,
      style: u ? {
        background: "transparent",
        border: "none",
        padding: 0,
        boxShadow: "none",
        display: "inline-block",
        verticalAlign: "middle",
        width: "max-content",
        minWidth: 0,
        maxWidth: "100%",
        margin: 0,
        alignSelf: "start"
      } : {
        alignSelf: "start"
      },
      children: m
    });
  }), nZ = ft(({ children: t, ...e }, n) => {
    const r = p.useRef(null), i = p.useRef(null), [a, s] = p.useState(false), [l, c] = p.useState(false), d = p.useCallback(() => {
      const f = r.current;
      if (!f) return;
      const { scrollLeft: g, scrollWidth: m, clientWidth: v } = f;
      s(g > 1), c(g + v < m - 1);
    }, []);
    p.useEffect(() => {
      const f = r.current;
      if (!f) return;
      d(), f.addEventListener("scroll", d, {
        passive: true
      });
      const g = new ResizeObserver(d);
      return g.observe(f), i.current && g.observe(i.current), () => {
        f.removeEventListener("scroll", d), g.disconnect();
      };
    }, [
      d
    ]);
    const u = () => {
      const f = r.current;
      if (!f) return;
      const { offsetWidth: g, scrollLeft: m } = f;
      f.scrollTo({
        left: m - g / 1.3,
        behavior: "smooth"
      });
    }, h = () => {
      const f = r.current;
      if (!f) return;
      const { offsetWidth: g, scrollLeft: m } = f;
      f.scrollTo({
        left: m + g / 1.3,
        behavior: "smooth"
      });
    };
    return o.jsx(E, {
      direction: "Column",
      ...e,
      ref: n,
      style: {
        marginTop: ee.space.S200,
        position: "relative"
      },
      children: o.jsx(dn, {
        ref: r,
        direction: "Horizontal",
        size: "0",
        visibility: "Hover",
        hideTrack: true,
        children: o.jsxs(E, {
          shrink: "No",
          alignItems: "Center",
          children: [
            a && o.jsxs(o.Fragment, {
              children: [
                o.jsx("div", {
                  className: JY({
                    position: "Left"
                  })
                }),
                o.jsx(Oe, {
                  className: XY({
                    position: "Left"
                  }),
                  variant: "Secondary",
                  radii: "Pill",
                  size: "300",
                  outlined: true,
                  onClick: u,
                  children: o.jsx(Q, {
                    size: "300",
                    src: q.ArrowLeft
                  })
                })
              ]
            }),
            o.jsx(E, {
              ref: i,
              alignItems: "Inherit",
              gap: "200",
              style: {
                alignItems: "baseline"
              },
              children: t
            }),
            l && o.jsxs(o.Fragment, {
              children: [
                o.jsx("div", {
                  className: JY({
                    position: "Right"
                  })
                }),
                o.jsx(Oe, {
                  className: XY({
                    position: "Right"
                  }),
                  variant: "Primary",
                  radii: "Pill",
                  size: "300",
                  outlined: true,
                  onClick: h,
                  children: o.jsx(Q, {
                    size: "300",
                    src: q.ArrowRight
                  })
                })
              ]
            })
          ]
        })
      })
    });
  });
  async function UGe(t) {
    return await fetch(t).then((n) => n.json());
  }
  const VGe = ft(({ title: t, source: e, after: n }) => o.jsx(d3, {
    children: o.jsxs(E, {
      alignItems: "Center",
      gap: "200",
      grow: "Yes",
      children: [
        o.jsx(E, {
          shrink: "No",
          children: o.jsx(Rn, {
            style: {
              maxWidth: He(100)
            },
            variant: "Secondary",
            radii: "Pill",
            children: o.jsx(D, {
              size: "O400",
              truncate: true,
              children: e
            })
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(D, {
            size: "T300",
            truncate: true,
            children: t
          })
        }),
        n
      ]
    })
  }));
  function HGe({ url: t }) {
    return o.jsx(Oe, {
      size: "300",
      radii: "300",
      onClick: () => window.open(t, "_blank"),
      children: o.jsx(Q, {
        size: "100",
        src: q.Link
      })
    });
  }
  const $Ge = ft(({ videoInfo: t, embedData: e }) => {
    const n = `https://i.ytimg.com/vi/${t.videoId}/hqdefault.jpg`, r = t.timestamp ? `&start=${t.timestamp}` : "", i = t.playlist ? `&${t.playlist}` : "", a = `https://www.youtube-nocookie.com/embed/${encodeURIComponent(t.videoId)}?autoplay=1${r}`, s = t.isMusic ? `https://music.youtube.com/watch?v=${t.videoId}${r}${i}` : `https://youtube.com/watch?v=${t.videoId}${r}${i}`, [l, c] = p.useState(), d = e.title ? e.title : "";
    return o.jsxs(c3, {
      style: {
        flexGrow: 1,
        flexShrink: 0,
        width: "640px",
        height: "400px"
      },
      children: [
        o.jsx(d3, {
          children: o.jsx(VGe, {
            title: d,
            source: "YOUTUBE",
            after: HGe({
              url: s
            })
          })
        }),
        o.jsx(LF, {
          style: {
            height: "100%",
            width: "100%"
          },
          children: o.jsx(LP, {
            body: d,
            mimeType: "fake",
            url: s,
            info: {
              thumbnail_info: {
                [$g]: l
              }
            },
            renderThumbnail: () => o.jsx(as, {
              src: n,
              crossOrigin: "anonymous",
              onLoad: (u) => {
                c(OP(u.currentTarget, 32, 32));
              }
            }),
            renderVideo: ({ onLoadedMetadata: u }) => o.jsx("iframe", {
              src: a,
              title: "YouTube embed",
              onLoad: u,
              allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
              referrerPolicy: "strict-origin-when-cross-origin",
              width: "640",
              height: "360",
              allowFullScreen: true
            })
          })
        })
      ]
    });
  }), aue = (t) => t.match(/(https:\/\/)(www\.|music\.|m\.|)(youtube\.com|youtu\.be)\//);
  function WGe(t) {
    let e;
    try {
      e = new URL(t);
    } catch {
      return null;
    }
    const n = e.host, r = e.searchParams;
    let i;
    if (n === "youtu.be" || n.endsWith(".youtu.be")) i = e.pathname.slice(1);
    else if (e.pathname.startsWith("/shorts/")) i = e.pathname.split("/").findLast(Boolean);
    else if ((n === "youtube.com" || n.endsWith(".youtube.com")) && e.pathname === "/watch") i = r.get("v") ?? void 0;
    else return null;
    if (!i) return null;
    const a = r.get("list") ?? void 0, s = r.get("t") ?? r.get("start") ?? void 0;
    return {
      videoId: i,
      timestamp: s,
      playlist: a,
      isMusic: t.includes("music.youtube.com")
    };
  }
  const qGe = ft(({ url: t, ...e }, n) => {
    const [r] = Fe(ge, "clientPreviewYoutube"), i = !!aue(t), a = i ? WGe(t) : null, s = i && a ? `https://www.youtube.com/oembed?url=${encodeURIComponent(`https://youtube.com/watch?v=${a.videoId}`)}` : t, [l, c] = Et(p.useCallback(() => UGe(s), [
      s
    ]));
    p.useEffect(() => {
      i && r && c();
    }, [
      i,
      r,
      c
    ]);
    let d;
    if (a && r) {
      if (l.status === ve.Error) return null;
      l.status === ve.Success && l.data ? d = o.jsx($Ge, {
        videoInfo: a,
        embedData: l.data
      }) : d = o.jsx(E, {
        grow: "Yes",
        alignItems: "Center",
        justifyContent: "Center",
        children: o.jsx(dt, {
          variant: "Secondary",
          size: "400"
        })
      });
    }
    return o.jsx(iue, {
      ...e,
      ref: n,
      style: {
        background: "transparent",
        border: "none",
        padding: 0,
        boxShadow: "none",
        display: "inline-block",
        verticalAlign: "middle",
        width: "max-content",
        minWidth: 0,
        maxWidth: "100%",
        margin: 0
      },
      children: d
    });
  });
  function eO({ hostLabel: t, kind: e = "theme" }) {
    const n = e === "tweak" ? "Third-party tweak" : "Third-party theme", r = e === "tweak" ? `This tweak is hosted on ${t}, outside the Sable catalog allowlist. Saving or enabling applies CSS from that host. Only use tweaks from providers you trust.` : `This preview is hosted on ${t}, outside the Sable catalog allowlist. Saving or applying installs full theme CSS from that host. Only use themes from providers you trust.`;
    return o.jsx(E, {
      direction: "Column",
      gap: "200",
      style: {
        padding: He(10),
        borderRadius: ee.radii.R300,
        background: "var(--sable-warn-container)",
        border: `${He(1)} solid var(--sable-warn-container-line)`,
        color: "var(--sable-warn-on-container)"
      },
      children: o.jsxs(E, {
        direction: "Row",
        gap: "200",
        alignItems: "Start",
        children: [
          o.jsx(Q, {
            src: q.Warning,
            size: "100",
            filled: true
          }),
          o.jsxs(E, {
            direction: "Column",
            gap: "100",
            grow: "Yes",
            style: {
              minWidth: 0
            },
            children: [
              o.jsx(D, {
                size: "T300",
                style: {
                  fontWeight: 600
                },
                children: n
              }),
              o.jsx(D, {
                size: "T200",
                priority: "300",
                style: {
                  wordBreak: "break-word"
                },
                children: r
              })
            ]
          })
        ]
      })
    });
  }
  function sue({ kind: t, url: e, hostLabel: n, isApprovedHost: r, onLoadPreview: i }) {
    const a = t === "theme" ? "Theme preview" : "Tweak preview", s = t === "theme" ? "This message links to a catalog theme preview. Nothing is fetched until you load it." : "This message links to a catalog tweak. Nothing is fetched until you load it.", l = t === "theme" ? "This message links to third-party theme CSS. Nothing is fetched until you confirm. Only load previews you trust." : "This message links to third-party tweak CSS. Nothing is fetched until you confirm. Only load previews you trust.";
    return o.jsxs(E, {
      direction: "Column",
      gap: "300",
      style: {
        width: "400px",
        maxWidth: "100%",
        flexShrink: 0,
        boxSizing: "border-box",
        padding: He(12),
        borderRadius: ee.radii.R300,
        border: `${He(1)} solid var(--sable-surface-container-line)`,
        background: "var(--sable-surface-container)"
      },
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            minWidth: 0
          },
          children: [
            o.jsx(D, {
              size: "H6",
              children: a
            }),
            r ? null : o.jsx(eO, {
              kind: t,
              hostLabel: n
            }),
            o.jsx(D, {
              size: "T200",
              priority: "300",
              style: {
                wordBreak: "break-word"
              },
              children: r ? s : l
            }),
            o.jsx(D, {
              size: "T200",
              priority: "300",
              children: r ? "Official catalog" : n
            }),
            o.jsx(D, {
              size: "T200",
              priority: "300",
              style: {
                wordBreak: "break-all",
                fontFamily: "monospace",
                opacity: 0.85
              },
              children: e
            })
          ]
        }),
        o.jsx(xe, {
          variant: "Primary",
          fill: "Soft",
          outlined: true,
          size: "300",
          radii: "300",
          onClick: i,
          children: o.jsx(D, {
            size: "B300",
            children: "Load preview"
          })
        })
      ]
    });
  }
  function KGe(t) {
    return /^https:\/\//i.test(t);
  }
  function GGe(t) {
    return /\.preview\.sable\.css(\?|#|$)/i.test(t);
  }
  function Z_(t) {
    return (t.split("/").pop() ?? t).replace(/\.preview\.sable\.css(\?|#|$)/i, "").replace(/\.sable\.css(\?|#|$)/i, "");
  }
  function Y5(t) {
    try {
      return new URL(t).hostname;
    } catch {
      return "Unofficial theme";
    }
  }
  function YGe({ url: t }) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7, _j3, _k3, _l3, _m2;
    const e = la(), n = SF(), r = _3(), i = p.useRef(true);
    p.useEffect(() => (i.current = true, () => {
      i.current = false;
    }), []);
    const [a] = Fe(ge, "themeChatAutoPreviewApprovedUrls"), [s] = Fe(ge, "themeChatAutoPreviewAnyUrl"), [l] = Fe(ge, "themeRemoteFavorites"), [c] = Fe(ge, "useSystemTheme"), [d] = Fe(ge, "themeRemoteManualFullUrl"), [u] = Fe(ge, "themeRemoteLightFullUrl"), [h] = Fe(ge, "themeRemoteDarkFullUrl"), f = p.useMemo(() => KGe(t) && GGe(t), [
      t
    ]), g = e.themeCatalogApprovedHostPrefixes, m = p.useMemo(() => wb(t, g), [
      g,
      t
    ]), v = p.useMemo(() => m && a || !m && s, [
      m,
      a,
      s
    ]), [y, w] = p.useState(false);
    p.useEffect(() => {
      w(false);
    }, [
      t
    ]);
    const b = p.useMemo(() => f && (v || y), [
      f,
      v,
      y
    ]), j = p.useMemo(() => !wb(t, g), [
      g,
      t
    ]), k = ol({
      queryKey: [
        "theme-preview-embed",
        t
      ],
      enabled: b,
      staleTime: 10 * 6e4,
      queryFn: async () => {
        var _a7, _b4;
        const se = await fetch(t, {
          mode: "cors"
        });
        if (!se.ok) throw new Error(`theme preview fetch failed: ${se.status}`);
        const ye = await se.text(), we = Uf(ye), Ee = mS(ye), ke = cVe(t, Ee), Ne = we.kind ?? Rr.Light, lt = ((_a7 = we.name) == null ? void 0 : _a7.trim()) || Z_(t), Rt = ((_b4 = we.author) == null ? void 0 : _b4.trim()) || void 0, We = we.contrast === "high" ? "high" : "low", yt = we.tags ?? [];
        return {
          previewText: ye,
          fullUrl: ke,
          kind: Ne,
          displayName: lt,
          author: Rt,
          contrast: We,
          tags: yt
        };
      }
    }), C = p.useRef(null), x = p.useRef(null), [S, T] = p.useState(false), [A, B] = p.useState(false), [U, z] = p.useState(null), O = p.useMemo(() => {
      var _a7;
      const se = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      return se ? c ? u === se || h === se : d === se : false;
    }, [
      (_a6 = k.data) == null ? void 0 : _a6.fullUrl,
      c,
      u,
      h,
      d
    ]), M = p.useMemo(() => S || O, [
      S,
      O
    ]), I = p.useMemo(() => l.some((se) => {
      var _a7;
      return se.fullUrl === ((_a7 = k.data) == null ? void 0 : _a7.fullUrl);
    }), [
      l,
      (_b3 = k.data) == null ? void 0 : _b3.fullUrl
    ]), N = p.useCallback((se, ye) => {
      const we = new Set(ye);
      return se.filter((Ee) => Ee.pinned === true || we.has(Ee.fullUrl));
    }, []), L = p.useCallback(async () => {
      var _a7, _b4, _c4;
      const se = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      if (!se) return;
      if (z(null), l.find((Ne) => Ne.fullUrl === se)) {
        B(false);
        const Ne = {};
        u === se && (Ne.themeRemoteLightFullUrl = void 0, Ne.themeRemoteLightKind = void 0), h === se && (Ne.themeRemoteDarkFullUrl = void 0, Ne.themeRemoteDarkKind = void 0), d === se && (Ne.themeRemoteManualFullUrl = void 0, Ne.themeRemoteManualKind = void 0);
        const lt = l.filter((We) => We.fullUrl !== se), Rt = [
          d,
          u,
          h
        ].filter((We) => !!(We && We.trim().length > 0)).filter((We) => We !== se);
        r({
          ...Ne,
          themeRemoteFavorites: N(lt, Rt)
        });
        return;
      }
      B(true);
      const we = await fetch(se, {
        mode: "cors"
      });
      if (!i.current) return;
      if (!we.ok) {
        z(`Theme CSS not found (${we.status})`);
        return;
      }
      const Ee = await we.text();
      if (!i.current || (await Fo(se, Ee), !i.current)) return;
      const ke = {
        fullUrl: se,
        displayName: ((_b4 = k.data) == null ? void 0 : _b4.displayName) ?? Z_(se),
        basename: Z_(se),
        kind: ((_c4 = k.data) == null ? void 0 : _c4.kind) === Rr.Dark ? "dark" : "light",
        pinned: true
      };
      r({
        themeRemoteFavorites: [
          ...l,
          ke
        ]
      });
    }, [
      h,
      l,
      u,
      d,
      r,
      k.data,
      N
    ]), H = p.useCallback(() => {
      var _a7, _b4;
      const se = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      if (!se) return;
      const ye = ((_b4 = k.data) == null ? void 0 : _b4.kind) === Rr.Dark ? "dark" : "light";
      r({
        themeRemoteManualFullUrl: se,
        themeRemoteManualKind: ye
      });
    }, [
      r,
      k.data
    ]), V = p.useCallback(() => {
      var _a7, _b4;
      const se = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      if (!se) return;
      const ye = ((_b4 = k.data) == null ? void 0 : _b4.kind) === Rr.Dark ? "dark" : "light";
      r({
        themeRemoteLightFullUrl: se,
        themeRemoteLightKind: ye
      });
    }, [
      r,
      k.data
    ]), Z = p.useCallback(() => {
      var _a7, _b4;
      const se = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      if (!se) return;
      const ye = ((_b4 = k.data) == null ? void 0 : _b4.kind) === Rr.Dark ? "dark" : "light";
      r({
        themeRemoteDarkFullUrl: se,
        themeRemoteDarkKind: ye
      });
    }, [
      r,
      k.data
    ]), Y = p.useCallback(async () => {
      var _a7;
      const se = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      if (!se || l.some((ke) => ke.fullUrl === se)) return false;
      const ye = await fetch(se, {
        mode: "cors"
      });
      if (!i.current || !ye.ok) return false;
      const we = await ye.text();
      if (!i.current || (await Fo(se, we), !i.current)) return false;
      const Ee = {
        fullUrl: se,
        displayName: k.data.displayName,
        basename: Z_(se),
        kind: k.data.kind === Rr.Dark ? "dark" : "light",
        pinned: false
      };
      return r({
        themeRemoteFavorites: [
          ...l,
          Ee
        ]
      }), true;
    }, [
      l,
      r,
      k.data
    ]), oe = p.useCallback(async (se, ye) => {
      var _a7;
      const we = n.get(ge);
      if (ye.themeRemoteManualFullUrl && we.themeRemoteManualFullUrl === ye.themeRemoteManualFullUrl || ye.themeRemoteLightFullUrl && we.themeRemoteLightFullUrl === ye.themeRemoteLightFullUrl || ye.themeRemoteDarkFullUrl && we.themeRemoteDarkFullUrl === ye.themeRemoteDarkFullUrl) return;
      if (C.current = {
        themeId: we.themeId,
        themeRemoteManualFullUrl: we.themeRemoteManualFullUrl,
        themeRemoteManualKind: we.themeRemoteManualKind,
        themeRemoteLightFullUrl: we.themeRemoteLightFullUrl,
        themeRemoteLightKind: we.themeRemoteLightKind,
        themeRemoteDarkFullUrl: we.themeRemoteDarkFullUrl,
        themeRemoteDarkKind: we.themeRemoteDarkKind
      }, T(true), A) x.current = null;
      else {
        const ke = await Y();
        if (!i.current) return;
        x.current = ke ? ((_a7 = k.data) == null ? void 0 : _a7.fullUrl) ?? null : null;
      }
      if (se(), !i.current) return;
      const Ee = [
        ye.themeRemoteManualFullUrl ?? d,
        ye.themeRemoteLightFullUrl ?? u,
        ye.themeRemoteDarkFullUrl ?? h
      ].filter((ke) => !!(ke && ke.trim().length > 0));
      r({
        themeRemoteFavorites: N(n.get(ge).themeRemoteFavorites, Ee)
      });
    }, [
      Y,
      A,
      u,
      h,
      d,
      r,
      (_c3 = k.data) == null ? void 0 : _c3.fullUrl,
      N,
      n
    ]), ue = p.useCallback(() => {
      var _a7, _b4;
      const se = (ke) => {
        const Ne = n.get(ge);
        let lt = Ne.themeRemoteFavorites;
        ke && (lt = lt.filter((We) => We.fullUrl !== ke));
        const Rt = [
          Ne.themeRemoteManualFullUrl,
          Ne.themeRemoteLightFullUrl,
          Ne.themeRemoteDarkFullUrl
        ].filter((We) => !!(We && We.trim().length > 0));
        r({
          themeRemoteFavorites: N(lt, Rt)
        });
      }, ye = C.current;
      if (ye) {
        r(ye), se(x.current), C.current = null, x.current = null, T(false);
        return;
      }
      const we = (_a7 = k.data) == null ? void 0 : _a7.fullUrl;
      if (!we) return;
      const Ee = {};
      u === we && (Ee.themeRemoteLightFullUrl = void 0, Ee.themeRemoteLightKind = void 0), h === we && (Ee.themeRemoteDarkFullUrl = void 0, Ee.themeRemoteDarkKind = void 0), d === we && (Ee.themeRemoteManualFullUrl = void 0, Ee.themeRemoteManualKind = void 0, Ee.themeId = ((_b4 = k.data) == null ? void 0 : _b4.kind) === Rr.Dark ? "dark-theme" : "light-theme"), Object.keys(Ee).length !== 0 && (r(Ee), se(null));
    }, [
      h,
      u,
      d,
      r,
      (_d4 = k.data) == null ? void 0 : _d4.fullUrl,
      (_e13 = k.data) == null ? void 0 : _e13.kind,
      N,
      n
    ]);
    if (!f) return null;
    if (!v && !y) return o.jsx(sue, {
      kind: "theme",
      url: t,
      hostLabel: Y5(t),
      isApprovedHost: m,
      onLoadPreview: () => {
        w(true);
      }
    });
    const ie = ((_f4 = k.data) == null ? void 0 : _f4.displayName) ?? "Theme preview";
    let de = "Theme";
    ((_g4 = k.data) == null ? void 0 : _g4.kind) === Rr.Dark ? de = "Dark" : ((_h4 = k.data) == null ? void 0 : _h4.kind) === Rr.Light && (de = "Light");
    const ne = ((_i7 = k.data) == null ? void 0 : _i7.contrast) ? `${k.data.contrast} contrast` : "", ae = ((_j3 = k.data) == null ? void 0 : _j3.author) ? `by ${k.data.author}` : "", X = ((_k3 = k.data) == null ? void 0 : _k3.tags) && k.data.tags.length > 0 ? k.data.tags.join(", ") : "", K = m ? "Official theme" : Y5(t), G = [
      de,
      ne
    ].filter(Boolean).join(" \xB7 "), le = [
      ae,
      X
    ].filter(Boolean).join(" \xB7 "), te = K, re = o.jsxs(o.Fragment, {
      children: [
        G,
        le ? o.jsxs(o.Fragment, {
          children: [
            o.jsx("br", {}),
            le
          ]
        }) : null,
        o.jsx("br", {}),
        te
      ]
    }), he = (_l3 = k.data) == null ? void 0 : _l3.fullUrl;
    return o.jsxs(E, {
      direction: "Column",
      gap: "300",
      style: {
        width: "400px",
        maxWidth: "100%",
        flexShrink: 0,
        boxSizing: "border-box"
      },
      children: [
        o.jsx(zI, {
          title: ie,
          subtitle: re,
          beforePreview: j ? o.jsx(eO, {
            hostLabel: Y5(t)
          }) : void 0,
          previewCssText: ((_m2 = k.data) == null ? void 0 : _m2.previewText) ?? "",
          scopeSlug: `chat-${Z_(t)}`,
          copyText: t,
          isFavorited: he ? I : false,
          onToggleFavorite: he ? () => L() : void 0,
          systemTheme: c,
          onApplyLight: c && he ? () => oe(() => V(), {
            themeRemoteLightFullUrl: he
          }) : void 0,
          onApplyDark: c && he ? () => oe(() => Z(), {
            themeRemoteDarkFullUrl: he
          }) : void 0,
          onApplyManual: !c && he ? () => oe(() => H(), {
            themeRemoteManualFullUrl: he
          }) : void 0,
          isAppliedLight: he ? u === he : false,
          isAppliedDark: he ? h === he : false,
          isAppliedManual: he ? d === he : false,
          canRevert: M,
          onRevert: ue
        }),
        k.isPending && o.jsx(D, {
          size: "T200",
          priority: "300",
          children: "Loading preview\u2026"
        }),
        U && o.jsx(D, {
          size: "T200",
          priority: "300",
          children: U
        })
      ]
    });
  }
  function Z5(t) {
    try {
      return new URL(t).hostname;
    } catch {
      return "Unofficial tweak";
    }
  }
  function rZ(t) {
    return (t.split("/").pop() ?? t).replace(/\.sable\.css(\?.*)?$/i, "") || "tweak";
  }
  function J5(t, e) {
    const n = new Set(e);
    return t.filter((r) => r.pinned === true || n.has(r.fullUrl));
  }
  function ZGe(t) {
    return (t || "tweak").replace(/[^a-zA-Z0-9_-]/g, "-") || "tweak";
  }
  function JGe({ url: t }) {
    const e = la(), n = _3(), r = p.useRef(true);
    p.useEffect(() => (r.current = true, () => {
      r.current = false;
    }), []);
    const [i] = Fe(ge, "themeChatAutoPreviewApprovedUrls"), [a] = Fe(ge, "themeChatAutoPreviewAnyUrl"), [s] = Fe(ge, "themeRemoteTweakFavorites"), [l] = Fe(ge, "themeRemoteEnabledTweakFullUrls"), [c, d] = Dp(), u = p.useMemo(() => RM(t), [
      t
    ]), h = e.themeCatalogApprovedHostPrefixes, f = p.useMemo(() => wb(t, h), [
      h,
      t
    ]), g = p.useMemo(() => f && i || !f && a, [
      f,
      i,
      a
    ]), [m, v] = p.useState(false);
    p.useEffect(() => {
      v(false);
    }, [
      t
    ]);
    const y = p.useMemo(() => u && (g || m), [
      u,
      g,
      m
    ]), w = p.useMemo(() => !wb(t, h), [
      h,
      t
    ]), b = ol({
      queryKey: [
        "tweak-preview-embed",
        t
      ],
      enabled: y,
      staleTime: 10 * 6e4,
      queryFn: async () => {
        var _a6, _b3, _c3, _d4;
        const I = await fetch(t, {
          mode: "cors"
        });
        if (!I.ok) throw new Error(`tweak fetch failed: ${I.status}`);
        const N = await I.text();
        if (xb(N) !== "tweak") return null;
        const L = Tf(N), H = ((_a6 = L.id) == null ? void 0 : _a6.trim()) || rZ(t);
        return {
          cssText: N,
          displayName: ((_b3 = L.name) == null ? void 0 : _b3.trim()) || rZ(t),
          description: ((_c3 = L.description) == null ? void 0 : _c3.trim()) || void 0,
          author: ((_d4 = L.author) == null ? void 0 : _d4.trim()) || void 0,
          tags: L.tags ?? [],
          basename: H
        };
      }
    }), { data: j } = b, k = p.useMemo(() => `sable-tweak-preview--${ZGe(t)}`, [
      t
    ]), C = p.useMemo(() => {
      if (!(j == null ? void 0 : j.cssText)) return "";
      const I = Tce(j.cssText);
      return Rce(I, k);
    }, [
      j == null ? void 0 : j.cssText,
      k
    ]), x = p.useCallback(async () => {
      await Jo(t) && d();
    }, [
      d,
      t
    ]), S = p.useCallback(async () => {
      if (!j) return;
      if (s.find((L) => L.fullUrl === t)) {
        const L = s.filter((V) => V.fullUrl !== t), H = l.filter((V) => V !== t);
        n({
          themeRemoteTweakFavorites: J5(L, H),
          themeRemoteEnabledTweakFullUrls: H
        });
        return;
      }
      if (await Fo(t, j.cssText), !r.current) return;
      const N = {
        fullUrl: t,
        displayName: j.displayName,
        basename: j.basename,
        pinned: true
      };
      n({
        themeRemoteTweakFavorites: J5([
          ...s,
          N
        ], l)
      });
    }, [
      j,
      l,
      n,
      s,
      t
    ]), T = p.useCallback(async (I) => {
      if (j) if (I) {
        if (await Fo(t, j.cssText), !r.current) return;
        const N = l.includes(t) ? [
          ...l
        ] : [
          ...l,
          t
        ], L = [
          ...s
        ];
        L.some((H) => H.fullUrl === t) || L.push({
          fullUrl: t,
          displayName: j.displayName,
          basename: j.basename,
          pinned: false
        }), n({
          themeRemoteEnabledTweakFullUrls: N,
          themeRemoteTweakFavorites: J5(L, N)
        });
      } else {
        const N = l.filter((L) => L !== t);
        n({
          themeRemoteEnabledTweakFullUrls: N
        });
      }
    }, [
      j,
      l,
      n,
      s,
      t
    ]);
    if (!u) return null;
    if (!g && !m) return o.jsx(sue, {
      kind: "tweak",
      url: t,
      hostLabel: Z5(t),
      isApprovedHost: f,
      onLoadPreview: () => {
        v(true);
      }
    });
    if (b.isPending) return o.jsx(E, {
      direction: "Column",
      gap: "200",
      style: {
        width: "400px",
        maxWidth: "100%",
        flexShrink: 0,
        boxSizing: "border-box"
      },
      children: o.jsxs(E, {
        direction: "Row",
        gap: "200",
        alignItems: "Center",
        children: [
          o.jsx(dt, {
            variant: "Primary",
            size: "400"
          }),
          o.jsx(D, {
            size: "T300",
            children: "Loading tweak\u2026"
          })
        ]
      })
    });
    if (b.isError || j === null || j === void 0) return null;
    const A = s.some((I) => I.fullUrl === t), B = l.includes(t), U = by(t, e.themeCatalogApprovedHostPrefixes), O = [
      j.description,
      j.author ? `by ${j.author}` : "",
      j.tags.length > 0 ? j.tags.join(", ") : ""
    ].filter(Boolean).join(" \xB7 "), M = f ? "Official catalog" : Z5(t);
    return o.jsxs(E, {
      direction: "Column",
      gap: "300",
      style: {
        width: "400px",
        maxWidth: "100%",
        flexShrink: 0,
        boxSizing: "border-box",
        padding: He(12),
        borderRadius: ee.radii.R300,
        border: `${He(1)} solid var(--sable-surface-container-line)`,
        background: "var(--sable-surface-container)"
      },
      children: [
        o.jsxs(E, {
          direction: "Row",
          alignItems: "Start",
          justifyContent: "SpaceBetween",
          gap: "200",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              grow: "Yes",
              style: {
                minWidth: 0
              },
              children: [
                o.jsxs(E, {
                  direction: "Row",
                  gap: "100",
                  alignItems: "Center",
                  wrap: "Wrap",
                  children: [
                    o.jsx(D, {
                      size: "H6",
                      children: j.displayName
                    }),
                    U && o.jsx(ar, {
                      position: "Top",
                      tooltip: o.jsx(pr, {
                        style: {
                          maxWidth: He(280)
                        },
                        children: o.jsx(D, {
                          size: "T200",
                          children: "Third-party tweak. Only enable CSS you trust."
                        })
                      }),
                      children: (I) => o.jsx(Q, {
                        ref: I,
                        src: q.Warning,
                        size: "100",
                        filled: true,
                        style: {
                          color: "var(--sable-warn-on-container)",
                          flexShrink: 0
                        },
                        "aria-label": "Third-party tweak"
                      })
                    })
                  ]
                }),
                O ? o.jsx(D, {
                  size: "T200",
                  priority: "300",
                  style: {
                    wordBreak: "break-word"
                  },
                  children: O
                }) : null,
                o.jsx(D, {
                  size: "T200",
                  priority: "300",
                  children: M
                })
              ]
            }),
            o.jsxs(E, {
              direction: "Row",
              gap: "100",
              alignItems: "Center",
              shrink: "No",
              children: [
                o.jsx(Oe, {
                  size: "300",
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  "aria-label": c ? "Copied tweak link" : "Copy tweak link",
                  onClick: () => {
                    x().catch(() => {
                    });
                  },
                  children: o.jsx(Q, {
                    size: "200",
                    src: c ? q.Check : q.Link
                  })
                }),
                o.jsx(Oe, {
                  size: "300",
                  variant: A ? "Primary" : "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  "aria-label": A ? "Remove tweak from saved" : "Save tweak",
                  onClick: () => {
                    S().catch(() => {
                    });
                  },
                  children: o.jsx(Q, {
                    size: "200",
                    src: q.Star,
                    filled: A
                  })
                }),
                o.jsx(Jt, {
                  variant: "Primary",
                  value: B,
                  onChange: (I) => {
                    T(I).catch(() => {
                    });
                  }
                })
              ]
            })
          ]
        }),
        w ? o.jsx(eO, {
          kind: "tweak",
          hostLabel: Z5(t)
        }) : void 0,
        C ? o.jsxs(o.Fragment, {
          children: [
            o.jsx("style", {
              children: C
            }),
            o.jsxs(E, {
              className: k,
              direction: "Column",
              gap: "200",
              style: {
                padding: He(12),
                borderRadius: ee.radii.R300,
                background: "var(--sable-bg-container)",
                border: `${He(1)} solid var(--sable-surface-container-line)`
              },
              children: [
                o.jsx(D, {
                  size: "T300",
                  style: {
                    color: "var(--sable-bg-on-container)"
                  },
                  children: "Sample text"
                }),
                o.jsxs(E, {
                  direction: "Row",
                  gap: "200",
                  wrap: "Wrap",
                  children: [
                    o.jsx("span", {
                      style: {
                        display: "inline-flex",
                        alignItems: "center",
                        padding: `${He(6)} ${He(12)}`,
                        borderRadius: ee.radii.Pill,
                        background: "var(--sable-primary-main)",
                        color: "var(--sable-primary-on-main)",
                        fontSize: He(12),
                        fontWeight: 500
                      },
                      children: "Primary"
                    }),
                    o.jsx("span", {
                      style: {
                        display: "inline-flex",
                        alignItems: "center",
                        padding: `${He(6)} ${He(12)}`,
                        borderRadius: ee.radii.Pill,
                        background: "var(--sable-surface-container)",
                        color: "var(--sable-surface-on-container)",
                        fontSize: He(12),
                        fontWeight: 500
                      },
                      children: "Surface"
                    })
                  ]
                })
              ]
            })
          ]
        }) : null
      ]
    });
  }
  const XGe = () => Et(p.useCallback(async () => {
    const t = await L1(() => import("./pdf-DEJ3BJS6.js").then(async (m) => {
      await m.__tla;
      return m;
    }), []);
    return t.GlobalWorkerOptions.workerSrc = `${ho("/sable")}/pdf.worker.min.js`, t;
  }, [])), QGe = (t, e) => Et(p.useCallback(async () => {
    if (!t) throw new Error("PdfJS is not loaded");
    return await t.getDocument(e).promise;
  }, [
    t,
    e
  ])), eYe = async (t, e, n) => {
    const r = await t.getPage(e), i = r.getViewport(n), a = document.createElement("canvas"), s = a.getContext("2d");
    if (!s) throw new Error("failed to render page.");
    return a.width = i.width, a.height = i.height, r.render({
      canvas: a,
      canvasContext: s,
      viewport: i
    }), a;
  };
  var tYe = "PdfViewer_PdfViewer__152nja50 _1mqalmd1 _1mqalmd0", nYe = "PdfViewer_PdfViewerHeader__152nja51 _1mqalmd1 _1mqalmd0", rYe = "PdfViewer_PdfViewerFooter__152nja52 PdfViewer_PdfViewerHeader__152nja51 _1mqalmd1 _1mqalmd0", iYe = "PdfViewer_PdfViewerContent__152nja53 _1mqalmd1 _1mqalmd0";
  const oYe = ft(({ className: t, name: e, src: n, requestClose: r, ...i }, a) => {
    const s = p.useRef(null), l = p.useRef(null), { transforms: { zoom: c }, zoomIn: d, zoomOut: u, setZoom: h, onPointerDown: f } = oue(true, 0.2, 0.1, 5), [g, m] = XGe(), [v, y] = QGe(g.status === ve.Success ? g.data : void 0, n), w = g.status === ve.Loading || v.status === ve.Loading, b = g.status === ve.Error || v.status === ve.Error, [j, k] = p.useState(1), [C, x] = p.useState();
    p.useEffect(() => {
      m();
    }, [
      m
    ]), p.useEffect(() => {
      g.status === ve.Success && y();
    }, [
      g,
      y
    ]), p.useEffect(() => {
      if (v.status === ve.Success) {
        const z = v.data;
        if (j < 0 || j > z.numPages) return;
        eYe(z, j, {
          scale: c
        }).then((O) => {
          const M = s.current;
          M && (M.textContent = "", M.append(O), O.style.touchAction = "pan-x pan-y");
        });
      }
    }, [
      v,
      j,
      c
    ]);
    const S = () => {
      ap.saveAs(n, e);
    }, T = (z) => {
      if (z.preventDefault(), v.status !== ve.Success) return;
      const O = z.currentTarget.jumpInput;
      if (!O) return;
      const M = Number.parseInt(O.value, 10);
      k(Math.max(1, Math.min(v.data.numPages, M))), x(void 0);
    }, A = () => {
      k((z) => Math.max(z - 1, 1));
    }, B = () => {
      v.status === ve.Success && k((z) => Math.min(z + 1, v.data.numPages));
    }, U = (z) => {
      x(z.currentTarget.getBoundingClientRect());
    };
    return o.jsxs(E, {
      className: gt(tYe, t),
      direction: "Column",
      "data-gestures": "ignore",
      onPointerDown: (z) => z.stopPropagation(),
      ...i,
      ref: a,
      children: [
        o.jsxs(wn, {
          className: nYe,
          size: "400",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Oe, {
                  size: "300",
                  radii: "300",
                  onClick: r,
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.ArrowLeft
                  })
                }),
                o.jsx(D, {
                  size: "T300",
                  truncate: true,
                  children: e
                })
              ]
            }),
            o.jsxs(E, {
              shrink: "No",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Oe, {
                  variant: c < 1 ? "Success" : "SurfaceVariant",
                  outlined: c < 1,
                  size: "300",
                  radii: "Pill",
                  onClick: u,
                  "aria-label": "Zoom Out",
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.Minus
                  })
                }),
                o.jsx(Qe, {
                  variant: "SurfaceVariant",
                  radii: "Pill",
                  onClick: () => h(c === 1 ? 2 : 1),
                  children: o.jsxs(D, {
                    size: "B300",
                    children: [
                      Math.round(c * 100),
                      "%"
                    ]
                  })
                }),
                o.jsx(Oe, {
                  variant: c > 1 ? "Success" : "SurfaceVariant",
                  outlined: c > 1,
                  size: "300",
                  radii: "Pill",
                  onClick: d,
                  "aria-label": "Zoom In",
                  children: o.jsx(Q, {
                    size: "50",
                    src: q.Plus
                  })
                }),
                o.jsx(Qe, {
                  variant: "Primary",
                  onClick: S,
                  radii: "300",
                  before: o.jsx(Q, {
                    size: "50",
                    src: q.Download
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Download"
                  })
                })
              ]
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          grow: "Yes",
          alignItems: "Center",
          justifyContent: "Center",
          gap: "200",
          children: [
            w && o.jsx(dt, {
              variant: "Secondary",
              size: "600"
            }),
            b && o.jsxs(o.Fragment, {
              children: [
                o.jsx(D, {
                  children: "Failed to load PDF"
                }),
                o.jsx(xe, {
                  variant: "Critical",
                  fill: "Soft",
                  size: "300",
                  radii: "300",
                  before: o.jsx(Q, {
                    src: q.Warning,
                    size: "50"
                  }),
                  onClick: m,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Retry"
                  })
                })
              ]
            }),
            v.status === ve.Success && o.jsx(dn, {
              ref: l,
              size: "300",
              direction: "Both",
              variant: "Surface",
              visibility: "Hover",
              style: {
                width: "100%",
                height: "100%",
                touchAction: "pan-x pan-y"
              },
              children: o.jsx(E, {
                style: {
                  minWidth: "100%",
                  minHeight: "100%"
                },
                onPointerDown: f,
                children: o.jsx("div", {
                  className: iYe,
                  ref: s
                })
              })
            })
          ]
        }),
        v.status === ve.Success && o.jsxs(wn, {
          as: "footer",
          className: rYe,
          size: "400",
          children: [
            o.jsx(Qe, {
              variant: "Secondary",
              radii: "300",
              before: o.jsx(Q, {
                size: "50",
                src: q.ChevronLeft
              }),
              onClick: A,
              "aria-disabled": j <= 1,
              children: o.jsx(D, {
                size: "B300",
                children: "Previous"
              })
            }),
            o.jsx(E, {
              grow: "Yes",
              justifyContent: "Center",
              alignItems: "Center",
              gap: "200",
              children: o.jsx(ln, {
                anchor: C,
                align: "Center",
                position: "Top",
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    onDeactivate: () => x(void 0),
                    clickOutsideDeactivates: true,
                    escapeDeactivates: kt
                  },
                  children: o.jsx(tn, {
                    variant: "Surface",
                    children: o.jsxs(E, {
                      as: "form",
                      onSubmit: T,
                      style: {
                        padding: ee.space.S200
                      },
                      direction: "Column",
                      gap: "200",
                      children: [
                        o.jsx(mn, {
                          name: "jumpInput",
                          size: "300",
                          variant: "Background",
                          defaultValue: j,
                          min: 1,
                          max: v.data.numPages,
                          step: 1,
                          outlined: true,
                          type: "number",
                          radii: "300",
                          "aria-label": "Page Number"
                        }),
                        o.jsx(xe, {
                          type: "submit",
                          size: "300",
                          variant: "Primary",
                          radii: "300",
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Jump To Page"
                          })
                        })
                      ]
                    })
                  })
                }),
                children: o.jsx(Qe, {
                  onClick: U,
                  variant: "SurfaceVariant",
                  radii: "300",
                  "aria-pressed": C !== void 0,
                  children: o.jsx(D, {
                    size: "B300",
                    children: `${j}/${v.data.numPages}`
                  })
                })
              })
            }),
            o.jsx(Qe, {
              variant: "Primary",
              radii: "300",
              after: o.jsx(Q, {
                size: "50",
                src: q.ChevronRight
              }),
              onClick: B,
              "aria-disabled": j >= v.data.numPages,
              children: o.jsx(D, {
                size: "B300",
                children: "Next"
              })
            })
          ]
        })
      ]
    });
  });
  var nC = ((t) => (t.Hug = "hug", t.Cuddle = "cuddle", t.Wave = "wave", t.Poke = "poke", t.Headpat = "headpat", t.Kiss = "kiss", t))(nC || {});
  function X5({ content: t, type: e, mentionedUserIds: n }) {
    if (!t) return null;
    let r = "";
    switch (e) {
      case "hug":
        r = `hugs ${(n == null ? void 0 : n[0]) || "you"}`;
        break;
      case "cuddle":
        r = `cuddles ${(n == null ? void 0 : n[0]) || "you"}`;
        break;
      case "kiss":
        r = "currently disabled kiss event, in light of potential abuse, may be added in the future with proper filtering";
        break;
      case "wave":
        r = `waves at ${(n == null ? void 0 : n[0]) || "you"}`;
        break;
      case "poke":
        r = `pokes ${(n == null ? void 0 : n[0]) || "you"}`;
        break;
      case "headpat":
        r = `gives headpats to ${(n == null ? void 0 : n[0]) || "you"}`;
        break;
      default:
        r = `sends ${(n == null ? void 0 : n[0]) || "you"} a cute event`;
    }
    return o.jsx(F1, {
      notice: true,
      children: o.jsx("em", {
        "data-cute-event": true,
        "data-cute-type": e,
        children: r
      })
    });
  }
  const aYe = (t) => {
    const e = t.toLowerCase();
    return e.match(/\.(mp4|webm|ogg)$/i) ? "video" : e.match(/\.(png|jpg|jpeg|gif|webp)$/i) || e.match(/@(jpeg|webp|png|jpg)$/i) ? "image" : null;
  }, sYe = (t) => /^https:\/\//i.test(t) && (/\.preview\.sable\.css(\?|#|$)/i.test(t) || RM(t)), lYe = {
    marginTop: ee.space.S200
  };
  function cYe({ displayName: t, msgType: e, ts: n, edited: r, getContent: i, mediaAutoLoad: a, bundledPreview: s, urlPreview: l, clientUrlPreview: c, highlightRegex: d, htmlReactParserOptions: u, linkifyOpts: h, outlineAttachment: f, hideCaption: g }) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7;
    const m = p.useMemo(() => i(), [
      i
    ]), [v] = Fe(ge, "autoplayGifs"), [y] = Fe(ge, "captionPosition"), [w] = Fe(ge, "themeChatSableWidgetsEnabled"), [b] = Fe(ge, "multiplePreviews"), j = gs(), C = {
      [Ua.Above]: "column-reverse",
      [Ua.Below]: "column",
      [Ua.Inline]: "row",
      [Ua.Hidden]: "row"
    }[y], x = p.useCallback((M) => o.jsx(hS, {
      ...M,
      body: M.body,
      highlightRegex: d,
      htmlReactParserOptions: u,
      linkifyOpts: h
    }), [
      d,
      u,
      h
    ]), S = p.useCallback((M) => {
      const I = M.filter((ue) => !zc(ue) && !Ak(j, ue));
      if (I.length === 0) return;
      const L = (w ? I.filter((ue) => /^https:\/\//i.test(ue) && /\.preview\.sable\.css(\?|#|$)/i.test(ue)) : []).filter((ue) => /^https:\/\//i.test(ue)), H = w ? I.filter((ue) => RM(ue)) : [], V = I.map((ue) => ({
        url: ue,
        type: aYe(ue)
      })), Z = V.filter((ue) => ue.type !== null), Y = Z.length > 0 ? Z : V, oe = b ? Y : [
        Y[0]
      ];
      return o.jsxs(nZ, {
        children: [
          L.map((ue) => o.jsx(YGe, {
            url: ue
          }, `theme:${ue}`)),
          H.map((ue) => o.jsx(JGe, {
            url: ue
          }, `tweak:${ue}`)),
          oe.map((ue) => {
            const { url: ie, type: de } = ue;
            return L.includes(ie) || H.includes(ie) ? null : de ? o.jsx(G5, {
              urlPreview: true,
              url: ie,
              ts: n,
              mediaType: de
            }, ie) : !w && sYe(ie) ? null : c && aue(ie) ? o.jsx(qGe, {
              url: ie
            }, ie) : l ? o.jsx(G5, {
              urlPreview: true,
              url: ie,
              ts: n,
              mediaType: de
            }, ie) : null;
          })
        ]
      });
    }, [
      b,
      w,
      j,
      c,
      l,
      n
    ]), T = p.useCallback((M) => o.jsx(nZ, {
      children: M.map((I) => o.jsx(G5, {
        urlPreview: l === true,
        url: I["og:url"],
        bundle: I
      }, I["og:url"]))
    }), [
      l
    ]), A = l || w ? S : void 0, B = s ? T : void 0, U = () => {
      const M = m.body && m.body.trim().length > 0;
      return y === Ua.Hidden || g ? null : M && m.filename && m.filename !== m.body ? y !== Ua.Inline ? o.jsx(B5, {
        style: lYe,
        edited: r,
        content: m,
        renderBody: x,
        renderUrlsPreview: A,
        renderBundledPreviews: B
      }) : o.jsx(E, {
        style: {
          padding: ee.space.S200,
          wordBreak: "break-word",
          maxWidth: "100%",
          display: "flex",
          flexDirection: "column",
          justifyContent: "center",
          flexShrink: 1
        },
        children: o.jsx(B5, {
          edited: r,
          content: m,
          renderBody: x,
          renderUrlsPreview: A,
          renderBundledPreviews: B
        })
      }) : null;
    };
    function z(M) {
      return o.jsxs("div", {
        style: {
          display: "flex",
          flexDirection: C
        },
        children: [
          o.jsx("div", {
            children: M
          }),
          U()
        ]
      });
    }
    const O = () => z(o.jsx($Ne, {
      content: m,
      renderFileContent: ({ body: M, mimeType: I, info: N, encInfo: L, url: H }) => o.jsx(jRe, {
        body: M,
        mimeType: I,
        renderAsPdfFile: () => o.jsx(kRe, {
          body: M,
          mimeType: I,
          url: H,
          encInfo: L,
          renderViewer: (V) => o.jsx(oYe, {
            ...V
          })
        }),
        renderAsTextFile: () => o.jsx(ERe, {
          body: M,
          mimeType: I,
          url: H,
          encInfo: L,
          renderViewer: (V) => o.jsx(Vce, {
            ...V
          })
        }),
        children: o.jsx(SRe, {
          body: M,
          mimeType: I,
          url: H,
          encInfo: L,
          info: N
        })
      }),
      outlined: f
    }));
    if (e === Jn.Text) return o.jsx(B5, {
      edited: r,
      content: m,
      renderBody: x,
      renderUrlsPreview: A,
      renderBundledPreviews: B
    });
    if (e === Jn.Emote) return m["fyi.cisnt.headpat"] ? o.jsx(X5, {
      content: m.body,
      type: nC.Headpat,
      mentionedUserIds: (_a6 = m["m.mentions"]) == null ? void 0 : _a6.user_ids
    }) : o.jsx(LNe, {
      displayName: t,
      edited: r,
      content: m,
      renderBody: x,
      renderUrlsPreview: A,
      renderBundledPreviews: B
    });
    if (e === Jn.Notice) return o.jsx(NNe, {
      edited: r,
      content: m,
      renderBody: x,
      renderUrlsPreview: A,
      renderBundledPreviews: B
    });
    if (e === Jn.Image) {
      const M = m.info, I = (M == null ? void 0 : M.mimetype) === "image/gif" || (M == null ? void 0 : M.mimetype) === "image/apng" || (M == null ? void 0 : M.mimetype) === "image/webp" || ((_b3 = m.body) == null ? void 0 : _b3.toLowerCase().endsWith(".gif")) || ((_c3 = m.body) == null ? void 0 : _c3.toLowerCase().endsWith(".apng")) || ((_d4 = m.body) == null ? void 0 : _d4.toLowerCase().endsWith(".webp")) || typeof m.url == "string" && (((_e13 = m.url) == null ? void 0 : _e13.toLowerCase().endsWith(".gif")) || ((_f4 = m.url) == null ? void 0 : _f4.toLowerCase().endsWith(".apng")) || ((_g4 = m.url) == null ? void 0 : _g4.toLowerCase().endsWith(".webp")));
      return z(o.jsx(zNe, {
        content: m,
        renderImageContent: (N) => o.jsx(rh, {
          ...N,
          autoPlay: a,
          renderImage: (L) => I && !v && L.src ? o.jsx(rp, {
            src: L.src,
            children: o.jsx(as, {
              ...L,
              loading: "lazy"
            })
          }) : o.jsx(as, {
            ...L,
            loading: "lazy"
          }),
          renderViewer: (L) => o.jsx(Yc, {
            ...L
          })
        }),
        outlined: f
      }));
    }
    return e === Jn.Video ? z(o.jsx(UNe, {
      content: m,
      renderAsFile: O,
      renderVideoContent: ({ body: M, info: I, ...N }) => o.jsx(LP, {
        body: M,
        info: I,
        ...N,
        renderThumbnail: a ? () => o.jsx(qTe, {
          info: I,
          renderImage: (L) => o.jsx(as, {
            alt: M,
            title: M,
            src: L,
            loading: "lazy"
          })
        }) : void 0,
        renderVideo: (L) => o.jsx(bRe, {
          ...L
        })
      }),
      outlined: f
    })) : e === Jn.Audio ? z(o.jsx(HNe, {
      content: m,
      renderAsFile: O,
      renderAudioContent: (M) => o.jsx(tse, {
        ...M,
        renderMediaControl: (I) => o.jsx(ese, {
          ...I
        })
      }),
      outlined: f
    })) : e === Jn.File ? O() : e === Jn.Location ? o.jsx(WNe, {
      content: m
    }) : e === "m.bad.encrypted" ? o.jsx(MNe, {}) : e === "im.fluffychat.cute_event" ? o.jsx(X5, {
      content: m.body,
      type: m.cute_type ?? nC.Hug,
      mentionedUserIds: (_h4 = m["m.mentions"]) == null ? void 0 : _h4.user_ids
    }) : e === "fyi.cisnt.headpat" ? o.jsx(X5, {
      content: m.body,
      type: nC.Headpat,
      mentionedUserIds: (_i7 = m["m.mentions"]) == null ? void 0 : _i7.user_ids
    }) : o.jsx(ONe, {
      body: m.body ?? ""
    });
  }
  const oh = p.memo(cYe);
  var dYe = "style_PowerColorBadge__100wriu0", uYe = "style_PowerColorBadgeNone__100wriu1", iZ = Jr({
    defaultClassName: "style_PowerIcon__100wriu3 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      size: {
        50: "style_PowerIcon_size_50__100wriu4",
        100: "style_PowerIcon_size_100__100wriu5",
        200: "style_PowerIcon_size_200__100wriu6",
        300: "style_PowerIcon_size_300__100wriu7",
        400: "style_PowerIcon_size_400__100wriu8",
        500: "style_PowerIcon_size_500__100wriu9",
        600: "style_PowerIcon_size_600__100wriua"
      }
    },
    defaultVariants: {
      size: "400"
    },
    compoundVariants: []
  });
  const Hf = ft(({ as: t = "span", color: e, className: n, style: r, ...i }, a) => o.jsx(t, {
    className: gt(dYe, {
      [uYe]: !e
    }, n),
    style: {
      backgroundColor: e,
      ...r
    },
    ...i,
    ref: a
  }));
  function Zc({ size: t, iconSrc: e, name: n }) {
    return Pk.test(e) ? o.jsx("span", {
      className: iZ({
        size: t
      }),
      children: e
    }) : o.jsx("img", {
      className: iZ({
        size: t
      }),
      src: e,
      alt: n
    });
  }
  const hYe = p.forwardRef(({ powerLevelTags: t, value: e, onChange: n }, r) => o.jsx(tn, {
    ref: r,
    style: {
      maxHeight: "75vh",
      maxWidth: He(300),
      display: "flex"
    },
    children: o.jsx(E, {
      grow: "Yes",
      children: o.jsx(dn, {
        size: "0",
        hideTrack: true,
        visibility: "Hover",
        children: o.jsx("div", {
          style: {
            padding: ee.space.S100
          },
          children: HF(t).map((i) => {
            const a = e === i, s = t[i];
            return o.jsx(Ye, {
              "aria-pressed": a,
              radii: "300",
              onClick: a ? void 0 : () => n(i),
              before: o.jsx(Hf, {
                color: s.color
              }),
              after: o.jsx(D, {
                size: "L400",
                children: i
              }),
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                size: "B400",
                truncate: true,
                children: s.name
              })
            }, i);
          })
        })
      })
    })
  }));
  function oZ({ powerLevelTags: t, value: e, onChange: n, children: r }) {
    const [i, a] = p.useState(), s = (l) => {
      a(l.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: i,
      offset: 5,
      position: "Bottom",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => a(void 0),
          clickOutsideDeactivates: true,
          isKeyForward: (l) => l.key === "ArrowDown" || l.key === "ArrowRight",
          isKeyBackward: (l) => l.key === "ArrowUp" || l.key === "ArrowLeft",
          escapeDeactivates: kt
        },
        children: o.jsx(hYe, {
          powerLevelTags: t,
          value: e,
          onChange: (l) => {
            n(l), a(void 0);
          }
        })
      }),
      children: r(s, !!i)
    });
  }
  const lue = (t, e) => {
    const [n, r] = p.useState(() => e(t));
    return p.useEffect(() => {
      const i = () => {
        r(e(t));
      };
      return t.on(Ed.Add, i), t.on(Ed.Redaction, i), t.on(Ed.Remove, i), () => {
        t.removeListener(Ed.Add, i), t.removeListener(Ed.Redaction, i), t.removeListener(Ed.Remove, i);
      };
    }, [
      t,
      e
    ]), n;
  };
  var fYe = "ReactionViewer_ReactionViewer__45ekdi0 _1mqalmd1 _1mqalmd0", mYe = "ReactionViewer_Sidebar__45ekdi1", gYe = "ReactionViewer_SidebarContent__45ekdi2", pYe = "ReactionViewer_Header__45ekdi3", FYe = "ReactionViewer_Content__45ekdi4";
  const cue = ft(({ className: t, room: e, initialKey: n, relations: r, requestClose: i, ...a }, s) => {
    var _a6;
    const l = be(), c = hn(), d = lue(r, p.useCallback((j) => [
      ...j.getSortedAnnotationsByKey() ?? []
    ], [])), u = ka(), h = Ls(), f = Ze(qr), [g, m] = p.useState(() => {
      if (n) return n;
      const j = d.find((k) => typeof k[0] == "string");
      return j ? j[0] : "";
    }), v = (j) => gr(e, j.userId, f) ?? _n(j.userId) ?? j.userId, w = ((j) => {
      var _a7;
      const k = (_a7 = d.find(([C]) => C === j)) == null ? void 0 : _a7[1];
      return k ? Array.from(k) : [];
    })(g), b = ((_a6 = w.find(NB)) == null ? void 0 : _a6.getContent().shortcode) ?? vP(_P(g)) ?? g;
    return o.jsxs(E, {
      className: gt(fYe, t),
      direction: "Row",
      ...a,
      ref: s,
      children: [
        o.jsx(E, {
          shrink: "No",
          className: mYe,
          children: o.jsx(dn, {
            visibility: "Hover",
            hideTrack: true,
            size: "300",
            children: o.jsx(E, {
              className: gYe,
              direction: "Column",
              gap: "200",
              children: d.map(([j, k]) => o.jsx(Loe, {
                mx: l,
                reaction: j,
                count: k.size,
                "aria-selected": j === g,
                onClick: () => m(j),
                useAuthentication: c
              }, j))
            })
          })
        }),
        o.jsx(nr, {
          variant: "Surface",
          direction: "Vertical",
          size: "300"
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          children: [
            o.jsxs(wn, {
              className: pYe,
              variant: "Surface",
              size: "600",
              children: [
                o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: `Reacted with :${b}:`
                  })
                }),
                o.jsx(Oe, {
                  size: "300",
                  onClick: i,
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              ]
            }),
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(dn, {
                visibility: "Hover",
                hideTrack: true,
                size: "300",
                children: o.jsx(E, {
                  className: FYe,
                  direction: "Column",
                  children: w.map((j) => {
                    const k = j.getSender();
                    if (!k) return null;
                    const C = e.getMember(k), x = (C ? v(C) : _n(k)) ?? k, S = C == null ? void 0 : C.getMxcAvatarUrl(), T = S ? l.mxcUrlToHttp(S, 100, 100, "crop", void 0, false, c) : void 0;
                    return o.jsx(Ye, {
                      style: {
                        padding: `0 ${ee.space.S200}`
                      },
                      radii: "400",
                      onClick: (A) => {
                        h(e.roomId, u == null ? void 0 : u.roomId, k, wp(A.nativeEvent), "Bottom");
                      },
                      before: o.jsx(xn, {
                        size: "200",
                        children: o.jsx(Si, {
                          userId: k,
                          src: T ?? void 0,
                          alt: x,
                          renderFallback: () => o.jsx(Q, {
                            size: "50",
                            src: q.User,
                            filled: true
                          })
                        })
                      }),
                      children: o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "T400",
                          truncate: true,
                          children: x
                        })
                      })
                    }, k);
                  })
                })
              })
            })
          ]
        })
      ]
    });
  }), Q5 = ft(({ className: t, room: e, relations: n, mEventId: r, canSendReaction: i, canDeleteOwn: a, onReactionToggle: s, ...l }, c) => {
    const d = be(), u = hn(), [h, f] = p.useState(false), g = d.getUserId(), m = lue(n, p.useCallback((y) => [
      ...y.getSortedAnnotationsByKey() ?? []
    ], [])), v = (y) => {
      y.stopPropagation(), y.preventDefault();
      const w = y.currentTarget.getAttribute("data-reaction-key");
      f(w || true);
    };
    return o.jsxs(E, {
      className: gt(hAe, t),
      gap: "200",
      wrap: "Wrap",
      ...l,
      ref: c,
      children: [
        m.map(([y, w]) => {
          var _a6;
          const b = Array.from(w);
          if (b.length === 0 || typeof y != "string") return null;
          const k = !!((_a6 = g ? b.find(Fie(g)) : void 0) == null ? void 0 : _a6.getRelation()), C = k ? a : i;
          return o.jsx(ar, {
            position: "Top",
            tooltip: o.jsx(pr, {
              style: {
                maxWidth: He(200)
              },
              children: o.jsx(D, {
                className: fAe,
                size: "T300",
                children: o.jsx(Z6e, {
                  room: e,
                  reaction: y,
                  events: b
                })
              })
            }),
            children: (x) => o.jsx(Loe, {
              ref: x,
              "data-reaction-key": y,
              "aria-pressed": k,
              mx: d,
              reaction: y,
              count: w.size,
              onClick: C ? () => s(r, y) : void 0,
              onContextMenu: v,
              "aria-disabled": !C,
              useAuthentication: u
            }, y)
          }, y);
        }),
        m.length > 0 && o.jsx(Hn, {
          onContextMenu: (y) => {
            y.stopPropagation();
          },
          open: !!h,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                returnFocusOnDeactivate: false,
                onDeactivate: () => f(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                variant: "Surface",
                size: "300",
                children: o.jsx(cue, {
                  room: e,
                  initialKey: typeof h == "string" ? h : void 0,
                  relations: n,
                  requestClose: () => f(false)
                })
              })
            })
          })
        })
      ]
    });
  }), vYe = typeof document < "u" ? yn.useLayoutEffect : () => {
  }, due = (t) => {
    var e;
    return (e = t == null ? void 0 : t.ownerDocument) !== null && e !== void 0 ? e : document;
  };
  function _Ye(t) {
    return t !== null && typeof t == "object" && "nodeType" in t && typeof t.nodeType == "number";
  }
  function yYe(t) {
    return _Ye(t) && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in t;
  }
  let bYe = false;
  function tO() {
    return bYe;
  }
  function gg(t, e) {
    if (!tO()) return e && t ? t.contains(e) : false;
    if (!t || !e) return false;
    let n = e;
    for (; n !== null; ) {
      if (n === t) return true;
      n.tagName === "SLOT" && n.assignedSlot ? n = n.assignedSlot.parentNode : yYe(n) ? n = n.host : n = n.parentNode;
    }
    return false;
  }
  const e8 = (t = document) => {
    var e;
    if (!tO()) return t.activeElement;
    let n = t.activeElement;
    for (; n && "shadowRoot" in n && (!((e = n.shadowRoot) === null || e === void 0) && e.activeElement); ) n = n.shadowRoot.activeElement;
    return n;
  };
  function Lu(t) {
    if (tO() && t.target instanceof Element && t.target.shadowRoot) {
      var e, n;
      if ("composedPath" in t) return (e = t.composedPath()[0]) !== null && e !== void 0 ? e : null;
      if ("composedPath" in t.nativeEvent) return (n = t.nativeEvent.composedPath()[0]) !== null && n !== void 0 ? n : null;
    }
    return t.target;
  }
  function uue() {
    let t = p.useRef(/* @__PURE__ */ new Map()), e = p.useCallback((i, a, s, l) => {
      let c = (l == null ? void 0 : l.once) ? (...d) => {
        t.current.delete(s), s(...d);
      } : s;
      t.current.set(s, {
        type: a,
        eventTarget: i,
        fn: c,
        options: l
      }), i.addEventListener(a, c, l);
    }, []), n = p.useCallback((i, a, s, l) => {
      var c;
      let d = ((c = t.current.get(s)) === null || c === void 0 ? void 0 : c.fn) || s;
      i.removeEventListener(a, d, l), t.current.delete(s);
    }, []), r = p.useCallback(() => {
      t.current.forEach((i, a) => {
        n(i.eventTarget, i.type, a, i.options);
      });
    }, [
      n
    ]);
    return p.useEffect(() => r, [
      r
    ]), {
      addGlobalListener: e,
      removeGlobalListener: n,
      removeAllGlobalListeners: r
    };
  }
  function hue(t) {
    let e = t;
    return e.nativeEvent = t, e.isDefaultPrevented = () => e.defaultPrevented, e.isPropagationStopped = () => e.cancelBubble, e.persist = () => {
    }, e;
  }
  function xYe(t, e) {
    Object.defineProperty(t, "target", {
      value: e
    }), Object.defineProperty(t, "currentTarget", {
      value: e
    });
  }
  function wYe(t) {
    let e = p.useRef({
      isFocused: false,
      observer: null
    });
    return vYe(() => {
      const n = e.current;
      return () => {
        n.observer && (n.observer.disconnect(), n.observer = null);
      };
    }, []), p.useCallback((n) => {
      let r = Lu(n);
      if (r instanceof HTMLButtonElement || r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement) {
        e.current.isFocused = true;
        let i = r, a = (s) => {
          if (e.current.isFocused = false, i.disabled) {
            let l = hue(s);
            t == null ? void 0 : t(l);
          }
          e.current.observer && (e.current.observer.disconnect(), e.current.observer = null);
        };
        i.addEventListener("focusout", a, {
          once: true
        }), e.current.observer = new MutationObserver(() => {
          if (e.current.isFocused && i.disabled) {
            var s;
            (s = e.current.observer) === null || s === void 0 || s.disconnect();
            let l = i === e8() ? null : e8();
            i.dispatchEvent(new FocusEvent("blur", {
              relatedTarget: l
            })), i.dispatchEvent(new FocusEvent("focusout", {
              bubbles: true,
              relatedTarget: l
            }));
          }
        }), e.current.observer.observe(i, {
          attributes: true,
          attributeFilter: [
            "disabled"
          ]
        });
      }
    }, [
      t
    ]);
  }
  function nO(t) {
    let { isDisabled: e, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: i } = t, a = p.useRef({
      isFocusWithin: false
    }), { addGlobalListener: s, removeAllGlobalListeners: l } = uue(), c = p.useCallback((h) => {
      gg(h.currentTarget, Lu(h)) && a.current.isFocusWithin && !gg(h.currentTarget, h.relatedTarget) && (a.current.isFocusWithin = false, l(), n && n(h), i && i(false));
    }, [
      n,
      i,
      a,
      l
    ]), d = wYe(c), u = p.useCallback((h) => {
      if (!gg(h.currentTarget, Lu(h))) return;
      let f = Lu(h);
      const g = due(f), m = e8(g);
      if (!a.current.isFocusWithin && m === f) {
        r && r(h), i && i(true), a.current.isFocusWithin = true, d(h);
        let v = h.currentTarget;
        s(g, "focus", (y) => {
          let w = Lu(y);
          if (a.current.isFocusWithin && !gg(v, w)) {
            let b = new g.defaultView.FocusEvent("blur", {
              relatedTarget: w
            });
            xYe(b, v);
            let j = hue(b);
            c(j);
          }
        }, {
          capture: true
        });
      }
    }, [
      r,
      i,
      d,
      s,
      c
    ]);
    return e ? {
      focusWithinProps: {
        onFocus: void 0,
        onBlur: void 0
      }
    } : {
      focusWithinProps: {
        onFocus: u,
        onBlur: c
      }
    };
  }
  let t8 = false, Qw = 0;
  function DYe() {
    t8 = true, setTimeout(() => {
      t8 = false;
    }, 50);
  }
  function aZ(t) {
    t.pointerType === "touch" && DYe();
  }
  function CYe() {
    if (!(typeof document > "u")) return Qw === 0 && typeof PointerEvent < "u" && document.addEventListener("pointerup", aZ), Qw++, () => {
      Qw--, !(Qw > 0) && typeof PointerEvent < "u" && document.removeEventListener("pointerup", aZ);
    };
  }
  function rO(t) {
    let { onHoverStart: e, onHoverChange: n, onHoverEnd: r, isDisabled: i } = t, [a, s] = p.useState(false), l = p.useRef({
      isHovered: false,
      ignoreEmulatedMouseEvents: false,
      pointerType: "",
      target: null
    }).current;
    p.useEffect(CYe, []);
    let { addGlobalListener: c, removeAllGlobalListeners: d } = uue(), { hoverProps: u, triggerHoverEnd: h } = p.useMemo(() => {
      let f = (v, y) => {
        if (l.pointerType = y, i || y === "touch" || l.isHovered || !gg(v.currentTarget, Lu(v))) return;
        l.isHovered = true;
        let w = v.currentTarget;
        l.target = w, c(due(Lu(v)), "pointerover", (b) => {
          l.isHovered && l.target && !gg(l.target, Lu(b)) && g(b, b.pointerType);
        }, {
          capture: true
        }), e && e({
          type: "hoverstart",
          target: w,
          pointerType: y
        }), n && n(true), s(true);
      }, g = (v, y) => {
        let w = l.target;
        l.pointerType = "", l.target = null, !(y === "touch" || !l.isHovered || !w) && (l.isHovered = false, d(), r && r({
          type: "hoverend",
          target: w,
          pointerType: y
        }), n && n(false), s(false));
      }, m = {};
      return typeof PointerEvent < "u" && (m.onPointerEnter = (v) => {
        t8 && v.pointerType === "mouse" || f(v, v.pointerType);
      }, m.onPointerLeave = (v) => {
        !i && gg(v.currentTarget, Lu(v)) && g(v, v.pointerType);
      }), {
        hoverProps: m,
        triggerHoverEnd: g
      };
    }, [
      e,
      n,
      r,
      i,
      l,
      c,
      d
    ]);
    return p.useEffect(() => {
      i && h({
        currentTarget: l.target
      }, l.pointerType);
    }, [
      i
    ]), {
      hoverProps: u,
      isHovered: a
    };
  }
  const fue = p.createContext({});
  function Cb(t) {
    const e = p.useRef(null);
    return e.current === null && (e.current = t()), e.current;
  }
  const mue = typeof window < "u", gue = mue ? p.useLayoutEffect : p.useEffect, iO = p.createContext(null);
  function oO(t, e) {
    t.indexOf(e) === -1 && t.push(e);
  }
  function DE(t, e) {
    const n = t.indexOf(e);
    n > -1 && t.splice(n, 1);
  }
  const Wd = (t, e, n) => n > e ? e : n < t ? t : n;
  let aO = () => {
  };
  const ah = {}, pue = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);
  function Fue(t) {
    return typeof t == "object" && t !== null;
  }
  const vue = (t) => /^0[^.\s]+$/u.test(t);
  function _ue(t) {
    let e;
    return () => (e === void 0 && (e = t()), e);
  }
  const $l = (t) => t, EYe = (t, e) => (n) => e(t(n)), C3 = (...t) => t.reduce(EYe), Eb = (t, e, n) => {
    const r = e - t;
    return r === 0 ? 1 : (n - t) / r;
  };
  class sO {
    constructor() {
      this.subscriptions = [];
    }
    add(e) {
      return oO(this.subscriptions, e), () => DE(this.subscriptions, e);
    }
    notify(e, n, r) {
      const i = this.subscriptions.length;
      if (i) if (i === 1) this.subscriptions[0](e, n, r);
      else for (let a = 0; a < i; a++) {
        const s = this.subscriptions[a];
        s && s(e, n, r);
      }
    }
    getSize() {
      return this.subscriptions.length;
    }
    clear() {
      this.subscriptions.length = 0;
    }
  }
  const dl = (t) => t * 1e3, zl = (t) => t / 1e3;
  function yue(t, e) {
    return e ? t * (1e3 / e) : 0;
  }
  const bue = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, kYe = 1e-7, SYe = 12;
  function jYe(t, e, n, r, i) {
    let a, s, l = 0;
    do
      s = e + (n - e) / 2, a = bue(s, r, i) - t, a > 0 ? n = s : e = s;
    while (Math.abs(a) > kYe && ++l < SYe);
    return s;
  }
  function E3(t, e, n, r) {
    if (t === e && n === r) return $l;
    const i = (a) => jYe(a, 0, 1, t, n);
    return (a) => a === 0 || a === 1 ? a : bue(i(a), e, r);
  }
  const xue = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, wue = (t) => (e) => 1 - t(1 - e), Due = E3(0.33, 1.53, 0.69, 0.99), lO = wue(Due), Cue = xue(lO), Eue = (t) => (t *= 2) < 1 ? 0.5 * lO(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), cO = (t) => 1 - Math.sin(Math.acos(t)), kue = wue(cO), Sue = xue(cO), TYe = E3(0.42, 0, 1, 1), RYe = E3(0, 0, 0.58, 1), jue = E3(0.42, 0, 0.58, 1), AYe = (t) => Array.isArray(t) && typeof t[0] != "number", Tue = (t) => Array.isArray(t) && typeof t[0] == "number", IYe = {
    linear: $l,
    easeIn: TYe,
    easeInOut: jue,
    easeOut: RYe,
    circIn: cO,
    circInOut: Sue,
    circOut: kue,
    backIn: lO,
    backInOut: Cue,
    backOut: Due,
    anticipate: Eue
  }, BYe = (t) => typeof t == "string", sZ = (t) => {
    if (Tue(t)) {
      aO(t.length === 4);
      const [e, n, r, i] = t;
      return E3(e, n, r, i);
    } else if (BYe(t)) return IYe[t];
    return t;
  }, eD = [
    "setup",
    "read",
    "resolveKeyframes",
    "preUpdate",
    "update",
    "preRender",
    "render",
    "postRender"
  ];
  function PYe(t, e) {
    let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = false, a = false;
    const s = /* @__PURE__ */ new WeakSet();
    let l = {
      delta: 0,
      timestamp: 0,
      isProcessing: false
    };
    function c(u) {
      s.has(u) && (d.schedule(u), t()), u(l);
    }
    const d = {
      schedule: (u, h = false, f = false) => {
        const m = f && i ? n : r;
        return h && s.add(u), m.has(u) || m.add(u), u;
      },
      cancel: (u) => {
        r.delete(u), s.delete(u);
      },
      process: (u) => {
        if (l = u, i) {
          a = true;
          return;
        }
        i = true, [n, r] = [
          r,
          n
        ], n.forEach(c), n.clear(), i = false, a && (a = false, d.process(u));
      }
    };
    return d;
  }
  const MYe = 40;
  function Rue(t, e) {
    let n = false, r = true;
    const i = {
      delta: 0,
      timestamp: 0,
      isProcessing: false
    }, a = () => n = true, s = eD.reduce((j, k) => (j[k] = PYe(a), j), {}), { setup: l, read: c, resolveKeyframes: d, preUpdate: u, update: h, preRender: f, render: g, postRender: m } = s, v = () => {
      const j = ah.useManualTiming ? i.timestamp : performance.now();
      n = false, ah.useManualTiming || (i.delta = r ? 1e3 / 60 : Math.max(Math.min(j - i.timestamp, MYe), 1)), i.timestamp = j, i.isProcessing = true, l.process(i), c.process(i), d.process(i), u.process(i), h.process(i), f.process(i), g.process(i), m.process(i), i.isProcessing = false, n && e && (r = false, t(v));
    }, y = () => {
      n = true, r = true, i.isProcessing || t(v);
    };
    return {
      schedule: eD.reduce((j, k) => {
        const C = s[k];
        return j[k] = (x, S = false, T = false) => (n || y(), C.schedule(x, S, T)), j;
      }, {}),
      cancel: (j) => {
        for (let k = 0; k < eD.length; k++) s[eD[k]].cancel(j);
      },
      state: i,
      steps: s
    };
  }
  const { schedule: Fi, cancel: sh, state: pa, steps: eT } = Rue(typeof requestAnimationFrame < "u" ? requestAnimationFrame : $l, true);
  let rC;
  function OYe() {
    rC = void 0;
  }
  const ls = {
    now: () => (rC === void 0 && ls.set(pa.isProcessing || ah.useManualTiming ? pa.timestamp : performance.now()), rC),
    set: (t) => {
      rC = t, queueMicrotask(OYe);
    }
  }, Aue = (t) => (e) => typeof e == "string" && e.startsWith(t), Iue = Aue("--"), LYe = Aue("var(--"), dO = (t) => LYe(t) ? NYe.test(t.split("/*")[0].trim()) : false, NYe = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
  function lZ(t) {
    return typeof t != "string" ? false : t.split("/*")[0].includes("var(--");
  }
  const nv = {
    test: (t) => typeof t == "number",
    parse: parseFloat,
    transform: (t) => t
  }, kb = {
    ...nv,
    transform: (t) => Wd(0, 1, t)
  }, tD = {
    ...nv,
    default: 1
  }, u2 = (t) => Math.round(t * 1e5) / 1e5, uO = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
  function zYe(t) {
    return t == null;
  }
  const UYe = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, hO = (t, e) => (n) => !!(typeof n == "string" && UYe.test(n) && n.startsWith(t) || e && !zYe(n) && Object.prototype.hasOwnProperty.call(n, e)), Bue = (t, e, n) => (r) => {
    if (typeof r != "string") return r;
    const [i, a, s, l] = r.match(uO);
    return {
      [t]: parseFloat(i),
      [e]: parseFloat(a),
      [n]: parseFloat(s),
      alpha: l !== void 0 ? parseFloat(l) : 1
    };
  }, VYe = (t) => Wd(0, 255, t), tT = {
    ...nv,
    transform: (t) => Math.round(VYe(t))
  }, pg = {
    test: hO("rgb", "red"),
    parse: Bue("red", "green", "blue"),
    transform: ({ red: t, green: e, blue: n, alpha: r = 1 }) => "rgba(" + tT.transform(t) + ", " + tT.transform(e) + ", " + tT.transform(n) + ", " + u2(kb.transform(r)) + ")"
  };
  function HYe(t) {
    let e = "", n = "", r = "", i = "";
    return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), r = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), r = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, r += r, i += i), {
      red: parseInt(e, 16),
      green: parseInt(n, 16),
      blue: parseInt(r, 16),
      alpha: i ? parseInt(i, 16) / 255 : 1
    };
  }
  const n8 = {
    test: hO("#"),
    parse: HYe,
    transform: pg.transform
  }, k3 = (t) => ({
    test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
    parse: parseFloat,
    transform: (e) => `${e}${t}`
  }), ef = k3("deg"), Nd = k3("%"), In = k3("px"), $Ye = k3("vh"), WYe = k3("vw"), cZ = {
    ...Nd,
    parse: (t) => Nd.parse(t) / 100,
    transform: (t) => Nd.transform(t * 100)
  }, Z0 = {
    test: hO("hsl", "hue"),
    parse: Bue("hue", "saturation", "lightness"),
    transform: ({ hue: t, saturation: e, lightness: n, alpha: r = 1 }) => "hsla(" + Math.round(t) + ", " + Nd.transform(u2(e)) + ", " + Nd.transform(u2(n)) + ", " + u2(kb.transform(r)) + ")"
  }, jo = {
    test: (t) => pg.test(t) || n8.test(t) || Z0.test(t),
    parse: (t) => pg.test(t) ? pg.parse(t) : Z0.test(t) ? Z0.parse(t) : n8.parse(t),
    transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? pg.transform(t) : Z0.transform(t),
    getAnimatableNone: (t) => {
      const e = jo.parse(t);
      return e.alpha = 0, jo.transform(e);
    }
  }, qYe = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
  function KYe(t) {
    var _a6, _b3;
    return isNaN(t) && typeof t == "string" && (((_a6 = t.match(uO)) == null ? void 0 : _a6.length) || 0) + (((_b3 = t.match(qYe)) == null ? void 0 : _b3.length) || 0) > 0;
  }
  const Pue = "number", Mue = "color", GYe = "var", YYe = "var(", dZ = "${}", ZYe = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
  function pF(t) {
    const e = t.toString(), n = [], r = {
      color: [],
      number: [],
      var: []
    }, i = [];
    let a = 0;
    const l = e.replace(ZYe, (c) => (jo.test(c) ? (r.color.push(a), i.push(Mue), n.push(jo.parse(c))) : c.startsWith(YYe) ? (r.var.push(a), i.push(GYe), n.push(c)) : (r.number.push(a), i.push(Pue), n.push(parseFloat(c))), ++a, dZ)).split(dZ);
    return {
      values: n,
      split: l,
      indexes: r,
      types: i
    };
  }
  function JYe(t) {
    return pF(t).values;
  }
  function Oue({ split: t, types: e }) {
    const n = t.length;
    return (r) => {
      let i = "";
      for (let a = 0; a < n; a++) if (i += t[a], r[a] !== void 0) {
        const s = e[a];
        s === Pue ? i += u2(r[a]) : s === Mue ? i += jo.transform(r[a]) : i += r[a];
      }
      return i;
    };
  }
  function XYe(t) {
    return Oue(pF(t));
  }
  const QYe = (t) => typeof t == "number" ? 0 : jo.test(t) ? jo.getAnimatableNone(t) : t, eZe = (t, e) => typeof t == "number" ? (e == null ? void 0 : e.trim().endsWith("/")) ? t : 0 : QYe(t);
  function tZe(t) {
    const e = pF(t);
    return Oue(e)(e.values.map((r, i) => eZe(r, e.split[i])));
  }
  const Lc = {
    test: KYe,
    parse: JYe,
    createTransformer: XYe,
    getAnimatableNone: tZe
  };
  function nT(t, e, n) {
    return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
  }
  function nZe({ hue: t, saturation: e, lightness: n, alpha: r }) {
    t /= 360, e /= 100, n /= 100;
    let i = 0, a = 0, s = 0;
    if (!e) i = a = s = n;
    else {
      const l = n < 0.5 ? n * (1 + e) : n + e - n * e, c = 2 * n - l;
      i = nT(c, l, t + 1 / 3), a = nT(c, l, t), s = nT(c, l, t - 1 / 3);
    }
    return {
      red: Math.round(i * 255),
      green: Math.round(a * 255),
      blue: Math.round(s * 255),
      alpha: r
    };
  }
  function CE(t, e) {
    return (n) => n > 0 ? e : t;
  }
  const eo = (t, e, n) => t + (e - t) * n, rT = (t, e, n) => {
    const r = t * t, i = n * (e * e - r) + r;
    return i < 0 ? 0 : Math.sqrt(i);
  }, rZe = [
    n8,
    pg,
    Z0
  ], iZe = (t) => rZe.find((e) => e.test(t));
  function uZ(t) {
    const e = iZe(t);
    if (!e) return false;
    let n = e.parse(t);
    return e === Z0 && (n = nZe(n)), n;
  }
  const hZ = (t, e) => {
    const n = uZ(t), r = uZ(e);
    if (!n || !r) return CE(t, e);
    const i = {
      ...n
    };
    return (a) => (i.red = rT(n.red, r.red, a), i.green = rT(n.green, r.green, a), i.blue = rT(n.blue, r.blue, a), i.alpha = eo(n.alpha, r.alpha, a), pg.transform(i));
  }, r8 = /* @__PURE__ */ new Set([
    "none",
    "hidden"
  ]);
  function oZe(t, e) {
    return r8.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
  }
  function aZe(t, e) {
    return (n) => eo(t, e, n);
  }
  function fO(t) {
    return typeof t == "number" ? aZe : typeof t == "string" ? dO(t) ? CE : jo.test(t) ? hZ : cZe : Array.isArray(t) ? Lue : typeof t == "object" ? jo.test(t) ? hZ : sZe : CE;
  }
  function Lue(t, e) {
    const n = [
      ...t
    ], r = n.length, i = t.map((a, s) => fO(a)(a, e[s]));
    return (a) => {
      for (let s = 0; s < r; s++) n[s] = i[s](a);
      return n;
    };
  }
  function sZe(t, e) {
    const n = {
      ...t,
      ...e
    }, r = {};
    for (const i in n) t[i] !== void 0 && e[i] !== void 0 && (r[i] = fO(t[i])(t[i], e[i]));
    return (i) => {
      for (const a in r) n[a] = r[a](i);
      return n;
    };
  }
  function lZe(t, e) {
    const n = [], r = {
      color: 0,
      var: 0,
      number: 0
    };
    for (let i = 0; i < e.values.length; i++) {
      const a = e.types[i], s = t.indexes[a][r[a]], l = t.values[s] ?? 0;
      n[i] = l, r[a]++;
    }
    return n;
  }
  const cZe = (t, e) => {
    const n = Lc.createTransformer(e), r = pF(t), i = pF(e);
    return r.indexes.var.length === i.indexes.var.length && r.indexes.color.length === i.indexes.color.length && r.indexes.number.length >= i.indexes.number.length ? r8.has(t) && !i.values.length || r8.has(e) && !r.values.length ? oZe(t, e) : C3(Lue(lZe(r, i), i.values), n) : CE(t, e);
  };
  function Nue(t, e, n) {
    return typeof t == "number" && typeof e == "number" && typeof n == "number" ? eo(t, e, n) : fO(t)(t, e);
  }
  const dZe = (t) => {
    const e = ({ timestamp: n }) => t(n);
    return {
      start: (n = true) => Fi.update(e, n),
      stop: () => sh(e),
      now: () => pa.isProcessing ? pa.timestamp : ls.now()
    };
  }, zue = (t, e, n = 10) => {
    let r = "";
    const i = Math.max(Math.round(e / n), 2);
    for (let a = 0; a < i; a++) r += Math.round(t(a / (i - 1)) * 1e4) / 1e4 + ", ";
    return `linear(${r.substring(0, r.length - 2)})`;
  }, EE = 2e4;
  function mO(t) {
    let e = 0;
    const n = 50;
    let r = t.next(e);
    for (; !r.done && e < EE; ) e += n, r = t.next(e);
    return e >= EE ? 1 / 0 : e;
  }
  function uZe(t, e = 100, n) {
    const r = n({
      ...t,
      keyframes: [
        0,
        e
      ]
    }), i = Math.min(mO(r), EE);
    return {
      type: "keyframes",
      ease: (a) => r.next(i * a).value / e,
      duration: zl(i)
    };
  }
  const lo = {
    stiffness: 100,
    damping: 10,
    mass: 1,
    velocity: 0,
    duration: 800,
    bounce: 0.3,
    visualDuration: 0.3,
    restSpeed: {
      granular: 0.01,
      default: 2
    },
    restDelta: {
      granular: 5e-3,
      default: 0.5
    },
    minDuration: 0.01,
    maxDuration: 10,
    minDamping: 0.05,
    maxDamping: 1
  };
  function i8(t, e) {
    return t * Math.sqrt(1 - e * e);
  }
  const hZe = 12;
  function fZe(t, e, n) {
    let r = n;
    for (let i = 1; i < hZe; i++) r = r - t(r) / e(r);
    return r;
  }
  const iT = 1e-3;
  function mZe({ duration: t = lo.duration, bounce: e = lo.bounce, velocity: n = lo.velocity, mass: r = lo.mass }) {
    let i, a, s = 1 - e;
    s = Wd(lo.minDamping, lo.maxDamping, s), t = Wd(lo.minDuration, lo.maxDuration, zl(t)), s < 1 ? (i = (d) => {
      const u = d * s, h = u * t, f = u - n, g = i8(d, s), m = Math.exp(-h);
      return iT - f / g * m;
    }, a = (d) => {
      const h = d * s * t, f = h * n + n, g = Math.pow(s, 2) * Math.pow(d, 2) * t, m = Math.exp(-h), v = i8(Math.pow(d, 2), s);
      return (-i(d) + iT > 0 ? -1 : 1) * ((f - g) * m) / v;
    }) : (i = (d) => {
      const u = Math.exp(-d * t), h = (d - n) * t + 1;
      return -iT + u * h;
    }, a = (d) => {
      const u = Math.exp(-d * t), h = (n - d) * (t * t);
      return u * h;
    });
    const l = 5 / t, c = fZe(i, a, l);
    if (t = dl(t), isNaN(c)) return {
      stiffness: lo.stiffness,
      damping: lo.damping,
      duration: t
    };
    {
      const d = Math.pow(c, 2) * r;
      return {
        stiffness: d,
        damping: s * 2 * Math.sqrt(r * d),
        duration: t
      };
    }
  }
  const gZe = [
    "duration",
    "bounce"
  ], pZe = [
    "stiffness",
    "damping",
    "mass"
  ];
  function fZ(t, e) {
    return e.some((n) => t[n] !== void 0);
  }
  function FZe(t) {
    let e = {
      velocity: lo.velocity,
      stiffness: lo.stiffness,
      damping: lo.damping,
      mass: lo.mass,
      isResolvedFromDuration: false,
      ...t
    };
    if (!fZ(t, pZe) && fZ(t, gZe)) if (e.velocity = 0, t.visualDuration) {
      const n = t.visualDuration, r = 2 * Math.PI / (n * 1.2), i = r * r, a = 2 * Wd(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
      e = {
        ...e,
        mass: lo.mass,
        stiffness: i,
        damping: a
      };
    } else {
      const n = mZe({
        ...t,
        velocity: 0
      });
      e = {
        ...e,
        ...n,
        mass: lo.mass
      }, e.isResolvedFromDuration = true;
    }
    return e;
  }
  function kE(t = lo.visualDuration, e = lo.bounce) {
    const n = typeof t != "object" ? {
      visualDuration: t,
      keyframes: [
        0,
        1
      ],
      bounce: e
    } : t;
    let { restSpeed: r, restDelta: i } = n;
    const a = n.keyframes[0], s = n.keyframes[n.keyframes.length - 1], l = {
      done: false,
      value: a
    }, { stiffness: c, damping: d, mass: u, duration: h, velocity: f, isResolvedFromDuration: g } = FZe({
      ...n,
      velocity: -zl(n.velocity || 0)
    }), m = f || 0, v = d / (2 * Math.sqrt(c * u)), y = s - a, w = zl(Math.sqrt(c / u)), b = Math.abs(y) < 5;
    r || (r = b ? lo.restSpeed.granular : lo.restSpeed.default), i || (i = b ? lo.restDelta.granular : lo.restDelta.default);
    let j, k, C, x, S, T;
    if (v < 1) C = i8(w, v), x = (m + v * w * y) / C, j = (B) => {
      const U = Math.exp(-v * w * B);
      return s - U * (x * Math.sin(C * B) + y * Math.cos(C * B));
    }, S = v * w * x + y * C, T = v * w * y - x * C, k = (B) => Math.exp(-v * w * B) * (S * Math.sin(C * B) + T * Math.cos(C * B));
    else if (v === 1) {
      j = (U) => s - Math.exp(-w * U) * (y + (m + w * y) * U);
      const B = m + w * y;
      k = (U) => Math.exp(-w * U) * (w * B * U - m);
    } else {
      const B = w * Math.sqrt(v * v - 1);
      j = (M) => {
        const I = Math.exp(-v * w * M), N = Math.min(B * M, 300);
        return s - I * ((m + v * w * y) * Math.sinh(N) + B * y * Math.cosh(N)) / B;
      };
      const U = (m + v * w * y) / B, z = v * w * U - y * B, O = v * w * y - U * B;
      k = (M) => {
        const I = Math.exp(-v * w * M), N = Math.min(B * M, 300);
        return I * (z * Math.sinh(N) + O * Math.cosh(N));
      };
    }
    const A = {
      calculatedDuration: g && h || null,
      velocity: (B) => dl(k(B)),
      next: (B) => {
        if (!g && v < 1) {
          const z = Math.exp(-v * w * B), O = Math.sin(C * B), M = Math.cos(C * B), I = s - z * (x * O + y * M), N = dl(z * (S * O + T * M));
          return l.done = Math.abs(N) <= r && Math.abs(s - I) <= i, l.value = l.done ? s : I, l;
        }
        const U = j(B);
        if (g) l.done = B >= h;
        else {
          const z = dl(k(B));
          l.done = Math.abs(z) <= r && Math.abs(s - U) <= i;
        }
        return l.value = l.done ? s : U, l;
      },
      toString: () => {
        const B = Math.min(mO(A), EE), U = zue((z) => A.next(B * z).value, B, 30);
        return B + "ms " + U;
      },
      toTransition: () => {
      }
    };
    return A;
  }
  kE.applyToOptions = (t) => {
    const e = uZe(t, 100, kE);
    return t.ease = e.ease, t.duration = dl(e.duration), t.type = "keyframes", t;
  };
  const vZe = 5;
  function Uue(t, e, n) {
    const r = Math.max(e - vZe, 0);
    return yue(n - t(r), e - r);
  }
  function o8({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: r = 325, bounceDamping: i = 10, bounceStiffness: a = 500, modifyTarget: s, min: l, max: c, restDelta: d = 0.5, restSpeed: u }) {
    const h = t[0], f = {
      done: false,
      value: h
    }, g = (T) => l !== void 0 && T < l || c !== void 0 && T > c, m = (T) => l === void 0 ? c : c === void 0 || Math.abs(l - T) < Math.abs(c - T) ? l : c;
    let v = n * e;
    const y = h + v, w = s === void 0 ? y : s(y);
    w !== y && (v = w - h);
    const b = (T) => -v * Math.exp(-T / r), j = (T) => w + b(T), k = (T) => {
      const A = b(T), B = j(T);
      f.done = Math.abs(A) <= d, f.value = f.done ? w : B;
    };
    let C, x;
    const S = (T) => {
      g(f.value) && (C = T, x = kE({
        keyframes: [
          f.value,
          m(f.value)
        ],
        velocity: Uue(j, T, f.value),
        damping: i,
        stiffness: a,
        restDelta: d,
        restSpeed: u
      }));
    };
    return S(0), {
      calculatedDuration: null,
      next: (T) => {
        let A = false;
        return !x && C === void 0 && (A = true, k(T), S(T)), C !== void 0 && T >= C ? x.next(T - C) : (!A && k(T), f);
      }
    };
  }
  function _Ze(t, e, n) {
    const r = [], i = n || ah.mix || Nue, a = t.length - 1;
    for (let s = 0; s < a; s++) {
      let l = i(t[s], t[s + 1]);
      if (e) {
        const c = Array.isArray(e) ? e[s] || $l : e;
        l = C3(c, l);
      }
      r.push(l);
    }
    return r;
  }
  function Vue(t, e, { clamp: n = true, ease: r, mixer: i } = {}) {
    const a = t.length;
    if (aO(a === e.length), a === 1) return () => e[0];
    if (a === 2 && e[0] === e[1]) return () => e[1];
    const s = t[0] === t[1];
    t[0] > t[a - 1] && (t = [
      ...t
    ].reverse(), e = [
      ...e
    ].reverse());
    const l = _Ze(e, r, i), c = l.length, d = (u) => {
      if (s && u < t[0]) return e[0];
      let h = 0;
      if (c > 1) for (; h < t.length - 2 && !(u < t[h + 1]); h++) ;
      const f = Eb(t[h], t[h + 1], u);
      return l[h](f);
    };
    return n ? (u) => d(Wd(t[0], t[a - 1], u)) : d;
  }
  function yZe(t, e) {
    const n = t[t.length - 1];
    for (let r = 1; r <= e; r++) {
      const i = Eb(0, e, r);
      t.push(eo(n, 1, i));
    }
  }
  function bZe(t) {
    const e = [
      0
    ];
    return yZe(e, t.length - 1), e;
  }
  function xZe(t, e) {
    return t.map((n) => n * e);
  }
  function wZe(t, e) {
    return t.map(() => e || jue).splice(0, t.length - 1);
  }
  function h2({ duration: t = 300, keyframes: e, times: n, ease: r = "easeInOut" }) {
    const i = AYe(r) ? r.map(sZ) : sZ(r), a = {
      done: false,
      value: e[0]
    }, s = xZe(n && n.length === e.length ? n : bZe(e), t), l = Vue(s, e, {
      ease: Array.isArray(i) ? i : wZe(e, i)
    });
    return {
      calculatedDuration: t,
      next: (c) => (a.value = l(c), a.done = c >= t, a)
    };
  }
  const DZe = (t) => t !== null;
  function gO(t, { repeat: e, repeatType: n = "loop" }, r, i = 1) {
    const a = t.filter(DZe), l = i < 0 || e && n !== "loop" && e % 2 === 1 ? 0 : a.length - 1;
    return !l || r === void 0 ? a[l] : r;
  }
  const CZe = {
    decay: o8,
    inertia: o8,
    tween: h2,
    keyframes: h2,
    spring: kE
  };
  function Hue(t) {
    typeof t.type == "string" && (t.type = CZe[t.type]);
  }
  class pO {
    constructor() {
      this.updateFinished();
    }
    get finished() {
      return this._finished;
    }
    updateFinished() {
      this._finished = new Promise((e) => {
        this.resolve = e;
      });
    }
    notifyFinished() {
      this.resolve();
    }
    then(e, n) {
      return this.finished.then(e, n);
    }
  }
  const EZe = (t) => t / 100;
  class DS extends pO {
    constructor(e) {
      super(), this.state = "idle", this.startTime = null, this.isStopped = false, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
        var _a6, _b3;
        const { motionValue: n } = this.options;
        n && n.updatedAt !== ls.now() && this.tick(ls.now()), this.isStopped = true, this.state !== "idle" && (this.teardown(), (_b3 = (_a6 = this.options).onStop) == null ? void 0 : _b3.call(_a6));
      }, this.options = e, this.initAnimation(), this.play(), e.autoplay === false && this.pause();
    }
    initAnimation() {
      const { options: e } = this;
      Hue(e);
      const { type: n = h2, repeat: r = 0, repeatDelay: i = 0, repeatType: a, velocity: s = 0 } = e;
      let { keyframes: l } = e;
      const c = n || h2;
      c !== h2 && typeof l[0] != "number" && (this.mixKeyframes = C3(EZe, Nue(l[0], l[1])), l = [
        0,
        100
      ]);
      const d = c({
        ...e,
        keyframes: l
      });
      a === "mirror" && (this.mirroredGenerator = c({
        ...e,
        keyframes: [
          ...l
        ].reverse(),
        velocity: -s
      })), d.calculatedDuration === null && (d.calculatedDuration = mO(d));
      const { calculatedDuration: u } = d;
      this.calculatedDuration = u, this.resolvedDuration = u + i, this.totalDuration = this.resolvedDuration * (r + 1) - i, this.generator = d;
    }
    updateTime(e) {
      const n = Math.round(e - this.startTime) * this.playbackSpeed;
      this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = n;
    }
    tick(e, n = false) {
      const { generator: r, totalDuration: i, mixKeyframes: a, mirroredGenerator: s, resolvedDuration: l, calculatedDuration: c } = this;
      if (this.startTime === null) return r.next(0);
      const { delay: d = 0, keyframes: u, repeat: h, repeatType: f, repeatDelay: g, type: m, onUpdate: v, finalKeyframe: y } = this.options;
      this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - i / this.speed, this.startTime)), n ? this.currentTime = e : this.updateTime(e);
      const w = this.currentTime - d * (this.playbackSpeed >= 0 ? 1 : -1), b = this.playbackSpeed >= 0 ? w < 0 : w > i;
      this.currentTime = Math.max(w, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
      let j = this.currentTime, k = r;
      if (h) {
        const T = Math.min(this.currentTime, i) / l;
        let A = Math.floor(T), B = T % 1;
        !B && T >= 1 && (B = 1), B === 1 && A--, A = Math.min(A, h + 1), A % 2 && (f === "reverse" ? (B = 1 - B, g && (B -= g / l)) : f === "mirror" && (k = s)), j = Wd(0, 1, B) * l;
      }
      const C = b ? {
        done: false,
        value: u[0]
      } : k.next(j);
      a && !b && (C.value = a(C.value));
      let { done: x } = C;
      !b && c !== null && (x = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
      const S = this.holdTime === null && (this.state === "finished" || this.state === "running" && x);
      return S && m !== o8 && (C.value = gO(u, this.options, y, this.speed)), v && v(C.value), S && this.finish(), C;
    }
    then(e, n) {
      return this.finished.then(e, n);
    }
    get duration() {
      return zl(this.calculatedDuration);
    }
    get iterationDuration() {
      const { delay: e = 0 } = this.options || {};
      return this.duration + zl(e);
    }
    get time() {
      return zl(this.currentTime);
    }
    set time(e) {
      e = dl(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver ? this.driver.start(false) : (this.startTime = 0, this.state = "paused", this.holdTime = e, this.tick(e));
    }
    getGeneratorVelocity() {
      const e = this.currentTime;
      if (e <= 0) return this.options.velocity || 0;
      if (this.generator.velocity) return this.generator.velocity(e);
      const n = this.generator.next(e).value;
      return Uue((r) => this.generator.next(r).value, e, n);
    }
    get speed() {
      return this.playbackSpeed;
    }
    set speed(e) {
      const n = this.playbackSpeed !== e;
      n && this.driver && this.updateTime(ls.now()), this.playbackSpeed = e, n && this.driver && (this.time = zl(this.currentTime));
    }
    play() {
      var _a6, _b3;
      if (this.isStopped) return;
      const { driver: e = dZe, startTime: n } = this.options;
      this.driver || (this.driver = e((i) => this.tick(i))), (_b3 = (_a6 = this.options).onPlay) == null ? void 0 : _b3.call(_a6);
      const r = this.driver.now();
      this.state === "finished" ? (this.updateFinished(), this.startTime = r) : this.holdTime !== null ? this.startTime = r - this.holdTime : this.startTime || (this.startTime = n ?? r), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
    }
    pause() {
      this.state = "paused", this.updateTime(ls.now()), this.holdTime = this.currentTime;
    }
    complete() {
      this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
    }
    finish() {
      var _a6, _b3;
      this.notifyFinished(), this.teardown(), this.state = "finished", (_b3 = (_a6 = this.options).onComplete) == null ? void 0 : _b3.call(_a6);
    }
    cancel() {
      var _a6, _b3;
      this.holdTime = null, this.startTime = 0, this.tick(0), this.teardown(), (_b3 = (_a6 = this.options).onCancel) == null ? void 0 : _b3.call(_a6);
    }
    teardown() {
      this.state = "idle", this.stopDriver(), this.startTime = this.holdTime = null;
    }
    stopDriver() {
      this.driver && (this.driver.stop(), this.driver = void 0);
    }
    sample(e) {
      return this.startTime = 0, this.tick(e, true);
    }
    attachTimeline(e) {
      var _a6;
      return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), (_a6 = this.driver) == null ? void 0 : _a6.stop(), e.observe(this);
    }
  }
  function kZe(t) {
    for (let e = 1; e < t.length; e++) t[e] ?? (t[e] = t[e - 1]);
  }
  const Fg = (t) => t * 180 / Math.PI, a8 = (t) => {
    const e = Fg(Math.atan2(t[1], t[0]));
    return s8(e);
  }, SZe = {
    x: 4,
    y: 5,
    translateX: 4,
    translateY: 5,
    scaleX: 0,
    scaleY: 3,
    scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
    rotate: a8,
    rotateZ: a8,
    skewX: (t) => Fg(Math.atan(t[1])),
    skewY: (t) => Fg(Math.atan(t[2])),
    skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
  }, s8 = (t) => (t = t % 360, t < 0 && (t += 360), t), mZ = a8, gZ = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), pZ = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), jZe = {
    x: 12,
    y: 13,
    z: 14,
    translateX: 12,
    translateY: 13,
    translateZ: 14,
    scaleX: gZ,
    scaleY: pZ,
    scale: (t) => (gZ(t) + pZ(t)) / 2,
    rotateX: (t) => s8(Fg(Math.atan2(t[6], t[5]))),
    rotateY: (t) => s8(Fg(Math.atan2(-t[2], t[0]))),
    rotateZ: mZ,
    rotate: mZ,
    skewX: (t) => Fg(Math.atan(t[4])),
    skewY: (t) => Fg(Math.atan(t[1])),
    skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
  };
  function l8(t) {
    return t.includes("scale") ? 1 : 0;
  }
  function c8(t, e) {
    if (!t || t === "none") return l8(e);
    const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
    let r, i;
    if (n) r = jZe, i = n;
    else {
      const l = t.match(/^matrix\(([-\d.e\s,]+)\)$/u);
      r = SZe, i = l;
    }
    if (!i) return l8(e);
    const a = r[e], s = i[1].split(",").map(RZe);
    return typeof a == "function" ? a(s) : s[a];
  }
  const TZe = (t, e) => {
    const { transform: n = "none" } = getComputedStyle(t);
    return c8(n, e);
  };
  function RZe(t) {
    return parseFloat(t.trim());
  }
  const rv = [
    "transformPerspective",
    "x",
    "y",
    "z",
    "translateX",
    "translateY",
    "translateZ",
    "scale",
    "scaleX",
    "scaleY",
    "rotate",
    "rotateX",
    "rotateY",
    "rotateZ",
    "skew",
    "skewX",
    "skewY"
  ], iv = new Set(rv), FZ = (t) => t === nv || t === In, AZe = /* @__PURE__ */ new Set([
    "x",
    "y",
    "z"
  ]), IZe = rv.filter((t) => !AZe.has(t));
  function BZe(t) {
    const e = [];
    return IZe.forEach((n) => {
      const r = t.getValue(n);
      r !== void 0 && (e.push([
        n,
        r.get()
      ]), r.set(n.startsWith("scale") ? 1 : 0));
    }), e;
  }
  const Cf = {
    width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
    height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
    top: (t, { top: e }) => parseFloat(e),
    left: (t, { left: e }) => parseFloat(e),
    bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
    right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
    x: (t, { transform: e }) => c8(e, "x"),
    y: (t, { transform: e }) => c8(e, "y")
  };
  Cf.translateX = Cf.x;
  Cf.translateY = Cf.y;
  const Pg = /* @__PURE__ */ new Set();
  let d8 = false, u8 = false, h8 = false;
  function $ue() {
    if (u8) {
      const t = Array.from(Pg).filter((r) => r.needsMeasurement), e = new Set(t.map((r) => r.element)), n = /* @__PURE__ */ new Map();
      e.forEach((r) => {
        const i = BZe(r);
        i.length && (n.set(r, i), r.render());
      }), t.forEach((r) => r.measureInitialState()), e.forEach((r) => {
        r.render();
        const i = n.get(r);
        i && i.forEach(([a, s]) => {
          var _a6;
          (_a6 = r.getValue(a)) == null ? void 0 : _a6.set(s);
        });
      }), t.forEach((r) => r.measureEndState()), t.forEach((r) => {
        r.suspendedScrollY !== void 0 && window.scrollTo(0, r.suspendedScrollY);
      });
    }
    u8 = false, d8 = false, Pg.forEach((t) => t.complete(h8)), Pg.clear();
  }
  function Wue() {
    Pg.forEach((t) => {
      t.readKeyframes(), t.needsMeasurement && (u8 = true);
    });
  }
  function PZe() {
    h8 = true, Wue(), $ue(), h8 = false;
  }
  class FO {
    constructor(e, n, r, i, a, s = false) {
      this.state = "pending", this.isAsync = false, this.needsMeasurement = false, this.unresolvedKeyframes = [
        ...e
      ], this.onComplete = n, this.name = r, this.motionValue = i, this.element = a, this.isAsync = s;
    }
    scheduleResolve() {
      this.state = "scheduled", this.isAsync ? (Pg.add(this), d8 || (d8 = true, Fi.read(Wue), Fi.resolveKeyframes($ue))) : (this.readKeyframes(), this.complete());
    }
    readKeyframes() {
      const { unresolvedKeyframes: e, name: n, element: r, motionValue: i } = this;
      if (e[0] === null) {
        const a = i == null ? void 0 : i.get(), s = e[e.length - 1];
        if (a !== void 0) e[0] = a;
        else if (r && n) {
          const l = r.readValue(n, s);
          l != null && (e[0] = l);
        }
        e[0] === void 0 && (e[0] = s), i && a === void 0 && i.set(e[0]);
      }
      kZe(e);
    }
    setFinalKeyframe() {
    }
    measureInitialState() {
    }
    renderEndStyles() {
    }
    measureEndState() {
    }
    complete(e = false) {
      this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), Pg.delete(this);
    }
    cancel() {
      this.state === "scheduled" && (Pg.delete(this), this.state = "pending");
    }
    resume() {
      this.state === "pending" && this.scheduleResolve();
    }
  }
  const MZe = (t) => t.startsWith("--");
  function que(t, e, n) {
    MZe(e) ? t.style.setProperty(e, n) : t.style[e] = n;
  }
  const OZe = {};
  function Kue(t, e) {
    const n = _ue(t);
    return () => OZe[e] ?? n();
  }
  const LZe = Kue(() => window.ScrollTimeline !== void 0, "scrollTimeline"), Gue = Kue(() => {
    try {
      document.createElement("div").animate({
        opacity: 0
      }, {
        easing: "linear(0, 1)"
      });
    } catch {
      return false;
    }
    return true;
  }, "linearEasing"), Dy = ([t, e, n, r]) => `cubic-bezier(${t}, ${e}, ${n}, ${r})`, vZ = {
    linear: "linear",
    ease: "ease",
    easeIn: "ease-in",
    easeOut: "ease-out",
    easeInOut: "ease-in-out",
    circIn: Dy([
      0,
      0.65,
      0.55,
      1
    ]),
    circOut: Dy([
      0.55,
      0,
      1,
      0.45
    ]),
    backIn: Dy([
      0.31,
      0.01,
      0.66,
      -0.59
    ]),
    backOut: Dy([
      0.33,
      1.53,
      0.69,
      0.99
    ])
  };
  function Yue(t, e) {
    if (t) return typeof t == "function" ? Gue() ? zue(t, e) : "ease-out" : Tue(t) ? Dy(t) : Array.isArray(t) ? t.map((n) => Yue(n, e) || vZ.easeOut) : vZ[t];
  }
  function NZe(t, e, n, { delay: r = 0, duration: i = 300, repeat: a = 0, repeatType: s = "loop", ease: l = "easeOut", times: c } = {}, d = void 0) {
    const u = {
      [e]: n
    };
    c && (u.offset = c);
    const h = Yue(l, i);
    Array.isArray(h) && (u.easing = h);
    const f = {
      delay: r,
      duration: i,
      easing: Array.isArray(h) ? "linear" : h,
      fill: "both",
      iterations: a + 1,
      direction: s === "reverse" ? "alternate" : "normal"
    };
    return d && (f.pseudoElement = d), t.animate(u, f);
  }
  function Zue(t) {
    return typeof t == "function" && "applyToOptions" in t;
  }
  function zZe({ type: t, ...e }) {
    return Zue(t) && Gue() ? t.applyToOptions(e) : (e.duration ?? (e.duration = 300), e.ease ?? (e.ease = "easeOut"), e);
  }
  class Jue extends pO {
    constructor(e) {
      if (super(), this.finishedTime = null, this.isStopped = false, this.manualStartTime = null, !e) return;
      const { element: n, name: r, keyframes: i, pseudoElement: a, allowFlatten: s = false, finalKeyframe: l, onComplete: c } = e;
      this.isPseudoElement = !!a, this.allowFlatten = s, this.options = e, aO(typeof e.type != "string");
      const d = zZe(e);
      this.animation = NZe(n, r, i, d, a), d.autoplay === false && this.animation.pause(), this.animation.onfinish = () => {
        if (this.finishedTime = this.time, !a) {
          const u = gO(i, this.options, l, this.speed);
          this.updateMotionValue && this.updateMotionValue(u), que(n, r, u), this.animation.cancel();
        }
        c == null ? void 0 : c(), this.notifyFinished();
      };
    }
    play() {
      this.isStopped || (this.manualStartTime = null, this.animation.play(), this.state === "finished" && this.updateFinished());
    }
    pause() {
      this.animation.pause();
    }
    complete() {
      var _a6, _b3;
      (_b3 = (_a6 = this.animation).finish) == null ? void 0 : _b3.call(_a6);
    }
    cancel() {
      try {
        this.animation.cancel();
      } catch {
      }
    }
    stop() {
      if (this.isStopped) return;
      this.isStopped = true;
      const { state: e } = this;
      e === "idle" || e === "finished" || (this.updateMotionValue ? this.updateMotionValue() : this.commitStyles(), this.isPseudoElement || this.cancel());
    }
    commitStyles() {
      var _a6, _b3, _c3;
      const e = (_a6 = this.options) == null ? void 0 : _a6.element;
      !this.isPseudoElement && (e == null ? void 0 : e.isConnected) && ((_c3 = (_b3 = this.animation).commitStyles) == null ? void 0 : _c3.call(_b3));
    }
    get duration() {
      var _a6, _b3;
      const e = ((_b3 = (_a6 = this.animation.effect) == null ? void 0 : _a6.getComputedTiming) == null ? void 0 : _b3.call(_a6).duration) || 0;
      return zl(Number(e));
    }
    get iterationDuration() {
      const { delay: e = 0 } = this.options || {};
      return this.duration + zl(e);
    }
    get time() {
      return zl(Number(this.animation.currentTime) || 0);
    }
    set time(e) {
      const n = this.finishedTime !== null;
      this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = dl(e), n && this.animation.pause();
    }
    get speed() {
      return this.animation.playbackRate;
    }
    set speed(e) {
      e < 0 && (this.finishedTime = null), this.animation.playbackRate = e;
    }
    get state() {
      return this.finishedTime !== null ? "finished" : this.animation.playState;
    }
    get startTime() {
      return this.manualStartTime ?? Number(this.animation.startTime);
    }
    set startTime(e) {
      this.manualStartTime = this.animation.startTime = e;
    }
    attachTimeline({ timeline: e, rangeStart: n, rangeEnd: r, observe: i }) {
      var _a6;
      return this.allowFlatten && ((_a6 = this.animation.effect) == null ? void 0 : _a6.updateTiming({
        easing: "linear"
      })), this.animation.onfinish = null, e && LZe() ? (this.animation.timeline = e, n && (this.animation.rangeStart = n), r && (this.animation.rangeEnd = r), $l) : i(this);
    }
  }
  const Xue = {
    anticipate: Eue,
    backInOut: Cue,
    circInOut: Sue
  };
  function UZe(t) {
    return t in Xue;
  }
  function VZe(t) {
    typeof t.ease == "string" && UZe(t.ease) && (t.ease = Xue[t.ease]);
  }
  const oT = 10;
  class HZe extends Jue {
    constructor(e) {
      VZe(e), Hue(e), super(e), e.startTime !== void 0 && e.autoplay !== false && (this.startTime = e.startTime), this.options = e;
    }
    updateMotionValue(e) {
      const { motionValue: n, onUpdate: r, onComplete: i, element: a, ...s } = this.options;
      if (!n) return;
      if (e !== void 0) {
        n.set(e);
        return;
      }
      const l = new DS({
        ...s,
        autoplay: false
      }), c = Math.max(oT, ls.now() - this.startTime), d = Wd(0, oT, c - oT), u = l.sample(c).value, { name: h } = this.options;
      a && h && que(a, h, u), n.setWithVelocity(l.sample(Math.max(0, c - d)).value, u, d), l.stop();
    }
  }
  const _Z = (t, e) => e === "zIndex" ? false : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && (Lc.test(t) || t === "0") && !t.startsWith("url("));
  function $Ze(t) {
    const e = t[0];
    if (t.length === 1) return true;
    for (let n = 0; n < t.length; n++) if (t[n] !== e) return true;
  }
  function WZe(t, e, n, r) {
    const i = t[0];
    if (i === null) return false;
    if (e === "display" || e === "visibility") return true;
    const a = t[t.length - 1], s = _Z(i, e), l = _Z(a, e);
    return !s || !l ? false : $Ze(t) || (n === "spring" || Zue(n)) && r;
  }
  function f8(t) {
    t.duration = 0, t.type = "keyframes";
  }
  const qZe = /* @__PURE__ */ new Set([
    "opacity",
    "clipPath",
    "filter",
    "transform"
  ]), KZe = _ue(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
  function GZe(t) {
    var _a6;
    const { motionValue: e, name: n, repeatDelay: r, repeatType: i, damping: a, type: s } = t;
    if (!(((_a6 = e == null ? void 0 : e.owner) == null ? void 0 : _a6.current) instanceof HTMLElement)) return false;
    const { onUpdate: c, transformTemplate: d } = e.owner.getProps();
    return KZe() && n && qZe.has(n) && (n !== "transform" || !d) && !c && !r && i !== "mirror" && a !== 0 && s !== "inertia";
  }
  const YZe = 40;
  class ZZe extends pO {
    constructor({ autoplay: e = true, delay: n = 0, type: r = "keyframes", repeat: i = 0, repeatDelay: a = 0, repeatType: s = "loop", keyframes: l, name: c, motionValue: d, element: u, ...h }) {
      var _a6;
      super(), this.stop = () => {
        var _a7, _b3;
        this._animation && (this._animation.stop(), (_a7 = this.stopTimeline) == null ? void 0 : _a7.call(this)), (_b3 = this.keyframeResolver) == null ? void 0 : _b3.cancel();
      }, this.createdAt = ls.now();
      const f = {
        autoplay: e,
        delay: n,
        type: r,
        repeat: i,
        repeatDelay: a,
        repeatType: s,
        name: c,
        motionValue: d,
        element: u,
        ...h
      }, g = (u == null ? void 0 : u.KeyframeResolver) || FO;
      this.keyframeResolver = new g(l, (m, v, y) => this.onKeyframesResolved(m, v, f, !y), c, d, u), (_a6 = this.keyframeResolver) == null ? void 0 : _a6.scheduleResolve();
    }
    onKeyframesResolved(e, n, r, i) {
      var _a6, _b3;
      this.keyframeResolver = void 0;
      const { name: a, type: s, velocity: l, delay: c, isHandoff: d, onUpdate: u } = r;
      this.resolvedAt = ls.now(), WZe(e, a, s, l) || ((ah.instantAnimations || !c) && (u == null ? void 0 : u(gO(e, r, n))), e[0] = e[e.length - 1], f8(r), r.repeat = 0);
      const f = {
        startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > YZe ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
        finalKeyframe: n,
        ...r,
        keyframes: e
      }, g = !d && GZe(f), m = (_b3 = (_a6 = f.motionValue) == null ? void 0 : _a6.owner) == null ? void 0 : _b3.current, v = g ? new HZe({
        ...f,
        element: m
      }) : new DS(f);
      v.finished.then(() => {
        this.notifyFinished();
      }).catch($l), this.pendingTimeline && (this.stopTimeline = v.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = v;
    }
    get finished() {
      return this._animation ? this.animation.finished : this._finished;
    }
    then(e, n) {
      return this.finished.finally(e).then(() => {
      });
    }
    get animation() {
      var _a6;
      return this._animation || ((_a6 = this.keyframeResolver) == null ? void 0 : _a6.resume(), PZe()), this._animation;
    }
    get duration() {
      return this.animation.duration;
    }
    get iterationDuration() {
      return this.animation.iterationDuration;
    }
    get time() {
      return this.animation.time;
    }
    set time(e) {
      this.animation.time = e;
    }
    get speed() {
      return this.animation.speed;
    }
    get state() {
      return this.animation.state;
    }
    set speed(e) {
      this.animation.speed = e;
    }
    get startTime() {
      return this.animation.startTime;
    }
    attachTimeline(e) {
      return this._animation ? this.stopTimeline = this.animation.attachTimeline(e) : this.pendingTimeline = e, () => this.stop();
    }
    play() {
      this.animation.play();
    }
    pause() {
      this.animation.pause();
    }
    complete() {
      this.animation.complete();
    }
    cancel() {
      var _a6;
      this._animation && this.animation.cancel(), (_a6 = this.keyframeResolver) == null ? void 0 : _a6.cancel();
    }
  }
  function Que(t, e, n, r = 0, i = 1) {
    const a = Array.from(t).sort((d, u) => d.sortNodePosition(u)).indexOf(e), s = t.size, l = (s - 1) * r;
    return typeof n == "function" ? n(a, s) : i === 1 ? a * r : l - a * r;
  }
  const JZe = /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;
  function XZe(t) {
    const e = JZe.exec(t);
    if (!e) return [
      ,
    ];
    const [, n, r, i] = e;
    return [
      `--${n ?? r}`,
      i
    ];
  }
  function ehe(t, e, n = 1) {
    const [r, i] = XZe(t);
    if (!r) return;
    const a = window.getComputedStyle(e).getPropertyValue(r);
    if (a) {
      const s = a.trim();
      return pue(s) ? parseFloat(s) : s;
    }
    return dO(i) ? ehe(i, e, n + 1) : i;
  }
  const QZe = {
    type: "spring",
    stiffness: 500,
    damping: 25,
    restSpeed: 10
  }, eJe = (t) => ({
    type: "spring",
    stiffness: 550,
    damping: t === 0 ? 2 * Math.sqrt(550) : 30,
    restSpeed: 10
  }), tJe = {
    type: "keyframes",
    duration: 0.8
  }, nJe = {
    type: "keyframes",
    ease: [
      0.25,
      0.1,
      0.35,
      1
    ],
    duration: 0.3
  }, rJe = (t, { keyframes: e }) => e.length > 2 ? tJe : iv.has(t) ? t.startsWith("scale") ? eJe(e[1]) : QZe : nJe, iJe = (t) => t !== null;
  function oJe(t, { repeat: e, repeatType: n = "loop" }, r) {
    const i = t.filter(iJe), a = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
    return i[a];
  }
  function the(t, e) {
    if ((t == null ? void 0 : t.inherit) && e) {
      const { inherit: n, ...r } = t;
      return {
        ...e,
        ...r
      };
    }
    return t;
  }
  function vO(t, e) {
    const n = (t == null ? void 0 : t[e]) ?? (t == null ? void 0 : t.default) ?? t;
    return n !== t ? the(n, t) : n;
  }
  function aJe({ when: t, delay: e, delayChildren: n, staggerChildren: r, staggerDirection: i, repeat: a, repeatType: s, repeatDelay: l, from: c, elapsed: d, ...u }) {
    return !!Object.keys(u).length;
  }
  const _O = (t, e, n, r = {}, i, a) => (s) => {
    const l = vO(r, t) || {}, c = l.delay || r.delay || 0;
    let { elapsed: d = 0 } = r;
    d = d - dl(c);
    const u = {
      keyframes: Array.isArray(n) ? n : [
        null,
        n
      ],
      ease: "easeOut",
      velocity: e.getVelocity(),
      ...l,
      delay: -d,
      onUpdate: (f) => {
        e.set(f), l.onUpdate && l.onUpdate(f);
      },
      onComplete: () => {
        s(), l.onComplete && l.onComplete();
      },
      name: t,
      motionValue: e,
      element: a ? void 0 : i
    };
    aJe(l) || Object.assign(u, rJe(t, u)), u.duration && (u.duration = dl(u.duration)), u.repeatDelay && (u.repeatDelay = dl(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
    let h = false;
    if ((u.type === false || u.duration === 0 && !u.repeatDelay) && (f8(u), u.delay === 0 && (h = true)), (ah.instantAnimations || ah.skipAnimations || (i == null ? void 0 : i.shouldSkipAnimations)) && (h = true, f8(u), u.delay = 0), u.allowFlatten = !l.type && !l.ease, h && !a && e.get() !== void 0) {
      const f = oJe(u.keyframes, l);
      if (f !== void 0) {
        Fi.update(() => {
          u.onUpdate(f), u.onComplete();
        });
        return;
      }
    }
    return l.isSync ? new DS(u) : new ZZe(u);
  };
  function yZ(t) {
    const e = [
      {},
      {}
    ];
    return t == null ? void 0 : t.values.forEach((n, r) => {
      e[0][r] = n.get(), e[1][r] = n.getVelocity();
    }), e;
  }
  function yO(t, e, n, r) {
    if (typeof e == "function") {
      const [i, a] = yZ(r);
      e = e(n !== void 0 ? n : t.custom, i, a);
    }
    if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
      const [i, a] = yZ(r);
      e = e(n !== void 0 ? n : t.custom, i, a);
    }
    return e;
  }
  function E1(t, e, n) {
    const r = t.getProps();
    return yO(r, e, n !== void 0 ? n : r.custom, t);
  }
  const nhe = /* @__PURE__ */ new Set([
    "width",
    "height",
    "top",
    "left",
    "right",
    "bottom",
    ...rv
  ]), bZ = 30, sJe = (t) => !isNaN(parseFloat(t)), f2 = {
    current: void 0
  };
  class lJe {
    constructor(e, n = {}) {
      this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (r) => {
        var _a6;
        const i = ls.now();
        if (this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(r), this.current !== this.prev && ((_a6 = this.events.change) == null ? void 0 : _a6.notify(this.current), this.dependents)) for (const a of this.dependents) a.dirty();
      }, this.hasAnimated = false, this.setCurrent(e), this.owner = n.owner;
    }
    setCurrent(e) {
      this.current = e, this.updatedAt = ls.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = sJe(this.current));
    }
    setPrevFrameValue(e = this.current) {
      this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
    }
    onChange(e) {
      return this.on("change", e);
    }
    on(e, n) {
      this.events[e] || (this.events[e] = new sO());
      const r = this.events[e].add(n);
      return e === "change" ? () => {
        r(), Fi.read(() => {
          this.events.change.getSize() || this.stop();
        });
      } : r;
    }
    clearListeners() {
      for (const e in this.events) this.events[e].clear();
    }
    attach(e, n) {
      this.passiveEffect = e, this.stopPassiveEffect = n;
    }
    set(e) {
      this.passiveEffect ? this.passiveEffect(e, this.updateAndNotify) : this.updateAndNotify(e);
    }
    setWithVelocity(e, n, r) {
      this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - r;
    }
    jump(e, n = true) {
      this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
    }
    dirty() {
      var _a6;
      (_a6 = this.events.change) == null ? void 0 : _a6.notify(this.current);
    }
    addDependent(e) {
      this.dependents || (this.dependents = /* @__PURE__ */ new Set()), this.dependents.add(e);
    }
    removeDependent(e) {
      this.dependents && this.dependents.delete(e);
    }
    get() {
      return f2.current && f2.current.push(this), this.current;
    }
    getPrevious() {
      return this.prev;
    }
    getVelocity() {
      const e = ls.now();
      if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > bZ) return 0;
      const n = Math.min(this.updatedAt - this.prevUpdatedAt, bZ);
      return yue(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
    }
    start(e) {
      return this.stop(), new Promise((n) => {
        this.hasAnimated = true, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
      }).then(() => {
        this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
      });
    }
    stop() {
      this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
    }
    isAnimating() {
      return !!this.animation;
    }
    clearAnimation() {
      delete this.animation;
    }
    destroy() {
      var _a6, _b3;
      (_a6 = this.dependents) == null ? void 0 : _a6.clear(), (_b3 = this.events.destroy) == null ? void 0 : _b3.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
    }
  }
  function up(t, e) {
    return new lJe(t, e);
  }
  const m8 = (t) => Array.isArray(t);
  function cJe(t, e, n) {
    t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, up(n));
  }
  function dJe(t) {
    return m8(t) ? t[t.length - 1] || 0 : t;
  }
  function uJe(t, e) {
    const n = E1(t, e);
    let { transitionEnd: r = {}, transition: i = {}, ...a } = n || {};
    a = {
      ...a,
      ...r
    };
    for (const s in a) {
      const l = dJe(a[s]);
      cJe(t, s, l);
    }
  }
  const aa = (t) => !!(t && t.getVelocity);
  function hJe(t) {
    return !!(aa(t) && t.add);
  }
  function g8(t, e) {
    const n = t.getValue("willChange");
    if (hJe(n)) return n.add(e);
    if (!n && ah.WillChange) {
      const r = new ah.WillChange("auto");
      t.addValue("willChange", r), r.add(e);
    }
  }
  function bO(t) {
    return t.replace(/([A-Z])/g, (e) => `-${e.toLowerCase()}`);
  }
  const fJe = "framerAppearId", rhe = "data-" + bO(fJe);
  function ihe(t) {
    return t.props[rhe];
  }
  function mJe({ protectedKeys: t, needsAnimating: e }, n) {
    const r = t.hasOwnProperty(n) && e[n] !== true;
    return e[n] = false, r;
  }
  function ohe(t, e, { delay: n = 0, transitionOverride: r, type: i } = {}) {
    let { transition: a, transitionEnd: s, ...l } = e;
    const c = t.getDefaultTransition();
    a = a ? the(a, c) : c;
    const d = a == null ? void 0 : a.reduceMotion;
    r && (a = r);
    const u = [], h = i && t.animationState && t.animationState.getState()[i];
    for (const f in l) {
      const g = t.getValue(f, t.latestValues[f] ?? null), m = l[f];
      if (m === void 0 || h && mJe(h, f)) continue;
      const v = {
        delay: n,
        ...vO(a || {}, f)
      }, y = g.get();
      if (y !== void 0 && !g.isAnimating && !Array.isArray(m) && m === y && !v.velocity) continue;
      let w = false;
      if (window.MotionHandoffAnimation) {
        const k = ihe(t);
        if (k) {
          const C = window.MotionHandoffAnimation(k, f, Fi);
          C !== null && (v.startTime = C, w = true);
        }
      }
      g8(t, f);
      const b = d ?? t.shouldReduceMotion;
      g.start(_O(f, g, m, b && nhe.has(f) ? {
        type: false
      } : v, t, w));
      const j = g.animation;
      j && u.push(j);
    }
    if (s) {
      const f = () => Fi.update(() => {
        s && uJe(t, s);
      });
      u.length ? Promise.all(u).then(f) : f();
    }
    return u;
  }
  function p8(t, e, n = {}) {
    var _a6;
    const r = E1(t, e, n.type === "exit" ? (_a6 = t.presenceContext) == null ? void 0 : _a6.custom : void 0);
    let { transition: i = t.getDefaultTransition() || {} } = r || {};
    n.transitionOverride && (i = n.transitionOverride);
    const a = r ? () => Promise.all(ohe(t, r, n)) : () => Promise.resolve(), s = t.variantChildren && t.variantChildren.size ? (c = 0) => {
      const { delayChildren: d = 0, staggerChildren: u, staggerDirection: h } = i;
      return gJe(t, e, c, d, u, h, n);
    } : () => Promise.resolve(), { when: l } = i;
    if (l) {
      const [c, d] = l === "beforeChildren" ? [
        a,
        s
      ] : [
        s,
        a
      ];
      return c().then(() => d());
    } else return Promise.all([
      a(),
      s(n.delay)
    ]);
  }
  function gJe(t, e, n = 0, r = 0, i = 0, a = 1, s) {
    const l = [];
    for (const c of t.variantChildren) c.notify("AnimationStart", e), l.push(p8(c, e, {
      ...s,
      delay: n + (typeof r == "function" ? 0 : r) + Que(t.variantChildren, c, r, i, a)
    }).then(() => c.notify("AnimationComplete", e)));
    return Promise.all(l);
  }
  function pJe(t, e, n = {}) {
    t.notify("AnimationStart", e);
    let r;
    if (Array.isArray(e)) {
      const i = e.map((a) => p8(t, a, n));
      r = Promise.all(i);
    } else if (typeof e == "string") r = p8(t, e, n);
    else {
      const i = typeof e == "function" ? E1(t, e, n.custom) : e;
      r = Promise.all(ohe(t, i, n));
    }
    return r.then(() => {
      t.notify("AnimationComplete", e);
    });
  }
  const FJe = {
    test: (t) => t === "auto",
    parse: (t) => t
  }, ahe = (t) => (e) => e.test(t), she = [
    nv,
    In,
    Nd,
    ef,
    WYe,
    $Ye,
    FJe
  ], xZ = (t) => she.find(ahe(t));
  function vJe(t) {
    return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || vue(t) : true;
  }
  const _Je = /* @__PURE__ */ new Set([
    "brightness",
    "contrast",
    "saturate",
    "opacity"
  ]);
  function yJe(t) {
    const [e, n] = t.slice(0, -1).split("(");
    if (e === "drop-shadow") return t;
    const [r] = n.match(uO) || [];
    if (!r) return t;
    const i = n.replace(r, "");
    let a = _Je.has(e) ? 1 : 0;
    return r !== n && (a *= 100), e + "(" + a + i + ")";
  }
  const bJe = /\b([a-z-]*)\(.*?\)/gu, F8 = {
    ...Lc,
    getAnimatableNone: (t) => {
      const e = t.match(bJe);
      return e ? e.map(yJe).join(" ") : t;
    }
  }, v8 = {
    ...Lc,
    getAnimatableNone: (t) => {
      const e = Lc.parse(t);
      return Lc.createTransformer(t)(e.map((r) => typeof r == "number" ? 0 : typeof r == "object" ? {
        ...r,
        alpha: 1
      } : r));
    }
  }, wZ = {
    ...nv,
    transform: Math.round
  }, xJe = {
    rotate: ef,
    rotateX: ef,
    rotateY: ef,
    rotateZ: ef,
    scale: tD,
    scaleX: tD,
    scaleY: tD,
    scaleZ: tD,
    skew: ef,
    skewX: ef,
    skewY: ef,
    distance: In,
    translateX: In,
    translateY: In,
    translateZ: In,
    x: In,
    y: In,
    z: In,
    perspective: In,
    transformPerspective: In,
    opacity: kb,
    originX: cZ,
    originY: cZ,
    originZ: In
  }, xO = {
    borderWidth: In,
    borderTopWidth: In,
    borderRightWidth: In,
    borderBottomWidth: In,
    borderLeftWidth: In,
    borderRadius: In,
    borderTopLeftRadius: In,
    borderTopRightRadius: In,
    borderBottomRightRadius: In,
    borderBottomLeftRadius: In,
    width: In,
    maxWidth: In,
    height: In,
    maxHeight: In,
    top: In,
    right: In,
    bottom: In,
    left: In,
    inset: In,
    insetBlock: In,
    insetBlockStart: In,
    insetBlockEnd: In,
    insetInline: In,
    insetInlineStart: In,
    insetInlineEnd: In,
    padding: In,
    paddingTop: In,
    paddingRight: In,
    paddingBottom: In,
    paddingLeft: In,
    paddingBlock: In,
    paddingBlockStart: In,
    paddingBlockEnd: In,
    paddingInline: In,
    paddingInlineStart: In,
    paddingInlineEnd: In,
    margin: In,
    marginTop: In,
    marginRight: In,
    marginBottom: In,
    marginLeft: In,
    marginBlock: In,
    marginBlockStart: In,
    marginBlockEnd: In,
    marginInline: In,
    marginInlineStart: In,
    marginInlineEnd: In,
    fontSize: In,
    backgroundPositionX: In,
    backgroundPositionY: In,
    ...xJe,
    zIndex: wZ,
    fillOpacity: kb,
    strokeOpacity: kb,
    numOctaves: wZ
  }, wJe = {
    ...xO,
    color: jo,
    backgroundColor: jo,
    outlineColor: jo,
    fill: jo,
    stroke: jo,
    borderColor: jo,
    borderTopColor: jo,
    borderRightColor: jo,
    borderBottomColor: jo,
    borderLeftColor: jo,
    filter: F8,
    WebkitFilter: F8,
    mask: v8,
    WebkitMask: v8
  }, lhe = (t) => wJe[t], DJe = /* @__PURE__ */ new Set([
    F8,
    v8
  ]);
  function che(t, e) {
    let n = lhe(t);
    return DJe.has(n) || (n = Lc), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
  }
  const CJe = /* @__PURE__ */ new Set([
    "auto",
    "none",
    "0"
  ]);
  function EJe(t, e, n) {
    let r = 0, i;
    for (; r < t.length && !i; ) {
      const a = t[r];
      typeof a == "string" && !CJe.has(a) && pF(a).values.length && (i = t[r]), r++;
    }
    if (i && n) for (const a of e) t[a] = che(n, i);
  }
  class kJe extends FO {
    constructor(e, n, r, i, a) {
      super(e, n, r, i, a, true);
    }
    readKeyframes() {
      const { unresolvedKeyframes: e, element: n, name: r } = this;
      if (!n || !n.current) return;
      super.readKeyframes();
      for (let u = 0; u < e.length; u++) {
        let h = e[u];
        if (typeof h == "string" && (h = h.trim(), dO(h))) {
          const f = ehe(h, n.current);
          f !== void 0 && (e[u] = f), u === e.length - 1 && (this.finalKeyframe = h);
        }
      }
      if (this.resolveNoneKeyframes(), !nhe.has(r) || e.length !== 2) return;
      const [i, a] = e, s = xZ(i), l = xZ(a), c = lZ(i), d = lZ(a);
      if (c !== d && Cf[r]) {
        this.needsMeasurement = true;
        return;
      }
      if (s !== l) if (FZ(s) && FZ(l)) for (let u = 0; u < e.length; u++) {
        const h = e[u];
        typeof h == "string" && (e[u] = parseFloat(h));
      }
      else Cf[r] && (this.needsMeasurement = true);
    }
    resolveNoneKeyframes() {
      const { unresolvedKeyframes: e, name: n } = this, r = [];
      for (let i = 0; i < e.length; i++) (e[i] === null || vJe(e[i])) && r.push(i);
      r.length && EJe(e, r, n);
    }
    measureInitialState() {
      const { element: e, unresolvedKeyframes: n, name: r } = this;
      if (!e || !e.current) return;
      r === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Cf[r](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
      const i = n[n.length - 1];
      i !== void 0 && e.getValue(r, i).jump(i, false);
    }
    measureEndState() {
      var _a6;
      const { element: e, name: n, unresolvedKeyframes: r } = this;
      if (!e || !e.current) return;
      const i = e.getValue(n);
      i && i.jump(this.measuredOrigin, false);
      const a = r.length - 1, s = r[a];
      r[a] = Cf[n](e.measureViewportBox(), window.getComputedStyle(e.current)), s !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = s), ((_a6 = this.removedTransforms) == null ? void 0 : _a6.length) && this.removedTransforms.forEach(([l, c]) => {
        e.getValue(l).set(c);
      }), this.resolveNoneKeyframes();
    }
  }
  const SJe = /* @__PURE__ */ new Set([
    "opacity",
    "clipPath",
    "filter",
    "transform"
  ]);
  function dhe(t, e, n) {
    if (t == null) return [];
    if (t instanceof EventTarget) return [
      t
    ];
    if (typeof t == "string") {
      let r = document;
      const i = (n == null ? void 0 : n[t]) ?? r.querySelectorAll(t);
      return i ? Array.from(i) : [];
    }
    return Array.from(t).filter((r) => r != null);
  }
  const uhe = (t, e) => e && typeof t == "number" ? e.transform(t) : t;
  function jJe(t) {
    return Fue(t) && "offsetHeight" in t;
  }
  const { schedule: wO } = Rue(queueMicrotask, false), yc = {
    x: false,
    y: false
  };
  function hhe() {
    return yc.x || yc.y;
  }
  function TJe(t) {
    return t === "x" || t === "y" ? yc[t] ? null : (yc[t] = true, () => {
      yc[t] = false;
    }) : yc.x || yc.y ? null : (yc.x = yc.y = true, () => {
      yc.x = yc.y = false;
    });
  }
  function fhe(t, e) {
    const n = dhe(t), r = new AbortController(), i = {
      passive: true,
      ...e,
      signal: r.signal
    };
    return [
      n,
      i,
      () => r.abort()
    ];
  }
  function RJe(t) {
    return !(t.pointerType === "touch" || hhe());
  }
  function AJe(t, e, n = {}) {
    const [r, i, a] = fhe(t, n);
    return r.forEach((s) => {
      let l = false, c = false, d;
      const u = () => {
        s.removeEventListener("pointerleave", m);
      }, h = (y) => {
        d && (d(y), d = void 0), u();
      }, f = (y) => {
        l = false, window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", f), c && (c = false, h(y));
      }, g = () => {
        l = true, window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", f, i);
      }, m = (y) => {
        if (y.pointerType !== "touch") {
          if (l) {
            c = true;
            return;
          }
          h(y);
        }
      }, v = (y) => {
        if (!RJe(y)) return;
        c = false;
        const w = e(s, y);
        typeof w == "function" && (d = w, s.addEventListener("pointerleave", m, i));
      };
      s.addEventListener("pointerenter", v, i), s.addEventListener("pointerdown", g, i);
    }), a;
  }
  const mhe = (t, e) => e ? t === e ? true : mhe(t, e.parentElement) : false, DO = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== false, IJe = /* @__PURE__ */ new Set([
    "BUTTON",
    "INPUT",
    "SELECT",
    "TEXTAREA",
    "A"
  ]);
  function BJe(t) {
    return IJe.has(t.tagName) || t.isContentEditable === true;
  }
  const PJe = /* @__PURE__ */ new Set([
    "INPUT",
    "SELECT",
    "TEXTAREA"
  ]);
  function MJe(t) {
    return PJe.has(t.tagName) || t.isContentEditable === true;
  }
  const iC = /* @__PURE__ */ new WeakSet();
  function DZ(t) {
    return (e) => {
      e.key === "Enter" && t(e);
    };
  }
  function aT(t, e) {
    t.dispatchEvent(new PointerEvent("pointer" + e, {
      isPrimary: true,
      bubbles: true
    }));
  }
  const OJe = (t, e) => {
    const n = t.currentTarget;
    if (!n) return;
    const r = DZ(() => {
      if (iC.has(n)) return;
      aT(n, "down");
      const i = DZ(() => {
        aT(n, "up");
      }), a = () => aT(n, "cancel");
      n.addEventListener("keyup", i, e), n.addEventListener("blur", a, e);
    });
    n.addEventListener("keydown", r, e), n.addEventListener("blur", () => n.removeEventListener("keydown", r), e);
  };
  function CZ(t) {
    return DO(t) && !hhe();
  }
  const EZ = /* @__PURE__ */ new WeakSet();
  function LJe(t, e, n = {}) {
    const [r, i, a] = fhe(t, n), s = (l) => {
      const c = l.currentTarget;
      if (!CZ(l) || EZ.has(l)) return;
      iC.add(c), n.stopPropagation && EZ.add(l);
      const d = e(c, l), u = (g, m) => {
        window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", f), iC.has(c) && iC.delete(c), CZ(g) && typeof d == "function" && d(g, {
          success: m
        });
      }, h = (g) => {
        u(g, c === window || c === document || n.useGlobalTarget || mhe(c, g.target));
      }, f = (g) => {
        u(g, false);
      };
      window.addEventListener("pointerup", h, i), window.addEventListener("pointercancel", f, i);
    };
    return r.forEach((l) => {
      (n.useGlobalTarget ? window : l).addEventListener("pointerdown", s, i), jJe(l) && (l.addEventListener("focus", (d) => OJe(d, i)), !BJe(l) && !l.hasAttribute("tabindex") && (l.tabIndex = 0));
    }), a;
  }
  function CO(t) {
    return Fue(t) && "ownerSVGElement" in t;
  }
  const oC = /* @__PURE__ */ new WeakMap();
  let aC;
  const ghe = (t, e, n) => (r, i) => i && i[0] ? i[0][t + "Size"] : CO(r) && "getBBox" in r ? r.getBBox()[e] : r[n], NJe = ghe("inline", "width", "offsetWidth"), zJe = ghe("block", "height", "offsetHeight");
  function UJe({ target: t, borderBoxSize: e }) {
    var _a6;
    (_a6 = oC.get(t)) == null ? void 0 : _a6.forEach((n) => {
      n(t, {
        get width() {
          return NJe(t, e);
        },
        get height() {
          return zJe(t, e);
        }
      });
    });
  }
  function VJe(t) {
    t.forEach(UJe);
  }
  function HJe() {
    typeof ResizeObserver > "u" || (aC = new ResizeObserver(VJe));
  }
  function $Je(t, e) {
    aC || HJe();
    const n = dhe(t);
    return n.forEach((r) => {
      let i = oC.get(r);
      i || (i = /* @__PURE__ */ new Set(), oC.set(r, i)), i.add(e), aC == null ? void 0 : aC.observe(r);
    }), () => {
      n.forEach((r) => {
        const i = oC.get(r);
        i == null ? void 0 : i.delete(e), (i == null ? void 0 : i.size) || (aC == null ? void 0 : aC.unobserve(r));
      });
    };
  }
  const sC = /* @__PURE__ */ new Set();
  let J0;
  function WJe() {
    J0 = () => {
      const t = {
        get width() {
          return window.innerWidth;
        },
        get height() {
          return window.innerHeight;
        }
      };
      sC.forEach((e) => e(t));
    }, window.addEventListener("resize", J0);
  }
  function qJe(t) {
    return sC.add(t), J0 || WJe(), () => {
      sC.delete(t), !sC.size && typeof J0 == "function" && (window.removeEventListener("resize", J0), J0 = void 0);
    };
  }
  function kZ(t, e) {
    return typeof t == "function" ? qJe(t) : $Je(t, e);
  }
  function KJe(t) {
    return CO(t) && t.tagName === "svg";
  }
  function GJe(...t) {
    const e = !Array.isArray(t[0]), n = e ? 0 : -1, r = t[0 + n], i = t[1 + n], a = t[2 + n], s = t[3 + n], l = Vue(i, a, s);
    return e ? l(r) : l;
  }
  function YJe(t, e, n = {}) {
    const r = t.get();
    let i = null, a = r, s;
    const l = typeof r == "string" ? r.replace(/[\d.-]/g, "") : void 0, c = () => {
      i && (i.stop(), i = null);
    }, d = () => {
      const h = jZ(t.get()), f = jZ(a);
      if (h === f) {
        c();
        return;
      }
      const g = i ? i.getGeneratorVelocity() : t.getVelocity();
      c(), i = new DS({
        keyframes: [
          h,
          f
        ],
        velocity: g,
        type: "spring",
        restDelta: 1e-3,
        restSpeed: 0.01,
        ...n,
        onUpdate: s
      });
    }, u = () => {
      var _a6;
      d(), (_a6 = t.events.animationStart) == null ? void 0 : _a6.notify(), i == null ? void 0 : i.then(() => {
        var _a7;
        (_a7 = t.events.animationComplete) == null ? void 0 : _a7.notify();
      });
    };
    if (t.attach((h, f) => {
      a = h, s = (g) => f(SZ(g, l)), Fi.postRender(u);
    }, c), aa(e)) {
      const h = e.on("change", (g) => t.set(SZ(g, l))), f = t.on("destroy", h);
      return () => {
        h(), f();
      };
    }
    return c;
  }
  function SZ(t, e) {
    return e ? t + e : t;
  }
  function jZ(t) {
    return typeof t == "number" ? t : parseFloat(t);
  }
  const ZJe = [
    ...she,
    jo,
    Lc
  ], JJe = (t) => ZJe.find(ahe(t)), TZ = () => ({
    translate: 0,
    scale: 1,
    origin: 0,
    originPoint: 0
  }), X0 = () => ({
    x: TZ(),
    y: TZ()
  }), RZ = () => ({
    min: 0,
    max: 0
  }), Uo = () => ({
    x: RZ(),
    y: RZ()
  }), XJe = /* @__PURE__ */ new WeakMap();
  function CS(t) {
    return t !== null && typeof t == "object" && typeof t.start == "function";
  }
  function Sb(t) {
    return typeof t == "string" || Array.isArray(t);
  }
  const EO = [
    "animate",
    "whileInView",
    "whileFocus",
    "whileHover",
    "whileTap",
    "whileDrag",
    "exit"
  ], kO = [
    "initial",
    ...EO
  ];
  function ES(t) {
    return CS(t.animate) || kO.some((e) => Sb(t[e]));
  }
  function phe(t) {
    return !!(ES(t) || t.variants);
  }
  function QJe(t, e, n) {
    for (const r in e) {
      const i = e[r], a = n[r];
      if (aa(i)) t.addValue(r, i);
      else if (aa(a)) t.addValue(r, up(i, {
        owner: t
      }));
      else if (a !== i) if (t.hasValue(r)) {
        const s = t.getValue(r);
        s.liveStyle === true ? s.jump(i) : s.hasAnimated || s.set(i);
      } else {
        const s = t.getStaticValue(r);
        t.addValue(r, up(s !== void 0 ? s : i, {
          owner: t
        }));
      }
    }
    for (const r in n) e[r] === void 0 && t.removeValue(r);
    return e;
  }
  const _8 = {
    current: null
  }, Fhe = {
    current: false
  }, eXe = typeof window < "u";
  function tXe() {
    if (Fhe.current = true, !!eXe) if (window.matchMedia) {
      const t = window.matchMedia("(prefers-reduced-motion)"), e = () => _8.current = t.matches;
      t.addEventListener("change", e), e();
    } else _8.current = false;
  }
  const AZ = [
    "AnimationStart",
    "AnimationComplete",
    "Update",
    "BeforeLayoutMeasure",
    "LayoutMeasure",
    "LayoutAnimationStart",
    "LayoutAnimationComplete"
  ];
  let SE = {};
  function vhe(t) {
    SE = t;
  }
  function nXe() {
    return SE;
  }
  class rXe {
    scrapeMotionValuesFromProps(e, n, r) {
      return {};
    }
    constructor({ parent: e, props: n, presenceContext: r, reducedMotionConfig: i, skipAnimations: a, blockInitialAnimation: s, visualState: l }, c = {}) {
      this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = false, this.isControllingVariants = false, this.shouldReduceMotion = null, this.shouldSkipAnimations = false, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = FO, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.hasBeenMounted = false, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
        this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
      }, this.renderScheduledAt = 0, this.scheduleRender = () => {
        const g = ls.now();
        this.renderScheduledAt < g && (this.renderScheduledAt = g, Fi.render(this.render, false, true));
      };
      const { latestValues: d, renderState: u } = l;
      this.latestValues = d, this.baseTarget = {
        ...d
      }, this.initialValues = n.initial ? {
        ...d
      } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = r, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.skipAnimationsConfig = a, this.options = c, this.blockInitialAnimation = !!s, this.isControllingVariants = ES(n), this.isVariantNode = phe(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
      const { willChange: h, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
      for (const g in f) {
        const m = f[g];
        d[g] !== void 0 && aa(m) && m.set(d[g]);
      }
    }
    mount(e) {
      var _a6, _b3;
      if (this.hasBeenMounted) for (const n in this.initialValues) (_a6 = this.values.get(n)) == null ? void 0 : _a6.jump(this.initialValues[n]), this.latestValues[n] = this.initialValues[n];
      this.current = e, XJe.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, r) => this.bindToMotionValue(r, n)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = false : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = true : (Fhe.current || tXe(), this.shouldReduceMotion = _8.current), this.shouldSkipAnimations = this.skipAnimationsConfig ?? false, (_b3 = this.parent) == null ? void 0 : _b3.addChild(this), this.update(this.props, this.presenceContext), this.hasBeenMounted = true;
    }
    unmount() {
      var _a6;
      this.projection && this.projection.unmount(), sh(this.notifyUpdate), sh(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), (_a6 = this.parent) == null ? void 0 : _a6.removeChild(this);
      for (const e in this.events) this.events[e].clear();
      for (const e in this.features) {
        const n = this.features[e];
        n && (n.unmount(), n.isMounted = false);
      }
      this.current = null;
    }
    addChild(e) {
      this.children.add(e), this.enteringChildren ?? (this.enteringChildren = /* @__PURE__ */ new Set()), this.enteringChildren.add(e);
    }
    removeChild(e) {
      this.children.delete(e), this.enteringChildren && this.enteringChildren.delete(e);
    }
    bindToMotionValue(e, n) {
      if (this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)(), n.accelerate && SJe.has(e) && this.current instanceof HTMLElement) {
        const { factory: s, keyframes: l, times: c, ease: d, duration: u } = n.accelerate, h = new Jue({
          element: this.current,
          name: e,
          keyframes: l,
          times: c,
          ease: d,
          duration: dl(u)
        }), f = s(h);
        this.valueSubscriptions.set(e, () => {
          f(), h.cancel();
        });
        return;
      }
      const r = iv.has(e);
      r && this.onBindTransform && this.onBindTransform();
      const i = n.on("change", (s) => {
        this.latestValues[e] = s, this.props.onUpdate && Fi.preRender(this.notifyUpdate), r && this.projection && (this.projection.isTransformDirty = true), this.scheduleRender();
      });
      let a;
      typeof window < "u" && window.MotionCheckAppearSync && (a = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
        i(), a && a(), n.owner && n.stop();
      });
    }
    sortNodePosition(e) {
      return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
    }
    updateFeatures() {
      let e = "animation";
      for (e in SE) {
        const n = SE[e];
        if (!n) continue;
        const { isEnabled: r, Feature: i } = n;
        if (!this.features[e] && i && r(this.props) && (this.features[e] = new i(this)), this.features[e]) {
          const a = this.features[e];
          a.isMounted ? a.update() : (a.mount(), a.isMounted = true);
        }
      }
    }
    triggerBuild() {
      this.build(this.renderState, this.latestValues, this.props);
    }
    measureViewportBox() {
      return this.current ? this.measureInstanceViewportBox(this.current, this.props) : Uo();
    }
    getStaticValue(e) {
      return this.latestValues[e];
    }
    setStaticValue(e, n) {
      this.latestValues[e] = n;
    }
    update(e, n) {
      (e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
      for (let r = 0; r < AZ.length; r++) {
        const i = AZ[r];
        this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
        const a = "on" + i, s = e[a];
        s && (this.propEventSubscriptions[i] = this.on(i, s));
      }
      this.prevMotionValues = QJe(this, this.scrapeMotionValuesFromProps(e, this.prevProps || {}, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
    }
    getProps() {
      return this.props;
    }
    getVariant(e) {
      return this.props.variants ? this.props.variants[e] : void 0;
    }
    getDefaultTransition() {
      return this.props.transition;
    }
    getTransformPagePoint() {
      return this.props.transformPagePoint;
    }
    getClosestVariantNode() {
      return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
    }
    addVariantChild(e) {
      const n = this.getClosestVariantNode();
      if (n) return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
    }
    addValue(e, n) {
      const r = this.values.get(e);
      n !== r && (r && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
    }
    removeValue(e) {
      this.values.delete(e);
      const n = this.valueSubscriptions.get(e);
      n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
    }
    hasValue(e) {
      return this.values.has(e);
    }
    getValue(e, n) {
      if (this.props.values && this.props.values[e]) return this.props.values[e];
      let r = this.values.get(e);
      return r === void 0 && n !== void 0 && (r = up(n === null ? void 0 : n, {
        owner: this
      }), this.addValue(e, r)), r;
    }
    readValue(e, n) {
      let r = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
      return r != null && (typeof r == "string" && (pue(r) || vue(r)) ? r = parseFloat(r) : !JJe(r) && Lc.test(n) && (r = che(e, n)), this.setBaseTarget(e, aa(r) ? r.get() : r)), aa(r) ? r.get() : r;
    }
    setBaseTarget(e, n) {
      this.baseTarget[e] = n;
    }
    getBaseTarget(e) {
      var _a6;
      const { initial: n } = this.props;
      let r;
      if (typeof n == "string" || typeof n == "object") {
        const a = yO(this.props, n, (_a6 = this.presenceContext) == null ? void 0 : _a6.custom);
        a && (r = a[e]);
      }
      if (n && r !== void 0) return r;
      const i = this.getBaseTargetFromProps(this.props, e);
      return i !== void 0 && !aa(i) ? i : this.initialValues[e] !== void 0 && r === void 0 ? void 0 : this.baseTarget[e];
    }
    on(e, n) {
      return this.events[e] || (this.events[e] = new sO()), this.events[e].add(n);
    }
    notify(e, ...n) {
      this.events[e] && this.events[e].notify(...n);
    }
    scheduleRenderMicrotask() {
      wO.render(this.render);
    }
  }
  class _he extends rXe {
    constructor() {
      super(...arguments), this.KeyframeResolver = kJe;
    }
    sortInstanceNodePosition(e, n) {
      return e.compareDocumentPosition(n) & 2 ? 1 : -1;
    }
    getBaseTargetFromProps(e, n) {
      const r = e.style;
      return r ? r[n] : void 0;
    }
    removeValueFromRenderState(e, { vars: n, style: r }) {
      delete n[e], delete r[e];
    }
    handleChildMotionValue() {
      this.childSubscription && (this.childSubscription(), delete this.childSubscription);
      const { children: e } = this.props;
      aa(e) && (this.childSubscription = e.on("change", (n) => {
        this.current && (this.current.textContent = `${n}`);
      }));
    }
  }
  class lm {
    constructor(e) {
      this.isMounted = false, this.node = e;
    }
    update() {
    }
  }
  function yhe({ top: t, left: e, right: n, bottom: r }) {
    return {
      x: {
        min: e,
        max: n
      },
      y: {
        min: t,
        max: r
      }
    };
  }
  function iXe({ x: t, y: e }) {
    return {
      top: e.min,
      right: t.max,
      bottom: e.max,
      left: t.min
    };
  }
  function oXe(t, e) {
    if (!e) return t;
    const n = e({
      x: t.left,
      y: t.top
    }), r = e({
      x: t.right,
      y: t.bottom
    });
    return {
      top: n.y,
      left: n.x,
      bottom: r.y,
      right: r.x
    };
  }
  function sT(t) {
    return t === void 0 || t === 1;
  }
  function y8({ scale: t, scaleX: e, scaleY: n }) {
    return !sT(t) || !sT(e) || !sT(n);
  }
  function tg(t) {
    return y8(t) || bhe(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
  }
  function bhe(t) {
    return IZ(t.x) || IZ(t.y);
  }
  function IZ(t) {
    return t && t !== "0%";
  }
  function jE(t, e, n) {
    const r = t - n, i = e * r;
    return n + i;
  }
  function BZ(t, e, n, r, i) {
    return i !== void 0 && (t = jE(t, i, r)), jE(t, n, r) + e;
  }
  function b8(t, e = 0, n = 1, r, i) {
    t.min = BZ(t.min, e, n, r, i), t.max = BZ(t.max, e, n, r, i);
  }
  function xhe(t, { x: e, y: n }) {
    b8(t.x, e.translate, e.scale, e.originPoint), b8(t.y, n.translate, n.scale, n.originPoint);
  }
  const PZ = 0.999999999999, MZ = 1.0000000000001;
  function aXe(t, e, n, r = false) {
    var _a6;
    const i = n.length;
    if (!i) return;
    e.x = e.y = 1;
    let a, s;
    for (let l = 0; l < i; l++) {
      a = n[l], s = a.projectionDelta;
      const { visualElement: c } = a.options;
      c && c.props.style && c.props.style.display === "contents" || (r && a.options.layoutScroll && a.scroll && a !== a.root && e1(t, {
        x: -a.scroll.offset.x,
        y: -a.scroll.offset.y
      }), s && (e.x *= s.x.scale, e.y *= s.y.scale, xhe(t, s)), r && tg(a.latestValues) && e1(t, a.latestValues, (_a6 = a.layout) == null ? void 0 : _a6.layoutBox));
    }
    e.x < MZ && e.x > PZ && (e.x = 1), e.y < MZ && e.y > PZ && (e.y = 1);
  }
  function Q0(t, e) {
    t.min = t.min + e, t.max = t.max + e;
  }
  function OZ(t, e, n, r, i = 0.5) {
    const a = eo(t.min, t.max, i);
    b8(t, e, n, a, r);
  }
  function LZ(t, e) {
    return typeof t == "string" ? parseFloat(t) / 100 * (e.max - e.min) : t;
  }
  function e1(t, e, n) {
    const r = n ?? t;
    OZ(t.x, LZ(e.x, r.x), e.scaleX, e.scale, e.originX), OZ(t.y, LZ(e.y, r.y), e.scaleY, e.scale, e.originY);
  }
  function whe(t, e) {
    return yhe(oXe(t.getBoundingClientRect(), e));
  }
  function sXe(t, e, n) {
    const r = whe(t, n), { scroll: i } = e;
    return i && (Q0(r.x, i.offset.x), Q0(r.y, i.offset.y)), r;
  }
  const lXe = {
    x: "translateX",
    y: "translateY",
    z: "translateZ",
    transformPerspective: "perspective"
  }, cXe = rv.length;
  function dXe(t, e, n) {
    let r = "", i = true;
    for (let a = 0; a < cXe; a++) {
      const s = rv[a], l = t[s];
      if (l === void 0) continue;
      let c = true;
      if (typeof l == "number") c = l === (s.startsWith("scale") ? 1 : 0);
      else {
        const d = parseFloat(l);
        c = s.startsWith("scale") ? d === 1 : d === 0;
      }
      if (!c || n) {
        const d = uhe(l, xO[s]);
        if (!c) {
          i = false;
          const u = lXe[s] || s;
          r += `${u}(${d}) `;
        }
        n && (e[s] = d);
      }
    }
    return r = r.trim(), n ? r = n(e, i ? "" : r) : i && (r = "none"), r;
  }
  function SO(t, e, n) {
    const { style: r, vars: i, transformOrigin: a } = t;
    let s = false, l = false;
    for (const c in e) {
      const d = e[c];
      if (iv.has(c)) {
        s = true;
        continue;
      } else if (Iue(c)) {
        i[c] = d;
        continue;
      } else {
        const u = uhe(d, xO[c]);
        c.startsWith("origin") ? (l = true, a[c] = u) : r[c] = u;
      }
    }
    if (e.transform || (s || n ? r.transform = dXe(e, t.transform, n) : r.transform && (r.transform = "none")), l) {
      const { originX: c = "50%", originY: d = "50%", originZ: u = 0 } = a;
      r.transformOrigin = `${c} ${d} ${u}`;
    }
  }
  function Dhe(t, { style: e, vars: n }, r, i) {
    const a = t.style;
    let s;
    for (s in e) a[s] = e[s];
    i == null ? void 0 : i.applyProjectionStyles(a, r);
    for (s in n) a.setProperty(s, n[s]);
  }
  function NZ(t, e) {
    return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
  }
  const J_ = {
    correct: (t, e) => {
      if (!e.target) return t;
      if (typeof t == "string") if (In.test(t)) t = parseFloat(t);
      else return t;
      const n = NZ(t, e.target.x), r = NZ(t, e.target.y);
      return `${n}% ${r}%`;
    }
  }, uXe = {
    correct: (t, { treeScale: e, projectionDelta: n }) => {
      const r = t, i = Lc.parse(t);
      if (i.length > 5) return r;
      const a = Lc.createTransformer(t), s = typeof i[0] != "number" ? 1 : 0, l = n.x.scale * e.x, c = n.y.scale * e.y;
      i[0 + s] /= l, i[1 + s] /= c;
      const d = eo(l, c, 0.5);
      return typeof i[2 + s] == "number" && (i[2 + s] /= d), typeof i[3 + s] == "number" && (i[3 + s] /= d), a(i);
    }
  }, x8 = {
    borderRadius: {
      ...J_,
      applyTo: [
        "borderTopLeftRadius",
        "borderTopRightRadius",
        "borderBottomLeftRadius",
        "borderBottomRightRadius"
      ]
    },
    borderTopLeftRadius: J_,
    borderTopRightRadius: J_,
    borderBottomLeftRadius: J_,
    borderBottomRightRadius: J_,
    boxShadow: uXe
  };
  function Che(t, { layout: e, layoutId: n }) {
    return iv.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!x8[t] || t === "opacity");
  }
  function jO(t, e, n) {
    var _a6;
    const r = t.style, i = e == null ? void 0 : e.style, a = {};
    if (!r) return a;
    for (const s in r) (aa(r[s]) || i && aa(i[s]) || Che(s, t) || ((_a6 = n == null ? void 0 : n.getValue(s)) == null ? void 0 : _a6.liveStyle) !== void 0) && (a[s] = r[s]);
    return a;
  }
  function hXe(t) {
    return window.getComputedStyle(t);
  }
  class fXe extends _he {
    constructor() {
      super(...arguments), this.type = "html", this.renderInstance = Dhe;
    }
    readValueFromInstance(e, n) {
      var _a6;
      if (iv.has(n)) return ((_a6 = this.projection) == null ? void 0 : _a6.isProjecting) ? l8(n) : TZe(e, n);
      {
        const r = hXe(e), i = (Iue(n) ? r.getPropertyValue(n) : r[n]) || 0;
        return typeof i == "string" ? i.trim() : i;
      }
    }
    measureInstanceViewportBox(e, { transformPagePoint: n }) {
      return whe(e, n);
    }
    build(e, n, r) {
      SO(e, n, r.transformTemplate);
    }
    scrapeMotionValuesFromProps(e, n, r) {
      return jO(e, n, r);
    }
  }
  const mXe = {
    offset: "stroke-dashoffset",
    array: "stroke-dasharray"
  }, gXe = {
    offset: "strokeDashoffset",
    array: "strokeDasharray"
  };
  function pXe(t, e, n = 1, r = 0, i = true) {
    t.pathLength = 1;
    const a = i ? mXe : gXe;
    t[a.offset] = `${-r}`, t[a.array] = `${e} ${n}`;
  }
  const FXe = [
    "offsetDistance",
    "offsetPath",
    "offsetRotate",
    "offsetAnchor"
  ];
  function Ehe(t, { attrX: e, attrY: n, attrScale: r, pathLength: i, pathSpacing: a = 1, pathOffset: s = 0, ...l }, c, d, u) {
    if (SO(t, l, d), c) {
      t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
      return;
    }
    t.attrs = t.style, t.style = {};
    const { attrs: h, style: f } = t;
    h.transform && (f.transform = h.transform, delete h.transform), (f.transform || h.transformOrigin) && (f.transformOrigin = h.transformOrigin ?? "50% 50%", delete h.transformOrigin), f.transform && (f.transformBox = (u == null ? void 0 : u.transformBox) ?? "fill-box", delete h.transformBox);
    for (const g of FXe) h[g] !== void 0 && (f[g] = h[g], delete h[g]);
    e !== void 0 && (h.x = e), n !== void 0 && (h.y = n), r !== void 0 && (h.scale = r), i !== void 0 && pXe(h, i, a, s, false);
  }
  const khe = /* @__PURE__ */ new Set([
    "baseFrequency",
    "diffuseConstant",
    "kernelMatrix",
    "kernelUnitLength",
    "keySplines",
    "keyTimes",
    "limitingConeAngle",
    "markerHeight",
    "markerWidth",
    "numOctaves",
    "targetX",
    "targetY",
    "surfaceScale",
    "specularConstant",
    "specularExponent",
    "stdDeviation",
    "tableValues",
    "viewBox",
    "gradientTransform",
    "pathLength",
    "startOffset",
    "textLength",
    "lengthAdjust"
  ]), She = (t) => typeof t == "string" && t.toLowerCase() === "svg";
  function vXe(t, e, n, r) {
    Dhe(t, e, void 0, r);
    for (const i in e.attrs) t.setAttribute(khe.has(i) ? i : bO(i), e.attrs[i]);
  }
  function jhe(t, e, n) {
    const r = jO(t, e, n);
    for (const i in t) if (aa(t[i]) || aa(e[i])) {
      const a = rv.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
      r[a] = t[i];
    }
    return r;
  }
  class _Xe extends _he {
    constructor() {
      super(...arguments), this.type = "svg", this.isSVGTag = false, this.measureInstanceViewportBox = Uo;
    }
    getBaseTargetFromProps(e, n) {
      return e[n];
    }
    readValueFromInstance(e, n) {
      if (iv.has(n)) {
        const r = lhe(n);
        return r && r.default || 0;
      }
      return n = khe.has(n) ? n : bO(n), e.getAttribute(n);
    }
    scrapeMotionValuesFromProps(e, n, r) {
      return jhe(e, n, r);
    }
    build(e, n, r) {
      Ehe(e, n, this.isSVGTag, r.transformTemplate, r.style);
    }
    renderInstance(e, n, r, i) {
      vXe(e, n, r, i);
    }
    mount(e) {
      this.isSVGTag = She(e.tagName), super.mount(e);
    }
  }
  const yXe = kO.length;
  function The(t) {
    if (!t) return;
    if (!t.isControllingVariants) {
      const n = t.parent ? The(t.parent) || {} : {};
      return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
    }
    const e = {};
    for (let n = 0; n < yXe; n++) {
      const r = kO[n], i = t.props[r];
      (Sb(i) || i === false) && (e[r] = i);
    }
    return e;
  }
  function Rhe(t, e) {
    if (!Array.isArray(e)) return false;
    const n = e.length;
    if (n !== t.length) return false;
    for (let r = 0; r < n; r++) if (e[r] !== t[r]) return false;
    return true;
  }
  const bXe = [
    ...EO
  ].reverse(), xXe = EO.length;
  function wXe(t) {
    return (e) => Promise.all(e.map(({ animation: n, options: r }) => pJe(t, n, r)));
  }
  function DXe(t) {
    let e = wXe(t), n = zZ(), r = true, i = false;
    const a = (d) => (u, h) => {
      var _a6;
      const f = E1(t, h, d === "exit" ? (_a6 = t.presenceContext) == null ? void 0 : _a6.custom : void 0);
      if (f) {
        const { transition: g, transitionEnd: m, ...v } = f;
        u = {
          ...u,
          ...v,
          ...m
        };
      }
      return u;
    };
    function s(d) {
      e = d(t);
    }
    function l(d) {
      const { props: u } = t, h = The(t.parent) || {}, f = [], g = /* @__PURE__ */ new Set();
      let m = {}, v = 1 / 0;
      for (let w = 0; w < xXe; w++) {
        const b = bXe[w], j = n[b], k = u[b] !== void 0 ? u[b] : h[b], C = Sb(k), x = b === d ? j.isActive : null;
        x === false && (v = w);
        let S = k === h[b] && k !== u[b] && C;
        if (S && (r || i) && t.manuallyAnimateOnMount && (S = false), j.protectedKeys = {
          ...m
        }, !j.isActive && x === null || !k && !j.prevProp || CS(k) || typeof k == "boolean") continue;
        if (b === "exit" && j.isActive && x !== true) {
          j.prevResolvedValues && (m = {
            ...m,
            ...j.prevResolvedValues
          });
          continue;
        }
        const T = CXe(j.prevProp, k);
        let A = T || b === d && j.isActive && !S && C || w > v && C, B = false;
        const U = Array.isArray(k) ? k : [
          k
        ];
        let z = U.reduce(a(b), {});
        x === false && (z = {});
        const { prevResolvedValues: O = {} } = j, M = {
          ...O,
          ...z
        }, I = (H) => {
          A = true, g.has(H) && (B = true, g.delete(H)), j.needsAnimating[H] = true;
          const V = t.getValue(H);
          V && (V.liveStyle = false);
        };
        for (const H in M) {
          const V = z[H], Z = O[H];
          if (m.hasOwnProperty(H)) continue;
          let Y = false;
          m8(V) && m8(Z) ? Y = !Rhe(V, Z) : Y = V !== Z, Y ? V != null ? I(H) : g.add(H) : V !== void 0 && g.has(H) ? I(H) : j.protectedKeys[H] = true;
        }
        j.prevProp = k, j.prevResolvedValues = z, j.isActive && (m = {
          ...m,
          ...z
        }), (r || i) && t.blockInitialAnimation && (A = false);
        const N = S && T;
        A && (!N || B) && f.push(...U.map((H) => {
          const V = {
            type: b
          };
          if (typeof H == "string" && (r || i) && !N && t.manuallyAnimateOnMount && t.parent) {
            const { parent: Z } = t, Y = E1(Z, H);
            if (Z.enteringChildren && Y) {
              const { delayChildren: oe } = Y.transition || {};
              V.delay = Que(Z.enteringChildren, t, oe);
            }
          }
          return {
            animation: H,
            options: V
          };
        }));
      }
      if (g.size) {
        const w = {};
        if (typeof u.initial != "boolean") {
          const b = E1(t, Array.isArray(u.initial) ? u.initial[0] : u.initial);
          b && b.transition && (w.transition = b.transition);
        }
        g.forEach((b) => {
          const j = t.getBaseTarget(b), k = t.getValue(b);
          k && (k.liveStyle = true), w[b] = j ?? null;
        }), f.push({
          animation: w
        });
      }
      let y = !!f.length;
      return r && (u.initial === false || u.initial === u.animate) && !t.manuallyAnimateOnMount && (y = false), r = false, i = false, y ? e(f) : Promise.resolve();
    }
    function c(d, u) {
      var _a6;
      if (n[d].isActive === u) return Promise.resolve();
      (_a6 = t.variantChildren) == null ? void 0 : _a6.forEach((f) => {
        var _a7;
        return (_a7 = f.animationState) == null ? void 0 : _a7.setActive(d, u);
      }), n[d].isActive = u;
      const h = l(d);
      for (const f in n) n[f].protectedKeys = {};
      return h;
    }
    return {
      animateChanges: l,
      setActive: c,
      setAnimateFunction: s,
      getState: () => n,
      reset: () => {
        n = zZ(), i = true;
      }
    };
  }
  function CXe(t, e) {
    return typeof e == "string" ? e !== t : Array.isArray(e) ? !Rhe(e, t) : false;
  }
  function Om(t = false) {
    return {
      isActive: t,
      protectedKeys: {},
      needsAnimating: {},
      prevResolvedValues: {}
    };
  }
  function zZ() {
    return {
      animate: Om(true),
      whileInView: Om(),
      whileHover: Om(),
      whileTap: Om(),
      whileDrag: Om(),
      whileFocus: Om(),
      exit: Om()
    };
  }
  function UZ(t, e) {
    t.min = e.min, t.max = e.max;
  }
  function vc(t, e) {
    UZ(t.x, e.x), UZ(t.y, e.y);
  }
  function VZ(t, e) {
    t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
  }
  const Ahe = 1e-4, EXe = 1 - Ahe, kXe = 1 + Ahe, Ihe = 0.01, SXe = 0 - Ihe, jXe = 0 + Ihe;
  function cs(t) {
    return t.max - t.min;
  }
  function TXe(t, e, n) {
    return Math.abs(t - e) <= n;
  }
  function HZ(t, e, n, r = 0.5) {
    t.origin = r, t.originPoint = eo(e.min, e.max, t.origin), t.scale = cs(n) / cs(e), t.translate = eo(n.min, n.max, t.origin) - t.originPoint, (t.scale >= EXe && t.scale <= kXe || isNaN(t.scale)) && (t.scale = 1), (t.translate >= SXe && t.translate <= jXe || isNaN(t.translate)) && (t.translate = 0);
  }
  function m2(t, e, n, r) {
    HZ(t.x, e.x, n.x, r ? r.originX : void 0), HZ(t.y, e.y, n.y, r ? r.originY : void 0);
  }
  function $Z(t, e, n) {
    t.min = n.min + e.min, t.max = t.min + cs(e);
  }
  function RXe(t, e, n) {
    $Z(t.x, e.x, n.x), $Z(t.y, e.y, n.y);
  }
  function WZ(t, e, n) {
    t.min = e.min - n.min, t.max = t.min + cs(e);
  }
  function TE(t, e, n) {
    WZ(t.x, e.x, n.x), WZ(t.y, e.y, n.y);
  }
  function qZ(t, e, n, r, i) {
    return t -= e, t = jE(t, 1 / n, r), i !== void 0 && (t = jE(t, 1 / i, r)), t;
  }
  function AXe(t, e = 0, n = 1, r = 0.5, i, a = t, s = t) {
    if (Nd.test(e) && (e = parseFloat(e), e = eo(s.min, s.max, e / 100) - s.min), typeof e != "number") return;
    let l = eo(a.min, a.max, r);
    t === a && (l -= e), t.min = qZ(t.min, e, n, l, i), t.max = qZ(t.max, e, n, l, i);
  }
  function KZ(t, e, [n, r, i], a, s) {
    AXe(t, e[n], e[r], e[i], e.scale, a, s);
  }
  const IXe = [
    "x",
    "scaleX",
    "originX"
  ], BXe = [
    "y",
    "scaleY",
    "originY"
  ];
  function GZ(t, e, n, r) {
    KZ(t.x, e, IXe, n ? n.x : void 0, r ? r.x : void 0), KZ(t.y, e, BXe, n ? n.y : void 0, r ? r.y : void 0);
  }
  function YZ(t) {
    return t.translate === 0 && t.scale === 1;
  }
  function Bhe(t) {
    return YZ(t.x) && YZ(t.y);
  }
  function ZZ(t, e) {
    return t.min === e.min && t.max === e.max;
  }
  function PXe(t, e) {
    return ZZ(t.x, e.x) && ZZ(t.y, e.y);
  }
  function JZ(t, e) {
    return Math.round(t.min) === Math.round(e.min) && Math.round(t.max) === Math.round(e.max);
  }
  function Phe(t, e) {
    return JZ(t.x, e.x) && JZ(t.y, e.y);
  }
  function XZ(t) {
    return cs(t.x) / cs(t.y);
  }
  function QZ(t, e) {
    return t.translate === e.translate && t.scale === e.scale && t.originPoint === e.originPoint;
  }
  function Cd(t) {
    return [
      t("x"),
      t("y")
    ];
  }
  function MXe(t, e, n) {
    let r = "";
    const i = t.x.translate / e.x, a = t.y.translate / e.y, s = (n == null ? void 0 : n.z) || 0;
    if ((i || a || s) && (r = `translate3d(${i}px, ${a}px, ${s}px) `), (e.x !== 1 || e.y !== 1) && (r += `scale(${1 / e.x}, ${1 / e.y}) `), n) {
      const { transformPerspective: d, rotate: u, rotateX: h, rotateY: f, skewX: g, skewY: m } = n;
      d && (r = `perspective(${d}px) ${r}`), u && (r += `rotate(${u}deg) `), h && (r += `rotateX(${h}deg) `), f && (r += `rotateY(${f}deg) `), g && (r += `skewX(${g}deg) `), m && (r += `skewY(${m}deg) `);
    }
    const l = t.x.scale * e.x, c = t.y.scale * e.y;
    return (l !== 1 || c !== 1) && (r += `scale(${l}, ${c})`), r || "none";
  }
  const Mhe = [
    "TopLeft",
    "TopRight",
    "BottomLeft",
    "BottomRight"
  ], OXe = Mhe.length, eJ = (t) => typeof t == "string" ? parseFloat(t) : t, tJ = (t) => typeof t == "number" || In.test(t);
  function LXe(t, e, n, r, i, a) {
    i ? (t.opacity = eo(0, n.opacity ?? 1, NXe(r)), t.opacityExit = eo(e.opacity ?? 1, 0, zXe(r))) : a && (t.opacity = eo(e.opacity ?? 1, n.opacity ?? 1, r));
    for (let s = 0; s < OXe; s++) {
      const l = `border${Mhe[s]}Radius`;
      let c = nJ(e, l), d = nJ(n, l);
      if (c === void 0 && d === void 0) continue;
      c || (c = 0), d || (d = 0), c === 0 || d === 0 || tJ(c) === tJ(d) ? (t[l] = Math.max(eo(eJ(c), eJ(d), r), 0), (Nd.test(d) || Nd.test(c)) && (t[l] += "%")) : t[l] = d;
    }
    (e.rotate || n.rotate) && (t.rotate = eo(e.rotate || 0, n.rotate || 0, r));
  }
  function nJ(t, e) {
    return t[e] !== void 0 ? t[e] : t.borderRadius;
  }
  const NXe = Ohe(0, 0.5, kue), zXe = Ohe(0.5, 0.95, $l);
  function Ohe(t, e, n) {
    return (r) => r < t ? 0 : r > e ? 1 : n(Eb(t, e, r));
  }
  function UXe(t, e, n) {
    const r = aa(t) ? t : up(t);
    return r.start(_O("", r, e, n)), r.animation;
  }
  function jb(t, e, n, r = {
    passive: true
  }) {
    return t.addEventListener(e, n, r), () => t.removeEventListener(e, n);
  }
  const VXe = (t, e) => t.depth - e.depth;
  class HXe {
    constructor() {
      this.children = [], this.isDirty = false;
    }
    add(e) {
      oO(this.children, e), this.isDirty = true;
    }
    remove(e) {
      DE(this.children, e), this.isDirty = true;
    }
    forEach(e) {
      this.isDirty && this.children.sort(VXe), this.isDirty = false, this.children.forEach(e);
    }
  }
  function $Xe(t, e) {
    const n = ls.now(), r = ({ timestamp: i }) => {
      const a = i - n;
      a >= e && (sh(r), t(a - e));
    };
    return Fi.setup(r, true), () => sh(r);
  }
  function lC(t) {
    return aa(t) ? t.get() : t;
  }
  class WXe {
    constructor() {
      this.members = [];
    }
    add(e) {
      oO(this.members, e);
      for (let n = this.members.length - 1; n >= 0; n--) {
        const r = this.members[n];
        if (r === e || r === this.lead || r === this.prevLead) continue;
        const i = r.instance;
        (!i || i.isConnected === false) && !r.snapshot && (DE(this.members, r), r.unmount());
      }
      e.scheduleRender();
    }
    remove(e) {
      if (DE(this.members, e), e === this.prevLead && (this.prevLead = void 0), e === this.lead) {
        const n = this.members[this.members.length - 1];
        n && this.promote(n);
      }
    }
    relegate(e) {
      var _a6;
      for (let n = this.members.indexOf(e) - 1; n >= 0; n--) {
        const r = this.members[n];
        if (r.isPresent !== false && ((_a6 = r.instance) == null ? void 0 : _a6.isConnected) !== false) return this.promote(r), true;
      }
      return false;
    }
    promote(e, n) {
      var _a6;
      const r = this.lead;
      if (e !== r && (this.prevLead = r, this.lead = e, e.show(), r)) {
        r.updateSnapshot(), e.scheduleRender();
        const { layoutDependency: i } = r.options, { layoutDependency: a } = e.options;
        (i === void 0 || i !== a) && (e.resumeFrom = r, n && (r.preserveOpacity = true), r.snapshot && (e.snapshot = r.snapshot, e.snapshot.latestValues = r.animationValues || r.latestValues), ((_a6 = e.root) == null ? void 0 : _a6.isUpdating) && (e.isLayoutDirty = true)), e.options.crossfade === false && r.hide();
      }
    }
    exitAnimationComplete() {
      this.members.forEach((e) => {
        var _a6, _b3, _c3, _d4, _e13;
        (_b3 = (_a6 = e.options).onExitComplete) == null ? void 0 : _b3.call(_a6), (_e13 = (_c3 = e.resumingFrom) == null ? void 0 : (_d4 = _c3.options).onExitComplete) == null ? void 0 : _e13.call(_d4);
      });
    }
    scheduleRender() {
      this.members.forEach((e) => e.instance && e.scheduleRender(false));
    }
    removeLeadSnapshot() {
      var _a6;
      ((_a6 = this.lead) == null ? void 0 : _a6.snapshot) && (this.lead.snapshot = void 0);
    }
  }
  const cC = {
    hasAnimatedSinceResize: true,
    hasEverUpdated: false
  }, lT = [
    "",
    "X",
    "Y",
    "Z"
  ], qXe = 1e3;
  let KXe = 0;
  function cT(t, e, n, r) {
    const { latestValues: i } = e;
    i[t] && (n[t] = i[t], e.setStaticValue(t, 0), r && (r[t] = 0));
  }
  function Lhe(t) {
    if (t.hasCheckedOptimisedAppear = true, t.root === t) return;
    const { visualElement: e } = t.options;
    if (!e) return;
    const n = ihe(e);
    if (window.MotionHasOptimisedAnimation(n, "transform")) {
      const { layout: i, layoutId: a } = t.options;
      window.MotionCancelOptimisedAnimation(n, "transform", Fi, !(i || a));
    }
    const { parent: r } = t;
    r && !r.hasCheckedOptimisedAppear && Lhe(r);
  }
  function Nhe({ attachResizeListener: t, defaultParent: e, measureScroll: n, checkIsScrollRoot: r, resetTransform: i }) {
    return class {
      constructor(s = {}, l = e == null ? void 0 : e()) {
        this.id = KXe++, this.animationId = 0, this.animationCommitId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = false, this.isAnimationBlocked = false, this.isLayoutDirty = false, this.isProjectionDirty = false, this.isSharedProjectionDirty = false, this.isTransformDirty = false, this.updateManuallyBlocked = false, this.updateBlockedByResize = false, this.isUpdating = false, this.isSVG = false, this.needsReset = false, this.shouldResetTransform = false, this.hasCheckedOptimisedAppear = false, this.treeScale = {
          x: 1,
          y: 1
        }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = false, this.layoutVersion = 0, this.updateScheduled = false, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = false, this.checkUpdateFailed = () => {
          this.isUpdating && (this.isUpdating = false, this.clearAllSnapshots());
        }, this.updateProjection = () => {
          this.projectionUpdateScheduled = false, this.nodes.forEach(ZXe), this.nodes.forEach(eQe), this.nodes.forEach(tQe), this.nodes.forEach(JXe);
        }, this.resolvedRelativeTargetAt = 0, this.linkedParentVersion = 0, this.hasProjected = false, this.isVisible = true, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = s, this.root = l ? l.root || l : this, this.path = l ? [
          ...l.path,
          l
        ] : [], this.parent = l, this.depth = l ? l.depth + 1 : 0;
        for (let c = 0; c < this.path.length; c++) this.path[c].shouldResetTransform = true;
        this.root === this && (this.nodes = new HXe());
      }
      addEventListener(s, l) {
        return this.eventHandlers.has(s) || this.eventHandlers.set(s, new sO()), this.eventHandlers.get(s).add(l);
      }
      notifyListeners(s, ...l) {
        const c = this.eventHandlers.get(s);
        c && c.notify(...l);
      }
      hasListeners(s) {
        return this.eventHandlers.has(s);
      }
      mount(s) {
        if (this.instance) return;
        this.isSVG = CO(s) && !KJe(s), this.instance = s;
        const { layoutId: l, layout: c, visualElement: d } = this.options;
        if (d && !d.current && d.mount(s), this.root.nodes.add(this), this.parent && this.parent.children.add(this), this.root.hasTreeAnimated && (c || l) && (this.isLayoutDirty = true), t) {
          let u, h = 0;
          const f = () => this.root.updateBlockedByResize = false;
          Fi.read(() => {
            h = window.innerWidth;
          }), t(s, () => {
            const g = window.innerWidth;
            g !== h && (h = g, this.root.updateBlockedByResize = true, u && u(), u = $Xe(f, 250), cC.hasAnimatedSinceResize && (cC.hasAnimatedSinceResize = false, this.nodes.forEach(oJ)));
          });
        }
        l && this.root.registerSharedNode(l, this), this.options.animate !== false && d && (l || c) && this.addEventListener("didUpdate", ({ delta: u, hasLayoutChanged: h, hasRelativeLayoutChanged: f, layout: g }) => {
          if (this.isTreeAnimationBlocked()) {
            this.target = void 0, this.relativeTarget = void 0;
            return;
          }
          const m = this.options.transition || d.getDefaultTransition() || aQe, { onLayoutAnimationStart: v, onLayoutAnimationComplete: y } = d.getProps(), w = !this.targetLayout || !Phe(this.targetLayout, g), b = !h && f;
          if (this.options.layoutRoot || this.resumeFrom || b || h && (w || !this.currentAnimation)) {
            this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0);
            const j = {
              ...vO(m, "layout"),
              onPlay: v,
              onComplete: y
            };
            (d.shouldReduceMotion || this.options.layoutRoot) && (j.delay = 0, j.type = false), this.startAnimation(j), this.setAnimationOrigin(u, b);
          } else h || oJ(this), this.isLead() && this.options.onExitComplete && this.options.onExitComplete();
          this.targetLayout = g;
        });
      }
      unmount() {
        this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
        const s = this.getStack();
        s && s.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, this.eventHandlers.clear(), sh(this.updateProjection);
      }
      blockUpdate() {
        this.updateManuallyBlocked = true;
      }
      unblockUpdate() {
        this.updateManuallyBlocked = false;
      }
      isUpdateBlocked() {
        return this.updateManuallyBlocked || this.updateBlockedByResize;
      }
      isTreeAnimationBlocked() {
        return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || false;
      }
      startUpdate() {
        this.isUpdateBlocked() || (this.isUpdating = true, this.nodes && this.nodes.forEach(nQe), this.animationId++);
      }
      getTransformTemplate() {
        const { visualElement: s } = this.options;
        return s && s.getProps().transformTemplate;
      }
      willUpdate(s = true) {
        if (this.root.hasTreeAnimated = true, this.root.isUpdateBlocked()) {
          this.options.onExitComplete && this.options.onExitComplete();
          return;
        }
        if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear && Lhe(this), !this.root.isUpdating && this.root.startUpdate(), this.isLayoutDirty) return;
        this.isLayoutDirty = true;
        for (let u = 0; u < this.path.length; u++) {
          const h = this.path[u];
          h.shouldResetTransform = true, (typeof h.latestValues.x == "string" || typeof h.latestValues.y == "string") && (h.isLayoutDirty = true), h.updateScroll("snapshot"), h.options.layoutRoot && h.willUpdate(false);
        }
        const { layoutId: l, layout: c } = this.options;
        if (l === void 0 && !c) return;
        const d = this.getTransformTemplate();
        this.prevTransformTemplateValue = d ? d(this.latestValues, "") : void 0, this.updateSnapshot(), s && this.notifyListeners("willUpdate");
      }
      update() {
        if (this.updateScheduled = false, this.isUpdateBlocked()) {
          this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(rJ);
          return;
        }
        if (this.animationId <= this.animationCommitId) {
          this.nodes.forEach(iJ);
          return;
        }
        this.animationCommitId = this.animationId, this.isUpdating ? (this.isUpdating = false, this.nodes.forEach(QXe), this.nodes.forEach(GXe), this.nodes.forEach(YXe)) : this.nodes.forEach(iJ), this.clearAllSnapshots();
        const l = ls.now();
        pa.delta = Wd(0, 1e3 / 60, l - pa.timestamp), pa.timestamp = l, pa.isProcessing = true, eT.update.process(pa), eT.preRender.process(pa), eT.render.process(pa), pa.isProcessing = false;
      }
      didUpdate() {
        this.updateScheduled || (this.updateScheduled = true, wO.read(this.scheduleUpdate));
      }
      clearAllSnapshots() {
        this.nodes.forEach(XXe), this.sharedNodes.forEach(rQe);
      }
      scheduleUpdateProjection() {
        this.projectionUpdateScheduled || (this.projectionUpdateScheduled = true, Fi.preRender(this.updateProjection, false, true));
      }
      scheduleCheckAfterUnmount() {
        Fi.postRender(() => {
          this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
        });
      }
      updateSnapshot() {
        this.snapshot || !this.instance || (this.snapshot = this.measure(), this.snapshot && !cs(this.snapshot.measuredBox.x) && !cs(this.snapshot.measuredBox.y) && (this.snapshot = void 0));
      }
      updateLayout() {
        if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty)) return;
        if (this.resumeFrom && !this.resumeFrom.instance) for (let c = 0; c < this.path.length; c++) this.path[c].updateScroll();
        const s = this.layout;
        this.layout = this.measure(false), this.layoutVersion++, this.layoutCorrected = Uo(), this.isLayoutDirty = false, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
        const { visualElement: l } = this.options;
        l && l.notify("LayoutMeasure", this.layout.layoutBox, s ? s.layoutBox : void 0);
      }
      updateScroll(s = "measure") {
        let l = !!(this.options.layoutScroll && this.instance);
        if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === s && (l = false), l && this.instance) {
          const c = r(this.instance);
          this.scroll = {
            animationId: this.root.animationId,
            phase: s,
            isRoot: c,
            offset: n(this.instance),
            wasRoot: this.scroll ? this.scroll.isRoot : c
          };
        }
      }
      resetTransform() {
        if (!i) return;
        const s = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, l = this.projectionDelta && !Bhe(this.projectionDelta), c = this.getTransformTemplate(), d = c ? c(this.latestValues, "") : void 0, u = d !== this.prevTransformTemplateValue;
        s && this.instance && (l || tg(this.latestValues) || u) && (i(this.instance, d), this.shouldResetTransform = false, this.scheduleRender());
      }
      measure(s = true) {
        const l = this.measurePageBox();
        let c = this.removeElementScroll(l);
        return s && (c = this.removeTransform(c)), sQe(c), {
          animationId: this.root.animationId,
          measuredBox: l,
          layoutBox: c,
          latestValues: {},
          source: this.id
        };
      }
      measurePageBox() {
        var _a6;
        const { visualElement: s } = this.options;
        if (!s) return Uo();
        const l = s.measureViewportBox();
        if (!(((_a6 = this.scroll) == null ? void 0 : _a6.wasRoot) || this.path.some(lQe))) {
          const { scroll: d } = this.root;
          d && (Q0(l.x, d.offset.x), Q0(l.y, d.offset.y));
        }
        return l;
      }
      removeElementScroll(s) {
        var _a6;
        const l = Uo();
        if (vc(l, s), (_a6 = this.scroll) == null ? void 0 : _a6.wasRoot) return l;
        for (let c = 0; c < this.path.length; c++) {
          const d = this.path[c], { scroll: u, options: h } = d;
          d !== this.root && u && h.layoutScroll && (u.wasRoot && vc(l, s), Q0(l.x, u.offset.x), Q0(l.y, u.offset.y));
        }
        return l;
      }
      applyTransform(s, l = false) {
        var _a6, _b3;
        const c = Uo();
        vc(c, s);
        for (let d = 0; d < this.path.length; d++) {
          const u = this.path[d];
          !l && u.options.layoutScroll && u.scroll && u !== u.root && e1(c, {
            x: -u.scroll.offset.x,
            y: -u.scroll.offset.y
          }), tg(u.latestValues) && e1(c, u.latestValues, (_a6 = u.layout) == null ? void 0 : _a6.layoutBox);
        }
        return tg(this.latestValues) && e1(c, this.latestValues, (_b3 = this.layout) == null ? void 0 : _b3.layoutBox), c;
      }
      removeTransform(s) {
        var _a6;
        const l = Uo();
        vc(l, s);
        for (let c = 0; c < this.path.length; c++) {
          const d = this.path[c];
          if (!tg(d.latestValues)) continue;
          let u;
          d.instance && (y8(d.latestValues) && d.updateSnapshot(), u = Uo(), vc(u, d.measurePageBox())), GZ(l, d.latestValues, (_a6 = d.snapshot) == null ? void 0 : _a6.layoutBox, u);
        }
        return tg(this.latestValues) && GZ(l, this.latestValues), l;
      }
      setTargetDelta(s) {
        this.targetDelta = s, this.root.scheduleUpdateProjection(), this.isProjectionDirty = true;
      }
      setOptions(s) {
        this.options = {
          ...this.options,
          ...s,
          crossfade: s.crossfade !== void 0 ? s.crossfade : true
        };
      }
      clearMeasurements() {
        this.scroll = void 0, this.layout = void 0, this.snapshot = void 0, this.prevTransformTemplateValue = void 0, this.targetDelta = void 0, this.target = void 0, this.isLayoutDirty = false;
      }
      forceRelativeParentToResolveTarget() {
        this.relativeParent && this.relativeParent.resolvedRelativeTargetAt !== pa.timestamp && this.relativeParent.resolveTargetDelta(true);
      }
      resolveTargetDelta(s = false) {
        var _a6;
        const l = this.getLead();
        this.isProjectionDirty || (this.isProjectionDirty = l.isProjectionDirty), this.isTransformDirty || (this.isTransformDirty = l.isTransformDirty), this.isSharedProjectionDirty || (this.isSharedProjectionDirty = l.isSharedProjectionDirty);
        const c = !!this.resumingFrom || this !== l;
        if (!(s || c && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a6 = this.parent) == null ? void 0 : _a6.isProjectionDirty) || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize)) return;
        const { layout: u, layoutId: h } = this.options;
        if (!this.layout || !(u || h)) return;
        this.resolvedRelativeTargetAt = pa.timestamp;
        const f = this.getClosestProjectingParent();
        f && this.linkedParentVersion !== f.layoutVersion && !f.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (f && f.layout ? this.createRelativeTarget(f, this.layout.layoutBox, f.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = Uo(), this.targetWithTransforms = Uo()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), RXe(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : vc(this.target, this.layout.layoutBox), xhe(this.target, this.targetDelta)) : vc(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = false, f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? this.createRelativeTarget(f, this.target, f.target) : this.relativeParent = this.relativeTarget = void 0));
      }
      getClosestProjectingParent() {
        if (!(!this.parent || y8(this.parent.latestValues) || bhe(this.parent.latestValues))) return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
      }
      isProjecting() {
        return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
      }
      createRelativeTarget(s, l, c) {
        this.relativeParent = s, this.linkedParentVersion = s.layoutVersion, this.forceRelativeParentToResolveTarget(), this.relativeTarget = Uo(), this.relativeTargetOrigin = Uo(), TE(this.relativeTargetOrigin, l, c), vc(this.relativeTarget, this.relativeTargetOrigin);
      }
      removeRelativeTarget() {
        this.relativeParent = this.relativeTarget = void 0;
      }
      calcProjection() {
        var _a6;
        const s = this.getLead(), l = !!this.resumingFrom || this !== s;
        let c = true;
        if ((this.isProjectionDirty || ((_a6 = this.parent) == null ? void 0 : _a6.isProjectionDirty)) && (c = false), l && (this.isSharedProjectionDirty || this.isTransformDirty) && (c = false), this.resolvedRelativeTargetAt === pa.timestamp && (c = false), c) return;
        const { layout: d, layoutId: u } = this.options;
        if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(d || u)) return;
        vc(this.layoutCorrected, this.layout.layoutBox);
        const h = this.treeScale.x, f = this.treeScale.y;
        aXe(this.layoutCorrected, this.treeScale, this.path, l), s.layout && !s.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (s.target = s.layout.layoutBox, s.targetWithTransforms = Uo());
        const { target: g } = s;
        if (!g) {
          this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
          return;
        }
        !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (VZ(this.prevProjectionDelta.x, this.projectionDelta.x), VZ(this.prevProjectionDelta.y, this.projectionDelta.y)), m2(this.projectionDelta, this.layoutCorrected, g, this.latestValues), (this.treeScale.x !== h || this.treeScale.y !== f || !QZ(this.projectionDelta.x, this.prevProjectionDelta.x) || !QZ(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = true, this.scheduleRender(), this.notifyListeners("projectionUpdate", g));
      }
      hide() {
        this.isVisible = false;
      }
      show() {
        this.isVisible = true;
      }
      scheduleRender(s = true) {
        var _a6;
        if ((_a6 = this.options.visualElement) == null ? void 0 : _a6.scheduleRender(), s) {
          const l = this.getStack();
          l && l.scheduleRender();
        }
        this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
      }
      createProjectionDeltas() {
        this.prevProjectionDelta = X0(), this.projectionDelta = X0(), this.projectionDeltaWithTransform = X0();
      }
      setAnimationOrigin(s, l = false) {
        const c = this.snapshot, d = c ? c.latestValues : {}, u = {
          ...this.latestValues
        }, h = X0();
        (!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !l;
        const f = Uo(), g = c ? c.source : void 0, m = this.layout ? this.layout.source : void 0, v = g !== m, y = this.getStack(), w = !y || y.members.length <= 1, b = !!(v && !w && this.options.crossfade === true && !this.path.some(oQe));
        this.animationProgress = 0;
        let j;
        this.mixTargetDelta = (k) => {
          const C = k / 1e3;
          aJ(h.x, s.x, C), aJ(h.y, s.y, C), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (TE(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), iQe(this.relativeTarget, this.relativeTargetOrigin, f, C), j && PXe(this.relativeTarget, j) && (this.isProjectionDirty = false), j || (j = Uo()), vc(j, this.relativeTarget)), v && (this.animationValues = u, LXe(u, d, this.latestValues, C, b, w)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = C;
        }, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
      }
      startAnimation(s) {
        var _a6, _b3, _c3;
        this.notifyListeners("animationStart"), (_a6 = this.currentAnimation) == null ? void 0 : _a6.stop(), (_c3 = (_b3 = this.resumingFrom) == null ? void 0 : _b3.currentAnimation) == null ? void 0 : _c3.stop(), this.pendingAnimation && (sh(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = Fi.update(() => {
          cC.hasAnimatedSinceResize = true, this.motionValue || (this.motionValue = up(0)), this.motionValue.jump(0, false), this.currentAnimation = UXe(this.motionValue, [
            0,
            1e3
          ], {
            ...s,
            velocity: 0,
            isSync: true,
            onUpdate: (l) => {
              this.mixTargetDelta(l), s.onUpdate && s.onUpdate(l);
            },
            onStop: () => {
            },
            onComplete: () => {
              s.onComplete && s.onComplete(), this.completeAnimation();
            }
          }), this.resumingFrom && (this.resumingFrom.currentAnimation = this.currentAnimation), this.pendingAnimation = void 0;
        });
      }
      completeAnimation() {
        this.resumingFrom && (this.resumingFrom.currentAnimation = void 0, this.resumingFrom.preserveOpacity = void 0);
        const s = this.getStack();
        s && s.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
      }
      finishAnimation() {
        this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(qXe), this.currentAnimation.stop()), this.completeAnimation();
      }
      applyTransformsToTarget() {
        const s = this.getLead();
        let { targetWithTransforms: l, target: c, layout: d, latestValues: u } = s;
        if (!(!l || !c || !d)) {
          if (this !== s && this.layout && d && zhe(this.options.animationType, this.layout.layoutBox, d.layoutBox)) {
            c = this.target || Uo();
            const h = cs(this.layout.layoutBox.x);
            c.x.min = s.target.x.min, c.x.max = c.x.min + h;
            const f = cs(this.layout.layoutBox.y);
            c.y.min = s.target.y.min, c.y.max = c.y.min + f;
          }
          vc(l, c), e1(l, u), m2(this.projectionDeltaWithTransform, this.layoutCorrected, l, u);
        }
      }
      registerSharedNode(s, l) {
        this.sharedNodes.has(s) || this.sharedNodes.set(s, new WXe()), this.sharedNodes.get(s).add(l);
        const d = l.options.initialPromotionConfig;
        l.promote({
          transition: d ? d.transition : void 0,
          preserveFollowOpacity: d && d.shouldPreserveFollowOpacity ? d.shouldPreserveFollowOpacity(l) : void 0
        });
      }
      isLead() {
        const s = this.getStack();
        return s ? s.lead === this : true;
      }
      getLead() {
        var _a6;
        const { layoutId: s } = this.options;
        return s ? ((_a6 = this.getStack()) == null ? void 0 : _a6.lead) || this : this;
      }
      getPrevLead() {
        var _a6;
        const { layoutId: s } = this.options;
        return s ? (_a6 = this.getStack()) == null ? void 0 : _a6.prevLead : void 0;
      }
      getStack() {
        const { layoutId: s } = this.options;
        if (s) return this.root.sharedNodes.get(s);
      }
      promote({ needsReset: s, transition: l, preserveFollowOpacity: c } = {}) {
        const d = this.getStack();
        d && d.promote(this, c), s && (this.projectionDelta = void 0, this.needsReset = true), l && this.setOptions({
          transition: l
        });
      }
      relegate() {
        const s = this.getStack();
        return s ? s.relegate(this) : false;
      }
      resetSkewAndRotation() {
        const { visualElement: s } = this.options;
        if (!s) return;
        let l = false;
        const { latestValues: c } = s;
        if ((c.z || c.rotate || c.rotateX || c.rotateY || c.rotateZ || c.skewX || c.skewY) && (l = true), !l) return;
        const d = {};
        c.z && cT("z", s, d, this.animationValues);
        for (let u = 0; u < lT.length; u++) cT(`rotate${lT[u]}`, s, d, this.animationValues), cT(`skew${lT[u]}`, s, d, this.animationValues);
        s.render();
        for (const u in d) s.setStaticValue(u, d[u]), this.animationValues && (this.animationValues[u] = d[u]);
        s.scheduleRender();
      }
      applyProjectionStyles(s, l) {
        if (!this.instance || this.isSVG) return;
        if (!this.isVisible) {
          s.visibility = "hidden";
          return;
        }
        const c = this.getTransformTemplate();
        if (this.needsReset) {
          this.needsReset = false, s.visibility = "", s.opacity = "", s.pointerEvents = lC(l == null ? void 0 : l.pointerEvents) || "", s.transform = c ? c(this.latestValues, "") : "none";
          return;
        }
        const d = this.getLead();
        if (!this.projectionDelta || !this.layout || !d.target) {
          this.options.layoutId && (s.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, s.pointerEvents = lC(l == null ? void 0 : l.pointerEvents) || ""), this.hasProjected && !tg(this.latestValues) && (s.transform = c ? c({}, "") : "none", this.hasProjected = false);
          return;
        }
        s.visibility = "";
        const u = d.animationValues || d.latestValues;
        this.applyTransformsToTarget();
        let h = MXe(this.projectionDeltaWithTransform, this.treeScale, u);
        c && (h = c(u, h)), s.transform = h;
        const { x: f, y: g } = this.projectionDelta;
        s.transformOrigin = `${f.origin * 100}% ${g.origin * 100}% 0`, d.animationValues ? s.opacity = d === this ? u.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : u.opacityExit : s.opacity = d === this ? u.opacity !== void 0 ? u.opacity : "" : u.opacityExit !== void 0 ? u.opacityExit : 0;
        for (const m in x8) {
          if (u[m] === void 0) continue;
          const { correct: v, applyTo: y, isCSSVariable: w } = x8[m], b = h === "none" ? u[m] : v(u[m], d);
          if (y) {
            const j = y.length;
            for (let k = 0; k < j; k++) s[y[k]] = b;
          } else w ? this.options.visualElement.renderState.vars[m] = b : s[m] = b;
        }
        this.options.layoutId && (s.pointerEvents = d === this ? lC(l == null ? void 0 : l.pointerEvents) || "" : "none");
      }
      clearSnapshot() {
        this.resumeFrom = this.snapshot = void 0;
      }
      resetTree() {
        this.root.nodes.forEach((s) => {
          var _a6;
          return (_a6 = s.currentAnimation) == null ? void 0 : _a6.stop();
        }), this.root.nodes.forEach(rJ), this.root.sharedNodes.clear();
      }
    };
  }
  function GXe(t) {
    t.updateLayout();
  }
  function YXe(t) {
    var _a6;
    const e = ((_a6 = t.resumeFrom) == null ? void 0 : _a6.snapshot) || t.snapshot;
    if (t.isLead() && t.layout && e && t.hasListeners("didUpdate")) {
      const { layoutBox: n, measuredBox: r } = t.layout, { animationType: i } = t.options, a = e.source !== t.layout.source;
      i === "size" ? Cd((u) => {
        const h = a ? e.measuredBox[u] : e.layoutBox[u], f = cs(h);
        h.min = n[u].min, h.max = h.min + f;
      }) : zhe(i, e.layoutBox, n) && Cd((u) => {
        const h = a ? e.measuredBox[u] : e.layoutBox[u], f = cs(n[u]);
        h.max = h.min + f, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = true, t.relativeTarget[u].max = t.relativeTarget[u].min + f);
      });
      const s = X0();
      m2(s, n, e.layoutBox);
      const l = X0();
      a ? m2(l, t.applyTransform(r, true), e.measuredBox) : m2(l, n, e.layoutBox);
      const c = !Bhe(s);
      let d = false;
      if (!t.resumeFrom) {
        const u = t.getClosestProjectingParent();
        if (u && !u.resumeFrom) {
          const { snapshot: h, layout: f } = u;
          if (h && f) {
            const g = Uo();
            TE(g, e.layoutBox, h.layoutBox);
            const m = Uo();
            TE(m, n, f.layoutBox), Phe(g, m) || (d = true), u.options.layoutRoot && (t.relativeTarget = m, t.relativeTargetOrigin = g, t.relativeParent = u);
          }
        }
      }
      t.notifyListeners("didUpdate", {
        layout: n,
        snapshot: e,
        delta: l,
        layoutDelta: s,
        hasLayoutChanged: c,
        hasRelativeLayoutChanged: d
      });
    } else if (t.isLead()) {
      const { onExitComplete: n } = t.options;
      n && n();
    }
    t.options.transition = void 0;
  }
  function ZXe(t) {
    t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
  }
  function JXe(t) {
    t.isProjectionDirty = t.isSharedProjectionDirty = t.isTransformDirty = false;
  }
  function XXe(t) {
    t.clearSnapshot();
  }
  function rJ(t) {
    t.clearMeasurements();
  }
  function iJ(t) {
    t.isLayoutDirty = false;
  }
  function QXe(t) {
    const { visualElement: e } = t.options;
    e && e.getProps().onBeforeLayoutMeasure && e.notify("BeforeLayoutMeasure"), t.resetTransform();
  }
  function oJ(t) {
    t.finishAnimation(), t.targetDelta = t.relativeTarget = t.target = void 0, t.isProjectionDirty = true;
  }
  function eQe(t) {
    t.resolveTargetDelta();
  }
  function tQe(t) {
    t.calcProjection();
  }
  function nQe(t) {
    t.resetSkewAndRotation();
  }
  function rQe(t) {
    t.removeLeadSnapshot();
  }
  function aJ(t, e, n) {
    t.translate = eo(e.translate, 0, n), t.scale = eo(e.scale, 1, n), t.origin = e.origin, t.originPoint = e.originPoint;
  }
  function sJ(t, e, n, r) {
    t.min = eo(e.min, n.min, r), t.max = eo(e.max, n.max, r);
  }
  function iQe(t, e, n, r) {
    sJ(t.x, e.x, n.x, r), sJ(t.y, e.y, n.y, r);
  }
  function oQe(t) {
    return t.animationValues && t.animationValues.opacityExit !== void 0;
  }
  const aQe = {
    duration: 0.45,
    ease: [
      0.4,
      0,
      0.1,
      1
    ]
  }, lJ = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t), cJ = lJ("applewebkit/") && !lJ("chrome/") ? Math.round : $l;
  function dJ(t) {
    t.min = cJ(t.min), t.max = cJ(t.max);
  }
  function sQe(t) {
    dJ(t.x), dJ(t.y);
  }
  function zhe(t, e, n) {
    return t === "position" || t === "preserve-aspect" && !TXe(XZ(e), XZ(n), 0.2);
  }
  function lQe(t) {
    var _a6;
    return t !== t.root && ((_a6 = t.scroll) == null ? void 0 : _a6.wasRoot);
  }
  const cQe = Nhe({
    attachResizeListener: (t, e) => jb(t, "resize", e),
    measureScroll: () => {
      var _a6, _b3;
      return {
        x: document.documentElement.scrollLeft || ((_a6 = document.body) == null ? void 0 : _a6.scrollLeft) || 0,
        y: document.documentElement.scrollTop || ((_b3 = document.body) == null ? void 0 : _b3.scrollTop) || 0
      };
    },
    checkIsScrollRoot: () => true
  }), dT = {
    current: void 0
  }, Uhe = Nhe({
    measureScroll: (t) => ({
      x: t.scrollLeft,
      y: t.scrollTop
    }),
    defaultParent: () => {
      if (!dT.current) {
        const t = new cQe({});
        t.mount(window), t.setOptions({
          layoutScroll: true
        }), dT.current = t;
      }
      return dT.current;
    },
    resetTransform: (t, e) => {
      t.style.transform = e !== void 0 ? e : "none";
    },
    checkIsScrollRoot: (t) => window.getComputedStyle(t).position === "fixed"
  }), kS = p.createContext({
    transformPagePoint: (t) => t,
    isStatic: false,
    reducedMotion: "never"
  });
  function dQe(t = true) {
    const e = p.useContext(iO);
    if (e === null) return [
      true,
      null
    ];
    const { isPresent: n, onExitComplete: r, register: i } = e, a = p.useId();
    p.useEffect(() => {
      if (t) return i(a);
    }, [
      t
    ]);
    const s = p.useCallback(() => t && r && r(a), [
      a,
      r,
      t
    ]);
    return !n && r ? [
      false,
      s
    ] : [
      true
    ];
  }
  const Vhe = p.createContext({
    strict: false
  }), uJ = {
    animation: [
      "animate",
      "variants",
      "whileHover",
      "whileTap",
      "exit",
      "whileInView",
      "whileFocus",
      "whileDrag"
    ],
    exit: [
      "exit"
    ],
    drag: [
      "drag",
      "dragControls"
    ],
    focus: [
      "whileFocus"
    ],
    hover: [
      "whileHover",
      "onHoverStart",
      "onHoverEnd"
    ],
    tap: [
      "whileTap",
      "onTap",
      "onTapStart",
      "onTapCancel"
    ],
    pan: [
      "onPan",
      "onPanStart",
      "onPanSessionStart",
      "onPanEnd"
    ],
    inView: [
      "whileInView",
      "onViewportEnter",
      "onViewportLeave"
    ],
    layout: [
      "layout",
      "layoutId"
    ]
  };
  let hJ = false;
  function uQe() {
    if (hJ) return;
    const t = {};
    for (const e in uJ) t[e] = {
      isEnabled: (n) => uJ[e].some((r) => !!n[r])
    };
    vhe(t), hJ = true;
  }
  function Hhe() {
    return uQe(), nXe();
  }
  function hQe(t) {
    const e = Hhe();
    for (const n in t) e[n] = {
      ...e[n],
      ...t[n]
    };
    vhe(e);
  }
  const fQe = /* @__PURE__ */ new Set([
    "animate",
    "exit",
    "variants",
    "initial",
    "style",
    "values",
    "variants",
    "transition",
    "transformTemplate",
    "custom",
    "inherit",
    "onBeforeLayoutMeasure",
    "onAnimationStart",
    "onAnimationComplete",
    "onUpdate",
    "onDragStart",
    "onDrag",
    "onDragEnd",
    "onMeasureDragConstraints",
    "onDirectionLock",
    "onDragTransitionEnd",
    "_dragX",
    "_dragY",
    "onHoverStart",
    "onHoverEnd",
    "onViewportEnter",
    "onViewportLeave",
    "globalTapTarget",
    "propagate",
    "ignoreStrict",
    "viewport"
  ]);
  function RE(t) {
    return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || fQe.has(t);
  }
  let $he = (t) => !RE(t);
  function mQe(t) {
    typeof t == "function" && ($he = (e) => e.startsWith("on") ? !RE(e) : t(e));
  }
  try {
    mQe(require("@emotion/is-prop-valid").default);
  } catch {
  }
  function gQe(t, e, n) {
    const r = {};
    for (const i in t) i === "values" && typeof t.values == "object" || ($he(i) || n === true && RE(i) || !e && !RE(i) || t.draggable && i.startsWith("onDrag")) && (r[i] = t[i]);
    return r;
  }
  const SS = p.createContext({});
  function pQe(t, e) {
    if (ES(t)) {
      const { initial: n, animate: r } = t;
      return {
        initial: n === false || Sb(n) ? n : void 0,
        animate: Sb(r) ? r : void 0
      };
    }
    return t.inherit !== false ? e : {};
  }
  function FQe(t) {
    const { initial: e, animate: n } = pQe(t, p.useContext(SS));
    return p.useMemo(() => ({
      initial: e,
      animate: n
    }), [
      fJ(e),
      fJ(n)
    ]);
  }
  function fJ(t) {
    return Array.isArray(t) ? t.join(" ") : t;
  }
  const TO = () => ({
    style: {},
    transform: {},
    transformOrigin: {},
    vars: {}
  });
  function Whe(t, e, n) {
    for (const r in e) !aa(e[r]) && !Che(r, n) && (t[r] = e[r]);
  }
  function vQe({ transformTemplate: t }, e) {
    return p.useMemo(() => {
      const n = TO();
      return SO(n, e, t), Object.assign({}, n.vars, n.style);
    }, [
      e
    ]);
  }
  function _Qe(t, e) {
    const n = t.style || {}, r = {};
    return Whe(r, n, t), Object.assign(r, vQe(t, e)), r;
  }
  function yQe(t, e) {
    const n = {}, r = _Qe(t, e);
    return t.drag && t.dragListener !== false && (n.draggable = false, r.userSelect = r.WebkitUserSelect = r.WebkitTouchCallout = "none", r.touchAction = t.drag === true ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = r, n;
  }
  const qhe = () => ({
    ...TO(),
    attrs: {}
  });
  function bQe(t, e, n, r) {
    const i = p.useMemo(() => {
      const a = qhe();
      return Ehe(a, e, She(r), t.transformTemplate, t.style), {
        ...a.attrs,
        style: {
          ...a.style
        }
      };
    }, [
      e
    ]);
    if (t.style) {
      const a = {};
      Whe(a, t.style, t), i.style = {
        ...a,
        ...i.style
      };
    }
    return i;
  }
  const xQe = [
    "animate",
    "circle",
    "defs",
    "desc",
    "ellipse",
    "g",
    "image",
    "line",
    "filter",
    "marker",
    "mask",
    "metadata",
    "path",
    "pattern",
    "polygon",
    "polyline",
    "rect",
    "stop",
    "switch",
    "symbol",
    "svg",
    "text",
    "tspan",
    "use",
    "view"
  ];
  function RO(t) {
    return typeof t != "string" || t.includes("-") ? false : !!(xQe.indexOf(t) > -1 || /[A-Z]/u.test(t));
  }
  function wQe(t, e, n, { latestValues: r }, i, a = false, s) {
    const c = (s ?? RO(t) ? bQe : yQe)(e, r, i, t), d = gQe(e, typeof t == "string", a), u = t !== p.Fragment ? {
      ...d,
      ...c,
      ref: n
    } : {}, { children: h } = e, f = p.useMemo(() => aa(h) ? h.get() : h, [
      h
    ]);
    return p.createElement(t, {
      ...u,
      children: f
    });
  }
  function DQe({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, r, i) {
    return {
      latestValues: CQe(n, r, i, t),
      renderState: e()
    };
  }
  function CQe(t, e, n, r) {
    const i = {}, a = r(t, {});
    for (const f in a) i[f] = lC(a[f]);
    let { initial: s, animate: l } = t;
    const c = ES(t), d = phe(t);
    e && d && !c && t.inherit !== false && (s === void 0 && (s = e.initial), l === void 0 && (l = e.animate));
    let u = n ? n.initial === false : false;
    u = u || s === false;
    const h = u ? l : s;
    if (h && typeof h != "boolean" && !CS(h)) {
      const f = Array.isArray(h) ? h : [
        h
      ];
      for (let g = 0; g < f.length; g++) {
        const m = yO(t, f[g]);
        if (m) {
          const { transitionEnd: v, transition: y, ...w } = m;
          for (const b in w) {
            let j = w[b];
            if (Array.isArray(j)) {
              const k = u ? j.length - 1 : 0;
              j = j[k];
            }
            j !== null && (i[b] = j);
          }
          for (const b in v) i[b] = v[b];
        }
      }
    }
    return i;
  }
  const Khe = (t) => (e, n) => {
    const r = p.useContext(SS), i = p.useContext(iO), a = () => DQe(t, e, r, i);
    return n ? a() : Cb(a);
  }, EQe = Khe({
    scrapeMotionValuesFromProps: jO,
    createRenderState: TO
  }), kQe = Khe({
    scrapeMotionValuesFromProps: jhe,
    createRenderState: qhe
  }), SQe = /* @__PURE__ */ Symbol.for("motionComponentSymbol");
  function jQe(t, e, n) {
    const r = p.useRef(n);
    p.useInsertionEffect(() => {
      r.current = n;
    });
    const i = p.useRef(null);
    return p.useCallback((a) => {
      var _a6;
      a && ((_a6 = t.onMount) == null ? void 0 : _a6.call(t, a)), e && (a ? e.mount(a) : e.unmount());
      const s = r.current;
      if (typeof s == "function") if (a) {
        const l = s(a);
        typeof l == "function" && (i.current = l);
      } else i.current ? (i.current(), i.current = null) : s(a);
      else s && (s.current = a);
    }, [
      e
    ]);
  }
  const Ghe = p.createContext({});
  function O0(t) {
    return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
  }
  function TQe(t, e, n, r, i, a) {
    var _a6, _b3;
    const { visualElement: s } = p.useContext(SS), l = p.useContext(Vhe), c = p.useContext(iO), d = p.useContext(kS), u = d.reducedMotion, h = d.skipAnimations, f = p.useRef(null), g = p.useRef(false);
    r = r || l.renderer, !f.current && r && (f.current = r(t, {
      visualState: e,
      parent: s,
      props: n,
      presenceContext: c,
      blockInitialAnimation: c ? c.initial === false : false,
      reducedMotionConfig: u,
      skipAnimations: h,
      isSVG: a
    }), g.current && f.current && (f.current.manuallyAnimateOnMount = true));
    const m = f.current, v = p.useContext(Ghe);
    m && !m.projection && i && (m.type === "html" || m.type === "svg") && RQe(f.current, n, i, v);
    const y = p.useRef(false);
    p.useInsertionEffect(() => {
      m && y.current && m.update(n, c);
    });
    const w = n[rhe], b = p.useRef(!!w && !((_a6 = window.MotionHandoffIsComplete) == null ? void 0 : _a6.call(window, w)) && ((_b3 = window.MotionHasOptimisedAnimation) == null ? void 0 : _b3.call(window, w)));
    return gue(() => {
      g.current = true, m && (y.current = true, window.MotionIsMounted = true, m.updateFeatures(), m.scheduleRenderMicrotask(), b.current && m.animationState && m.animationState.animateChanges());
    }), p.useEffect(() => {
      m && (!b.current && m.animationState && m.animationState.animateChanges(), b.current && (queueMicrotask(() => {
        var _a7;
        (_a7 = window.MotionHandoffMarkAsComplete) == null ? void 0 : _a7.call(window, w);
      }), b.current = false), m.enteringChildren = void 0);
    }), m;
  }
  function RQe(t, e, n, r) {
    const { layoutId: i, layout: a, drag: s, dragConstraints: l, layoutScroll: c, layoutRoot: d, layoutCrossfade: u } = e;
    t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Yhe(t.parent)), t.projection.setOptions({
      layoutId: i,
      layout: a,
      alwaysMeasureLayout: !!s || l && O0(l),
      visualElement: t,
      animationType: typeof a == "string" ? a : "both",
      initialPromotionConfig: r,
      crossfade: u,
      layoutScroll: c,
      layoutRoot: d
    });
  }
  function Yhe(t) {
    if (t) return t.options.allowProjection !== false ? t.projection : Yhe(t.parent);
  }
  function uT(t, { forwardMotionProps: e = false, type: n } = {}, r, i) {
    r && hQe(r);
    const a = n ? n === "svg" : RO(t), s = a ? kQe : EQe;
    function l(d, u) {
      let h;
      const f = {
        ...p.useContext(kS),
        ...d,
        layoutId: AQe(d)
      }, { isStatic: g } = f, m = FQe(d), v = s(d, g);
      if (!g && mue) {
        IQe();
        const y = BQe(f);
        h = y.MeasureLayout, m.visualElement = TQe(t, v, f, i, y.ProjectionNode, a);
      }
      return o.jsxs(SS.Provider, {
        value: m,
        children: [
          h && m.visualElement ? o.jsx(h, {
            visualElement: m.visualElement,
            ...f
          }) : null,
          wQe(t, d, jQe(v, m.visualElement, u), v, g, e, a)
        ]
      });
    }
    l.displayName = `motion.${typeof t == "string" ? t : `create(${t.displayName ?? t.name ?? ""})`}`;
    const c = p.forwardRef(l);
    return c[SQe] = t, c;
  }
  function AQe({ layoutId: t }) {
    const e = p.useContext(fue).id;
    return e && t !== void 0 ? e + "-" + t : t;
  }
  function IQe(t, e) {
    p.useContext(Vhe).strict;
  }
  function BQe(t) {
    const e = Hhe(), { drag: n, layout: r } = e;
    if (!n && !r) return {};
    const i = {
      ...n,
      ...r
    };
    return {
      MeasureLayout: (n == null ? void 0 : n.isEnabled(t)) || (r == null ? void 0 : r.isEnabled(t)) ? i.MeasureLayout : void 0,
      ProjectionNode: i.ProjectionNode
    };
  }
  function PQe(t, e) {
    if (typeof Proxy > "u") return uT;
    const n = /* @__PURE__ */ new Map(), r = (a, s) => uT(a, s, t, e), i = (a, s) => r(a, s);
    return new Proxy(i, {
      get: (a, s) => s === "create" ? r : (n.has(s) || n.set(s, uT(s, void 0, t, e)), n.get(s))
    });
  }
  const MQe = (t, e) => e.isSVG ?? RO(t) ? new _Xe(e) : new fXe(e, {
    allowProjection: t !== p.Fragment
  });
  class OQe extends lm {
    constructor(e) {
      super(e), e.animationState || (e.animationState = DXe(e));
    }
    updateAnimationControlsSubscription() {
      const { animate: e } = this.node.getProps();
      CS(e) && (this.unmountControls = e.subscribe(this.node));
    }
    mount() {
      this.updateAnimationControlsSubscription();
    }
    update() {
      const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
      e !== n && this.updateAnimationControlsSubscription();
    }
    unmount() {
      var _a6;
      this.node.animationState.reset(), (_a6 = this.unmountControls) == null ? void 0 : _a6.call(this);
    }
  }
  let LQe = 0;
  class NQe extends lm {
    constructor() {
      super(...arguments), this.id = LQe++;
    }
    update() {
      if (!this.node.presenceContext) return;
      const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: r } = this.node.prevPresenceContext || {};
      if (!this.node.animationState || e === r) return;
      const i = this.node.animationState.setActive("exit", !e);
      n && !e && i.then(() => {
        n(this.id);
      });
    }
    mount() {
      const { register: e, onExitComplete: n } = this.node.presenceContext || {};
      n && n(this.id), e && (this.unmount = e(this.id));
    }
    unmount() {
    }
  }
  const zQe = {
    animation: {
      Feature: OQe
    },
    exit: {
      Feature: NQe
    }
  };
  function S3(t) {
    return {
      point: {
        x: t.pageX,
        y: t.pageY
      }
    };
  }
  const UQe = (t) => (e) => DO(e) && t(e, S3(e));
  function g2(t, e, n, r) {
    return jb(t, e, UQe(n), r);
  }
  const Zhe = ({ current: t }) => t ? t.ownerDocument.defaultView : null, mJ = (t, e) => Math.abs(t - e);
  function VQe(t, e) {
    const n = mJ(t.x, e.x), r = mJ(t.y, e.y);
    return Math.sqrt(n ** 2 + r ** 2);
  }
  const gJ = /* @__PURE__ */ new Set([
    "auto",
    "scroll"
  ]);
  class Jhe {
    constructor(e, n, { transformPagePoint: r, contextWindow: i = window, dragSnapToOrigin: a = false, distanceThreshold: s = 3, element: l } = {}) {
      if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.scrollPositions = /* @__PURE__ */ new Map(), this.removeScrollListeners = null, this.onElementScroll = (g) => {
        this.handleScroll(g.target);
      }, this.onWindowScroll = () => {
        this.handleScroll(window);
      }, this.updatePoint = () => {
        if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return;
        const g = fT(this.lastMoveEventInfo, this.history), m = this.startEvent !== null, v = VQe(g.offset, {
          x: 0,
          y: 0
        }) >= this.distanceThreshold;
        if (!m && !v) return;
        const { point: y } = g, { timestamp: w } = pa;
        this.history.push({
          ...y,
          timestamp: w
        });
        const { onStart: b, onMove: j } = this.handlers;
        m || (b && b(this.lastMoveEvent, g), this.startEvent = this.lastMoveEvent), j && j(this.lastMoveEvent, g);
      }, this.handlePointerMove = (g, m) => {
        this.lastMoveEvent = g, this.lastMoveEventInfo = hT(m, this.transformPagePoint), Fi.update(this.updatePoint, true);
      }, this.handlePointerUp = (g, m) => {
        this.end();
        const { onEnd: v, onSessionEnd: y, resumeAnimation: w } = this.handlers;
        if ((this.dragSnapToOrigin || !this.startEvent) && w && w(), !(this.lastMoveEvent && this.lastMoveEventInfo)) return;
        const b = fT(g.type === "pointercancel" ? this.lastMoveEventInfo : hT(m, this.transformPagePoint), this.history);
        this.startEvent && v && v(g, b), y && y(g, b);
      }, !DO(e)) return;
      this.dragSnapToOrigin = a, this.handlers = n, this.transformPagePoint = r, this.distanceThreshold = s, this.contextWindow = i || window;
      const c = S3(e), d = hT(c, this.transformPagePoint), { point: u } = d, { timestamp: h } = pa;
      this.history = [
        {
          ...u,
          timestamp: h
        }
      ];
      const { onSessionStart: f } = n;
      f && f(e, fT(d, this.history)), this.removeListeners = C3(g2(this.contextWindow, "pointermove", this.handlePointerMove), g2(this.contextWindow, "pointerup", this.handlePointerUp), g2(this.contextWindow, "pointercancel", this.handlePointerUp)), l && this.startScrollTracking(l);
    }
    startScrollTracking(e) {
      let n = e.parentElement;
      for (; n; ) {
        const r = getComputedStyle(n);
        (gJ.has(r.overflowX) || gJ.has(r.overflowY)) && this.scrollPositions.set(n, {
          x: n.scrollLeft,
          y: n.scrollTop
        }), n = n.parentElement;
      }
      this.scrollPositions.set(window, {
        x: window.scrollX,
        y: window.scrollY
      }), window.addEventListener("scroll", this.onElementScroll, {
        capture: true
      }), window.addEventListener("scroll", this.onWindowScroll), this.removeScrollListeners = () => {
        window.removeEventListener("scroll", this.onElementScroll, {
          capture: true
        }), window.removeEventListener("scroll", this.onWindowScroll);
      };
    }
    handleScroll(e) {
      const n = this.scrollPositions.get(e);
      if (!n) return;
      const r = e === window, i = r ? {
        x: window.scrollX,
        y: window.scrollY
      } : {
        x: e.scrollLeft,
        y: e.scrollTop
      }, a = {
        x: i.x - n.x,
        y: i.y - n.y
      };
      a.x === 0 && a.y === 0 || (r ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += a.x, this.lastMoveEventInfo.point.y += a.y) : this.history.length > 0 && (this.history[0].x -= a.x, this.history[0].y -= a.y), this.scrollPositions.set(e, i), Fi.update(this.updatePoint, true));
    }
    updateHandlers(e) {
      this.handlers = e;
    }
    end() {
      this.removeListeners && this.removeListeners(), this.removeScrollListeners && this.removeScrollListeners(), this.scrollPositions.clear(), sh(this.updatePoint);
    }
  }
  function hT(t, e) {
    return e ? {
      point: e(t.point)
    } : t;
  }
  function pJ(t, e) {
    return {
      x: t.x - e.x,
      y: t.y - e.y
    };
  }
  function fT({ point: t }, e) {
    return {
      point: t,
      delta: pJ(t, Xhe(e)),
      offset: pJ(t, HQe(e)),
      velocity: $Qe(e, 0.1)
    };
  }
  function HQe(t) {
    return t[0];
  }
  function Xhe(t) {
    return t[t.length - 1];
  }
  function $Qe(t, e) {
    if (t.length < 2) return {
      x: 0,
      y: 0
    };
    let n = t.length - 1, r = null;
    const i = Xhe(t);
    for (; n >= 0 && (r = t[n], !(i.timestamp - r.timestamp > dl(e))); ) n--;
    if (!r) return {
      x: 0,
      y: 0
    };
    r === t[0] && t.length > 2 && i.timestamp - r.timestamp > dl(e) * 2 && (r = t[1]);
    const a = zl(i.timestamp - r.timestamp);
    if (a === 0) return {
      x: 0,
      y: 0
    };
    const s = {
      x: (i.x - r.x) / a,
      y: (i.y - r.y) / a
    };
    return s.x === 1 / 0 && (s.x = 0), s.y === 1 / 0 && (s.y = 0), s;
  }
  function WQe(t, { min: e, max: n }, r) {
    return e !== void 0 && t < e ? t = r ? eo(e, t, r.min) : Math.max(t, e) : n !== void 0 && t > n && (t = r ? eo(n, t, r.max) : Math.min(t, n)), t;
  }
  function FJ(t, e, n) {
    return {
      min: e !== void 0 ? t.min + e : void 0,
      max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
    };
  }
  function qQe(t, { top: e, left: n, bottom: r, right: i }) {
    return {
      x: FJ(t.x, n, i),
      y: FJ(t.y, e, r)
    };
  }
  function vJ(t, e) {
    let n = e.min - t.min, r = e.max - t.max;
    return e.max - e.min < t.max - t.min && ([n, r] = [
      r,
      n
    ]), {
      min: n,
      max: r
    };
  }
  function KQe(t, e) {
    return {
      x: vJ(t.x, e.x),
      y: vJ(t.y, e.y)
    };
  }
  function GQe(t, e) {
    let n = 0.5;
    const r = cs(t), i = cs(e);
    return i > r ? n = Eb(e.min, e.max - r, t.min) : r > i && (n = Eb(t.min, t.max - i, e.min)), Wd(0, 1, n);
  }
  function YQe(t, e) {
    const n = {};
    return e.min !== void 0 && (n.min = e.min - t.min), e.max !== void 0 && (n.max = e.max - t.min), n;
  }
  const w8 = 0.35;
  function ZQe(t = w8) {
    return t === false ? t = 0 : t === true && (t = w8), {
      x: _J(t, "left", "right"),
      y: _J(t, "top", "bottom")
    };
  }
  function _J(t, e, n) {
    return {
      min: yJ(t, e),
      max: yJ(t, n)
    };
  }
  function yJ(t, e) {
    return typeof t == "number" ? t : t[e] || 0;
  }
  const JQe = /* @__PURE__ */ new WeakMap();
  class XQe {
    constructor(e) {
      this.openDragLock = null, this.isDragging = false, this.currentDirection = null, this.originPoint = {
        x: 0,
        y: 0
      }, this.constraints = false, this.hasMutatedConstraints = false, this.elastic = Uo(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = e;
    }
    start(e, { snapToCursor: n = false, distanceThreshold: r } = {}) {
      const { presenceContext: i } = this.visualElement;
      if (i && i.isPresent === false) return;
      const a = (h) => {
        n && this.snapToCursor(S3(h).point), this.stopAnimation();
      }, s = (h, f) => {
        const { drag: g, dragPropagation: m, onDragStart: v } = this.getProps();
        if (g && !m && (this.openDragLock && this.openDragLock(), this.openDragLock = TJe(g), !this.openDragLock)) return;
        this.latestPointerEvent = h, this.latestPanInfo = f, this.isDragging = true, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = true, this.visualElement.projection.target = void 0), Cd((w) => {
          let b = this.getAxisMotionValue(w).get() || 0;
          if (Nd.test(b)) {
            const { projection: j } = this.visualElement;
            if (j && j.layout) {
              const k = j.layout.layoutBox[w];
              k && (b = cs(k) * (parseFloat(b) / 100));
            }
          }
          this.originPoint[w] = b;
        }), v && Fi.update(() => v(h, f), false, true), g8(this.visualElement, "transform");
        const { animationState: y } = this.visualElement;
        y && y.setActive("whileDrag", true);
      }, l = (h, f) => {
        this.latestPointerEvent = h, this.latestPanInfo = f;
        const { dragPropagation: g, dragDirectionLock: m, onDirectionLock: v, onDrag: y } = this.getProps();
        if (!g && !this.openDragLock) return;
        const { offset: w } = f;
        if (m && this.currentDirection === null) {
          this.currentDirection = eet(w), this.currentDirection !== null && v && v(this.currentDirection);
          return;
        }
        this.updateAxis("x", f.point, w), this.updateAxis("y", f.point, w), this.visualElement.render(), y && Fi.update(() => y(h, f), false, true);
      }, c = (h, f) => {
        this.latestPointerEvent = h, this.latestPanInfo = f, this.stop(h, f), this.latestPointerEvent = null, this.latestPanInfo = null;
      }, d = () => {
        const { dragSnapToOrigin: h } = this.getProps();
        (h || this.constraints) && this.startAnimation({
          x: 0,
          y: 0
        });
      }, { dragSnapToOrigin: u } = this.getProps();
      this.panSession = new Jhe(e, {
        onSessionStart: a,
        onStart: s,
        onMove: l,
        onSessionEnd: c,
        resumeAnimation: d
      }, {
        transformPagePoint: this.visualElement.getTransformPagePoint(),
        dragSnapToOrigin: u,
        distanceThreshold: r,
        contextWindow: Zhe(this.visualElement),
        element: this.visualElement.current
      });
    }
    stop(e, n) {
      const r = e || this.latestPointerEvent, i = n || this.latestPanInfo, a = this.isDragging;
      if (this.cancel(), !a || !i || !r) return;
      const { velocity: s } = i;
      this.startAnimation(s);
      const { onDragEnd: l } = this.getProps();
      l && Fi.postRender(() => l(r, i));
    }
    cancel() {
      this.isDragging = false;
      const { projection: e, animationState: n } = this.visualElement;
      e && (e.isAnimationBlocked = false), this.endPanSession();
      const { dragPropagation: r } = this.getProps();
      !r && this.openDragLock && (this.openDragLock(), this.openDragLock = null), n && n.setActive("whileDrag", false);
    }
    endPanSession() {
      this.panSession && this.panSession.end(), this.panSession = void 0;
    }
    updateAxis(e, n, r) {
      const { drag: i } = this.getProps();
      if (!r || !nD(e, i, this.currentDirection)) return;
      const a = this.getAxisMotionValue(e);
      let s = this.originPoint[e] + r[e];
      this.constraints && this.constraints[e] && (s = WQe(s, this.constraints[e], this.elastic[e])), a.set(s);
    }
    resolveConstraints() {
      var _a6;
      const { dragConstraints: e, dragElastic: n } = this.getProps(), r = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a6 = this.visualElement.projection) == null ? void 0 : _a6.layout, i = this.constraints;
      e && O0(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && r ? this.constraints = qQe(r.layoutBox, e) : this.constraints = false, this.elastic = ZQe(n), i !== this.constraints && !O0(e) && r && this.constraints && !this.hasMutatedConstraints && Cd((a) => {
        this.constraints !== false && this.getAxisMotionValue(a) && (this.constraints[a] = YQe(r.layoutBox[a], this.constraints[a]));
      });
    }
    resolveRefConstraints() {
      const { dragConstraints: e, onMeasureDragConstraints: n } = this.getProps();
      if (!e || !O0(e)) return false;
      const r = e.current, { projection: i } = this.visualElement;
      if (!i || !i.layout) return false;
      const a = sXe(r, i.root, this.visualElement.getTransformPagePoint());
      let s = KQe(i.layout.layoutBox, a);
      if (n) {
        const l = n(iXe(s));
        this.hasMutatedConstraints = !!l, l && (s = yhe(l));
      }
      return s;
    }
    startAnimation(e) {
      const { drag: n, dragMomentum: r, dragElastic: i, dragTransition: a, dragSnapToOrigin: s, onDragTransitionEnd: l } = this.getProps(), c = this.constraints || {}, d = Cd((u) => {
        if (!nD(u, n, this.currentDirection)) return;
        let h = c && c[u] || {};
        s && (h = {
          min: 0,
          max: 0
        });
        const f = i ? 200 : 1e6, g = i ? 40 : 1e7, m = {
          type: "inertia",
          velocity: r ? e[u] : 0,
          bounceStiffness: f,
          bounceDamping: g,
          timeConstant: 750,
          restDelta: 1,
          restSpeed: 10,
          ...a,
          ...h
        };
        return this.startAxisValueAnimation(u, m);
      });
      return Promise.all(d).then(l);
    }
    startAxisValueAnimation(e, n) {
      const r = this.getAxisMotionValue(e);
      return g8(this.visualElement, e), r.start(_O(e, r, 0, n, this.visualElement, false));
    }
    stopAnimation() {
      Cd((e) => this.getAxisMotionValue(e).stop());
    }
    getAxisMotionValue(e) {
      const n = `_drag${e.toUpperCase()}`, r = this.visualElement.getProps(), i = r[n];
      return i || this.visualElement.getValue(e, (r.initial ? r.initial[e] : void 0) || 0);
    }
    snapToCursor(e) {
      Cd((n) => {
        const { drag: r } = this.getProps();
        if (!nD(n, r, this.currentDirection)) return;
        const { projection: i } = this.visualElement, a = this.getAxisMotionValue(n);
        if (i && i.layout) {
          const { min: s, max: l } = i.layout.layoutBox[n], c = a.get() || 0;
          a.set(e[n] - eo(s, l, 0.5) + c);
        }
      });
    }
    scalePositionWithinConstraints() {
      if (!this.visualElement.current) return;
      const { drag: e, dragConstraints: n } = this.getProps(), { projection: r } = this.visualElement;
      if (!O0(n) || !r || !this.constraints) return;
      this.stopAnimation();
      const i = {
        x: 0,
        y: 0
      };
      Cd((s) => {
        const l = this.getAxisMotionValue(s);
        if (l && this.constraints !== false) {
          const c = l.get();
          i[s] = GQe({
            min: c,
            max: c
          }, this.constraints[s]);
        }
      });
      const { transformTemplate: a } = this.visualElement.getProps();
      this.visualElement.current.style.transform = a ? a({}, "") : "none", r.root && r.root.updateScroll(), r.updateLayout(), this.constraints = false, this.resolveConstraints(), Cd((s) => {
        if (!nD(s, e, null)) return;
        const l = this.getAxisMotionValue(s), { min: c, max: d } = this.constraints[s];
        l.set(eo(c, d, i[s]));
      }), this.visualElement.render();
    }
    addListeners() {
      if (!this.visualElement.current) return;
      JQe.set(this.visualElement, this);
      const e = this.visualElement.current, n = g2(e, "pointerdown", (d) => {
        const { drag: u, dragListener: h = true } = this.getProps(), f = d.target, g = f !== e && MJe(f);
        u && h && !g && this.start(d);
      });
      let r;
      const i = () => {
        const { dragConstraints: d } = this.getProps();
        O0(d) && d.current && (this.constraints = this.resolveRefConstraints(), r || (r = QQe(e, d.current, () => this.scalePositionWithinConstraints())));
      }, { projection: a } = this.visualElement, s = a.addEventListener("measure", i);
      a && !a.layout && (a.root && a.root.updateScroll(), a.updateLayout()), Fi.read(i);
      const l = jb(window, "resize", () => this.scalePositionWithinConstraints()), c = a.addEventListener("didUpdate", (({ delta: d, hasLayoutChanged: u }) => {
        this.isDragging && u && (Cd((h) => {
          const f = this.getAxisMotionValue(h);
          f && (this.originPoint[h] += d[h].translate, f.set(f.get() + d[h].translate));
        }), this.visualElement.render());
      }));
      return () => {
        l(), n(), s(), c && c(), r && r();
      };
    }
    getProps() {
      const e = this.visualElement.getProps(), { drag: n = false, dragDirectionLock: r = false, dragPropagation: i = false, dragConstraints: a = false, dragElastic: s = w8, dragMomentum: l = true } = e;
      return {
        ...e,
        drag: n,
        dragDirectionLock: r,
        dragPropagation: i,
        dragConstraints: a,
        dragElastic: s,
        dragMomentum: l
      };
    }
  }
  function bJ(t) {
    let e = true;
    return () => {
      if (e) {
        e = false;
        return;
      }
      t();
    };
  }
  function QQe(t, e, n) {
    const r = kZ(t, bJ(n)), i = kZ(e, bJ(n));
    return () => {
      r(), i();
    };
  }
  function nD(t, e, n) {
    return (e === true || e === t) && (n === null || n === t);
  }
  function eet(t, e = 10) {
    let n = null;
    return Math.abs(t.y) > e ? n = "y" : Math.abs(t.x) > e && (n = "x"), n;
  }
  class tet extends lm {
    constructor(e) {
      super(e), this.removeGroupControls = $l, this.removeListeners = $l, this.controls = new XQe(e);
    }
    mount() {
      const { dragControls: e } = this.node.getProps();
      e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || $l;
    }
    update() {
      const { dragControls: e } = this.node.getProps(), { dragControls: n } = this.node.prevProps || {};
      e !== n && (this.removeGroupControls(), e && (this.removeGroupControls = e.subscribe(this.controls)));
    }
    unmount() {
      this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
    }
  }
  const mT = (t) => (e, n) => {
    t && Fi.update(() => t(e, n), false, true);
  };
  class net extends lm {
    constructor() {
      super(...arguments), this.removePointerDownListener = $l;
    }
    onPointerDown(e) {
      this.session = new Jhe(e, this.createPanHandlers(), {
        transformPagePoint: this.node.getTransformPagePoint(),
        contextWindow: Zhe(this.node)
      });
    }
    createPanHandlers() {
      const { onPanSessionStart: e, onPanStart: n, onPan: r, onPanEnd: i } = this.node.getProps();
      return {
        onSessionStart: mT(e),
        onStart: mT(n),
        onMove: mT(r),
        onEnd: (a, s) => {
          delete this.session, i && Fi.postRender(() => i(a, s));
        }
      };
    }
    mount() {
      this.removePointerDownListener = g2(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
    }
    update() {
      this.session && this.session.updateHandlers(this.createPanHandlers());
    }
    unmount() {
      this.removePointerDownListener(), this.session && this.session.end();
    }
  }
  let gT = false;
  class ret extends p.Component {
    componentDidMount() {
      const { visualElement: e, layoutGroup: n, switchLayoutGroup: r, layoutId: i } = this.props, { projection: a } = e;
      a && (n.group && n.group.add(a), r && r.register && i && r.register(a), gT && a.root.didUpdate(), a.addEventListener("animationComplete", () => {
        this.safeToRemove();
      }), a.setOptions({
        ...a.options,
        layoutDependency: this.props.layoutDependency,
        onExitComplete: () => this.safeToRemove()
      })), cC.hasEverUpdated = true;
    }
    getSnapshotBeforeUpdate(e) {
      const { layoutDependency: n, visualElement: r, drag: i, isPresent: a } = this.props, { projection: s } = r;
      return s && (s.isPresent = a, e.layoutDependency !== n && s.setOptions({
        ...s.options,
        layoutDependency: n
      }), gT = true, i || e.layoutDependency !== n || n === void 0 || e.isPresent !== a ? s.willUpdate() : this.safeToRemove(), e.isPresent !== a && (a ? s.promote() : s.relegate() || Fi.postRender(() => {
        const l = s.getStack();
        (!l || !l.members.length) && this.safeToRemove();
      }))), null;
    }
    componentDidUpdate() {
      const { projection: e } = this.props.visualElement;
      e && (e.root.didUpdate(), wO.postRender(() => {
        !e.currentAnimation && e.isLead() && this.safeToRemove();
      }));
    }
    componentWillUnmount() {
      const { visualElement: e, layoutGroup: n, switchLayoutGroup: r } = this.props, { projection: i } = e;
      gT = true, i && (i.scheduleCheckAfterUnmount(), n && n.group && n.group.remove(i), r && r.deregister && r.deregister(i));
    }
    safeToRemove() {
      const { safeToRemove: e } = this.props;
      e && e();
    }
    render() {
      return null;
    }
  }
  function Qhe(t) {
    const [e, n] = dQe(), r = p.useContext(fue);
    return o.jsx(ret, {
      ...t,
      layoutGroup: r,
      switchLayoutGroup: p.useContext(Ghe),
      isPresent: e,
      safeToRemove: n
    });
  }
  const iet = {
    pan: {
      Feature: net
    },
    drag: {
      Feature: tet,
      ProjectionNode: Uhe,
      MeasureLayout: Qhe
    }
  };
  function xJ(t, e, n) {
    const { props: r } = t;
    t.animationState && r.whileHover && t.animationState.setActive("whileHover", n === "Start");
    const i = "onHover" + n, a = r[i];
    a && Fi.postRender(() => a(e, S3(e)));
  }
  class oet extends lm {
    mount() {
      const { current: e } = this.node;
      e && (this.unmount = AJe(e, (n, r) => (xJ(this.node, r, "Start"), (i) => xJ(this.node, i, "End"))));
    }
    unmount() {
    }
  }
  class aet extends lm {
    constructor() {
      super(...arguments), this.isActive = false;
    }
    onFocus() {
      let e = false;
      try {
        e = this.node.current.matches(":focus-visible");
      } catch {
        e = true;
      }
      !e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", true), this.isActive = true);
    }
    onBlur() {
      !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", false), this.isActive = false);
    }
    mount() {
      this.unmount = C3(jb(this.node.current, "focus", () => this.onFocus()), jb(this.node.current, "blur", () => this.onBlur()));
    }
    unmount() {
    }
  }
  function wJ(t, e, n) {
    const { props: r } = t;
    if (t.current instanceof HTMLButtonElement && t.current.disabled) return;
    t.animationState && r.whileTap && t.animationState.setActive("whileTap", n === "Start");
    const i = "onTap" + (n === "End" ? "" : n), a = r[i];
    a && Fi.postRender(() => a(e, S3(e)));
  }
  class set extends lm {
    mount() {
      const { current: e } = this.node;
      if (!e) return;
      const { globalTapTarget: n, propagate: r } = this.node.props;
      this.unmount = LJe(e, (i, a) => (wJ(this.node, a, "Start"), (s, { success: l }) => wJ(this.node, s, l ? "End" : "Cancel")), {
        useGlobalTarget: n,
        stopPropagation: (r == null ? void 0 : r.tap) === false
      });
    }
    unmount() {
    }
  }
  const D8 = /* @__PURE__ */ new WeakMap(), pT = /* @__PURE__ */ new WeakMap(), cet = (t) => {
    const e = D8.get(t.target);
    e && e(t);
  }, det = (t) => {
    t.forEach(cet);
  };
  function uet({ root: t, ...e }) {
    const n = t || document;
    pT.has(n) || pT.set(n, {});
    const r = pT.get(n), i = JSON.stringify(e);
    return r[i] || (r[i] = new IntersectionObserver(det, {
      root: t,
      ...e
    })), r[i];
  }
  function het(t, e, n) {
    const r = uet(e);
    return D8.set(t, n), r.observe(t), () => {
      D8.delete(t), r.unobserve(t);
    };
  }
  const fet = {
    some: 0,
    all: 1
  };
  class met extends lm {
    constructor() {
      super(...arguments), this.hasEnteredView = false, this.isInView = false;
    }
    startObserver() {
      this.unmount();
      const { viewport: e = {} } = this.node.getProps(), { root: n, margin: r, amount: i = "some", once: a } = e, s = {
        root: n ? n.current : void 0,
        rootMargin: r,
        threshold: typeof i == "number" ? i : fet[i]
      }, l = (c) => {
        const { isIntersecting: d } = c;
        if (this.isInView === d || (this.isInView = d, a && !d && this.hasEnteredView)) return;
        d && (this.hasEnteredView = true), this.node.animationState && this.node.animationState.setActive("whileInView", d);
        const { onViewportEnter: u, onViewportLeave: h } = this.node.getProps(), f = d ? u : h;
        f && f(c);
      };
      return het(this.node.current, s, l);
    }
    mount() {
      this.startObserver();
    }
    update() {
      if (typeof IntersectionObserver > "u") return;
      const { props: e, prevProps: n } = this.node;
      [
        "amount",
        "margin",
        "root"
      ].some(get(e, n)) && this.startObserver();
    }
    unmount() {
    }
  }
  function get({ viewport: t = {} }, { viewport: e = {} } = {}) {
    return (n) => t[n] !== e[n];
  }
  const pet = {
    inView: {
      Feature: met
    },
    tap: {
      Feature: set
    },
    focus: {
      Feature: aet
    },
    hover: {
      Feature: oet
    }
  }, Fet = {
    layout: {
      ProjectionNode: Uhe,
      MeasureLayout: Qhe
    }
  }, vet = {
    ...zQe,
    ...pet,
    ...iet,
    ...Fet
  }, AE = PQe(vet, MQe);
  function j3(t) {
    const e = Cb(() => up(t)), { isStatic: n } = p.useContext(kS);
    if (n) {
      const [, r] = p.useState(t);
      p.useEffect(() => e.on("change", r), []);
    }
    return e;
  }
  function efe(t, e) {
    const n = j3(e()), r = () => n.set(e());
    return r(), gue(() => {
      const i = () => Fi.preRender(r, false, true), a = t.map((s) => s.on("change", i));
      return () => {
        a.forEach((s) => s()), sh(r);
      };
    }), n;
  }
  function _et(t) {
    f2.current = [], t();
    const e = efe(f2.current, t);
    return f2.current = void 0, e;
  }
  function AO(t, e, n, r) {
    if (typeof t == "function") return _et(t);
    if (n !== void 0 && !Array.isArray(n) && typeof e != "function") return yet(t, e, n, r);
    const s = typeof e == "function" ? e : GJe(e, n, r), l = Array.isArray(t) ? DJ(t, s) : DJ([
      t
    ], ([d]) => s(d)), c = Array.isArray(t) ? void 0 : t.accelerate;
    return c && !c.isTransformed && typeof e != "function" && Array.isArray(n) && (r == null ? void 0 : r.clamp) !== false && (l.accelerate = {
      ...c,
      times: e,
      keyframes: n,
      isTransformed: true
    }), l;
  }
  function DJ(t, e) {
    const n = Cb(() => []);
    return efe(t, () => {
      n.length = 0;
      const r = t.length;
      for (let i = 0; i < r; i++) n[i] = t[i].get();
      return e(n);
    });
  }
  function yet(t, e, n, r) {
    const i = Cb(() => Object.keys(n)), a = Cb(() => ({}));
    for (const s of i) a[s] = AO(t, e, n[s], r);
    return a;
  }
  function bet(t, e = {}) {
    const { isStatic: n } = p.useContext(kS), r = () => aa(t) ? t.get() : t;
    if (n) return AO(r);
    const i = j3(r());
    return p.useInsertionEffect(() => YJe(i, t, e), [
      i,
      JSON.stringify(e)
    ]), i;
  }
  function IO(t, e = {}) {
    return bet(t, {
      type: "spring",
      ...e
    });
  }
  function xet(t, e, n) {
    return Math.max(e, Math.min(t, n));
  }
  const Ka = {
    toVector(t, e) {
      return t === void 0 && (t = e), Array.isArray(t) ? t : [
        t,
        t
      ];
    },
    add(t, e) {
      return [
        t[0] + e[0],
        t[1] + e[1]
      ];
    },
    sub(t, e) {
      return [
        t[0] - e[0],
        t[1] - e[1]
      ];
    },
    addTo(t, e) {
      t[0] += e[0], t[1] += e[1];
    },
    subTo(t, e) {
      t[0] -= e[0], t[1] -= e[1];
    }
  };
  function CJ(t, e, n) {
    return e === 0 || Math.abs(e) === 1 / 0 ? Math.pow(t, n * 5) : t * e * n / (e + n * t);
  }
  function EJ(t, e, n, r = 0.15) {
    return r === 0 ? xet(t, e, n) : t < e ? -CJ(e - t, n - e, r) + e : t > n ? +CJ(t - n, n - e, r) + n : t;
  }
  function wet(t, [e, n], [r, i]) {
    const [[a, s], [l, c]] = t;
    return [
      EJ(e, a, s, r),
      EJ(n, l, c, i)
    ];
  }
  function Det(t, e) {
    if (typeof t != "object" || t === null) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (typeof r != "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function Cet(t) {
    var e = Det(t, "string");
    return typeof e == "symbol" ? e : String(e);
  }
  function Es(t, e, n) {
    return e = Cet(e), e in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function kJ(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function no(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? kJ(Object(n), true).forEach(function(r) {
        Es(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : kJ(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  const tfe = {
    pointer: {
      start: "down",
      change: "move",
      end: "up"
    },
    mouse: {
      start: "down",
      change: "move",
      end: "up"
    },
    touch: {
      start: "start",
      change: "move",
      end: "end"
    },
    gesture: {
      start: "start",
      change: "change",
      end: "end"
    }
  };
  function SJ(t) {
    return t ? t[0].toUpperCase() + t.slice(1) : "";
  }
  const Eet = [
    "enter",
    "leave"
  ];
  function ket(t = false, e) {
    return t && !Eet.includes(e);
  }
  function jet(t, e = "", n = false) {
    const r = tfe[t], i = r && r[e] || e;
    return "on" + SJ(t) + SJ(i) + (ket(n, i) ? "Capture" : "");
  }
  const Tet = [
    "gotpointercapture",
    "lostpointercapture"
  ];
  function Ret(t) {
    let e = t.substring(2).toLowerCase();
    const n = !!~e.indexOf("passive");
    n && (e = e.replace("passive", ""));
    const r = Tet.includes(e) ? "capturecapture" : "capture", i = !!~e.indexOf(r);
    return i && (e = e.replace("capture", "")), {
      device: e,
      capture: i,
      passive: n
    };
  }
  function Aet(t, e = "") {
    const n = tfe[t], r = n && n[e] || e;
    return t + r;
  }
  function jS(t) {
    return "touches" in t;
  }
  function nfe(t) {
    return jS(t) ? "touch" : "pointerType" in t ? t.pointerType : "mouse";
  }
  function Iet(t) {
    return Array.from(t.touches).filter((e) => {
      var n, r;
      return e.target === t.currentTarget || ((n = t.currentTarget) === null || n === void 0 || (r = n.contains) === null || r === void 0 ? void 0 : r.call(n, e.target));
    });
  }
  function Bet(t) {
    return t.type === "touchend" || t.type === "touchcancel" ? t.changedTouches : t.targetTouches;
  }
  function rfe(t) {
    return jS(t) ? Bet(t)[0] : t;
  }
  function Pet(t) {
    return Iet(t).map((e) => e.identifier);
  }
  function FT(t) {
    const e = rfe(t);
    return jS(t) ? e.identifier : e.pointerId;
  }
  function jJ(t) {
    const e = rfe(t);
    return [
      e.clientX,
      e.clientY
    ];
  }
  function Met(t) {
    const e = {};
    if ("buttons" in t && (e.buttons = t.buttons), "shiftKey" in t) {
      const { shiftKey: n, altKey: r, metaKey: i, ctrlKey: a } = t;
      Object.assign(e, {
        shiftKey: n,
        altKey: r,
        metaKey: i,
        ctrlKey: a
      });
    }
    return e;
  }
  function IE(t, ...e) {
    return typeof t == "function" ? t(...e) : t;
  }
  function Oet() {
  }
  function Let(...t) {
    return t.length === 0 ? Oet : t.length === 1 ? t[0] : function() {
      let e;
      for (const n of t) e = n.apply(this, arguments) || e;
      return e;
    };
  }
  function TJ(t, e) {
    return Object.assign({}, e, t || {});
  }
  const Net = 32;
  class zet {
    constructor(e, n, r) {
      this.ctrl = e, this.args = n, this.key = r, this.state || (this.state = {}, this.computeValues([
        0,
        0
      ]), this.computeInitial(), this.init && this.init(), this.reset());
    }
    get state() {
      return this.ctrl.state[this.key];
    }
    set state(e) {
      this.ctrl.state[this.key] = e;
    }
    get shared() {
      return this.ctrl.state.shared;
    }
    get eventStore() {
      return this.ctrl.gestureEventStores[this.key];
    }
    get timeoutStore() {
      return this.ctrl.gestureTimeoutStores[this.key];
    }
    get config() {
      return this.ctrl.config[this.key];
    }
    get sharedConfig() {
      return this.ctrl.config.shared;
    }
    get handler() {
      return this.ctrl.handlers[this.key];
    }
    reset() {
      const { state: e, shared: n, ingKey: r, args: i } = this;
      n[r] = e._active = e.active = e._blocked = e._force = false, e._step = [
        false,
        false
      ], e.intentional = false, e._movement = [
        0,
        0
      ], e._distance = [
        0,
        0
      ], e._direction = [
        0,
        0
      ], e._delta = [
        0,
        0
      ], e._bounds = [
        [
          -1 / 0,
          1 / 0
        ],
        [
          -1 / 0,
          1 / 0
        ]
      ], e.args = i, e.axis = void 0, e.memo = void 0, e.elapsedTime = e.timeDelta = 0, e.direction = [
        0,
        0
      ], e.distance = [
        0,
        0
      ], e.overflow = [
        0,
        0
      ], e._movementBound = [
        false,
        false
      ], e.velocity = [
        0,
        0
      ], e.movement = [
        0,
        0
      ], e.delta = [
        0,
        0
      ], e.timeStamp = 0;
    }
    start(e) {
      const n = this.state, r = this.config;
      n._active || (this.reset(), this.computeInitial(), n._active = true, n.target = e.target, n.currentTarget = e.currentTarget, n.lastOffset = r.from ? IE(r.from, n) : n.offset, n.offset = n.lastOffset, n.startTime = n.timeStamp = e.timeStamp);
    }
    computeValues(e) {
      const n = this.state;
      n._values = e, n.values = this.config.transform(e);
    }
    computeInitial() {
      const e = this.state;
      e._initial = e._values, e.initial = e.values;
    }
    compute(e) {
      const { state: n, config: r, shared: i } = this;
      n.args = this.args;
      let a = 0;
      if (e && (n.event = e, r.preventDefault && e.cancelable && n.event.preventDefault(), n.type = e.type, i.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, i.locked = !!document.pointerLockElement, Object.assign(i, Met(e)), i.down = i.pressed = i.buttons % 2 === 1 || i.touches > 0, a = e.timeStamp - n.timeStamp, n.timeStamp = e.timeStamp, n.elapsedTime = n.timeStamp - n.startTime), n._active) {
        const x = n._delta.map(Math.abs);
        Ka.addTo(n._distance, x);
      }
      this.axisIntent && this.axisIntent(e);
      const [s, l] = n._movement, [c, d] = r.threshold, { _step: u, values: h } = n;
      if (r.hasCustomTransform ? (u[0] === false && (u[0] = Math.abs(s) >= c && h[0]), u[1] === false && (u[1] = Math.abs(l) >= d && h[1])) : (u[0] === false && (u[0] = Math.abs(s) >= c && Math.sign(s) * c), u[1] === false && (u[1] = Math.abs(l) >= d && Math.sign(l) * d)), n.intentional = u[0] !== false || u[1] !== false, !n.intentional) return;
      const f = [
        0,
        0
      ];
      if (r.hasCustomTransform) {
        const [x, S] = h;
        f[0] = u[0] !== false ? x - u[0] : 0, f[1] = u[1] !== false ? S - u[1] : 0;
      } else f[0] = u[0] !== false ? s - u[0] : 0, f[1] = u[1] !== false ? l - u[1] : 0;
      this.restrictToAxis && !n._blocked && this.restrictToAxis(f);
      const g = n.offset, m = n._active && !n._blocked || n.active;
      m && (n.first = n._active && !n.active, n.last = !n._active && n.active, n.active = i[this.ingKey] = n._active, e && (n.first && ("bounds" in r && (n._bounds = IE(r.bounds, n)), this.setup && this.setup()), n.movement = f, this.computeOffset()));
      const [v, y] = n.offset, [[w, b], [j, k]] = n._bounds;
      n.overflow = [
        v < w ? -1 : v > b ? 1 : 0,
        y < j ? -1 : y > k ? 1 : 0
      ], n._movementBound[0] = n.overflow[0] ? n._movementBound[0] === false ? n._movement[0] : n._movementBound[0] : false, n._movementBound[1] = n.overflow[1] ? n._movementBound[1] === false ? n._movement[1] : n._movementBound[1] : false;
      const C = n._active ? r.rubberband || [
        0,
        0
      ] : [
        0,
        0
      ];
      if (n.offset = wet(n._bounds, n.offset, C), n.delta = Ka.sub(n.offset, g), this.computeMovement(), m && (!n.last || a > Net)) {
        n.delta = Ka.sub(n.offset, g);
        const x = n.delta.map(Math.abs);
        Ka.addTo(n.distance, x), n.direction = n.delta.map(Math.sign), n._direction = n._delta.map(Math.sign), !n.first && a > 0 && (n.velocity = [
          x[0] / a,
          x[1] / a
        ], n.timeDelta = a);
      }
    }
    emit() {
      const e = this.state, n = this.shared, r = this.config;
      if (e._active || this.clean(), (e._blocked || !e.intentional) && !e._force && !r.triggerAllEvents) return;
      const i = this.handler(no(no(no({}, n), e), {}, {
        [this.aliasKey]: e.values
      }));
      i !== void 0 && (e.memo = i);
    }
    clean() {
      this.eventStore.clean(), this.timeoutStore.clean();
    }
  }
  function Uet([t, e], n) {
    const r = Math.abs(t), i = Math.abs(e);
    if (r > i && r > n) return "x";
    if (i > r && i > n) return "y";
  }
  class Vet extends zet {
    constructor(...e) {
      super(...e), Es(this, "aliasKey", "xy");
    }
    reset() {
      super.reset(), this.state.axis = void 0;
    }
    init() {
      this.state.offset = [
        0,
        0
      ], this.state.lastOffset = [
        0,
        0
      ];
    }
    computeOffset() {
      this.state.offset = Ka.add(this.state.lastOffset, this.state.movement);
    }
    computeMovement() {
      this.state.movement = Ka.sub(this.state.offset, this.state.lastOffset);
    }
    axisIntent(e) {
      const n = this.state, r = this.config;
      if (!n.axis && e) {
        const i = typeof r.axisThreshold == "object" ? r.axisThreshold[nfe(e)] : r.axisThreshold;
        n.axis = Uet(n._movement, i);
      }
      n._blocked = (r.lockDirection || !!r.axis) && !n.axis || !!r.axis && r.axis !== n.axis;
    }
    restrictToAxis(e) {
      if (this.config.axis || this.config.lockDirection) switch (this.state.axis) {
        case "x":
          e[1] = 0;
          break;
        case "y":
          e[0] = 0;
          break;
      }
    }
  }
  const Het = (t) => t, RJ = 0.15, ife = {
    enabled(t = true) {
      return t;
    },
    eventOptions(t, e, n) {
      return no(no({}, n.shared.eventOptions), t);
    },
    preventDefault(t = false) {
      return t;
    },
    triggerAllEvents(t = false) {
      return t;
    },
    rubberband(t = 0) {
      switch (t) {
        case true:
          return [
            RJ,
            RJ
          ];
        case false:
          return [
            0,
            0
          ];
        default:
          return Ka.toVector(t);
      }
    },
    from(t) {
      if (typeof t == "function") return t;
      if (t != null) return Ka.toVector(t);
    },
    transform(t, e, n) {
      const r = t || n.shared.transform;
      return this.hasCustomTransform = !!r, r || Het;
    },
    threshold(t) {
      return Ka.toVector(t, 0);
    }
  }, $et = 0, T3 = no(no({}, ife), {}, {
    axis(t, e, { axis: n }) {
      if (this.lockDirection = n === "lock", !this.lockDirection) return n;
    },
    axisThreshold(t = $et) {
      return t;
    },
    bounds(t = {}) {
      if (typeof t == "function") return (a) => T3.bounds(t(a));
      if ("current" in t) return () => t.current;
      if (typeof HTMLElement == "function" && t instanceof HTMLElement) return t;
      const { left: e = -1 / 0, right: n = 1 / 0, top: r = -1 / 0, bottom: i = 1 / 0 } = t;
      return [
        [
          e,
          n
        ],
        [
          r,
          i
        ]
      ];
    }
  }), AJ = {
    ArrowRight: (t, e = 1) => [
      t * e,
      0
    ],
    ArrowLeft: (t, e = 1) => [
      -1 * t * e,
      0
    ],
    ArrowUp: (t, e = 1) => [
      0,
      -1 * t * e
    ],
    ArrowDown: (t, e = 1) => [
      0,
      t * e
    ]
  };
  class Wet extends Vet {
    constructor(...e) {
      super(...e), Es(this, "ingKey", "dragging");
    }
    reset() {
      super.reset();
      const e = this.state;
      e._pointerId = void 0, e._pointerActive = false, e._keyboardActive = false, e._preventScroll = false, e._delayed = false, e.swipe = [
        0,
        0
      ], e.tap = false, e.canceled = false, e.cancel = this.cancel.bind(this);
    }
    setup() {
      const e = this.state;
      if (e._bounds instanceof HTMLElement) {
        const n = e._bounds.getBoundingClientRect(), r = e.currentTarget.getBoundingClientRect(), i = {
          left: n.left - r.left + e.offset[0],
          right: n.right - r.right + e.offset[0],
          top: n.top - r.top + e.offset[1],
          bottom: n.bottom - r.bottom + e.offset[1]
        };
        e._bounds = T3.bounds(i);
      }
    }
    cancel() {
      const e = this.state;
      e.canceled || (e.canceled = true, e._active = false, setTimeout(() => {
        this.compute(), this.emit();
      }, 0));
    }
    setActive() {
      this.state._active = this.state._pointerActive || this.state._keyboardActive;
    }
    clean() {
      this.pointerClean(), this.state._pointerActive = false, this.state._keyboardActive = false, super.clean();
    }
    pointerDown(e) {
      const n = this.config, r = this.state;
      if (e.buttons != null && (Array.isArray(n.pointerButtons) ? !n.pointerButtons.includes(e.buttons) : n.pointerButtons !== -1 && n.pointerButtons !== e.buttons)) return;
      const i = this.ctrl.setEventIds(e);
      n.pointerCapture && e.target.setPointerCapture(e.pointerId), !(i && i.size > 1 && r._pointerActive) && (this.start(e), this.setupPointer(e), r._pointerId = FT(e), r._pointerActive = true, this.computeValues(jJ(e)), this.computeInitial(), n.preventScrollAxis && nfe(e) !== "mouse" ? (r._active = false, this.setupScrollPrevention(e)) : n.delay > 0 ? (this.setupDelayTrigger(e), n.triggerAllEvents && (this.compute(e), this.emit())) : this.startPointerDrag(e));
    }
    startPointerDrag(e) {
      const n = this.state;
      n._active = true, n._preventScroll = true, n._delayed = false, this.compute(e), this.emit();
    }
    pointerMove(e) {
      const n = this.state, r = this.config;
      if (!n._pointerActive) return;
      const i = FT(e);
      if (n._pointerId !== void 0 && i !== n._pointerId) return;
      const a = jJ(e);
      if (document.pointerLockElement === e.target ? n._delta = [
        e.movementX,
        e.movementY
      ] : (n._delta = Ka.sub(a, n._values), this.computeValues(a)), Ka.addTo(n._movement, n._delta), this.compute(e), n._delayed && n.intentional) {
        this.timeoutStore.remove("dragDelay"), n.active = false, this.startPointerDrag(e);
        return;
      }
      if (r.preventScrollAxis && !n._preventScroll) if (n.axis) if (n.axis === r.preventScrollAxis || r.preventScrollAxis === "xy") {
        n._active = false, this.clean();
        return;
      } else {
        this.timeoutStore.remove("startPointerDrag"), this.startPointerDrag(e);
        return;
      }
      else return;
      this.emit();
    }
    pointerUp(e) {
      this.ctrl.setEventIds(e);
      try {
        this.config.pointerCapture && e.target.hasPointerCapture(e.pointerId) && e.target.releasePointerCapture(e.pointerId);
      } catch {
      }
      const n = this.state, r = this.config;
      if (!n._active || !n._pointerActive) return;
      const i = FT(e);
      if (n._pointerId !== void 0 && i !== n._pointerId) return;
      this.state._pointerActive = false, this.setActive(), this.compute(e);
      const [a, s] = n._distance;
      if (n.tap = a <= r.tapsThreshold && s <= r.tapsThreshold, n.tap && r.filterTaps) n._force = true;
      else {
        const [l, c] = n._delta, [d, u] = n._movement, [h, f] = r.swipe.velocity, [g, m] = r.swipe.distance, v = r.swipe.duration;
        if (n.elapsedTime < v) {
          const y = Math.abs(l / n.timeDelta), w = Math.abs(c / n.timeDelta);
          y > h && Math.abs(d) > g && (n.swipe[0] = Math.sign(l)), w > f && Math.abs(u) > m && (n.swipe[1] = Math.sign(c));
        }
      }
      this.emit();
    }
    pointerClick(e) {
      !this.state.tap && e.detail > 0 && (e.preventDefault(), e.stopPropagation());
    }
    setupPointer(e) {
      const n = this.config, r = n.device;
      n.pointerLock && e.currentTarget.requestPointerLock(), n.pointerCapture || (this.eventStore.add(this.sharedConfig.window, r, "change", this.pointerMove.bind(this)), this.eventStore.add(this.sharedConfig.window, r, "end", this.pointerUp.bind(this)), this.eventStore.add(this.sharedConfig.window, r, "cancel", this.pointerUp.bind(this)));
    }
    pointerClean() {
      this.config.pointerLock && document.pointerLockElement === this.state.currentTarget && document.exitPointerLock();
    }
    preventScroll(e) {
      this.state._preventScroll && e.cancelable && e.preventDefault();
    }
    setupScrollPrevention(e) {
      this.state._preventScroll = false, qet(e);
      const n = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
        passive: false
      });
      this.eventStore.add(this.sharedConfig.window, "touch", "end", n), this.eventStore.add(this.sharedConfig.window, "touch", "cancel", n), this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScrollDelay, e);
    }
    setupDelayTrigger(e) {
      this.state._delayed = true, this.timeoutStore.add("dragDelay", () => {
        this.state._step = [
          0,
          0
        ], this.startPointerDrag(e);
      }, this.config.delay);
    }
    keyDown(e) {
      const n = AJ[e.key];
      if (n) {
        const r = this.state, i = e.shiftKey ? 10 : e.altKey ? 0.1 : 1;
        this.start(e), r._delta = n(this.config.keyboardDisplacement, i), r._keyboardActive = true, Ka.addTo(r._movement, r._delta), this.compute(e), this.emit();
      }
    }
    keyUp(e) {
      e.key in AJ && (this.state._keyboardActive = false, this.setActive(), this.compute(e), this.emit());
    }
    bind(e) {
      const n = this.config.device;
      e(n, "start", this.pointerDown.bind(this)), this.config.pointerCapture && (e(n, "change", this.pointerMove.bind(this)), e(n, "end", this.pointerUp.bind(this)), e(n, "cancel", this.pointerUp.bind(this)), e("lostPointerCapture", "", this.pointerUp.bind(this))), this.config.keys && (e("key", "down", this.keyDown.bind(this)), e("key", "up", this.keyUp.bind(this))), this.config.filterTaps && e("click", "", this.pointerClick.bind(this), {
        capture: true,
        passive: false
      });
    }
  }
  function qet(t) {
    "persist" in t && typeof t.persist == "function" && t.persist();
  }
  const R3 = typeof window < "u" && window.document && window.document.createElement;
  function ofe() {
    return R3 && "ontouchstart" in window;
  }
  function Ket() {
    return ofe() || R3 && window.navigator.maxTouchPoints > 1;
  }
  function Get() {
    return R3 && "onpointerdown" in window;
  }
  function Yet() {
    return R3 && "exitPointerLock" in window.document;
  }
  function Zet() {
    try {
      return "constructor" in GestureEvent;
    } catch {
      return false;
    }
  }
  const Pl = {
    isBrowser: R3,
    gesture: Zet(),
    touch: ofe(),
    touchscreen: Ket(),
    pointer: Get(),
    pointerLock: Yet()
  }, Jet = 250, Xet = 180, Qet = 0.5, ett = 50, ttt = 250, ntt = 10, IJ = {
    mouse: 0,
    touch: 0,
    pen: 8
  }, rtt = no(no({}, T3), {}, {
    device(t, e, { pointer: { touch: n = false, lock: r = false, mouse: i = false } = {} }) {
      return this.pointerLock = r && Pl.pointerLock, Pl.touch && n ? "touch" : this.pointerLock ? "mouse" : Pl.pointer && !i ? "pointer" : Pl.touch ? "touch" : "mouse";
    },
    preventScrollAxis(t, e, { preventScroll: n }) {
      if (this.preventScrollDelay = typeof n == "number" ? n : n || n === void 0 && t ? Jet : void 0, !(!Pl.touchscreen || n === false)) return t || (n !== void 0 ? "y" : void 0);
    },
    pointerCapture(t, e, { pointer: { capture: n = true, buttons: r = 1, keys: i = true } = {} }) {
      return this.pointerButtons = r, this.keys = i, !this.pointerLock && this.device === "pointer" && n;
    },
    threshold(t, e, { filterTaps: n = false, tapsThreshold: r = 3, axis: i = void 0 }) {
      const a = Ka.toVector(t, n ? r : i ? 1 : 0);
      return this.filterTaps = n, this.tapsThreshold = r, a;
    },
    swipe({ velocity: t = Qet, distance: e = ett, duration: n = ttt } = {}) {
      return {
        velocity: this.transform(Ka.toVector(t)),
        distance: this.transform(Ka.toVector(e)),
        duration: n
      };
    },
    delay(t = 0) {
      switch (t) {
        case true:
          return Xet;
        case false:
          return 0;
        default:
          return t;
      }
    },
    axisThreshold(t) {
      return t ? no(no({}, IJ), t) : IJ;
    },
    keyboardDisplacement(t = ntt) {
      return t;
    }
  });
  no(no({}, ife), {}, {
    device(t, e, { shared: n, pointer: { touch: r = false } = {} }) {
      if (n.target && !Pl.touch && Pl.gesture) return "gesture";
      if (Pl.touch && r) return "touch";
      if (Pl.touchscreen) {
        if (Pl.pointer) return "pointer";
        if (Pl.touch) return "touch";
      }
    },
    bounds(t, e, { scaleBounds: n = {}, angleBounds: r = {} }) {
      const i = (s) => {
        const l = TJ(IE(n, s), {
          min: -1 / 0,
          max: 1 / 0
        });
        return [
          l.min,
          l.max
        ];
      }, a = (s) => {
        const l = TJ(IE(r, s), {
          min: -1 / 0,
          max: 1 / 0
        });
        return [
          l.min,
          l.max
        ];
      };
      return typeof n != "function" && typeof r != "function" ? [
        i(),
        a()
      ] : (s) => [
        i(s),
        a(s)
      ];
    },
    threshold(t, e, n) {
      return this.lockDirection = n.axis === "lock", Ka.toVector(t, this.lockDirection ? [
        0.1,
        3
      ] : 0);
    },
    modifierKey(t) {
      return t === void 0 ? "ctrlKey" : t;
    },
    pinchOnWheel(t = true) {
      return t;
    }
  });
  no(no({}, T3), {}, {
    mouseOnly: (t = true) => t
  });
  no(no({}, T3), {}, {
    mouseOnly: (t = true) => t
  });
  const afe = /* @__PURE__ */ new Map(), C8 = /* @__PURE__ */ new Map();
  function itt(t) {
    afe.set(t.key, t.engine), C8.set(t.key, t.resolver);
  }
  const ott = {
    key: "drag",
    engine: Wet,
    resolver: rtt
  };
  function att(t, e) {
    if (t == null) return {};
    var n = {}, r = Object.keys(t), i, a;
    for (a = 0; a < r.length; a++) i = r[a], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
    return n;
  }
  function stt(t, e) {
    if (t == null) return {};
    var n = att(t, e), r, i;
    if (Object.getOwnPropertySymbols) {
      var a = Object.getOwnPropertySymbols(t);
      for (i = 0; i < a.length; i++) r = a[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }
  const ltt = {
    target(t) {
      if (t) return () => "current" in t ? t.current : t;
    },
    enabled(t = true) {
      return t;
    },
    window(t = Pl.isBrowser ? window : void 0) {
      return t;
    },
    eventOptions({ passive: t = true, capture: e = false } = {}) {
      return {
        passive: t,
        capture: e
      };
    },
    transform(t) {
      return t;
    }
  }, ctt = [
    "target",
    "eventOptions",
    "window",
    "enabled",
    "transform"
  ];
  function dC(t = {}, e) {
    const n = {};
    for (const [r, i] of Object.entries(e)) switch (typeof i) {
      case "function":
        n[r] = i.call(n, t[r], r, t);
        break;
      case "object":
        n[r] = dC(t[r], i);
        break;
      case "boolean":
        i && (n[r] = t[r]);
        break;
    }
    return n;
  }
  function dtt(t, e, n = {}) {
    const r = t, { target: i, eventOptions: a, window: s, enabled: l, transform: c } = r, d = stt(r, ctt);
    if (n.shared = dC({
      target: i,
      eventOptions: a,
      window: s,
      enabled: l,
      transform: c
    }, ltt), e) {
      const u = C8.get(e);
      n[e] = dC(no({
        shared: n.shared
      }, d), u);
    } else for (const u in d) {
      const h = C8.get(u);
      h && (n[u] = dC(no({
        shared: n.shared
      }, d[u]), h));
    }
    return n;
  }
  class sfe {
    constructor(e, n) {
      Es(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = e, this._gestureKey = n;
    }
    add(e, n, r, i, a) {
      const s = this._listeners, l = Aet(n, r), c = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, d = no(no({}, c), a);
      e.addEventListener(l, i, d);
      const u = () => {
        e.removeEventListener(l, i, d), s.delete(u);
      };
      return s.add(u), u;
    }
    clean() {
      this._listeners.forEach((e) => e()), this._listeners.clear();
    }
  }
  class utt {
    constructor() {
      Es(this, "_timeouts", /* @__PURE__ */ new Map());
    }
    add(e, n, r = 140, ...i) {
      this.remove(e), this._timeouts.set(e, window.setTimeout(n, r, ...i));
    }
    remove(e) {
      const n = this._timeouts.get(e);
      n && window.clearTimeout(n);
    }
    clean() {
      this._timeouts.forEach((e) => {
        window.clearTimeout(e);
      }), this._timeouts.clear();
    }
  }
  class htt {
    constructor(e) {
      Es(this, "gestures", /* @__PURE__ */ new Set()), Es(this, "_targetEventStore", new sfe(this)), Es(this, "gestureEventStores", {}), Es(this, "gestureTimeoutStores", {}), Es(this, "handlers", {}), Es(this, "config", {}), Es(this, "pointerIds", /* @__PURE__ */ new Set()), Es(this, "touchIds", /* @__PURE__ */ new Set()), Es(this, "state", {
        shared: {
          shiftKey: false,
          metaKey: false,
          ctrlKey: false,
          altKey: false
        }
      }), ftt(this, e);
    }
    setEventIds(e) {
      if (jS(e)) return this.touchIds = new Set(Pet(e)), this.touchIds;
      if ("pointerId" in e) return e.type === "pointerup" || e.type === "pointercancel" ? this.pointerIds.delete(e.pointerId) : e.type === "pointerdown" && this.pointerIds.add(e.pointerId), this.pointerIds;
    }
    applyHandlers(e, n) {
      this.handlers = e, this.nativeHandlers = n;
    }
    applyConfig(e, n) {
      this.config = dtt(e, n, this.config);
    }
    clean() {
      this._targetEventStore.clean();
      for (const e of this.gestures) this.gestureEventStores[e].clean(), this.gestureTimeoutStores[e].clean();
    }
    effect() {
      return this.config.shared.target && this.bind(), () => this._targetEventStore.clean();
    }
    bind(...e) {
      const n = this.config.shared, r = {};
      let i;
      if (!(n.target && (i = n.target(), !i))) {
        if (n.enabled) {
          for (const s of this.gestures) {
            const l = this.config[s], c = BJ(r, l.eventOptions, !!i);
            if (l.enabled) {
              const d = afe.get(s);
              new d(this, e, s).bind(c);
            }
          }
          const a = BJ(r, n.eventOptions, !!i);
          for (const s in this.nativeHandlers) a(s, "", (l) => this.nativeHandlers[s](no(no({}, this.state.shared), {}, {
            event: l,
            args: e
          })), void 0, true);
        }
        for (const a in r) r[a] = Let(...r[a]);
        if (!i) return r;
        for (const a in r) {
          const { device: s, capture: l, passive: c } = Ret(a);
          this._targetEventStore.add(i, s, "", r[a], {
            capture: l,
            passive: c
          });
        }
      }
    }
  }
  function S0(t, e) {
    t.gestures.add(e), t.gestureEventStores[e] = new sfe(t, e), t.gestureTimeoutStores[e] = new utt();
  }
  function ftt(t, e) {
    e.drag && S0(t, "drag"), e.wheel && S0(t, "wheel"), e.scroll && S0(t, "scroll"), e.move && S0(t, "move"), e.pinch && S0(t, "pinch"), e.hover && S0(t, "hover");
  }
  const BJ = (t, e, n) => (r, i, a, s = {}, l = false) => {
    var c, d;
    const u = (c = s.capture) !== null && c !== void 0 ? c : e.capture, h = (d = s.passive) !== null && d !== void 0 ? d : e.passive;
    let f = l ? r : jet(r, i, u);
    n && h && (f += "Passive"), t[f] = t[f] || [], t[f].push(a);
  };
  function mtt(t, e = {}, n, r) {
    const i = yn.useMemo(() => new htt(t), []);
    if (i.applyHandlers(t, r), i.applyConfig(e, n), yn.useEffect(i.effect.bind(i)), yn.useEffect(() => i.clean.bind(i), []), e.target === void 0) return i.bind.bind(i);
  }
  function BO(t, e) {
    return itt(ott), mtt({
      drag: t
    }, e || {}, "drag");
  }
  function gtt({ children: t, onReply: e }) {
    const n = j3(0), r = IO(n, {
      stiffness: 300,
      damping: 35
    }), [i, a] = p.useState(false), s = AO(n, [
      0,
      -8
    ], [
      0,
      1
    ]), l = BO(({ active: c, movement: [d] }) => {
      if (c) {
        const u = d < 0 ? d : 0;
        n.set(Math.max(-80, u)), d < -50 !== i && a(d < -50);
      } else d < -50 && e(), n.set(0), a(false);
    }, {
      axis: "x",
      bounds: {
        right: 0
      },
      rubberband: true,
      filterTaps: true,
      eventOptions: {
        passive: true
      }
    });
    return o.jsxs("div", {
      ...l(),
      style: {
        position: "relative",
        touchAction: "pan-y"
      },
      children: [
        o.jsx("div", {
          style: {
            position: "absolute",
            top: 0,
            bottom: 0,
            right: 0,
            paddingRight: ee.space.S400,
            display: "flex",
            alignItems: "center",
            zIndex: 0
          },
          children: o.jsx(AE.div, {
            style: {
              opacity: s
            },
            children: o.jsx(Q, {
              src: q.ReplyArrow,
              size: "400",
              style: {
                color: i ? "var(--sable-surface-on-container)" : "var(--sable-surface-container)",
                transition: "color 0.2s"
              }
            })
          })
        }),
        o.jsx(AE.div, {
          style: {
            x: r,
            position: "relative",
            zIndex: 1
          },
          children: t
        })
      ]
    });
  }
  function vT({ children: t, onReply: e }) {
    const n = Ze(ge);
    return p.useMemo(() => n.mobileGestures && Dr() && n.rightSwipeAction !== G1.Members, [
      n.mobileGestures,
      n.rightSwipeAction
    ]) ? o.jsx(gtt, {
      onReply: e,
      children: t
    }) : t;
  }
  const Cy = /* @__PURE__ */ new Map(), L0 = /* @__PURE__ */ new Map();
  function ptt() {
    return {
      cacheSize: Cy.size,
      inflightCount: L0.size
    };
  }
  function E8(t) {
    const [e, n] = p.useState({
      sourceUrl: t,
      blobUrl: t ? Cy.get(t) : void 0
    });
    return t !== e.sourceUrl && n({
      sourceUrl: t,
      blobUrl: t ? Cy.get(t) : void 0
    }), p.useEffect(() => {
      if (!t || Cy.has(t)) return;
      let r = true;
      return (async () => {
        if (L0.has(t)) {
          try {
            const s = await L0.get(t);
            r && n({
              sourceUrl: t,
              blobUrl: s
            });
          } catch {
          }
          return;
        }
        const a = (async () => {
          try {
            const s = await fetch(t, {
              mode: "cors"
            });
            if (!s.ok) throw new Error(`Failed to fetch blob: ${s.status} ${s.statusText}`);
            const l = await s.blob(), c = URL.createObjectURL(l);
            return Cy.set(t, c), c;
          } catch (s) {
            throw L0.delete(t), s;
          }
        })();
        L0.set(t, a);
        try {
          const s = await a;
          r && n({
            sourceUrl: t,
            blobUrl: s
          });
        } catch {
        } finally {
          L0.delete(t);
        }
      })(), () => {
        r = false;
      };
    }, [
      t
    ]), e.blobUrl || t;
  }
  function Ftt({ room: t, relations: e }) {
    const n = Fn(tu);
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.Smile
      }),
      radii: "300",
      onClick: (r) => {
        r.preventDefault(), r.stopPropagation(), n({
          type: _a.Reactions,
          room: t,
          relations: e
        });
      },
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "View Reactions"
      })
    });
  }
  function vtt({ room: t, relations: e, onClose: n }) {
    return o.jsx(cue, {
      room: t,
      relations: e,
      requestClose: n
    });
  }
  const rD = (t, e) => {
    if (!e) return [];
    if (!e.startsWith("$")) return [];
    const n = t.getLiveTimeline().getEvents(), r = [];
    for (let i = n.length - 1; i >= 0; i -= 1) {
      const a = n[i];
      if (a && (r.splice(r.length, 0, ...t.getUsersReadUpTo(a)), a.getId() === e)) break;
    }
    return [
      ...new Set(r)
    ];
  }, lfe = (t, e) => {
    const [n, r] = p.useState(() => rD(t, e));
    return p.useEffect(() => {
      r(rD(t, e));
      const i = (s, l) => {
        l.roomId === t.roomId && r(rD(t, e));
      }, a = (s, l, c) => {
        l.roomId !== t.roomId || !c || c.startsWith("$") || c === e && r(rD(t, s.getId()));
      };
      return t.on(mt.Receipt, i), t.on(mt.LocalEchoUpdated, a), () => {
        t.removeListener(mt.Receipt, i), t.removeListener(mt.LocalEchoUpdated, a);
      };
    }, [
      t,
      e
    ]), n;
  };
  var _tt = "EventReaders_EventReaders__w7kiw80 _1mqalmd1 _1mqalmd0", ytt = "EventReaders_Header__w7kiw81", btt = "EventReaders_Content__w7kiw82";
  const xtt = ft(({ className: t, room: e, eventId: n, requestClose: r, ...i }, a) => {
    const s = be(), l = hn(), c = lfe(e, n), d = Ls(), u = ka(), h = Ze(qr), f = (g) => gr(e, g, h) ?? _n(g) ?? g;
    return o.jsxs(E, {
      className: gt(_tt, t),
      direction: "Column",
      ...i,
      ref: a,
      children: [
        o.jsxs(wn, {
          className: ytt,
          variant: "Surface",
          size: "600",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H3",
                children: "Seen by"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: r,
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsx(E, {
          grow: "Yes",
          style: {
            width: "100%",
            minWidth: 0
          },
          children: o.jsx(E, {
            grow: "Yes",
            className: btt,
            direction: "Column",
            style: {
              width: "100%",
              minWidth: 0
            },
            children: o.jsx(dn, {
              visibility: "Hover",
              hideTrack: true,
              size: "300",
              style: {
                width: "100%"
              },
              children: c.map((g) => {
                var _a6;
                const m = f(g), v = (_a6 = e.getMember(g)) == null ? void 0 : _a6.getMxcAvatarUrl(), y = v ? s.mxcUrlToHttp(v, 100, 100, "crop", void 0, false, l) : void 0;
                return o.jsx(Ye, {
                  style: {
                    padding: `0 ${ee.space.S200}`,
                    width: "100%"
                  },
                  radii: "400",
                  onClick: (w) => {
                    d(e.roomId, u == null ? void 0 : u.roomId, g, wp(w.nativeEvent), "Bottom");
                  },
                  before: o.jsx(xn, {
                    size: "200",
                    children: o.jsx(Si, {
                      userId: g,
                      src: y ?? void 0,
                      alt: m,
                      renderFallback: () => o.jsx(Q, {
                        size: "50",
                        src: q.User,
                        filled: true
                      })
                    })
                  }),
                  children: o.jsx(D, {
                    size: "T400",
                    truncate: true,
                    children: m
                  })
                }, g);
              })
            })
          })
        })
      ]
    });
  });
  function cfe({ room: t, eventId: e }) {
    const n = Fn(tu);
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.CheckTwice
      }),
      radii: "300",
      onClick: (r) => {
        r.preventDefault(), r.stopPropagation(), n({
          type: _a.ReadReceipts,
          room: t,
          eventId: e
        });
      },
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "Read Receipts"
      })
    });
  }
  function wtt({ room: t, eventId: e, onClose: n }) {
    return o.jsx(xtt, {
      room: t,
      eventId: e,
      requestClose: n
    });
  }
  var Dtt = "EventHistory_EventHistory__kwzbgm0 _1mqalmd1 _1mqalmd0", Ctt = "EventHistory_Header__kwzbgm1", Ett = "EventHistory_Content__kwzbgm2", ktt = "EventHistory_EventItem__kwzbgm3", Stt = "EventHistory_MenuOptions__kwzbgm6";
  const jtt = ft(({ className: t, room: e, mEvents: n, requestClose: r, ...i }, a) => {
    var _a6, _b3, _c3;
    const s = be(), l = hn(), c = gs(), d = Ls(), u = ka(), h = Ze(qr), f = (N) => gr(e, N, h) ?? _n(N) ?? N, g = ((_a6 = n[0]) == null ? void 0 : _a6.event.sender) ?? "", m = f(g ?? ""), v = (_b3 = e.getMember(g ?? "")) == null ? void 0 : _b3.getMxcAvatarUrl(), y = v ? s.mxcUrlToHttp(v, 100, 100, "crop", void 0, false, l) : void 0, [w] = Fe(ge, "hour24Clock"), [b] = Fe(ge, "dateFormatString"), j = p.useMemo(() => ({
      ...fs
    }), []), k = Xd(), C = p.useMemo(() => Ql(s, n[0].getRoomId(), {
      settingsLinkBaseUrl: c,
      linkifyOpts: j,
      useAuthentication: l,
      handleSpoilerClick: k
    }), [
      j,
      n,
      s,
      c,
      k,
      l
    ]), x = Qd(), S = ri(e), T = Ki(S, x), A = T.action("redact", s.getSafeUserId()), B = T.event(ce.RoomRedaction, s.getSafeUserId()), U = A || B && ((_c3 = n[0]) == null ? void 0 : _c3.getSender()) === s.getUserId(), z = Fn(mF(e.roomId)), O = p.useCallback((N, L = false) => {
      var _a7, _b4;
      const H = e.findEventById(N);
      if (!H) return;
      const V = H.getOriginalContent(), Z = ((_a7 = V == null ? void 0 : V["m.new_content"]) == null ? void 0 : _a7.body) ?? (V == null ? void 0 : V.body) ?? "", Y = ((_b4 = V == null ? void 0 : V["m.new_content"]) == null ? void 0 : _b4.formatted_body) ?? (V == null ? void 0 : V.formatted_body) ?? "", { "m.relates_to": oe } = L ? {
        "m.relates_to": {
          rel_type: "m.thread",
          event_id: N
        }
      } : H.getWireContent(), ue = H.getSender();
      ue && z(typeof Z == "string" ? {
        userId: ue,
        eventId: N,
        body: Z,
        formattedBody: Y,
        relation: oe
      } : {
        userId: ue,
        eventId: N,
        body: "",
        formattedBody: "",
        relation: oe
      });
    }, [
      e,
      z
    ]);
    function M({ mEvent: N }) {
      const L = Fn(tu);
      return o.jsxs(tn, {
        className: Stt,
        children: [
          o.jsx(Ye, {
            size: "300",
            after: o.jsx(Q, {
              size: "100",
              src: q.ReplyArrow
            }),
            radii: "300",
            fill: "None",
            variant: "Secondary",
            onClick: (H) => {
              H.preventDefault(), H.stopPropagation(), N.event.event_id && (O(N.event.event_id, false), r());
            }
          }),
          o.jsx(Ye, {
            size: "300",
            after: o.jsx(Q, {
              size: "100",
              src: q.ThreadReply
            }),
            radii: "300",
            fill: "None",
            variant: "Secondary",
            onClick: (H) => {
              H.preventDefault(), H.stopPropagation(), N.event.event_id && (O(N.event.event_id, true), r());
            }
          }),
          U && o.jsx(Ye, {
            size: "300",
            after: o.jsx(Q, {
              size: "100",
              src: q.Delete
            }),
            radii: "300",
            fill: "None",
            variant: "Critical",
            onClick: (H) => {
              H.preventDefault(), H.stopPropagation(), L({
                type: _a.Delete,
                room: e,
                mEvent: N
              });
            }
          })
        ]
      });
    }
    function I({ mEvent: N, EventContent: L }) {
      var _a7, _b4;
      const [H, V] = p.useState(false);
      return o.jsxs(E, {
        style: {
          position: "relative",
          width: "100%"
        },
        onMouseEnter: () => V(true),
        onMouseLeave: () => V(false),
        onClick: () => V(!H),
        children: [
          o.jsxs(E, {
            className: ktt,
            children: [
              o.jsx(Ma, {
                ts: N.getTs(),
                hour24Clock: w,
                dateFormatString: b
              }),
              o.jsx(D, {
                size: "T400",
                style: {
                  paddingLeft: "10px",
                  wordBreak: "break-word"
                },
                children: o.jsx(hS, {
                  body: ((_a7 = L == null ? void 0 : L["m.new_content"]) == null ? void 0 : _a7.body) ?? (L == null ? void 0 : L.body) ?? "",
                  customBody: ((_b4 = L == null ? void 0 : L["m.new_content"]) == null ? void 0 : _b4.formatted_body) ?? (L == null ? void 0 : L.formatted_body) ?? "",
                  htmlReactParserOptions: C,
                  linkifyOpts: j
                })
              })
            ]
          }),
          H && o.jsx(M, {
            mEvent: N
          })
        ]
      });
    }
    return o.jsxs(E, {
      className: gt(Dtt, t),
      direction: "Column",
      ...i,
      ref: a,
      children: [
        o.jsxs(wn, {
          className: Ctt,
          variant: "Surface",
          size: "600",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H3",
                children: "Message version history"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: r,
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsx(wn, {
          children: o.jsx(Ye, {
            style: {
              display: "flex",
              justifyContent: "center",
              padding: `${ee.space.S200} ${ee.space.S200}`,
              height: "unset"
            },
            radii: "400",
            onClick: (N) => {
              d(e.roomId, u == null ? void 0 : u.roomId, g, wp(N.nativeEvent), "Bottom");
            },
            before: o.jsx(xn, {
              size: "300",
              children: o.jsx(Si, {
                userId: g ?? "",
                src: y ?? void 0,
                alt: m,
                renderFallback: () => o.jsx(Q, {
                  size: "50",
                  src: q.User,
                  filled: true
                })
              })
            }),
            children: o.jsx(D, {
              size: "T400",
              children: m
            })
          }, g)
        }),
        o.jsx(E, {
          grow: "Yes",
          style: {
            overflow: "scroll"
          },
          children: o.jsx(dn, {
            visibility: "Hover",
            children: o.jsx(E, {
              className: Ett,
              direction: "Column",
              children: n.map((N) => {
                if (!N.event.sender) return o.jsx("div", {}, N.event.event_id);
                const L = N.getOriginalContent();
                return o.jsxs(o.Fragment, {
                  children: [
                    o.jsx("hr", {
                      style: {
                        width: "100%",
                        color: ct.Surface.ContainerLine
                      }
                    }),
                    o.jsx(I, {
                      mEvent: N,
                      EventContent: L
                    })
                  ]
                });
              })
            })
          })
        })
      ]
    });
  });
  function dfe({ room: t, mEvent: e, closeMenu: n }) {
    const r = Fn(tu);
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.Clock
      }),
      radii: "300",
      onClick: (i) => {
        i.preventDefault(), i.stopPropagation(), n(), r({
          type: _a.EditHistory,
          room: t,
          mEvent: e
        });
      },
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "Version History"
      })
    });
  }
  function Ttt({ room: t, mEvent: e, onClose: n }) {
    const r = () => {
      var _a6;
      const i = e.getId(), a = t.getTimelineForEvent(i), s = a && ((_a6 = Xb(a.getTimelineSet(), i, e.getType())) == null ? void 0 : _a6.getRelations());
      return s ? (s.sort((l, c) => l.getTs() - c.getTs()), [
        e,
        ...s
      ]) : [
        e
      ];
    };
    return o.jsx(jtt, {
      room: t,
      mEvents: r(),
      requestClose: n
    });
  }
  function ufe({ room: t, mEvent: e }) {
    const n = Fn(tu);
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.BlockCode
      }),
      radii: "300",
      onClick: (r) => {
        r.preventDefault(), r.stopPropagation(), n({
          type: _a.Source,
          room: t,
          mEvent: e
        });
      },
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "View Source"
      })
    });
  }
  const _T = (t) => t.isEncrypted() ? {
    "<== DECRYPTED_EVENT ==>": t.getEffectiveEvent(),
    "<== ORIGINAL_EVENT ==>": t.event
  } : t.event;
  function Rtt({ room: t, mEvent: e, onClose: n }) {
    const r = () => {
      var _a6;
      const i = e.getId(), a = t.getTimelineForEvent(i), s = a && ((_a6 = Xb(a.getTimelineSet(), i, e.getType())) == null ? void 0 : _a6.getRelations());
      if (!s) return JSON.stringify(_T(e), null, 2);
      const l = {
        "<== MAIN_EVENT ==>": _T(e)
      };
      return s.forEach((c, d) => {
        l[`<== REPLACEMENT_EVENT_${d + 1} ==>`] = _T(c);
      }), JSON.stringify(l, null, 2);
    };
    return o.jsx(Vce, {
      name: "Source Code",
      langName: "json",
      text: r(),
      requestClose: n
    });
  }
  const yT = fo("MessageDelete");
  function hfe({ room: t, mEvent: e }) {
    const n = Fn(tu);
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.Delete
      }),
      radii: "300",
      fill: "None",
      variant: "Critical",
      onClick: (r) => {
        r.preventDefault(), r.stopPropagation(), n({
          type: _a.Delete,
          room: t,
          mEvent: e
        });
      },
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "Delete"
      })
    });
  }
  function Att({ room: t, mEvent: e, onClose: n }) {
    const r = be(), [i, a] = Et(p.useCallback((l, c) => r.redactEvent(t.roomId, l, void 0, c ? {
      reason: c
    } : void 0), [
      r,
      t
    ]));
    p.useEffect(() => {
      i.status === ve.Success && (yT.info("ui", "Message deleted successfully", {
        roomId: t.roomId
      }), Vr("sable.message.delete.success", 1), n()), i.status === ve.Error && (yT.error("ui", "Message delete failed", {
        roomId: t.roomId
      }), Vr("sable.message.delete.error", 1));
    }, [
      i.status,
      t.roomId,
      n
    ]);
    const s = (l) => {
      var _a6;
      l.preventDefault();
      const c = e.getId();
      if (!c || i.status === ve.Loading || i.status === ve.Success) return;
      const u = (_a6 = l.target) == null ? void 0 : _a6.reasonInput, h = u && u.value.trim();
      yT.info("ui", "Deleting message", {
        eventId: c,
        hasReason: !!h
      }), Vr("sable.message.delete.attempt", 1), a(c, h);
    };
    return o.jsxs(lr, {
      variant: "Surface",
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
            borderBottomWidth: ee.borderWidth.B300
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "Delete Message"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: n,
              radii: "300",
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsxs(E, {
          as: "form",
          onSubmit: s,
          style: {
            padding: ee.space.S400
          },
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(D, {
              priority: "400",
              children: "This action is irreversible! Are you sure that you want to delete this message?"
            }),
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsxs(D, {
                  size: "L400",
                  children: [
                    "Reason",
                    " ",
                    o.jsx(D, {
                      as: "span",
                      size: "T200",
                      children: "(optional)"
                    })
                  ]
                }),
                o.jsx(mn, {
                  name: "reasonInput",
                  variant: "Background"
                }),
                i.status === ve.Error && o.jsx(D, {
                  style: {
                    color: ct.Critical.Main
                  },
                  size: "T300",
                  children: "Failed to delete message! Please try again."
                })
              ]
            }),
            o.jsx(xe, {
              type: "submit",
              variant: "Critical",
              before: i.status === ve.Loading ? o.jsx(dt, {
                fill: "Solid",
                variant: "Critical",
                size: "200"
              }) : void 0,
              "aria-disabled": i.status === ve.Loading,
              children: o.jsx(D, {
                size: "B400",
                children: i.status === ve.Loading ? "Deleting..." : "Delete"
              })
            })
          ]
        })
      ]
    });
  }
  const bT = fo("MessageReport");
  function ffe({ room: t, mEvent: e }) {
    const n = Fn(tu);
    return o.jsx(Ye, {
      size: "300",
      variant: "Critical",
      fill: "None",
      after: o.jsx(Q, {
        size: "100",
        src: q.Warning
      }),
      radii: "300",
      onClick: (r) => {
        r.preventDefault(), r.stopPropagation(), n({
          type: _a.Report,
          room: t,
          mEvent: e
        });
      },
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "Report"
      })
    });
  }
  function Itt({ room: t, mEvent: e, onClose: n }) {
    const r = be(), [i, a] = Et(p.useCallback((l, c, d) => r.reportEvent(t.roomId, l, c, d), [
      r,
      t
    ]));
    p.useEffect(() => {
      i.status === ve.Success && (bT.info("ui", "Message reported successfully", {
        roomId: t.roomId
      }), Vr("sable.message.report.success", 1)), i.status === ve.Error && (bT.error("ui", "Message report failed", {
        roomId: t.roomId
      }), Vr("sable.message.report.error", 1));
    }, [
      i.status,
      t.roomId
    ]);
    const s = (l) => {
      var _a6;
      l.preventDefault();
      const c = e.getId();
      if (!c || i.status === ve.Loading || i.status === ve.Success) return;
      const u = (_a6 = l.target) == null ? void 0 : _a6.reasonInput, h = u && u.value.trim();
      bT.info("ui", "Reporting message", {
        eventId: c,
        hasReason: !!h
      }), Vr("sable.message.report.attempt", 1), a(c, h ? -100 : -50, h || "No reason provided");
    };
    return o.jsxs(lr, {
      variant: "Surface",
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
            borderBottomWidth: ee.borderWidth.B300
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "Report Message"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: n,
              radii: "300",
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsxs(E, {
          as: "form",
          onSubmit: s,
          style: {
            padding: ee.space.S400
          },
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(D, {
              priority: "400",
              children: "Report this message to the server, which may then notify the appropriate people to take action."
            }),
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Reason"
                }),
                o.jsx(mn, {
                  name: "reasonInput",
                  variant: "Background",
                  required: true
                }),
                i.status === ve.Error && o.jsx(D, {
                  style: {
                    color: ct.Critical.Main
                  },
                  size: "T300",
                  children: "Failed to report message! Please try again."
                }),
                i.status === ve.Success && o.jsx(D, {
                  style: {
                    color: ct.Success.Main
                  },
                  size: "T300",
                  children: "Message has been reported to server."
                })
              ]
            }),
            o.jsx(xe, {
              type: "submit",
              variant: "Critical",
              before: i.status === ve.Loading ? o.jsx(dt, {
                fill: "Solid",
                variant: "Critical",
                size: "200"
              }) : void 0,
              "aria-disabled": i.status === ve.Loading || i.status === ve.Success,
              children: o.jsx(D, {
                size: "B400",
                children: i.status === ve.Loading ? "Reporting..." : "Report"
              })
            })
          ]
        })
      ]
    });
  }
  async function Btt(t, e, n, r, i) {
    var _a6, _b3;
    const a = ((_a6 = t.getAccountData(Zr.PoniesUserEmotes)) == null ? void 0 : _a6.getContent()) ?? {}, s = {
      ...a,
      images: {
        ...a.images,
        [e]: {
          ...(_b3 = a.images) == null ? void 0 : _b3[e],
          url: n,
          body: r,
          info: i,
          usage: [
            Hr.Sticker
          ]
        }
      }
    };
    await t.setAccountData(Zr.PoniesUserEmotes, s);
  }
  function Ptt(t, e) {
    var _a6;
    const n = (_a6 = t.getAccountData(Zr.PoniesUserEmotes)) == null ? void 0 : _a6.getContent().images;
    return n === void 0 ? false : Object.values(n).some((r) => r.url === e) ?? false;
  }
  const uC = "(https?:\\/\\/.[A-Za-z0-9-._~:/?#[\\()@!$&'*+,;%=]+)", PJ = new RegExp(`\\(?(${uC})\\)?`, "g");
  function MJ(t) {
    const e = new RegExp(String.raw`\\<(${uC})\\>`, "g"), n = new RegExp(String.raw`\\<(${uC})`, "g"), r = new RegExp(String.raw`(${uC})\\>`, "g");
    let i = t.replace(e, "<$1>").replace(n, "<$1").replace(r, "$1>");
    const a = new RegExp(String.raw`\\<\[([^\]]*)\]\((<https?:\/\/[^>\s]+>)\)\\>`, "g");
    i = i.replace(a, "[$1]($2)");
    const s = /\\<\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)(?:>|\\>)/g;
    return i = i.replace(s, "[$1](<$2>)"), i;
  }
  function Mtt(t, e) {
    if (!e) return t;
    const n = new Set(e.map((r) => r.matched_url));
    return PJ.lastIndex = 0, t.replace(PJ, (...r) => {
      const i = r[0], a = r[r.length - 3], s = r[r.length - 2];
      if (!a || n.has(a) || zc(a)) return i;
      const l = t.indexOf(a, s);
      return t.slice(s + i.length, s + i.length + 2) === "](" || s >= 3 && t.slice(s - 3, s) === "](<" || l !== -1 && t.slice(l - 1, l + a.length + 1) === `<${a}>` ? i : i.startsWith("(") && i.endsWith(")") ? `(<${a}>)` : i.startsWith("(") ? `(<${a}` : i.endsWith(")") ? `<${a}>)` : `<${a}>`;
    });
  }
  const Ott = ft(({ room: t, roomId: e, mEvent: n, imagePackRooms: r, onCancel: i, ...a }, s) => {
    var _a6;
    const l = be(), c = Ze(qr), d = p3(), [u] = Fe(ge, "enterForNewline"), h = Tte(), [f, g] = p.useState(), m = p.useCallback(() => {
      var _a7;
      const L = n.getId();
      if (!L) return [
        void 0,
        void 0,
        void 0
      ];
      const H = t.getTimelineForEvent(L), Z = ((_a7 = H && eh(L, n, H.getTimelineSet())) == null ? void 0 : _a7.getContent()["m.new_content"]) ?? n.getContent();
      let { body: Y, formatted_body: oe } = Z;
      const ue = Z["m.mentions"], ie = Z["com.beeper.per_message_profile"], de = ie !== null && typeof ie == "object" && "displayname" in ie && typeof ie.displayname == "string" && ie.displayname.length > 0 ? ie.displayname : void 0;
      if (de && typeof Y == "string") {
        const X = `${de}: `;
        Y.startsWith(X) && (Y = Y.slice(X.length));
      }
      de && typeof oe == "string" && (oe = oe.replace(/^<strong\s+data-mx-profile-fallback[^>]*>.*?<\/strong>/, ""));
      const ne = Z["com.beeper.linkpreviews"] ?? [], ae = (X, K) => {
        if (!K) return Mtt(X, ne);
        const G = X.split(new RegExp("(?=^.+<)|(?=<a.+)|(?<=\\/a>)|(?=<code.+)|(?<=\\/code>)", "gi"));
        let le = "";
        return G.map((te) => te.startsWith("<a") ? [
          te
        ] : te.split(/(?=[ \n()])/g)).reduce((te, re) => te.concat(re), []).map((te) => {
          var _a8, _b3;
          if (te.length < 6 || te.startsWith("<code") || te.endsWith("code>")) {
            le += te;
            return;
          }
          const re = te.substring(1), he = K && te.toLowerCase().startsWith("<a") ? (_a8 = te.match(/href\s*=\s*["']([^"']+)["']/i)) == null ? void 0 : _a8[1] : void 0, se = (_b3 = re.match(/https?:\/\/[^\s)]+/)) == null ? void 0 : _b3[0], we = !zc(he ?? se ?? "") && ((ne == null ? void 0 : ne.length) === 0 || ne.filter((Ee) => te.includes(Ee.matched_url)).length === 0) && re.match(yE) !== null;
          if (we && K && te.toLowerCase().startsWith("<a")) {
            le += `&lt;${te}&gt;`;
            return;
          }
          le += `${we ? K && `${te[0]}&lt;` || `${te[0]}<` : te[0]}${re}${we ? K && "&gt;" || ">" : ""}`;
        }), le;
      };
      return [
        typeof Y == "string" ? ae(Y) : void 0,
        typeof oe == "string" ? ae(oe, true) : void 0,
        ue
      ];
    }, [
      t,
      n
    ]), [v, y] = Et(p.useCallback(async () => {
      var _a7, _b3, _c3, _d4, _e13, _f4;
      const L = n.getContent(), H = n.getContent().msgtype;
      let V = Hl(d.children).trim(), Z = _b(lp(d.children, {
        forEmote: H === Jn.Emote,
        room: t
      }));
      const [Y, oe, ue] = m();
      if (V === "") return;
      const ie = n.getId();
      if (!ie || Y && (oe && sie(oe) === Z || !oe && Y === V && AI(Z, V))) return;
      const de = {
        msgtype: H,
        body: V
      }, ne = n.getId(), ae = ne ? t.getTimelineForEvent(ne) : void 0, K = ((_c3 = (_b3 = (_a7 = ae && ne ? eh(ne, n, ae.getTimelineSet()) : void 0) == null ? void 0 : _a7.getContent()) == null ? void 0 : _b3["m.new_content"]) == null ? void 0 : _c3["com.beeper.per_message_profile"]) ?? ((_d4 = n.getContent()) == null ? void 0 : _d4["com.beeper.per_message_profile"]), G = K !== null && typeof K == "object" && "displayname" in K && typeof K.displayname == "string" && K.displayname.length > 0 ? K.displayname : void 0;
      if (G) {
        const ye = `${G}: `;
        V.startsWith(ye) || (V = ye + V);
        const Ee = `<strong data-mx-profile-fallback>${Va(G)}: </strong>`;
        Z.startsWith(Ee) || (Z = Ee + Z), de["com.beeper.per_message_profile"] = K;
      }
      const le = {
        body: `* ${V}`
      }, te = II(l, e, d);
      (_e13 = ue == null ? void 0 : ue.user_ids) == null ? void 0 : _e13.forEach((ye) => {
        te.users.add(ye);
      });
      const re = cie(Array.from(te.users), te.room);
      de["m.mentions"] = re, le["m.mentions"] = re;
      const he = oce(d.children);
      (G || !AI(Z, V)) && (de.format = "org.matrix.custom.html", de.formatted_body = Z, le.format = "org.matrix.custom.html", le.formatted_body = `* ${Z}`);
      const se = {
        ...L,
        "m.relates_to": {
          event_id: ie,
          rel_type: Xn.Replace
        }
      };
      return se.body = le.body, se.format = le.format, se.formatted_body = le.formatted_body, se["m.new_content"] = de, L.info !== void 0 && ((_f4 = L.filename) == null ? void 0 : _f4.length) > 0 && (se.filename = L.filename, se["m.new_content"].filename = L.filename, se.info = L.info, se["m.new_content"].info = L.info, L.file !== void 0 && (se["m.new_content"].file = L.file), L.url !== void 0 && (se["m.new_content"].url = L.url), L["page.codeberg.everypizza.msc4193.spoiler"] !== void 0 && (se["page.codeberg.everypizza.msc4193.spoiler"] = L["page.codeberg.everypizza.msc4193.spoiler"], se["m.new_content"]["page.codeberg.everypizza.msc4193.spoiler"] = L["page.codeberg.everypizza.msc4193.spoiler"])), se["com.beeper.linkpreviews"] = [], he == null ? void 0 : he.forEach((ye) => se["com.beeper.linkpreviews"].push({
        matched_url: ye
      })), se["m.new_content"]["com.beeper.linkpreviews"] = se["com.beeper.linkpreviews"], l.sendMessage(e, se);
    }, [
      l,
      d,
      e,
      n,
      m,
      t
    ])), w = p.useCallback(() => {
      v.status !== ve.Loading && y();
    }, [
      v,
      y
    ]), b = p.useCallback((L) => {
      if ((Yt.isKeyHotkey("mod+enter", L) || !u && Yt.isKeyHotkey("enter", L)) && !h(L)) {
        const H = gb(d);
        if (H && fF(d, H, xI)) return;
        L.preventDefault(), w();
      }
      Yt.isKeyHotkey("escape", L) && (L.preventDefault(), i());
    }, [
      u,
      h,
      d,
      w,
      i
    ]), j = p.useCallback((L) => {
      if (Yt.isKeyHotkey("escape", L)) {
        L.preventDefault();
        return;
      }
      const H = gb(d), V = H ? fF(d, H, xI) : void 0;
      g(V);
    }, [
      d
    ]), k = p.useCallback(() => {
      Bt.focus(d), g(void 0);
    }, [
      d
    ]), C = (L, H) => {
      d.insertNode(YF(L, H)), Gl(d);
    };
    p.useEffect(() => {
      const [L, H] = m(), V = {
        room: t,
        nicknames: c,
        mxUserId: l.getUserId() ?? void 0
      }, Z = jf(H ? MJ(vb(H)) : typeof L == "string" ? MJ(L) : "", V);
      xt.select(d, {
        anchor: fe.start(d, []),
        focus: fe.end(d, [])
      }), d.insertFragment(Z), Dr() || Bt.focus(d);
    }, [
      d,
      m,
      t,
      c,
      l
    ]), p.useEffect(() => {
      v.status === ve.Success && i();
    }, [
      v,
      i
    ]);
    const x = hn(), S = gs(), T = p.useMemo(() => ({
      ...fs
    }), []), A = Xd(), [B] = Fe(ge, "incomingInlineImagesDefaultHeight"), [U] = Fe(ge, "incomingInlineImagesMaxHeight"), z = p.useMemo(() => Ql(l, n.getRoomId(), {
      settingsLinkBaseUrl: S,
      linkifyOpts: T,
      useAuthentication: x,
      handleSpoilerClick: A,
      incomingInlineImagesDefaultHeight: B,
      incomingInlineImagesMaxHeight: U
    }), [
      T,
      n,
      l,
      S,
      A,
      x,
      B,
      U
    ]), O = (() => n.getContent()), M = n.getContent().msgtype, [I] = Fe(ge, "captionPosition"), N = {
      [Ua.Above]: "column-reverse",
      [Ua.Below]: "column",
      [Ua.Inline]: "row",
      [Ua.Hidden]: "row"
    };
    return o.jsxs("div", {
      ...a,
      ref: s,
      className: `${a.className || ""} ${ANe}`.trim(),
      children: [
        (f == null ? void 0 : f.prefix) === al.RoomMention && o.jsx(ple, {
          roomId: e,
          editor: d,
          query: f,
          requestClose: k
        }),
        (f == null ? void 0 : f.prefix) === al.UserMention && o.jsx(Fle, {
          room: t,
          editor: d,
          query: f,
          requestClose: k
        }),
        (f == null ? void 0 : f.prefix) === al.Emoticon && o.jsx(pb, {
          imagePackRooms: r || [],
          editor: d,
          query: f,
          requestClose: k
        }),
        o.jsxs(E, {
          style: {
            display: "flex",
            flexDirection: N[I]
          },
          children: [
            (M === Jn.Image || M === Jn.Video || M === Jn.Audio || M === Jn.File) && o.jsx(oh, {
              displayName: ((_a6 = n.sender) == null ? void 0 : _a6.name) ?? "",
              msgType: n.getContent().msgtype ?? "",
              ts: n.getTs(),
              getContent: O,
              htmlReactParserOptions: z,
              hideCaption: true,
              linkifyOpts: T
            }),
            o.jsx(E, {
              style: I !== Ua.Inline ? {
                marginTop: M === Jn.Image || M === Jn.Video || M === Jn.Audio || M === Jn.File ? ee.space.S400 : void 0,
                width: "100%"
              } : {
                padding: ee.space.S200,
                wordBreak: "break-word",
                maxWidth: "100%",
                width: "100%",
                display: "flex",
                flexDirection: "column",
                justifyContent: "center",
                flexShrink: 1
              },
              children: o.jsx(oS, {
                editor: d,
                placeholder: "Edit message...",
                onKeyDown: b,
                onKeyUp: j,
                bottom: o.jsxs(o.Fragment, {
                  children: [
                    o.jsx(uS, {}),
                    o.jsxs(E, {
                      style: {
                        padding: ee.space.S200,
                        paddingTop: 0
                      },
                      alignItems: "End",
                      justifyContent: "SpaceBetween",
                      gap: "100",
                      children: [
                        o.jsxs(E, {
                          gap: "Inherit",
                          children: [
                            o.jsx(Qe, {
                              onClick: w,
                              variant: "Primary",
                              radii: "Pill",
                              disabled: v.status === ve.Loading,
                              outlined: true,
                              before: v.status === ve.Loading ? o.jsx(dt, {
                                variant: "Primary",
                                fill: "Soft",
                                size: "100"
                              }) : void 0,
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Save"
                              })
                            }),
                            o.jsx(Qe, {
                              onClick: i,
                              variant: "SurfaceVariant",
                              radii: "Pill",
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Cancel"
                              })
                            })
                          ]
                        }),
                        o.jsxs(E, {
                          gap: "Inherit",
                          children: [
                            o.jsx(dS, {
                              variant: "SurfaceVariant"
                            }),
                            o.jsx(Hi, {
                              initial: void 0,
                              children: (L, H) => o.jsx(ln, {
                                anchor: L,
                                alignOffset: -8,
                                position: "Top",
                                align: "End",
                                content: o.jsx(JF, {
                                  imagePackRooms: r ?? [],
                                  returnFocusOnDeactivate: false,
                                  onEmojiSelect: C,
                                  onCustomEmojiSelect: C,
                                  requestClose: () => {
                                    H((V) => {
                                      if (V) {
                                        Dr() || Bt.focus(d);
                                        return;
                                      }
                                      return V;
                                    });
                                  }
                                }),
                                children: o.jsx(Oe, {
                                  "aria-pressed": L !== void 0,
                                  onClick: ((V) => H(V.currentTarget.getBoundingClientRect())),
                                  variant: "SurfaceVariant",
                                  size: "300",
                                  radii: "300",
                                  children: o.jsx(Q, {
                                    size: "400",
                                    src: q.Smile,
                                    filled: L !== void 0
                                  })
                                })
                              })
                            })
                          ]
                        })
                      ]
                    })
                  ]
                })
              })
            })
          ]
        })
      ]
    });
  }), Ltt = p.memo(({ children: t }) => t), Ntt = ft(({ onReaction: t, ...e }, n) => {
    const r = be(), i = cM(r, 4);
    return i.length === 0 ? o.jsx("span", {}) : o.jsxs(o.Fragment, {
      children: [
        o.jsx(E, {
          style: {
            padding: ee.space.S200
          },
          alignItems: "Center",
          justifyContent: "Center",
          gap: "200",
          ...e,
          ref: n,
          children: i.map((a) => o.jsx(Oe, {
            className: uAe,
            size: "300",
            variant: "SurfaceVariant",
            radii: "Pill",
            title: a.shortcode,
            "aria-label": a.shortcode,
            onClick: () => t(a.unicode, a.shortcode),
            children: o.jsx(D, {
              size: "T500",
              children: a.unicode
            })
          }, a.unicode))
        }),
        o.jsx(nr, {
          size: "300"
        })
      ]
    });
  }), mfe = ft(({ room: t, mEvent: e, onClose: n, ...r }, i) => {
    const a = () => {
      const s = e.getId();
      s && (Jo(Dte(t.roomId, s, Xc(t))), n == null ? void 0 : n());
    };
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.Link
      }),
      radii: "300",
      onClick: a,
      ...r,
      ref: i,
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: "Copy Link"
      })
    });
  }), ztt = ft(({ room: t, mEvent: e, onClose: n, ...r }, i) => {
    const a = be(), s = XM(t), l = s.includes(e.getId() ?? ""), c = () => {
      const d = e.getId(), u = {
        pinned: Array.from(s).filter((h) => h !== d)
      };
      !l && d && u.pinned.push(d), a.sendStateEvent(t.roomId, ce.RoomPinnedEvents, u), n == null ? void 0 : n();
    };
    return o.jsx(Ye, {
      size: "300",
      after: o.jsx(Q, {
        size: "100",
        src: q.Pin
      }),
      radii: "300",
      onClick: c,
      ...r,
      ref: i,
      children: o.jsx(D, {
        className: Ha,
        as: "span",
        size: "T300",
        truncate: true,
        children: l ? "Unpin Message" : "Pin Message"
      })
    });
  });
  function gfe(t, e = 300) {
    const n = p.useRef(0);
    return p.useCallback(() => {
      if (!Dr()) return;
      const r = Date.now(), i = r - n.current;
      i < e && i > 0 ? (t(), n.current = 0) : n.current = r;
    }, [
      t,
      e
    ]);
  }
  const pfe = (t, e) => t.length > e ? `${t.slice(0, e)}...` : t;
  function Utt({ pronouns: t, tagColor: e, maxPillLength: n }) {
    const [r, i] = p.useState(), a = (u) => {
      i((h) => h ? void 0 : u.getBoundingClientRect());
    }, s = (u) => {
      u.stopPropagation(), a(u.currentTarget);
    }, l = (u) => {
      u.key !== "Enter" && u.key !== " " || (u.preventDefault(), u.stopPropagation(), a(u.currentTarget));
    };
    p.useEffect(() => {
      if (!r) return;
      const u = () => i(void 0);
      return document.addEventListener("click", u, {
        once: true
      }), () => document.removeEventListener("click", u);
    }, [
      r
    ]);
    const c = t.map((u) => pfe(u.summary, n)).join(", "), d = o.jsx(pr, {
      style: {
        maxWidth: He(250)
      },
      children: o.jsx(D, {
        size: "T200",
        children: c
      })
    });
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(ar, {
          position: "Top",
          tooltip: d,
          children: (u) => o.jsx(Poe, {
            ref: u,
            style: {
              color: e,
              cursor: "help"
            },
            onClick: s,
            onKeyDown: l,
            role: "button",
            tabIndex: 0,
            children: "..."
          })
        }),
        r && o.jsx(ln, {
          anchor: r,
          position: "Top",
          align: "Center",
          content: d,
          children: null
        })
      ]
    });
  }
  const Vtt = ft(({ as: t = "span", pronouns: e, tagColor: n, ...r }, i) => {
    if (!e || e.length === 0) return null;
    const a = Ol().filterPronounsBasedOnLanguage ?? false, s = (Ol().filterPronounsLanguages ?? [
      "en"
    ]).map((u) => u.trim().toLowerCase()).filter(Boolean), l = xce(e, a, s), c = Ol().pronounPillMaxCount ?? 3, d = Ol().pronounPillMaxLength ?? 16;
    return l.length === 0 && l.push(...e), o.jsxs(t, {
      ...r,
      ref: i,
      children: [
        l.slice(0, c).map((u) => o.jsx(Poe, {
          style: {
            color: n
          },
          children: pfe(u.summary, d)
        }, u.summary)),
        l.length > c && o.jsx(Utt, {
          pronouns: l.slice(c),
          tagColor: n,
          maxPillLength: d
        })
      ]
    });
  });
  function Htt({ className: t, room: e, mEvent: n, collapse: r, highlight: i, notifyHighlight: a, isMarked: s, edit: l, canDelete: c, canSendReaction: d, canPinEvent: u, imagePackRooms: h, relations: f, messageLayout: g, messageSpacing: m, onUserClick: v, onUsernameClick: y, onReplyClick: w, onReactionToggle: b, onEditId: j, reply: k, reactions: C, hideReadReceipts: x, showDeveloperTools: S, memberPowerTag: T, hour24Clock: A, dateFormatString: B, children: U, senderId: z, senderDisplayName: O, activeReplyId: M, sendStatus: I, onResend: N, onDeleteFailedSend: L, messageForwardedProps: H, msc2723ForwardedMessageProps: V, ...Z }, Y) {
    var _a6, _b3, _c3;
    const oe = be(), ue = hn(), [ie, de] = p.useState(0);
    p.useEffect(() => {
      const Ve = () => {
        e.emit(mt.LocalEchoUpdated, n, e);
      }, St = () => {
        de((pt) => pt + 1), Ve();
      };
      return n.getClearContent() && (de((pt) => pt === 0 ? 1 : pt), Ve()), n.on(or.Decrypted, St), n.on(or.Replaced, St), () => {
        n.off(or.Decrypted, St), n.off(or.Replaced, St);
      };
    }, [
      n,
      e
    ]);
    const ne = p.useMemo(() => {
      var _a7;
      const Ve = n.getId(), St = Ve ? e.getTimelineForEvent(Ve) : void 0, pt = St && Ve ? eh(Ve, n, St.getTimelineSet()) : void 0;
      return (_a7 = pt ? pt.getContent()["m.new_content"] : n.getContent()) == null ? void 0 : _a7["com.beeper.per_message_profile"];
    }, [
      n,
      e,
      ie
    ]), ae = p.useMemo(() => {
      if (ne) return Iqe(ne);
    }, [
      ne
    ]), X = (ae == null ? void 0 : ae.name) && ((_a6 = ae.name) == null ? void 0 : _a6.trim()) !== "", K = Hc(z, e), { color: G, font: le } = rm(z, e), te = (ae == null ? void 0 : ae.pronouns) ?? K.pronouns, [re] = Fe(ge, "highlightMentions"), he = Jc(e, z), se = p.useMemo(() => {
      if (r) return;
      const Ve = (ne == null ? void 0 : ne.avatar_url) || he || K.avatarUrl;
      return Ve ? Cn(oe, Ve, ue, 48, 48, "crop") : void 0;
    }, [
      ne,
      r,
      he,
      K.avatarUrl,
      oe,
      ue
    ]), ye = E8(se ?? void 0), [we, Ee] = p.useState(false), { hoverProps: ke } = rO({
      onHoverChange: (Ve) => {
        Dr() || Ee(Ve);
      }
    }), { focusWithinProps: Ne } = nO({
      onFocusWithinChange: (Ve) => {
        Dr() || Ee(Ve);
      }
    }), [lt, Rt] = p.useState(), [We, yt] = p.useState(), [Xt, nn] = p.useState(false), [bt, At] = p.useState(""), $t = Ze(qr), Lt = Fn(Ooe), wt = (T == null ? void 0 : T.icon) ? qc(oe, ue, T.icon) : void 0, [st, Be] = p.useState(false), Re = p.useRef(null), [Ue] = Fe(ge, "showPronouns"), [qe] = Fe(ge, "parsePronouns"), [tt] = Fe(ge, "useRightBubbles"), { cleanedDisplayName: ht, inlinePronoun: $e } = p.useMemo(() => {
      const Ve = (ne == null ? void 0 : ne.displayname) || O || "";
      return lUe(Ve, qe);
    }, [
      ne,
      O,
      qe
    ]), Tt = p.useMemo(() => {
      const Ve = te ? [
        ...te
      ] : [];
      return $e && (Ve.some((pt) => {
        var _a7;
        return ((_a7 = pt.summary) == null ? void 0 : _a7.toLowerCase()) === $e;
      }) || Ve.push({
        summary: $e,
        language: "en"
      })), Ve;
    }, [
      te,
      $e
    ]);
    p.useEffect(() => {
      if (!st) return;
      const Ve = (St) => {
        Re.current && !Re.current.contains(St.target) && Be(false);
      };
      return document.addEventListener("pointerdown", Ve, {
        capture: true
      }), () => document.removeEventListener("pointerdown", Ve, {
        capture: true
      });
    }, [
      st
    ]);
    const zt = !r && o.jsxs(E, {
      gap: "300",
      direction: g === Mr.Compact ? "RowReverse" : "Row",
      justifyContent: "SpaceBetween",
      alignItems: "Baseline",
      grow: "Yes",
      children: [
        o.jsxs(E, {
          alignItems: "Center",
          gap: "100",
          children: [
            o.jsx(l3, {
              as: "button",
              style: {
                color: G,
                fontFamily: le
              },
              "data-user-id": z,
              onContextMenu: v,
              onClick: y,
              children: o.jsx(D, {
                as: "span",
                size: g === Mr.Bubble ? "T300" : "T400",
                truncate: true,
                children: o.jsx(iF, {
                  children: ht
                })
              })
            }),
            Ue && o.jsx(Vtt, {
              pronouns: Tt,
              tagColor: G ?? "currentColor"
            }),
            X && o.jsx(E, {
              children: o.jsxs(D, {
                as: "span",
                children: [
                  o.jsx(D, {
                    as: "span",
                    style: {
                      paddingLeft: 0,
                      paddingRight: 5,
                      fontWeight: 100,
                      fontSize: 11
                    },
                    children: "via"
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: g === Mr.Bubble ? "T300" : "T400",
                    style: {
                      fontSize: 11
                    },
                    truncate: true,
                    children: o.jsx(iF, {
                      children: O
                    })
                  })
                ]
              })
            }),
            wt && o.jsx(Zc, {
              size: "100",
              iconSrc: wt
            })
          ]
        }),
        o.jsxs(E, {
          shrink: "No",
          gap: "100",
          children: [
            g === Mr.Modern && we && o.jsxs(o.Fragment, {
              children: [
                o.jsx(D, {
                  as: "span",
                  size: "T200",
                  priority: "300",
                  children: z
                }),
                o.jsx(D, {
                  as: "span",
                  size: "T200",
                  priority: "300",
                  children: "|"
                })
              ]
            }),
            o.jsx(Ma, {
              ts: n.getTs(),
              compact: g === Mr.Compact,
              hour24Clock: A,
              dateFormatString: B
            })
          ]
        })
      ]
    }), Vt = !r && g !== Mr.Compact && o.jsx(s3, {
      className: g === Mr.Bubble ? cAe : void 0,
      children: o.jsx(xn, {
        className: dAe,
        as: "button",
        size: "300",
        "data-user-id": z,
        onClick: v,
        children: o.jsx(Si, {
          userId: z,
          src: ye,
          alt: ht,
          renderFallback: () => o.jsx(Q, {
            size: "200",
            src: q.User,
            filled: true
          })
        })
      })
    }), bn = p.useMemo(() => n.getContent().body || "", [
      n
    ]), Zn = I === Vn.ENCRYPTING || I === Vn.QUEUED || I === Vn.SENDING, Kn = I === Vn.NOT_SENT, Ce = Kn && z === oe.getUserId() && !!N, Dt = Kn && z === oe.getUserId() && !!L, Ut = om(e.roomId), Zt = p.useMemo(() => {
      const Ve = (St) => St !== void 0 && St === e.roomId;
      if (H == null ? void 0 : H.isForwarded) {
        const St = H.originalRoomId;
        return {
          label: H.originalEventPrivate ? "Forwarded private message" : Ve(St) ? "Forwarded from earlier in this room" : "Forwarded from another room",
          roomId: St,
          eventId: H.originalEventId,
          ts: H.originalTimestamp ?? 0,
          showLink: !H.originalEventPrivate
        };
      }
      if (V) {
        const St = V.room_id;
        return {
          label: Ve(St) ? "Forwarded from earlier in this room" : "Forwarded from another room",
          roomId: St,
          eventId: V.event_id,
          ts: V.origin_server_ts ?? 0,
          showLink: true
        };
      }
      return null;
    }, [
      H,
      V,
      e.roomId
    ]), ut = p.useCallback((Ve) => {
      Ve.preventDefault(), Ve.stopPropagation(), N == null ? void 0 : N(n);
    }, [
      n,
      N
    ]), De = p.useCallback((Ve) => {
      Ve.preventDefault(), Ve.stopPropagation(), L == null ? void 0 : L(n);
    }, [
      n,
      L
    ]), Ae = {
      maxWidth: "100%"
    }, Ge = (_b3 = n.getId()) == null ? void 0 : _b3.startsWith("~sable-feedback-"), ot = o.jsxs(E, {
      direction: "Column",
      alignSelf: "Start",
      style: Ae,
      className: gt({
        [mAe]: Zn,
        [gAe]: Kn
      }),
      children: [
        Zt && o.jsx(Qe, {
          as: "div",
          variant: "SurfaceVariant",
          radii: "Pill",
          children: o.jsxs(D, {
            size: "T200",
            priority: "300",
            children: [
              Zt.label,
              Zt.showLink && o.jsxs(o.Fragment, {
                children: [
                  " ",
                  o.jsx("a", {
                    href: Dte(Zt.roomId, Zt.eventId),
                    rel: "noreferrer noopener",
                    "data-mention-id": Zt.roomId,
                    "data-mention-event-id": Zt.eventId,
                    onClick: Ut,
                    children: "jump to original"
                  })
                ]
              }),
              o.jsx(Ma, {
                ts: Zt.ts,
                compact: g === Mr.Compact,
                hour24Clock: A,
                dateFormatString: B,
                style: {
                  marginLeft: ee.space.S100,
                  justifyContent: "flex-end"
                }
              })
            ]
          })
        }),
        k,
        l && j ? o.jsx(Ott, {
          style: {
            maxWidth: "100%",
            width: "100%"
          },
          roomId: e.roomId,
          room: e,
          mEvent: n,
          imagePackRooms: h,
          onCancel: () => j()
        }) : o.jsx(Ltt, {
          children: U
        }, bn),
        C,
        Kn && o.jsxs(E, {
          className: rK,
          children: [
            o.jsx(D, {
              size: "T200",
              priority: "300",
              children: "Failed to send."
            }),
            Ce && o.jsx(Qe, {
              type: "button",
              variant: "Primary",
              radii: "Pill",
              outlined: true,
              onClick: ut,
              children: o.jsx(D, {
                size: "B300",
                children: "Retry"
              })
            }),
            Dt && o.jsx(Qe, {
              type: "button",
              variant: "Critical",
              radii: "Pill",
              onClick: De,
              children: o.jsx(D, {
                size: "B300",
                children: "Delete"
              })
            })
          ]
        }),
        Ge && o.jsxs(E, {
          className: rK,
          alignItems: "Center",
          gap: "100",
          children: [
            o.jsx(Q, {
              src: q.Info,
              size: "100"
            }),
            o.jsx(D, {
              size: "T200",
              priority: "300",
              as: "span",
              children: "Only you can see this."
            }),
            o.jsx(Qe, {
              type: "button",
              variant: "SurfaceVariant",
              radii: "Pill",
              outlined: true,
              onClick: (Ve) => {
                Ve.preventDefault(), Ve.stopPropagation();
                const St = n.getId();
                St && (e.removeEvent(St), e.emit(mt.LocalEchoUpdated, n, e));
              },
              children: o.jsx(D, {
                size: "B300",
                children: "Dismiss"
              })
            })
          ]
        })
      ]
    }), Mt = (Ve) => {
      var _a7;
      if (Dr()) {
        Ve.preventDefault();
        return;
      }
      if (Ve.altKey || !((_a7 = window.getSelection()) == null ? void 0 : _a7.isCollapsed) || l) return;
      const St = Ve.target.tagName;
      typeof St == "string" && St.toLowerCase() === "a" || (Ve.preventDefault(), Rt({
        x: Ve.clientX,
        y: Ve.clientY,
        width: 0,
        height: 0
      }));
    }, cn = (Ve) => {
      var _a7;
      const pt = (((_a7 = Ve.currentTarget.parentElement) == null ? void 0 : _a7.parentElement) ?? Ve.currentTarget).getBoundingClientRect();
      window.requestAnimationFrame(() => {
        Rt(pt);
      });
    }, un = () => {
      Rt(void 0), nn(false), Be(false);
    }, gn = (Ve) => {
      var _a7;
      const St = ((_a7 = Ve.currentTarget.parentElement) == null ? void 0 : _a7.parentElement) ?? Ve.currentTarget;
      yt(St.getBoundingClientRect());
    }, Ke = () => {
      const Ve = lt;
      un(), setTimeout(() => {
        yt(Ve);
      }, 100);
    }, it = () => {
      const Ve = n.getId(), St = M === Ve ? null : Ve;
      w({
        currentTarget: {
          getAttribute: (Ct) => Ct === "data-event-id" ? St : null
        }
      });
    }, It = gfe(() => {
      Be(true);
    }), Pt = Da(n, n.threadRootId), Sn = n.getType() === "m.sticker", Mn = n.getId(), on = e.getTimelineForEvent(Mn), je = (on && ((_c3 = Xb(on.getTimelineSet(), Mn, n.getType())) == null ? void 0 : _c3.getRelations())) !== void 0;
    return o.jsxs(Xy, {
      className: gt(dse, t, {
        [lAe]: g === Mr.Bubble && r
      }),
      tabIndex: 0,
      space: m,
      collapse: r,
      highlight: i,
      notifyHighlight: re ? a : void 0,
      selected: !!lt || !!We,
      isMarked: s,
      ...Z,
      ...ke,
      ...Ne,
      ref: Y,
      children: [
        !l && (we || !!lt || !!We || st) && o.jsx("div", {
          className: use,
          ref: Re,
          children: o.jsx(tn, {
            className: hse,
            variant: "SurfaceVariant",
            children: o.jsxs(E, {
              gap: "100",
              children: [
                d && o.jsx(ln, {
                  position: "Bottom",
                  align: (We == null ? void 0 : We.width) === 0 ? "Start" : "End",
                  offset: (We == null ? void 0 : We.width) === 0 ? 0 : void 0,
                  anchor: We,
                  content: o.jsx(JF, {
                    imagePackRooms: h ?? [],
                    returnFocusOnDeactivate: false,
                    allowTextCustomEmoji: true,
                    onEmojiSelect: (Ve) => {
                      b(n.getId(), Ve), yt(void 0), Be(false);
                    },
                    onCustomEmojiSelect: (Ve, St) => {
                      b(n.getId(), Ve, St), yt(void 0), Be(false);
                    },
                    requestClose: () => {
                      yt(void 0);
                    }
                  }),
                  children: o.jsx(Oe, {
                    onClick: gn,
                    variant: "SurfaceVariant",
                    size: "300",
                    radii: "300",
                    "aria-pressed": !!We,
                    children: o.jsx(Q, {
                      src: q.SmilePlus,
                      size: "100"
                    })
                  })
                }),
                o.jsx(Oe, {
                  onClick: (Ve) => {
                    w(Ve), Be(false);
                  },
                  "data-event-id": n.getId(),
                  variant: "SurfaceVariant",
                  size: "300",
                  radii: "300",
                  children: o.jsx(Q, {
                    src: q.ReplyArrow,
                    size: "100"
                  })
                }),
                !Pt && o.jsx(Oe, {
                  onClick: (Ve) => {
                    M === n.getId() && Ve.currentTarget.setAttribute("data-event-id", ""), w(Ve, true), Be(false);
                  },
                  "data-event-id": n.getId(),
                  variant: "SurfaceVariant",
                  size: "300",
                  radii: "300",
                  children: o.jsx(Q, {
                    src: q.ThreadPlus,
                    size: "100"
                  })
                }),
                J$(oe, n) && j && o.jsx(Oe, {
                  onClick: () => {
                    j(n.getId()), Be(false);
                  },
                  variant: "SurfaceVariant",
                  size: "300",
                  radii: "300",
                  children: o.jsx(Q, {
                    src: q.Pencil,
                    size: "100"
                  })
                }),
                o.jsx(ln, {
                  anchor: lt,
                  position: "Bottom",
                  align: (lt == null ? void 0 : lt.width) === 0 ? "Start" : "End",
                  offset: (lt == null ? void 0 : lt.width) === 0 ? 0 : void 0,
                  content: o.jsx(Ft, {
                    focusTrapOptions: {
                      initialFocus: false,
                      onDeactivate: () => Rt(void 0),
                      clickOutsideDeactivates: true,
                      isKeyForward: (Ve) => Ve.key === "ArrowDown",
                      isKeyBackward: (Ve) => Ve.key === "ArrowUp",
                      escapeDeactivates: kt
                    },
                    children: o.jsxs(tn, {
                      children: [
                        d && o.jsx(Ntt, {
                          onReaction: (Ve, St) => {
                            b(n.getId(), Ve, St), un();
                          }
                        }),
                        o.jsxs(E, {
                          direction: "Column",
                          gap: "100",
                          className: sE,
                          children: [
                            d && o.jsx(Ye, {
                              size: "300",
                              after: o.jsx(Q, {
                                size: "100",
                                src: q.SmilePlus
                              }),
                              radii: "300",
                              onClick: Ke,
                              children: o.jsx(D, {
                                className: Ha,
                                as: "span",
                                size: "T300",
                                truncate: true,
                                children: "Add Reaction"
                              })
                            }),
                            Sn && n.getContent().url && !Ptt(oe, n.getContent().url) && o.jsx(Ye, {
                              size: "300",
                              after: o.jsx(Q, {
                                size: "100",
                                src: q.Star
                              }),
                              radii: "300",
                              onClick: () => {
                                var _a7;
                                Btt(oe, `sticker-${n.getId()}`, n.getContent().url ?? ((_a7 = n.getContent().file) == null ? void 0 : _a7.url) ?? "", n.getContent().body, n.getContent().info), un();
                              },
                              children: o.jsx(D, {
                                className: Ha,
                                as: "span",
                                size: "T300",
                                truncate: true,
                                children: "Add to User Sticker Pack"
                              })
                            }),
                            f && o.jsx(Ftt, {
                              room: e,
                              relations: f
                            }),
                            o.jsx(Ye, {
                              size: "300",
                              after: o.jsx(Q, {
                                size: "100",
                                src: q.ReplyArrow
                              }),
                              radii: "300",
                              "data-event-id": n.getId(),
                              onClick: (Ve) => {
                                w(Ve), un();
                              },
                              children: o.jsx(D, {
                                className: Ha,
                                as: "span",
                                size: "T300",
                                truncate: true,
                                children: "Reply"
                              })
                            }),
                            !Pt && o.jsx(Ye, {
                              size: "300",
                              after: o.jsx(Q, {
                                src: q.ThreadPlus,
                                size: "100"
                              }),
                              radii: "300",
                              "data-event-id": n.getId(),
                              onClick: (Ve) => {
                                w(Ve, true), un();
                              },
                              children: o.jsx(D, {
                                className: Ha,
                                as: "span",
                                size: "T300",
                                truncate: true,
                                children: "Reply in Thread"
                              })
                            }),
                            J$(oe, n) && j && o.jsx(Ye, {
                              size: "300",
                              after: o.jsx(Q, {
                                size: "100",
                                src: q.Pencil
                              }),
                              radii: "300",
                              "data-event-id": n.getId(),
                              onClick: () => {
                                j(n.getId()), un();
                              },
                              children: o.jsx(D, {
                                className: Ha,
                                as: "span",
                                size: "T300",
                                truncate: true,
                                children: "Edit Message"
                              })
                            }),
                            !x && o.jsx(cfe, {
                              room: e,
                              eventId: n.getId() ?? ""
                            }),
                            je && o.jsx(dfe, {
                              room: e,
                              mEvent: n,
                              closeMenu: un
                            }),
                            S && o.jsx(ufe, {
                              room: e,
                              mEvent: n
                            }),
                            o.jsx(mfe, {
                              room: e,
                              mEvent: n,
                              onClose: un
                            }),
                            o.jsx(xse, {
                              room: e,
                              mEvent: n,
                              onClose: un
                            }),
                            u && o.jsx(ztt, {
                              room: e,
                              mEvent: n,
                              onClose: un
                            }),
                            z !== oe.getUserId() && (Xt ? o.jsxs(E, {
                              direction: "Column",
                              gap: "100",
                              style: {
                                padding: `${ee.space.S100} ${ee.space.S200}`
                              },
                              children: [
                                o.jsx(D, {
                                  size: "L400",
                                  children: "Nickname"
                                }),
                                o.jsx("input", {
                                  autoFocus: true,
                                  value: bt,
                                  onChange: (Ve) => At(Ve.target.value),
                                  placeholder: ht,
                                  onKeyDown: (Ve) => {
                                    Ve.key === "Enter" && (Lt(z, bt || void 0, oe), un()), Ve.key === "Escape" && un();
                                  },
                                  style: {
                                    background: "var(--mx-c-surface)",
                                    color: "var(--mx-c-on-surface)",
                                    border: "1px solid var(--mx-c-outline)",
                                    borderRadius: "6px",
                                    padding: "4px 8px",
                                    fontSize: "14px",
                                    width: "100%",
                                    outline: "none"
                                  }
                                }),
                                o.jsxs(E, {
                                  gap: "200",
                                  children: [
                                    o.jsx(Ye, {
                                      size: "300",
                                      radii: "300",
                                      variant: "Success",
                                      fill: "None",
                                      onClick: () => {
                                        Lt(z, bt || void 0, oe), un();
                                      },
                                      children: o.jsx(D, {
                                        size: "B300",
                                        children: "Save"
                                      })
                                    }),
                                    $t[z] && o.jsx(Ye, {
                                      size: "300",
                                      radii: "300",
                                      variant: "Critical",
                                      fill: "None",
                                      onClick: () => {
                                        Lt(z, void 0, oe), un();
                                      },
                                      children: o.jsx(D, {
                                        size: "B300",
                                        children: "Clear"
                                      })
                                    })
                                  ]
                                })
                              ]
                            }) : o.jsx(Ye, {
                              size: "300",
                              after: o.jsx(Q, {
                                size: "100",
                                src: q.Pencil
                              }),
                              radii: "300",
                              onClick: () => {
                                At($t[z] ?? ""), nn(true);
                              },
                              children: o.jsx(D, {
                                className: Ha,
                                as: "span",
                                size: "T300",
                                truncate: true,
                                children: $t[z] ? "Edit Nickname" : "Set Nickname"
                              })
                            }))
                          ]
                        }),
                        (!n.isRedacted() && c || n.getSender() !== oe.getUserId()) && o.jsxs(o.Fragment, {
                          children: [
                            o.jsx(nr, {
                              size: "300"
                            }),
                            o.jsxs(E, {
                              direction: "Column",
                              gap: "100",
                              className: sE,
                              children: [
                                !n.isRedacted() && c && o.jsx(hfe, {
                                  room: e,
                                  mEvent: n
                                }),
                                n.getSender() !== oe.getUserId() && o.jsx(ffe, {
                                  room: e,
                                  mEvent: n
                                })
                              ]
                            })
                          ]
                        })
                      ]
                    })
                  }),
                  children: o.jsx(Oe, {
                    variant: "SurfaceVariant",
                    size: "300",
                    radii: "300",
                    onClick: cn,
                    "aria-pressed": !!lt,
                    children: o.jsx(Q, {
                      src: q.VerticalDots,
                      size: "100"
                    })
                  })
                })
              ]
            })
          })
        }),
        g === Mr.Compact && o.jsx(vT, {
          onReply: it,
          children: o.jsx(bP, {
            before: zt,
            onContextMenu: Mt,
            children: o.jsx("div", {
              onPointerDown: It,
              children: ot
            })
          })
        }),
        g === Mr.Bubble && o.jsx(vT, {
          onReply: it,
          children: o.jsx(Boe, {
            before: Vt,
            header: zt,
            onContextMenu: Mt,
            align: tt && z === oe.getUserId() ? "right" : "left",
            children: o.jsx("div", {
              onPointerDown: It,
              children: ot
            })
          })
        }),
        g !== Mr.Compact && g !== Mr.Bubble && o.jsx(vT, {
          onReply: it,
          children: o.jsx(Cp, {
            before: Vt,
            onContextMenu: Mt,
            children: o.jsxs("div", {
              onPointerDown: It,
              children: [
                zt,
                ot
              ]
            })
          })
        })
      ]
    });
  }
  const $tt = ft(Htt), xT = p.memo($tt), Zh = ft(({ className: t, room: e, mEvent: n, highlight: r, notifyHighlight: i, isMarked: a, collapse: s, canDelete: l, onReplyClick: c, messageSpacing: d, hideReadReceipts: u, showDeveloperTools: h, children: f, ...g }, m) => {
    var _a6;
    const v = be(), y = typeof n.getStateKey() == "string", [w, b] = p.useState(), [j, k] = p.useState(false), [C] = Fe(ge, "highlightMentions"), x = (V) => {
      var _a7;
      if (Dr()) {
        V.preventDefault();
        return;
      }
      if (V.altKey || !((_a7 = window.getSelection()) == null ? void 0 : _a7.isCollapsed)) return;
      const Z = V.target.tagName;
      typeof Z == "string" && Z.toLowerCase() === "a" || (V.preventDefault(), b({
        x: V.clientX,
        y: V.clientY,
        width: 0,
        height: 0
      }));
    }, S = (V) => {
      var _a7;
      const Y = (((_a7 = V.currentTarget.parentElement) == null ? void 0 : _a7.parentElement) ?? V.currentTarget).getBoundingClientRect();
      window.requestAnimationFrame(() => {
        b(Y);
      });
    }, T = () => {
      b(void 0), k(false);
    }, [A, B] = p.useState(false), { hoverProps: U } = rO({
      onHoverChange: (V) => {
        Dr() || B(V);
      }
    }), { focusWithinProps: z } = nO({
      onFocusWithinChange: (V) => {
        Dr() || B(V);
      }
    }), O = p.useRef(null);
    p.useEffect(() => {
      if (!j) return;
      const V = (Z) => {
        O.current && !O.current.contains(Z.target) && k(false);
      };
      return document.addEventListener("pointerdown", V, {
        capture: true
      }), () => document.removeEventListener("pointerdown", V, {
        capture: true
      });
    }, [
      j
    ]);
    const M = gfe(() => {
      k(true);
    }), I = n.getId(), N = e.getTimelineForEvent(I), H = (N && ((_a6 = Xb(N.getTimelineSet(), I, n.getType())) == null ? void 0 : _a6.getRelations())) !== void 0;
    return o.jsxs(Xy, {
      className: gt(dse, t),
      tabIndex: 0,
      space: d,
      collapse: s,
      highlight: r,
      notifyHighlight: C ? i : void 0,
      selected: !!w,
      isMarked: a,
      ...g,
      ...U,
      ...z,
      ref: m,
      children: [
        (A || !!w || j) && o.jsx("div", {
          className: use,
          ref: O,
          children: o.jsx(tn, {
            className: hse,
            variant: "SurfaceVariant",
            children: o.jsx(E, {
              gap: "100",
              children: !Dr() && o.jsxs(ln, {
                anchor: w,
                position: "Bottom",
                align: (w == null ? void 0 : w.width) === 0 ? "Start" : "End",
                offset: (w == null ? void 0 : w.width) === 0 ? 0 : void 0,
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    onDeactivate: () => b(void 0),
                    clickOutsideDeactivates: true,
                    isKeyForward: (V) => V.key === "ArrowDown",
                    isKeyBackward: (V) => V.key === "ArrowUp",
                    escapeDeactivates: kt
                  },
                  children: o.jsxs(tn, {
                    ...g,
                    ref: m,
                    children: [
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        className: sE,
                        children: [
                          o.jsx(Ye, {
                            size: "300",
                            after: o.jsx(Q, {
                              size: "100",
                              src: q.ReplyArrow
                            }),
                            radii: "300",
                            "data-event-id": n.getId(),
                            onClick: (V) => {
                              c(V), T();
                            },
                            children: o.jsx(D, {
                              className: Ha,
                              as: "span",
                              size: "T300",
                              truncate: true,
                              children: "Reply"
                            })
                          }),
                          !u && o.jsx(cfe, {
                            room: e,
                            eventId: n.getId() ?? ""
                          }),
                          H && o.jsx(dfe, {
                            room: e,
                            mEvent: n,
                            closeMenu: T
                          }),
                          h && o.jsx(ufe, {
                            room: e,
                            mEvent: n
                          }),
                          o.jsx(mfe, {
                            room: e,
                            mEvent: n,
                            onClose: T
                          }),
                          o.jsx(xse, {
                            room: e,
                            mEvent: n,
                            onClose: T
                          })
                        ]
                      }),
                      (!n.isRedacted() && l && !y || n.getSender() !== v.getUserId() && !y) && o.jsxs(o.Fragment, {
                        children: [
                          o.jsx(nr, {
                            size: "300"
                          }),
                          o.jsxs(E, {
                            direction: "Column",
                            gap: "100",
                            className: sE,
                            children: [
                              !n.isRedacted() && l && o.jsx(hfe, {
                                room: e,
                                mEvent: n
                              }),
                              n.getSender() !== v.getUserId() && o.jsx(ffe, {
                                room: e,
                                mEvent: n
                              })
                            ]
                          })
                        ]
                      })
                    ]
                  })
                }),
                children: [
                  o.jsx(Oe, {
                    onClick: c,
                    "data-event-id": n.getId(),
                    variant: "SurfaceVariant",
                    size: "300",
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.ReplyArrow,
                      size: "100"
                    })
                  }),
                  o.jsx(Oe, {
                    variant: "SurfaceVariant",
                    size: "300",
                    radii: "300",
                    onClick: S,
                    "aria-pressed": !!w,
                    children: o.jsx(Q, {
                      src: q.VerticalDots,
                      size: "100"
                    })
                  })
                ]
              })
            })
          })
        }),
        o.jsx("div", {
          onContextMenu: x,
          onPointerDown: M,
          children: f
        })
      ]
    });
  });
  function TS({ mEvent: t, children: e }) {
    const n = be(), [, r] = p.useState(t.getType() === ce.RoomMessageEncrypted);
    return p.useEffect(() => {
      if (t.getType() === ce.RoomMessageEncrypted) if (Math.random() < 0.05) {
        const i = performance.now();
        Mg({
          name: "decrypt.event",
          op: "matrix.crypto"
        }, () => n.decryptEventIfNeeded(t).then(() => {
          oa("sable.decryption.event_ms", performance.now() - i);
        })).catch(() => {
        });
      } else n.decryptEventIfNeeded(t).catch(() => {
      });
    }, [
      n,
      t
    ]), p.useEffect(() => {
      r(t.getType() === ce.RoomMessageEncrypted);
      const i = (a) => {
        a.isDecryptionFailure() && Vr("sable.decryption.failure", 1, {
          attributes: {
            reason: a.decryptionFailureReason ?? "UNKNOWN_ERROR"
          }
        }), r(a.getType() === ce.RoomMessageEncrypted);
      };
      return t.on(or.Decrypted, i), () => {
        t.removeListener(or.Decrypted, i);
      };
    }, [
      t
    ]), o.jsx(o.Fragment, {
      children: e()
    });
  }
  var Wtt = "RoomPinMenu_PinMenu__hnoi60", qtt = "RoomPinMenu_PinMenuHeader__hnoi61", Ktt = "RoomPinMenu_PinMenuContent__hnoi62";
  const Gtt = Po("RoomPinMenu");
  function Ytt(t) {
    const { pinnedEvent: e, room: n, renderContent: r, hour24Clock: i, dateFormatString: a, getMemberPowerTag: s, renderOptions: l, handleOpenClick: c } = t, d = be(), u = hn(), h = Ze(qr), f = e.getSender(), { color: g, font: m } = rm(f, n), v = gr(n, f, h) ?? _n(f) ?? f, y = Jc(n, f), w = (() => e.getContent()), b = e.getContent(), j = s(f), k = (j == null ? void 0 : j.icon) ? qc(d, u, j.icon) : void 0;
    return o.jsxs(Cp, {
      before: o.jsx(s3, {
        children: o.jsx(xn, {
          size: "300",
          children: o.jsx(Si, {
            userId: f,
            src: y ? Cn(d, y, u, 48, 48, "crop") ?? void 0 : void 0,
            alt: v,
            renderFallback: () => o.jsx(Q, {
              size: "200",
              src: q.User,
              filled: true
            })
          })
        })
      }),
      children: [
        o.jsxs(E, {
          gap: "300",
          justifyContent: "SpaceBetween",
          alignItems: "Center",
          grow: "Yes",
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "Baseline",
              children: [
                o.jsxs(E, {
                  alignItems: "Center",
                  gap: "200",
                  children: [
                    o.jsx(l3, {
                      style: {
                        color: g,
                        font: m
                      },
                      children: o.jsx(D, {
                        as: "span",
                        truncate: true,
                        children: o.jsx(iF, {
                          children: v
                        })
                      })
                    }),
                    k && o.jsx(Zc, {
                      size: "100",
                      iconSrc: k
                    })
                  ]
                }),
                o.jsx(Ma, {
                  ts: e.getTs(),
                  hour24Clock: i,
                  dateFormatString: a
                })
              ]
            }),
            l()
          ]
        }),
        e.replyEventId && o.jsx(Pu, {
          room: n,
          replyEventId: e.replyEventId,
          threadRootId: e.threadRootId,
          mentions: b["m.mentions"],
          onClick: c
        }),
        r(e.getType(), false, e, v, w)
      ]
    });
  }
  function Ztt(t) {
    const { room: e, eventId: n, onOpen: r, canPinEvent: i } = t, a = Koe(e, n), s = be(), [l, c] = Et(p.useCallback(() => {
      var _a6;
      const m = {
        pinned: (((_a6 = ni(e, ce.RoomPinnedEvents)) == null ? void 0 : _a6.getContent()) ?? {
          pinned: []
        }).pinned.filter((v) => v !== n)
      };
      return s.sendStateEvent(e.roomId, ce.RoomPinnedEvents, m);
    }, [
      e,
      n,
      s
    ])), d = p.useCallback((f) => {
      f.stopPropagation(), r(e.roomId, n);
    }, [
      r,
      e.roomId,
      n
    ]), u = p.useCallback((f) => {
      f.stopPropagation(), c().catch((g) => {
        Gtt.warn("Failed to unpin room event:", g);
      });
    }, [
      c
    ]), h = () => o.jsxs(E, {
      shrink: "No",
      gap: "200",
      alignItems: "Center",
      children: [
        o.jsx(Qe, {
          "data-event-id": n,
          onClick: d,
          radii: "Pill",
          children: o.jsx(D, {
            size: "T200",
            children: "Jump"
          })
        }),
        i && o.jsx(Oe, {
          "data-event-id": n,
          size: "300",
          radii: "Pill",
          onClick: l.status === ve.Loading ? void 0 : u,
          "aria-disabled": l.status === ve.Loading,
          children: l.status === ve.Loading ? o.jsx(dt, {
            size: "100"
          }) : o.jsx(Q, {
            src: q.Cross,
            size: "100"
          })
        })
      ]
    });
    return a === void 0 ? o.jsx(Moe, {
      variant: "Secondary"
    }) : a === null ? o.jsxs(E, {
      gap: "300",
      justifyContent: "SpaceBetween",
      alignItems: "Center",
      children: [
        o.jsx(E, {
          children: o.jsx(D, {
            style: {
              color: ct.Critical.Main
            },
            children: "Failed to load message!"
          })
        }),
        h()
      ]
    }) : o.jsx(Ytt, {
      ...t,
      pinnedEvent: a,
      renderOptions: h,
      handleOpenClick: d
    });
  }
  const Ffe = p.forwardRef(({ room: t, requestClose: e, currentHash: n }, r) => {
    const i = be(), a = i.getUserId(), s = Ze(qr), l = Qd(), c = ri(t), u = Ki(c, l).stateEvent(ce.RoomPinnedEvents, a), h = Ep(), f = yh(t, l), g = bh(t, c, l), m = yp(), v = Vk(m.kind, h, f), y = XM(t), w = p.useMemo(() => Array.from(y).reverse(), [
      y
    ]), b = hn(), [j] = Fe(ge, "mediaAutoLoad"), [k] = Fe(ge, "urlPreview"), [C] = Fe(ge, "hour24Clock"), [x] = Fe(ge, "dateFormatString"), { navigateRoom: S } = Wi(), T = p.useRef(null), A = p.useMemo(() => {
      var _a6;
      return (_a6 = t.getAccountData(Zr.SablePinStatus)) == null ? void 0 : _a6.getContent();
    }, [
      t
    ]), B = p.useMemo(() => (A == null ? void 0 : A.last_seen_id) ? y.indexOf(A.last_seen_id) : -1, [
      y,
      A
    ]), U = nc({
      count: w.length,
      getScrollElement: () => T.current,
      estimateSize: () => 75,
      overscan: 4
    }), z = om(t.roomId), O = gs(), M = Xd(), I = p.useMemo(() => ({
      ...fs,
      render: em(O, (V) => _h(i, t.roomId, V, Jd(z), s), z)
    }), [
      i,
      t,
      z,
      s,
      O
    ]), N = p.useMemo(() => Ql(i, t.roomId, {
      settingsLinkBaseUrl: O,
      linkifyOpts: I,
      useAuthentication: b,
      handleSpoilerClick: M,
      handleMentionClick: z,
      nicknames: s
    }), [
      i,
      t,
      I,
      z,
      M,
      b,
      s,
      O
    ]), L = wS({
      [ce.RoomMessage]: (V, Z, Y) => {
        var _a6;
        if (V.isRedacted()) {
          const ue = (_a6 = V.getUnsigned().redacted_because) == null ? void 0 : _a6.content;
          return o.jsx(ss, {
            reason: ue == null ? void 0 : ue.reason
          });
        }
        return o.jsx(oh, {
          displayName: Z,
          msgType: V.getContent().msgtype ?? "",
          ts: V.getTs(),
          getContent: Y,
          edited: !!V.replacingEvent(),
          mediaAutoLoad: j,
          urlPreview: k,
          htmlReactParserOptions: N,
          linkifyOpts: I,
          outlineAttachment: true
        });
      },
      [ce.RoomMessageEncrypted]: (V, Z) => {
        const Y = V.getId(), oe = t.getTimelineForEvent(Y), ue = oe == null ? void 0 : oe.getEvents().find((ie) => ie.getId() === Y);
        return !ue || !oe ? o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsxs(D, {
            size: "T400",
            priority: "300",
            children: [
              o.jsx("code", {
                className: nh,
                children: V.getType()
              }),
              " event"
            ]
          })
        }) : o.jsx(TS, {
          mEvent: ue,
          children: () => {
            const ie = ue.getType(), de = ce.Sticker, ne = ce.RoomMessage, ae = ce.RoomMessageEncrypted;
            if (ue.isRedacted()) return o.jsx(ss, {});
            if (ie === de) return o.jsx(cp, {
              content: ue.getContent(),
              renderImageContent: (X) => o.jsx(rh, {
                ...X,
                autoPlay: j,
                renderImage: (K) => o.jsx(as, {
                  ...K,
                  loading: "lazy"
                }),
                renderViewer: (K) => o.jsx(Yc, {
                  ...K
                })
              })
            });
            if (ie === ne) {
              const X = eh(Y, ue, oe.getTimelineSet()), K = (() => {
                var _a6;
                const G = ue.getContent();
                return ((_a6 = X == null ? void 0 : X.getContent()) == null ? void 0 : _a6["m.new_content"]) ?? G;
              });
              return o.jsx(oh, {
                displayName: Z,
                msgType: ue.getContent().msgtype ?? "",
                ts: ue.getTs(),
                edited: !!X || !!ue.replacingEvent(),
                getContent: K,
                mediaAutoLoad: j,
                urlPreview: k,
                htmlReactParserOptions: N,
                linkifyOpts: I
              });
            }
            return ie === ae ? o.jsx(D, {
              children: o.jsx(UP, {})
            }) : o.jsx(D, {
              children: o.jsx(lF, {})
            });
          }
        });
      },
      [ce.Sticker]: (V, Z, Y) => {
        var _a6;
        if (V.isRedacted()) {
          const ue = (_a6 = V.getUnsigned().redacted_because) == null ? void 0 : _a6.content;
          return o.jsx(ss, {
            reason: ue == null ? void 0 : ue.reason
          });
        }
        return o.jsx(cp, {
          content: Y(),
          renderImageContent: (oe) => o.jsx(rh, {
            ...oe,
            autoPlay: j,
            renderImage: (ue) => o.jsx(as, {
              ...ue,
              loading: "lazy"
            }),
            renderViewer: (ue) => o.jsx(Yc, {
              ...ue
            })
          })
        });
      }
    }, void 0, (V) => {
      var _a6;
      if (V.isRedacted()) {
        const Y = (_a6 = V.getUnsigned().redacted_because) == null ? void 0 : _a6.content;
        return o.jsx(ss, {
          reason: Y == null ? void 0 : Y.reason
        });
      }
      return o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        children: o.jsxs(D, {
          size: "T400",
          priority: "300",
          children: [
            o.jsx("code", {
              className: nh,
              children: V.getType()
            }),
            " event"
          ]
        })
      });
    }), H = (V, Z) => {
      S(V, Z), e();
    };
    return o.jsx(tn, {
      ref: r,
      className: Wtt,
      children: o.jsxs(E, {
        grow: "Yes",
        direction: "Column",
        children: [
          o.jsxs(wn, {
            className: qtt,
            size: "500",
            children: [
              o.jsx(E, {
                grow: "Yes",
                children: o.jsx(D, {
                  size: "H5",
                  children: "Pinned Messages"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  size: "300",
                  onClick: e,
                  radii: "300",
                  children: o.jsx(Q, {
                    src: q.Cross,
                    size: "400"
                  })
                })
              })
            ]
          }),
          o.jsx(E, {
            grow: "Yes",
            children: o.jsx(dn, {
              ref: T,
              size: "300",
              hideTrack: true,
              visibility: "Hover",
              children: o.jsx(E, {
                className: Ktt,
                direction: "Column",
                gap: "100",
                children: w.length > 0 ? o.jsx("div", {
                  style: {
                    position: "relative",
                    height: U.getTotalSize()
                  },
                  children: U.getVirtualItems().map((V) => {
                    const Z = w[V.index];
                    if (!Z) return null;
                    const Y = y.indexOf(Z);
                    let oe = false;
                    if ((A == null ? void 0 : A.hash) !== n) if (B !== -1) oe = Y > B;
                    else {
                      const ue = (A == null ? void 0 : A.count) ?? 0;
                      oe = Y >= ue - 1;
                    }
                    return o.jsx(Rs, {
                      virtualItem: V,
                      style: {
                        paddingBottom: ee.space.S200
                      },
                      ref: U.measureElement,
                      children: o.jsx(Te, {
                        style: {
                          padding: ee.space.S400,
                          borderRadius: ee.radii.R300,
                          border: oe ? `${ee.borderWidth.B700} solid ${ct.Secondary.ContainerActive}` : void 0
                        },
                        variant: "Background",
                        direction: "Column",
                        children: o.jsx(Ztt, {
                          room: t,
                          eventId: Z,
                          renderContent: L,
                          onOpen: H,
                          canPinEvent: u,
                          getMemberPowerTag: g,
                          accessibleTagColors: v,
                          hour24Clock: C,
                          isNew: oe,
                          dateFormatString: x
                        })
                      })
                    }, V.index);
                  })
                }) : o.jsxs(E, {
                  className: ro({
                    variant: "SurfaceVariant"
                  }),
                  style: {
                    marginBottom: ee.space.S200,
                    padding: `${ee.space.S700} ${ee.space.S400} ${He(60)}`,
                    borderRadius: ee.radii.R300
                  },
                  grow: "Yes",
                  direction: "Column",
                  gap: "400",
                  justifyContent: "Center",
                  alignItems: "Center",
                  children: [
                    o.jsx(Q, {
                      src: q.Pin,
                      size: "600"
                    }),
                    o.jsxs(E, {
                      style: {
                        maxWidth: He(300)
                      },
                      direction: "Column",
                      gap: "200",
                      alignItems: "Center",
                      children: [
                        o.jsx(D, {
                          size: "H4",
                          align: "Center",
                          children: "No Pinned Messages"
                        }),
                        o.jsx(D, {
                          size: "T400",
                          align: "Center",
                          children: "Users with sufficient power level can pin messages from the context menu."
                        })
                      ]
                    })
                  ]
                })
              })
            })
          })
        ]
      })
    });
  });
  Ffe.displayName = "RoomPinMenu";
  var Jtt = "RoomViewHeader_HeaderTopic__9y4jdc0";
  function Xtt({ room: t }) {
    const e = bS(), n = Ze(ev), r = Ap(n), i = be(), { microphone: a, video: s, sound: l } = KM();
    if (r && (n == null ? void 0 : n.roomId) === t.roomId) return null;
    const d = async () => {
      var _a6;
      e(t, {
        microphone: a,
        video: s,
        sound: l
      });
      try {
        const u = Date.now();
        await i.sendEvent(t.roomId, "org.matrix.msc4075.rtc.notification", {
          notification_type: "ring",
          sender_ts: u,
          lifetime: 3e4,
          "m.mentions": {
            room: true
          },
          application: "m.call",
          call_id: t.roomId,
          "m.text": [
            {
              body: `Call started by ${((_a6 = i.getUser(i.getSafeUserId())) == null ? void 0 : _a6.displayName) || "User"} \u{1F3B6}`
            }
          ]
        });
      } catch {
      }
    };
    return o.jsx(ar, {
      position: "Bottom",
      offset: 4,
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          children: "Start Voice Call"
        })
      }),
      children: (u) => o.jsx(Oe, {
        fill: "None",
        ref: u,
        onClick: d,
        "aria-label": "Start Voice Call",
        children: o.jsx(Q, {
          size: "400",
          src: q.Phone
        })
      })
    });
  }
  const wT = Po("RoomViewHeader");
  async function DT(t) {
    const e = [
      ...t
    ].toSorted().join(","), r = new TextEncoder().encode(e), i = await crypto.subtle.digest("SHA-256", r);
    return Array.from(new Uint8Array(i)).map((l) => l.toString(16).padStart(2, "0")).join("").slice(0, 10);
  }
  const vfe = p.forwardRef(({ room: t, requestClose: e }, n) => {
    const r = be(), [i] = Fe(ge, "hideReads"), a = w3(t.roomId, qi), s = Qd(), l = ri(t), d = Ki(l, s).action("invite", r.getSafeUserId()), h = Ze(gi).has(t.roomId), f = h3(), g = Xk(f, t.roomId), { navigateRoom: m } = Wi(), [v, y] = p.useState(false), [w, b] = p.useState(false), j = () => {
      As(r, t.roomId, i), e();
    }, k = () => {
      if (h) {
        b(true);
        return;
      }
      y(true);
    }, C = () => {
      b(false), y(true);
    }, [x, S] = Et(p.useCallback(async () => {
      await UB(r, t.roomId);
    }, [
      r,
      t.roomId
    ])), T = () => {
      x.status !== ve.Loading && S().catch(() => {
      });
    };
    p.useEffect(() => {
      x.status === ve.Success && (b(false), y(true));
    }, [
      x.status
    ]);
    const A = () => {
      const O = wi(r, t.roomId), M = ml(O) ? void 0 : Xc(t);
      Jo(JE(O, M)), e();
    }, B = Bp(), U = ka(), z = () => {
      B(t.roomId, U == null ? void 0 : U.roomId), e();
    };
    return o.jsxs(tn, {
      ref: n,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: [
        v && o.jsx(Pp, {
          room: t,
          requestClose: () => {
            y(false), e();
          }
        }),
        w && o.jsx(Qde, {
          onCancel: () => {
            b(false), e();
          },
          onInviteDirect: C,
          onConvertAndInvite: T,
          converting: x.status === ve.Loading,
          convertError: x.status === ve.Error ? x.error.message : void 0
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: j,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.CheckTwice
              }),
              radii: "300",
              disabled: !a,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Mark as Read"
              })
            }),
            o.jsx(Jde, {
              roomId: t.roomId,
              value: g,
              children: (O, M, I) => o.jsx(Ye, {
                size: "300",
                after: I ? o.jsx(dt, {
                  size: "100",
                  variant: "Secondary"
                }) : o.jsx(Q, {
                  size: "100",
                  src: Qk(g)
                }),
                radii: "300",
                "aria-pressed": M,
                onClick: O,
                children: o.jsx(D, {
                  style: {
                    flexGrow: 1
                  },
                  as: "span",
                  size: "T300",
                  truncate: true,
                  children: "Notifications"
                })
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: k,
              variant: "Primary",
              fill: "None",
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.UserPlus
              }),
              radii: "300",
              "aria-pressed": v,
              disabled: !d,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Invite"
              })
            }),
            o.jsx(Ye, {
              onClick: A,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Link
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Copy Link"
              })
            }),
            o.jsx(Ye, {
              onClick: z,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Setting
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Room Settings"
              })
            }),
            o.jsx(Hi, {
              initial: false,
              children: (O, M) => o.jsxs(o.Fragment, {
                children: [
                  o.jsx(Ye, {
                    onClick: () => M(true),
                    size: "300",
                    after: o.jsx(Q, {
                      size: "100",
                      src: q.RecentClock
                    }),
                    radii: "300",
                    "aria-pressed": O,
                    children: o.jsx(D, {
                      style: {
                        flexGrow: 1
                      },
                      as: "span",
                      size: "T300",
                      truncate: true,
                      children: "Jump to Time"
                    })
                  }),
                  O && o.jsx(EGe, {
                    onSubmit: (I) => {
                      M(false), m(t.roomId, I), e();
                    },
                    onCancel: () => M(false)
                  })
                ]
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: o.jsx(Hi, {
            initial: false,
            children: (O, M) => o.jsxs(o.Fragment, {
              children: [
                o.jsx(Ye, {
                  onClick: () => M(true),
                  variant: "Critical",
                  fill: "None",
                  size: "300",
                  after: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowGoLeft
                  }),
                  radii: "300",
                  "aria-pressed": O,
                  children: o.jsx(D, {
                    style: {
                      flexGrow: 1
                    },
                    as: "span",
                    size: "T300",
                    truncate: true,
                    children: "Leave Room"
                  })
                }),
                O && o.jsx(YM, {
                  roomId: t.roomId,
                  onDone: e,
                  onCancel: () => M(false)
                })
              ]
            })
          })
        })
      ]
    });
  });
  vfe.displayName = "RoomMenu";
  function OJ({ callView: t }) {
    var _a6, _b3;
    const e = br(), n = be(), r = hn(), i = fr(), a = cr(), s = ka(), [l, c] = p.useState(), [d, u] = p.useState(), h = zce(), [f] = Fe(ge, "customDMCards"), [g, m] = Fr(tv), [v, y] = Fr(Yde(a.roomId)), [w, b] = Fr(GM(a.roomId)), j = (_a6 = a.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.maySendStateEvent("org.matrix.msc3401.call.member", n.getUserId()), [k] = Fe(ge, "alwaysShowCallButton"), C = k || a.getJoinedMemberCount() <= 10, S = !!$i(a, ce.RoomEncryption), T = Ip(a, h && !f), A = rc(a), B = D3(a), U = T ? Cn(n, T, r, 96, 96, "crop") ?? void 0 : void 0, [z, O] = Fe(ge, "isPeopleDrawer"), [M, I] = Fe(ge, "isWidgetDrawer"), N = Kde(a), L = XM(a), H = (_b3 = a.getAccountData(Zr.SablePinStatus)) == null ? void 0 : _b3.getContent(), [V, Z] = p.useState(0), [Y, oe] = p.useState(0), [ue, ie] = p.useState(false), [de, ne] = p.useState("");
    p.useEffect(() => {
      DT(L).then(ne).catch((re) => {
        wT.warn("Failed to compute pins hash:", re);
      });
    }, [
      L
    ]), p.useEffect(() => {
      (async () => {
        if (!L.length) {
          Z(0);
          return;
        }
        const he = await DT(L);
        if ((H == null ? void 0 : H.hash) === he) {
          Z(0);
          return;
        }
        const se = L.indexOf(H == null ? void 0 : H.last_seen_id);
        if (se === -1) {
          const ye = (H == null ? void 0 : H.count) ?? 0, we = Math.max(0, ye - 1), Ee = L.length > 0 ? L.length - we : 0;
          Z(Math.max(0, Ee));
        } else {
          const ye = L.slice(se + 1);
          Z(ye.length);
        }
      })().catch((he) => {
        wT.warn("Failed to check unread pins:", he);
      });
    }, [
      L,
      H
    ]), p.useEffect(() => {
      const re = (we) => {
        const Ee = we.getEvents(), ke = /* @__PURE__ */ new Set();
        Ee.forEach((Ne) => {
          if (X$(Ne)) {
            const Rt = Ne.getId();
            Rt && !a.getThread(Rt) && ke.add(Rt);
          }
          const { threadRootId: lt } = Ne;
          lt && Da(Ne, lt) && !a.getThread(lt) && ke.add(lt);
        }), ke.forEach((Ne) => {
          const lt = a.findEventById(Ne);
          lt && a.createThread(Ne, lt, [], false);
        });
      }, he = a.getLiveTimeline();
      re(he);
      let se = he.getNeighbouringTimeline(Tn.Backward);
      for (; se; ) re(se), se = se.getNeighbouringTimeline(Tn.Backward);
      const ye = (we) => {
        if (X$(we)) {
          const ke = we.getId();
          if (ke && !a.getThread(ke)) {
            const Ne = a.findEventById(ke);
            Ne && a.createThread(ke, Ne, [], false);
          }
        }
        const { threadRootId: Ee } = we;
        if (Ee && Da(we, Ee) && !a.getThread(Ee)) {
          const ke = a.findEventById(Ee);
          ke && a.createThread(Ee, ke, [], false);
        }
      };
      return n.on(mt.Timeline, ye), () => {
        n.off(mt.Timeline, ye);
      };
    }, [
      a,
      n
    ]), p.useEffect(() => {
      const re = () => {
        const se = a.getThreads();
        let ye = 0;
        se.forEach((ke) => {
          ye += a.getThreadUnreadNotificationCount(ke.id, ir.Total);
        });
        const Ee = a.threadsAggregateNotificationType === ir.Highlight;
        oe(ye), ie(Ee);
      };
      re();
      const he = () => re();
      return a.on(jr.New, he), a.on(jr.Update, he), a.on(jr.NewReply, he), () => {
        a.off(jr.New, he), a.off(jr.Update, he), a.off(jr.NewReply, he);
      };
    }, [
      a,
      n
    ]);
    const ae = () => {
      const re = {
        rooms: a.roomId
      }, he = s ? tP(wi(n, s.roomId)) : QB();
      e(gl(he, re));
    }, X = (re) => {
      c(re.currentTarget.getBoundingClientRect());
    }, K = (re) => {
      u(re.currentTarget.getBoundingClientRect()), (async () => {
        if (L.length === 0) return;
        const se = await DT(L);
        await n.setRoomAccountData(a.roomId, Zr.SablePinStatus, {
          hash: se,
          count: L.length,
          last_seen_id: L.at(-1)
        });
      })().catch((se) => {
        wT.warn("Failed to update pin marker:", se);
      });
    }, G = Bp(), le = ka(), te = () => {
      if (t) {
        G(a.roomId, le == null ? void 0 : le.roomId, Ao.MembersPage);
        return;
      }
      O(!z);
    };
    return o.jsx(_i, {
      className: ro({
        variant: "Surface"
      }),
      balance: i === sn.Mobile,
      children: o.jsxs(E, {
        grow: "Yes",
        gap: "300",
        children: [
          i === sn.Mobile && o.jsx(ic, {
            children: (re) => o.jsx(E, {
              shrink: "No",
              alignItems: "Center",
              children: o.jsx(Oe, {
                fill: "None",
                onClick: re,
                children: o.jsx(Q, {
                  src: q.ArrowLeft
                })
              })
            })
          }),
          o.jsxs(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "300",
            children: [
              i !== sn.Mobile && o.jsx(xn, {
                size: "300",
                children: o.jsx(yi, {
                  roomId: a.roomId,
                  src: U,
                  alt: A,
                  renderFallback: () => o.jsx(Ya, {
                    size: "200",
                    joinRule: a.getJoinRule(),
                    roomType: a.getType()
                  })
                })
              }),
              o.jsxs(E, {
                direction: "Column",
                children: [
                  o.jsx(D, {
                    size: B ? "H5" : "H3",
                    truncate: true,
                    children: A
                  }),
                  B && o.jsx(Hi, {
                    initial: false,
                    children: (re, he) => o.jsxs(o.Fragment, {
                      children: [
                        o.jsx(Hn, {
                          open: re,
                          backdrop: o.jsx($n, {}),
                          children: o.jsx(Wn, {
                            children: o.jsx(Ft, {
                              focusTrapOptions: {
                                initialFocus: false,
                                clickOutsideDeactivates: true,
                                onDeactivate: () => he(false),
                                escapeDeactivates: kt
                              },
                              children: o.jsx(Vf, {
                                name: A,
                                topic: B,
                                requestClose: () => he(false)
                              })
                            })
                          })
                        }),
                        o.jsx(D, {
                          as: "button",
                          type: "button",
                          onClick: () => he(true),
                          className: Jtt,
                          size: "T200",
                          priority: "300",
                          truncate: true,
                          children: B
                        })
                      ]
                    })
                  })
                ]
              })
            ]
          }),
          o.jsxs(E, {
            shrink: "No",
            children: [
              (!a.isCallRoom() || g) && o.jsxs(o.Fragment, {
                children: [
                  !S && o.jsx(ar, {
                    position: "Bottom",
                    offset: 4,
                    tooltip: o.jsx(pr, {
                      children: o.jsx(D, {
                        children: "Search"
                      })
                    }),
                    children: (re) => o.jsx(Oe, {
                      fill: "None",
                      ref: re,
                      onClick: ae,
                      children: o.jsx(Q, {
                        size: "400",
                        src: q.Search
                      })
                    })
                  }),
                  o.jsx(ar, {
                    position: "Bottom",
                    offset: 4,
                    tooltip: o.jsx(pr, {
                      children: o.jsx(D, {
                        children: "Pinned Messages"
                      })
                    }),
                    children: (re) => o.jsxs(Oe, {
                      fill: "None",
                      style: {
                        position: "relative"
                      },
                      onClick: K,
                      ref: re,
                      "aria-pressed": !!d,
                      children: [
                        V > 0 && o.jsx(Rn, {
                          style: {
                            position: "absolute",
                            left: He(3),
                            top: He(3)
                          },
                          variant: "Secondary",
                          size: "400",
                          fill: "Solid",
                          radii: "Pill",
                          children: o.jsx(D, {
                            as: "span",
                            size: "L400",
                            children: V
                          })
                        }),
                        o.jsx(Q, {
                          size: "400",
                          src: q.Pin,
                          filled: !!d
                        })
                      ]
                    })
                  }),
                  j && C && o.jsx(Xtt, {
                    room: a
                  }),
                  o.jsx(ln, {
                    anchor: d,
                    position: "Bottom",
                    content: o.jsx(Ft, {
                      focusTrapOptions: {
                        initialFocus: false,
                        returnFocusOnDeactivate: false,
                        onDeactivate: () => u(void 0),
                        clickOutsideDeactivates: true,
                        isKeyForward: (re) => re.key === "ArrowDown",
                        isKeyBackward: (re) => re.key === "ArrowUp",
                        escapeDeactivates: kt
                      },
                      children: o.jsx(Ffe, {
                        room: a,
                        requestClose: () => u(void 0),
                        currentHash: de
                      })
                    })
                  }),
                  o.jsx(ar, {
                    position: "Bottom",
                    offset: 4,
                    tooltip: o.jsx(pr, {
                      children: o.jsx(D, {
                        children: "Threads"
                      })
                    }),
                    children: (re) => o.jsxs(Oe, {
                      fill: "None",
                      ref: re,
                      onClick: () => {
                        w ? (b(void 0), y(true)) : y(!v);
                      },
                      "aria-pressed": v || !!w,
                      style: {
                        position: "relative"
                      },
                      children: [
                        Y > 0 && o.jsx(Rn, {
                          style: {
                            position: "absolute",
                            left: He(3),
                            top: He(3)
                          },
                          variant: ue ? "Critical" : "Secondary",
                          size: "400",
                          fill: "Solid",
                          radii: "Pill",
                          children: o.jsx(D, {
                            as: "span",
                            size: "L400",
                            children: Y
                          })
                        }),
                        o.jsx(Q, {
                          size: "400",
                          src: q.Thread,
                          filled: v
                        })
                      ]
                    })
                  })
                ]
              }),
              i === sn.Desktop && o.jsx(ar, {
                position: "Bottom",
                offset: 4,
                tooltip: o.jsx(pr, {
                  children: o.jsx(D, {
                    children: M ? "Hide Widgets" : "Show Widgets"
                  })
                }),
                children: (re) => o.jsxs(Oe, {
                  fill: "None",
                  ref: re,
                  onClick: () => I((he) => !he),
                  style: {
                    position: "relative"
                  },
                  children: [
                    N.length > 0 && o.jsx(Rn, {
                      style: {
                        position: "absolute",
                        left: He(3),
                        top: He(3)
                      },
                      variant: "Secondary",
                      size: "400",
                      fill: "Solid",
                      radii: "Pill",
                      children: o.jsx(D, {
                        as: "span",
                        size: "L400",
                        children: N.length
                      })
                    }),
                    o.jsx(Q, {
                      size: "400",
                      src: q.Category,
                      filled: M
                    })
                  ]
                })
              }),
              i === sn.Desktop && o.jsx(ar, {
                position: "Bottom",
                offset: 4,
                tooltip: o.jsx(pr, {
                  children: t ? o.jsx(D, {
                    children: "Members"
                  }) : o.jsx(D, {
                    children: z ? "Hide Members" : "Show Members"
                  })
                }),
                children: (re) => o.jsx(Oe, {
                  fill: "None",
                  ref: re,
                  onClick: te,
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.User,
                    filled: z
                  })
                })
              }),
              t && o.jsx(ar, {
                position: "Bottom",
                offset: 4,
                tooltip: o.jsx(pr, {
                  children: o.jsx(D, {
                    children: g ? "Hide Chat" : "Show Chat"
                  })
                }),
                children: (re) => o.jsx(Oe, {
                  fill: "None",
                  ref: re,
                  onClick: () => {
                    m(!g);
                  },
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.Message,
                    filled: g
                  })
                })
              }),
              o.jsx(ar, {
                position: "Bottom",
                align: "End",
                offset: 4,
                tooltip: o.jsx(pr, {
                  children: o.jsx(D, {
                    children: "More Options"
                  })
                }),
                children: (re) => o.jsx(Oe, {
                  fill: "None",
                  onClick: X,
                  ref: re,
                  "aria-pressed": !!l,
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.VerticalDots,
                    filled: !!l
                  })
                })
              }),
              o.jsx(ln, {
                anchor: l,
                position: "Bottom",
                align: "End",
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    returnFocusOnDeactivate: false,
                    onDeactivate: () => c(void 0),
                    clickOutsideDeactivates: true,
                    isKeyForward: (re) => re.key === "ArrowDown",
                    isKeyBackward: (re) => re.key === "ArrowUp",
                    escapeDeactivates: kt
                  },
                  children: o.jsx(vfe, {
                    room: a,
                    requestClose: () => c(void 0)
                  })
                })
              })
            ]
          })
        ]
      })
    });
  }
  var Qtt = "styles_AvatarPresence__1meaq7c0", ent = "styles_AvatarPresenceBadge__1meaq7c1";
  const tnt = {
    [w1.Online]: "Success",
    [w1.Unavailable]: "Warning",
    [w1.Offline]: "Secondary"
  };
  function RS({ presence: t, size: e }) {
    const n = oUe(), r = p.useId();
    return o.jsx(ar, {
      position: "Right",
      align: "Center",
      offset: 4,
      delay: 200,
      tooltip: o.jsx(pr, {
        id: r,
        children: o.jsx(E, {
          style: {
            maxWidth: He(250)
          },
          alignItems: "Baseline",
          gap: "100",
          children: o.jsx(D, {
            size: "L400",
            children: n[t]
          })
        })
      }),
      children: (i) => o.jsx(Rn, {
        "aria-labelledby": r,
        ref: i,
        size: e,
        variant: tnt[t],
        fill: t === w1.Offline ? "Soft" : "Solid",
        radii: "Pill"
      })
    });
  }
  const PO = ft(({ as: t, badge: e, variant: n = "Surface", children: r, ...i }, a) => o.jsxs(E, {
    as: t,
    className: Qtt,
    ...i,
    ref: a,
    children: [
      e && o.jsx("div", {
        className: ent,
        style: {
          backgroundColor: ct[n].Container
        },
        children: e
      }),
      r
    ]
  }));
  var CT = Jr({
    defaultClassName: "TypingIndicator_TypingDot__apyvd71 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      animated: {
        true: "TypingIndicator_TypingDot_animated_true__apyvd72"
      },
      size: {
        300: "TypingIndicator_TypingDot_size_300__apyvd73",
        400: "TypingIndicator_TypingDot_size_400__apyvd74"
      },
      index: {
        0: "TypingIndicator_TypingDot_index_0__apyvd75",
        1: "TypingIndicator_TypingDot_index_1__apyvd76",
        2: "TypingIndicator_TypingDot_index_2__apyvd77"
      }
    },
    defaultVariants: {
      size: "400",
      animated: true
    },
    compoundVariants: []
  });
  const MO = ft(({ size: t, disableAnimation: e, style: n, ...r }, i) => o.jsxs(E, {
    as: "span",
    alignItems: "Center",
    shrink: "No",
    style: {
      gap: He(t === "300" ? 1 : 2),
      zIndex: 10,
      ...n
    },
    ...r,
    ref: i,
    children: [
      o.jsx("span", {
        className: CT({
          size: t,
          index: "0",
          animated: !e
        })
      }),
      o.jsx("span", {
        className: CT({
          size: t,
          index: "1",
          animated: !e
        })
      }),
      o.jsx("span", {
        className: CT({
          size: t,
          index: "2",
          animated: !e
        })
      })
    ]
  })), nnt = (t, e) => e.find((n) => n.target === t), rnt = (t, e, n) => {
    const [r, i] = p.useState();
    return p.useEffect(() => {
      const a = typeof e == "function" ? e() : e;
      i(new IntersectionObserver(t, a));
    }, [
      t,
      e
    ]), p.useEffect(() => () => r == null ? void 0 : r.disconnect(), [
      r
    ]), p.useEffect(() => {
      const a = typeof n == "function" ? n() : n;
      return a && (r == null ? void 0 : r.observe(a)), () => {
        a && (r == null ? void 0 : r.unobserve(a));
      };
    }, [
      r,
      n
    ]), r;
  };
  var int = "style_ScrollTopContainer__z030kb1";
  const A3 = ft(({ className: t, scrollRef: e, anchorRef: n, onVisibilityChange: r, ...i }, a) => {
    const [s, l] = p.useState(true);
    return rnt(p.useCallback((c) => {
      if (!n.current) return;
      const d = nnt(n.current, c);
      d && (l(d.isIntersecting), r == null ? void 0 : r(d.isIntersecting));
    }, [
      n,
      r
    ]), p.useCallback(() => ({
      root: e == null ? void 0 : e.current
    }), [
      e
    ]), p.useCallback(() => n.current, [
      n
    ])), s ? null : o.jsx(E, {
      className: gt(int, t),
      ...i,
      ref: a
    });
  }), lf = 5e3, Lm = vn(/* @__PURE__ */ new Map()), ont = (t, e) => {
    let n = t.get(e.roomId) ?? [];
    return n = n.filter((r) => r.userId !== e.userId), n.push({
      userId: e.userId,
      ts: e.ts
    }), t.set(e.roomId, n), t;
  }, LJ = (t, e) => {
    let n = t.get(e.roomId) ?? [];
    return n = n.filter((r) => r.userId !== e.userId), n.length === 0 ? t.delete(e.roomId) : t.set(e.roomId, n), t;
  }, ant = (t, e, n, r) => {
    const a = (t.get(e) ?? []).find((s) => s.userId === n);
    if (a) return Date.now() - a.ts >= r;
  }, OO = vn((t) => t(Lm), (t, e, n) => {
    var _a6;
    const r = t(Lm);
    n.type === "PUT" && (e(Lm, uo(r, (i) => ont(i, n))), setTimeout(() => {
      const { roomId: i, userId: a } = n;
      ant(t(Lm), i, a, lf) && e(Lm, uo(t(Lm), (l) => LJ(l, {
        roomId: i,
        userId: a
      })));
    }, lf)), n.type === "DELETE" && ((_a6 = r.get(n.roomId)) == null ? void 0 : _a6.find((i) => i.userId === n.userId)) && e(Lm, uo(r, (i) => LJ(i, n)));
  }), snt = (t, e) => {
    const n = Fn(e), [r] = Fe(ge, "hideActivity");
    p.useEffect(() => {
      const i = (a, s) => {
        r || n({
          type: s.typing ? "PUT" : "DELETE",
          roomId: s.roomId,
          userId: s.userId,
          ts: Date.now()
        });
      };
      return t.on(Ui.Typing, i), () => {
        t.removeListener(Ui.Typing, i);
      };
    }, [
      t,
      n,
      r
    ]);
  }, lnt = (t, e) => t.userId === e.userId && t.ts === e.ts, cnt = (t, e) => t.length !== e.length ? false : t.every((n, r) => {
    const i = e[r];
    return i ? lnt(n, i) : false;
  }), LO = (t) => {
    const e = p.useCallback((r) => r.get(t) ?? [], [
      t
    ]);
    return Ze(jF(OO, e, cnt));
  }, N0 = {
    filterJoined: (t) => t.membership === Ht.Join,
    filterInvited: (t) => t.membership === Ht.Invite,
    filterLeaved: (t) => {
      var _a6, _b3;
      return t.membership === Ht.Leave && ((_a6 = t.events.member) == null ? void 0 : _a6.getStateKey()) === ((_b3 = t.events.member) == null ? void 0 : _b3.getSender());
    },
    filterKicked: (t) => {
      var _a6, _b3;
      return t.membership === Ht.Leave && ((_a6 = t.events.member) == null ? void 0 : _a6.getStateKey()) !== ((_b3 = t.events.member) == null ? void 0 : _b3.getSender());
    },
    filterBanned: (t) => t.membership === Ht.Ban
  }, NO = () => p.useMemo(() => [
    {
      name: "Joined",
      filterFn: N0.filterJoined
    },
    {
      name: "Invited",
      filterFn: N0.filterInvited
    },
    {
      name: "Left",
      filterFn: N0.filterLeaved
    },
    {
      name: "Kicked",
      filterFn: N0.filterKicked
    },
    {
      name: "Banned",
      filterFn: N0.filterBanned
    }
  ], []), _fe = (t, e) => {
    const n = e[t] ?? e[0];
    return n || {
      name: "Joined",
      filterFn: N0.filterJoined
    };
  }, Ey = {
    Ascending: (t, e) => t.name.toLowerCase() < e.name.toLowerCase() ? -1 : 1,
    Descending: (t, e) => t.name.toLowerCase() > e.name.toLowerCase() ? -1 : 1,
    NewestFirst: (t, e) => {
      var _a6, _b3;
      return (((_a6 = e.events.member) == null ? void 0 : _a6.getTs()) ?? 0) - (((_b3 = t.events.member) == null ? void 0 : _b3.getTs()) ?? 0);
    },
    Oldest: (t, e) => {
      var _a6, _b3;
      return (((_a6 = t.events.member) == null ? void 0 : _a6.getTs()) ?? 0) - (((_b3 = e.events.member) == null ? void 0 : _b3.getTs()) ?? 0);
    }
  }, zO = () => p.useMemo(() => [
    {
      name: "A to Z",
      sortFn: Ey.Ascending
    },
    {
      name: "Z to A",
      sortFn: Ey.Descending
    },
    {
      name: "Newest",
      sortFn: Ey.NewestFirst
    },
    {
      name: "Oldest",
      sortFn: Ey.Oldest
    }
  ], []), yfe = (t, e) => {
    const n = e[t] ?? e[0];
    return n || {
      name: "A to Z",
      sortFn: Ey.Ascending
    };
  }, bfe = (t, e) => p.useCallback((r, i) => t.has(r.userId) && t.has(i.userId) ? 0 : t.has(r.userId) ? -1 : t.has(i.userId) ? 1 : e(i.userId) - e(r.userId), [
    t,
    e
  ]);
  function xfe({ selected: t, onSelect: e, requestClose: n }) {
    const r = NO();
    return o.jsx(Ft, {
      focusTrapOptions: {
        initialFocus: false,
        onDeactivate: n,
        clickOutsideDeactivates: true,
        isKeyForward: (i) => i.key === "ArrowDown",
        isKeyBackward: (i) => i.key === "ArrowUp",
        escapeDeactivates: kt
      },
      children: o.jsx(tn, {
        style: {
          padding: ee.space.S100
        },
        children: r.map((i, a) => o.jsx(Ye, {
          variant: "Surface",
          "aria-pressed": t === a,
          size: "300",
          radii: "300",
          onClick: () => {
            e(a), n();
          },
          children: o.jsx(D, {
            size: "T300",
            children: i.name
          })
        }, i.name))
      })
    });
  }
  function wfe({ selected: t, onSelect: e, requestClose: n }) {
    const r = zO();
    return o.jsx(Ft, {
      focusTrapOptions: {
        initialFocus: false,
        onDeactivate: n,
        clickOutsideDeactivates: true,
        isKeyForward: (i) => i.key === "ArrowDown",
        isKeyBackward: (i) => i.key === "ArrowUp",
        escapeDeactivates: kt
      },
      children: o.jsx(tn, {
        style: {
          padding: ee.space.S100
        },
        children: r.map((i, a) => o.jsx(Ye, {
          variant: "Surface",
          "aria-pressed": t === a,
          size: "300",
          radii: "300",
          onClick: () => {
            e(a), n();
          },
          children: o.jsx(D, {
            size: "T300",
            children: i.name
          })
        }, i.name))
      })
    });
  }
  const dnt = 1, unt = () => typeof navigator > "u" ? void 0 : navigator.languages;
  function UO(t, { locales: e = unt(), maximumFractionDigits: n = dnt } = {}) {
    return new Intl.NumberFormat(e, {
      notation: "compact",
      maximumFractionDigits: n
    }).format(t);
  }
  var hnt = "MembersDrawer_MembersDrawer__10re0tb0", fnt = "MembersDrawer_MembersDrawerHeader__10re0tb1", mnt = "MembersDrawer_MemberDrawerContentBase__10re0tb2", gnt = "MembersDrawer_MemberDrawerContent__10re0tb3", pnt = "MembersDrawer_DrawerGroup__10re0tb6", Fnt = "MembersDrawer_MembersGroup__10re0tb7", vnt = "MembersDrawer_MembersGroupLabel__10re0tb8", NJ = "MembersDrawer_DrawerVirtualItem__10re0tb9";
  function _nt({ room: t, hideText: e }) {
    const n = _k(ge, "isPeopleDrawer");
    return o.jsx(wn, {
      className: fnt,
      variant: "Background",
      size: "600",
      children: o.jsxs(E, {
        grow: "Yes",
        alignItems: "Center",
        gap: "200",
        children: [
          !e && o.jsx(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: o.jsx(D, {
              title: `${t.getJoinedMemberCount()} Members`,
              size: "H5",
              truncate: true,
              children: `${UO(t.getJoinedMemberCount())} Members`
            })
          }),
          o.jsx(E, {
            shrink: "No",
            alignItems: "Center",
            children: o.jsx(ar, {
              position: "Bottom",
              align: "End",
              offset: 4,
              tooltip: o.jsx(pr, {
                children: o.jsx(D, {
                  children: "Close"
                })
              }),
              children: (r) => o.jsx(Oe, {
                ref: r,
                variant: "Background",
                onClick: () => n(false),
                children: o.jsx(Q, {
                  src: q.Cross
                })
              })
            })
          })
        ]
      })
    });
  }
  function ynt({ mx: t, useAuthentication: e, room: n, member: r, onClick: i, pressed: a, typing: s, hideText: l }) {
    const c = Ze(qr), d = gr(n, r.userId, c) ?? _n(r.userId) ?? r.userId, u = r.getMxcAvatarUrl(), h = u ? t.mxcUrlToHttp(u, 128, 128, "crop", void 0, false, e) : void 0, f = v3(r.userId), { color: g, font: m } = rm(r.userId, n), v = o.jsx("div", {
      style: {
        position: "relative",
        width: He(40),
        height: He(40),
        transform: "scale(0.85)",
        transformOrigin: "center"
      },
      children: o.jsx(PO, {
        badge: f && f.lastActiveTs !== 0 ? o.jsx(RS, {
          presence: f.presence,
          size: "200"
        }) : void 0,
        children: o.jsx(xn, {
          size: "300",
          radii: "400",
          children: o.jsx(Si, {
            userId: r.userId,
            src: h ?? void 0,
            alt: d,
            renderFallback: () => o.jsx(Q, {
              size: "100",
              src: q.User,
              filled: true
            })
          })
        })
      })
    });
    return l ? o.jsx(Oe, {
      onClick: i,
      size: "300",
      "aria-pressed": a,
      "data-user-id": r.userId,
      style: {
        padding: "0"
      },
      children: v
    }) : o.jsx(Ye, {
      style: {
        padding: `0 ${ee.space.S200}`
      },
      "aria-pressed": a,
      "data-user-id": r.userId,
      variant: "Background",
      radii: "400",
      onClick: i,
      before: v,
      after: s && o.jsx(Rn, {
        size: "300",
        variant: "Secondary",
        fill: "Soft",
        radii: "Pill",
        outlined: true,
        children: o.jsx(MO, {
          size: "300"
        })
      }),
      children: o.jsxs(E, {
        direction: "Column",
        grow: "Yes",
        gap: "0",
        children: [
          o.jsx(D, {
            size: "T300",
            truncate: true,
            style: {
              color: g,
              fontFamily: m,
              lineHeight: "1.2"
            },
            children: d
          }),
          (f == null ? void 0 : f.status) && o.jsx(D, {
            size: "T200",
            truncate: true,
            style: {
              opacity: ee.opacity.P300,
              fontFamily: m,
              marginTop: "-2px"
            },
            children: f.status
          })
        ]
      })
    });
  }
  const bnt = {
    limit: 1e3,
    matchOptions: {
      contain: true
    }
  }, xnt = (t) => _n(t) ?? t, wnt = (t, e) => BB(t, e, xnt);
  function Dfe({ room: t, members: e }) {
    var _a6, _b3;
    const n = be(), r = hn(), i = p.useRef(null), a = p.useRef(null), s = p.useRef(null), l = Qd(), c = ri(t), d = bh(t, c, l), u = xP(l), h = e.length < t.getJoinedMemberCount(), f = Ls(), g = ka(), m = (_a6 = AP()) == null ? void 0 : _a6.userId, v = NO(), y = zO(), [w, b] = Fe(ge, "memberSortFilterIndex"), [j, k] = p.useState(0), C = _fe(j, v), x = yfe(w, y), S = bfe(c, u), T = LO(t.roomId), A = p.useMemo(() => e.filter(C.filterFn).toSorted(x.sortFn).sort(S), [
      e,
      C,
      x,
      S
    ]), [B, U, z] = tc(A, wnt, bnt);
    !B && ((_b3 = a.current) == null ? void 0 : _b3.value) && U(a.current.value);
    const O = B ? B.items : A, M = Rae(O, d), I = nc({
      count: M.length,
      getScrollElement: () => i.current,
      estimateSize: () => 40,
      overscan: 10
    }), N = Rp(p.useCallback((de) => {
      de.target.value ? U(de.target.value) : z();
    }, [
      U,
      z
    ]), {
      wait: 200
    }), L = (de) => {
      const ne = de.currentTarget, ae = ne.getAttribute("data-user-id");
      if (!ae) return;
      const X = ne.getBoundingClientRect();
      X.y = Math.min(X.y, window.innerHeight - 42), f(t.roomId, g == null ? void 0 : g.roomId, ae, X, "Left");
    }, [H, V] = Fe(ge, "memberSidebarWidth"), [Z, Y] = p.useState(H);
    p.useEffect(() => {
      Y(H);
    }, [
      H
    ]);
    const ue = fr() === sn.Mobile, ie = Z <= 80 && !ue;
    return o.jsxs(E, {
      className: gt(hnt, ro({
        variant: "Background"
      })),
      shrink: "No",
      direction: "Column",
      style: {
        position: "relative",
        width: ue ? "100%" : He(Z)
      },
      children: [
        o.jsx(_nt, {
          room: t,
          hideText: ie
        }),
        o.jsxs(E, {
          className: mnt,
          grow: "Yes",
          children: [
            !ue && o.jsx(Zl, {
              setCurWidth: Y,
              sidebarWidth: H,
              setSidebarWidth: V,
              instep: 64,
              outstep: 176,
              minValue: 50,
              maxValue: 350,
              isReversed: true
            }),
            o.jsx(dn, {
              ref: i,
              variant: "Background",
              size: "300",
              visibility: "Hover",
              hideTrack: true,
              children: o.jsxs(E, {
                className: gnt,
                direction: "Column",
                gap: "200",
                children: [
                  !ie && o.jsxs(o.Fragment, {
                    children: [
                      o.jsxs(E, {
                        ref: s,
                        className: pnt,
                        direction: "Column",
                        gap: "200",
                        children: [
                          o.jsxs(E, {
                            alignItems: "Center",
                            justifyContent: "SpaceBetween",
                            gap: "200",
                            children: [
                              o.jsx(Hi, {
                                initial: void 0,
                                children: (de, ne) => o.jsx(ln, {
                                  anchor: de,
                                  position: "Bottom",
                                  align: "Start",
                                  offset: 4,
                                  content: o.jsx(xfe, {
                                    selected: j,
                                    onSelect: k,
                                    requestClose: () => ne(void 0)
                                  }),
                                  children: o.jsx(Qe, {
                                    onClick: ((ae) => ne(ae.currentTarget.getBoundingClientRect())),
                                    variant: "Background",
                                    size: "400",
                                    radii: "300",
                                    before: o.jsx(Q, {
                                      src: q.Filter,
                                      size: "50"
                                    }),
                                    children: o.jsx(D, {
                                      size: "T200",
                                      children: C.name
                                    })
                                  })
                                })
                              }),
                              o.jsx(Hi, {
                                initial: void 0,
                                children: (de, ne) => o.jsx(ln, {
                                  anchor: de,
                                  position: "Bottom",
                                  align: "End",
                                  offset: 4,
                                  content: o.jsx(wfe, {
                                    selected: w,
                                    onSelect: b,
                                    requestClose: () => ne(void 0)
                                  }),
                                  children: o.jsx(Qe, {
                                    onClick: ((ae) => ne(ae.currentTarget.getBoundingClientRect())),
                                    variant: "Background",
                                    size: "400",
                                    radii: "300",
                                    after: o.jsx(Q, {
                                      src: q.Sort,
                                      size: "50"
                                    }),
                                    children: o.jsx(D, {
                                      size: "T200",
                                      children: x.name
                                    })
                                  })
                                })
                              })
                            ]
                          }),
                          o.jsx(E, {
                            direction: "Column",
                            gap: "100",
                            children: o.jsx(mn, {
                              ref: a,
                              onChange: N,
                              style: {
                                paddingRight: ee.space.S200
                              },
                              placeholder: "Type name...",
                              variant: "Surface",
                              size: "400",
                              radii: "400",
                              before: o.jsx(Q, {
                                size: "50",
                                src: q.Search
                              }),
                              after: B && o.jsx(Qe, {
                                variant: B.items.length > 0 ? "Success" : "Critical",
                                size: "400",
                                radii: "Pill",
                                "aria-pressed": true,
                                onClick: () => {
                                  a.current && (a.current.value = "", a.current.focus()), z();
                                },
                                after: o.jsx(Q, {
                                  size: "50",
                                  src: q.Cross
                                }),
                                children: o.jsx(D, {
                                  size: "B300",
                                  children: `${B.items.length || "No"} ${B.items.length === 1 ? "Result" : "Results"}`
                                })
                              })
                            })
                          })
                        ]
                      }),
                      o.jsx(A3, {
                        scrollRef: i,
                        anchorRef: s,
                        children: o.jsx(Oe, {
                          onClick: () => I.scrollToOffset(0),
                          variant: "Surface",
                          radii: "Pill",
                          outlined: true,
                          size: "300",
                          "aria-label": "Scroll to Top",
                          children: o.jsx(Q, {
                            src: q.ChevronTop,
                            size: "300"
                          })
                        })
                      }),
                      !h && !B && O.length === 0 && o.jsx(D, {
                        style: {
                          padding: ee.space.S300
                        },
                        align: "Center",
                        children: `No "${C.name}" Members`
                      })
                    ]
                  }),
                  o.jsx(E, {
                    className: Fnt,
                    direction: "Column",
                    gap: "100",
                    children: o.jsx("div", {
                      style: {
                        position: "relative",
                        height: I.getTotalSize()
                      },
                      children: I.getVirtualItems().map((de) => {
                        const ne = M[de.index];
                        return ne ? "userId" in ne ? o.jsx("div", {
                          style: {
                            transform: `translateY(${de.start}px)`
                          },
                          className: NJ,
                          "data-index": de.index,
                          ref: I.measureElement,
                          children: o.jsx(ynt, {
                            mx: n,
                            useAuthentication: r,
                            room: t,
                            member: ne,
                            onClick: L,
                            pressed: m === ne.userId,
                            typing: T.some((ae) => ae.userId === ne.userId),
                            hideText: ie
                          })
                        }, `${t.roomId}-${ne.userId}`) : o.jsx(D, {
                          style: {
                            transform: `translateY(${de.start}px)`
                          },
                          "data-index": de.index,
                          ref: I.measureElement,
                          className: gt(vnt, NJ),
                          size: "L400",
                          truncate: ie,
                          children: ne.name
                        }, `${t.roomId}-${de.index}`) : null;
                      })
                    })
                  }),
                  h && o.jsx(E, {
                    justifyContent: "Center",
                    children: o.jsx(dt, {})
                  })
                ]
              })
            })
          ]
        })
      ]
    });
  }
  function Dnt({ children: t, onOpenSidebar: e, onOpenMembers: n, onReply: r }) {
    const i = Ze(ge), a = j3(0), s = IO(a, {
      stiffness: 400,
      damping: 40
    }), l = BO(({ active: c, movement: [d], velocity: [u], direction: [h], event: f }) => {
      if (f && "target" in f && f.target instanceof HTMLElement && f.target.closest('[data-gestures="ignore"]') || !i.mobileGestures || !Dr()) return;
      let g = d;
      const m = !!e, v = i.rightSwipeAction === G1.Members ? !!n : !!r;
      !m && g > 0 && (g = 0), !v && g < 0 && (g = 0), c ? a.set(g) : (g > 120 || u > 0.5 && h > 0 && g > 0 ? e == null ? void 0 : e() : (g < -120 || u > 0.5 && h < 0 && g < 0) && (i.rightSwipeAction === G1.Members ? n == null ? void 0 : n() : r == null ? void 0 : r()), a.set(0));
    }, {
      axis: "x",
      bounds: {
        left: -200,
        right: 200
      },
      rubberband: true,
      filterTaps: true
    });
    return !i.mobileGestures || !Dr() ? o.jsx("div", {
      style: {
        display: "flex",
        flexDirection: "column",
        flexGrow: 1,
        height: "100%",
        width: "100%"
      },
      children: t
    }) : o.jsx("div", {
      ...l(),
      style: {
        touchAction: "pan-y",
        overflow: "hidden",
        display: "flex",
        flexDirection: "column",
        flexGrow: 1,
        height: "100%",
        width: "100%"
      },
      children: o.jsx(AE.div, {
        style: {
          x: s,
          display: "flex",
          flexDirection: "column",
          flexGrow: 1,
          height: "100%"
        },
        children: t
      })
    });
  }
  function Cnt() {
    const [t, e] = Fr(tu), n = () => e(null);
    return (t == null ? void 0 : t.type) === _a.Forward ? o.jsx(OAe, {
      room: t.room,
      mEvent: t.mEvent,
      onClose: n
    }) : t ? o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: n,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs("div", {
            children: [
              t.type === _a.Report && o.jsx(E, {
                children: o.jsx(Itt, {
                  room: t.room,
                  mEvent: t.mEvent,
                  onClose: n
                })
              }),
              t.type === _a.Delete && o.jsx(E, {
                children: o.jsx(Att, {
                  room: t.room,
                  mEvent: t.mEvent,
                  onClose: n
                })
              }),
              t.type === _a.Source && o.jsx(Go, {
                variant: "Surface",
                size: "300",
                children: o.jsx(Rtt, {
                  room: t.room,
                  mEvent: t.mEvent,
                  onClose: n
                })
              }),
              t.type === _a.Reactions && o.jsx(Go, {
                variant: "Surface",
                size: "300",
                children: o.jsx(vtt, {
                  room: t.room,
                  relations: t.relations,
                  onClose: n
                })
              }),
              t.type === _a.EditHistory && o.jsx(Go, {
                variant: "Surface",
                size: "300",
                children: o.jsx(Ttt, {
                  room: t.room,
                  mEvent: t.mEvent,
                  onClose: n
                })
              }),
              t.type === _a.ReadReceipts && o.jsx(Go, {
                variant: "Surface",
                size: "300",
                children: o.jsx(wtt, {
                  room: t.room,
                  eventId: t.eventId,
                  onClose: n
                })
              })
            ]
          })
        })
      })
    }) : null;
  }
  const AS = vn(false), Cfe = Gf(() => vn(null)), Efe = Gf(() => vn(null)), kfe = vn(null);
  async function Ent(t) {
    try {
      return await t.doesServerSupportUnstableFeature("org.matrix.msc4140");
    } catch {
      return false;
    }
  }
  async function zJ(t, e, n, r, i) {
    return t._unstable_sendDelayedEvent(e, {
      delay: r
    }, null, ce.RoomMessage, n);
  }
  async function UJ(t, e, n, r, i, a) {
    const s = t.getCrypto();
    if (!s || !("encryptEvent" in s)) throw new Error("Encryption not available: no crypto backend with encryptEvent");
    const l = new to({
      type: ce.RoomMessage,
      content: r,
      room_id: e,
      sender: t.getUserId() ?? "",
      event_id: `~${e}:${Date.now()}`,
      origin_server_ts: Date.now(),
      unsigned: {}
    });
    return await s.encryptEvent(l, n), t._unstable_sendDelayedEvent(e, {
      delay: i
    }, null, l.getWireType(), l.getWireContent());
  }
  async function knt(t) {
    return t._unstable_getDelayedEvents();
  }
  async function ky(t, e) {
    await t._unstable_updateDelayedEvent(e, Ny.Cancel);
  }
  function VJ(t) {
    const e = t.getTime() - Date.now();
    if (e <= 0) throw new Error("Scheduled time must be in the future");
    return e;
  }
  function Snt() {
    const t = be(), e = Fn(AS);
    p.useEffect(() => {
      let n = false;
      return Ent(t).then((r) => {
        n || e(r);
      }), () => {
        n = true;
      };
    }, [
      t,
      e
    ]);
  }
  const jnt = (t) => {
    const [e] = Fe(ge, "hideMembershipEvents"), [n] = Fe(ge, "hideNickAvatarEvents"), [r] = Fe(ge, "showHiddenEvents"), [i, a] = p.useState();
    return p.useEffect(() => {
      const s = () => {
        const c = t.getLiveTimeline().getEvents();
        for (let d = c.length - 1; d >= 0; d -= 1) {
          const u = c[d];
          if (u && !is(u)) {
            if (u.getType() === ce.RoomMember) {
              const h = xk(u);
              if (h && e || !h && n) continue;
              return u;
            }
            if (u.getType() === ce.RoomMessage || u.getType() === ce.RoomMessageEncrypted || u.getType() === ce.Sticker || u.getType() === ce.RoomName || u.getType() === ce.RoomTopic || u.getType() === ce.RoomAvatar || r) return u;
          }
        }
      }, l = () => {
        a(s());
      };
      return a(s()), t.on(mt.Timeline, l), () => {
        t.removeListener(mt.Timeline, l);
      };
    }, [
      t,
      e,
      n,
      r
    ]), i;
  };
  var Tnt = "RoomViewFollowing_RoomViewFollowingPlaceholder__1h4d2d50 _1mqalmd1 _1mqalmd0", Rnt = Jr({
    defaultClassName: "RoomViewFollowing_RoomViewFollowing__1h4d2d51 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      clickable: {
        true: "RoomViewFollowing_RoomViewFollowing_clickable_true__1h4d2d52"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  });
  function Sfe() {
    return o.jsx("div", {
      className: Tnt
    });
  }
  const jfe = ft(({ className: t, room: e, threadEventId: n, participantIds: r, ...i }, a) => {
    const s = be(), [, l] = Fr(tu), c = jnt(e), d = n ?? (c == null ? void 0 : c.getId()), u = lfe(e, d), h = Ze(qr), f = u.filter((m) => m !== s.getUserId()).filter((m) => !r || r.has(m)).map((m) => gr(e, m, h) ?? _n(m) ?? m), g = d;
    return o.jsx(E, {
      as: f.length > 0 ? "button" : "div",
      onClick: f.length > 0 ? () => {
        g && l({
          type: _a.ReadReceipts,
          room: e,
          eventId: g
        });
      } : void 0,
      className: gt(Rnt({
        clickable: f.length > 0
      }), t),
      alignItems: "Center",
      justifyContent: "End",
      gap: "200",
      ...i,
      ref: a,
      children: f.length > 0 && o.jsxs(o.Fragment, {
        children: [
          o.jsx(Q, {
            style: {
              opacity: ee.opacity.P300
            },
            size: "100",
            src: q.CheckTwice
          }),
          o.jsxs(D, {
            size: "T300",
            truncate: true,
            children: [
              f.length === 1 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " is following the conversation."
                  })
                ]
              }),
              f.length === 2 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " and "
                  }),
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[1]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " are following the conversation."
                  })
                ]
              }),
              f.length === 3 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: ", "
                  }),
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[1]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " and "
                  }),
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[2]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " are following the conversation."
                  })
                ]
              }),
              f.length > 3 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: ", "
                  }),
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[1]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: ", "
                  }),
                  o.jsx("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: f[2]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " and "
                  }),
                  o.jsxs("b", {
                    style: {
                      WebkitTextFillColor: "inherit"
                    },
                    children: [
                      f.length - 3,
                      " others"
                    ]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    style: {
                      WebkitTextFillColor: "currentColor"
                    },
                    children: " are following the conversation."
                  })
                ]
              })
            ]
          })
        ]
      })
    });
  }), Ant = (t, e, n) => {
    const r = p.useRef(0), i = (n == null ? void 0 : n.disabled) ?? false;
    return p.useMemo(() => (r.current = 0, (s) => {
      if (!i) {
        if (s) {
          if (Date.now() - r.current < lf) return;
          t.sendTyping(e, true, lf);
          const l = Date.now();
          r.current = l, setTimeout(() => {
            r.current === l && (t.sendTyping(e, false, lf), r.current = 0);
          }, lf);
          return;
        }
        Date.now() - r.current < lf && t.sendTyping(e, false, lf), r.current = 0;
      }
    }), [
      t,
      e,
      i
    ]);
  }, Int = (t) => p.useCallback((e) => {
    const n = Yie(e.clipboardData);
    n && t(n);
  }, [
    t
  ]), Bnt = (t, e) => {
    const n = p.useRef(), [r, i] = p.useState(false);
    return p.useEffect(() => {
      const a = t.current, s = (l) => {
        if (l.preventDefault(), n.current = void 0, i(false), !l.dataTransfer) return;
        const c = Yie(l.dataTransfer);
        c && e(c);
      };
      return a == null ? void 0 : a.addEventListener("drop", s), () => {
        a == null ? void 0 : a.removeEventListener("drop", s);
      };
    }, [
      t,
      e
    ]), p.useEffect(() => {
      const a = t.current, s = (d) => {
        var _a6;
        ((_a6 = d.dataTransfer) == null ? void 0 : _a6.types.includes("Files")) && (n.current = "start", i(true));
      }, l = () => {
        n.current === "over" && (n.current = "leave", i(false));
      }, c = (d) => {
        d.preventDefault(), n.current = "over";
      };
      return a == null ? void 0 : a.addEventListener("dragenter", s), a == null ? void 0 : a.addEventListener("dragleave", l), a == null ? void 0 : a.addEventListener("dragover", c), () => {
        a == null ? void 0 : a.removeEventListener("dragenter", s), a == null ? void 0 : a.removeEventListener("dragleave", l), a == null ? void 0 : a.removeEventListener("dragover", c);
      };
    }, [
      t
    ]), r;
  };
  var Pnt = "UploadBoard_UploadBoardBase__bginyb0 _1mqalmd1 _1mqalmd0", Mnt = "UploadBoard_UploadBoardContainer__bginyb1 _1mqalmd1 _1mqalmd0", Ont = "UploadBoard_UploadBoard__bginyb2", HJ = "UploadBoard_UploadBoardHeaderContent__bginyb3", Lnt = "UploadBoard_UploadBoardContent__bginyb4";
  const Nnt = ft(({ header: t, children: e, ...n }, r) => o.jsx(E, {
    className: Pnt,
    ...n,
    ref: r,
    children: o.jsx(E, {
      className: Mnt,
      justifyContent: "End",
      children: o.jsxs(E, {
        className: gt(Ont),
        direction: "Column",
        children: [
          o.jsx(E, {
            grow: "Yes",
            direction: "Column",
            children: e
          }),
          o.jsx(E, {
            direction: "Column",
            shrink: "No",
            children: t
          })
        ]
      })
    })
  }));
  function znt({ open: t, onToggle: e, uploadFamilyObserverAtom: n, onCancel: r, onSend: i, imperativeHandlerRef: a }) {
    const s = p.useRef(false), l = Ze(n), c = l.every((g) => g.status === Xi.Success), d = l.some((g) => g.status === Xi.Error), u = l.reduce((g, m) => (g.total += m.file.size, m.status === Xi.Loading && (g.loaded += m.progress.loaded), m.status === Xi.Success && (g.loaded += m.file.size), g), {
      loaded: 0,
      total: 0
    }), h = async () => {
      s.current || (s.current = true, await i(l.filter((g) => g.status === Xi.Success)), s.current = false);
    };
    p.useImperativeHandle(a, () => ({
      handleSend: h
    }));
    const f = () => r(l);
    return o.jsxs(wn, {
      size: "400",
      children: [
        o.jsxs(E, {
          as: "button",
          style: {
            cursor: "pointer"
          },
          onClick: e,
          className: HJ,
          alignItems: "Center",
          grow: "Yes",
          gap: "100",
          children: [
            o.jsx(Q, {
              src: t ? q.ChevronTop : q.ChevronRight,
              size: "50"
            }),
            o.jsx(D, {
              size: "H6",
              children: "Files"
            })
          ]
        }),
        o.jsxs(E, {
          className: HJ,
          alignItems: "Center",
          gap: "100",
          children: [
            c && o.jsx(Qe, {
              as: "button",
              onClick: h,
              variant: "Primary",
              radii: "Pill",
              outlined: true,
              after: o.jsx(Q, {
                src: q.Send,
                size: "50",
                filled: true
              }),
              children: o.jsx(D, {
                size: "B300",
                children: "Send"
              })
            }),
            d && !t && o.jsx(Rn, {
              variant: "Critical",
              fill: "Solid",
              radii: "300",
              children: o.jsx(D, {
                size: "L400",
                children: "Upload Failed"
              })
            }),
            !c && !d && !t && o.jsxs(o.Fragment, {
              children: [
                o.jsx(Rn, {
                  variant: "Secondary",
                  fill: "Solid",
                  radii: "Pill",
                  children: o.jsxs(D, {
                    size: "L400",
                    children: [
                      Math.round(Nb(0, u.total, u.loaded)),
                      "%"
                    ]
                  })
                }),
                o.jsx(dt, {
                  variant: "Secondary",
                  size: "200"
                })
              ]
            }),
            !c && t && o.jsx(Qe, {
              as: "button",
              onClick: f,
              variant: "SurfaceVariant",
              radii: "Pill",
              after: o.jsx(Q, {
                src: q.Cross,
                size: "50"
              }),
              children: o.jsx(D, {
                size: "B300",
                children: l.length === 1 ? "Remove" : "Remove All"
              })
            })
          ]
        })
      ]
    });
  }
  const Unt = ft(({ className: t, children: e, ...n }, r) => o.jsx(E, {
    className: gt(Lnt, t),
    direction: "Column",
    gap: "200",
    ...n,
    ref: r,
    children: e
  }));
  var na = ((t) => (t.TextRoom = "text", t.VoiceRoom = "voice", t))(na || {}), wr = ((t) => (t.Private = "private", t.Restricted = "restricted", t.Public = "public", t))(wr || {});
  function Tfe({ value: t, onSelect: e, canRestrict: n, disabled: r, getIcon: i }) {
    return o.jsxs(E, {
      shrink: "No",
      direction: "Column",
      gap: "100",
      children: [
        n && o.jsx(Te, {
          style: {
            padding: ee.space.S300
          },
          variant: t === wr.Restricted ? "Primary" : "SurfaceVariant",
          direction: "Column",
          gap: "100",
          as: "button",
          type: "button",
          "aria-pressed": t === wr.Restricted,
          onClick: () => e(wr.Restricted),
          disabled: r,
          children: o.jsxs(Ie, {
            before: o.jsx(Q, {
              size: "400",
              src: i(wr.Restricted)
            }),
            after: t === wr.Restricted && o.jsx(Q, {
              src: q.Check
            }),
            children: [
              o.jsx(D, {
                size: "H6",
                children: "Restricted"
              }),
              o.jsx(D, {
                size: "T300",
                priority: "300",
                children: "Only member of parent space can join."
              })
            ]
          })
        }),
        o.jsx(Te, {
          style: {
            padding: ee.space.S300
          },
          variant: t === wr.Private ? "Primary" : "SurfaceVariant",
          direction: "Column",
          gap: "100",
          as: "button",
          type: "button",
          "aria-pressed": t === wr.Private,
          onClick: () => e(wr.Private),
          disabled: r,
          children: o.jsxs(Ie, {
            before: o.jsx(Q, {
              size: "400",
              src: i(wr.Private)
            }),
            after: t === wr.Private && o.jsx(Q, {
              src: q.Check
            }),
            children: [
              o.jsx(D, {
                size: "H6",
                children: "Private"
              }),
              o.jsx(D, {
                size: "T300",
                priority: "300",
                children: "Only people with invite can join."
              })
            ]
          })
        }),
        o.jsx(Te, {
          style: {
            padding: ee.space.S300
          },
          variant: t === wr.Public ? "Primary" : "SurfaceVariant",
          direction: "Column",
          gap: "100",
          as: "button",
          type: "button",
          "aria-pressed": t === wr.Public,
          onClick: () => e(wr.Public),
          disabled: r,
          children: o.jsxs(Ie, {
            before: o.jsx(Q, {
              size: "400",
              src: i(wr.Public)
            }),
            after: t === wr.Public && o.jsx(Q, {
              src: q.Check
            }),
            children: [
              o.jsx(D, {
                size: "H6",
                children: "Public"
              }),
              o.jsx(D, {
                size: "T300",
                priority: "300",
                children: "Anyone with the address can join."
              })
            ]
          })
        })
      ]
    });
  }
  function Rfe({ disabled: t }) {
    const e = be(), n = p.useRef(null), [r, i] = p.useState({
      status: ve.Idle
    });
    p.useEffect(() => {
      var _a6;
      r.status === ve.Success && ((_a6 = n.current) == null ? void 0 : _a6.value) === "" && i({
        status: ve.Idle
      });
    }, [
      r
    ]);
    const a = YE(p.useCallback(async (u) => {
      const h = `#${u}:${bo(e.getSafeUserId())}`;
      try {
        return typeof (await e.getRoomIdForAlias(h)).room_id != "string";
      } catch (f) {
        if (f instanceof Un && f.httpStatus === 404) return true;
        throw f;
      }
    }, [
      e
    ]), i), s = r.status === ve.Success ? r.data : void 0, l = Rp(a, {
      wait: 500
    }), c = (u) => {
      const h = u.currentTarget, f = Og(h.value);
      f ? (h.value = f, l(f)) : i({
        status: ve.Idle
      });
    }, d = (u) => {
      if (Yt.isKeyHotkey("enter", u)) {
        u.preventDefault();
        const h = u.currentTarget, f = Og(h.value);
        f ? a(f) : i({
          status: ve.Idle
        });
      }
    };
    return o.jsxs(E, {
      shrink: "No",
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Address (Optional)"
        }),
        o.jsx(D, {
          size: "T200",
          priority: "300",
          children: "Pick an unique address to make it discoverable."
        }),
        o.jsx(mn, {
          ref: n,
          onChange: c,
          before: r.status === ve.Loading ? o.jsx(dt, {
            size: "100",
            variant: "Secondary"
          }) : o.jsx(Q, {
            size: "100",
            src: q.Hash
          }),
          after: o.jsxs(D, {
            style: {
              maxWidth: He(150)
            },
            truncate: true,
            children: [
              ":",
              bo(e.getSafeUserId())
            ]
          }),
          onKeyDown: d,
          name: "aliasInput",
          size: "500",
          variant: s === true ? "Success" : "SurfaceVariant",
          radii: "400",
          autoComplete: "off",
          disabled: t
        }),
        s === false && o.jsxs(E, {
          style: {
            color: ct.Critical.Main
          },
          alignItems: "Center",
          gap: "100",
          children: [
            o.jsx(Q, {
              src: q.Warning,
              filled: true,
              size: "50"
            }),
            o.jsx(D, {
              size: "T200",
              children: o.jsx("b", {
                children: "This address is already taken. Please select a different one."
              })
            })
          ]
        })
      ]
    });
  }
  function VO({ versions: t, value: e, onChange: n, disabled: r }) {
    const [i, a] = p.useState(), s = (c) => {
      a(c.currentTarget.getBoundingClientRect());
    }, l = (c) => {
      a(void 0), n(c);
    };
    return o.jsx(Te, {
      style: {
        padding: ee.space.S300
      },
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "500",
      children: o.jsx(Ie, {
        title: "Version",
        after: o.jsx(ln, {
          anchor: i,
          offset: 5,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: () => a(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (c) => c.key === "ArrowDown" || c.key === "ArrowRight",
              isKeyBackward: (c) => c.key === "ArrowUp" || c.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "200",
                style: {
                  padding: ee.space.S200,
                  maxWidth: He(300)
                },
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Versions"
                  }),
                  o.jsx(E, {
                    wrap: "Wrap",
                    gap: "100",
                    children: t.map((c) => o.jsx(Qe, {
                      variant: e === c ? "Primary" : "SurfaceVariant",
                      "aria-pressed": e === c,
                      outlined: e === c,
                      radii: "300",
                      onClick: () => l(c),
                      type: "button",
                      children: o.jsx(D, {
                        truncate: true,
                        size: "T300",
                        children: c
                      })
                    }, c))
                  })
                ]
              })
            })
          }),
          children: o.jsx(xe, {
            type: "button",
            onClick: s,
            size: "300",
            variant: "Secondary",
            fill: "Soft",
            radii: "300",
            "aria-pressed": !!i,
            before: o.jsx(Q, {
              size: "50",
              src: i ? q.ChevronTop : q.ChevronBottom
            }),
            disabled: r,
            children: o.jsx(D, {
              size: "B300",
              children: e
            })
          })
        })
      })
    });
  }
  const Vnt = (t, e, n) => {
    const r = {};
    return typeof t == "string" && (r.type = t), e || (r["m.federate"] = false), Array.isArray(n) && (r.additional_creators = n), r;
  }, Hnt = (t, e, n) => {
    let r = {
      join_rule: n ? kn.Knock : kn.Invite
    };
    return t === wr.Public && (r = {
      join_rule: kn.Public
    }), t === wr.Restricted && e && (r = {
      join_rule: n ? "knock_restricted" : kn.Restricted,
      allow: [
        {
          type: ak.RoomMembership,
          room_id: e.roomId
        }
      ]
    }), {
      type: ce.RoomJoinRules,
      state_key: "",
      content: r
    };
  }, $nt = (t) => ({
    type: ce.SpaceParent,
    state_key: t.roomId,
    content: {
      canonical: true,
      via: Xc(t)
    }
  }), Wnt = () => ({
    events_default: 50
  }), HO = () => ({
    type: "m.room.encryption",
    state_key: "",
    content: {
      algorithm: "m.megolm.v1.aes-sha2"
    }
  }), qnt = () => ({
    type: S4e,
    state_key: "",
    content: {}
  }), Knt = () => ({
    events: {
      [ce.GroupCallMemberPrefix]: 0
    }
  }), Afe = async (t, e) => {
    const n = [];
    e.encryption && n.push(HO()), e.parent && n.push($nt(e.parent)), e.type === Bo.UnstableCall && n.push(qnt()), n.push(Hnt(e.access, e.parent, e.knock));
    const r = {
      room_version: e.version,
      name: e.name,
      topic: e.topic,
      room_alias_name: e.aliasLocalPart,
      creation_content: Vnt(e.type, e.allowFederation, e.additionalCreators),
      power_level_content_override: e.type === Bo.UnstableCall ? Knt() : void 0,
      initial_state: n
    };
    e.type === Bo.Space && (r.power_level_content_override = Wnt());
    const i = await t.createRoom(r);
    return e.parent && await t.sendStateEvent(e.parent.roomId, ce.SpaceChild, {
      auto_join: false,
      suggested: false,
      via: [
        bo(t.getUserId() ?? "") ?? ""
      ]
    }, i.room_id), i.room_id;
  }, $O = (t) => {
    const e = be(), [n, r] = p.useState(() => (t == null ? void 0 : t.filter((s) => s !== e.getSafeUserId())) ?? []);
    return {
      additionalCreators: n,
      addAdditionalCreator: (s) => {
        s !== e.getSafeUserId() && r((l) => {
          const c = new Set(l);
          return c.add(s), Array.from(c);
        });
      },
      removeAdditionalCreator: (s) => {
        r((l) => {
          const c = new Set(l);
          return c.delete(s), Array.from(c);
        });
      }
    };
  }, Gnt = {
    limit: 1e3,
    matchOptions: {
      contain: true
    }
  }, Ynt = (t) => _n(t) ?? t;
  function WO({ additionalCreators: t, onSelect: e, onRemove: n, disabled: r }) {
    const i = be(), [a, s] = p.useState(), l = Xde(), [c, d] = p.useState(), u = p.useMemo(() => l.filter((x) => !t.includes(x)), [
      l,
      t
    ]), [h, f, g] = tc(u, Ynt, Gnt), m = (h == null ? void 0 : h.query) ? a3([
      h.query
    ]) : void 0, v = h ? h.items : u.toSorted((x, S) => x.toLocaleLowerCase() >= S.toLocaleLowerCase() ? 1 : -1), y = (x) => {
      s(x.currentTarget.getBoundingClientRect());
    }, w = () => {
      s(void 0), d(void 0), g();
    }, b = (x) => {
      const T = x.currentTarget.value.trim();
      if (co(T)) d(T);
      else {
        d(void 0);
        const A = _n(T) ?? (T.startsWith("@") ? T.slice(1) : T);
        A ? f(A) : g();
      }
    }, j = (x) => {
      x && co(x) && (e(x), w());
    }, k = (x) => {
      if (Yt.isKeyHotkey("enter", x)) {
        x.preventDefault();
        const S = x.currentTarget.value.trim();
        j(co(S) ? S : v[0]);
      }
    }, C = () => {
      j(c);
    };
    return o.jsx(Ie, {
      title: "Founders",
      description: "Special privileged users can be assigned during creation. These users have elevated control and can only be modified during a upgrade.",
      children: o.jsx(E, {
        shrink: "No",
        direction: "Column",
        gap: "100",
        children: o.jsxs(E, {
          gap: "200",
          wrap: "Wrap",
          children: [
            o.jsx(Qe, {
              type: "button",
              variant: "Primary",
              radii: "Pill",
              outlined: true,
              children: o.jsx(D, {
                size: "B300",
                children: i.getSafeUserId()
              })
            }),
            t.map((x) => o.jsx(Qe, {
              type: "button",
              variant: "Secondary",
              radii: "Pill",
              after: o.jsx(Q, {
                size: "50",
                src: q.Cross
              }),
              onClick: () => n(x),
              disabled: r,
              children: o.jsx(D, {
                size: "B300",
                children: x
              })
            }, x)),
            o.jsx(ln, {
              anchor: a,
              position: "Bottom",
              align: "Center",
              content: o.jsx(Ft, {
                focusTrapOptions: {
                  onDeactivate: w,
                  clickOutsideDeactivates: true,
                  isKeyForward: (x) => x.key === "ArrowDown",
                  isKeyBackward: (x) => x.key === "ArrowUp",
                  escapeDeactivates: kt
                },
                children: o.jsx(tn, {
                  style: {
                    width: "100vw",
                    maxWidth: He(300),
                    height: He(250),
                    display: "flex"
                  },
                  children: o.jsxs(E, {
                    grow: "Yes",
                    direction: "Column",
                    children: [
                      o.jsxs(E, {
                        shrink: "No",
                        gap: "100",
                        style: {
                          padding: ee.space.S100
                        },
                        children: [
                          o.jsx(E, {
                            grow: "Yes",
                            direction: "Column",
                            gap: "100",
                            children: o.jsx(mn, {
                              size: "400",
                              variant: "Background",
                              radii: "300",
                              outlined: true,
                              placeholder: "@username:server",
                              onChange: b,
                              onKeyDown: k
                            })
                          }),
                          o.jsx(xe, {
                            type: "button",
                            variant: "Success",
                            radii: "300",
                            onClick: C,
                            disabled: !c,
                            children: o.jsx(D, {
                              size: "B400",
                              children: "Enter"
                            })
                          })
                        ]
                      }),
                      o.jsx(nr, {
                        size: "300"
                      }),
                      o.jsx(E, {
                        grow: "Yes",
                        direction: "Column",
                        children: !c && v.length > 0 ? o.jsx(dn, {
                          size: "300",
                          hideTrack: true,
                          children: o.jsx(E, {
                            grow: "Yes",
                            direction: "Column",
                            gap: "100",
                            style: {
                              padding: ee.space.S200,
                              paddingRight: 0
                            },
                            children: v.map((x) => o.jsx(Ye, {
                              size: "300",
                              variant: "Surface",
                              radii: "300",
                              onClick: () => j(x),
                              after: o.jsx(D, {
                                size: "T200",
                                truncate: true,
                                children: bo(x)
                              }),
                              children: o.jsx(E, {
                                grow: "Yes",
                                children: o.jsx(D, {
                                  size: "T200",
                                  truncate: true,
                                  children: o.jsx("b", {
                                    children: m ? ip(m, [
                                      _n(x) ?? x
                                    ]) : _n(x)
                                  })
                                })
                              })
                            }, x))
                          })
                        }) : o.jsxs(E, {
                          grow: "Yes",
                          alignItems: "Center",
                          justifyContent: "Center",
                          direction: "Column",
                          gap: "100",
                          children: [
                            o.jsx(D, {
                              size: "H6",
                              align: "Center",
                              children: "No Suggestions"
                            }),
                            o.jsx(D, {
                              size: "T200",
                              align: "Center",
                              children: "Please provide the user ID and hit Enter."
                            })
                          ]
                        })
                      })
                    ]
                  })
                })
              }),
              children: o.jsx(Qe, {
                type: "button",
                variant: "Secondary",
                radii: "Pill",
                onClick: y,
                "aria-pressed": !!a,
                disabled: r,
                children: o.jsx(Q, {
                  size: "50",
                  src: q.Plus
                })
              })
            })
          ]
        })
      })
    });
  }
  function qt(t, e, n) {
    const r = new to({
      type: "m.room.message",
      content: {
        msgtype: "m.notice",
        body: t
      },
      event_id: `~sable-feedback-${Date.now()}`,
      room_id: e.roomId,
      sender: n
    });
    e.addLiveEvents([
      r
    ], {
      duplicateStrategy: l1.Ignore,
      addToState: false
    });
  }
  const $J = /^(pk;member)\s+"?([\w\s]+)"?\s*rename\s+"?([\w\s]+)"?$/, WJ = /^(pk;member)\s+new\s+"?([\w\s]+)"?$/, qJ = /^(pk;member)\s+"?([\w\s]+)"?\s+proxy(\s+add)?\s+(.*text.*)$/, KJ = /^(pk;member)\s+"?([\w\s]+)"?\s+proxy\s+remove\s+(.*text.*)$/, z0 = "To create a new persona: pk;member new Yumi", k8 = 'To rename a persona: pk;member "Rain Deer" rename "Micky Mouse"', Ife = "To add a shorthand to a persona: pk;member Yumi proxy [text]", Bfe = "To remove a shorthand from a persona: pk;member Yumi proxy remove [text]", GJ = `Available 'pk;member' commands:
${z0}
${k8}
${Ife}
${Bfe}`;
  function Znt(t) {
    return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  }
  function Jnt(t) {
    const [e = "", n = ""] = t.split("text"), r = (a) => typeof RegExp.escape == "function" ? RegExp.escape(a) : Znt(a), i = `${r(e)}(.+)${r(n)}`;
    return new RegExp(`^${i}$`);
  }
  class S8 {
    constructor(e, n) {
      __publicField(this, "mx");
      __publicField(this, "message", "");
      __publicField(this, "room");
      __publicField(this, "useIdInsteadOfNameWherePossible");
      this.mx = e, this.room = n, this.useIdInsteadOfNameWherePossible = false;
    }
    async memberHandler() {
      var _a6, _b3, _c3;
      if (this.message.match(WJ)) {
        const e = WJ.exec(this.message);
        if (!e) {
          qt(`malformed input, ${z0}`, this.room, this.mx.getSafeUserId());
          return;
        }
        const n = e[2];
        if (!n) {
          qt(`malformed input, ${z0}`, this.room, this.mx.getSafeUserId());
          return;
        }
        const r = Cde(5);
        qt(`adding new member has been created with id: ${r} and name ${n}`, this.room, this.mx.getSafeUserId()), await gF(this.mx, {
          id: r,
          name: n
        }), qt(`added new member has been created with id: ${r} and name ${n}`, this.room, this.mx.getSafeUserId());
      } else if (this.message.match($J)) {
        const e = $J.exec(this.message);
        if (!e) {
          qt(`malformed input, ${k8}`, this.room, this.mx.getSafeUserId());
          return;
        }
        const n = e[2], r = e[3], i = (_a6 = (await wy(this.mx)).find((s) => s.name === n)) == null ? void 0 : _a6.id;
        if (!i) {
          qt(`Persona with name "${n}" doesn't exist in your records, ${z0}`, this.room, this.mx.getSafeUserId());
          return;
        }
        const a = await b3(this.mx, i);
        if (!a) {
          qt("Persona record can't be retrieved, data might be corrupted", this.room, this.mx.getSafeUserId());
          return;
        }
        if (!r) {
          qt(`malformed input, ${k8}`, this.room, this.mx.getSafeUserId());
          return;
        }
        a.name = r, qt(`renaming your profile ${i} from ${n} to ${r}`, this.room, this.mx.getSafeUserId()), await gF(this.mx, a);
      } else if (KJ.test(this.message)) {
        const e = KJ.exec(this.message);
        if (!e) return;
        const n = e[2], r = e[3], i = this.useIdInsteadOfNameWherePossible ? n : (_b3 = (await wy(this.mx)).find((a) => a.name === n)) == null ? void 0 : _b3.id;
        if (!i) {
          qt(`Persona with ${this.useIdInsteadOfNameWherePossible ? "id" : "name"} "${n}" doesn't exist in your records, ${z0}`, this.room, this.mx.getSafeUserId());
          return;
        }
        if (!r) {
          qt(`malformed input, ${Bfe}`, this.room, this.mx.getSafeUserId());
          return;
        }
        await Nqe(this.mx, r), qt(`Persona with ${this.useIdInsteadOfNameWherePossible ? "id" : "name"} "${n}" (${i}) is now no longer associated with ${r}`, this.room, this.mx.getSafeUserId());
      } else if (qJ.test(this.message)) {
        const e = qJ.exec(this.message);
        if (!e) return;
        const n = e[2], r = e[4], i = this.useIdInsteadOfNameWherePossible ? n : (_c3 = (await wy(this.mx)).find((s) => s.name === n)) == null ? void 0 : _c3.id;
        if (!i) {
          qt(`Persona with ${this.useIdInsteadOfNameWherePossible ? "id" : "name"} "${n}" doesn't exist in your records, ${z0}`, this.room, this.mx.getSafeUserId());
          return;
        }
        if (!r) {
          qt(`malformed input, ${Ife}`, this.room, this.mx.getSafeUserId());
          return;
        }
        const a = Jnt(r);
        await Oqe(this.mx, i, r, a), qt(`Persona with ${this.useIdInsteadOfNameWherePossible ? "id" : "name"} "${n}" (${i}) is now associated with ${r}`, this.room, this.mx.getSafeUserId());
      } else {
        const n = (await wy(this.mx)).map((r) => `${r.id}: ${r.name ? r.name : "(empty name)"}`).join(`
`);
        qt(`If you see this, you have messed up a command

You currently have the following persona set up:
${n}

${GJ}`, this.room, this.mx.getSafeUserId());
      }
    }
    static isPKCommand(e) {
      return e.startsWith("pk;");
    }
    async handleMessage(e, n) {
      if (this.message = e, this.useIdInsteadOfNameWherePossible = n ?? false, !!this.message.startsWith("pk;")) {
        if (this.message.startsWith("pk;member")) {
          await this.memberHandler();
          return;
        }
        qt(`Command currently not supported, right now compatibility is limited and only a subset of pk;member is supported

${GJ}`, this.room, this.mx.getSafeUserId());
      }
    }
  }
  const YJ = String.raw`¯\_(ツ)_/¯`, j8 = "(\u256F\xB0\u25A1\xB0)\u256F\uFE35 \u253B\u2501\u253B", T8 = "\u252C\u2500\u252C\u30CE( \xBA_\xBA\u30CE)", Pfe = String.raw`(?:^|\s)-(\w+)\b`, Xnt = new RegExp(Pfe), ZJ = new RegExp(Pfe, "g"), Qnt = /(\S+) (name=)?"?([\w\s]*)"? (avatar=)?([\w.:/]+)/, ert = /^(\S+)\s*(-g)?(-o)?(-u)?\s*(\d+)?$/, Nm = (t) => {
    const e = new RegExp(Xnt).exec(t);
    if (!e) return [
      t,
      void 0
    ];
    const n = t.slice(0, e.index), r = t.slice(e.index);
    return [
      n,
      r
    ];
  }, zm = (t) => {
    var _a6;
    const e = {};
    if (!t) return e;
    const n = [];
    for (let r = ZJ.exec(t); r !== null; r = ZJ.exec(t)) !r[1] || !r[0] || n.push({
      key: r[1],
      index: r.index,
      match: r[0]
    });
    for (let r = 0; r < n.length; r += 1) {
      const i = n[r];
      if (!i) continue;
      const { key: a, match: s } = i, l = i.index + s.length, c = r + 1 < n.length ? ((_a6 = n[r + 1]) == null ? void 0 : _a6.index) ?? t.length : t.length, d = t.slice(l, c).trim();
      e[a] = d;
    }
    return e;
  }, X_ = (t) => {
    const e = [];
    return ga(t).forEach((n) => {
      co(n) && e.push(n);
    }), e;
  }, ET = (t) => {
    const e = [];
    return ga(t).forEach((n) => {
      iEe(n) && e.push(n);
    }), e;
  }, kT = (t, e) => t.getMembers().filter((r) => r.userId.endsWith(`:${e}`)), trt = (t) => {
    const e = t.match(/^(\d+(?:\.\d+)?)([dhms])$/);
    if (!e) return;
    const n = Number.parseFloat(e[1]), r = e[2], i = Date.now();
    let a = 0;
    switch (r) {
      case "d":
        a = n * 24 * 60 * 60 * 1e3;
        break;
      case "h":
        a = n * 60 * 60 * 1e3;
        break;
      case "m":
        a = n * 60 * 1e3;
        break;
      case "s":
        a = n * 1e3;
        break;
      default:
        return;
    }
    return i - a;
  }, nrt = (t, e, n) => {
    const r = e * Math.min(n, 1 - n), i = (a) => {
      const s = (a + t * 12) % 12, l = n - r * Math.max(Math.min(s - 3, 9 - s, 1), -1);
      return Math.round(255 * l).toString(16).padStart(2, "0");
    };
    return `#${i(0)}${i(8)}${i(4)}`;
  }, Mfe = (t) => t.nodeType === Node.TEXT_NODE ? [
    t
  ] : Array.from(t.childNodes).reduce((e, n) => e.concat(Mfe(n)), []), rrt = (t) => {
    const e = document.createElement("div");
    e.innerHTML = t;
    const n = Mfe(e), r = n.reduce((i, a) => {
      const s = a.textContent || "", l = Array.from(s).filter((c) => c.trim().length > 0).length;
      return i + l;
    }, 0);
    return n.reduce((i, a) => {
      var _a6;
      const s = a.textContent || "";
      if (!s.trim()) return i;
      const l = Array.from(s), { html: c, count: d } = l.reduce((h, f) => {
        if (f.trim().length === 0) return {
          html: h.html + f,
          count: h.count
        };
        const g = (i + h.count) / r * (5 / 6), v = `<span data-mx-color="${nrt(g, 1, 0.5)}">${f}</span>`;
        return {
          html: h.html + v,
          count: h.count + 1
        };
      }, {
        html: "",
        count: 0
      }), u = document.createElement("span");
      return u.innerHTML = c, (_a6 = a.parentNode) == null ? void 0 : _a6.replaceChild(u, a), i + d;
    }, 0), e.innerHTML;
  };
  var Na = ((t) => (t.Me = "me", t.Notice = "notice", t.Shrug = "shrug", t.StartDm = "startdm", t.Join = "join", t.Leave = "leave", t.Invite = "invite", t.DisInvite = "disinvite", t.Kick = "kick", t.Ban = "ban", t.UnBan = "unban", t.Ignore = "ignore", t.UnIgnore = "unignore", t.MyRoomNick = "myroomnick", t.MyRoomAvatar = "myroomavatar", t.ConvertToDm = "converttodm", t.ConvertToRoom = "converttoroom", t.TableFlip = "tableflip", t.UnFlip = "unflip", t.Delete = "delete", t.Acl = "acl", t.Knock = "knock", t.Color = "color", t.SColor = "scolor", t.Font = "font", t.SFont = "sfont", t.AddWidget = "addwidget", t.AddPerMessageProfileToAccount = "addpmp", t.DeletePerMessageProfileFromAccount = "delpmp", t.UsePerMessageProfile = "usepmp", t.AssociateProxyPerMessageProfile = "pmpproxy", t.Pronoun = "pronoun", t.SPronoun = "spronoun", t.Rainbow = "rainbow", t.RawMsg = "rawmsg", t.Raw = "raw", t.RawAcc = "rawacc", t.DelAcc = "delacc", t.SetExt = "setext", t.DelExt = "delext", t.DiscardSession = "discardsession", t.Html = "html", t.Hug = "hug", t.Cuddle = "cuddle", t.Wave = "wave", t.Poke = "poke", t.Headpat = "headpat", t.Report = "bugreport", t.ShareE2EEHistory = "sharehistory", t.Location = "location", t.ShareMyLocation = "sharemylocation", t))(Na || {});
  const ov = (t, e) => {
    const { navigateRoom: n } = Wi(), [r] = Fe(ge, "developerTools"), [i] = Fe(ge, "enableMSC4268CMD"), a = p.useMemo(() => new S8(t, e), [
      t,
      e
    ]), s = Hc(t.getSafeUserId()), l = Vte();
    return p.useMemo(() => ({
      me: {
        name: "me",
        description: "Send action message",
        exe: async () => {
        }
      },
      notice: {
        name: "notice",
        description: "Send notice message",
        exe: async () => {
        }
      },
      shrug: {
        name: "shrug",
        description: String.raw`Send ¯\_(ツ)_/¯ as message`,
        exe: async () => {
        }
      },
      tableflip: {
        name: "tableflip",
        description: `Send ${j8} as message`,
        exe: async () => {
        }
      },
      unflip: {
        name: "unflip",
        description: `Send ${T8} as message`,
        exe: async () => {
        }
      },
      startdm: {
        name: "startdm",
        description: "Start direct message with user. Example: /startdm userId1",
        exe: async (d) => {
          var _a6;
          const h = ga(d).filter((g) => co(g) && g !== t.getSafeUserId());
          if (h.length === 0) return;
          if (h.length === 1) {
            const g = (_a6 = vie(t, h[0])) == null ? void 0 : _a6.roomId;
            if (g) {
              n(g);
              return;
            }
          }
          const f = await t.createRoom({
            is_direct: true,
            invite: h,
            visibility: s1.Private,
            preset: Yb.TrustedPrivateChat,
            initial_state: [
              HO()
            ]
          });
          c4(t, f.room_id, h[0]), n(f.room_id);
        }
      },
      join: {
        name: "join",
        description: "Join room with address. Example: /join address1 address2",
        exe: async (d) => {
          ga(d).filter((f) => Bc(f) || ml(f)).forEach(async (f) => {
            await t.joinRoom(f);
          });
        }
      },
      leave: {
        name: "leave",
        description: "Leave current room.",
        exe: async (d) => {
          if (d.trim() === "") {
            t.leave(e.roomId);
            return;
          }
          ga(d).filter((f) => Bc(f)).map((f) => t.leave(f));
        }
      },
      invite: {
        name: "invite",
        description: "Invite user to room. Example: /invite userId1 userId2 [-r reason]",
        exe: async (d) => {
          const [u, h] = Nm(d), f = X_(u), m = zm(h).r;
          f.map((v) => t.invite(e.roomId, v, m));
        }
      },
      disinvite: {
        name: "disinvite",
        description: "Disinvite user to room. Example: /disinvite userId1 userId2 [-r reason]",
        exe: async (d) => {
          const [u, h] = Nm(d), f = X_(u), m = zm(h).r;
          f.map((v) => t.kick(e.roomId, v, m));
        }
      },
      kick: {
        name: "kick",
        description: "Kick user from room. Example: /kick userId1 userId2 servername [-r reason]",
        exe: async (d) => {
          var _a6;
          const [u, h] = Nm(d), f = X_(u), g = ET(u), v = zm(h).r, w = (_a6 = g == null ? void 0 : g.flatMap((b) => kT(e, b))) == null ? void 0 : _a6.filter((b) => b.membership !== Ht.Ban).map((b) => b.userId);
          Array.isArray(w) && w.forEach((b) => {
            f.includes(b) || f.push(b);
          }), Hu(f, (b) => t.kick(e.roomId, b, v));
        }
      },
      ban: {
        name: "ban",
        description: "Ban user from room. Example: /ban userId1 userId2 servername [-r reason]",
        exe: async (d) => {
          var _a6;
          const [u, h] = Nm(d), f = X_(u), g = ET(u), v = zm(h).r, w = (_a6 = g == null ? void 0 : g.flatMap((b) => kT(e, b))) == null ? void 0 : _a6.map((b) => b.userId);
          Array.isArray(w) && w.forEach((b) => {
            f.includes(b) || f.push(b);
          }), Hu(f, (b) => t.ban(e.roomId, b, v));
        }
      },
      unban: {
        name: "unban",
        description: "Unban user from room. Example: /unban userId1 userId2",
        exe: async (d) => {
          ga(d).filter((f) => co(f)).map((f) => t.unban(e.roomId, f));
        }
      },
      ignore: {
        name: "ignore",
        description: "Ignore user. Example: /ignore userId1 userId2",
        exe: async (d) => {
          const h = ga(d).filter((f) => co(f));
          if (h.length > 0) {
            let f = t.getIgnoredUsers().concat(h);
            f = [
              ...new Set(f)
            ], await t.setIgnoredUsers(f);
          }
        }
      },
      unignore: {
        name: "unignore",
        description: "Unignore user. Example: /unignore userId1 userId2",
        exe: async (d) => {
          const h = ga(d).filter((f) => co(f));
          if (h.length > 0) {
            const f = t.getIgnoredUsers();
            await t.setIgnoredUsers(f.filter((g) => !h.includes(g)));
          }
        }
      },
      myroomnick: {
        name: "myroomnick",
        description: "Change nick in current room.",
        exe: async (d) => {
          var _a6, _b3;
          let u = d.trim();
          u === "" && (u = s.displayName ?? null);
          const f = (_b3 = (_a6 = e.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(ce.RoomMember, t.getSafeUserId())) == null ? void 0 : _b3.getContent();
          if (!f) return;
          const g = {
            ...f
          }, m = g;
          u == null || u === "" ? delete m.displayname : m.displayname = u, await t.sendStateEvent(e.roomId, ce.RoomMember, g, t.getSafeUserId());
        }
      },
      addpmp: {
        name: "addpmp",
        description: "Add or update a per message profile to your account. Example: /addpmp profileId name=Profile Name avatar=mxc://xyzabc",
        exe: async (d) => {
          const u = Qnt.exec(d);
          if (!u) {
            qt("invalid payload", e, t.getSafeUserId());
            return;
          }
          const h = u[5], f = u[3], g = u[1];
          if (!h || !f || !g) {
            qt("invalid payload", e, t.getSafeUserId());
            return;
          }
          await gF(t, {
            id: g,
            name: f || "",
            avatarUrl: h
          }).then(() => {
            qt(`Per message profile "${g}" added/updated in account.`, e, t.getSafeUserId());
          }).catch(() => {
            qt(`Failed to add/update per message profile "${g}" in account.`, e, t.getSafeUserId());
          });
        }
      },
      delpmp: {
        name: "delpmp",
        description: "Delete a per message profile from your account. Example: /delpmp profileId",
        exe: async (d) => {
          const [u] = ga(d);
          if (u === "index") {
            qt('Cannot delete reserved profile ID "index".', e, t.getSafeUserId());
            return;
          }
          await $M(t, u ?? "").then(() => {
            qt(`Per message profile "${u}" deleted from account.`, e, t.getSafeUserId());
          }).catch(() => {
            qt(`Failed to delete per message profile "${u}" from account.`, e, t.getSafeUserId());
          });
        }
      },
      usepmp: {
        name: "usepmp",
        description: "Use a per message profile for this room once, or until reset. Example: /usepmp (profileId,reset) [-o,-u,-g] [ts]",
        exe: async (d) => {
          const u = ert.exec(d);
          if (!u) {
            qt("invalid payload", e, t.getSafeUserId());
            return;
          }
          const h = u[1], f = u[2] !== void 0, g = u[3] !== void 0, m = Number.parseInt(u[5] ?? "", 10);
          if (g || f) {
            qt("Currently not implemented, consider using shorthands, with /pmpproxy id \u2728:text", e, t.getSafeUserId());
            return;
          }
          if ((h ?? "").normalize() === "reset") {
            WY(t, e.roomId, void 0, void 0, true).then(() => {
              qt("Per message profile reset for this room.", e, t.getSafeUserId());
            }).catch((v) => {
              qt(`Failed to reset per message profile for this room. Failed with: "${v.message}"`, e, t.getSafeUserId());
            });
            return;
          }
          await WY(t, e.roomId, h, m).then(() => {
            qt(`Per message profile "${h}" will be used for messages in this room for the until ${m ?? "reset"}. Use \`/usepmp reset\` to reset it at any time.`, e, t.getSafeUserId());
          }).catch((v) => {
            qt(`Failed to set per message profile for this room. Failed with: "${v.message}"`, e, t.getSafeUserId());
          });
        }
      },
      pmpproxy: {
        name: "pmpproxy",
        description: "Associate proxy with a profile. Example /pmpproxy id \u2728:text",
        exe: async (d) => {
          const u = ga(d)[0] ?? "", h = ga(d)[1] ?? "";
          await a.handleMessage(`pk;member "${u}" proxy ${h}`, true);
        }
      },
      myroomavatar: {
        name: "myroomavatar",
        description: "Change profile picture in current room. Example /myroomavatar mxc://xyzabc",
        exe: async (d) => {
          var _a6, _b3, _c3;
          const u = d.trim(), h = u.length === 0, g = (_b3 = (_a6 = e.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(ce.RoomMember, t.getSafeUserId())) == null ? void 0 : _b3.getContent();
          if (!g) return;
          const m = {
            ...g
          };
          if (h) {
            const v = ((_c3 = t.getUser(t.getSafeUserId())) == null ? void 0 : _c3.avatarUrl) ?? void 0;
            m.avatar_url = v;
          } else {
            if (!u.match(/^mxc:\/\/\S+$/)) return;
            m.avatar_url = u;
          }
          await t.sendStateEvent(e.roomId, ce.RoomMember, m, t.getSafeUserId());
        }
      },
      converttodm: {
        name: "converttodm",
        description: "Convert room to direct message",
        exe: async () => {
          const d = zB(e, t.getSafeUserId());
          await c4(t, e.roomId, d);
        }
      },
      converttoroom: {
        name: "converttoroom",
        description: "Convert direct message to room",
        exe: async () => {
          await UB(t, e.roomId);
        }
      },
      delete: {
        name: "delete",
        description: "Delete messages from users. Example: /delete userId1 servername -past 1d|2h|5m|30s [-t m.room.message] [-r spam]",
        exe: async (d) => {
          var _a6;
          const [u, h] = Nm(d), f = X_(u), g = ET(u), m = zm(h), v = m.r, y = m.past ?? "", w = m.t, b = w ? ga(w) : [], j = trt(y);
          if (!j) return;
          const C = (_a6 = g == null ? void 0 : g.flatMap((U) => kT(e, U))) == null ? void 0 : _a6.map((U) => U.userId);
          Array.isArray(C) && C.forEach((U) => {
            f.includes(U) || f.push(U);
          });
          const S = (await t.timestampToEvent(e.roomId, j, Tn.Forward)).event_id, T = `/rooms/${encodeURIComponent(e.roomId)}/context/${encodeURIComponent(S)}`;
          let B = (await t.http.authedRequest(rt.Get, T, {
            limit: 0
          })).start;
          for (; B; ) {
            const U = await t.createMessagesRequest(e.roomId, B, 20, Tn.Forward), { end: z, chunk: O } = U;
            B = z;
            const I = O.filter((N) => {
              var _a7;
              return (b.length > 0 ? b.includes(N.type) : true) && f.includes(N.sender) && ((_a7 = N.unsigned) == null ? void 0 : _a7.redacted_because) === void 0;
            }).map((N) => N.event_id);
            await Hu(I, (N) => t.redactEvent(e.roomId, N, void 0, {
              reason: v
            }));
          }
        }
      },
      acl: {
        name: "acl",
        description: "Manage server access control list. Example: /acl [-a servername1] [-d servername2] [-ra servername1] [-rd servername2]",
        exe: async (d) => {
          var _a6, _b3, _c3, _d4, _e13;
          const [, u] = Nm(d), h = zm(u), f = h.a, g = h.d, m = h.ra, v = h.rd, y = f ? ga(f) : [], w = g ? ga(g) : [], b = m ? ga(m) : [], j = v ? ga(v) : [], k = (_a6 = ni(e, ce.RoomServerAcl)) == null ? void 0 : _a6.getContent(), C = {
            allow: (k == null ? void 0 : k.allow) ? [
              ...k.allow
            ] : [],
            allow_ip_literals: k == null ? void 0 : k.allow_ip_literals,
            deny: (k == null ? void 0 : k.deny) ? [
              ...k.deny
            ] : []
          };
          y.forEach((x) => {
            !Array.isArray(C.allow) || C.allow.includes(x) || C.allow.push(x);
          }), w.forEach((x) => {
            !Array.isArray(C.deny) || C.deny.includes(x) || C.deny.push(x);
          }), C.allow = (_b3 = C.allow) == null ? void 0 : _b3.filter((x) => !b.includes(x)), C.deny = (_c3 = C.deny) == null ? void 0 : _c3.filter((x) => !j.includes(x)), (_d4 = C.allow) == null ? void 0 : _d4.sort(), (_e13 = C.deny) == null ? void 0 : _e13.sort(), await t.sendStateEvent(e.roomId, ce.RoomServerAcl, C);
        }
      },
      knock: {
        name: "knock",
        description: "Knock on (request to join) room with address. Example: /knock address1 address2",
        exe: async (d) => {
          ga(d).filter((f) => Bc(f) || ml(f)).forEach(async (f) => {
            await t.knockRoom(f);
          });
        }
      },
      color: {
        name: "color",
        description: "Set a room-specific color. Example: /color #ff00ff | /color reset",
        exe: async (d) => {
          const u = d.trim().toLowerCase(), h = t.getSafeUserId();
          try {
            if (u === "reset" || u === "clear") {
              await t.sendStateEvent(e.roomId, Pn.RoomCosmeticsColor, {}, h), qt("Room color has been reset.", e, h);
              return;
            }
            /^#[0-9A-F]{6}$/i.test(u) ? (await t.sendStateEvent(e.roomId, Pn.RoomCosmeticsColor, {
              color: u
            }, h), qt(`Room color set to ${u}.`, e, h)) : qt("Invalid format. Use #RRGGBB.", e, h);
          } catch (f) {
            f instanceof Un && f.errcode === vo.M_FORBIDDEN && qt('Permission Denied. An admin must enable "Room Colors" in Settings > Cosmetics in app.sable.moe or another supported client.', e, h);
          }
        }
      },
      scolor: {
        name: "scolor",
        description: "Set your color for the current Space. Example: /scolor #ff00ff | /scolor reset",
        exe: async (d) => {
          var _a6;
          const u = d.trim().toLowerCase(), h = t.getSafeUserId(), f = (_a6 = e.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(ce.SpaceParent), g = f && f.length > 0 ? f[0].getStateKey() : e.roomId;
          try {
            if (u === "reset" || u === "clear") {
              await t.sendStateEvent(g, Pn.RoomCosmeticsColor, {}, h), qt("Global space color reset.", e, h);
              return;
            }
            /^#[0-9A-F]{6}$/i.test(u) ? (await t.sendStateEvent(g, Pn.RoomCosmeticsColor, {
              color: u
            }, h), qt(`Global space color set to ${u}.`, e, h)) : qt("Invalid format. Use #RRGGBB.", e, h);
          } catch (m) {
            m instanceof Un && m.errcode === vo.M_FORBIDDEN && qt('Permission Denied. An admin must enable "Space-Wide Colors" in Settings > Cosmetics in app.sable.moe or another supported client.', e, h);
          }
        }
      },
      font: {
        name: "font",
        description: "Set a room-specific font. Example: /font Courier New | /font reset",
        exe: async (d) => {
          const u = d.trim().replaceAll(/[;{}<>]/g, "").slice(0, 32), h = t.getSafeUserId();
          try {
            if (u.toLowerCase() === "reset" || u === "") {
              await t.sendStateEvent(e.roomId, Pn.RoomCosmeticsFont, {}, h), qt("Room font reset.", e, h);
              return;
            }
            await t.sendStateEvent(e.roomId, Pn.RoomCosmeticsFont, {
              font: u
            }, h), qt(`Room font set to "${u}".`, e, h);
          } catch (f) {
            f instanceof Un && f.errcode === vo.M_FORBIDDEN && qt('Permission Denied. An admin must enable "Room Fonts" in Settings > Cosmetics in app.sable.moe or another supported client.', e, h);
          }
        }
      },
      sfont: {
        name: "sfont",
        description: "Set a font for the current Space. Example: /sfont Courier New | /sfont reset",
        exe: async (d) => {
          var _a6;
          const u = d.trim().replaceAll(/[;{}<>]/g, "").slice(0, 32), h = t.getSafeUserId(), f = (_a6 = e.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(ce.SpaceParent), g = f && f.length > 0 ? f[0].getStateKey() : e.roomId;
          try {
            if (u.toLowerCase() === "reset" || u === "") {
              await t.sendStateEvent(g, Pn.RoomCosmeticsFont, {}, h), qt("Space font reset.", e, h);
              return;
            }
            await t.sendStateEvent(g, Pn.RoomCosmeticsFont, {
              font: u
            }, h), qt(`Space font set to "${u}".`, e, h);
          } catch (m) {
            m instanceof Un && m.errcode === vo.M_FORBIDDEN && qt('Permission Denied. An admin must enable "Space-Wide Fonts" in Settings > Cosmetics in app.sable.moe or another supported client.', e, h);
          }
        }
      },
      addwidget: {
        name: "addwidget",
        description: "Add a widget to this room. Usage: /addwidget <url> [name]",
        exe: async (d) => {
          const u = t.getSafeUserId(), h = d.trim().split(/\s+/), f = h[0], g = h.slice(1).join(" ") || "Widget";
          if (!f) {
            qt("Usage: /addwidget <url> [name]", e, u);
            return;
          }
          let m;
          try {
            m = new URL(f);
          } catch {
            qt("Invalid URL. Please provide a valid widget URL.", e, u);
            return;
          }
          try {
            const v = `${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
            await t.sendStateEvent(e.roomId, Pn.RoomWidget, {
              type: "m.custom",
              url: qde(m.toString()),
              name: g,
              id: v,
              creatorUserId: u
            }, v), qt(`Widget "${g}" added.`, e, u);
          } catch (v) {
            v instanceof Un && v.errcode === vo.M_FORBIDDEN ? qt("Permission denied. You need permission to manage widgets in this room.", e, u) : qt(`Failed to add widget: ${v.message || "Unknown error"}`, e, u);
          }
        }
      },
      pronoun: {
        name: "pronoun",
        description: 'Set your pronouns for this room. Example: /pronoun "en:they/them, de:sie/ihr" | /pronoun reset',
        exe: async (d) => {
          const u = d.trim().match(/^"(.*)"$/), h = u ? (u[1] ?? "").trim() : d.trim(), f = t.getSafeUserId();
          try {
            if ([
              "reset",
              "clear",
              ""
            ].includes(h.toLowerCase())) {
              await t.sendStateEvent(e.roomId, Pn.RoomCosmeticsPronouns, {}, f), qt("Room pronouns have been reset.", e, f);
              return;
            }
            const g = bE(h);
            await t.sendStateEvent(e.roomId, Pn.RoomCosmeticsPronouns, {
              pronouns: g
            }, f);
            const m = g.map((v) => v.language ? `for ${v.language} "${v.summary}" was set` : v.summary).join(", ");
            qt(`Room pronouns set: ${m}`, e, f);
          } catch (g) {
            g instanceof Un && g.errcode === vo.M_FORBIDDEN && qt("Permission Denied. Could not update room pronouns.", e, f);
          }
        }
      },
      spronoun: {
        name: "spronoun",
        description: 'Set your pronouns for this space. Example: /spronoun "en:they/them, de:sie/ihr" | /spronoun reset',
        exe: async (d) => {
          var _a6;
          const u = d.trim().match(/^"(.*)"$/), h = u ? (u[1] ?? "").trim() : d.trim(), f = t.getSafeUserId(), g = (_a6 = e.getLiveTimeline().getState(en.FORWARDS)) == null ? void 0 : _a6.getStateEvents(ce.SpaceParent), m = g && g.length > 0 ? g[0].getStateKey() : e.roomId;
          try {
            if ([
              "reset",
              "clear",
              ""
            ].includes(h.toLowerCase())) {
              await t.sendStateEvent(m, Pn.RoomCosmeticsPronouns, {}, f), qt("Global space pronouns reset.", e, f);
              return;
            }
            const v = bE(h);
            await t.sendStateEvent(m, Pn.RoomCosmeticsPronouns, {
              pronouns: v
            }, f);
            const y = v.map((w) => w.language ? `for ${w.language} "${w.summary}" was set` : w.summary).join(", ");
            qt(`Global space pronouns set: ${y}`, e, f);
          } catch (v) {
            v instanceof Un && v.errcode === vo.M_FORBIDDEN && qt("Permission Denied. Could not update space pronouns.", e, f);
          }
        }
      },
      rainbow: {
        name: "rainbow",
        description: "Send rainbow text.",
        exe: async (d, u) => {
          if (!d || d.trim().length === 0) return;
          const f = rrt(u || d);
          await t.sendMessage(e.roomId, {
            msgtype: Jn.Text,
            body: d,
            format: "org.matrix.custom.html",
            formatted_body: f
          });
        }
      },
      rawmsg: {
        name: "rawmsg",
        description: '[Dev only] Send raw message event. Example: /rawmsg {"msgtype":"m.text", "body":"hello"}',
        exe: async (d) => {
          const u = t.getSafeUserId();
          if (!r) {
            qt("Command available in Developer Mode only.", e, u);
            return;
          }
          try {
            const h = JSON.parse(d);
            await t.sendMessage(e.roomId, h);
          } catch (h) {
            qt(`Invalid JSON: ${h.message}`, e, u);
          }
        }
      },
      raw: {
        name: "raw",
        description: "[Dev only] Send any raw event. Usage: /raw <type> <json> [-s stateKey]",
        exe: async (d) => {
          const u = t.getSafeUserId();
          if (!r) {
            qt("Command available in Developer Mode only.", e, u);
            return;
          }
          const [h, f] = Nm(d), m = zm(f).s, y = h.trim().split(/\s+/)[0] ?? "", w = h.trim().substring(y.length).trim();
          if (!y || !w) {
            qt("Usage: /rawevent <type> <json> [-s stateKey]", e, u);
            return;
          }
          try {
            const b = JSON.parse(w);
            typeof m == "string" ? (await t.sendStateEvent(e.roomId, y, b, m), qt(`State event "${y}" sent with state key "${m}".`, e, u)) : (await t.sendEvent(e.roomId, y, b), qt(`Event "${y}" sent.`, e, u));
          } catch (b) {
            qt(`Error: ${b.message}`, e, u);
          }
        }
      },
      rawacc: {
        name: "rawacc",
        description: "[Dev only] Merge global account data. Usage: /rawacc <type> <json>",
        exe: async (d) => {
          const u = t.getSafeUserId();
          if (!r) {
            qt("Command available in Developer Mode only.", e, u);
            return;
          }
          const h = d.trim(), f = h.indexOf(" ");
          if (f === -1) {
            qt("Usage: /rawacc <type> <json>", e, u);
            return;
          }
          const g = h.substring(0, f), m = h.substring(f).trim();
          try {
            const v = JSON.parse(m), y = t.getAccountData(g), b = {
              ...y ? y.getContent() : {},
              ...v
            };
            await t.setAccountData(g, b), qt(`Account data "${g}" merged successfully.`, e, u);
          } catch (v) {
            qt(`Error: ${v.message}`, e, u);
          }
        }
      },
      delacc: {
        name: "delacc",
        description: "[Dev Only] Remove a key from account data. Usage: /delacc <type> <key>",
        exe: async (d) => {
          const u = t.getSafeUserId(), h = d.trim().split(/\s+/);
          if (h.length < 2) {
            qt("Usage: /delacc <type> <key>", e, u);
            return;
          }
          const [f, g] = h;
          try {
            const m = t.getAccountData(f);
            if (!m) {
              qt(`No account data found for type "${f}".`, e, u);
              return;
            }
            if (!g) {
              qt(`Key "${g}" not found in "${f}".`, e, u);
              return;
            }
            const v = {
              ...m == null ? void 0 : m.getContent()
            };
            if (!(g in v)) {
              qt(`Key "${g}" not found in "${f}".`, e, u);
              return;
            }
            delete v[g], await t.setAccountData(f, v), qt(`Key "${g}" removed from "${f}".`, e, u);
          } catch (m) {
            qt(`Error: ${m.message}`, e, u);
          }
        }
      },
      setext: {
        name: "setext",
        description: "[Dev Only] Set an extended profile property. Usage: /setext <key> <value>",
        exe: async (d) => {
          const u = t.getSafeUserId();
          if (!r) {
            qt("Command available in Developer Mode only.", e, u);
            return;
          }
          const h = d.trim().split(/\s+/);
          if (h.length < 2) {
            qt("Usage: /setext <key> <value>", e, u);
            return;
          }
          const f = h[0], g = h.slice(1).join(" ");
          let m = g;
          g === "true" ? m = true : g === "false" ? m = false : !Number.isNaN(Number(g)) && g.trim() !== "" && (m = Number(g));
          try {
            typeof t.setExtendedProfileProperty == "function" ? (await t.setExtendedProfileProperty(f ?? "", m), qt(`Extended profile property "${f}" set to: ${m}`, e, u)) : qt("Error: setExtendedProfileProperty is not supported.", e, u);
          } catch (v) {
            qt(`Failed to set extended profile: ${v.message}`, e, u);
          }
        }
      },
      delext: {
        name: "delext",
        description: "[Dev Only] Remove an extended profile property. Usage: /delext <key>",
        exe: async (d) => {
          const u = t.getSafeUserId(), h = d.trim();
          if (!r) {
            qt("Command available in Developer Mode only.", e, u);
            return;
          }
          if (!h) {
            qt("Usage: /delext <key>", e, u);
            return;
          }
          try {
            typeof t.deleteExtendedProfileProperty == "function" ? (await t.deleteExtendedProfileProperty(h), qt(`Extended profile property "${h}" removed.`, e, u)) : qt("Error: setExtendedProfileProperty is not supported.", e, u);
          } catch (f) {
            qt(`Failed to remove property: ${f.message}`, e, u);
          }
        }
      },
      discardsession: {
        name: "discardsession",
        description: "Force discard the current outbound E2EE session in this room.",
        exe: async () => {
          const d = t.getSafeUserId();
          try {
            const u = t.getCrypto();
            if (!u) {
              qt("Encryption is not enabled on this client.", e, d);
              return;
            }
            await u.forceDiscardSession(e.roomId), qt("Outbound encryption session discarded.", e, d);
          } catch (u) {
            qt(`Failed to discard session: ${u.message}`, e, d);
          }
        }
      },
      html: {
        name: "html",
        description: 'Send a message with HTML content. Example: /html <span data-mx-color="#ff0000">Red</span>',
        exe: async (d) => {
          await t.sendMessage(e.roomId, {
            msgtype: Jn.Text,
            body: d.replaceAll("<br>", `
`).replaceAll("<li>", `
- `).replaceAll(/<a(.*?)href="(?<link>(.*?))"(.*?)>(?<text>(.*?))<\/a>/g, "[$<text>]($<link>)").replaceAll(/<[^>]*>/g, ""),
            format: "org.matrix.custom.html",
            formatted_body: d
          });
        }
      },
      sharehistory: {
        name: "sharehistory",
        description: "Share E2EE history (MSC4268) of this room with a user. Example: /sharee2eehistory @user:example.org",
        exe: async (d) => {
          const u = d.trim(), { roomId: h } = e;
          if (!i) {
            qt("This command is disabled. Enable it under experimental settings to use it.", e, t.getSafeUserId());
            return;
          }
          if (!u) {
            qt("Usage: /sharee2eehistory @user:example.org", e, t.getSafeUserId());
            return;
          }
          const f = t.getCrypto();
          if (!f) {
            qt("Encryption is not enabled on this client.", e, t.getSafeUserId());
            return;
          }
          f.shareRoomHistoryWithUser(h, u).then(() => {
            qt(`E2EE history shared with ${u}. (Their client needs to support MSC4268)`, e, t.getSafeUserId());
          }).catch((g) => {
            qt(`Failed to share E2EE history: ${g.message}`, e, t.getSafeUserId());
          });
        }
      },
      hug: {
        name: "hug",
        description: "Send a hug to someone. Example: /hug [@user:example.org]",
        exe: async (d) => {
          const u = d.trim();
          await t.sendMessage(e.roomId, {
            msgtype: "im.fluffychat.cute_event",
            "m.mentions": {
              user_ids: u ? [
                u
              ] : []
            },
            cute_type: "hug",
            body: "\u{1F917}"
          });
        }
      },
      cuddle: {
        name: "cuddle",
        description: "Send a cuddle to someone. Example: /cuddle [@user:example.org]",
        exe: async (d) => {
          const u = d.trim();
          await t.sendMessage(e.roomId, {
            msgtype: "im.fluffychat.cute_event",
            cute_type: "cuddle",
            "m.mentions": {
              user_ids: u ? [
                u
              ] : []
            },
            body: "\u{1F60A}"
          });
        }
      },
      wave: {
        name: "wave",
        description: "Send a wave to someone. Example: /wave [@user:example.org]",
        exe: async (d) => {
          const u = d.trim();
          await t.sendMessage(e.roomId, {
            msgtype: "im.fluffychat.cute_event",
            cute_type: "wave",
            "m.mentions": {
              user_ids: u ? [
                u
              ] : []
            },
            body: "\u{1F44B}"
          });
        }
      },
      poke: {
        name: "poke",
        description: "Send a poke to someone. Example: /poke [@user:example.org]",
        exe: async (d) => {
          const u = d.trim();
          await t.sendMessage(e.roomId, {
            msgtype: "im.fluffychat.cute_event",
            cute_type: "poke",
            "m.mentions": {
              user_ids: u ? [
                u
              ] : []
            },
            body: "\u{1FAF5}"
          });
        }
      },
      headpat: {
        name: "headpat",
        description: "Send a headpat to someone. Example: /headpat [@user:example.org]",
        exe: async (d) => {
          const u = d.trim();
          await t.sendMessage(e.roomId, {
            msgtype: "m.emote",
            "m.mentions": {
              user_ids: u ? [
                u
              ] : []
            },
            body: `pats ${u || "you"}`,
            "fyi.cisnt.headpat": true
          });
        }
      },
      bugreport: {
        name: "bugreport",
        description: "Report a bug or request a feature",
        exe: async () => {
          l();
        }
      },
      location: {
        name: "location",
        description: "Share a location as /location <latitude> <longitude>",
        exe: async (d) => {
          const u = d.replace(",", " ").replace("/", " ").replace("  ", " ").trim().split(" "), h = u[0], f = u[1], g = u[2];
          if (!h || !f) {
            qt("You need to specify a latitude, a longitude parameter, and optionally an altitude, as for example: /location 43.959971 -59.790623 or use the /sharemylocation to share the current location", e, t.getSafeUserId());
            return;
          }
          await t.sendMessage(e.roomId, {
            msgtype: "m.location",
            geo_uri: `geo:${h},${f}${g ? `,${g}` : ""};u=0`,
            body: `https://www.openstreetmap.org/?mlat=${h}&mlon=${f}#map=16/${h}/${f}"`
          });
        }
      },
      sharemylocation: {
        name: "sharemylocation",
        description: "Share current location. Requires your browser to have location permissions. Add the flag --accurate or -a for enabling the high accuracy option",
        exe: async (d) => {
          const u = d.trim(), h = {
            enableHighAccuracy: u === "--accurate" || u === "-a" || u === "--high-accuracy" || u === "-h",
            timeout: 5e3,
            maximumAge: 0
          };
          function f(m) {
            const v = m.coords, y = v.latitude, w = v.longitude, b = v.altitude, j = v.accuracy;
            if (!y || !w) {
              qt("Unable to retrieve the location data for an unknown reason", e, t.getSafeUserId());
              return;
            }
            t.sendMessage(e.roomId, {
              msgtype: "m.location",
              geo_uri: `geo:${y},${w}${b ? `,${b}` : ""};u=${j}`,
              body: `https://www.openstreetmap.org/?mlat=${y}&mlon=${w}#map=16/${y}/${w}"`
            });
          }
          function g(m) {
            let v = `Unable to retrieve the location data, Error no. ${m.code}: ${m.message}`;
            m.code === 1 && (v = "You have denied Sable access to you location services."), m.code === 2 && (v = "Your device does not have a gps module, or it may not be turned on."), qt(v, e, t.getSafeUserId());
          }
          navigator.geolocation.getCurrentPosition(f, g, h);
        }
      }
    }), [
      t,
      n,
      e,
      s.displayName,
      a,
      r,
      i,
      l
    ]);
  }, IS = (t, e) => {
    const n = be();
    return p.useMemo(() => [
      t
    ].concat(Array.from(sa(e, t))).reduce((a, s) => {
      const l = n.getRoom(s);
      return l && a.push(l), a;
    }, []), [
      n,
      t,
      e
    ]);
  };
  function ST({ children: t }) {
    return o.jsx(ule, {
      children: o.jsx(tn, {
        className: dle,
        children: o.jsx(wn, {
          className: LPe,
          size: "400",
          children: t
        })
      })
    });
  }
  const irt = [
    "audio/mp4",
    "audio/mp4;codecs=mp4a.40.2",
    "audio/mp4;codecs=mp4a.40.5",
    "audio/mp4;codecs=aac",
    "audio/aac",
    "audio/wav;codecs=1",
    "audio/wav",
    "audio/mpeg"
  ], ort = [
    "audio/ogg;codecs=opus",
    "audio/ogg",
    "audio/webm;codecs=opus",
    "audio/webm",
    "audio/ogg;codecs=vorbis",
    "audio/wav;codecs=1",
    "audio/wav",
    "audio/mpeg",
    "audio/mp4;codecs=mp4a.40.2",
    "audio/mp4;codecs=mp4a.40.5",
    "audio/mp4;codecs=aac",
    "audio/mp4",
    "audio/aac",
    "audio/ogg;codecs=speex",
    "audio/webm;codecs=vorbis"
  ];
  function jT() {
    var _a6, _b3, _c3;
    if (!("MediaRecorder" in globalThis) || !globalThis.MediaRecorder) return null;
    const t = ((_a6 = globalThis.navigator) == null ? void 0 : _a6.userAgent) ?? "", e = /iPad|iPhone|iPod/.test(t) || ((_b3 = globalThis.navigator) == null ? void 0 : _b3.platform) === "MacIntel" && ((_c3 = globalThis.navigator) == null ? void 0 : _c3.maxTouchPoints) > 1;
    return (/^((?!chrome|android|crios|fxios|edgios).)*safari/i.test(t) || e ? irt : ort).find((a) => MediaRecorder.isTypeSupported(a)) || null;
  }
  function R8(t) {
    var _a6;
    switch (((_a6 = t.split(";")[0]) == null ? void 0 : _a6.trim()) ?? t) {
      case "audio/ogg":
        return "ogg";
      case "audio/webm":
        return "webm";
      case "audio/mp4":
        return "m4a";
      case "audio/mpeg":
        return "mp3";
      case "audio/wav":
        return "wav";
      case "audio/aac":
        return "aac";
      default:
        return "dat";
    }
  }
  class art {
    constructor(e) {
      __publicField(this, "mx");
      __publicField(this, "proxiesAssocs");
      __publicField(this, "succInit");
      this.mx = e, this.proxiesAssocs = [], this.succInit = false;
    }
    async init() {
      try {
        this.proxiesAssocs = (await Lqe(this.mx)).map((e) => Bqe(e)), this.succInit = true;
      } catch (e) {
        throw this.succInit = false, new Error(`failed to init pmp proxy handler: ${String(e)}`, {
          cause: e
        });
      }
    }
    isAProxiedMessage(e) {
      return this.succInit ? this.proxiesAssocs.some((n) => n.regex.test(e)) : false;
    }
    async getPmpBasedOnMessage(e) {
      var _a6;
      await this.init();
      const n = (_a6 = this.proxiesAssocs.find((r) => r.regex.test(e))) == null ? void 0 : _a6.profileId;
      if (n) return b3(this.mx, n);
    }
    stripProxyFromMessage(e) {
      if (!this.succInit) return;
      let n;
      return this.proxiesAssocs.forEach((r) => {
        const i = r.regex.exec(e);
        (i == null ? void 0 : i.at(1)) && (n = i.at(1));
      }), n;
    }
  }
  function Ofe({ initialTime: t, showEncryptionWarning: e, onCancel: n, onSubmit: r }) {
    const i = Date.now(), s = Ze(kfe) ?? dF(30), l = Math.round(s / dF(1)), c = t ?? i + yf(1), [d, u] = p.useState(() => Math.max(c, i + 6e4)), [h, f] = p.useState(), [g] = Fe(ge, "hour24Clock"), [m, v] = p.useState(), [y, w] = p.useState(), b = (S) => {
      v(S.currentTarget.getBoundingClientRect());
    }, j = (S) => {
      w(S.currentTarget.getBoundingClientRect());
    }, k = (S) => {
      u(Date.now() + S), f(void 0);
    }, C = () => {
      const S = d - Date.now();
      if (S <= 0) {
        f("Scheduled time must be in the future");
        return;
      }
      if (S > s) {
        f(`Cannot schedule more than ${l} day${l !== 1 ? "s" : ""} in advance`);
        return;
      }
      f(void 0), r(new Date(d));
    }, x = d <= i;
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: n,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Schedule Send"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: n,
                    radii: "300",
                    title: "Cancel scheduling",
                    "aria-label": "Cancel scheduling",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                direction: "Column",
                gap: "500",
                style: {
                  padding: ee.space.S400
                },
                children: [
                  o.jsxs(E, {
                    direction: "Row",
                    gap: "300",
                    children: [
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            priority: "400",
                            children: "Time"
                          }),
                          o.jsxs(E, {
                            gap: "100",
                            alignItems: "Center",
                            children: [
                              o.jsx(Qe, {
                                size: "500",
                                variant: "Surface",
                                fill: "None",
                                outlined: true,
                                radii: "300",
                                "aria-pressed": !!m,
                                after: o.jsx(Q, {
                                  size: "50",
                                  src: q.ChevronBottom
                                }),
                                onClick: b,
                                children: o.jsx(D, {
                                  size: "B300",
                                  children: eu(d, g)
                                })
                              }),
                              o.jsx(ln, {
                                anchor: m,
                                offset: 5,
                                position: "Bottom",
                                align: "Center",
                                content: o.jsx(Ft, {
                                  focusTrapOptions: {
                                    initialFocus: false,
                                    onDeactivate: () => v(void 0),
                                    clickOutsideDeactivates: true,
                                    isKeyForward: (S) => S.key === "ArrowDown" || S.key === "ArrowRight",
                                    isKeyBackward: (S) => S.key === "ArrowUp" || S.key === "ArrowLeft",
                                    escapeDeactivates: kt
                                  },
                                  children: o.jsx(nue, {
                                    min: i,
                                    max: i + s,
                                    value: d,
                                    onChange: u
                                  })
                                })
                              })
                            ]
                          })
                        ]
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            priority: "400",
                            children: "Date"
                          }),
                          o.jsxs(E, {
                            gap: "100",
                            alignItems: "Center",
                            children: [
                              o.jsx(Qe, {
                                size: "500",
                                variant: "Surface",
                                fill: "None",
                                outlined: true,
                                radii: "300",
                                "aria-pressed": !!y,
                                after: o.jsx(Q, {
                                  size: "50",
                                  src: q.ChevronBottom
                                }),
                                onClick: j,
                                children: o.jsx(D, {
                                  size: "B300",
                                  children: qF(d)
                                })
                              }),
                              o.jsx(ln, {
                                anchor: y,
                                offset: 5,
                                position: "Bottom",
                                align: "Center",
                                content: o.jsx(Ft, {
                                  focusTrapOptions: {
                                    initialFocus: false,
                                    onDeactivate: () => w(void 0),
                                    clickOutsideDeactivates: true,
                                    isKeyForward: (S) => S.key === "ArrowDown" || S.key === "ArrowRight",
                                    isKeyBackward: (S) => S.key === "ArrowUp" || S.key === "ArrowLeft",
                                    escapeDeactivates: kt
                                  },
                                  children: o.jsx(rue, {
                                    min: i,
                                    max: i + s,
                                    value: d,
                                    onChange: u
                                  })
                                })
                              })
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Quick Schedule"
                      }),
                      o.jsxs(E, {
                        gap: "200",
                        wrap: "Wrap",
                        children: [
                          o.jsx(Qe, {
                            variant: "SurfaceVariant",
                            radii: "Pill",
                            onClick: () => k(yf(1)),
                            children: o.jsx(D, {
                              size: "B300",
                              children: "In 1 hour"
                            })
                          }),
                          o.jsx(Qe, {
                            variant: "SurfaceVariant",
                            radii: "Pill",
                            onClick: () => k(yf(4)),
                            children: o.jsx(D, {
                              size: "B300",
                              children: "In 4 hours"
                            })
                          }),
                          o.jsx(Qe, {
                            variant: "SurfaceVariant",
                            radii: "Pill",
                            onClick: () => {
                              const S = /* @__PURE__ */ new Date();
                              S.setDate(S.getDate() + 1), S.setHours(9, 0, 0, 0), u(S.getTime()), f(void 0);
                            },
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Tomorrow 9 AM"
                            })
                          }),
                          o.jsx(Qe, {
                            variant: "SurfaceVariant",
                            radii: "Pill",
                            onClick: () => {
                              const S = /* @__PURE__ */ new Date();
                              S.setDate(S.getDate() + 1), S.setHours(14, 0, 0, 0), u(S.getTime()), f(void 0);
                            },
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Tomorrow 2 PM"
                            })
                          })
                        ]
                      })
                    ]
                  }),
                  e && o.jsx(D, {
                    size: "T300",
                    priority: "400",
                    children: "Note: This message will be encrypted with current room keys. Devices that join or are added after scheduling may not be able to decrypt it."
                  }),
                  (h || x) && o.jsx(D, {
                    style: {
                      color: ct.Critical.Main
                    },
                    size: "T300",
                    children: h || "Selected time is in the past"
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    variant: "Primary",
                    "aria-disabled": x,
                    onClick: C,
                    title: "Schedule Send",
                    "aria-label": "Schedule send",
                    children: o.jsx(D, {
                      size: "B400",
                      children: "Schedule Send"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  var srt = "ScheduledMessagesList_ScheduledMessagesToggle__rl03aj0", lrt = "ScheduledMessagesList_ScheduledMessagesPanel__rl03aj1", crt = "ScheduledMessagesList_ScheduledMessageRow__rl03aj2", drt = "ScheduledMessagesList_MessagePreview__rl03aj3";
  function urt({ room: t, onEditMessage: e }) {
    const n = be(), r = Ub(), i = Ze(AS), a = Fn(Cfe(t.roomId)), [s] = Fe(ge, "hour24Clock"), [l, c] = p.useState(false), [d, u] = Fr(Efe(t.roomId)), { data: h } = ol({
      queryKey: [
        "delayedEvents",
        t.roomId
      ],
      queryFn: () => knt(n),
      refetchInterval: 3e4,
      enabled: i
    }), f = h == null ? void 0 : h.delayed_events.filter((b) => b.room_id === t.roomId && (b.type === "m.room.message" || b.type === "m.room.encrypted")), g = p.useCallback(() => {
      r.invalidateQueries({
        queryKey: [
          "delayedEvents",
          t.roomId
        ]
      });
    }, [
      r,
      t.roomId
    ]), m = p.useCallback(async (b) => {
      await ky(n, b), g();
    }, [
      n,
      g
    ]), v = p.useCallback((b, j, k, C) => {
      e && e(j, k), C && a(new Date(C)), u(b);
    }, [
      e,
      a,
      u
    ]), y = p.useCallback((b) => {
      a(b), u(null);
    }, [
      a,
      u
    ]), w = (f == null ? void 0 : f.filter((b) => b.delay_id !== d)) ?? [];
    return !i || w.length === 0 ? null : o.jsxs(E, {
      direction: "Column",
      children: [
        o.jsx(E, {
          className: srt,
          children: o.jsx(Qe, {
            variant: "SurfaceVariant",
            radii: "Pill",
            before: o.jsx(Q, {
              size: "50",
              src: q.Clock
            }),
            after: o.jsx(Q, {
              size: "50",
              src: l ? q.ChevronTop : q.ChevronBottom
            }),
            onClick: () => c(!l),
            children: o.jsxs(D, {
              size: "B300",
              children: [
                w.length,
                " scheduled ",
                w.length === 1 ? "message" : "messages"
              ]
            })
          })
        }),
        l && o.jsx(E, {
          direction: "Column",
          className: lrt,
          children: w.map((b) => {
            const j = "delay" in b ? b.running_since + b.delay : b.running_since, k = b.type === "m.room.encrypted", C = !k && typeof b.content.body == "string" ? b.content.body : "", x = !k && typeof b.content.formatted_body == "string" ? b.content.formatted_body : void 0;
            return o.jsxs(E, {
              className: crt,
              direction: "Row",
              gap: "200",
              alignItems: "Center",
              justifyContent: "SpaceBetween",
              children: [
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  grow: "Yes",
                  style: {
                    minWidth: 0
                  },
                  children: [
                    k ? o.jsxs(E, {
                      direction: "Row",
                      gap: "100",
                      alignItems: "Center",
                      children: [
                        o.jsx(Q, {
                          size: "50",
                          src: q.Lock
                        }),
                        o.jsx(D, {
                          size: "T300",
                          priority: "300",
                          children: "Encrypted \u2014 cancel and resend to edit"
                        })
                      ]
                    }) : o.jsx(D, {
                      className: drt,
                      size: "T300",
                      children: C
                    }),
                    o.jsxs(D, {
                      size: "T200",
                      priority: "300",
                      children: [
                        qF(j),
                        " at ",
                        eu(j, s)
                      ]
                    })
                  ]
                }),
                o.jsxs(E, {
                  gap: "100",
                  shrink: "No",
                  children: [
                    !k && o.jsx(Oe, {
                      size: "300",
                      variant: "SurfaceVariant",
                      radii: "300",
                      onClick: () => v(b.delay_id, C, x, j),
                      "aria-label": "Edit scheduled message",
                      children: o.jsx(Q, {
                        size: "50",
                        src: q.Pencil
                      })
                    }),
                    o.jsx(Oe, {
                      size: "300",
                      variant: "Critical",
                      radii: "300",
                      onClick: () => m(b.delay_id),
                      "aria-label": "Cancel scheduled message",
                      children: o.jsx(Q, {
                        size: "50",
                        src: q.Cross
                      })
                    })
                  ]
                })
              ]
            }, b.delay_id);
          })
        }),
        d && !e && o.jsx(Ofe, {
          onCancel: () => u(null),
          onSubmit: y
        })
      ]
    });
  }
  var hrt = "SchedulePickerDialog_SplitSendButton__9y2ke71", frt = "SchedulePickerDialog_SplitChevronButton__9y2ke72";
  const A8 = Po("msgContent"), mrt = async (t, e, n, r) => {
    var _a6;
    const i = await Dke(e, ...n);
    if (!i) throw new Error("Can not create thumbnail!");
    const a = r ? await pie(i) : void 0, s = (a == null ? void 0 : a.file) ?? i;
    if (!s) throw new Error("Can not create thumbnail!");
    const c = (_a6 = await t.uploadContent(s)) == null ? void 0 : _a6.content_uri;
    if (!c) throw new Error("Failed when uploading thumbnail!");
    return aEe({
      thumbnail: s,
      encInfo: a == null ? void 0 : a.encInfo,
      mxc: c,
      width: n[0],
      height: n[1]
    });
  }, grt = async (t, e, n) => {
    const { file: r, originalFile: i, encInfo: a, metadata: s } = e, [l, c] = await ca(oP(Zie(i)));
    l && A8.warn("Failed to load image element:", l);
    const d = {
      msgtype: Jn.Image,
      filename: r.name,
      body: r.name,
      [bk]: s.markedAsSpoiler
    };
    if (c) {
      const u = OP(c, 512, GE(c.width, 512, c.height));
      d.info = {
        ...LB(c, r),
        [$g]: u
      };
    }
    return a ? d.file = {
      ...a,
      url: n
    } : d.url = n, e.body && e.body.length > 0 && (d.body = e.body), e.formatted_body && e.formatted_body.length > 0 && (d.format = "org.matrix.custom.html", d.formatted_body = e.formatted_body), d;
  }, prt = async (t, e, n) => {
    const { file: r, originalFile: i, encInfo: a, metadata: s } = e, [l, c] = await ca(xke(bke(i)));
    l && A8.warn("Failed to load video element:", l);
    const d = {
      msgtype: Jn.Video,
      filename: r.name,
      body: r.name,
      [bk]: s.markedAsSpoiler
    };
    if (c) {
      const [u, h] = await ca(mrt(t, c, wke(c.videoWidth, c.videoHeight), !!a));
      h && h.thumbnail_info && (h.thumbnail_info[$g] = OP(c, 512, GE(c.videoWidth, 512, c.videoHeight))), u && A8.warn("Failed to generate video thumbnail:", u), d.info = {
        ...oEe(c, r),
        ...h
      };
    }
    return a ? d.file = {
      ...a,
      url: n
    } : d.url = n, e.body && e.body.length > 0 && (d.body = e.body), e.formatted_body && e.formatted_body.length > 0 && (d.format = "org.matrix.custom.html", d.formatted_body = e.formatted_body), d;
  }, Frt = (t, e) => {
    const { file: n, encInfo: r, metadata: i } = t, { waveform: a, audioDuration: s, markedAsSpoiler: l } = i, d = a !== void 0 && a.length > 0 ? "a voice message" : n.name;
    let u = {
      msgtype: Jn.Audio,
      filename: n.name,
      body: t.body && t.body.length > 0 ? t.body : d,
      info: {
        mimetype: n.type,
        size: n.size,
        duration: l || !s ? 0 : s * 1e3
      },
      "org.matrix.msc1767.audio": {
        waveform: a == null ? void 0 : a.map((h) => Math.round(h * 1024)),
        duration: l || !s ? 0 : s * 1e3
      },
      "org.matrix.msc1767.text": t.body && t.body.length > 0 ? t.body : d,
      "org.matrix.msc3245.voice.v2": {
        duration: l || !s ? 0 : s,
        waveform: a == null ? void 0 : a.map((h) => Math.round(h * 1024))
      },
      "org.matrix.msc3245.voice": {}
    };
    return r ? (u.file = {
      ...r,
      url: e
    }, u = {
      ...u,
      "org.matrix.msc1767.file": {
        name: n.name,
        mimetype: n.type,
        size: n.size,
        file: u.file
      }
    }) : (u.url = e, u = {
      ...u,
      "org.matrix.msc1767.file": {
        name: n.name,
        mimetype: n.type,
        size: n.size,
        url: u.url
      }
    }), t.body && t.body.length > 0 && (u.body = t.body), t.formatted_body && t.formatted_body.length > 0 && (u.format = "org.matrix.custom.html", u.formatted_body = t.formatted_body), u;
  }, vrt = (t, e) => {
    const { file: n, encInfo: r } = t, i = {
      msgtype: Jn.File,
      filename: n.name,
      body: n.name,
      info: {
        mimetype: n.type,
        size: n.size
      }
    };
    return r ? i.file = {
      ...r,
      url: e
    } : i.url = e, t.body && t.body.length > 0 && (i.body = t.body), t.formatted_body && t.formatted_body.length > 0 && (i.format = "org.matrix.custom.html", i.formatted_body = t.formatted_body), i;
  }, _rt = (t, e, n) => t.slice(0, e).endsWith("](") && t.slice(n).startsWith(")"), yrt = (t, e, n) => t[e - 1] === "<" && t[n] === ">", brt = (t, e) => {
    const n = t.lastIndexOf("<", e);
    return n === -1 || t.lastIndexOf(">", e) > n ? false : /^<\/?[A-Za-z][^>]*$/.test(t.slice(n, e));
  }, xrt = (t, e, n, r) => _rt(t, e, n) || lM(e, n, r) || yrt(t, e, n) || brt(t, e), qO = (t, e) => {
    const n = yoe(t, "url");
    if (n.length === 0) return [];
    const r = rS(t);
    return n.flatMap((i) => {
      const a = i.value, s = Ak(e, a);
      return !s || xrt(t, i.start, i.end, r) ? [] : [
        {
          end: i.end,
          href: a,
          label: Fke(s.section, s.focus),
          start: i.start
        }
      ];
    });
  }, wrt = (t, e) => t.some((n) => Zo.isText(n) && qO(n.text, e).length > 0), TT = (t, e) => ({
    ...t,
    text: e
  }), Drt = (t, e) => {
    const n = qO(t.text, e);
    if (n.length === 0) return [
      t
    ];
    const r = [];
    let i = 0;
    return n.forEach((a) => {
      i < a.start && r.push(TT(t, t.text.slice(i, a.start))), r.push(WPe(a.href, [
        TT(t, a.label)
      ])), i = a.end;
    }), r.length === 0 ? [
      t
    ] : (i < t.text.length && r.push(TT(t, t.text.slice(i))), r.filter((a) => !Zo.isText(a) || a.text.length > 0));
  }, Crt = (t, e) => t.flatMap((n) => Zo.isText(n) ? Drt(n, e) : [
    n
  ]), Ert = (t, e) => ({
    ...t,
    children: Crt(t.children, e)
  }), krt = (t, e) => Zo.isText(t) ? qO(t.text, e).length > 0 : t.type === Cr.Paragraph ? wrt(t.children, e) : false, Srt = (t, e) => Zo.isText(t) ? t : t.type === Cr.Paragraph ? Ert(t, e) : t, jrt = (t, e) => t.some((n) => krt(n, e)), Trt = (t, e) => t.map((n) => Srt(n, e)), JJ = [
    {
      apply: (t, e) => Trt(t, e.settingsLinkBaseUrl),
      shouldApply: (t, e) => jrt(t, e.settingsLinkBaseUrl)
    }
  ], Rrt = {
    matchOptions: {
      contain: true
    }
  };
  function Art({ room: t, editor: e, query: n, requestClose: r }) {
    const i = be(), a = ov(i, t), s = p.useMemo(() => Object.keys(a), [
      a
    ]), [l, c, d] = tc(s, p.useCallback((f) => f, []), Rrt), u = l ? l.items : s;
    p.useEffect(() => {
      n.text ? c(n.text) : d();
    }, [
      n.text,
      c,
      d
    ]);
    const h = (f) => {
      const g = qPe(f);
      g3(e, n.range, g), Gl(e, true), r();
    };
    return Ld(window, (f) => {
      zd(f, () => {
        if (u.length === 0) return;
        const g = u[0];
        h(g);
      });
    }), u.length === 0 ? null : o.jsx(nS, {
      headerContent: o.jsx(E, {
        grow: "Yes",
        direction: "Row",
        gap: "200",
        justifyContent: "SpaceBetween",
        children: o.jsx(D, {
          size: "L400",
          children: "Commands"
        })
      }),
      requestClose: r,
      editor: e,
      children: u.map((f) => o.jsx(Ye, {
        as: "button",
        radii: "300",
        style: {
          height: "unset"
        },
        onKeyDown: (g) => zd(g, () => h(f)),
        onClick: () => h(f),
        children: o.jsxs(E, {
          style: {
            padding: `${ee.space.S300} 0`
          },
          grow: "Yes",
          direction: "Column",
          gap: "100",
          justifyContent: "SpaceBetween",
          children: [
            o.jsx(D, {
              style: {
                flexGrow: 1
              },
              size: "B400",
              truncate: true,
              children: `/${f}`
            }),
            o.jsx(D, {
              truncate: true,
              priority: "300",
              size: "T200",
              children: a[f].description
            })
          ]
        })
      }, f))
    });
  }
  const iD = 40, oD = 100;
  let aD = null;
  function Irt() {
    return (!aD || aD.state === "closed") && (aD = new AudioContext()), aD;
  }
  function sD(t, e) {
    if (t.length === 0) return Array.from({
      length: e
    }, () => 0.15);
    if (t.length <= e) {
      const r = (t.length - 1) / (e - 1);
      return Array.from({
        length: e
      }, (i, a) => {
        const s = a * r, l = Math.floor(s), c = Math.min(Math.ceil(s), t.length - 1), d = s - l;
        return l === c ? t[l] ?? 0.15 : (t[l] ?? 0.15) * (1 - d) + (t[c] ?? 0.15) * d;
      });
    }
    const n = t.length / e;
    return Array.from({
      length: e
    }, (r, i) => {
      const a = Math.floor(i * n), s = Math.floor((i + 1) * n), l = t.slice(a, s);
      return l.length > 0 ? Math.max(...l) : 0.15;
    });
  }
  function Brt(t = {}) {
    const { autoStart: e = true, onStop: n, onDelete: r } = t, i = jT(), [a, s] = p.useState(false), [l, c] = p.useState(false), [d, u] = p.useState(false), [h, f] = p.useState(false), [g, m] = p.useState(false), [v, y] = p.useState(0), [w, b] = p.useState(() => Array.from({
      length: iD
    }, () => 0.15)), [j, k] = p.useState(null), [C, x] = p.useState(null), [S, T] = p.useState(null), [A, B] = p.useState(null), U = p.useRef(null), z = p.useRef([]), O = p.useRef(null), M = p.useRef(null), I = p.useRef(null), N = p.useRef(null), L = p.useRef(null), H = p.useRef(null), V = p.useRef(null), Z = p.useRef(null), Y = p.useRef(null), oe = p.useRef(0), ue = p.useRef(null), ie = p.useRef(null), de = p.useRef(0), ne = p.useRef(0), ae = p.useRef(null), X = p.useRef(null), K = p.useRef([]), G = p.useRef(false), le = p.useRef(false), te = p.useRef(false), re = p.useRef(null), he = p.useRef([]), se = p.useRef(false), ye = p.useCallback(() => {
      O.current && (O.current.getTracks().forEach(($e) => $e.stop()), O.current = null);
    }, []), we = p.useCallback(() => {
      const $e = U.current;
      U.current = null, $e && ($e.ondataavailable = null, $e.onstop = null);
    }, []), Ee = p.useCallback(() => {
      const $e = M.current, Tt = I.current, zt = N.current, Vt = L.current, bn = H.current;
      if (Y.current !== null && (cancelAnimationFrame(Y.current), Y.current = null), oe.current = 0, M.current = null, I.current = null, N.current = null, L.current = null, H.current = null, V.current = null, Z.current = null, bn == null ? void 0 : bn.getTracks().forEach((Zn) => Zn.stop()), Tt == null ? void 0 : Tt.disconnect(), zt == null ? void 0 : zt.disconnect(), Vt == null ? void 0 : Vt.disconnect(), !!$e) {
        if (bn) {
          $e.state !== "closed" && $e.close().catch(() => {
          });
          return;
        }
        $e.state !== "closed" && $e.suspend().catch(() => {
        });
      }
    }, []), ke = p.useCallback(() => {
      ue.current !== null && (window.clearInterval(ue.current), ue.current = null);
    }, []), Ne = p.useCallback(() => {
      ie.current = Date.now() - de.current * 1e3, ke(), ue.current = window.setInterval(() => {
        if (ie.current === null) return;
        const $e = Date.now() - ie.current;
        y(Math.floor($e / 1e3));
      }, 1e3);
    }, [
      ke
    ]), lt = p.useCallback(($e) => {
      y(0), ke(), ue.current = window.setInterval(() => {
        y(Math.floor($e.currentTime));
      }, 250);
    }, [
      ke
    ]);
    p.useEffect(() => {
      ne.current = v;
    }, [
      v
    ]);
    const Rt = p.useCallback(() => {
      if (ie.current === null) return ne.current;
      const $e = Math.floor((Date.now() - ie.current) / 1e3);
      return Math.max(ne.current, $e);
    }, []), We = p.useCallback(($e, Tt, zt, Vt) => {
      if (!n) return;
      const bn = {
        audioFile: $e,
        audioUrl: Tt,
        waveform: zt,
        audioLength: Vt,
        audioCodec: $e.type
      };
      n(bn);
    }, [
      n
    ]), yt = p.useCallback(() => {
      const $e = V.current, Tt = Z.current;
      if (!$e || !Tt) return;
      const zt = new Uint8Array(Tt), Vt = () => {
        $e.getByteFrequencyData(zt);
        const bn = zt.length;
        let Zn = 0;
        for (let Ut = 0; Ut < bn; Ut += 1) Zn += zt[Ut] ?? 0;
        let Ce = Zn / bn / 255 * 3.5;
        const Dt = 0.05;
        Ce < Dt && (Ce = Dt), Ce > 1 && (Ce = 1), oe.current += 1, oe.current >= 5 && (b((Ut) => {
          const Zt = Ut.slice(1);
          return Zt.push(Ce), Zt;
        }), se.current && he.current.push(Ce), oe.current = 0), Y.current = requestAnimationFrame(Vt);
      };
      Vt();
    }, []), Xt = p.useCallback(($e) => {
      const Tt = new AudioContext();
      M.current = Tt;
      const zt = Tt.createMediaStreamSource($e), Vt = Tt.createAnalyser();
      Vt.fftSize = 512, Vt.smoothingTimeConstant = 0.6;
      const bn = Vt.frequencyBinCount, Zn = new Uint8Array(bn);
      I.current = zt, N.current = Vt, V.current = Vt, Z.current = Zn;
      const Kn = Tt.createMediaStreamDestination();
      return L.current = Kn, H.current = Kn.stream, zt.connect(Vt), Vt.connect(Kn), Tt.state === "suspended" && Tt.resume().catch(() => {
      }), yt(), Kn.stream;
    }, [
      yt
    ]), nn = p.useCallback(($e) => {
      const Tt = Irt();
      M.current = Tt;
      const zt = Tt.createMediaElementSource($e), Vt = Tt.createAnalyser();
      Vt.fftSize = 512, Vt.smoothingTimeConstant = 0.6;
      const bn = Vt.frequencyBinCount, Zn = new Uint8Array(bn);
      V.current = Vt, Z.current = Zn, zt.connect(Vt), Vt.connect(Tt.destination), Tt.state === "suspended" && Tt.resume().catch(() => {
      }), yt();
    }, [
      yt
    ]), bt = p.useCallback(async () => {
      if (!(typeof window > "u")) {
        if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
          k("Browser does not support audio recording.");
          return;
        }
        k(null), G.current = false;
        try {
          const $e = await navigator.mediaDevices.getUserMedia({
            audio: true
          }), Tt = jT();
          if (!Tt) {
            k("No supported audio codec found for recording."), ye();
            return;
          }
          O.current = $e, z.current = [], K.current = [], he.current = [], se.current = true;
          const zt = Xt($e);
          Ne();
          const Vt = new MediaRecorder(zt, {
            mimeType: Tt
          });
          U.current = Vt, Vt.ondataavailable = (bn) => {
            bn.data && bn.data.size > 0 && z.current.push(bn.data);
          }, Vt.onstop = () => {
            var _a6;
            Ee(), ye(), we(), ke(), s(false), m(false);
            const bn = Rt();
            if (de.current = 0, ie.current = null, se.current = false, G.current) {
              G.current = false;
              return;
            }
            if (le.current) {
              le.current = false;
              return;
            }
            if (z.current.length === 0) {
              te.current ? (u(true), c(true), te.current = false) : (c(true), u(false));
              return;
            }
            const Zn = ((_a6 = z.current[0]) == null ? void 0 : _a6.type) || Tt || "audio/webm", Kn = new Blob(z.current, {
              type: Zn
            });
            ae.current && URL.revokeObjectURL(ae.current);
            const Ce = URL.createObjectURL(Kn);
            ae.current = Ce, x(Ce);
            const Dt = new File([
              Kn
            ], `voice-${Date.now()}.${R8(Zn)}`, {
              type: Zn
            });
            T(Dt);
            const Ut = sD(he.current, oD);
            B(Ut), te.current ? (u(true), c(true), te.current = false) : (c(true), u(false), We(Dt, Ce, Ut, bn));
          }, Vt.start(1e3), s(true), m(false), c(false), de.current = 0;
        } catch {
          k("Microphone access denied or an error occurred."), Ee(), ye(), we(), ke(), s(false);
        }
      }
    }, [
      Ee,
      we,
      ye,
      We,
      Rt,
      Xt,
      Ne,
      ke
    ]), At = p.useCallback(() => {
      bt();
    }, [
      bt
    ]), $t = p.useCallback(() => {
      const $e = U.current;
      if (!(!$e || $e.state !== "recording")) try {
        $e.requestData(), $e.pause(), ke(), de.current = v, m(true), Y.current !== null && (cancelAnimationFrame(Y.current), Y.current = null), M.current && M.current.state !== "closed" && M.current.suspend().catch(() => {
        }), b(Array.from({
          length: iD
        }, () => 0.15));
      } catch {
        k("Error pausing recording");
      }
    }, [
      v,
      ke
    ]), Lt = p.useCallback(() => {
      const $e = U.current;
      if ($e && $e.state !== "inactive") {
        if (K.current = [
          ...z.current
        ], te.current = false, $e.state === "recording") try {
          $e.requestData();
        } catch {
        }
        try {
          $e.stop();
        } catch {
        }
        c(true), u(false), m(false), de.current = 0;
      } else {
        if (C && S) {
          const Tt = A ?? sD(he.current, oD);
          We(S, C, Tt, ne.current);
        }
        Ee(), ye(), we(), ke(), s(false), c(true), u(false), m(false), de.current = 0, ie.current = null;
      }
    }, [
      S,
      C,
      Ee,
      we,
      ye,
      We,
      ke,
      A
    ]), wt = p.useCallback(() => {
      const $e = U.current;
      if ($e && $e.state !== "inactive") {
        if (K.current = [
          ...z.current
        ], te.current = false, $e.state === "recording") try {
          $e.requestData();
        } catch {
        }
        try {
          $e.stop();
        } catch {
        }
        c(true), u(false), m(false), de.current = 0;
      } else {
        if (C && S) {
          const Tt = A ?? sD(he.current, oD);
          We(S, C, Tt, ne.current);
        }
        Ee(), ye(), we(), ke(), s(false), c(true), u(false), m(false), de.current = 0, ie.current = null;
      }
    }, [
      S,
      C,
      Ee,
      we,
      ye,
      We,
      ke,
      A
    ]), st = p.useCallback(() => {
      var _a6;
      let $e = C;
      if (!$e && g) {
        re.current && URL.revokeObjectURL(re.current);
        const zt = z.current.length > 0 ? z.current : K.current;
        if (zt.length > 0) {
          const Vt = ((_a6 = zt[0]) == null ? void 0 : _a6.type) || i || "audio/webm", bn = new Blob(zt, {
            type: Vt
          });
          $e = URL.createObjectURL(bn), re.current = $e;
        }
      }
      if (!$e) return;
      if (re.current && re.current !== $e && (URL.revokeObjectURL(re.current), re.current = null), !X.current || X.current.src !== $e) {
        X.current && (X.current.pause(), X.current = null);
        const zt = new Audio($e);
        X.current = zt;
        const Vt = () => {
          f(false), ke(), Ee(), zt.currentTime = 0, y(de.current);
        }, bn = () => {
          f(false), ke(), Ee();
        }, Zn = () => {
          f(true), Ee(), nn(zt), lt(zt);
        };
        zt.addEventListener("ended", Vt), zt.addEventListener("pause", bn), zt.addEventListener("play", Zn);
      }
      const Tt = X.current;
      Tt && (h ? Tt.pause() : ((Tt.ended || Tt.duration && Tt.currentTime >= Tt.duration - 0.01) && (Tt.currentTime = 0, y(0)), Tt.play().catch(() => {
      })));
    }, [
      C,
      g,
      h,
      i,
      ke,
      Ee,
      nn,
      lt
    ]), Be = p.useCallback(() => {
      if (!C) return;
      if (!X.current) {
        const Tt = new Audio(C);
        X.current = Tt;
        const zt = () => {
          f(false), ke(), Ee(), Tt.currentTime = 0, y(0);
        }, Vt = () => {
          f(false), ke(), Ee();
        }, bn = () => {
          f(true), Ee(), nn(Tt), lt(Tt);
        };
        Tt.addEventListener("ended", zt), Tt.addEventListener("pause", Vt), Tt.addEventListener("play", bn);
      }
      const $e = X.current;
      $e && (h ? $e.pause() : (($e.ended || $e.duration && $e.currentTime >= $e.duration - 0.01) && ($e.currentTime = 0, y(0)), $e.play().catch(() => {
      })));
    }, [
      C,
      Ee,
      h,
      nn,
      lt,
      ke
    ]), Re = p.useCallback(async () => {
      if (!(typeof window > "u")) {
        if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
          k("Browser does not support audio recording.");
          return;
        }
        k(null), G.current = true;
        try {
          const $e = await navigator.mediaDevices.getUserMedia({
            audio: true
          });
          O.current = $e;
          const Tt = Xt($e);
          y(de.current), Ne();
          const zt = jT() || i, Vt = zt ? new MediaRecorder(Tt, {
            mimeType: zt
          }) : new MediaRecorder(Tt);
          U.current = Vt, Vt.ondataavailable = (bn) => {
            bn.data && bn.data.size > 0 && z.current.push(bn.data);
          }, Vt.onstop = () => {
            var _a6;
            Ee(), ye(), we(), ke(), s(false), m(false);
            const bn = Rt();
            if (de.current = 0, ie.current = null, se.current = false, z.current.length === 0) {
              c(true);
              return;
            }
            const Zn = ((_a6 = z.current[0]) == null ? void 0 : _a6.type) || i || "audio/webm", Kn = new Blob(z.current, {
              type: Zn
            });
            ae.current && URL.revokeObjectURL(ae.current);
            const Ce = URL.createObjectURL(Kn);
            ae.current = Ce, x(Ce);
            const Dt = new File([
              Kn
            ], `voice-${Date.now()}.${R8(Kn.type)}`, {
              type: Kn.type
            });
            T(Dt);
            const Ut = sD(he.current, oD);
            B(Ut), We(Dt, Ce, Ut, bn);
          }, Vt.start(1e3), s(true), m(false), c(false), u(false), f(false), se.current = true, X.current && (X.current.pause(), X.current = null), re.current && (URL.revokeObjectURL(re.current), re.current = null), ie.current = Date.now() - de.current * 1e3;
        } catch {
          k("Microphone access denied or an error occurred."), Ee(), ye(), we(), ke(), s(false), G.current = false;
        }
      }
    }, [
      i,
      Ee,
      we,
      ye,
      We,
      Rt,
      Xt,
      Ne,
      ke
    ]), Ue = p.useCallback(() => {
      const $e = U.current;
      $e && $e.state !== "inactive" && $e.stop(), X.current && (X.current.pause(), X.current = null), Ee(), ye(), we(), ke(), f(false), c(true), s(false), m(false), y(0), de.current = 0, ie.current = null, b(Array.from({
        length: iD
      }, () => 0.15)), K.current = [], z.current = [], he.current = [], se.current = false, B(null), re.current && (URL.revokeObjectURL(re.current), re.current = null), r && r();
    }, [
      Ee,
      we,
      ye,
      r,
      ke
    ]), qe = p.useCallback(() => {
      le.current = true;
      const $e = U.current;
      $e && $e.state !== "inactive" && $e.stop(), X.current && (X.current.pause(), X.current = null), Ee(), ye(), we(), ke(), s(false), c(false), u(false), m(false), f(false), y(0), de.current = 0, ie.current = null, b(Array.from({
        length: iD
      }, () => 0.15)), K.current = [], z.current = [], G.current = false, he.current = [], se.current = false, B(null), ae.current && (URL.revokeObjectURL(ae.current), ae.current = null), re.current && (URL.revokeObjectURL(re.current), re.current = null), x(null), T(null), bt();
    }, [
      Ee,
      we,
      ye,
      bt,
      ke
    ]);
    p.useEffect(() => (e && bt(), () => {
      const $e = U.current;
      $e && $e.state !== "inactive" ? $e.stop() : we(), Ee(), ye(), ke(), X.current && (X.current.pause(), X.current = null), ae.current && (URL.revokeObjectURL(ae.current), ae.current = null), re.current && (URL.revokeObjectURL(re.current), re.current = null);
    }), [
      e,
      Ee,
      we,
      ye,
      bt,
      ke
    ]);
    const tt = () => h ? "playing" : l && !d && C ? "reviewing" : a && g ? "paused" : a ? "recording" : "idle", ht = p.useCallback(() => {
      qe();
    }, [
      qe
    ]);
    return {
      state: tt(),
      isRecording: a,
      isStopped: l,
      isTemporaryStopped: d,
      isPlaying: h,
      isPaused: g,
      seconds: v,
      levels: w,
      error: j,
      audioUrl: C,
      audioFile: S,
      waveform: A,
      start: At,
      handlePause: $t,
      handleStopTemporary: Lt,
      handleStop: wt,
      handleResume: Re,
      handlePreviewPlay: st,
      handlePlay: Be,
      handleRestart: qe,
      handleDelete: Ue,
      handleRecordAgain: ht
    };
  }
  var Prt = "AudioMessageRecorder_Container__wrjf7y3 _1mqalmd1 _1mqalmd0", Mrt = "AudioMessageRecorder_ContainerCanceling__wrjf7y4", Ort = "AudioMessageRecorder_RecDot__wrjf7y6 _1mqalmd1 _1mqalmd0", Lrt = "AudioMessageRecorder_WaveformContainer__wrjf7y7 _1mqalmd1 _1mqalmd0", Nrt = "AudioMessageRecorder_WaveformBar__wrjf7y8 _1mqalmd1 _1mqalmd0", zrt = "AudioMessageRecorder_Timer__wrjf7y9 _1mqalmd1 _1mqalmd0", Urt = "AudioMessageRecorder_SrOnly__wrjf7yc _1mqalmd1 _1mqalmd0";
  function XJ(t) {
    const e = Math.floor(t / 60), n = t % 60;
    return `${e}:${n.toString().padStart(2, "0")}`;
  }
  const QJ = 28, Vrt = 8, Hrt = 2, eX = 4, $rt = 72, Wrt = p.forwardRef(({ onRecordingComplete: t, onRequestClose: e, onWaveformUpdate: n, onAudioLengthUpdate: r }, i) => {
    const a = p.useRef(false), s = p.useRef(false), l = p.useRef(null), [c, d] = p.useState(false), [u, h] = p.useState(0), [f, g] = p.useState(QJ), m = p.useRef(t);
    m.current = t;
    const v = p.useRef(e);
    v.current = e;
    const y = p.useRef(n);
    y.current = n;
    const w = p.useRef(r);
    w.current = r;
    const b = p.useCallback((M) => {
      s.current && (a.current || (m.current({
        audioBlob: M.audioFile,
        waveform: M.waveform,
        audioLength: M.audioLength,
        audioCodec: M.audioCodec
      }), y.current(M.waveform), w.current(M.audioLength)));
    }, []), j = p.useCallback(() => {
      a.current = true, v.current();
    }, []), { levels: k, seconds: C, error: x, handleStop: S, handleDelete: T } = Brt({
      autoStart: true,
      onStop: b,
      onDelete: j
    }), A = p.useCallback(() => {
      a.current || (s.current = true, S());
    }, [
      S
    ]), B = p.useCallback(() => {
      a.current || (d(true), setTimeout(() => {
        a.current = true, T();
      }, 180));
    }, [
      T
    ]);
    p.useImperativeHandle(i, () => ({
      stop: A,
      cancel: B
    }), [
      A,
      B
    ]), p.useEffect(() => {
      C > 0 && C % 30 === 0 && C !== u && h(C);
    }, [
      C,
      u
    ]), gp(p.useCallback(() => l.current, []), p.useCallback((M) => {
      const I = Math.max(0, M - $rt), N = Math.max(Vrt, Math.min(QJ, Math.floor((I + eX) / (Hrt + eX))));
      g((L) => L === N ? L : N);
    }, []));
    const U = p.useMemo(() => {
      if (k.length === 0) return Array(f).fill(0.15);
      if (k.length <= f) {
        const I = (k.length - 1) / (f - 1);
        return Array.from({
          length: f
        }, (N, L) => {
          const H = L * I, V = Math.floor(H), Z = Math.min(Math.ceil(H), k.length - 1), Y = H - V;
          return V === Z ? k[V] ?? 0.15 : (k[V] ?? 0.15) * (1 - Y) + (k[Z] ?? 0.15) * Y;
        });
      }
      const M = k.length / f;
      return Array.from({
        length: f
      }, (I, N) => {
        const L = Math.floor(N * M), H = Math.floor((N + 1) * M), V = k.slice(L, H);
        return V.length > 0 ? Math.max(...V) : 0.15;
      });
    }, [
      f,
      k
    ]), z = p.useMemo(() => U.map((M, I) => ({
      id: `recording-waveform-bar-${I}`,
      level: M
    })), [
      U
    ]), O = [
      Prt,
      c ? Mrt : null
    ].filter(Boolean).join(" ");
    return o.jsxs(o.Fragment, {
      children: [
        x && o.jsx(D, {
          size: "T200",
          style: {
            color: "var(--color-critical-main)"
          },
          children: x
        }),
        o.jsxs(E, {
          ref: l,
          alignItems: "Center",
          gap: "200",
          className: O,
          children: [
            o.jsx("div", {
              "aria-hidden": true,
              className: Ort
            }),
            o.jsx(E, {
              grow: "Yes",
              alignItems: "Center",
              justifyContent: "SpaceBetween",
              className: Lrt,
              children: z.map((M) => o.jsx("div", {
                className: Nrt,
                style: {
                  height: Math.max(3, Math.round(M.level * 20))
                }
              }, M.id))
            }),
            o.jsx(D, {
              size: "T200",
              className: zrt,
              "aria-live": "polite",
              "aria-atomic": "true",
              children: XJ(C)
            }),
            u > 0 && u === C && o.jsxs("span", {
              className: Urt,
              "aria-live": "polite",
              children: [
                "Recording duration: ",
                XJ(u)
              ]
            })
          ]
        })
      ]
    });
  }), qrt = (t, e) => {
    var _a6;
    const i = (((_a6 = t.getThread(e)) == null ? void 0 : _a6.events) ?? []).filter((s) => s.getId() !== e && !is(s) && Da(s, e));
    if (i.length > 0) return i[i.length - 1].getId() ?? e;
    const a = t.getUnfilteredTimelineSet().getLiveTimeline().getEvents().filter((s) => s.getId() !== e && !is(s) && Da(s, e));
    return a.length > 0 ? a.at(-1).getId() ?? e : e;
  }, RT = (t, e) => {
    var _a6;
    if (!t) return {};
    const n = {};
    if (((_a6 = t.relation) == null ? void 0 : _a6.rel_type) === Xn.Thread) if (n.event_id = t.relation.event_id, n.rel_type = Xn.Thread, t.body) n["m.in_reply_to"] = {
      event_id: t.eventId
    }, n.is_falling_back = false;
    else {
      const r = t.relation.event_id ?? t.eventId, i = e ? qrt(e, r) : r;
      n["m.in_reply_to"] = {
        event_id: i
      }, n.is_falling_back = true;
    }
    else n["m.in_reply_to"] = {
      event_id: t.eventId
    };
    return n;
  }, lD = Po("RoomInput"), fd = fo("RoomInput"), Krt = () => {
    var _a6, _b3;
    return ((_b3 = (_a6 = globalThis.crypto).randomUUID) == null ? void 0 : _b3.call(_a6)) ?? `${Date.now()}-${Math.random().toString(16).slice(2)}`;
  }, Lfe = p.forwardRef(({ editor: t, fileDropContainerRef: e, roomId: n, room: r, threadRootId: i, onEditLastMessage: a }, s) => {
    var _a6;
    const l = i ?? n, c = be(), d = hn(), [u] = Fe(ge, "enterForNewline"), [h] = Fe(ge, "hideActivity"), [f] = Fe(ge, "mentionInReplies"), g = gs(), m = ov(c, r), v = p.useRef(new fie()), y = p.useMemo(() => new S8(c, r), [
      c,
      r
    ]), w = p.useMemo(() => new art(c), [
      c
    ]);
    p.useEffect(() => {
      w.init();
    }, [
      w
    ]);
    const [b] = Fe(ge, "pkCompat"), [j] = Fe(ge, "pmpProxying"), k = p.useRef(null), C = p.useRef(null), x = p.useRef(/* @__PURE__ */ new WeakMap()), S = Ze(vi), T = Ze(qr), A = Qd(), B = ri(r), z = Ki(B, A).event(ce.Reaction, c.getSafeUserId()), [O, M] = Fr(XNe(l)), [I, N] = Fr(mF(l)), [L, H] = p.useState(true), [V, Z] = Fr(ZNe(l)), Y = $ke(BI, V.map((Ke) => Ke.file)), oe = p.useRef(), ue = p.useRef(null), ie = p.useRef(false), de = IS(n, S), [ne, ae] = p.useState(false), X = p.useRef(null), K = p.useRef(0), G = 400, [le, te] = p.useState(), [re, he] = p.useState(false), se = Ant(c, n, {
      disabled: !!i
    }), [ye, we] = p.useState(0), Ee = p.useCallback((Ke) => {
      const it = x.current.get(Ke.originalFile);
      if (it) return it;
      const It = Krt();
      return x.current.set(Ke.originalFile, It), It;
    }, []), ke = p.useCallback(async (Ke, it) => {
      H(true);
      const It = Ke.map($Te), Pt = [];
      r.hasEncryptionStateEvent() ? _R(await Promise.allSettled(It.map((Mn) => pie(Mn)))).forEach((Mn) => Pt.push({
        ...Mn,
        metadata: {
          markedAsSpoiler: false,
          waveform: it == null ? void 0 : it.waveform,
          audioDuration: it == null ? void 0 : it.audioDuration
        }
      })) : It.forEach((Sn) => Pt.push({
        file: Sn,
        originalFile: Sn,
        encInfo: void 0,
        metadata: {
          markedAsSpoiler: false,
          waveform: it == null ? void 0 : it.waveform,
          audioDuration: it == null ? void 0 : it.audioDuration
        }
      })), Z({
        type: "PUT",
        item: Pt
      });
    }, [
      Z,
      r
    ]), Ne = ed(ke, true), lt = Int(ke), Rt = Bnt(e, ke), [We, yt] = p.useState(document.body.clientWidth < 500), Xt = Tte(), nn = Ub(), bt = Ze(AS), [At, $t] = Fr(Cfe(n)), [Lt, wt] = Fr(Efe(n)), [st, Be] = p.useState(), [Re, Ue] = p.useState(false), [qe, tt] = p.useState(!f), [ht] = Fe(ge, "hour24Clock"), $e = Fn(kfe), [Tt, zt] = p.useState(), Vt = r.hasEncryptionStateEvent();
    gp(p.useCallback(() => e.current, [
      e
    ]), p.useCallback((Ke) => yt(Ke < 500), []));
    const bn = I ? r.findEventById(I.eventId) : void 0;
    p.useEffect(() => {
      i && N((Ke) => {
        var _a7;
        return ((_a7 = Ke == null ? void 0 : Ke.relation) == null ? void 0 : _a7.rel_type) === Xn.Thread && Ke.relation.event_id === i ? Ke : {
          userId: c.getUserId() ?? "",
          eventId: i,
          body: "",
          relation: {
            rel_type: Xn.Thread,
            event_id: i
          }
        };
      });
    }, [
      i,
      N,
      c
    ]), p.useEffect(() => {
      xt.insertFragment(t, O);
    }, [
      t,
      O
    ]), p.useEffect(() => () => {
      if (XD(t)) M([]);
      else {
        const Ke = structuredClone(t.children);
        M(Ke);
      }
      M0(t), Bw(t);
    }, [
      l,
      t,
      M
    ]), p.useEffect(() => {
      I !== void 0 && tt(I.userId === c.getUserId() || !f);
    }, [
      f,
      c,
      I
    ]);
    const Zn = p.useRef(I == null ? void 0 : I.eventId);
    p.useEffect(() => {
      (I == null ? void 0 : I.eventId) !== Zn.current && (Zn.current = I == null ? void 0 : I.eventId, (I == null ? void 0 : I.eventId) && requestAnimationFrame(() => {
        try {
          Bt.focus(t), Gl(t);
        } catch {
        }
      }));
    }, [
      I == null ? void 0 : I.eventId,
      t
    ]);
    const Kn = p.useCallback((Ke, it) => {
      Z({
        type: "REPLACE",
        item: Ke,
        replacement: {
          ...Ke,
          metadata: it
        }
      });
    }, [
      Z
    ]), Ce = p.useCallback((Ke, it, It) => {
      Z({
        type: "REPLACE",
        item: Ke,
        replacement: {
          ...Ke,
          body: it,
          formatted_body: It
        }
      });
    }, [
      Z
    ]), Dt = p.useCallback((Ke) => {
      const it = Array.isArray(Ke) ? Ke : [
        Ke
      ];
      Z({
        type: "DELETE",
        item: V.filter((It) => it.find((Pt) => Pt === It.file))
      }), it.forEach((It) => BI.remove(It));
    }, [
      Z,
      V
    ]), Ut = p.useCallback((Ke) => {
      const it = R8(Ke.audioCodec), It = new File([
        Ke.audioBlob
      ], `sable-audio-message-${Date.now()}.${it}`, {
        type: Ke.audioCodec
      });
      ke([
        It
      ], {
        waveform: Ke.waveform,
        audioDuration: Ke.audioLength
      }), ae(false);
    }, [
      ke
    ]), Zt = ne ? o.jsx(Wrt, {
      ref: X,
      onRequestClose: () => ae(false),
      onRecordingComplete: Ut,
      onAudioLengthUpdate: () => {
      },
      onWaveformUpdate: () => {
      }
    }) : void 0, ut = (Ke) => {
      Ke.forEach((it) => {
        it.status === Xi.Loading && c.cancelUpload(it.promise);
      }), Dt(Ke.map((it) => it.file));
    }, De = async (Ke) => {
      const it = Hl(t.children).trim(), It = Ke.map(async (on) => {
        const vt = V.find((je) => je.file === on.file);
        if (!vt) throw new Error("Broken upload");
        return vt.file.type.startsWith("image") ? grt(c, vt, on.mxc) : vt.file.type.startsWith("video") ? prt(c, vt, on.mxc) : vt.file.type.startsWith("audio") ? Frt(vt, on.mxc) : vrt(vt, on.mxc);
      });
      ut(Ke);
      const Pt = _R(await Promise.allSettled(It)), Sn = await H5(c, n);
      if (Sn && Pt.forEach((on) => {
        on[Vy] = V5(Sn, false);
      }), Pt.length > 0) {
        const on = (it == null ? void 0 : it.length) === 0 ? RT(I, r) : void 0;
        on && (Pt[0]["m.relates_to"] = on), N(i ? {
          userId: c.getUserId() ?? "",
          eventId: i,
          body: "",
          relation: {
            rel_type: Xn.Thread,
            event_id: i
          }
        } : void 0);
      }
      const Mn = () => nn.invalidateQueries({
        queryKey: [
          "delayedEvents",
          n
        ]
      });
      if (At) try {
        const on = VJ(At);
        Lt && await ky(c, Lt), await Promise.all(Pt.map((vt) => Vt ? UJ(c, n, r, vt, on) : zJ(c, n, vt, on))), Mn(), wt(null), $t(null);
      } catch (on) {
        throw fd.error("message", "Failed to schedule uploaded file message", {
          roomId: n,
          error: on instanceof Error ? on.message : String(on)
        }), lD.error("failed to schedule uploaded message", {
          roomId: n
        }, on), on;
      }
      else {
        if (Lt) try {
          await ky(c, Lt), Mn(), wt(null);
        } catch {
          fd.error("message", "Failed to cancel scheduled event before immediate file send", {
            roomId: n
          });
        }
        await Promise.all(Pt.map((on) => c.sendMessage(n, i ?? null, on).then((vt) => (fd.info("message", "Uploaded file message sent", {
          roomId: n,
          eventId: vt.event_id,
          msgtype: on.msgtype
        }), vt)).catch((vt) => {
          throw fd.error("message", "Failed to send uploaded file message", {
            roomId: n,
            error: vt instanceof Error ? vt.message : String(vt)
          }), lD.error("failed to send uploaded message", {
            roomId: n
          }, vt), vt;
        })));
      }
    }, Ae = p.useCallback(() => {
      te(void 0), Bt.focus(t);
    }, [
      t
    ]), Ge = p.useCallback((Ke, it) => {
      var _a7;
      if (Ke.length > 0) {
        const Pt = (_a7 = r.getLiveTimeline().getEvents().findLast((Sn) => [
          ce.RoomMessage,
          ce.RoomMessageEncrypted,
          ce.Sticker
        ].includes(Sn.getType()))) == null ? void 0 : _a7.getId();
        Pt && VB(c, r, Pt, Ke, it);
      }
      M0(t), Bw(t), se(false), Ae();
    }, [
      t,
      Ae,
      c,
      r,
      se
    ]), ot = p.useCallback(async () => {
      var _a7, _b3, _c3, _d4, _e13;
      (_a7 = oe.current) == null ? void 0 : _a7.handleSend();
      const Ke = mle(t), it = /* @__PURE__ */ new Map();
      if (bn) {
        const pn = bn.getSender();
        if (pn) {
          const nt = T[pn];
          typeof nt == "string" && nt.length > 0 && it.set(new RegExp(`@?${nt}`, "g"), ((_b3 = r.getMember(pn)) == null ? void 0 : _b3.rawDisplayName) ?? pn);
        }
      }
      const It = II(c, n, t);
      (It == null ? void 0 : It.users) && It.users.forEach((pn) => {
        var _a8;
        const nt = T[pn];
        typeof nt == "string" && nt.length > 0 && it.set(new RegExp(`@?${nt}`, "g"), ((_a8 = r.getMember(pn)) == null ? void 0 : _a8.rawDisplayName) ?? pn);
      });
      let Pt = t.children;
      if (Ke) {
        const pn = Pt[0];
        pn && "type" in pn && pn.type === Cr.Paragraph && pn.children.length >= 2 && (Pt = [
          {
            ...pn,
            children: pn.children.slice(2)
          },
          ...Pt.slice(1)
        ]);
      }
      const Sn = {
        isMarkdown: true,
        settingsLinkBaseUrl: g
      };
      JJ.forEach((pn) => {
        pn.shouldApply(Pt, Sn) && (Pt = pn.apply(Pt, Sn));
      });
      let Mn = Hl(Pt, true, it).trim(), on = _b(lp(Pt, {
        stripNickname: true,
        nickNameReplacement: it,
        forEmote: Ke === Na.Me,
        room: r
      })), vt = Jn.Text;
      if (z && Mn.startsWith("+#")) {
        Ge(Mn.substring(2));
        return;
      }
      if (b && S8.isPKCommand(Mn)) {
        await y.handleMessage(Mn), M0(t);
        return;
      }
      if (Ke && (Mn = mY(Ke, Mn), on = mY(Ke, on)), Ke === Na.Me) vt = Jn.Emote;
      else if (Ke === Na.Notice) vt = Jn.Notice;
      else if (Ke === Na.Shrug) Mn = `${YJ} ${Mn}`, on = `${YJ} ${on}`;
      else if (Ke === Na.TableFlip) Mn = `${j8} ${Mn}`, on = `${j8} ${on}`;
      else if (Ke === Na.UnFlip) Mn = `${T8} ${Mn}`, on = `${T8} ${on}`;
      else if (Ke) {
        const pn = m[Ke];
        pn && pn.exe(Mn, on), M0(t), Bw(t), se(false);
        return;
      }
      if (Mn === "") return;
      let je;
      if (j && (je = await w.getPmpBasedOnMessage(Mn), je)) {
        const pn = w.stripProxyFromMessage(Mn);
        pn !== void 0 && (Pt = jf(pn), JJ.forEach((nt) => {
          nt.shouldApply(Pt, Sn) && (Pt = nt.apply(Pt, Sn));
        }), Mn = Hl(Pt, true, it).trim(), on = _b(lp(Pt, {
          stripNickname: true,
          nickNameReplacement: it,
          forEmote: Ke === Na.Me,
          room: r
        })));
      }
      const Ve = Mn, St = on, pt = II(c, n, t), Ct = {
        msgtype: vt,
        body: Ve
      };
      I && !qe && pt.users.add(I.userId), Ct["m.mentions"] = cie(Array.from(pt.users), pt.room), Ct[AD] = v.current.toJSON();
      const En = oce(Pt);
      Ct[DA] = [], En == null ? void 0 : En.forEach((pn) => Ct[DA].push({
        matched_url: pn
      })), (I || !AI(St, Ve)) && (Ct.format = "org.matrix.custom.html", Ct.formatted_body = St);
      let fn = await H5(c, n);
      if (j && je && (fn = je), fn && (Ct[Vy] = V5(fn, fn.name.trim() !== ""), fn.name.trim() !== "")) {
        const pn = `${fn.name}: `;
        Ct.body.startsWith(pn) || (Ct.body = pn + Ct.body);
        const an = `<strong data-mx-profile-fallback>${Va(fn.name)}: </strong>`;
        if (Ct.formatted_body && !Ct.formatted_body.startsWith(an)) Ct.formatted_body = an + Ct.formatted_body;
        else {
          Ct.format = "org.matrix.custom.html";
          const On = Va(Mn).replaceAll(`
`, "<br/>");
          Ct.formatted_body = `${an}${On}`;
        }
      }
      I && (Ct["m.relates_to"] = RT(I, r));
      const ur = () => nn.invalidateQueries({
        queryKey: [
          "delayedEvents",
          n
        ]
      }), Lr = () => {
        M0(t), Bw(t), we((pn) => pn + 1), v.current.clear(), N(i ? {
          userId: c.getUserId() ?? "",
          eventId: i,
          body: "",
          relation: {
            rel_type: Xn.Thread,
            event_id: i
          }
        } : void 0), se(false);
      };
      if (At) try {
        const pn = VJ(At);
        Lt && await ky(c, Lt), Vt ? await UJ(c, n, r, Ct, pn) : await zJ(c, n, Ct, pn), zt(void 0), ur(), wt(null), $t(null), Lr();
      } catch (pn) {
        if (pn instanceof Un && (pn.errcode === vo.M_MAX_DELAY_EXCEEDED || ((_c3 = pn.data) == null ? void 0 : _c3["org.matrix.msc4140.errcode"]) === "M_MAX_DELAY_EXCEEDED")) {
          const nt = ((_d4 = pn.data) == null ? void 0 : _d4.max_delay) ?? ((_e13 = pn.data) == null ? void 0 : _e13["org.matrix.msc4140.max_delay"]);
          typeof nt == "number" && $e(nt);
          const an = nt / dF(1);
          zt(`Scheduled time exceeds the maximum delay allowed by this server. Please choose an earlier time. The Maximum Delay is of ${an} day${an > 1 ? "s" : ""}.`);
        } else zt("Failed to schedule message. Please try again.");
      }
      else if (Lt) try {
        await ky(c, Lt), fd.info("message", "Sending message after cancelling scheduled event", {
          roomId: n,
          scheduledDelayId: Lt
        });
        const pn = await c.sendMessage(n, i ?? null, Ct);
        fd.info("message", "Message sent successfully", {
          roomId: n,
          eventId: pn.event_id
        }), ur(), wt(null), Lr();
      } catch (pn) {
        fd.error("message", "Failed to send message after cancelling scheduled event", {
          roomId: n,
          error: pn instanceof Error ? pn.message : String(pn)
        });
      }
      else {
        const pn = performance.now();
        Lr(), fd.info("message", "Sending message", {
          roomId: n,
          msgtype: Ct.msgtype
        }), Mg({
          name: "message.send",
          op: "matrix.message",
          attributes: {
            encrypted: String(Vt)
          }
        }, () => c.sendMessage(n, i ?? null, Ct)).then((nt) => {
          fd.info("message", "Message sent successfully", {
            roomId: n,
            eventId: nt.event_id
          }), oa("sable.message.send_latency_ms", performance.now() - pn, {
            attributes: {
              encrypted: String(Vt)
            }
          });
        }).catch((nt) => {
          fd.error("message", "Failed to send message", {
            roomId: n,
            error: nt instanceof Error ? nt.message : String(nt)
          }), Vr("sable.message.send_error", 1, {
            attributes: {
              encrypted: String(Vt)
            }
          }), lD.error("failed to send message", {
            roomId: n
          }, nt);
        });
      }
    }, [
      t,
      bn,
      c,
      n,
      z,
      b,
      I,
      qe,
      j,
      w,
      At,
      Lt,
      T,
      r,
      Ge,
      y,
      m,
      se,
      nn,
      i,
      N,
      g,
      Vt,
      wt,
      $t,
      $e
    ]), Mt = p.useCallback((Ke) => {
      var _a7;
      const it = document.querySelector("[data-autocomplete-menu]");
      if (!!(le && it)) {
        if (Yt.isKeyHotkey("arrowdown", Ke)) {
          Ke.preventDefault(), it.dispatchEvent(new CustomEvent("autocomplete-navigate", {
            detail: {
              direction: 1
            }
          }));
          return;
        }
        if (Yt.isKeyHotkey("arrowup", Ke)) {
          Ke.preventDefault(), it.dispatchEvent(new CustomEvent("autocomplete-navigate", {
            detail: {
              direction: -1
            }
          }));
          return;
        }
        if ((Yt.isKeyHotkey("enter", Ke) || Yt.isKeyHotkey("tab", Ke)) && !Xt(Ke)) {
          const Pt = it.querySelector('button[data-selected="true"]') ?? it.querySelector("button");
          if (Pt) {
            Ke.preventDefault(), Pt.click();
            return;
          }
        }
      }
      if (Yt.isKeyHotkey("arrowup", Ke) && XD(t)) {
        const { selection: Pt } = t;
        if (Pt && fe.isStart(t, Pt.anchor, [])) {
          Ke.preventDefault(), a == null ? void 0 : a();
          return;
        }
      }
      if ((Yt.isKeyHotkey("mod+enter", Ke) || !u && Yt.isKeyHotkey("enter", Ke)) && !Xt(Ke)) {
        Ke.preventDefault(), ot().catch((Pt) => {
          lD.error("submit failed", {
            roomId: n
          }, Pt);
        });
        return;
      }
      if (Yt.isKeyHotkey("escape", Ke)) {
        if (Ke.preventDefault(), ne) {
          (_a7 = X.current) == null ? void 0 : _a7.cancel();
          return;
        }
        if (le) {
          te(void 0);
          return;
        }
        N(void 0);
      }
    }, [
      ot,
      n,
      N,
      u,
      le,
      Xt,
      ne,
      t,
      a
    ]), cn = p.useCallback((Ke) => {
      if (Yt.isKeyHotkey("escape", Ke)) {
        Ke.preventDefault();
        return;
      }
      h || se(!XD(t));
      const it = fe.start(t, []), It = fe.after(t, it, {
        distance: 2,
        unit: "character"
      });
      if (fe.string(t, fe.range(t, it, It)) === "+#") {
        he(true), te(void 0);
        return;
      }
      he(false);
      const Sn = gb(t);
      if (!Sn) {
        te(void 0);
        return;
      }
      const on = (!ei.isAfter(_t.start(Sn), it) ? fF(t, Sn, NPe) : void 0) ?? fF(t, Sn, xI);
      te(on);
    }, [
      t,
      se,
      h
    ]), un = (Ke, it) => {
      const It = YF(Ke, it);
      if (le ? g3(t, le.range, It) : t.insertNode(It), !v.current.has(Ke)) {
        const Pt = gie(Ke, c, Hr.Emoticon, r);
        (Pt == null ? void 0 : Pt.room_id) && (Pt == null ? void 0 : Pt.shortcode) && v.current.set(Ke, Pt);
      }
      Gl(t), Ae();
    }, gn = async (Ke, it, It) => {
      const Pt = Cn(c, Ke, d);
      if (!Pt) return;
      const Sn = LB(await oP(Pt), await yke(Pt)), Mn = {
        body: It,
        url: Ke,
        info: Sn
      };
      Mn[AD] = jA(Ke, c, Hr.Sticker, r);
      const on = await H5(c, n);
      on && (Mn[Vy] = V5(on, false)), Mn[AD] = jA(Ke, c, Hr.Sticker, r), I && (Mn["m.relates_to"] = RT(I, r), N(i ? {
        userId: c.getUserId() ?? "",
        eventId: i,
        body: "",
        relation: {
          rel_type: Xn.Thread,
          event_id: i
        }
      } : void 0)), c.sendEvent(n, ce.Sticker, Mn);
    };
    return o.jsxs("div", {
      ref: s,
      children: [
        V.length > 0 && o.jsx(Nnt, {
          header: o.jsx(znt, {
            open: L,
            onToggle: () => H(!L),
            uploadFamilyObserverAtom: Y,
            onSend: De,
            imperativeHandlerRef: oe,
            onCancel: ut
          }),
          children: L && o.jsx(dn, {
            size: "300",
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Unt, {
              children: Array.from(V).toReversed().map((Ke) => o.jsx(rUe, {
                isEncrypted: !!Ke.encInfo,
                fileItem: Ke,
                setMetadata: Kn,
                onRemove: Dt,
                setDesc: Ce,
                roomId: n
              }, Ee(Ke)))
            })
          })
        }),
        o.jsx(Hn, {
          open: Rt,
          backdrop: o.jsx($n, {}),
          style: {
            pointerEvents: "none"
          },
          children: o.jsx(Wn, {
            children: o.jsx(lr, {
              variant: "Primary",
              children: o.jsxs(E, {
                direction: "Column",
                justifyContent: "Center",
                alignItems: "Center",
                gap: "500",
                style: {
                  padding: He(60)
                },
                children: [
                  o.jsx(Q, {
                    size: "600",
                    src: q.File
                  }),
                  o.jsx(D, {
                    size: "H4",
                    align: "Center",
                    children: `Drop Files in "${(r == null ? void 0 : r.name) || "Room"}"`
                  }),
                  o.jsx(D, {
                    align: "Center",
                    children: "Drag and drop files here or click for selection dialog"
                  })
                ]
              })
            })
          })
        }),
        (le == null ? void 0 : le.prefix) === al.RoomMention && o.jsx(ple, {
          roomId: n,
          editor: t,
          query: le,
          requestClose: Ae
        }),
        (le == null ? void 0 : le.prefix) === al.UserMention && o.jsx(Fle, {
          room: r,
          editor: t,
          query: le,
          requestClose: Ae
        }),
        (le == null ? void 0 : le.prefix) === al.Emoticon && o.jsx(pb, {
          imagePackRooms: de,
          editor: t,
          query: le,
          requestClose: Ae,
          onEmoticonSelected: un
        }),
        (le == null ? void 0 : le.prefix) === al.Reaction && (z ? o.jsx(pb, {
          title: `React with :${le.text}`,
          imagePackRooms: de,
          editor: t,
          query: le,
          requestClose: Ae,
          onEmoticonSelected: Ge
        }) : o.jsx(ST, {
          children: "You do not have permission to send reactions in this room"
        })),
        (le == null ? void 0 : le.prefix) === al.Command && o.jsx(Art, {
          room: r,
          editor: t,
          query: le,
          requestClose: Ae
        }),
        re && (z ? o.jsx(ST, {
          children: "Sending as text reaction to the latest message"
        }) : o.jsx(ST, {
          children: "You do not have permission to send reactions in this room"
        })),
        o.jsx(oS, {
          editableName: "RoomInput",
          editor: t,
          placeholder: "Send a message...",
          onKeyDown: Mt,
          onKeyUp: cn,
          onPaste: lt,
          responsiveAfter: Zt,
          forceMultilineLayout: ne,
          top: o.jsxs(o.Fragment, {
            children: [
              At && o.jsx("div", {
                children: o.jsxs(E, {
                  alignItems: "Center",
                  gap: "300",
                  style: {
                    padding: `${ee.space.S200} ${ee.space.S300} 0`
                  },
                  children: [
                    o.jsx(Oe, {
                      onClick: () => {
                        $t(null), wt(null), zt(void 0);
                      },
                      variant: "SurfaceVariant",
                      size: "300",
                      radii: "300",
                      title: "schedule message send",
                      children: o.jsx(Q, {
                        src: q.Cross,
                        size: "50"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Row",
                      gap: "200",
                      alignItems: "Center",
                      children: [
                        o.jsx(Q, {
                          size: "100",
                          src: q.Clock
                        }),
                        o.jsxs(D, {
                          size: "T300",
                          children: [
                            "Scheduled for ",
                            qF(At.getTime()),
                            " at",
                            " ",
                            eu(At.getTime(), ht)
                          ]
                        })
                      ]
                    })
                  ]
                })
              }),
              Tt && o.jsx("div", {
                children: o.jsx(E, {
                  alignItems: "Center",
                  gap: "300",
                  style: {
                    padding: `${ee.space.S200} ${ee.space.S300} 0`
                  },
                  children: o.jsx(D, {
                    style: {
                      color: ct.Critical.Main
                    },
                    size: "T300",
                    children: Tt
                  })
                })
              }),
              I && (!i || I.body) && o.jsx("div", {
                children: o.jsxs(E, {
                  alignItems: "Center",
                  gap: "300",
                  style: {
                    padding: `${ee.space.S200} ${ee.space.S300} 0`
                  },
                  children: [
                    o.jsx(Oe, {
                      onClick: () => {
                        N(i ? {
                          userId: c.getUserId() ?? "",
                          eventId: i,
                          body: "",
                          relation: {
                            rel_type: Xn.Thread,
                            event_id: i
                          }
                        } : void 0);
                      },
                      variant: "SurfaceVariant",
                      size: "300",
                      radii: "300",
                      "aria-label": "Cancel reply",
                      title: "Cancel reply",
                      children: o.jsx(Q, {
                        src: q.Cross,
                        size: "50"
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Row",
                      gap: "200",
                      alignItems: "Center",
                      grow: "Yes",
                      style: {
                        minWidth: 0
                      },
                      children: [
                        o.jsxs(E, {
                          direction: "Row",
                          gap: "200",
                          alignItems: "Center",
                          grow: "Yes",
                          style: {
                            minWidth: 0
                          },
                          children: [
                            ((_a6 = I.relation) == null ? void 0 : _a6.rel_type) === Xn.Thread && !i && o.jsx(ose, {}),
                            o.jsx(Pu, {
                              room: r,
                              replyEventId: I.eventId
                            })
                          ]
                        }),
                        o.jsxs(Oe, {
                          variant: "SurfaceVariant",
                          size: "300",
                          radii: "300",
                          title: qe ? "Unmute reply notifications" : "Mute reply notifications",
                          "aria-pressed": qe,
                          "aria-label": qe ? "Unmute reply notifications" : "Mute reply notifications",
                          onClick: () => tt(!qe),
                          children: [
                            !qe && o.jsx(Q, {
                              src: q.BellPing
                            }),
                            qe && o.jsx(Q, {
                              src: q.BellMute
                            })
                          ]
                        })
                      ]
                    })
                  ]
                })
              })
            ]
          }),
          before: o.jsx(Oe, {
            onClick: () => Ne("*"),
            variant: "SurfaceVariant",
            size: "300",
            radii: "300",
            title: "Upload File",
            "aria-label": "Upload and attach a File",
            children: o.jsx(Q, {
              src: q.PlusCircle
            })
          }),
          after: o.jsxs(o.Fragment, {
            children: [
              o.jsx(Oe, {
                ref: C,
                variant: ne ? "Critical" : "SurfaceVariant",
                size: "300",
                radii: "300",
                title: ne ? "Stop recording" : "Record audio message",
                "aria-label": ne ? "Stop recording" : "Record audio message",
                "aria-pressed": ne,
                onClick: () => {
                  var _a7;
                  Dr() && !ne || (ne ? (_a7 = X.current) == null ? void 0 : _a7.stop() : ae(true));
                },
                onPointerDown: () => {
                  if (!Dr() || ne) return;
                  K.current = Date.now(), ae(true);
                  function Ke() {
                    it(), Date.now() - K.current >= G ? setTimeout(() => {
                      var _a7;
                      (_a7 = X.current) == null ? void 0 : _a7.stop();
                    }, 50) : setTimeout(() => {
                      var _a7;
                      (_a7 = X.current) == null ? void 0 : _a7.cancel();
                    }, 50);
                  }
                  function it() {
                    window.removeEventListener("pointerup", Ke), window.removeEventListener("pointercancel", it);
                  }
                  window.addEventListener("pointerup", Ke), window.addEventListener("pointercancel", it);
                },
                children: ne ? o.jsx(sSe, {
                  size: 20,
                  weight: "fill",
                  style: {
                    color: ct.Critical.Main
                  }
                }) : o.jsx(iSe, {
                  size: 20
                })
              }),
              o.jsx(dS, {
                variant: "SurfaceVariant"
              }),
              o.jsx(Hi, {
                initial: void 0,
                children: (Ke, it) => {
                  var _a7;
                  return o.jsxs(ln, {
                    offset: 16,
                    alignOffset: -44,
                    position: "Top",
                    align: "End",
                    anchor: Ke === void 0 ? void 0 : ((_a7 = k.current) == null ? void 0 : _a7.getBoundingClientRect()) ?? void 0,
                    content: o.jsx(JF, {
                      tab: Ke,
                      onTabChange: it,
                      imagePackRooms: de,
                      returnFocusOnDeactivate: false,
                      onEmojiSelect: un,
                      onCustomEmojiSelect: un,
                      onStickerSelect: gn,
                      requestClose: () => {
                        it((It) => {
                          if (It) {
                            Dr() || Bt.focus(t);
                            return;
                          }
                          return It;
                        });
                      }
                    }),
                    children: [
                      !We && o.jsx(Oe, {
                        "aria-pressed": Ke === xa.Sticker,
                        onClick: () => it(xa.Sticker),
                        variant: "SurfaceVariant",
                        size: "300",
                        radii: "300",
                        title: "open sticker picker",
                        "aria-label": "Open sticker picker",
                        children: o.jsx(Q, {
                          src: q.Sticker,
                          filled: Ke === xa.Sticker
                        })
                      }),
                      o.jsx(Oe, {
                        ref: k,
                        "aria-pressed": We ? !!Ke : Ke === xa.Emoji,
                        onClick: () => it(xa.Emoji),
                        variant: "SurfaceVariant",
                        size: "300",
                        radii: "300",
                        title: "open emoji picker",
                        "aria-label": "Open emoji picker",
                        children: o.jsx(Q, {
                          src: q.Smile,
                          filled: We ? !!Ke : Ke === xa.Emoji
                        })
                      })
                    ]
                  });
                }
              }),
              o.jsx(ln, {
                anchor: st,
                position: "Top",
                align: "End",
                offset: 5,
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    onDeactivate: () => Be(void 0),
                    clickOutsideDeactivates: true,
                    escapeDeactivates: kt
                  },
                  children: o.jsx(tn, {
                    children: o.jsxs(E, {
                      direction: "Column",
                      gap: "100",
                      style: {
                        padding: ee.space.S100
                      },
                      children: [
                        o.jsx(Ye, {
                          size: "300",
                          radii: "300",
                          onClick: () => {
                            Be(void 0), ot();
                          },
                          before: o.jsx(Q, {
                            size: "100",
                            src: q.Send
                          }),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Send Now"
                          })
                        }),
                        o.jsx(Ye, {
                          size: "300",
                          radii: "300",
                          onClick: () => {
                            Be(void 0), Ue(true);
                          },
                          before: o.jsx(Q, {
                            size: "100",
                            src: q.Clock
                          }),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Schedule Send"
                          })
                        })
                      ]
                    })
                  })
                })
              }),
              o.jsxs(E, {
                display: "Flex",
                alignItems: "Center",
                children: [
                  o.jsx(Oe, {
                    title: "Send Message",
                    "aria-label": "Send your composed Message",
                    onClick: () => {
                      if (ie.current) {
                        ie.current = false;
                        return;
                      }
                      ot();
                    },
                    onMouseDown: (Ke) => Ke.preventDefault(),
                    onPointerDown: () => {
                      ie.current = false, Dr() && bt && (ue.current = setTimeout(() => {
                        ie.current = true, Ue(true);
                      }, 1e3));
                    },
                    onPointerUp: () => {
                      ue.current !== null && (clearTimeout(ue.current), ue.current = null);
                    },
                    onPointerCancel: () => {
                      ue.current !== null && (clearTimeout(ue.current), ue.current = null);
                    },
                    variant: At ? "Primary" : "SurfaceVariant",
                    size: "300",
                    radii: "0",
                    className: bt ? hrt : void 0,
                    children: o.jsx(Q, {
                      src: At ? q.Clock : q.Send
                    })
                  }),
                  bt && !Dr() && o.jsx(Oe, {
                    onClick: (Ke) => {
                      Be(Ke.currentTarget.getBoundingClientRect());
                    },
                    title: "Schedule Message",
                    "aria-label": "Schedule message send",
                    variant: At ? "Primary" : "SurfaceVariant",
                    size: "300",
                    radii: "0",
                    className: frt,
                    children: o.jsx(Q, {
                      size: "50",
                      src: q.ChevronBottom
                    })
                  })
                ]
              })
            ]
          }),
          bottom: o.jsx(uS, {})
        }, ye),
        Re && o.jsx(Ofe, {
          initialTime: At == null ? void 0 : At.getTime(),
          showEncryptionWarning: Vt,
          onCancel: () => Ue(false),
          onSubmit: (Ke) => {
            $t(Ke), Ue(false), zt(void 0);
          }
        })
      ]
    });
  });
  var Grt = "RoomInputPlaceholder_RoomInputPlaceholder__ywnp5a0";
  const Nfe = ft(({ className: t, ...e }, n) => o.jsx(E, {
    className: gt(Grt, t),
    ...e,
    ref: n
  }));
  var Yrt = "RoomTombstone_RoomTombstone__ce8na00";
  function Zrt({ roomId: t, body: e, replacementRoomId: n }) {
    var _a6;
    const r = be(), { navigateRoom: i } = Wi(), [a, s] = Et(p.useCallback(() => {
      const d = r.getRoom(t), u = d ? Xc(d) : [];
      return r.joinRoom(n, {
        viaServers: u
      });
    }, [
      r,
      t,
      n
    ])), l = r.getRoom(n), c = () => {
      l && i(l.roomId), a.status === ve.Success && i(a.data.roomId);
    };
    return o.jsxs(Nfe, {
      alignItems: "Center",
      gap: "600",
      className: Yrt,
      children: [
        o.jsxs(E, {
          direction: "Column",
          grow: "Yes",
          children: [
            o.jsx(D, {
              size: "T400",
              children: e || "This room has been replaced and is no longer active."
            }),
            a.status === ve.Error && o.jsx(D, {
              style: {
                color: ct.Critical.Main
              },
              size: "T200",
              children: ((_a6 = a.error) == null ? void 0 : _a6.message) ?? "Failed to join replacement room!"
            })
          ]
        }),
        o.jsx(E, {
          shrink: "No",
          children: (l == null ? void 0 : l.getMyMembership()) === Ht.Join || a.status === ve.Success ? o.jsx(xe, {
            onClick: c,
            size: "300",
            variant: "Success",
            fill: "Solid",
            radii: "300",
            children: o.jsx(D, {
              size: "B300",
              children: "Open New Room"
            })
          }) : o.jsx(xe, {
            onClick: s,
            size: "300",
            variant: "Primary",
            fill: "Solid",
            radii: "300",
            before: a.status === ve.Loading && o.jsx(dt, {
              size: "100",
              variant: "Primary",
              fill: "Solid"
            }),
            disabled: a.status === ve.Loading,
            children: o.jsx(D, {
              size: "B300",
              children: "Join New Room"
            })
          })
        })
      ]
    });
  }
  var Jrt = "RoomViewTyping_RoomViewTyping__1dfodck1 _1mqalmd1 _1mqalmd0", Xrt = "RoomViewTyping_TypingText__1dfodck2";
  const Qrt = ft(({ className: t, room: e, ...n }, r) => {
    const i = Fn(OO), a = be(), s = LO(e.roomId), l = Ze(qr), c = s.filter((u) => u.userId !== a.getUserId()).map((u) => gr(e, u.userId, l) ?? _n(u.userId)).toReversed();
    if (c.length === 0) return null;
    const d = () => {
      s.forEach((u) => i({
        type: "DELETE",
        roomId: e.roomId,
        userId: u.userId
      }));
    };
    return o.jsx("div", {
      style: {
        position: "relative"
      },
      children: o.jsxs(E, {
        className: gt(Jrt, t),
        alignItems: "Center",
        gap: "400",
        ...n,
        ref: r,
        style: {
          zIndex: 9
        },
        children: [
          o.jsx(MO, {}),
          o.jsxs(D, {
            className: Xrt,
            size: "T300",
            truncate: true,
            children: [
              c.length === 1 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    children: c[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " is typing..."
                  })
                ]
              }),
              c.length === 2 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    children: c[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " and "
                  }),
                  o.jsx("b", {
                    children: c[1]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " are typing..."
                  })
                ]
              }),
              c.length === 3 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    children: c[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: ", "
                  }),
                  o.jsx("b", {
                    children: c[1]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " and "
                  }),
                  o.jsx("b", {
                    children: c[2]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " are typing..."
                  })
                ]
              }),
              c.length > 3 && o.jsxs(o.Fragment, {
                children: [
                  o.jsx("b", {
                    children: c[0]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: ", "
                  }),
                  o.jsx("b", {
                    children: c[1]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: ", "
                  }),
                  o.jsx("b", {
                    children: c[2]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " and "
                  }),
                  o.jsxs("b", {
                    children: [
                      c.length - 3,
                      " others"
                    ]
                  }),
                  o.jsx(D, {
                    as: "span",
                    size: "Inherit",
                    priority: "300",
                    children: " are typing..."
                  })
                ]
              })
            ]
          }),
          o.jsx(Oe, {
            title: "Drop Typing Status",
            size: "300",
            radii: "Pill",
            onClick: d,
            children: o.jsx(Q, {
              size: "50",
              src: q.Cross
            })
          })
        ]
      })
    });
  }), Tb = null, { min: vg, max: bc, abs: tX, floor: eit } = Math, zfe = (t, e, n) => vg(n, bc(e, t)), Ufe = (t) => [
    ...t
  ].sort(((e, n) => e - n)), Vfe = typeof queueMicrotask == "function" ? queueMicrotask : (t) => {
    Promise.resolve().then(t);
  }, I8 = () => {
    let t;
    return [
      new Promise(((e) => {
        t = e;
      })),
      t
    ];
  }, Hfe = (t) => {
    let e;
    return () => (t && (e = t(), t = void 0), e);
  }, p2 = (t, e, n) => {
    const r = n ? "unshift" : "push";
    for (let i = 0; i < e; i++) t[r](-1);
    return t;
  }, $fe = (t, e) => {
    const n = t.t[e];
    return n === -1 ? t.o : n;
  }, tit = (t, e, n) => {
    const r = t.t[e] === -1;
    return t.t[e] = n, t.i = vg(e, t.i), r;
  }, hC = (t, e) => {
    if (!t.l) return 0;
    if (t.i >= e) return t.u[e];
    t.i < 0 && (t.u[0] = 0, t.i = 0);
    let n = t.i, r = t.u[n];
    for (; n < e; ) r += $fe(t, n), t.u[++n] = r;
    return t.i = e, r;
  }, j0 = (t, e, n = 0, r = t.l - 1) => {
    let i = n;
    for (; n <= r; ) {
      const a = eit((n + r) / 2);
      hC(t, a) <= e ? (i = a, n = a + 1) : r = a - 1;
    }
    return zfe(i, 0, t.l - 1);
  }, nX = (t, e, n) => {
    const r = e - t.l;
    return t.i = n ? -1 : vg(e - 1, t.i), t.l = e, r > 0 ? (p2(t.u, r), p2(t.t, r, n), t.o * r) : (t.u.splice(r), (n ? t.t.splice(0, -r) : t.t.splice(r)).reduce(((i, a) => i - (a === -1 ? t.o : a)), 0));
  }, nit = typeof window < "u", rit = (t) => t.documentElement, iit = (t) => t.ownerDocument, oit = (t) => t.defaultView, Wfe = Hfe((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 0)), ait = Hfe((() => "scrollBehavior" in rit(document).style)), sit = (t) => bc(t.h(), t.p()), lit = (t, e = 40, n = 0, r, i = false) => {
    let a = !!n, s = 1, l = 0, c = 0, d = 0, u = 0, h = 0, f = 0, g = 0, m = 0, v = Tb, y = [
      0,
      a ? bc(n - 1, 0) : -1
    ], w = 0, b = false;
    const j = ((O, M, I) => ({
      o: M,
      t: I ? p2(I.slice(0, vg(O, I.length)), bc(0, O - I.length)) : p2([], O),
      l: O,
      i: -1,
      u: p2([], O + 1)
    }))(t, r ? r[1] : e, r && r[0]), k = /* @__PURE__ */ new Set(), C = () => d - c, x = () => C() + h + u, S = (O, M) => ((I, N, L, H) => {
      if (H = vg(H, I.l - 1), hC(I, H) <= N) {
        const V = j0(I, L, H);
        return [
          j0(I, N, H, V),
          V
        ];
      }
      {
        const V = j0(I, N, void 0, H);
        return [
          V,
          j0(I, L, V)
        ];
      }
    })(j, O, M, y[0]), T = () => hC(j, j.l), A = (O, M) => {
      const I = hC(j, O) - h;
      return M ? T() - I - B(O) : I;
    }, B = (O) => $fe(j, O), U = (O, M = -1) => j.t[O] === M, z = (O) => {
      O && (Wfe() && g !== 0 || v && m === 1 ? h += O : u += O);
    };
    return {
      v: () => {
        k.clear();
      },
      m: () => s,
      _: () => ((O) => [
        O.t.slice(),
        O.o
      ])(j),
      S: (O = 200) => {
        if (!b || a) return y;
        let M, I;
        if (f) [M, I] = y;
        else {
          let N = bc(0, x()), L = N + l;
          i || (O = bc(0, O), g !== 1 && (N -= O), g !== 2 && (L += O)), [M, I] = y = S(bc(0, N), bc(0, L)), v && (M = vg(M, v[0]), I = bc(I, v[1]));
        }
        return [
          bc(M, 0),
          vg(I, j.l - 1)
        ];
      },
      $: (O) => j0(j, O - c),
      I: U,
      k: A,
      R: B,
      T: () => j.l,
      C: () => d,
      M: () => g !== 0,
      p: () => l,
      O: () => c,
      h: T,
      H: () => (f = u, u = 0, [
        f,
        m === 2
      ]),
      W: (O, M) => {
        const I = [
          O,
          M
        ];
        return k.add(I), () => {
          k.delete(I);
        };
      },
      B: (O, M) => {
        let I, N, L = 0;
        switch (O) {
          case 1: {
            if (M === d && m === 0) break;
            const H = f;
            f = 0;
            const V = M - d, Z = tX(V);
            H && Z < tX(H) + 1 || m !== 0 || (g = V < 0 ? 2 : 1), a && (a = false), d = M, L = 4;
            const Y = C();
            Y >= -l && Y <= T() && (L += 1, N = Z > l);
            break;
          }
          case 2:
            L = 8, g !== 0 && (I = true, L += 1), g = 0, m = 0, v = Tb;
            break;
          case 3: {
            const H = M.filter((([V, Z]) => !U(V, Z)));
            if (!H.length) break;
            z(H.reduce(((V, [Z, Y]) => {
              let oe;
              if (m === 2) oe = true;
              else if (v && m === 1) oe = Z < v[0];
              else {
                const ue = C(), ie = A(Z), de = B(Z);
                oe = g !== 1 && m === 0 ? ie + de < ue : ie < ue && ie + de < ue + l;
              }
              return oe && (V += Y - B(Z)), V;
            }), 0));
            for (const [V, Z] of H) {
              const Y = B(V), oe = tit(j, V, Z);
              i && (w += oe ? Z : Z - Y);
            }
            i && l && w > l && (z(((V, Z) => {
              let Y = 0;
              const oe = [];
              V.t.forEach(((X, K) => {
                X !== -1 && (oe.push(X), K < Z && Y++);
              })), V.i = -1;
              const ue = Ufe(oe), ie = ue.length, de = ie / 2 | 0, ne = ie % 2 == 0 ? (ue[de - 1] + ue[de]) / 2 : ue[de], ae = V.o;
              return ((V.o = ne) - ae) * bc(Z - Y, 0);
            })(j, j0(j, x()))), i = false), L = 3, N = true;
            break;
          }
          case 4:
            l !== M && (l || (b = N = true), l = M, L = 3);
            break;
          case 5:
            M[1] ? (z(nX(j, M[0], true)), m = 2, L = 1) : (nX(j, M[0]), L = 1);
            break;
          case 6:
            c = M;
            break;
          case 7:
            m = 1;
            break;
          case 8:
            v = S(M, M + l), L = 1;
        }
        L && (s = 1 + (2147483647 & s), I && h && (u += h, h = 0), k.forEach((([H, V]) => {
          L & H && V(N);
        })));
      }
    };
  }, KO = setTimeout, AT = (t, e) => e ? -t : t, cit = (t, e, n, r, i, a) => {
    const s = Date.now;
    let l = 0, c = false, d = false, u = false, h = false;
    const f = (() => {
      let w;
      const b = () => {
        w != Tb && clearTimeout(w);
      }, j = () => {
        b(), w = KO((() => {
          w = Tb, (() => {
            if (c || d) return c = false, void f();
            u = false, t.B(2);
          })();
        }), 150);
      };
      return j.J = b, j;
    })(), g = () => {
      l = s(), u && (h = true), t.B(1, r()), f();
    }, m = (w) => {
      if (c || !t.M() || w.ctrlKey) return;
      const b = s() - l;
      150 > b && 50 < b && (n ? w.deltaX : w.deltaY) && (c = true);
    }, v = () => {
      d = true, u = h = false;
    }, y = () => {
      d = false, Wfe() && (u = true);
    };
    return e.addEventListener("scroll", g), e.addEventListener("wheel", m, {
      passive: true
    }), e.addEventListener("touchstart", v, {
      passive: true
    }), e.addEventListener("touchend", y, {
      passive: true
    }), {
      A: () => {
        e.removeEventListener("scroll", g), e.removeEventListener("wheel", m), e.removeEventListener("touchstart", v), e.removeEventListener("touchend", y), f.J();
      },
      L: () => {
        const [w, b] = t.H();
        w && (i(w, b, h), h = false, b && t.p() > t.h() && t.B(1, r()));
      }
    };
  }, dit = (t, e, n) => {
    let r;
    return [
      async (i, a) => {
        if (!await e()) return;
        r && r();
        const s = () => {
          const [l, c] = I8();
          return r = () => {
            c(false);
          }, t.p() && KO(r, 150), [
            l,
            t.W(2, (() => {
              c(true);
            }))
          ];
        };
        if (a && ait()) t.B(8, i()), Vfe((async () => {
          for (; ; ) {
            let l = true;
            for (let [u, h] = t.S(); u <= h; u++) if (t.I(u)) {
              l = false;
              break;
            }
            if (l) break;
            const [c, d] = s();
            try {
              if (!await c) return;
            } finally {
              d();
            }
          }
          t.B(7), n(i(), a);
        }));
        else for (; ; ) {
          const [l, c] = s();
          try {
            if (t.B(7), n(i()), !await l) return;
          } finally {
            c();
          }
        }
      },
      () => {
        r && r();
      }
    ];
  }, uit = (t, e) => {
    let n, r, i = I8(), a = false;
    const s = e ? "scrollLeft" : "scrollTop", l = e ? "overflowX" : "overflowY", [c, d] = dit(t, (() => i[0]), ((u, h) => {
      u = AT(u, a), h ? n.scrollTo({
        [e ? "left" : "top"]: u,
        behavior: "smooth"
      }) : n[s] = u;
    }));
    return {
      N(u, h) {
        n = h, e && (a = getComputedStyle(h).direction === "rtl"), r = cit(t, h, e, (() => AT(h[s], a)), ((f, g, m) => {
          if (m) {
            const v = h.style, y = v[l];
            v[l] = "hidden", KO((() => {
              v[l] = y;
            }));
          }
          h[s] = AT(t.C() + f, a), g && d();
        })), i[1](true);
      },
      v() {
        r && r.A(), i[1](false), i = I8();
      },
      P: () => a,
      V(u) {
        c((() => u));
      },
      X(u) {
        u += t.C(), c((() => u));
      },
      Y(u, { align: h, smooth: f, offset: g = 0 } = {}) {
        if (u = zfe(u, 0, t.T() - 1), h === "nearest") {
          const m = t.k(u), v = t.C();
          if (m < v) h = "start";
          else {
            if (!(m + t.R(u) > v + t.p())) return;
            h = "end";
          }
        }
        c((() => g + t.O() + t.k(u) + (h === "end" ? t.R(u) - t.p() : h === "center" ? (t.R(u) - t.p()) / 2 : 0)), f);
      },
      q: () => {
        r && r.L();
      }
    };
  }, hit = (t) => {
    let e;
    return {
      D(n) {
        (e || (e = new (oit(iit(n))).ResizeObserver(t))).observe(n);
      },
      j(n) {
        e.unobserve(n);
      },
      A() {
        e && e.disconnect();
      }
    };
  }, fit = (t, e) => {
    let n;
    const r = e ? "width" : "height", i = /* @__PURE__ */ new WeakMap(), a = hit(((s) => {
      const l = [];
      for (const { target: c, contentRect: d } of s) if (c.offsetParent) if (c === n) t.B(4, d[r]);
      else {
        const u = i.get(c);
        u != Tb && l.push([
          u,
          d[r]
        ]);
      }
      l.length && t.B(3, l);
    }));
    return {
      G(s) {
        a.D(n = s);
      },
      U: (s, l) => (i.set(s, l), a.D(s), () => {
        i.delete(s), a.j(s);
      }),
      v: a.A
    };
  }, BE = nit ? p.useLayoutEffect : p.useEffect, Xs = "current", qfe = (t, e) => {
    if (Array.isArray(t)) for (const n of t) qfe(n, e);
    else t == null || typeof t == "boolean" || e.push(t);
  }, mit = (t, e) => {
    const n = t.key;
    return n ?? "_" + e;
  }, git = (t) => {
    const e = p.useRef(null);
    return e[Xs] || (e[Xs] = t());
  }, rX = (t) => {
    const e = p.useRef(t);
    return BE((() => {
      e[Xs] = t;
    }), [
      t
    ]), e;
  }, pit = p.memo((({ Z: t, ee: e, te: n, oe: r, ne: i, re: a, ie: s, se: l }) => {
    const c = p.useRef(null);
    BE((() => e(c[Xs], n)), [
      n
    ]);
    const d = p.useMemo((() => {
      const u = {
        contain: "layout style",
        position: i && l ? void 0 : "absolute",
        [s ? "height" : "width"]: "100%",
        [s ? "top" : "left"]: 0,
        [s ? "left" : "top"]: r,
        visibility: !i || l ? void 0 : "hidden"
      };
      return s && (u.display = "inline-flex"), u;
    }), [
      r,
      i,
      l,
      s
    ]);
    return o.jsx(a, typeof a == "string" ? {
      ref: c,
      style: d,
      children: t
    } : {
      ref: c,
      style: d,
      index: n,
      children: t
    });
  })), Fit = (t, e) => p.useMemo((() => {
    if (typeof t == "function") return [
      (r) => t(e[r], r),
      e.length
    ];
    const n = ((r) => {
      const i = [];
      return qfe(r, i), i;
    })(t);
    return [
      (r) => n[r],
      n.length
    ];
  }), [
    t,
    e
  ]), vit = p.forwardRef((({ children: t, data: e, bufferSize: n, itemSize: r, shift: i, horizontal: a, keepMounted: s, cache: l, startMargin: c = 0, ssrCount: d, as: u = "div", item: h = "div", scrollRef: f, onScroll: g, onScrollEnd: m }, v) => {
    const [y, w] = Fit(t, e), b = p.useRef(null), j = p.useRef(!!d), k = rX(g), C = rX(m), [x, S, T, A] = git((() => {
      const L = !!a, H = lit(w, r, d, l, !r);
      return [
        H,
        fit(H, L),
        uit(H, L),
        L
      ];
    }));
    w !== x.T() && x.B(5, [
      w,
      i
    ]), c !== x.O() && x.B(6, c);
    const [B, U] = p.useReducer(x.m, void 0, x.m), z = x.M(), O = x.h(), M = T.P(), I = [], N = (L) => {
      const H = y(L);
      return o.jsx(pit, {
        ee: S.U,
        te: L,
        oe: x.k(L, M),
        ne: x.I(L),
        re: h,
        Z: H,
        ie: A,
        se: j[Xs]
      }, mit(H, L));
    };
    if (BE((() => {
      j[Xs] = false, x.W(1, ((V) => {
        V ? DF.flushSync(U) : U();
      })), x.W(4, (() => {
        k[Xs] && k[Xs](x.C());
      })), x.W(8, (() => {
        C[Xs] && C[Xs]();
      }));
      const L = b[Xs], H = (V) => {
        S.G(V), T.N(L, V);
      };
      return f ? Vfe((() => {
        f[Xs] && H(f[Xs]);
      })) : H(L.parentElement), () => {
        x.v(), S.v(), T.v();
      };
    }), []), BE((() => {
      T.q();
    }), [
      B
    ]), p.useImperativeHandle(v, (() => ({
      get cache() {
        return x._();
      },
      get scrollOffset() {
        return x.C();
      },
      get scrollSize() {
        return sit(x);
      },
      get viewportSize() {
        return x.p();
      },
      findItemIndex: x.$,
      getItemOffset: x.k,
      getItemSize: x.R,
      scrollToIndex: T.Y,
      scrollTo: T.V,
      scrollBy: T.X
    })), []), s) {
      const L = new Set(s);
      for (let [H, V] = x.S(n); H <= V; H++) L.add(H);
      Ufe([
        ...L
      ]).forEach(((H) => {
        I.push(N(H));
      }));
    } else for (let [L, H] = x.S(n); L <= H; L++) I.push(N(L));
    return o.jsx(u, {
      ref: b,
      style: {
        contain: "size style",
        overflowAnchor: "none",
        flex: "none",
        position: "relative",
        width: A ? O : "100%",
        height: A ? "100%" : O,
        pointerEvents: z ? "none" : void 0
      },
      children: I
    });
  })), _it = p.forwardRef((({ children: t, data: e, bufferSize: n, itemSize: r, shift: i, horizontal: a, keepMounted: s, cache: l, ssrCount: c, item: d, onScroll: u, onScrollEnd: h, style: f, ...g }, m) => o.jsx("div", {
    ...g,
    style: {
      display: a ? "inline-block" : "block",
      [a ? "overflowX" : "overflowY"]: "auto",
      contain: "strict",
      width: "100%",
      height: "100%",
      ...f
    },
    children: o.jsx(vit, {
      ref: m,
      data: e,
      bufferSize: n,
      itemSize: r,
      shift: i,
      horizontal: a,
      keepMounted: s,
      cache: l,
      ssrCount: c,
      item: d,
      onScroll: u,
      onScrollEnd: h,
      children: t
    })
  }))), iX = ft(({ room: t, ...e }, n) => {
    var _a6, _b3;
    const r = be(), i = hn(), { navigateRoom: a } = Wi(), s = Ze(gi), l = Ze(qr), c = s.has(t.roomId), [d, u] = p.useState(false), [h, f] = p.useState(false), g = ni(t, ce.RoomCreate), m = Ip(t, s.has(t.roomId)), v = rc(t), y = D3(t), w = m ? Cn(r, m, i) : void 0, b = g == null ? void 0 : g.getContent(), j = g == null ? void 0 : g.getTs(), k = g == null ? void 0 : g.getSender(), C = k && (gr(t, k, l) ?? _n(k)), x = (_a6 = b == null ? void 0 : b.predecessor) == null ? void 0 : _a6.room_id, [S, T] = Et(p.useCallback(async (I) => r.joinRoom(I), [
      r
    ])), [A] = Fe(ge, "hour24Clock"), B = () => {
      if (c) {
        f(true);
        return;
      }
      u(true);
    }, U = () => {
      f(false), u(true);
    }, [z, O] = Et(p.useCallback(async () => {
      await UB(r, t.roomId);
    }, [
      r,
      t.roomId
    ])), M = () => {
      z.status !== ve.Loading && O().catch(() => {
      });
    };
    return p.useEffect(() => {
      z.status === ve.Success && (f(false), u(true));
    }, [
      z.status
    ]), o.jsxs(E, {
      direction: "Column",
      grow: "Yes",
      gap: "500",
      ...e,
      ref: n,
      children: [
        o.jsx(E, {
          children: o.jsx(xn, {
            size: "500",
            children: o.jsx(yi, {
              roomId: t.roomId,
              src: w ?? void 0,
              alt: v,
              renderFallback: () => o.jsx(D, {
                size: "H2",
                children: Vi(v)
              })
            })
          })
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "300",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "H3",
                  priority: "500",
                  children: v
                }),
                o.jsx(D, {
                  size: "T400",
                  priority: "400",
                  children: typeof y == "string" ? y : "This is the beginning of conversation."
                }),
                C && j && o.jsxs(D, {
                  size: "T200",
                  priority: "300",
                  children: [
                    "Created by ",
                    o.jsxs("b", {
                      children: [
                        "@",
                        C
                      ]
                    }),
                    ` on ${qF(j)} ${eu(j, A)}`
                  ]
                }),
                c && o.jsx(Lf, {
                  variant: "Primary",
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.User
                  }),
                  beforeAlign: "Center",
                  description: "This is a direct message",
                  after: o.jsx(xe, {
                    onClick: B,
                    variant: "Secondary",
                    size: "300",
                    radii: "300",
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Invite another Member"
                    })
                  })
                })
              ]
            }),
            o.jsxs(E, {
              gap: "200",
              wrap: "Wrap",
              children: [
                !c && o.jsx(xe, {
                  onClick: B,
                  variant: "Secondary",
                  size: "300",
                  radii: "300",
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Invite another Member"
                  })
                }),
                typeof x == "string" && (((_b3 = r.getRoom(x)) == null ? void 0 : _b3.getMyMembership()) === Ht.Join ? o.jsx(xe, {
                  onClick: () => {
                    var _a7;
                    return a(x, (_a7 = b == null ? void 0 : b.predecessor) == null ? void 0 : _a7.event_id);
                  },
                  variant: "Success",
                  size: "300",
                  fill: "Soft",
                  radii: "300",
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Open Old Room"
                  })
                }) : o.jsx(xe, {
                  onClick: () => {
                    T(x);
                  },
                  variant: "Secondary",
                  size: "300",
                  fill: "Soft",
                  radii: "300",
                  disabled: S.status === ve.Loading,
                  after: S.status === ve.Loading ? o.jsx(dt, {
                    size: "50",
                    variant: "Secondary",
                    fill: "Soft"
                  }) : void 0,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Join Old Room"
                  })
                }))
              ]
            }),
            d && o.jsx(Pp, {
              room: t,
              requestClose: () => u(false)
            }),
            h && o.jsx(Qde, {
              onCancel: () => f(false),
              onInviteDirect: U,
              onConvertAndInvite: M,
              converting: z.status === ve.Loading,
              convertError: z.status === ve.Error ? z.error.message : void 0
            })
          ]
        })
      ]
    });
  });
  function Kfe(t, e) {
    const [n, r] = p.useState(void 0), i = p.useRef(e == null ? void 0 : e.alive);
    i.current = e == null ? void 0 : e.alive;
    const a = p.useRef(e == null ? void 0 : e.onReset);
    a.current = e == null ? void 0 : e.onReset;
    const s = p.useCallback((l) => {
      if (l) {
        r(l);
        return;
      }
      r(void 0), requestAnimationFrame(() => {
        i.current && !i.current() || (a.current && XD(t) && a.current(), Bt.focus(t), Gl(t));
      });
    }, [
      t
    ]);
    return {
      editId: n,
      handleEdit: s
    };
  }
  const yit = (t) => {
    p.useEffect(() => {
      let e = document.hasFocus();
      const n = () => {
        if (document.hasFocus()) {
          if (e) return;
          e = true, t(e);
        } else e && (e = false, t(e));
      };
      return document.addEventListener("focusin", n), document.addEventListener("focusout", n), () => {
        document.removeEventListener("focusin", n), document.removeEventListener("focusout", n);
      };
    }, [
      t
    ]);
  }, GO = 60, FF = (t) => t.getUnfilteredTimelineSet().getLiveTimeline(), Sy = (t, e) => t.getUnfilteredTimelineSet().getTimelineForEvent(e) ?? void 0, YO = (t, e) => {
    let n = t;
    for (; n.getNeighbouringTimeline(e); ) n = n.getNeighbouringTimeline(e);
    return n;
  }, _g = (t) => {
    const e = [];
    let n = YO(t, Tn.Backward);
    for (; n; ) e.push(n), n = n.getNeighbouringTimeline(Tn.Forward);
    return e;
  }, bit = (t) => {
    if (!t) return 0;
    const e = t.getEvents();
    return e ? e.length : 0;
  }, t1 = (t) => {
    const e = (n, r) => n + bit(r);
    return (t || []).filter(Boolean).reduce((n, r) => e(n, r), 0);
  }, xit = (t, e) => {
    const r = (t || []).filter(Boolean).reduce((i, a) => {
      if (i.found) return i;
      const s = a.getEvents(), l = s ? s.length : 0;
      return e < i.baseIndex + l ? (i.found = a, i) : (i.baseIndex += l, i);
    }, {
      baseIndex: 0
    });
    return [
      r.found,
      r.found ? r.baseIndex : 0
    ];
  }, wit = (t, e) => t - e, Dit = (t, e) => {
    if (!t) return;
    const n = t.getEvents();
    return n ? n[e] : void 0;
  }, B8 = (t, e, n) => {
    const r = t.indexOf(e);
    if (r === -1) return;
    const i = e.getEvents();
    if (!i) return;
    const a = i.findIndex((l) => l.getId() === n);
    return a === -1 ? void 0 : t.slice(0, r).reduce((l, c) => {
      const d = c.getEvents();
      return (d ? d.length : 0) + l;
    }, 0) + a;
  }, U0 = (t) => {
    const e = _g(FF(t)), n = t1(e);
    return {
      linkedTimelines: e,
      range: {
        start: Math.max(n - GO, 0),
        end: n
      }
    };
  }, Cit = () => ({
    range: {
      start: 0,
      end: 0
    },
    linkedTimelines: []
  }), P8 = (t, e = false) => {
    if (!V4e(t) && !q2(t.client, t)) return;
    const n = t.getEventReadUpTo(t.client.getUserId() ?? "");
    if (!n) return;
    const r = Sy(t, n);
    if (!r) return {
      readUptoEventId: n,
      inLiveTimeline: false,
      scrollTo: e
    };
    const i = YO(r, Tn.Forward);
    return {
      readUptoEventId: n,
      inLiveTimeline: i === t.getLiveTimeline(),
      scrollTo: e
    };
  }, IT = 12e3, BT = async (t, e) => new Promise((n, r) => {
    const i = globalThis.setTimeout(() => {
      r(new Error("Timed out loading event timeline"));
    }, e);
    t.then((a) => {
      globalThis.clearTimeout(i), n(a);
    }).catch((a) => {
      globalThis.clearTimeout(i), r(a);
    });
  }), Eit = (t, e, n, r) => p.useCallback(async (i) => Mg({
    name: "timeline.jump_load",
    op: "matrix.timeline"
  }, async () => {
    const a = performance.now();
    e.getUnfilteredTimelineSet().getTimelineForEvent(i) || (await BT(t.roomInitialSync(e.roomId, GO), IT), await BT(t.getLatestTimeline(e.getUnfilteredTimelineSet()), IT));
    const [s, l] = await ca(BT(t.getEventTimeline(e.getUnfilteredTimelineSet(), i), IT));
    if (!l) {
      r(s ?? null);
      return;
    }
    const c = _g(l), d = B8(c, l, i);
    if (d === void 0) {
      r(s ?? null);
      return;
    }
    oa("sable.timeline.jump_load_ms", performance.now() - a), n(i, c, d);
  }), [
    t,
    e,
    n,
    r
  ]), kit = (t, e, n, r) => {
    const i = p.useRef(e);
    i.current = e;
    const a = Kr(), [s, l] = p.useState("idle"), [c, d] = p.useState("idle"), u = p.useRef({
      backward: false,
      forward: false
    }), h = p.useMemo(() => {
      const f = (g) => {
        const m = g[0];
        if (!m) return;
        const v = _g(m);
        n(() => ({
          linkedTimelines: v
        }));
      };
      return async (g) => {
        var _a6, _b3;
        const m = g ? "backward" : "forward";
        if (u.current[m]) return;
        const { linkedTimelines: v } = i.current, y = g ? v[0] : v.at(-1);
        if (!y) return;
        if (!y.getPaginationToken(g ? Tn.Backward : Tn.Forward) && t1(v) !== t1(_g(y))) {
          f(v);
          return;
        }
        u.current[m] = true, a() && (g ? l : d)("loading");
        let b = false;
        try {
          const j = t1(v), [k] = await ca(t.paginateEventTimeline(y, {
            backwards: g,
            limit: r
          }));
          if (k) {
            a() && (g ? l : d)("error");
            return;
          }
          const C = y.getNeighbouringTimeline(g ? Tn.Backward : Tn.Forward) ?? y, x = C.getRoomId();
          if (((_a6 = x ? t.getRoom(x) : null) == null ? void 0 : _a6.hasEncryptionStateEvent()) && await ca(H4e(t, C)), a()) {
            const T = i.current.linkedTimelines, A = T[0];
            if (!A) {
              (g ? l : d)("idle");
              return;
            }
            f(T);
            const U = t1(_g(A)) - j;
            let z = false;
            if (U > 0 && U < 5) {
              const O = g ? T[0] : T[T.length - 1];
              if (!O) {
                (g ? l : d)("idle");
                return;
              }
              const M = g ? Tn.Backward : Tn.Forward;
              typeof ((_b3 = _g(O)[0]) == null ? void 0 : _b3.getPaginationToken(M)) == "string" && (u.current[m] = false, b = true, z = true, h(g));
            }
            z || (g ? l : d)("idle");
          }
        } finally {
          b || (u.current[m] = false);
        }
      };
    }, [
      t,
      a,
      n,
      r,
      l,
      d
    ]);
    return {
      paginate: h,
      backwardStatus: s,
      forwardStatus: c
    };
  }, Sit = (t, e) => {
    const n = p.useRef(e);
    n.current = e, p.useEffect(() => {
      let r = FF(t), i = Date.now();
      const a = (l, c, d, u, h) => {
        if ((c == null ? void 0 : c.roomId) !== t.roomId) return;
        const f = FF(t);
        f !== r && (r = f, i = Date.now()), (h.liveEvent || !d && !u && h.timeline === r && l.getTs() >= i - 6e4) && n.current(l);
      }, s = (l, c) => {
        (c == null ? void 0 : c.roomId) === t.roomId && n.current(l);
      };
      return t.on(mt.Timeline, a), t.on(mt.Redaction, s), () => {
        t.removeListener(mt.Timeline, a), t.removeListener(mt.Redaction, s);
      };
    }, [
      t
    ]);
  }, jit = (t, e) => {
    const n = p.useRef(e);
    n.current = e, p.useEffect(() => {
      const r = (i, a, s, l, c) => {
        var _a6;
        (a == null ? void 0 : a.roomId) !== t.roomId || c.liveEvent || ((_a6 = i.getRelation()) == null ? void 0 : _a6.rel_type) === Xn.Replace && n.current();
      };
      return t.on(mt.Timeline, r), () => {
        t.removeListener(mt.Timeline, r);
      };
    }, [
      t
    ]);
  }, Tit = (t, e) => {
    const n = p.useRef(e);
    n.current = e, p.useEffect(() => {
      const r = (s) => {
        s.roomId === t.roomId && n.current();
      }, i = () => {
        n.current();
      }, a = t.getUnfilteredTimelineSet();
      return t.on(mt.TimelineRefresh, r), a.on(mt.TimelineReset, i), () => {
        t.removeListener(mt.TimelineRefresh, r), a.removeListener(mt.TimelineReset, i);
      };
    }, [
      t
    ]);
  }, Rit = (t, e) => {
    const n = p.useRef(e);
    n.current = e, p.useEffect(() => {
      const r = () => n.current();
      return t.on(jr.New, r), t.on(jr.Update, r), t.on(jr.NewReply, r), () => {
        t.removeListener(jr.New, r), t.removeListener(jr.Update, r), t.removeListener(jr.NewReply, r);
      };
    }, [
      t
    ]);
  };
  function Ait({ room: t, mx: e, eventId: n, isAtBottom: r, isAtBottomRef: i, scrollToBottom: a, unreadInfo: s, setUnreadInfo: l, hideReadsRef: c, readUptoEventIdRef: d }) {
    var _a6;
    const u = Kr(), [h, f] = p.useState(() => n ? Cit() : {
      linkedTimelines: U0(t).linkedTimelines
    }), [g, m] = p.useState(), v = p.useRef(false), y = t1(h.linkedTimelines), w = h.linkedTimelines.at(-1) === FF(t), b = typeof ((_a6 = h.linkedTimelines[0]) == null ? void 0 : _a6.getPaginationToken(Tn.Backward)) == "string", j = p.useRef(w);
    j.current = w;
    const { paginate: k, backwardStatus: C, forwardStatus: x } = kit(e, h, f, GO), S = p.useRef(y);
    p.useEffect(() => {
      const O = S.current, M = y - O;
      if (S.current = y, M === 0) return;
      const I = M > 1;
      let N;
      M === 1 ? N = "single" : M <= 20 ? N = "small" : M <= 100 ? N = "medium" : N = "large", wa({
        category: "timeline.events",
        message: `Timeline: ${M} event${M === 1 ? "" : "s"} added (${N})`,
        level: I ? "info" : "debug",
        data: {
          delta: M,
          batchSize: N,
          eventsLength: y,
          prevEventsLength: O,
          liveTimelineLinked: w,
          atBottom: r
        }
      }), M > 50 && w && wC("Timeline: large event batch from sliding sync", {
        level: "warning",
        extra: {
          delta: M,
          eventsLength: y,
          atBottom: r
        },
        tags: {
          feature: "timeline",
          batchSize: N
        }
      });
    }, [
      y,
      w,
      r
    ]);
    const T = Eit(e, t, p.useCallback((O, M, I) => {
      u() && (f({
        linkedTimelines: M
      }), m({
        index: I,
        scrollTo: true,
        highlight: O !== d.current
      }));
    }, [
      u,
      d
    ]), p.useCallback(() => {
      u() && (f({
        linkedTimelines: U0(t).linkedTimelines
      }), a("instant"));
    }, [
      u,
      t,
      a
    ])), A = p.useRef(y), B = p.useRef(y);
    B.current = y, Sit(t, p.useCallback((O) => {
      const { threadRootId: M } = O;
      if (M === void 0) {
        if (i.current && j.current) {
          document.hasFocus() && (!(s == null ? void 0 : s.readUptoEventId) || O.getSender() === e.getUserId()) && requestAnimationFrame(() => As(e, O.getRoomId(), c.current)), !document.hasFocus() && !s && l(P8(t)), a(O.getSender() === e.getUserId() ? "instant" : "smooth"), A.current = B.current + 1, f((I) => ({
            ...I
          }));
          return;
        }
        f((I) => ({
          ...I
        })), s || l(P8(t));
      }
    }, [
      e,
      t,
      i,
      s,
      a,
      l,
      c
    ])), p.useEffect(() => {
      const O = (M, I) => {
        (I == null ? void 0 : I.roomId) === t.roomId && f((N) => ({
          ...N
        }));
      };
      return t.on(mt.LocalEchoUpdated, O), () => {
        t.removeListener(mt.LocalEchoUpdated, O);
      };
    }, [
      t,
      f
    ]), Tit(t, p.useCallback(() => {
      const O = i.current;
      v.current = O, f({
        linkedTimelines: U0(t).linkedTimelines
      }), O && a("instant");
    }, [
      t,
      i,
      a
    ])), jit(t, p.useCallback(() => {
      f((O) => ({
        ...O
      }));
    }, [])), Rit(t, p.useCallback(() => {
      f((O) => ({
        ...O
      }));
    }, [])), p.useEffect(() => {
      const O = v.current;
      O && (v.current = false), !(!(r || O) || !w && !O || y === 0) && (y <= A.current && !O || (A.current = y, a("instant")));
    }, [
      r,
      w,
      y,
      a
    ]), p.useEffect(() => {
      n || h.linkedTimelines.length > 0 || FF(t).getEvents().length !== 0 && f({
        linkedTimelines: U0(t).linkedTimelines
      });
    }, [
      n,
      t,
      h.linkedTimelines.length
    ]);
    const U = p.useRef(t.roomId), z = p.useRef(n);
    return z.current = n, p.useEffect(() => {
      U.current !== t.roomId && (U.current = t.roomId, !z.current && f({
        linkedTimelines: U0(t).linkedTimelines
      }));
    }, [
      t
    ]), {
      timeline: h,
      setTimeline: f,
      eventsLength: y,
      liveTimelineLinked: w,
      canPaginateBack: b,
      backwardStatus: C,
      forwardStatus: x,
      handleTimelinePagination: k,
      loadEventTimeline: T,
      focusItem: g,
      setFocusItem: m
    };
  }
  function Iit({ room: t, mx: e, editor: n, nicknames: r, globalProfiles: i, spaceId: a, openUserRoomProfile: s, activeReplyId: l, setReplyDraft: c, openThreadId: d, setOpenThread: u, handleEdit: h, handleOpenEvent: f }) {
    const g = p.useCallback((C) => {
      const x = C.currentTarget.getAttribute("data-event-id");
      x && f(x);
    }, [
      f
    ]), m = p.useCallback((C) => {
      C.preventDefault(), C.stopPropagation();
      const x = C.currentTarget.getAttribute("data-user-id");
      if (!x) return;
      const S = i[x], T = (S == null ? void 0 : S.extended) ? {
        ...S.extended
      } : void 0;
      T && (delete T[Of], delete T[Wg], delete T[Gg], delete T[a4], delete T[V2], delete T[H2], delete T[J1], delete T[Z1], delete T[$2], delete T[W2], delete T.avatar_url, delete T.displayname, delete T[Kg], delete T[qg]), s(t.roomId, a, x, C.currentTarget.getBoundingClientRect(), void 0, {
        pronouns: S == null ? void 0 : S.pronouns,
        bio: S == null ? void 0 : S.bio,
        timezone: S == null ? void 0 : S.timezone,
        extended: T
      });
    }, [
      t.roomId,
      a,
      s,
      i
    ]), v = p.useCallback((C) => {
      C.preventDefault();
      const x = C.currentTarget.getAttribute("data-user-id");
      if (!x) return;
      const S = gr(t, x, r) ?? _n(x) ?? x;
      n.insertNode(Ig(x, S.startsWith("@") ? S : `@${S}`, x === e.getUserId())), Bt.focus(n), Gl(n);
    }, [
      e,
      t,
      n,
      r
    ]), y = p.useCallback((C, x = false) => {
      if (l === C) {
        c(void 0);
        return;
      }
      const S = t.findEventById(C);
      if (!S) return;
      const T = eh(C, S, t.getUnfilteredTimelineSet());
      let A;
      T && (A = T.getContent()["m.new_content"]);
      const B = A ?? S.getContent(), { body: U, formatted_body: z } = B, { "m.relates_to": O } = x ? {
        "m.relates_to": {
          rel_type: "m.thread",
          event_id: C
        }
      } : S.getWireContent(), M = S.getSender();
      M && c({
        userId: M,
        eventId: C,
        body: typeof U == "string" ? U : "",
        formattedBody: typeof z == "string" ? z : "",
        relation: O
      });
    }, [
      t,
      c,
      l
    ]), w = p.useCallback((C, x = false) => {
      const S = C.currentTarget.getAttribute("data-event-id");
      if (!S) {
        c(void 0);
        return;
      }
      if (x) {
        const T = t.findEventById(S);
        T && !t.getThread(S) && t.createThread(S, T, [], false), u(d === S ? void 0 : S);
        return;
      }
      y(S, false);
    }, [
      y,
      c,
      u,
      d,
      t
    ]), b = p.useCallback((C, x, S) => {
      VB(e, t, C, x, S);
    }, [
      e,
      t
    ]), j = p.useCallback((C) => {
      C.getAssociatedStatus() === Vn.NOT_SENT && e.resendEvent(C, t).catch(() => {
      });
    }, [
      e,
      t
    ]), k = p.useCallback((C) => {
      C.getAssociatedStatus() === Vn.NOT_SENT && e.cancelPendingEvent(C);
    }, [
      e
    ]);
    return {
      handleOpenReply: g,
      handleUserClick: m,
      handleUsernameClick: v,
      handleReplyClick: w,
      handleReactionToggle: b,
      handleResend: j,
      handleDeleteFailedSend: k,
      handleEdit: h,
      setOpenThread: u
    };
  }
  function Gfe(t, e) {
    if (!(e < 0)) for (let n = e; n >= 0; n -= 1) {
      const r = t.findIndex((i) => i.itemIndex === n);
      if (r >= 0) return {
        rowIndex: r,
        focusRawIndex: n
      };
    }
  }
  const oX = /* @__PURE__ */ new Set([
    "m.room.message",
    "m.room.message.encrypted",
    "m.sticker",
    "m.room.encrypted"
  ]), aX = (t) => t === "m.room.encrypted" || t === "m.room.message.encrypted" ? "m.room.message" : t, sX = (t) => {
    var _a6, _b3;
    return ((_b3 = (_a6 = t.getContent()) == null ? void 0 : _a6["com.beeper.per_message_profile"]) == null ? void 0 : _b3.id) ?? null;
  };
  function Yfe({ items: t, linkedTimelines: e, ignoredUsersSet: n, showHiddenEvents: r, showTombstoneEvents: i, mxUserId: a, readUptoEventId: s, hideMembershipEvents: l, hideNickAvatarEvents: c, isReadOnly: d, hideMemberInReadOnly: u, skipThreadFilter: h }) {
    return p.useMemo(() => {
      let f, g = false, m = false, v = false;
      return t.reduce((w, b) => {
        const [j, k] = xit(e, b);
        if (!j) return w;
        const C = j.getTimelineSet(), x = Dit(j, wit(b, k));
        if (!x) return w;
        const { threadRootId: S } = x, T = x.getId();
        if (!T) return w;
        const A = x.getSender() ?? null;
        if (A && n.has(A) || x.isRedacted() && !(r || i)) return w;
        const B = x.getType();
        if (B === "m.room.member") {
          const L = xk(x);
          if (u && d || L && l || !L && c) return w;
        }
        if (!r && ![
          "m.room.message",
          "m.room.message.encrypted",
          "m.sticker",
          "m.room.member",
          "m.room.name",
          "m.room.topic",
          "m.room.avatar",
          "org.matrix.msc3401.call.member"
        ].includes(B) && (Object.keys(x.getContent()).length === 0 || x.getRelation() || x.isRedaction()) || !h && S !== void 0 && S !== T && Da(x, S) || is(x)) return w;
        !m && s && (m = (f ? f.getId() : void 0) === s), v || (v = f ? !dI(f.getTs(), x.getTs()) : false);
        const z = oX.has(B);
        let O = false;
        if (g && !v && f !== void 0) if (z) {
          const L = eAe(f.getTs(), x.getTs()) < 2, H = f.getSender() === A, V = aX(f.getType()) === aX(B);
          O = (!m || A === a) && H && V && L && sX(f) === sX(x);
        } else O = !oX.has(f.getType());
        const M = m && A !== a, I = v, N = {
          id: T,
          itemIndex: b,
          mEvent: x,
          timelineSet: C,
          eventSender: A,
          collapsed: O,
          willRenderNewDivider: M,
          willRenderDayDivider: I
        };
        return f = x, g = true, M && (m = false), I && (v = false), w.push(N), w;
      }, []);
    }, [
      t,
      e,
      n,
      r,
      i,
      a,
      s,
      l,
      c,
      d,
      u,
      h
    ]);
  }
  function T0({ room: t, userId: e, userName: n }) {
    const { color: r, font: i } = rm(e, t ?? {}), a = Ls(), s = p.useCallback((l) => {
      l.preventDefault(), l.stopPropagation(), a(t.roomId, void 0, e, l.currentTarget.getBoundingClientRect());
    }, [
      t,
      e,
      a
    ]);
    return o.jsx(D, {
      as: "a",
      onClick: s,
      truncate: true,
      children: o.jsxs("b", {
        style: {
          color: r,
          font: i
        },
        children: [
          n ?? e,
          " "
        ]
      })
    });
  }
  function PT({ room: t, mEventId: e, openThreadId: n, onToggle: r }) {
    var _a6, _b3, _c3;
    const i = be(), a = hn(), s = Ze(qr), [l, c] = p.useState(0), d = t.getThread(e);
    p.useEffect(() => {
      if (!d) return () => {
      };
      const x = () => c((S) => S + 1);
      return d.on(jr.NewReply, x), d.on(jr.Update, x), t.on(mt.Redaction, x), () => {
        d.off(jr.NewReply, x), d.off(jr.Update, x), t.off(mt.Redaction, x);
      };
    }, [
      t,
      d
    ]);
    const u = p.useMemo(() => {
      if (d) {
        const S = d.events.filter((T) => T.getId() !== e && !is(T) && Da(T, e));
        if (S.length > 0) return S;
      }
      return _g(FF(t)).flatMap((S) => S.getEvents()).filter((S) => S.getId() !== e && !is(S) && Da(S, e));
    }, [
      t,
      e,
      d,
      l
    ]);
    if (!d) return null;
    const f = ((_b3 = (_a6 = d.rootEvent) == null ? void 0 : _a6.getServerAggregatedRelation("m.thread")) == null ? void 0 : _b3.count) ?? d.length ?? 0;
    if (f === 0) return null;
    const g = [], m = /* @__PURE__ */ new Set();
    u.forEach((x) => {
      const S = x.getSender();
      S && !m.has(S) && (m.add(S), g.push(S));
    });
    const v = u.at(-1);
    let y = "", w = "";
    v && (y = v.getSender() ?? "", w = ((_c3 = v.getContent()) == null ? void 0 : _c3.body) ?? "");
    const b = gr(t, y, s) ?? _n(y) ?? y, j = n === e, k = t.getThreadUnreadNotificationCount(e, ir.Total), C = t.getThreadUnreadNotificationCount(e, ir.Highlight);
    return o.jsxs(Qe, {
      size: "400",
      variant: j ? "Primary" : "SurfaceVariant",
      radii: "300",
      before: g.length > 0 ? o.jsx(E, {
        alignItems: "Center",
        style: {
          gap: 0
        },
        children: g.slice(0, 3).map((x, S) => {
          const T = Jc(t, x), A = T ? Cn(i, T, a, 20, 20, "crop") ?? void 0 : void 0, B = gr(t, x, s) ?? _n(x) ?? x;
          return o.jsx(xn, {
            size: "200",
            style: {
              marginLeft: S > 0 ? "-4px" : 0
            },
            children: o.jsx(Si, {
              userId: x,
              src: A,
              alt: B,
              renderFallback: () => {
                var _a7;
                return o.jsx("span", {
                  style: {
                    fontSize: "10px",
                    fontWeight: "bold",
                    lineHeight: 1
                  },
                  children: ((_a7 = B[0]) == null ? void 0 : _a7.toUpperCase()) ?? "?"
                });
              }
            })
          }, x);
        })
      }) : void 0,
      onClick: r,
      style: {
        marginTop: ee.space.S200
      },
      children: [
        o.jsxs(D, {
          size: "T300",
          style: {
            whiteSpace: "nowrap"
          },
          children: [
            f,
            "\xA0",
            f === 1 ? "reply" : "replies"
          ]
        }),
        w && o.jsxs(D, {
          size: "T300",
          style: {
            opacity: 0.7,
            overflow: "hidden",
            textOverflow: "ellipsis",
            whiteSpace: "nowrap",
            maxWidth: He(180)
          },
          children: [
            "\xA0\xB7\xA0",
            b,
            ":\xA0",
            w.slice(0, 60)
          ]
        }),
        k > 0 && o.jsx(f3, {
          children: o.jsx(Sp, {
            highlight: C > 0,
            count: k
          })
        })
      ]
    });
  }
  function Zfe({ room: t, mx: e, pushProcessor: n, nicknames: r, imagePackRooms: i, settings: { messageLayout: a, messageSpacing: s, hideReads: l, showDeveloperTools: c, hour24Clock: d, dateFormatString: u, mediaAutoLoad: h, showBundledPreview: f, showUrlPreview: g, showClientUrlPreview: m, autoplayStickers: v, hideMemberInReadOnly: y, isReadOnly: w, hideMembershipEvents: b, hideNickAvatarEvents: j, showHiddenEvents: k, hideThreadChip: C }, state: { focusItem: x, editId: S, activeReplyId: T, openThreadId: A }, permissions: { canRedact: B, canDeleteOwn: U, canSendReaction: z, canPinEvent: O }, callbacks: { onUserClick: M, onUsernameClick: I, onReplyClick: N, onReactionToggle: L, onEditId: H, onResend: V, onDeleteFailedSend: Z, setOpenThread: Y, handleOpenReply: oe }, utils: { htmlReactParserOptions: ue, linkifyOpts: ie, getMemberPowerTag: de, parseMemberEvent: ne } }) {
    const { t: ae } = Nae();
    return wS({
      [ce.RoomMessage]: (X, K, G, le, te) => {
        var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4;
        const { replyEventId: re, threadRootId: he } = K, se = Da(K, he), ye = se ? he : void 0, we = (_c3 = (_b3 = (_a6 = K.getWireContent()) == null ? void 0 : _a6["m.relates_to"]) == null ? void 0 : _b3["m.in_reply_to"]) == null ? void 0 : _c3.event_id, Ee = se && typeof we == "string" ? we : void 0, ke = C && ((_e13 = (_d4 = K.getWireContent()) == null ? void 0 : _d4["m.relates_to"]) == null ? void 0 : _e13.is_falling_back) ? void 0 : Ee ?? re, Ne = ID(le, X), lt = Ne == null ? void 0 : Ne.getSortedAnnotationsByKey(), Rt = lt && lt.length > 0, We = (x == null ? void 0 : x.index) === G && x.highlight, yt = T === X, Xt = n.actionsForEvent(K);
        let nn;
        (Xt == null ? void 0 : Xt.notify) && ((_f4 = Xt.tweaks) == null ? void 0 : _f4.highlight) && (nn = ((_g4 = Xt.tweaks) == null ? void 0 : _g4.sound) ? "loud" : "silent");
        const bt = eh(X, K, le);
        let At;
        bt && (At = bt.getContent()["m.new_content"]);
        const $t = K.getContent() || {}, Lt = Object.keys($t).length > 0 ? $t : K.getOriginalContent(), wt = (() => At ?? Lt), st = K.getSender() ?? "", Be = gr(t, st, r) ?? _n(st) ?? st, Re = Lt["moe.sable.message.forward"], Ue = Re ? {
          isForwarded: true,
          originalTimestamp: typeof Re.original_timestamp == "number" ? Re.original_timestamp : K.getTs(),
          originalRoomId: Re.original_room_id ?? t.roomId,
          originalEventId: Re.original_event_id ?? "",
          originalEventPrivate: Re.original_event_private ?? false
        } : void 0;
        return o.jsx(xT, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          messageSpacing: s,
          messageLayout: a,
          highlight: We,
          isMarked: yt,
          notifyHighlight: nn,
          edit: S === X,
          canDelete: B || U && st === e.getUserId(),
          canSendReaction: z,
          canPinEvent: O,
          imagePackRooms: i,
          relations: Rt ? Ne : void 0,
          onUserClick: M,
          onUsernameClick: I,
          onReplyClick: N,
          onReactionToggle: L,
          senderId: st,
          senderDisplayName: Be,
          messageForwardedProps: Ue,
          sendStatus: K.getAssociatedStatus(),
          onResend: V,
          onDeleteFailedSend: Z,
          onEditId: H,
          collapse: te,
          activeReplyId: T,
          reply: ke && o.jsx(Pu, {
            room: t,
            timelineSet: le,
            replyEventId: ke,
            threadRootId: C ? void 0 : ye,
            mentions: $t["m.mentions"],
            onClick: oe
          }),
          reactions: (() => {
            const qe = !C && (t.getThread(X) || he) ? o.jsx(PT, {
              room: t,
              mEventId: X,
              openThreadId: A,
              onToggle: () => Y(A === X ? void 0 : X)
            }) : null;
            if (!(!Ne && !qe)) return o.jsxs(o.Fragment, {
              children: [
                Ne && o.jsx(Q5, {
                  style: {
                    marginTop: ee.space.S200
                  },
                  room: t,
                  relations: Ne,
                  mEventId: X,
                  canSendReaction: z,
                  canDeleteOwn: U,
                  onReactionToggle: L
                }),
                qe
              ]
            });
          })(),
          hideReadReceipts: l,
          showDeveloperTools: c,
          memberPowerTag: de(st),
          hour24Clock: d,
          dateFormatString: u,
          children: K.isRedacted() ? o.jsx(ss, {
            reason: (_h4 = K.getUnsigned().redacted_because) == null ? void 0 : _h4.content.reason
          }) : o.jsx(oh, {
            displayName: Be,
            msgType: (At ?? Lt).msgtype ?? "",
            ts: K.getTs(),
            edited: !!bt,
            getContent: wt,
            mediaAutoLoad: h,
            urlPreview: g,
            bundledPreview: f,
            clientUrlPreview: m,
            htmlReactParserOptions: ue,
            linkifyOpts: ie,
            outlineAttachment: a === Mr.Bubble
          })
        }, X);
      },
      [ce.RoomMessageEncrypted]: (X, K, G, le, te) => {
        var _a6, _b3, _c3, _d4, _e13, _f4, _g4;
        const { replyEventId: re, threadRootId: he } = K, se = Da(K, he), ye = se ? he : void 0, we = (_c3 = (_b3 = (_a6 = K.getWireContent()) == null ? void 0 : _a6["m.relates_to"]) == null ? void 0 : _b3["m.in_reply_to"]) == null ? void 0 : _c3.event_id, Ee = se && typeof we == "string" ? we : void 0, ke = C && ((_e13 = (_d4 = K.getWireContent()) == null ? void 0 : _d4["m.relates_to"]) == null ? void 0 : _e13.is_falling_back) ? void 0 : Ee ?? re, Ne = ID(le, X), lt = Ne == null ? void 0 : Ne.getSortedAnnotationsByKey(), Rt = lt && lt.length > 0, We = (x == null ? void 0 : x.index) === G && x.highlight, yt = T === X, Xt = K.getSender() ?? "", nn = gr(t, Xt, r) ?? _n(Xt) ?? Xt, bt = n.actionsForEvent(K);
        let At;
        return (bt == null ? void 0 : bt.notify) && ((_f4 = bt.tweaks) == null ? void 0 : _f4.highlight) && (At = ((_g4 = bt.tweaks) == null ? void 0 : _g4.sound) ? "loud" : "silent"), o.jsx(xT, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          messageSpacing: s,
          messageLayout: a,
          highlight: We,
          isMarked: yt,
          notifyHighlight: At,
          edit: S === X,
          canDelete: B || U && Xt === e.getUserId(),
          canSendReaction: z,
          canPinEvent: O,
          imagePackRooms: i,
          relations: Rt ? Ne : void 0,
          onUserClick: M,
          onUsernameClick: I,
          onReplyClick: N,
          onReactionToggle: L,
          onEditId: H,
          senderId: Xt,
          activeReplyId: T,
          senderDisplayName: nn,
          sendStatus: K.getAssociatedStatus(),
          onResend: V,
          collapse: te,
          onDeleteFailedSend: Z,
          reply: ke && o.jsx(Pu, {
            room: t,
            timelineSet: le,
            replyEventId: ke,
            threadRootId: C ? void 0 : ye,
            onClick: oe
          }),
          reactions: (() => {
            const $t = !C && (t.getThread(X) || he) ? o.jsx(PT, {
              room: t,
              mEventId: X,
              openThreadId: A,
              onToggle: () => Y(A === X ? void 0 : X)
            }) : null;
            if (!(!Ne && !$t)) return o.jsxs(o.Fragment, {
              children: [
                Ne && o.jsx(Q5, {
                  style: {
                    marginTop: ee.space.S200
                  },
                  room: t,
                  relations: Ne,
                  mEventId: X,
                  canSendReaction: z,
                  canDeleteOwn: U,
                  onReactionToggle: L
                }),
                $t
              ]
            });
          })(),
          hideReadReceipts: l,
          showDeveloperTools: c,
          memberPowerTag: de(Xt),
          hour24Clock: d,
          dateFormatString: u,
          children: o.jsx(TS, {
            mEvent: K,
            children: () => {
              if (K.isRedacted()) return o.jsx(ss, {});
              const $t = K.getType();
              if ($t === ce.Sticker) return o.jsx(cp, {
                content: K.getContent(),
                renderImageContent: (Lt) => o.jsx(rh, {
                  ...Lt,
                  autoPlay: h,
                  renderImage: (wt) => !v && wt.src ? o.jsx(rp, {
                    src: wt.src,
                    children: o.jsx(as, {
                      ...wt,
                      loading: "lazy"
                    })
                  }) : o.jsx(as, {
                    ...wt,
                    loading: "lazy"
                  }),
                  renderViewer: (wt) => o.jsx(Yc, {
                    ...wt
                  })
                })
              });
              if ($t === ce.RoomMessage) {
                const Lt = eh(X, K, le);
                let wt;
                Lt && (wt = Lt.getContent()["m.new_content"]);
                const st = K.getContent() || {}, Be = Object.keys(st).length > 0 ? st : K.getOriginalContent(), Re = (() => wt ?? Be);
                return o.jsx(oh, {
                  displayName: nn,
                  msgType: (wt ?? Be).msgtype ?? "",
                  ts: K.getTs(),
                  edited: !!Lt,
                  getContent: Re,
                  mediaAutoLoad: h,
                  bundledPreview: f,
                  urlPreview: g,
                  clientUrlPreview: m,
                  htmlReactParserOptions: ue,
                  linkifyOpts: ie,
                  outlineAttachment: a === Mr.Bubble
                });
              }
              return o.jsx(D, {
                children: o.jsx(UP, {})
              });
            }
          })
        }, X);
      },
      [ce.Sticker]: (X, K, G, le, te) => {
        var _a6, _b3, _c3, _d4, _e13, _f4;
        const { replyEventId: re, threadRootId: he } = K, se = Da(K, he), ye = se ? he : void 0, we = (_c3 = (_b3 = (_a6 = K.getWireContent()) == null ? void 0 : _a6["m.relates_to"]) == null ? void 0 : _b3["m.in_reply_to"]) == null ? void 0 : _c3.event_id, Ee = se && typeof we == "string" ? we : void 0, ke = C && ((_e13 = (_d4 = K.getWireContent()) == null ? void 0 : _d4["m.relates_to"]) == null ? void 0 : _e13.is_falling_back) ? void 0 : Ee ?? re, Ne = ID(le, X), lt = Ne == null ? void 0 : Ne.getSortedAnnotationsByKey(), Rt = lt && lt.length > 0, We = (x == null ? void 0 : x.index) === G && x.highlight, yt = T === X, Xt = K.getSender() ?? "", nn = gr(t, Xt, r) ?? _n(Xt) ?? Xt, bt = K.getContent() ?? {};
        return o.jsx(xT, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          messageSpacing: s,
          messageLayout: a,
          highlight: We,
          isMarked: yt,
          canDelete: B || U && Xt === e.getUserId(),
          canSendReaction: z,
          canPinEvent: O,
          imagePackRooms: i,
          relations: Rt ? Ne : void 0,
          onUserClick: M,
          onUsernameClick: I,
          onReplyClick: N,
          onReactionToggle: L,
          senderId: Xt,
          activeReplyId: T,
          senderDisplayName: nn,
          sendStatus: K.getAssociatedStatus(),
          onResend: V,
          onDeleteFailedSend: Z,
          collapse: te,
          reply: ke && o.jsx(Pu, {
            room: t,
            timelineSet: le,
            replyEventId: ke,
            threadRootId: C ? void 0 : ye,
            mentions: bt["m.mentions"],
            onClick: oe
          }),
          reactions: (() => {
            const At = !C && (t.getThread(X) || he) ? o.jsx(PT, {
              room: t,
              mEventId: X,
              openThreadId: A,
              onToggle: () => Y(A === X ? void 0 : X)
            }) : null;
            if (!(!Ne && !At)) return o.jsxs(o.Fragment, {
              children: [
                Ne && o.jsx(Q5, {
                  style: {
                    marginTop: ee.space.S200
                  },
                  room: t,
                  relations: Ne,
                  mEventId: X,
                  canSendReaction: z,
                  canDeleteOwn: U,
                  onReactionToggle: L
                }),
                At
              ]
            });
          })(),
          hideReadReceipts: l,
          showDeveloperTools: c,
          memberPowerTag: de(Xt),
          hour24Clock: d,
          dateFormatString: u,
          children: K.isRedacted() ? o.jsx(ss, {
            reason: (_f4 = K.getUnsigned().redacted_because) == null ? void 0 : _f4.content.reason
          }) : o.jsx(cp, {
            content: K.getContent(),
            renderImageContent: (At) => o.jsx(rh, {
              ...At,
              autoPlay: h,
              renderImage: ($t) => !v && $t.src ? o.jsx(rp, {
                src: $t.src,
                children: o.jsx(as, {
                  ...$t,
                  loading: "lazy"
                })
              }) : o.jsx(as, {
                ...$t,
                loading: "lazy"
              }),
              renderViewer: ($t) => o.jsx(Yc, {
                ...$t
              })
            })
          })
        }, X);
      },
      [ce.RoomMember]: (X, K, G, le, te) => {
        const re = xk(K);
        if (y && w || re && b || !re && j) return null;
        const he = (x == null ? void 0 : x.index) === G && x.highlight, se = T === X, ye = ne(K), we = o.jsx(Ma, {
          ts: K.getTs(),
          compact: a === Mr.Compact,
          hour24Clock: d,
          dateFormatString: u
        });
        return o.jsx(Zh, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          highlight: he,
          isMarked: se,
          collapse: te,
          canDelete: B || K.getSender() === e.getUserId(),
          onReplyClick: N,
          hideReadReceipts: l,
          showDeveloperTools: c,
          messageSpacing: s,
          children: o.jsx(Kh, {
            messageLayout: a,
            time: we,
            iconSrc: ye.icon,
            content: o.jsx(D, {
              size: "T300",
              priority: "300",
              children: o.jsx(E, {
                direction: "Row",
                style: {
                  flexWrap: "wrap",
                  columnGap: He(6)
                },
                children: ye.body
              })
            })
          })
        }, X);
      },
      [ce.RoomName]: (X, K, G, le, te) => {
        const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se, r) || _n(se), we = o.jsx(Ma, {
          ts: K.getTs(),
          compact: a === Mr.Compact,
          hour24Clock: d,
          dateFormatString: u
        });
        return o.jsx(Zh, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          highlight: re,
          isMarked: he,
          collapse: te,
          canDelete: B || se === e.getUserId(),
          onReplyClick: N,
          hideReadReceipts: l,
          showDeveloperTools: c,
          messageSpacing: s,
          children: o.jsx(Kh, {
            messageLayout: a,
            time: we,
            iconSrc: q.Hash,
            content: o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsxs(D, {
                size: "T300",
                priority: "300",
                children: [
                  o.jsx(T0, {
                    userId: se,
                    userName: ye,
                    room: t
                  }),
                  ae("Organisms.RoomCommon.changed_room_name")
                ]
              })
            })
          })
        }, X);
      },
      [ce.RoomTopic]: (X, K, G, le, te) => {
        const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se, r) || _n(se), we = o.jsx(Ma, {
          ts: K.getTs(),
          compact: a === Mr.Compact,
          hour24Clock: d,
          dateFormatString: u
        });
        return o.jsx(Zh, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          highlight: re,
          isMarked: he,
          collapse: te,
          canDelete: B || se === e.getUserId(),
          onReplyClick: N,
          hideReadReceipts: l,
          showDeveloperTools: c,
          messageSpacing: s,
          children: o.jsx(Kh, {
            messageLayout: a,
            time: we,
            iconSrc: q.Hash,
            content: o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsxs(D, {
                size: "T300",
                priority: "300",
                children: [
                  o.jsx(T0, {
                    userId: se,
                    userName: ye,
                    room: t
                  }),
                  " changed room topic"
                ]
              })
            })
          })
        }, X);
      },
      [ce.RoomAvatar]: (X, K, G, le, te) => {
        const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se, r) || _n(se), we = o.jsx(Ma, {
          ts: K.getTs(),
          compact: a === Mr.Compact,
          hour24Clock: d,
          dateFormatString: u
        });
        return o.jsx(Zh, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          highlight: re,
          isMarked: he,
          collapse: te,
          canDelete: B || se === e.getUserId(),
          onReplyClick: N,
          hideReadReceipts: l,
          showDeveloperTools: c,
          messageSpacing: s,
          children: o.jsx(Kh, {
            messageLayout: a,
            time: we,
            iconSrc: q.Hash,
            content: o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsxs(D, {
                size: "T300",
                priority: "300",
                children: [
                  o.jsx(T0, {
                    userId: se,
                    userName: ye,
                    room: t
                  }),
                  " changed room avatar"
                ]
              })
            })
          })
        }, X);
      },
      [ce.GroupCallMemberPrefix]: (X, K, G, le, te) => {
        const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se) || _n(se), we = K.getContent(), Ee = K.getPrevContent(), ke = we.application;
        if (ke && "application" in Ee) return null;
        const Ne = o.jsx(Ma, {
          ts: K.getTs(),
          compact: a === Mr.Compact,
          hour24Clock: d,
          dateFormatString: u
        });
        return o.jsx(Zh, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          highlight: re,
          isMarked: he,
          collapse: te,
          canDelete: B || se === e.getUserId(),
          hideReadReceipts: l,
          onReplyClick: N,
          showDeveloperTools: c,
          messageSpacing: s,
          children: o.jsx(Kh, {
            messageLayout: a,
            time: Ne,
            iconSrc: ke ? q.Phone : q.PhoneDown,
            content: o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsxs(D, {
                size: "T300",
                priority: "300",
                children: [
                  o.jsx(T0, {
                    userId: se,
                    userName: ye,
                    room: t
                  }),
                  ke ? " joined the call" : " ended the call"
                ]
              })
            })
          })
        }, X);
      },
      [ce.RoomPinnedEvents]: (X, K, G, le, te) => {
        if (!k) return null;
        const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se, r) || _n(se), { pinned: we } = K.getContent(), Ee = K.getPrevContent().pinned, ke = Ee ? we == null ? void 0 : we.filter((yt) => !Ee.includes(yt)) : we == null ? void 0 : we.filter((yt) => yt.length > 0), Ne = Ee && we && Ee.filter((yt) => !we.includes(yt)) || [], lt = (ke ?? []).concat(...Ne ?? []), Rt = new Set(we ?? []), We = o.jsx(Ma, {
          ts: K.getTs(),
          compact: a === Mr.Compact,
          hour24Clock: d,
          dateFormatString: u
        });
        return o.jsx(Zh, {
          "data-message-item": G,
          "data-message-id": X,
          room: t,
          mEvent: K,
          highlight: re,
          isMarked: he,
          collapse: te,
          canDelete: B || se === e.getUserId(),
          onReplyClick: N,
          hideReadReceipts: l,
          showDeveloperTools: c,
          messageSpacing: s,
          children: o.jsx(Kh, {
            messageLayout: a,
            time: We,
            iconSrc: q.Pin,
            content: o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              children: [
                o.jsxs(D, {
                  size: "T300",
                  priority: "300",
                  children: [
                    o.jsx(T0, {
                      userId: se,
                      userName: ye,
                      room: t
                    }),
                    (ke == null ? void 0 : ke.length) > 0 && `pinned ${ke.length} message${ke.length > 1 ? "s" : ""}` || "",
                    (ke == null ? void 0 : ke.length) > 0 && (Ne == null ? void 0 : Ne.length) > 0 && " and " || "",
                    (Ne == null ? void 0 : Ne.length) > 0 && `unpinned ${Ne.length} message${Ne.length > 1 ? "s" : ""}` || "",
                    (!ke || ke.length <= 0) && (!Ne || Ne.length <= 0) && "has not changed the pins" || ":"
                  ]
                }),
                lt.length > 0 && lt.slice(0, 4).map((yt) => o.jsx(Pu, {
                  style: {
                    opacity: "80%"
                  },
                  room: t,
                  replyEventId: yt,
                  onClick: oe,
                  replyIcon: o.jsxs(o.Fragment, {
                    children: [
                      o.jsx(Q, {
                        size: "100",
                        src: q.Pin
                      }),
                      o.jsx(Q, {
                        size: "100",
                        src: Rt.has(yt) ? q.Plus : q.Minus
                      })
                    ]
                  })
                }, yt))
              ]
            })
          })
        }, X);
      }
    }, (X, K, G, le, te) => {
      if (!k) return null;
      const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se, r) || _n(se), we = o.jsx(Ma, {
        ts: K.getTs(),
        compact: a === Mr.Compact,
        hour24Clock: d,
        dateFormatString: u
      });
      return o.jsx(Zh, {
        "data-message-item": G,
        "data-message-id": X,
        room: t,
        mEvent: K,
        highlight: re,
        isMarked: he,
        collapse: te,
        canDelete: B || se === e.getUserId(),
        onReplyClick: N,
        hideReadReceipts: l,
        showDeveloperTools: c,
        messageSpacing: s,
        children: o.jsx(Kh, {
          messageLayout: a,
          time: we,
          iconSrc: q.Code,
          content: o.jsx(E, {
            grow: "Yes",
            direction: "Column",
            children: o.jsxs(D, {
              size: "T300",
              priority: "300",
              children: [
                o.jsx(T0, {
                  userId: se,
                  userName: ye,
                  room: t
                }),
                " sent ",
                o.jsx("code", {
                  className: nh,
                  children: K.getType()
                }),
                " state event"
              ]
            })
          })
        })
      }, X);
    }, (X, K, G, le, te) => {
      if (!k || Object.keys(K.getContent()).length === 0 || K.getRelation() || K.isRedaction()) return null;
      const re = (x == null ? void 0 : x.index) === G && x.highlight, he = T === X, se = K.getSender() ?? "", ye = gr(t, se, r) || _n(se), we = o.jsx(Ma, {
        ts: K.getTs(),
        compact: a === Mr.Compact,
        hour24Clock: d,
        dateFormatString: u
      });
      return o.jsx(Zh, {
        "data-message-item": G,
        "data-message-id": X,
        room: t,
        mEvent: K,
        highlight: re,
        isMarked: he,
        collapse: te,
        canDelete: B || se === e.getUserId(),
        onReplyClick: N,
        hideReadReceipts: l,
        showDeveloperTools: c,
        messageSpacing: s,
        children: o.jsx(Kh, {
          messageLayout: a,
          time: we,
          iconSrc: q.Code,
          content: o.jsx(E, {
            grow: "Yes",
            direction: "Column",
            children: o.jsxs(D, {
              size: "T300",
              priority: "300",
              children: [
                o.jsx("b", {
                  children: ye
                }),
                " sent ",
                o.jsx("code", {
                  className: nh,
                  children: K.getType()
                }),
                " event"
              ]
            })
          })
        })
      }, X);
    });
  }
  var Bit = Jr({
    defaultClassName: "RoomTimeline_TimelineFloat__1n936q90 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      position: {
        Top: "RoomTimeline_TimelineFloat_position_Top__1n936q91",
        Bottom: "RoomTimeline_TimelineFloat_position_Bottom__1n936q92"
      }
    },
    defaultVariants: {
      position: "Top"
    },
    compoundVariants: []
  }), Pit = "RoomTimeline_messageList__1n936q93";
  const Q_ = ft(({ position: t, className: e, ...n }, r) => o.jsx(E, {
    className: gt(Bit({
      position: t
    }), e),
    justifyContent: "Center",
    alignItems: "Center",
    gap: "200",
    ...n,
    ref: r
  })), lX = ft(({ variant: t, children: e, ...n }, r) => o.jsxs(E, {
    gap: "100",
    justifyContent: "Center",
    alignItems: "Center",
    ...n,
    ref: r,
    children: [
      o.jsx(nr, {
        style: {
          flexGrow: 1
        },
        variant: t,
        size: "300"
      }),
      e,
      o.jsx(nr, {
        style: {
          flexGrow: 1
        },
        variant: t,
        size: "300"
      })
    ]
  })), Mit = (t) => iE(t) ? "Today" : oE(t) ? "Yesterday" : qF(t);
  function Oit({ room: t, eventId: e, editor: n, onEditorReset: r, onEditLastMessageRef: i }) {
    const a = be(), s = Kr(), { editId: l, handleEdit: c } = Kfe(n, {
      onReset: r,
      alive: s
    }), { navigateRoom: d } = Wi(), [u] = Fe(ge, "hideReads"), [h] = Fe(ge, "messageLayout"), [f] = Fe(ge, "messageSpacing"), [g] = Fe(ge, "hideMembershipEvents"), [m] = Fe(ge, "hideNickAvatarEvents"), [v] = Fe(ge, "mediaAutoLoad"), [y] = Fe(ge, "bundledPreview"), [w] = Fe(ge, "urlPreview"), [b] = Fe(ge, "encUrlPreview"), [j] = Fe(ge, "clientUrlPreview"), [k] = Fe(ge, "encClientUrlPreview"), [C] = Fe(ge, "showHiddenEvents"), [x] = Fe(ge, "showTombstoneEvents"), [S] = Fe(ge, "developerTools"), [T] = Fe(ge, "reducedMotion"), [A] = Fe(ge, "hour24Clock"), [B] = Fe(ge, "dateFormatString"), [U] = Fe(ge, "autoplayStickers"), [z] = Fe(ge, "autoplayEmojis"), [O] = Fe(ge, "incomingInlineImagesDefaultHeight"), [M] = Fe(ge, "incomingInlineImagesMaxHeight"), [I] = Fe(ge, "hideMembershipInReadOnly"), N = t.hasEncryptionStateEvent() ? b : w, L = t.hasEncryptionStateEvent() ? j && k : j, H = Ze(qr), V = Ze(z2), Z = kp(), Y = p.useMemo(() => new Set(Z), [
      Z
    ]), oe = Qd(), ue = ri(t), ie = bh(t, ue, oe), de = Ki(ue, oe), ne = p.useMemo(() => {
      var _a6, _b3;
      const nt = ((_a6 = oe == null ? void 0 : oe.users) == null ? void 0 : _a6[a.getUserId()]) ?? (oe == null ? void 0 : oe.users_default) ?? 0, an = ((_b3 = oe == null ? void 0 : oe.events) == null ? void 0 : _b3["m.room.message"]) ?? (oe == null ? void 0 : oe.events_default) ?? 0;
      return nt < an;
    }, [
      oe,
      a
    ]), [ae, X] = p.useState(() => P8(t, true)), K = p.useRef(void 0);
    ae && (K.current = ae.readUptoEventId);
    const G = p.useRef(u);
    G.current = u;
    const le = p.useRef(0), te = p.useRef(null), re = hn(), he = Xd(), se = om(t.roomId), ye = gs(), we = Ls(), Ee = ka(), ke = Ze(vi), Ne = IS(t.roomId, ke), lt = p.useMemo(() => new Oa(a), [
      a
    ]), Rt = IP(), We = p.useMemo(() => mF(t.roomId), [
      t.roomId
    ]), yt = Ze(We), Xt = Fn(We), nn = yt == null ? void 0 : yt.eventId, bt = p.useMemo(() => GM(t.roomId), [
      t.roomId
    ]), At = Ze(bt), $t = Fn(bt), Lt = p.useRef(null), [wt, st] = p.useState(true), Be = p.useRef(wt), Re = p.useCallback((nt) => {
      st(nt), Be.current = nt;
    }, []), [Ue, qe] = p.useState(false), [tt, ht] = p.useState(0), $e = p.useRef(0), Tt = p.useRef(Date.now() + 3e3), zt = p.useRef(false), Vt = p.useRef(void 0), bn = p.useRef(false), Zn = p.useRef(t.roomId), [Kn, Ce] = p.useState(false);
    Zn.current !== t.roomId && (zt.current = false, Tt.current = Date.now() + 3e3, Zn.current = t.roomId, bn.current = false, Vt.current !== void 0 && (clearTimeout(Vt.current), Vt.current = void 0), Ce(false));
    const Dt = p.useRef([]), Ut = p.useRef(null), Zt = p.useCallback(() => {
      !Lt.current || Dt.current.length - 1 < 0 || Lt.current.scrollTo(Lt.current.scrollSize);
    }, []), ut = Ait({
      room: t,
      mx: a,
      eventId: e,
      isAtBottom: wt,
      isAtBottomRef: Be,
      scrollToBottom: Zt,
      unreadInfo: ae,
      setUnreadInfo: X,
      hideReadsRef: G,
      readUptoEventIdRef: K
    });
    Ut.current = ut;
    const De = p.useRef(ut.eventsLength);
    De.current = ut.eventsLength;
    const Ae = p.useRef(ut.canPaginateBack);
    Ae.current = ut.canPaginateBack;
    const Ge = p.useRef(ut.liveTimelineLinked);
    Ge.current = ut.liveTimelineLinked;
    const ot = p.useRef(ut.backwardStatus);
    ot.current = ut.backwardStatus;
    const Mt = p.useRef(ut.forwardStatus);
    Mt.current = ut.forwardStatus;
    const cn = p.useCallback((nt) => {
      const an = Dt.current, On = an.find((Qr) => Qr.itemIndex === nt);
      if (On) return an.indexOf(On);
    }, []);
    p.useLayoutEffect(() => {
      !e && !zt.current && ut.eventsLength > 0 && ut.liveTimelineLinked && Lt.current && (Lt.current.scrollToIndex(Dt.current.length - 1, {
        align: "end"
      }), Vt.current = setTimeout(() => {
        var _a6;
        Vt.current = void 0, Dt.current.length > 0 ? ((_a6 = Lt.current) == null ? void 0 : _a6.scrollToIndex(Dt.current.length - 1, {
          align: "end"
        }), Ce(true)) : bn.current = true;
      }, 80), zt.current = true);
    }, [
      ut.eventsLength,
      ut.liveTimelineLinked,
      e,
      t.roomId
    ]), p.useEffect(() => () => {
      Vt.current !== void 0 && clearTimeout(Vt.current);
    }, []), p.useLayoutEffect(() => {
      Kn && (ut.eventsLength > 0 || (Ce(false), zt.current = false));
    }, [
      Kn,
      ut.eventsLength
    ]);
    const un = p.useCallback(() => {
      const nt = Lt.current;
      if (!nt) return;
      const an = $e.current, On = Math.max(0, nt.viewportSize - nt.scrollSize + an);
      Math.abs(an - On) > 2 && ($e.current = On, ht(On), an > 0 && On === 0 && Dt.current.length > 0 && requestAnimationFrame(() => {
        var _a6;
        (_a6 = Lt.current) == null ? void 0 : _a6.scrollToIndex(Dt.current.length - 1, {
          align: "end"
        });
      }));
    }, []);
    p.useLayoutEffect(() => {
      const nt = requestAnimationFrame(un);
      return () => cancelAnimationFrame(nt);
    }, [
      un,
      ut.eventsLength
    ]);
    const gn = p.useRef(ut.backwardStatus), Ke = p.useRef(false);
    p.useLayoutEffect(() => {
      var _a6;
      const nt = gn.current;
      gn.current = ut.backwardStatus, ut.backwardStatus === "loading" ? (Ke.current = Be.current, Be.current || qe(true)) : nt === "loading" && ut.backwardStatus === "idle" && (qe(false), Ke.current && ((_a6 = Lt.current) == null ? void 0 : _a6.scrollToIndex(Dt.current.length - 1, {
        align: "end"
      })));
    }, [
      ut.backwardStatus
    ]), p.useEffect(() => {
      let nt;
      if (ut.focusItem) {
        if (ut.focusItem.scrollTo && Lt.current) {
          const an = cn(ut.focusItem.index);
          an !== void 0 && (Lt.current.scrollToIndex(an, {
            align: "center"
          }), ut.setFocusItem((On) => On ? {
            ...On,
            scrollTo: false
          } : void 0));
        }
        nt = setTimeout(() => {
          ut.setFocusItem(void 0);
        }, 2e3);
      }
      return () => {
        nt !== void 0 && clearTimeout(nt);
      };
    }, [
      ut.focusItem,
      ut,
      T,
      cn
    ]), p.useEffect(() => {
      ut.focusItem && Ce(true);
    }, [
      ut.focusItem
    ]), p.useEffect(() => {
      e && (Ce(false), Ut.current.loadEventTimeline(e));
    }, [
      e,
      t.roomId
    ]), p.useEffect(() => {
      if (e || Kn) return;
      const { readUptoEventId: nt, inLiveTimeline: an, scrollTo: On } = ae ?? {};
      if (nt && an && On) {
        const Qr = Sy(t, nt), tr = Qr ? B8(ut.timeline.linkedTimelines, Qr, nt) : void 0;
        if (tr !== void 0) {
          const Mi = cn(tr);
          Mi !== void 0 && Lt.current && Lt.current.scrollToIndex(Mi, {
            align: "start"
          }), X((ps) => ps && {
            ...ps,
            scrollTo: false
          });
        }
      }
    }, [
      t,
      ae,
      ut.timeline.linkedTimelines,
      e,
      Kn,
      cn
    ]), p.useEffect(() => {
      const nt = te.current;
      if (!nt) return () => {
      };
      const an = new ResizeObserver((On) => {
        var _a6;
        const Qr = On[0].contentRect.height, tr = le.current, Mi = Be.current;
        Qr < tr && Mi && ((_a6 = Lt.current) == null ? void 0 : _a6.scrollTo(Lt.current.scrollSize)), le.current = Qr;
      });
      return an.observe(nt), () => an.disconnect();
    }, []);
    const it = Iit({
      room: t,
      mx: a,
      editor: n,
      nicknames: H,
      globalProfiles: V,
      spaceId: Ee == null ? void 0 : Ee.roomId,
      openUserRoomProfile: we,
      activeReplyId: nn,
      setReplyDraft: Xt,
      openThreadId: At,
      setOpenThread: $t,
      handleEdit: c,
      handleOpenEvent: (nt) => {
        const an = lie(t, nt);
        let On = Sy(t, an), Qr = an;
        !On && an !== nt && (On = Sy(t, nt), Qr = nt);
        const tr = On ? B8(ut.timeline.linkedTimelines, On, Qr) : void 0;
        if (typeof tr == "number") {
          let Mi = cn(tr), ps = tr;
          if (Mi === void 0) {
            const nu = Gfe(Dt.current, tr);
            nu && (Mi = nu.rowIndex, ps = nu.focusRawIndex);
          }
          Lt.current && Mi !== void 0 && Lt.current.scrollToIndex(Mi, {
            align: "center"
          }), ut.setFocusItem({
            index: ps,
            scrollTo: false,
            highlight: true
          });
        } else ut.loadEventTimeline(an);
      }
    }), It = p.useMemo(() => ({
      ...fs,
      render: em(ye, (nt) => _h(a, t.roomId, nt, Jd(se), H), se)
    }), [
      a,
      t.roomId,
      se,
      H,
      ye
    ]), Pt = SM(), Sn = p.useMemo(() => Ql(a, t.roomId, {
      settingsLinkBaseUrl: ye,
      linkifyOpts: It,
      useAuthentication: re,
      handleSpoilerClick: he,
      handleMentionClick: se,
      nicknames: H,
      autoplayEmojis: z,
      incomingInlineImagesDefaultHeight: O,
      incomingInlineImagesMaxHeight: M,
      replaceTextNode: dce(Pt, It)
    }), [
      a,
      t.roomId,
      It,
      z,
      O,
      M,
      se,
      H,
      re,
      he,
      ye,
      Pt
    ]), Mn = Zfe({
      room: t,
      mx: a,
      pushProcessor: lt,
      nicknames: H,
      imagePackRooms: Ne,
      settings: {
        messageLayout: h,
        messageSpacing: f,
        hideReads: u,
        showDeveloperTools: S,
        hour24Clock: A,
        dateFormatString: B,
        mediaAutoLoad: v,
        showBundledPreview: y,
        showUrlPreview: N,
        showClientUrlPreview: L,
        autoplayStickers: U,
        hideMemberInReadOnly: I,
        isReadOnly: ne,
        hideMembershipEvents: g,
        hideNickAvatarEvents: m,
        showHiddenEvents: C
      },
      state: {
        focusItem: ut.focusItem,
        editId: l,
        activeReplyId: nn,
        openThreadId: At
      },
      permissions: {
        canRedact: de.action("redact", a.getSafeUserId()),
        canDeleteOwn: de.event("m.room.redaction", a.getSafeUserId()),
        canSendReaction: de.event("m.reaction", a.getSafeUserId()),
        canPinEvent: de.stateEvent("m.room.pinned_events", a.getSafeUserId())
      },
      callbacks: {
        onUserClick: it.handleUserClick,
        onUsernameClick: it.handleUsernameClick,
        onReplyClick: it.handleReplyClick,
        onReactionToggle: it.handleReactionToggle,
        onEditId: it.handleEdit,
        onResend: it.handleResend,
        onDeleteFailedSend: it.handleDeleteFailedSend,
        setOpenThread: it.setOpenThread,
        handleOpenReply: it.handleOpenReply
      },
      utils: {
        htmlReactParserOptions: Sn,
        linkifyOpts: It,
        getMemberPowerTag: ie,
        parseMemberEvent: Rt
      }
    }), on = p.useCallback(() => {
      if (!K.current) {
        requestAnimationFrame(() => As(a, t.roomId, u));
        return;
      }
      const nt = Sy(t, K.current);
      (nt && YO(nt, Tn.Forward)) === t.getLiveTimeline() && requestAnimationFrame(() => As(a, t.roomId, u));
    }, [
      a,
      t,
      u
    ]);
    yit(p.useCallback((nt) => {
      nt && wt && on();
    }, [
      on,
      wt
    ])), p.useEffect(() => {
      wt && document.hasFocus() && ut.liveTimelineLinked && on();
    }, [
      wt,
      ut.liveTimelineLinked,
      on,
      ut.eventsLength
    ]);
    const vt = p.useCallback((nt) => {
      const an = Lt.current;
      if (!an) return;
      const On = an.scrollSize - nt - an.viewportSize, Qr = On < 100;
      Qr !== Be.current && Re(Qr), nt < 500 && Ae.current && ot.current === "idle" && Ut.current.handleTimelinePagination(true), On < 500 && !Ge.current && Mt.current === "idle" && Ut.current.handleTimelinePagination(false);
    }, [
      Re
    ]), je = ut.eventsLength === 0 && (!Kn || ut.canPaginateBack || ut.backwardStatus === "loading");
    let Ve;
    (ut.canPaginateBack || ut.backwardStatus !== "idle") && ut.backwardStatus === "error" && (Ve = o.jsxs(E, {
      justifyContent: "Center",
      alignItems: "Center",
      gap: "200",
      style: {
        padding: ee.space.S300
      },
      children: [
        o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T300",
          children: "Failed to load history."
        }),
        o.jsx(Qe, {
          variant: "SurfaceVariant",
          radii: "Pill",
          outlined: true,
          onClick: () => ut.handleTimelinePagination(true),
          children: o.jsx(D, {
            size: "B300",
            children: "Retry"
          })
        })
      ]
    }));
    let St;
    (!ut.liveTimelineLinked || ut.forwardStatus !== "idle") && ut.forwardStatus === "error" && (St = o.jsxs(E, {
      justifyContent: "Center",
      alignItems: "Center",
      gap: "200",
      style: {
        padding: ee.space.S300
      },
      children: [
        o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T300",
          children: "Failed to load messages."
        }),
        o.jsx(Qe, {
          variant: "SurfaceVariant",
          radii: "Pill",
          outlined: true,
          onClick: () => ut.handleTimelinePagination(false),
          children: o.jsx(D, {
            size: "B300",
            children: "Retry"
          })
        })
      ]
    }));
    const pt = ut.backwardStatus === "loading" && ut.eventsLength > 0, Ct = ut.forwardStatus === "loading" && ut.eventsLength > 0, En = !wt && Kn ? {
      bottom: `calc(${ee.space.S400} + ${He(52)})`
    } : void 0, fn = (ae == null ? void 0 : ae.readUptoEventId) && !(ae == null ? void 0 : ae.inLiveTimeline) && Kn ? {
      top: `calc(${ee.space.S400} + ${He(52)})`
    } : void 0, ur = ut.eventsLength === 0 && (!Kn || ut.canPaginateBack || ut.backwardStatus === "loading") ? 3 : ut.eventsLength, Lr = p.useMemo(() => (ut.timeline, Array.from({
      length: ur
    }, (nt, an) => an)), [
      ur,
      ut.timeline
    ]), pn = Yfe({
      items: Lr,
      linkedTimelines: ut.timeline.linkedTimelines,
      ignoredUsersSet: Y,
      showHiddenEvents: C,
      showTombstoneEvents: x,
      mxUserId: a.getUserId(),
      readUptoEventId: K.current,
      hideMembershipEvents: g,
      hideNickAvatarEvents: m,
      isReadOnly: ne,
      hideMemberInReadOnly: I
    });
    return Dt.current = pn, p.useLayoutEffect(() => {
      var _a6;
      bn.current && pn.length !== 0 && (bn.current = false, (_a6 = Lt.current) == null ? void 0 : _a6.scrollToIndex(pn.length - 1, {
        align: "end"
      }), Ce(true));
    }, [
      pn.length
    ]), p.useEffect(() => {
      if (!i) return;
      const nt = i;
      nt.current = () => {
        const an = a.getUserId(), On = [
          ...Dt.current
        ].toReversed().find((Qr) => Qr.mEvent.getSender() === an && Qr.mEvent.getType() === "m.room.message" && !Qr.mEvent.isRedacted());
        (On == null ? void 0 : On.mEvent.getId()) && it.handleEdit(On.mEvent.getId());
      };
    }, [
      i,
      a,
      it
    ]), p.useEffect(() => {
      const nt = Lt.current;
      nt && Ae.current && ot.current === "idle" && nt.scrollSize <= nt.viewportSize && Ut.current.handleTimelinePagination(true);
    }, [
      ut.eventsLength,
      ut.backwardStatus
    ]), p.useEffect(() => {
      if (!Ae.current) return () => {
      };
      let nt, an = 0;
      const On = 20, Qr = pn.length, tr = () => {
        const Mi = Lt.current;
        if (!Mi) return;
        if (Mi.viewportSize === 0) {
          an += 1, an <= On && (nt = requestAnimationFrame(tr));
          return;
        }
        if (!Ae.current || ot.current !== "idle") return;
        const ps = Mi.scrollOffset < 500, nu = pn.length === Qr;
        (!(Mi.scrollSize > Mi.viewportSize + 300) || ps && nu) && Ut.current.handleTimelinePagination(true);
      };
      return nt = requestAnimationFrame(tr), () => cancelAnimationFrame(nt);
    }, [
      ut.eventsLength,
      ut.backwardStatus,
      pn.length
    ]), o.jsxs(E, {
      grow: "Yes",
      style: {
        position: "relative"
      },
      children: [
        (ae == null ? void 0 : ae.readUptoEventId) && !(ae == null ? void 0 : ae.inLiveTimeline) && Kn && o.jsxs(Q_, {
          position: "Top",
          children: [
            o.jsx(Qe, {
              variant: "Primary",
              radii: "Pill",
              outlined: true,
              before: o.jsx(Q, {
                size: "50",
                src: q.MessageUnread
              }),
              onClick: () => ut.loadEventTimeline(ae.readUptoEventId),
              children: o.jsx(D, {
                size: "L400",
                children: "Jump to Unread"
              })
            }),
            o.jsx(Qe, {
              variant: "SurfaceVariant",
              radii: "Pill",
              outlined: true,
              before: o.jsx(Q, {
                size: "50",
                src: q.CheckTwice
              }),
              onClick: () => As(a, t.roomId, u),
              children: o.jsx(D, {
                size: "L400",
                children: "Mark as Read"
              })
            })
          ]
        }),
        o.jsx("div", {
          ref: te,
          style: {
            flex: 1,
            minHeight: 0,
            overflow: "hidden",
            position: "relative",
            opacity: Kn || je ? 1 : 0
          },
          children: o.jsx(_it, {
            ref: Lt,
            data: pn,
            shift: Ue,
            className: Pit,
            style: {
              flex: 1,
              minHeight: 0,
              display: "flex",
              flexDirection: "column",
              paddingTop: tt > 0 ? tt : ee.space.S600,
              paddingBottom: ee.space.S600
            },
            onScroll: vt,
            children: (nt, an) => {
              if (je) return o.jsx(Xy, {
                children: h === Mr.Compact ? o.jsx(W6e, {}) : o.jsx(Moe, {})
              }, `placeholder-${an}`);
              if (!nt) return an === 0 && !ut.canPaginateBack ? o.jsxs(p.Fragment, {
                children: [
                  Ve,
                  o.jsx("div", {
                    style: {
                      padding: `${ee.space.S700} ${ee.space.S400} ${ee.space.S600} ${h === Mr.Compact ? ee.space.S400 : He(64)}`
                    },
                    children: o.jsx(iX, {
                      room: t
                    })
                  })
                ]
              }, "intro-and-first") : an === 0 ? o.jsx(p.Fragment, {
                children: Ve
              }, "first") : o.jsx(p.Fragment, {}, an);
              const On = Mn(nt.mEvent.getType(), typeof nt.mEvent.getStateKey() == "string", nt.id, nt.mEvent, nt.itemIndex, nt.timelineSet, nt.collapsed), tr = On !== null ? o.jsxs(o.Fragment, {
                children: [
                  nt.willRenderDayDivider && o.jsx(Xy, {
                    space: f,
                    children: o.jsx(lX, {
                      variant: "Surface",
                      children: o.jsx(Rn, {
                        as: "span",
                        size: "500",
                        variant: "Secondary",
                        fill: "None",
                        radii: "300",
                        children: o.jsx(D, {
                          size: "L400",
                          children: Mit(nt.mEvent.getTs())
                        })
                      })
                    })
                  }),
                  nt.willRenderNewDivider && o.jsx(Xy, {
                    space: f,
                    children: o.jsx(lX, {
                      style: {
                        color: ct.Success.Main
                      },
                      variant: "Inherit",
                      children: o.jsx(Rn, {
                        as: "span",
                        size: "500",
                        variant: "Success",
                        fill: "Solid",
                        radii: "300",
                        children: o.jsx(D, {
                          size: "L400",
                          children: "New Messages"
                        })
                      })
                    })
                  })
                ]
              }) : null;
              return an === 0 ? o.jsxs(p.Fragment, {
                children: [
                  !ut.canPaginateBack && o.jsx("div", {
                    style: {
                      padding: `${ee.space.S700} ${ee.space.S400} ${ee.space.S600} ${h === Mr.Compact ? ee.space.S400 : He(64)}`
                    },
                    children: o.jsx(iX, {
                      room: t
                    })
                  }),
                  Ve,
                  tr,
                  On
                ]
              }, "first-item-block") : o.jsxs(p.Fragment, {
                children: [
                  tr,
                  On
                ]
              }, nt.id);
            }
          })
        }),
        pt && o.jsx(Q_, {
          position: "Top",
          style: fn,
          children: o.jsx(dt, {
            variant: "Secondary",
            size: "400"
          })
        }),
        Ct && o.jsx(Q_, {
          position: "Bottom",
          style: En,
          children: o.jsx(dt, {
            variant: "Secondary",
            size: "400"
          })
        }),
        St && o.jsx(Q_, {
          position: "Bottom",
          style: En,
          children: St
        }),
        !wt && Kn && o.jsx(Q_, {
          position: "Bottom",
          children: o.jsx(Qe, {
            variant: "SurfaceVariant",
            radii: "Pill",
            outlined: true,
            before: o.jsx(Q, {
              size: "50",
              src: q.ArrowBottom
            }),
            onClick: () => {
              e && d(t.roomId, void 0, {
                replace: true
              }), ut.setTimeline(U0(t)), Zt();
            },
            children: o.jsx(D, {
              size: "L400",
              children: "Jump to Latest"
            })
          })
        })
      ]
    });
  }
  const Lit = /^F\d+$/, Nit = (t) => {
    const { code: e } = t;
    return !(t.metaKey || t.altKey || t.ctrlKey || Lit.test(e) || e.startsWith("OS") || e.startsWith("Meta") || e.startsWith("Shift") || e.startsWith("Alt") || e.startsWith("Control") || e.startsWith("Arrow") || e.startsWith("Page") || e.startsWith("End") || e.startsWith("Home") || e === "Tab" || e === "Space" || e === "Enter" || e === "NumLock" || e === "ScrollLock");
  };
  function Jfe({ eventId: t }) {
    const e = p.useRef(null), n = p.useRef(null), r = p.useRef(), [i] = Fe(ge, "hideReads"), a = fr(), s = cr(), { roomId: l } = s, c = p3(), d = be(), u = $i(s, ce.RoomTombstone), h = Qd(), f = ri(s), m = Ki(f, h).event(ce.RoomMessage, d.getSafeUserId()), [v, y] = p.useState(0), w = p.useCallback(() => y((z) => z + 1), []);
    Snt();
    const b = Ze(AS), j = p.useCallback((z) => {
      M0(c), z && xt.insertText(c, z), Bt.focus(c);
    }, [
      c
    ]);
    Ld(window, p.useCallback((z) => {
      if (NA()) return;
      const O = document.getElementById("portalContainer");
      O && O.children.length > 0 || (Nit(z) || Yt.isKeyHotkey("mod+v", z)) && Bt.focus(c);
    }, [
      c
    ]));
    const k = Bp(), C = ka(), x = p.useCallback(() => {
      a === sn.Mobile && k(s.roomId, C == null ? void 0 : C.roomId, Ao.MembersPage);
    }, [
      a,
      k,
      s.roomId,
      C == null ? void 0 : C.roomId
    ]), S = QF(s), T = x3(s, S), A = Ze(ev), B = Ap(A) && (A == null ? void 0 : A.roomId) === s.roomId, U = !s.isCallRoom() && (T.length > 0 || B);
    return o.jsx(ic, {
      children: (z) => o.jsx(si, {
        ref: n,
        children: o.jsxs(Dnt, {
          onOpenSidebar: z,
          onOpenMembers: x,
          children: [
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              children: [
                U && o.jsx(E, {
                  shrink: "No",
                  style: {
                    width: "100%",
                    position: "relative"
                  },
                  children: o.jsx(Wde, {
                    resizable: true
                  })
                }),
                o.jsx(Oit, {
                  room: s,
                  eventId: t,
                  editor: c,
                  onEditorReset: w,
                  onEditLastMessageRef: r
                }, l),
                o.jsx(Qrt, {
                  room: s
                }),
                o.jsx(Cnt, {})
              ]
            }),
            o.jsxs(E, {
              shrink: "No",
              direction: "Column",
              children: [
                m && b && o.jsx(urt, {
                  room: s,
                  onEditMessage: j
                }),
                o.jsx("div", {
                  style: {
                    padding: `0 ${ee.space.S400}`
                  },
                  children: u ? o.jsx(Zrt, {
                    roomId: l,
                    body: u.getContent().body,
                    replacementRoomId: u.getContent().replacement_room
                  }) : o.jsxs(o.Fragment, {
                    children: [
                      m && o.jsx(Lfe, {
                        room: s,
                        editor: c,
                        roomId: l,
                        fileDropContainerRef: n,
                        ref: e,
                        onEditLastMessage: () => {
                          var _a6;
                          return (_a6 = r.current) == null ? void 0 : _a6.call(r);
                        }
                      }, `${l}-${v}`),
                      !m && o.jsx(Nfe, {
                        style: {
                          padding: ee.space.S200
                        },
                        alignItems: "Center",
                        justifyContent: "Center",
                        children: o.jsx(D, {
                          align: "Center",
                          children: "You do not have permission to post in this room"
                        })
                      })
                    ]
                  })
                }),
                i ? o.jsx(Sfe, {}) : o.jsx(jfe, {
                  room: s
                })
              ]
            })
          ]
        })
      })
    });
  }
  function zit() {
    const { eventId: t } = Fl(), e = Fn(tv), n = fr(), r = () => e(false), [i, a] = Fe(ge, "vcmsgSidebarWidth"), [s, l] = p.useState(i);
    return p.useEffect(() => {
      l(i);
    }, [
      i
    ]), o.jsxs(E, {
      shrink: "No",
      style: {
        position: "relative",
        width: n === sn.Desktop ? He(s) : "100%",
        flexShrink: 0,
        flexGrow: 0
      },
      children: [
        !Dr() && o.jsx(Zl, {
          setCurWidth: l,
          sidebarWidth: i,
          setSidebarWidth: a,
          minValue: 300,
          maxValue: 1e3,
          isReversed: true
        }),
        o.jsxs(si, {
          style: {
            width: "100%",
            flexShrink: 0,
            flexGrow: 0
          },
          children: [
            o.jsx(_i, {
              children: o.jsxs(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H5",
                      truncate: true,
                      children: "Chat"
                    })
                  }),
                  o.jsx(E, {
                    shrink: "No",
                    alignItems: "Center",
                    children: o.jsx(ar, {
                      position: "Bottom",
                      align: "End",
                      offset: 4,
                      tooltip: o.jsx(pr, {
                        children: o.jsx(D, {
                          children: "Close"
                        })
                      }),
                      children: (c) => o.jsx(Oe, {
                        ref: c,
                        variant: "Surface",
                        onClick: r,
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    })
                  })
                ]
              })
            }),
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(Jfe, {
                eventId: t
              })
            })
          ]
        })
      ]
    });
  }
  var Xfe = "ThreadDrawer_ThreadDrawer__1n9cyvz0", cX = "ThreadDrawer_messageList__1n9cyvz1", Qfe = "ThreadDrawer_ThreadDrawerHeader__1n9cyvz2", Uit = "ThreadDrawer_threadRootShell__1n9cyvz3", Vit = "ThreadDrawer_threadRootScrollShadow__1n9cyvz4", eme = "ThreadDrawer_ThreadDrawerContent__1n9cyvz5", Hit = "ThreadDrawer_ThreadDrawerInput__1n9cyvz6", tme = "ThreadDrawer_ThreadDrawerOverlay__1n9cyvz7", $it = "ThreadDrawer_ThreadBrowserItem__1n9cyvz8";
  function dX(t, e) {
    var _a6;
    const i = (((_a6 = t.getThread(e)) == null ? void 0 : _a6.events) ?? []).filter((a) => a.getId() !== e && !is(a) && Da(a, e));
    return i.length > 0 ? i : t.getUnfilteredTimelineSet().getLiveTimeline().getEvents().filter((a) => a.getId() !== e && !is(a) && Da(a, e));
  }
  function uX({ room: t, threadRootId: e, onClose: n, overlay: r }) {
    var _a6, _b3;
    const i = be(), a = p.useRef(null), s = p3(), [l, c] = p.useState(0), [d, u] = p.useState(void 0), [h, f] = p.useState(false), [g, m] = p.useState(true), v = p.useRef(false), y = p.useRef(null), w = p.useRef(0), b = p.useRef([]), j = p.useRef(null), k = p.useRef(false), { editId: C, handleEdit: x } = Kfe(s), S = Ze(qr), T = p.useMemo(() => new Oa(i), [
      i
    ]), A = hn(), B = om(t.roomId), U = gs(), z = Xd(), [O] = Fe(ge, "messageLayout"), [M] = Fe(ge, "messageSpacing"), [I] = Fe(ge, "hour24Clock"), [N] = Fe(ge, "dateFormatString"), [L] = Fe(ge, "hideReads"), [H] = Fe(ge, "developerTools"), [V] = Fe(ge, "mediaAutoLoad"), [Z] = Fe(ge, "urlPreview"), [Y] = Fe(ge, "encUrlPreview"), [oe] = Fe(ge, "clientUrlPreview"), [ue] = Fe(ge, "encClientUrlPreview"), [ie] = Fe(ge, "autoplayStickers"), [de] = Fe(ge, "autoplayEmojis"), [ne] = Fe(ge, "showHiddenEvents"), [ae] = Fe(ge, "showTombstoneEvents"), [X] = Fe(ge, "hideMembershipInReadOnly"), [K] = Fe(ge, "bundledPreview"), G = t.hasEncryptionStateEvent() ? Y : Z, le = t.hasEncryptionStateEvent() ? oe && ue : oe, te = p.useMemo(() => ({
      ...fs,
      render: em(U, (pt) => _h(i, t.roomId, pt, Jd(B), S), B)
    }), [
      i,
      t,
      B,
      S,
      U
    ]), re = SM(), he = p.useMemo(() => Ql(i, t.roomId, {
      settingsLinkBaseUrl: U,
      linkifyOpts: te,
      useAuthentication: A,
      handleSpoilerClick: z,
      handleMentionClick: B,
      nicknames: S,
      autoplayEmojis: de,
      replaceTextNode: dce(re, te)
    }), [
      i,
      t,
      te,
      z,
      B,
      A,
      S,
      U,
      de,
      re
    ]), se = Qd(), ye = ri(t), we = Ki(ye, se), Ee = we.action("redact", i.getSafeUserId()), ke = we.event(ce.RoomRedaction, i.getSafeUserId()), Ne = we.event(ce.Reaction, i.getSafeUserId()), lt = we.stateEvent(ce.RoomPinnedEvents, i.getSafeUserId()), Rt = p.useMemo(() => {
      var _a7, _b4;
      const pt = ((_a7 = se == null ? void 0 : se.users) == null ? void 0 : _a7[i.getUserId()]) ?? (se == null ? void 0 : se.users_default) ?? 0, Ct = ((_b4 = se == null ? void 0 : se.events) == null ? void 0 : _b4["m.room.message"]) ?? (se == null ? void 0 : se.events_default) ?? 0;
      return pt < Ct;
    }, [
      se,
      i
    ]), We = bh(t, ye, se), yt = IP(), Xt = kp(), nn = p.useMemo(() => new Set(Xt), [
      Xt
    ]), bt = Ze(vi), At = IS(t.roomId, bt), $t = Fn(mF(e)), Lt = Ze(mF(e)), wt = Lt == null ? void 0 : Lt.eventId, st = Ls(), Be = t.getThread(e), Re = Be == null ? void 0 : Be.timelineSet.getLiveTimeline(), Ue = t.findEventById(e) ?? (Be == null ? void 0 : Be.rootEvent), qe = (Re == null ? void 0 : Re.getEvents().length) ?? 0, tt = p.useMemo(() => Re ? [
      Re
    ] : [], [
      Re,
      qe
    ]), ht = p.useMemo(() => Array.from({
      length: qe
    }, (pt, Ct) => Ct), [
      qe
    ]), $e = Yfe({
      items: ht,
      linkedTimelines: tt,
      skipThreadFilter: true,
      ignoredUsersSet: nn,
      showHiddenEvents: ne,
      showTombstoneEvents: ae,
      mxUserId: i.getUserId(),
      readUptoEventId: void 0,
      hideMembershipEvents: true,
      hideNickAvatarEvents: true,
      isReadOnly: Rt,
      hideMemberInReadOnly: X
    }), Tt = p.useMemo(() => {
      const pt = $e.filter((En) => En.id !== e);
      if (pt.length > 0) return pt;
      const Ct = (Be == null ? void 0 : Be.timelineSet) ?? t.getUnfilteredTimelineSet();
      return dX(t, e).map((En, fn) => ({
        id: En.getId() ?? `thread-reply-${fn}`,
        itemIndex: fn,
        mEvent: En,
        timelineSet: Ct,
        eventSender: En.getSender() ?? null,
        collapsed: false,
        willRenderNewDivider: false,
        willRenderDayDivider: false
      }));
    }, [
      t,
      e,
      Be,
      $e,
      l
    ]);
    b.current = Tt;
    const zt = Tt;
    p.useEffect(() => {
      if (!t.getThread(e)) {
        const fn = t.findEventById(e);
        fn ? t.createThread(e, fn, [], false) : i.fetchRoomEvent(t.roomId, e).then((ur) => {
          t.getThread(e) || t.createThread(e, new to(ur), [], false);
        }).catch(() => {
        });
      }
      const pt = t.getThread(e);
      if (!pt || !pt.initialEventsFetched || pt.events.some((fn) => fn.getId() !== e && !is(fn) && Da(fn, e))) return;
      const En = t.getUnfilteredTimelineSet().getLiveTimeline().getEvents().filter((fn) => fn.getId() !== e && !is(fn) && Da(fn, e));
      if (En.length > 0) {
        pt.addEvents(En, false), Promise.resolve().then(() => c((fn) => fn + 1));
        return;
      }
      j.current !== e && (j.current = e, i.paginateEventTimeline(pt.timelineSet.getLiveTimeline(), {
        backwards: true
      }).then(() => c((fn) => fn + 1)).catch(() => {
      }));
    }, [
      i,
      t,
      e,
      c,
      l
    ]), p.useEffect(() => {
      const pt = (ur) => {
        var _a7;
        if (ur.getId() === e || Da(ur, e)) return true;
        if (is(ur)) {
          const pn = (_a7 = ur.getRelation()) == null ? void 0 : _a7.event_id;
          if (pn) {
            const nt = t.findEventById(pn);
            if (nt && (nt.getId() === e || Da(nt, e))) return true;
          }
        }
        return false;
      }, Ct = (ur) => {
        pt(ur) && c((Lr) => Lr + 1);
      }, En = (ur) => {
        pt(ur) && c((Lr) => Lr + 1);
      }, fn = () => c((ur) => ur + 1);
      return i.on(mt.Timeline, Ct), t.on(mt.Redaction, En), t.on(jr.Update, fn), t.on(jr.NewReply, fn), () => {
        i.off(mt.Timeline, Ct), t.removeListener(mt.Redaction, En), t.removeListener(jr.Update, fn), t.removeListener(jr.NewReply, fn);
      };
    }, [
      i,
      t,
      e
    ]), p.useEffect(() => {
      (async () => {
        const Ct = t.getThread(e);
        if (!Ct) return;
        const En = Ct.events || [];
        if (En.length === 0) return;
        const fn = En[En.length - 1];
        if (!fn || fn.isSending()) return;
        const ur = i.getUserId();
        if (!ur) return;
        const Lr = Ct.getEventReadUpTo(ur, false), pn = fn.getId();
        if (Lr !== pn) try {
          await i.sendReadReceipt(fn, ia.Read);
        } catch (nt) {
          console.warn("Failed to send thread read receipt:", nt);
        }
      })();
    }, [
      i,
      t,
      e,
      l
    ]);
    const Vt = dX(t, e), bn = !!Be && !Be.initialEventsFetched && Vt.length === 0, Zn = g && !!(Be == null ? void 0 : Be.initialEventsFetched) && (Be == null ? void 0 : Be.timelineSet.getLiveTimeline().getPaginationToken(Tn.Backward)) != null, Kn = p.useRef(Zn);
    Kn.current = Zn;
    const Ce = p.useCallback(() => {
      const pt = t.getThread(e);
      !pt || !pt.initialEventsFetched || v.current || (v.current = true, f(true), i.paginateEventTimeline(pt.timelineSet.getLiveTimeline(), {
        backwards: true
      }).then((Ct) => {
        v.current = false, Ct || m(false), f(false), c((En) => En + 1);
      }).catch(() => {
        v.current = false, f(false);
      }));
    }, [
      i,
      t,
      e,
      c
    ]), Dt = p.useRef(Ce);
    Dt.current = Ce, p.useEffect(() => {
      m(true), k.current = false;
    }, [
      e
    ]);
    const Ut = p.useCallback(() => {
      const pt = y.current;
      pt && pt.scrollTop < 200 && Kn.current && !v.current && Dt.current();
    }, []);
    p.useEffect(() => {
      const pt = y.current;
      if (!pt) return;
      const Ct = pt.scrollHeight - pt.scrollTop - pt.clientHeight < 150;
      (w.current === 0 || Ct || k.current) && (pt.scrollTop = pt.scrollHeight), w.current = zt.length;
    }, [
      zt.length
    ]), p.useEffect(() => {
      if (v.current) return;
      const pt = y.current;
      if (pt) {
        if (!Zn) {
          k.current = false;
          return;
        }
        pt.scrollHeight <= pt.clientHeight ? (k.current = true, Dt.current()) : k.current = false;
      }
    }, [
      zt.length,
      Zn
    ]);
    const Zt = p.useCallback((pt) => {
      if (!pt.currentTarget) return;
      pt.preventDefault(), pt.stopPropagation();
      const Ct = pt.currentTarget.getAttribute("data-user-id");
      Ct && st(t.roomId, void 0, Ct, pt.currentTarget.getBoundingClientRect());
    }, [
      t,
      st
    ]), ut = p.useCallback((pt) => {
      pt.preventDefault();
      const Ct = pt.currentTarget.getAttribute("data-user-id");
      if (!Ct) return;
      const fn = gr(t, Ct, void 0) ?? _n(Ct) ?? Ct;
      s.insertNode(Ig(Ct, fn.startsWith("@") ? fn : `@${fn}`, Ct === i.getUserId())), Bt.focus(s), Gl(s);
    }, [
      i,
      t,
      s
    ]), De = p.useCallback((pt) => {
      var _a7;
      const Ct = pt.currentTarget.getAttribute("data-event-id");
      if (!Ct) {
        $t({
          userId: i.getUserId() ?? "",
          eventId: e,
          body: "",
          relation: {
            rel_type: Xn.Thread,
            event_id: e
          }
        });
        return;
      }
      const En = t.findEventById(Ct);
      if (!En) return;
      const ur = ((_a7 = eh(Ct, En, t.getUnfilteredTimelineSet())) == null ? void 0 : _a7.getContent()["m.new_content"]) ?? En.getContent(), { body: Lr, formatted_body: pn } = ur, nt = En.getSender();
      if (nt) {
        const an = {
          userId: nt,
          eventId: Ct,
          body: typeof Lr == "string" ? Lr : "",
          formattedBody: pn,
          relation: {
            rel_type: Xn.Thread,
            event_id: e
          }
        };
        wt === Ct && (Lt == null ? void 0 : Lt.body) ? $t({
          userId: i.getUserId() ?? "",
          eventId: e,
          body: "",
          relation: {
            rel_type: Xn.Thread,
            event_id: e
          }
        }) : $t(an);
      }
    }, [
      i,
      t,
      $t,
      wt,
      e,
      Lt
    ]), Ae = p.useCallback((pt, Ct, En) => {
      var _a7;
      const fn = (_a7 = t.getThread(e)) == null ? void 0 : _a7.timelineSet;
      VB(i, t, pt, Ct, En, fn);
    }, [
      i,
      t,
      e
    ]), Ge = p.useCallback(() => {
      var _a7, _b4;
      const pt = i.getUserId(), En = (_a7 = [
        ...b.current
      ].toReversed().find((fn) => fn.id !== e && fn.mEvent.getSender() === pt && !fn.mEvent.isRedacted() && !is(fn.mEvent))) == null ? void 0 : _a7.id;
      if (En) {
        x(En);
        const fn = a.current;
        fn && ((_b4 = fn.querySelector(`[data-message-id="${En}"]`)) == null ? void 0 : _b4.scrollIntoView({
          block: "nearest",
          behavior: "smooth"
        }));
      }
    }, [
      i,
      e,
      x
    ]), ot = p.useCallback((pt) => {
      i.resendEvent(pt, t);
    }, [
      i,
      t
    ]), Mt = p.useCallback((pt) => {
      i.cancelPendingEvent(pt);
    }, [
      i
    ]), cn = p.useCallback((pt) => {
      var _a7, _b4, _c3;
      const Ct = pt.currentTarget.getAttribute("data-event-id");
      if (!Ct) return;
      let En = lie(t, Ct);
      const Lr = ((_b4 = (_a7 = Be == null ? void 0 : Be.timelineSet.getLiveTimeline()) == null ? void 0 : _a7.getEvents()) == null ? void 0 : _b4.findIndex((On) => On.getId() === En)) ?? -1;
      if (Lr >= 0) {
        const On = Gfe(b.current, Lr);
        if (On) {
          const Qr = b.current[On.rowIndex];
          Qr && (En = Qr.id);
        }
      }
      const pn = En === e, nt = b.current.some((On) => On.id === En);
      if (!pn && !nt) return;
      u(En), setTimeout(() => u(void 0), 2500);
      const an = a.current;
      an && ((_c3 = an.querySelector(`[data-message-id="${En}"]`)) == null ? void 0 : _c3.scrollIntoView({
        block: "nearest",
        behavior: "smooth"
      }));
    }, [
      e,
      t,
      Be
    ]), un = d ? $e.findIndex((pt) => pt.id === d) : -1, gn = un >= 0 && $e[un] ? {
      index: $e[un].itemIndex,
      highlight: true
    } : void 0, Ke = Zfe({
      room: t,
      mx: i,
      pushProcessor: T,
      nicknames: S,
      imagePackRooms: At,
      settings: {
        messageLayout: O,
        messageSpacing: M,
        hideReads: L,
        showDeveloperTools: H,
        hour24Clock: I,
        dateFormatString: N,
        mediaAutoLoad: V,
        showUrlPreview: G,
        showClientUrlPreview: le,
        showBundledPreview: K,
        autoplayStickers: ie,
        hideMemberInReadOnly: X,
        isReadOnly: Rt,
        hideMembershipEvents: true,
        hideNickAvatarEvents: true,
        showHiddenEvents: ne,
        hideThreadChip: true
      },
      state: {
        focusItem: gn,
        editId: C,
        activeReplyId: wt,
        openThreadId: e
      },
      permissions: {
        canRedact: Ee,
        canDeleteOwn: ke,
        canSendReaction: Ne,
        canPinEvent: lt
      },
      callbacks: {
        onUserClick: Zt,
        onUsernameClick: ut,
        onReplyClick: De,
        onReactionToggle: Ae,
        onEditId: x,
        onResend: ot,
        onDeleteFailedSend: Mt,
        setOpenThread: () => {
        },
        handleOpenReply: cn
      },
      utils: {
        htmlReactParserOptions: he,
        linkifyOpts: te,
        getMemberPowerTag: We,
        parseMemberEvent: yt
      }
    }), it = new Set($e.map((pt) => pt.mEvent.getSender()).filter(Boolean)), It = ((_a6 = $e.at(-1)) == null ? void 0 : _a6.id) ?? (Ue == null ? void 0 : Ue.getId()), [Pt, Sn] = Fe(ge, "threadSidebarWidth"), [Mn, on] = p.useState(Pt);
    p.useEffect(() => {
      on(Pt);
    }, [
      Pt
    ]);
    const [vt, je] = Fe(ge, "threadRootHeight"), [Ve, St] = p.useState(vt);
    return p.useEffect(() => {
      St(vt);
    }, [
      vt
    ]), o.jsxs(E, {
      className: r ? tme : Xfe,
      direction: "Column",
      shrink: "No",
      style: {
        position: "relative",
        width: r ? "100%" : He(Mn)
      },
      children: [
        !Dr() && o.jsx(Zl, {
          setCurWidth: on,
          sidebarWidth: Pt,
          setSidebarWidth: Sn,
          minValue: 150,
          maxValue: 600,
          isReversed: true
        }),
        o.jsxs(wn, {
          className: Qfe,
          variant: "Background",
          size: "600",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Q, {
                  size: "200",
                  src: q.Thread
                }),
                o.jsx(D, {
                  size: "H4",
                  truncate: true,
                  children: "Thread"
                })
              ]
            }),
            o.jsx(E, {
              alignItems: "Center",
              gap: "200",
              shrink: "No",
              children: o.jsx(Oe, {
                onClick: n,
                variant: "SurfaceVariant",
                size: "300",
                radii: "300",
                "aria-label": "Close thread",
                children: o.jsx(Q, {
                  size: "200",
                  src: q.Cross
                })
              })
            })
          ]
        }),
        Ue && o.jsxs(E, {
          className: Uit,
          children: [
            o.jsx(E, {
              className: Vit,
              children: o.jsx(dn, {
                variant: "Background",
                visibility: "Hover",
                direction: "Vertical",
                size: "300",
                hideTrack: true,
                style: {
                  height: He(Ve),
                  flexShrink: 0
                },
                children: o.jsx(E, {
                  className: cX,
                  direction: "Column",
                  style: {
                    padding: `${ee.space.S200} 0 ${ee.space.S100} 0`
                  },
                  children: Ke(Ue.getType(), typeof Ue.getStateKey() == "string", Ue.getId(), Ue, ((_b3 = $e.find((pt) => pt.id === e)) == null ? void 0 : _b3.itemIndex) ?? 0, (Be == null ? void 0 : Be.timelineSet) ?? t.getUnfilteredTimelineSet(), false)
                })
              })
            }),
            o.jsx(Zl, {
              setCurWidth: St,
              sidebarWidth: vt,
              setSidebarWidth: je,
              minValue: 60,
              maxValue: 700,
              topSided: true
            })
          ]
        }),
        o.jsx(E, {
          className: eme,
          grow: "Yes",
          direction: "Column",
          children: o.jsx(dn, {
            ref: y,
            variant: "Background",
            visibility: "Hover",
            direction: "Vertical",
            size: "300",
            onScroll: Ut,
            style: {
              flexGrow: 1
            },
            children: bn ? o.jsx(E, {
              direction: "Column",
              alignItems: "Center",
              justifyContent: "Center",
              style: {
                padding: ee.space.S400
              },
              children: o.jsx(dt, {
                variant: "Secondary",
                size: "400"
              })
            }) : zt.length === 0 ? o.jsxs(E, {
              direction: "Column",
              alignItems: "Center",
              justifyContent: "Center",
              style: {
                padding: ee.space.S400,
                gap: ee.space.S200
              },
              children: [
                o.jsx(Q, {
                  size: "400",
                  src: q.Thread
                }),
                o.jsx(D, {
                  size: "T300",
                  align: "Center",
                  children: "No replies yet. Start the thread below!"
                })
              ]
            }) : o.jsxs(o.Fragment, {
              children: [
                h && o.jsx(E, {
                  justifyContent: "Center",
                  style: {
                    padding: ee.space.S300,
                    flexShrink: 0
                  },
                  children: o.jsx(dt, {
                    variant: "Secondary",
                    size: "200"
                  })
                }),
                o.jsx(E, {
                  style: {
                    padding: `${ee.space.S200} ${ee.space.S400}`,
                    flexShrink: 0
                  },
                  children: o.jsxs(D, {
                    size: "T300",
                    priority: "300",
                    children: [
                      zt.length,
                      " ",
                      zt.length === 1 ? "reply" : "replies"
                    ]
                  })
                }),
                o.jsx(E, {
                  className: cX,
                  direction: "Column",
                  style: {
                    padding: `0 0 ${ee.space.S600} 0`
                  },
                  children: zt.map((pt) => Ke(pt.mEvent.getType(), typeof pt.mEvent.getStateKey() == "string", pt.id, pt.mEvent, pt.itemIndex, pt.timelineSet, pt.collapsed))
                })
              ]
            })
          })
        }),
        o.jsxs(E, {
          className: Hit,
          direction: "Column",
          shrink: "No",
          children: [
            o.jsx("div", {
              style: {
                padding: `0 ${ee.space.S400}`
              },
              children: o.jsx(Lfe, {
                room: t,
                roomId: t.roomId,
                threadRootId: e,
                editor: s,
                fileDropContainerRef: a,
                onEditLastMessage: Ge
              }, e)
            }),
            L ? o.jsx(Sfe, {}) : o.jsx(jfe, {
              room: t,
              threadEventId: It,
              participantIds: it
            })
          ]
        })
      ]
    });
  }
  function Wit({ room: t, thread: e, onClick: n, onJump: r }) {
    const i = be(), a = hn(), { navigateRoom: s } = Wi(), l = Ze(qr), c = gs(), [d] = Fe(ge, "hour24Clock"), [u] = Fe(ge, "dateFormatString"), [h] = Fe(ge, "mediaAutoLoad"), [f] = Fe(ge, "urlPreview"), g = om(t.roomId), m = Xd(), v = p.useMemo(() => ({
      ...fs,
      render: em(c, (L) => _h(i, t.roomId, L, Jd(g), l), g)
    }), [
      i,
      t.roomId,
      l,
      g,
      c
    ]), y = p.useMemo(() => Ql(i, t.roomId, {
      settingsLinkBaseUrl: c,
      linkifyOpts: v,
      handleSpoilerClick: m,
      handleMentionClick: g,
      useAuthentication: a,
      nicknames: l
    }), [
      i,
      t,
      v,
      g,
      m,
      a,
      l,
      c
    ]), w = p.useCallback((L) => {
      L.stopPropagation(), s(t.roomId, e.id), r == null ? void 0 : r();
    }, [
      s,
      t.roomId,
      e.id,
      r
    ]), [, b] = p.useState(0);
    p.useEffect(() => {
      const L = (H, V) => {
        (!V || V === e.id) && b((Z) => Z + 1);
      };
      return t.on(mt.UnreadNotifications, L), () => {
        t.off(mt.UnreadNotifications, L);
      };
    }, [
      t,
      e.id
    ]);
    const j = t.getThreadUnreadNotificationCount(e.id, ir.Total), k = t.getThreadUnreadNotificationCount(e.id, ir.Highlight), { rootEvent: C } = e;
    if (!C) return null;
    const x = C.getSender() ?? "", S = gr(t, x, l) ?? _n(x) ?? x, T = Jc(t, x), A = (() => C.getContent()), B = e.events.filter((L) => L.getId() !== e.id && !is(L)).length, U = Math.max(B, e.length ?? 0), z = e.events.findLast((L) => L.getId() !== e.id && !is(L)), O = (z == null ? void 0 : z.getSender()) ?? "", M = gr(t, O, l) ?? _n(O) ?? O, I = z == null ? void 0 : z.getContent(), N = typeof (I == null ? void 0 : I.body) == "string" ? I.body : "";
    return o.jsx(E, {
      as: "button",
      direction: "Column",
      gap: "100",
      className: $it,
      onClick: () => n(e.id),
      children: o.jsxs(Cp, {
        before: o.jsx(s3, {
          children: o.jsx(xn, {
            size: "300",
            children: o.jsx(Si, {
              userId: x,
              src: T ? Cn(i, T, a, 48, 48, "crop") ?? void 0 : void 0,
              alt: S,
              renderFallback: () => o.jsx(Q, {
                size: "200",
                src: q.User,
                filled: true
              })
            })
          })
        }),
        children: [
          o.jsxs(E, {
            gap: "300",
            justifyContent: "SpaceBetween",
            alignItems: "Center",
            grow: "Yes",
            children: [
              o.jsxs(E, {
                gap: "200",
                alignItems: "Baseline",
                children: [
                  o.jsx(l3, {
                    children: o.jsx(D, {
                      as: "span",
                      truncate: true,
                      children: o.jsx(iF, {
                        children: S
                      })
                    })
                  }),
                  o.jsx(Ma, {
                    ts: C.getTs(),
                    hour24Clock: d,
                    dateFormatString: u
                  })
                ]
              }),
              o.jsxs(E, {
                shrink: "No",
                alignItems: "Center",
                gap: "200",
                children: [
                  j > 0 && o.jsx(f3, {
                    children: o.jsx(Sp, {
                      highlight: k > 0,
                      count: j
                    })
                  }),
                  o.jsx(Qe, {
                    "data-event-id": e.id,
                    onClick: w,
                    radii: "Pill",
                    children: o.jsx(D, {
                      size: "T200",
                      children: "Jump"
                    })
                  })
                ]
              })
            ]
          }),
          C.replyEventId && o.jsx(Pu, {
            room: t,
            replyEventId: C.replyEventId,
            threadRootId: C.threadRootId,
            mentions: C.getContent()["m.mentions"],
            onClick: w
          }),
          o.jsx(E, {
            style: {
              maxHeight: "200px",
              overflow: "auto",
              flexShrink: 0
            },
            children: o.jsx(TS, {
              mEvent: C,
              children: () => C.isRedacted() ? o.jsx(ss, {}) : o.jsx(oh, {
                displayName: S,
                msgType: C.getContent().msgtype ?? "",
                ts: C.getTs(),
                getContent: A,
                edited: !!C.replacingEvent(),
                mediaAutoLoad: h,
                urlPreview: f,
                htmlReactParserOptions: y,
                linkifyOpts: v,
                outlineAttachment: true
              })
            })
          }),
          U > 0 && o.jsxs(E, {
            gap: "100",
            alignItems: "Center",
            style: {
              marginTop: ee.space.S200
            },
            children: [
              o.jsxs(D, {
                size: "T200",
                priority: "300",
                style: {
                  flexShrink: 0
                },
                children: [
                  U,
                  " ",
                  U === 1 ? "reply" : "replies"
                ]
              }),
              z && N && o.jsxs(D, {
                size: "T200",
                priority: "300",
                style: {
                  overflow: "hidden",
                  textOverflow: "ellipsis",
                  whiteSpace: "nowrap",
                  minWidth: 0
                },
                children: [
                  "\xB7 ",
                  M,
                  ": ",
                  N.slice(0, 60)
                ]
              })
            ]
          })
        ]
      })
    });
  }
  function hX({ room: t, onOpenThread: e, onClose: n, overlay: r }) {
    const i = be(), [, a] = p.useState(0), [s, l] = p.useState(""), [c, d] = p.useState(false), [u, h] = p.useState(false), f = p.useRef(null), g = p.useRef(null), m = p.useRef(false), v = p.useRef(false);
    v.current = u, p.useEffect(() => {
      const U = () => a((M) => M + 1);
      t.on(jr.New, U), t.on(jr.Update, U), t.on(jr.NewReply, U);
      let z = false;
      return (async () => {
        d(true);
        try {
          const M = await t.createThreadsTimelineSets();
          if (!M || z) return;
          const [I] = M;
          g.current = I, await t.fetchRoomThreads().catch((L) => {
            console.warn("ThreadBrowser: fetchRoomThreads failed", L);
          });
          const N = await i.paginateEventTimeline(I.getLiveTimeline(), {
            backwards: true
          });
          I.getLiveTimeline().getEvents().filter((L) => !!L.getId()).forEach((L) => {
            const H = L.getId(), V = t.getThread(H);
            V ? V.rootEvent || (V.rootEvent = L, V.setEventMetadata(L)) : t.createThread(H, L, [], false);
          }), z || (h(N), a((L) => L + 1));
        } catch {
        } finally {
          z || d(false);
        }
      })(), () => {
        z = true, t.off(jr.New, U), t.off(jr.Update, U), t.off(jr.NewReply, U);
      };
    }, [
      t,
      i
    ]);
    const y = p.useCallback(async () => {
      const U = g.current;
      if (!(!U || c)) {
        d(true);
        try {
          const z = await i.paginateEventTimeline(U.getLiveTimeline(), {
            backwards: true
          });
          U.getLiveTimeline().getEvents().filter((O) => !!O.getId()).forEach((O) => {
            const M = O.getId(), I = t.getThread(M);
            I ? I.rootEvent || (I.rootEvent = O, I.setEventMetadata(O)) : t.createThread(M, O, [], false);
          }), h(z), a((O) => O + 1);
        } catch {
        } finally {
          d(false), m.current = false;
        }
      }
    }, [
      i,
      t,
      c
    ]), w = p.useRef(y);
    w.current = y;
    const b = p.useCallback((U) => {
      const z = U.currentTarget;
      z.scrollHeight - z.scrollTop - z.clientHeight < 200 && v.current && !m.current && w.current();
    }, []), j = t.getThreads().toSorted((U, z) => {
      var _a6, _b3, _c3, _d4;
      const O = ((_a6 = U.events.at(-1)) == null ? void 0 : _a6.getTs()) ?? ((_b3 = U.rootEvent) == null ? void 0 : _b3.getTs()) ?? 0;
      return (((_c3 = z.events.at(-1)) == null ? void 0 : _c3.getTs()) ?? ((_d4 = z.rootEvent) == null ? void 0 : _d4.getTs()) ?? 0) - O;
    }), k = s.trim().toLowerCase(), C = k ? j.filter((U) => {
      var _a6, _b3;
      const z = ((_b3 = (_a6 = U.rootEvent) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.body) ?? "";
      return typeof z == "string" && z.toLowerCase().includes(k);
    }) : j, x = (U) => {
      l(U.target.value);
    }, [S, T] = Fe(ge, "threadSidebarWidth"), [A, B] = p.useState(S);
    return p.useEffect(() => {
      B(S);
    }, [
      S
    ]), o.jsxs(E, {
      className: r ? tme : Xfe,
      direction: "Column",
      shrink: "No",
      style: {
        position: "relative",
        width: r ? "100%" : He(A)
      },
      children: [
        !Dr() && o.jsx(Zl, {
          setCurWidth: B,
          sidebarWidth: S,
          setSidebarWidth: T,
          minValue: 150,
          maxValue: 600,
          isReversed: true
        }),
        o.jsxs(wn, {
          className: Qfe,
          variant: "Background",
          size: "600",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Q, {
                  size: "200",
                  src: q.Thread
                }),
                o.jsx(D, {
                  size: "H4",
                  truncate: true,
                  children: "Threads"
                })
              ]
            }),
            o.jsx(E, {
              alignItems: "Center",
              gap: "200",
              shrink: "No",
              children: o.jsx(Oe, {
                onClick: n,
                variant: "SurfaceVariant",
                size: "300",
                radii: "300",
                "aria-label": "Close threads",
                children: o.jsx(Q, {
                  size: "200",
                  src: q.Cross
                })
              })
            })
          ]
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: `${ee.space.S200} ${ee.space.S300}`
          },
          shrink: "No",
          children: o.jsx(mn, {
            ref: f,
            value: s,
            onChange: x,
            placeholder: "Search threads...",
            variant: "Surface",
            size: "400",
            radii: "400",
            before: o.jsx(Q, {
              size: "50",
              src: q.Search
            }),
            after: s ? o.jsx(Oe, {
              size: "300",
              radii: "300",
              variant: "SurfaceVariant",
              onClick: () => {
                var _a6;
                l(""), (_a6 = f.current) == null ? void 0 : _a6.focus();
              },
              "aria-label": "Clear search",
              children: o.jsx(Q, {
                size: "50",
                src: q.Cross
              })
            }) : void 0
          })
        }),
        o.jsx(E, {
          className: eme,
          grow: "Yes",
          direction: "Column",
          children: o.jsx(dn, {
            variant: "Background",
            visibility: "Hover",
            direction: "Vertical",
            size: "300",
            onScroll: b,
            style: {
              flexGrow: 1
            },
            children: C.length === 0 && c ? o.jsx(E, {
              direction: "Column",
              alignItems: "Center",
              justifyContent: "Center",
              style: {
                padding: ee.space.S400,
                gap: ee.space.S200
              },
              children: o.jsx(dt, {
                variant: "Secondary",
                size: "400"
              })
            }) : C.length === 0 ? o.jsxs(E, {
              direction: "Column",
              alignItems: "Center",
              justifyContent: "Center",
              style: {
                padding: ee.space.S400,
                gap: ee.space.S200
              },
              children: [
                o.jsx(Q, {
                  size: "400",
                  src: q.Thread
                }),
                o.jsx(D, {
                  size: "T300",
                  align: "Center",
                  children: k ? "No threads match your search." : "No threads yet."
                })
              ]
            }) : o.jsxs(o.Fragment, {
              children: [
                o.jsx(E, {
                  direction: "Column",
                  style: {
                    padding: `${ee.space.S100} ${ee.space.S200}`
                  },
                  children: C.map((U) => o.jsx(Wit, {
                    room: t,
                    thread: U,
                    onClick: e,
                    onJump: n
                  }, U.id))
                }),
                c && o.jsx(E, {
                  justifyContent: "Center",
                  style: {
                    padding: ee.space.S300,
                    flexShrink: 0
                  },
                  children: o.jsx(dt, {
                    variant: "Secondary",
                    size: "400"
                  })
                })
              ]
            })
          })
        })
      ]
    });
  }
  const ey = fo("Room");
  function MT() {
    const { eventId: t } = Fl(), e = cr(), n = be();
    p.useEffect(() => (ey.info("ui", "Room component mounted", {
      roomId: e.roomId,
      eventId: t
    }), () => {
      ey.info("ui", "Room component unmounted", {
        roomId: e.roomId
      });
    }), [
      e.roomId,
      t
    ]);
    const [r] = Fe(ge, "isPeopleDrawer"), [i] = Fe(ge, "isWidgetDrawer"), [a] = Fe(ge, "hideReads"), s = fr();
    p.useEffect(() => {
      ey.debug("ui", "Members drawer state changed", {
        roomId: e.roomId,
        isOpen: r
      });
    }, [
      r,
      e.roomId
    ]), p.useEffect(() => {
      ey.debug("ui", "Widgets drawer state changed", {
        roomId: e.roomId,
        isOpen: i
      });
    }, [
      i,
      e.roomId
    ]);
    const l = Mo(e), c = iS(n, e.roomId), d = Ze(tv), [u, h] = Fr(GM(e.roomId)), [f, g] = Fr(Yde(e.roomId));
    p.useEffect(() => {
      if (!t) return;
      const y = e.findEventById(t);
      if (!y) return;
      const { threadRootId: w } = y;
      if (w) {
        if (!e.getThread(w)) {
          const b = e.findEventById(w);
          b && e.createThread(w, b, [], false);
        }
        h(w);
      }
    }, [
      t,
      e,
      h
    ]), Ld(window, p.useCallback((y) => {
      Yt.isKeyHotkey("escape", y) && As(n, e.roomId, a);
    }, [
      n,
      e.roomId,
      a
    ]));
    const m = e.isCallRoom(), v = KNe(e);
    return p.useEffect(() => {
      ey.debug("ui", "Room view mode", {
        roomId: e.roomId,
        callView: m,
        chatOpen: d
      });
    }, [
      m,
      d,
      e.roomId
    ]), o.jsx(Zoe, {
      value: l,
      children: o.jsx(sce.Provider, {
        value: v,
        children: o.jsxs(E, {
          grow: "Yes",
          style: {
            position: "relative"
          },
          children: [
            m && (s === sn.Desktop || !d) && o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              children: [
                o.jsx(OJ, {
                  callView: true
                }),
                o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(Wde, {})
                })
              ]
            }),
            !m && o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              children: [
                o.jsx(OJ, {}),
                o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(Jfe, {
                    eventId: t
                  })
                })
              ]
            }),
            m && d && o.jsxs(o.Fragment, {
              children: [
                s === sn.Desktop && o.jsx(nr, {
                  variant: "Background",
                  direction: "Vertical",
                  size: "300"
                }),
                o.jsx(zit, {})
              ]
            }),
            !m && s === sn.Desktop && r && o.jsxs(o.Fragment, {
              children: [
                o.jsx(nr, {
                  variant: "Background",
                  direction: "Vertical",
                  size: "300"
                }),
                o.jsx(Dfe, {
                  room: e,
                  members: c
                }, e.roomId)
              ]
            }),
            s === sn.Desktop && i && o.jsxs(o.Fragment, {
              children: [
                o.jsx(nr, {
                  variant: "Background",
                  direction: "Vertical",
                  size: "300"
                }),
                o.jsx(sGe, {
                  room: e
                }, `widgets-${e.roomId}`)
              ]
            }),
            s === sn.Desktop && u && o.jsxs(o.Fragment, {
              children: [
                o.jsx(nr, {
                  variant: "Background",
                  direction: "Vertical",
                  size: "300"
                }),
                o.jsx(uX, {
                  room: e,
                  threadRootId: u,
                  onClose: () => h(void 0)
                }, `thread-${e.roomId}-${u}`)
              ]
            }),
            s === sn.Desktop && f && !u && o.jsxs(o.Fragment, {
              children: [
                o.jsx(nr, {
                  variant: "Background",
                  direction: "Vertical",
                  size: "300"
                }),
                o.jsx(hX, {
                  room: e,
                  onOpenThread: (y) => {
                    h(y), g(false);
                  },
                  onClose: () => g(false)
                }, `thread-browser-${e.roomId}`)
              ]
            }),
            s !== sn.Desktop && u && o.jsx(uX, {
              room: e,
              threadRootId: u,
              onClose: () => h(void 0),
              overlay: true
            }, `thread-${e.roomId}-${u}`),
            s !== sn.Desktop && f && !u && o.jsx(hX, {
              room: e,
              onOpenThread: (y) => {
                h(y), g(false);
              },
              onClose: () => g(false),
              overlay: true
            }, `thread-browser-${e.roomId}`)
          ]
        })
      })
    });
  }
  const qit = "closedLobbyCategories", Kit = (t) => {
    const e = `${qit}${t}`, n = ph(e, (i) => {
      const a = Ps(i, []);
      return new Set(a);
    }, (i, a) => {
      const s = Array.from(a);
      Vd(i, s);
    });
    return vn((i) => i(n), (i, a, s) => {
      if (s.type === "DELETE") {
        a(n, uo(i(n), (l) => {
          l.delete(s.categoryId);
        }));
        return;
      }
      s.type === "PUT" && a(n, uo(i(n), (l) => {
        l.add(s.categoryId);
      }));
    });
  }, M8 = (...t) => t.join("|"), Git = (t) => t.split("|"), nme = (t, e) => lse(t.ts, e.ts), rme = (t, e) => cse(t.content.order, e.content.order), Yit = (t, e) => lse(t.getTs(), e.getTs()), Zit = (t, e) => cse(t.getContent().order, e.getContent().order), ime = (t, e, n, r) => {
    const i = {
      roomId: t,
      content: {
        via: []
      },
      ts: 0,
      space: true,
      depth: 0
    }, a = [], s = (l, c, d = /* @__PURE__ */ new Set()) => {
      const u = M8(c, l.roomId);
      if (d.has(u)) return;
      d.add(u);
      const h = e(l.roomId);
      if (a.push(l), !h) return;
      Ud(h, ce.SpaceChild).filter((g) => {
        var _a6;
        if (!X1(g)) return false;
        const m = g.getStateKey();
        return !m || !Bc(m) || n(l.roomId, m, l.depth) ? false : ((_a6 = e(m)) == null ? void 0 : _a6.isSpaceRoom()) || r.has(m);
      }).toSorted(Yit).toSorted(Zit).forEach((g) => {
        const m = g.getStateKey();
        if (!m || !Bc(m)) return;
        const v = {
          roomId: m,
          content: g.getContent(),
          ts: g.getTs(),
          space: true,
          parentId: l.roomId,
          depth: l.depth + 1
        };
        s(v, l.roomId, d);
      });
    };
    return s(i, t), a;
  }, OT = (t, e, n, r, i) => ime(t, n, r, e).map((l) => {
    const c = n(l.roomId);
    if (!c || i(l.roomId)) return {
      space: l
    };
    const d = Ud(c, ce.SpaceChild), u = [];
    return d.forEach((h) => {
      var _a6;
      if (!X1(h)) return;
      const f = h.getStateKey();
      if (!f || !Bc(f) || ((_a6 = n(f)) == null ? void 0 : _a6.isSpaceRoom()) || e.has(f)) return;
      const g = {
        roomId: f,
        content: h.getContent(),
        ts: h.getTs(),
        parentId: l.roomId,
        depth: l.depth
      };
      u.push(g);
    }), {
      space: l,
      rooms: u.toSorted(nme).toSorted(rme)
    };
  }), Jit = (t, e, n, r, i) => {
    const a = be(), s = Ze(vi), [l] = p.useState(() => vn(OT(t, e, n, r, i))), [c, d] = Fr(l);
    return p.useEffect(() => {
      d(OT(t, e, n, r, i));
    }, [
      a,
      t,
      e,
      d,
      n,
      i,
      r
    ]), vl(a, p.useCallback((u) => {
      if (u.getType() !== ce.SpaceChild) return;
      const h = u.getRoomId();
      h && (t === h || sa(s, h).has(t)) && d(OT(t, e, n, r, i));
    }, [
      t,
      s,
      d,
      e,
      n,
      i,
      r
    ])), c;
  }, LT = (t, e, n, r) => {
    const i = ime(t, e, n, /* @__PURE__ */ new Set()), a = (l, c = /* @__PURE__ */ new Set()) => {
      if (c.has(l)) return false;
      c.add(l);
      const d = e(l);
      return d ? Ud(d, ce.SpaceChild).some((h) => {
        if (!X1(h)) return false;
        const f = h.getStateKey();
        if (!f || !Bc(f)) return false;
        const g = e(f);
        return g ? g.isSpaceRoom() ? a(f, c) : true : false;
      }) : false;
    };
    return i.flatMap((l) => {
      const c = e(l.roomId);
      if (!c) return [];
      const d = Ud(c, ce.SpaceChild).filter((h) => {
        if (!X1(h)) return false;
        const f = h.getStateKey();
        if (!f || !Bc(f)) return false;
        const g = e(f);
        return !(!g || g.isSpaceRoom());
      });
      if (!a(l.roomId)) return [];
      const u = [];
      return d.forEach((h) => {
        const f = h.getStateKey();
        if (!f || n(c.roomId, f, l.depth)) return;
        const g = {
          roomId: f,
          content: h.getContent(),
          ts: h.getTs(),
          parentId: l.roomId,
          depth: l.depth
        };
        u.push(g);
      }), [
        l
      ].concat(r(l.roomId, u));
    });
  }, Xit = (t, e, n, r) => {
    const i = be(), a = Ze(vi), s = p.useCallback((u, h) => r(u) ? (h.sort((f, g) => Ku(i)(f.roomId, g.roomId)), h) : h.toSorted(nme).toSorted(rme), [
      i,
      r
    ]), [l] = p.useState(() => vn(LT(t, e, n, s))), [c, d] = Fr(l);
    return p.useEffect(() => {
      d(LT(t, e, n, s));
    }, [
      i,
      t,
      d,
      e,
      n,
      s
    ]), vl(i, p.useCallback((u) => {
      if (u.getType() !== ce.SpaceChild) return;
      const h = u.getRoomId();
      h && (t === h || sa(a, h).has(t)) && d(LT(t, e, n, s));
    }, [
      t,
      a,
      d,
      e,
      n,
      s
    ])), c;
  }, Qit = 100, eot = 50, tot = (t, e) => {
    const n = be(), r = p.useRef(0), i = p.useCallback(({ pageParam: m }) => n.getRoomHierarchy(t, Qit, 1, false, m), [
      t,
      n
    ]), a = bte({
      refetchOnMount: e,
      queryKey: [
        t,
        "hierarchy_level"
      ],
      initialPageParam: void 0,
      queryFn: i,
      getNextPageParam: (m) => {
        if (m.next_batch) return m.next_batch;
      },
      retry: 5,
      retryDelay: (m, v) => {
        if (v instanceof Un && v.errcode === vo.M_LIMIT_EXCEEDED) {
          const { retry_after_ms: y } = v.data;
          if (typeof y == "number") return y;
        }
        return 500 * m;
      }
    }), { data: s, isLoading: l, isFetchingNextPage: c, error: d, fetchNextPage: u, hasNextPage: h } = a;
    p.useEffect(() => {
      h && r.current <= eot && !d && s && s.pages.length > 0 && (r.current += 1, u());
    }, [
      u,
      h,
      s,
      d
    ]);
    const f = p.useMemo(() => {
      const m = /* @__PURE__ */ new Map();
      return s && s.pages.flatMap((y) => y.rooms).forEach((y) => {
        m.set(y.room_id, y);
      }), m;
    }, [
      s
    ]);
    return {
      fetching: l || c,
      error: d,
      rooms: f
    };
  }, not = "spaceRooms", cD = ph(not, (t) => {
    const e = Ps(t, []);
    return new Set(e);
  }, (t, e) => {
    const n = Array.from(e);
    Vd(t, n);
  }), ome = vn((t) => t(cD), (t, e, n) => {
    const r = t(cD), { type: i, roomIds: a } = n;
    if (i === "DELETE" && a.find((s) => r.has(s))) {
      e(cD, uo(r, (s) => {
        a.forEach((l) => s.delete(l));
      }));
      return;
    }
    if (i === "PUT") {
      const s = a.filter((l) => !r.has(l));
      s.length > 0 && e(cD, uo(r, (l) => {
        s.forEach((c) => l.add(c));
      }));
    }
  }), BS = (t, e) => (r) => {
    const i = r.currentTarget.getAttribute("data-category-id");
    if (i) {
      if (e(i)) {
        t({
          type: "DELETE",
          categoryId: i
        });
        return;
      }
      t({
        type: "PUT",
        categoryId: i
      });
    }
  }, rot = Po("ASCIILexicalTable");
  class iot {
    constructor(e, n, r) {
      __publicField(this, "startCode");
      __publicField(this, "endCode");
      __publicField(this, "maxStrWidth");
      __publicField(this, "widthToSize");
      __publicField(this, "rangeCount");
      if (e > n) throw new Error("Invalid ASCII code! startCode is greater than endCode.");
      if (e < 0 || n > 128) throw new Error("Invalid ASCII code range!");
      if (r <= 0) throw new Error("Invalid max string width!");
      this.maxStrWidth = r, this.startCode = e, this.endCode = n, this.rangeCount = (i, a) => a - i + 1, this.widthToSize = [], this.populateWidthToSize(), this.size() > Number.MAX_SAFE_INTEGER && rot.warn(`[!] Warning: ASCIILexicalTable size is larger than the Number.MAX_SAFE_INTEGER: ${this.size()} > ${Number.MAX_SAFE_INTEGER}`);
    }
    populateWidthToSize() {
      const e = this.rangeCount(this.startCode, this.endCode);
      for (let n = 0, r = 0; n < this.maxStrWidth; n += 1) r = r * e + e, this.widthToSize[n] = r;
    }
    getWidthToSize(e) {
      return this.widthToSize[e - 1] ?? 0;
    }
    first() {
      return String.fromCodePoint(this.startCode);
    }
    last() {
      let e = "";
      for (let n = 0; n < this.maxStrWidth; n += 1) e += String.fromCodePoint(this.endCode);
      return e;
    }
    hasIndex(e) {
      return e >= 0 && e < this.size();
    }
    has(e) {
      if (e.length === 0 || e.length > this.maxStrWidth) return false;
      let n;
      for (let r = 0; r < e.length; r += 1) if (n = e.charCodeAt(r), n < this.startCode || n > this.endCode) return false;
      return true;
    }
    size() {
      return this.getWidthToSize(this.maxStrWidth);
    }
    index(e) {
      if (!this.has(e)) return -1;
      let n = 0;
      const r = this.rangeCount(this.startCode, this.endCode);
      for (let i = 0; i < this.maxStrWidth; i += 1) {
        const a = e.charCodeAt(i);
        if (Number.isNaN(a)) return n;
        const s = this.maxStrWidth - i, c = this.getWidthToSize(s) / r, d = a - this.startCode, u = i === 0 ? 0 : 1;
        n += c * d + u;
      }
      return n;
    }
    get(e) {
      if (!this.hasIndex(e)) return;
      let n = "";
      const r = this.rangeCount(this.startCode, this.endCode);
      for (let i = e, a = 0; a < this.maxStrWidth; a += 1) {
        const s = this.maxStrWidth - a, c = this.getWidthToSize(s) / r, d = Math.floor(i / c);
        if (n += String.fromCharCode(this.startCode + d), i -= d * c, i === 0) break;
        i -= 1;
      }
      return n;
    }
    previous(e) {
      if (!this.has(e)) return;
      let n = e;
      const r = n.charCodeAt(n.length - 1);
      if (n = n.slice(0, n.length - 1), r === this.startCode) return n.length === 0 ? void 0 : n;
      for (n += String.fromCharCode(r - 1); n.length < this.maxStrWidth; ) n += String.fromCodePoint(this.endCode);
      return n;
    }
    next(e) {
      if (!this.has(e)) return;
      let n = e;
      if (n.length < this.maxStrWidth) return n += String.fromCharCode(this.startCode), n;
      for (let r = n.length - 1; r >= 0; r -= 1) {
        const i = n.charCodeAt(r);
        if (i !== this.endCode) return n = n.slice(0, r) + String.fromCharCode(i + 1), n;
        n = n.slice(0, r);
      }
    }
    between(e, n) {
      if (!this.has(e) || !this.has(n)) return;
      const r = Math.floor((this.index(e) + this.index(n)) / 2), i = this.get(r);
      if (!(i === e || i === n)) return i;
    }
    nBetween(e, n, r) {
      if (e <= 0 || !this.has(n) || !this.has(r)) return;
      const i = this.index(n), a = this.index(r), s = Math.max(i, a) - Math.min(i, a);
      if (s < e) return;
      const l = Math.floor(s / (e + 1));
      if (l === 0) return;
      const c = [];
      for (let d = i + l; d < a && c.length !== e; d += l) {
        const u = this.get(d);
        if (!u) break;
        c.push(u);
      }
      if (!(c.length < e)) return c;
    }
  }
  const oot = (t, e) => {
    for (let n = t; n < e.length; n += 1) {
      const r = e[n];
      if (typeof r == "string") return [
        n,
        r
      ];
    }
    return [
      -1,
      void 0
    ];
  }, fX = (t, e) => {
    const n = [];
    for (let r = 0; r < e.length; ) {
      const i = e[r], a = [], [s, l] = oot(r + 1, e);
      typeof i == "string" && a.push(i);
      const d = (s === -1 ? e.length : s) - (i ? r + 1 : r + 0);
      if (d > 0) {
        const u = t.nBetween(d, i ?? t.first(), l ?? t.last());
        if (u) a.push(...u);
        else return t.nBetween(e == null ? void 0 : e.length, t.first(), t.last());
      }
      n.push(...a), r += a.length;
    }
    if (n.length === e.length) return n;
  }, ame = p.createContext(null), aot = ame.Provider, sot = () => {
    const t = p.useContext(ame);
    if (!t) throw new Error("ClosedLobbyCategoriesAtom is not provided!");
    return t;
  }, k1 = (t, e, n) => {
    const r = (n == null ? void 0 : n.sidebar) ?? (n == null ? void 0 : n.shortcut) ?? [], i = new Set(e), a = [], s = (l) => {
      if (typeof l != "string") return false;
      const c = t.getRoom(l);
      return (c == null ? void 0 : c.getMyMembership()) !== Ht.Join ? false : Uu(c);
    };
    return r.forEach((l) => {
      if (typeof l == "string") {
        s(l) && !a.includes(l) && (i.delete(l), a.push(l));
        return;
      }
      if (typeof l == "object" && typeof l.id == "string" && Array.isArray(l.content) && !a.find((c) => typeof c == "string" ? false : c.id === l.id)) {
        const c = l.content.filter(s);
        c.forEach((d) => i.delete(d)), a.push({
          ...l,
          content: Array.from(new Set(c))
        });
      }
    }), i.forEach((l) => a.push(l)), a;
  }, sme = (t) => {
    const e = be(), [n, r] = p.useState(() => {
      var _a6;
      const i = (_a6 = Qu(e, Zr.CinnySpaces)) == null ? void 0 : _a6.getContent();
      return k1(e, t, i);
    });
    return p.useEffect(() => {
      var _a6;
      const i = (_a6 = Qu(e, Zr.CinnySpaces)) == null ? void 0 : _a6.getContent();
      r(k1(e, t, i));
    }, [
      e,
      t
    ]), bp(e, p.useCallback((i) => {
      if (i.getType() === Zr.CinnySpaces) {
        const a = i.getContent();
        r(k1(e, t, a));
      }
    }, [
      e,
      t
    ])), [
      n,
      r
    ];
  }, lot = (t, e, n) => {
    const r = n == null ? void 0 : n.trim(), i = r || void 0;
    return t.map((a) => typeof a == "object" && a.id === e ? {
      ...a,
      name: i
    } : a);
  }, lme = (t, e) => t.map((r) => {
    if (typeof r == "string") return r === e ? null : r;
    if (r.content.includes(e)) {
      const i = r.content.filter((a) => a !== e);
      return i.length === 0 ? null : {
        ...r,
        content: i
      };
    }
    return r;
  }).filter((r) => r !== null), fC = (t, e) => {
    var _a6;
    return {
      ...((_a6 = Qu(t, Zr.CinnySpaces)) == null ? void 0 : _a6.getContent()) ?? {},
      sidebar: e
    };
  }, cot = (t) => {
    var _a6, _b3;
    const n = (_a6 = ni(t, ce.RoomTopic)) == null ? void 0 : _a6.getContent(), r = n && typeof n.topic == "string" ? n.topic : void 0, a = (_b3 = ni(t, ce.RoomHistoryVisibility)) == null ? void 0 : _b3.getContent(), s = a && typeof a.history_visibility == "string" ? a.history_visibility === ll.WorldReadable : void 0, l = t.getGuestAccess() === j2.CanJoin;
    return {
      roomId: t.roomId,
      name: t.name,
      topic: r,
      avatarUrl: t.getMxcAvatarUrl() ?? void 0,
      canonicalAlias: t.getCanonicalAlias() ?? void 0,
      worldReadable: s,
      guestCanJoin: l,
      memberCount: t.getJoinedMemberCount(),
      roomType: t.getType(),
      joinRule: t.getJoinRule()
    };
  };
  function O8({ roomIdOrAlias: t, children: e }) {
    const n = be(), r = p.useCallback(() => n.getRoomSummary(t), [
      n,
      t
    ]), { data: i } = ol({
      queryKey: [
        t,
        "summary"
      ],
      queryFn: r
    });
    return e(i);
  }
  function ZO({ room: t, children: e }) {
    const n = cot(t);
    return e(n);
  }
  function JO() {
    return o.jsx(ar, {
      position: "Right",
      align: "Center",
      tooltip: o.jsx(pr, {
        style: {
          maxWidth: He(200)
        },
        children: o.jsxs(E, {
          direction: "Column",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Notice"
            }),
            o.jsx(D, {
              size: "T200",
              children: "This feature is under testing and may change over time."
            })
          ]
        })
      }),
      children: (t) => o.jsx(Rn, {
        size: "500",
        tabIndex: 0,
        ref: t,
        variant: "Primary",
        fill: "Solid",
        children: o.jsx(D, {
          size: "L400",
          children: "Beta"
        })
      })
    });
  }
  const dot = {
    limit: 500,
    matchOptions: {
      contain: true
    },
    normalizeOptions: {
      ignoreWhitespace: false
    }
  };
  function cme({ parentId: t, space: e, requestClose: n }) {
    const r = be(), i = hn(), a = Kr(), s = Ze(gi), l = HP(r, zr), c = $P(r, zr, s), d = u3(r, zr, s), u = Ze(vi), h = p.useRef(null), [f, g] = p.useState([]), m = td(), v = ec(m), y = p.useCallback((L, H, V = /* @__PURE__ */ new Set()) => {
      if (V.has(H)) return false;
      V.add(H);
      const Z = u.get(H);
      return Z ? Z.has(L) ? true : Array.from(Z).some((Y) => y(L, Y, V)) : false;
    }, [
      u
    ]), w = p.useMemo(() => (e ? [
      ...l
    ] : [
      ...c,
      ...d
    ]).filter((H) => H !== t && !y(H, t)).toSorted(Yk(r)), [
      e,
      l,
      c,
      d,
      r,
      t,
      y
    ]), b = p.useCallback((L) => {
      var _a6;
      return ((_a6 = v(L)) == null ? void 0 : _a6.name) ?? L;
    }, [
      v
    ]), [j, k, C] = tc(w, b, dot), x = (j == null ? void 0 : j.query) ? a3(j.query.split(" ")) : void 0, S = j ? j.items : w, T = nc({
      count: S.length,
      getScrollElement: () => h.current,
      estimateSize: () => 32,
      overscan: 5
    }), A = T.getVirtualItems(), B = (L) => {
      const H = L.currentTarget.value.trim();
      if (!H) {
        C();
        return;
      }
      k(H);
    }, [U, z] = Et(p.useCallback(async (L) => {
      await Hu(L, async (H) => {
        const V = Xc(H);
        await r.sendStateEvent(t, ce.SpaceChild, {
          auto_join: false,
          suggested: false,
          via: V
        }, H.roomId);
      });
    }, [
      r,
      t
    ])), O = U.status === ve.Loading, M = (L) => {
      const H = L.currentTarget.getAttribute("data-room-id");
      if (!H) return;
      if (f == null ? void 0 : f.includes(H)) {
        g(f == null ? void 0 : f.filter((Z) => Z !== H));
        return;
      }
      const V = [
        ...f ?? []
      ];
      V.push(H), g(V);
    }, I = () => {
      const L = f.map((H) => v(H)).filter((H) => H !== void 0);
      z(L).then(() => {
        a() && (g([]), n());
      });
    }, N = () => {
      g([]);
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            clickOutsideDeactivates: true,
            onDeactivate: n,
            escapeDeactivates: kt
          },
          children: o.jsx(Go, {
            size: "300",
            children: o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              children: [
                o.jsxs(wn, {
                  size: "500",
                  style: {
                    padding: ee.space.S200,
                    paddingLeft: ee.space.S400
                  },
                  children: [
                    o.jsx(E, {
                      grow: "Yes",
                      children: o.jsx(D, {
                        size: "H4",
                        children: "Add Existing"
                      })
                    }),
                    o.jsx(E, {
                      shrink: "No",
                      children: o.jsx(Oe, {
                        size: "300",
                        radii: "300",
                        onClick: n,
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    })
                  ]
                }),
                o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(dn, {
                    ref: h,
                    size: "300",
                    hideTrack: true,
                    children: o.jsxs(E, {
                      style: {
                        padding: ee.space.S300,
                        paddingRight: 0
                      },
                      direction: "Column",
                      gap: "500",
                      children: [
                        o.jsx(E, {
                          direction: "Column",
                          style: {
                            position: "sticky",
                            top: ee.space.S300,
                            zIndex: 1
                          },
                          children: o.jsx(mn, {
                            onChange: B,
                            before: o.jsx(Q, {
                              size: "200",
                              src: q.Search
                            }),
                            placeholder: "Search",
                            size: "400",
                            variant: "Background",
                            outlined: true
                          })
                        }),
                        A.length === 0 && o.jsxs(E, {
                          style: {
                            paddingTop: ee.space.S700
                          },
                          grow: "Yes",
                          alignItems: "Center",
                          justifyContent: "Center",
                          direction: "Column",
                          gap: "100",
                          children: [
                            o.jsx(D, {
                              size: "H6",
                              align: "Center",
                              children: j ? "No Match Found" : `No ${e ? "Spaces" : "Rooms"}`
                            }),
                            o.jsx(D, {
                              size: "T200",
                              align: "Center",
                              children: j ? `No match found for "${j.query}".` : `You do not have any ${e ? "Spaces" : "Rooms"} to display yet.`
                            })
                          ]
                        }),
                        o.jsx(E, {
                          style: {
                            position: "relative",
                            height: T.getTotalSize()
                          },
                          children: A.map((L) => {
                            const H = S[L.index];
                            if (!H) return null;
                            const V = v(H);
                            if (!V) return null;
                            const Z = f == null ? void 0 : f.includes(H), Y = s.has(V.roomId);
                            return o.jsx(Rs, {
                              virtualItem: L,
                              style: {
                                paddingBottom: ee.space.S100
                              },
                              ref: T.measureElement,
                              children: o.jsx(Ye, {
                                "data-room-id": H,
                                onClick: M,
                                variant: Z ? "Success" : "Surface",
                                size: "400",
                                radii: "400",
                                disabled: O,
                                "aria-pressed": Z,
                                before: o.jsx(xn, {
                                  size: "200",
                                  radii: Y ? "400" : "300",
                                  children: Y || V.isSpaceRoom() ? o.jsx(yi, {
                                    roomId: V.roomId,
                                    src: Y ? Jf(r, V, 96, i) : Sa(r, V, 96, i),
                                    alt: V.name,
                                    renderFallback: () => o.jsx(D, {
                                      as: "span",
                                      size: "H6",
                                      children: Vi(V.name)
                                    })
                                  }) : o.jsx(Ya, {
                                    size: "200",
                                    joinRule: V.getJoinRule(),
                                    roomType: V.getType()
                                  })
                                }),
                                after: Z && o.jsx(Q, {
                                  size: "200",
                                  src: q.Check
                                }),
                                children: o.jsx(E, {
                                  grow: "Yes",
                                  children: o.jsx(D, {
                                    truncate: true,
                                    size: "T400",
                                    children: x ? ip(x, [
                                      V.name
                                    ]) : V.name
                                  })
                                })
                              })
                            }, L.index);
                          })
                        }),
                        f.length > 0 && o.jsx(tn, {
                          style: {
                            position: "sticky",
                            padding: ee.space.S200,
                            paddingLeft: ee.space.S400,
                            bottom: ee.space.S400,
                            left: ee.space.S400,
                            right: 0,
                            zIndex: 1
                          },
                          variant: "Success",
                          children: o.jsxs(E, {
                            alignItems: "Center",
                            gap: "400",
                            children: [
                              o.jsx(E, {
                                grow: "Yes",
                                direction: "Column",
                                children: U.status === ve.Error ? o.jsx(D, {
                                  size: "T200",
                                  children: o.jsx("b", {
                                    children: "Failed to apply changes! Please try again."
                                  })
                                }) : o.jsx(D, {
                                  size: "T200",
                                  children: o.jsxs("b", {
                                    children: [
                                      "Apply when ready. (",
                                      f.length,
                                      " Selected)"
                                    ]
                                  })
                                })
                              }),
                              o.jsxs(E, {
                                shrink: "No",
                                gap: "200",
                                children: [
                                  o.jsx(xe, {
                                    size: "300",
                                    variant: "Success",
                                    fill: "None",
                                    radii: "300",
                                    disabled: O,
                                    onClick: N,
                                    children: o.jsx(D, {
                                      size: "B300",
                                      children: "Reset"
                                    })
                                  }),
                                  o.jsx(xe, {
                                    size: "300",
                                    variant: "Success",
                                    radii: "300",
                                    disabled: O,
                                    before: O && o.jsx(dt, {
                                      variant: "Success",
                                      fill: "Solid",
                                      size: "100"
                                    }),
                                    onClick: I,
                                    children: o.jsx(D, {
                                      size: "B300",
                                      children: "Apply Changes"
                                    })
                                  })
                                ]
                              })
                            ]
                          })
                        })
                      ]
                    })
                  })
                })
              ]
            })
          })
        })
      })
    });
  }
  const XO = vn(void 0), uot = () => Ze(XO), hot = () => {
    const t = Fn(XO);
    return p.useCallback(() => {
      t(void 0);
    }, [
      t
    ]);
  }, fot = () => {
    const t = Fn(XO);
    return p.useCallback((n, r) => {
      t({
        spaceId: n,
        type: r
      });
    }, [
      t
    ]);
  }, QO = vn(void 0), mot = () => Ze(QO), got = () => {
    const t = Fn(QO);
    return p.useCallback(() => {
      t(void 0);
    }, [
      t
    ]);
  }, pot = () => {
    const t = Fn(QO);
    return p.useCallback((n) => {
      t({
        spaceId: n
      });
    }, [
      t
    ]);
  };
  var Fot = Jr({
    defaultClassName: "SpaceItem_SpaceItemCard__15ka2090",
    variantClassNames: {
      outlined: {
        true: "SpaceItem_SpaceItemCard_outlined_true__15ka2091"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), PS = "SpaceItem_HeaderChip__15ka2092", vot = "SpaceItem_HeaderChipPlaceholder__15ka2093", dme = "style_AvatarPlaceholder__703h180", mC = "style_LinePlaceholder__703h181 _1mqalmd1 _1mqalmd0";
  function _ot(t) {
    if (Array.isArray(t)) return t;
  }
  function yot(t, e) {
    var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
    if (n != null) {
      var r, i, a, s, l = [], c = true, d = false;
      try {
        if (a = (n = n.call(t)).next, e !== 0) for (; !(c = (r = a.call(n)).done) && (l.push(r.value), l.length !== e); c = true) ;
      } catch (u) {
        d = true, i = u;
      } finally {
        try {
          if (!c && n.return != null && (s = n.return(), Object(s) !== s)) return;
        } finally {
          if (d) throw i;
        }
      }
      return l;
    }
  }
  function L8(t, e) {
    (e == null || e > t.length) && (e = t.length);
    for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
    return r;
  }
  function ume(t, e) {
    if (t) {
      if (typeof t == "string") return L8(t, e);
      var n = {}.toString.call(t).slice(8, -1);
      return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? L8(t, e) : void 0;
    }
  }
  function bot() {
    throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  function hme(t, e) {
    return _ot(t) || yot(t, e) || ume(t, e) || bot();
  }
  var NT = {}, ty = {}, mX;
  function fme() {
    if (mX) return ty;
    mX = 1, Object.defineProperty(ty, "__esModule", {
      value: true
    }), ty.bind = void 0;
    function t(e, n) {
      var r = n.type, i = n.listener, a = n.options;
      return e.addEventListener(r, i, a), function() {
        e.removeEventListener(r, i, a);
      };
    }
    return ty.bind = t, ty;
  }
  var Um = {}, gX;
  function xot() {
    if (gX) return Um;
    gX = 1;
    var t = Um && Um.__assign || function() {
      return t = Object.assign || function(a) {
        for (var s, l = 1, c = arguments.length; l < c; l++) {
          s = arguments[l];
          for (var d in s) Object.prototype.hasOwnProperty.call(s, d) && (a[d] = s[d]);
        }
        return a;
      }, t.apply(this, arguments);
    };
    Object.defineProperty(Um, "__esModule", {
      value: true
    }), Um.bindAll = void 0;
    var e = fme();
    function n(a) {
      if (!(typeof a > "u")) return typeof a == "boolean" ? {
        capture: a
      } : a;
    }
    function r(a, s) {
      if (s == null) return a;
      var l = t(t({}, a), {
        options: t(t({}, n(s)), n(a.options))
      });
      return l;
    }
    function i(a, s, l) {
      var c = s.map(function(d) {
        var u = r(d, l);
        return (0, e.bind)(a, u);
      });
      return function() {
        c.forEach(function(u) {
          return u();
        });
      };
    }
    return Um.bindAll = i, Um;
  }
  var pX;
  function wot() {
    return pX || (pX = 1, (function(t) {
      Object.defineProperty(t, "__esModule", {
        value: true
      }), t.bindAll = t.bind = void 0;
      var e = fme();
      Object.defineProperty(t, "bind", {
        enumerable: true,
        get: function() {
          return e.bind;
        }
      });
      var n = xot();
      Object.defineProperty(t, "bindAll", {
        enumerable: true,
        get: function() {
          return n.bindAll;
        }
      });
    })(NT)), NT;
  }
  var vF = wot(), mme = "data-pdnd-honey-pot";
  function gme(t) {
    return t instanceof Element && t.hasAttribute(mme);
  }
  function eL(t) {
    var e = document.elementsFromPoint(t.x, t.y), n = hme(e, 2), r = n[0], i = n[1];
    return r ? gme(r) ? i ?? null : r : null;
  }
  var Dot = 2147483647;
  function FX(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function vX(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? FX(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : FX(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var Rb = 2, _X = Rb / 2;
  function Cot(t) {
    return {
      x: Math.floor(t.x),
      y: Math.floor(t.y)
    };
  }
  function Eot(t) {
    return {
      x: t.x - _X,
      y: t.y - _X
    };
  }
  function kot(t) {
    return {
      x: Math.max(t.x, 0),
      y: Math.max(t.y, 0)
    };
  }
  function Sot(t) {
    return {
      x: Math.min(t.x, window.innerWidth - Rb),
      y: Math.min(t.y, window.innerHeight - Rb)
    };
  }
  function yX(t) {
    var e = t.client, n = Sot(kot(Eot(Cot(e))));
    return DOMRect.fromRect({
      x: n.x,
      y: n.y,
      width: Rb,
      height: Rb
    });
  }
  function bX(t) {
    var e = t.clientRect;
    return {
      left: "".concat(e.left, "px"),
      top: "".concat(e.top, "px"),
      width: "".concat(e.width, "px"),
      height: "".concat(e.height, "px")
    };
  }
  function jot(t) {
    var e = t.client, n = t.clientRect;
    return e.x >= n.x && e.x <= n.x + n.width && e.y >= n.y && e.y <= n.y + n.height;
  }
  function Tot(t) {
    var e = t.initial, n = document.createElement("div");
    n.setAttribute(mme, "true");
    var r = yX({
      client: e
    });
    Object.assign(n.style, vX(vX({
      backgroundColor: "transparent",
      position: "fixed",
      padding: 0,
      margin: 0,
      boxSizing: "border-box"
    }, bX({
      clientRect: r
    })), {}, {
      pointerEvents: "auto",
      zIndex: Dot
    })), document.body.appendChild(n);
    var i = vF.bind(window, {
      type: "pointermove",
      listener: function(s) {
        var l = {
          x: s.clientX,
          y: s.clientY
        };
        r = yX({
          client: l
        }), Object.assign(n.style, bX({
          clientRect: r
        }));
      },
      options: {
        capture: true
      }
    });
    return function(s) {
      var l = s.current;
      if (i(), jot({
        client: l,
        clientRect: r
      })) {
        n.remove();
        return;
      }
      function c() {
        d(), n.remove();
      }
      var d = vF.bindAll(window, [
        {
          type: "pointerdown",
          listener: c
        },
        {
          type: "pointermove",
          listener: c
        },
        {
          type: "focusin",
          listener: c
        },
        {
          type: "focusout",
          listener: c
        },
        {
          type: "dragstart",
          listener: c
        },
        {
          type: "dragenter",
          listener: c
        },
        {
          type: "dragover",
          listener: c
        }
      ], {
        capture: true
      });
    };
  }
  function Rot() {
    var t = null;
    function e() {
      return t = null, vF.bind(window, {
        type: "pointermove",
        listener: function(i) {
          t = {
            x: i.clientX,
            y: i.clientY
          };
        },
        options: {
          capture: true
        }
      });
    }
    function n() {
      var r = null;
      return function(a) {
        var s = a.eventName, l = a.payload;
        if (s === "onDragStart") {
          var c = l.location.initial.input, d = t ?? {
            x: c.clientX,
            y: c.clientY
          };
          r = Tot({
            initial: d
          });
        }
        if (s === "onDrop") {
          var u, h = l.location.current.input;
          (u = r) === null || u === void 0 || u({
            current: {
              x: h.clientX,
              y: h.clientY
            }
          }), r = null, t = null;
        }
      };
    }
    return {
      bindEvents: e,
      getOnPostDispatch: n
    };
  }
  function Aot(t) {
    if (Array.isArray(t)) return L8(t);
  }
  function Iot(t) {
    if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
  }
  function Bot() {
    throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  function pme(t) {
    return Aot(t) || Iot(t) || ume(t) || Bot();
  }
  function av(t) {
    var e = null;
    return function() {
      if (!e) {
        for (var r = arguments.length, i = new Array(r), a = 0; a < r; a++) i[a] = arguments[a];
        var s = t.apply(this, i);
        e = {
          result: s
        };
      }
      return e.result;
    };
  }
  var Pot = av(function() {
    return navigator.userAgent.includes("Firefox");
  }), tL = av(function() {
    var e = navigator, n = e.userAgent;
    return n.includes("AppleWebKit") && !n.includes("Chrome");
  }), N8 = {
    isLeavingWindow: /* @__PURE__ */ Symbol("leaving"),
    isEnteringWindow: /* @__PURE__ */ Symbol("entering")
  };
  function Mot(t) {
    var e = t.dragLeave;
    return tL() ? e.hasOwnProperty(N8.isLeavingWindow) : false;
  }
  (function() {
    if (typeof window > "u" || !tL()) return;
    function e() {
      return {
        enterCount: 0,
        isOverWindow: false
      };
    }
    var n = e();
    function r() {
      n = e();
    }
    vF.bindAll(window, [
      {
        type: "dragstart",
        listener: function() {
          n.enterCount = 0, n.isOverWindow = true;
        }
      },
      {
        type: "drop",
        listener: r
      },
      {
        type: "dragend",
        listener: r
      },
      {
        type: "dragenter",
        listener: function(a) {
          !n.isOverWindow && n.enterCount === 0 && (a[N8.isEnteringWindow] = true), n.isOverWindow = true, n.enterCount++;
        }
      },
      {
        type: "dragleave",
        listener: function(a) {
          n.enterCount--, n.isOverWindow && n.enterCount === 0 && (a[N8.isLeavingWindow] = true, n.isOverWindow = false);
        }
      }
    ], {
      capture: true
    });
  })();
  function Oot(t) {
    return "nodeName" in t;
  }
  function Lot(t) {
    return Oot(t) && t.ownerDocument !== document;
  }
  function Not(t) {
    var e = t.dragLeave, n = e.type, r = e.relatedTarget;
    return n !== "dragleave" ? false : tL() ? Mot({
      dragLeave: e
    }) : r == null ? true : Pot() ? Lot(r) : r instanceof HTMLIFrameElement;
  }
  function zot(t) {
    var e = t.onDragEnd;
    return [
      {
        type: "pointermove",
        listener: /* @__PURE__ */ (function() {
          var n = 0;
          return function() {
            if (n < 20) {
              n++;
              return;
            }
            e();
          };
        })()
      },
      {
        type: "pointerdown",
        listener: e
      }
    ];
  }
  function F2(t) {
    return {
      altKey: t.altKey,
      button: t.button,
      buttons: t.buttons,
      ctrlKey: t.ctrlKey,
      metaKey: t.metaKey,
      shiftKey: t.shiftKey,
      clientX: t.clientX,
      clientY: t.clientY,
      pageX: t.pageX,
      pageY: t.pageY
    };
  }
  var Uot = function(e) {
    var n = [], r = null, i = function() {
      for (var s = arguments.length, l = new Array(s), c = 0; c < s; c++) l[c] = arguments[c];
      n = l, !r && (r = requestAnimationFrame(function() {
        r = null, e.apply(void 0, n);
      }));
    };
    return i.cancel = function() {
      r && (cancelAnimationFrame(r), r = null);
    }, i;
  }, zT = Uot(function(t) {
    return t();
  }), dD = /* @__PURE__ */ (function() {
    var t = null;
    function e(r) {
      var i = requestAnimationFrame(function() {
        t = null, r();
      });
      t = {
        frameId: i,
        fn: r
      };
    }
    function n() {
      t && (cancelAnimationFrame(t.frameId), t.fn(), t = null);
    }
    return {
      schedule: e,
      flush: n
    };
  })();
  function Vot(t) {
    var e = t.source, n = t.initial, r = t.dispatchEvent, i = {
      dropTargets: []
    };
    function a(l) {
      r(l), i = {
        dropTargets: l.payload.location.current.dropTargets
      };
    }
    var s = {
      start: function(c) {
        var d = c.nativeSetDragImage, u = {
          current: n,
          previous: i,
          initial: n
        };
        a({
          eventName: "onGenerateDragPreview",
          payload: {
            source: e,
            location: u,
            nativeSetDragImage: d
          }
        }), dD.schedule(function() {
          a({
            eventName: "onDragStart",
            payload: {
              source: e,
              location: u
            }
          });
        });
      },
      dragUpdate: function(c) {
        var d = c.current;
        dD.flush(), zT.cancel(), a({
          eventName: "onDropTargetChange",
          payload: {
            source: e,
            location: {
              initial: n,
              previous: i,
              current: d
            }
          }
        });
      },
      drag: function(c) {
        var d = c.current;
        zT(function() {
          dD.flush();
          var u = {
            initial: n,
            previous: i,
            current: d
          };
          a({
            eventName: "onDrag",
            payload: {
              source: e,
              location: u
            }
          });
        });
      },
      drop: function(c) {
        var d = c.current, u = c.updatedSourcePayload;
        dD.flush(), zT.cancel(), a({
          eventName: "onDrop",
          payload: {
            source: u ?? e,
            location: {
              current: d,
              previous: i,
              initial: n
            }
          }
        });
      }
    };
    return s;
  }
  var z8 = {
    isActive: false
  };
  function Fme() {
    return !z8.isActive;
  }
  function Hot(t) {
    return t.dataTransfer ? t.dataTransfer.setDragImage.bind(t.dataTransfer) : null;
  }
  function $ot(t) {
    var e = t.current, n = t.next;
    if (e.length !== n.length) return true;
    for (var r = 0; r < e.length; r++) if (e[r].element !== n[r].element) return true;
    return false;
  }
  function Wot(t) {
    var e = t.event, n = t.dragType, r = t.getDropTargetsOver, i = t.dispatchEvent;
    if (!Fme()) return;
    var a = qot({
      event: e,
      dragType: n,
      getDropTargetsOver: r
    });
    z8.isActive = true;
    var s = {
      current: a
    };
    UT({
      event: e,
      current: a.dropTargets
    });
    var l = Vot({
      source: n.payload,
      dispatchEvent: i,
      initial: a
    });
    function c(g) {
      var m = $ot({
        current: s.current.dropTargets,
        next: g.dropTargets
      });
      s.current = g, m && l.dragUpdate({
        current: s.current
      });
    }
    function d(g) {
      var m = F2(g), v = gme(g.target) ? eL({
        x: m.clientX,
        y: m.clientY
      }) : g.target, y = r({
        target: v,
        input: m,
        source: n.payload,
        current: s.current.dropTargets
      });
      y.length && (g.preventDefault(), UT({
        event: g,
        current: y
      })), c({
        dropTargets: y,
        input: m
      });
    }
    function u() {
      s.current.dropTargets.length && c({
        dropTargets: [],
        input: s.current.input
      }), l.drop({
        current: s.current,
        updatedSourcePayload: null
      }), h();
    }
    function h() {
      z8.isActive = false, f();
    }
    var f = vF.bindAll(window, [
      {
        type: "dragover",
        listener: function(m) {
          d(m), l.drag({
            current: s.current
          });
        }
      },
      {
        type: "dragenter",
        listener: d
      },
      {
        type: "dragleave",
        listener: function(m) {
          Not({
            dragLeave: m
          }) && (c({
            input: s.current.input,
            dropTargets: []
          }), n.startedFrom === "external" && u());
        }
      },
      {
        type: "drop",
        listener: function(m) {
          if (s.current = {
            dropTargets: s.current.dropTargets,
            input: F2(m)
          }, !s.current.dropTargets.length) {
            u();
            return;
          }
          m.preventDefault(), UT({
            event: m,
            current: s.current.dropTargets
          }), l.drop({
            current: s.current,
            updatedSourcePayload: n.type === "external" ? n.getDropPayload(m) : null
          }), h();
        }
      },
      {
        type: "dragend",
        listener: function(m) {
          s.current = {
            dropTargets: s.current.dropTargets,
            input: F2(m)
          }, u();
        }
      }
    ].concat(pme(zot({
      onDragEnd: u
    }))), {
      capture: true
    });
    l.start({
      nativeSetDragImage: Hot(e)
    });
  }
  function UT(t) {
    var e, n = t.event, r = t.current, i = (e = r[0]) === null || e === void 0 ? void 0 : e.dropEffect;
    i != null && n.dataTransfer && (n.dataTransfer.dropEffect = i);
  }
  function qot(t) {
    var e = t.event, n = t.dragType, r = t.getDropTargetsOver, i = F2(e);
    if (n.startedFrom === "external") return {
      input: i,
      dropTargets: []
    };
    var a = r({
      input: i,
      source: n.payload,
      target: e.target,
      current: []
    });
    return {
      input: i,
      dropTargets: a
    };
  }
  var xX = {
    canStart: Fme,
    start: Wot
  }, U8 = /* @__PURE__ */ new Map();
  function Kot(t) {
    var e = t.typeKey, n = t.mount, r = U8.get(e);
    if (r) return r.usageCount++, r;
    var i = {
      typeKey: e,
      unmount: n(),
      usageCount: 1
    };
    return U8.set(e, i), i;
  }
  function Got(t) {
    var e = Kot(t);
    return function() {
      e.usageCount--, !(e.usageCount > 0) && (e.unmount(), U8.delete(t.typeKey));
    };
  }
  function sv() {
    for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
    return function() {
      e.forEach(function(i) {
        return i();
      });
    };
  }
  function vme(t, e) {
    var n = e.attribute, r = e.value;
    return t.setAttribute(n, r), function() {
      return t.removeAttribute(n);
    };
  }
  function wX(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Jh(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? wX(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : wX(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function VT(t, e) {
    var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
    if (!n) {
      if (Array.isArray(t) || (n = Yot(t)) || e) {
        n && (t = n);
        var r = 0, i = function() {
        };
        return {
          s: i,
          n: function() {
            return r >= t.length ? {
              done: true
            } : {
              done: false,
              value: t[r++]
            };
          },
          e: function(d) {
            throw d;
          },
          f: i
        };
      }
      throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
    }
    var a, s = true, l = false;
    return {
      s: function() {
        n = n.call(t);
      },
      n: function() {
        var d = n.next();
        return s = d.done, d;
      },
      e: function(d) {
        l = true, a = d;
      },
      f: function() {
        try {
          s || n.return == null || n.return();
        } finally {
          if (l) throw a;
        }
      }
    };
  }
  function Yot(t, e) {
    if (t) {
      if (typeof t == "string") return DX(t, e);
      var n = {}.toString.call(t).slice(8, -1);
      return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? DX(t, e) : void 0;
    }
  }
  function DX(t, e) {
    (e == null || e > t.length) && (e = t.length);
    for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
    return r;
  }
  function HT(t) {
    return t.slice(0).reverse();
  }
  function Zot(t) {
    var e = t.typeKey, n = t.defaultDropEffect, r = /* @__PURE__ */ new WeakMap(), i = "data-drop-target-for-".concat(e), a = "[".concat(i, "]");
    function s(g) {
      return r.set(g.element, g), function() {
        return r.delete(g.element);
      };
    }
    function l(g) {
      var m = sv(vme(g.element, {
        attribute: i,
        value: "true"
      }), s(g));
      return av(m);
    }
    function c(g) {
      var m, v, y, w, b = g.source, j = g.target, k = g.input, C = g.result, x = C === void 0 ? [] : C;
      if (j == null) return x;
      if (!(j instanceof Element)) return j instanceof Node ? c({
        source: b,
        target: j.parentElement,
        input: k,
        result: x
      }) : x;
      var S = j.closest(a);
      if (S == null) return x;
      var T = r.get(S);
      if (T == null) return x;
      var A = {
        input: k,
        source: b,
        element: T.element
      };
      if (T.canDrop && !T.canDrop(A)) return c({
        source: b,
        target: T.element.parentElement,
        input: k,
        result: x
      });
      var B = (m = (v = T.getData) === null || v === void 0 ? void 0 : v.call(T, A)) !== null && m !== void 0 ? m : {}, U = (y = (w = T.getDropEffect) === null || w === void 0 ? void 0 : w.call(T, A)) !== null && y !== void 0 ? y : n, z = {
        data: B,
        element: T.element,
        dropEffect: U,
        isActiveDueToStickiness: false
      };
      return c({
        source: b,
        target: T.element.parentElement,
        input: k,
        result: [].concat(pme(x), [
          z
        ])
      });
    }
    function d(g) {
      var m = g.eventName, v = g.payload, y = VT(v.location.current.dropTargets), w;
      try {
        for (y.s(); !(w = y.n()).done; ) {
          var b, j = w.value, k = r.get(j.element), C = Jh(Jh({}, v), {}, {
            self: j
          });
          k == null || (b = k[m]) === null || b === void 0 || b.call(k, C);
        }
      } catch (x) {
        y.e(x);
      } finally {
        y.f();
      }
    }
    var u = {
      onGenerateDragPreview: d,
      onDrag: d,
      onDragStart: d,
      onDrop: d,
      onDropTargetChange: function(m) {
        var v = m.payload, y = new Set(v.location.current.dropTargets.map(function(L) {
          return L.element;
        })), w = /* @__PURE__ */ new Set(), b = VT(v.location.previous.dropTargets), j;
        try {
          for (b.s(); !(j = b.n()).done; ) {
            var k, C = j.value;
            w.add(C.element);
            var x = r.get(C.element), S = y.has(C.element), T = Jh(Jh({}, v), {}, {
              self: C
            });
            if (x == null || (k = x.onDropTargetChange) === null || k === void 0 || k.call(x, T), !S) {
              var A;
              x == null || (A = x.onDragLeave) === null || A === void 0 || A.call(x, T);
            }
          }
        } catch (L) {
          b.e(L);
        } finally {
          b.f();
        }
        var B = VT(v.location.current.dropTargets), U;
        try {
          for (B.s(); !(U = B.n()).done; ) {
            var z, O, M = U.value;
            if (!w.has(M.element)) {
              var I = Jh(Jh({}, v), {}, {
                self: M
              }), N = r.get(M.element);
              N == null || (z = N.onDropTargetChange) === null || z === void 0 || z.call(N, I), N == null || (O = N.onDragEnter) === null || O === void 0 || O.call(N, I);
            }
          }
        } catch (L) {
          B.e(L);
        } finally {
          B.f();
        }
      }
    };
    function h(g) {
      u[g.eventName](g);
    }
    function f(g) {
      var m = g.source, v = g.target, y = g.input, w = g.current, b = c({
        source: m,
        target: v,
        input: y
      });
      if (b.length >= w.length) return b;
      for (var j = HT(w), k = HT(b), C = [], x = 0; x < j.length; x++) {
        var S, T = j[x], A = k[x];
        if (A != null) {
          C.push(A);
          continue;
        }
        var B = C[x - 1], U = j[x - 1];
        if ((B == null ? void 0 : B.element) !== (U == null ? void 0 : U.element)) break;
        var z = r.get(T.element);
        if (!z) break;
        var O = {
          input: y,
          source: m,
          element: z.element
        };
        if (z.canDrop && !z.canDrop(O) || !((S = z.getIsSticky) !== null && S !== void 0 && S.call(z, O))) break;
        C.push(Jh(Jh({}, T), {}, {
          isActiveDueToStickiness: true
        }));
      }
      return HT(C);
    }
    return {
      dropTargetForConsumers: l,
      getIsOver: f,
      dispatchEvent: h
    };
  }
  function Jot(t, e) {
    var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
    if (!n) {
      if (Array.isArray(t) || (n = Xot(t)) || e) {
        n && (t = n);
        var r = 0, i = function() {
        };
        return {
          s: i,
          n: function() {
            return r >= t.length ? {
              done: true
            } : {
              done: false,
              value: t[r++]
            };
          },
          e: function(d) {
            throw d;
          },
          f: i
        };
      }
      throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
    }
    var a, s = true, l = false;
    return {
      s: function() {
        n = n.call(t);
      },
      n: function() {
        var d = n.next();
        return s = d.done, d;
      },
      e: function(d) {
        l = true, a = d;
      },
      f: function() {
        try {
          s || n.return == null || n.return();
        } finally {
          if (l) throw a;
        }
      }
    };
  }
  function Xot(t, e) {
    if (t) {
      if (typeof t == "string") return CX(t, e);
      var n = {}.toString.call(t).slice(8, -1);
      return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? CX(t, e) : void 0;
    }
  }
  function CX(t, e) {
    (e == null || e > t.length) && (e = t.length);
    for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
    return r;
  }
  function EX(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function Qot(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? EX(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : EX(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function eat() {
    var t = /* @__PURE__ */ new Set(), e = null;
    function n(a) {
      e && (!a.canMonitor || a.canMonitor(e.canMonitorArgs)) && e.active.add(a);
    }
    function r(a) {
      var s = Qot({}, a);
      t.add(s), n(s);
      function l() {
        t.delete(s), e && e.active.delete(s);
      }
      return av(l);
    }
    function i(a) {
      var s = a.eventName, l = a.payload;
      if (s === "onGenerateDragPreview") {
        e = {
          canMonitorArgs: {
            initial: l.location.initial,
            source: l.source
          },
          active: /* @__PURE__ */ new Set()
        };
        var c = Jot(t), d;
        try {
          for (c.s(); !(d = c.n()).done; ) {
            var u = d.value;
            n(u);
          }
        } catch (y) {
          c.e(y);
        } finally {
          c.f();
        }
      }
      if (e) {
        for (var h = Array.from(e.active), f = 0, g = h; f < g.length; f++) {
          var m = g[f];
          if (e.active.has(m)) {
            var v;
            (v = m[s]) === null || v === void 0 || v.call(m, l);
          }
        }
        s === "onDrop" && (e.active.clear(), e = null);
      }
    }
    return {
      dispatchEvent: i,
      monitorForConsumers: r
    };
  }
  function tat(t) {
    var e = t.typeKey, n = t.mount, r = t.dispatchEventToSource, i = t.onPostDispatch, a = t.defaultDropEffect, s = eat(), l = Zot({
      typeKey: e,
      defaultDropEffect: a
    });
    function c(h) {
      r == null ? void 0 : r(h), l.dispatchEvent(h), s.dispatchEvent(h), i == null ? void 0 : i(h);
    }
    function d(h) {
      var f = h.event, g = h.dragType;
      xX.start({
        event: f,
        dragType: g,
        getDropTargetsOver: l.getIsOver,
        dispatchEvent: c
      });
    }
    function u() {
      function h() {
        var f = {
          canStart: xX.canStart,
          start: d
        };
        return n(f);
      }
      return Got({
        typeKey: e,
        mount: h
      });
    }
    return {
      registerUsage: u,
      dropTarget: l.dropTargetForConsumers,
      monitor: s.monitorForConsumers
    };
  }
  var nat = av(function() {
    return navigator.userAgent.toLocaleLowerCase().includes("android");
  }), rat = "pdnd:android-fallback", kX = "text/plain", iat = "text/uri-list", oat = "application/vnd.pdnd", PE = /* @__PURE__ */ new WeakMap();
  function aat(t) {
    return PE.set(t.element, t), function() {
      PE.delete(t.element);
    };
  }
  var SX = Rot(), nL = tat({
    typeKey: "element",
    defaultDropEffect: "move",
    mount: function(e) {
      return sv(SX.bindEvents(), vF.bind(document, {
        type: "dragstart",
        listener: function(r) {
          var i, a, s, l, c, d;
          if (e.canStart(r) && !r.defaultPrevented && r.dataTransfer) {
            var u = r.target;
            if (u instanceof HTMLElement) {
              var h = PE.get(u);
              if (h) {
                var f = F2(r), g = {
                  element: h.element,
                  dragHandle: (i = h.dragHandle) !== null && i !== void 0 ? i : null,
                  input: f
                };
                if (h.canDrag && !h.canDrag(g)) {
                  r.preventDefault();
                  return;
                }
                if (h.dragHandle) {
                  var m = eL({
                    x: f.clientX,
                    y: f.clientY
                  });
                  if (!h.dragHandle.contains(m)) {
                    r.preventDefault();
                    return;
                  }
                }
                var v = (a = (s = h.getInitialDataForExternal) === null || s === void 0 ? void 0 : s.call(h, g)) !== null && a !== void 0 ? a : null;
                if (v) for (var y = 0, w = Object.entries(v); y < w.length; y++) {
                  var b = hme(w[y], 2), j = b[0], k = b[1];
                  r.dataTransfer.setData(j, k ?? "");
                }
                nat() && !r.dataTransfer.types.includes(kX) && !r.dataTransfer.types.includes(iat) && r.dataTransfer.setData(kX, rat), r.dataTransfer.setData(oat, "");
                var C = {
                  element: h.element,
                  dragHandle: (l = h.dragHandle) !== null && l !== void 0 ? l : null,
                  data: (c = (d = h.getInitialData) === null || d === void 0 ? void 0 : d.call(h, g)) !== null && c !== void 0 ? c : {}
                }, x = {
                  type: "element",
                  payload: C,
                  startedFrom: "internal"
                };
                e.start({
                  event: r,
                  dragType: x
                });
              }
            }
          }
        }
      }));
    },
    dispatchEventToSource: function(e) {
      var n, r, i = e.eventName, a = e.payload;
      (n = PE.get(a.source.element)) === null || n === void 0 || (r = n[i]) === null || r === void 0 || r.call(n, a);
    },
    onPostDispatch: SX.getOnPostDispatch()
  }), rL = nL.dropTarget, iL = nL.monitor;
  function _me(t) {
    var e = sv(nL.registerUsage(), aat(t), vme(t.element, {
      attribute: "draggable",
      value: "true"
    }));
    return av(e);
  }
  var Ab = /* @__PURE__ */ new Map(), gC = /* @__PURE__ */ new Set();
  function yme(t) {
    sat(t);
    var e = Ab.get(t);
    if (e) return e;
    var n = {
      timeOfEngagementStart: Date.now()
    };
    return Ab.set(t, n), n;
  }
  function sat(t) {
    gC.add(t);
  }
  function lat(t) {
    gC.clear(), t(), Ab.forEach(function(e, n) {
      gC.has(n) || Ab.delete(n);
    }), gC.clear();
  }
  function cat() {
    Ab.clear();
  }
  var jX = /* @__PURE__ */ new Map();
  function dat(t) {
    var e = jX.get(t);
    if (e) return e;
    var n = uat(t);
    return jX.set(t, n), n;
  }
  function uat(t) {
    var e = {
      type: "idle"
    }, n = [];
    function r(c) {
      if (e.type === "running") {
        var d = c - e.timeLastFrameFinished, u = e, h = u.latestArgs, f = eL({
          x: h.location.current.input.clientX,
          y: h.location.current.input.clientY
        });
        lat(function() {
          n.forEach(function(g) {
            return g({
              underUsersPointer: f,
              latestArgs: h,
              timeSinceLastFrame: d
            });
          });
        }), e.timeLastFrameFinished = c, e.frameId = requestAnimationFrame(r);
      }
    }
    function i() {
      e.type !== "idle" && (cancelAnimationFrame(e.frameId), cat(), e = {
        type: "idle"
      });
    }
    function a(c) {
      e.type === "idle" && (e = {
        type: "initializing",
        latestArgs: c,
        frameId: requestAnimationFrame(function(d) {
          e.type === "initializing" && (e = {
            type: "running",
            timeLastFrameFinished: d,
            latestArgs: e.latestArgs,
            frameId: requestAnimationFrame(r)
          });
        })
      });
    }
    function s(c) {
      if (e.type === "idle") {
        a(c);
        return;
      }
      e.latestArgs = c;
    }
    t({
      onDragStart: a,
      onDropTargetChange: s,
      onDrag: s,
      onDrop: i
    });
    var l = {
      onFrame: function(d) {
        n.push(d);
      }
    };
    return l;
  }
  var V8 = "data-auto-scrollable", hat = "[".concat(V8, '="true"]');
  function fat(t) {
    return t.setAttribute(V8, "true"), function() {
      return t.removeAttribute(V8);
    };
  }
  function TX(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function RX(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? TX(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : TX(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var mat = {
    startHitboxAtPercentageRemainingOfElement: {
      top: 0.25,
      right: 0.25,
      bottom: 0.25,
      left: 0.25
    },
    maxScrollAtPercentageRemainingOfHitbox: {
      top: 0.5,
      right: 0.5,
      bottom: 0.5,
      left: 0.5
    },
    timeDampeningDurationMs: 300,
    maxMainAxisHitboxSize: 180
  }, gat = {
    standard: 900,
    fast: 1500
  };
  function bme(t) {
    var e;
    return RX(RX({}, mat), {}, {
      maxPixelScrollPerSecond: gat[(e = t == null ? void 0 : t.maxScrollSpeed) !== null && e !== void 0 ? e : "standard"]
    });
  }
  var pat = {
    top: function(e) {
      return e.scrollTop > 0;
    },
    right: function(e) {
      return Math.ceil(e.scrollLeft) + e.clientWidth < e.scrollWidth;
    },
    bottom: function(e) {
      return Math.ceil(e.scrollTop) + e.clientHeight < e.scrollHeight;
    },
    left: function(e) {
      return e.scrollLeft > 0;
    }
  }, Fat = [
    "top",
    "right",
    "bottom",
    "left"
  ], vat = {
    top: "vertical",
    right: "horizontal",
    bottom: "vertical",
    left: "horizontal"
  }, AX = {
    start: "top",
    end: "bottom",
    point: "y",
    size: "height"
  }, IX = {
    start: "left",
    end: "right",
    point: "x",
    size: "width"
  }, xme = {
    vertical: {
      mainAxis: AX,
      crossAxis: IX
    },
    horizontal: {
      mainAxis: IX,
      crossAxis: AX
    }
  }, oL = {
    top: "start",
    right: "end",
    bottom: "end",
    left: "start"
  };
  function uD(t) {
    var e = t.edge, n = t.axis;
    return function(i) {
      var a, s = i.clientRect, l = i.config, c = xme[n], d = c.mainAxis, u = c.crossAxis, h = oL[e], f = Math.min(l.startHitboxAtPercentageRemainingOfElement[e] * s[d.size], l.maxMainAxisHitboxSize);
      return DOMRect.fromRect((a = {}, $(a, d.point, h === "start" ? s[d.point] : s[d.point] + s[d.size] - f), $(a, u.point, s[u.point]), $(a, d.size, f), $(a, u.size, s[u.size]), a));
    };
  }
  var _at = {
    top: uD({
      axis: "vertical",
      edge: "top"
    }),
    right: uD({
      axis: "horizontal",
      edge: "right"
    }),
    bottom: uD({
      axis: "vertical",
      edge: "bottom"
    }),
    left: uD({
      axis: "horizontal",
      edge: "left"
    })
  };
  function H8(t) {
    var e = t.startOfRange, n = t.endOfRange, r = t.value, i = e < n;
    if (!i || r < e) return 0;
    if (r > n) return 1;
    var a = n - e;
    return (r - e) / a;
  }
  function yat(t) {
    var e = t.timeSinceLastFrame, n = t.config, r = n.maxPixelScrollPerSecond / 1e3, i = Math.ceil(r * e), a = n.maxPixelScrollPerSecond / 60;
    return Math.min(i, a);
  }
  function bat(t) {
    var e = t.client, n = t.axis, r = t.edge, i = t.hitbox, a = t.config, s = xme[n].mainAxis, l = oL[r], c = i[s.size] * a.maxScrollAtPercentageRemainingOfHitbox[r];
    if (l === "end") return H8({
      startOfRange: i[s.start],
      endOfRange: i[s.end] - c,
      value: e[s.point]
    });
    var d = H8({
      startOfRange: i[s.start] + c,
      endOfRange: i[s.end],
      value: e[s.point]
    });
    return 1 - d;
  }
  function hD(t) {
    var e = t.client, n = t.timeSinceLastFrame, r = t.engagement, i = t.axis, a = t.hitbox, s = t.edge, l = t.isDistanceDampeningEnabled, c = t.config, d = yat({
      timeSinceLastFrame: n,
      config: c
    }), u = l ? bat({
      client: e,
      edge: s,
      hitbox: a,
      axis: i,
      config: c
    }) : 1, h = H8({
      startOfRange: r.timeOfEngagementStart,
      endOfRange: r.timeOfEngagementStart + c.timeDampeningDurationMs,
      value: Date.now()
    }), f = u * h, g = Math.max(d * f, 1), m = oL[s];
    return m === "end" ? g : -1 * g;
  }
  function xat(t, e) {
    return e === "all" || t === e;
  }
  function wat(t) {
    var e = t.client, n = t.clientRect;
    return e.x >= n.x && e.x <= n.x + n.width && e.y >= n.y && e.y <= n.y + n.height;
  }
  function Dat(t) {
    return t.getBoundingClientRect();
  }
  function wme(t) {
    var e = t.element, n = t.input, r = t.timeSinceLastFrame, i = t.engagement, a = t.config, s = t.allowedAxis, l = t.getRect, c = l === void 0 ? Dat : l, d = {
      x: n.clientX,
      y: n.clientY
    }, u = c(e), h = Fat.reduce(function(m, v) {
      var y = _at[v]({
        clientRect: u,
        config: a
      }), w = vat[v];
      return !xat(w, s) || !wat({
        client: d,
        clientRect: y
      }) || !pat[v](e) || m.set(v, {
        edge: v,
        hitbox: y
      }), m;
    }, /* @__PURE__ */ new Map()), f = (function() {
      var m = "horizontal", v = h.get("left");
      if (v) return hD({
        client: d,
        edge: v.edge,
        hitbox: v.hitbox,
        axis: m,
        timeSinceLastFrame: r,
        engagement: i,
        isDistanceDampeningEnabled: true,
        config: a
      });
      var y = h.get("right");
      return y ? hD({
        client: d,
        edge: y.edge,
        hitbox: y.hitbox,
        axis: m,
        timeSinceLastFrame: r,
        engagement: i,
        isDistanceDampeningEnabled: true,
        config: a
      }) : 0;
    })(), g = (function() {
      var m = "vertical", v = h.get("bottom");
      if (v) return hD({
        client: d,
        edge: v.edge,
        hitbox: v.hitbox,
        axis: m,
        timeSinceLastFrame: r,
        engagement: i,
        isDistanceDampeningEnabled: true,
        config: a
      });
      var y = h.get("top");
      return y ? hD({
        client: d,
        edge: y.edge,
        hitbox: y.hitbox,
        axis: m,
        timeSinceLastFrame: r,
        engagement: i,
        isDistanceDampeningEnabled: true,
        config: a
      }) : 0;
    })();
    return {
      left: f,
      top: g
    };
  }
  function Cat(t, e) {
    var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
    if (!n) {
      if (Array.isArray(t) || (n = Eat(t)) || e) {
        n && (t = n);
        var r = 0, i = function() {
        };
        return {
          s: i,
          n: function() {
            return r >= t.length ? {
              done: true
            } : {
              done: false,
              value: t[r++]
            };
          },
          e: function(d) {
            throw d;
          },
          f: i
        };
      }
      throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
    }
    var a = true, s = false, l;
    return {
      s: function() {
        n = n.call(t);
      },
      n: function() {
        var d = n.next();
        return a = d.done, d;
      },
      e: function(d) {
        s = true, l = d;
      },
      f: function() {
        try {
          !a && n.return != null && n.return();
        } finally {
          if (s) throw l;
        }
      }
    };
  }
  function Eat(t, e) {
    if (t) {
      if (typeof t == "string") return BX(t, e);
      var n = Object.prototype.toString.call(t).slice(8, -1);
      if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t);
      if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return BX(t, e);
    }
  }
  function BX(t, e) {
    (e == null || e > t.length) && (e = t.length);
    for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
    return r;
  }
  function Dme(t) {
    return !!(t.top || t.left);
  }
  function Cme(t) {
    var e, n, r, i = t.target, a = t.input, s = t.source, l = t.findEntry, c = t.timeSinceLastFrame, d = t.available, u = d === void 0 ? {
      top: true,
      left: true
    } : d;
    if (!Dme(u) || !i) return u;
    var h = i.closest(hat);
    if (!h) return u;
    var f = l(h);
    if (!f) return u;
    function g() {
      var k;
      return Cme({
        target: (k = h == null ? void 0 : h.parentElement) !== null && k !== void 0 ? k : null,
        findEntry: l,
        source: s,
        timeSinceLastFrame: c,
        input: a,
        available: u
      });
    }
    var m = {
      input: a,
      source: s,
      element: h
    };
    if (f.canScroll && !f.canScroll(m)) return g();
    var v = yme(h), y = bme((e = f.getConfiguration) === null || e === void 0 ? void 0 : e.call(f, m)), w = (n = (r = f.getAllowedAxis) === null || r === void 0 ? void 0 : r.call(f, m)) !== null && n !== void 0 ? n : "all", b = wme({
      element: h,
      engagement: v,
      input: a,
      timeSinceLastFrame: c,
      allowedAxis: w,
      config: y
    }), j = {
      top: 0,
      left: 0
    };
    return u.top && b.top !== 0 && (j.top = b.top, u.top = false), u.left && b.left !== 0 && (j.left = b.left, u.left = false), (j.top !== 0 || j.left !== 0) && h.scrollBy(j), g();
  }
  function kat(t) {
    var e = t.input, n = t.timeSinceLastFrame, r = t.available, i = t.source, a = t.entries, s = document.documentElement, l = {
      input: e,
      source: i,
      element: s
    }, c = Cat(a), d;
    try {
      for (c.s(); !(d = c.n()).done; ) {
        var u, h, f, g = d.value;
        if (!(g.canScroll && !g.canScroll(l))) {
          var m = yme(s), v = bme((u = g.getConfiguration) === null || u === void 0 ? void 0 : u.call(g, l)), y = (h = (f = g.getAllowedAxis) === null || f === void 0 ? void 0 : f.call(g, l)) !== null && h !== void 0 ? h : "all", w = wme({
            element: s,
            engagement: m,
            input: e,
            config: v,
            allowedAxis: y,
            getRect: function(k) {
              return DOMRect.fromRect({
                y: 0,
                x: 0,
                width: k.clientWidth,
                height: k.clientHeight
              });
            },
            timeSinceLastFrame: n
          }), b = {
            top: r.top ? w.top : 0,
            left: r.left ? w.left : 0
          };
          (b.top !== 0 || b.left !== 0) && s.scrollBy(b);
          break;
        }
      }
    } catch (j) {
      c.e(j);
    } finally {
      c.f();
    }
  }
  function Sat(t) {
    var e = t.input, n = t.findEntry, r = t.timeSinceLastFrame, i = t.source, a = t.getWindowScrollEntries, s = t.underUsersPointer, l = Cme({
      target: s,
      timeSinceLastFrame: r,
      input: e,
      source: i,
      findEntry: n
    });
    Dme(l) && kat({
      input: e,
      source: i,
      entries: a(),
      timeSinceLastFrame: r,
      available: l
    });
  }
  function PX(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function jat(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? PX(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : PX(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function Tat(t) {
    var e = t.monitor, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
    function i(d) {
      return n.set(d.element, d), sv(fat(d.element), function() {
        return n.delete(d.element);
      });
    }
    function a() {
      var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, u = jat({}, d);
      return r.add(u), function() {
        return r.delete(u);
      };
    }
    function s(d) {
      var u;
      return (u = n.get(d)) !== null && u !== void 0 ? u : null;
    }
    function l() {
      return Array.from(r);
    }
    function c(d) {
      var u = d.latestArgs, h = d.underUsersPointer, f = d.timeSinceLastFrame;
      Sat({
        input: u.location.current.input,
        source: u.source,
        findEntry: s,
        underUsersPointer: h,
        timeSinceLastFrame: f,
        getWindowScrollEntries: l
      });
    }
    return dat(e).onFrame(c), {
      autoScroll: i,
      autoScrollWindow: a
    };
  }
  var Rat = Tat({
    monitor: iL
  }), Eme = Rat.autoScroll, Aat = "DnD_ItemDraggableTarget__1u3qs4v0 ContainerColor_ContainerColor__15396tl0 _1mqalmd1 _1mqalmd0 ContainerColor_ContainerColor_variant_SurfaceVariant__15396tl3", Iat = "DnD_AfterRoomItemDropTarget__1u3qs4v3 DnD_BaseAfterRoomItemDropTarget__1u3qs4v2 DnD_DropTargetLine__1u3qs4v1", Bat = "DnD_AfterSpaceItemDropTarget__1u3qs4v4 DnD_BaseAfterRoomItemDropTarget__1u3qs4v2 DnD_DropTargetLine__1u3qs4v1";
  const aL = (t, e, n, r) => {
    const [i, a] = p.useState(false);
    return p.useEffect(() => {
      const s = e.current, l = (r == null ? void 0 : r.current) ?? void 0;
      return s ? _me({
        element: s,
        dragHandle: l,
        getInitialData: () => t,
        onDragStart: () => {
          a(true), n(t);
        },
        onDrop: () => {
          a(false), n(void 0);
        }
      }) : void 0;
    }, [
      e,
      r,
      t,
      n
    ]), i;
  }, Pat = ft(({ className: t, ...e }, n) => o.jsx(E, {
    justifyContent: "Center",
    alignItems: "Center",
    className: gt(Aat, t),
    ref: n,
    ...e,
    children: o.jsx(Q, {
      size: "50",
      src: q.VerticalDots
    })
  }));
  function $8({ item: t, afterSpace: e, nextRoomId: n, canDrop: r }) {
    const i = p.useRef(null), [a, s] = p.useState("idle");
    return p.useEffect(() => {
      const l = i.current;
      if (!l) throw new Error("drop target ref is not set properly");
      return rL({
        element: l,
        getData: () => ({
          item: t,
          nextRoomId: n
        }),
        onDragEnter: ({ source: c }) => {
          r(c.data, {
            item: t,
            nextRoomId: n
          }) ? s("allow") : s("not-allow");
        },
        onDragLeave: () => s("idle"),
        onDrop: () => s("idle")
      });
    }, [
      t,
      n,
      r
    ]), o.jsx("div", {
      className: e ? Bat : Iat,
      "data-hover": a !== "idle",
      "data-error": a === "not-allow",
      ref: i
    });
  }
  const Mat = (t, e, n) => {
    p.useEffect(() => {
      const r = t.current;
      if (!r) throw new Error("Scroll element ref not configured");
      return sv(iL({
        onDrop: ({ source: i, location: a }) => {
          e(void 0);
          const { dropTargets: s } = a.current;
          s.length !== 0 && n(i.data, s[0].data);
        }
      }), Eme({
        element: r
      }));
    }, [
      t,
      e,
      n
    ]);
  };
  function Oat() {
    return o.jsx(E, {
      gap: "200",
      alignItems: "Center",
      children: o.jsxs(E, {
        grow: "Yes",
        gap: "200",
        alignItems: "Center",
        className: vot,
        children: [
          o.jsx(xn, {
            className: dme,
            size: "200",
            radii: "300"
          }),
          o.jsx(E, {
            className: mC,
            shrink: "No",
            style: {
              width: "100vw",
              maxWidth: He(120)
            }
          })
        ]
      })
    });
  }
  function kme({ roomId: t, suggested: e }) {
    return o.jsx(Qe, {
      as: "span",
      className: PS,
      variant: "Surface",
      size: "500",
      before: o.jsx(xn, {
        size: "200",
        radii: "300",
        children: o.jsx(yi, {
          roomId: t,
          renderFallback: () => o.jsx(D, {
            as: "span",
            size: "H6",
            children: "U"
          })
        })
      }),
      children: o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          o.jsx(D, {
            size: "H4",
            truncate: true,
            children: "Unknown"
          }),
          o.jsx(Rn, {
            variant: "Secondary",
            fill: "Soft",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "L400",
              children: "Inaccessible"
            })
          }),
          e && o.jsx(Rn, {
            variant: "Success",
            fill: "Soft",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "L400",
              children: "Suggested"
            })
          })
        ]
      })
    });
  }
  function Sme({ roomId: t, via: e, name: n, avatarUrl: r, suggested: i }) {
    const a = be(), [s, l] = Et(p.useCallback(() => a.joinRoom(t, {
      viaServers: e
    }), [
      a,
      t,
      e
    ])), c = s.status === ve.Idle || s.status === ve.Error;
    return o.jsx(Qe, {
      className: PS,
      variant: "Surface",
      size: "500",
      onClick: l,
      disabled: !c,
      before: o.jsx(xn, {
        size: "200",
        radii: "300",
        children: o.jsx(yi, {
          roomId: t,
          src: r,
          alt: n,
          renderFallback: () => o.jsx(D, {
            as: "span",
            size: "H6",
            children: Vi(n)
          })
        })
      }),
      after: c ? o.jsx(Q, {
        src: q.Plus,
        size: "50"
      }) : o.jsx(dt, {
        variant: "Secondary",
        size: "200"
      }),
      children: o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          o.jsx(D, {
            size: "H4",
            truncate: true,
            children: n || "Unknown"
          }),
          i && o.jsx(Rn, {
            variant: "Success",
            fill: "Soft",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "L400",
              children: "Suggested"
            })
          }),
          s.status === ve.Error && o.jsx(Rn, {
            variant: "Critical",
            fill: "Soft",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "L400",
              truncate: true,
              children: s.error.name
            })
          })
        ]
      })
    });
  }
  function Lat({ roomId: t, name: e, avatarUrl: n, suggested: r, closed: i, categoryId: a, handleClose: s }) {
    return o.jsx(Qe, {
      "data-category-id": a,
      onClick: s,
      className: PS,
      variant: "Surface",
      size: "500",
      before: o.jsx(xn, {
        size: "200",
        radii: "300",
        children: o.jsx(yi, {
          roomId: t,
          src: n,
          alt: e,
          renderFallback: () => o.jsx(D, {
            as: "span",
            size: "H6",
            children: Vi(e)
          })
        })
      }),
      after: o.jsx(Q, {
        src: i ? q.ChevronRight : q.ChevronBottom,
        size: "50"
      }),
      children: o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          o.jsx(D, {
            size: "H4",
            truncate: true,
            children: e
          }),
          r && o.jsx(Rn, {
            variant: "Success",
            fill: "Soft",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "L400",
              children: "Suggested"
            })
          })
        ]
      })
    });
  }
  function Nat({ closed: t, categoryId: e, handleClose: n }) {
    return o.jsx(Qe, {
      "data-category-id": e,
      onClick: n,
      className: PS,
      variant: "Surface",
      size: "500",
      after: o.jsx(Q, {
        src: t ? q.ChevronRight : q.ChevronBottom,
        size: "50"
      }),
      children: o.jsx(E, {
        alignItems: "Center",
        gap: "200",
        children: o.jsx(D, {
          size: "H4",
          truncate: true,
          children: "Rooms"
        })
      })
    });
  }
  function zat({ item: t }) {
    const [e, n] = p.useState(), r = fot(), [i, a] = p.useState(false), s = (d) => {
      n(d.currentTarget.getBoundingClientRect());
    }, l = (d) => {
      r(t.roomId, d), n(void 0);
    }, c = () => {
      a(true), n(void 0);
    };
    return o.jsxs(ln, {
      anchor: e,
      position: "Bottom",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => n(void 0),
          clickOutsideDeactivates: true,
          isKeyForward: (d) => d.key === "ArrowDown",
          isKeyBackward: (d) => d.key === "ArrowUp",
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              size: "300",
              radii: "300",
              variant: "Primary",
              fill: "None",
              onClick: () => l(na.TextRoom),
              children: o.jsx(D, {
                size: "T300",
                children: "Chat Room"
              })
            }),
            o.jsx(Ye, {
              size: "300",
              radii: "300",
              variant: "Primary",
              fill: "None",
              onClick: () => l(na.VoiceRoom),
              after: o.jsx(JO, {}),
              children: o.jsx(D, {
                size: "T300",
                children: "Voice Room"
              })
            }),
            o.jsx(Ye, {
              size: "300",
              radii: "300",
              fill: "None",
              onClick: c,
              children: o.jsx(D, {
                size: "T300",
                children: "Existing Room"
              })
            })
          ]
        })
      }),
      children: [
        t.parentId === void 0 && o.jsx(Qe, {
          variant: "Primary",
          radii: "Pill",
          before: o.jsx(Q, {
            src: q.Plus,
            size: "50"
          }),
          onClick: s,
          "aria-pressed": !!e,
          children: o.jsx(D, {
            size: "B300",
            children: "Add Room"
          })
        }),
        i && o.jsx(cme, {
          parentId: t.roomId,
          requestClose: () => a(false)
        })
      ]
    });
  }
  function Uat({ item: t }) {
    const [e, n] = p.useState(), r = pot(), [i, a] = p.useState(false), s = (d) => {
      n(d.currentTarget.getBoundingClientRect());
    }, l = () => {
      r(t.roomId), n(void 0);
    }, c = () => {
      a(true), n(void 0);
    };
    return o.jsxs(ln, {
      anchor: e,
      position: "Bottom",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => n(void 0),
          clickOutsideDeactivates: true,
          isKeyForward: (d) => d.key === "ArrowDown",
          isKeyBackward: (d) => d.key === "ArrowUp",
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              size: "300",
              radii: "300",
              variant: "Primary",
              fill: "None",
              onClick: l,
              children: o.jsx(D, {
                size: "T300",
                children: "New Space"
              })
            }),
            o.jsx(Ye, {
              size: "300",
              radii: "300",
              fill: "None",
              onClick: c,
              children: o.jsx(D, {
                size: "T300",
                children: "Existing Space"
              })
            })
          ]
        })
      }),
      children: [
        t.parentId === void 0 && o.jsx(Qe, {
          variant: "SurfaceVariant",
          radii: "Pill",
          before: o.jsx(Q, {
            src: q.Plus,
            size: "50"
          }),
          onClick: s,
          "aria-pressed": !!e,
          children: o.jsx(D, {
            size: "B300",
            children: "Add Space"
          })
        }),
        i && o.jsx(cme, {
          space: true,
          parentId: t.roomId,
          requestClose: () => a(false)
        })
      ]
    });
  }
  const Vat = ft(({ className: t, summary: e, loading: n, joined: r, closed: i, categoryId: a, item: s, handleClose: l, options: c, before: d, after: u, canEditChild: h, canReorder: f, onDragging: g, getRoom: m, ...v }, y) => {
    const w = be(), b = hn(), { roomId: j, content: k } = s, C = m(j), x = p.useRef(null);
    return aL(s, x, g), o.jsxs(E, {
      shrink: "No",
      alignItems: "Center",
      gap: "200",
      className: gt(Fot({
        outlined: !r || i
      }), t),
      ...v,
      ref: y,
      children: [
        d,
        o.jsxs(E, {
          grow: "Yes",
          gap: "100",
          alignItems: "Inherit",
          justifyContent: "SpaceBetween",
          children: [
            o.jsx(E, {
              ref: f ? x : null,
              children: C ? o.jsx(ZO, {
                room: C,
                children: (S) => s.parentId ? o.jsx(Lat, {
                  roomId: j,
                  name: S.name,
                  avatarUrl: Sa(w, C, 96, b),
                  suggested: k.suggested,
                  closed: i,
                  categoryId: a,
                  handleClose: l
                }) : o.jsx(Nat, {
                  closed: i,
                  categoryId: a,
                  handleClose: l
                })
              }) : o.jsxs(o.Fragment, {
                children: [
                  !e && (n ? o.jsx(Oat, {}) : o.jsx(kme, {
                    roomId: s.roomId,
                    suggested: s.content.suggested
                  })),
                  e && o.jsx(Sme, {
                    roomId: j,
                    via: s.content.via,
                    name: e.name || e.canonical_alias || j,
                    avatarUrl: (e == null ? void 0 : e.avatar_url) ? Cn(w, e.avatar_url, b, 96, 96, "crop") ?? void 0 : void 0,
                    suggested: k.suggested
                  })
                ]
              })
            }),
            C && h && o.jsxs(E, {
              shrink: "No",
              alignItems: "Inherit",
              gap: "200",
              children: [
                o.jsx(zat, {
                  item: s
                }),
                o.jsx(Uat, {
                  item: s
                })
              ]
            })
          ]
        }),
        c,
        u
      ]
    });
  });
  function sL({ roomId: t, onDone: e, onCancel: n }) {
    const r = be(), [i, a] = Et(p.useCallback(async () => {
      r.leave(t);
    }, [
      r,
      t
    ])), s = () => {
      a();
    };
    return p.useEffect(() => {
      i.status === ve.Success && e();
    }, [
      i,
      e
    ]), o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: n,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Leave Space"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: n,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        children: "Are you sure you want to leave this space?"
                      }),
                      i.status === ve.Error && o.jsxs(D, {
                        style: {
                          color: ct.Critical.Main
                        },
                        size: "T300",
                        children: [
                          "Failed to leave space! ",
                          i.error.message
                        ]
                      })
                    ]
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    variant: "Critical",
                    onClick: s,
                    before: i.status === ve.Loading ? o.jsx(dt, {
                      fill: "Solid",
                      variant: "Critical",
                      size: "200"
                    }) : void 0,
                    "aria-disabled": i.status === ve.Loading || i.status === ve.Success,
                    children: o.jsx(D, {
                      size: "B400",
                      children: i.status === ve.Loading ? "Leaving..." : "Leave"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  var Ro = ((t) => (t[t.GeneralPage = 0] = "GeneralPage", t[t.MembersPage = 1] = "MembersPage", t[t.PermissionsPage = 2] = "PermissionsPage", t[t.EmojisStickersPage = 3] = "EmojisStickersPage", t[t.DeveloperToolsPage = 4] = "DeveloperToolsPage", t[t.CosmeticsPage = 5] = "CosmeticsPage", t[t.AbbreviationsPage = 6] = "AbbreviationsPage", t[t.AppearancePage = 7] = "AppearancePage", t))(Ro || {});
  const lL = vn(void 0), Hat = () => Ze(lL), $at = () => {
    const t = Fn(lL);
    return p.useCallback(() => {
      t(void 0);
    }, [
      t
    ]);
  }, lv = () => {
    const t = Fn(lL);
    return p.useCallback((n, r, i) => {
      t({
        roomId: n,
        spaceId: r,
        page: i
      });
    }, [
      t
    ]);
  };
  function Wat({ item: t, requestClose: e }) {
    const n = be(), { roomId: r, parentId: i, content: a } = t, [s, l] = Et(p.useCallback(() => {
      const c = {
        ...a,
        suggested: !a.suggested
      };
      return n.sendStateEvent(i, ce.SpaceChild, c, r);
    }, [
      n,
      i,
      r,
      a
    ]));
    return p.useEffect(() => {
      s.status === ve.Success && e();
    }, [
      e,
      s
    ]), o.jsx(Ye, {
      onClick: l,
      size: "300",
      radii: "300",
      before: s.status === ve.Loading && o.jsx(dt, {
        size: "100"
      }),
      disabled: s.status === ve.Loading,
      children: o.jsx(D, {
        as: "span",
        size: "T300",
        truncate: true,
        children: a.suggested ? "Unset Suggested" : "Set Suggested"
      })
    });
  }
  function qat({ item: t, requestClose: e }) {
    const n = be(), { roomId: r, parentId: i } = t, [a, s] = Et(p.useCallback(() => n.sendStateEvent(i, ce.SpaceChild, {}, r), [
      n,
      i,
      r
    ]));
    return p.useEffect(() => {
      a.status === ve.Success && e();
    }, [
      e,
      a
    ]), o.jsx(Ye, {
      onClick: s,
      variant: "Critical",
      fill: "None",
      size: "300",
      radii: "300",
      before: a.status === ve.Loading && o.jsx(dt, {
        variant: "Critical",
        fill: "Soft",
        size: "100"
      }),
      disabled: a.status === ve.Loading,
      children: o.jsx(D, {
        as: "span",
        size: "T300",
        truncate: true,
        children: "Remove"
      })
    });
  }
  function Kat({ item: t, requestClose: e, disabled: n }) {
    const i = be().getRoom(t.roomId), [a, s] = p.useState(false), l = () => {
      s(true);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Ye, {
          onClick: l,
          size: "300",
          radii: "300",
          variant: "Primary",
          fill: "None",
          "aria-pressed": a,
          disabled: n || !i,
          children: o.jsx(D, {
            as: "span",
            size: "T300",
            truncate: true,
            children: "Invite"
          })
        }),
        a && i && o.jsx(Pp, {
          room: i,
          requestClose: () => {
            s(false), e();
          }
        })
      ]
    });
  }
  function Gat({ item: t, requestClose: e, disabled: n }) {
    const r = Bp(), i = lv(), a = ka(), s = () => {
      "space" in t ? i(t.roomId, t.parentId) : r(t.roomId, a == null ? void 0 : a.roomId), e();
    };
    return o.jsx(Ye, {
      onClick: s,
      size: "300",
      radii: "300",
      disabled: n,
      children: o.jsx(D, {
        as: "span",
        size: "T300",
        truncate: true,
        children: "Settings"
      })
    });
  }
  function W8({ item: t, joined: e, powerLevels: n, canEditChild: r, pinned: i, onTogglePin: a }) {
    const s = be(), [l, c] = p.useState(), d = () => {
      if (!n) return false;
      const g = Sf(s, t.roomId);
      return Gu(g, n).action("invite", s.getSafeUserId());
    }, u = (g) => {
      c(g.currentTarget.getBoundingClientRect());
    }, h = p.useCallback(() => c(void 0), []), f = br();
    return !e && !r ? null : o.jsxs(E, {
      gap: "200",
      alignItems: "Center",
      shrink: "No",
      children: [
        o.jsx(Oe, {
          onClick: u,
          size: "300",
          variant: "SurfaceVariant",
          fill: "None",
          radii: "300",
          "aria-pressed": !!l,
          children: o.jsx(Q, {
            size: "50",
            src: q.VerticalDots
          })
        }),
        l && o.jsx(ln, {
          anchor: l,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => c(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (g) => g.key === "ArrowDown",
              isKeyBackward: (g) => g.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsxs(tn, {
              style: {
                maxWidth: He(150),
                width: "100vw"
              },
              children: [
                e && o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    padding: ee.space.S100
                  },
                  children: [
                    a && o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        a(t.roomId), h();
                      },
                      children: o.jsx(D, {
                        as: "span",
                        size: "T300",
                        truncate: true,
                        children: i ? "Unpin from Sidebar" : "Pin to Sidebar"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      onClick: () => {
                        f(Qg(wi(s, t.roomId)));
                      },
                      children: o.jsx(D, {
                        as: "span",
                        size: "T300",
                        truncate: true,
                        children: "Open Lobby"
                      })
                    }),
                    o.jsx(Kat, {
                      item: t,
                      requestClose: h,
                      disabled: !d()
                    }),
                    o.jsx(Gat, {
                      item: t,
                      requestClose: h
                    }),
                    o.jsx(Hi, {
                      initial: false,
                      children: (g, m) => o.jsxs(o.Fragment, {
                        children: [
                          o.jsx(Ye, {
                            onClick: () => m(true),
                            variant: "Critical",
                            fill: "None",
                            size: "300",
                            after: o.jsx(Q, {
                              size: "100",
                              src: q.ArrowGoLeft
                            }),
                            radii: "300",
                            "aria-pressed": g,
                            children: o.jsx(D, {
                              style: {
                                flexGrow: 1
                              },
                              as: "span",
                              size: "T300",
                              truncate: true,
                              children: "Leave"
                            })
                          }),
                          g && ("space" in t ? o.jsx(sL, {
                            roomId: t.roomId,
                            onDone: h,
                            onCancel: () => m(false)
                          }) : o.jsx(YM, {
                            roomId: t.roomId,
                            onDone: h,
                            onCancel: () => m(false)
                          }))
                        ]
                      })
                    })
                  ]
                }),
                (e || r) && o.jsx(nr, {
                  size: "300",
                  variant: "Surface",
                  direction: "Horizontal"
                }),
                r && o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    padding: ee.space.S100
                  },
                  children: [
                    o.jsx(Wat, {
                      item: t,
                      requestClose: h
                    }),
                    o.jsx(qat, {
                      item: t,
                      requestClose: h
                    })
                  ]
                })
              ]
            })
          })
        })
      ]
    });
  }
  const MX = fo("KnockRoomPrompt");
  function jme({ roomId: t, via: e, onDone: n, onCancel: r }) {
    const i = be(), [a, s] = Et(p.useCallback(async (c) => {
      MX.info("ui", "Knock room button clicked", {
        roomId: t
      }), i.knockRoom(t, {
        viaServers: e || void 0,
        reason: c
      });
    }, [
      i,
      t,
      e
    ])), l = (c) => {
      var _a6, _b3;
      c.preventDefault();
      const h = ((_b3 = ((_a6 = c.target) == null ? void 0 : _a6.reasonInput) || void 0) == null ? void 0 : _b3.value.trim()) || void 0;
      s(h);
    };
    return p.useEffect(() => {
      a.status === ve.Success && (MX.info("ui", "Successfully knocked on room", {
        roomId: t
      }), n());
    }, [
      a,
      n,
      t
    ]), o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: r,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Knock On Room"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: r,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                as: "form",
                onSubmit: l,
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        children: "Request to join this room. You can optionally leave a reason for the moderators."
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsxs(D, {
                            size: "L400",
                            children: [
                              "Reason",
                              " ",
                              o.jsx(D, {
                                as: "span",
                                size: "T200",
                                children: "(Optional)"
                              })
                            ]
                          }),
                          o.jsx(mn, {
                            name: "reasonInput",
                            variant: "Background"
                          }),
                          a.status === ve.Error && o.jsxs(D, {
                            style: {
                              color: ct.Critical.Main
                            },
                            size: "T300",
                            children: [
                              "Failed to knock! ",
                              a.error.message
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    variant: "Primary",
                    before: a.status === ve.Loading ? o.jsx(dt, {
                      fill: "Solid",
                      variant: "Primary",
                      size: "200"
                    }) : void 0,
                    "aria-disabled": a.status === ve.Loading || a.status === ve.Success,
                    children: o.jsx(D, {
                      size: "B400",
                      children: a.status === ve.Loading ? "Knocking..." : "Knock"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  var Yat = "RoomItem_RoomItemCard__bkzhnl0", Zat = "RoomItem_RoomProfileTopic__bkzhnl1", Jat = "RoomItem_ErrorNameContainer__bkzhnl2";
  function Xat({ roomId: t, via: e }) {
    var _a6;
    const n = be(), [r, i] = Et(p.useCallback(() => n.joinRoom(t, {
      viaServers: e
    }), [
      n,
      t,
      e
    ])), a = r.status === ve.Idle || r.status === ve.Error;
    return o.jsxs(E, {
      shrink: "No",
      gap: "200",
      alignItems: "Center",
      children: [
        r.status === ve.Error && o.jsx(ar, {
          tooltip: o.jsx(pr, {
            variant: "Critical",
            style: {
              maxWidth: He(200)
            },
            children: o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  style: {
                    wordBreak: "break-word"
                  },
                  size: "T400",
                  children: ((_a6 = r.error.data) == null ? void 0 : _a6.error) || r.error.message
                }),
                o.jsx(D, {
                  size: "T200",
                  children: r.error.name
                })
              ]
            })
          }),
          children: (s) => {
            var _a7;
            return o.jsx(Q, {
              ref: s,
              style: {
                color: ct.Critical.Main,
                cursor: "pointer"
              },
              src: q.Warning,
              size: "400",
              filled: true,
              tabIndex: 0,
              "aria-label": ((_a7 = r.error.data) == null ? void 0 : _a7.error) || r.error.message
            });
          }
        }),
        o.jsx(Qe, {
          variant: "Secondary",
          fill: "Soft",
          size: "400",
          radii: "Pill",
          before: a ? o.jsx(Q, {
            src: q.Plus,
            size: "50"
          }) : o.jsx(dt, {
            variant: "Secondary",
            size: "100"
          }),
          onClick: i,
          disabled: !a,
          children: o.jsx(D, {
            size: "B300",
            children: "Join"
          })
        })
      ]
    });
  }
  function Qat({ roomId: t, via: e }) {
    return o.jsx(Hi, {
      initial: false,
      children: (n, r) => o.jsxs(E, {
        shrink: "No",
        gap: "200",
        alignItems: "Center",
        children: [
          o.jsx(Qe, {
            variant: "Secondary",
            fill: "Soft",
            size: "400",
            radii: "Pill",
            before: o.jsx(Q, {
              src: q.MailPlus,
              size: "50"
            }),
            onClick: () => r(true),
            children: o.jsx(D, {
              size: "B300",
              children: "Knock"
            })
          }),
          n && o.jsx(jme, {
            roomId: t,
            via: e,
            onDone: () => r(false),
            onCancel: () => r(false)
          })
        ]
      })
    });
  }
  function q8({ roomId: t, via: e, joinRule: n }) {
    return n === kn.Knock ? o.jsx(Qat, {
      roomId: t,
      via: e
    }) : o.jsx(Xat, {
      roomId: t,
      via: e
    });
  }
  function est() {
    return o.jsxs(E, {
      grow: "Yes",
      gap: "300",
      children: [
        o.jsx(xn, {
          className: dme
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(E, {
              gap: "200",
              alignItems: "Center",
              children: o.jsx(E, {
                className: mC,
                shrink: "No",
                style: {
                  maxWidth: He(80)
                }
              })
            }),
            o.jsxs(E, {
              gap: "200",
              alignItems: "Center",
              children: [
                o.jsx(E, {
                  className: mC,
                  shrink: "No",
                  style: {
                    maxWidth: He(40)
                  }
                }),
                o.jsx(E, {
                  className: mC,
                  shrink: "No",
                  style: {
                    maxWidth: He(120)
                  }
                })
              ]
            })
          ]
        })
      ]
    });
  }
  function OX({ roomId: t, suggested: e, inaccessibleRoom: n, via: r }) {
    return o.jsxs(E, {
      grow: "Yes",
      gap: "300",
      children: [
        o.jsx(xn, {
          children: o.jsx(yi, {
            roomId: t,
            src: void 0,
            alt: t,
            renderFallback: () => o.jsx(Ya, {
              size: "300",
              joinRule: n ? kn.Invite : kn.Restricted,
              filled: true
            })
          })
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          className: Jat,
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "Center",
              children: [
                o.jsx(D, {
                  size: "H5",
                  truncate: true,
                  children: "Unknown"
                }),
                e && o.jsx(E, {
                  shrink: "No",
                  alignItems: "Center",
                  children: o.jsx(Rn, {
                    variant: "Success",
                    fill: "Soft",
                    radii: "Pill",
                    outlined: true,
                    children: o.jsx(D, {
                      size: "L400",
                      children: "Suggested"
                    })
                  })
                })
              ]
            }),
            o.jsx(E, {
              gap: "200",
              alignItems: "Center",
              children: n ? o.jsx(Rn, {
                variant: "Secondary",
                fill: "Soft",
                radii: "300",
                size: "500",
                children: o.jsx(D, {
                  size: "L400",
                  children: "Inaccessible"
                })
              }) : o.jsx(D, {
                size: "T200",
                truncate: true,
                children: t
              })
            })
          ]
        }),
        !n && o.jsx(q8, {
          roomId: t,
          via: r
        })
      ]
    });
  }
  function LX({ roomId: t, roomType: e, name: n, topic: r, avatarUrl: i, suggested: a, memberCount: s, joinRule: l, options: c }) {
    return o.jsxs(E, {
      grow: "Yes",
      gap: "300",
      children: [
        o.jsx(xn, {
          children: o.jsx(yi, {
            roomId: t,
            src: i,
            alt: n,
            renderFallback: () => o.jsx(Ya, {
              size: "300",
              joinRule: l,
              roomType: e
            })
          })
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "Center",
              children: [
                o.jsx(D, {
                  size: "H5",
                  truncate: true,
                  children: n
                }),
                a && o.jsx(E, {
                  shrink: "No",
                  alignItems: "Center",
                  children: o.jsx(Rn, {
                    variant: "Success",
                    fill: "Soft",
                    radii: "Pill",
                    outlined: true,
                    children: o.jsx(D, {
                      size: "L400",
                      children: "Suggested"
                    })
                  })
                })
              ]
            }),
            o.jsxs(E, {
              gap: "200",
              alignItems: "Center",
              children: [
                s && o.jsx(E, {
                  shrink: "No",
                  gap: "200",
                  children: o.jsx(D, {
                    size: "T200",
                    priority: "300",
                    children: `${UO(s)} Members`
                  })
                }),
                s && r && o.jsx(nr, {
                  variant: "SurfaceVariant",
                  style: {
                    height: He(12)
                  },
                  direction: "Vertical",
                  size: "400"
                }),
                r && o.jsx(Hi, {
                  initial: false,
                  children: (d, u) => o.jsxs(o.Fragment, {
                    children: [
                      o.jsx(D, {
                        className: Zat,
                        size: "T200",
                        priority: "300",
                        truncate: true,
                        onClick: () => u(true),
                        onKeyDown: Vb(() => u(true)),
                        tabIndex: 0,
                        children: r
                      }),
                      o.jsx(Hn, {
                        open: d,
                        backdrop: o.jsx($n, {}),
                        children: o.jsx(Wn, {
                          children: o.jsx(Ft, {
                            focusTrapOptions: {
                              initialFocus: false,
                              clickOutsideDeactivates: true,
                              onDeactivate: () => u(false),
                              escapeDeactivates: kt
                            },
                            children: o.jsx(Vf, {
                              name: n,
                              topic: r,
                              requestClose: () => u(false)
                            })
                          })
                        })
                      })
                    ]
                  })
                })
              ]
            })
          ]
        }),
        c
      ]
    });
  }
  const tst = ft(({ item: t, loading: e, error: n, summary: r, dm: i, onOpen: a, options: s, before: l, after: c, onDragging: d, canReorder: u, getRoom: h, ...f }, g) => {
    const m = be(), v = hn(), { roomId: y, content: w } = t, b = h(y), j = p.useRef(null), k = p.useRef(null);
    aL(t, j, d, k);
    const C = (b == null ? void 0 : b.getMyMembership()) === Ht.Join;
    return o.jsxs(Te, {
      className: Yat,
      variant: "SurfaceVariant",
      gap: "300",
      alignItems: "Center",
      ...f,
      ref: g,
      children: [
        l,
        o.jsxs(E, {
          ref: u ? j : null,
          grow: "Yes",
          children: [
            u && o.jsx(Pat, {
              ref: k
            }),
            b ? o.jsx(ZO, {
              room: b,
              children: (x) => o.jsx(LX, {
                roomId: y,
                roomType: x.roomType,
                name: x.name,
                topic: x.topic,
                avatarUrl: i ? Jf(m, b, 96, v) : Sa(m, b, 96, v),
                memberCount: x.memberCount,
                suggested: w.suggested,
                joinRule: x.joinRule,
                options: C ? o.jsx(E, {
                  shrink: "No",
                  gap: "100",
                  alignItems: "Center",
                  children: o.jsx(Qe, {
                    "data-room-id": y,
                    onClick: a,
                    variant: "Secondary",
                    fill: "None",
                    size: "400",
                    radii: "Pill",
                    "aria-label": "Open Room",
                    children: o.jsx(Q, {
                      size: "50",
                      src: q.ArrowRight
                    })
                  })
                }) : o.jsx(q8, {
                  roomId: y,
                  via: w.via,
                  joinRule: x.joinRule
                })
              })
            }) : o.jsxs(o.Fragment, {
              children: [
                !r && (n ? o.jsx(OX, {
                  roomId: y,
                  inaccessibleRoom: false,
                  suggested: w.suggested,
                  via: w.via
                }) : o.jsxs(o.Fragment, {
                  children: [
                    e && o.jsx(est, {}),
                    !e && o.jsx(OX, {
                      roomId: y,
                      inaccessibleRoom: true,
                      suggested: w.suggested,
                      via: w.via
                    })
                  ]
                })),
                r && o.jsx(LX, {
                  roomId: y,
                  roomType: r.room_type,
                  name: r.name || r.canonical_alias || y,
                  topic: r.topic,
                  avatarUrl: (r == null ? void 0 : r.avatar_url) ? Cn(m, r.avatar_url, v, 96, 96, "crop") ?? void 0 : void 0,
                  memberCount: r.num_joined_members,
                  suggested: w.suggested,
                  joinRule: r.join_rule,
                  options: o.jsx(q8, {
                    roomId: y,
                    via: w.via,
                    joinRule: r.join_rule
                  })
                })
              ]
            })
          ]
        }),
        s,
        c
      ]
    });
  }), nst = p.forwardRef(({ summary: t, spaceItem: e, roomItems: n, allJoinedRooms: r, mDirects: i, roomsPowerLevels: a, categoryId: s, closed: l, handleClose: c, draggingItem: d, onDragging: u, canDrop: h, disabledReorder: f, nextSpaceId: g, getRoom: m, pinned: v, togglePinToSidebar: y, onOpenRoom: w, onSpacesFound: b }, j) => {
    var _a6;
    const k = be(), { fetching: C, error: x, rooms: S } = tot(e.roomId, true), T = p.useMemo(() => {
      const H = /* @__PURE__ */ new Map();
      return S.forEach((V) => {
        V.room_type === Bo.Space && H.set(V.room_id, V);
      }), H;
    }, [
      S
    ]), A = a.get(e.roomId), B = Sf(k, e.roomId), U = A && Gu(B, A), z = (d == null ? void 0 : d.roomId) === e.roomId && d.parentId === e.parentId, { parentId: O } = e, M = O ? a.get(O) : void 0, I = O ? Sf(k, O) : void 0, N = I && M && Gu(I, M);
    p.useEffect(() => {
      b(Array.from(T.values()));
    }, [
      T,
      b
    ]);
    let L = n == null ? void 0 : n.filter((H) => !T.has(H.roomId));
    return (U == null ? void 0 : U.stateEvent(ce.SpaceChild, k.getSafeUserId())) || (L = L == null ? void 0 : L.filter((H) => {
      const V = x instanceof Un && x.errcode === vo.M_FORBIDDEN;
      return !(!S.get(H.roomId) && !C && (x ? V : true));
    })), o.jsxs(E, {
      direction: "Column",
      gap: "0",
      ref: j,
      children: [
        o.jsx(Vat, {
          summary: S.get(e.roomId) ?? t,
          loading: C,
          item: e,
          joined: r.has(e.roomId),
          categoryId: s,
          closed: l,
          handleClose: c,
          getRoom: m,
          canEditChild: !!(U == null ? void 0 : U.stateEvent(ce.SpaceChild, k.getSafeUserId())),
          canReorder: M && !f && N ? N.stateEvent(ce.SpaceChild, k.getSafeUserId()) : false,
          options: O && M && o.jsx(W8, {
            item: {
              ...e,
              parentId: O
            },
            powerLevels: A,
            joined: r.has(e.roomId),
            canEditChild: !!(N == null ? void 0 : N.stateEvent(ce.SpaceChild, k.getSafeUserId())),
            pinned: v,
            onTogglePin: y
          }),
          after: o.jsx($8, {
            item: e,
            nextRoomId: l ? g : (_a6 = L == null ? void 0 : L[0]) == null ? void 0 : _a6.roomId,
            afterSpace: true,
            canDrop: h
          }),
          onDragging: u,
          "data-dragging": z
        }),
        L && L.length > 0 ? o.jsx(E, {
          direction: "Column",
          gap: "0",
          children: L.map((H, V) => {
            var _a7;
            const Z = S.get(H.roomId), Y = a.get(H.roomId) ?? {}, ue = V === L.length ? g : (_a7 = L[V + 1]) == null ? void 0 : _a7.roomId, ie = (d == null ? void 0 : d.roomId) === H.roomId && d.parentId === H.parentId;
            return o.jsx(tst, {
              item: H,
              loading: C,
              error: x,
              summary: Z,
              dm: i.has(H.roomId),
              onOpen: w,
              getRoom: m,
              canReorder: !!(U == null ? void 0 : U.stateEvent(ce.SpaceChild, k.getSafeUserId())) && !f,
              options: o.jsx(W8, {
                item: H,
                powerLevels: Y,
                joined: r.has(H.roomId),
                canEditChild: !!(U == null ? void 0 : U.stateEvent(ce.SpaceChild, k.getSafeUserId()))
              }),
              after: o.jsx($8, {
                item: H,
                nextRoomId: ue,
                canDrop: h
              }),
              "data-dragging": ie,
              onDragging: u
            }, H.roomId);
          })
        }) : L && o.jsx(Te, {
          variant: "SurfaceVariant",
          gap: "300",
          alignItems: "Center",
          radii: "300",
          children: o.jsx(E, {
            grow: "Yes",
            style: {
              padding: ee.space.S100
            },
            direction: "Column",
            alignItems: "Center",
            justifyContent: "Center",
            gap: "100",
            children: o.jsx(D, {
              align: "Center",
              size: "T300",
              priority: "300",
              children: "This space does not contain any rooms."
            })
          })
        })
      ]
    });
  });
  var rst = "LobbyHero_LobbyHeroTopic__1rcj9aq0";
  function ist() {
    const t = be(), e = hn(), n = im(), r = rc(n), i = D3(n), a = Ip(n), s = a ? Cn(t, a, e, 96, 96, "crop") ?? void 0 : void 0;
    return o.jsx(Vc, {
      icon: o.jsx(xn, {
        size: "500",
        children: o.jsx(yi, {
          roomId: n.roomId,
          src: s,
          alt: r,
          renderFallback: () => o.jsx(D, {
            size: "H4",
            children: Vi(r)
          })
        })
      }),
      title: r,
      subTitle: i && o.jsx(Hi, {
        initial: false,
        children: (l, c) => o.jsxs(o.Fragment, {
          children: [
            o.jsx(Hn, {
              open: l,
              backdrop: o.jsx($n, {}),
              children: o.jsx(Wn, {
                children: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    clickOutsideDeactivates: true,
                    onDeactivate: () => c(false),
                    escapeDeactivates: kt
                  },
                  children: o.jsx(Vf, {
                    name: r,
                    topic: i,
                    requestClose: () => c(false)
                  })
                })
              })
            }),
            o.jsx(D, {
              as: "span",
              onClick: () => c(true),
              onKeyDown: Vb(() => c(true)),
              tabIndex: 0,
              className: rst,
              size: "Inherit",
              priority: "300",
              children: i
            })
          ]
        })
      })
    });
  }
  var ost = "LobbyHeader_Header__j1s8xi0";
  const ast = p.forwardRef(({ powerLevels: t, requestClose: e }, n) => {
    const r = be(), i = im(), a = ri(i), l = Ki(a, t).action("invite", r.getSafeUserId()), c = lv(), [d, u] = p.useState(false), h = () => {
      u(true);
    }, f = () => {
      c(i.roomId), e();
    };
    return o.jsxs(tn, {
      ref: n,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: [
        d && o.jsx(Pp, {
          room: i,
          requestClose: () => {
            u(false), e();
          }
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: h,
              variant: "Primary",
              fill: "None",
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.UserPlus
              }),
              radii: "300",
              "aria-pressed": d,
              disabled: !l,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Invite"
              })
            }),
            o.jsx(Ye, {
              onClick: f,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Setting
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Space Settings"
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: o.jsx(Hi, {
            initial: false,
            children: (g, m) => o.jsxs(o.Fragment, {
              children: [
                o.jsx(Ye, {
                  onClick: () => m(true),
                  variant: "Critical",
                  fill: "None",
                  size: "300",
                  after: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowGoLeft
                  }),
                  radii: "300",
                  "aria-pressed": g,
                  children: o.jsx(D, {
                    style: {
                      flexGrow: 1
                    },
                    as: "span",
                    size: "T300",
                    truncate: true,
                    children: "Leave Space"
                  })
                }),
                g && o.jsx(sL, {
                  roomId: i.roomId,
                  onDone: e,
                  onCancel: () => m(false)
                })
              ]
            })
          })
        })
      ]
    });
  });
  function sst({ showProfile: t, powerLevels: e }) {
    const n = be(), r = hn(), i = im(), a = _k(ge, "isPeopleDrawer"), [s, l] = p.useState(), c = fr(), d = rc(i), u = Ip(i), h = u ? Cn(n, u, r, 96, 96, "crop") ?? void 0 : void 0, f = (g) => {
      l(g.currentTarget.getBoundingClientRect());
    };
    return o.jsx(_i, {
      className: t ? void 0 : ost,
      balance: true,
      children: o.jsxs(E, {
        grow: "Yes",
        alignItems: "Center",
        gap: "200",
        children: [
          c === sn.Mobile ? o.jsxs(o.Fragment, {
            children: [
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(ic, {
                  children: (g) => o.jsx(Oe, {
                    fill: "None",
                    onClick: g,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsx(E, {
                grow: "Yes",
                justifyContent: "Center",
                children: t && o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: d
                })
              })
            ]
          }) : o.jsxs(o.Fragment, {
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              }),
              o.jsx(E, {
                justifyContent: "Center",
                alignItems: "Center",
                gap: "300",
                children: t && o.jsxs(o.Fragment, {
                  children: [
                    o.jsx(xn, {
                      size: "300",
                      children: o.jsx(yi, {
                        roomId: i.roomId,
                        src: h,
                        alt: d,
                        renderFallback: () => o.jsx(D, {
                          size: "H4",
                          children: Vi(d)
                        })
                      })
                    }),
                    o.jsx(D, {
                      size: "H3",
                      truncate: true,
                      children: d
                    })
                  ]
                })
              })
            ]
          }),
          o.jsxs(E, {
            shrink: "No",
            grow: c === sn.Mobile ? "No" : "Yes",
            basis: c === sn.Mobile ? "Yes" : "No",
            justifyContent: "End",
            children: [
              c !== sn.Mobile && o.jsx(ar, {
                position: "Bottom",
                offset: 4,
                tooltip: o.jsx(pr, {
                  children: o.jsx(D, {
                    children: "Members"
                  })
                }),
                children: (g) => o.jsx(Oe, {
                  fill: "None",
                  ref: g,
                  onClick: () => a((m) => !m),
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.User
                  })
                })
              }),
              o.jsx(ar, {
                position: "Bottom",
                align: "End",
                offset: 4,
                tooltip: o.jsx(pr, {
                  children: o.jsx(D, {
                    children: "More Options"
                  })
                }),
                children: (g) => o.jsx(Oe, {
                  fill: "None",
                  onClick: f,
                  ref: g,
                  "aria-pressed": !!s,
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.VerticalDots,
                    filled: !!s
                  })
                })
              }),
              o.jsx(ln, {
                anchor: s,
                position: "Bottom",
                align: "End",
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    returnFocusOnDeactivate: false,
                    onDeactivate: () => l(void 0),
                    clickOutsideDeactivates: true,
                    isKeyForward: (g) => g.key === "ArrowDown",
                    isKeyBackward: (g) => g.key === "ArrowUp",
                    escapeDeactivates: kt
                  },
                  children: o.jsx(ast, {
                    powerLevels: e,
                    requestClose: () => l(void 0)
                  })
                })
              })
            ]
          })
        ]
      })
    });
  }
  var lst = Jr({
    defaultClassName: "SpaceNavItem_SpaceItemCard__1q1hx2x0",
    variantClassNames: {},
    defaultVariants: {},
    compoundVariants: []
  }), cst = "SpaceNavItem_HeaderChip__1q1hx2x1";
  function dst({ roomId: t, name: e, avatarUrl: n, suggested: r, categoryId: i, mx: a }) {
    const s = br();
    return o.jsx(Qe, {
      "data-category-id": i,
      className: cst,
      variant: "Surface",
      size: "500",
      onClick: () => s(Qg(wi(a, t))),
      before: o.jsx(xn, {
        size: "200",
        radii: "300",
        children: o.jsx(yi, {
          roomId: t,
          src: n,
          alt: e,
          renderFallback: () => o.jsx(D, {
            as: "span",
            size: "H6",
            children: Vi(e)
          })
        })
      }),
      after: o.jsx(Q, {
        src: q.Space,
        size: "50"
      }),
      children: o.jsxs(E, {
        alignItems: "Center",
        gap: "200",
        children: [
          o.jsx(D, {
            size: "H4",
            truncate: true,
            children: e
          }),
          r && o.jsx(Rn, {
            variant: "Success",
            fill: "Soft",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "L400",
              children: "Suggested"
            })
          })
        ]
      })
    });
  }
  const ust = ft(({ className: t, summary: e, joined: n, categoryId: r, item: i, options: a, before: s, after: l, canReorder: c, onDragging: d, getRoom: u, ...h }, f) => {
    const g = be(), m = hn(), { roomId: v, content: y } = i, w = p.useRef(null);
    aL(i, w, d);
    const b = u(i.roomId);
    return o.jsxs(E, {
      shrink: "No",
      alignItems: "Center",
      gap: "200",
      className: gt(lst(), t),
      ...h,
      ref: f,
      children: [
        s,
        o.jsx(E, {
          grow: "Yes",
          gap: "100",
          alignItems: "Inherit",
          justifyContent: "SpaceBetween",
          children: o.jsx(E, {
            ref: c ? w : null,
            children: b ? o.jsx(ZO, {
              room: b,
              children: (j) => o.jsx(dst, {
                roomId: v,
                name: j.name,
                avatarUrl: Sa(g, b, 96, m),
                suggested: y.suggested,
                categoryId: r,
                mx: g
              })
            }) : o.jsxs(o.Fragment, {
              children: [
                !e && o.jsx(kme, {
                  roomId: i.roomId,
                  suggested: i.content.suggested
                }),
                e && o.jsx(Sme, {
                  roomId: v,
                  via: i.content.via,
                  name: e.name || e.canonical_alias || v,
                  avatarUrl: (e == null ? void 0 : e.avatar_url) ? Cn(g, e.avatar_url, m, 96, 96, "crop") ?? void 0 : void 0,
                  suggested: y.suggested
                })
              ]
            })
          })
        }),
        a,
        l
      ]
    });
  }), hst = p.forwardRef(({ summary: t, spaceItem: e, allJoinedRooms: n, roomsPowerLevels: r, categoryId: i, draggingItem: a, onDragging: s, canDrop: l, disabledReorder: c, nextSpaceId: d, pinned: u, togglePinToSidebar: h, getRoom: f }, g) => {
    const m = be(), v = r.get(e.roomId), y = (a == null ? void 0 : a.roomId) === e.roomId && a.parentId === e.parentId, { parentId: w } = e, b = w ? r.get(w) : void 0, j = w ? Sf(m, w) : void 0, k = j && b && Gu(j, b);
    return o.jsx(E, {
      direction: "Column",
      gap: "0",
      ref: g,
      children: o.jsx(ust, {
        summary: t,
        item: e,
        joined: n.has(e.roomId),
        categoryId: i,
        canReorder: b && !c && k ? k.stateEvent(ce.SpaceChild, m.getSafeUserId()) : false,
        options: w && b && o.jsx(W8, {
          item: {
            ...e,
            parentId: w
          },
          powerLevels: v,
          joined: n.has(e.roomId),
          canEditChild: !!(k == null ? void 0 : k.stateEvent(ce.SpaceChild, m.getSafeUserId())),
          pinned: u,
          onTogglePin: h
        }),
        getRoom: f,
        after: o.jsx($8, {
          item: e,
          nextRoomId: d,
          afterSpace: true,
          canDrop: l
        }),
        onDragging: s,
        "data-dragging": y
      })
    });
  }), fst = (t, e, n) => {
    const r = be(), i = p.useCallback((l, c) => {
      if (!("space" in c.item)) return false;
      const d = t.roomId;
      if (l.parentId !== c.item.roomId && l.parentId !== c.item.parentId) return false;
      const u = e.get(d) ?? {}, h = Sf(r, d), f = Gu(h, u);
      return !(n(d) === void 0 || !f.stateEvent(ce.SpaceChild, r.getSafeUserId()));
    }, [
      t,
      e,
      n,
      r
    ]), a = p.useCallback((l, c) => {
      var _a6;
      const d = "space" in c.item ? c.item.roomId : c.item.parentId, u = l.parentId !== d, h = ((_a6 = r.getRoom(l.roomId)) == null ? void 0 : _a6.getJoinRule()) === kn.Restricted;
      if (u && h) {
        const v = e.get(l.roomId) ?? {}, y = Sf(r, l.roomId);
        if (!Gu(y, v).stateEvent(ce.RoomJoinRules, r.getSafeUserId())) return false;
      }
      const f = e.get(d) ?? {}, g = Sf(r, d), m = Gu(g, f);
      return !(n(d) === void 0 || !m.stateEvent(ce.SpaceChild, r.getSafeUserId()));
    }, [
      r,
      n,
      e
    ]);
    return p.useCallback((l, c) => l.roomId === c.item.roomId || l.roomId === c.nextRoomId ? false : "space" in l ? i(l, c) : a(l, c), [
      i,
      a
    ]);
  };
  function mst() {
    const t = br(), e = be(), n = Ze(gi), r = Ze(zr), i = p.useMemo(() => new Set(r), [
      r
    ]), a = im(), s = Mo(a), l = p.useMemo(() => new iot(32, 126, 6), []), c = iS(e, a.roomId), d = p.useRef(null), u = p.useRef(null), [h, f] = p.useState(), [g, m] = Fr(ome), [v] = Fe(ge, "isPeopleDrawer"), y = fr(), [w, b] = p.useState(true), [j, k] = Fr(sot()), C = Ze(vi), [x] = sme(Jk(e, zr, Ze(vi))), S = p.useMemo(() => {
      const se = x.flatMap((ye) => typeof ye == "string" ? ye : ye.content);
      return new Set(se);
    }, [
      x
    ]), [T, A] = p.useState(() => /* @__PURE__ */ new Map());
    gp(p.useCallback(() => u.current, []), p.useCallback((se, ye) => f(ye), []));
    const B = ec(i), U = p.useRef(/* @__PURE__ */ new Map());
    p.useEffect(() => {
      U.current.clear();
    }, [
      j,
      C,
      B
    ]);
    const z = p.useCallback((se, ye, we, Ee = /* @__PURE__ */ new Set()) => {
      var _a6;
      if (ye === se && we && (g.has(we) || ((_a6 = B(we)) == null ? void 0 : _a6.isSpaceRoom()))) return false;
      const ke = M8(se, ye);
      if (Ee.has(ke)) return false;
      if (Ee.add(ke), U.current.has(ke)) return U.current.get(ke);
      if (j.has(ke)) return U.current.set(ke, true), true;
      const Ne = C.get(ye);
      if (!Ne || Ne.size === 0) return U.current.set(ke, false), false;
      const lt = !Array.from(Ne).some((Rt) => !z(se, Rt, ye, Ee));
      return Ee.delete(ke), U.current.set(ke, lt), lt;
    }, [
      j,
      B,
      C,
      g
    ]), O = (se, ye) => {
      const we = C.get(ye);
      return !we || we.size === 0 ? false : !Array.from(we).some((Ee) => !z(se, Ee, ye));
    }, [M] = Fe(ge, "subspaceHierarchyLimit"), [I, N] = p.useState(), L = Jit(a.roomId, g, B, p.useCallback((se, ye, we) => we >= M, [
      M
    ]), p.useCallback((se) => z(a.roomId, se) || (I ? "space" in I : false), [
      I,
      z,
      a.roomId
    ])), H = nc({
      count: L.length,
      getScrollElement: () => d.current,
      estimateSize: () => 1,
      overscan: 2,
      paddingStart: h ?? 258
    }), V = H.getVirtualItems(), Z = Uje(p.useMemo(() => L.flatMap((se) => {
      const ye = Array.isArray(se.rooms) ? se.rooms.map((we) => B(we.roomId)) : [];
      return [
        B(se.space.roomId),
        ...ye
      ];
    }).filter((se) => !!se), [
      L,
      B
    ])), Y = fst(a, Z, B), [oe, ue] = Et(p.useCallback(async (se, ye) => {
      var _a6;
      if (!se.parentId) return;
      const we = L.map((We) => We.space).filter((We) => We.roomId !== se.roomId), ke = we.findIndex((We) => We.roomId === ye.roomId) + 1;
      we.splice(ke, 0, {
        ...se,
        content: {
          ...se.content,
          order: void 0
        }
      });
      const Ne = we.map((We) => {
        if (typeof We.content.order == "string" && l.has(We.content.order)) return We.content.order;
      }), Rt = (_a6 = fX(l, Ne)) == null ? void 0 : _a6.map((We, yt) => ({
        item: we[yt],
        orderKey: We
      })).filter((We, yt) => {
        if (!We.item || !We.item.parentId) return false;
        const Xt = Z.get(We.item.parentId);
        if (!Xt) return false;
        const nn = Sf(e, We.item.parentId);
        return Gu(nn, Xt).stateEvent(ce.SpaceChild, e.getSafeUserId()) && We.orderKey !== Ne[yt];
      });
      Rt && await Hu(Rt, async (We) => {
        !We.item || !We.item.parentId || await e.sendStateEvent(We.item.parentId, ce.SpaceChild, {
          ...We.item.content,
          order: We.orderKey
        }, We.item.roomId);
      });
    }, [
      e,
      L,
      l,
      Z
    ])), ie = oe.status === ve.Loading, [de, ne] = Et(p.useCallback(async (se, ye) => {
      var _a6, _b3, _c3, _d4;
      const we = e.getRoom(se.roomId);
      if (!se.parentId) return;
      const Ee = "space" in ye ? ye.roomId : ye.parentId, ke = se.content;
      if (se.parentId !== Ee && await e.sendStateEvent(se.parentId, ce.SpaceChild, {}, se.roomId), (we == null ? void 0 : we.getJoinRule()) === kn.Restricted && se.parentId !== Ee) {
        const bt = (_a6 = ni(we, ce.RoomJoinRules)) == null ? void 0 : _a6.getContent();
        if (bt) {
          const At = ((_b3 = bt.allow) == null ? void 0 : _b3.filter(($t) => $t.room_id !== se.parentId)) ?? [];
          At.push({
            type: ak.RoomMembership,
            room_id: Ee
          }), await e.sendStateEvent(we.roomId, ce.RoomJoinRules, {
            ...bt,
            allow: At
          });
        }
      }
      const Ne = Array.from(((_c3 = L == null ? void 0 : L.find((bt) => bt.space.roomId === Ee)) == null ? void 0 : _c3.rooms) ?? []), lt = "space" in ye ? void 0 : ye, We = Ne.findIndex((bt) => bt.roomId === (lt == null ? void 0 : lt.roomId)) + 1;
      Ne.splice(We, 0, {
        ...se,
        parentId: Ee,
        content: {
          ...ke,
          order: void 0
        }
      });
      const yt = Ne.map((bt) => {
        if (typeof bt.content.order == "string" && l.has(bt.content.order)) return bt.content.order;
      }), nn = (_d4 = fX(l, yt)) == null ? void 0 : _d4.map((bt, At) => ({
        item: Ne[At],
        orderKey: bt
      })).filter((bt, At) => bt.item && bt.orderKey !== yt[At]);
      nn && await Hu(nn, async (bt) => {
        bt.item && await e.sendStateEvent(Ee, ce.SpaceChild, {
          ...bt.item.content,
          order: bt.orderKey
        }, bt.item.roomId);
      });
    }, [
      e,
      L,
      l
    ])), X = de.status === ve.Loading || ie;
    Mat(d, N, p.useCallback((se, ye) => {
      Y(se, ye) && ("space" in se ? ue(se, ye.item) : ne(se, ye.item));
    }, [
      ne,
      ue,
      Y
    ]));
    const K = p.useCallback((se) => {
      m({
        type: "PUT",
        roomIds: se.map((ye) => ye.room_id)
      }), A((ye) => {
        const we = uo(ye, (Ee) => {
          se.forEach((ke) => Ee.set(ke.room_id, ke));
        });
        return ye.size === we.size ? ye : we;
      });
    }, [
      m
    ]), G = BS(k, (se) => {
      const ye = j.has(se), [we, Ee] = Git(se);
      return O(we ?? "", Ee ?? "") ? !ye : ye;
    }), le = (se) => {
      const ye = se.currentTarget.getAttribute("data-room-id");
      if (!ye) return;
      const we = wi(e, a.roomId);
      t(tF(we, wi(e, ye)));
    }, te = p.useCallback((se) => {
      const ye = lme(x, se);
      S.has(se) || ye.push(se);
      const we = fC(e, ye);
      e.setAccountData(Zr.CinnySpaces, we);
    }, [
      e,
      x,
      S
    ]), re = (se) => {
      var _a6, _b3;
      if (se.index === 0) return 0;
      const ye = ((_a6 = L[se.index - 1]) == null ? void 0 : _a6.space.depth) ?? 0, { depth: we } = ((_b3 = L[se.index]) == null ? void 0 : _b3.space) ?? {};
      return we !== 1 && (we ?? 0) >= ye ? ee.space.S200 : ee.space.S500;
    }, he = p.useCallback((se) => {
      let Ee = 0;
      const ke = [];
      return se.forEach((Ne) => {
        var _a6;
        const { depth: lt } = ((_a6 = L[Ne.index]) == null ? void 0 : _a6.space) ?? {};
        if ((lt ?? 0) < 1) return;
        if (lt === 1) {
          Ee = Ne.end;
          return;
        }
        const Rt = [];
        for (let We = 0; We < (lt ?? 0); We += 1) {
          const yt = We * 15.75 + -15, Xt = Ne.end;
          Rt.push(`M ${yt} ${Ee} L ${yt} ${Xt}`);
        }
        ke.push(o.jsx("path", {
          d: Rt.join(" "),
          fill: "none",
          stroke: ct.Surface.ContainerLine,
          strokeWidth: ee.borderWidth.B300,
          display: "block"
        })), Ee = Ne.end;
      }), o.jsx("svg", {
        style: {
          position: "absolute",
          inset: 0,
          width: "100%",
          height: "100%",
          pointerEvents: "none"
        },
        children: ke
      });
    }, [
      L
    ]);
    return o.jsx(Zoe, {
      value: s,
      children: o.jsxs(E, {
        grow: "Yes",
        children: [
          o.jsxs(si, {
            children: [
              o.jsx(sst, {
                showProfile: !w,
                powerLevels: Z.get(a.roomId) ?? {}
              }),
              o.jsx(E, {
                style: {
                  position: "relative"
                },
                grow: "Yes",
                children: o.jsx(dn, {
                  ref: d,
                  hideTrack: true,
                  visibility: "Hover",
                  children: o.jsx(Xr, {
                    children: o.jsxs(qd, {
                      children: [
                        o.jsx(A3, {
                          scrollRef: d,
                          anchorRef: u,
                          onVisibilityChange: b,
                          children: o.jsx(Oe, {
                            onClick: () => H.scrollToOffset(0),
                            variant: "SurfaceVariant",
                            radii: "Pill",
                            outlined: true,
                            size: "300",
                            "aria-label": "Scroll to Top",
                            children: o.jsx(Q, {
                              src: q.ChevronTop,
                              size: "300"
                            })
                          })
                        }),
                        o.jsxs("div", {
                          style: {
                            position: "relative",
                            height: H.getTotalSize()
                          },
                          children: [
                            o.jsx(Uc, {
                              ref: u,
                              style: {
                                paddingTop: 0
                              },
                              children: o.jsx(ist, {})
                            }),
                            V.map((se) => {
                              var _a6;
                              const ye = L[se.index];
                              if (!ye) return null;
                              const we = (_a6 = L[se.index + 1]) == null ? void 0 : _a6.space.roomId, Ee = M8(a.roomId, ye.space.roomId), ke = z(a.roomId, ye.space.roomId), Ne = `calc((${ye.space.depth} - 1) * ${ee.space.S400})`;
                              return o.jsx(Rs, {
                                virtualItem: se,
                                style: {
                                  paddingTop: re(se),
                                  paddingLeft: Ne
                                },
                                ref: H.measureElement,
                                children: ye.space.depth !== M ? o.jsx(nst, {
                                  spaceItem: ye.space,
                                  roomItems: ye.rooms,
                                  summary: T.get(ye.space.roomId),
                                  allJoinedRooms: i,
                                  mDirects: n,
                                  roomsPowerLevels: Z,
                                  categoryId: Ee,
                                  closed: ke || (I ? "space" in I : false),
                                  handleClose: G,
                                  draggingItem: I,
                                  onDragging: N,
                                  canDrop: Y,
                                  disabledReorder: X,
                                  nextSpaceId: we,
                                  getRoom: B,
                                  pinned: S.has(ye.space.roomId),
                                  togglePinToSidebar: te,
                                  onSpacesFound: K,
                                  onOpenRoom: le
                                }) : o.jsx(hst, {
                                  spaceItem: ye.space,
                                  summary: T.get(ye.space.roomId),
                                  allJoinedRooms: i,
                                  roomsPowerLevels: Z,
                                  categoryId: Ee,
                                  draggingItem: I,
                                  onDragging: N,
                                  canDrop: Y,
                                  disabledReorder: X,
                                  nextSpaceId: we,
                                  pinned: S.has(ye.space.roomId),
                                  togglePinToSidebar: te,
                                  getRoom: B
                                })
                              }, se.index);
                            }),
                            he(V)
                          ]
                        }),
                        X && o.jsx(E, {
                          style: {
                            position: "absolute",
                            bottom: ee.space.S400,
                            left: 0,
                            right: 0,
                            zIndex: 2,
                            pointerEvents: "none"
                          },
                          justifyContent: "Center",
                          children: o.jsx(Qe, {
                            variant: "Secondary",
                            outlined: true,
                            radii: "Pill",
                            before: o.jsx(dt, {
                              variant: "Secondary",
                              fill: "Soft",
                              size: "100"
                            }),
                            children: o.jsx(D, {
                              size: "L400",
                              children: "Reordering"
                            })
                          })
                        })
                      ]
                    })
                  })
                })
              })
            ]
          }),
          y === sn.Desktop && v && o.jsxs(o.Fragment, {
            children: [
              o.jsx(nr, {
                variant: "Background",
                direction: "Vertical",
                size: "300"
              }),
              o.jsx(Dfe, {
                room: a,
                members: c
              })
            ]
          })
        ]
      })
    });
  }
  function Tme({ children: t, onClose: e, direction: n }) {
    const r = Ze(ge), i = j3(0), a = IO(i, {
      stiffness: 400,
      damping: 40
    }), s = BO(({ active: l, movement: [c], velocity: [d], direction: [u], event: h, event: f }) => {
      if (f && "target" in f && f.target instanceof HTMLElement && f.target.closest('[data-gestures="ignore"]') || !r.mobileGestures || !Dr()) return;
      h.stopPropagation();
      let g = c;
      if (n === "left" && g > 0 && (g = 0), n === "right" && g < 0 && (g = 0), l) i.set(g);
      else {
        const y = n === "left" && (g < -100 || d > 0.5 && u < 0), w = n === "right" && (g > 100 || d > 0.5 && u > 0);
        (y || w) && e(), i.set(0);
      }
    }, {
      axis: "x",
      bounds: n === "left" ? {
        left: -300,
        right: 0
      } : {
        left: 0,
        right: 300
      },
      rubberband: true,
      filterTaps: true,
      pointer: {
        capture: true
      }
    });
    return !r.mobileGestures || !Dr() ? o.jsx("div", {
      style: {
        display: "flex",
        flexDirection: "column",
        flexGrow: 1,
        height: "100%",
        width: "100%"
      },
      children: t
    }) : o.jsx("div", {
      ...s(),
      style: {
        touchAction: "pan-y",
        overflow: "hidden",
        display: "flex",
        flexDirection: "column",
        flexGrow: 1,
        height: "100%",
        width: "100%"
      },
      children: o.jsx(AE.div, {
        style: {
          x: a,
          display: "flex",
          flexDirection: "column",
          flexGrow: 1,
          height: "100%"
        },
        children: t
      })
    });
  }
  var gst = "style_MemberTile__f1jyt0 _1mqalmd1 _1mqalmd0 _1bugis90 _1bugis91";
  const pst = (t, e, n) => gr(t, e.userId, n) ?? _n(e.userId) ?? e.userId, Fst = ft(({ as: t = "button", mx: e, room: n, member: r, useAuthentication: i, after: a, ...s }, l) => {
    var _a6;
    const c = Ze(qr), d = pst(n, r, c), u = v3(r.userId ?? ""), h = r.getMxcAvatarUrl() ?? ((_a6 = e.getUser(r.userId)) == null ? void 0 : _a6.avatarUrl), f = h ? e.mxcUrlToHttp(h, 100, 100, "crop", void 0, false, i) : void 0, { color: g, font: m } = rm(r.userId, n);
    return o.jsxs(t, {
      className: gst,
      ...s,
      ref: l,
      children: [
        o.jsx(xn, {
          size: "300",
          radii: "400",
          children: o.jsx(Si, {
            userId: r.userId,
            src: f ?? void 0,
            alt: d,
            renderFallback: () => o.jsx(Q, {
              size: "300",
              src: q.User,
              filled: true
            })
          })
        }),
        o.jsxs(E, {
          grow: "Yes",
          as: "span",
          direction: "Column",
          children: [
            o.jsx(D, {
              as: "span",
              size: "T300",
              truncate: true,
              style: {
                color: g,
                fontFamily: m
              },
              children: o.jsx("b", {
                children: d
              })
            }),
            u && u.status && o.jsxs(E, {
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(RS, {
                  presence: u.presence,
                  size: "200"
                }),
                o.jsx(D, {
                  as: "span",
                  size: "T200",
                  priority: "300",
                  truncate: true,
                  children: u.status
                })
              ]
            })
          ]
        }),
        a
      ]
    });
  }), NX = ft(({ as: t = "div", fill: e, server: n, ...r }, i) => o.jsx(Rn, {
    as: t,
    variant: "Secondary",
    fill: e,
    radii: "300",
    ...r,
    ref: i,
    children: o.jsx(D, {
      as: "span",
      size: "L400",
      truncate: true,
      children: n
    })
  })), vst = {
    limit: 1e3,
    matchOptions: {
      contain: true
    },
    normalizeOptions: {
      ignoreWhitespace: false
    }
  }, _st = (t) => _n(t) ?? t, yst = (t, e) => BB(t, e, _st);
  function Rme({ requestClose: t }) {
    var _a6;
    const e = be(), n = hn(), r = cr(), i = iS(e, r.roomId), a = i.length < r.getJoinedMemberCount(), s = Ls(), l = AP(), c = ka(), d = Mo(r), u = ri(r), h = bh(r, u, d), f = xP(d), [g, m] = p.useState(0), [v, y] = Fe(ge, "memberSortFilterIndex"), w = _fe(g, NO()), b = yfe(v, zO()), j = bfe(u, f), k = p.useRef(null), C = p.useRef(null), x = p.useRef(null), S = p.useMemo(() => Array.from(i).filter(w.filterFn).toSorted(b.sortFn).sort(j), [
      i,
      w,
      b,
      j
    ]), [T, A, B] = tc(S, yst, vst);
    !T && ((_a6 = C.current) == null ? void 0 : _a6.value) && A(C.current.value);
    const U = Rae((T == null ? void 0 : T.items) ?? S, h), z = nc({
      count: U.length,
      getScrollElement: () => k.current,
      estimateSize: () => 40,
      overscan: 10
    }), O = Rp(p.useCallback((N) => {
      N.target.value ? A(N.target.value) : B();
    }, [
      A,
      B
    ]), {
      wait: 200
    }), M = () => {
      C.current && (C.current.value = "", C.current.focus()), B();
    }, I = (N) => {
      const H = N.currentTarget.getAttribute("data-user-id");
      H && s(r.roomId, c == null ? void 0 : c.roomId, H, wp(N.nativeEvent));
    };
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsxs(D, {
                  size: "H3",
                  truncate: true,
                  children: [
                    r.getJoinedMemberCount(),
                    " Members"
                  ]
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          style: {
            position: "relative"
          },
          children: o.jsx(dn, {
            ref: k,
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "200",
                children: [
                  o.jsx(E, {
                    style: {
                      position: "sticky",
                      top: ee.space.S100,
                      zIndex: 1
                    },
                    direction: "Column",
                    gap: "100",
                    children: o.jsx(mn, {
                      ref: C,
                      onChange: O,
                      before: o.jsx(Q, {
                        size: "200",
                        src: q.Search
                      }),
                      variant: "SurfaceVariant",
                      size: "500",
                      placeholder: "Search",
                      outlined: true,
                      after: T && o.jsx(Qe, {
                        variant: T.items.length > 0 ? "Success" : "Critical",
                        outlined: true,
                        size: "400",
                        radii: "Pill",
                        "aria-pressed": true,
                        onClick: M,
                        after: o.jsx(Q, {
                          size: "50",
                          src: q.Cross
                        }),
                        children: o.jsx(D, {
                          size: "B300",
                          children: T.items.length === 0 ? "No Results" : `${T.items.length} Results`
                        })
                      })
                    })
                  }),
                  o.jsxs(E, {
                    ref: x,
                    alignItems: "Center",
                    justifyContent: "End",
                    gap: "200",
                    children: [
                      o.jsx(Hi, {
                        initial: void 0,
                        children: (N, L) => o.jsx(ln, {
                          anchor: N,
                          position: "Bottom",
                          align: "Start",
                          offset: 4,
                          content: o.jsx(xfe, {
                            selected: g,
                            onSelect: m,
                            requestClose: () => L(void 0)
                          }),
                          children: o.jsx(Qe, {
                            onClick: ((H) => L(H.currentTarget.getBoundingClientRect())),
                            variant: "SurfaceVariant",
                            size: "400",
                            radii: "300",
                            before: o.jsx(Q, {
                              src: q.Filter,
                              size: "50"
                            }),
                            children: o.jsx(D, {
                              size: "T200",
                              children: w.name
                            })
                          })
                        })
                      }),
                      o.jsx(Hi, {
                        initial: void 0,
                        children: (N, L) => o.jsx(ln, {
                          anchor: N,
                          position: "Bottom",
                          align: "End",
                          offset: 4,
                          content: o.jsx(wfe, {
                            selected: v,
                            onSelect: y,
                            requestClose: () => L(void 0)
                          }),
                          children: o.jsx(Qe, {
                            onClick: ((H) => L(H.currentTarget.getBoundingClientRect())),
                            variant: "SurfaceVariant",
                            size: "400",
                            radii: "300",
                            after: o.jsx(Q, {
                              src: q.Sort,
                              size: "50"
                            }),
                            children: o.jsx(D, {
                              size: "T200",
                              children: b.name
                            })
                          })
                        })
                      })
                    ]
                  }),
                  o.jsx(A3, {
                    style: {
                      top: He(64)
                    },
                    scrollRef: k,
                    anchorRef: x,
                    children: o.jsx(Oe, {
                      onClick: () => z.scrollToOffset(0),
                      variant: "Surface",
                      radii: "Pill",
                      outlined: true,
                      size: "300",
                      "aria-label": "Scroll to Top",
                      children: o.jsx(Q, {
                        src: q.ChevronTop,
                        size: "300"
                      })
                    })
                  }),
                  a && o.jsx(E, {
                    justifyContent: "Center",
                    children: o.jsx(dt, {})
                  }),
                  !a && !T && U.length === 0 && o.jsx(D, {
                    style: {
                      padding: ee.space.S300
                    },
                    align: "Center",
                    children: `No "${w.name}" Members`
                  }),
                  o.jsx(E, {
                    style: {
                      position: "relative",
                      height: z.getTotalSize()
                    },
                    direction: "Column",
                    gap: "100",
                    children: z.getVirtualItems().map((N) => {
                      const L = U[N.index];
                      if ("userId" in L) {
                        const H = bo(L.userId), V = _n(L.userId);
                        return o.jsx(Rs, {
                          virtualItem: N,
                          ref: z.measureElement,
                          children: o.jsx("div", {
                            style: {
                              paddingTop: ee.space.S200
                            },
                            children: o.jsx(Fst, {
                              "data-user-id": L.userId,
                              onClick: I,
                              "aria-pressed": (l == null ? void 0 : l.userId) === L.userId,
                              mx: e,
                              room: r,
                              member: L,
                              useAuthentication: n,
                              after: H && o.jsxs(E, {
                                as: "span",
                                shrink: "No",
                                alignSelf: "End",
                                direction: "Column",
                                children: [
                                  o.jsx(NX, {
                                    server: V ?? "",
                                    fill: "None",
                                    style: {
                                      alignSelf: "End"
                                    }
                                  }),
                                  o.jsx(NX, {
                                    server: H,
                                    fill: "None"
                                  })
                                ]
                              })
                            })
                          })
                        }, `${L.userId}-${N.index}`);
                      }
                      return o.jsx(Rs, {
                        virtualItem: N,
                        ref: z.measureElement,
                        children: o.jsx("div", {
                          style: {
                            paddingTop: N.index === 0 ? 0 : ee.space.S500
                          },
                          children: o.jsx(D, {
                            size: "L400",
                            children: L.name
                          })
                        })
                      }, N.index);
                    })
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function bst({ packs: t, roomId: e }) {
    const n = be(), r = Kr(), [i, a] = Et(p.useCallback(async (c, d) => {
      const u = {
        pack: {
          display_name: d
        }
      };
      await n.sendStateEvent(e, Pn.PoniesRoomEmotes, u, c);
    }, [
      n,
      e
    ])), s = i.status === ve.Loading, l = (c) => {
      var _a6;
      if (c.preventDefault(), s) return;
      const u = (_a6 = c.target) == null ? void 0 : _a6.nameInput;
      if (!u) return;
      const h = u == null ? void 0 : u.value.trim();
      if (!h) return;
      let f = h.replaceAll(/\s/g, "-");
      const g = (m) => t.some((v) => {
        var _a7;
        return ((_a7 = v.address) == null ? void 0 : _a7.stateKey) === m;
      });
      g(f) && (f = yR(f, g)), a(f, h).then(() => {
        r() && (u.value = "");
      });
    };
    return o.jsx(Te, {
      className: hi,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: o.jsx(Ie, {
        title: "New Pack",
        description: "Add your own emoji and sticker pack to use in room.",
        children: o.jsxs(E, {
          style: {
            marginTop: ee.space.S200
          },
          as: "form",
          onSubmit: l,
          gap: "200",
          alignItems: "End",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              grow: "Yes",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Name"
                }),
                o.jsx(mn, {
                  name: "nameInput",
                  required: true,
                  size: "400",
                  variant: "Secondary",
                  radii: "300",
                  readOnly: s
                }),
                i.status === ve.Error && o.jsx(D, {
                  style: {
                    color: ct.Critical.Main
                  },
                  size: "T300",
                  children: i.error.message
                })
              ]
            }),
            o.jsx(xe, {
              variant: "Success",
              radii: "300",
              type: "submit",
              disabled: s,
              before: s && o.jsx(dt, {
                size: "200",
                variant: "Success",
                fill: "Solid"
              }),
              children: o.jsx(D, {
                size: "B400",
                children: "Create"
              })
            })
          ]
        })
      })
    });
  }
  function xst({ onViewPack: t }) {
    const e = be(), n = hn(), r = cr(), i = Kr(), a = Mo(r), s = ri(r), c = Ki(s, a).stateEvent(Pn.PoniesRoomEmotes, e.getSafeUserId()), d = nMe(r), u = p.useMemo(() => d.filter((x) => !x.deleted), [
      d
    ]), [h, f] = p.useState([]), g = h.length > 0, [m, v] = Et(p.useCallback(async () => {
      for (let x = 0; x < h.length; x += 1) {
        const S = h[x];
        S && await e.sendStateEvent(r.roomId, Pn.PoniesRoomEmotes, {}, S.stateKey);
      }
    }, [
      e,
      r,
      h
    ])), y = m.status === ve.Loading, w = (x) => {
      f((S) => [
        ...S,
        x
      ]);
    }, b = (x) => {
      f((S) => S.filter((T) => !Ll(T, x)));
    }, j = () => f([]), k = () => {
      v().then(() => {
        i() && f([]);
      });
    }, C = (x) => {
      const S = x.getAvatarUrl(Hr.Emoticon), T = S ? Cn(e, S, n) : void 0, { address: A } = x;
      if (!A) return null;
      const B = h.some((U) => Ll(U, A));
      return o.jsx(Te, {
        className: hi,
        variant: B ? "Critical" : "SurfaceVariant",
        direction: "Column",
        gap: "400",
        children: o.jsx(Ie, {
          title: o.jsx("span", {
            style: {
              textDecoration: B ? "line-through" : void 0
            },
            children: x.meta.name ?? "Unknown"
          }),
          description: o.jsx("span", {
            className: KB,
            children: x.meta.attribution
          }),
          before: o.jsxs(E, {
            alignItems: "Center",
            gap: "300",
            children: [
              c && (B ? o.jsx(Oe, {
                size: "300",
                radii: "Pill",
                variant: "Critical",
                onClick: () => b(A),
                disabled: y,
                children: o.jsx(Q, {
                  src: q.Plus,
                  size: "100"
                })
              }) : o.jsx(Oe, {
                size: "300",
                radii: "Pill",
                variant: "Secondary",
                onClick: () => w(A),
                disabled: y,
                children: o.jsx(Q, {
                  src: q.Cross,
                  size: "100"
                })
              })),
              o.jsx(xn, {
                size: "300",
                radii: "300",
                children: T ? o.jsx(Xu, {
                  style: {
                    objectFit: "contain"
                  },
                  src: T
                }) : o.jsx(mp, {
                  children: o.jsx(Q, {
                    size: "400",
                    src: q.Sticker,
                    filled: true
                  })
                })
              })
            ]
          }),
          after: !B && o.jsx(xe, {
            variant: "Secondary",
            fill: "Soft",
            size: "300",
            radii: "300",
            outlined: true,
            onClick: () => t(x),
            children: o.jsx(D, {
              size: "B300",
              children: "View"
            })
          })
        })
      }, x.id);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Packs"
            }),
            c && o.jsx(bst, {
              roomId: r.roomId,
              packs: u
            }),
            u.map(C),
            u.length === 0 && o.jsx(Te, {
              className: hi,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsxs(E, {
                justifyContent: "Center",
                direction: "Column",
                gap: "200",
                style: {
                  padding: `${ee.space.S700} ${ee.space.S400}`,
                  maxWidth: He(300),
                  margin: "auto"
                },
                children: [
                  o.jsx(D, {
                    size: "H5",
                    align: "Center",
                    children: "No Packs"
                  }),
                  o.jsx(D, {
                    size: "T200",
                    align: "Center",
                    children: "There are no emoji or sticker packs to display at the moment."
                  })
                ]
              })
            })
          ]
        }),
        g && o.jsx(tn, {
          style: {
            position: "sticky",
            padding: ee.space.S200,
            paddingLeft: ee.space.S400,
            bottom: ee.space.S400,
            left: ee.space.S400,
            right: 0,
            zIndex: 1
          },
          variant: "Critical",
          children: o.jsxs(E, {
            alignItems: "Center",
            gap: "400",
            children: [
              o.jsx(E, {
                grow: "Yes",
                direction: "Column",
                children: m.status === ve.Error ? o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Failed to remove packs! Please try again."
                  })
                }) : o.jsx(D, {
                  size: "T200",
                  children: o.jsxs("b", {
                    children: [
                      "Delete selected packs. (",
                      h.length,
                      " selected)"
                    ]
                  })
                })
              }),
              o.jsxs(E, {
                shrink: "No",
                gap: "200",
                children: [
                  o.jsx(xe, {
                    size: "300",
                    variant: "Critical",
                    fill: "None",
                    radii: "300",
                    disabled: y,
                    onClick: j,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Cancel"
                    })
                  }),
                  o.jsx(xe, {
                    size: "300",
                    variant: "Critical",
                    radii: "300",
                    disabled: y,
                    before: y && o.jsx(dt, {
                      variant: "Critical",
                      fill: "Solid",
                      size: "100"
                    }),
                    onClick: k,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Delete"
                    })
                  })
                ]
              })
            ]
          })
        })
      ]
    });
  }
  function Ame({ requestClose: t }) {
    const [e, n] = p.useState(), r = () => {
      n(void 0);
    };
    return e ? o.jsx(Fde, {
      address: e.address,
      requestClose: r
    }) : o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Emojis & Stickers"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "700",
                children: o.jsx(xst, {
                  onViewPack: n
                })
              })
            })
          })
        })
      ]
    });
  }
  const wst = (t) => {
    const e = p.useCallback(() => {
      const i = t.getLiveTimeline().getState(Tn.Forward), a = /* @__PURE__ */ new Map();
      return i && i.events.forEach((s, l) => {
        if (l === ce.RoomMember) return;
        const c = /* @__PURE__ */ new Map();
        s.forEach((d, u) => c.set(u, d)), a.set(l, c);
      }), a;
    }, [
      t
    ]), [n, r] = p.useState(e);
    return p.useEffect(() => {
      const i = t.getLiveTimeline().getState(Tn.Forward), a = () => {
        r(e());
      };
      return i == null ? void 0 : i.on(qn.Events, a), () => {
        i == null ? void 0 : i.removeListener(qn.Events, a);
      };
    }, [
      t,
      e
    ]), n;
  }, Dst = (t) => {
    const e = p.useCallback(() => {
      const i = /* @__PURE__ */ new Map();
      return Array.from(t.accountData.entries()).forEach(([a, s]) => {
        const l = s.getContent();
        i.set(a, l);
      }), i;
    }, [
      t
    ]), [n, r] = p.useState(e);
    return p.useEffect(() => {
      const i = () => {
        r(e());
      };
      return t.on(mt.AccountData, i), () => {
        t.removeListener(mt.AccountData, i);
      };
    }, [
      t,
      e
    ]), n;
  }, $T = vn([]), cv = vn((t) => t($T), (t, e, n) => {
    if (n.type === "INITIALIZE") {
      e($T, n.rooms);
      return;
    }
    e($T, (r) => {
      const i = r.filter((a) => a !== n.roomId);
      return n.type === "PUT" && i.push(n.roomId), i;
    });
  }), Cst = (t, e) => {
    sse(t, e, p.useMemo(() => [
      Ht.Invite
    ], []));
  }, Est = 2;
  function kst({ type: t, stateKey: e, requestClose: n }) {
    const r = be(), i = cr(), a = Kr(), s = typeof e == "string", l = p.useRef(null), [c, d] = p.useState(), { handleKeyDown: u, operations: h, getTarget: f } = AM(l, Est), [g, m] = Et(p.useCallback((w, b, j) => typeof b == "string" ? r.sendStateEvent(i.roomId, w, j, b) : r.sendEvent(i.roomId, w, j), [
      r,
      i
    ])), v = g.status === ve.Loading, y = (w) => {
      if (w.preventDefault(), v) return;
      const b = w.target, j = b == null ? void 0 : b.typeInput, k = b == null ? void 0 : b.stateKeyInput, C = b == null ? void 0 : b.contentTextArea;
      if (!j || !C) return;
      const x = j.value, S = k == null ? void 0 : k.value, T = C.value.trim();
      let A;
      try {
        A = JSON.parse(T);
      } catch (B) {
        d(B);
        return;
      }
      d(void 0), A !== null && m(x, S, A).then(() => {
        a() && n();
      });
    };
    return p.useEffect(() => {
      var _a6;
      if (c) {
        const w = aP(c) ?? 0, b = new Qi(w, w, "none");
        h.select(b), (_a6 = f()) == null ? void 0 : _a6.focus();
      }
    }, [
      c,
      h,
      f
    ]), o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          balance: true,
          children: o.jsxs(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                alignItems: "Inherit",
                grow: "Yes",
                gap: "200",
                children: o.jsx(Qe, {
                  size: "500",
                  radii: "Pill",
                  onClick: n,
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowLeft
                  }),
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Developer Tools"
                  })
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: n,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsxs(E, {
            as: "form",
            onSubmit: y,
            grow: "Yes",
            style: {
              padding: ee.space.S400
            },
            direction: "Column",
            gap: "400",
            "aria-disabled": v,
            children: [
              o.jsxs(E, {
                shrink: "No",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: s ? "State Event Type" : "Message Event Type"
                  }),
                  o.jsxs(E, {
                    gap: "300",
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        direction: "Column",
                        children: o.jsx(mn, {
                          variant: "Background",
                          name: "typeInput",
                          size: "400",
                          radii: "300",
                          readOnly: v,
                          defaultValue: t,
                          required: true
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Success",
                        size: "400",
                        radii: "300",
                        type: "submit",
                        disabled: v,
                        before: v && o.jsx(dt, {
                          variant: "Primary",
                          fill: "Solid",
                          size: "300"
                        }),
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Send"
                        })
                      })
                    ]
                  }),
                  g.status === ve.Error && o.jsx(D, {
                    size: "T200",
                    style: {
                      color: ct.Critical.Main
                    },
                    children: o.jsx("b", {
                      children: g.error.message
                    })
                  })
                ]
              }),
              s && o.jsxs(E, {
                shrink: "No",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "State Key (Optional)"
                  }),
                  o.jsx(mn, {
                    variant: "Background",
                    name: "stateKeyInput",
                    size: "400",
                    radii: "300",
                    readOnly: v,
                    defaultValue: e
                  })
                ]
              }),
              o.jsxs(E, {
                grow: "Yes",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(E, {
                    shrink: "No",
                    children: o.jsx(D, {
                      size: "L400",
                      children: "JSON Content"
                    })
                  }),
                  o.jsx(js, {
                    ref: l,
                    name: "contentTextArea",
                    style: {
                      fontFamily: "var(--font-monospace)"
                    },
                    onKeyDown: u,
                    resize: "None",
                    spellCheck: "false",
                    required: true,
                    readOnly: v
                  }),
                  c && o.jsx(D, {
                    size: "T200",
                    style: {
                      color: ct.Critical.Main
                    },
                    children: o.jsxs("b", {
                      children: [
                        c.name,
                        ": ",
                        c.message
                      ]
                    })
                  })
                ]
              })
            ]
          })
        })
      ]
    });
  }
  const pC = 2;
  function Sst({ type: t, stateKey: e, content: n, requestClose: r }) {
    const i = be(), a = cr(), s = Kr(), l = p.useMemo(() => JSON.stringify(n, void 0, pC), [
      n
    ]), c = p.useRef(null), [d, u] = p.useState(), { handleKeyDown: h, operations: f, getTarget: g } = AM(c, pC), [m, v] = Et(p.useCallback((b) => i.sendStateEvent(a.roomId, t, b, e), [
      i,
      a,
      t,
      e
    ])), y = m.status === ve.Loading, w = (b) => {
      var _a6;
      if (b.preventDefault(), y) return;
      const k = (_a6 = b.target) == null ? void 0 : _a6.contentTextArea;
      if (!k) return;
      const C = k.value.trim();
      let x;
      try {
        x = JSON.parse(C);
      } catch (S) {
        u(S);
        return;
      }
      u(void 0), !(x === null || l === JSON.stringify(x, null, pC)) && v(x).then(() => {
        s() && r();
      });
    };
    return p.useEffect(() => {
      var _a6;
      if (d) {
        const b = aP(d) ?? 0, j = new Qi(b, b, "none");
        f.select(j), (_a6 = g()) == null ? void 0 : _a6.focus();
      }
    }, [
      d,
      f,
      g
    ]), o.jsxs(E, {
      as: "form",
      onSubmit: w,
      grow: "Yes",
      style: {
        padding: ee.space.S400
      },
      direction: "Column",
      gap: "400",
      "aria-disabled": y,
      children: [
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "State Event"
            }),
            o.jsx(Te, {
              className: hi,
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "400",
              children: o.jsx(Ie, {
                title: t,
                description: e,
                after: o.jsxs(E, {
                  gap: "200",
                  children: [
                    o.jsx(xe, {
                      variant: "Success",
                      size: "300",
                      radii: "300",
                      type: "submit",
                      disabled: y,
                      before: y && o.jsx(dt, {
                        variant: "Primary",
                        fill: "Solid",
                        size: "300"
                      }),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Save"
                      })
                    }),
                    o.jsx(xe, {
                      variant: "Secondary",
                      fill: "Soft",
                      size: "300",
                      radii: "300",
                      onClick: r,
                      disabled: y,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Cancel"
                      })
                    })
                  ]
                })
              })
            }),
            m.status === ve.Error && o.jsx(D, {
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: m.error.message
              })
            })
          ]
        }),
        o.jsxs(E, {
          grow: "Yes",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(E, {
              shrink: "No",
              children: o.jsx(D, {
                size: "L400",
                children: "JSON Content"
              })
            }),
            o.jsx(js, {
              ref: c,
              name: "contentTextArea",
              style: {
                fontFamily: "var(--font-monospace)"
              },
              onKeyDown: h,
              defaultValue: l,
              resize: "None",
              spellCheck: "false",
              required: true,
              readOnly: y
            }),
            d && o.jsx(D, {
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsxs("b", {
                children: [
                  d.name,
                  ": ",
                  d.message
                ]
              })
            })
          ]
        })
      ]
    });
  }
  function jst({ content: t, eventJSONStr: e, onEditContent: n }) {
    return o.jsx(E, {
      direction: "Column",
      style: {
        padding: ee.space.S400
      },
      gap: "400",
      children: o.jsxs(E, {
        grow: "Yes",
        direction: "Column",
        gap: "100",
        children: [
          o.jsxs(E, {
            gap: "200",
            alignItems: "End",
            children: [
              o.jsx(E, {
                grow: "Yes",
                children: o.jsx(D, {
                  size: "L400",
                  children: "State Event"
                })
              }),
              n && o.jsx(E, {
                shrink: "No",
                gap: "200",
                children: o.jsx(Qe, {
                  variant: "Secondary",
                  fill: "Soft",
                  radii: "300",
                  outlined: true,
                  onClick: () => n(t),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Edit"
                  })
                })
              })
            ]
          }),
          o.jsx(Te, {
            variant: "SurfaceVariant",
            children: o.jsx(dn, {
              visibility: "Always",
              size: "300",
              hideTrack: true,
              children: o.jsx(gS, {
                size: "T300",
                style: {
                  padding: `${ee.space.S300} ${ee.space.S100} ${ee.space.S300} ${ee.space.S300}`
                },
                text: e,
                langName: "JSON"
              })
            })
          })
        ]
      })
    });
  }
  function Tst({ type: t, stateKey: e, requestClose: n }) {
    const r = be(), i = cr(), a = $i(i, t, e), [s, l] = p.useState(), c = Mo(i), d = ri(i), h = Ki(d, c).stateEvent(t, r.getSafeUserId()), f = p.useMemo(() => a ? JSON.stringify(a.event, null, pC) : "", [
      a
    ]), g = p.useCallback(() => {
      l(void 0);
    }, []);
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          balance: true,
          children: o.jsxs(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                alignItems: "Inherit",
                grow: "Yes",
                gap: "200",
                children: o.jsx(Qe, {
                  size: "500",
                  radii: "Pill",
                  onClick: n,
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowLeft
                  }),
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Developer Tools"
                  })
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: n,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: s ? o.jsx(Sst, {
            type: t,
            stateKey: e,
            content: s,
            requestClose: g
          }) : o.jsx(jst, {
            content: (a == null ? void 0 : a.getContent()) ?? {},
            onEditContent: h ? l : void 0,
            eventJSONStr: f
          })
        })
      ]
    });
  }
  const Rst = (t) => t === "sliding_active" ? "Sliding Sync active" : t === "sliding_disabled_server" ? "Server-side sliding sync disabled" : t === "session_opt_out" ? "Session opt-in is off" : t === "missing_proxy" ? "Sliding proxy URL missing" : t === "cold_cache_bootstrap" ? "Cold-cache bootstrap (classic for this run)" : t === "probe_failed_fallback" ? "Sliding probe failed, using fallback" : t;
  function Ime({ requestClose: t }) {
    const [e, n] = Fe(ge, "developerTools"), r = be(), i = cr(), a = wst(i), s = Dst(i), [l, c] = p.useState(false), [d, u] = p.useState(false), [h, f] = p.useState(false), [g, m] = p.useState(), [v, y] = p.useState(), [w, b] = p.useState(), [j, k] = p.useState(false), [C, x] = p.useState(), S = Ze(qi), T = Ze(zr), A = Ze(cv), [, B] = p.useState(0);
    p.useEffect(() => {
      const I = window.setInterval(() => B((N) => N + 1), 1e3);
      return () => window.clearInterval(I);
    }, []);
    const U = p.useMemo(() => {
      var _a6, _b3, _c3, _d4, _e13;
      const I = r.getUserId(), N = r.getSyncState(), L = i.getLiveTimeline().getEvents(), V = ((_a6 = L[L.length - 1]) == null ? void 0 : _a6.getId()) ?? null, Y = ((_b3 = [
        ...L
      ].toReversed().find((K) => {
        const G = K.getType();
        return G === "m.room.message" || G === "m.room.encrypted" || G === "m.sticker";
      })) == null ? void 0 : _b3.getId()) ?? null, ue = ((_c3 = [
        ...L
      ].toReversed().find((K) => Vu(K))) == null ? void 0 : _c3.getId()) ?? null, ie = ((_e13 = (_d4 = i.getAccountData(ce.FullyRead)) == null ? void 0 : _d4.getContent()) == null ? void 0 : _e13.event_id) ?? null, de = I ? i.getEventReadUpTo(I) ?? null : null, ne = i.getUnreadNotificationCount(ir.Total), ae = i.getUnreadNotificationCount(ir.Highlight), X = S.get(i.roomId);
      return {
        roomId: i.roomId,
        userId: I ?? null,
        clientSyncState: N,
        roomMembership: i.getMyMembership(),
        roomInJoinedListAtom: T.includes(i.roomId),
        roomInInviteListAtom: A.includes(i.roomId),
        timelineSize: L.length,
        latestTimelineEventId: V,
        latestMessageEventId: Y,
        latestNotificationEventId: ue,
        fullyReadEventId: ie,
        readUpToEventId: de,
        hasReadLatestLive: !!(I && V && i.hasUserReadEvent(I, V)),
        hasReadLatestNotification: !!(I && ue && i.hasUserReadEvent(I, ue)),
        sdkUnread: {
          total: ne,
          highlight: ae
        },
        atomUnread: X ? {
          total: X.total,
          highlight: X.highlight
        } : null
      };
    }, [
      r,
      i,
      S,
      T,
      A
    ]), z = $B(r), O = p.useCallback(() => {
      y(void 0), b(void 0), x(void 0);
    }, []), M = p.useCallback(async (I, N) => {
      await r.setRoomAccountData(i.roomId, I, N);
    }, [
      r,
      i.roomId
    ]);
    return C !== void 0 ? o.jsx(Hce, {
      type: C ?? void 0,
      content: C ? s.get(C) : void 0,
      submitChange: M,
      requestClose: O
    }) : w ? o.jsx(kst, {
      ...w,
      requestClose: O
    }) : v ? o.jsx(Tst, {
      ...v,
      requestClose: O
    }) : o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Developer Tools"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Options"
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: "Enable Developer Tools",
                          after: o.jsx(Jt, {
                            variant: "Primary",
                            value: e,
                            onChange: n
                          })
                        })
                      }),
                      e && o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: "Room ID",
                          description: `Copy room ID to clipboard. ("${i.roomId}")`,
                          after: o.jsx(xe, {
                            onClick: () => Jo(i.roomId ?? "<NO_ROOM_ID_FOUND>"),
                            variant: "Secondary",
                            fill: "Soft",
                            size: "300",
                            radii: "300",
                            outlined: true,
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Copy"
                            })
                          })
                        })
                      })
                    ]
                  }),
                  e && o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Data"
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: "New Message Event",
                          description: "Create and send a new message event within the room.",
                          after: o.jsx(xe, {
                            onClick: () => b({}),
                            variant: "Secondary",
                            fill: "Soft",
                            size: "300",
                            radii: "300",
                            outlined: true,
                            children: o.jsx(D, {
                              size: "B300",
                              children: "Compose"
                            })
                          })
                        })
                      }),
                      o.jsxs(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: [
                          o.jsx(Ie, {
                            title: "Room State",
                            description: "State events of the room.",
                            after: o.jsx(xe, {
                              onClick: () => c(!l),
                              variant: "Secondary",
                              fill: "Soft",
                              size: "300",
                              radii: "300",
                              outlined: true,
                              before: o.jsx(Q, {
                                src: l ? q.ChevronTop : q.ChevronBottom,
                                size: "100",
                                filled: true
                              }),
                              children: o.jsx(D, {
                                size: "B300",
                                children: l ? "Collapse" : "Expand"
                              })
                            })
                          }),
                          l && o.jsxs(E, {
                            direction: "Column",
                            gap: "100",
                            children: [
                              o.jsxs(E, {
                                direction: "Column",
                                gap: "100",
                                style: {
                                  paddingInline: ee.space.S400,
                                  paddingBottom: ee.space.S300
                                },
                                children: [
                                  o.jsxs(E, {
                                    direction: "Column",
                                    gap: "100",
                                    children: [
                                      o.jsxs(E, {
                                        justifyContent: "SpaceBetween",
                                        alignItems: "Center",
                                        children: [
                                          o.jsx(D, {
                                            size: "L400",
                                            children: "Unread Diagnostics"
                                          }),
                                          o.jsx(xe, {
                                            onClick: () => u(!d),
                                            variant: "Secondary",
                                            fill: "Soft",
                                            size: "300",
                                            radii: "300",
                                            outlined: true,
                                            before: o.jsx(Q, {
                                              src: d ? q.ChevronTop : q.ChevronBottom,
                                              size: "100",
                                              filled: true
                                            }),
                                            children: o.jsx(D, {
                                              size: "B300",
                                              children: d ? "Collapse" : "Expand"
                                            })
                                          })
                                        ]
                                      }),
                                      d && o.jsxs(E, {
                                        direction: "Column",
                                        gap: "100",
                                        children: [
                                          o.jsx(xe, {
                                            onClick: () => Jo(JSON.stringify(U, null, 2)),
                                            variant: "Secondary",
                                            fill: "Soft",
                                            size: "300",
                                            radii: "300",
                                            outlined: true,
                                            children: o.jsx(D, {
                                              size: "B300",
                                              children: "Copy JSON"
                                            })
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Client sync: ",
                                              U.clientSyncState ?? "null",
                                              " | membership: ",
                                              U.roomMembership
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "In room atoms: joined",
                                              " ",
                                              U.roomInJoinedListAtom ? "yes" : "no",
                                              " | invite",
                                              " ",
                                              U.roomInInviteListAtom ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "`readUpTo`: ",
                                              U.readUpToEventId ?? "null"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "`m.fully_read`: ",
                                              U.fullyReadEventId ?? "null"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Latest timeline event:",
                                              " ",
                                              U.latestTimelineEventId ?? "null",
                                              " | read?",
                                              " ",
                                              U.hasReadLatestLive ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Latest message event:",
                                              " ",
                                              U.latestMessageEventId ?? "null"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Latest notification:",
                                              " ",
                                              U.latestNotificationEventId ?? "null",
                                              " | read?",
                                              " ",
                                              U.hasReadLatestNotification ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "SDK unread: ",
                                              U.sdkUnread.total,
                                              " total /",
                                              " ",
                                              U.sdkUnread.highlight,
                                              " highlight"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Atom unread:",
                                              " ",
                                              U.atomUnread ? `${U.atomUnread.total} total / ${U.atomUnread.highlight} highlight` : "none"
                                            ]
                                          })
                                        ]
                                      })
                                    ]
                                  }),
                                  o.jsxs(E, {
                                    direction: "Column",
                                    gap: "100",
                                    children: [
                                      o.jsxs(E, {
                                        justifyContent: "SpaceBetween",
                                        alignItems: "Center",
                                        children: [
                                          o.jsx(D, {
                                            size: "L400",
                                            children: "Sliding Sync Diagnostics"
                                          }),
                                          o.jsx(xe, {
                                            onClick: () => f(!h),
                                            variant: "Secondary",
                                            fill: "Soft",
                                            size: "300",
                                            radii: "300",
                                            outlined: true,
                                            before: o.jsx(Q, {
                                              src: h ? q.ChevronTop : q.ChevronBottom,
                                              size: "100",
                                              filled: true
                                            }),
                                            children: o.jsx(D, {
                                              size: "B300",
                                              children: h ? "Collapse" : "Expand"
                                            })
                                          })
                                        ]
                                      }),
                                      h && o.jsxs(E, {
                                        direction: "Column",
                                        gap: "100",
                                        children: [
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Transport: ",
                                              z.transport,
                                              z.fallbackFromSliding ? " (fallback)" : ""
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Sliding configured:",
                                              " ",
                                              z.slidingConfigured ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Sliding server-enabled:",
                                              " ",
                                              z.slidingEnabledOnServer ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Sliding session opt-in:",
                                              " ",
                                              z.sessionOptIn ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Sliding requested:",
                                              " ",
                                              z.slidingRequested ? "yes" : "no"
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Sync reason: ",
                                              Rst(z.reason)
                                            ]
                                          }),
                                          o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Client sync state: ",
                                              z.syncState ?? "null"
                                            ]
                                          }),
                                          z.sliding ? o.jsxs(o.Fragment, {
                                            children: [
                                              o.jsxs(D, {
                                                size: "T200",
                                                children: [
                                                  "Proxy: ",
                                                  z.sliding.proxyBaseUrl
                                                ]
                                              }),
                                              o.jsxs(D, {
                                                size: "T200",
                                                children: [
                                                  "Room timeline: ",
                                                  z.sliding.timelineLimit,
                                                  " | page size: ",
                                                  z.sliding.listPageSize
                                                ]
                                              })
                                            ]
                                          }) : o.jsx(D, {
                                            size: "T200",
                                            children: "Sliding manager: not attached"
                                          })
                                        ]
                                      })
                                    ]
                                  })
                                ]
                              }),
                              o.jsxs(E, {
                                justifyContent: "SpaceBetween",
                                children: [
                                  o.jsx(D, {
                                    size: "L400",
                                    children: "Events"
                                  }),
                                  o.jsxs(D, {
                                    size: "L400",
                                    children: [
                                      "Total: ",
                                      a.size
                                    ]
                                  })
                                ]
                              }),
                              o.jsxs(Gc, {
                                children: [
                                  o.jsx(Ye, {
                                    onClick: () => b({
                                      stateKey: ""
                                    }),
                                    variant: "Surface",
                                    fill: "None",
                                    size: "300",
                                    radii: "0",
                                    before: o.jsx(Q, {
                                      size: "50",
                                      src: q.Plus
                                    }),
                                    children: o.jsx(E, {
                                      grow: "Yes",
                                      children: o.jsx(D, {
                                        size: "T200",
                                        truncate: true,
                                        children: "Add New"
                                      })
                                    })
                                  }),
                                  Array.from(a.keys()).toSorted().map((I) => {
                                    const N = I === g, L = a.get(I);
                                    return L ? o.jsxs(E, {
                                      id: I,
                                      direction: "Column",
                                      gap: "100",
                                      children: [
                                        o.jsx(Ye, {
                                          onClick: () => m(N ? void 0 : I),
                                          variant: "Surface",
                                          fill: "None",
                                          size: "300",
                                          radii: "0",
                                          before: o.jsx(Q, {
                                            size: "50",
                                            src: N ? q.ChevronBottom : q.ChevronRight
                                          }),
                                          after: o.jsx(D, {
                                            size: "L400",
                                            children: L.size
                                          }),
                                          children: o.jsx(E, {
                                            grow: "Yes",
                                            children: o.jsx(D, {
                                              size: "T200",
                                              truncate: true,
                                              children: I
                                            })
                                          })
                                        }),
                                        N && o.jsxs("div", {
                                          style: {
                                            marginLeft: ee.space.S400,
                                            borderLeft: `${ee.borderWidth.B300} solid ${ct.Surface.ContainerLine}`
                                          },
                                          children: [
                                            o.jsx(Ye, {
                                              onClick: () => b({
                                                type: I,
                                                stateKey: ""
                                              }),
                                              variant: "Surface",
                                              fill: "None",
                                              size: "300",
                                              radii: "0",
                                              before: o.jsx(Q, {
                                                size: "50",
                                                src: q.Plus
                                              }),
                                              children: o.jsx(E, {
                                                grow: "Yes",
                                                children: o.jsx(D, {
                                                  size: "T200",
                                                  truncate: true,
                                                  children: "Add New"
                                                })
                                              })
                                            }),
                                            Array.from(L.keys()).toSorted().map((H) => o.jsx(Ye, {
                                              onClick: () => {
                                                y({
                                                  type: I,
                                                  stateKey: H
                                                });
                                              },
                                              variant: "Surface",
                                              fill: "None",
                                              size: "300",
                                              radii: "0",
                                              after: o.jsx(Q, {
                                                size: "50",
                                                src: q.ChevronRight
                                              }),
                                              children: o.jsx(E, {
                                                grow: "Yes",
                                                children: o.jsx(D, {
                                                  size: "T200",
                                                  truncate: true,
                                                  children: H ? `"${H}"` : "Default"
                                                })
                                              })
                                            }, H))
                                          ]
                                        })
                                      ]
                                    }, I) : null;
                                  })
                                ]
                              })
                            ]
                          })
                        ]
                      }),
                      o.jsxs(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: [
                          o.jsx(Ie, {
                            title: "Account Data",
                            description: "Private personalization data stored within room.",
                            after: o.jsx(xe, {
                              onClick: () => k(!j),
                              variant: "Secondary",
                              fill: "Soft",
                              size: "300",
                              radii: "300",
                              outlined: true,
                              before: o.jsx(Q, {
                                src: j ? q.ChevronTop : q.ChevronBottom,
                                size: "100",
                                filled: true
                              }),
                              children: o.jsx(D, {
                                size: "B300",
                                children: j ? "Collapse" : "Expand"
                              })
                            })
                          }),
                          j && o.jsxs(E, {
                            direction: "Column",
                            gap: "100",
                            children: [
                              o.jsxs(E, {
                                justifyContent: "SpaceBetween",
                                children: [
                                  o.jsx(D, {
                                    size: "L400",
                                    children: "Events"
                                  }),
                                  o.jsxs(D, {
                                    size: "L400",
                                    children: [
                                      "Total: ",
                                      s.size
                                    ]
                                  })
                                ]
                              }),
                              o.jsxs(Gc, {
                                children: [
                                  o.jsx(Ye, {
                                    variant: "Surface",
                                    fill: "None",
                                    size: "300",
                                    radii: "0",
                                    before: o.jsx(Q, {
                                      size: "50",
                                      src: q.Plus
                                    }),
                                    onClick: () => x(null),
                                    children: o.jsx(E, {
                                      grow: "Yes",
                                      children: o.jsx(D, {
                                        size: "T200",
                                        truncate: true,
                                        children: "Add New"
                                      })
                                    })
                                  }),
                                  Array.from(s.keys()).toSorted().map((I) => o.jsx(Ye, {
                                    variant: "Surface",
                                    fill: "None",
                                    size: "300",
                                    radii: "0",
                                    after: o.jsx(Q, {
                                      size: "50",
                                      src: q.ChevronRight
                                    }),
                                    onClick: () => x(I),
                                    children: o.jsx(E, {
                                      grow: "Yes",
                                      children: o.jsx(D, {
                                        size: "T200",
                                        truncate: true,
                                        children: I
                                      })
                                    })
                                  }, I))
                                ]
                              })
                            ]
                          })
                        ]
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const Ast = Po("Cosmetics");
  function Ist({ profile: t, member: e, userId: n, room: r }) {
    var _a6, _b3;
    const i = be(), a = hn(), s = XF(), [l, c] = p.useState(false), d = ((_a6 = s["m.set_avatar_url"]) == null ? void 0 : _a6.enabled) === false, u = $i(r, ce.RoomMember, n), h = u == null ? void 0 : u.getContent(), f = ((_b3 = i.getUser(n)) == null ? void 0 : _b3.avatarUrl) ?? t.avatarUrl, m = (u ? h == null ? void 0 : h.avatar_url : e.getMxcAvatarUrl()) ?? f, v = u !== void 0 && (h == null ? void 0 : h.avatar_url) !== void 0 && h.avatar_url !== f, y = m && (Cn(i, m, a, 96, 96, "crop") ?? void 0), [w, b] = p.useState(), j = Xl(w), k = p.useMemo(() => {
      if (w) return Yd(w);
    }, [
      w
    ]), C = ed(b, false), x = p.useCallback(() => {
      b(void 0);
    }, []), S = ov(i, r)[Na.MyRoomAvatar], T = p.useCallback((B) => {
      const { mxc: U } = B;
      S.exe(U).finally(() => {
        x();
      });
    }, [
      S,
      x
    ]), A = () => {
      S.exe("").finally(() => {
        c(false);
      });
    };
    return o.jsxs(Ie, {
      title: "Room Avatar",
      after: o.jsx(xn, {
        size: "500",
        radii: "300",
        children: o.jsx(Si, {
          userId: n,
          src: y,
          renderFallback: () => o.jsx(D, {
            size: "H4",
            children: Vi(r.getMember(n).rawDisplayName)
          })
        })
      }),
      children: [
        k ? o.jsx(E, {
          gap: "200",
          direction: "Column",
          children: o.jsx(xh, {
            uploadAtom: k,
            onRemove: x,
            onComplete: T
          })
        }) : o.jsxs(E, {
          gap: "200",
          children: [
            o.jsx(xe, {
              onClick: () => C("image/*"),
              size: "300",
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              radii: "300",
              disabled: d,
              children: o.jsx(D, {
                size: "B300",
                children: "Upload"
              })
            }),
            v && o.jsx(xe, {
              size: "300",
              variant: "Critical",
              fill: "None",
              radii: "300",
              disabled: d,
              onClick: () => c(true),
              children: o.jsx(D, {
                size: "B300",
                children: "Remove"
              })
            })
          ]
        }),
        j && o.jsx(Hn, {
          open: false,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: x,
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                className: OF,
                variant: "Surface",
                size: "500",
                children: o.jsx(eoe, {
                  name: (w == null ? void 0 : w.name) ?? "Unnamed",
                  url: j,
                  requestClose: x
                })
              })
            })
          })
        }),
        o.jsx(Hn, {
          open: l,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => c(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsxs(lr, {
                variant: "Surface",
                children: [
                  o.jsxs(wn, {
                    style: {
                      padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                      borderBottomWidth: ee.borderWidth.B300
                    },
                    variant: "Surface",
                    size: "500",
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: "Remove Room Avatar"
                        })
                      }),
                      o.jsx(Oe, {
                        size: "300",
                        onClick: () => c(false),
                        radii: "300",
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    style: {
                      padding: ee.space.S400
                    },
                    direction: "Column",
                    gap: "400",
                    children: [
                      o.jsx(E, {
                        direction: "Column",
                        gap: "200",
                        children: o.jsx(D, {
                          priority: "400",
                          children: "Are you sure you want to remove room avatar?"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Critical",
                        onClick: A,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Remove"
                        })
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function Bst({ profile: t, member: e, userId: n, room: r }) {
    const i = be(), a = e.rawDisplayName, [s, l] = p.useState(a), c = s !== a, d = ov(i, r)[Na.MyRoomNick], [u, h] = Et((y) => d.exe(y)), f = u.status === ve.Loading;
    p.useEffect(() => {
      l(a);
    }, [
      a
    ]);
    const g = (y) => {
      const w = y.currentTarget.value;
      l(w);
    }, m = () => {
      l(c ? a : t.displayName ?? _n(n) ?? n);
    }, v = (y) => {
      var _a6, _b3;
      if (y.preventDefault(), f) return;
      const j = (_b3 = (_a6 = y.target) == null ? void 0 : _a6.displayNameInput) == null ? void 0 : _b3.value;
      h(j ?? "");
    };
    return o.jsx(Ie, {
      title: "Room Display Name",
      children: o.jsx(E, {
        direction: "Column",
        grow: "Yes",
        gap: "100",
        children: o.jsxs(E, {
          as: "form",
          onSubmit: v,
          gap: "200",
          children: [
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(mn, {
                name: "displayNameInput",
                value: s,
                onChange: g,
                variant: "Secondary",
                radii: "300",
                style: {
                  paddingRight: ee.space.S200
                },
                readOnly: f,
                after: s !== (t.displayName ?? _n(n) ?? n) && !f && o.jsx(Oe, {
                  type: "reset",
                  onClick: m,
                  size: "300",
                  radii: "300",
                  variant: "Secondary",
                  children: o.jsx(Q, {
                    src: q.Cross,
                    size: "100"
                  })
                })
              })
            }),
            o.jsxs(xe, {
              size: "400",
              variant: c ? "Success" : "Secondary",
              fill: c ? "Solid" : "Soft",
              outlined: true,
              radii: "300",
              disabled: !c || f,
              type: "submit",
              children: [
                f && o.jsx(dt, {
                  variant: "Success",
                  fill: "Solid",
                  size: "300"
                }),
                o.jsx(D, {
                  size: "B400",
                  children: "Save"
                })
              ]
            })
          ]
        })
      })
    });
  }
  function Pst({ room: t, isSpace: e, font: n, disabled: r }) {
    const i = be(), a = (/^"?(.*?)"?, var\(--font-secondary\)$/.exec(n ?? "") ?? [
      ""
    ])[1] ?? "", [s, l] = p.useState(a);
    p.useEffect(() => l(a), [
      a
    ]);
    const c = ov(i, t)[e ? Na.SFont : Na.Font], d = () => {
      s !== a && c.exe(s);
    }, u = (h) => {
      l(h.currentTarget.value);
    };
    return o.jsx(Ie, {
      title: e ? "Space Font" : "Room Font",
      description: "Use a custom font to render your display name",
      after: o.jsx(mn, {
        value: s,
        size: "300",
        radii: "300",
        disabled: r,
        variant: "Secondary",
        placeholder: "Comic Sans",
        onChange: u,
        onBlur: d,
        onKeyDown: (h) => h.key === "Enter" && d(),
        style: {
          width: "232px"
        }
      })
    });
  }
  function Bme({ requestClose: t }) {
    const e = be(), n = e.getUserId(), r = Hc(n), i = cr(), a = Hc(n, i), s = ri(i), l = i.getMember(n), c = Mo(i), d = i.isSpaceRoom(), h = Ki(s, c).stateEvent(ce.RoomPowerLevels, e.getSafeUserId()), f = ov(e, i), g = (b) => {
      var _a6;
      return ((_a6 = c.events ?? {}) == null ? void 0 : _a6[b]) ?? 50;
    }, m = g(Pn.RoomCosmeticsColor) === 0, v = g(Pn.RoomCosmeticsPronouns) === 0, y = g(Pn.RoomCosmeticsFont) === 0, w = p.useCallback(async (b, j) => {
      const k = j ? 0 : 50, C = {
        ...c,
        events: {
          ...c.events,
          [b]: k
        }
      };
      try {
        await e.sendStateEvent(i.roomId, ce.RoomPowerLevels, C, "");
      } catch (x) {
        Ast.error(`Failed to update permissions for ${b}:`, x);
      }
    }, [
      e,
      i.roomId,
      c
    ]);
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Cosmetics"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Profile"
                      }),
                      !d && o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ist, {
                          profile: r,
                          member: l,
                          userId: n,
                          room: i
                        })
                      }),
                      !d && o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Bst, {
                          profile: r,
                          member: l,
                          userId: n,
                          room: i
                        })
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(yy, {
                          title: d ? "Space Name Color" : "Room Name Color",
                          current: a.resolvedColor,
                          disabled: !(m || h),
                          onSave: (b) => f[d ? Na.SColor : Na.Color].exe(b ?? "clear")
                        })
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(wce, {
                          title: d ? "Space Pronouns" : "Room Pronouns",
                          current: a.resolvedPronouns,
                          disabled: !(v || h),
                          onSave: (b) => f[d ? Na.SPronoun : Na.Pronoun].exe(b.map(({ language: j, summary: k }) => j ? `${j}:${k}` : k).join())
                        })
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Pst, {
                          room: i,
                          isSpace: d,
                          font: a.resolvedFont,
                          disabled: !(y || h)
                        })
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Settings"
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: d ? "Space-Wide Colors" : "Room Colors",
                          description: `Allow everyone to set a color that applies in ${d ? "all the space's rooms" : "this room"}.`,
                          after: o.jsx(Jt, {
                            variant: "Primary",
                            value: m,
                            onChange: (b) => w(Pn.RoomCosmeticsColor, b),
                            disabled: !h
                          })
                        })
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: d ? "Space-Wide Pronouns" : "Room Pronouns",
                          description: `Allow everyone to set pronouns that apply in ${d ? "all the space's rooms" : "this room"}.`,
                          after: o.jsx(Jt, {
                            variant: "Primary",
                            value: v,
                            onChange: (b) => w(Pn.RoomCosmeticsPronouns, b),
                            disabled: !h
                          })
                        })
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: d ? "Space-Wide Fonts" : "Room Fonts",
                          description: `Allow everyone to set a font that applies in ${d ? "all the space's rooms" : "this room"}.`,
                          after: o.jsx(Jt, {
                            variant: "Primary",
                            value: y,
                            onChange: (b) => w(Pn.RoomCosmeticsFont, b),
                            disabled: !h
                          })
                        })
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const WT = {
    user: true
  }, Mst = (t) => JSON.stringify(t);
  function Pme({ powerLevels: t, permissionGroups: e, canEdit: n }) {
    const r = be(), i = cr(), a = Kr(), s = yh(i, t), l = p.useMemo(() => Math.max(...HF(s)), [
      s
    ]), [c, d] = p.useState(/* @__PURE__ */ new Map());
    p.useEffect(() => {
      d(/* @__PURE__ */ new Map());
    }, [
      e
    ]);
    const u = (b, j, k) => {
      d((C) => {
        const x = /* @__PURE__ */ new Map();
        return C.forEach((S, T) => {
          x.set(T, S);
        }), j === k ? x.delete(b) : x.set(b, j), x;
      });
    }, [h, f] = Et(p.useCallback(async () => {
      const b = uo(t, (j) => (e.forEach((k) => k.items.forEach((C) => {
        const x = UD(t, C.location);
        uq(j, C.location, x);
      })), c.forEach((k, C) => uq(j, C, k)), j));
      await r.sendStateEvent(i.roomId, ce.RoomPowerLevels, b);
    }, [
      r,
      i,
      t,
      c,
      e
    ])), g = p.useCallback(() => {
      d(/* @__PURE__ */ new Map());
    }, []), m = () => {
      f().then(() => {
        a() && g();
      });
    }, v = h.status === ve.Loading, y = c.size > 0, w = () => {
      const b = UD(t, WT), k = c.get(WT) ?? b, C = tI(s, k), x = k !== b;
      return o.jsxs(E, {
        direction: "Column",
        gap: "100",
        children: [
          o.jsx(D, {
            size: "L400",
            children: "Users"
          }),
          o.jsx(Te, {
            variant: "SurfaceVariant",
            className: hi,
            direction: "Column",
            gap: "400",
            children: o.jsx(Ie, {
              title: "Default Power",
              description: "Default power level for all users.",
              after: o.jsx(oZ, {
                powerLevelTags: s,
                value: k,
                onChange: (S) => u(WT, S, b),
                children: (S, T) => o.jsx(Qe, {
                  variant: x ? "Success" : "Secondary",
                  outlined: x,
                  fill: "Soft",
                  radii: "Pill",
                  "aria-selected": T,
                  disabled: !n || v,
                  after: x && o.jsx(Rn, {
                    size: "200",
                    variant: "Success",
                    fill: "Solid",
                    radii: "Pill"
                  }),
                  before: n && o.jsx(Q, {
                    size: "50",
                    src: T ? q.ChevronTop : q.ChevronBottom
                  }),
                  onClick: S,
                  children: o.jsx(D, {
                    size: "B300",
                    truncate: true,
                    children: C.name
                  })
                })
              })
            })
          })
        ]
      });
    };
    return o.jsxs(o.Fragment, {
      children: [
        w(),
        e.map((b) => o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: b.name
            }),
            b.items.map((j) => {
              const k = UD(t, j.location), x = c.get(j.location) ?? k, S = tI(s, x), T = x !== k;
              return o.jsx(Te, {
                variant: "SurfaceVariant",
                className: hi,
                direction: "Column",
                gap: "400",
                children: o.jsx(Ie, {
                  title: j.name,
                  description: j.description,
                  after: o.jsx(oZ, {
                    powerLevelTags: s,
                    value: x,
                    onChange: (A) => u(j.location, A, k),
                    children: (A, B) => o.jsxs(Qe, {
                      variant: T ? "Success" : "Secondary",
                      outlined: T,
                      fill: "Soft",
                      radii: "Pill",
                      "aria-selected": B,
                      disabled: !n || v,
                      after: T && o.jsx(Rn, {
                        size: "200",
                        variant: "Success",
                        fill: "Solid",
                        radii: "Pill"
                      }),
                      before: n && o.jsx(Q, {
                        size: "50",
                        src: B ? q.ChevronTop : q.ChevronBottom
                      }),
                      onClick: A,
                      children: [
                        o.jsx(D, {
                          size: "B300",
                          truncate: true,
                          children: S.name
                        }),
                        x < l && o.jsx(D, {
                          size: "T200",
                          children: "& Above"
                        })
                      ]
                    })
                  })
                })
              }, Mst(j.location));
            })
          ]
        }, b.name)),
        y && o.jsx(tn, {
          style: {
            position: "sticky",
            padding: ee.space.S200,
            paddingLeft: ee.space.S400,
            bottom: ee.space.S400,
            left: ee.space.S400,
            right: 0,
            zIndex: 1
          },
          variant: "Success",
          children: o.jsxs(E, {
            alignItems: "Center",
            gap: "400",
            children: [
              o.jsx(E, {
                grow: "Yes",
                direction: "Column",
                children: h.status === ve.Error ? o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Failed to apply changes! Please try again."
                  })
                }) : o.jsx(D, {
                  size: "T200",
                  children: o.jsx("b", {
                    children: "Changes saved! Apply when ready."
                  })
                })
              }),
              o.jsxs(E, {
                shrink: "No",
                gap: "200",
                children: [
                  o.jsx(xe, {
                    size: "300",
                    variant: "Success",
                    fill: "None",
                    radii: "300",
                    disabled: v,
                    onClick: g,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Reset"
                    })
                  }),
                  o.jsx(xe, {
                    size: "300",
                    variant: "Success",
                    radii: "300",
                    disabled: v,
                    before: v && o.jsx(dt, {
                      variant: "Success",
                      fill: "Solid",
                      size: "100"
                    }),
                    onClick: m,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Apply Changes"
                    })
                  })
                ]
              })
            ]
          })
        })
      ]
    });
  }
  function Ost({ powerLevels: t, power: e, permissionGroups: n, children: r }) {
    const [i, a] = p.useState(), s = (l) => {
      a(l.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: i,
      offset: 5,
      position: "Bottom",
      align: "Center",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => a(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          style: {
            maxHeight: "75vh",
            maxWidth: He(300),
            display: "flex"
          },
          children: o.jsx(E, {
            grow: "Yes",
            tabIndex: 0,
            children: o.jsx(dn, {
              size: "0",
              hideTrack: true,
              visibility: "Hover",
              children: o.jsx(E, {
                style: {
                  padding: ee.space.S200
                },
                direction: "Column",
                gap: "400",
                children: n.map((l) => o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: l.name
                    }),
                    o.jsx("div", {
                      children: l.items.map((c) => {
                        const u = UD(t, c.location) <= e;
                        return o.jsxs(D, {
                          size: "T200",
                          style: {
                            color: u ? void 0 : ct.Critical.Main
                          },
                          children: [
                            u ? "\u2705" : "\u274C",
                            " ",
                            c.name
                          ]
                        }, JSON.stringify(c.location));
                      })
                    })
                  ]
                }, l.name))
              })
            })
          })
        })
      }),
      children: r(s, !!i)
    });
  }
  function Mme({ powerLevels: t, permissionGroups: e, onEdit: n }) {
    const r = be(), i = hn(), a = cr(), s = yh(a, t), l = ri(a), c = Ep(), d = c.icon && qc(r, i, c.icon);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        l.size > 0 && o.jsxs(Te, {
          variant: "SurfaceVariant",
          className: hi,
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "Founders",
              description: "Founding members has all permissions and can only be changed during upgrade."
            }),
            o.jsx(Ie, {
              children: o.jsx(E, {
                gap: "200",
                wrap: "Wrap",
                children: o.jsx(Qe, {
                  disabled: true,
                  variant: "Secondary",
                  radii: "300",
                  before: o.jsx(Hf, {
                    color: c.color
                  }),
                  after: d && o.jsx(Zc, {
                    size: "50",
                    iconSrc: d
                  }),
                  children: o.jsx(D, {
                    size: "T300",
                    truncate: true,
                    children: o.jsx("b", {
                      children: c.name
                    })
                  })
                })
              })
            })
          ]
        }),
        o.jsxs(Te, {
          variant: "SurfaceVariant",
          className: hi,
          direction: "Column",
          gap: "400",
          children: [
            o.jsx(Ie, {
              title: "Power Levels",
              description: "Manage and customize incremental power levels for users.",
              after: n && o.jsx(E, {
                gap: "200",
                children: o.jsx(xe, {
                  variant: "Secondary",
                  fill: "Soft",
                  size: "300",
                  radii: "300",
                  outlined: true,
                  onClick: n,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Edit"
                  })
                })
              })
            }),
            o.jsx(Ie, {
              children: o.jsx(E, {
                gap: "200",
                wrap: "Wrap",
                children: HF(s).map((u) => {
                  const h = s[u], f = h.icon && qc(r, i, h.icon);
                  return o.jsx(Ost, {
                    powerLevels: t,
                    power: u,
                    permissionGroups: e,
                    children: (g, m) => o.jsx(Qe, {
                      onClick: g,
                      variant: "Secondary",
                      "aria-pressed": m,
                      radii: "300",
                      before: o.jsx(Hf, {
                        color: h.color
                      }),
                      after: f && o.jsx(Zc, {
                        size: "50",
                        iconSrc: f
                      }),
                      children: o.jsx(D, {
                        size: "T300",
                        truncate: true,
                        children: o.jsx("b", {
                          children: h.name
                        })
                      })
                    })
                  }, u);
                })
              })
            })
          ]
        })
      ]
    });
  }
  function zX({ maxPower: t, power: e, tag: n, onSave: r, onClose: i }) {
    const a = be(), s = cr(), l = Ze(vi), c = hn(), d = BF(s.getVersion()), u = IS(s.roomId, l), [h, f] = p.useState(), g = ed(f, false), [m, v] = p.useState((n == null ? void 0 : n.color) || "#FFFFFF"), [y, w] = p.useState(n == null ? void 0 : n.icon), b = h && !y, j = y && qc(a, c, y), k = (A) => {
      const B = A.startsWith("#") ? A : `#${A}`;
      v(B);
    }, C = p.useMemo(() => {
      if (h) return Yd(h);
    }, [
      h
    ]), x = p.useCallback(() => {
      f(void 0);
    }, []), S = p.useCallback((A) => {
      w({
        key: A.mxc
      }), f(void 0);
    }, []), T = (A) => {
      if (A.preventDefault(), b) return;
      const B = A.target, U = B == null ? void 0 : B.powerInput, z = B == null ? void 0 : B.nameInput;
      if (!U || !z) return;
      const O = Number.parseInt(U.value, 10);
      if (Number.isNaN(O)) return;
      const M = z.value.trim();
      if (!M) return;
      const I = /^#[0-9A-F]{6}$/i.test(m) ? m : void 0;
      r(e ?? O, {
        name: M,
        color: I,
        icon: y
      }), i();
    };
    return o.jsxs(E, {
      onSubmit: T,
      as: "form",
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(E, {
          direction: "Column",
          gap: "300",
          children: o.jsxs(E, {
            gap: "200",
            children: [
              o.jsxs(E, {
                shrink: "No",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Color"
                  }),
                  o.jsxs(E, {
                    gap: "200",
                    alignItems: "Center",
                    children: [
                      o.jsx(jce, {
                        picker: o.jsx(Sce, {
                          color: m,
                          onChange: k
                        }),
                        onRemove: () => v("#FFFFFF"),
                        children: (A, B) => o.jsx(xe, {
                          "aria-pressed": B,
                          onClick: A,
                          size: "300",
                          type: "button",
                          variant: "Secondary",
                          fill: "Soft",
                          radii: "300",
                          before: o.jsx(Hf, {
                            color: m
                          }),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Pick"
                          })
                        })
                      }),
                      o.jsx(mn, {
                        value: m,
                        onChange: (A) => k(A.currentTarget.value),
                        placeholder: "#FFFFFF",
                        size: "300",
                        variant: "Secondary",
                        radii: "300",
                        style: {
                          width: He(100),
                          fontFamily: "monospace",
                          textTransform: "uppercase"
                        }
                      })
                    ]
                  })
                ]
              }),
              o.jsxs(E, {
                grow: "Yes",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Name"
                  }),
                  o.jsx(mn, {
                    name: "nameInput",
                    defaultValue: n == null ? void 0 : n.name,
                    placeholder: "Bot",
                    size: "300",
                    variant: "Secondary",
                    radii: "300",
                    required: true
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  maxWidth: He(74)
                },
                grow: "Yes",
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Power"
                  }),
                  o.jsx(mn, {
                    defaultValue: e,
                    name: "powerInput",
                    size: "300",
                    variant: typeof e == "number" ? "SurfaceVariant" : "Secondary",
                    radii: "300",
                    type: "number",
                    placeholder: "75",
                    max: d ? void 0 : t,
                    outlined: typeof e == "number",
                    readOnly: typeof e == "number",
                    required: true
                  })
                ]
              })
            ]
          })
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Icon"
            }),
            C && !j ? o.jsx(xh, {
              uploadAtom: C,
              onRemove: x,
              onComplete: S
            }) : o.jsx(E, {
              gap: "200",
              alignItems: "Center",
              children: j ? o.jsxs(o.Fragment, {
                children: [
                  o.jsx(Zc, {
                    size: "500",
                    iconSrc: j
                  }),
                  o.jsx(xe, {
                    onClick: () => w(void 0),
                    type: "button",
                    size: "300",
                    variant: "Critical",
                    fill: "None",
                    radii: "300",
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Remove"
                    })
                  })
                ]
              }) : o.jsxs(o.Fragment, {
                children: [
                  o.jsx(Hi, {
                    initial: void 0,
                    children: (A, B) => o.jsx(ln, {
                      position: "Bottom",
                      anchor: A,
                      content: o.jsx(JF, {
                        imagePackRooms: u,
                        returnFocusOnDeactivate: false,
                        allowTextCustomEmoji: false,
                        addToRecentEmoji: false,
                        onEmojiSelect: (U) => {
                          w({
                            key: U
                          }), B(void 0);
                        },
                        onCustomEmojiSelect: (U) => {
                          w({
                            key: U
                          }), B(void 0);
                        },
                        requestClose: () => {
                          B(void 0);
                        }
                      }),
                      children: o.jsx(xe, {
                        onClick: ((U) => B(U.currentTarget.getBoundingClientRect())),
                        type: "button",
                        size: "300",
                        variant: "Secondary",
                        fill: "Soft",
                        radii: "300",
                        before: o.jsx(Q, {
                          size: "50",
                          src: q.SmilePlus
                        }),
                        children: o.jsx(D, {
                          size: "B300",
                          children: "Pick"
                        })
                      })
                    })
                  }),
                  o.jsx(xe, {
                    onClick: () => g("image/*"),
                    type: "button",
                    size: "300",
                    variant: "Secondary",
                    fill: "None",
                    radii: "300",
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Import"
                    })
                  })
                ]
              })
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Row",
          gap: "200",
          justifyContent: "Start",
          children: [
            o.jsx(xe, {
              style: {
                minWidth: He(64)
              },
              type: "submit",
              size: "300",
              variant: "Success",
              radii: "300",
              disabled: b,
              children: o.jsx(D, {
                size: "B300",
                children: "Save"
              })
            }),
            o.jsx(xe, {
              type: "button",
              size: "300",
              variant: "Secondary",
              fill: "Soft",
              radii: "300",
              onClick: i,
              children: o.jsx(D, {
                size: "B300",
                children: "Cancel"
              })
            })
          ]
        })
      ]
    });
  }
  function Ome({ powerLevels: t, requestClose: e }) {
    const n = be(), r = hn(), i = cr(), a = Kr(), [s, l] = p.useMemo(() => {
      const T = jae(t);
      return [
        T,
        Math.max(...Array.from(T))
      ];
    }, [
      t
    ]), c = yh(i, t), [d, u] = p.useState(), [h, f] = p.useState(/* @__PURE__ */ new Set()), [g, m] = p.useState(false), v = p.useCallback((T) => {
      f((A) => {
        const B = new Set(A);
        return B.has(T) ? B.delete(T) : B.add(T), B;
      });
    }, []), y = p.useCallback((T, A) => {
      u((B) => {
        const U = {
          ...B ?? c
        };
        return U[T] = A, U;
      });
    }, [
      c
    ]), [w, b] = Et(p.useCallback(async () => {
      const T = {
        ...d ?? c
      };
      h.forEach((A) => {
        delete T[A];
      }), await n.sendStateEvent(i.roomId, Pn.PowerLevelTags, T);
    }, [
      n,
      i,
      c,
      d,
      h
    ])), j = p.useCallback(() => {
      u(void 0), f(/* @__PURE__ */ new Set());
    }, []), k = () => {
      b().then(() => {
        a() && j();
      });
    }, C = w.status === ve.Loading, x = d || h.size > 0, S = d ?? c;
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          balance: true,
          children: o.jsxs(E, {
            alignItems: "Center",
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                alignItems: "Inherit",
                grow: "Yes",
                gap: "200",
                children: o.jsx(Qe, {
                  size: "500",
                  radii: "Pill",
                  onClick: e,
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowLeft
                  }),
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Permissions"
                  })
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: e,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsxs(E, {
                        alignItems: "Baseline",
                        gap: "200",
                        justifyContent: "SpaceBetween",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Power Levels"
                          }),
                          o.jsx(JO, {})
                        ]
                      }),
                      o.jsxs(Te, {
                        variant: "SurfaceVariant",
                        className: hi,
                        direction: "Column",
                        gap: "400",
                        children: [
                          o.jsx(Ie, {
                            title: "New Power Level",
                            description: "Create a new power level.",
                            after: !g && o.jsx(xe, {
                              onClick: () => m(true),
                              variant: "Secondary",
                              fill: "Soft",
                              size: "300",
                              radii: "300",
                              outlined: true,
                              disabled: C,
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Create"
                              })
                            })
                          }),
                          g && o.jsx(zX, {
                            maxPower: l,
                            onSave: y,
                            onClose: () => m(false)
                          })
                        ]
                      }),
                      HF(S).map((T) => {
                        const A = S[T], B = A.icon && qc(n, r, A.icon);
                        return o.jsx(Te, {
                          variant: h.has(T) ? "Critical" : "SurfaceVariant",
                          className: hi,
                          direction: "Column",
                          gap: "400",
                          children: o.jsx(Hi, {
                            initial: false,
                            children: (U, z) => U ? o.jsx(zX, {
                              maxPower: l,
                              power: T,
                              tag: A,
                              onSave: y,
                              onClose: () => z(false)
                            }) : o.jsx(Ie, {
                              before: o.jsx(Hf, {
                                color: A.color
                              }),
                              title: o.jsxs(E, {
                                as: "span",
                                alignItems: "Center",
                                gap: "200",
                                children: [
                                  o.jsx("b", {
                                    children: h.has(T) ? o.jsx("s", {
                                      children: A.name
                                    }) : A.name
                                  }),
                                  o.jsxs(E, {
                                    as: "span",
                                    shrink: "No",
                                    alignItems: "Inherit",
                                    gap: "Inherit",
                                    children: [
                                      B && o.jsx(Zc, {
                                        size: "50",
                                        iconSrc: B
                                      }),
                                      o.jsxs(D, {
                                        as: "span",
                                        size: "T200",
                                        priority: "300",
                                        children: [
                                          "(",
                                          T,
                                          ")"
                                        ]
                                      })
                                    ]
                                  })
                                ]
                              }),
                              after: h.has(T) ? o.jsx(Qe, {
                                variant: "Critical",
                                radii: "Pill",
                                disabled: C,
                                onClick: () => v(T),
                                children: o.jsx(D, {
                                  size: "B300",
                                  children: "Undo"
                                })
                              }) : o.jsxs(E, {
                                shrink: "No",
                                alignItems: "Center",
                                gap: "200",
                                children: [
                                  o.jsx(ar, {
                                    tooltip: o.jsx(pr, {
                                      style: {
                                        maxWidth: He(200)
                                      },
                                      children: s.has(T) ? o.jsxs(E, {
                                        direction: "Column",
                                        children: [
                                          o.jsx(D, {
                                            size: "L400",
                                            children: "Used Power Level"
                                          }),
                                          o.jsx(D, {
                                            size: "T200",
                                            children: "You have to remove its use before you can delete it."
                                          })
                                        ]
                                      }) : o.jsx(D, {
                                        children: "Delete"
                                      })
                                    }),
                                    children: (O) => o.jsx(Qe, {
                                      ref: O,
                                      variant: "Secondary",
                                      fill: "None",
                                      radii: "Pill",
                                      disabled: C,
                                      "aria-disabled": s.has(T),
                                      onClick: s.has(T) ? void 0 : () => v(T),
                                      children: o.jsx(Q, {
                                        size: "50",
                                        src: q.Delete
                                      })
                                    })
                                  }),
                                  o.jsx(Qe, {
                                    variant: "Secondary",
                                    radii: "Pill",
                                    disabled: C,
                                    onClick: () => z(true),
                                    children: o.jsx(D, {
                                      size: "B300",
                                      children: "Edit"
                                    })
                                  })
                                ]
                              })
                            })
                          })
                        }, T);
                      })
                    ]
                  }),
                  x && o.jsx(tn, {
                    style: {
                      position: "sticky",
                      padding: ee.space.S200,
                      paddingLeft: ee.space.S400,
                      bottom: ee.space.S400,
                      left: ee.space.S400,
                      right: 0,
                      zIndex: 1
                    },
                    variant: "Success",
                    children: o.jsxs(E, {
                      alignItems: "Center",
                      gap: "400",
                      children: [
                        o.jsx(E, {
                          grow: "Yes",
                          direction: "Column",
                          children: w.status === ve.Error ? o.jsx(D, {
                            size: "T200",
                            children: o.jsx("b", {
                              children: "Failed to apply changes! Please try again."
                            })
                          }) : o.jsx(D, {
                            size: "T200",
                            children: o.jsx("b", {
                              children: "Changes saved! Apply when ready."
                            })
                          })
                        }),
                        o.jsxs(E, {
                          shrink: "No",
                          gap: "200",
                          children: [
                            o.jsx(xe, {
                              size: "300",
                              variant: "Success",
                              fill: "None",
                              radii: "300",
                              disabled: C,
                              onClick: j,
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Reset"
                              })
                            }),
                            o.jsx(xe, {
                              size: "300",
                              variant: "Success",
                              radii: "300",
                              disabled: C,
                              before: C && o.jsx(dt, {
                                variant: "Success",
                                fill: "Solid",
                                size: "100"
                              }),
                              onClick: k,
                              children: o.jsx(D, {
                                size: "B300",
                                children: "Apply Changes"
                              })
                            })
                          ]
                        })
                      ]
                    })
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const Lst = (t) => p.useMemo(() => {
    const n = {
      name: "Messages",
      items: [
        {
          location: {
            key: ce.RoomMessage
          },
          name: "Send Messages"
        },
        {
          location: {
            key: ce.Sticker
          },
          name: "Send Stickers"
        },
        {
          location: {
            key: ce.Reaction
          },
          name: "Send Reactions"
        },
        {
          location: {
            notification: true,
            key: "room"
          },
          name: "Ping @room"
        },
        {
          location: {
            state: true,
            key: ce.RoomPinnedEvents
          },
          name: "Pin Messages"
        },
        {
          location: {},
          name: "Other Message Events"
        }
      ]
    }, r = {
      name: "Calls",
      items: [
        {
          location: {
            state: true,
            key: ce.GroupCallMemberPrefix
          },
          name: "Join Call"
        }
      ]
    }, i = {
      name: "Moderation",
      items: [
        {
          location: {
            action: true,
            key: "invite"
          },
          name: "Invite"
        },
        {
          location: {
            action: true,
            key: "kick"
          },
          name: "Kick"
        },
        {
          location: {
            action: true,
            key: "ban"
          },
          name: "Ban"
        },
        {
          location: {
            action: true,
            key: "redact"
          },
          name: "Delete Others Messages"
        },
        {
          location: {
            key: ce.RoomRedaction
          },
          name: "Delete Self Messages"
        }
      ]
    }, a = {
      name: "Room Overview",
      items: [
        {
          location: {
            state: true,
            key: ce.RoomAvatar
          },
          name: "Room Avatar"
        },
        {
          location: {
            state: true,
            key: ce.RoomName
          },
          name: "Room Name"
        },
        {
          location: {
            state: true,
            key: ce.RoomTopic
          },
          name: "Room Topic"
        }
      ]
    }, s = {
      name: "Settings",
      items: [
        {
          location: {
            state: true,
            key: ce.RoomJoinRules
          },
          name: "Change Room Access"
        },
        {
          location: {
            state: true,
            key: ce.RoomCanonicalAlias
          },
          name: "Publish Address"
        },
        {
          location: {
            state: true,
            key: ce.RoomPowerLevels
          },
          name: "Change All Permission"
        },
        {
          location: {
            state: true,
            key: Pn.PowerLevelTags
          },
          name: "Edit Power Levels"
        },
        {
          location: {
            state: true,
            key: ce.RoomEncryption
          },
          name: "Enable Encryption"
        },
        {
          location: {
            state: true,
            key: ce.RoomHistoryVisibility
          },
          name: "History Visibility"
        },
        {
          location: {
            state: true,
            key: ce.RoomTombstone
          },
          name: "Upgrade Room"
        },
        {
          location: {
            state: true
          },
          name: "Other Settings"
        }
      ]
    }, l = {
      name: "Other",
      items: [
        {
          location: {
            state: true,
            key: Pn.PoniesRoomEmotes
          },
          name: "Manage Emojis & Stickers"
        },
        {
          location: {
            state: true,
            key: ce.RoomServerAcl
          },
          name: "Change Server ACLs"
        },
        {
          location: {
            state: true,
            key: "im.vector.modular.widgets"
          },
          name: "Modify Widgets"
        }
      ]
    };
    return [
      n,
      ...t ? [
        r
      ] : [],
      i,
      a,
      s,
      l
    ];
  }, [
    t
  ]);
  function Nst({ requestClose: t }) {
    const e = be(), n = cr(), r = Mo(n), i = ri(n), a = Ki(i, r), s = a.stateEvent(Pn.PowerLevelTags, e.getSafeUserId()), l = a.stateEvent(ce.RoomPowerLevels, e.getSafeUserId()), c = Lst(n.isCallRoom()), [d, u] = p.useState(false), h = () => {
      u(true);
    };
    return s && d ? o.jsx(Ome, {
      powerLevels: r,
      requestClose: () => u(false)
    }) : o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Permissions"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsx(Mme, {
                    powerLevels: r,
                    onEdit: s ? h : void 0,
                    permissionGroups: c
                  }),
                  o.jsx(Pme, {
                    canEdit: l,
                    powerLevels: r,
                    permissionGroups: c
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  var lh = "styles_SequenceCardStyle__j06d440";
  const Lme = (t) => {
    var _a6;
    const e = (_a6 = $i(t, ce.RoomCanonicalAlias)) == null ? void 0 : _a6.getContent(), n = e == null ? void 0 : e.alias, r = p.useMemo(() => {
      var _a7;
      const i = [];
      return typeof (e == null ? void 0 : e.alias) == "string" && i.push(e.alias), (_a7 = e == null ? void 0 : e.alt_aliases) == null ? void 0 : _a7.forEach((a) => {
        typeof a == "string" && i.push(a);
      }), i;
    }, [
      e
    ]);
    return [
      n,
      r
    ];
  }, zst = (t) => {
    const e = be();
    return p.useCallback(async (r) => {
      var _a6, _b3;
      const i = (_a6 = ni(t, ce.RoomCanonicalAlias)) == null ? void 0 : _a6.getContent(), a = [];
      (i == null ? void 0 : i.alias) && i.alias !== r && a.push(i.alias), (_b3 = i == null ? void 0 : i.alt_aliases) == null ? void 0 : _b3.forEach((l) => {
        l !== r && a.push(l);
      });
      const s = {
        alias: r,
        alt_aliases: a
      };
      await e.sendStateEvent(t.roomId, ce.RoomCanonicalAlias, s);
    }, [
      e,
      t
    ]);
  }, Ust = (t) => {
    const e = be(), n = p.useCallback(async (i) => {
      var _a6;
      const a = (_a6 = ni(t, ce.RoomCanonicalAlias)) == null ? void 0 : _a6.getContent(), s = (a == null ? void 0 : a.alt_aliases) ?? [];
      i.forEach((c) => {
        s.includes(c) || s.push(c);
      });
      const l = {
        alias: a == null ? void 0 : a.alias,
        alt_aliases: s
      };
      await e.sendStateEvent(t.roomId, ce.RoomCanonicalAlias, l);
    }, [
      e,
      t
    ]), r = p.useCallback(async (i) => {
      var _a6, _b3;
      const a = (_a6 = ni(t, ce.RoomCanonicalAlias)) == null ? void 0 : _a6.getContent(), s = [];
      (_b3 = a == null ? void 0 : a.alt_aliases) == null ? void 0 : _b3.forEach((c) => {
        i.includes(c) || s.push(c);
      });
      const l = {
        alias: a == null ? void 0 : a.alias,
        alt_aliases: s
      };
      await e.sendStateEvent(t.roomId, ce.RoomCanonicalAlias, l);
    }, [
      e,
      t
    ]);
    return {
      publishAliases: n,
      unpublishAliases: r
    };
  }, Vst = (t) => {
    const e = be(), n = Kr(), [r, i] = Et(p.useCallback(async () => (await e.getLocalAliases(t)).aliases, [
      e,
      t
    ]));
    p.useEffect(() => {
      i();
    }, [
      i
    ]);
    const a = p.useCallback(async (l) => {
      await e.createAlias(l, t), n() && await i();
    }, [
      e,
      t,
      i,
      n
    ]), s = p.useCallback(async (l) => {
      await e.deleteAlias(l), n() && await i();
    }, [
      e,
      i,
      n
    ]);
    return {
      localAliasesState: r,
      addLocalAlias: a,
      removeLocalAlias: s
    };
  };
  function Nme({ permissions: t }) {
    const e = be(), n = cr(), r = t.stateEvent(ce.RoomCanonicalAlias, e.getSafeUserId()), [i, a] = Lme(n), s = zst(n), [l, c] = Et(s), d = l.status === ve.Loading;
    return o.jsxs(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(Ie, {
          title: "Published Addresses",
          description: o.jsxs("span", {
            children: [
              "If access is ",
              o.jsx("b", {
                children: "Public"
              }),
              ", Published addresses will be used to join by anyone."
            ]
          })
        }),
        o.jsx(Gc, {
          variant: "Surface",
          style: {
            padding: ee.space.S300
          },
          children: a.length === 0 ? o.jsxs(E, {
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "L400",
                children: "No Addresses"
              }),
              o.jsx(D, {
                size: "T200",
                children: "To publish an address, it needs to be set as a local address first"
              })
            ]
          }) : o.jsxs(E, {
            direction: "Column",
            gap: "300",
            children: [
              a.map((u) => o.jsxs(E, {
                as: "span",
                gap: "200",
                alignItems: "Center",
                children: [
                  o.jsxs(E, {
                    grow: "Yes",
                    gap: "Inherit",
                    alignItems: "Center",
                    children: [
                      o.jsx(D, {
                        size: "T300",
                        truncate: true,
                        children: u === i ? o.jsx("b", {
                          children: u
                        }) : u
                      }),
                      u === i && o.jsx(Rn, {
                        variant: "Success",
                        fill: "Solid",
                        size: "500",
                        children: o.jsx(D, {
                          size: "L400",
                          children: "Main"
                        })
                      })
                    ]
                  }),
                  r && o.jsx(E, {
                    shrink: "No",
                    gap: "100",
                    children: u === i ? o.jsx(Qe, {
                      variant: "Warning",
                      radii: "Pill",
                      fill: "None",
                      disabled: d,
                      onClick: () => c(void 0),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Unset Main"
                      })
                    }) : o.jsx(Qe, {
                      variant: "Success",
                      radii: "Pill",
                      fill: i ? "None" : "Soft",
                      disabled: d,
                      onClick: () => c(u),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Set Main"
                      })
                    })
                  })
                ]
              }, u)),
              l.status === ve.Error && o.jsx(D, {
                size: "T200",
                style: {
                  color: ct.Critical.Main
                },
                children: l.error.message
              })
            ]
          })
        })
      ]
    });
  }
  function Hst({ addLocalAlias: t }) {
    const n = be().getSafeUserId(), r = bo(n), i = Kr(), [a, s] = Et(t), l = a.status === ve.Loading, c = (d) => {
      var _a6;
      if (l) return;
      d.preventDefault();
      const h = (_a6 = d.target) == null ? void 0 : _a6.aliasInput;
      if (!h) return;
      const f = Og(h.value.trim());
      f && s(`#${f}:${r}`).then(() => {
        i() && (h.value = "");
      });
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: c,
      direction: "Column",
      gap: "200",
      children: [
        o.jsxs(E, {
          gap: "200",
          children: [
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(mn, {
                name: "aliasInput",
                variant: "Secondary",
                size: "400",
                radii: "300",
                before: o.jsx(D, {
                  size: "T200",
                  children: "#"
                }),
                readOnly: l,
                after: o.jsxs(D, {
                  style: {
                    maxWidth: He(300)
                  },
                  size: "T200",
                  truncate: true,
                  children: [
                    ":",
                    r
                  ]
                })
              })
            }),
            o.jsx(E, {
              shrink: "No",
              children: o.jsx(xe, {
                variant: "Success",
                size: "400",
                radii: "300",
                type: "submit",
                disabled: l,
                before: l && o.jsx(dt, {
                  size: "100",
                  variant: "Success",
                  fill: "Solid"
                }),
                children: o.jsx(D, {
                  size: "B400",
                  children: "Save"
                })
              })
            })
          ]
        }),
        a.status === ve.Error && o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T200",
          children: a.error.httpStatus === 409 ? "Address is already in use!" : a.error.message
        })
      ]
    });
  }
  function $st({ localAliases: t, removeLocalAlias: e, canEditCanonical: n }) {
    const r = cr(), i = Kr(), [, a] = Lme(r), { publishAliases: s, unpublishAliases: l } = Ust(r), [c, d] = p.useState([]), u = c.find((T) => a.includes(T)), h = (T) => {
      d((A) => {
        if (A.includes(T)) return A.filter((U) => U !== T);
        const B = [
          ...A
        ];
        return B.push(T), B;
      });
    }, f = () => {
      i() && d([]);
    }, [g, m] = Et(p.useCallback(async (T) => {
      for (let A = 0; A < T.length; A += 1) {
        const B = T[A];
        B && await e(B);
      }
    }, [
      e
    ])), [v, y] = Et(s), [w, b] = Et(l), j = () => {
      m(c).then(f);
    }, k = () => {
      y(c).then(f);
    }, C = () => {
      b(c).then(f);
    }, x = g.status === ve.Loading || v.status === ve.Loading || w.status === ve.Loading;
    let S;
    return g.status === ve.Error && (S = g.error), v.status === ve.Error && (S = v.error), w.status === ve.Error && (S = w.error), o.jsxs(E, {
      direction: "Column",
      gap: "300",
      children: [
        c.length > 0 && o.jsxs(E, {
          gap: "200",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsxs(D, {
                size: "L400",
                children: [
                  c.length,
                  " Selected"
                ]
              })
            }),
            o.jsxs(E, {
              shrink: "No",
              gap: "Inherit",
              children: [
                n && (u ? o.jsx(Qe, {
                  variant: "Warning",
                  radii: "Pill",
                  disabled: x,
                  onClick: C,
                  before: w.status === ve.Loading && o.jsx(dt, {
                    size: "100",
                    variant: "Warning"
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Unpublish"
                  })
                }) : o.jsx(Qe, {
                  variant: "Success",
                  radii: "Pill",
                  disabled: x,
                  onClick: k,
                  before: v.status === ve.Loading && o.jsx(dt, {
                    size: "100",
                    variant: "Success"
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Publish"
                  })
                })),
                o.jsx(Qe, {
                  variant: "Critical",
                  radii: "Pill",
                  disabled: x,
                  onClick: j,
                  before: g.status === ve.Loading && o.jsx(dt, {
                    size: "100",
                    variant: "Critical"
                  }),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Delete"
                  })
                })
              ]
            })
          ]
        }),
        t.map((T) => {
          const A = a.includes(T), B = c.includes(T);
          return o.jsxs(E, {
            as: "span",
            alignItems: "Center",
            gap: "200",
            children: [
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Rd, {
                  checked: B,
                  onClick: () => h(T),
                  size: "50",
                  variant: "Primary",
                  disabled: x
                })
              }),
              o.jsx(E, {
                grow: "Yes",
                children: o.jsx(D, {
                  size: "T300",
                  truncate: true,
                  children: T
                })
              }),
              o.jsx(E, {
                shrink: "No",
                gap: "100",
                children: A && o.jsx(Rn, {
                  variant: "Success",
                  fill: "Soft",
                  size: "500",
                  children: o.jsx(D, {
                    size: "L400",
                    children: "Published"
                  })
                })
              })
            ]
          }, T);
        }),
        S && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: S.message
        })
      ]
    });
  }
  function zme({ permissions: t }) {
    const e = be(), n = cr(), r = t.stateEvent(ce.RoomCanonicalAlias, e.getSafeUserId()), [i, a] = p.useState(false), { localAliasesState: s, addLocalAlias: l, removeLocalAlias: c } = Vst(n.roomId);
    return o.jsxs(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(Ie, {
          title: "Local Addresses",
          description: "Set local address so users can join through your homeserver.",
          after: o.jsx(xe, {
            type: "button",
            onClick: () => a(!i),
            size: "300",
            variant: "Secondary",
            fill: "Soft",
            outlined: true,
            radii: "300",
            before: o.jsx(Q, {
              size: "100",
              src: i ? q.ChevronTop : q.ChevronBottom,
              filled: true
            }),
            children: o.jsx(D, {
              as: "span",
              size: "B300",
              truncate: true,
              children: i ? "Collapse" : "Expand"
            })
          })
        }),
        i && o.jsxs(Gc, {
          variant: "Surface",
          style: {
            padding: ee.space.S300
          },
          children: [
            s.status === ve.Loading && o.jsxs(E, {
              gap: "100",
              children: [
                o.jsx(dt, {
                  variant: "Secondary",
                  size: "100"
                }),
                o.jsx(D, {
                  size: "T200",
                  children: "Loading..."
                })
              ]
            }),
            s.status === ve.Success && (s.data.length === 0 ? o.jsx(E, {
              direction: "Column",
              gap: "100",
              children: o.jsx(D, {
                size: "L400",
                children: "No Addresses"
              })
            }) : o.jsx($st, {
              localAliases: s.data,
              removeLocalAlias: c,
              canEditCanonical: r
            })),
            s.status === ve.Error && o.jsx(E, {
              gap: "100",
              children: o.jsx(D, {
                size: "T200",
                style: {
                  color: ct.Critical.Main
                },
                children: s.error.message
              })
            })
          ]
        }),
        i && o.jsx(Hst, {
          addLocalAlias: l
        })
      ]
    });
  }
  const UX = "m.megolm.v1.aes-sha2";
  function Wst({ permissions: t }) {
    var _a6, _b3;
    const e = be(), n = cr(), r = t.stateEvent(ce.RoomEncryption, e.getSafeUserId()), a = ((_b3 = (_a6 = $i(n, ce.RoomEncryption)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.algorithm) === UX, [s, l] = Et(p.useCallback(async () => {
      await e.sendStateEvent(n.roomId, ce.RoomEncryption, {
        algorithm: UX
      });
    }, [
      e,
      n.roomId
    ])), c = s.status === ve.Loading, [d, u] = p.useState(false), h = () => {
      l(), u(false);
    };
    return o.jsx(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: o.jsxs(Ie, {
        title: "Room Encryption",
        description: a ? "Messages in this room are protected by end-to-end encryption." : "Once enabled, encryption cannot be disabled!",
        after: a ? o.jsx(Rn, {
          size: "500",
          variant: "Success",
          fill: "Solid",
          radii: "300",
          children: o.jsx(D, {
            size: "L400",
            children: "Enabled"
          })
        }) : o.jsx(xe, {
          size: "300",
          variant: "Primary",
          fill: "Solid",
          radii: "300",
          disabled: !r,
          onClick: () => u(true),
          before: c && o.jsx(dt, {
            size: "100",
            variant: "Primary",
            fill: "Solid"
          }),
          children: o.jsx(D, {
            size: "B300",
            children: "Enable"
          })
        }),
        children: [
          s.status === ve.Error && o.jsx(D, {
            style: {
              color: ct.Critical.Main
            },
            size: "T200",
            children: s.error.message
          }),
          d && o.jsx(Hn, {
            open: true,
            backdrop: o.jsx($n, {}),
            children: o.jsx(Wn, {
              children: o.jsx(Ft, {
                focusTrapOptions: {
                  initialFocus: false,
                  onDeactivate: () => u(false),
                  clickOutsideDeactivates: true,
                  escapeDeactivates: kt
                },
                children: o.jsxs(lr, {
                  variant: "Surface",
                  children: [
                    o.jsxs(wn, {
                      style: {
                        padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                        borderBottomWidth: ee.borderWidth.B300
                      },
                      variant: "Surface",
                      size: "500",
                      children: [
                        o.jsx(E, {
                          grow: "Yes",
                          children: o.jsx(D, {
                            size: "H4",
                            children: "Enable Encryption"
                          })
                        }),
                        o.jsx(Oe, {
                          size: "300",
                          onClick: () => u(false),
                          radii: "300",
                          children: o.jsx(Q, {
                            src: q.Cross
                          })
                        })
                      ]
                    }),
                    o.jsxs(E, {
                      style: {
                        padding: ee.space.S400
                      },
                      direction: "Column",
                      gap: "400",
                      children: [
                        o.jsx(D, {
                          priority: "400",
                          children: "Are you sure? Once enabled, encryption cannot be disabled!"
                        }),
                        o.jsx(xe, {
                          type: "submit",
                          variant: "Primary",
                          onClick: h,
                          children: o.jsx(D, {
                            size: "B400",
                            children: "Enable E2E Encryption"
                          })
                        })
                      ]
                    })
                  ]
                })
              })
            })
          })
        ]
      })
    });
  }
  const qst = () => p.useMemo(() => ({
    [ll.Invited]: "After Invite",
    [ll.Joined]: "After Join",
    [ll.Shared]: "All Messages",
    [ll.WorldReadable]: "All Messages (Guests)"
  }), []), Kst = () => p.useMemo(() => [
    ll.Shared,
    ll.Invited,
    ll.Joined,
    ll.WorldReadable
  ], []);
  function Gst({ permissions: t }) {
    var _a6;
    const e = be(), n = cr(), r = t.stateEvent(ce.RoomHistoryVisibility, e.getSafeUserId()), a = ((_a6 = $i(n, ce.RoomHistoryVisibility)) == null ? void 0 : _a6.getContent().history_visibility) ?? ll.Shared, s = Kst(), l = qst(), [c, d] = p.useState(), u = (v) => {
      d(v.currentTarget.getBoundingClientRect());
    }, [h, f] = Et(p.useCallback(async (v) => {
      const y = {
        history_visibility: v
      };
      await e.sendStateEvent(n.roomId, ce.RoomHistoryVisibility, y);
    }, [
      e,
      n.roomId
    ])), g = h.status === ve.Loading, m = (v) => {
      f(v), d(void 0);
    };
    return o.jsx(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: o.jsx(Ie, {
        title: "Message History Visibility",
        description: "Changes to history visibility will only apply to future messages. The visibility of existing history will have no effect.",
        after: o.jsx(ln, {
          anchor: c,
          position: "Bottom",
          align: "End",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => d(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (v) => v.key === "ArrowDown",
              isKeyBackward: (v) => v.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              style: {
                padding: ee.space.S100
              },
              children: s.map((v) => o.jsx(Ye, {
                size: "300",
                radii: "300",
                onClick: () => m(v),
                "aria-pressed": v === a,
                children: o.jsx(D, {
                  as: "span",
                  size: "T300",
                  truncate: true,
                  children: l[v]
                })
              }, v))
            })
          }),
          children: o.jsx(xe, {
            variant: "Secondary",
            fill: "Soft",
            size: "300",
            radii: "300",
            outlined: true,
            disabled: !r || g,
            onClick: u,
            after: g ? o.jsx(dt, {
              size: "100",
              variant: "Secondary"
            }) : o.jsx(Q, {
              size: "100",
              src: q.ChevronBottom
            }),
            children: o.jsx(D, {
              size: "B300",
              children: l[a]
            })
          })
        }),
        children: h.status === ve.Error && o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T200",
          children: h.error.message
        })
      })
    });
  }
  const Yst = (t) => p.useMemo(() => ({
    [kn.Invite]: Sd(q, t, kn.Invite),
    [kn.Knock]: Sd(q, t, kn.Knock),
    knock_restricted: Sd(q, t, kn.Restricted),
    [kn.Restricted]: Sd(q, t, kn.Restricted),
    [kn.Public]: Sd(q, t, kn.Public),
    [kn.Private]: Sd(q, t, kn.Private)
  }), [
    t
  ]), Zst = () => p.useMemo(() => ({
    [kn.Invite]: "Invite Only",
    [kn.Knock]: "Knock & Invite",
    knock_restricted: "Space Members or Knock",
    [kn.Restricted]: "Space Members",
    [kn.Public]: "Public",
    [kn.Private]: "Invite Only"
  }), []);
  function Jst({ icons: t, labels: e, rules: n, value: r, onChange: i, disabled: a, changing: s }) {
    const [l, c] = p.useState(), d = (h) => {
      c(h.currentTarget.getBoundingClientRect());
    }, u = p.useCallback((h) => {
      c(void 0), i(h);
    }, [
      i
    ]);
    return o.jsx(ln, {
      anchor: l,
      position: "Bottom",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => c(void 0),
          clickOutsideDeactivates: true,
          isKeyForward: (h) => h.key === "ArrowDown",
          isKeyBackward: (h) => h.key === "ArrowUp",
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          children: o.jsx(E, {
            direction: "Column",
            gap: "100",
            style: {
              padding: ee.space.S100
            },
            children: n.map((h) => o.jsx(Ye, {
              size: "300",
              variant: "Surface",
              radii: "300",
              "aria-pressed": r === h,
              onClick: () => u(h),
              before: o.jsx(Q, {
                size: "100",
                src: t[h]
              }),
              disabled: a,
              children: o.jsx(E, {
                grow: "Yes",
                children: o.jsx(D, {
                  size: "T300",
                  children: e[h]
                })
              })
            }, h))
          })
        })
      }),
      children: o.jsx(xe, {
        size: "300",
        variant: "Secondary",
        fill: "Soft",
        radii: "300",
        outlined: true,
        before: o.jsx(Q, {
          size: "100",
          src: t[r] ?? t[kn.Restricted]
        }),
        after: s ? o.jsx(dt, {
          size: "100",
          variant: "Secondary",
          fill: "Soft"
        }) : o.jsx(Q, {
          size: "100",
          src: q.ChevronBottom
        }),
        onClick: d,
        disabled: a,
        children: o.jsx(D, {
          size: "B300",
          children: e[r] ?? "Unsupported"
        })
      })
    });
  }
  function Ume({ permissions: t }) {
    var _a6, _b3;
    const e = be(), n = cr(), r = OB(n.getVersion()), i = G2(n.getVersion()), a = MB(n.getVersion()), s = Ze(vi), l = ka(), c = FAe(e, s), d = Zk(zr, (l == null ? void 0 : l.roomId) ?? "", c), u = t.stateEvent(ce.RoomHistoryVisibility, e.getSafeUserId()), g = ((_b3 = (_a6 = $i(n, ce.RoomJoinRules)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.join_rule) ?? kn.Invite, m = p.useMemo(() => {
      const k = [
        kn.Invite
      ];
      return a && k.push(kn.Knock), i && l && k.push(kn.Restricted), r && l && k.push("knock_restricted"), k.push(kn.Public), k;
    }, [
      r,
      i,
      a,
      l
    ]), v = Yst(n.getType()), y = Zst(), [w, b] = Et(p.useCallback(async (k) => {
      const C = [];
      if (k === kn.Restricted || k === "knock_restricted") {
        const S = s.get(n.roomId), T = Ud(n, ce.SpaceParent).map((A) => A.getStateKey()).filter((A) => typeof A == "string").filter((A) => S == null ? void 0 : S.has(A));
        if (T.length === 0 && l && S) {
          const A = d.filter((B) => S.has(B));
          S.has(l.roomId) && A.push(l.roomId), A.forEach((B) => T.push(B));
        }
        T.forEach((A) => {
          A && C.push({
            type: ak.RoomMembership,
            room_id: A
          });
        });
      }
      const x = {
        join_rule: k
      };
      C.length > 0 && (x.allow = C), await e.sendStateEvent(n.roomId, ce.RoomJoinRules, x);
    }, [
      e,
      n,
      l,
      d,
      s
    ])), j = w.status === ve.Loading;
    return o.jsx(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: o.jsx(Ie, {
        title: n.isSpaceRoom() ? "Space Access" : "Room Access",
        description: n.isSpaceRoom() ? "Change how people can join the space." : "Change how people can join the room.",
        after: o.jsx(Jst, {
          icons: v,
          labels: y,
          rules: m,
          value: g,
          onChange: b,
          disabled: !u || j,
          changing: j
        }),
        children: w.status === ve.Error && o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T200",
          children: w.error.message
        })
      })
    });
  }
  function Xst({ canEditAvatar: t, canEditName: e, canEditTopic: n, avatar: r, name: i, topic: a, isDm: s, onClose: l }) {
    const c = cr(), d = be(), u = Kr(), h = hn(), f = xS(c), [g, m] = p.useState(r), v = g ? Cn(d, g, h) ?? void 0 : void 0, [y, w] = p.useState(), j = Xl(y) ? g === r : false, k = p.useMemo(() => {
      if (y) return Yd(y);
    }, [
      y
    ]), C = ed(w, false), x = p.useCallback(() => {
      w(void 0), m(r);
    }, [
      r
    ]), S = p.useCallback((O) => {
      m(O.mxc);
    }, []), [T, A] = Et(p.useCallback(async (O, M, I) => {
      O !== void 0 && await d.sendStateEvent(c.roomId, ce.RoomAvatar, O ? {
        url: O
      } : {}), M !== void 0 && await d.sendStateEvent(c.roomId, ce.RoomName, {
        name: M
      }), I !== void 0 && await d.sendStateEvent(c.roomId, ce.RoomTopic, {
        topic: I
      });
    }, [
      d,
      c.roomId
    ])), B = T.status === ve.Loading, U = (O) => {
      if (O.preventDefault(), j) return;
      const M = O.target, I = M == null ? void 0 : M.nameInput, N = M == null ? void 0 : M.topicTextArea;
      if (!I || !N) return;
      const L = I.value.trim(), H = N.value.trim();
      g === r && L === i && H === a || A(g === r ? void 0 : g || null, L === i ? void 0 : L, H === a ? void 0 : H).then(() => {
        u() && l();
      });
    }, z = p.useCallback(() => {
      A(void 0, "", void 0).then(() => {
        u() && l();
      });
    }, [
      A,
      u,
      l
    ]);
    return o.jsxs(E, {
      as: "form",
      onSubmit: U,
      direction: "Column",
      gap: "400",
      children: [
        o.jsxs(E, {
          gap: "400",
          children: [
            o.jsxs(E, {
              grow: "Yes",
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Avatar"
                }),
                k ? o.jsx(E, {
                  gap: "200",
                  direction: "Column",
                  children: o.jsx(xh, {
                    uploadAtom: k,
                    onRemove: x,
                    onComplete: S
                  })
                }) : o.jsxs(E, {
                  gap: "200",
                  children: [
                    o.jsx(xe, {
                      type: "button",
                      size: "300",
                      variant: "Secondary",
                      fill: "Soft",
                      radii: "300",
                      disabled: !t || B,
                      onClick: () => C("image/*"),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Upload"
                      })
                    }),
                    !g && r && o.jsx(xe, {
                      type: "button",
                      size: "300",
                      variant: "Success",
                      fill: "None",
                      radii: "300",
                      disabled: !t || B,
                      onClick: () => m(r),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Reset"
                      })
                    }),
                    g && o.jsx(xe, {
                      type: "button",
                      size: "300",
                      variant: "Critical",
                      fill: "None",
                      radii: "300",
                      disabled: !t || B,
                      onClick: () => m(void 0),
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Remove"
                      })
                    })
                  ]
                })
              ]
            }),
            o.jsx(E, {
              shrink: "No",
              children: o.jsx(xn, {
                size: "500",
                radii: "300",
                children: o.jsx(yi, {
                  roomId: c.roomId,
                  src: v,
                  alt: i,
                  renderFallback: () => o.jsx(Ya, {
                    roomType: c.getType(),
                    size: "400",
                    joinRule: (f == null ? void 0 : f.join_rule) ?? kn.Invite,
                    filled: true
                  })
                })
              })
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Name"
            }),
            o.jsxs(E, {
              gap: "200",
              alignItems: "Center",
              children: [
                o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(mn, {
                    name: "nameInput",
                    defaultValue: i,
                    variant: "Secondary",
                    radii: "300",
                    style: {
                      width: "100%"
                    },
                    readOnly: !e || B
                  })
                }),
                s && e && o.jsx(xe, {
                  type: "button",
                  variant: "Critical",
                  fill: "None",
                  size: "300",
                  radii: "300",
                  onClick: z,
                  disabled: B,
                  title: "Reset DM Name",
                  children: o.jsx(Q, {
                    src: q.Reload,
                    size: "100"
                  })
                })
              ]
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Inherit",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Topic"
            }),
            o.jsx(js, {
              name: "topicTextArea",
              defaultValue: a,
              variant: "Secondary",
              radii: "300",
              readOnly: !n || B
            })
          ]
        }),
        T.status === ve.Error && o.jsx(D, {
          size: "T200",
          style: {
            color: ct.Critical.Main
          },
          children: T.error.message
        }),
        o.jsxs(E, {
          gap: "300",
          children: [
            o.jsx(xe, {
              type: "submit",
              variant: "Success",
              size: "300",
              radii: "300",
              disabled: j || B,
              before: B && o.jsx(dt, {
                size: "100",
                variant: "Success",
                fill: "Solid"
              }),
              children: o.jsx(D, {
                size: "B300",
                children: "Save"
              })
            }),
            o.jsx(xe, {
              type: "reset",
              onClick: l,
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              radii: "300",
              children: o.jsx(D, {
                size: "B300",
                children: "Cancel"
              })
            })
          ]
        })
      ]
    });
  }
  function Qst({ bannerURI: t, permissions: e }) {
    const n = be(), [r, i] = p.useState(false), a = cr(), s = n.getUserId() ?? "", l = e.stateEvent(Pn.RoomBanner, s), [c, d] = p.useState(), [u, h] = p.useState(false), f = t;
    p.useEffect(() => {
      f && d(void 0);
    }, [
      f
    ]);
    const [g, m] = p.useState(), v = Xl(g), y = p.useMemo(() => {
      if (g) return Yd(g);
    }, [
      g
    ]), w = ed(m, false), b = p.useCallback(() => {
      h(false), d(void 0), w("image/*");
    }, [
      w
    ]), j = p.useCallback(() => {
      m(void 0);
    }, []), k = p.useCallback((S) => {
      const { mxc: T } = S;
      v && d(v), n.sendStateEvent(a.roomId, Pn.RoomBanner, {
        url: T
      }, ""), m(void 0);
    }, [
      n,
      v,
      a
    ]), C = async () => {
      h(true), d(void 0), m(void 0), n.sendStateEvent(a.roomId, Pn.RoomBanner, {
        url: ""
      }, ""), i(false);
    }, x = u ? void 0 : v || c || f;
    return o.jsxs(Ie, {
      title: "Banner",
      focusId: "banner",
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "300",
          grow: "Yes",
          children: [
            o.jsx(E, {
              style: {
                height: "100px",
                width: "100%",
                borderRadius: ee.radii.R400,
                overflow: "hidden",
                backgroundColor: "var(--sable-surface-container)",
                position: "relative",
                display: "flex",
                alignItems: "center",
                justifyContent: "center"
              },
              children: x ? o.jsx("img", {
                src: x,
                style: {
                  width: "100%",
                  height: "100%",
                  objectFit: "cover"
                },
                alt: "Banner Preview"
              }, x) : o.jsx(E, {
                justifyContent: "Center",
                alignItems: "Center",
                children: o.jsx(D, {
                  priority: "300",
                  size: "T200",
                  children: "No Banner Set"
                })
              })
            }),
            y ? o.jsx(E, {
              gap: "200",
              direction: "Column",
              children: o.jsx(xh, {
                uploadAtom: y,
                onRemove: j,
                onComplete: k
              })
            }) : o.jsxs(E, {
              gap: "200",
              children: [
                o.jsx(xe, {
                  onClick: b,
                  size: "300",
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  radii: "300",
                  disabled: !l,
                  children: o.jsx(D, {
                    size: "B300",
                    children: f ? "Change Banner" : "Upload Banner"
                  })
                }),
                f && o.jsx(xe, {
                  size: "300",
                  variant: "Critical",
                  fill: "None",
                  radii: "300",
                  onClick: () => i(true),
                  disabled: !l,
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Remove"
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(Hn, {
          open: r,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => i(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsxs(lr, {
                variant: "Surface",
                children: [
                  o.jsxs(wn, {
                    style: {
                      padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                      borderBottomWidth: ee.borderWidth.B300
                    },
                    variant: "Surface",
                    size: "500",
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: "Remove Banner"
                        })
                      }),
                      o.jsx(Oe, {
                        size: "300",
                        onClick: () => i(false),
                        radii: "300",
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    style: {
                      padding: ee.space.S400
                    },
                    direction: "Column",
                    gap: "400",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        children: "Are you sure you want to remove profile banner?"
                      }),
                      o.jsx(xe, {
                        variant: "Critical",
                        onClick: C,
                        disabled: !l,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Remove"
                        })
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function Vme({ permissions: t }) {
    var _a6, _b3;
    const e = be(), n = hn(), r = cr(), i = Ze(gi), a = i.has(r.roomId), [s] = Fe(ge, "customDMCards"), l = Ip(r, i.has(r.roomId) && !s), c = rc(r), d = D3(r), u = xS(r), h = t.stateEvent(ce.RoomAvatar, e.getSafeUserId()), f = t.stateEvent(ce.RoomName, e.getSafeUserId()), g = t.stateEvent(ce.RoomTopic, e.getSafeUserId()), m = h || f || g, v = l ? Cn(e, l, n, 96, 96, "crop") ?? void 0 : void 0, [y, w] = p.useState(false), b = p.useCallback(() => w(false), []), k = (_b3 = (_a6 = $i(r, Pn.RoomBanner)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.url, C = Cn(e, k ?? "", true);
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Profile"
        }),
        o.jsx(Te, {
          className: lh,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          children: y ? o.jsx(Xst, {
            canEditAvatar: h,
            canEditName: f,
            canEditTopic: g,
            avatar: l,
            name: c ?? "",
            topic: d ?? "",
            isDm: a,
            onClose: b
          }) : o.jsxs(E, {
            gap: "400",
            children: [
              o.jsxs(E, {
                grow: "Yes",
                direction: "Column",
                gap: "300",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        className: Pi,
                        size: "H5",
                        children: c ?? "Unknown"
                      }),
                      d && o.jsx(D, {
                        className: gt(Pi, IA),
                        size: "T200",
                        children: o.jsx(nF, {
                          options: fs,
                          children: d
                        })
                      })
                    ]
                  }),
                  m && o.jsx(E, {
                    gap: "200",
                    children: o.jsx(Qe, {
                      variant: "Secondary",
                      fill: "Soft",
                      radii: "300",
                      before: o.jsx(Q, {
                        size: "50",
                        src: q.Pencil
                      }),
                      onClick: () => w(true),
                      outlined: true,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Edit"
                      })
                    })
                  })
                ]
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(xn, {
                  size: "500",
                  radii: "300",
                  children: o.jsx(yi, {
                    roomId: r.roomId,
                    src: v,
                    alt: c,
                    renderFallback: () => o.jsx(Ya, {
                      roomType: r.getType(),
                      size: "400",
                      joinRule: (u == null ? void 0 : u.join_rule) ?? kn.Invite,
                      filled: true
                    })
                  })
                })
              })
            ]
          })
        }),
        r.isSpaceRoom() && o.jsx(Te, {
          className: lh,
          variant: "SurfaceVariant",
          direction: "Column",
          gap: "400",
          disabled: !m,
          children: o.jsx(Qst, {
            permissions: t,
            bannerURI: C ?? void 0
          })
        })
      ]
    });
  }
  const elt = (t) => {
    const e = be(), [n, r] = Et(p.useCallback(async () => (await e.getRoomDirectoryVisibility(t)).visibility === s1.Public, [
      e,
      t
    ]));
    p.useEffect(() => {
      r();
    }, [
      r
    ]);
    const i = p.useCallback(async (a) => {
      await e.setRoomDirectoryVisibility(t, a ? s1.Public : s1.Private), await r();
    }, [
      e,
      t,
      r
    ]);
    return {
      visibilityState: n,
      setVisibility: i
    };
  };
  function Hme({ permissions: t }) {
    var _a6, _b3;
    const e = be(), n = cr(), r = t.stateEvent(ce.RoomCanonicalAlias, e.getSafeUserId()), s = ((_b3 = (_a6 = $i(n, ce.RoomJoinRules)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.join_rule) ?? kn.Invite, { visibilityState: l, setVisibility: c } = elt(n.roomId), [d, u] = Et(c), h = l.status === ve.Loading || d.status === ve.Loading, f = s === kn.Public || s === kn.Knock || s === "knock_restricted";
    return o.jsx(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: o.jsxs(Ie, {
        title: "Publish to Directory",
        description: n.isSpaceRoom() ? "List the space in the public directory to make it discoverable by others." : "List the room in the public directory to make it discoverable by others.",
        after: o.jsxs(E, {
          gap: "200",
          alignItems: "Center",
          children: [
            h && o.jsx(dt, {
              variant: "Secondary"
            }),
            !h && l.status === ve.Success && o.jsx(Jt, {
              value: l.data,
              onChange: u,
              disabled: !r || !f
            })
          ]
        }),
        children: [
          l.status === ve.Error && o.jsx(D, {
            style: {
              color: ct.Critical.Main
            },
            size: "T200",
            children: l.error.message
          }),
          d.status === ve.Error && o.jsx(D, {
            style: {
              color: ct.Critical.Main
            },
            size: "T200",
            children: d.error.message
          })
        ]
      })
    });
  }
  function tlt({ requestClose: t }) {
    const e = be(), n = cr(), r = Kr(), i = ri(n), s = XF()["m.room_versions"], [l, c] = p.useState((s == null ? void 0 : s.default) ?? "1");
    p.useEffect(() => {
      c((s == null ? void 0 : s.default) ?? "1");
    }, [
      s == null ? void 0 : s.default
    ]);
    const d = BF(l), { additionalCreators: u, addAdditionalCreator: h, removeAdditionalCreator: f } = $O(Array.from(i)), [g, m] = Et(p.useCallback(async (w, b) => {
      await e.http.authedRequest(rt.Post, `/rooms/${n.roomId}/upgrade`, void 0, {
        new_version: w,
        additional_creators: b
      });
    }, [
      e,
      n
    ])), v = g.status === ve.Loading, y = () => {
      m(l, d ? u : void 0).then(() => {
        r() && t();
      });
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: t,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: n.isSpaceRoom() ? "Space Upgrade" : "Room Upgrade"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: t,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsx(D, {
                    priority: "400",
                    style: {
                      color: ct.Critical.Main
                    },
                    children: o.jsx("b", {
                      children: "This action is irreversible!"
                    })
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Options"
                      }),
                      o.jsx(VO, {
                        versions: (s == null ? void 0 : s.available) ? Object.keys(s.available) : [
                          "1"
                        ],
                        value: l,
                        onChange: c,
                        disabled: v
                      }),
                      d && o.jsx(Te, {
                        style: {
                          padding: ee.space.S300
                        },
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "500",
                        children: o.jsx(WO, {
                          additionalCreators: u,
                          onSelect: h,
                          onRemove: f,
                          disabled: v
                        })
                      })
                    ]
                  }),
                  g.status === ve.Error && o.jsx(D, {
                    className: Pi,
                    style: {
                      color: ct.Critical.Main
                    },
                    size: "T200",
                    children: g.error.message
                  }),
                  o.jsx(xe, {
                    onClick: y,
                    variant: "Secondary",
                    disabled: v,
                    before: v && o.jsx(dt, {
                      size: "200",
                      variant: "Secondary",
                      fill: "Solid"
                    }),
                    children: o.jsx(D, {
                      size: "B400",
                      children: n.isSpaceRoom() ? "Upgrade Space" : "Upgrade Room"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function $me({ permissions: t, requestClose: e }) {
    var _a6, _b3, _c3;
    const n = be(), r = cr(), { navigateRoom: i, navigateSpace: a } = Wi(), s = (_a6 = $i(r, ce.RoomCreate)) == null ? void 0 : _a6.getContent(), l = (s == null ? void 0 : s.room_version) ?? "1", c = (_b3 = s == null ? void 0 : s.predecessor) == null ? void 0 : _b3.room_id, d = (_c3 = $i(r, ce.RoomTombstone)) == null ? void 0 : _c3.getContent(), u = d == null ? void 0 : d.replacement_room, h = t.stateEvent(ce.RoomTombstone, n.getSafeUserId()), f = () => {
      u && (e(), r.isSpaceRoom() ? a(u) : i(u));
    }, g = () => {
      var _a7;
      c && (e(), r.isSpaceRoom() ? a(c) : i(c, (_a7 = s.predecessor) == null ? void 0 : _a7.event_id));
    }, [m, v] = p.useState(false);
    return o.jsx(Te, {
      className: lh,
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "400",
      children: o.jsx(Ie, {
        title: r.isSpaceRoom() ? "Upgrade Space" : "Upgrade Room",
        description: u ? d.body || `This ${r.isSpaceRoom() ? "space" : "room"} has been replaced!` : `Current version: ${l}.`,
        after: o.jsxs(E, {
          alignItems: "Center",
          gap: "200",
          children: [
            c && o.jsx(xe, {
              size: "300",
              variant: "Secondary",
              fill: "Soft",
              outlined: true,
              radii: "300",
              onClick: g,
              children: o.jsx(D, {
                size: "B300",
                children: r.isSpaceRoom() ? "Old Space" : "Old Room"
              })
            }),
            u ? o.jsx(xe, {
              size: "300",
              variant: "Success",
              fill: "Solid",
              radii: "300",
              onClick: f,
              children: o.jsx(D, {
                size: "B300",
                children: r.isSpaceRoom() ? "Open New Space" : "Open New Room"
              })
            }) : o.jsx(xe, {
              size: "300",
              variant: "Secondary",
              fill: "Solid",
              radii: "300",
              disabled: !h,
              onClick: () => v(true),
              children: o.jsx(D, {
                size: "B300",
                children: "Upgrade"
              })
            })
          ]
        }),
        children: m && o.jsx(tlt, {
          requestClose: () => v(false)
        })
      })
    });
  }
  function nlt({ requestClose: t }) {
    const e = cr(), n = Mo(e), r = ri(e), i = Ki(r, n);
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "General"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsx(Vme, {
                    permissions: i
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Options"
                      }),
                      o.jsx(Ume, {
                        permissions: i
                      }),
                      o.jsx(Gst, {
                        permissions: i
                      }),
                      o.jsx(Wst, {
                        permissions: i
                      }),
                      o.jsx(Hme, {
                        permissions: i
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Addresses"
                      }),
                      o.jsx(Nme, {
                        permissions: i
                      }),
                      o.jsx(zme, {
                        permissions: i
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Advanced Options"
                      }),
                      o.jsx($me, {
                        permissions: i,
                        requestClose: t
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  function Wme({ requestClose: t, isSpace: e }) {
    var _a6;
    const n = cr(), r = be(), i = Mo(n), a = ri(n), s = Ki(a, i), l = r.getUserId() ?? "", d = (_a6 = $i(n, Pn.RoomAbbreviations)) == null ? void 0 : _a6.getContent(), u = Array.isArray(d == null ? void 0 : d.entries) ? d.entries : [], h = Ze(vi), [f, g] = Nk();
    vl(r, p.useCallback((x) => {
      if (x.getType() !== Pn.RoomAbbreviations) return;
      const S = x.getRoomId();
      S && sa(h, n.roomId).has(S) && g();
    }, [
      n.roomId,
      h,
      g
    ]));
    const m = p.useMemo(() => Array.from(sa(h, n.roomId)).reduce((x, S) => {
      var _a7;
      const T = r.getRoom(S);
      if (!T) return x;
      const B = (_a7 = ni(T, Pn.RoomAbbreviations)) == null ? void 0 : _a7.getContent(), U = Array.isArray(B == null ? void 0 : B.entries) ? B.entries : [];
      return U.length > 0 && x.push({
        spaceId: S,
        spaceName: T.name,
        entries: U
      }), x;
    }, []), [
      r,
      h,
      n.roomId,
      f
    ]), v = p.useMemo(() => m.flatMap((x) => x.entries), [
      m
    ]), y = s.stateEvent(Pn.RoomAbbreviations, l), [w, b] = Et(p.useCallback(async (x) => {
      const S = {
        entries: x
      };
      await r.sendStateEvent(n.roomId, Pn.RoomAbbreviations, S, "");
    }, [
      r,
      n.roomId
    ])), j = w.status === ve.Loading, k = (x) => {
      if (x.preventDefault(), j || !y) return;
      const S = x.target, T = S.elements.namedItem("term"), A = S.elements.namedItem("definition");
      if (!T || !A) return;
      const B = T.value.trim(), U = A.value.trim();
      if (!B || !U) return;
      if (u.some((M) => M.term.toLowerCase() === B.toLowerCase()) || v.some((M) => M.term.toLowerCase() === B.toLowerCase())) {
        T.setCustomValidity("This term already exists."), T.reportValidity();
        return;
      }
      T.setCustomValidity("");
      const O = [
        ...u,
        {
          term: B,
          definition: U
        }
      ];
      b(O).then(() => {
        S.reset();
      });
    }, C = (x) => {
      if (j || !y) return;
      const S = u.filter((T, A) => A !== x);
      b(S);
    };
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Abbreviations"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  y && o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Add Abbreviation"
                      }),
                      o.jsx(Te, {
                        className: hi,
                        variant: "SurfaceVariant",
                        direction: "Column",
                        gap: "400",
                        children: o.jsx(Ie, {
                          title: "New Entry",
                          description: "Define a term that members can hover over to see its meaning.",
                          children: o.jsxs(E, {
                            style: {
                              marginTop: ee.space.S200
                            },
                            as: "form",
                            onSubmit: k,
                            direction: "Column",
                            gap: "400",
                            children: [
                              o.jsxs(E, {
                                direction: "Column",
                                gap: "100",
                                children: [
                                  o.jsx(D, {
                                    size: "L400",
                                    children: "Term"
                                  }),
                                  o.jsx(mn, {
                                    name: "term",
                                    required: true,
                                    size: "400",
                                    variant: "Secondary",
                                    radii: "300",
                                    placeholder: "e.g. FOSS",
                                    readOnly: j,
                                    onChange: (x) => x.currentTarget.setCustomValidity("")
                                  })
                                ]
                              }),
                              o.jsxs(E, {
                                direction: "Column",
                                gap: "100",
                                children: [
                                  o.jsx(D, {
                                    size: "L400",
                                    children: "Definition"
                                  }),
                                  o.jsx(mn, {
                                    name: "definition",
                                    required: true,
                                    size: "400",
                                    variant: "Secondary",
                                    radii: "300",
                                    placeholder: "e.g. Free and Open Source Software",
                                    readOnly: j
                                  })
                                ]
                              }),
                              w.status === ve.Error && o.jsx(D, {
                                size: "T200",
                                style: {
                                  color: "var(--mx-danger)"
                                },
                                children: w.error.message
                              }),
                              o.jsx(E, {
                                gap: "200",
                                children: o.jsx(xe, {
                                  type: "submit",
                                  size: "300",
                                  variant: "Primary",
                                  radii: "300",
                                  disabled: j,
                                  before: j ? o.jsx(dt, {
                                    size: "100",
                                    variant: "Primary"
                                  }) : void 0,
                                  children: o.jsx(D, {
                                    size: "B300",
                                    children: j ? "Saving\u2026" : "Add"
                                  })
                                })
                              })
                            ]
                          })
                        })
                      })
                    ]
                  }),
                  o.jsx(E, {
                    direction: "Column",
                    gap: "100",
                    children: (() => {
                      const x = u.length + (e ? 0 : v.length), S = e ? "Space" : "Room";
                      return o.jsxs(o.Fragment, {
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: x > 0 ? `${S} Abbreviations (${x})` : `${S} Abbreviations`
                          }),
                          x === 0 ? o.jsx(Te, {
                            className: hi,
                            variant: "SurfaceVariant",
                            direction: "Column",
                            children: o.jsxs(D, {
                              size: "T300",
                              style: {
                                color: "var(--mx-surface-variant-on)"
                              },
                              children: [
                                "No ",
                                e ? "space" : "room",
                                "-level abbreviations defined yet.",
                                y && " Use the form above to add some."
                              ]
                            })
                          }) : o.jsxs(o.Fragment, {
                            children: [
                              u.map((T, A) => o.jsxs(Te, {
                                className: hi,
                                variant: "SurfaceVariant",
                                direction: "Row",
                                gap: "400",
                                alignItems: "Center",
                                children: [
                                  o.jsxs(E, {
                                    grow: "Yes",
                                    direction: "Column",
                                    gap: "100",
                                    children: [
                                      o.jsx(D, {
                                        size: "T300",
                                        children: o.jsx("b", {
                                          children: T.term
                                        })
                                      }),
                                      o.jsx(D, {
                                        size: "T200",
                                        style: {
                                          opacity: 0.7
                                        },
                                        children: T.definition
                                      })
                                    ]
                                  }),
                                  y && o.jsx(E, {
                                    shrink: "No",
                                    children: o.jsx(Oe, {
                                      onClick: () => C(A),
                                      variant: "Background",
                                      size: "300",
                                      radii: "300",
                                      disabled: j,
                                      "aria-label": `Remove abbreviation ${T.term}`,
                                      children: o.jsx(Q, {
                                        src: q.Delete,
                                        size: "100"
                                      })
                                    })
                                  })
                                ]
                              }, T.term)),
                              !e && m.flatMap(({ spaceId: T, spaceName: A, entries: B }) => B.map((U) => o.jsx(Te, {
                                className: hi,
                                variant: "SurfaceVariant",
                                direction: "Row",
                                gap: "400",
                                alignItems: "Center",
                                children: o.jsxs(E, {
                                  grow: "Yes",
                                  direction: "Column",
                                  gap: "100",
                                  children: [
                                    o.jsxs(E, {
                                      gap: "200",
                                      alignItems: "Center",
                                      children: [
                                        o.jsx(D, {
                                          size: "T300",
                                          children: o.jsx("b", {
                                            children: U.term
                                          })
                                        }),
                                        o.jsx(Qe, {
                                          variant: "Primary",
                                          radii: "Pill",
                                          size: "400",
                                          children: o.jsxs(D, {
                                            size: "T200",
                                            children: [
                                              "Space - ",
                                              A
                                            ]
                                          })
                                        })
                                      ]
                                    }),
                                    o.jsx(D, {
                                      size: "T200",
                                      style: {
                                        opacity: 0.7
                                      },
                                      children: U.definition
                                    })
                                  ]
                                })
                              }, `${T}-${U.term}`)))
                            ]
                          })
                        ]
                      });
                    })()
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const rlt = () => p.useMemo(() => [
    {
      page: Ao.GeneralPage,
      name: "General",
      icon: q.Setting
    },
    {
      page: Ao.MembersPage,
      name: "Members",
      icon: q.User
    },
    {
      page: Ao.PermissionsPage,
      name: "Permissions",
      icon: q.Lock
    },
    {
      page: Ao.CosmeticsPage,
      name: "Cosmetics",
      icon: q.Alphabet,
      activeIcon: q.AlphabetUnderline
    },
    {
      page: Ao.AbbreviationsPage,
      name: "Abbreviations",
      icon: q.Info
    },
    {
      page: Ao.EmojisStickersPage,
      name: "Emojis & Stickers",
      icon: q.Smile
    },
    {
      page: Ao.DeveloperToolsPage,
      name: "Developer Tools",
      icon: q.Terminal
    }
  ], []);
  function ilt({ initialPage: t, requestClose: e }) {
    const n = cr(), r = be(), i = hn(), a = Ze(gi), [s] = Fe(ge, "customDMCards"), l = Ip(n, a.has(n.roomId) && !s), c = rc(n), d = xS(n), u = l ? Cn(r, l, i, 96, 96, "crop") ?? void 0 : void 0, h = fr(), [f, g] = p.useState(() => t || (h === sn.Mobile ? void 0 : Ao.GeneralPage)), m = rlt(), v = () => {
      if (h === sn.Mobile) {
        g(void 0);
        return;
      }
      e();
    }, y = () => {
      h === sn.Mobile && e();
    };
    return o.jsx(Tme, {
      direction: "right",
      onClose: y,
      children: o.jsxs(df, {
        nav: h === sn.Mobile && f !== void 0 ? void 0 : o.jsxs(qf, {
          size: "300",
          children: [
            o.jsxs(Kf, {
              outlined: false,
              children: [
                o.jsxs(E, {
                  grow: "Yes",
                  gap: "200",
                  children: [
                    o.jsx(xn, {
                      size: "200",
                      radii: "300",
                      children: o.jsx(yi, {
                        roomId: n.roomId,
                        src: u,
                        alt: c,
                        renderFallback: () => o.jsx(Ya, {
                          size: "50",
                          roomType: n.getType(),
                          joinRule: (d == null ? void 0 : d.join_rule) ?? kn.Invite,
                          filled: true
                        })
                      })
                    }),
                    o.jsx(D, {
                      size: "H4",
                      truncate: true,
                      children: c
                    })
                  ]
                }),
                o.jsx(E, {
                  shrink: "No",
                  children: h === sn.Mobile && o.jsx(Oe, {
                    onClick: e,
                    variant: "Background",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                })
              ]
            }),
            o.jsx(E, {
              grow: "Yes",
              direction: "Column",
              children: o.jsx(mh, {
                children: o.jsx("div", {
                  style: {
                    flexGrow: 1
                  },
                  children: m.map((w) => {
                    const b = f === w.page && w.activeIcon ? w.activeIcon : w.icon;
                    return o.jsx(Ye, {
                      variant: "Background",
                      radii: "400",
                      "aria-pressed": f === w.page,
                      before: o.jsx(Q, {
                        src: b,
                        size: "100",
                        filled: f === w.page
                      }),
                      onClick: () => g(w.page),
                      children: o.jsx(D, {
                        style: {
                          fontWeight: f === w.page ? ee.fontWeight.W600 : void 0
                        },
                        size: "T300",
                        truncate: true,
                        children: w.name
                      })
                    }, w.name);
                  })
                })
              })
            })
          ]
        }),
        children: [
          f === Ao.GeneralPage && o.jsx(nlt, {
            requestClose: v
          }),
          f === Ao.MembersPage && o.jsx(Rme, {
            requestClose: v
          }),
          f === Ao.PermissionsPage && o.jsx(Nst, {
            requestClose: v
          }),
          f === Ao.CosmeticsPage && o.jsx(Bme, {
            requestClose: v
          }),
          f === Ao.EmojisStickersPage && o.jsx(Ame, {
            requestClose: v
          }),
          f === Ao.DeveloperToolsPage && o.jsx(Ime, {
            requestClose: v
          }),
          f === Ao.AbbreviationsPage && o.jsx(Wme, {
            requestClose: v
          })
        ]
      })
    });
  }
  function olt({ state: t }) {
    const { roomId: e, spaceId: n, page: r } = t, i = _Ge(), a = td(), s = ec(a), l = s(e), c = n ? s(n) : void 0;
    return l ? o.jsx(yS, {
      requestClose: i,
      children: o.jsx(WF, {
        value: c ?? null,
        children: o.jsx(dp, {
          value: l,
          children: o.jsx(ilt, {
            initialPage: r,
            requestClose: i
          })
        })
      })
    }) : null;
  }
  function alt() {
    const t = vGe();
    return t ? o.jsx(olt, {
      state: t
    }) : null;
  }
  function slt({ requestClose: t }) {
    const e = cr(), n = Mo(e), r = ri(e), i = Ki(r, n);
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "General"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsx(Vme, {
                    permissions: i
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Options"
                      }),
                      o.jsx(Ume, {
                        permissions: i
                      }),
                      o.jsx(Hme, {
                        permissions: i
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Addresses"
                      }),
                      o.jsx(Nme, {
                        permissions: i
                      }),
                      o.jsx(zme, {
                        permissions: i
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Advanced Options"
                      }),
                      o.jsx($me, {
                        permissions: i,
                        requestClose: t
                      })
                    ]
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const llt = () => p.useMemo(() => {
    const e = {
      name: "Manage",
      items: [
        {
          location: {
            state: true,
            key: ce.SpaceChild
          },
          name: "Manage space rooms"
        },
        {
          location: {},
          name: "Message Events"
        }
      ]
    }, n = {
      name: "Moderation",
      items: [
        {
          location: {
            action: true,
            key: "invite"
          },
          name: "Invite"
        },
        {
          location: {
            action: true,
            key: "kick"
          },
          name: "Kick"
        },
        {
          location: {
            action: true,
            key: "ban"
          },
          name: "Ban"
        }
      ]
    }, r = {
      name: "Space Overview",
      items: [
        {
          location: {
            state: true,
            key: ce.RoomAvatar
          },
          name: "Space Avatar"
        },
        {
          location: {
            state: true,
            key: ce.RoomName
          },
          name: "Space Name"
        },
        {
          location: {
            state: true,
            key: ce.RoomTopic
          },
          name: "Space Topic"
        }
      ]
    }, i = {
      name: "Settings",
      items: [
        {
          location: {
            state: true,
            key: ce.RoomJoinRules
          },
          name: "Change Space Access"
        },
        {
          location: {
            state: true,
            key: ce.RoomCanonicalAlias
          },
          name: "Publish Address"
        },
        {
          location: {
            state: true,
            key: ce.RoomPowerLevels
          },
          name: "Change All Permission"
        },
        {
          location: {
            state: true,
            key: Pn.PowerLevelTags
          },
          name: "Edit Power Levels"
        },
        {
          location: {
            state: true,
            key: ce.RoomTombstone
          },
          name: "Upgrade Space"
        },
        {
          location: {
            state: true
          },
          name: "Other Settings"
        }
      ]
    }, a = {
      name: "Other",
      items: [
        {
          location: {
            state: true,
            key: Pn.PoniesRoomEmotes
          },
          name: "Manage Emojis & Stickers"
        },
        {
          location: {
            state: true,
            key: ce.RoomServerAcl
          },
          name: "Change Server ACLs"
        }
      ]
    };
    return [
      e,
      n,
      r,
      i,
      a
    ];
  }, []);
  function clt({ requestClose: t }) {
    const e = be(), n = cr(), r = Mo(n), i = ri(n), a = Ki(i, r), s = a.stateEvent(Pn.PowerLevelTags, e.getSafeUserId()), l = a.stateEvent(ce.RoomPowerLevels, e.getSafeUserId()), c = llt(), [d, u] = p.useState(false), h = () => {
      u(true);
    };
    return s && d ? o.jsx(Ome, {
      powerLevels: r,
      requestClose: () => u(false)
    }) : o.jsxs(si, {
      children: [
        o.jsx(_i, {
          outlined: false,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: "Permissions"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  onClick: t,
                  variant: "Surface",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "700",
                children: [
                  o.jsx(Mme, {
                    powerLevels: r,
                    onEdit: s ? h : void 0,
                    permissionGroups: c
                  }),
                  o.jsx(Pme, {
                    canEdit: l,
                    powerLevels: r,
                    permissionGroups: c
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const dlt = () => p.useMemo(() => [
    {
      page: Ro.GeneralPage,
      name: "General",
      icon: q.Setting
    },
    {
      page: Ro.MembersPage,
      name: "Members",
      icon: q.User
    },
    {
      page: Ro.PermissionsPage,
      name: "Permissions",
      icon: q.Lock
    },
    {
      page: Ro.CosmeticsPage,
      name: "Cosmetics",
      icon: q.Alphabet,
      activeIcon: q.AlphabetUnderline
    },
    {
      page: Ro.AbbreviationsPage,
      name: "Abbreviations",
      icon: q.Info
    },
    {
      page: Ro.EmojisStickersPage,
      name: "Emojis & Stickers",
      icon: q.Smile
    },
    {
      page: Ro.DeveloperToolsPage,
      name: "Developer Tools",
      icon: q.Terminal
    },
    {
      page: Ro.AppearancePage,
      name: "Appearance",
      icon: q.Alphabet,
      activeIcon: q.AlphabetUnderline
    }
  ], []);
  function ult({ initialPage: t, requestClose: e }) {
    const n = cr(), r = be(), i = hn(), a = Ze(gi), s = Ip(n, a.has(n.roomId)), l = rc(n), c = xS(n), d = s ? Cn(r, s, i, 96, 96, "crop") ?? void 0 : void 0, u = fr(), [h, f] = p.useState(() => t || (u === sn.Mobile ? void 0 : Ro.GeneralPage)), g = dlt(), m = () => {
      if (u === sn.Mobile) {
        f(void 0);
        return;
      }
      e();
    };
    return o.jsxs(df, {
      nav: u === sn.Mobile && h !== void 0 ? void 0 : o.jsxs(qf, {
        size: "300",
        children: [
          o.jsxs(Kf, {
            outlined: false,
            children: [
              o.jsxs(E, {
                grow: "Yes",
                gap: "200",
                children: [
                  o.jsx(xn, {
                    size: "200",
                    radii: "300",
                    children: o.jsx(yi, {
                      roomId: n.roomId,
                      src: d,
                      alt: l,
                      renderFallback: () => o.jsx(Ya, {
                        roomType: n.getType(),
                        size: "50",
                        joinRule: (c == null ? void 0 : c.join_rule) ?? kn.Invite,
                        filled: true
                      })
                    })
                  }),
                  o.jsx(D, {
                    size: "H4",
                    truncate: true,
                    children: l
                  })
                ]
              }),
              o.jsx(E, {
                shrink: "No",
                children: u === sn.Mobile && o.jsx(Oe, {
                  onClick: e,
                  variant: "Background",
                  children: o.jsx(Q, {
                    src: q.Cross
                  })
                })
              })
            ]
          }),
          o.jsx(E, {
            grow: "Yes",
            direction: "Column",
            children: o.jsx(mh, {
              children: o.jsx("div", {
                style: {
                  flexGrow: 1
                },
                children: g.map((v) => {
                  const y = h === v.page && v.activeIcon ? v.activeIcon : v.icon;
                  return o.jsx(Ye, {
                    variant: "Background",
                    radii: "400",
                    "aria-pressed": h === v.page,
                    before: o.jsx(Q, {
                      src: y,
                      size: "100",
                      filled: h === v.page
                    }),
                    onClick: () => f(v.page),
                    children: o.jsx(D, {
                      style: {
                        fontWeight: h === v.page ? ee.fontWeight.W600 : void 0
                      },
                      size: "T300",
                      truncate: true,
                      children: v.name
                    })
                  }, v.name);
                })
              })
            })
          })
        ]
      }),
      children: [
        h === Ro.GeneralPage && o.jsx(slt, {
          requestClose: m
        }),
        h === Ro.MembersPage && o.jsx(Rme, {
          requestClose: m
        }),
        h === Ro.PermissionsPage && o.jsx(clt, {
          requestClose: m
        }),
        h === Ro.CosmeticsPage && o.jsx(Bme, {
          requestClose: m
        }),
        h === Ro.EmojisStickersPage && o.jsx(Ame, {
          requestClose: m
        }),
        h === Ro.DeveloperToolsPage && o.jsx(Ime, {
          requestClose: m
        }),
        h === Ro.AbbreviationsPage && o.jsx(Wme, {
          isSpace: true,
          requestClose: m
        }),
        h === Ro.AppearancePage && o.jsx(_Ve, {
          requestClose: m
        })
      ]
    });
  }
  function hlt({ state: t }) {
    const { roomId: e, spaceId: n, page: r } = t, i = $at(), a = td(), s = ec(a), l = s(e), c = n && n !== e ? s(n) : void 0;
    return l ? o.jsx(yS, {
      requestClose: i,
      children: o.jsx(WF, {
        value: c ?? null,
        children: o.jsx(dp, {
          value: l,
          children: o.jsx(ult, {
            initialPage: r,
            requestClose: i
          })
        })
      })
    }) : null;
  }
  function flt() {
    const t = Hat();
    return t ? o.jsx(hlt, {
      state: t
    }) : null;
  }
  const mlt = (t, e) => {
    const n = t.getMember(e), [r, i] = p.useState(() => (n == null ? void 0 : n.membership) ?? Ht.Leave);
    return p.useEffect(() => {
      const a = (s, l) => {
        s.getRoomId() === t.roomId && l.userId === e && i(l.membership ?? Ht.Leave);
      };
      return n == null ? void 0 : n.on(Ui.Membership, a), () => {
        n == null ? void 0 : n.removeListener(Ui.Membership, a);
      };
    }, [
      t,
      n,
      e
    ]), r;
  }, qme = (t, e) => ({
    hasMorePower: p.useCallback((r, i) => {
      const a = t.has(r), s = t.has(i);
      if (a && s) return false;
      if (a) return true;
      if (s) return false;
      const l = va.user(e, r), c = va.user(e, i);
      return l > c;
    }, [
      t,
      e
    ])
  });
  function Io(t, e) {
    const n = t.backgroundColor, r = {
      ...t
    };
    return typeof n == "string" && n !== "" && n !== "transparent" && (r["--user-hero-menu-item-bg"] = n), e != null && (r["--user-hero-chip-hover-brightness"] = e), r;
  }
  var glt = "styles_UserHero__1eorsy91", plt = "styles_UserHeroCoverContainer__1eorsy92", VX = "styles_UserHeroCover__1eorsy93", HX = "styles_UserHeroCoverFallback__1eorsy94", Flt = "styles_UserHeroAvatarStatusContainer__1eorsy95", vlt = "styles_UserHeroAvatarContainer__1eorsy96", _lt = "styles_UserAvatarContainer__1eorsy97", ylt = "styles_UserHeroStatusContainer__1eorsy98", blt = "styles_UserHeroStatusTooltip__1eorsy99", xlt = "styles_UserHeroStatusTooltipInteractive__1eorsy9a", wlt = "styles_UserHeroAvatar__1eorsy9b", Dlt = "styles_UserHeroAvatarImg__1eorsy9c", dv = "styles_UserHeroBrightnessHover__1eorsy9d", Clt = "styles_UserHeroChip__1eorsy9e styles_UserHeroBrightnessHover__1eorsy9d", Mp = "styles_UserHeroChipThemed__1eorsy9f styles_UserHeroBrightnessHover__1eorsy9d", qT = "styles_MiscDataToggleButton__1eorsy9g", cl = "styles_UserHeroMenuItem__1eorsy9h";
  function Elt({ innerColor: t, cardColor: e, textColor: n, chipSurfaceStyle: r, chipFillColor: i, chipHoverBrightness: a }) {
    const s = i ?? e, l = be(), c = hn(), d = cr(), u = ka(), h = Bp(), f = lv(), [g, m] = p.useState(), v = Ep(), y = v.icon && qc(l, c, v.icon), w = (j) => {
      m(j.currentTarget.getBoundingClientRect());
    }, b = () => m(void 0);
    return o.jsx(ln, {
      anchor: g,
      position: "Bottom",
      align: "Start",
      offset: 4,
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: b,
          clickOutsideDeactivates: true,
          escapeDeactivates: kt,
          isKeyForward: (j) => Yt.isKeyHotkey("arrowdown", j),
          isKeyBackward: (j) => Yt.isKeyHotkey("arrowup", j)
        },
        children: o.jsx(tn, {
          children: o.jsx("div", {
            style: {
              padding: ee.space.S100,
              backgroundColor: t
            },
            children: o.jsx(Ye, {
              variant: "Surface",
              fill: "None",
              className: cl,
              style: Io({
                backgroundColor: s,
                color: n
              }, a),
              size: "300",
              radii: "300",
              onClick: () => {
                d.isSpaceRoom() ? f(d.roomId, u == null ? void 0 : u.roomId, Ro.PermissionsPage) : h(d.roomId, u == null ? void 0 : u.roomId, Ao.PermissionsPage), b();
              },
              children: o.jsx(D, {
                size: "B300",
                children: "Manage Powers"
              })
            })
          })
        })
      }),
      children: o.jsx(Qe, {
        variant: e ? void 0 : "Success",
        outlined: !e,
        radii: "Pill",
        before: g ? o.jsx(Q, {
          size: "50",
          src: q.ChevronBottom
        }) : o.jsx(Hf, {
          color: v.color
        }),
        after: y ? o.jsx(Zc, {
          size: "50",
          iconSrc: y
        }) : void 0,
        onClick: w,
        "aria-pressed": !!g,
        className: e ? Mp : dv,
        style: Io(e && r ? r : {}, a),
        children: o.jsx(D, {
          size: "B300",
          truncate: true,
          children: v.name
        })
      })
    });
  }
  function klt({ reason: t, kickedBy: e, ts: n }) {
    const [r] = Fe(ge, "hour24Clock"), [i] = Fe(ge, "dateFormatString"), a = n ? eu(n, r) : void 0, s = n ? cF(n, i) : void 0;
    return o.jsx(Gc, {
      style: {
        padding: ee.space.S200
      },
      variant: "Critical",
      children: o.jsx(Ie, {
        children: o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            o.jsxs(E, {
              gap: "200",
              justifyContent: "SpaceBetween",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Kicked User"
                }),
                a && s && o.jsxs(D, {
                  size: "T200",
                  children: [
                    s,
                    " ",
                    a
                  ]
                })
              ]
            }),
            o.jsxs(E, {
              direction: "Column",
              children: [
                e && o.jsxs(D, {
                  size: "T200",
                  children: [
                    "Kicked by: ",
                    o.jsx("b", {
                      children: e
                    })
                  ]
                }),
                o.jsx(D, {
                  size: "T200",
                  children: t ? o.jsxs(o.Fragment, {
                    children: [
                      "Reason: ",
                      o.jsx("b", {
                        children: t
                      })
                    ]
                  }) : o.jsx("i", {
                    children: "No Reason Provided."
                  })
                })
              ]
            })
          ]
        })
      })
    });
  }
  function Slt({ userId: t, reason: e, canUnban: n, bannedBy: r, ts: i }) {
    const a = be(), s = cr(), [l] = Fe(ge, "hour24Clock"), [c] = Fe(ge, "dateFormatString"), d = i ? eu(i, l) : void 0, u = i ? cF(i, c) : void 0, [h, f] = Et(p.useCallback(async () => {
      await a.unban(s.roomId, t);
    }, [
      a,
      s,
      t
    ])), g = h.status === ve.Loading, m = h.status === ve.Error;
    return o.jsx(Gc, {
      style: {
        padding: ee.space.S200
      },
      variant: "Critical",
      children: o.jsx(Ie, {
        children: o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            o.jsxs(E, {
              gap: "200",
              justifyContent: "SpaceBetween",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Banned User"
                }),
                d && u && o.jsxs(D, {
                  size: "T200",
                  children: [
                    u,
                    " ",
                    d
                  ]
                })
              ]
            }),
            o.jsxs(E, {
              direction: "Column",
              children: [
                r && o.jsxs(D, {
                  size: "T200",
                  children: [
                    "Banned by: ",
                    o.jsx("b", {
                      children: r
                    })
                  ]
                }),
                o.jsx(D, {
                  size: "T200",
                  children: e ? o.jsxs(o.Fragment, {
                    children: [
                      "Reason: ",
                      o.jsx("b", {
                        children: e
                      })
                    ]
                  }) : o.jsx("i", {
                    children: "No Reason Provided."
                  })
                })
              ]
            }),
            m && o.jsx(D, {
              className: Pi,
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: h.error.message
              })
            }),
            n && o.jsx(xe, {
              size: "300",
              variant: "Critical",
              radii: "300",
              onClick: f,
              before: g && o.jsx(dt, {
                size: "100",
                variant: "Critical",
                fill: "Solid"
              }),
              disabled: g,
              children: o.jsx(D, {
                size: "B300",
                children: "Unban"
              })
            })
          ]
        })
      })
    });
  }
  function jlt({ userId: t, reason: e, canKick: n, invitedBy: r, ts: i }) {
    const a = be(), s = cr(), [l] = Fe(ge, "hour24Clock"), [c] = Fe(ge, "dateFormatString"), d = i ? eu(i, l) : void 0, u = i ? cF(i, c) : void 0, [h, f] = Et(p.useCallback(async () => {
      await a.kick(s.roomId, t);
    }, [
      a,
      s,
      t
    ])), g = h.status === ve.Loading, m = h.status === ve.Error;
    return o.jsx(Gc, {
      style: {
        padding: ee.space.S200
      },
      variant: "Success",
      children: o.jsx(Ie, {
        children: o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            o.jsxs(E, {
              gap: "200",
              justifyContent: "SpaceBetween",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Invited User"
                }),
                d && u && o.jsxs(D, {
                  size: "T200",
                  children: [
                    u,
                    " ",
                    d
                  ]
                })
              ]
            }),
            o.jsxs(E, {
              direction: "Column",
              children: [
                r && o.jsxs(D, {
                  size: "T200",
                  children: [
                    "Invited by: ",
                    o.jsx("b", {
                      children: r
                    })
                  ]
                }),
                o.jsx(D, {
                  size: "T200",
                  children: e ? o.jsxs(o.Fragment, {
                    children: [
                      "Reason: ",
                      o.jsx("b", {
                        children: e
                      })
                    ]
                  }) : o.jsx("i", {
                    children: "No Reason Provided."
                  })
                })
              ]
            }),
            m && o.jsx(D, {
              className: Pi,
              size: "T200",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: h.error.message
              })
            }),
            n && o.jsx(xe, {
              size: "300",
              variant: "Success",
              fill: "Soft",
              outlined: true,
              radii: "300",
              onClick: f,
              before: g && o.jsx(dt, {
                size: "100",
                variant: "Success",
                fill: "Soft"
              }),
              disabled: g,
              children: o.jsx(D, {
                size: "B300",
                children: "Cancel Invite"
              })
            })
          ]
        })
      })
    });
  }
  function Tlt({ userId: t, canKick: e, canBan: n, canInvite: r }) {
    const i = be(), a = cr(), s = p.useRef(null), l = p.useCallback(() => {
      var _a6;
      const v = ((_a6 = s.current) == null ? void 0 : _a6.value.trim()) || void 0;
      return s.current && (s.current.value = ""), v;
    }, []), [c, d] = Et(p.useCallback(async () => {
      await i.kick(a.roomId, t, l());
    }, [
      i,
      a,
      t,
      l
    ])), [u, h] = Et(p.useCallback(async () => {
      await i.ban(a.roomId, t, l());
    }, [
      i,
      a,
      t,
      l
    ])), [f, g] = Et(p.useCallback(async () => {
      await i.invite(a.roomId, t, l());
    }, [
      i,
      a,
      t,
      l
    ])), m = c.status === ve.Loading || u.status === ve.Loading || f.status === ve.Loading;
    return !n && !e && !r ? null : o.jsx(E, {
      direction: "Column",
      gap: "400",
      children: o.jsxs(E, {
        direction: "Column",
        gap: "200",
        children: [
          o.jsxs(E, {
            grow: "Yes",
            direction: "Column",
            gap: "100",
            children: [
              o.jsx(D, {
                size: "L400",
                align: "Center",
                children: "Moderation"
              }),
              o.jsx(mn, {
                ref: s,
                placeholder: "Reason",
                size: "300",
                variant: "Background",
                radii: "300",
                disabled: m
              }),
              c.status === ve.Error && o.jsx(D, {
                style: {
                  color: ct.Critical.Main
                },
                className: Pi,
                size: "T200",
                children: o.jsx("b", {
                  children: c.error.message
                })
              }),
              u.status === ve.Error && o.jsx(D, {
                style: {
                  color: ct.Critical.Main
                },
                className: Pi,
                size: "T200",
                children: o.jsx("b", {
                  children: u.error.message
                })
              }),
              f.status === ve.Error && o.jsx(D, {
                style: {
                  color: ct.Critical.Main
                },
                className: Pi,
                size: "T200",
                children: o.jsx("b", {
                  children: f.error.message
                })
              })
            ]
          }),
          o.jsxs(E, {
            shrink: "No",
            gap: "200",
            children: [
              r && o.jsx(xe, {
                style: {
                  flexGrow: 1
                },
                size: "300",
                variant: "Secondary",
                fill: "Soft",
                radii: "300",
                before: f.status === ve.Loading ? o.jsx(dt, {
                  size: "50",
                  variant: "Secondary",
                  fill: "Soft"
                }) : o.jsx(Q, {
                  size: "50",
                  src: q.ArrowRight
                }),
                onClick: g,
                disabled: m,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Invite"
                })
              }),
              e && o.jsx(xe, {
                style: {
                  flexGrow: 1
                },
                size: "300",
                variant: "Critical",
                fill: "Soft",
                radii: "300",
                before: c.status === ve.Loading ? o.jsx(dt, {
                  size: "50",
                  variant: "Critical",
                  fill: "Soft"
                }) : o.jsx(Q, {
                  size: "50",
                  src: q.ArrowLeft
                }),
                onClick: d,
                disabled: m,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Kick"
                })
              }),
              n && o.jsx(xe, {
                style: {
                  flexGrow: 1
                },
                size: "300",
                variant: "Critical",
                fill: "Solid",
                radii: "300",
                before: u.status === ve.Loading ? o.jsx(dt, {
                  size: "50",
                  variant: "Critical",
                  fill: "Solid"
                }) : o.jsx(Q, {
                  size: "50",
                  src: q.Prohibited
                }),
                onClick: h,
                disabled: m,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Ban"
                })
              })
            ]
          })
        ]
      })
    });
  }
  function Rlt({ power: t, onCancel: e, onChange: n }) {
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: e,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Self Demotion"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: e,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400,
                  paddingTop: 0
                },
                direction: "Column",
                gap: "500",
                children: [
                  o.jsx(E, {
                    direction: "Column",
                    gap: "200",
                    children: o.jsx(D, {
                      priority: "400",
                      children: "You are about to demote yourself! You will not be able to regain this power yourself. Are you sure?"
                    })
                  }),
                  o.jsx(E, {
                    direction: "Column",
                    gap: "200",
                    children: o.jsx(xe, {
                      type: "submit",
                      variant: "Warning",
                      onClick: () => n(t),
                      children: o.jsx(D, {
                        size: "B400",
                        children: "Demote"
                      })
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function Alt({ power: t, onCancel: e, onChange: n }) {
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: e,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Shared Power"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: e,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400,
                  paddingTop: 0
                },
                direction: "Column",
                gap: "500",
                children: [
                  o.jsx(E, {
                    direction: "Column",
                    gap: "200",
                    children: o.jsx(D, {
                      priority: "400",
                      children: "You are promoting the user to have the same power as yourself! You will not be able to change their power afterward. Are you sure?"
                    })
                  }),
                  o.jsx(E, {
                    direction: "Column",
                    gap: "200",
                    children: o.jsx(xe, {
                      type: "submit",
                      variant: "Warning",
                      onClick: () => n(t),
                      children: o.jsx(D, {
                        size: "B400",
                        children: "Promote"
                      })
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  function Ilt({ userId: t, innerColor: e, cardColor: n, textColor: r, chipSurfaceStyle: i, chipFillColor: a, chipHoverBrightness: s }) {
    const l = a ?? n, c = be(), d = cr(), u = ka(), h = hn(), f = Bp(), g = lv(), m = Mo(d), v = ri(d), y = Ki(v, m), w = xP(m), { hasMorePower: b } = qme(v, m), j = yh(d, m), k = bh(d, v, m), C = c.getSafeUserId(), x = y.stateEvent(ce.RoomPowerLevels, C) && (C === t ? true : b(C, t)), S = k(t), T = S.icon && qc(c, h, S.icon), [A, B] = p.useState(), U = (ie) => {
      B(ie.currentTarget.getBoundingClientRect());
    }, z = () => B(void 0), [O, M] = Et(p.useCallback(async (ie) => {
      await c.setPowerLevel(d.roomId, t, ie);
    }, [
      c,
      t,
      d
    ])), I = O.status === ve.Loading, N = O.status === ve.Error, [L, H] = p.useState(), [V, Z] = p.useState(), Y = (ie) => {
      if (z(), !!x && ie !== w(t)) {
        if (t === c.getSafeUserId()) {
          H(ie);
          return;
        }
        if (!v.has(C) && ie === w(C)) {
          Z(ie);
          return;
        }
        M(ie);
      }
    }, oe = (ie) => {
      H(void 0), M(ie);
    }, ue = (ie) => {
      Z(void 0), M(ie);
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(ln, {
          anchor: A,
          position: "Bottom",
          align: "Start",
          offset: 4,
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              onDeactivate: z,
              clickOutsideDeactivates: true,
              escapeDeactivates: kt,
              isKeyForward: (ie) => Yt.isKeyHotkey("arrowdown", ie),
              isKeyBackward: (ie) => Yt.isKeyHotkey("arrowup", ie)
            },
            children: o.jsxs(tn, {
              children: [
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    padding: ee.space.S100,
                    maxWidth: He(200),
                    backgroundColor: e
                  },
                  children: [
                    N && o.jsxs(Gc, {
                      style: {
                        padding: ee.space.S200
                      },
                      variant: "Critical",
                      children: [
                        o.jsxs(D, {
                          size: "L400",
                          children: [
                            "Error: ",
                            O.error.name
                          ]
                        }),
                        o.jsx(D, {
                          className: Pi,
                          size: "T200",
                          children: O.error.message
                        })
                      ]
                    }),
                    HF(j).map((ie) => {
                      const de = j[ie], ne = de.icon && qc(c, h, de.icon), ae = w(t) === ie, X = v.has(C) ? true : ie <= w(C);
                      return o.jsx(Ye, {
                        variant: ae ? "Primary" : "Surface",
                        fill: "None",
                        size: "300",
                        radii: "300",
                        "aria-disabled": I || !x || !X,
                        "aria-pressed": ae,
                        className: cl,
                        style: Io({
                          backgroundColor: l,
                          color: r
                        }, s),
                        before: o.jsx(Hf, {
                          color: de.color
                        }),
                        after: ne ? o.jsx(Zc, {
                          size: "50",
                          iconSrc: ne
                        }) : void 0,
                        onClick: x && X ? () => Y(ie) : void 0,
                        children: o.jsx(D, {
                          size: "B300",
                          children: de.name
                        })
                      }, ie);
                    })
                  ]
                }),
                o.jsx(nr, {
                  size: "300",
                  color: r
                }),
                o.jsx("div", {
                  style: {
                    padding: ee.space.S100,
                    backgroundColor: e
                  },
                  children: o.jsx(Ye, {
                    variant: "Surface",
                    fill: "None",
                    size: "300",
                    radii: "300",
                    className: cl,
                    style: Io({
                      backgroundColor: l,
                      color: r
                    }, s),
                    onClick: () => {
                      d.isSpaceRoom() ? g(d.roomId, u == null ? void 0 : u.roomId, Ro.PermissionsPage) : f(d.roomId, u == null ? void 0 : u.roomId, Ao.PermissionsPage), z();
                    },
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Manage Powers"
                    })
                  })
                })
              ]
            })
          }),
          children: o.jsx(Qe, {
            variant: N ? "Critical" : n ? void 0 : "SurfaceVariant",
            radii: "Pill",
            className: N ? void 0 : n ? Mp : dv,
            style: N ? void 0 : Io(n && i ? i : {}, s),
            before: A ? o.jsx(Q, {
              size: "50",
              src: q.ChevronBottom
            }) : o.jsxs(o.Fragment, {
              children: [
                !I && o.jsx(Hf, {
                  color: S.color
                }),
                I && o.jsx(dt, {
                  size: "50",
                  variant: "Secondary",
                  fill: "Soft"
                })
              ]
            }),
            after: T ? o.jsx(Zc, {
              size: "50",
              iconSrc: T
            }) : void 0,
            onClick: U,
            "aria-pressed": !!A,
            children: o.jsx(D, {
              size: "B300",
              truncate: true,
              children: S.name
            })
          })
        }),
        typeof L == "number" ? o.jsx(Rlt, {
          power: L,
          onCancel: () => H(void 0),
          onChange: oe
        }) : null,
        typeof V == "number" ? o.jsx(Alt, {
          power: V,
          onCancel: () => Z(void 0),
          onChange: ue
        }) : null
      ]
    });
  }
  const Kme = () => {
    const { unstable_features: t } = Dk();
    return !!((t == null ? void 0 : t["uk.half-shot.msc2666"]) || (t == null ? void 0 : t["uk.half-shot.msc2666.mutual_rooms"]) || (t == null ? void 0 : t["uk.half-shot.msc2666.query_mutual_rooms"]));
  }, Gme = () => {
    const { unstable_features: t, versions: e } = Dk();
    return e.includes("v1.19") || !!(t == null ? void 0 : t["uk.half-shot.msc2666.query_mutual_rooms.stable"]);
  }, Blt = async (t, e) => {
    const n = /* @__PURE__ */ new Set(), r = async (i) => {
      const a = await t.http.authedRequest(rt.Get, "/mutual_rooms", {
        user_id: e,
        from: i
      }, void 0, {
        prefix: "/_matrix/client/v1"
      });
      a.joined.forEach((s) => n.add(s)), typeof a.next_batch == "string" && await r(a.next_batch);
    };
    return await r(), Array.from(n);
  }, Plt = (t) => {
    const e = be(), n = Kme(), r = Gme(), [i] = ZE(p.useCallback(() => r ? Blt(e, t) : n ? e._unstable_getSharedRooms(t) : Promise.resolve([]), [
      e,
      t,
      n,
      r
    ]));
    return i;
  }, uv = () => {
    const t = be(), e = Ze(gi);
    return u3(t, zr, e);
  };
  function Mlt({ server: t, innerColor: e, cardColor: n, textColor: r, chipSurfaceStyle: i, chipFillColor: a, chipHoverBrightness: s }) {
    const l = a ?? n, c = be(), d = bo(c.getSafeUserId()), u = br(), h = Hk(), [f, g] = Dp(), [m, v] = p.useState(), y = (b) => {
      v(b.currentTarget.getBoundingClientRect());
    }, w = () => v(void 0);
    return o.jsx(ln, {
      anchor: m,
      position: "Bottom",
      align: "Start",
      offset: 4,
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: w,
          clickOutsideDeactivates: true,
          escapeDeactivates: kt,
          isKeyForward: (b) => Yt.isKeyHotkey("arrowdown", b),
          isKeyBackward: (b) => Yt.isKeyHotkey("arrowup", b)
        },
        children: o.jsxs(tn, {
          children: [
            o.jsx("div", {
              style: {
                padding: ee.space.S200,
                maxWidth: He(200),
                backgroundColor: e
              },
              children: o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(Ye, {
                    fill: "None",
                    size: "300",
                    radii: "300",
                    onClick: () => {
                      Jo(t), g(), w();
                    },
                    className: cl,
                    style: Io({
                      backgroundColor: l,
                      color: r
                    }, s),
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Copy Server"
                    })
                  }),
                  o.jsx(Ye, {
                    fill: "None",
                    size: "300",
                    radii: "300",
                    onClick: () => {
                      u(ep(t)), h();
                    },
                    className: cl,
                    style: Io({
                      backgroundColor: l,
                      color: r
                    }, s),
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Explore Community"
                    })
                  })
                ]
              })
            }),
            o.jsx(nr, {
              size: "300"
            }),
            o.jsx("div", {
              style: {
                padding: ee.space.S200,
                backgroundColor: e,
                color: r
              },
              children: o.jsx(E, {
                direction: "Column",
                gap: "100",
                children: o.jsx(Ye, {
                  fill: "None",
                  size: "300",
                  radii: "300",
                  onClick: () => {
                    window.open(`https://${t}`, "_blank"), w();
                  },
                  className: cl,
                  style: Io({
                    backgroundColor: l,
                    color: r
                  }, s),
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Open in Browser"
                  })
                })
              })
            })
          ]
        })
      }),
      children: o.jsx(Qe, {
        variant: n ? void 0 : d === t ? "SurfaceVariant" : "Warning",
        radii: "Pill",
        before: m ? o.jsx(Q, {
          size: "50",
          src: q.ChevronBottom
        }) : o.jsx(Q, {
          size: "50",
          src: f ? q.Check : q.Server
        }),
        onClick: y,
        "aria-pressed": !!m,
        className: n ? Mp : dv,
        style: Io(n && i ? i : {}, s),
        children: o.jsx(D, {
          size: "B300",
          truncate: true,
          children: t
        })
      })
    });
  }
  function Olt({ userId: t, innerColor: e, cardColor: n, textColor: r, chipSurfaceStyle: i, chipFillColor: a, chipHoverBrightness: s }) {
    const l = a ?? n, [c, d] = p.useState(), [u, h] = Dp(), f = (m) => {
      d(m.currentTarget.getBoundingClientRect());
    }, g = () => d(void 0);
    return o.jsx(ln, {
      anchor: c,
      position: "Bottom",
      align: "Start",
      offset: 4,
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: g,
          clickOutsideDeactivates: true,
          escapeDeactivates: kt,
          isKeyForward: (m) => Yt.isKeyHotkey("arrowdown", m),
          isKeyBackward: (m) => Yt.isKeyHotkey("arrowup", m)
        },
        children: o.jsx(tn, {
          children: o.jsx("div", {
            style: {
              padding: ee.space.S200,
              backgroundColor: e
            },
            children: o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(Ye, {
                  fill: "None",
                  size: "300",
                  radii: "300",
                  className: cl,
                  style: Io({
                    backgroundColor: l,
                    color: r
                  }, s),
                  onClick: () => {
                    Jo(t), h(), g();
                  },
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Copy User ID"
                  })
                }),
                o.jsx(Ye, {
                  fill: "None",
                  size: "300",
                  radii: "300",
                  className: cl,
                  style: Io({
                    backgroundColor: l,
                    color: r
                  }, s),
                  onClick: () => {
                    Jo(K2e(t)), h(), g();
                  },
                  children: o.jsx(D, {
                    size: "B300",
                    children: "Copy User Link"
                  })
                })
              ]
            })
          })
        })
      }),
      children: o.jsx(Qe, {
        variant: u ? "Success" : n ? void 0 : "SurfaceVariant",
        radii: "Pill",
        before: c ? o.jsx(Q, {
          size: "50",
          src: q.ChevronBottom
        }) : o.jsx(Q, {
          size: "50",
          src: u ? q.Check : q.Link
        }),
        onClick: f,
        "aria-pressed": !!c,
        className: !u && n ? Mp : dv,
        style: Io(n && !u && i ? i : {}, s),
        children: o.jsx(D, {
          size: "B300",
          truncate: true,
          children: "Share"
        })
      })
    });
  }
  function Llt({ userId: t, innerColor: e, cardColor: n, textColor: r, chipSurfaceStyle: i, chipFillColor: a, chipHoverBrightness: s }) {
    const l = a ?? n, c = be(), d = Gme(), u = Kme(), h = Plt(t), { navigateRoom: f, navigateSpace: g } = Wi(), m = Hk(), v = uv(), y = hn(), w = td(), b = ec(w), [j, k] = p.useState(), C = (A) => {
      k(A.currentTarget.getBoundingClientRect());
    }, x = () => k(void 0), S = p.useMemo(() => {
      const A = {
        rooms: [],
        spaces: [],
        directs: []
      };
      return h.status === ve.Success && h.data.toSorted(Yk(c)).map(b).filter((U) => !!U).forEach((U) => {
        if (U.isSpaceRoom()) {
          A.spaces.push(U);
          return;
        }
        if (v.includes(U.roomId)) {
          A.directs.push(U);
          return;
        }
        A.rooms.push(U);
      }), A;
    }, [
      h,
      b,
      v,
      c
    ]);
    if (t === c.getSafeUserId() || !d && !u || h.status === ve.Error) return null;
    const T = (A) => {
      const { roomId: B } = A, U = v.includes(B);
      return o.jsx(Ye, {
        variant: "Surface",
        fill: "None",
        size: "300",
        radii: "300",
        className: cl,
        style: Io({
          paddingLeft: ee.space.S100,
          backgroundColor: l,
          color: r
        }, s),
        onClick: () => {
          A.isSpaceRoom() ? g(B) : f(B), m();
        },
        before: o.jsx(xn, {
          size: "200",
          radii: U ? "400" : "300",
          children: U || A.isSpaceRoom() ? o.jsx(yi, {
            roomId: A.roomId,
            src: U ? Jf(c, A, 96, y) : Sa(c, A, 96, y),
            alt: A.name,
            renderFallback: () => o.jsx(D, {
              as: "span",
              size: "H6",
              children: Vi(A.name)
            })
          }) : o.jsx(Ya, {
            size: "100",
            joinRule: A.getJoinRule(),
            roomType: A.getType(),
            style: {
              color: r
            }
          })
        }),
        children: o.jsx(D, {
          size: "B300",
          truncate: true,
          style: {
            color: r
          },
          children: A.name
        })
      }, B);
    };
    return o.jsx(ln, {
      anchor: j,
      position: "Bottom",
      align: "Start",
      offset: 4,
      content: h.status === ve.Success ? o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: x,
          clickOutsideDeactivates: true,
          escapeDeactivates: kt,
          isKeyForward: (A) => Yt.isKeyHotkey("arrowdown", A),
          isKeyBackward: (A) => Yt.isKeyHotkey("arrowup", A)
        },
        children: o.jsx(tn, {
          style: {
            display: "flex",
            maxWidth: He(200),
            maxHeight: "80vh",
            backgroundColor: e
          },
          children: o.jsx(E, {
            grow: "Yes",
            children: o.jsx(dn, {
              size: "300",
              hideTrack: true,
              children: o.jsxs(E, {
                direction: "Column",
                gap: "400",
                style: {
                  padding: ee.space.S200,
                  paddingRight: 0,
                  color: r
                },
                children: [
                  S.spaces.length > 0 && o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        style: {
                          paddingLeft: ee.space.S100
                        },
                        size: "L400",
                        children: "Spaces"
                      }),
                      S.spaces.map(T)
                    ]
                  }),
                  S.rooms.length > 0 && o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        style: {
                          paddingLeft: ee.space.S100
                        },
                        size: "L400",
                        children: "Rooms"
                      }),
                      S.rooms.map(T)
                    ]
                  }),
                  S.directs.length > 0 && o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        style: {
                          paddingLeft: ee.space.S100
                        },
                        size: "L400",
                        children: "Direct Messages"
                      }),
                      S.directs.map(T)
                    ]
                  })
                ]
              })
            })
          })
        })
      }) : null,
      children: o.jsx(Qe, {
        variant: n ? void 0 : "SurfaceVariant",
        radii: "Pill",
        before: h.status === ve.Loading && o.jsx(dt, {
          size: "50"
        }),
        disabled: h.status !== ve.Success || h.data.length === 0,
        onClick: C,
        "aria-pressed": !!j,
        className: n ? Mp : dv,
        style: Io(n && i ? i : {}, s),
        children: o.jsxs(D, {
          size: "B300",
          style: {
            color: r
          },
          children: [
            h.status === ve.Success && `${h.data.length} Mutual Rooms`,
            h.status === ve.Loading && "Mutual Rooms"
          ]
        })
      })
    });
  }
  function Nlt() {
    return o.jsx(Gc, {
      style: {
        padding: ee.space.S200
      },
      variant: "Critical",
      children: o.jsx(Ie, {
        children: o.jsxs(E, {
          direction: "Column",
          gap: "200",
          children: [
            o.jsx(E, {
              gap: "200",
              justifyContent: "Center",
              children: o.jsx(D, {
                size: "L400",
                children: "Blocked User"
              })
            }),
            o.jsx(E, {
              direction: "Column",
              children: o.jsx(D, {
                size: "T200",
                children: "You do not receive any messages or invites from this user."
              })
            })
          ]
        })
      })
    });
  }
  function zlt({ userId: t, innerColor: e, cardColor: n, textColor: r, chipSurfaceStyle: i, chipFillColor: a, chipHoverBrightness: s }) {
    const l = a ?? n, c = be(), [d, u] = p.useState(), [h, f] = p.useState(false), g = p.useRef(null), m = (A) => {
      u(A.currentTarget.getBoundingClientRect());
    }, v = () => {
      u(void 0), f(false);
    }, y = kp(), w = y.includes(t), [b, j] = Et(p.useCallback(async () => {
      const A = y.filter((B) => B !== t);
      w || A.push(t), await c.setIgnoredUsers(A);
    }, [
      c,
      y,
      t,
      w
    ])), k = b.status === ve.Loading, C = ZM(t), x = pGe();
    p.useEffect(() => {
      var _a6;
      h && ((_a6 = g.current) == null ? void 0 : _a6.focus());
    }, [
      h
    ]);
    const S = () => {
      var _a6;
      const A = ((_a6 = g.current) == null ? void 0 : _a6.value) ?? "";
      x(t, A || void 0), v();
    }, T = (A) => {
      A.key === "Enter" && S(), A.key === "Escape" && v();
    };
    return o.jsx(ln, {
      anchor: d,
      position: "Bottom",
      align: "Start",
      offset: 4,
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: v,
          clickOutsideDeactivates: true,
          escapeDeactivates: kt,
          isKeyForward: (A) => Yt.isKeyHotkey("arrowdown", A),
          isKeyBackward: (A) => Yt.isKeyHotkey("arrowup", A)
        },
        children: o.jsx(tn, {
          children: o.jsx("div", {
            style: {
              padding: ee.space.S200,
              backgroundColor: e
            },
            children: o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                h ? o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    color: r
                  },
                  children: [
                    o.jsx(D, {
                      size: "L400",
                      children: "Nickname"
                    }),
                    o.jsx("input", {
                      ref: g,
                      defaultValue: C ?? "",
                      placeholder: "Enter a nickname\u2026",
                      onKeyDown: T,
                      style: {
                        background: "var(--mx-c-surface)",
                        color: "var(--mx-c-on-surface)",
                        border: "1px solid var(--mx-c-outline)",
                        borderRadius: "6px",
                        padding: "4px 8px",
                        fontSize: "14px",
                        width: "100%",
                        outline: "none"
                      }
                    }),
                    o.jsxs(E, {
                      gap: "200",
                      children: [
                        o.jsx(Ye, {
                          size: "300",
                          radii: "300",
                          variant: "Success",
                          fill: "None",
                          onClick: S,
                          className: cl,
                          style: Io({
                            backgroundColor: l,
                            color: r
                          }, s),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Save"
                          })
                        }),
                        C && o.jsx(Ye, {
                          size: "300",
                          radii: "300",
                          variant: "Critical",
                          fill: "None",
                          className: cl,
                          onClick: () => {
                            x(t, void 0), v();
                          },
                          style: Io({
                            backgroundColor: l,
                            color: r
                          }, s),
                          children: o.jsx(D, {
                            size: "B300",
                            children: "Clear"
                          })
                        })
                      ]
                    })
                  ]
                }) : o.jsx(Ye, {
                  variant: "Surface",
                  fill: "None",
                  size: "300",
                  radii: "300",
                  before: o.jsx(Q, {
                    size: "50",
                    src: q.Pencil
                  }),
                  onClick: () => f(true),
                  className: cl,
                  style: Io({
                    backgroundColor: l,
                    color: r
                  }, s),
                  children: o.jsx(D, {
                    size: "B300",
                    children: C ? "Edit Nickname" : "Set Nickname"
                  })
                }),
                o.jsx(Ye, {
                  variant: "Critical",
                  fill: "None",
                  size: "300",
                  radii: "300",
                  onClick: () => {
                    j(), v();
                  },
                  className: cl,
                  style: Io({
                    backgroundColor: l
                  }, s),
                  before: k ? o.jsx(dt, {
                    variant: "Critical",
                    size: "50"
                  }) : o.jsx(Q, {
                    size: "50",
                    src: q.Prohibited
                  }),
                  disabled: k,
                  children: o.jsx(D, {
                    size: "B300",
                    style: {
                      color: r
                    },
                    children: w ? "Unblock User" : "Block User"
                  })
                })
              ]
            })
          })
        })
      }),
      children: o.jsx(Qe, {
        variant: n ? void 0 : "SurfaceVariant",
        radii: "Pill",
        onClick: m,
        "aria-pressed": !!d,
        className: n ? Mp : dv,
        style: Io(n && i ? i : {}, s),
        children: k ? o.jsx(dt, {
          variant: "Secondary",
          size: "50"
        }) : o.jsx(Q, {
          size: "50",
          src: q.HorizontalDots
        })
      })
    });
  }
  function Ult({ userId: t, avatarUrl: e, bannerUrl: n, presence: r, autoplayGifs: i }) {
    const [a, s] = p.useState(), [l, c] = p.useState(false), d = E8(n), u = E8(e), h = d || u, f = !d && !!u, g = p.useMemo(() => {
      if (!h) return false;
      const U = h.toLowerCase();
      return !(U.endsWith(".jpg") || U.endsWith(".jpeg") || U.endsWith(".png")) || U.includes("gif") || U.includes("webp");
    }, [
      h
    ]), m = gt(VX, f && HX), v = () => o.jsx("img", {
      className: gt(VX, f && HX),
      src: h,
      alt: `${t} cover`,
      draggable: "false"
    }), y = r == null ? void 0 : r.status, w = ((y == null ? void 0 : y.length) ?? 0) > 70, b = Hc(t), j = b.heroColor ?? ct.Surface.Container, k = b == null ? void 0 : b.heroBrightness, C = k ? k === "dark" : void 0, x = Eg(j, C ? -80 : 80) ?? ct.Background.Container, S = Eg(j, C ? -50 : 50) ?? j, T = Eg(S, k === "light" ? -14 : 32) ?? x, A = (k === "dark" || Y1("#000000", x)) && "#FFFFFF" || (k === "light" || Y1("#FFFFFF", x)) && "#000000" || void 0, B = k === "light" ? 0.94 : 1.08;
    return o.jsxs(E, {
      direction: "Column",
      className: glt,
      style: {
        backgroundColor: j
      },
      children: [
        o.jsx("div", {
          className: plt,
          style: {
            backgroundColor: _p(t)
          },
          children: h && o.jsx(o.Fragment, {
            children: g && !i ? o.jsx(rp, {
              src: h,
              className: m,
              children: v()
            }) : v()
          })
        }),
        o.jsxs(E, {
          direction: "Row",
          className: Flt,
          children: [
            o.jsxs("div", {
              className: vlt,
              children: [
                o.jsx(PO, {
                  className: _lt,
                  badge: r && o.jsx(RS, {
                    presence: r.presence
                  }),
                  children: o.jsx(xn, {
                    as: e ? "button" : "div",
                    onClick: e ? () => s(e) : void 0,
                    className: wlt,
                    size: "500",
                    children: o.jsx(Si, {
                      className: Dlt,
                      userId: t,
                      src: e,
                      alt: t,
                      renderFallback: () => o.jsx(Q, {
                        size: "500",
                        src: q.User,
                        filled: true
                      })
                    })
                  })
                }),
                a && o.jsx(Hn, {
                  open: true,
                  backdrop: o.jsx($n, {}),
                  children: o.jsx(Wn, {
                    children: o.jsx(Ft, {
                      focusTrapOptions: {
                        initialFocus: false,
                        onDeactivate: () => s(void 0),
                        clickOutsideDeactivates: true,
                        escapeDeactivates: kt
                      },
                      children: o.jsx(Go, {
                        size: "500",
                        onContextMenu: (U) => U.stopPropagation(),
                        children: o.jsx(Yc, {
                          src: a,
                          alt: t,
                          requestClose: () => s(void 0)
                        })
                      })
                    })
                  })
                })
              ]
            }),
            y && y.length > 0 && o.jsx("div", {
              className: ylt,
              children: o.jsx(pr, {
                radii: "400",
                variant: "Surface",
                onClick: w ? () => c(!l) : void 0,
                className: gt(blt, w && xlt),
                style: {
                  maxHeight: He(l ? 105 : 48),
                  cursor: w ? "pointer" : "default",
                  transform: "none",
                  transition: "none",
                  display: "flex",
                  padding: `${He(8)} ${He(12)}`,
                  backgroundColor: T,
                  color: A,
                  borderStyle: "none",
                  borderWidth: 0,
                  outline: "none",
                  boxShadow: "inset 0 1px 1px rgba(0, 0, 0, 0.05)",
                  "--user-hero-status-hover-brightness": String(B)
                },
                children: o.jsxs(E, {
                  direction: "Row",
                  gap: "100",
                  style: {
                    height: "100%",
                    width: "100%"
                  },
                  children: [
                    l ? o.jsx(dn, {
                      visibility: "Hover",
                      hideTrack: true,
                      style: {
                        height: "100%",
                        flex: 1
                      },
                      children: o.jsx(D, {
                        size: "T200",
                        style: {
                          wordBreak: "break-word"
                        },
                        children: y
                      })
                    }) : o.jsx(D, {
                      size: "T200",
                      style: {
                        flex: 1,
                        wordBreak: "break-word",
                        WebkitLineClamp: 2,
                        WebkitBoxOrient: "vertical",
                        overflow: "hidden"
                      },
                      children: y
                    }),
                    w && o.jsx(E, {
                      shrink: "No",
                      alignItems: "Center",
                      justifyContent: "Center",
                      style: {
                        alignSelf: l ? "flex-start" : "center"
                      },
                      children: o.jsx(Q, {
                        size: "50",
                        src: l ? q.ChevronTop : q.ChevronBottom
                      })
                    })
                  ]
                })
              })
            })
          ]
        })
      ]
    });
  }
  function Vlt({ displayName: t, userId: e, customHeroCards: n }) {
    const r = _n(e), i = ZM(e), { color: a, font: s } = rm(e, cr(), n), l = i ?? t ?? r ?? e;
    return o.jsxs(E, {
      grow: "Yes",
      direction: "Column",
      gap: "0",
      children: [
        o.jsxs(E, {
          alignItems: "Baseline",
          gap: "200",
          wrap: "Wrap",
          children: [
            o.jsx(D, {
              size: "H4",
              className: gt(Pi, IA),
              title: l,
              style: {
                color: a,
                fontFamily: s
              },
              children: l
            }),
            i && o.jsx(D, {
              size: "T200",
              priority: "300",
              title: `Nickname (real: ${r})`,
              children: "(nick)"
            })
          ]
        }),
        o.jsx(E, {
          alignItems: "Center",
          gap: "100",
          wrap: "Wrap",
          children: o.jsxs(D, {
            size: "T200",
            className: gt(Pi, IA),
            title: r,
            children: [
              "@",
              r
            ]
          })
        })
      ]
    });
  }
  const Hlt = /* @__PURE__ */ new Set([
    Wg,
    Gg,
    J1,
    a4,
    Of,
    V2,
    H2,
    Z1,
    "avatar_url",
    "displayname",
    qg,
    Kg
  ]), $lt = (t) => t == null ? "n/a" : typeof t == "boolean" ? t ? "Yes" : "No" : typeof t == "object" ? JSON.stringify(t) : String(t);
  function Wlt({ profile: t, htmlReactParserOptions: e, linkifyOpts: n, innerColor: r, cardColor: i, textColor: a }) {
    const [s, l] = p.useState(false), [c, d] = p.useState(-1), [u] = Fe(ge, "renderAnimals"), h = t.isCat === true, f = t.hasCats === true, g = p.useMemo(() => u ? h && f ? "Cat with cats\u2014needs pets & love!" : h ? "Is a cat\u2014give pets & love!" : f ? "Has cats\u2014send love!" : null : null, [
      u,
      h,
      f
    ]), m = Ol().filterPronounsBasedOnLanguage ?? false, v = Ol().filterPronounsLanguages ?? [
      "en"
    ], y = xce(t.pronouns, m, v).map((T) => T.summary).join(", "), w = p.useMemo(() => {
      if (!t.timezone) return null;
      try {
        return new Intl.DateTimeFormat([], {
          hour: "numeric",
          minute: "2-digit",
          timeZone: t.timezone.replaceAll(/^["']|["']$/g, "")
        }).format(/* @__PURE__ */ new Date());
      } catch {
        return null;
      }
    }, [
      t.timezone
    ]), b = p.useMemo(() => {
      var _a6, _b3;
      let T = ((_a6 = t.extended) == null ? void 0 : _a6[Wg]) || ((_b3 = t.extended) == null ? void 0 : _b3[Gg]) || t.bio;
      if (!T || (typeof T == "object" && T !== null && "formatted_body" in T && (T = T.formatted_body), typeof T != "string")) return null;
      const A = T.length > 2048 ? T.slice(0, 2048) : T, B = A.replaceAll(/<[^>]*>?/gm, ""), U = 1024;
      return B.length <= U ? A : `${A.slice(0, U)}...`;
    }, [
      t
    ]), j = Object.entries(t.extended || {}).filter(([T]) => !Hlt.has(T)), k = c > -1 ? j[c] : void 0;
    function C(T) {
      d(T), l(false);
    }
    const x = p.useMemo(() => j.length === 1 && s ? (l(false), d(c === -1 ? 0 : -1), null) : o.jsxs(tn, {
      style: {
        position: "absolute",
        zIndex: "100",
        transform: `translateY(${He(32)})`,
        backgroundColor: r
      },
      children: [
        o.jsxs(Ye, {
          size: "300",
          radii: "300",
          fill: "None",
          style: {
            justifyContent: "Center",
            textAlign: "center",
            backgroundColor: i,
            color: a
          },
          onClick: () => C(-1),
          children: [
            o.jsx(Q, {
              src: q.ChevronTop,
              size: "50"
            }),
            o.jsx(D, {
              children: "Show less"
            })
          ]
        }),
        j.map(([T], A) => o.jsx(Ye, {
          size: "300",
          radii: "300",
          fill: "None",
          style: {
            justifyContent: "Center",
            backgroundColor: i,
            color: a
          },
          onClick: () => C(A),
          children: o.jsx(D, {
            children: T
          })
        }, T))
      ]
    }), [
      i,
      r,
      c,
      s,
      a,
      j
    ]), S = p.useMemo(() => o.jsxs(E, {
      justifyContent: "Center",
      grow: "Yes",
      children: [
        o.jsx(xe, {
          fill: "None",
          size: "300",
          className: qT,
          onClick: () => l(!s),
          after: o.jsx(Q, {
            size: "50",
            src: c === -1 ? q.ChevronBottom : q.ChevronTop
          }),
          style: {
            padding: "1rem",
            justifyContent: "flex-start",
            width: "fit-content",
            textAlign: "center",
            color: a
          },
          children: o.jsx(D, {
            size: "T200",
            priority: "400",
            children: c === -1 ? `Show Misc. Data (${j.length} value${j.length > 1 ? "s" : ""})` : `${(k == null ? void 0 : k[0]) ?? "Unknown"} ${j.length > 1 ? `(${c + 1}/${j.length})` : ""}`
          })
        }),
        s && x
      ]
    }), [
      x,
      c,
      k,
      s,
      j,
      a
    ]);
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      style: {
        marginBottom: ee.space.S100,
        color: a
      },
      children: [
        (y || w) && o.jsxs(E, {
          alignItems: "Center",
          gap: "300",
          wrap: "Wrap",
          children: [
            y && o.jsxs(E, {
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(Q, {
                  size: "50",
                  src: q.User,
                  style: {
                    opacity: 0.5
                  }
                }),
                o.jsx(D, {
                  size: "T200",
                  priority: "400",
                  children: y
                })
              ]
            }),
            w && t.timezone && o.jsxs(E, {
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(Q, {
                  size: "50",
                  src: q.Clock,
                  style: {
                    opacity: 0.5
                  }
                }),
                o.jsxs(D, {
                  size: "T200",
                  priority: "400",
                  children: [
                    w,
                    " (",
                    t.timezone.replaceAll(/^["']|["']$/g, ""),
                    ")"
                  ]
                })
              ]
            }),
            g && o.jsxs(E, {
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(Q, {
                  size: "50",
                  src: q.Heart,
                  style: {
                    opacity: 0.5
                  }
                }),
                o.jsx(D, {
                  size: "T200",
                  priority: "400",
                  children: g
                })
              ]
            })
          ]
        }),
        b && o.jsx(dn, {
          "data-profile-bio": true,
          direction: "Vertical",
          variant: "SurfaceVariant",
          visibility: "Always",
          size: "300",
          style: {
            backgroundColor: i,
            borderRadius: ee.radii.R400,
            boxShadow: "inset 0 1px 2px rgba(0, 0, 0, 0.1)",
            maxHeight: "200px",
            marginTop: ee.space.S0,
            overflowY: "auto"
          },
          children: o.jsx(E, {
            style: {
              padding: ee.space.S200,
              wordBreak: "break-word",
              backgroundColor: i
            },
            children: o.jsx(D, {
              size: "T200",
              priority: "400",
              as: "div",
              children: o.jsx(hS, {
                body: b,
                customBody: b,
                htmlReactParserOptions: e,
                linkifyOpts: n
              })
            })
          })
        }),
        j.length > 0 && o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            c === -1 && S,
            c > -1 && o.jsxs("div", {
              style: {
                backgroundColor: i,
                borderRadius: ee.radii.R400,
                boxShadow: "inset 0 1px 2px rgba(0, 0, 0, 0.1)",
                overflow: "hidden"
              },
              children: [
                o.jsxs(E, {
                  direction: "Row",
                  justifyContent: "Center",
                  alignContent: "Center",
                  children: [
                    j.length > 1 && o.jsx(xe, {
                      size: "300",
                      fill: "None",
                      className: qT,
                      onClick: () => d(c === 0 ? j.length - 1 : c - 1),
                      style: {
                        color: a
                      },
                      children: o.jsx(Q, {
                        src: q.ArrowLeft,
                        size: "50"
                      })
                    }),
                    S,
                    j.length > 1 && o.jsx(xe, {
                      size: "300",
                      fill: "None",
                      className: qT,
                      onClick: () => d((c + 1) % j.length),
                      style: {
                        color: a
                      },
                      children: o.jsx(Q, {
                        src: q.ArrowRight,
                        size: "50"
                      })
                    })
                  ]
                }),
                o.jsx(dn, {
                  size: "300",
                  direction: "Both",
                  visibility: "Hover",
                  hideTrack: true,
                  variant: "SurfaceVariant",
                  style: {
                    backgroundColor: ct.SurfaceVariant.Container,
                    color: ct.SurfaceVariant.OnContainer,
                    fontFamily: "monospace",
                    boxShadow: "inset 0 2px 0 rgba(0, 0, 0, 0.65), inset 0 4px 6px -2px rgba(0, 0, 0, 0.35)"
                  },
                  children: o.jsx(E, {
                    direction: "Column",
                    style: {
                      padding: ee.space.S200,
                      maxHeight: He(100)
                    },
                    children: o.jsx(gS, {
                      text: $lt(k == null ? void 0 : k[1]),
                      langName: "json"
                    })
                  })
                })
              ]
            })
          ]
        })
      ]
    });
  }
  function qlt({ userId: t, initialProfile: e }) {
    var _a6, _b3, _c3, _d4, _e13, _f4, _g4, _h4, _i7;
    const n = yp(), r = be(), i = hn(), a = br(), s = Hk(), c = kp().includes(t), [d] = Fe(ge, "autoplayGifs"), u = cr(), h = Mo(u), f = ri(u), g = Ki(f, h), { hasMorePower: m } = qme(f, h), v = r.getSafeUserId(), y = f.has(t), w = g.action("kick", v) && m(v, t), b = g.action("ban", v) && m(v, t), j = g.action("ban", v), k = g.action("invite", v), C = u.getMember(t), x = mlt(u, t), S = Ht.Ban, T = Ht.Invite, A = Ht.Join, B = Ht.Leave, U = bo(t), z = Ze(qr), O = gr(u, t, z), M = Jc(u, t), I = (M && Cn(r, M, i)) ?? void 0, N = v3(t), L = Hc(t, u), H = L && Object.keys(L).length > 0 ? L : e || L, V = typeof H.bannerUrl == "string" ? H.bannerUrl.replaceAll(/^"|"$/g, "") : void 0, Z = V ? Cn(r, V, i) ?? void 0 : void 0, Y = () => {
      s();
      const ke = {
        userId: t
      };
      a(gl(kk(), ke));
    }, oe = p.useCallback((ke) => {
      ke.preventDefault();
    }, []), ue = gs(), ie = p.useMemo(() => ({
      ...fs,
      render: em(ue, (ke) => _h(r, u.roomId, ke, Jd(oe), z), oe)
    }), [
      r,
      u,
      oe,
      z,
      ue
    ]), de = Xd(), ne = p.useMemo(() => Ql(r, u.roomId, {
      settingsLinkBaseUrl: ue,
      linkifyOpts: ie,
      useAuthentication: i,
      handleSpoilerClick: de
    }), [
      r,
      u,
      ie,
      ue,
      i,
      de
    ]), ae = L.heroColor ?? ct.Surface.Container, X = L == null ? void 0 : L.heroBrightness, K = X ? X === "dark" : void 0, G = Eg(ae, K ? -50 : 50), le = Eg(ae, K ? -80 : 80) ?? ct.Background.Container, te = (X === "dark" || Y1("#000000", G)) && "#FFFFFF" || (X === "light" || Y1("#FFFFFF", G)) && "#000000" || void 0, re = !!L.heroColor, he = Eg(G, X === "light" ? -14 : 32) ?? le, se = X === "light" ? 0.94 : X === "dark" || n.kind === Rr.Dark ? 1.12 : 0.94, ye = re && he ? {
      backgroundColor: he,
      borderColor: "transparent",
      color: te,
      "--user-hero-chip-hover-brightness": se
    } : void 0, we = te ?? ct.Surface.OnContainer, Ee = re ? {
      innerColor: G,
      cardColor: le,
      textColor: we,
      chipSurfaceStyle: ye,
      chipFillColor: he,
      chipHoverBrightness: se
    } : {
      innerColor: ct.Surface.Container,
      chipFillColor: ct.SurfaceVariant.Container,
      textColor: ct.SurfaceVariant.OnContainer,
      chipHoverBrightness: se
    };
    return o.jsxs(E, {
      direction: "Column",
      style: {
        color: te
      },
      children: [
        o.jsx(Ult, {
          userId: t,
          avatarUrl: I,
          bannerUrl: Z ?? void 0,
          presence: N && N.lastActiveTs !== 0 ? N : void 0,
          autoplayGifs: d
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "300",
          style: {
            padding: re && G ? ee.space.S200 : ee.space.S0,
            backgroundColor: ae
          },
          children: o.jsxs(E, {
            direction: "Column",
            gap: "200",
            style: {
              backgroundColor: G,
              borderRadius: He(5),
              boxShadow: re ? "inset 0 1px 2px rgba(0, 0, 0, 0.1)" : void 0,
              padding: re && G ? ee.space.S200 : ee.space.S300
            },
            children: [
              o.jsxs(E, {
                gap: "200",
                alignItems: "Center",
                wrap: "Wrap",
                children: [
                  o.jsx(Vlt, {
                    displayName: O,
                    userId: t,
                    customHeroCards: re
                  }),
                  t !== v && o.jsx(xe, {
                    size: "300",
                    variant: "Primary",
                    fill: "Solid",
                    radii: "300",
                    before: o.jsx(Q, {
                      size: "50",
                      src: q.Message,
                      filled: true
                    }),
                    onClick: Y,
                    className: re ? Mp : Clt,
                    style: {
                      marginLeft: "auto",
                      ...re && ye ? ye : {},
                      ...Io({}, se)
                    },
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Message"
                    })
                  })
                ]
              }),
              o.jsx(Wlt, {
                profile: H,
                htmlReactParserOptions: ne,
                linkifyOpts: ie,
                innerColor: G,
                cardColor: le,
                textColor: te
              }),
              o.jsxs(E, {
                alignItems: "Center",
                gap: "100",
                wrap: "Wrap",
                justifyContent: "Center",
                children: [
                  U && o.jsx(Mlt, {
                    server: U,
                    ...Ee
                  }),
                  o.jsx(Olt, {
                    userId: t,
                    ...Ee
                  }),
                  y ? o.jsx(Elt, {
                    ...Ee
                  }) : o.jsx(Ilt, {
                    userId: t,
                    ...Ee
                  }),
                  t !== v && o.jsx(Llt, {
                    userId: t,
                    ...Ee
                  }),
                  t !== v && o.jsx(zlt, {
                    userId: t,
                    ...Ee
                  })
                ]
              }),
              c && o.jsx(Nlt, {}),
              C && x === S && o.jsx(Slt, {
                userId: t,
                reason: (_a6 = C.events.member) == null ? void 0 : _a6.getContent().reason,
                canUnban: j,
                bannedBy: (_b3 = C.events.member) == null ? void 0 : _b3.getSender(),
                ts: (_c3 = C.events.member) == null ? void 0 : _c3.getTs()
              }),
              C && x === B && C.events.member && C.events.member.getSender() !== t && o.jsx(klt, {
                reason: (_d4 = C.events.member) == null ? void 0 : _d4.getContent().reason,
                kickedBy: (_e13 = C.events.member) == null ? void 0 : _e13.getSender(),
                ts: (_f4 = C.events.member) == null ? void 0 : _f4.getTs()
              }),
              C && x === T && o.jsx(jlt, {
                userId: t,
                reason: (_g4 = C.events.member) == null ? void 0 : _g4.getContent().reason,
                canKick: w,
                invitedBy: (_h4 = C.events.member) == null ? void 0 : _h4.getSender(),
                ts: (_i7 = C.events.member) == null ? void 0 : _i7.getTs()
              }),
              o.jsx(Tlt, {
                userId: t,
                canInvite: k && x === B,
                canKick: w && x === A,
                canBan: b && x !== S
              })
            ]
          })
        })
      ]
    });
  }
  function Klt({ state: t }) {
    const { roomId: e, spaceId: n, userId: r, cords: i, position: a, initialProfile: s } = t, l = td(), c = ec(l), d = c(e), u = n ? c(n) : void 0, h = Hk();
    return d ? o.jsx(ln, {
      anchor: i,
      position: a ?? "Top",
      align: i.y > window.innerHeight / 2 ? "End" : "Start",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: h,
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          style: {
            width: He(340)
          },
          children: o.jsx(WF, {
            value: u ?? null,
            children: o.jsx(dp, {
              value: d,
              children: o.jsx(qlt, {
                userId: r,
                initialProfile: s
              })
            })
          })
        })
      })
    }) : null;
  }
  function Glt() {
    const t = AP();
    return t ? o.jsx(Klt, {
      state: t
    }) : null;
  }
  function Ylt({ value: t, onSelect: e, disabled: n, getIcon: r }) {
    return o.jsxs(E, {
      shrink: "No",
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(Te, {
          style: {
            padding: ee.space.S300
          },
          variant: t === na.TextRoom ? "Primary" : "SurfaceVariant",
          direction: "Column",
          gap: "100",
          as: "button",
          type: "button",
          "aria-pressed": t === na.TextRoom,
          onClick: () => e(na.TextRoom),
          disabled: n,
          children: o.jsx(Ie, {
            before: o.jsx(Q, {
              size: "400",
              src: r(na.TextRoom)
            }),
            after: t === na.TextRoom && o.jsx(Q, {
              src: q.Check
            }),
            children: o.jsxs(E, {
              gap: "200",
              alignItems: "Baseline",
              children: [
                o.jsx(D, {
                  size: "H6",
                  style: {
                    flexShrink: 0
                  },
                  children: "Chat Room"
                }),
                o.jsx(D, {
                  size: "T300",
                  priority: "300",
                  truncate: true,
                  children: "- Messages, photos, and videos."
                })
              ]
            })
          })
        }),
        o.jsx(Te, {
          style: {
            padding: ee.space.S300
          },
          variant: t === na.VoiceRoom ? "Primary" : "SurfaceVariant",
          direction: "Column",
          gap: "100",
          as: "button",
          type: "button",
          "aria-pressed": t === na.VoiceRoom,
          onClick: () => e(na.VoiceRoom),
          disabled: n,
          children: o.jsx(Ie, {
            before: o.jsx(Q, {
              size: "400",
              src: r(na.VoiceRoom)
            }),
            after: t === na.VoiceRoom && o.jsx(Q, {
              src: q.Check
            }),
            children: o.jsxs(E, {
              gap: "200",
              alignItems: "Baseline",
              children: [
                o.jsx(D, {
                  size: "H6",
                  style: {
                    flexShrink: 0
                  },
                  children: "Voice Room"
                }),
                o.jsx(D, {
                  size: "T300",
                  priority: "300",
                  truncate: true,
                  children: "- Live audio and video conversations."
                }),
                o.jsx(JO, {})
              ]
            })
          })
        })
      ]
    });
  }
  const $X = fo("CreateRoom"), WX = (t, e) => {
    const n = e === na.VoiceRoom;
    let r = kn.Public;
    return t === wr.Restricted && (r = kn.Restricted), t === wr.Private && (r = kn.Knock), Sd(q, n ? Bo.UnstableCall : void 0, r);
  }, Zlt = (t) => t === na.VoiceRoom ? q.VolumeHigh : q.Hash;
  function Yme({ defaultAccess: t, defaultType: e, space: n, onCreate: r }) {
    const i = be(), a = Kr(), l = XF()["m.room_versions"], [c, d] = p.useState((l == null ? void 0 : l.default) ?? "1");
    p.useEffect(() => {
      d((l == null ? void 0 : l.default) ?? "1");
    }, [
      l == null ? void 0 : l.default
    ]);
    const u = n && G2(c), [h, f] = p.useState(e ?? na.TextRoom), [g, m] = p.useState(t ?? (u ? wr.Restricted : wr.Private)), v = BF(c), { additionalCreators: y, addAdditionalCreator: w, removeAdditionalCreator: b } = $O(), [j, k] = p.useState(true), [C, x] = p.useState(false), [S, T] = p.useState(false), [A, B] = p.useState(false), U = g === wr.Private && MB(c), z = g === wr.Restricted && OB(c), O = (Z) => {
      G2(Z) || m(wr.Private), d(Z);
    }, [M, I] = Et(p.useCallback((Z) => Afe(i, Z), [
      i
    ])), N = M.status === ve.Loading, L = M.status === ve.Error ? M.error : void 0, H = M.status === ve.Loading, V = (Z) => {
      if (Z.preventDefault(), H) return;
      const Y = Z.currentTarget, oe = Y.nameInput, ue = Y.topicTextAria, ie = Y.aliasInput, de = oe == null ? void 0 : oe.value.trim(), ne = ue == null ? void 0 : ue.value.trim(), ae = ie && ie.value ? Og(ie.value) : void 0;
      if (!de) return;
      const X = g === wr.Public;
      let K = false;
      U && g === wr.Private && (K = S), z && g === wr.Restricted && (K = S);
      let G;
      h === na.VoiceRoom && (G = Bo.UnstableCall), $X.info("ui", "Create room button clicked", {
        roomName: de,
        access: g,
        type: h,
        publicRoom: X,
        encryption: C,
        hasParent: !!n,
        parentRoomId: n == null ? void 0 : n.roomId
      }), I({
        version: c,
        type: G,
        parent: n,
        access: g,
        name: de,
        topic: ne || void 0,
        aliasLocalPart: X ? ae : void 0,
        encryption: X ? false : C,
        knock: K,
        allowFederation: j,
        additionalCreators: v ? y : void 0
      }).then((le) => {
        $X.info("ui", "Room created successfully", {
          roomId: le,
          roomName: de,
          access: g,
          type: h
        }), a() && (r == null ? void 0 : r(le));
      });
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: V,
      grow: "Yes",
      direction: "Column",
      gap: "500",
      children: [
        !n && o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Type"
            }),
            o.jsx(Ylt, {
              value: h,
              onSelect: f,
              disabled: H,
              getIcon: Zlt
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Access"
            }),
            o.jsx(Tfe, {
              value: g,
              onSelect: m,
              canRestrict: u,
              disabled: H,
              getIcon: (Z) => WX(Z, h)
            })
          ]
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Name"
            }),
            o.jsx(mn, {
              required: true,
              before: o.jsx(Q, {
                size: "100",
                src: WX(g, h)
              }),
              name: "nameInput",
              autoFocus: true,
              size: "500",
              variant: "SurfaceVariant",
              radii: "400",
              autoComplete: "off",
              disabled: H
            })
          ]
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Topic (Optional)"
            }),
            o.jsx(js, {
              name: "topicTextAria",
              size: "500",
              variant: "SurfaceVariant",
              radii: "400",
              disabled: H
            })
          ]
        }),
        g === wr.Public && o.jsx(Rfe, {
          disabled: H
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "End",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Options"
                }),
                o.jsx(E, {
                  grow: "Yes",
                  justifyContent: "End",
                  children: o.jsx(Qe, {
                    radii: "Pill",
                    before: o.jsx(Q, {
                      src: A ? q.ChevronTop : q.ChevronBottom,
                      size: "50"
                    }),
                    onClick: () => B(!A),
                    type: "button",
                    children: o.jsx(D, {
                      size: "T200",
                      children: "Advanced Options"
                    })
                  })
                })
              ]
            }),
            v && o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "500",
              children: o.jsx(WO, {
                additionalCreators: y,
                onSelect: w,
                onRemove: b
              })
            }),
            g !== wr.Public && o.jsxs(o.Fragment, {
              children: [
                o.jsx(Te, {
                  style: {
                    padding: ee.space.S300
                  },
                  variant: "SurfaceVariant",
                  direction: "Column",
                  gap: "500",
                  children: o.jsx(Ie, {
                    title: "End-to-End Encryption",
                    description: "Once this feature is enabled, it can't be disabled after the room is created.",
                    after: o.jsx(Jt, {
                      variant: "Primary",
                      value: C,
                      onChange: x,
                      disabled: H
                    })
                  })
                }),
                A && (U || z) && o.jsx(Te, {
                  style: {
                    padding: ee.space.S300
                  },
                  variant: "SurfaceVariant",
                  direction: "Column",
                  gap: "500",
                  children: o.jsx(Ie, {
                    title: "Knock to Join",
                    description: "Anyone can send request to join this room.",
                    after: o.jsx(Jt, {
                      variant: "Primary",
                      value: S,
                      onChange: T,
                      disabled: H
                    })
                  })
                })
              ]
            }),
            o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "500",
              children: o.jsx(Ie, {
                title: "Allow Federation",
                description: "Users from other servers can join.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: j,
                  onChange: k,
                  disabled: H
                })
              })
            }),
            A && o.jsx(VO, {
              versions: (l == null ? void 0 : l.available) ? Object.keys(l.available) : [
                "1"
              ],
              value: c,
              onChange: O,
              disabled: H
            })
          ]
        }),
        L && o.jsxs(E, {
          style: {
            color: ct.Critical.Main
          },
          alignItems: "Center",
          gap: "200",
          children: [
            o.jsx(Q, {
              src: q.Warning,
              filled: true,
              size: "100"
            }),
            o.jsx(D, {
              size: "T300",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: L instanceof Un && L.name === vo.M_LIMIT_EXCEEDED ? `Server rate-limited your request for ${A7(L.data.retry_after_ms ?? 0)} minutes!` : L.message
              })
            })
          ]
        }),
        o.jsx(E, {
          shrink: "No",
          direction: "Column",
          gap: "200",
          children: o.jsx(xe, {
            type: "submit",
            size: "500",
            variant: "Primary",
            radii: "400",
            disabled: H,
            before: N && o.jsx(dt, {
              variant: "Primary",
              fill: "Solid",
              size: "200"
            }),
            children: o.jsx(D, {
              size: "B500",
              children: "Create"
            })
          })
        })
      ]
    });
  }
  function Jlt({ state: t }) {
    const { spaceId: e, type: n } = t, r = hot(), i = td(), a = ec(i), s = e ? a(e) : void 0;
    return o.jsx(WF, {
      value: s ?? null,
      children: o.jsx(Hn, {
        open: true,
        backdrop: o.jsx($n, {}),
        children: o.jsx(Wn, {
          children: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              clickOutsideDeactivates: true,
              onDeactivate: r,
              escapeDeactivates: kt
            },
            children: o.jsx(Go, {
              size: "300",
              flexHeight: true,
              children: o.jsxs(E, {
                direction: "Column",
                children: [
                  o.jsxs(wn, {
                    size: "500",
                    style: {
                      padding: ee.space.S200,
                      paddingLeft: ee.space.S400
                    },
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: n === na.VoiceRoom ? "New Voice Room" : "New Chat Room"
                        })
                      }),
                      o.jsx(E, {
                        shrink: "No",
                        children: o.jsx(Oe, {
                          size: "300",
                          radii: "300",
                          onClick: r,
                          children: o.jsx(Q, {
                            src: q.Cross
                          })
                        })
                      })
                    ]
                  }),
                  o.jsx(dn, {
                    size: "300",
                    hideTrack: true,
                    children: o.jsx(E, {
                      style: {
                        padding: ee.space.S400,
                        paddingRight: ee.space.S200
                      },
                      direction: "Column",
                      gap: "500",
                      children: o.jsx(Yme, {
                        space: s,
                        onCreate: r,
                        defaultType: n
                      })
                    })
                  })
                ]
              })
            })
          })
        })
      })
    });
  }
  function Xlt() {
    const t = uot();
    return t ? o.jsx(Jlt, {
      state: t
    }) : null;
  }
  const qX = (t) => t === wr.Private ? q.SpaceLock : t === wr.Restricted ? q.Space : q.SpaceGlobe;
  function Zme({ defaultAccess: t, space: e, onCreate: n }) {
    const r = be(), i = Kr(), s = XF()["m.room_versions"], [l, c] = p.useState((s == null ? void 0 : s.default) ?? "1");
    p.useEffect(() => {
      c((s == null ? void 0 : s.default) ?? "1");
    }, [
      s == null ? void 0 : s.default
    ]);
    const d = e && G2(l), [u, h] = p.useState(t ?? (d ? wr.Restricted : wr.Private)), f = BF(l), { additionalCreators: g, addAdditionalCreator: m, removeAdditionalCreator: v } = $O(), [y, w] = p.useState(true), [b, j] = p.useState(false), [k, C] = p.useState(false), x = u === wr.Private && MB(l), S = u === wr.Restricted && OB(l), T = (I) => {
      G2(I) || h(wr.Private), c(I);
    }, [A, B] = Et(p.useCallback((I) => Afe(r, I), [
      r
    ])), U = A.status === ve.Loading, z = A.status === ve.Error ? A.error : void 0, O = A.status === ve.Loading, M = (I) => {
      if (I.preventDefault(), O) return;
      const N = I.currentTarget, L = N.nameInput, H = N.topicTextAria, V = N.aliasInput, Z = L == null ? void 0 : L.value.trim(), Y = H == null ? void 0 : H.value.trim(), oe = V && V.value ? Og(V.value) : void 0;
      if (!Z) return;
      const ue = u === wr.Public;
      let ie = false;
      x && u === wr.Private && (ie = b), S && u === wr.Restricted && (ie = b), B({
        version: l,
        type: Bo.Space,
        parent: e,
        access: u,
        name: Z,
        topic: Y || void 0,
        aliasLocalPart: ue ? oe : void 0,
        knock: ie,
        allowFederation: y,
        additionalCreators: f ? g : void 0
      }).then((de) => {
        i() && (n == null ? void 0 : n(de));
      });
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: M,
      grow: "Yes",
      direction: "Column",
      gap: "500",
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Access"
            }),
            o.jsx(Tfe, {
              value: u,
              onSelect: h,
              canRestrict: d,
              disabled: O,
              getIcon: qX
            })
          ]
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Name"
            }),
            o.jsx(mn, {
              required: true,
              before: o.jsx(Q, {
                size: "100",
                src: qX(u)
              }),
              name: "nameInput",
              autoFocus: true,
              size: "500",
              variant: "SurfaceVariant",
              radii: "400",
              autoComplete: "off",
              disabled: O
            })
          ]
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Topic (Optional)"
            }),
            o.jsx(js, {
              name: "topicTextAria",
              size: "500",
              variant: "SurfaceVariant",
              radii: "400",
              disabled: O
            })
          ]
        }),
        u === wr.Public && o.jsx(Rfe, {
          disabled: O
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "End",
              children: [
                o.jsx(D, {
                  size: "L400",
                  children: "Options"
                }),
                o.jsx(E, {
                  grow: "Yes",
                  justifyContent: "End",
                  children: o.jsx(Qe, {
                    radii: "Pill",
                    before: o.jsx(Q, {
                      src: k ? q.ChevronTop : q.ChevronBottom,
                      size: "50"
                    }),
                    onClick: () => C(!k),
                    type: "button",
                    children: o.jsx(D, {
                      size: "T200",
                      children: "Advanced Options"
                    })
                  })
                })
              ]
            }),
            f && o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "500",
              children: o.jsx(WO, {
                additionalCreators: g,
                onSelect: m,
                onRemove: v
              })
            }),
            u !== wr.Public && k && (x || S) && o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "500",
              children: o.jsx(Ie, {
                title: "Knock to Join",
                description: "Anyone can send request to join this space.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: b,
                  onChange: j,
                  disabled: O
                })
              })
            }),
            o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "500",
              children: o.jsx(Ie, {
                title: "Allow Federation",
                description: "Users from other servers can join.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: y,
                  onChange: w,
                  disabled: O
                })
              })
            }),
            k && o.jsx(VO, {
              versions: (s == null ? void 0 : s.available) ? Object.keys(s.available) : [
                "1"
              ],
              value: l,
              onChange: T,
              disabled: O
            })
          ]
        }),
        z && o.jsxs(E, {
          style: {
            color: ct.Critical.Main
          },
          alignItems: "Center",
          gap: "200",
          children: [
            o.jsx(Q, {
              src: q.Warning,
              filled: true,
              size: "100"
            }),
            o.jsx(D, {
              size: "T300",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: z instanceof Un && z.name === vo.M_LIMIT_EXCEEDED ? `Server rate-limited your request for ${A7(z.data.retry_after_ms ?? 0)} minutes!` : z.message
              })
            })
          ]
        }),
        o.jsx(E, {
          shrink: "No",
          direction: "Column",
          gap: "200",
          children: o.jsx(xe, {
            type: "submit",
            size: "500",
            variant: "Primary",
            radii: "400",
            disabled: O,
            before: U && o.jsx(dt, {
              variant: "Primary",
              fill: "Solid",
              size: "200"
            }),
            children: o.jsx(D, {
              size: "B500",
              children: "Create"
            })
          })
        })
      ]
    });
  }
  function Qlt({ state: t }) {
    const { spaceId: e } = t, n = got(), r = td(), i = ec(r), a = e ? i(e) : void 0;
    return o.jsx(WF, {
      value: a ?? null,
      children: o.jsx(Hn, {
        open: true,
        backdrop: o.jsx($n, {}),
        children: o.jsx(Wn, {
          children: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              clickOutsideDeactivates: true,
              onDeactivate: n,
              escapeDeactivates: kt
            },
            children: o.jsx(Go, {
              size: "300",
              flexHeight: true,
              children: o.jsxs(E, {
                direction: "Column",
                children: [
                  o.jsxs(wn, {
                    size: "500",
                    style: {
                      padding: ee.space.S200,
                      paddingLeft: ee.space.S400,
                      borderBottomWidth: ee.borderWidth.B300
                    },
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: "New Space"
                        })
                      }),
                      o.jsx(E, {
                        shrink: "No",
                        children: o.jsx(Oe, {
                          size: "300",
                          radii: "300",
                          onClick: n,
                          children: o.jsx(Q, {
                            src: q.Cross
                          })
                        })
                      })
                    ]
                  }),
                  o.jsx(dn, {
                    size: "300",
                    hideTrack: true,
                    children: o.jsx(E, {
                      style: {
                        padding: ee.space.S400,
                        paddingRight: ee.space.S200
                      },
                      direction: "Column",
                      gap: "500",
                      children: o.jsx(Zme, {
                        space: a,
                        onCreate: n
                      })
                    })
                  })
                ]
              })
            })
          })
        })
      })
    });
  }
  function ect() {
    const t = mot();
    return t ? o.jsx(Qlt, {
      state: t
    }) : null;
  }
  function tct() {
    const [t, e] = Fr(t3), n = Ze(Fh), r = Ze(gi), i = Ze(vi), a = be(), s = br(), l = Po("NotificationJumper"), c = p.useRef(false), d = p.useCallback(() => {
      if (!t || c.current) return;
      if (t.targetSessionId && t.targetSessionId !== n) {
        l.log("waiting for target session atom...", {
          targetSessionId: t.targetSessionId,
          activeSessionId: n
        });
        return;
      }
      if (t.targetSessionId && a.getUserId() !== t.targetSessionId) {
        l.log("waiting for mx client to switch to target session...", {
          targetSessionId: t.targetSessionId,
          currentUserId: a.getUserId()
        });
        return;
      }
      const h = a.getSyncState() === Nn.Syncing, f = a.getRoom(t.roomId), g = (f == null ? void 0 : f.getMyMembership()) === "join";
      if (h && g) {
        l.log("jumping to:", t.roomId, t.eventId), c.current = true;
        const m = wi(a, t.roomId);
        if (r.has(t.roomId)) s(xp(m, t.eventId));
        else {
          const v = aie(i, t.roomId);
          if (v.length > 0) {
            const y = K2(a, t.roomId, v) ?? v[0];
            s(tF(wi(a, y ?? t.roomId), m, t.eventId));
          } else s(Xg(m, t.eventId));
        }
        e(null);
      } else l.log("still waiting for room data...", {
        isSyncing: h,
        hasRoom: !!f,
        membership: f == null ? void 0 : f.getMyMembership()
      });
    }, [
      t,
      n,
      a,
      r,
      i,
      s,
      e,
      l
    ]);
    p.useEffect(() => {
      c.current = false;
    }, [
      t
    ]);
    const u = p.useRef(d);
    return u.current = d, $F(a, p.useCallback((h) => {
      h === Nn.Syncing && u.current();
    }, [])), p.useEffect(() => {
      if (!t) return;
      const h = () => u.current();
      return a.on(jt.Room, h), u.current(), () => {
        a.removeListener(jt.Room, h);
      };
    }, [
      t,
      a
    ]), null;
  }
  function nct(t) {
    const e = document.getElementById("sable-announcements");
    e && (e.textContent = "", requestAnimationFrame(() => {
      e.textContent = t;
    }));
  }
  function rct() {
    const t = br(), e = Za(), n = be(), r = Ze(vi), i = Ze(gi), a = Ze(qi), s = p.useRef(0), l = Wo(GB, e.pathname) ?? Wo(YB, e.pathname) ?? Wo(ZB, e.pathname), c = (l == null ? void 0 : l.params.roomIdOrAlias) ? decodeURIComponent(l.params.roomIdOrAlias) : void 0;
    let d = null;
    c && (c.startsWith("!") ? d = n.getRoom(c) : d = n.getRooms().find((w) => w.getCanonicalAlias() === c) ?? null);
    const u = mF((d == null ? void 0 : d.roomId) ?? ""), h = Ze(u), f = Fn(u), g = p.useCallback((w, b) => {
      var _a6;
      const j = wi(n, w), k = i.has(w);
      if (k) t(xp(j));
      else {
        const S = r.get(w);
        if (S && S.size > 0) {
          const T = Array.from(S)[0];
          if (!T) {
            t(Xg(j));
            return;
          }
          const A = wi(n, T);
          t(tF(A, j));
        } else t(Xg(j));
      }
      const C = ((_a6 = n.getRoom(w)) == null ? void 0 : _a6.name) ?? "Room";
      nct(`${C}, ${k ? "Direct Message" : "Group Room"}. ${b} room${b === 1 ? "" : "s"} unread.`);
    }, [
      n,
      i,
      r,
      t
    ]), m = p.useCallback((w) => {
      if (!Yt.isKeyHotkey("alt+n", w)) return;
      const b = Array.from(a.entries()).filter(([k, C]) => C.total > 0 && k !== (d == null ? void 0 : d.roomId)).toSorted((k, C) => C[1].highlight - k[1].highlight || C[1].total - k[1].total);
      if (b.length === 0) return;
      w.preventDefault(), s.current = 0;
      const [j] = b[0];
      g(j, b.length - 1);
    }, [
      a,
      d == null ? void 0 : d.roomId,
      g
    ]), v = p.useCallback((w) => {
      const b = Yt.isKeyHotkey("alt+shift+down", w), j = Yt.isKeyHotkey("alt+shift+up", w);
      if (!b && !j) return;
      const k = Array.from(a.entries()).filter(([, S]) => S.total > 0).toSorted((S, T) => T[1].highlight - S[1].highlight || T[1].total - S[1].total);
      if (k.length === 0) return;
      w.preventDefault(), b ? s.current = (s.current + 1) % k.length : s.current = (s.current - 1 + k.length) % k.length;
      const C = k[s.current];
      if (!C) return;
      const [x] = C;
      g(x, k.length - 1);
    }, [
      a,
      g
    ]), y = p.useCallback((w) => {
      const b = Yt.isKeyHotkey("mod+down", w), j = Yt.isKeyHotkey("mod+up", w);
      if (d === null || !b && !j) return;
      const k = d.getUnfilteredTimelineSet().getLiveTimeline().getEvents();
      if ((h == null ? void 0 : h.eventId) === void 0) {
        const T = k.at(-1);
        if (T === void 0) return;
        const A = T.event.event_id;
        if (A === void 0) return;
        f({
          userId: d.myUserId,
          eventId: A,
          body: ""
        });
        return;
      }
      const C = k.findIndex((T) => T.event.event_id === h.eventId);
      if (C === k.length - 1 && b) return;
      const x = j ? k[C - 1] : k[C + 1];
      if (!x) return;
      const S = x.event.event_id;
      S !== void 0 && f({
        userId: d.myUserId,
        eventId: S,
        body: ""
      });
    }, [
      d,
      h,
      f
    ]);
    return Ld(window, m), Ld(window, v), Ld(window, y), null;
  }
  const oc = () => {
    const t = be(), { roomIdOrAlias: e } = Fl(), n = e && decodeURIComponent(e);
    return n && ml(n) ? eF(t, n) : n;
  };
  function ict() {
    const t = be(), e = oc(), [n, r] = Fr(Ide), i = bS();
    p.useEffect(() => {
      if (e && n && e === n) {
        const a = t.getRoom(e);
        a && (i(a), r(null));
      }
    }, [
      e,
      n,
      i,
      r,
      t
    ]);
  }
  const KX = fo("IncomingCall");
  function oct({ room: t, onClose: e }) {
    const n = be(), r = rc(t), { navigateRoom: i } = Wi(), a = Sa(n, t, 96), s = Fn(Ide), l = Fn(XI), c = () => {
      KX.info("call", "Incoming call answered", {
        roomId: t.roomId
      }), wa({
        category: "call.signal",
        message: "Incoming call answered",
        data: {
          roomId: t.roomId
        }
      }), Vr("sable.call.answered", 1), l(t.roomId), s(t.roomId), e(), i(t.roomId);
    }, d = async () => {
      KX.info("call", "Incoming call declined", {
        roomId: t.roomId
      }), wa({
        category: "call.signal",
        message: "Incoming call declined",
        data: {
          roomId: t.roomId
        }
      }), Vr("sable.call.declined", 1), l(t.roomId), e();
    };
    return o.jsxs(lr, {
      variant: "Surface",
      style: {
        width: "340px"
      },
      children: [
        o.jsxs(wn, {
          style: {
            padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
            borderBottomWidth: ee.borderWidth.B300
          },
          variant: "Surface",
          size: "500",
          children: [
            o.jsx(E, {
              grow: "Yes",
              children: o.jsx(D, {
                size: "H4",
                children: "Incoming Call"
              })
            }),
            o.jsx(Oe, {
              size: "300",
              onClick: e,
              radii: "300",
              children: o.jsx(Q, {
                src: q.Cross
              })
            })
          ]
        }),
        o.jsxs(E, {
          style: {
            padding: ee.space.S600
          },
          direction: "Column",
          alignItems: "Center",
          gap: "500",
          children: [
            o.jsx(xn, {
              size: "500",
              children: o.jsx(yi, {
                roomId: t.roomId,
                src: a ?? void 0,
                alt: r,
                renderFallback: () => o.jsx(Q, {
                  size: "200",
                  src: q.User,
                  filled: true
                })
              })
            }),
            o.jsxs(E, {
              direction: "Column",
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(D, {
                  size: "L400",
                  align: "Center",
                  truncate: true,
                  children: r
                }),
                o.jsx(D, {
                  priority: "400",
                  size: "T300",
                  align: "Center",
                  children: "Incoming voice chat request"
                })
              ]
            }),
            o.jsxs(E, {
              gap: "300",
              style: {
                width: "100%"
              },
              justifyContent: "Center",
              children: [
                o.jsx(xe, {
                  variant: "Critical",
                  fill: "Soft",
                  style: {
                    minWidth: "110px"
                  },
                  onClick: d,
                  children: o.jsx(D, {
                    size: "B400",
                    children: "Decline"
                  })
                }),
                o.jsx(xe, {
                  fill: "Solid",
                  variant: "Primary",
                  style: {
                    minWidth: "110px"
                  },
                  onClick: c,
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.Phone
                  }),
                  children: o.jsx(D, {
                    size: "B400",
                    children: "Answer"
                  })
                })
              ]
            })
          ]
        })
      ]
    });
  }
  function act() {
    const [t, e] = Fr(Ade), n = be(), r = t ? n.getRoom(t) : null;
    if (!t || !r) return null;
    const i = () => e(null);
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: i,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsx("div", {
            children: o.jsx(oct, {
              room: r,
              onClose: i
            })
          })
        })
      })
    });
  }
  function sct({ embed: t }) {
    const e = Fn(ev);
    pKe(t), FKe(t);
    const n = p.useCallback(() => {
      e(void 0);
    }, [
      e
    ]);
    return gKe(t, n), qM(t.call, Ou.Close, n), null;
  }
  function lct() {
    return ict(), null;
  }
  function cct({ children: t }) {
    const e = Ze(ev), n = p.useRef(null), r = Ap(e), i = oc(), a = Ze(tv), s = fr(), l = a && s !== sn.Desktop, c = e && i === e.roomId && r && !l;
    return o.jsxs(hKe, {
      value: e,
      children: [
        o.jsx(act, {}),
        e && o.jsx(sct, {
          embed: e
        }),
        o.jsxs(fKe, {
          value: n,
          children: [
            o.jsx(lct, {}),
            t
          ]
        }),
        o.jsx("div", {
          "data-call-embed-container": true,
          style: {
            visibility: c ? void 0 : "hidden",
            position: "fixed",
            zIndex: c ? 10 : -1,
            pointerEvents: c ? "all" : "none"
          },
          ref: n
        })
      ]
    });
  }
  var K8 = ((t) => (t.PROMPT = "PROMPT", t.IGNORE = "IGNORE", t.FAIL_PROMPT = "FAIL_PROMPT", t.FAIL_ERROR = "FAIL_ERROR", t))(K8 || {});
  const cL = async (t, e) => {
    var _a6;
    const n = /^https?:\/\//.test(e) ? ho(e) : `https://${e}`, r = `${n}/.well-known/matrix/client`, [i, a] = await ca(t(r, {
      method: "GET"
    }));
    if (i || a.status === 404) return [
      void 0,
      {
        "m.homeserver": {
          base_url: n
        }
      }
    ];
    if (a.status !== 200) return [
      {
        host: n,
        action: "FAIL_PROMPT"
      },
      void 0
    ];
    const [s, l] = await ca(a.json());
    if (s || typeof l != "object") return [
      {
        host: n,
        action: "FAIL_PROMPT"
      },
      void 0
    ];
    const c = (_a6 = l["m.homeserver"]) == null ? void 0 : _a6.base_url;
    return typeof c != "string" ? [
      {
        host: n,
        action: "FAIL_PROMPT"
      },
      void 0
    ] : /^https?:\/\//.test(c) ? (l["m.homeserver"].base_url = ho(c), l["m.identity_server"] && (l["m.identity_server"].base_url = ho(l["m.identity_server"].base_url)), [
      void 0,
      l
    ]) : [
      {
        host: n,
        action: "FAIL_ERROR"
      },
      void 0
    ];
  }, Jme = async (t, e) => {
    const r = await (await t(`${ho(e)}/_matrix/client/versions`)).json();
    if (r && typeof r == "object" && "versions" in r && Array.isArray(r.versions)) return r;
    throw new Error("Homeserver URL does not appear to be a valid Matrix homeserver");
  };
  function Xme({ baseUrl: t, fallback: e, error: n, children: r }) {
    const [i, a] = Et(p.useCallback(() => Jme(fetch, t), [
      t
    ])), [s, l] = p.useState(false), c = p.useCallback(() => l(true), []);
    return p.useEffect(() => {
      a();
    }, [
      a
    ]), i.status === ve.Idle || i.status === ve.Loading ? e == null ? void 0 : e() : !s && i.status === ve.Error ? n == null ? void 0 : n(i.error, a, c) : r(i.status === ve.Success ? i.data : {
      versions: []
    });
  }
  var sg = ((t) => (t[t.FlowRequired = 401] = "FlowRequired", t[t.InvalidRequest = 400] = "InvalidRequest", t[t.RegistrationDisabled = 403] = "RegistrationDisabled", t[t.RateLimited = 429] = "RateLimited", t))(sg || {});
  const dct = (t) => {
    switch (t.httpStatus) {
      case 400:
        return {
          status: 400
        };
      case 429:
        return {
          status: 429
        };
      case 403:
        return {
          status: 403
        };
      case 401:
        return {
          status: 401,
          data: t.data
        };
      default:
        return {
          status: 400
        };
    }
  }, Qme = p.createContext(null), uct = Qme.Provider, ege = () => {
    const t = p.useContext(Qme);
    if (!t) throw new Error("Auth Flow info is not loaded!");
    return t;
  };
  function hct({ fallback: t, error: e, children: n }) {
    const i = am()["m.homeserver"].base_url, a = p.useMemo(() => Zf({
      baseUrl: i
    }), [
      i
    ]), [s, l] = Et(p.useCallback(async () => {
      const c = await Promise.allSettled([
        a.loginFlows(),
        a.registerRequest({})
      ]), d = bD(c[0]), u = Cye(c[1]);
      let h = {
        status: sg.InvalidRequest
      };
      if (typeof u == "object" && u.httpStatus && (h = dct(u)), !d) throw new Error("Missing auth flow!");
      if ("errcode" in d) throw new Error("Failed to load auth flow!");
      return {
        loginFlows: d,
        registerFlows: h
      };
    }, [
      a
    ]));
    return p.useEffect(() => {
      l();
    }, [
      l
    ]), s.status === ve.Idle || s.status === ve.Loading ? t == null ? void 0 : t() : s.status === ve.Error ? e == null ? void 0 : e(s.error) : n(s.data);
  }
  const tge = p.createContext(null), fct = tge.Provider, hv = () => {
    const t = p.useContext(tge);
    if (t === null) throw new Error("Auth server is not provided!");
    return t;
  };
  function mct({ server: t, serverList: e, allowCustomServer: n, onServerChange: r }) {
    const [i, a] = p.useState(), s = p.useRef(null), l = p.useRef(false);
    p.useEffect(() => {
      !l.current && s.current && s.current.value !== t && (s.current.value = t);
    }, [
      t
    ]);
    const c = Rp(r, {
      wait: 700
    }), d = (v) => {
      const y = v.target.value.trim();
      y && c(y);
    }, u = () => {
      l.current = true;
    }, h = () => {
      l.current = false, s.current && s.current.value.trim() === "" && (s.current.value = t);
    }, f = (v) => {
      if (v.key === "ArrowDown" && (v.preventDefault(), a(void 0)), v.key === "Enter") {
        v.preventDefault();
        const y = v.currentTarget.value.trim();
        y && r(y);
      }
    }, g = (v) => {
      const y = v.currentTarget.getAttribute("data-server");
      y && r(y), a(void 0);
    }, m = (v) => {
      const y = v.currentTarget.parentElement ?? v.currentTarget;
      a(y.getBoundingClientRect());
    };
    return o.jsx(mn, {
      ref: s,
      style: {
        paddingRight: ee.space.S200
      },
      variant: n ? "Background" : "Surface",
      outlined: true,
      defaultValue: t,
      onChange: d,
      onKeyDown: f,
      onFocus: u,
      onBlur: h,
      size: "500",
      readOnly: !n,
      onClick: n ? void 0 : m,
      autoCapitalize: "off",
      spellCheck: false,
      autoCorrect: "off",
      after: e.length === 0 || e.length === 1 && !n ? void 0 : o.jsx(ln, {
        anchor: i,
        position: "Bottom",
        align: "End",
        offset: 4,
        content: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: () => a(void 0),
            clickOutsideDeactivates: true,
            isKeyForward: (v) => v.key === "ArrowDown",
            isKeyBackward: (v) => v.key === "ArrowUp",
            escapeDeactivates: kt
          },
          children: o.jsxs(tn, {
            children: [
              o.jsx(wn, {
                size: "300",
                style: {
                  padding: `0 ${ee.space.S200}`
                },
                children: o.jsx(D, {
                  size: "L400",
                  children: "Homeserver List"
                })
              }),
              o.jsx("div", {
                style: {
                  padding: ee.space.S100,
                  paddingTop: 0
                },
                children: e == null ? void 0 : e.map((v) => o.jsx(Ye, {
                  radii: "300",
                  "aria-pressed": v === t,
                  "data-server": v,
                  onClick: g,
                  children: o.jsx(D, {
                    children: v
                  })
                }, v))
              })
            ]
          })
        }),
        children: o.jsx(Oe, {
          onClick: m,
          variant: n ? "Background" : "Surface",
          size: "300",
          "aria-pressed": !!i,
          radii: "300",
          children: o.jsx(Q, {
            src: q.ChevronBottom
          })
        })
      })
    });
  }
  var gct = "styles_AuthLayout__39n2z00", pct = "styles_AuthCard__39n2z01", Fct = "styles_AuthLogo__39n2z02 _1mqalmd1 _1mqalmd0", vct = "styles_AuthHeader__39n2z03", _ct = "styles_AuthCardContent__39n2z04", yct = "styles_AuthFooter__39n2z05";
  function bct() {
    return o.jsxs(E, {
      className: yct,
      justifyContent: "Center",
      gap: "400",
      wrap: "Wrap",
      children: [
        o.jsx(D, {
          as: "a",
          size: "T300",
          href: "https://app.sable.moe",
          target: "_blank",
          rel: "noreferrer",
          children: "About"
        }),
        o.jsx(D, {
          as: "a",
          size: "T300",
          href: "https://github.com/SableClient/Sable",
          target: "_blank",
          rel: "noreferrer",
          children: "v1.17.0-dev"
        }),
        o.jsx(D, {
          as: "a",
          size: "T300",
          href: "https://matrix.org",
          target: "_blank",
          rel: "noreferrer",
          children: "Powered by Matrix"
        })
      ]
    });
  }
  const GX = (t) => Wo($y, t) ? $y : Wo(g4, t) ? g4 : Wo(m4, t) ? m4 : $y;
  function KT({ message: t }) {
    return o.jsxs(E, {
      justifyContent: "Center",
      alignItems: "Center",
      gap: "200",
      children: [
        o.jsx(dt, {
          size: "100",
          variant: "Secondary"
        }),
        o.jsx(D, {
          align: "Center",
          size: "T300",
          children: t
        })
      ]
    });
  }
  function ny({ message: t }) {
    return o.jsx(E, {
      justifyContent: "Center",
      alignItems: "Center",
      gap: "200",
      children: o.jsx(D, {
        align: "Center",
        style: {
          color: ct.Critical.Main
        },
        size: "T300",
        children: t
      })
    });
  }
  function xct() {
    const t = br(), e = Za(), { server: n } = Fl(), [r] = fh(), i = r.get("addAccount") === "1", a = la(), s = W2e(a);
    let c = (n && decodeURIComponent(n)) ?? s;
    xte(a, c) || (c = s);
    const [d, u] = Et(p.useCallback(async (m) => {
      const v = await cL(fetch, m);
      return {
        serverName: m,
        response: v
      };
    }, []));
    p.useEffect(() => {
      c && u(c);
    }, [
      u,
      c
    ]), p.useEffect(() => {
      if (!n || decodeURIComponent(n) !== c) {
        const m = hl(GX(e.pathname), {
          server: encodeURIComponent(c)
        }), v = r.toString();
        t(`${m}${v ? `?${v}` : ""}`, {
          replace: true
        });
      }
    }, [
      n,
      t,
      e,
      c,
      r
    ]);
    const h = p.useCallback((m) => {
      if (m === c) {
        if (d.status === ve.Loading) return;
        u(c);
        return;
      }
      const v = hl(GX(e.pathname), {
        server: encodeURIComponent(m)
      }), y = r.toString();
      t(`${v}${y ? `?${y}` : ""}`);
    }, [
      t,
      e,
      d,
      c,
      u,
      r
    ]), [f, g] = d.status === ve.Success ? d.data.response : [];
    return o.jsx(dn, {
      variant: "Background",
      visibility: "Hover",
      size: "300",
      hideTrack: true,
      children: o.jsxs(E, {
        className: gt(gct, Rte),
        direction: "Column",
        alignItems: "Center",
        justifyContent: "SpaceBetween",
        gap: "400",
        children: [
          o.jsxs(E, {
            direction: "Column",
            className: pct,
            children: [
              o.jsxs(wn, {
                className: vct,
                size: "600",
                variant: "Surface",
                children: [
                  o.jsxs(E, {
                    grow: "Yes",
                    direction: "Row",
                    gap: "300",
                    alignItems: "Center",
                    children: [
                      o.jsx("img", {
                        className: Fct,
                        src: tp,
                        alt: "Sable Logo"
                      }),
                      o.jsx(D, {
                        size: "H3",
                        children: "Sable"
                      })
                    ]
                  }),
                  i && o.jsxs(E, {
                    gap: "200",
                    alignItems: "Center",
                    style: {
                      marginLeft: "auto"
                    },
                    children: [
                      o.jsx(D, {
                        size: "T200",
                        priority: "300",
                        children: "Adding account"
                      }),
                      o.jsx(Qe, {
                        variant: "Surface",
                        radii: "300",
                        onClick: () => window.location.assign($c()),
                        children: o.jsx(D, {
                          size: "T200",
                          children: "Cancel"
                        })
                      })
                    ]
                  })
                ]
              }),
              o.jsxs(E, {
                className: _ct,
                direction: "Column",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        as: "label",
                        size: "L400",
                        priority: "300",
                        children: "Homeserver"
                      }),
                      o.jsx(mct, {
                        server: c,
                        serverList: a.homeserverList ?? [],
                        allowCustomServer: a.allowCustomHomeservers,
                        onServerChange: h
                      })
                    ]
                  }),
                  d.status === ve.Loading && o.jsx(KT, {
                    message: "Looking for homeserver..."
                  }),
                  d.status === ve.Error && o.jsx(ny, {
                    message: "Failed to find homeserver."
                  }),
                  (f == null ? void 0 : f.action) === K8.FAIL_PROMPT && o.jsx(ny, {
                    message: `Failed to connect. Homeserver configuration found with ${f.host} appears unusable.`
                  }),
                  (f == null ? void 0 : f.action) === K8.FAIL_ERROR && o.jsx(ny, {
                    message: "Failed to connect. Homeserver configuration base_url appears invalid."
                  }),
                  d.status === ve.Success && g && o.jsx(fct, {
                    value: d.data.serverName,
                    children: o.jsx(jde, {
                      value: g,
                      children: o.jsx(Xme, {
                        baseUrl: g["m.homeserver"].base_url,
                        fallback: () => o.jsx(KT, {
                          message: `Connecting to ${g["m.homeserver"].base_url}`
                        }),
                        error: () => o.jsx(ny, {
                          message: "Failed to connect. Either homeserver is unavailable at this moment or does not exist."
                        }),
                        children: (m) => o.jsx(yie, {
                          value: m,
                          children: o.jsx(hct, {
                            fallback: () => o.jsx(KT, {
                              message: "Loading authentication flow..."
                            }),
                            error: () => o.jsx(ny, {
                              message: "Failed to get authentication flow information."
                            }),
                            children: (v) => o.jsx(uct, {
                              value: v,
                              children: o.jsx(I0, {})
                            })
                          })
                        })
                      })
                    })
                  })
                ]
              })
            ]
          }),
          o.jsx(bct, {})
        ]
      })
    });
  }
  const wct = (t) => t.find((e) => e.type === "m.login.sso" || e.type === "m.login.cas"), Dct = (t) => t.find((e) => e.type === "m.login.password"), Cct = (t) => t.find((e) => e.type === "m.login.token"), nge = (t) => p.useMemo(() => ({
    password: Dct(t),
    token: Cct(t),
    sso: wct(t)
  }), [
    t
  ]), G8 = (t) => {
    const { hashRouter: e } = la(), { origin: n } = window.location;
    return p.useMemo(() => {
      let i = Ij(n);
      return i += `/${Ij("/sable")}`, i = ho(i), (e == null ? void 0 : e.enabled) && (i += `/#/${Ij(e.basename ?? "")}`, i = ho(i)), i += `/${Ay(t)}`, i;
    }, [
      t,
      e,
      n
    ]);
  };
  function rge({ providers: t, redirectUrl: e, action: n, saveScreenSpace: r }) {
    const a = am()["m.homeserver"].base_url, s = p.useMemo(() => Zf({
      baseUrl: a
    }), [
      a
    ]), l = (u) => s.getSsoLoginUrl(e, "sso", u, n), d = (t ? t.find((u) => !u.icon || !s.mxcUrlToHttp(u.icon, 96, 96, "crop", false)) : true) ? false : r && t && t.length > 2;
    return o.jsx(E, {
      justifyContent: "Center",
      gap: "600",
      wrap: "Wrap",
      children: t ? t.map((u) => {
        const { id: h, name: f, icon: g } = u, m = g && s.mxcUrlToHttp(g, 96, 96, "crop", false), v = `Continue with ${f}`;
        return d ? o.jsx(xn, {
          style: {
            cursor: "pointer"
          },
          as: "a",
          href: l(h),
          "aria-label": v,
          size: "300",
          radii: "300",
          children: o.jsx(Xu, {
            src: m,
            alt: f,
            title: v
          })
        }, h) : o.jsx(xe, {
          style: {
            width: "100%"
          },
          as: "a",
          href: l(h),
          size: "500",
          variant: "Secondary",
          fill: "Soft",
          outlined: true,
          before: m && o.jsx(xn, {
            size: "200",
            radii: "300",
            children: o.jsx(Xu, {
              src: m,
              alt: f
            })
          }),
          children: o.jsx(D, {
            align: "Center",
            size: "B500",
            truncate: true,
            children: v
          })
        }, h);
      }) : o.jsx(xe, {
        style: {
          width: "100%"
        },
        as: "a",
        href: l(),
        size: "500",
        variant: "Secondary",
        fill: "Soft",
        outlined: true,
        children: o.jsx(D, {
          align: "Center",
          size: "B500",
          truncate: true,
          children: "Continue with SSO"
        })
      })
    });
  }
  function ige() {
    return o.jsxs(E, {
      gap: "400",
      alignItems: "Center",
      children: [
        o.jsx(nr, {
          style: {
            flexGrow: 1
          },
          direction: "Horizontal",
          size: "300",
          variant: "Surface"
        }),
        o.jsx(D, {
          children: "OR"
        }),
        o.jsx(nr, {
          style: {
            flexGrow: 1
          },
          direction: "Horizontal",
          size: "300",
          variant: "Surface"
        })
      ]
    });
  }
  function ra({ message: t }) {
    return o.jsxs(E, {
      style: {
        color: ct.Critical.Main
      },
      alignItems: "Center",
      gap: "100",
      children: [
        o.jsx(Q, {
          size: "50",
          filled: true,
          src: q.Warning
        }),
        o.jsx(D, {
          size: "T200",
          children: o.jsx("b", {
            children: t
          })
        })
      ]
    });
  }
  const dL = "after_login_redirect_url", YX = (t) => {
    localStorage.setItem(dL, t);
  }, oge = () => localStorage.getItem(dL) ?? void 0, age = () => {
    localStorage.removeItem(dL);
  }, ZX = Po("loginUtil"), Vm = fo("loginUtil"), Ect = (t, e) => async () => {
    if (!xte(t, e)) throw new Error("NotAllow");
    const [, n] = await ca(cL(fetch, e));
    let r;
    const [, i] = n ?? [];
    if (i && (r = i["m.homeserver"].base_url), !r) throw new Error("NotFound");
    const [, a] = await ca(Jme(fetch, r));
    if (!a) throw new Error("NotFound");
    return r;
  };
  var tl = ((t) => (t.ServerNotAllowed = "ServerNotAllowed", t.InvalidServer = "InvalidServer", t.Forbidden = "Forbidden", t.UserDeactivated = "UserDeactivated", t.InvalidRequest = "InvalidRequest", t.RateLimited = "RateLimited", t.Unknown = "Unknown", t))(tl || {});
  const sge = async (t, e) => {
    const [n, r] = typeof t == "function" ? await ca(t()) : [
      void 0,
      t
    ];
    if (n) throw new Un({
      errcode: n.message === "NotAllow" ? "ServerNotAllowed" : "InvalidServer"
    });
    const i = Zf({
      baseUrl: r
    });
    return Vm.info("general", "Attempting login", {
      baseUrl: r,
      loginType: e.type
    }), Mg({
      name: "auth.login",
      op: "auth",
      attributes: {
        "auth.method": e.type
      }
    }, async (a) => {
      const [s, l] = await ca(i.loginRequest(e));
      if (s) throw a.setAttribute("auth.error", s.errcode ?? "unknown"), Vr("sable.auth.login_failed", 1, {
        attributes: {
          errcode: s.errcode ?? "unknown"
        }
      }), s.httpStatus === 400 ? (Vm.error("general", "Login failed - invalid request", {
        httpStatus: 400
      }), new Un({
        errcode: "InvalidRequest"
      })) : s.httpStatus === 429 ? (Vm.error("general", "Login failed - rate limited", {
        httpStatus: 429
      }), new Un({
        errcode: "RateLimited"
      })) : s.errcode === vo.M_USER_DEACTIVATED ? (Vm.error("general", "Login failed - user deactivated", {
        errcode: s.errcode
      }), new Un({
        errcode: "UserDeactivated"
      })) : s.httpStatus === 403 ? (Vm.error("general", "Login failed - forbidden", {
        httpStatus: 403
      }), new Un({
        errcode: "Forbidden"
      })) : (Vm.error("general", "Login failed - unknown error", {
        error: s.message,
        httpStatus: s.httpStatus
      }), new Un({
        error: s.message,
        errcode: "Unknown"
      }));
      return a.setAttribute("auth.success", true), Vm.info("general", "Login successful", {
        userId: l.user_id,
        deviceId: l.device_id
      }), {
        baseUrl: r,
        response: l
      };
    });
  }, lge = (t) => {
    const e = br(), n = Fn(th), r = Fn(Fh);
    p.useEffect(() => {
      if (t) {
        const { response: i, baseUrl: a } = t;
        ZX.log("useLoginComplete: login success", {
          userId: i.user_id,
          baseUrl: a
        });
        const s = {
          baseUrl: a,
          userId: i.user_id,
          deviceId: i.device_id,
          accessToken: i.access_token
        };
        n({
          type: "PUT",
          session: s
        }), r(i.user_id);
        const l = oge();
        age();
        const c = l ?? $c();
        ZX.log("useLoginComplete: navigating to", c), e(c, {
          replace: true
        });
      }
    }, [
      t,
      e,
      n,
      r
    ]);
  };
  function kct({ server: t }) {
    const [e, n] = p.useState(), r = (i) => {
      n(i.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: e,
      position: "Top",
      align: "End",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => n(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          children: [
            o.jsx(wn, {
              size: "300",
              style: {
                padding: `0 ${ee.space.S200}`
              },
              children: o.jsx(D, {
                size: "L400",
                children: "Hint"
              })
            }),
            o.jsxs(E, {
              style: {
                padding: ee.space.S200,
                paddingTop: 0
              },
              direction: "Column",
              tabIndex: 0,
              gap: "100",
              children: [
                o.jsxs(D, {
                  size: "T300",
                  children: [
                    o.jsx(D, {
                      as: "span",
                      size: "Inherit",
                      priority: "300",
                      children: "Username:"
                    }),
                    " ",
                    "user123"
                  ]
                }),
                o.jsxs(D, {
                  size: "T300",
                  children: [
                    o.jsx(D, {
                      as: "span",
                      size: "Inherit",
                      priority: "300",
                      children: "Matrix ID:"
                    }),
                    ` @user123:${t}`
                  ]
                }),
                o.jsxs(D, {
                  size: "T300",
                  children: [
                    o.jsx(D, {
                      as: "span",
                      size: "Inherit",
                      priority: "300",
                      children: "Email:"
                    }),
                    ` user123@${t}`
                  ]
                })
              ]
            })
          ]
        })
      }),
      children: o.jsx(Oe, {
        tabIndex: -1,
        onClick: r,
        type: "button",
        variant: "Background",
        size: "300",
        radii: "300",
        "aria-pressed": !!e,
        children: o.jsx(Q, {
          style: {
            opacity: ee.opacity.P300
          },
          size: "100",
          src: q.Info
        })
      })
    });
  }
  function Sct({ defaultUsername: t, defaultEmail: e }) {
    const n = hv(), r = la(), a = am()["m.homeserver"].base_url, [s, l] = Et(p.useCallback(sge, []));
    lge(s.status === ve.Success ? s.data : void 0);
    const c = (f, g) => {
      l(a, {
        type: "m.login.password",
        identifier: {
          type: "m.id.user",
          user: f
        },
        password: g,
        initial_device_display_name: h1()
      });
    }, d = async (f, g) => {
      const m = bo(f), v = _n(f);
      if (!m || !v) return;
      const y = Ect(r, m);
      l(y, {
        type: "m.login.password",
        identifier: {
          type: "m.id.user",
          user: v
        },
        password: g,
        initial_device_display_name: h1()
      });
    }, u = (f, g) => {
      l(a, {
        type: "m.login.password",
        identifier: {
          type: "m.id.thirdparty",
          medium: "email",
          address: f
        },
        password: g,
        initial_device_display_name: h1()
      });
    }, h = (f) => {
      f.preventDefault();
      const { usernameInput: g, passwordInput: m } = f.target, v = g.value.trim(), y = m.value;
      if (!v) {
        g.focus();
        return;
      }
      if (!y) {
        m.focus();
        return;
      }
      if (co(v)) {
        d(v, y);
        return;
      }
      if (XSe.test(v)) {
        u(v, y);
        return;
      }
      c(v, y);
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: h,
      direction: "Inherit",
      gap: "400",
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              as: "label",
              htmlFor: "login-username-input",
              size: "L400",
              priority: "300",
              children: "Username"
            }),
            o.jsx(mn, {
              id: "login-username-input",
              defaultValue: t ?? e,
              style: {
                paddingRight: ee.space.S300
              },
              name: "usernameInput",
              variant: "Background",
              size: "500",
              required: true,
              outlined: true,
              autoCapitalize: "off",
              spellCheck: false,
              autoCorrect: "off",
              after: o.jsx(kct, {
                server: n
              })
            }),
            s.status === ve.Error && o.jsxs(o.Fragment, {
              children: [
                s.error.errcode === tl.ServerNotAllowed && o.jsx(ra, {
                  message: "Login with custom server not allowed by your client instance."
                }),
                s.error.errcode === tl.InvalidServer && o.jsx(ra, {
                  message: "Failed to find your Matrix ID server."
                })
              ]
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              as: "label",
              htmlFor: "login-password-input",
              size: "L400",
              priority: "300",
              children: "Password"
            }),
            o.jsx(Yl, {
              id: "login-password-input",
              name: "passwordInput",
              variant: "Background",
              size: "500",
              outlined: true,
              required: true
            }),
            o.jsxs(E, {
              alignItems: "Start",
              justifyContent: "SpaceBetween",
              gap: "200",
              children: [
                s.status === ve.Error && o.jsxs(o.Fragment, {
                  children: [
                    s.error.errcode === tl.Forbidden && o.jsx(ra, {
                      message: "Invalid Username or Password."
                    }),
                    s.error.errcode === tl.UserDeactivated && o.jsx(ra, {
                      message: "This account has been deactivated."
                    }),
                    s.error.errcode === tl.InvalidRequest && o.jsx(ra, {
                      message: "Failed to login. Part of your request data is invalid."
                    }),
                    s.error.errcode === tl.RateLimited && o.jsx(ra, {
                      message: "Failed to login. Your login request has been rate-limited by server, Please try after some time."
                    }),
                    s.error.errcode === tl.Unknown && o.jsx(ra, {
                      message: `Failed to login: ${s.error.data.error}`
                    })
                  ]
                }),
                o.jsx(E, {
                  grow: "Yes",
                  shrink: "No",
                  justifyContent: "End",
                  children: o.jsx(D, {
                    as: "span",
                    size: "T200",
                    priority: "400",
                    align: "Right",
                    children: o.jsx(Lb, {
                      to: ake(n),
                      children: "Forget Password?"
                    })
                  })
                })
              ]
            })
          ]
        }),
        o.jsx(xe, {
          type: "submit",
          variant: "Primary",
          size: "500",
          children: o.jsx(D, {
            as: "span",
            size: "B500",
            children: "Login"
          })
        }),
        o.jsx(Hn, {
          open: s.status === ve.Loading || s.status === ve.Success,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(dt, {
              variant: "Secondary",
              size: "600"
            })
          })
        })
      ]
    });
  }
  function ry({ message: t }) {
    return o.jsxs(E, {
      style: {
        backgroundColor: ct.Critical.Container,
        color: ct.Critical.OnContainer,
        padding: ee.space.S300,
        borderRadius: ee.radii.R400
      },
      justifyContent: "Start",
      alignItems: "Start",
      gap: "300",
      children: [
        o.jsx(Q, {
          size: "300",
          filled: true,
          src: q.Warning
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Token Login"
            }),
            o.jsx(D, {
              size: "T300",
              children: o.jsx("b", {
                children: t
              })
            })
          ]
        })
      ]
    });
  }
  function jct({ token: t }) {
    const n = am()["m.homeserver"].base_url, [r, i] = Et(p.useCallback(sge, []));
    return p.useEffect(() => {
      i(n, {
        type: "m.login.token",
        token: t,
        initial_device_display_name: h1()
      });
    }, [
      n,
      t,
      i
    ]), lge(r.status === ve.Success ? r.data : void 0), o.jsxs(o.Fragment, {
      children: [
        r.status === ve.Error && o.jsxs(o.Fragment, {
          children: [
            r.error.errcode === tl.Forbidden && o.jsx(ry, {
              message: "Invalid login token."
            }),
            r.error.errcode === tl.UserDeactivated && o.jsx(ry, {
              message: "This account has been deactivated."
            }),
            r.error.errcode === tl.InvalidRequest && o.jsx(ry, {
              message: "Failed to login. Part of your request data is invalid."
            }),
            r.error.errcode === tl.RateLimited && o.jsx(ry, {
              message: "Failed to login. Your login request has been rate-limited by server, Please try after some time."
            }),
            r.error.errcode === tl.Unknown && o.jsx(ry, {
              message: `Failed to login: ${r.error.data.error}`
            })
          ]
        }),
        o.jsx(Hn, {
          open: r.status !== ve.Error,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(dt, {
              size: "600",
              variant: "Secondary"
            })
          })
        })
      ]
    });
  }
  const Tct = () => new URLSearchParams(window.location.search).get("loginToken") ?? void 0, Rct = (t) => p.useMemo(() => ({
    username: t.get("username") ?? void 0,
    email: t.get("email") ?? void 0,
    loginToken: t.get("loginToken") ?? void 0
  }), [
    t
  ]);
  function Act() {
    const t = hv(), { hashRouter: e } = la(), { hideUsernamePasswordFields: n } = la(), { loginFlows: r } = ege(), [i] = fh(), a = Rct(i), s = G8(Hd(t)), l = Tct(), c = G8(Hd(t));
    (e == null ? void 0 : e.enabled) && l && window.location.replace(gl(c, {
      loginToken: l
    }));
    const d = nge(r.flows);
    return o.jsxs(E, {
      direction: "Column",
      gap: "500",
      children: [
        o.jsx(D, {
          size: "H2",
          priority: "400",
          children: "Login"
        }),
        d.token && a.loginToken && o.jsx(jct, {
          token: a.loginToken
        }),
        !n && d.password && o.jsxs(o.Fragment, {
          children: [
            o.jsx(Sct, {
              defaultUsername: a.username,
              defaultEmail: a.email
            }),
            o.jsx("span", {
              "data-spacing-node": true
            }),
            d.sso && o.jsx(ige, {})
          ]
        }),
        d.sso && o.jsxs(o.Fragment, {
          children: [
            o.jsx(rge, {
              providers: d.sso.identity_providers,
              redirectUrl: s,
              action: kB.LOGIN,
              saveScreenSpace: d.password !== void 0
            }),
            o.jsx("span", {
              "data-spacing-node": true
            })
          ]
        }),
        !d.password && !d.sso && o.jsxs(o.Fragment, {
          children: [
            o.jsx(D, {
              style: {
                color: ct.Critical.Main
              },
              children: `This client does not support login on "${t}" homeserver. Password and SSO based login method not found.`
            }),
            o.jsx("span", {
              "data-spacing-node": true
            })
          ]
        }),
        o.jsxs(D, {
          align: "Center",
          children: [
            "Do not have an account? ",
            o.jsx(Lb, {
              to: oke(t),
              children: "Register"
            })
          ]
        })
      ]
    });
  }
  function Ict({ flows: t, supportedStages: e, children: n }) {
    const r = tde(t, e);
    return n(r);
  }
  const Bct = (t) => {
    const e = p.useRef(1), n = p.useCallback(async (a, s, l) => {
      const c = e.current;
      e.current += 1;
      const d = await t.requestRegisterEmailToken(a, s, c, l);
      return {
        email: a,
        clientSecret: s,
        result: d
      };
    }, [
      t
    ]), [r, i] = Et(n);
    return [
      r,
      i
    ];
  };
  var yd = ((t) => (t.UserTaken = "UserTaken", t.UserInvalid = "UserInvalid", t.UserExclusive = "UserExclusive", t.PasswordWeak = "PasswordWeak", t.PasswordShort = "PasswordShort", t.InvalidRequest = "InvalidRequest", t.Forbidden = "Forbidden", t.RateLimited = "RateLimited", t.Unknown = "Unknown", t))(yd || {});
  const Pct = async (t, e) => {
    const [n, r] = await ca(t.registerRequest(e));
    if (n) {
      if (n.httpStatus === 401) return [
        n.data,
        void 0
      ];
      throw n.errcode === vo.M_USER_IN_USE ? new Un({
        errcode: "UserTaken"
      }) : n.errcode === vo.M_INVALID_USERNAME ? new Un({
        errcode: "UserInvalid"
      }) : n.errcode === vo.M_EXCLUSIVE ? new Un({
        errcode: "UserExclusive"
      }) : n.errcode === vo.M_WEAK_PASSWORD ? new Un({
        errcode: "PasswordWeak",
        error: n.data.error
      }) : n.errcode === vo.M_PASSWORD_TOO_SHORT ? new Un({
        errcode: "PasswordShort",
        error: n.data.error
      }) : n.httpStatus === 429 ? new Un({
        errcode: "RateLimited"
      }) : n.httpStatus === 400 ? new Un({
        errcode: "InvalidRequest"
      }) : n.httpStatus === 403 ? new Un({
        errcode: "Forbidden"
      }) : new Un({
        errcode: "Unknown",
        error: n.data.error
      });
    }
    return [
      void 0,
      {
        baseUrl: t.baseUrl,
        response: r
      }
    ];
  }, Mct = (t) => {
    const e = br(), n = Fn(th), r = Fn(Fh);
    p.useEffect(() => {
      if (t) {
        const { response: i, baseUrl: a } = t, s = i.user_id, l = i.access_token, c = i.device_id;
        if (l && c) {
          n({
            type: "PUT",
            session: {
              baseUrl: a,
              userId: s,
              deviceId: c,
              accessToken: l
            }
          }), r(s), gEe(l, c, s, a);
          const d = oge();
          age(), e(d ?? $c(), {
            replace: true
          });
        } else {
          const d = _n(s), u = bo(s);
          e(gl(Hd(u), {
            username: d ?? ""
          }), {
            replace: true
          });
        }
      }
    }, [
      t,
      e,
      n,
      r
    ]);
  }, Oct = [
    sr.RegistrationToken,
    sr.Terms,
    sr.Recaptcha,
    sr.Email,
    sr.Dummy
  ], Lct = (t, e) => {
    const n = [];
    return e.token && n.push(sr.RegistrationToken), e.email && n.push(sr.Email), e.terms && n.push(sr.Terms), tC(t, sr.Recaptcha) && n.push(sr.Recaptcha), n;
  };
  function Nct({ formData: t, flow: e, authData: n, registerEmailState: r, registerEmail: i, onRegister: a }) {
    const s = PM(n), { getStageToComplete: l } = rde(n, e), c = l(), d = p.useCallback((h) => {
      const { password: f, username: g } = t;
      a({
        auth: h,
        password: f,
        username: g,
        initial_device_display_name: h1()
      });
    }, [
      a,
      t
    ]), u = p.useCallback(() => {
      window.location.reload();
    }, []);
    return c ? o.jsxs(MM, {
      currentStep: s.length + 1,
      stepCount: e.stages.length,
      onCancel: u,
      children: [
        c.type === sr.RegistrationToken && o.jsx(w$e, {
          token: t.token,
          stageData: c,
          submitAuthDict: d,
          onCancel: u
        }),
        c.type === sr.Terms && o.jsx(E$e, {
          stageData: c,
          submitAuthDict: d,
          onCancel: u
        }),
        c.type === sr.Recaptcha && o.jsx(x$e, {
          stageData: c,
          submitAuthDict: d,
          onCancel: u
        }),
        c.type === sr.Email && o.jsx(ide, {
          email: t.email,
          clientSecret: t.clientSecret,
          stageData: c,
          requestEmailToken: i,
          emailTokenState: r,
          submitAuthDict: d,
          onCancel: u
        }),
        c.type === sr.Dummy && o.jsx(r$e, {
          stageData: c,
          submitAuthDict: d,
          onCancel: u
        })
      ]
    }) : null;
  }
  function zct({ authData: t, uiaFlows: e, defaultUsername: n, defaultEmail: r, defaultRegisterToken: i }) {
    const s = am()["m.homeserver"].base_url, l = p.useMemo(() => Zf({
      baseUrl: s
    }), [
      s
    ]), c = nde(t), d = JHe(c), [u, h] = p.useState(), [f, g] = p.useState(), [m, v] = Bct(l), [y, w] = Et(p.useCallback(async (x) => Pct(l, x), [
      l
    ])), [b, j] = y.status === ve.Success ? y.data : [], k = y.status === ve.Error ? y.error : void 0;
    Mct(j);
    const C = (x) => {
      x.preventDefault();
      const { usernameInput: S, passwordInput: T, confirmPasswordInput: A, emailInput: B, tokenInput: U, termsInput: z } = x.target, O = U == null ? void 0 : U.value.trim(), M = S.value.trim(), I = T.value, N = A.value;
      if (I !== N) return;
      const L = B == null ? void 0 : B.value.trim(), H = (z == null ? void 0 : z.value) === "on";
      if (!M) {
        S.focus();
        return;
      }
      const V = {
        username: M,
        password: I,
        token: O,
        email: L,
        terms: H,
        clientSecret: l.generateClientSecret()
      }, Z = Lct(e, V), Y = ZHe(e, Z);
      g(Y), h(V), w({
        username: M,
        password: I,
        auth: {
          session: t.session
        },
        initial_device_display_name: h1()
      });
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsxs(E, {
          as: "form",
          onSubmit: C,
          direction: "Inherit",
          gap: "400",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  as: "label",
                  htmlFor: "register-username-input",
                  size: "L400",
                  priority: "300",
                  children: "Username"
                }),
                o.jsx(mn, {
                  id: "register-username-input",
                  variant: "Background",
                  defaultValue: n,
                  name: "usernameInput",
                  size: "500",
                  outlined: true,
                  required: true
                }),
                (k == null ? void 0 : k.errcode) === yd.UserTaken && o.jsx(ra, {
                  message: "This username is already taken."
                }),
                (k == null ? void 0 : k.errcode) === yd.UserInvalid && o.jsx(ra, {
                  message: "This username contains invalid characters."
                }),
                (k == null ? void 0 : k.errcode) === yd.UserExclusive && o.jsx(ra, {
                  message: "This username is reserved."
                })
              ]
            }),
            o.jsx(BM, {
              initialValue: true,
              children: (x, S, T, A) => o.jsxs(o.Fragment, {
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        as: "label",
                        htmlFor: "register-password-input",
                        size: "L400",
                        priority: "300",
                        children: "Password"
                      }),
                      o.jsx(Yl, {
                        id: "register-password-input",
                        ref: T,
                        onChange: S,
                        name: "passwordInput",
                        variant: "Background",
                        size: "500",
                        outlined: true,
                        required: true
                      }),
                      (k == null ? void 0 : k.errcode) === yd.PasswordWeak && o.jsx(ra, {
                        message: k.data.error ?? "Weak Password. Password rejected by server please choosing more strong Password."
                      }),
                      (k == null ? void 0 : k.errcode) === yd.PasswordShort && o.jsx(ra, {
                        message: k.data.error ?? "Short Password. Password rejected by server please choosing more long Password."
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        as: "label",
                        htmlFor: "register-confirm-password-input",
                        size: "L400",
                        priority: "300",
                        children: "Confirm Password"
                      }),
                      o.jsx(Yl, {
                        id: "register-confirm-password-input",
                        ref: A,
                        onChange: S,
                        name: "confirmPasswordInput",
                        variant: "Background",
                        size: "500",
                        style: {
                          color: x ? void 0 : ct.Critical.Main
                        },
                        outlined: true,
                        required: true
                      })
                    ]
                  })
                ]
              })
            }),
            tC(e, sr.RegistrationToken) && o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  as: "label",
                  htmlFor: "register-token-input",
                  size: "L400",
                  priority: "300",
                  children: Kw(e, sr.RegistrationToken) ? "Registration Token" : "Registration Token (Optional)"
                }),
                o.jsx(mn, {
                  id: "register-token-input",
                  variant: "Background",
                  defaultValue: i,
                  name: "tokenInput",
                  size: "500",
                  required: Kw(e, sr.RegistrationToken),
                  outlined: true
                })
              ]
            }),
            tC(e, sr.Email) && o.jsxs(E, {
              direction: "Column",
              gap: "100",
              children: [
                o.jsx(D, {
                  as: "label",
                  htmlFor: "register-email-input",
                  size: "L400",
                  priority: "300",
                  children: Kw(e, sr.Email) ? "Email" : "Email (Optional)"
                }),
                o.jsx(mn, {
                  id: "register-email-input",
                  variant: "Background",
                  defaultValue: r,
                  name: "emailInput",
                  type: "email",
                  size: "500",
                  required: Kw(e, sr.Email),
                  outlined: true
                })
              ]
            }),
            tC(e, sr.Terms) && d && o.jsxs(E, {
              alignItems: "Center",
              gap: "200",
              children: [
                o.jsx(Rd, {
                  name: "termsInput",
                  size: "300",
                  variant: "Primary",
                  required: true
                }),
                o.jsxs(D, {
                  size: "T300",
                  children: [
                    "I accept server",
                    " ",
                    o.jsx("a", {
                      href: d,
                      target: "_blank",
                      rel: "noreferrer",
                      children: "Terms and Conditions"
                    }),
                    "."
                  ]
                })
              ]
            }),
            (k == null ? void 0 : k.errcode) === yd.RateLimited && o.jsx(ra, {
              message: "Failed to register. Your register request has been rate-limited by server, Please try after some time."
            }),
            (k == null ? void 0 : k.errcode) === yd.Forbidden && o.jsx(ra, {
              message: "Failed to register. The homeserver does not permit registration."
            }),
            (k == null ? void 0 : k.errcode) === yd.InvalidRequest && o.jsx(ra, {
              message: "Failed to register. Invalid request."
            }),
            (k == null ? void 0 : k.errcode) === yd.Unknown && o.jsx(ra, {
              message: k.data.error ?? "Failed to register. Unknown Reason."
            }),
            o.jsx("span", {
              "data-spacing-node": true
            }),
            o.jsx(xe, {
              variant: "Primary",
              size: "500",
              type: "submit",
              children: o.jsx(D, {
                as: "span",
                size: "B500",
                children: "Register"
              })
            })
          ]
        }),
        y.status === ve.Success && u && f && b && o.jsx(Nct, {
          formData: u,
          flow: f,
          authData: b,
          registerEmail: v,
          registerEmailState: m,
          onRegister: w
        }),
        y.status === ve.Loading && o.jsx(Hn, {
          open: true,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(dt, {
              variant: "Secondary",
              size: "600"
            })
          })
        })
      ]
    });
  }
  const Uct = (t) => p.useMemo(() => ({
    username: t.get("username") ?? void 0,
    email: t.get("email") ?? void 0,
    token: t.get("token") ?? void 0
  }), [
    t
  ]);
  function Vct() {
    const t = hv(), { loginFlows: e, registerFlows: n } = ege(), [r] = fh(), i = Uct(r), { sso: a } = nge(e.flows), s = G8(Hd(t));
    return o.jsxs(E, {
      direction: "Column",
      gap: "500",
      children: [
        o.jsx(D, {
          size: "H2",
          priority: "400",
          children: "Register"
        }),
        n.status === sg.RegistrationDisabled && !a && o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T300",
          children: "Registration has been disabled on this homeserver."
        }),
        n.status === sg.RateLimited && !a && o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T300",
          children: "You have been rate-limited! Please try after some time."
        }),
        n.status === sg.InvalidRequest && !a && o.jsx(D, {
          style: {
            color: ct.Critical.Main
          },
          size: "T300",
          children: "Invalid Request! Failed to get any registration options."
        }),
        n.status === sg.FlowRequired && o.jsxs(o.Fragment, {
          children: [
            o.jsx(Ict, {
              flows: n.data.flows ?? [],
              supportedStages: Oct,
              children: (l) => l.length === 0 ? o.jsx(D, {
                style: {
                  color: ct.Critical.Main
                },
                size: "T300",
                children: "This application does not support registration on this homeserver."
              }) : o.jsx(zct, {
                authData: n.data,
                uiaFlows: l,
                defaultUsername: i.username,
                defaultEmail: i.email,
                defaultRegisterToken: i.token
              })
            }),
            o.jsx("span", {
              "data-spacing-node": true
            }),
            a && o.jsx(ige, {})
          ]
        }),
        a && o.jsxs(o.Fragment, {
          children: [
            o.jsx(rge, {
              providers: a.identity_providers,
              redirectUrl: s,
              action: kB.REGISTER,
              saveScreenSpace: n.status === sg.FlowRequired
            }),
            o.jsx("span", {
              "data-spacing-node": true
            })
          ]
        }),
        o.jsxs(D, {
          align: "Center",
          children: [
            "Already have an account? ",
            o.jsx(Lb, {
              to: Hd(t),
              children: "Login"
            })
          ]
        })
      ]
    });
  }
  const Hct = (t) => {
    const e = p.useRef(1), n = p.useCallback(async (a, s, l) => {
      const c = e.current;
      e.current += 1;
      const d = await t.requestPasswordEmailToken(a, s, c, l);
      return {
        email: a,
        clientSecret: s,
        result: d
      };
    }, [
      t
    ]), [r, i] = Et(n);
    return [
      r,
      i
    ];
  }, $ct = async (t, e, n) => {
    const [r, i] = await ca(t.setPassword(e, n, false));
    if (r) {
      if (r.httpStatus === 401) return [
        r.data,
        void 0
      ];
      throw r;
    }
    return [
      void 0,
      i
    ];
  };
  function Wct({ email: t }) {
    const e = hv(), n = br(), r = () => {
      const i = Hd(e);
      if (t) {
        n(gl(i, {
          email: t
        }));
        return;
      }
      n(i);
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          children: o.jsx(lr, {
            children: o.jsxs(E, {
              style: {
                padding: ee.space.S400
              },
              direction: "Column",
              gap: "400",
              children: [
                o.jsx(D, {
                  children: "Password has been reset successfully. Please login with your new password."
                }),
                o.jsx(xe, {
                  variant: "Primary",
                  onClick: r,
                  children: o.jsx(D, {
                    size: "B400",
                    as: "span",
                    children: "Login"
                  })
                })
              ]
            })
          })
        })
      })
    });
  }
  const JX = () => {
    window.location.reload();
  };
  function qct({ defaultEmail: t }) {
    var _a6, _b3;
    const e = hv(), r = am()["m.homeserver"].base_url, i = p.useMemo(() => Zf({
      baseUrl: r
    }), [
      r
    ]), [a, s] = p.useState(), [l, c] = Hct(i), [d, u] = Et(p.useCallback(async (j, k) => $ct(i, j, k), [
      i
    ])), [h, f] = d.status === ve.Success ? d.data : [], g = d.status === ve.Error ? d.error : void 0, m = h && Qce(h), v = h && ede(h);
    let y = true;
    f && (y = false), h && m === void 0 && (y = false), g && (y = false), d.status === ve.Loading && (y = false), p.useEffect(() => {
      a && h && !m && u({
        type: sr.Password,
        identifier: {
          type: "m.id.thirdparty",
          medium: "email",
          address: a.email
        },
        password: a.password
      }, a.password);
    }, [
      h,
      m,
      a,
      u
    ]);
    const w = (j) => {
      j.preventDefault();
      const { emailInput: k, passwordInput: C, confirmPasswordInput: x } = j.target, S = k.value.trim(), T = C.value, A = x.value;
      if (!S) {
        k.focus();
        return;
      }
      if (T !== A) return;
      const B = i.generateClientSecret();
      c(S, B), s({
        email: S,
        password: T,
        clientSecret: B
      });
    }, b = p.useCallback((j) => {
      if (!a) return;
      const { password: k } = a;
      u(j, k);
    }, [
      a,
      u
    ]);
    return o.jsxs(E, {
      as: "form",
      onSubmit: w,
      direction: "Inherit",
      gap: "400",
      children: [
        o.jsxs(D, {
          size: "T300",
          priority: "400",
          children: [
            "Homeserver ",
            o.jsx("strong", {
              children: e
            }),
            " will send you an email to let you reset your password."
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              as: "label",
              size: "L400",
              priority: "300",
              children: "Email"
            }),
            o.jsx(mn, {
              defaultValue: t,
              type: "email",
              name: "emailInput",
              variant: "Background",
              size: "500",
              required: true,
              outlined: true
            }),
            l.status === ve.Error && o.jsx(ra, {
              message: `${l.error.errcode}: ${(_a6 = l.error.data) == null ? void 0 : _a6.error}`
            })
          ]
        }),
        o.jsx(BM, {
          initialValue: true,
          children: (j, k, C, x) => o.jsxs(o.Fragment, {
            children: [
              o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    as: "label",
                    size: "L400",
                    priority: "300",
                    children: "New Password"
                  }),
                  o.jsx(Yl, {
                    ref: C,
                    onChange: k,
                    name: "passwordInput",
                    variant: "Background",
                    size: "500",
                    outlined: true,
                    required: true
                  })
                ]
              }),
              o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    as: "label",
                    size: "L400",
                    priority: "300",
                    children: "Confirm Password"
                  }),
                  o.jsx(Yl, {
                    ref: x,
                    onChange: k,
                    name: "confirmPasswordInput",
                    variant: "Background",
                    size: "500",
                    style: {
                      color: j ? void 0 : ct.Critical.Main
                    },
                    outlined: true,
                    required: true
                  })
                ]
              })
            ]
          })
        }),
        g && o.jsx(ra, {
          message: `${g.errcode}: ${((_b3 = g.data) == null ? void 0 : _b3.error) ?? "Failed to reset password."}`
        }),
        o.jsx("span", {
          "data-spacing-node": true
        }),
        o.jsx(xe, {
          type: "submit",
          variant: "Primary",
          size: "500",
          children: o.jsx(D, {
            as: "span",
            size: "B500",
            children: "Reset Password"
          })
        }),
        f && o.jsx(Wct, {
          email: a == null ? void 0 : a.email
        }),
        l.status === ve.Success && a && y && o.jsx(MM, {
          currentStep: 1,
          stepCount: 1,
          onCancel: JX,
          children: o.jsx(ide, {
            stageData: {
              type: sr.Email,
              errorCode: m,
              error: v,
              session: h == null ? void 0 : h.session
            },
            submitAuthDict: b,
            email: a.email,
            clientSecret: a.clientSecret,
            requestEmailToken: c,
            emailTokenState: l,
            onCancel: JX
          })
        }),
        o.jsx(Hn, {
          open: l.status === ve.Loading || d.status === ve.Loading,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(dt, {
              variant: "Secondary",
              size: "600"
            })
          })
        })
      ]
    });
  }
  const Kct = (t) => p.useMemo(() => ({
    email: t.get("email") ?? void 0
  }), [
    t
  ]);
  function Gct() {
    const t = hv(), [e] = fh(), n = Kct(e);
    return o.jsxs(E, {
      direction: "Column",
      gap: "500",
      children: [
        o.jsx(D, {
          size: "H2",
          priority: "400",
          children: "Reset Password"
        }),
        o.jsx(qct, {
          defaultEmail: n.email
        }),
        o.jsx("span", {
          "data-spacing-node": true
        }),
        o.jsxs(D, {
          align: "Center",
          children: [
            "Remember your password? ",
            o.jsx(Lb, {
              to: Hd(t),
              children: "Login"
            })
          ]
        })
      ]
    });
  }
  const Yct = Po("ServerConfigsLoader");
  function Zct({ children: t }) {
    const e = be(), n = p.useMemo(() => ({}), []), [r] = ZE(p.useCallback(async () => {
      const a = await Promise.allSettled([
        e.getCapabilities(),
        e.getMediaConfig(),
        e.getAuthMetadata()
      ]), s = bD(a[0]), l = bD(a[1]), c = bD(a[2]);
      let d;
      try {
        d = mB(c);
      } catch (u) {
        Yct.error("Failed to validate auth metadata:", u);
      }
      return {
        capabilities: s,
        mediaConfig: l,
        authMetadata: d
      };
    }, [
      e
    ])), i = r.status === ve.Success ? r.data : n;
    return t(i);
  }
  const fD = {
    onVisibilityHidden: null,
    onVisibilityChange: null
  }, Jct = fo("AppVisibility");
  function Xct(t) {
    const e = la(), [n] = Fe(ge, "usePushNotifications"), r = Fr(zM), i = Dr();
    p.useEffect(() => {
      const a = () => {
        var _a6, _b3;
        const s = document.visibilityState === "visible";
        Jct.info("general", `App visibility changed: ${s ? "visible (foreground)" : "hidden (background)"}`, {
          visibilityState: document.visibilityState
        }), (_a6 = fD.onVisibilityChange) == null ? void 0 : _a6.call(fD, s), s || ((_b3 = fD.onVisibilityHidden) == null ? void 0 : _b3.call(fD));
      };
      return document.addEventListener("visibilitychange", a), () => {
        document.removeEventListener("visibilitychange", a);
      };
    }, []), p.useEffect(() => {
      if (!t) return;
      const a = (s) => {
        uqe(t, e, s, n, r, i);
      };
      return fD.onVisibilityChange = a, () => {
        fD.onVisibilityChange = null;
      };
    }, [
      t,
      e,
      n,
      r,
      i
    ]);
  }
  function Qct({ mx: t }) {
    const [e, n] = p.useState({
      current: null,
      previous: void 0
    });
    return $F(t, p.useCallback((r, i) => {
      n((a) => a.current === r && a.previous === i ? a : {
        current: r,
        previous: i
      }), (r === Nn.Reconnecting || r === Nn.Error) && (wa({
        category: "sync",
        message: `Sync state changed to ${r}`,
        level: r === Nn.Error ? "error" : "warning",
        data: {
          previous: i
        }
      }), Vr("sable.sync.degraded", 1, {
        attributes: {
          state: r
        }
      }));
    }, [])), (e.current === Nn.Prepared || e.current === Nn.Syncing || e.current === Nn.Catchup) && e.previous !== Nn.Syncing ? o.jsxs(E, {
      direction: "Column",
      shrink: "No",
      children: [
        o.jsx(E, {
          className: ro({
            variant: "Success"
          }),
          style: {
            padding: `${ee.space.S100} 0`
          },
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(D, {
            size: "L400",
            children: "Connecting..."
          })
        }),
        o.jsx(nr, {
          variant: "Success",
          size: "300"
        })
      ]
    }) : e.current === Nn.Reconnecting ? o.jsxs(E, {
      direction: "Column",
      shrink: "No",
      children: [
        o.jsx(E, {
          className: ro({
            variant: "Warning"
          }),
          style: {
            padding: `${ee.space.S100} 0`
          },
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(D, {
            size: "L400",
            children: "Connection Lost! Reconnecting..."
          })
        }),
        o.jsx(nr, {
          variant: "Warning",
          size: "300"
        })
      ]
    }) : e.current === Nn.Error ? o.jsxs(E, {
      direction: "Column",
      shrink: "No",
      children: [
        o.jsx(E, {
          className: ro({
            variant: "Critical"
          }),
          style: {
            padding: `${ee.space.S100} 0`
          },
          alignItems: "Center",
          justifyContent: "Center",
          children: o.jsx(D, {
            size: "L400",
            children: "Connection Lost!"
          })
        }),
        o.jsx(nr, {
          variant: "Critical",
          size: "300"
        })
      ]
    }) : null;
  }
  function edt({ baseUrl: t, children: e }) {
    return o.jsx(Xme, {
      baseUrl: t,
      fallback: () => o.jsx(If, {
        children: o.jsxs(E, {
          direction: "Column",
          grow: "Yes",
          alignItems: "Center",
          justifyContent: "Center",
          gap: "400",
          children: [
            o.jsx(dt, {
              variant: "Secondary",
              size: "600"
            }),
            o.jsx(D, {
              children: "Connecting to server"
            })
          ]
        })
      }),
      error: (n, r, i) => o.jsx(If, {
        children: o.jsx(E, {
          direction: "Column",
          grow: "Yes",
          alignItems: "Center",
          justifyContent: "Center",
          gap: "400",
          children: o.jsx(lr, {
            children: o.jsxs(E, {
              direction: "Column",
              gap: "400",
              style: {
                padding: ee.space.S400
              },
              children: [
                o.jsx(D, {
                  children: "Failed to connect to homeserver. Either homeserver is down or your internet."
                }),
                o.jsx(xe, {
                  variant: "Critical",
                  onClick: r,
                  children: o.jsx(D, {
                    as: "span",
                    size: "B400",
                    children: "Retry"
                  })
                }),
                o.jsx(xe, {
                  variant: "Critical",
                  onClick: i,
                  fill: "Soft",
                  children: o.jsx(D, {
                    as: "span",
                    size: "B400",
                    children: "Continue"
                  })
                })
              ]
            })
          })
        })
      }),
      children: (n) => o.jsx(yie, {
        value: n,
        children: e
      })
    });
  }
  function tdt({ userId: t, baseUrl: e, children: n }) {
    const [r] = ZE(p.useCallback(async () => {
      const s = bo(t);
      return cL(fetch, s ?? t);
    }, [
      t
    ])), [, i] = r.status === ve.Success ? r.data : [], a = p.useMemo(() => ({
      "m.homeserver": {
        base_url: e
      }
    }), [
      e
    ]);
    return o.jsx(jde, {
      value: i ?? a,
      children: n
    });
  }
  const iy = Po("ClientRoot"), XX = (t) => t === "PREPARED" || t === "SYNCING" || t === "CATCHUP";
  function ndt() {
    return o.jsx(If, {
      children: o.jsxs(E, {
        direction: "Column",
        grow: "Yes",
        alignItems: "Center",
        justifyContent: "Center",
        gap: "400",
        children: [
          o.jsx(dt, {
            variant: "Secondary",
            size: "600"
          }),
          o.jsx(D, {
            children: "Petting cats"
          })
        ]
      })
    });
  }
  function rdt({ mx: t, onLogout: e }) {
    const [n, r] = p.useState(), i = (a) => {
      const s = a.currentTarget.getBoundingClientRect();
      r((l) => {
        if (!l) return s;
      });
    };
    return o.jsxs(Oe, {
      style: {
        position: "absolute",
        top: ee.space.S100,
        right: ee.space.S100
      },
      variant: "Background",
      fill: "None",
      onClick: i,
      children: [
        o.jsx(Q, {
          size: "200",
          src: q.VerticalDots
        }),
        o.jsx(ln, {
          anchor: n,
          position: "Bottom",
          align: "End",
          offset: 6,
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => r(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (a) => a.key === "ArrowDown",
              isKeyBackward: (a) => a.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: [
                  t && o.jsx(Ye, {
                    onClick: () => jie(t),
                    size: "300",
                    radii: "300",
                    children: o.jsx(D, {
                      as: "span",
                      size: "T300",
                      truncate: true,
                      children: "Clear Cache and Reload"
                    })
                  }),
                  o.jsx(Ye, {
                    onClick: () => {
                      if (t) {
                        e();
                        return;
                      }
                      UEe();
                    },
                    size: "300",
                    radii: "300",
                    variant: "Critical",
                    fill: "None",
                    children: o.jsx(D, {
                      as: "span",
                      size: "T300",
                      truncate: true,
                      children: "Logout"
                    })
                  })
                ]
              })
            })
          })
        })
      ]
    });
  }
  const idt = (t) => {
    p.useEffect(() => {
      const e = async () => {
        wa({
          category: "auth",
          message: "Session forcibly logged out by server",
          level: "warning"
        }), t && $u(t), await (t == null ? void 0 : t.clearStores()), window.localStorage.clear(), window.location.reload();
      };
      return t == null ? void 0 : t.on(I2.SessionLoggedOut, e), () => {
        t == null ? void 0 : t.removeListener(I2.SessionLoggedOut, e);
      };
    }, [
      t
    ]);
  };
  function odt({ children: t }) {
    const [e, n] = p.useState(true), r = br(), i = la(), a = Ze(th), [s, l] = Fr(Fh), c = Fn(th), d = a.find((x) => x.userId === s) ?? a[0], { baseUrl: u, userId: h } = d ?? {}, f = p.useRef(void 0), g = p.useRef(performance.now()), m = p.useRef(false), [v, y, w] = Et(p.useCallback(async () => {
      if (!d) throw iy.error("no session found"), new Error("No session Found!");
      d.userId !== s && (iy.log("persisting activeSessionId \u2192", d.userId), l(d.userId)), await zEe(), iy.log("initClient for", d.userId);
      const x = await Eie(d);
      return f.current = d.userId, d4(d.baseUrl, d.accessToken), x;
    }, [
      d,
      s,
      l
    ])), b = v.status === ve.Success ? v.data : void 0, [j, k] = Et(p.useCallback((x) => Sie(x, {
      baseUrl: d == null ? void 0 : d.baseUrl,
      slidingSync: i.slidingSync,
      sessionSlidingSyncOptIn: d == null ? void 0 : d.slidingSyncOptIn
    }), [
      d == null ? void 0 : d.baseUrl,
      d == null ? void 0 : d.slidingSyncOptIn,
      i.slidingSync
    ]));
    p.useEffect(() => {
      d && f.current && f.current !== d.userId && (iy.log("session changed from", f.current, "\u2192", d.userId, "\u2014 reloading client"), d4(d.baseUrl, d.accessToken), (b == null ? void 0 : b.clientRunning) && $u(b), n(true), f.current = void 0, w({
        status: ve.Idle
      }), r($c(), {
        replace: true
      }));
    }, [
      d,
      b,
      r,
      w
    ]);
    const C = p.useCallback(async () => {
      var _a6;
      !b || !d || (await f4(b, d), c({
        type: "DELETE",
        session: d
      }), l(((_a6 = a.find((x) => x.userId !== d.userId)) == null ? void 0 : _a6.userId) ?? void 0), window.location.reload());
    }, [
      b,
      d,
      a,
      c,
      l
    ]);
    return FGe(b), idt(b), Xct(b), p.useEffect(() => () => {
      (b == null ? void 0 : b.clientRunning) && (iy.log("ClientRoot unmounting \u2014 stopping client", b.getUserId()), $u(b));
    }, [
      b
    ]), p.useEffect(() => {
      v.status === ve.Idle && y();
    }, [
      v,
      y
    ]), p.useEffect(() => {
      b && !b.clientRunning && k(b);
    }, [
      b,
      k
    ]), p.useEffect(() => {
      b && XX(b.getSyncState()) && n(false);
    }, [
      b
    ]), $F(b, p.useCallback((x) => {
      XX(x) && (m.current || (m.current = true, oa("sable.sync.time_to_ready_ms", performance.now() - g.current)), n(false));
    }, [])), p.useEffect(() => {
      if (d == null ? void 0 : d.baseUrl) return A1("client", {
        homeserver: d.baseUrl,
        sliding_sync: i.slidingSync
      }), () => {
        A1("client", null);
      };
    }, [
      d == null ? void 0 : d.baseUrl,
      i.slidingSync
    ]), p.useEffect(() => {
      if (!b) return;
      const x = b.getUserId();
      if (x) return (async () => {
        const S = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(x)), T = Array.from(new Uint8Array(S)).map((B) => B.toString(16).padStart(2, "0")).join("").slice(0, 16), A = x.split(":")[1] ?? "unknown";
        rU({
          id: T,
          homeserver: A
        });
      })(), () => {
        rU(null);
      };
    }, [
      b
    ]), p.useEffect(() => {
      v.status === ve.Error && y2(v.error, {
        tags: {
          phase: "load"
        }
      });
    }, [
      v
    ]), p.useEffect(() => {
      j.status === ve.Error && y2(j.error, {
        tags: {
          phase: "start"
        }
      });
    }, [
      j
    ]), o.jsx(tdt, {
      userId: h ?? "",
      baseUrl: u ?? "",
      children: o.jsxs(edt, {
        baseUrl: u ?? "",
        children: [
          b && o.jsx(Qct, {
            mx: b
          }),
          e && o.jsx(rdt, {
            mx: b,
            onLogout: C
          }),
          (v.status === ve.Error || j.status === ve.Error) && o.jsx(If, {
            children: o.jsx(E, {
              direction: "Column",
              grow: "Yes",
              alignItems: "Center",
              justifyContent: "Center",
              gap: "400",
              children: o.jsx(lr, {
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "400",
                  style: {
                    padding: ee.space.S400
                  },
                  children: [
                    v.status === ve.Error && o.jsx(D, {
                      children: `Failed to load. ${v.error.message}`
                    }),
                    j.status === ve.Error && o.jsx(D, {
                      children: `Failed to start. ${j.error.message}`
                    }),
                    o.jsx(xe, {
                      variant: "Critical",
                      onClick: b ? () => k(b) : y,
                      children: o.jsx(D, {
                        as: "span",
                        size: "B400",
                        children: "Retry"
                      })
                    })
                  ]
                })
              })
            })
          }),
          e || !b ? o.jsx(ndt, {}) : o.jsx(v4e, {
            value: b,
            children: o.jsx(Zct, {
              children: (x) => o.jsx(iUe, {
                value: x.capabilities ?? {},
                children: o.jsx(eze, {
                  value: x.mediaConfig ?? {},
                  children: o.jsx(j$e, {
                    value: x.authMetadata,
                    children: t
                  })
                })
              })
            })
          })
        ]
      })
    });
  }
  const adt = (t) => {
    G5e(t, gi), Cst(t, cv), sAe(t, zr), K5e(t, vi), SAe(t, qi), snt(t, OO);
  };
  function sdt({ children: t }) {
    const e = be();
    return adt(e), t;
  }
  function ldt({ nav: t, children: e }) {
    const n = Za(), r = fr(), i = !!Wo(PF, n.pathname) && !WM(n.pathname, n.state, r);
    return o.jsxs(E, {
      grow: "Yes",
      children: [
        !i && o.jsx(E, {
          shrink: "No",
          children: t
        }),
        o.jsx(E, {
          grow: "Yes",
          children: e
        })
      ]
    });
  }
  const cdt = "data:image/svg+xml,%3csvg%20viewBox='0%200%20512%20512'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23181825'%20d='M%20255.99974,0.1037582%20A%20255.89609,255.89609%200%200%200%200.10375619,255.99978%20255.89609,255.89609%200%200%200%20255.99974,511.89625%20255.89609,255.89609%200%200%200%20339.13667,498.01466%20125.31725,125.31725%200%200%201%20288.18864,397.14979%20125.31725,125.31725%200%200%201%20413.50582,271.83251%20125.31725,125.31725%200%200%201%20505.64585,312.21104%20255.89609,255.89609%200%200%200%20511.89622,255.99978%20255.89609,255.89609%200%200%200%20255.99974,0.1037582%20Z'/%3e%3ccircle%20fill='%23989898'%20cx='413.73395'%20cy='395.55249'%20r='62.658623'/%3e%3cpath%20fill='%239987f7'%20d='M%20281.22266,61.638672%20C%20252.51456,62.340868%20242.25,96.445313%20242.25,96.445312%20c%200,0%2021.86201,-0.227885%2038.08398,2%2019.65914,2.699828%2036.77735,8.470708%2036.77735,8.470708%200,0%20-12.11668,-45.858806%20-35.88867,-45.277348%20z%20M%20176.44531,79.111328%20c%20-48.18491,2.028263%20-80.827865,69.713282%20-12.08398,159.111332%200.80656,1.04883%20-3.8528,2.37319%20-12.25,-6.08399%20-14.29504,-14.39717%20-25.27735,-39.58398%20-25.27735,-39.58398%200,0%20-30.436305,90.74071%20-54.556636,125.36133%20-11.322277,16.25085%20-23.296424,29.36279%20-34.673828,40.0664%2036.151435,77.35626%20112.144444,132.24302%20201.664064,138.37696%200.39018,-1.71398%200.87261,-3.37594%201.17773,-5.13672%207.3847,-42.61472%2022.24188,-82.33049%2049.29102,-109.79297%20a%20125.31725,125.31725%200%200%201%20123.76953,-109.59766%20125.31725,125.31725%200%200%201%2033.93945,5.30274%20c%20-6.47254,-3.74441%20-14.05852,-10.17329%20-14.55664,-20.30079%20-0.72761,-14.7695%2026.44531,-16%2026.44531,-16%200,0%20-16.78004,-12.90508%20-42.25,-31.02929%20-14.15715,-10.07648%20-23.71667,-44.74677%20-63.55664,-75.52735%20-42.51349,-32.84957%20-109.55468,-29.36132%20-109.55468,-29.36132%200,0%2011.18932,19.49627%2011.88867,25.47265%201.15061,9.83807%20-4.14406,0.85935%20-4.80664,-0.19336%20-20.40648,-35.136141%20-46.82455,-50.026407%20-69.88867,-51.083982%20-1.58601,-0.07268%20-3.16642,-0.06541%20-4.72071,0%20z%20M%20331.66602,200.88867%20c%2011.37689,-0.77289%2021.73754,6.54406%2024.80664,17.52735%20l%200.88867,6.47265%20c%200,12.65368%20-9.79137,23.13771%20-22.41602,24%20-12.62502,0.86151%20-23.75391,-8.18588%20-25.47265,-20.72265%20-1.71877,-12.53681%206.55285,-24.26336%2018.94336,-26.83204%201.07318,-0.22215%202.15627,-0.37139%203.25,-0.44531%20z'/%3e%3cpath%20fill='%237b6dc4'%20d='m%20177.84845,197.13285%20c%200,0%20-44.43023,-63.57598%20-8.46796,-99.538252%2026.21392,-26.213922%2064.86752,30.516502%2064.86752,30.516502%200,0%20-40.50667,-3.42071%20-42.97866,11.82315%20-1.00026,6.16799%2014.37955,10.70468%2014.37955,10.70468%200,0%20-10.86453,14.69916%20-15.49793,22.44815%20-4.63345,7.74898%20-12.30252,24.04577%20-12.30252,24.04577%20z'/%3e%3c/svg%3e", ddt = "data:image/svg+xml,%3csvg%20viewBox='0%200%20512%20512'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23181825'%20d='M%20255.99974,0.1037582%20A%20255.89609,255.89609%200%200%200%200.10375619,255.99978%20255.89609,255.89609%200%200%200%20255.99974,511.89625%20255.89609,255.89609%200%200%200%20339.13667,498.01466%20125.31725,125.31725%200%200%201%20288.18864,397.14979%20125.31725,125.31725%200%200%201%20413.50582,271.83251%20125.31725,125.31725%200%200%201%20505.64585,312.21104%20255.89609,255.89609%200%200%200%20511.89622,255.99978%20255.89609,255.89609%200%200%200%20255.99974,0.1037582%20Z'/%3e%3ccircle%20fill='%2331ff41'%20cx='413.73395'%20cy='395.55249'%20r='62.658623'/%3e%3cpath%20fill='%239987f7'%20d='M%20281.22266,61.638672%20C%20252.51456,62.340868%20242.25,96.445313%20242.25,96.445312%20c%200,0%2021.86201,-0.227885%2038.08398,2%2019.65914,2.699828%2036.77735,8.470708%2036.77735,8.470708%200,0%20-12.11668,-45.858806%20-35.88867,-45.277348%20z%20M%20176.44531,79.111328%20c%20-48.18491,2.028263%20-80.827865,69.713282%20-12.08398,159.111332%200.80656,1.04883%20-3.8528,2.37319%20-12.25,-6.08399%20-14.29504,-14.39717%20-25.27735,-39.58398%20-25.27735,-39.58398%200,0%20-30.436305,90.74071%20-54.556636,125.36133%20-11.322277,16.25085%20-23.296424,29.36279%20-34.673828,40.0664%2036.151435,77.35626%20112.144444,132.24302%20201.664064,138.37696%200.39018,-1.71398%200.87261,-3.37594%201.17773,-5.13672%207.3847,-42.61472%2022.24188,-82.33049%2049.29102,-109.79297%20a%20125.31725,125.31725%200%200%201%20123.76953,-109.59766%20125.31725,125.31725%200%200%201%2033.93945,5.30274%20c%20-6.47254,-3.74441%20-14.05852,-10.17329%20-14.55664,-20.30079%20-0.72761,-14.7695%2026.44531,-16%2026.44531,-16%200,0%20-16.78004,-12.90508%20-42.25,-31.02929%20-14.15715,-10.07648%20-23.71667,-44.74677%20-63.55664,-75.52735%20-42.51349,-32.84957%20-109.55468,-29.36132%20-109.55468,-29.36132%200,0%2011.18932,19.49627%2011.88867,25.47265%201.15061,9.83807%20-4.14406,0.85935%20-4.80664,-0.19336%20-20.40648,-35.136141%20-46.82455,-50.026407%20-69.88867,-51.083982%20-1.58601,-0.07268%20-3.16642,-0.06541%20-4.72071,0%20z%20M%20331.66602,200.88867%20c%2011.37689,-0.77289%2021.73754,6.54406%2024.80664,17.52735%20l%200.88867,6.47265%20c%200,12.65368%20-9.79137,23.13771%20-22.41602,24%20-12.62502,0.86151%20-23.75391,-8.18588%20-25.47265,-20.72265%20-1.71877,-12.53681%206.55285,-24.26336%2018.94336,-26.83204%201.07318,-0.22215%202.15627,-0.37139%203.25,-0.44531%20z'/%3e%3cpath%20fill='%237b6dc4'%20d='m%20177.84845,197.13285%20c%200,0%20-44.43023,-63.57598%20-8.46796,-99.538252%2026.21392,-26.213922%2064.86752,30.516502%2064.86752,30.516502%200,0%20-40.50667,-3.42071%20-42.97866,11.82315%20-1.00026,6.16799%2014.37955,10.70468%2014.37955,10.70468%200,0%20-10.86453,14.69916%20-15.49793,22.44815%20-4.63345,7.74898%20-12.30252,24.04577%20-12.30252,24.04577%20z'/%3e%3c/svg%3e", udt = "/sable/assets/notification-EtLMRd0T.ogg", hdt = "/sable/assets/invite-DROg5x7-.ogg", fdt = (t, e) => {
    const n = p.useRef(e);
    return p.useEffect(() => {
      n.current = t;
    }, [
      t
    ]), n.current;
  }, mdt = () => !!Ko({
    path: nP(),
    caseSensitive: true,
    end: false
  }), cge = () => !!Ko({
    path: Tk(),
    caseSensitive: true,
    end: false
  }), gdt = () => !!Ko({
    path: i3(),
    caseSensitive: true,
    end: false
  }), pdt = async (t = ((_l3) => (_l3 = globalThis.navigator) == null ? void 0 : _l3.serviceWorker)()) => {
    if (t) try {
      return await t.getRegistration();
    } catch {
      return;
    }
  }, dge = vn(void 0);
  dge.onMount = (t) => {
    var _a6;
    const e = (_a6 = globalThis.navigator) == null ? void 0 : _a6.serviceWorker;
    if (!e) return;
    let n = false;
    const r = async () => {
      const a = await pdt(e);
      n || t(a);
    }, i = () => {
      r();
    };
    return r(), e.addEventListener("controllerchange", i), e.ready.then((a) => {
      n || t(a);
    }).catch(() => {
      r();
    }), () => {
      n = true, e.removeEventListener("controllerchange", i);
    };
  };
  const Fdt = "/public/res/logo-maskable/logo-maskable-180x180.png", vdt = "/public/res/logo-maskable/logo-maskable-72x72.png", Y8 = "new message", GT = "Encrypted message", mD = (t, e) => {
    if (typeof t != "string") return e;
    const n = t.trim();
    return n.length > 0 ? n : e;
  }, _dt = (t) => {
    if (!t || typeof t != "object") return;
    const { body: e } = t;
    if (typeof e != "string") return;
    const n = e.trim();
    return n.length > 0 ? n : void 0;
  }, Z8 = ({ content: t, eventType: e, isEncryptedRoom: n, showMessageContent: r, showEncryptedMessageContent: i }) => {
    if (e === "m.reaction" && t && typeof t == "object") {
      const l = t["m.relates_to"];
      if (l && typeof l == "object") {
        const { key: c } = l;
        if (typeof c == "string") return `Reacted with ${c}`;
      }
      return "Added a reaction";
    }
    const a = n || e === "m.room.encrypted";
    if (!r) return a ? GT : Y8;
    if (a && !i) return GT;
    const s = _dt(t);
    return s || (a ? GT : Y8);
  }, ydt = (t) => {
    var _a6;
    return ((_a6 = t.match(/^@([^:]+):/)) == null ? void 0 : _a6[1]) ?? t;
  }, J8 = ({ roomName: t, username: e, roomAvatar: n, previewText: r, silent: i, eventId: a, data: s, recipientId: l }) => {
    const c = mD(e, "Someone"), d = mD(t, "Unknown"), u = mD(r, Y8), h = mD(n, Fdt), f = l ? ` \u2022 ${ydt(l)}` : "";
    return {
      title: `${c} in ${d}${f}`,
      options: {
        icon: h,
        badge: h || vdt,
        body: `${c}: ${u}`,
        silent: i,
        tag: a ?? `${d}-${c}`,
        data: s
      }
    };
  }, bdt = () => {
    const t = be(), e = oc();
    p.useEffect(() => {
      if (!e) return;
      const n = kie(t);
      n && n.subscribeToRoom(e);
    }, [
      t,
      e
    ]);
  };
  var xdt = "NotificationBanner_BannerContainer__ooe3rc2", wdt = "NotificationBanner_Banner__ooe3rc3", Ddt = "NotificationBanner_BannerIcon__ooe3rc4", Cdt = "NotificationBanner_BannerContent__ooe3rc5", Edt = "NotificationBanner_BannerTitle__ooe3rc6", kdt = "NotificationBanner_BannerSubtitle__ooe3rc7", uge = "NotificationBanner_BannerBody__ooe3rc9", Sdt = "NotificationBanner_ProgressBar__ooe3rcb";
  const Hm = Po("NotificationBanner"), QX = 5e3;
  function jdt({ text: t, hovered: e }) {
    const n = p.useRef(null), [r, i] = p.useState(false);
    return p.useEffect(() => {
      const a = n.current;
      a && i(a.scrollHeight > a.clientHeight);
    }, [
      t
    ]), o.jsx("div", {
      ref: n,
      className: uge,
      "data-overflow": r,
      "data-hovered": e,
      children: o.jsx(D, {
        size: "T200",
        priority: "300",
        children: t
      })
    });
  }
  function Tdt({ node: t, hovered: e }) {
    const n = p.useRef(null), [r, i] = p.useState(false);
    return p.useEffect(() => {
      const a = n.current;
      a && i(a.scrollHeight > a.clientHeight);
    }, [
      t
    ]), o.jsx("div", {
      ref: n,
      className: uge,
      "data-overflow": r,
      "data-hovered": e,
      children: o.jsx(D, {
        size: "T200",
        priority: "300",
        children: t
      })
    });
  }
  function Rdt({ notification: t, onDismiss: e }) {
    const [n, r] = p.useState(false), [i, a] = p.useState(false), s = p.useRef(false), l = p.useRef(null), c = p.useRef(0), d = p.useCallback(() => {
      s.current || (s.current = true, r(true), l.current = setTimeout(() => e(t.id), 200));
    }, [
      t.id,
      e
    ]);
    p.useEffect(() => {
      if (i) return;
      const g = QX - c.current;
      if (g <= 0) {
        d();
        return;
      }
      const m = Date.now(), v = setTimeout(d, g);
      return () => {
        clearTimeout(v), c.current += Date.now() - m;
      };
    }, [
      i,
      d
    ]), p.useEffect(() => () => {
      l.current && clearTimeout(l.current);
    }, []);
    const u = () => {
      t.onClick(), d();
    }, h = () => a(true), f = () => a(false);
    return o.jsxs("div", {
      className: wdt,
      "data-dismissing": n,
      onClick: u,
      role: "button",
      tabIndex: 0,
      onKeyDown: (g) => {
        (g.key === "Enter" || g.key === " ") && u(), g.key === "Escape" && d();
      },
      onMouseEnter: h,
      onMouseLeave: f,
      children: [
        t.icon && o.jsx("img", {
          src: t.icon,
          alt: "",
          className: Ddt,
          onError: (g) => {
            g.currentTarget.style.display = "none";
          }
        }),
        o.jsxs("div", {
          className: Cdt,
          children: [
            o.jsxs(D, {
              size: "T300",
              truncate: true,
              className: Edt,
              children: [
                t.senderName ?? t.title,
                (t.roomName || t.serverName) && o.jsxs("span", {
                  className: kdt,
                  children: [
                    " (\u200B",
                    t.roomName && `#${t.roomName}`,
                    t.roomName && t.serverName && ", ",
                    t.serverName,
                    ")"
                  ]
                })
              ]
            }),
            t.bodyNode ? o.jsx(Tdt, {
              node: t.bodyNode,
              hovered: i
            }) : t.body && o.jsx(jdt, {
              text: t.body,
              hovered: i
            })
          ]
        }),
        o.jsx(E, {
          shrink: "No",
          children: o.jsx(Oe, {
            size: "300",
            variant: "Surface",
            fill: "None",
            radii: "300",
            onClick: (g) => {
              g.stopPropagation(), d();
            },
            "aria-label": "Dismiss notification",
            children: o.jsx(Q, {
              size: "100",
              src: q.Cross
            })
          })
        }),
        o.jsx("div", {
          className: Sdt,
          "data-paused": i,
          style: {
            animationDuration: `${QX - c.current}ms`
          }
        })
      ]
    });
  }
  function Adt() {
    const [t, e] = Fr(HB), [n, r] = p.useState([]), i = p.useRef(null);
    Hm.log("[Banner] Component render, queue length:", n.length, "banner:", t), p.useEffect(() => {
      if (!("visualViewport" in window)) return;
      const s = () => {
        const c = i.current;
        if (!c) return;
        const d = window.visualViewport, u = window.innerHeight - d.height;
        u > 0 ? c.style.top = `${u}px` : c.style.top = "";
      }, l = window.visualViewport;
      return l.addEventListener("resize", s), l.addEventListener("scroll", s), s(), () => {
        l.removeEventListener("resize", s), l.removeEventListener("scroll", s);
      };
    }, []), p.useEffect(() => {
      t && (Hm.log("[Banner] New banner from atom:", t.id, t.title), r((s) => {
        if (s.some((c) => c.id === t.id)) return Hm.log("[Banner] Duplicate banner, skipping:", t.id), s;
        const l = [
          ...s,
          t
        ];
        return Hm.log("[Banner] Adding to queue, new length:", l.length), l.length > 3 ? l.slice(l.length - 3) : l;
      }), e(null));
    }, [
      t,
      e
    ]);
    const a = (s) => {
      Hm.log("[Banner] Dismissing banner:", s), r((l) => l.filter((c) => c.id !== s));
    };
    return n.length === 0 ? (Hm.log("[Banner] No banners in queue, returning null"), null) : (Hm.log("[Banner] Rendering", n.length, "banners"), o.jsx("div", {
      ref: i,
      className: xdt,
      "aria-live": "polite",
      "aria-atomic": "false",
      children: n.map((s) => o.jsx(Rdt, {
        notification: s,
        onDismiss: a
      }, s.id))
    }));
  }
  const Idt = /* @__PURE__ */ new Set([
    "light-theme",
    "dark-theme"
  ]);
  function ff(t) {
    return !(!t || t.trim() === "" || Idt.has(t) || t === Xre);
  }
  function YT(t) {
    return t.endsWith("-theme") ? t.slice(0, -6) : t;
  }
  const Bdt = /* @__PURE__ */ new Set([
    "dark",
    "black",
    "cinny-dark",
    "gruvdark",
    "accord",
    "butter",
    "rose-pine"
  ]);
  function Pdt(t) {
    return Bdt.has(t) ? "dark" : "light";
  }
  function ZT(t, e) {
    return `${ho(e)}/themes/${t}.sable.css`;
  }
  function Mdt(t) {
    return t.themeMigrationDismissed ? false : ff(t.themeId) || ff(t.lightThemeId) || ff(t.darkThemeId);
  }
  async function Odt(t) {
    var _a6, _b3;
    try {
      const e = await fetch(t, {
        mode: "cors"
      });
      if (!e.ok) return {
        ok: false,
        error: `Could not download theme (${e.status}).`
      };
      const n = await e.text();
      await Fo(t, n);
      const r = Uf(n), i = t.replace(/\.sable\.css$/i, "").split("/").pop() ?? "theme", a = ((_a6 = r.id) == null ? void 0 : _a6.trim()) || i;
      let s;
      r.kind === Rr.Dark ? s = "dark" : r.kind === Rr.Light ? s = "light" : s = Pdt(a);
      const l = ((_b3 = r.name) == null ? void 0 : _b3.trim()) || a;
      return {
        ok: true,
        data: {
          kind: s,
          displayName: l,
          basename: a
        }
      };
    } catch {
      return {
        ok: false,
        error: "Network error while downloading theme."
      };
    }
  }
  function Ldt(t) {
    return ho(t.length > 0 ? t : TM);
  }
  async function Ndt(t, e) {
    const n = Ldt(e), r = {
      themeMigrationDismissed: true,
      themeRemoteCatalogEnabled: true,
      themeCatalogOnboardingDone: true
    }, i = [];
    if (!t.useSystemTheme && ff(t.themeId)) {
      const h = t.themeId;
      i.push({
        legacyId: h,
        url: ZT(YT(h), n),
        assign: "manual"
      });
    }
    if (ff(t.lightThemeId)) {
      const h = t.lightThemeId;
      i.push({
        legacyId: h,
        url: ZT(YT(h), n),
        assign: "light"
      });
    }
    if (ff(t.darkThemeId)) {
      const h = t.darkThemeId;
      i.push({
        legacyId: h,
        url: ZT(YT(h), n),
        assign: "dark"
      });
    }
    if (i.length === 0) return t.useSystemTheme && ff(t.themeId) && (r.themeId = "light-theme"), {
      ok: true,
      partial: r
    };
    const a = /* @__PURE__ */ new Map(), s = [
      ...new Set(i.map((h) => h.url))
    ], l = await Promise.all(s.map((h) => Odt(h))), c = l.find((h) => !h.ok);
    if (c) return c;
    s.forEach((h, f) => {
      const g = l[f];
      g && g.ok && a.set(h, g.data);
    }), i.forEach((h) => {
      const f = a.get(h.url);
      h.assign === "manual" ? (r.themeRemoteManualFullUrl = h.url, r.themeRemoteManualKind = f.kind, r.themeId = f.kind === "dark" ? "dark-theme" : "light-theme") : h.assign === "light" ? (r.themeRemoteLightFullUrl = h.url, r.themeRemoteLightKind = f.kind, r.lightThemeId = "light-theme") : (r.themeRemoteDarkFullUrl = h.url, r.themeRemoteDarkKind = f.kind, r.darkThemeId = "dark-theme");
    }), t.useSystemTheme && ff(t.themeId) && (r.themeId = "light-theme");
    const d = [
      ...t.themeRemoteFavorites ?? []
    ], u = new Map(d.map((h) => [
      h.fullUrl,
      h
    ]));
    return i.forEach((h) => {
      const f = a.get(h.url);
      u.has(h.url) || u.set(h.url, {
        fullUrl: h.url,
        displayName: f.displayName,
        basename: f.basename,
        kind: f.kind,
        pinned: true
      });
    }), r.themeRemoteFavorites = [
      ...u.values()
    ], {
      ok: true,
      partial: r
    };
  }
  function zdt() {
    var _a6;
    const t = SF(), [e] = Fe(ge, "themeMigrationDismissed"), [n] = Fe(ge, "themeId"), [r] = Fe(ge, "lightThemeId"), [i] = Fe(ge, "darkThemeId"), a = _3(), s = $2e(), [l, c] = p.useState(false), [d, u] = p.useState(null), h = p.useMemo(() => Mdt({
      themeMigrationDismissed: e ?? false,
      themeId: n,
      lightThemeId: r,
      darkThemeId: i
    }), [
      e,
      n,
      r,
      i
    ]), f = ho(((_a6 = s == null ? void 0 : s.themeCatalogBaseUrl) == null ? void 0 : _a6.trim()) || TM), g = p.useCallback(() => {
      a({
        themeMigrationDismissed: true
      });
    }, [
      a
    ]), m = p.useCallback(() => {
      l || g();
    }, [
      l,
      g
    ]), v = p.useCallback(async () => {
      u(null), c(true);
      try {
        const y = t.get(ge), w = await Ndt(y, f);
        if (!w.ok) {
          u(w.error);
          return;
        }
        a(w.partial);
      } finally {
        c(false);
      }
    }, [
      f,
      a,
      t
    ]);
    return h ? o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: m,
            clickOutsideDeactivates: false,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            "aria-labelledby": "theme-migration-title",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      id: "theme-migration-title",
                      size: "H4",
                      children: "Update your theme selection"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    variant: "Secondary",
                    fill: "Soft",
                    outlined: true,
                    radii: "300",
                    onClick: m,
                    disabled: l,
                    "aria-label": "Close",
                    children: o.jsx(Q, {
                      src: q.Cross,
                      size: "100"
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsx(D, {
                    priority: "400",
                    children: "Older bundled color themes are no longer included in the app. Migrate to the same looks from the official catalog (downloaded and cached on this device), or dismiss this reminder."
                  }),
                  d && o.jsx(D, {
                    size: "T300",
                    priority: "400",
                    style: {
                      color: "var(--sable-error)"
                    },
                    children: d
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(xe, {
                        variant: "Primary",
                        fill: "Soft",
                        outlined: true,
                        size: "300",
                        radii: "300",
                        onClick: v,
                        disabled: l,
                        children: o.jsx(D, {
                          size: "B400",
                          children: l ? "Migrating\u2026" : "Migrate"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Secondary",
                        fill: "Soft",
                        outlined: true,
                        size: "300",
                        radii: "300",
                        onClick: m,
                        disabled: l,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Not now"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    }) : null;
  }
  var Udt = "TelemetryConsentBanner_Container__uhk4b72", Vdt = "TelemetryConsentBanner_Banner__uhk4b73", Hdt = "TelemetryConsentBanner_Header__uhk4b74", $dt = "TelemetryConsentBanner_HeaderText__uhk4b75", Wdt = "TelemetryConsentBanner_Actions__uhk4b76";
  const eQ = "sable_sentry_enabled";
  function qdt() {
    const [e, n] = p.useState(false), [r, i] = p.useState(false), a = p.useRef(null);
    if (p.useEffect(() => () => {
      a.current && clearTimeout(a.current);
    }, []), !e) return null;
    const s = () => {
      localStorage.setItem(eQ, "true"), window.location.reload();
    }, l = () => {
      localStorage.setItem(eQ, "false"), i(true), a.current = setTimeout(() => n(false), 220);
    };
    return o.jsx("div", {
      className: Udt,
      children: o.jsxs("div", {
        className: Vdt,
        "data-dismissing": r,
        role: "region",
        "aria-label": "Crash reporting prompt",
        children: [
          o.jsxs("div", {
            className: Hdt,
            children: [
              o.jsx(Q, {
                src: q.Shield,
                size: "400"
              }),
              o.jsxs("div", {
                className: $dt,
                children: [
                  o.jsx(D, {
                    size: "H4",
                    children: "Help improve Sable"
                  }),
                  o.jsxs(D, {
                    size: "T300",
                    priority: "300",
                    children: [
                      "Optionally send anonymous crash reports to help us fix bugs faster. No messages, room names, or personal data are included.",
                      " ",
                      o.jsx("a", {
                        href: "https://github.com/SableClient/Sable/blob/dev/docs/PRIVACY.md",
                        target: "_blank",
                        rel: "noreferrer noopener",
                        children: "Learn more"
                      })
                    ]
                  })
                ]
              })
            ]
          }),
          o.jsxs(E, {
            className: Wdt,
            children: [
              o.jsx(xe, {
                variant: "Secondary",
                fill: "Soft",
                size: "300",
                radii: "300",
                onClick: l,
                children: o.jsx(D, {
                  size: "B300",
                  children: "No thanks"
                })
              }),
              o.jsx(xe, {
                variant: "Primary",
                fill: "Solid",
                size: "300",
                radii: "300",
                onClick: s,
                children: o.jsx(D, {
                  size: "B300",
                  children: "Enable"
                })
              })
            ]
          })
        ]
      })
    });
  }
  const tQ = "/sable/assets/ringtone-4rwYiCEg.webm", oy = fo("CallSignaling");
  function Kdt() {
    const t = be(), e = Fn(Ade), n = Ze(gi), r = p.useRef(null), i = p.useRef(null), a = p.useRef(null), s = p.useRef(null), l = p.useRef({}), c = Ze(XI), d = Fn(XI), u = p.useRef(c);
    u.current = c, p.useEffect(() => {
      const w = new Audio(tQ);
      w.loop = true, r.current = w;
      const b = new Audio(tQ);
      return b.loop = true, i.current = b, () => {
        w.pause(), b.pause();
      };
    }, []);
    const h = p.useCallback(() => {
      var _a6, _b3;
      (_a6 = r.current) == null ? void 0 : _a6.pause(), (_b3 = i.current) == null ? void 0 : _b3.pause(), r.current && (r.current.currentTime = 0), i.current && (i.current.currentTime = 0), a.current = null, e(null);
    }, [
      e
    ]), f = p.useCallback((w) => {
      i.current && a.current !== w && (i.current.play().catch(() => {
      }), a.current = w);
    }, []), g = p.useCallback((w) => {
      r.current && a.current !== w && (r.current.play().catch(() => {
      }), a.current = w, e(w));
    }, [
      e
    ]), m = p.useRef(g);
    m.current = g;
    const v = p.useRef(h);
    v.current = h;
    const y = p.useRef(f);
    return y.current = f, p.useEffect(() => {
      if (!t || !t.matrixRTC) return;
      const w = () => {
        const C = t.getUserId(), x = Date.now(), S = Array.from(n).reduce((T, A) => {
          if (T.incoming || u.current === A) return T;
          const B = t.getRoom(A);
          if (!B) return T;
          const U = t.matrixRTC.getRoomSession(B), z = rl.sessionMembershipsForRoom(B, U.sessionDescription), O = z.filter((N) => (N.userId || N.sender) !== C), M = z.some((N) => (N.userId || N.sender) === C), I = l.current[A] || "IDLE";
          if (!M && O.length === 0) return l.current[A] = "IDLE", T;
          if (O.length > 0 && !M) return I !== "RINGING_IN" && (oy.info("call", "Incoming call detected", {
            roomId: A,
            remoteCount: O.length
          }), wa({
            category: "call.signal",
            message: "Incoming call ringing",
            data: {
              roomId: A
            }
          })), l.current[A] = "RINGING_IN", T.incoming = A, T;
          if (M && O.length > 0) return I !== "ACTIVE" && (oy.info("call", "Call became active", {
            roomId: A
          }), wa({
            category: "call.signal",
            message: "Call active",
            data: {
              roomId: A
            }
          }), Vr("sable.call.active", 1)), l.current[A] = "ACTIVE", T;
          if (M && O.length === 0) {
            if (I === "ACTIVE" || I === "ENDED") return I !== "ENDED" && (oy.info("call", "Call ended", {
              roomId: A
            }), wa({
              category: "call.signal",
              message: "Call ended",
              data: {
                roomId: A
              }
            }), Vr("sable.call.ended", 1)), l.current[A] = "ENDED", T;
            if (I === "IDLE" || I === "RINGING_OUT") {
              if (s.current || (s.current = x), x - s.current < 3e4) return I !== "RINGING_OUT" && (oy.info("call", "Outgoing call ringing", {
                roomId: A
              }), wa({
                category: "call.signal",
                message: "Outgoing call ringing",
                data: {
                  roomId: A
                }
              })), l.current[A] = "RINGING_OUT", T.outgoing = A, T;
              oy.info("call", "Outgoing call timed out (unanswered)", {
                roomId: A
              }), Vr("sable.call.timeout", 1), l.current[A] = "ENDED";
            }
          }
          return T;
        }, {
          incoming: null,
          outgoing: null
        });
        S.incoming ? m.current(S.incoming) : S.outgoing ? y.current(S.outgoing) : (v.current(), S.outgoing || (s.current = null));
      }, b = setInterval(w, 1e3), j = () => w(), k = (C) => {
        u.current === C && d(null), l.current[C] = "IDLE", w();
      };
      return t.matrixRTC.on(Id.SessionStarted, j), t.matrixRTC.on(Id.SessionEnded, k), t.on(qn.Events, j), w(), () => {
        clearInterval(b), t.matrixRTC.off(Id.SessionStarted, j), t.matrixRTC.off(Id.SessionEnded, k), t.off(qn.Events, j), v.current();
      };
    }, [
      t,
      n,
      d
    ]), null;
  }
  const Gdt = Po("BackgroundNotifications"), $m = fo("BackgroundNotifications"), Ydt = 6e4, Zdt = 5e3, X8 = (t) => t === Nn.Prepared || t === Nn.Syncing || t === Nn.Catchup, Jdt = async (t, e) => {
    const n = {
      sync: `bg-sync${t.userId}`,
      crypto: `bg-crypto${t.userId}`,
      rustCryptoPrefix: `bg-sync${t.userId}`
    }, r = new EB({
      indexedDB: global.indexedDB,
      localStorage: global.localStorage,
      dbName: n.sync
    }), i = Zf({
      baseUrl: t.baseUrl,
      accessToken: t.accessToken,
      userId: t.userId,
      deviceId: t.deviceId,
      store: r,
      timelineSupport: false
    }), a = {
      baseUrl: t.baseUrl,
      slidingSync: t.slidingSyncOptIn ? e : void 0,
      sessionSlidingSyncOptIn: t.slidingSyncOptIn,
      pollTimeoutMs: Ydt,
      timelineLimit: 1
    };
    return await Sie(i, a), i;
  }, Xdt = (t) => new Promise((e, n) => {
    const r = t.getSyncState();
    if (X8(r)) {
      e();
      return;
    }
    const i = {
      id: void 0
    };
    function a(s) {
      X8(s) && (i.id !== void 0 && clearTimeout(i.id), t.removeListener(jt.Sync, a), e());
    }
    t.on(jt.Sync, a), i.id = setTimeout(() => {
      t.removeListener(jt.Sync, a), n(new Error("background client sync timed out"));
    }, 3e4);
  });
  function Qdt() {
    var _a6;
    const t = la(), e = Ze(th), [n, r] = Fr(Fh), [i] = Fe(ge, "useInAppNotifications"), [a] = Fe(ge, "usePushNotifications"), [s] = Fe(ge, "isNotificationSounds"), [l] = Fe(ge, "showMessageContentInNotifications"), [c] = Fe(ge, "showMessageContentInEncryptedNotifications"), d = i || a, u = Ze(qr), h = p.useRef(u);
    h.current = u;
    const f = p.useRef(i);
    f.current = i;
    const g = p.useRef(s);
    g.current = s;
    const m = p.useRef(l);
    m.current = l;
    const v = p.useRef(c);
    v.current = c;
    const y = p.useRef(/* @__PURE__ */ new Map()), w = p.useRef(/* @__PURE__ */ new Set()), b = Fn(t3), j = Fn(TA), k = Fn(HB), C = p.useRef(j);
    C.current = j;
    const x = p.useRef(k);
    x.current = k;
    const S = p.useRef(/* @__PURE__ */ new Map()), T = n ?? ((_a6 = e[0]) == null ? void 0 : _a6.userId), A = p.useMemo(() => e.filter((U) => U.userId !== T), [
      e,
      T
    ]), B = p.useRef(A);
    return B.current = A, p.useEffect(() => {
      if (!d) return;
      const { current: U } = y, z = new Set(A.map((V) => V.userId));
      async function O(V) {
        if ("serviceWorker" in navigator) try {
          await (await navigator.serviceWorker.ready).showNotification(V.title, {
            body: V.body,
            icon: V.icon,
            badge: V.badge,
            silent: V.silent ?? false,
            data: V.data
          });
          return;
        } catch {
        }
        if ("Notification" in window && window.Notification.permission === "granted") {
          const Z = new window.Notification(V.title, {
            icon: V.icon,
            badge: V.badge,
            body: V.body,
            silent: V.silent ?? false,
            data: V.data
          });
          V.onClick && Z.addEventListener("click", () => {
            var _a7;
            (_a7 = V.onClick) == null ? void 0 : _a7.call(V), Z.close();
          });
        }
      }
      U.forEach((V, Z) => {
        var _a7;
        z.has(Z) || ((_a7 = S.current.get(Z)) == null ? void 0 : _a7(), S.current.delete(Z), $u(V), U.delete(Z), bg("sable.background.client_count", U.size), j((Y) => {
          const oe = {
            ...Y
          };
          return delete oe[Z], oe;
        }));
      });
      const M = (V, Z = 0) => {
        let Y;
        Jdt(V, t.slidingSync).then(async (oe) => {
          Y = oe, U.set(V.userId, oe), bg("sable.background.client_count", U.size), await Xdt(oe);
          let ue;
          const ie = Qu(oe, ce.Direct);
          ie ? ue = Hy(ie) : await new Promise((K) => {
            const G = (le) => {
              le.getType() === ce.Direct && (ue = Hy(le), oe.off(jt.AccountData, G), K());
            };
            oe.on(jt.AccountData, G), setTimeout(() => {
              oe.off(jt.AccountData, G), K();
            }, 5e3);
          });
          const de = new Oa(oe), ne = (K) => {
            K.getType() === ce.Direct && (ue = Hy(K));
          };
          oe.on(jt.AccountData, ne);
          const ae = /* @__PURE__ */ new Set(), X = (K, G, le, te, re) => {
            var _a7, _b3, _c3;
            if (!X8(oe.getSyncState()) || !G || G.isSpaceRoom()) return;
            const he = K.getId();
            if (!he) return;
            const se = K.getType(), ye = se === "m.room.encrypted";
            if (he && !ae.has(he) && K.isEncrypted() && ye) {
              ae.add(he);
              const Be = () => {
                X(K, G, true, false, {
                  liveEvent: true
                }), ae.delete(he);
              };
              K.once(or.Decrypted, Be);
              return;
            }
            if (!(re == null ? void 0 : re.liveEvent) || !Vu(K)) return;
            const we = Yg(oe, G.roomId);
            if (we === rs.Mute) {
              $m.debug("notification", "Room is muted - skipping notification", {
                roomId: G.roomId,
                eventId: he
              });
              return;
            }
            const Ee = `${V.userId}:${he}`;
            if (w.current.has(Ee)) return;
            const ke = K.getSender();
            if (!ke || ke === oe.getUserId()) return;
            const Ne = IB(G, ue), lt = de.actionsForEvent(K), Rt = Ne && we !== rs.MentionsAndKeywords;
            if (!((lt == null ? void 0 : lt.notify) || Rt)) {
              $m.debug("notification", "Event filtered - no push action match", {
                eventId: he,
                roomId: G.roomId,
                eventType: se,
                isDM: Ne
              });
              return;
            }
            const yt = !!((_a7 = lt.tweaks) == null ? void 0 : _a7.sound), Xt = !!((_b3 = lt.tweaks) == null ? void 0 : _b3.highlight);
            $m.info("notification", "Processing notification event", {
              eventId: he,
              roomId: G.roomId,
              eventType: se,
              isDM: Ne,
              isHighlight: Xt,
              loud: yt
            });
            const nn = gr(G, ke, h.current) ?? _n(ke) ?? ke, bt = ((_c3 = G.getAvatarFallbackMember()) == null ? void 0 : _c3.getMxcAvatarUrl()) ?? G.getMxcAvatarUrl(), At = bt ? Cn(oe, bt, false, 96, 96, "crop") ?? void 0 : tp;
            if (C.current((Be) => {
              const Re = Be[V.userId] ?? {
                total: 0,
                highlight: 0
              };
              return {
                ...Be,
                [V.userId]: {
                  total: Re.total + 1,
                  highlight: Xt ? Re.highlight + 1 : Re.highlight
                }
              };
            }), !yt && !Xt) {
              $m.debug("notification", "Silent notification - badge updated only", {
                eventId: he,
                roomId: G.roomId
              });
              return;
            }
            const $t = !!ni(G, ce.RoomEncryption);
            if (w.current.add(Ee), w.current.size > 200) {
              const Be = w.current.values().next().value;
              Be && w.current.delete(Be);
            }
            const Lt = J8({
              roomName: G.name ?? G.getCanonicalAlias() ?? G.roomId,
              roomAvatar: At,
              username: nn,
              recipientId: V.userId,
              previewText: Z8({
                content: K.getContent(),
                eventType: K.getType(),
                isEncryptedRoom: $t,
                showMessageContent: m.current,
                showEncryptedMessageContent: v.current
              }),
              silent: !g.current || !yt,
              eventId: he,
              data: {
                type: K.getType(),
                room_id: G.roomId,
                event_id: he,
                user_id: V.userId
              }
            }), wt = () => {
              window.focus(), r(V.userId), b({
                roomId: G.roomId,
                eventId: he,
                targetSessionId: V.userId
              });
            };
            document.visibilityState === "visible" && Dr() && f.current ? ($m.info("notification", "Showing in-app banner", {
              eventId: he,
              roomId: G.roomId,
              title: Lt.title
            }), x.current({
              id: Ee,
              title: Lt.title,
              roomName: G.name ?? G.getCanonicalAlias() ?? void 0,
              senderName: nn,
              body: Lt.options.body,
              icon: Lt.options.icon,
              onClick: wt
            })) : yt && ($m.info("notification", "Sending OS notification", {
              eventId: he,
              roomId: G.roomId,
              title: Lt.title,
              hasSound: !Lt.options.silent
            }), O({
              title: Lt.title,
              icon: Lt.options.icon,
              badge: Lt.options.badge,
              body: Lt.options.body,
              silent: Lt.options.silent ?? void 0,
              data: Lt.options.data,
              onClick: wt
            }));
          };
          oe.on(mt.Timeline, X), S.current.set(V.userId, () => {
            oe.off(jt.AccountData, ne), oe.off(mt.Timeline, X);
          });
        }).catch((oe) => {
          var _a7;
          if (Gdt.error("failed to start background client for", V.userId, oe), $m.error("notification", "Failed to start background client", {
            userId: V.userId,
            error: oe
          }), y2(oe, {
            tags: {
              component: "BackgroundNotifications"
            }
          }), Y && U.get(V.userId) === Y && ((_a7 = S.current.get(V.userId)) == null ? void 0 : _a7(), S.current.delete(V.userId), U.delete(V.userId), $u(Y)), Z < 5) {
            const ue = Math.min(5e3 * 2 ** Z, 6e4);
            setTimeout(() => {
              const ie = B.current.find((de) => de.userId === V.userId);
              ie && !U.has(V.userId) && M(ie, Z + 1);
            }, ue);
          }
        });
      }, I = A.filter((V) => !U.has(V.userId)), N = [];
      I.forEach((V, Z) => {
        Z === 0 ? M(V) : N.push(setTimeout(() => M(V), Z * Zdt));
      });
      const L = S.current, H = new Set(A.map((V) => V.userId));
      return () => {
        N.forEach(clearTimeout), U.forEach((V, Z) => {
          var _a7;
          H.has(Z) || ((_a7 = L.get(Z)) == null ? void 0 : _a7(), L.delete(Z), $u(V), U.delete(Z));
        });
      };
    }, [
      t.slidingSync,
      A,
      d,
      r,
      b,
      j,
      k
    ]), null;
  }
  const nQ = fo("push-relay");
  function hge() {
    "mediaSession" in navigator && setTimeout(() => {
      navigator.mediaSession.metadata === null && (navigator.mediaSession.playbackState = "none");
    }, 500);
  }
  function eut() {
    const [t] = Fe(ge, "twitterEmoji");
    return t ? document.documentElement.style.setProperty("--font-emoji", "Twemoji") : document.documentElement.style.setProperty("--font-emoji", "Twemoji_DISABLED"), null;
  }
  function tut() {
    const [t] = Fe(ge, "pageZoom");
    return t === 100 ? document.documentElement.style.removeProperty("font-size") : document.documentElement.style.setProperty("font-size", `calc(1em * ${t / 100})`), null;
  }
  function nut() {
    const t = Ze(qi), [e] = Fe(ge, "usePushNotifications"), [n] = Fe(ge, "faviconForMentionsOnly"), r = Ze(dge);
    return p.useEffect(() => {
      let i = false, a = false, s = 0, l = 0;
      t.forEach((c) => {
        c.from === null && (s += c.total, l += c.highlight), c.total > 0 && (i = true), c.highlight > 0 && (a = true);
      }), b9(a ? ddt : !n && i ? cdt : tp);
      try {
        l > 0 ? navigator.setAppBadge(l) : navigator.clearAppBadge(), e && r && (s === 0 ? r.getNotifications().then((c) => c.forEach((d) => d.close())) : r.getNotifications().then((c) => {
          c.forEach((d) => {
            var _a6;
            const u = (_a6 = d.data) == null ? void 0 : _a6.room_id;
            if (!u) return;
            const h = t.get(u);
            (!h || h.total === 0 && h.highlight === 0) && d.close();
          });
        }));
      } catch {
      }
    }, [
      t,
      e,
      r,
      n
    ]), null;
  }
  function rut() {
    const t = p.useRef(null), e = Ze(cv), n = fdt(e.length, 0), r = be(), i = br(), [a] = Fe(ge, "useSystemNotifications"), [s] = Fe(ge, "usePushNotifications"), [l] = Fe(ge, "isNotificationSounds"), c = p.useCallback((u) => {
      const h = new window.Notification("Invitation", {
        icon: tp,
        badge: tp,
        body: `You have ${u} new invitation request.`,
        silent: true
      });
      h.addEventListener("click", () => {
        window.closed || i(i3()), h.close();
      });
    }, [
      i
    ]), d = p.useCallback(() => {
      var _a6;
      (_a6 = t.current) == null ? void 0 : _a6.play(), hge();
    }, []);
    return p.useEffect(() => {
      if (!(e.length <= n || r.getSyncState() !== Nn.Syncing) && !(document.visibilityState !== "visible" && s)) {
        if (!Dr() && a && Jie("granted")) try {
          c(e.length - n);
        } catch {
        }
        document.visibilityState === "visible" && l && d();
      }
    }, [
      r,
      e,
      n,
      a,
      s,
      l,
      c,
      d
    ]), o.jsx("audio", {
      ref: t,
      style: {
        display: "none"
      },
      children: o.jsx("source", {
        src: hdt,
        type: "audio/ogg"
      })
    });
  }
  function iut() {
    const t = p.useRef(null), e = p.useRef(/* @__PURE__ */ new Set()), n = p.useRef(Date.now()), r = be(), i = hn(), a = gs(), [s] = Fe(ge, "useInAppNotifications"), [l] = Fe(ge, "useSystemNotifications"), [c] = Fe(ge, "usePushNotifications"), [d] = Fe(ge, "isNotificationSounds"), [u] = Fe(ge, "showMessageContentInNotifications"), [h] = Fe(ge, "showMessageContentInEncryptedNotifications"), f = Ze(qr), g = p.useRef(f);
    g.current = f;
    const m = Ze(gi), v = p.useRef(m);
    v.current = m;
    const y = Fn(t3), w = Fn(HB), b = oc(), j = cge(), k = p.useCallback(() => {
      var _a6;
      (_a6 = t.current) == null ? void 0 : _a6.play(), hge();
    }, []);
    return p.useEffect(() => {
      const C = new Oa(r), x = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map(), T = (A, B, U, z, O) => {
        var _a6, _b3, _c3, _d4, _e13;
        if (r.getSyncState() !== Nn.Syncing) return;
        const M = A.getId();
        if (M && !S.has(M) && S.set(M, performance.now()), !(M && x.has(M)) && document.hasFocus() && (b === (B == null ? void 0 : B.roomId) || j)) return;
        const N = !O.liveEvent && (A.getTs() < n.current - 60 * 1e3 || !!B && B.hasUserReadEvent(r.getSafeUserId(), A.getId()));
        if (A.getType() === "m.room.encrypted" && A.isEncrypted()) {
          M && x.add(M);
          const ae = () => {
            T(A, B, void 0, true, O), M && x.delete(M);
          };
          A.once(or.Decrypted, ae);
          return;
        }
        if (!B || N || B.isSpaceRoom() || !Vu(A)) return;
        const L = Yg(r, B.roomId);
        if (L === rs.Mute) return;
        const H = A.getSender();
        if (!H || !M || A.getSender() === r.getUserId() || e.current.has(M)) return;
        const V = IB(B, v.current), Z = S.get(M);
        Z !== void 0 && (oa("sable.notification.delivery_ms", performance.now() - Z, {
          attributes: {
            encrypted: String(A.isEncrypted()),
            dm: String(V)
          }
        }), S.delete(M));
        const Y = C.actionsForEvent(A), oe = V && L !== rs.MentionsAndKeywords;
        if (!((Y == null ? void 0 : Y.notify) || oe)) return;
        const ie = !!((_a6 = Y.tweaks) == null ? void 0 : _a6.sound), de = !!((_b3 = Y.tweaks) == null ? void 0 : _b3.highlight), ne = ie || V;
        if (e.current.add(M), e.current.size > 200) {
          const ae = e.current.values().next().value;
          ae && e.current.delete(ae);
        }
        if (!Dr() && l && Jie("granted")) try {
          const ae = !!ni(B, ce.RoomEncryption), X = ((_c3 = B.getAvatarFallbackMember()) == null ? void 0 : _c3.getMxcAvatarUrl()) ?? B.getMxcAvatarUrl(), K = J8({
            roomName: B.name ?? "Unknown",
            roomAvatar: X ? Cn(r, X, i, 96, 96, "crop") ?? void 0 : void 0,
            username: gr(B, H, g.current) ?? _n(H) ?? H,
            previewText: Z8({
              content: A.getContent(),
              eventType: A.getType(),
              isEncryptedRoom: ae,
              showMessageContent: u,
              showEncryptedMessageContent: h
            }),
            silent: !d || !ne,
            eventId: M
          }), G = new window.Notification(K.title, K.options), { roomId: le } = B;
          G.addEventListener("click", () => {
            window.focus(), y({
              roomId: le,
              eventId: M,
              targetSessionId: r.getUserId() ?? void 0
            }), G.close();
          });
        } catch {
        }
        if (document.visibilityState === "visible") {
          if (s && (de || V)) {
            const ae = ((_d4 = B.getAvatarFallbackMember()) == null ? void 0 : _d4.getMxcAvatarUrl()) ?? B.getMxcAvatarUrl(), X = ae ? Cn(r, ae, i, 96, 96, "crop") ?? void 0 : void 0, K = gr(B, H, g.current) ?? _n(H) ?? H, G = A.getContent(), le = Z8({
              content: A.getContent(),
              eventType: A.getType(),
              isEncryptedRoom: false,
              showMessageContent: u,
              showEncryptedMessageContent: h
            });
            let te;
            if (u && G.format === "org.matrix.custom.html" && G.formatted_body) {
              const ke = Ql(r, B.roomId, {
                settingsLinkBaseUrl: a,
                linkifyOpts: fs,
                useAuthentication: i,
                nicknames: g.current
              });
              te = Zd(Lk(G.formatted_body), ke);
            }
            const re = J8({
              roomName: B.name ?? "Unknown",
              roomAvatar: X,
              username: K,
              previewText: le,
              silent: !d || !ne,
              eventId: M
            }), { roomId: he } = B, se = M, ye = r.getUserId() ?? void 0, Ee = ((_e13 = B.getCanonicalAlias()) == null ? void 0 : _e13.split(":")[1]) ?? B.roomId.split(":")[1] ?? void 0;
            w({
              id: M,
              title: re.title,
              roomName: B.name ?? void 0,
              serverName: Ee,
              senderName: K,
              body: le,
              bodyNode: te,
              icon: X,
              onClick: () => {
                window.focus(), y({
                  roomId: he,
                  eventId: se,
                  targetSessionId: ye
                });
              }
            });
          }
          d && ne && k();
        }
      };
      return r.on(mt.Timeline, T), () => {
        r.removeListener(mt.Timeline, T);
      };
    }, [
      r,
      d,
      j,
      s,
      l,
      u,
      h,
      c,
      k,
      w,
      y,
      b,
      a,
      i
    ]), o.jsx("audio", {
      ref: t,
      style: {
        display: "none"
      },
      children: o.jsx("source", {
        src: udt,
        type: "audio/ogg"
      })
    });
  }
  function out() {
    const [t] = Fe(ge, "privacyBlur"), [e] = Fe(ge, "privacyBlurAvatars"), [n] = Fe(ge, "privacyBlurEmotes");
    return p.useEffect(() => {
      document.body.classList.toggle("sable-blur-media", t), document.body.classList.toggle("sable-blur-avatars", e), document.body.classList.toggle("sable-blur-emotes", n);
    }, [
      t,
      e,
      n
    ]), null;
  }
  function aut() {
    return p.useEffect(() => {
      const t = window.setInterval(() => {
        const { cacheSize: e, inflightCount: n } = ptt();
        bg("sable.media.blob_cache_size", e), n > 0 && (bg("sable.media.inflight_requests", n), n >= 10 && wa({
          category: "media",
          message: `High inflight request count: ${n}`,
          level: "warning",
          data: {
            inflight_count: n
          }
        }));
      }, 6e4);
      return () => window.clearInterval(t);
    }, []), null;
  }
  function sut() {
    const t = Fn(t3), e = Fn(Fh), n = br();
    return p.useEffect(() => {
      if (!("serviceWorker" in navigator)) return;
      const r = (i) => {
        const { data: a } = i;
        if (!a || a.type !== "notificationClick") return;
        const { userId: s, roomId: l, eventId: c, isInvite: d } = a;
        if (s && e(s), d) {
          n(i3());
          return;
        }
        l && t({
          roomId: l,
          eventId: c,
          targetSessionId: s
        });
      };
      return navigator.serviceWorker.addEventListener("message", r), () => navigator.serviceWorker.removeEventListener("message", r);
    }, [
      t,
      e,
      n
    ]), null;
  }
  function lut() {
    const [t] = Fe(ge, "showMessageContentInNotifications"), [e] = Fe(ge, "showMessageContentInEncryptedNotifications"), [n] = Fe(ge, "clearNotificationsOnRead");
    return p.useEffect(() => {
      if (!("serviceWorker" in navigator)) return;
      const r = () => {
        var _a6;
        const a = {
          type: "setAppVisible",
          visible: document.visibilityState === "visible"
        };
        (_a6 = navigator.serviceWorker.controller) == null ? void 0 : _a6.postMessage(a), navigator.serviceWorker.ready.then((s) => {
          var _a7;
          return (_a7 = s.active) == null ? void 0 : _a7.postMessage(a);
        });
      };
      return r(), document.addEventListener("visibilitychange", r), () => document.removeEventListener("visibilitychange", r);
    }, []), p.useEffect(() => {
      var _a6;
      if (!("serviceWorker" in navigator)) return;
      const r = {
        type: "setNotificationSettings",
        showMessageContent: t,
        showEncryptedMessageContent: e,
        clearNotificationsOnRead: n
      };
      (_a6 = navigator.serviceWorker.controller) == null ? void 0 : _a6.postMessage(r), navigator.serviceWorker.ready.then((i) => {
        var _a7;
        (_a7 = i.active) == null ? void 0 : _a7.postMessage(r);
      });
    }, [
      t,
      e,
      n
    ]), null;
  }
  function cut() {
    return bdt(), null;
  }
  function dut() {
    const t = be(), e = Ze(gi), n = Ze(JM);
    return p.useEffect(() => {
      if (!n) {
        A1("room", null), Eo("room_type", "none"), Eo("room_encrypted", "none");
        return;
      }
      const r = t.getRoom(n);
      if (!r) return;
      const i = e.has(n), a = t.isRoomEncrypted(n), s = r.getJoinedMemberCount();
      let l;
      s <= 2 ? l = "1-2" : s <= 10 ? l = "3-10" : s <= 50 ? l = "11-50" : s <= 200 ? l = "51-200" : l = "200+", A1("room", {
        type: i ? "dm" : "group",
        encrypted: a,
        member_count_range: l
      }), Eo("room_type", i ? "dm" : "group"), Eo("room_encrypted", String(a));
    }, [
      t,
      e,
      n
    ]), null;
  }
  function uut() {
    const t = Ze(ge);
    return p.useEffect(() => {
      Eo("message_layout", String(t.messageLayout)), Eo("message_spacing", t.messageSpacing), Eo("twitter_emoji", String(t.twitterEmoji)), Eo("page_zoom", String(t.pageZoom)), t.themeId && Eo("theme_id", t.themeId), Eo("use_right_bubbles", String(t.useRightBubbles)), Eo("reduced_motion", String(t.reducedMotion)), Eo("send_presence", String(t.sendPresence)), Eo("enter_for_newline", String(t.enterForNewline)), Eo("media_auto_load", String(t.mediaAutoLoad)), Eo("url_preview", String(t.urlPreview)), Eo("use_system_theme", String(t.useSystemTheme)), Eo("uniform_icons", String(t.uniformIcons)), Eo("jumbo_emoji_size", t.jumboEmojiSize), Eo("caption_position", t.captionPosition), Eo("right_swipe_action", t.rightSwipeAction), A1("settings", {
        ...t
      });
    }, [
      t
    ]), null;
  }
  function hut() {
    const t = be();
    return p.useEffect(() => {
      if (!("serviceWorker" in navigator)) return;
      const e = async (n) => {
        var _a6, _b3;
        const { data: r } = n;
        if (!r || r.type !== "decryptPushEvent") return;
        const { rawEvent: i } = r, a = i.event_id, s = i.room_id, l = performance.now();
        try {
          const c = new to(i);
          await t.decryptEventIfNeeded(c);
          const d = t.getRoom(s), u = c.getSender();
          let h = "Someone";
          u && (h = _n(u) ?? u, d && (h = gr(d, u) ?? h));
          const f = Math.round(performance.now() - l), g = document.visibilityState === "visible";
          nQ.info("notification", "Push relay decryption succeeded", {
            eventType: c.getType(),
            decryptMs: f,
            appVisible: g
          }), (_a6 = navigator.serviceWorker.controller) == null ? void 0 : _a6.postMessage({
            type: "pushDecryptResult",
            eventId: a,
            success: true,
            eventType: c.getType(),
            content: c.getContent(),
            sender_display_name: h,
            room_name: (d == null ? void 0 : d.name) ?? "",
            visibilityState: document.visibilityState
          });
        } catch (c) {
          console.warn("[app] HandleDecryptPushEvent: failed to decrypt push event", c), nQ.error("notification", "Push relay decryption failed", c instanceof Error ? c : new Error(String(c))), (_b3 = navigator.serviceWorker.controller) == null ? void 0 : _b3.postMessage({
            type: "pushDecryptResult",
            eventId: a,
            success: false,
            visibilityState: document.visibilityState
          });
        }
      };
      return navigator.serviceWorker.addEventListener("message", e), () => navigator.serviceWorker.removeEventListener("message", e);
    }, [
      t
    ]), null;
  }
  function fut() {
    const t = be(), [e] = Fe(ge, "sendPresence");
    return p.useEffect(() => {
      var _a6;
      t.setSyncPresence(e ? void 0 : tB.Offline), (_a6 = kie(t)) == null ? void 0 : _a6.setPresenceEnabled(e);
    }, [
      t,
      e
    ]), null;
  }
  function mut() {
    return RWe(), null;
  }
  function gut({ children: t }) {
    return Kdt(), o.jsxs(o.Fragment, {
      children: [
        o.jsx(mut, {}),
        o.jsx(eut, {}),
        o.jsx(tut, {}),
        o.jsx(out, {}),
        o.jsx(nut, {}),
        o.jsx(rut, {}),
        o.jsx(iut, {}),
        o.jsx(Qdt, {}),
        o.jsx(lut, {}),
        o.jsx(hut, {}),
        o.jsx(Adt, {}),
        o.jsx(qdt, {}),
        o.jsx(zdt, {}),
        o.jsx(cut, {}),
        o.jsx(fut, {}),
        o.jsx(dut, {}),
        o.jsx(uut, {}),
        o.jsx(aut, {}),
        t
      ]
    });
  }
  var put = "styles_NavCategory__e6taqj0 _1mqalmd1 _1mqalmd0", Fut = "styles_NavCategoryHeader__e6taqj1", fge = "styles_NavLink__e6taqj2", vut = Jr({
    defaultClassName: "styles_NavItem__e6taqj9 _1mqalmd1 _1mqalmd0 styles_NavItemBase__e6taqj8 _1bugis91",
    variantClassNames: {
      variant: {
        Background: "styles_NavItem_variant_Background__e6taqja",
        Surface: "styles_NavItem_variant_Surface__e6taqjb",
        SurfaceVariant: "styles_NavItem_variant_SurfaceVariant__e6taqjc",
        Primary: "styles_NavItem_variant_Primary__e6taqjd",
        Secondary: "styles_NavItem_variant_Secondary__e6taqje",
        Success: "styles_NavItem_variant_Success__e6taqjf",
        Warning: "styles_NavItem_variant_Warning__e6taqjg",
        Critical: "styles_NavItem_variant_Critical__e6taqjh"
      },
      radii: {
        0: "styles_NavItem_radii_0__e6taqji cpipac1",
        300: "styles_NavItem_radii_300__e6taqjj cpipac2",
        400: "styles_NavItem_radii_400__e6taqjk cpipac3",
        500: "styles_NavItem_radii_500__e6taqjl cpipac4",
        Inherit: "styles_NavItem_radii_Inherit__e6taqjm cpipac0",
        Pill: "styles_NavItem_radii_Pill__e6taqjn cpipac5"
      }
    },
    defaultVariants: {
      variant: "Surface",
      radii: "400"
    },
    compoundVariants: []
  }), _ut = "styles_NavItemContent__e6taqjo", yut = "styles_NavItemOptions__e6taqjp";
  const ch = ft(({ className: t, ...e }, n) => o.jsx("div", {
    className: gt(put, t),
    ...e,
    ref: n
  })), MS = ft(({ className: t, ...e }, n) => o.jsx(wn, {
    className: gt(Fut, t),
    variant: "Background",
    size: "300",
    ...e,
    ref: n
  }));
  function mge({ children: t }) {
    return o.jsx(E, {
      style: {
        padding: ee.space.S500
      },
      grow: "Yes",
      direction: "Column",
      justifyContent: "Center",
      children: t
    });
  }
  function gge({ icon: t, title: e, content: n, options: r }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "400",
      children: [
        o.jsx(E, {
          direction: "Column",
          alignItems: "Center",
          gap: "200",
          children: t
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          alignItems: "Center",
          children: [
            e,
            n
          ]
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "200",
          children: r
        })
      ]
    });
  }
  const Is = ft(({ as: t = "div", className: e, highlight: n, variant: r, radii: i, children: a, ...s }, l) => o.jsx(t, {
    className: gt(vut({
      variant: r,
      radii: i
    }), e),
    "data-highlight": n,
    ...s,
    ref: l,
    children: a
  })), Rf = p.forwardRef(({ className: t, ...e }, n) => o.jsx(Lb, {
    className: gt(fge, t),
    ...e,
    ref: n
  })), _F = ft(({ as: t = "button", className: e, ...n }, r) => o.jsx(t, {
    className: gt(fge, e),
    ...n,
    ref: r
  })), Bs = ft(({ children: t, className: e, ...n }, r) => o.jsx(D, {
    className: gt(_ut, e),
    size: "T300",
    ...n,
    ref: r,
    children: t
  })), but = ft(({ className: t, ...e }, n) => o.jsx(E, {
    className: gt(yut, t),
    alignItems: "Center",
    shrink: "No",
    gap: "0",
    ...e,
    ref: n
  })), xut = () => !!Ko({
    path: $c(),
    caseSensitive: true,
    end: false
  }), wut = () => !!Ko({
    path: XB(),
    caseSensitive: true,
    end: false
  }), Dut = () => !!Ko({
    path: QB(),
    caseSensitive: true,
    end: false
  });
  function Cut({ room: t, callMembership: e, hideText: n }) {
    var _a6;
    const r = be(), i = hn(), a = Ls(), s = ka(), c = ((_a6 = sm()) == null ? void 0 : _a6.roomId) === t.roomId, d = e.sender ?? "", u = Jc(t, d), h = u ? r.mxcUrlToHttp(u, 32, 32, "crop", void 0, false, i) : void 0, f = Ze(qr), g = gr(t, d, f) ?? _n(d), m = c && d !== r.getUserId(), v = (w) => {
      a(t.roomId, s == null ? void 0 : s.roomId, d, w.currentTarget.getBoundingClientRect());
    }, y = m ? `Call Participant: ${g}` : g;
    return o.jsx(Is, {
      variant: "Background",
      radii: "400",
      children: o.jsx(_F, {
        onClick: v,
        "aria-label": y,
        children: o.jsx(Bs, {
          as: "div",
          style: n ? {
            padding: "0"
          } : {},
          children: o.jsx(E, {
            direction: "Column",
            grow: "Yes",
            gap: "200",
            justifyContent: "Stretch",
            children: o.jsxs(E, {
              alignItems: "Center",
              gap: "200",
              justifyContent: n ? "Center" : "Start",
              children: [
                o.jsx(xn, {
                  size: "200",
                  children: o.jsx(Si, {
                    userId: d,
                    src: h ?? void 0,
                    alt: g,
                    renderFallback: () => o.jsx(Q, {
                      size: "50",
                      src: q.User,
                      filled: true
                    })
                  })
                }),
                !n && o.jsx(D, {
                  as: "span",
                  size: "B400",
                  priority: "300",
                  truncate: true,
                  children: g
                })
              ]
            })
          })
        })
      })
    });
  }
  var Eut = "Sidebar_Sidebar__vs60p50 _1mqalmd1 _1mqalmd0", kut = "Sidebar_SidebarStack__vs60p51 _1mqalmd1 _1mqalmd0", Sut = Jr({
    defaultClassName: "Sidebar_SidebarItem__vs60p54 _1mqalmd1 _1mqalmd0 _1bugis91 Sidebar_DropTarget__vs60p53",
    variantClassNames: {
      active: {
        true: "Sidebar_SidebarItem_active_true__vs60p55"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), jut = Jr({
    defaultClassName: "Sidebar_SidebarItemBadge__vs60p56 _1mqalmd1 _1mqalmd0",
    variantClassNames: {
      mode: {
        count: "Sidebar_SidebarItemBadge_mode_count__vs60p57",
        dot: "Sidebar_SidebarItemBadge_mode_dot__vs60p58"
      }
    },
    defaultVariants: {
      mode: "dot"
    },
    compoundVariants: []
  }), Tut = Jr({
    defaultClassName: "Sidebar_SidebarAvatar__vs60p59",
    variantClassNames: {
      size: {
        200: "Sidebar_SidebarAvatar_size_200__vs60p5a",
        300: "Sidebar_SidebarAvatar_size_300__vs60p5b",
        400: "Sidebar_SidebarAvatar_size_400__vs60p5c"
      },
      outlined: {
        true: "Sidebar_SidebarAvatar_outlined_true__vs60p5d"
      }
    },
    defaultVariants: {
      size: "400"
    },
    compoundVariants: []
  }), Rut = Jr({
    defaultClassName: "Sidebar_SidebarFolder__vs60p5e ContainerColor_ContainerColor__15396tl0 _1mqalmd1 _1mqalmd0 ContainerColor_ContainerColor_variant_Background__15396tl1 _1bugis90 Sidebar_DropTarget__vs60p53",
    variantClassNames: {
      state: {
        Close: "Sidebar_SidebarFolder_state_Close__vs60p5f",
        Open: "Sidebar_SidebarFolder_state_Open__vs60p5g"
      }
    },
    defaultVariants: {
      state: "Close"
    },
    compoundVariants: []
  }), Aut = Jr({
    defaultClassName: "Sidebar_SidebarFolderDropTarget__vs60p5h",
    variantClassNames: {
      position: {
        Top: "Sidebar_SidebarFolderDropTarget_position_Top__vs60p5i",
        Bottom: "Sidebar_SidebarFolderDropTarget_position_Bottom__vs60p5j"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  });
  const Iut = ft(({ as: t = "div", className: e, ...n }, r) => o.jsx(t, {
    className: gt(Eut, e),
    ...n,
    ref: r
  })), rd = ft(({ as: t = "div", className: e, active: n, ...r }, i) => o.jsx(t, {
    className: gt(Sut({
      active: n
    }), e),
    ...r,
    ref: i
  })), pge = ft(({ as: t = "div", className: e, mode: n, ...r }, i) => o.jsx(t, {
    className: gt(jut({
      mode: n
    }), e),
    ...r,
    ref: i
  }));
  function id({ tooltip: t, children: e }) {
    return t ? o.jsx(ar, {
      delay: 400,
      position: "Right",
      tooltip: o.jsx(pr, {
        style: {
          maxWidth: He(280)
        },
        children: o.jsx(D, {
          size: "H5",
          children: t
        })
      }),
      children: e
    }) : e(() => {
    });
  }
  const _l = ft(({ className: t, size: e, outlined: n, radii: r, ...i }, a) => o.jsx(xn, {
    className: gt(Tut({
      size: e,
      outlined: n
    }), t),
    radii: r,
    ...i,
    ref: a
  })), Fge = ft(({ as: t = "div", className: e, state: n, ...r }, i) => o.jsx(t, {
    className: gt(Rut({
      state: n
    }), e),
    ...r,
    ref: i
  })), rQ = ft(({ as: t = "div", className: e, position: n, ...r }, i) => o.jsx(t, {
    className: gt(Aut({
      position: n
    }), e),
    ...r,
    ref: i
  }));
  function cm({ highlight: t, count: e, dm: n, mode: r }) {
    const [i] = Fe(ge, "showUnreadCounts"), [a] = Fe(ge, "badgeCountDMsOnly"), [s] = Fe(ge, "showPingCounts"), l = r ?? _se({
      highlight: t,
      count: e,
      dm: n,
      showUnreadCounts: i,
      badgeCountDMsOnly: a,
      showPingCounts: s
    });
    return o.jsx(pge, {
      mode: l,
      children: o.jsx(Sp, {
        highlight: t,
        count: e,
        dm: n,
        mode: l
      })
    });
  }
  function But({ scrollable: t, sticky: e }) {
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(E, {
          direction: "Column",
          grow: "Yes",
          children: t
        }),
        o.jsx(E, {
          direction: "Column",
          shrink: "No",
          children: e
        })
      ]
    });
  }
  const FC = ft(({ as: t = "div", className: e, ...n }, r) => o.jsx(t, {
    className: gt(kut, e),
    ...n,
    ref: r
  }));
  function vge() {
    return o.jsx(nr, {
      role: "separator",
      style: {
        width: He(24),
        margin: "0 auto"
      },
      variant: "Background",
      size: "300"
    });
  }
  function Put(t) {
    const e = be(), [n, r] = p.useState(() => q2(e, t));
    return p.useEffect(() => {
      const i = () => r(q2(e, t));
      return t.on(mt.Timeline, i), t.on(mt.Receipt, i), () => {
        t.removeListener(mt.Timeline, i), t.removeListener(mt.Receipt, i);
      };
    }, [
      t,
      e
    ]), n;
  }
  const Mut = p.forwardRef(({ room: t, requestClose: e, notificationMode: n }, r) => {
    const i = be(), [a] = Fe(ge, "hideReads"), s = w3(t.roomId, qi), l = Mo(t), c = ri(t), u = Ki(c, l).action("invite", i.getSafeUserId()), h = Bp(), f = ka(), [g, m] = p.useState(false), v = () => {
      As(i, t.roomId, a), e();
    }, y = () => {
      m(true);
    }, w = () => {
      const j = wi(i, t.roomId), k = ml(j) ? void 0 : Xc(t);
      Jo(JE(j, k)), e();
    }, b = () => {
      h(t.roomId, f == null ? void 0 : f.roomId), e();
    };
    return o.jsxs(tn, {
      ref: r,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: [
        g && t && o.jsx(Pp, {
          room: t,
          requestClose: () => {
            m(false), e();
          }
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: v,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.CheckTwice
              }),
              radii: "300",
              disabled: !s,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Mark as Read"
              })
            }),
            o.jsx(Jde, {
              roomId: t.roomId,
              value: n,
              children: (j, k, C) => o.jsx(Ye, {
                size: "300",
                after: C ? o.jsx(dt, {
                  size: "100",
                  variant: "Secondary"
                }) : o.jsx(Q, {
                  size: "100",
                  src: Qk(n)
                }),
                radii: "300",
                "aria-pressed": k,
                onClick: j,
                children: o.jsx(D, {
                  style: {
                    flexGrow: 1
                  },
                  as: "span",
                  size: "T300",
                  truncate: true,
                  children: "Notifications"
                })
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: y,
              variant: "Primary",
              fill: "None",
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.UserPlus
              }),
              radii: "300",
              "aria-pressed": g,
              disabled: !u,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Invite"
              })
            }),
            o.jsx(Ye, {
              onClick: w,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Link
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Copy Link"
              })
            }),
            o.jsx(Ye, {
              onClick: b,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Setting
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Room Settings"
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: o.jsx(Hi, {
            initial: false,
            children: (j, k) => o.jsxs(o.Fragment, {
              children: [
                o.jsx(Ye, {
                  onClick: () => k(true),
                  variant: "Critical",
                  fill: "None",
                  size: "300",
                  after: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowGoLeft
                  }),
                  radii: "300",
                  "aria-pressed": j,
                  children: o.jsx(D, {
                    style: {
                      flexGrow: 1
                    },
                    as: "span",
                    size: "T300",
                    truncate: true,
                    children: "Leave Room"
                  })
                }),
                j && o.jsx(YM, {
                  roomId: t.roomId,
                  onDone: e,
                  onCancel: () => k(false)
                })
              ]
            })
          })
        })
      ]
    });
  }), Wm = (t) => t ? {
    width: "100%",
    height: "100%",
    padding: "0",
    paddingTop: "0px"
  } : {};
  function uL({ room: t, selected: e, showAvatar: n, direct: r, customDMCards: i, notificationMode: a, linkPath: s, hideText: l, joinCallOnSingleClick: c }) {
    var _a6;
    const d = be(), u = hn(), [h, f] = p.useState(false), { hoverProps: g } = rO({
      onHoverChange: f
    }), { focusWithinProps: m } = nO({
      onFocusWithinChange: f
    }), [v, y] = p.useState(), w = w3(t.roomId, qi), b = Put(t), j = LO(t.roomId).filter((re) => re.userId !== d.getUserId()), k = Ze(qr), C = r ? (_a6 = t.getAvatarFallbackMember()) == null ? void 0 : _a6.userId : void 0, x = rc(t), S = C && k[C] || x, T = v3(C ?? ""), A = D3(t), B = r ? (i && A) ?? (T == null ? void 0 : T.status) : void 0, { navigateRoom: U } = Wi(), z = br(), M = fr() === sn.Mobile, I = QF(t), N = x3(t, I), L = bS(r), H = sm(), V = Ze($de()), [Z, Y] = Fr(tv), oe = am(), ue = (H == null ? void 0 : H.roomId) === t.roomId, ie = (re) => {
      re.preventDefault(), y({
        x: re.clientX,
        y: re.clientY,
        width: 0,
        height: 0
      });
    }, de = (re) => {
      y(re.currentTarget.getBoundingClientRect());
    }, ne = (re) => {
      if (t.isCallRoom()) {
        if (!Tde(oe) && N.length === 0 || H && !ue) return;
        !M && !l ? !ue && !H && c ? L(t, new D1(V.microphone, V.video, V.sound)) : U(t.roomId) : (re.stopPropagation(), Z && Y(false), U(t.roomId));
      } else z(s);
    }, ae = (re) => {
      re.stopPropagation(), Y(!Z), z(s);
    }, X = h || !!v, G = !(a === Ts.Mute) && (!!w || b);
    let le = 0;
    w && (le = w.highlight > 0 ? w.highlight : w.total);
    const te = [
      S,
      t.isCallRoom() ? [
        "Call Room",
        ue && "Currently in Call",
        N.length && `${N.length} in Call`
      ] : "Text Room",
      (w == null ? void 0 : w.total) && `${w.total} Messages`
    ].flat().filter(Boolean).join(", ");
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(E, {
          direction: "Column",
          grow: "Yes",
          style: {
            ...Wm(l),
            marginTop: l ? He(5) : "0"
          },
          children: o.jsxs(Is, {
            variant: "Background",
            radii: "400",
            highlight: G,
            "aria-selected": e,
            "data-hover": !!v,
            onContextMenu: ie,
            ...g,
            ...m,
            style: Wm(l),
            children: [
              o.jsx(ar, {
                position: "Right",
                offset: 4,
                tooltip: l && o.jsx(pr, {
                  children: o.jsx(D, {
                    children: S
                  })
                }),
                children: (re) => o.jsx(_F, {
                  onClick: ne,
                  "aria-label": te,
                  ref: re,
                  style: Wm(l),
                  children: o.jsx(Bs, {
                    style: Wm(l),
                    children: o.jsxs(E, {
                      as: "span",
                      grow: "Yes",
                      alignItems: "Center",
                      justifyContent: "Start",
                      gap: "200",
                      style: Wm(l),
                      children: [
                        o.jsx(PO, {
                          badge: T && T.presence !== w1.Offline && o.jsx(RS, {
                            presence: T.presence,
                            size: l ? "300" : "200"
                          }),
                          style: Wm(l),
                          children: o.jsx(xn, {
                            size: l ? void 0 : "200",
                            radii: "400",
                            style: Wm(l),
                            children: n ? o.jsx(yi, {
                              roomId: t.roomId,
                              src: (!r || i) && Sa(d, t, 96, u) || Jf(d, t, 96, u),
                              uniformIcons: true,
                              alt: S,
                              renderFallback: () => o.jsx(D, {
                                as: "span",
                                size: "H6",
                                children: Vi(S)
                              })
                            }) : o.jsx(Ya, {
                              style: {
                                opacity: w || b || ue ? ee.opacity.P500 : ee.opacity.P300
                              },
                              filled: e || ue,
                              size: "100",
                              joinRule: t.getJoinRule(),
                              roomType: t.getType()
                            })
                          })
                        }),
                        w && l && o.jsx(cm, {
                          highlight: w.highlight > 0,
                          count: w.highlight > 0 ? w.highlight : w.total
                        }),
                        !l && o.jsxs(o.Fragment, {
                          children: [
                            o.jsxs(E, {
                              as: "span",
                              grow: "Yes",
                              direction: "Column",
                              children: [
                                o.jsx(D, {
                                  priority: w || b || ue ? "500" : "400",
                                  as: "span",
                                  size: "Inherit",
                                  truncate: true,
                                  children: S
                                }),
                                B && o.jsx(D, {
                                  truncate: true,
                                  size: "T200",
                                  priority: "300",
                                  style: {
                                    opacity: ee.opacity.P300,
                                    marginTop: "-2px"
                                  },
                                  children: B
                                })
                              ]
                            }),
                            !X && !w && !e && j.length > 0 && o.jsx(Rn, {
                              size: "300",
                              variant: "Secondary",
                              fill: "Soft",
                              radii: "Pill",
                              outlined: true,
                              children: o.jsx(MO, {
                                size: "300",
                                disableAnimation: true
                              })
                            }),
                            !X && G && o.jsx(f3, {
                              children: o.jsx(Sp, {
                                highlight: !!w && w.highlight > 0,
                                count: le,
                                dm: r
                              })
                            }),
                            !X && a !== Ts.Unset && o.jsx(Q, {
                              size: "50",
                              src: Qk(a),
                              "aria-label": a
                            }),
                            (t.isCallRoom() || r) && N.length > 0 && !X && o.jsx(Rn, {
                              variant: "Critical",
                              fill: "Solid",
                              size: "400",
                              children: o.jsxs(E, {
                                alignItems: "Center",
                                gap: "100",
                                children: [
                                  o.jsx(Q, {
                                    size: "50",
                                    src: q.Phone,
                                    color: "Inherit"
                                  }),
                                  o.jsx(D, {
                                    as: "span",
                                    size: "L400",
                                    truncate: true,
                                    children: r ? "Calling" : `${N.length} Live`
                                  })
                                ]
                              })
                            })
                          ]
                        })
                      ]
                    })
                  })
                })
              }),
              X && !l && o.jsxs(but, {
                children: [
                  (t.isCallRoom() || r && N.length > 0) && o.jsx(ar, {
                    position: "Bottom",
                    offset: 4,
                    tooltip: o.jsx(pr, {
                      children: o.jsx(D, {
                        children: Z ? "Hide Chat" : "Show Chat"
                      })
                    }),
                    children: (re) => o.jsx(Oe, {
                      ref: re,
                      "data-testid": "chat-button",
                      onClick: ae,
                      "aria-pressed": Z && e,
                      "aria-label": "Open Chat",
                      variant: "Background",
                      fill: "None",
                      size: "300",
                      radii: "300",
                      children: o.jsx(Q, {
                        size: "50",
                        src: q.Message,
                        filled: Z
                      })
                    })
                  }),
                  o.jsx(ln, {
                    id: `menu-${t.roomId}`,
                    "aria-expanded": !!v,
                    anchor: v,
                    offset: (v == null ? void 0 : v.width) === 0 ? 0 : void 0,
                    alignOffset: (v == null ? void 0 : v.width) === 0 ? 0 : -5,
                    position: "Bottom",
                    align: (v == null ? void 0 : v.width) === 0 ? "Start" : "End",
                    content: o.jsx(Ft, {
                      focusTrapOptions: {
                        initialFocus: false,
                        returnFocusOnDeactivate: false,
                        onDeactivate: () => y(void 0),
                        clickOutsideDeactivates: true,
                        isKeyForward: (re) => re.key === "ArrowDown",
                        isKeyBackward: (re) => re.key === "ArrowUp",
                        escapeDeactivates: kt
                      },
                      children: o.jsx(Mut, {
                        room: t,
                        requestClose: () => y(void 0),
                        notificationMode: a
                      })
                    }),
                    children: !l && o.jsx(Oe, {
                      onClick: de,
                      "aria-pressed": !!v,
                      "aria-controls": `menu-${t.roomId}`,
                      "aria-label": "More Options",
                      variant: "Background",
                      fill: "None",
                      size: "300",
                      radii: "300",
                      children: o.jsx(Q, {
                        size: "50",
                        src: q.VerticalDots
                      })
                    })
                  })
                ]
              })
            ]
          })
        }),
        t.isCallRoom() && o.jsx(E, {
          direction: "Column",
          style: {
            paddingLeft: l ? ee.space.S0 : ee.space.S200
          },
          children: N.map((re) => o.jsx(Cut, {
            room: t,
            callMembership: re,
            hideText: l
          }, re.membershipID))
        })
      ]
    });
  }
  var iQ = "styles_CategoryButton__rhl6fl0", oQ = "styles_CategoryButtonIcon__rhl6fl1";
  const hL = ft(({ className: t, closed: e, children: n, ...r }, i) => n ? o.jsx(Qe, {
    className: gt(iQ, t),
    variant: "Background",
    radii: "400",
    after: o.jsx(Q, {
      className: oQ,
      size: "50",
      src: e ? q.ChevronRight : q.ChevronBottom
    }),
    ...r,
    ref: i,
    children: n && o.jsx(D, {
      size: "B400",
      priority: "300",
      truncate: true,
      children: n
    })
  }) : o.jsx(Oe, {
    className: gt(iQ, t),
    variant: "Background",
    radii: "400",
    ...r,
    style: {
      padding: "0"
    },
    ref: i,
    children: o.jsx(Q, {
      className: oQ,
      size: "50",
      style: {
        padding: "0"
      },
      src: e ? q.ChevronRight : q.ChevronBottom
    })
  })), Out = "closedNavCategories", Lut = (t) => {
    const e = `${Out}${t}`, n = ph(e, (i) => {
      const a = Ps(i, []);
      return new Set(a);
    }, (i, a) => {
      const s = Array.from(a);
      Vd(i, s);
    });
    return vn((i) => i(n), (i, a, s) => {
      if (s.type === "DELETE") {
        a(n, uo(i(n), (l) => {
          l.delete(s.categoryId);
        }));
        return;
      }
      s.type === "PUT" && a(n, uo(i(n), (l) => {
        l.add(s.categoryId);
      }));
    });
  }, v2 = (...t) => t.join("|"), Nut = (t) => t.split("|"), _ge = p.createContext(null), zut = _ge.Provider, fv = () => {
    const t = p.useContext(_ge);
    if (!t) throw new Error("NavToActivePathAtom is not provided!");
    return t;
  }, I3 = (t) => {
    const e = Za(), n = Fn(fv());
    p.useEffect(() => {
      const { pathname: r, search: i, hash: a } = e;
      n({
        type: "PUT",
        navId: t,
        path: {
          pathname: r,
          search: i,
          hash: a
        }
      });
    }, [
      e,
      n,
      t
    ]);
  }, yge = p.createContext(null), Uut = yge.Provider, fL = () => {
    const t = p.useContext(yge);
    if (!t) throw new Error("ClosedNavCategoriesAtom is not provided!");
    return t;
  };
  function bge({ onOpen: t, onCancel: e }) {
    const [n, r] = p.useState(false), i = (a) => {
      var _a6, _b3;
      a.preventDefault(), r(false);
      const c = (_b3 = (_a6 = a.target) == null ? void 0 : _a6.addressInput) == null ? void 0 : _b3.value.trim();
      if (c) {
        if (Bc(c) || ml(c)) {
          t(c);
          return;
        }
        if (zc(c)) {
          const d = c, u = d && decodeURIComponent(d), h = QE(u);
          if (h) {
            t(h.roomIdOrAlias, h.viaServers);
            return;
          }
          const f = ek(u);
          if (f) {
            t(f.roomIdOrAlias, f.viaServers, f.eventId);
            return;
          }
        }
        r(true);
      }
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            onDeactivate: e,
            clickOutsideDeactivates: true,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Join with Address"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: e,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                as: "form",
                onSubmit: i,
                style: {
                  padding: ee.space.S400,
                  paddingTop: 0
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        size: "T300",
                        children: "Enter public address to join the community. Addresses looks like:"
                      }),
                      o.jsxs(D, {
                        as: "ul",
                        size: "T200",
                        priority: "300",
                        style: {
                          paddingLeft: ee.space.S400
                        },
                        children: [
                          o.jsx("li", {
                            children: "#community:server"
                          }),
                          o.jsx("li", {
                            children: "https://matrix.to/#/#community:server"
                          }),
                          o.jsx("li", {
                            children: "https://matrix.to/#/!xYzAj?via=server"
                          })
                        ]
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Address"
                      }),
                      o.jsx(mn, {
                        size: "500",
                        autoFocus: true,
                        name: "addressInput",
                        variant: "Background",
                        placeholder: "#community:server",
                        required: true
                      }),
                      n && o.jsx(D, {
                        size: "T200",
                        style: {
                          color: ct.Critical.Main
                        },
                        children: o.jsx("b", {
                          children: "Invalid Address"
                        })
                      })
                    ]
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    variant: "Primary",
                    children: o.jsx(D, {
                      size: "B400",
                      children: "Open"
                    })
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  const B3 = (t) => {
    const e = be(), n = Ze(gi), r = Ze(vi);
    return mse(e, zr, n, r, t);
  }, Vut = p.forwardRef(({ requestClose: t }, e) => {
    const n = B3(), [r] = Fe(ge, "hideReads"), [i, a] = Fe(ge, "isShowingAllRoomsInHome"), s = wh(n, qi), l = be(), c = () => {
      s && (n.forEach((d) => As(l, d, r)), t());
    };
    return o.jsx(tn, {
      ref: e,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: o.jsxs(E, {
        direction: "Column",
        gap: "100",
        style: {
          padding: ee.space.S100
        },
        children: [
          o.jsx(Ye, {
            onClick: c,
            size: "300",
            after: o.jsx(Q, {
              size: "100",
              src: q.CheckTwice
            }),
            radii: "300",
            "aria-disabled": !s,
            children: o.jsx(D, {
              style: {
                flexGrow: 1
              },
              as: "span",
              size: "T300",
              truncate: true,
              children: "Mark as Read"
            })
          }),
          o.jsx(Ye, {
            onClick: () => a(!i),
            size: "300",
            after: o.jsx(Q, {
              size: "100",
              src: i ? q.Home : q.Globe
            }),
            radii: "300",
            children: o.jsx(D, {
              style: {
                flexGrow: 1
              },
              as: "span",
              size: "T300",
              truncate: true,
              children: i ? "Show Home Rooms" : "Show All Rooms"
            })
          })
        ]
      })
    });
  });
  function Hut({ hideText: t }) {
    const [e, n] = p.useState(), r = (i) => {
      const a = i.currentTarget.getBoundingClientRect();
      n((s) => {
        if (!s) return a;
      });
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Kf, {
          size: "600",
          children: t ? o.jsx(E, {
            alignItems: "Center",
            grow: "Yes",
            justifyContent: "Center",
            children: o.jsx(Oe, {
              "aria-pressed": !!e,
              variant: "Background",
              onClick: r,
              children: o.jsx(Q, {
                src: q.Home,
                size: "200",
                filled: !!e
              })
            })
          }) : o.jsxs(E, {
            grow: "Yes",
            gap: "300",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                children: o.jsx(D, {
                  size: "H4",
                  truncate: true,
                  children: "Home"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  "aria-pressed": !!e,
                  variant: "Background",
                  onClick: r,
                  children: o.jsx(Q, {
                    src: q.VerticalDots,
                    size: "200",
                    filled: !!e
                  })
                })
              })
            ]
          })
        }),
        o.jsx(ln, {
          anchor: e,
          position: "Bottom",
          align: "End",
          offset: 6,
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => n(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (i) => i.key === "ArrowDown",
              isKeyBackward: (i) => i.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(Vut, {
              requestClose: () => n(void 0)
            })
          })
        })
      ]
    });
  }
  function $ut() {
    const t = br();
    return o.jsx(mge, {
      children: o.jsx(gge, {
        icon: o.jsx(Q, {
          size: "600",
          src: q.Hash
        }),
        title: o.jsx(D, {
          size: "H5",
          align: "Center",
          children: "No Rooms"
        }),
        content: o.jsx(D, {
          size: "T300",
          align: "Center",
          children: "You do not have any rooms yet."
        }),
        options: o.jsxs(o.Fragment, {
          children: [
            o.jsx(xe, {
              onClick: () => t(XB()),
              variant: "Secondary",
              size: "300",
              children: o.jsx(D, {
                size: "B300",
                truncate: true,
                children: "Create Room"
              })
            }),
            o.jsx(xe, {
              onClick: () => t(nb()),
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              children: o.jsx(D, {
                size: "B300",
                truncate: true,
                children: "Explore Community Rooms"
              })
            })
          ]
        })
      })
    });
  }
  const gD = v2("home", "room");
  function Wut() {
    var _a6;
    const t = be();
    I3("home");
    const e = p.useRef(null), [n] = Fe(ge, "isShowingAllRoomsInHome"), r = B3(n), i = h3(), a = Ze(qi), s = br(), [l, c] = Fe(ge, "roomSidebarWidth"), [d, u] = p.useState(l);
    p.useEffect(() => {
      u(l);
    }, [
      l
    ]);
    const [h] = Fe(ge, "showRoomIcon"), [f] = Fe(ge, "perRoomShowRoomIcon"), g = ((_a6 = f.find((z) => z.roomId === "Home")) == null ? void 0 : _a6.display) ?? h, m = () => g === Ic.Always ? true : g === Ic.Never ? false : d < 144, [v] = Fe(ge, "joinCallOnSingleClick"), y = oc(), w = wut(), b = Dut(), j = r.length === 0, [k, C] = Fr(fL()), x = p.useMemo(() => {
      const z = Array.from(r).toSorted(k.has(gD) || n ? Ku(t) : Yk(t)), O = (M) => {
        const I = a.get(M);
        return !!I && (I.total > 0 || I.highlight > 0);
      };
      return k.has(gD) ? z.filter((M) => O(M) || M === y) : z;
    }, [
      t,
      r,
      k,
      a,
      y,
      n
    ]), S = nc({
      count: x.length,
      getScrollElement: () => e.current,
      estimateSize: () => 38,
      overscan: 10
    }), T = BS(C, (z) => k.has(z)), B = fr() === sn.Mobile, U = d <= 80 && !B;
    return o.jsxs(E, {
      shrink: "No",
      style: {
        position: "relative",
        width: B ? "100%" : He(d)
      },
      children: [
        o.jsxs(qf, {
          children: [
            o.jsx(Hut, {
              hideText: U
            }),
            j ? o.jsx($ut, {}) : o.jsx(mh, {
              scrollRef: e,
              children: o.jsxs(E, {
                direction: "Column",
                gap: "300",
                children: [
                  o.jsxs(ch, {
                    children: [
                      o.jsx(Is, {
                        variant: "Background",
                        radii: "400",
                        "aria-selected": w,
                        children: o.jsx(_F, {
                          onClick: () => s(XB()),
                          children: o.jsx(Bs, {
                            children: o.jsxs(E, {
                              as: "span",
                              grow: "Yes",
                              alignItems: "Center",
                              justifyContent: "Start",
                              gap: "200",
                              children: [
                                o.jsx(xn, {
                                  size: U ? void 0 : "200",
                                  radii: "400",
                                  style: U ? {
                                    width: "100%",
                                    padding: "0"
                                  } : void 0,
                                  children: o.jsx(Q, {
                                    src: q.Plus,
                                    size: "100"
                                  })
                                }),
                                !U && o.jsx(E, {
                                  as: "span",
                                  grow: "Yes",
                                  children: o.jsx(D, {
                                    as: "span",
                                    size: "Inherit",
                                    truncate: true,
                                    children: "Create Room"
                                  })
                                })
                              ]
                            })
                          })
                        })
                      }),
                      o.jsx(Hi, {
                        initial: false,
                        children: (z, O) => o.jsxs(o.Fragment, {
                          children: [
                            o.jsx(Is, {
                              variant: "Background",
                              radii: "400",
                              children: o.jsx(_F, {
                                onClick: () => O(true),
                                children: o.jsx(Bs, {
                                  children: o.jsxs(E, {
                                    as: "span",
                                    grow: "Yes",
                                    alignItems: "Center",
                                    justifyContent: "Start",
                                    gap: "200",
                                    children: [
                                      o.jsx(xn, {
                                        size: U ? void 0 : "200",
                                        radii: "400",
                                        style: U ? {
                                          width: "100%",
                                          padding: "0"
                                        } : void 0,
                                        children: o.jsx(Q, {
                                          src: q.Link,
                                          size: "100"
                                        })
                                      }),
                                      !U && o.jsx(E, {
                                        as: "span",
                                        grow: "Yes",
                                        children: o.jsx(D, {
                                          as: "span",
                                          size: "Inherit",
                                          truncate: true,
                                          children: "Join with Address"
                                        })
                                      })
                                    ]
                                  })
                                })
                              })
                            }),
                            z && o.jsx(bge, {
                              onCancel: () => O(false),
                              onOpen: (M, I, N) => {
                                O(false);
                                const L = Xg(M, N);
                                s(I ? gl(L, {
                                  viaServers: JB(I)
                                }) : L);
                              }
                            })
                          ]
                        })
                      }),
                      o.jsx(Is, {
                        variant: "Background",
                        radii: "400",
                        "aria-selected": b,
                        children: o.jsx(Rf, {
                          to: QB(),
                          children: o.jsx(Bs, {
                            children: o.jsxs(E, {
                              as: "span",
                              grow: "Yes",
                              alignItems: "Center",
                              justifyContent: "Start",
                              gap: "200",
                              children: [
                                o.jsx(xn, {
                                  size: U ? void 0 : "200",
                                  radii: "400",
                                  style: U ? {
                                    width: "100%"
                                  } : void 0,
                                  children: o.jsx(Q, {
                                    src: q.Search,
                                    size: "100",
                                    filled: b
                                  })
                                }),
                                !U && o.jsx(E, {
                                  as: "span",
                                  grow: "Yes",
                                  children: o.jsx(D, {
                                    as: "span",
                                    size: "Inherit",
                                    truncate: true,
                                    children: "Message Search"
                                  })
                                })
                              ]
                            })
                          })
                        })
                      })
                    ]
                  }),
                  o.jsxs(ch, {
                    children: [
                      o.jsx(MS, {
                        children: o.jsx(hL, {
                          closed: k.has(gD),
                          "data-category-id": gD,
                          onClick: T,
                          children: !U && "Rooms"
                        })
                      }),
                      o.jsx("div", {
                        style: {
                          position: "relative",
                          height: S.getTotalSize(),
                          overflow: "visible"
                        },
                        children: S.getVirtualItems().map((z) => {
                          const O = x[z.index];
                          if (!O) return null;
                          const M = t.getRoom(O);
                          if (!M) return null;
                          const I = y === O, N = wi(t, O);
                          return o.jsx(Rs, {
                            virtualItem: z,
                            ref: S.measureElement,
                            children: o.jsx("div", {
                              style: U ? {
                                padding: "0",
                                width: "100%",
                                aspectRatio: 1,
                                display: "flex",
                                flexDirection: "column"
                              } : {},
                              children: o.jsx(uL, {
                                room: M,
                                selected: I,
                                showAvatar: m(),
                                hideText: U,
                                linkPath: Xg(N),
                                notificationMode: Xk(i, M.roomId),
                                joinCallOnSingleClick: v
                              })
                            })
                          }, z.index);
                        })
                      })
                    ]
                  })
                ]
              })
            })
          ]
        }),
        !B && o.jsx(Zl, {
          setCurWidth: u,
          sidebarWidth: l,
          setSidebarWidth: c,
          instep: 80,
          outstep: 190,
          minValue: 50,
          maxValue: 500
        })
      ]
    });
  }
  const qut = (t) => {
    const e = [];
    return t.forEach((n) => {
      const r = n.result.room_id, i = {
        rank: n.rank,
        event: n.result,
        context: n.context
      }, a = e[e.length - 1];
      if (a && r === a.roomId) {
        a.items.push(i);
        return;
      }
      e.push({
        roomId: r,
        items: [
          i
        ]
      });
    }), e;
  }, Kut = (t) => {
    const e = t.search_categories.room_events;
    return {
      nextToken: e == null ? void 0 : e.next_batch,
      highlights: (e == null ? void 0 : e.highlights) ?? [],
      groups: qut((e == null ? void 0 : e.results) ?? [])
    };
  }, Gut = (t) => {
    const e = be(), { term: n, order: r, rooms: i, senders: a } = t;
    return p.useCallback(async (l) => {
      if (!n) return {
        highlights: [],
        groups: []
      };
      const d = {
        search_categories: {
          room_events: {
            event_context: {
              before_limit: 0,
              after_limit: 0,
              include_profile: false
            },
            filter: {
              limit: 20,
              rooms: i,
              senders: a
            },
            include_state: false,
            order_by: r,
            search_term: n
          }
        }
      }, u = await e.search({
        body: d,
        next_batch: l === "" ? void 0 : l
      });
      return Kut(u);
    }, [
      e,
      n,
      r,
      i,
      a
    ]);
  };
  function Yut({ room: t, highlights: e, items: n, mediaAutoLoad: r, urlPreview: i, onOpen: a, legacyUsernameColor: s, hour24Clock: l, dateFormatString: c }) {
    const d = be(), u = hn(), h = p.useMemo(() => a3(e), [
      e
    ]), f = Mo(t), g = ri(t), m = Ep(), v = yh(t, f), y = bh(t, g, f), w = yp(), b = Vk(w.kind, m, v), j = Ze(qr), k = gs(), [C] = Fe(ge, "incomingInlineImagesDefaultHeight"), [x] = Fe(ge, "incomingInlineImagesMaxHeight"), S = om(t.roomId), T = Xd(), A = p.useMemo(() => ({
      ...fs,
      render: em(k, (O) => _h(d, t.roomId, O, Jd(S), j), S)
    }), [
      d,
      t,
      S,
      j,
      k
    ]), B = p.useMemo(() => Ql(d, t.roomId, {
      settingsLinkBaseUrl: k,
      linkifyOpts: A,
      highlightRegex: h,
      useAuthentication: u,
      handleSpoilerClick: T,
      handleMentionClick: S,
      nicknames: j,
      incomingInlineImagesDefaultHeight: C,
      incomingInlineImagesMaxHeight: x
    }), [
      d,
      t,
      A,
      h,
      S,
      T,
      u,
      j,
      k,
      C,
      x
    ]), U = wS({
      [ce.RoomMessage]: (O, M, I) => {
        var _a6, _b3;
        return ((_a6 = O.unsigned) == null ? void 0 : _a6.redacted_because) ? o.jsx(ss, {
          reason: (_b3 = O.unsigned) == null ? void 0 : _b3.redacted_because.content.reason
        }) : o.jsx(oh, {
          displayName: M,
          msgType: O.content.msgtype ?? "",
          ts: O.origin_server_ts,
          getContent: I,
          mediaAutoLoad: r,
          urlPreview: i,
          htmlReactParserOptions: B,
          linkifyOpts: A,
          highlightRegex: h,
          outlineAttachment: true
        });
      },
      [ce.Reaction]: (O, M, I) => {
        var _a6, _b3;
        return ((_a6 = O.unsigned) == null ? void 0 : _a6.redacted_because) ? o.jsx(ss, {
          reason: (_b3 = O.unsigned) == null ? void 0 : _b3.redacted_because.content.reason
        }) : o.jsx(cp, {
          content: I(),
          renderImageContent: (N) => o.jsx(rh, {
            ...N,
            autoPlay: r,
            renderImage: (L) => o.jsx(as, {
              ...L,
              loading: "lazy"
            }),
            renderViewer: (L) => o.jsx(Yc, {
              ...L
            })
          })
        });
      },
      [ce.RoomTombstone]: (O) => {
        const { content: M } = O;
        return o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsxs(D, {
            size: "T400",
            priority: "300",
            children: [
              "Room Tombstone. ",
              M.body
            ]
          })
        });
      }
    }, void 0, (O) => {
      var _a6, _b3;
      return ((_a6 = O.unsigned) == null ? void 0 : _a6.redacted_because) ? o.jsx(ss, {
        reason: (_b3 = O.unsigned) == null ? void 0 : _b3.redacted_because.content.reason
      }) : o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        children: o.jsxs(D, {
          size: "T400",
          priority: "300",
          children: [
            o.jsx("code", {
              className: nh,
              children: O.type
            }),
            " event"
          ]
        })
      });
    }), z = (O) => {
      const M = O.currentTarget.getAttribute("data-event-id");
      M && a(t.roomId, M);
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      children: [
        o.jsx(wn, {
          size: "300",
          children: o.jsxs(E, {
            gap: "200",
            grow: "Yes",
            children: [
              o.jsx(xn, {
                size: "200",
                radii: "300",
                children: o.jsx(yi, {
                  roomId: t.roomId,
                  src: Sa(d, t, 96, u),
                  alt: t.name,
                  renderFallback: () => o.jsx(Ya, {
                    size: "50",
                    roomType: t.getType(),
                    joinRule: t.getJoinRule() ?? kn.Restricted,
                    filled: true
                  })
                })
              }),
              o.jsx(D, {
                size: "H4",
                truncate: true,
                children: t.name
              })
            ]
          })
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          children: n.map((O) => {
            var _a6;
            const { event: M } = O, I = gr(t, M.sender, j) ?? _n(M.sender) ?? M.sender, N = Jc(t, M.sender), L = M.content["m.relates_to"], H = (L == null ? void 0 : L.rel_type) === Xn.Replace ? L.event_id : M.event_id, V = (() => M.content["m.new_content"] ?? M.content), Z = (_a6 = L == null ? void 0 : L["m.in_reply_to"]) == null ? void 0 : _a6.event_id, Y = (L == null ? void 0 : L.rel_type) === Xn.Thread ? L.event_id : void 0, oe = y(M.sender), ue = (oe == null ? void 0 : oe.color) ? b == null ? void 0 : b.get(oe.color) : void 0, ie = (oe == null ? void 0 : oe.icon) ? qc(d, u, oe.icon) : void 0, de = s ? _p(M.sender) : ue;
            return o.jsx(Te, {
              style: {
                padding: ee.space.S400
              },
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsxs(Cp, {
                before: o.jsx(s3, {
                  children: o.jsx(xn, {
                    size: "300",
                    children: o.jsx(Si, {
                      userId: M.sender,
                      src: N ? Cn(d, N, u, 48, 48, "crop") ?? void 0 : void 0,
                      alt: I,
                      renderFallback: () => o.jsx(Q, {
                        size: "200",
                        src: q.User,
                        filled: true
                      })
                    })
                  })
                }),
                children: [
                  o.jsxs(E, {
                    gap: "300",
                    justifyContent: "SpaceBetween",
                    alignItems: "Center",
                    grow: "Yes",
                    children: [
                      o.jsxs(E, {
                        gap: "200",
                        alignItems: "Baseline",
                        children: [
                          o.jsxs(E, {
                            alignItems: "Center",
                            gap: "200",
                            children: [
                              o.jsx(l3, {
                                style: {
                                  color: de
                                },
                                children: o.jsx(D, {
                                  as: "span",
                                  truncate: true,
                                  children: o.jsx(iF, {
                                    children: I
                                  })
                                })
                              }),
                              ie && o.jsx(Zc, {
                                size: "100",
                                iconSrc: ie
                              })
                            ]
                          }),
                          o.jsx(Ma, {
                            ts: M.origin_server_ts,
                            hour24Clock: l,
                            dateFormatString: c
                          })
                        ]
                      }),
                      o.jsx(E, {
                        shrink: "No",
                        gap: "200",
                        alignItems: "Center",
                        children: o.jsx(Qe, {
                          "data-event-id": H,
                          onClick: z,
                          variant: "Secondary",
                          radii: "400",
                          children: o.jsx(D, {
                            size: "T200",
                            children: "Open"
                          })
                        })
                      })
                    ]
                  }),
                  Z && o.jsx(Pu, {
                    room: t,
                    replyEventId: Z,
                    threadRootId: Y,
                    mentions: M.content["m.mentions"],
                    onClick: z
                  }),
                  U(M.type, false, M, I, V)
                ]
              })
            }, M.event_id);
          })
        })
      ]
    });
  }
  function Zut({ active: t, loading: e, searchInputRef: n, onSearch: r, onReset: i }) {
    const a = (s) => {
      s.preventDefault();
      const { searchInput: l } = s.target, c = l.value.trim() || void 0;
      c && r(c);
    };
    return o.jsxs(E, {
      as: "form",
      direction: "Column",
      gap: "100",
      onSubmit: a,
      children: [
        o.jsx("span", {
          "data-spacing-node": true
        }),
        o.jsx(D, {
          size: "L400",
          children: "Search"
        }),
        o.jsx(mn, {
          ref: n,
          style: {
            paddingRight: ee.space.S300
          },
          name: "searchInput",
          autoFocus: true,
          size: "500",
          variant: "Background",
          placeholder: "Search for keyword",
          autoComplete: "off",
          before: t && e ? o.jsx(dt, {
            variant: "Secondary",
            size: "200"
          }) : o.jsx(Q, {
            size: "200",
            src: q.Search
          }),
          after: t ? o.jsx(Qe, {
            type: "reset",
            variant: "Secondary",
            size: "400",
            radii: "Pill",
            outlined: true,
            after: o.jsx(Q, {
              size: "50",
              src: q.Cross
            }),
            onClick: i,
            children: o.jsx(D, {
              size: "B300",
              children: "Clear"
            })
          }, "resetButton") : o.jsx(Qe, {
            type: "submit",
            variant: "Primary",
            size: "400",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "B300",
              children: "Enter"
            })
          })
        })
      ]
    });
  }
  function Jut({ order: t, onChange: e }) {
    const [n, r] = p.useState(), i = t === M2.Rank, a = (l) => {
      r(void 0), e(l);
    }, s = (l) => {
      r(l.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: n,
      align: "End",
      position: "Bottom",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => r(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsxs(tn, {
          variant: "Surface",
          children: [
            o.jsx(wn, {
              size: "300",
              variant: "Surface",
              style: {
                padding: `0 ${ee.space.S300}`
              },
              children: o.jsx(D, {
                size: "L400",
                children: "Sort by"
              })
            }),
            o.jsx(nr, {
              variant: "Surface",
              size: "300"
            }),
            o.jsxs("div", {
              style: {
                padding: ee.space.S100
              },
              children: [
                o.jsx(Ye, {
                  onClick: () => a(),
                  variant: "Surface",
                  size: "300",
                  radii: "300",
                  "aria-pressed": !i,
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Recent"
                  })
                }),
                o.jsx(Ye, {
                  onClick: () => a(M2.Rank),
                  variant: "Surface",
                  size: "300",
                  radii: "300",
                  "aria-pressed": i,
                  children: o.jsx(D, {
                    size: "T300",
                    children: "Relevance"
                  })
                })
              ]
            })
          ]
        })
      }),
      children: o.jsx(Qe, {
        variant: "SurfaceVariant",
        radii: "Pill",
        after: o.jsx(Q, {
          size: "50",
          src: q.Sort
        }),
        onClick: s,
        children: i ? o.jsx(D, {
          size: "T200",
          children: "Relevance"
        }) : o.jsx(D, {
          size: "T200",
          children: "Recent"
        })
      })
    });
  }
  const Xut = {
    limit: 20,
    matchOptions: {
      contain: true
    }
  }, Qut = {
    wait: 200
  };
  function eht({ roomList: t, selectedRooms: e, onChange: n }) {
    const r = be(), i = p.useRef(null), [a, s] = p.useState(), [l, c] = p.useState(e), d = p.useCallback((x) => {
      var _a6;
      return ((_a6 = r.getRoom(x)) == null ? void 0 : _a6.name) ?? x;
    }, [
      r
    ]), [u, h, f] = tc(t, d, Xut), g = Array.from((u == null ? void 0 : u.items) ?? t).toSorted(Yk(r)), m = nc({
      count: g.length,
      getScrollElement: () => i.current,
      estimateSize: () => 32,
      overscan: 5
    }), v = m.getVirtualItems(), y = Rp(h, Qut), w = (x) => {
      const S = x.currentTarget.value.trim();
      if (!S) {
        f();
        return;
      }
      y(S);
    }, b = (x) => {
      const S = x.currentTarget.getAttribute("data-room-id");
      if (!S) return;
      if (l == null ? void 0 : l.includes(S)) {
        c(l == null ? void 0 : l.filter((A) => A !== S));
        return;
      }
      const T = [
        ...l ?? []
      ];
      T.push(S), c(T);
    }, j = () => {
      s(void 0), n(l);
    }, k = () => {
      s(void 0), n(void 0);
    };
    p.useEffect(() => {
      c(e), f();
    }, [
      a,
      e,
      f
    ]);
    const C = (x) => {
      s(x.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: a,
      align: "Center",
      position: "Bottom",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => s(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          variant: "Surface",
          style: {
            width: He(250)
          },
          children: o.jsxs(E, {
            direction: "Column",
            style: {
              maxHeight: He(450),
              maxWidth: He(300)
            },
            children: [
              o.jsxs(E, {
                shrink: "No",
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S200,
                  paddingBottom: 0
                },
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Search"
                  }),
                  o.jsx(mn, {
                    onChange: w,
                    size: "300",
                    radii: "300",
                    after: u && u.items.length > 0 ? o.jsx(Rn, {
                      variant: "Secondary",
                      size: "400",
                      radii: "Pill",
                      children: o.jsx(D, {
                        size: "L400",
                        children: u.items.length
                      })
                    }) : null
                  })
                ]
              }),
              o.jsx(dn, {
                ref: i,
                size: "300",
                hideTrack: true,
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    padding: ee.space.S200,
                    paddingRight: 0
                  },
                  children: [
                    !u && o.jsx(D, {
                      size: "L400",
                      children: "Rooms"
                    }),
                    u && o.jsx(D, {
                      size: "L400",
                      children: `Rooms for "${u.query}"`
                    }),
                    u && u.items.length === 0 && o.jsx(D, {
                      style: {
                        padding: ee.space.S400
                      },
                      size: "T300",
                      align: "Center",
                      children: "No match found!"
                    }),
                    o.jsx("div", {
                      style: {
                        position: "relative",
                        height: m.getTotalSize()
                      },
                      children: v.map((x) => {
                        const S = g[x.index], T = r.getRoom(S);
                        if (!T) return null;
                        const A = l == null ? void 0 : l.includes(S);
                        return o.jsx(Rs, {
                          virtualItem: x,
                          style: {
                            paddingBottom: ee.space.S100
                          },
                          ref: m.measureElement,
                          children: o.jsx(Ye, {
                            "data-room-id": S,
                            onClick: b,
                            variant: A ? "Success" : "Surface",
                            size: "300",
                            radii: "300",
                            "aria-pressed": A,
                            before: o.jsx(Q, {
                              size: "50",
                              src: Sd(q, T.getType(), T.getJoinRule())
                            }),
                            children: o.jsx(D, {
                              truncate: true,
                              size: "T300",
                              children: T.name
                            })
                          })
                        }, x.index);
                      })
                    })
                  ]
                })
              }),
              o.jsx(nr, {
                variant: "Surface",
                size: "300"
              }),
              o.jsxs(E, {
                shrink: "No",
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S200
                },
                children: [
                  o.jsx(xe, {
                    size: "300",
                    variant: "Secondary",
                    radii: "300",
                    onClick: j,
                    children: l && l.length > 0 ? o.jsxs(D, {
                      size: "B300",
                      children: [
                        "Save (",
                        l.length,
                        ")"
                      ]
                    }) : o.jsx(D, {
                      size: "B300",
                      children: "Save"
                    })
                  }),
                  o.jsx(xe, {
                    size: "300",
                    radii: "300",
                    variant: "Secondary",
                    fill: "Soft",
                    onClick: k,
                    disabled: !l || l.length === 0,
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Deselect All"
                    })
                  })
                ]
              })
            ]
          })
        })
      }),
      children: o.jsx(Qe, {
        onClick: C,
        variant: "SurfaceVariant",
        radii: "Pill",
        before: o.jsx(Q, {
          size: "100",
          src: q.PlusCircle
        }),
        children: o.jsx(D, {
          size: "T200",
          children: "Select Rooms"
        })
      })
    });
  }
  function tht({ defaultRoomsFilterName: t, allowGlobal: e, roomList: n, selectedRooms: r, onSelectedRoomsChange: i, global: a, order: s, onGlobalChange: l, onOrderChange: c }) {
    const d = be();
    return o.jsxs(E, {
      direction: "Column",
      gap: "100",
      children: [
        o.jsx(D, {
          size: "L400",
          children: "Filter"
        }),
        o.jsxs(E, {
          gap: "200",
          wrap: "Wrap",
          children: [
            o.jsx(Qe, {
              variant: a ? "Surface" : "Success",
              "aria-pressed": !a,
              before: !a && o.jsx(Q, {
                size: "100",
                src: q.Check
              }),
              outlined: true,
              onClick: () => l(),
              children: o.jsx(D, {
                size: "T200",
                children: t
              })
            }),
            e && o.jsx(Qe, {
              variant: a ? "Success" : "Surface",
              "aria-pressed": a,
              before: a && o.jsx(Q, {
                size: "100",
                src: q.Check
              }),
              outlined: true,
              onClick: () => l(true),
              children: o.jsx(D, {
                size: "T200",
                children: "Global"
              })
            }),
            o.jsx(nr, {
              style: {
                margin: `${ee.space.S100} 0`
              },
              direction: "Vertical",
              variant: "Surface",
              size: "300"
            }),
            r == null ? void 0 : r.map((u) => {
              const h = d.getRoom(u);
              return h ? o.jsx(Qe, {
                variant: "Success",
                onClick: () => i(r.filter((f) => f !== u)),
                radii: "Pill",
                before: o.jsx(Q, {
                  size: "50",
                  src: Sd(q, h.getType(), h.getJoinRule())
                }),
                after: o.jsx(Q, {
                  size: "50",
                  src: q.Cross
                }),
                children: o.jsx(D, {
                  size: "T200",
                  children: h.name
                })
              }, u) : null;
            }),
            o.jsx(eht, {
              roomList: n,
              selectedRooms: r,
              onChange: i
            }),
            o.jsx(E, {
              grow: "Yes",
              "data-spacing-node": true
            }),
            o.jsx(Jut, {
              order: s,
              onChange: c
            })
          ]
        })
      ]
    });
  }
  const nht = (t) => p.useMemo(() => ({
    global: t.get("global") ?? void 0,
    term: t.get("term") ?? void 0,
    order: t.get("order") ?? void 0,
    rooms: t.get("rooms") ?? void 0,
    senders: t.get("senders") ?? void 0
  }), [
    t
  ]);
  function xge({ defaultRoomsFilterName: t, allowGlobal: e, rooms: n, senders: r, scrollRef: i }) {
    var _a6;
    const a = be(), s = Ze(gi), l = $P(a, zr, s), [c] = Fe(ge, "mediaAutoLoad"), [d] = Fe(ge, "urlPreview"), [u] = Fe(ge, "legacyUsernameColor"), [h] = Fe(ge, "hour24Clock"), [f] = Fe(ge, "dateFormatString"), g = p.useRef(null), m = p.useRef(null), [v, y] = fh(), w = nht(v), { navigateRoom: b } = Wi(), j = p.useMemo(() => {
      if (w.rooms) return BA(w.rooms).filter((ne) => l.includes(ne));
    }, [
      l,
      w.rooms
    ]), k = p.useMemo(() => {
      if (w.senders) return BA(w.senders);
    }, [
      w.senders
    ]), C = p.useMemo(() => {
      const ne = w.global === "true" ? void 0 : n;
      return {
        term: w.term,
        order: w.order ?? M2.Recent,
        rooms: j ?? ne,
        senders: k ?? r
      };
    }, [
      w,
      j,
      k,
      n,
      r
    ]), x = Gut(C), { status: S, data: T, error: A, fetchNextPage: B, hasNextPage: U, isFetchingNextPage: z } = bte({
      enabled: !!C.term,
      queryKey: [
        "search",
        C.term,
        C.order,
        C.rooms,
        C.senders
      ],
      queryFn: ({ pageParam: de }) => x(de),
      initialPageParam: "",
      getNextPageParam: (de) => de.nextToken
    }), O = p.useMemo(() => (T == null ? void 0 : T.pages.flatMap((de) => de.groups)) ?? [], [
      T
    ]), M = p.useMemo(() => {
      const de = T == null ? void 0 : T.pages.flatMap((ne) => ne.highlights);
      return Array.from(new Set(de));
    }, [
      T
    ]), I = nc({
      count: O.length,
      getScrollElement: () => i.current,
      estimateSize: () => 40,
      overscan: 1
    }), N = I.getVirtualItems(), L = (de) => {
      y((ne) => {
        const ae = new URLSearchParams(ne);
        return ae.delete("term"), ae.append("term", de), ae;
      });
    }, H = () => {
      g.current && (g.current.value = ""), y((de) => {
        const ne = new URLSearchParams(de);
        return ne.delete("term"), ne;
      });
    }, V = (de) => {
      y((ne) => {
        const ae = new URLSearchParams(ne);
        return ae.delete("rooms"), de && de.length > 0 && ae.append("rooms", JB(de)), ae;
      });
    }, Z = (de) => {
      y((ne) => {
        const ae = new URLSearchParams(ne);
        return ae.delete("global"), de && ae.append("global", "true"), ae;
      });
    }, Y = (de) => {
      y((ne) => {
        const ae = new URLSearchParams(ne);
        return ae.delete("order"), de && ae.append("order", de), ae;
      });
    }, ue = (_a6 = N.at(-1)) == null ? void 0 : _a6.index, ie = O.length - 1;
    return p.useEffect(() => {
      ie > -1 && ie === ue && !z && U && B();
    }, [
      ue,
      ie,
      B,
      z,
      U
    ]), o.jsxs(E, {
      direction: "Column",
      gap: "700",
      children: [
        o.jsx(A3, {
          scrollRef: i,
          anchorRef: m,
          children: o.jsx(Oe, {
            onClick: () => I.scrollToOffset(0),
            variant: "SurfaceVariant",
            radii: "Pill",
            outlined: true,
            size: "300",
            "aria-label": "Scroll to Top",
            children: o.jsx(Q, {
              src: q.ChevronTop,
              size: "300"
            })
          })
        }),
        o.jsxs(E, {
          ref: m,
          direction: "Column",
          gap: "300",
          children: [
            o.jsx(Zut, {
              active: !!C.term,
              loading: S === "pending",
              searchInputRef: g,
              onSearch: L,
              onReset: H
            }),
            o.jsx(tht, {
              defaultRoomsFilterName: t,
              allowGlobal: e,
              roomList: w.global === "true" ? l : n,
              selectedRooms: j,
              onSelectedRoomsChange: V,
              global: w.global === "true",
              onGlobalChange: Z,
              order: C.order,
              onOrderChange: Y
            })
          ]
        }),
        !C.term && S === "pending" && o.jsx(tk, {
          children: o.jsx(Uc, {
            children: o.jsx(Vc, {
              icon: o.jsx(Q, {
                size: "600",
                src: q.Message
              }),
              title: "Search Messages",
              subTitle: "Find helpful messages in your community by searching with related keywords."
            })
          })
        }),
        C.term && O.length === 0 && S === "success" && o.jsxs(E, {
          className: ro({
            variant: "Warning"
          }),
          style: {
            padding: ee.space.S300,
            borderRadius: ee.radii.R400
          },
          alignItems: "Center",
          gap: "200",
          children: [
            o.jsx(Q, {
              size: "200",
              src: q.Info
            }),
            o.jsxs(D, {
              children: [
                "No results found for ",
                o.jsx("b", {
                  children: `"${C.term}"`
                })
              ]
            })
          ]
        }),
        (C.term && S === "pending" || O.length > 0 && N.length === 0) && o.jsx(E, {
          direction: "Column",
          gap: "100",
          children: Array.from({
            length: 8
          }).map(() => o.jsx(Te, {
            variant: "SurfaceVariant",
            style: {
              minHeight: He(80)
            }
          }, crypto.randomUUID()))
        }),
        N.length > 0 && o.jsxs(E, {
          direction: "Column",
          gap: "300",
          children: [
            o.jsxs(E, {
              direction: "Column",
              gap: "200",
              children: [
                o.jsx(D, {
                  size: "H5",
                  children: `Results for "${C.term}"`
                }),
                o.jsx(nr, {
                  size: "300",
                  variant: "Surface"
                })
              ]
            }),
            o.jsx("div", {
              style: {
                position: "relative",
                height: I.getTotalSize()
              },
              children: N.map((de) => {
                const ne = O[de.index];
                if (!ne) return null;
                const ae = a.getRoom(ne.roomId);
                return ae ? o.jsx(Rs, {
                  virtualItem: de,
                  style: {
                    paddingBottom: ee.space.S500
                  },
                  ref: I.measureElement,
                  children: o.jsx(Yut, {
                    room: ae,
                    highlights: M,
                    items: ne.items,
                    mediaAutoLoad: c,
                    urlPreview: d,
                    onOpen: b,
                    legacyUsernameColor: u || s.has(ae.roomId),
                    hour24Clock: h,
                    dateFormatString: f
                  })
                }, de.index) : null;
              })
            }),
            z && o.jsx(E, {
              justifyContent: "Center",
              alignItems: "Center",
              children: o.jsx(dt, {
                size: "600",
                variant: "Secondary"
              })
            })
          ]
        }),
        A && o.jsxs(E, {
          className: ro({
            variant: "Critical"
          }),
          style: {
            padding: ee.space.S300,
            borderRadius: ee.radii.R400
          },
          direction: "Column",
          gap: "200",
          children: [
            o.jsx(D, {
              size: "L400",
              children: A.name
            }),
            o.jsx(D, {
              size: "T300",
              children: A.message
            })
          ]
        })
      ]
    });
  }
  function rht() {
    const t = p.useRef(null), e = B3(), n = fr();
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          balance: true,
          children: o.jsxs(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No",
                children: n === sn.Mobile && o.jsx(ic, {
                  children: (r) => o.jsx(Oe, {
                    onClick: r,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsxs(E, {
                justifyContent: "Center",
                alignItems: "Center",
                gap: "200",
                children: [
                  n !== sn.Mobile && o.jsx(Q, {
                    size: "400",
                    src: q.Search
                  }),
                  o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: "Message Search"
                  })
                ]
              }),
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              })
            ]
          })
        }),
        o.jsx(E, {
          style: {
            position: "relative"
          },
          grow: "Yes",
          children: o.jsx(dn, {
            ref: t,
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsx(xge, {
                  defaultRoomsFilterName: "Home",
                  allowGlobal: true,
                  rooms: e,
                  scrollRef: t
                })
              })
            })
          })
        })
      ]
    });
  }
  const iht = (t, e) => {
    const n = be();
    return p.useMemo(() => {
      const i = ml(e) ? eF(n, e) : e;
      if (i && t.includes(i)) return i;
    }, [
      n,
      t,
      e
    ]);
  };
  var oht = "style_CardGrid__8jk8sn0", aht = "style_RoomCardBase__8jk8sn1 _1mqalmd1 _1mqalmd0 ContainerColor_ContainerColor__15396tl0 ContainerColor_ContainerColor_variant_SurfaceVariant__15396tl3", sht = "style_RoomCardItems__8jk8sn2", lht = "style_RoomCardTopic__8jk8sn3", aQ = "style_ActionButton__8jk8sn4", sQ = Jr({
    defaultClassName: "style_RoomCardBanner__8jk8sn5",
    variantClassNames: {
      trueBanner: {
        true: "style_RoomCardBanner_trueBanner_true__8jk8sn6",
        false: "style_RoomCardBanner_trueBanner_false__8jk8sn7"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), cht = "style_RoomCardAvatar__8jk8sn8";
  const dht = (t) => t <= 498 ? "1" : t <= 748 ? "2" : "3", uht = (t, e) => {
    t.style.setProperty("grid-template-columns", `repeat(${e}, 1fr)`);
  };
  function ME({ children: t }) {
    const e = p.useRef(null);
    return gp(p.useCallback(() => e.current, []), p.useCallback((n, r, i) => uht(i, dht(n)), [])), o.jsx(E, {
      className: oht,
      direction: "Row",
      gap: "400",
      wrap: "Wrap",
      ref: e,
      children: t
    });
  }
  const wge = ft(({ className: t, ...e }, n) => o.jsx(E, {
    direction: "Column",
    className: gt(aht, t),
    ...e,
    ref: n
  })), hht = ft(({ children: t, ...e }, n) => o.jsx(D, {
    as: "h6",
    size: "H6",
    truncate: true,
    ...e,
    ref: n,
    children: t
  })), fht = ft(({ children: t, className: e, ...n }, r) => o.jsx(D, {
    as: "p",
    size: "T200",
    className: gt(lht, e),
    ...n,
    priority: "400",
    ref: r,
    children: t
  }));
  function mht({ title: t, message: e, children: n }) {
    const [r, i] = p.useState(false), a = () => i(false), s = () => i(true);
    return o.jsxs(o.Fragment, {
      children: [
        n(s),
        o.jsx(Hn, {
          open: r,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                clickOutsideDeactivates: true,
                onDeactivate: a,
                escapeDeactivates: kt
              },
              children: o.jsx(lr, {
                variant: "Surface",
                children: o.jsxs(E, {
                  style: {
                    padding: ee.space.S400
                  },
                  direction: "Column",
                  gap: "400",
                  children: [
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx(D, {
                          children: t
                        }),
                        o.jsx(D, {
                          style: {
                            color: ct.Critical.Main
                          },
                          size: "T300",
                          priority: "400",
                          children: e
                        })
                      ]
                    }),
                    o.jsx(xe, {
                      size: "400",
                      variant: "Secondary",
                      fill: "Soft",
                      onClick: a,
                      children: o.jsx(D, {
                        size: "B400",
                        children: "Cancel"
                      })
                    })
                  ]
                })
              })
            })
          })
        })
      ]
    });
  }
  const OE = ft(({ roomIdOrAlias: t, allRooms: e, avatarUrl: n, name: r, topic: i, memberCount: a, roomType: s, joinRule: l, viaServers: c, onView: d, renderTopicViewer: u, ...h }, f) => {
    var _a6, _b3;
    const g = be(), m = hn(), v = iht(e, t), y = g.getRoom(v), [w, b] = p.useState(() => y ? ni(y, ce.RoomTopic) : void 0), [j, k] = p.useState(false), C = _n(t) ?? t, x = t, S = y ? Sa(g, y, 96, m) : n && Cn(g, n, m, 96, 96, "crop"), A = (_b3 = (_a6 = y ? ni(y, Pn.RoomBanner) : void 0) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.url, B = Cn(g, A ?? "", true), U = (y == null ? void 0 : y.name) || r || C, z = (w == null ? void 0 : w.getContent().topic) || void 0 || i || x, O = (y == null ? void 0 : y.getJoinedMemberCount()) ?? a;
    vl(g, p.useCallback((Y) => {
      y && Y.getRoomId() === y.roomId && Y.getType() === ce.RoomTopic && b(ni(y, ce.RoomTopic));
    }, [
      y
    ]));
    const [M, I] = Et(p.useCallback(() => g.joinRoom(t, {
      viaServers: c
    }), [
      g,
      t,
      c
    ])), N = M.status === ve.Loading || M.status === ve.Success, [L, H] = p.useState(false), V = () => H(false), Z = () => H(true);
    return o.jsxs(wge, {
      ...h,
      ref: f,
      children: [
        o.jsxs(E, {
          style: {
            height: He(120)
          },
          direction: "Column",
          children: [
            !B && !S ? o.jsx("span", {
              className: sQ({
                trueBanner: false
              }),
              style: {
                backgroundColor: _p(t)
              }
            }) : o.jsx("img", {
              className: sQ({
                trueBanner: !!B
              }),
              src: B || S || void 0,
              alt: `${r} cover`,
              draggable: "false"
            }),
            o.jsx(xn, {
              className: cht,
              size: "500",
              children: o.jsx(yi, {
                roomId: t,
                src: S ?? void 0,
                alt: t,
                renderFallback: () => o.jsx(D, {
                  as: "span",
                  size: "H3",
                  children: Vi(U)
                })
              })
            })
          ]
        }),
        o.jsxs(E, {
          className: sht,
          direction: "Column",
          gap: "300",
          children: [
            o.jsxs(E, {
              gap: "200",
              justifyContent: "SpaceBetween",
              children: [
                o.jsxs(E, {
                  grow: "Yes",
                  direction: "Column",
                  gap: "100",
                  children: [
                    o.jsx(hht, {
                      children: U
                    }),
                    o.jsx(fht, {
                      onClick: Z,
                      onKeyDown: Vb(Z),
                      tabIndex: 0,
                      children: z
                    })
                  ]
                }),
                o.jsx(Hn, {
                  open: L,
                  backdrop: o.jsx($n, {}),
                  children: o.jsx(Wn, {
                    children: o.jsx(Ft, {
                      focusTrapOptions: {
                        initialFocus: false,
                        clickOutsideDeactivates: true,
                        onDeactivate: V,
                        escapeDeactivates: kt
                      },
                      children: u(U, z, V)
                    })
                  })
                }),
                (s === Bo.Space || (y == null ? void 0 : y.isSpaceRoom())) && o.jsx(Rn, {
                  variant: "Secondary",
                  fill: "Soft",
                  outlined: true,
                  children: o.jsx(D, {
                    size: "L400",
                    children: "Space"
                  })
                })
              ]
            }),
            typeof O == "number" && o.jsxs(E, {
              gap: "100",
              children: [
                o.jsx(Q, {
                  size: "50",
                  src: q.User
                }),
                o.jsx(D, {
                  size: "T200",
                  children: `${UO(O)} Members`
                })
              ]
            }),
            typeof v == "string" && o.jsx(xe, {
              onClick: d ? () => d(v) : void 0,
              variant: "Secondary",
              fill: "Soft",
              size: "300",
              children: o.jsx(D, {
                size: "B300",
                truncate: true,
                children: "View"
              })
            }),
            typeof v != "string" && M.status !== ve.Error && (l === kn.Knock ? o.jsxs(o.Fragment, {
              children: [
                o.jsx(xe, {
                  onClick: () => k(true),
                  variant: "Secondary",
                  size: "300",
                  children: o.jsx(D, {
                    size: "B300",
                    truncate: true,
                    children: "Knock"
                  })
                }),
                j && o.jsx(jme, {
                  roomId: t,
                  via: c,
                  onDone: () => k(false),
                  onCancel: () => k(false)
                })
              ]
            }) : o.jsx(xe, {
              onClick: I,
              variant: "Secondary",
              size: "300",
              disabled: N,
              before: N && o.jsx(dt, {
                size: "50",
                variant: "Secondary",
                fill: "Soft"
              }),
              children: o.jsx(D, {
                size: "B300",
                truncate: true,
                children: N ? "Joining" : "Join"
              })
            })),
            typeof v != "string" && M.status === ve.Error && o.jsxs(E, {
              gap: "200",
              children: [
                o.jsx(xe, {
                  onClick: I,
                  className: aQ,
                  variant: "Critical",
                  fill: "Solid",
                  size: "300",
                  children: o.jsx(D, {
                    size: "B300",
                    truncate: true,
                    children: "Retry"
                  })
                }),
                o.jsx(mht, {
                  title: "Join Error",
                  message: M.error.message || "Failed to join. Unknown Error.",
                  children: (Y) => o.jsx(xe, {
                    onClick: Y,
                    className: aQ,
                    variant: "Critical",
                    fill: "Soft",
                    outlined: true,
                    size: "300",
                    children: o.jsx(D, {
                      size: "B300",
                      truncate: true,
                      children: "View Error"
                    })
                  })
                })
              ]
            })
          ]
        })
      ]
    });
  });
  function Ib({ roomIdOrAlias: t, eventId: e, viaServers: n }) {
    const r = be(), i = Ze(zr), { navigateRoom: a, navigateSpace: s } = Wi(), l = fr(), c = (d) => {
      var _a6;
      if ((_a6 = r.getRoom(d)) == null ? void 0 : _a6.isSpaceRoom()) {
        s(d);
        return;
      }
      a(d, e);
    };
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          balance: true,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                shrink: "No",
                children: l === sn.Mobile && o.jsx(ic, {
                  children: (d) => o.jsx(Oe, {
                    onClick: d,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsx(E, {
                grow: "Yes",
                justifyContent: "Center",
                alignItems: "Center",
                gap: "200",
                children: o.jsx(D, {
                  size: "H3",
                  truncate: true,
                  children: t
                })
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            size: "0",
            children: o.jsx(E, {
              style: {
                height: "100%"
              },
              grow: "Yes",
              alignItems: "Center",
              justifyContent: "Center",
              children: o.jsx(O8, {
                roomIdOrAlias: t,
                children: (d) => o.jsx(OE, {
                  style: {
                    maxWidth: He(364),
                    width: "100%"
                  },
                  roomIdOrAlias: t,
                  allRooms: i,
                  avatarUrl: d == null ? void 0 : d.avatar_url,
                  name: d == null ? void 0 : d.name,
                  topic: d == null ? void 0 : d.topic,
                  memberCount: d == null ? void 0 : d.num_joined_members,
                  roomType: d == null ? void 0 : d.room_type,
                  joinRule: d == null ? void 0 : d.join_rule,
                  viaServers: n,
                  renderTopicViewer: (u, h, f) => o.jsx(Vf, {
                    name: u,
                    topic: h,
                    requestClose: f
                  }),
                  onView: c
                })
              })
            })
          })
        })
      ]
    });
  }
  const ght = (t) => ({
    viaServers: t.get("viaServers") ?? void 0
  }), pht = (t) => ({
    userId: t.get("userId") ?? void 0
  }), mL = () => {
    const [t] = fh(), e = p.useMemo(() => ght(t), [
      t
    ]);
    return e.viaServers ? BA(e.viaServers) : void 0;
  };
  function Fht({ children: t }) {
    const e = be(), [n] = Fe(ge, "isShowingAllRoomsInHome"), r = B3(), { roomIdOrAlias: i, eventId: a } = Fl(), s = i && decodeURIComponent(i), l = a && decodeURIComponent(a), c = mL(), d = oc(), u = e.getRoom(d);
    return !u || !n && !r.includes(u.roomId) ? o.jsx(Ib, {
      roomIdOrAlias: s,
      eventId: l,
      viaServers: c
    }) : o.jsx(dp, {
      value: u,
      children: o.jsx(wE, {
        value: false,
        children: t
      })
    }, u.roomId);
  }
  const vht = () => !!Ko({
    path: eP(),
    caseSensitive: true,
    end: false
  }), _ht = () => !!Ko({
    path: kk(),
    caseSensitive: true,
    end: false
  }), yht = p.forwardRef(({ requestClose: t }, e) => {
    const n = be(), [r] = Fe(ge, "hideReads"), i = uv(), a = wh(i, qi), s = () => {
      a && (i.forEach((l) => As(n, l, r)), t());
    };
    return o.jsx(tn, {
      ref: e,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: o.jsx(E, {
        direction: "Column",
        gap: "100",
        style: {
          padding: ee.space.S100
        },
        children: o.jsx(Ye, {
          onClick: s,
          size: "300",
          after: o.jsx(Q, {
            size: "100",
            src: q.CheckTwice
          }),
          radii: "300",
          "aria-disabled": !a,
          children: o.jsx(D, {
            style: {
              flexGrow: 1
            },
            as: "span",
            size: "T300",
            truncate: true,
            children: "Mark as Read"
          })
        })
      })
    });
  });
  function bht({ hideText: t }) {
    const [e, n] = p.useState(), r = (i) => {
      const a = i.currentTarget.getBoundingClientRect();
      n((s) => {
        if (!s) return a;
      });
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Kf, {
          size: "600",
          children: t ? o.jsx(E, {
            alignItems: "Center",
            grow: "Yes",
            justifyContent: "Center",
            children: o.jsx(Oe, {
              "aria-pressed": !!e,
              variant: "Background",
              onClick: r,
              children: o.jsx(Q, {
                src: q.User,
                size: "200",
                filled: !!e
              })
            })
          }) : o.jsxs(E, {
            grow: "Yes",
            gap: "300",
            children: [
              o.jsx(E, {
                grow: "Yes",
                alignItems: "Center",
                children: o.jsx(D, {
                  size: "H4",
                  truncate: true,
                  children: "Direct Messages"
                })
              }),
              o.jsx(E, {
                shrink: "No",
                children: o.jsx(Oe, {
                  "aria-pressed": !!e,
                  variant: "Background",
                  onClick: r,
                  children: o.jsx(Q, {
                    src: q.VerticalDots,
                    size: "200",
                    filled: !!e
                  })
                })
              })
            ]
          })
        }),
        o.jsx(ln, {
          anchor: e,
          position: "Bottom",
          align: "End",
          offset: 6,
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => n(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (i) => i.key === "ArrowDown",
              isKeyBackward: (i) => i.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(yht, {
              requestClose: () => n(void 0)
            })
          })
        })
      ]
    });
  }
  function xht() {
    const t = br();
    return o.jsx(mge, {
      children: o.jsx(gge, {
        icon: o.jsx(Q, {
          size: "600",
          src: q.Mention
        }),
        title: o.jsx(D, {
          size: "H5",
          align: "Center",
          children: "No Direct Messages"
        }),
        content: o.jsx(D, {
          size: "T300",
          align: "Center",
          children: "You do not have any direct messages yet."
        }),
        options: o.jsx(xe, {
          variant: "Secondary",
          size: "300",
          onClick: () => t(kk()),
          children: o.jsx(D, {
            size: "B300",
            truncate: true,
            children: "Direct Message"
          })
        })
      })
    });
  }
  const JT = v2("direct", "direct");
  function wht() {
    const t = be();
    I3("direct");
    const e = p.useRef(null), n = uv(), r = h3(), i = Ze(qi), a = br(), [s] = Fe(ge, "customDMCards"), [l, c] = Fe(ge, "roomSidebarWidth"), [d, u] = p.useState(l);
    p.useEffect(() => {
      u(l);
    }, [
      l
    ]);
    const [h] = Fe(ge, "joinCallOnSingleClick"), f = _ht(), g = oc(), m = n.length === 0, [v, y] = Fr(fL()), [w, b] = p.useState(0), j = p.useRef(n);
    j.current = n, p.useEffect(() => {
      const B = () => {
        b((U) => U + 1);
      };
      return j.current.forEach((U) => {
        var _a6;
        (_a6 = t.getRoom(U)) == null ? void 0 : _a6.on(mt.Timeline, B);
      }), () => {
        j.current.forEach((U) => {
          var _a6;
          (_a6 = t.getRoom(U)) == null ? void 0 : _a6.off(mt.Timeline, B);
        });
      };
    }, [
      t,
      n
    ]);
    const k = p.useMemo(() => {
      const B = Array.from(n).toSorted(Ku(t)), U = (z) => {
        const O = i.get(z);
        return !!O && (O.total > 0 || O.highlight > 0);
      };
      return v.has(JT) ? B.filter((z) => U(z) || z === g) : B;
    }, [
      t,
      n,
      v,
      i,
      g,
      w
    ]), C = nc({
      count: k.length,
      getScrollElement: () => e.current,
      estimateSize: () => 38,
      overscan: 10
    }), x = BS(y, (B) => v.has(B)), T = fr() === sn.Mobile, A = d <= 80 && !T;
    return o.jsxs(E, {
      shrink: "No",
      style: {
        position: "relative",
        width: T ? "100%" : He(d)
      },
      children: [
        o.jsxs(qf, {
          children: [
            o.jsx(bht, {
              hideText: A
            }),
            m ? o.jsx(xht, {}) : o.jsx(mh, {
              scrollRef: e,
              children: o.jsxs(E, {
                direction: "Column",
                gap: "300",
                children: [
                  o.jsx(ch, {
                    children: o.jsx(Is, {
                      variant: "Background",
                      radii: "400",
                      "aria-selected": f,
                      children: o.jsx(_F, {
                        onClick: () => a(kk()),
                        children: o.jsx(Bs, {
                          children: o.jsxs(E, {
                            as: "span",
                            grow: "Yes",
                            alignItems: "Center",
                            gap: "200",
                            justifyContent: "Center",
                            children: [
                              o.jsx(xn, {
                                size: "200",
                                radii: "400",
                                children: o.jsx(Q, {
                                  src: q.Plus,
                                  size: "100"
                                })
                              }),
                              !A && o.jsx(E, {
                                as: "span",
                                grow: "Yes",
                                children: o.jsx(D, {
                                  as: "span",
                                  size: "Inherit",
                                  truncate: true,
                                  children: "Create Chat"
                                })
                              })
                            ]
                          })
                        })
                      })
                    })
                  }),
                  o.jsxs(ch, {
                    children: [
                      o.jsx(MS, {
                        children: o.jsx(hL, {
                          closed: v.has(JT),
                          "data-category-id": JT,
                          onClick: x,
                          children: !A && "Chats"
                        })
                      }),
                      o.jsx("div", {
                        style: {
                          position: "relative",
                          height: C.getTotalSize(),
                          overflow: "clip"
                        },
                        children: C.getVirtualItems().map((B) => {
                          const U = k[B.index];
                          if (!U) return null;
                          const z = t.getRoom(U);
                          if (!z) return null;
                          const O = g === U;
                          return o.jsx(Rs, {
                            virtualItem: B,
                            ref: C.measureElement,
                            children: o.jsx("div", {
                              style: A ? {
                                padding: "0",
                                width: "100%",
                                aspectRatio: 1,
                                display: "flex",
                                flexDirection: "column"
                              } : {},
                              children: o.jsx(uL, {
                                room: z,
                                selected: O,
                                showAvatar: true,
                                direct: true,
                                customDMCards: s,
                                hideText: A,
                                linkPath: xp(wi(t, U)),
                                notificationMode: Xk(r, z.roomId),
                                joinCallOnSingleClick: h
                              })
                            })
                          }, B.index);
                        })
                      })
                    ]
                  })
                ]
              })
            })
          ]
        }),
        !T && o.jsx(Zl, {
          setCurWidth: u,
          sidebarWidth: l,
          setSidebarWidth: c,
          instep: 80,
          outstep: 190,
          minValue: 50,
          maxValue: 500
        })
      ]
    });
  }
  function Dht({ children: t }) {
    const e = be(), n = uv(), { roomIdOrAlias: r, eventId: i } = Fl(), a = r && decodeURIComponent(r), s = i && decodeURIComponent(i), l = oc(), c = e.getRoom(l);
    return !c || !n.includes(c.roomId) ? o.jsx(Ib, {
      roomIdOrAlias: a,
      eventId: s
    }) : o.jsx(dp, {
      value: c,
      children: o.jsx(wE, {
        value: true,
        children: t
      })
    }, c.roomId);
  }
  function Cht({ defaultUserId: t }) {
    const e = be(), n = Kr(), r = br(), [i, a] = p.useState(true), [s, l] = p.useState(false), [c, d] = Et(p.useCallback(async (m, v) => {
      const y = [];
      v && y.push(HO());
      const w = await e.createRoom({
        is_direct: true,
        invite: [
          m
        ],
        visibility: s1.Private,
        preset: Yb.TrustedPrivateChat,
        initial_state: y,
        creation_content: {
          additional_creators: [
            m
          ]
        }
      });
      return c4(e, w.room_id, m), w.room_id;
    }, [
      e
    ])), u = c.status === ve.Loading, h = c.status === ve.Error ? c.error : void 0, f = c.status === ve.Loading, g = (m) => {
      var _a6;
      m.preventDefault(), l(false);
      const y = (_a6 = m.target) == null ? void 0 : _a6.userIdInput, w = y == null ? void 0 : y.value.trim();
      if (!(!y || !w)) {
        if (!co(w)) {
          l(true);
          return;
        }
        d(w, i).then((b) => {
          n() && (y.value = "", r(xp(b)));
        });
      }
    };
    return o.jsxs(E, {
      as: "form",
      onSubmit: g,
      grow: "Yes",
      direction: "Column",
      gap: "500",
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "User ID"
            }),
            o.jsx(mn, {
              defaultValue: t,
              placeholder: "@username:server",
              name: "userIdInput",
              variant: "SurfaceVariant",
              size: "500",
              radii: "400",
              required: true,
              autoFocus: true,
              autoComplete: "off",
              disabled: f
            }),
            s && o.jsxs(E, {
              style: {
                color: ct.Critical.Main
              },
              alignItems: "Center",
              gap: "100",
              children: [
                o.jsx(Q, {
                  src: q.Warning,
                  filled: true,
                  size: "50"
                }),
                o.jsx(D, {
                  size: "T200",
                  style: {
                    color: ct.Critical.Main
                  },
                  children: o.jsx("b", {
                    children: "Please enter a valid User ID."
                  })
                })
              ]
            })
          ]
        }),
        o.jsxs(E, {
          shrink: "No",
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Options"
            }),
            o.jsx(Te, {
              style: {
                padding: ee.space.S300
              },
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "500",
              children: o.jsx(Ie, {
                title: "End-to-End Encryption",
                description: "Once this feature is enabled, it can't be disabled after the room is created.",
                after: o.jsx(Jt, {
                  variant: "Primary",
                  value: i,
                  onChange: a,
                  disabled: f
                })
              })
            })
          ]
        }),
        h && o.jsxs(E, {
          style: {
            color: ct.Critical.Main
          },
          alignItems: "Center",
          gap: "200",
          children: [
            o.jsx(Q, {
              src: q.Warning,
              filled: true,
              size: "100"
            }),
            o.jsx(D, {
              size: "T300",
              style: {
                color: ct.Critical.Main
              },
              children: o.jsx("b", {
                children: h instanceof Un && h.name === vo.M_LIMIT_EXCEEDED ? `Server rate-limited your request for ${A7(h.data.retry_after_ms ?? 0)} minutes!` : h.message
              })
            })
          ]
        }),
        o.jsx(E, {
          shrink: "No",
          direction: "Column",
          gap: "200",
          children: o.jsx(xe, {
            type: "submit",
            size: "500",
            variant: "Primary",
            radii: "400",
            disabled: f,
            before: u && o.jsx(dt, {
              variant: "Primary",
              fill: "Solid",
              size: "200"
            }),
            children: o.jsx(D, {
              size: "B500",
              children: "Create"
            })
          })
        })
      ]
    });
  }
  function Eht() {
    const t = be(), e = fr(), n = br(), [r] = fh(), { userId: i } = pht(r), a = uv();
    return p.useEffect(() => {
      var _a6;
      if (i) {
        const s = (_a6 = vie(t, i)) == null ? void 0 : _a6.roomId;
        s && a.includes(s) && n(xp(s), {
          replace: true
        });
      }
    }, [
      t,
      n,
      a,
      i
    ]), o.jsxs(si, {
      children: [
        e === sn.Mobile && o.jsx(_i, {
          balance: true,
          outlined: false,
          children: o.jsx(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: o.jsx(ic, {
              children: (s) => o.jsx(Oe, {
                onClick: s,
                children: o.jsx(Q, {
                  src: q.ArrowLeft
                })
              })
            })
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsx(Uc, {
                  children: o.jsxs(E, {
                    direction: "Column",
                    gap: "700",
                    children: [
                      o.jsx(Vc, {
                        icon: o.jsx(Q, {
                          size: "600",
                          src: q.Mention
                        }),
                        title: "Create Chat",
                        subTitle: "Start a private, encrypted chat by entering a user ID."
                      }),
                      o.jsx(Cht, {
                        defaultUserId: i
                      })
                    ]
                  })
                })
              })
            })
          })
        })
      ]
    });
  }
  function kht({ children: t }) {
    const e = be(), n = HP(e, zr), { spaceIdOrAlias: r } = Fl(), i = r && decodeURIComponent(r), a = mL(), s = $k(), l = e.getRoom(s);
    return !l || !n.includes(l.roomId) ? o.jsx(Ib, {
      roomIdOrAlias: i ?? "",
      viaServers: a
    }) : o.jsx(WF, {
      value: l,
      children: t
    }, l.roomId);
  }
  function Sht({ room: t, selected: e, linkPath: n, hideText: r }) {
    const [i, a] = p.useState(), l = rc(t), c = br(), d = (f) => {
      f.preventDefault(), a({
        x: f.clientX,
        y: f.clientY,
        width: 0,
        height: 0
      });
    }, u = () => {
      c(n);
    }, h = [
      l,
      "Space"
    ].flat().filter(Boolean).join(", ");
    return o.jsx(E, {
      direction: "Column",
      grow: "Yes",
      children: o.jsx(Is, {
        variant: "Background",
        radii: "400",
        highlight: false,
        "aria-selected": e,
        "data-hover": !!i,
        onContextMenu: d,
        children: o.jsx(_F, {
          onClick: u,
          "aria-label": h,
          children: o.jsx(Bs, {
            children: o.jsxs(E, {
              as: "span",
              grow: "Yes",
              alignItems: "Center",
              gap: "200",
              style: {
                padding: r ? "0" : "1"
              },
              children: [
                o.jsx(xn, {
                  size: "200",
                  radii: "400",
                  children: o.jsx(Q, {
                    src: q.Space,
                    style: {
                      opacity: ee.opacity.P300
                    },
                    filled: e,
                    size: "100"
                  })
                }),
                !r && o.jsx(E, {
                  as: "span",
                  grow: "Yes",
                  children: o.jsx(D, {
                    priority: "300",
                    as: "span",
                    size: "Inherit",
                    truncate: true,
                    children: l
                  })
                })
              ]
            })
          })
        })
      })
    });
  }
  const jht = vn((t) => {
    const e = t(vi), n = /* @__PURE__ */ new Map();
    return e.forEach((r, i) => {
      r.forEach((a) => {
        var _a6;
        n.has(a) || n.set(a, /* @__PURE__ */ new Set()), (_a6 = n.get(a)) == null ? void 0 : _a6.add(i);
      });
    }), n;
  });
  var Tht = "styles_RoomCoverHeaderContainer__11fc96u0", Rht = "styles_RoomCoverNavContainer__11fc96u1", Aht = Jr({
    defaultClassName: "styles_RoomCoverlessNavContainer__11fc96u2",
    variantClassNames: {
      hideText: {
        true: "styles_RoomCoverlessNavContainer_hideText_true__11fc96u3",
        false: "styles_RoomCoverlessNavContainer_hideText_false__11fc96u4"
      }
    },
    defaultVariants: {},
    compoundVariants: []
  }), Iht = "styles_RoomCoverContainer__11fc96u5", Bht = "styles_RoomCover__11fc96u6", Pht = "styles_RoomCoverImage__11fc96u8";
  const Mht = fo("Space"), Oht = p.forwardRef(({ room: t, requestClose: e }, n) => {
    const r = be(), [i] = Fe(ge, "hideReads"), [a] = Fe(ge, "developerTools"), s = Ze(vi), l = Mo(t), c = ri(t), u = Ki(c, l).action("invite", r.getSafeUserId()), h = lv(), { navigateRoom: f } = Wi(), [g, m] = p.useState(false), v = Zk(zr, t.roomId, fse(r, s)), y = wh(v, qi), w = () => {
      v.forEach((x) => As(r, x, i)), e();
    }, b = () => {
      const x = wi(r, t.roomId), S = ml(x) ? void 0 : Xc(t);
      Jo(JE(x, S)), e();
    }, j = () => {
      m(true);
    }, k = () => {
      h(t.roomId), e();
    }, C = () => {
      Mht.info("ui", "Space timeline opened", {
        roomId: t.roomId
      }), f(t.roomId), e();
    };
    return o.jsxs(tn, {
      ref: n,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: [
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            g && t && o.jsx(Pp, {
              room: t,
              requestClose: () => {
                m(false), e();
              }
            }),
            o.jsx(Ye, {
              onClick: w,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.CheckTwice
              }),
              radii: "300",
              disabled: !y,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Mark as Read"
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: j,
              variant: "Primary",
              fill: "None",
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.UserPlus
              }),
              radii: "300",
              "aria-pressed": g,
              disabled: !u,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Invite"
              })
            }),
            o.jsx(Ye, {
              onClick: b,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Link
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Copy Link"
              })
            }),
            o.jsx(Ye, {
              onClick: k,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Setting
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Space Settings"
              })
            }),
            a && o.jsx(Ye, {
              onClick: C,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Terminal
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Event Timeline"
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: o.jsx(Hi, {
            initial: false,
            children: (x, S) => o.jsxs(o.Fragment, {
              children: [
                o.jsx(Ye, {
                  onClick: () => S(true),
                  variant: "Critical",
                  fill: "None",
                  size: "300",
                  after: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowGoLeft
                  }),
                  radii: "300",
                  "aria-pressed": x,
                  children: o.jsx(D, {
                    style: {
                      flexGrow: 1
                    },
                    as: "span",
                    size: "T300",
                    truncate: true,
                    children: "Leave Space"
                  })
                }),
                x && o.jsx(sL, {
                  roomId: t.roomId,
                  onDone: e,
                  onCancel: () => S(false)
                })
              ]
            })
          })
        })
      ]
    });
  });
  function Lht({ hideText: t, mx: e }) {
    var _a6, _b3, _c3;
    const n = im(), r = rc(n), [i, a] = p.useState(), s = hn(), l = (_a6 = $i(n, ce.RoomJoinRules)) == null ? void 0 : _a6.getContent(), c = (k) => {
      const C = k.currentTarget.getBoundingClientRect();
      a((x) => {
        if (!x) return C;
      });
    }, [d] = Fe(ge, "showRoomBanners"), [u, h] = Fe(ge, "roomBannerHeight"), [f, g] = p.useState(u);
    p.useEffect(() => {
      g(u);
    }, [
      u
    ]);
    const v = (_c3 = (_b3 = $i(n, Pn.RoomBanner)) == null ? void 0 : _b3.getContent()) == null ? void 0 : _c3.url, y = Cn(e, v ?? "", true), w = !!(y && !t && d), [b, j] = p.useState(false);
    return p.useEffect(() => {
      w || j(false);
    }, [
      w
    ]), o.jsxs(o.Fragment, {
      children: [
        o.jsx("div", {
          className: w ? Tht : "",
          children: o.jsxs("div", {
            className: w ? Rht : Aht({
              hideText: t
            }),
            children: [
              o.jsx(Kf, {
                outlined: !w,
                size: "600",
                children: t ? o.jsx(E, {
                  alignItems: "Center",
                  grow: "Yes",
                  justifyContent: "Center",
                  children: o.jsx(xn, {
                    size: t ? void 0 : "200",
                    radii: "400",
                    onClick: c,
                    children: o.jsx(yi, {
                      roomId: n.roomId,
                      src: Sa(e, n, 96, s),
                      uniformIcons: true,
                      alt: r,
                      renderFallback: () => o.jsx(D, {
                        as: "span",
                        size: "H6",
                        children: Vi(r)
                      })
                    })
                  })
                }) : o.jsxs(E, {
                  grow: "Yes",
                  gap: "300",
                  children: [
                    o.jsxs(E, {
                      grow: "Yes",
                      alignItems: "Center",
                      gap: "100",
                      style: w ? {
                        color: "#fff"
                      } : {},
                      children: [
                        o.jsx(D, {
                          size: "H4",
                          truncate: true,
                          children: r
                        }),
                        (l == null ? void 0 : l.join_rule) !== kn.Public && o.jsx(Q, {
                          src: q.Lock,
                          size: "50"
                        })
                      ]
                    }),
                    o.jsx(E, {
                      shrink: "No",
                      children: o.jsx(Oe, {
                        "aria-pressed": !!i,
                        variant: "Background",
                        style: w ? {
                          backgroundColor: "#0000",
                          color: "#fff"
                        } : {},
                        onClick: c,
                        children: o.jsx(Q, {
                          src: q.VerticalDots,
                          size: "200"
                        })
                      })
                    })
                  ]
                })
              }),
              i && o.jsx(ln, {
                anchor: i,
                position: "Bottom",
                align: "End",
                offset: 6,
                content: o.jsx(Ft, {
                  focusTrapOptions: {
                    initialFocus: false,
                    returnFocusOnDeactivate: false,
                    onDeactivate: () => a(void 0),
                    clickOutsideDeactivates: true,
                    isKeyForward: (k) => k.key === "ArrowDown",
                    isKeyBackward: (k) => k.key === "ArrowUp",
                    escapeDeactivates: kt
                  },
                  children: o.jsx(Oht, {
                    room: n,
                    requestClose: () => a(void 0)
                  })
                })
              })
            ]
          })
        }),
        w && o.jsx(o.Fragment, {
          children: o.jsx(E, {
            shrink: "No",
            className: Iht,
            style: {
              height: He(f)
            },
            children: o.jsxs(rp, {
              src: y,
              className: Bht,
              children: [
                o.jsx("img", {
                  className: Pht,
                  src: y,
                  alt: `${r}'s banner`,
                  draggable: "false",
                  role: "button",
                  tabIndex: 0,
                  "aria-label": `View ${r} banner`,
                  onClick: () => j(true),
                  onKeyDown: (k) => {
                    (k.key === "Enter" || k.key === " ") && (k.preventDefault(), j(true));
                  }
                }),
                o.jsx(Zl, {
                  setCurWidth: g,
                  sidebarWidth: u,
                  setSidebarWidth: h,
                  instep: 56,
                  outstep: 66,
                  minValue: 56,
                  maxValue: 500,
                  topSided: true
                })
              ]
            })
          })
        }),
        w && b && o.jsx(Hn, {
          open: true,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                onDeactivate: () => j(false),
                clickOutsideDeactivates: true,
                escapeDeactivates: kt
              },
              children: o.jsx(Go, {
                className: OF,
                size: "500",
                onContextMenu: (k) => k.stopPropagation(),
                children: o.jsx(Yc, {
                  src: y,
                  alt: `${r} banner`,
                  requestClose: () => j(false)
                })
              })
            })
          })
        })
      ]
    });
  }
  function Nht({ roomId: t, replacementRoomId: e }) {
    var _a6;
    const n = be(), { navigateSpace: r } = Wi(), [i, a] = Et(p.useCallback(() => {
      const c = n.getRoom(t), d = c ? Xc(c) : [];
      return n.joinRoom(e, {
        viaServers: d
      });
    }, [
      n,
      t,
      e
    ])), s = n.getRoom(e), l = () => {
      s && r(s.roomId), i.status === ve.Success && r(i.data.roomId);
    };
    return o.jsxs(E, {
      style: {
        padding: ee.space.S200,
        borderRadius: ee.radii.R400,
        borderWidth: ee.borderWidth.B300
      },
      className: ro({
        variant: "Surface"
      }),
      direction: "Column",
      gap: "300",
      children: [
        o.jsxs(E, {
          direction: "Column",
          grow: "Yes",
          gap: "100",
          children: [
            o.jsx(D, {
              size: "L400",
              children: "Space Upgraded"
            }),
            o.jsx(D, {
              size: "T200",
              children: "This space has been replaced and is no longer active."
            }),
            i.status === ve.Error && o.jsx(D, {
              className: Pi,
              style: {
                color: ct.Critical.Main
              },
              size: "T200",
              children: ((_a6 = i.error) == null ? void 0 : _a6.message) ?? "Failed to join replacement space!"
            })
          ]
        }),
        o.jsx(E, {
          direction: "Column",
          shrink: "No",
          children: (s == null ? void 0 : s.getMyMembership()) === Ht.Join || i.status === ve.Success ? o.jsx(xe, {
            onClick: l,
            size: "300",
            variant: "Success",
            fill: "Solid",
            radii: "300",
            children: o.jsx(D, {
              size: "B300",
              children: "Open New Space"
            })
          }) : o.jsx(xe, {
            onClick: a,
            size: "300",
            variant: "Primary",
            fill: "Solid",
            radii: "300",
            before: i.status === ve.Loading && o.jsx(dt, {
              size: "100",
              variant: "Primary",
              fill: "Solid"
            }),
            disabled: i.status === ve.Loading,
            children: o.jsx(D, {
              size: "B300",
              children: "Join New Space"
            })
          })
        })
      ]
    });
  }
  function zht() {
    var _a6;
    const t = be(), e = im();
    I3(e.roomId);
    const n = wi(t, e.roomId), r = p.useRef(null), i = Ze(gi), a = Ze(qi), s = Ze(vi), l = Ze(jht), c = Ze(zr), [d] = Fr(ome), u = p.useMemo(() => new Set(c), [
      c
    ]), h = h3(), [f, g] = Fe(ge, "roomSidebarWidth"), [m, v] = p.useState(f);
    p.useEffect(() => {
      v(f);
    }, [
      f
    ]);
    const [y] = Fe(ge, "showRoomIcon"), [w] = Fe(ge, "perRoomShowRoomIcon"), b = ((_a6 = w.find((te) => te.roomId === e.roomId)) == null ? void 0 : _a6.display) ?? y, j = () => b === Ic.Always ? true : b === Ic.Never ? false : m < 144, [k] = Fe(ge, "joinCallOnSingleClick"), C = $i(e, ce.RoomTombstone), x = oc(), S = Y5e(n), T = Z5e(n), A = sm(), [B, U] = Fr(fL()), z = p.useCallback((te) => {
      if (u.has(te)) return t.getRoom(te) ?? void 0;
    }, [
      t,
      u
    ]), O = p.useRef(/* @__PURE__ */ new Map()), M = p.useRef(/* @__PURE__ */ new Map());
    p.useEffect(() => {
      O.current.clear(), M.current.clear();
    }, [
      B,
      s,
      z
    ]);
    const I = p.useCallback((te, re, he, se = /* @__PURE__ */ new Set()) => {
      var _a7;
      if (re === te && he && (d.has(he) || ((_a7 = z(he)) == null ? void 0 : _a7.isSpaceRoom()))) return false;
      const ye = v2(te, re);
      if (se.has(ye)) return false;
      if (se.add(ye), O.current.has(ye)) return O.current.get(ye);
      if (B.has(ye)) return O.current.set(ye, true), true;
      const we = s.get(re);
      if (!we || we.size === 0) return O.current.set(ye, false), false;
      const Ee = !Array.from(we).some((ke) => !I(te, ke, re, se));
      return se.delete(ye), O.current.set(ye, Ee), Ee;
    }, [
      B,
      z,
      s,
      d
    ]), N = p.useCallback((te, re = /* @__PURE__ */ new Set()) => {
      if (a.has(te) || te === x) return true;
      if (re.has(te)) return false;
      re.add(te);
      const he = l.get(te);
      return !he || he.size === 0 ? false : Array.from(he).some((se) => N(se, re));
    }, [
      a,
      x,
      l
    ]), L = (te, re) => {
      const he = v2(te, re);
      if (M.current.has(he)) return M.current.get(he);
      const se = s.get(re);
      if (!se || se.size === 0) return M.current.set(he, false), false;
      const ye = !Array.from(se).some((we) => !I(te, we, re));
      return M.current.set(he, ye), ye;
    }, [H] = Fe(ge, "subspaceHierarchyLimit"), V = (te, re) => {
      let Ee = [];
      const ke = [];
      return re.forEach((Ne) => {
        const lt = te[Ne.index];
        if (!lt) return;
        const { roomId: Rt, depth: We } = lt, yt = We ?? 0, Xt = z(Rt), nn = (Xt == null ? void 0 : Xt.isSpaceRoom()) ? yt : yt + 1;
        if (nn < 2 || nn === 1 && !(Xt == null ? void 0 : Xt.isSpaceRoom()) && Ee.length === 0) return;
        if (nn === 2) {
          Ee = [
            {
              aX: 15.75 * 2 + -15.75,
              aY: Ne.end
            }
          ];
          return;
        }
        for (; Ee.length + 2 > nn && Ee.length !== 0; ) Ee.pop();
        Ee.length === 0 && (Ee = [
          {
            aX: Math.round(nn * 15.75),
            aY: 0
          }
        ]);
        const bt = Ee[Ee.length - 1];
        if (!bt) return;
        const { aX: At, aY: $t } = bt, Lt = Math.round((nn - 0.5) * 15.75 + -15.75), wt = Ne.end - Ne.size / 2, st = `M ${At} ${$t} L ${At} ${wt - 5} A 5 5 0 0 0 ${At + 5} ${wt} L ${Lt} ${wt}`;
        ke.push(o.jsx("path", {
          d: st,
          fill: "none",
          stroke: ct.Surface.ContainerLine,
          strokeWidth: "2",
          display: "block"
        })), Ee.push({
          aX: Math.round(nn * 15.75) + -15.75,
          aY: Ne.end
        });
      }), o.jsx("svg", {
        style: {
          position: "absolute",
          inset: 0,
          width: "100%",
          height: "100%",
          pointerEvents: "none"
        },
        children: ke
      });
    }, Z = Xit(e.roomId, z, p.useCallback((te, re, he) => {
      if (he >= H) return true;
      if (!I(e.roomId, te, re)) return false;
      const se = a.get(re), ye = N(re), Ee = !!se && (se.total > 0 || se.highlight > 0) || re === x || (A == null ? void 0 : A.roomId) === re;
      return ye || !Ee;
    }, [
      N,
      I,
      e.roomId,
      A,
      H,
      a,
      x
    ]), p.useCallback((te) => I(e.roomId, te), [
      I,
      e.roomId
    ])), Y = nc({
      count: Z.length,
      getScrollElement: () => r.current,
      estimateSize: () => 32,
      overscan: 10
    }), oe = Y.getVirtualItems(), ue = BS(U, (te) => {
      const re = B.has(te), [he, se] = Nut(te);
      return L(he, se) ? !re : re;
    }), ie = (te) => tF(n, wi(t, te)), de = (te) => {
      if (te !== 0) return te === 1 ? ee.space.S400 : ee.space.S0;
    }, ne = br(), ae = Ze(JM), X = p.useCallback(() => {
      if (Dr() && ae) {
        const te = wi(t, ae);
        ne(tF(n, te));
      }
    }, [
      ae,
      n,
      t,
      ne
    ]), G = fr() === sn.Mobile, le = m <= 80 && !G;
    return o.jsxs(E, {
      shrink: "No",
      style: {
        position: "relative",
        width: G ? "100%" : He(m)
      },
      children: [
        o.jsx(qf, {
          children: o.jsxs(Tme, {
            direction: "left",
            onClose: X,
            children: [
              o.jsx(Lht, {
                hideText: le,
                mx: t
              }),
              o.jsx(mh, {
                scrollRef: r,
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "300",
                  children: [
                    C && o.jsx(Nht, {
                      roomId: e.roomId,
                      replacementRoomId: C.getContent().replacement_room
                    }),
                    o.jsxs(ch, {
                      children: [
                        o.jsx(Is, {
                          variant: "Background",
                          radii: "400",
                          "aria-selected": S,
                          children: o.jsx(Rf, {
                            to: Qg(wi(t, e.roomId)),
                            children: o.jsx(Bs, {
                              children: o.jsxs(E, {
                                as: "span",
                                grow: "Yes",
                                alignItems: "Center",
                                justifyContent: "Start",
                                gap: "200",
                                children: [
                                  o.jsx(xn, {
                                    size: le ? void 0 : "200",
                                    radii: "400",
                                    style: le ? {
                                      width: "100%",
                                      padding: "0"
                                    } : void 0,
                                    children: o.jsx(Q, {
                                      src: q.Flag,
                                      size: "100",
                                      filled: S
                                    })
                                  }),
                                  !le && o.jsx(E, {
                                    as: "span",
                                    grow: "Yes",
                                    children: o.jsx(D, {
                                      as: "span",
                                      size: "Inherit",
                                      truncate: true,
                                      children: "Lobby"
                                    })
                                  })
                                ]
                              })
                            })
                          })
                        }),
                        o.jsx(Is, {
                          variant: "Background",
                          radii: "400",
                          "aria-selected": T,
                          children: o.jsx(Rf, {
                            to: tP(wi(t, e.roomId)),
                            children: o.jsx(Bs, {
                              children: o.jsxs(E, {
                                as: "span",
                                grow: "Yes",
                                alignItems: "Center",
                                justifyContent: "Start",
                                gap: "200",
                                children: [
                                  o.jsx(xn, {
                                    size: le ? void 0 : "200",
                                    radii: "400",
                                    style: le ? {
                                      width: "100%"
                                    } : void 0,
                                    children: o.jsx(Q, {
                                      src: q.Search,
                                      size: "100",
                                      filled: T
                                    })
                                  }),
                                  o.jsx(E, {
                                    as: "span",
                                    grow: "Yes",
                                    children: !le && o.jsx(D, {
                                      as: "span",
                                      size: "Inherit",
                                      truncate: true,
                                      children: "Message Search"
                                    })
                                  })
                                ]
                              })
                            })
                          })
                        })
                      ]
                    }),
                    o.jsxs(ch, {
                      style: {
                        height: Y.getTotalSize(),
                        position: "relative",
                        overflow: "visible"
                      },
                      children: [
                        oe.map((te) => {
                          const re = Z[te.index];
                          if (!re) return null;
                          const { roomId: he, depth: se } = re, ye = se ?? 0, we = t.getRoom(he), Ee = (we == null ? void 0 : we.isSpaceRoom()) ? ye - 2 : ye - 1;
                          if (!we) return null;
                          if (ye === H && we.isSpaceRoom()) return o.jsx(Rs, {
                            virtualItem: te,
                            ref: Y.measureElement,
                            children: o.jsx("div", {
                              style: le ? {} : {
                                paddingLeft: `calc(${Ee} * ${ee.space.S400})`
                              },
                              children: o.jsx(Sht, {
                                room: we,
                                selected: x === he,
                                linkPath: Qg(wi(t, he)),
                                hideText: le
                              })
                            })
                          }, te.index);
                          const ke = de(ye), Ne = `calc(${Ee} * ${ee.space.S400})`;
                          if (we.isSpaceRoom()) {
                            const lt = v2(e.roomId, he), Rt = I(e.roomId, he);
                            return o.jsx(Rs, {
                              virtualItem: te,
                              ref: Y.measureElement,
                              children: o.jsx("div", {
                                style: le ? {
                                  paddingTop: "0"
                                } : {
                                  paddingTop: ke,
                                  paddingLeft: Ne
                                },
                                children: o.jsx(MS, {
                                  style: le ? {
                                    justifyContent: "Center"
                                  } : {},
                                  children: o.jsx(hL, {
                                    "data-category-id": lt,
                                    onClick: ue,
                                    closed: B.has(lt) || Rt,
                                    children: !le && (he === e.roomId ? "Rooms" : we == null ? void 0 : we.name)
                                  })
                                })
                              })
                            }, te.index);
                          }
                          return o.jsx(Rs, {
                            virtualItem: te,
                            ref: Y.measureElement,
                            children: o.jsx("div", {
                              style: le ? {
                                padding: "0",
                                width: "100%",
                                aspectRatio: 1,
                                display: "flex",
                                flexDirection: "column"
                              } : {
                                paddingLeft: Ne
                              },
                              children: o.jsx(uL, {
                                room: we,
                                selected: x === he,
                                showAvatar: i.has(he) || j(),
                                direct: i.has(he),
                                linkPath: ie(he),
                                hideText: le,
                                notificationMode: Xk(h, we.roomId),
                                joinCallOnSingleClick: k
                              })
                            })
                          }, te.index);
                        }),
                        V(Z, oe)
                      ]
                    })
                  ]
                })
              })
            ]
          })
        }),
        !G && o.jsx(Zl, {
          setCurWidth: v,
          sidebarWidth: f,
          setSidebarWidth: g,
          instep: 80,
          outstep: 190,
          minValue: 50,
          maxValue: 500
        })
      ]
    });
  }
  function Uht() {
    const t = be(), e = p.useRef(null), n = im(), r = fr(), i = Ze(gi), a = Ze(vi), s = Zk(zr, n.roomId, vAe(t, i, a));
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          balance: true,
          children: o.jsxs(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No",
                children: r === sn.Mobile && o.jsx(ic, {
                  children: (l) => o.jsx(Oe, {
                    onClick: l,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsxs(E, {
                justifyContent: "Center",
                alignItems: "Center",
                gap: "200",
                children: [
                  r !== sn.Mobile && o.jsx(Q, {
                    size: "400",
                    src: q.Search
                  }),
                  o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: "Message Search"
                  })
                ]
              }),
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              })
            ]
          })
        }),
        o.jsx(E, {
          style: {
            position: "relative"
          },
          grow: "Yes",
          children: o.jsx(dn, {
            ref: e,
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsx(xge, {
                  defaultRoomsFilterName: n.name,
                  allowGlobal: true,
                  rooms: s,
                  scrollRef: e
                })
              })
            })
          })
        })
      ]
    });
  }
  function Vht({ children: t }) {
    const e = be(), n = im(), [r] = Fe(ge, "developerTools"), [i, a] = Fr(vi), s = Ze(gi), l = Ze(zr), { roomIdOrAlias: c, eventId: d } = Fl(), u = c && decodeURIComponent(c), h = d && decodeURIComponent(d), f = mL(), g = oc(), m = e.getRoom(g);
    return !m || !l.includes(m.roomId) ? o.jsx(Ib, {
      roomIdOrAlias: u,
      eventId: h,
      viaServers: f
    }) : r && m.isSpaceRoom() && m.roomId === n.roomId ? o.jsx(dp, {
      value: m,
      children: o.jsx(wE, {
        value: s.has(m.roomId),
        children: t
      })
    }, m.roomId) : sa(i, m.roomId).has(n.roomId) ? o.jsx(dp, {
      value: m,
      children: o.jsx(wE, {
        value: s.has(m.roomId),
        children: t
      })
    }, m.roomId) : (s4(n).includes(m.roomId) && a({
      type: "PUT",
      parent: n.roomId,
      children: [
        m.roomId
      ]
    }), o.jsx(Ib, {
      roomIdOrAlias: u,
      eventId: h,
      viaServers: f
    }));
  }
  const Hht = () => !!Ko({
    path: nb(),
    caseSensitive: true,
    end: false
  }), $ht = () => !!Ko({
    path: jk(),
    caseSensitive: true,
    end: false
  }), Wht = () => {
    const { server: t } = Fl();
    return t;
  };
  function qht({ hideText: t }) {
    const e = be(), n = br(), [r, i] = p.useState(false), a = p.useRef(null), [s] = Et(p.useCallback((u) => e.publicRooms({
      server: u,
      limit: 1
    }), [
      e
    ])), l = () => {
      const u = a.current;
      return u && u.value.trim() || void 0;
    }, c = (u) => {
      u.preventDefault();
      const h = l();
      h && (n(ep(h)), i(false));
    }, d = () => {
      const u = l();
      u && (n(ep(u)), i(false));
    };
    return o.jsxs(o.Fragment, {
      children: [
        o.jsx(Hn, {
          open: r,
          backdrop: o.jsx($n, {}),
          children: o.jsx(Wn, {
            children: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                clickOutsideDeactivates: true,
                onDeactivate: () => i(false),
                escapeDeactivates: kt
              },
              children: o.jsxs(lr, {
                variant: "Surface",
                children: [
                  o.jsxs(wn, {
                    style: {
                      padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                      borderBottomWidth: ee.borderWidth.B300
                    },
                    variant: "Surface",
                    size: "500",
                    children: [
                      o.jsx(E, {
                        grow: "Yes",
                        children: o.jsx(D, {
                          size: "H4",
                          children: "Add Server"
                        })
                      }),
                      o.jsx(Oe, {
                        size: "300",
                        onClick: () => i(false),
                        radii: "300",
                        children: o.jsx(Q, {
                          src: q.Cross
                        })
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    as: "form",
                    onSubmit: c,
                    style: {
                      padding: ee.space.S400
                    },
                    direction: "Column",
                    gap: "400",
                    children: [
                      o.jsx(D, {
                        priority: "400",
                        children: "Add server name to explore public communities."
                      }),
                      o.jsxs(E, {
                        direction: "Column",
                        gap: "100",
                        children: [
                          o.jsx(D, {
                            size: "L400",
                            children: "Server Name"
                          }),
                          o.jsx(mn, {
                            ref: a,
                            name: "serverInput",
                            variant: "Background",
                            required: true
                          }),
                          s.status === ve.Error && o.jsx(D, {
                            style: {
                              color: ct.Critical.Main
                            },
                            size: "T300",
                            children: "Failed to load public rooms. Please try again."
                          })
                        ]
                      }),
                      o.jsx(E, {
                        direction: "Column",
                        gap: "200",
                        children: o.jsx(xe, {
                          type: "submit",
                          onClick: d,
                          variant: "Secondary",
                          fill: "Soft",
                          children: o.jsx(D, {
                            size: "B400",
                            children: "View"
                          })
                        })
                      })
                    ]
                  })
                ]
              })
            })
          })
        }),
        t ? o.jsx(Oe, {
          "aria-pressed": true,
          variant: "Background",
          onClick: () => i(true),
          children: o.jsx(Q, {
            src: q.Plus,
            size: "200",
            filled: true
          })
        }) : o.jsx(xe, {
          variant: "Secondary",
          fill: "Soft",
          size: "300",
          before: o.jsx(Q, {
            size: "100",
            src: q.Plus
          }),
          onClick: () => i(true),
          children: o.jsx(D, {
            size: "B300",
            truncate: true,
            children: "Add Server"
          })
        })
      ]
    });
  }
  function Kht() {
    var _a6, _b3;
    const t = be();
    I3("explore");
    const e = t.getUserId(), n = la(), r = e ? bo(e) : void 0, i = ((_b3 = (_a6 = n.featuredCommunities) == null ? void 0 : _a6.servers) == null ? void 0 : _b3.filter((m) => m !== r)) ?? [], a = $ht(), s = Wht(), [l, c] = Fe(ge, "roomSidebarWidth"), [d, u] = p.useState(l);
    p.useEffect(() => {
      u(l);
    }, [
      l
    ]);
    const f = fr() === sn.Mobile, g = d <= 80 && !f;
    return o.jsxs(E, {
      shrink: "No",
      style: {
        position: "relative",
        width: f ? "100%" : He(d)
      },
      children: [
        o.jsxs(qf, {
          children: [
            o.jsx(Kf, {
              children: o.jsx(E, {
                grow: "Yes",
                gap: "300",
                justifyContent: "Center",
                children: g ? o.jsx(Q, {
                  src: q.Explore,
                  size: "200",
                  filled: true
                }) : o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(D, {
                    size: "H4",
                    truncate: true,
                    children: "Explore Community"
                  })
                })
              })
            }),
            o.jsx(mh, {
              children: o.jsxs(E, {
                direction: "Column",
                gap: "300",
                children: [
                  o.jsxs(ch, {
                    children: [
                      o.jsx(Is, {
                        variant: "Background",
                        radii: "400",
                        "aria-selected": a,
                        children: o.jsx(Rf, {
                          to: jk(),
                          children: o.jsx(Bs, {
                            children: o.jsxs(E, {
                              as: "span",
                              grow: "Yes",
                              alignItems: "Center",
                              gap: "200",
                              children: [
                                o.jsx(xn, {
                                  size: "200",
                                  radii: "400",
                                  style: g ? {
                                    width: "100%",
                                    padding: "0"
                                  } : {
                                    height: "100%"
                                  },
                                  children: o.jsx(Q, {
                                    src: q.Bulb,
                                    size: "100",
                                    filled: a
                                  })
                                }),
                                !g && o.jsx(E, {
                                  as: "span",
                                  grow: "Yes",
                                  children: o.jsx(D, {
                                    as: "span",
                                    size: "Inherit",
                                    truncate: true,
                                    children: "Featured"
                                  })
                                })
                              ]
                            })
                          })
                        })
                      }),
                      r && o.jsx(Is, {
                        variant: "Background",
                        radii: "400",
                        "aria-selected": s === r,
                        children: o.jsx(Rf, {
                          to: ep(r),
                          children: o.jsx(Bs, {
                            children: o.jsxs(E, {
                              as: "span",
                              grow: "Yes",
                              alignItems: "Center",
                              gap: "200",
                              children: [
                                o.jsx(xn, {
                                  size: "200",
                                  radii: "400",
                                  style: g ? {
                                    width: "100%",
                                    padding: "0"
                                  } : {
                                    height: "100%"
                                  },
                                  children: o.jsx(Q, {
                                    src: q.Server,
                                    size: "100",
                                    filled: s === r
                                  })
                                }),
                                !g && o.jsx(E, {
                                  as: "span",
                                  grow: "Yes",
                                  children: o.jsx(D, {
                                    as: "span",
                                    size: "Inherit",
                                    truncate: true,
                                    children: r
                                  })
                                })
                              ]
                            })
                          })
                        })
                      })
                    ]
                  }),
                  i.length > 0 && o.jsxs(ch, {
                    children: [
                      o.jsx(MS, {
                        children: !g && o.jsx(D, {
                          size: "O400",
                          style: {
                            paddingLeft: ee.space.S200
                          },
                          children: "Servers"
                        })
                      }),
                      i.map((m) => o.jsx(Is, {
                        variant: "Background",
                        radii: "400",
                        "aria-selected": m === s,
                        children: o.jsx(Rf, {
                          to: ep(m),
                          children: o.jsx(Bs, {
                            children: o.jsxs(E, {
                              as: "span",
                              grow: "Yes",
                              alignItems: "Center",
                              gap: "200",
                              children: [
                                o.jsx(xn, {
                                  size: "200",
                                  radii: "400",
                                  style: g ? {
                                    width: "100%",
                                    padding: "0"
                                  } : {
                                    height: "100%"
                                  },
                                  children: o.jsx(Q, {
                                    src: q.Server,
                                    size: "100",
                                    filled: m === s
                                  })
                                }),
                                !g && o.jsx(E, {
                                  as: "span",
                                  grow: "Yes",
                                  children: o.jsx(D, {
                                    as: "span",
                                    size: "Inherit",
                                    truncate: true,
                                    children: m
                                  })
                                })
                              ]
                            })
                          })
                        })
                      }, m))
                    ]
                  }),
                  o.jsx(E, {
                    direction: "Column",
                    children: o.jsx(qht, {
                      hideText: g
                    })
                  })
                ]
              })
            })
          ]
        }),
        !f && o.jsx(Zl, {
          setCurWidth: u,
          sidebarWidth: l,
          setSidebarWidth: c,
          instep: 80,
          outstep: 190,
          minValue: 50,
          maxValue: 500
        })
      ]
    });
  }
  var Dge = "style_RoomsInfoCard__16h303d0 ContainerColor_ContainerColor__15396tl0 _1mqalmd1 _1mqalmd0 ContainerColor_ContainerColor_variant_SurfaceVariant__15396tl3", Ght = "style_PublicRoomsError__16h303d1 ContainerColor_ContainerColor__15396tl0 _1mqalmd1 _1mqalmd0 ContainerColor_ContainerColor_variant_Critical__15396tl8";
  const Yht = (t) => p.useMemo(() => ({
    limit: t.get("limit") ?? void 0,
    since: t.get("since") ?? void 0,
    term: t.get("term") ?? void 0,
    type: t.get("type") ?? void 0,
    instance: t.get("instance") ?? void 0
  }), [
    t
  ]), Zht = () => p.useMemo(() => [
    {
      title: "All",
      value: void 0
    },
    {
      title: "Spaces",
      value: Bo.Space
    },
    {
      title: "Rooms",
      value: "null"
    }
  ], []), XT = 24;
  function Jht({ active: t, loading: e, searchInputRef: n, onSearch: r, onReset: i }) {
    const a = (s) => {
      s.preventDefault();
      const { searchInput: l } = s.target, c = l.value.trim() || void 0;
      c && r(c);
    };
    return o.jsxs(E, {
      as: "form",
      direction: "Column",
      gap: "100",
      onSubmit: a,
      children: [
        o.jsx("span", {
          "data-spacing-node": true
        }),
        o.jsx(D, {
          size: "L400",
          children: "Search"
        }),
        o.jsx(mn, {
          ref: n,
          style: {
            paddingRight: ee.space.S300
          },
          name: "searchInput",
          size: "500",
          variant: "Background",
          placeholder: "Search for keyword",
          before: t && e ? o.jsx(dt, {
            variant: "Secondary",
            size: "200"
          }) : o.jsx(Q, {
            size: "200",
            src: q.Search
          }),
          after: t ? o.jsx(Qe, {
            type: "button",
            variant: "Secondary",
            size: "400",
            radii: "Pill",
            outlined: true,
            after: o.jsx(Q, {
              size: "50",
              src: q.Cross
            }),
            onClick: i,
            children: o.jsx(D, {
              size: "B300",
              children: "Clear"
            })
          }) : o.jsx(Qe, {
            type: "submit",
            variant: "Primary",
            size: "400",
            radii: "Pill",
            outlined: true,
            children: o.jsx(D, {
              size: "B300",
              children: "Enter"
            })
          })
        })
      ]
    });
  }
  const lQ = "Matrix";
  function Xht({ instanceId: t, onChange: e }) {
    const n = be(), [r, i] = p.useState(), { data: a } = ol({
      queryKey: [
        "thirdparty",
        "protocols"
      ],
      queryFn: () => n.getThirdpartyProtocols()
    }), s = (u) => {
      const h = u.currentTarget.getAttribute("data-instance-id") ?? void 0;
      e(h), i(void 0);
    }, l = (u) => {
      i(u.currentTarget.getBoundingClientRect());
    }, c = a && Object.keys(a).flatMap((u) => {
      var _a6;
      return ((_a6 = a[u]) == null ? void 0 : _a6.instances) ?? [];
    });
    if (!c || c.length === 0) return null;
    const d = c.find((u) => t === u.instance_id);
    return o.jsx(ln, {
      anchor: r,
      align: "End",
      position: "Bottom",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => i(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          variant: "Surface",
          children: o.jsxs(E, {
            direction: "Column",
            gap: "100",
            style: {
              padding: ee.space.S100,
              minWidth: He(100)
            },
            children: [
              o.jsx(D, {
                style: {
                  padding: ee.space.S100
                },
                size: "L400",
                truncate: true,
                children: "Protocols"
              }),
              o.jsxs(E, {
                direction: "Column",
                children: [
                  o.jsx(Ye, {
                    size: "300",
                    variant: "Surface",
                    "aria-pressed": t === void 0,
                    radii: "300",
                    onClick: s,
                    children: o.jsx(D, {
                      size: "T200",
                      truncate: true,
                      children: lQ
                    })
                  }),
                  c.map((u) => o.jsx(Ye, {
                    size: "300",
                    "data-instance-id": u.instance_id,
                    "aria-pressed": t === u.instance_id,
                    variant: "Surface",
                    radii: "300",
                    onClick: s,
                    children: o.jsx(D, {
                      size: "T200",
                      truncate: true,
                      children: u.desc
                    })
                  }, u.instance_id))
                ]
              })
            ]
          })
        })
      }),
      children: o.jsx(Qe, {
        onClick: l,
        "aria-pressed": !!r,
        radii: "Pill",
        size: "400",
        variant: t ? "Success" : "SurfaceVariant",
        after: o.jsx(Q, {
          size: "100",
          src: q.ChevronBottom
        }),
        children: o.jsx(D, {
          size: "T200",
          truncate: true,
          children: (d == null ? void 0 : d.desc) ?? lQ
        })
      })
    });
  }
  function Qht({ limit: t, onLimitChange: e }) {
    const [n, r] = p.useState(), i = (l) => {
      l.preventDefault();
      const c = l.currentTarget.limitInput;
      if (!c) return;
      const d = c.value.trim();
      d && e(d);
    }, a = (l) => {
      r(void 0), e(l);
    }, s = (l) => {
      r(l.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: n,
      align: "End",
      position: "Bottom",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => r(void 0),
          clickOutsideDeactivates: true,
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          variant: "Surface",
          children: o.jsxs(E, {
            direction: "Column",
            gap: "400",
            style: {
              padding: ee.space.S300
            },
            children: [
              o.jsxs(E, {
                direction: "Column",
                gap: "100",
                children: [
                  o.jsx(D, {
                    size: "L400",
                    children: "Presets"
                  }),
                  o.jsxs(E, {
                    gap: "100",
                    wrap: "Wrap",
                    children: [
                      o.jsx(Qe, {
                        variant: "SurfaceVariant",
                        onClick: () => a("24"),
                        radii: "Pill",
                        children: o.jsx(D, {
                          size: "T200",
                          children: "24"
                        })
                      }),
                      o.jsx(Qe, {
                        variant: "SurfaceVariant",
                        onClick: () => a("48"),
                        radii: "Pill",
                        children: o.jsx(D, {
                          size: "T200",
                          children: "48"
                        })
                      }),
                      o.jsx(Qe, {
                        variant: "SurfaceVariant",
                        onClick: () => a("96"),
                        radii: "Pill",
                        children: o.jsx(D, {
                          size: "T200",
                          children: "96"
                        })
                      })
                    ]
                  })
                ]
              }),
              o.jsxs(E, {
                as: "form",
                onSubmit: i,
                direction: "Column",
                gap: "300",
                children: [
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Custom Limit"
                      }),
                      o.jsx(mn, {
                        name: "limitInput",
                        size: "300",
                        variant: "Background",
                        defaultValue: t,
                        min: 1,
                        step: 1,
                        outlined: true,
                        type: "number",
                        radii: "400",
                        "aria-label": "Per Page Item Limit"
                      })
                    ]
                  }),
                  o.jsx(xe, {
                    type: "submit",
                    size: "300",
                    variant: "Primary",
                    radii: "400",
                    children: o.jsx(D, {
                      size: "B300",
                      children: "Change Limit"
                    })
                  })
                ]
              })
            ]
          })
        })
      }),
      children: o.jsx(Qe, {
        onClick: s,
        "aria-pressed": !!n,
        radii: "Pill",
        size: "400",
        variant: "SurfaceVariant",
        after: o.jsx(Q, {
          size: "100",
          src: q.ChevronBottom
        }),
        children: o.jsx(D, {
          size: "T200",
          truncate: true,
          children: `Page Limit: ${t}`
        })
      })
    });
  }
  function eft() {
    const { server: t } = Fl(), e = be(), n = e.getUserId(), r = n && bo(n), i = Ze(zr), { navigateSpace: a, navigateRoom: s } = Wi(), l = fr(), [c] = fh(), d = Yht(c), u = !!d.term, h = p.useRef(null), f = p.useRef(null), g = br(), m = Zht(), v = p.useMemo(() => {
      const M = d.limit;
      return M && Number.parseInt(M, 10) || XT;
    }, [
      d.limit
    ]), y = p.useMemo(() => Array.from({
      length: v
    }, (M, I) => `placeholder-${I}`), [
      v
    ]), w = p.useCallback(() => {
      const M = h.current;
      M && (M.scrollTop = 0);
    }, []), b = p.useCallback(() => {
      const M = typeof d.limit == "string" ? Number.parseInt(d.limit, 10) : XT, I = d.type === "null" ? null : d.type;
      return e.http.authedRequest(rt.Post, "/publicRooms", {
        server: t
      }, {
        limit: M,
        since: d.since,
        filter: {
          generic_search_term: d.term,
          room_types: I === void 0 ? void 0 : [
            I
          ]
        },
        third_party_instance_id: d.instance
      });
    }, [
      e,
      t,
      d
    ]), { data: j, isLoading: k, error: C } = ol({
      queryKey: [
        t,
        "publicRooms",
        d.limit,
        d.since,
        d.term,
        d.type,
        d.instance
      ],
      queryFn: b
    });
    p.useEffect(() => {
      k && w();
    }, [
      k,
      w
    ]);
    const x = (M) => {
      if (!t) return;
      const I = {
        ...d,
        ...M
      };
      Object.keys(I).forEach((L) => {
        I[L] === void 0 && delete I[L];
      });
      const N = gl(ep(t), I);
      g(N);
    }, S = () => {
      const M = j == null ? void 0 : j.prev_batch;
      x({
        since: M
      });
    }, T = () => {
      const M = j == null ? void 0 : j.next_batch;
      x({
        since: M
      });
    }, A = (M) => {
      x({
        term: M,
        since: void 0
      });
    }, B = () => {
      f.current && (f.current.value = ""), x({
        term: void 0,
        since: void 0
      });
    }, U = (M) => {
      const I = M.currentTarget.getAttribute("data-room-filter");
      x({
        type: I ?? void 0,
        since: void 0
      });
    }, z = (M) => {
      x({
        limit: M
      });
    }, O = (M) => {
      x({
        instance: M,
        since: void 0
      });
    };
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          balance: true,
          children: u ? o.jsxs(o.Fragment, {
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No",
                children: o.jsx(Qe, {
                  size: "500",
                  variant: "Surface",
                  radii: "Pill",
                  before: o.jsx(Q, {
                    size: "100",
                    src: q.ArrowLeft
                  }),
                  onClick: B,
                  children: o.jsx(D, {
                    size: "T300",
                    children: t
                  })
                })
              }),
              o.jsxs(E, {
                grow: "No",
                justifyContent: "Center",
                alignItems: "Center",
                gap: "200",
                children: [
                  l !== sn.Mobile && o.jsx(Q, {
                    size: "400",
                    src: q.Search
                  }),
                  o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: "Search"
                  })
                ]
              }),
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              })
            ]
          }) : o.jsxs(o.Fragment, {
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No",
                children: l === sn.Mobile && o.jsx(ic, {
                  children: (M) => o.jsx(Oe, {
                    onClick: M,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsxs(E, {
                grow: "Yes",
                justifyContent: "Center",
                alignItems: "Center",
                gap: "200",
                children: [
                  l !== sn.Mobile && o.jsx(Q, {
                    size: "400",
                    src: q.Server
                  }),
                  o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: t
                  })
                ]
              }),
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            ref: h,
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "600",
                  children: [
                    o.jsx(Jht, {
                      active: u,
                      loading: k,
                      searchInputRef: f,
                      onSearch: A,
                      onReset: B
                    }, t),
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "400",
                      children: [
                        o.jsxs(E, {
                          direction: "Column",
                          gap: "300",
                          children: [
                            u ? o.jsx(D, {
                              size: "H4",
                              children: `Results for "${d.term}"`
                            }) : o.jsx(D, {
                              size: "H4",
                              children: "Popular Communities"
                            }),
                            o.jsxs(E, {
                              gap: "200",
                              children: [
                                m.map((M) => o.jsx(Qe, {
                                  onClick: U,
                                  "data-room-filter": M.value,
                                  variant: M.value === d.type ? "Success" : "Surface",
                                  "aria-pressed": M.value === d.type,
                                  before: M.value === d.type && o.jsx(Q, {
                                    size: "100",
                                    src: q.Check
                                  }),
                                  outlined: true,
                                  children: o.jsx(D, {
                                    size: "T200",
                                    children: M.title
                                  })
                                }, M.title)),
                                r === t && o.jsxs(o.Fragment, {
                                  children: [
                                    o.jsx(nr, {
                                      style: {
                                        margin: `${ee.space.S100} 0`
                                      },
                                      direction: "Vertical",
                                      variant: "Surface",
                                      size: "300"
                                    }),
                                    o.jsx(Xht, {
                                      instanceId: d.instance,
                                      onChange: O
                                    })
                                  ]
                                }),
                                o.jsx(E, {
                                  grow: "Yes",
                                  "data-spacing-node": true
                                }),
                                o.jsx(Qht, {
                                  limit: v,
                                  onLimitChange: z
                                })
                              ]
                            })
                          ]
                        }),
                        k && o.jsx(ME, {
                          children: y.map((M) => o.jsx(wge, {
                            style: {
                              minHeight: He(260)
                            }
                          }, M))
                        }),
                        C && o.jsxs(E, {
                          direction: "Column",
                          className: Ght,
                          gap: "200",
                          children: [
                            o.jsx(D, {
                              size: "L400",
                              children: C.name
                            }),
                            o.jsx(D, {
                              size: "T300",
                              children: C.message
                            })
                          ]
                        }),
                        j && (j.chunk.length > 0 ? o.jsxs(o.Fragment, {
                          children: [
                            o.jsx(ME, {
                              children: j == null ? void 0 : j.chunk.map((M) => o.jsx(OE, {
                                roomIdOrAlias: M.canonical_alias ?? M.room_id,
                                allRooms: i,
                                avatarUrl: M.avatar_url,
                                name: M.name,
                                topic: M.topic,
                                memberCount: M.num_joined_members,
                                roomType: M.room_type,
                                joinRule: M.join_rule,
                                onView: M.room_type === Bo.Space ? a : s,
                                renderTopicViewer: (I, N, L) => o.jsx(Vf, {
                                  name: I,
                                  topic: N,
                                  requestClose: L
                                })
                              }, M.room_id))
                            }),
                            (j.prev_batch || j.next_batch) && o.jsxs(E, {
                              justifyContent: "Center",
                              gap: "200",
                              children: [
                                o.jsx(xe, {
                                  onClick: S,
                                  size: "300",
                                  fill: "Soft",
                                  disabled: !j.prev_batch,
                                  children: o.jsx(D, {
                                    size: "B300",
                                    truncate: true,
                                    children: "Previous Page"
                                  })
                                }),
                                o.jsx(E, {
                                  "data-spacing-node": true,
                                  grow: "Yes"
                                }),
                                o.jsx(xe, {
                                  onClick: T,
                                  size: "300",
                                  fill: "Solid",
                                  disabled: !j.next_batch,
                                  children: o.jsx(D, {
                                    size: "B300",
                                    truncate: true,
                                    children: "Next Page"
                                  })
                                })
                              ]
                            })
                          ]
                        }) : o.jsxs(E, {
                          className: Dge,
                          direction: "Column",
                          justifyContent: "Center",
                          alignItems: "Center",
                          gap: "200",
                          children: [
                            o.jsx(Q, {
                              size: "400",
                              src: q.Info
                            }),
                            o.jsx(D, {
                              size: "T300",
                              align: "Center",
                              children: "No communities found!"
                            })
                          ]
                        }))
                      ]
                    })
                  ]
                })
              })
            })
          })
        })
      ]
    });
  }
  function tft() {
    const { featuredCommunities: t } = la(), { rooms: e, spaces: n } = t ?? {}, r = Ze(zr), i = fr(), { navigateSpace: a, navigateRoom: s } = Wi();
    return o.jsxs(si, {
      children: [
        i === sn.Mobile && o.jsx(_i, {
          children: o.jsx(E, {
            shrink: "No",
            children: o.jsx(ic, {
              children: (l) => o.jsx(Oe, {
                onClick: l,
                children: o.jsx(Q, {
                  src: q.ArrowLeft
                })
              })
            })
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "200",
                  children: [
                    o.jsx(Uc, {
                      children: o.jsx(Vc, {
                        icon: o.jsx(Q, {
                          size: "600",
                          src: q.Bulb
                        }),
                        title: "Featured by Client",
                        subTitle: "Find and explore public rooms and spaces featured by client provider."
                      })
                    }),
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "700",
                      children: [
                        n && n.length > 0 && o.jsxs(E, {
                          direction: "Column",
                          gap: "400",
                          children: [
                            o.jsx(D, {
                              size: "H4",
                              children: "Featured Spaces"
                            }),
                            o.jsx(ME, {
                              children: n.map((l) => o.jsx(O8, {
                                roomIdOrAlias: l,
                                children: (c) => o.jsx(OE, {
                                  roomIdOrAlias: l,
                                  allRooms: r,
                                  avatarUrl: c == null ? void 0 : c.avatar_url,
                                  name: c == null ? void 0 : c.name,
                                  topic: c == null ? void 0 : c.topic,
                                  memberCount: c == null ? void 0 : c.num_joined_members,
                                  joinRule: c == null ? void 0 : c.join_rule,
                                  onView: a,
                                  renderTopicViewer: (d, u, h) => o.jsx(Vf, {
                                    name: d,
                                    topic: u,
                                    requestClose: h
                                  })
                                })
                              }, l))
                            })
                          ]
                        }),
                        e && e.length > 0 && o.jsxs(E, {
                          direction: "Column",
                          gap: "400",
                          children: [
                            o.jsx(D, {
                              size: "H4",
                              children: "Featured Rooms"
                            }),
                            o.jsx(ME, {
                              children: e.map((l) => o.jsx(O8, {
                                roomIdOrAlias: l,
                                children: (c) => o.jsx(OE, {
                                  roomIdOrAlias: l,
                                  allRooms: r,
                                  avatarUrl: c == null ? void 0 : c.avatar_url,
                                  name: c == null ? void 0 : c.name,
                                  topic: c == null ? void 0 : c.topic,
                                  memberCount: c == null ? void 0 : c.num_joined_members,
                                  joinRule: c == null ? void 0 : c.join_rule,
                                  onView: s,
                                  renderTopicViewer: (d, u, h) => o.jsx(Vf, {
                                    name: d,
                                    topic: u,
                                    requestClose: h
                                  })
                                })
                              }, l))
                            })
                          ]
                        }),
                        (n && n.length === 0 && e && e.length === 0 || !n && !e) && o.jsxs(E, {
                          className: Dge,
                          direction: "Column",
                          justifyContent: "Center",
                          alignItems: "Center",
                          gap: "200",
                          children: [
                            o.jsx(Q, {
                              size: "400",
                              src: q.Info
                            }),
                            o.jsx(D, {
                              size: "T300",
                              align: "Center",
                              children: "No rooms or spaces featured by client provider."
                            })
                          ]
                        })
                      ]
                    })
                  ]
                })
              })
            })
          })
        })
      ]
    });
  }
  function nft({ hideText: t }) {
    const e = gdt(), r = Ze(cv).length;
    return o.jsx(Is, {
      variant: "Background",
      radii: "400",
      highlight: r > 0,
      "aria-selected": e,
      children: o.jsx(Rf, {
        to: i3(),
        children: o.jsx(Bs, {
          children: o.jsxs(E, {
            as: "span",
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: [
              o.jsx(xn, {
                size: "200",
                radii: "400",
                style: t ? {
                  width: "100%",
                  padding: "0"
                } : {
                  height: "100%"
                },
                children: o.jsx(Q, {
                  src: q.Mail,
                  size: "100",
                  filled: e
                })
              }),
              !t && o.jsx(E, {
                as: "span",
                grow: "Yes",
                children: o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  truncate: true,
                  children: "Invites"
                })
              }),
              r > 0 && o.jsx(Sp, {
                highlight: true,
                count: r
              })
            ]
          })
        })
      })
    });
  }
  function rft() {
    I3("inbox");
    const t = cge(), [e, n] = Fe(ge, "roomSidebarWidth"), [r, i] = p.useState(e);
    p.useEffect(() => {
      i(e);
    }, [
      e
    ]);
    const s = fr() === sn.Mobile, l = r <= 80 && !s;
    return o.jsxs(E, {
      shrink: "No",
      style: {
        position: "relative",
        width: s ? "100%" : He(r)
      },
      children: [
        o.jsxs(qf, {
          children: [
            o.jsx(Kf, {
              children: o.jsx(E, {
                grow: "Yes",
                gap: "300",
                justifyContent: "Center",
                children: l ? o.jsx(Q, {
                  src: q.Inbox,
                  size: "200",
                  filled: true
                }) : o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(D, {
                    size: "H4",
                    truncate: true,
                    children: "Inbox"
                  })
                })
              })
            }),
            o.jsx(mh, {
              children: o.jsx(E, {
                direction: "Column",
                gap: "300",
                children: o.jsxs(ch, {
                  children: [
                    o.jsx(Is, {
                      variant: "Background",
                      radii: "400",
                      "aria-selected": t,
                      children: o.jsx(Rf, {
                        to: Tk(),
                        children: o.jsx(Bs, {
                          children: o.jsxs(E, {
                            as: "span",
                            grow: "Yes",
                            alignItems: "Center",
                            gap: "200",
                            children: [
                              o.jsx(xn, {
                                size: "200",
                                radii: "400",
                                style: l ? {
                                  width: "100%",
                                  padding: "0"
                                } : {
                                  height: "100%"
                                },
                                children: o.jsx(Q, {
                                  src: q.MessageUnread,
                                  size: "100",
                                  filled: t
                                })
                              }),
                              !l && o.jsx(E, {
                                as: "span",
                                grow: "Yes",
                                children: o.jsx(D, {
                                  as: "span",
                                  size: "Inherit",
                                  truncate: true,
                                  children: "Notifications"
                                })
                              })
                            ]
                          })
                        })
                      })
                    }),
                    o.jsx(nft, {
                      hideText: l
                    })
                  ]
                })
              })
            })
          ]
        }),
        !s && o.jsx(Zl, {
          setCurWidth: i,
          sidebarWidth: e,
          setSidebarWidth: n,
          instep: 80,
          outstep: 190,
          minValue: 50,
          maxValue: 500
        })
      ]
    });
  }
  const ift = (t, e) => {
    const n = p.useMemo(() => window.setInterval(t, e), [
      t,
      e
    ]);
    return p.useEffect(() => () => {
      window.clearInterval(n);
    }, [
      n
    ]), n;
  }, cQ = (t, e) => {
    const n = [];
    return t.forEach((r) => {
      if (r.event.type === ce.RoomMember || !e.has(r.room_id)) return;
      const i = n.length - 1, a = n[i];
      if (r.room_id === (a == null ? void 0 : a.roomId)) {
        a.notifications.push(r);
        return;
      }
      n.push({
        roomId: r.room_id,
        notifications: [
          r
        ]
      });
    }), n;
  }, oft = (t, e) => {
    const n = be(), r = Ze(zr), i = p.useMemo(() => new Set(r), [
      r
    ]), [a, s] = p.useState({
      groups: []
    }), l = p.useCallback((u, h, f) => {
      const g = {
        from: u,
        limit: h,
        only: f
      };
      return n.http.authedRequest(rt.Get, "/notifications", g);
    }, [
      n
    ]), c = p.useCallback(async (u) => {
      u || s({
        groups: []
      });
      const h = await l(u, t, e ? "highlight" : void 0), f = cQ(h.notifications, i);
      s((g) => g.nextToken === u ? {
        nextToken: h.next_token,
        groups: u ? g.groups.concat(f) : f
      } : g);
    }, [
      t,
      e,
      l,
      i
    ]), d = p.useCallback(async () => {
      const u = await l(void 0, t, e ? "highlight" : void 0), h = cQ(u.notifications, i);
      s({
        nextToken: u.next_token,
        groups: h
      });
    }, [
      t,
      e,
      l,
      i
    ]);
    return [
      a,
      c,
      d
    ];
  };
  function aft({ room: t, appBaseUrl: e, notifications: n, mediaAutoLoad: r, urlPreview: i, hideReads: a, onOpen: s, legacyUsernameColor: l, hour24Clock: c, dateFormatString: d }) {
    const u = be(), h = hn(), f = w3(t.roomId, qi), g = Ze(qr), m = Mo(t), v = ri(t), y = Ep(), w = yh(t, m), b = bh(t, v, m), j = yp(), k = Vk(j.kind, y, w), C = om(t.roomId), x = Xd(), S = p.useMemo(() => ({
      ...fs,
      render: em(e, (z) => _h(u, t.roomId, z, Jd(C), g), C)
    }), [
      e,
      u,
      t,
      C,
      g
    ]), T = p.useMemo(() => Ql(u, t.roomId, {
      settingsLinkBaseUrl: e,
      linkifyOpts: S,
      useAuthentication: h,
      handleSpoilerClick: x,
      handleMentionClick: C,
      nicknames: g
    }), [
      e,
      u,
      t,
      S,
      C,
      x,
      h,
      g
    ]), A = wS({
      [ce.RoomMessage]: (z, O, M) => {
        var _a6, _b3;
        return ((_a6 = z.unsigned) == null ? void 0 : _a6.redacted_because) ? o.jsx(ss, {
          reason: (_b3 = z.unsigned) == null ? void 0 : _b3.redacted_because.content.reason
        }) : o.jsx(oh, {
          displayName: O,
          msgType: z.content.msgtype ?? "",
          ts: z.origin_server_ts,
          getContent: M,
          mediaAutoLoad: r,
          urlPreview: i,
          htmlReactParserOptions: T,
          linkifyOpts: S,
          outlineAttachment: true
        });
      },
      [ce.RoomMessageEncrypted]: (z, O) => {
        const M = t.getTimelineForEvent(z.event_id), I = M == null ? void 0 : M.getEvents().find((N) => N.getId() === z.event_id);
        return !I || !M ? o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsxs(D, {
            size: "T400",
            priority: "300",
            children: [
              o.jsx("code", {
                className: nh,
                children: z.type
              }),
              " event"
            ]
          })
        }) : o.jsx(TS, {
          mEvent: I,
          children: () => {
            if (I.isRedacted()) return o.jsx(ss, {});
            if (I.getType() === ce.Sticker) return o.jsx(cp, {
              content: I.getContent(),
              renderImageContent: (N) => o.jsx(rh, {
                ...N,
                autoPlay: r,
                renderImage: (L) => o.jsx(as, {
                  ...L,
                  loading: "lazy"
                }),
                renderViewer: (L) => o.jsx(Yc, {
                  ...L
                })
              })
            });
            if (I.getType() === ce.RoomMessage) {
              const N = eh(z.event_id, I, M.getTimelineSet()), L = (() => (N == null ? void 0 : N.getContent()["m.new_content"]) ?? I.getContent());
              return o.jsx(oh, {
                displayName: O,
                msgType: I.getContent().msgtype ?? "",
                ts: I.getTs(),
                edited: !!N,
                getContent: L,
                mediaAutoLoad: r,
                urlPreview: i,
                htmlReactParserOptions: T,
                linkifyOpts: S
              });
            }
            return I.getType() === ce.RoomMessageEncrypted ? o.jsx(D, {
              children: o.jsx(UP, {})
            }) : o.jsx(D, {
              children: o.jsx(lF, {})
            });
          }
        });
      },
      [ce.Sticker]: (z, O, M) => {
        var _a6, _b3;
        return ((_a6 = z.unsigned) == null ? void 0 : _a6.redacted_because) ? o.jsx(ss, {
          reason: (_b3 = z.unsigned) == null ? void 0 : _b3.redacted_because.content.reason
        }) : o.jsx(cp, {
          content: M(),
          renderImageContent: (I) => o.jsx(rh, {
            ...I,
            autoPlay: r,
            renderImage: (N) => o.jsx(as, {
              ...N,
              loading: "lazy"
            }),
            renderViewer: (N) => o.jsx(Yc, {
              ...N
            })
          })
        });
      },
      [ce.RoomTombstone]: (z) => {
        const { content: O } = z;
        return o.jsx(E, {
          grow: "Yes",
          direction: "Column",
          children: o.jsxs(D, {
            size: "T400",
            priority: "300",
            children: [
              "Room Tombstone. ",
              O.body
            ]
          })
        });
      }
    }, void 0, (z) => {
      var _a6, _b3;
      return ((_a6 = z.unsigned) == null ? void 0 : _a6.redacted_because) ? o.jsx(ss, {
        reason: (_b3 = z.unsigned) == null ? void 0 : _b3.redacted_because.content.reason
      }) : o.jsx(E, {
        grow: "Yes",
        direction: "Column",
        children: o.jsxs(D, {
          size: "T400",
          priority: "300",
          children: [
            o.jsx("code", {
              className: nh,
              children: z.type
            }),
            " event"
          ]
        })
      });
    }), B = (z) => {
      const O = z.currentTarget.getAttribute("data-event-id");
      O && s(t.roomId, O);
    }, U = () => {
      As(u, t.roomId, a);
    };
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      children: [
        o.jsxs(wn, {
          size: "300",
          children: [
            o.jsxs(E, {
              gap: "200",
              grow: "Yes",
              children: [
                o.jsx(xn, {
                  size: "200",
                  radii: "300",
                  children: o.jsx(yi, {
                    roomId: t.roomId,
                    src: Sa(u, t, 96, h),
                    alt: t.name,
                    renderFallback: () => o.jsx(Ya, {
                      size: "50",
                      roomType: t.getType(),
                      joinRule: t.getJoinRule() ?? kn.Restricted,
                      filled: true
                    })
                  })
                }),
                o.jsx(D, {
                  size: "H4",
                  truncate: true,
                  children: t.name
                })
              ]
            }),
            o.jsx(E, {
              shrink: "No",
              children: f && o.jsx(Qe, {
                variant: "Primary",
                radii: "Pill",
                onClick: U,
                before: o.jsx(Q, {
                  size: "100",
                  src: q.CheckTwice
                }),
                children: o.jsx(D, {
                  size: "T200",
                  children: "Mark as Read"
                })
              })
            })
          ]
        }),
        o.jsx(E, {
          direction: "Column",
          gap: "100",
          children: n.map((z) => {
            var _a6;
            const { event: O } = z, M = gr(t, O.sender, g) ?? _n(O.sender) ?? O.sender, I = Jc(t, O.sender), N = (() => O.content), L = O.content["m.relates_to"], H = (_a6 = L == null ? void 0 : L["m.in_reply_to"]) == null ? void 0 : _a6.event_id, V = (L == null ? void 0 : L.rel_type) === Xn.Thread ? L.event_id : void 0, Z = O.content["m.mentions"], Y = b(O.sender), oe = (Y == null ? void 0 : Y.color) ? k == null ? void 0 : k.get(Y.color) : void 0, ue = (Y == null ? void 0 : Y.icon) ? qc(u, h, Y.icon) : void 0, ie = l ? _p(O.sender) : oe;
            return o.jsx(Te, {
              style: {
                padding: ee.space.S400
              },
              variant: "SurfaceVariant",
              direction: "Column",
              children: o.jsxs(Cp, {
                before: o.jsx(s3, {
                  children: o.jsx(xn, {
                    size: "300",
                    children: o.jsx(Si, {
                      userId: O.sender,
                      src: I ? Cn(u, I, h, 48, 48, "crop") ?? void 0 : void 0,
                      alt: M,
                      renderFallback: () => o.jsx(Q, {
                        size: "200",
                        src: q.User,
                        filled: true
                      })
                    })
                  })
                }),
                children: [
                  o.jsxs(E, {
                    gap: "300",
                    justifyContent: "SpaceBetween",
                    alignItems: "Center",
                    grow: "Yes",
                    children: [
                      o.jsxs(E, {
                        gap: "200",
                        alignItems: "Baseline",
                        children: [
                          o.jsxs(E, {
                            alignItems: "Center",
                            gap: "200",
                            children: [
                              o.jsx(l3, {
                                style: {
                                  color: ie
                                },
                                children: o.jsx(D, {
                                  as: "span",
                                  truncate: true,
                                  children: o.jsx(iF, {
                                    children: M
                                  })
                                })
                              }),
                              ue && o.jsx(Zc, {
                                size: "100",
                                iconSrc: ue
                              })
                            ]
                          }),
                          o.jsx(Ma, {
                            ts: O.origin_server_ts,
                            hour24Clock: c,
                            dateFormatString: d
                          })
                        ]
                      }),
                      o.jsx(E, {
                        shrink: "No",
                        gap: "200",
                        alignItems: "Center",
                        children: o.jsx(Qe, {
                          "data-event-id": O.event_id,
                          onClick: B,
                          variant: "Secondary",
                          radii: "400",
                          children: o.jsx(D, {
                            size: "T200",
                            children: "Open"
                          })
                        })
                      })
                    ]
                  }),
                  H && o.jsx(Pu, {
                    room: t,
                    replyEventId: H,
                    threadRootId: V,
                    mentions: Z,
                    onClick: B
                  }),
                  A(O.type, false, O, M, N)
                ]
              })
            }, z.event.event_id);
          })
        })
      ]
    });
  }
  const sft = (t) => p.useMemo(() => ({
    only: t.get("only") ?? void 0
  }), [
    t
  ]), lft = 2500;
  function cft() {
    var _a6;
    const t = be(), [e] = Fe(ge, "hideReads"), [n] = Fe(ge, "mediaAutoLoad"), [r] = Fe(ge, "urlPreview"), [i] = Fe(ge, "legacyUsernameColor"), [a] = Fe(ge, "hour24Clock"), [s] = Fe(ge, "dateFormatString"), l = fr(), c = Ze(gi), d = gs(), { navigateRoom: u } = Wi(), [h, f] = fh(), g = sft(h), m = p.useRef(null), v = p.useRef(null), y = g.only === "highlight", w = (U) => {
      if (U) {
        f(new URLSearchParams({
          only: "highlight"
        }));
        return;
      }
      f();
    }, [b, j, k] = oft(24, y), [C, x] = Et(j), S = nc({
      count: b.groups.length,
      getScrollElement: () => m.current,
      estimateSize: () => 40,
      overscan: 4
    }), T = S.getVirtualItems();
    ift(p.useCallback(() => {
      k();
    }, [
      k
    ]), lft), p.useEffect(() => {
      x();
    }, [
      x
    ]);
    const B = (_a6 = T.at(-1)) == null ? void 0 : _a6.index;
    return p.useEffect(() => {
      C.status === ve.Success && b.groups.length - 1 === B && b.nextToken && x(b.nextToken);
    }, [
      C,
      b,
      B,
      x
    ]), o.jsxs(si, {
      children: [
        o.jsx(_i, {
          balance: true,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No",
                children: l === sn.Mobile && o.jsx(ic, {
                  children: (U) => o.jsx(Oe, {
                    onClick: U,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsxs(E, {
                alignItems: "Center",
                gap: "200",
                children: [
                  l !== sn.Mobile && o.jsx(Q, {
                    size: "400",
                    src: q.Message
                  }),
                  o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: "Notification Messages"
                  })
                ]
              }),
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              })
            ]
          })
        }),
        o.jsx(E, {
          style: {
            position: "relative"
          },
          grow: "Yes",
          children: o.jsx(dn, {
            ref: m,
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "200",
                  children: [
                    o.jsxs(E, {
                      ref: v,
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx("span", {
                          "data-spacing-node": true
                        }),
                        o.jsx(D, {
                          size: "L400",
                          children: "Filter"
                        }),
                        o.jsxs(E, {
                          gap: "200",
                          children: [
                            o.jsx(Qe, {
                              onClick: () => w(false),
                              variant: y ? "Surface" : "Success",
                              "aria-pressed": !y,
                              before: !y && o.jsx(Q, {
                                size: "100",
                                src: q.Check
                              }),
                              outlined: true,
                              children: o.jsx(D, {
                                size: "T200",
                                children: "All Notifications"
                              })
                            }),
                            o.jsx(Qe, {
                              onClick: () => w(true),
                              variant: y ? "Success" : "Surface",
                              "aria-pressed": y,
                              before: y && o.jsx(Q, {
                                size: "100",
                                src: q.Check
                              }),
                              outlined: true,
                              children: o.jsx(D, {
                                size: "T200",
                                children: "Highlighted"
                              })
                            })
                          ]
                        })
                      ]
                    }),
                    o.jsx(A3, {
                      scrollRef: m,
                      anchorRef: v,
                      children: o.jsx(Oe, {
                        onClick: () => S.scrollToOffset(0),
                        variant: "SurfaceVariant",
                        radii: "Pill",
                        outlined: true,
                        size: "300",
                        "aria-label": "Scroll to Top",
                        children: o.jsx(Q, {
                          src: q.ChevronTop,
                          size: "300"
                        })
                      })
                    }),
                    o.jsx("div", {
                      style: {
                        position: "relative",
                        height: S.getTotalSize()
                      },
                      children: T.map((U) => {
                        const z = b.groups[U.index];
                        if (!z) return null;
                        const O = t.getRoom(z.roomId);
                        return O ? o.jsx(Rs, {
                          virtualItem: U,
                          style: {
                            paddingTop: ee.space.S500
                          },
                          ref: S.measureElement,
                          children: o.jsx(aft, {
                            room: O,
                            appBaseUrl: d,
                            notifications: z.notifications,
                            mediaAutoLoad: n,
                            urlPreview: r,
                            hideReads: e,
                            onOpen: u,
                            legacyUsernameColor: i || c.has(O.roomId),
                            hour24Clock: a,
                            dateFormatString: s
                          })
                        }, U.index) : null;
                      })
                    }),
                    C.status === ve.Success && b.groups.length === 0 && o.jsxs(E, {
                      className: ro({
                        variant: "SurfaceVariant"
                      }),
                      style: {
                        padding: ee.space.S300,
                        borderRadius: ee.radii.R400
                      },
                      direction: "Column",
                      gap: "200",
                      children: [
                        o.jsx(D, {
                          children: "No Notifications"
                        }),
                        o.jsx(D, {
                          size: "T200",
                          children: "You don't have any new notifications to display yet."
                        })
                      ]
                    }),
                    C.status === ve.Loading && o.jsx(E, {
                      direction: "Column",
                      gap: "100",
                      children: Array.from({
                        length: 8
                      }).map(() => o.jsx(Te, {
                        variant: "SurfaceVariant",
                        style: {
                          minHeight: He(80)
                        }
                      }, crypto.randomUUID()))
                    }),
                    C.status === ve.Error && o.jsxs(E, {
                      className: ro({
                        variant: "Critical"
                      }),
                      style: {
                        padding: ee.space.S300,
                        borderRadius: ee.radii.R400
                      },
                      direction: "Column",
                      gap: "200",
                      children: [
                        o.jsx(D, {
                          size: "L400",
                          children: C.error.name
                        }),
                        o.jsx(D, {
                          size: "T300",
                          children: C.error.message
                        })
                      ]
                    })
                  ]
                })
              })
            })
          })
        })
      ]
    });
  }
  const dft = [
    "4r5e",
    "5h1t",
    "5hit",
    "a55",
    "anal",
    "anus",
    "ar5e",
    "arrse",
    "arse",
    "ass",
    "ass-fucker",
    "asses",
    "assfucker",
    "assfukka",
    "asshole",
    "assholes",
    "asswhole",
    "a_s_s",
    "b!tch",
    "b00bs",
    "b17ch",
    "b1tch",
    "ballbag",
    "balls",
    "ballsack",
    "bastard",
    "beastial",
    "beastiality",
    "bellend",
    "bestial",
    "bestiality",
    "bi+ch",
    "biatch",
    "bitch",
    "bitcher",
    "bitchers",
    "bitches",
    "bitchin",
    "bitching",
    "bloody",
    "blow job",
    "blowjob",
    "blowjobs",
    "boiolas",
    "bollock",
    "bollok",
    "boner",
    "boob",
    "boobs",
    "booobs",
    "boooobs",
    "booooobs",
    "booooooobs",
    "breasts",
    "buceta",
    "bugger",
    "bum",
    "bunny fucker",
    "butt",
    "butthole",
    "buttmuch",
    "buttplug",
    "c0ck",
    "c0cksucker",
    "carpet muncher",
    "cawk",
    "chink",
    "cipa",
    "cl1t",
    "clit",
    "clitoris",
    "clits",
    "cnut",
    "cock",
    "cock-sucker",
    "cockface",
    "cockhead",
    "cockmunch",
    "cockmuncher",
    "cocks",
    "cocksuck",
    "cocksucked",
    "cocksucker",
    "cocksucking",
    "cocksucks",
    "cocksuka",
    "cocksukka",
    "cok",
    "cokmuncher",
    "coksucka",
    "coon",
    "cox",
    "crap",
    "cum",
    "cummer",
    "cumming",
    "cums",
    "cumshot",
    "cunilingus",
    "cunillingus",
    "cunnilingus",
    "cunt",
    "cuntlick",
    "cuntlicker",
    "cuntlicking",
    "cunts",
    "cyalis",
    "cyberfuc",
    "cyberfuck",
    "cyberfucked",
    "cyberfucker",
    "cyberfuckers",
    "cyberfucking",
    "d1ck",
    "damn",
    "dick",
    "dickhead",
    "dildo",
    "dildos",
    "dink",
    "dinks",
    "dirsa",
    "dlck",
    "dog-fucker",
    "doggin",
    "dogging",
    "donkeyribber",
    "doosh",
    "duche",
    "dyke",
    "ejaculate",
    "ejaculated",
    "ejaculates",
    "ejaculating",
    "ejaculatings",
    "ejaculation",
    "ejakulate",
    "f u c k",
    "f u c k e r",
    "f4nny",
    "fag",
    "fagging",
    "faggitt",
    "faggot",
    "faggs",
    "fagot",
    "fagots",
    "fags",
    "fanny",
    "fannyflaps",
    "fannyfucker",
    "fanyy",
    "fatass",
    "fcuk",
    "fcuker",
    "fcuking",
    "feck",
    "fecker",
    "felching",
    "fellate",
    "fellatio",
    "fingerfuck",
    "fingerfucked",
    "fingerfucker",
    "fingerfuckers",
    "fingerfucking",
    "fingerfucks",
    "fistfuck",
    "fistfucked",
    "fistfucker",
    "fistfuckers",
    "fistfucking",
    "fistfuckings",
    "fistfucks",
    "flange",
    "fook",
    "fooker",
    "fuck",
    "fucka",
    "fucked",
    "fucker",
    "fuckers",
    "fuckhead",
    "fuckheads",
    "fuckin",
    "fucking",
    "fuckings",
    "fuckingshitmotherfucker",
    "fuckme",
    "fucks",
    "fuckwhit",
    "fuckwit",
    "fudge packer",
    "fudgepacker",
    "fuk",
    "fuker",
    "fukker",
    "fukkin",
    "fuks",
    "fukwhit",
    "fukwit",
    "fux",
    "fux0r",
    "f_u_c_k",
    "gangbang",
    "gangbanged",
    "gangbangs",
    "gaylord",
    "gaysex",
    "goatse",
    "God",
    "god-dam",
    "god-damned",
    "goddamn",
    "goddamned",
    "hardcoresex",
    "hell",
    "heshe",
    "hoar",
    "hoare",
    "hoer",
    "homo",
    "hore",
    "horniest",
    "horny",
    "hotsex",
    "jack-off",
    "jackoff",
    "jap",
    "jerk-off",
    "jism",
    "jiz",
    "jizm",
    "jizz",
    "kawk",
    "knob",
    "knobead",
    "knobed",
    "knobend",
    "knobhead",
    "knobjocky",
    "knobjokey",
    "kock",
    "kondum",
    "kondums",
    "kum",
    "kummer",
    "kumming",
    "kums",
    "kunilingus",
    "l3i+ch",
    "l3itch",
    "labia",
    "lust",
    "lusting",
    "m0f0",
    "m0fo",
    "m45terbate",
    "ma5terb8",
    "ma5terbate",
    "masochist",
    "master-bate",
    "masterb8",
    "masterbat*",
    "masterbat3",
    "masterbate",
    "masterbation",
    "masterbations",
    "masturbate",
    "mo-fo",
    "mof0",
    "mofo",
    "mothafuck",
    "mothafucka",
    "mothafuckas",
    "mothafuckaz",
    "mothafucked",
    "mothafucker",
    "mothafuckers",
    "mothafuckin",
    "mothafucking",
    "mothafuckings",
    "mothafucks",
    "mother fucker",
    "motherfuck",
    "motherfucked",
    "motherfucker",
    "motherfuckers",
    "motherfuckin",
    "motherfucking",
    "motherfuckings",
    "motherfuckka",
    "motherfucks",
    "muff",
    "mutha",
    "muthafecker",
    "muthafuckker",
    "muther",
    "mutherfucker",
    "n1gga",
    "n1gger",
    "nazi",
    "nigg3r",
    "nigg4h",
    "nigga",
    "niggah",
    "niggas",
    "niggaz",
    "nigger",
    "niggers",
    "nob",
    "nob jokey",
    "nobhead",
    "nobjocky",
    "nobjokey",
    "numbnuts",
    "nutsack",
    "orgasim",
    "orgasims",
    "orgasm",
    "orgasms",
    "p0rn",
    "pawn",
    "pecker",
    "penis",
    "penisfucker",
    "phonesex",
    "phuck",
    "phuk",
    "phuked",
    "phuking",
    "phukked",
    "phukking",
    "phuks",
    "phuq",
    "pigfucker",
    "pimpis",
    "piss",
    "pissed",
    "pisser",
    "pissers",
    "pisses",
    "pissflaps",
    "pissin",
    "pissing",
    "pissoff",
    "poop",
    "porn",
    "porno",
    "pornography",
    "pornos",
    "prick",
    "pricks",
    "pron",
    "pube",
    "pusse",
    "pussi",
    "pussies",
    "pussy",
    "pussys",
    "rectum",
    "retard",
    "rimjaw",
    "rimming",
    "s hit",
    "s.o.b.",
    "sadist",
    "schlong",
    "screwing",
    "scroat",
    "scrote",
    "scrotum",
    "semen",
    "sex",
    "sh!+",
    "sh!t",
    "sh1t",
    "shag",
    "shagger",
    "shaggin",
    "shagging",
    "shemale",
    "shi+",
    "shit",
    "shitdick",
    "shite",
    "shited",
    "shitey",
    "shitfuck",
    "shitfull",
    "shithead",
    "shiting",
    "shitings",
    "shits",
    "shitted",
    "shitter",
    "shitters",
    "shitting",
    "shittings",
    "shitty",
    "skank",
    "slut",
    "sluts",
    "smegma",
    "smut",
    "snatch",
    "son-of-a-bitch",
    "spac",
    "spunk",
    "s_h_i_t",
    "t1tt1e5",
    "t1tties",
    "teets",
    "teez",
    "testical",
    "testicle",
    "tit",
    "titfuck",
    "tits",
    "titt",
    "tittie5",
    "tittiefucker",
    "titties",
    "tittyfuck",
    "tittywank",
    "titwank",
    "tosser",
    "turd",
    "tw4t",
    "twat",
    "twathead",
    "twatty",
    "twunt",
    "twunter",
    "v14gra",
    "v1gra",
    "vagina",
    "viagra",
    "vulva",
    "w00se",
    "wang",
    "wank",
    "wanker",
    "wanky",
    "whoar",
    "whore",
    "willies",
    "willy",
    "xrated",
    "xxx"
  ], dQ = [
    "torture",
    "t0rture"
  ], uft = dQ.concat(dft.filter((t) => !dQ.includes(t))), hft = new RegExp(`(\\b|_)(${uft.map((t) => ob(t)).join("|")})(\\b|_)`, "g"), ay = (t) => !!t.toLowerCase().match(hft), fft = () => {
    const { versions: t, unstable_features: e } = Dk();
    return (e == null ? void 0 : e["org.matrix.msc4151"]) || t.includes("v1.13");
  }, uQ = 548, mft = (t, e, n, r) => {
    var _a6, _b3, _c3;
    const i = t.getSafeUserId(), a = iie(e, i), s = a ? Jf(t, e, 96, n) : Sa(t, e, 96, n), l = e.name || e.getCanonicalAlias() || e.roomId, c = ((_b3 = (_a6 = ni(e, ce.RoomTopic)) == null ? void 0 : _a6.getContent()) == null ? void 0 : _b3.topic) ?? void 0, u = (_c3 = e.getMember(i)) == null ? void 0 : _c3.events.member, h = u == null ? void 0 : u.getContent(), f = u == null ? void 0 : u.getSender(), g = f ? gr(e, f, r) ?? _n(f) ?? f : void 0, m = u == null ? void 0 : u.getTs(), v = h && "reason" in h && typeof h.reason == "string" ? h.reason : void 0;
    return {
      room: e,
      roomId: e.roomId,
      roomAvatar: s,
      roomName: l,
      roomTopic: c,
      roomAlias: e.getCanonicalAlias() ?? void 0,
      senderId: f ?? "Unknown",
      senderName: g ?? "Unknown",
      inviteTs: m,
      reason: v,
      isSpace: Uu(e),
      isDirect: a,
      isEncrypted: !!ni(e, ce.RoomEncryption)
    };
  }, gft = (t) => ay(t.roomName) || ay(t.roomTopic ?? "") || ay(t.senderName) || ay(t.senderId) || ay(t.reason || "");
  function gL({ invite: t, compact: e, hour24Clock: n, dateFormatString: r, onNavigate: i, hideAvatar: a }) {
    const s = be(), l = s.getSafeUserId(), [c, d] = p.useState(false), u = () => d(false), h = () => d(true), [f, g] = Et(p.useCallback(async () => {
      const b = iie(t.room, l) ? zB(t.room, l) : void 0;
      await s.joinRoom(t.roomId), b && await c4(s, t.roomId, b), i(t.roomId, t.isSpace);
    }, [
      s,
      t,
      l,
      i
    ])), [m, v] = Et(p.useCallback(() => s.leave(t.roomId), [
      s,
      t
    ])), y = f.status === ve.Loading || f.status === ve.Success, w = m.status === ve.Loading || m.status === ve.Success;
    return o.jsxs(Te, {
      variant: "SurfaceVariant",
      direction: "Column",
      gap: "300",
      style: {
        padding: ee.space.S400
      },
      children: [
        (t.isEncrypted || t.isDirect || t.isSpace) && o.jsxs(E, {
          gap: "200",
          alignItems: "Center",
          children: [
            t.isEncrypted && o.jsx(E, {
              shrink: "No",
              alignItems: "Center",
              justifyContent: "Center",
              children: o.jsx(Rn, {
                variant: "Success",
                fill: "Solid",
                size: "400",
                radii: "300",
                children: o.jsx(D, {
                  size: "L400",
                  children: "Encrypted"
                })
              })
            }),
            t.isDirect && o.jsx(E, {
              shrink: "No",
              alignItems: "Center",
              justifyContent: "Center",
              children: o.jsx(Rn, {
                variant: "Primary",
                fill: "Solid",
                size: "400",
                radii: "300",
                children: o.jsx(D, {
                  size: "L400",
                  children: "Direct Message"
                })
              })
            }),
            t.isSpace && o.jsx(E, {
              shrink: "No",
              alignItems: "Center",
              justifyContent: "Center",
              children: o.jsx(Rn, {
                variant: "Secondary",
                fill: "Soft",
                size: "400",
                radii: "300",
                children: o.jsx(D, {
                  size: "L400",
                  children: "Space"
                })
              })
            })
          ]
        }),
        o.jsxs(E, {
          gap: "300",
          children: [
            o.jsx(xn, {
              size: "300",
              children: o.jsx(yi, {
                roomId: t.roomId,
                src: a ? void 0 : t.roomAvatar,
                alt: t.roomName,
                renderFallback: () => o.jsx(D, {
                  as: "span",
                  size: "H6",
                  children: Vi(a && t.roomAvatar ? void 0 : t.roomName)
                })
              })
            }),
            o.jsxs(E, {
              direction: e ? "Column" : "Row",
              grow: "Yes",
              gap: "200",
              children: [
                o.jsxs(E, {
                  grow: "Yes",
                  direction: "Column",
                  gap: "200",
                  children: [
                    o.jsxs(E, {
                      direction: "Column",
                      children: [
                        o.jsx(D, {
                          size: "T300",
                          truncate: true,
                          children: o.jsx("b", {
                            children: t.roomName
                          })
                        }),
                        t.roomTopic && o.jsx(D, {
                          size: "T200",
                          onClick: h,
                          onKeyDown: Vb(h),
                          tabIndex: 0,
                          truncate: true,
                          children: t.roomTopic
                        }),
                        o.jsx(Hn, {
                          open: c,
                          backdrop: o.jsx($n, {}),
                          children: o.jsx(Wn, {
                            children: o.jsx(Ft, {
                              focusTrapOptions: {
                                initialFocus: false,
                                clickOutsideDeactivates: true,
                                onDeactivate: u,
                                escapeDeactivates: kt
                              },
                              children: o.jsx(Vf, {
                                name: t.roomName,
                                topic: t.roomTopic ?? "",
                                requestClose: u
                              })
                            })
                          })
                        })
                      ]
                    }),
                    f.status === ve.Error && o.jsx(D, {
                      size: "T200",
                      style: {
                        color: ct.Critical.Main
                      },
                      children: f.error.message
                    }),
                    m.status === ve.Error && o.jsx(D, {
                      size: "T200",
                      style: {
                        color: ct.Critical.Main
                      },
                      children: m.error.message
                    })
                  ]
                }),
                o.jsxs(E, {
                  gap: "200",
                  shrink: "No",
                  alignItems: "Center",
                  children: [
                    o.jsx(xe, {
                      onClick: v,
                      size: "300",
                      variant: "Secondary",
                      radii: "300",
                      fill: "Soft",
                      disabled: y || w,
                      before: w ? o.jsx(dt, {
                        variant: "Secondary",
                        size: "100"
                      }) : void 0,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Decline"
                      })
                    }),
                    o.jsx(xe, {
                      onClick: g,
                      size: "300",
                      variant: "Success",
                      fill: "Soft",
                      radii: "300",
                      outlined: true,
                      disabled: y || w,
                      before: y ? o.jsx(dt, {
                        variant: "Success",
                        fill: "Soft",
                        size: "100"
                      }) : void 0,
                      children: o.jsx(D, {
                        size: "B300",
                        children: "Accept"
                      })
                    })
                  ]
                })
              ]
            })
          ]
        }),
        o.jsxs(E, {
          direction: "Column",
          children: [
            o.jsxs(E, {
              gap: "200",
              alignItems: "Baseline",
              children: [
                o.jsx(E, {
                  grow: "Yes",
                  children: o.jsxs(D, {
                    size: "T200",
                    priority: "300",
                    children: [
                      "From: ",
                      o.jsx("b", {
                        children: t.senderId
                      })
                    ]
                  })
                }),
                typeof t.inviteTs == "number" && t.inviteTs !== 0 && o.jsx(E, {
                  shrink: "No",
                  children: o.jsx(Ma, {
                    size: "T200",
                    ts: t.inviteTs,
                    hour24Clock: n,
                    dateFormatString: r,
                    priority: "300"
                  })
                })
              ]
            }),
            t.reason && o.jsxs(D, {
              size: "T200",
              priority: "300",
              children: [
                "Reason: ",
                t.reason
              ]
            })
          ]
        })
      ]
    });
  }
  function pft({ filter: t, onFilter: e, knownInvites: n, unknownInvites: r, spamInvites: i }) {
    const a = t === 0, s = t === 1, l = t === 2;
    return o.jsxs(E, {
      gap: "200",
      children: [
        o.jsx(Qe, {
          variant: a ? "Success" : "Surface",
          "aria-selected": a,
          outlined: !a,
          onClick: () => e(0),
          before: a && o.jsx(Q, {
            size: "100",
            src: q.Check
          }),
          after: n.length > 0 && o.jsx(Rn, {
            variant: a ? "Success" : "Secondary",
            fill: "Solid",
            radii: "Pill",
            children: o.jsx(D, {
              size: "L400",
              children: n.length
            })
          }),
          children: o.jsx(D, {
            size: "T200",
            children: "Primary"
          })
        }),
        o.jsx(Qe, {
          variant: s ? "Warning" : "Surface",
          "aria-selected": s,
          outlined: !s,
          onClick: () => e(1),
          before: s && o.jsx(Q, {
            size: "100",
            src: q.Check
          }),
          after: r.length > 0 && o.jsx(Rn, {
            variant: s ? "Warning" : "Secondary",
            fill: "Solid",
            radii: "Pill",
            children: o.jsx(D, {
              size: "L400",
              children: r.length
            })
          }),
          children: o.jsx(D, {
            size: "T200",
            children: "Public"
          })
        }),
        o.jsx(Qe, {
          variant: l ? "Critical" : "Surface",
          "aria-selected": l,
          outlined: !l,
          onClick: () => e(2),
          before: l && o.jsx(Q, {
            size: "100",
            src: q.Check
          }),
          after: i.length > 0 && o.jsx(Rn, {
            variant: l ? "Critical" : "Secondary",
            fill: "Solid",
            radii: "Pill",
            children: o.jsx(D, {
              size: "L400",
              children: i.length
            })
          }),
          children: o.jsx(D, {
            size: "T200",
            children: "Spam"
          })
        })
      ]
    });
  }
  function Fft({ invites: t, handleNavigate: e, compact: n, hour24Clock: r, dateFormatString: i }) {
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      children: [
        o.jsx(D, {
          size: "H4",
          children: "Primary"
        }),
        t.length > 0 ? o.jsx(E, {
          direction: "Column",
          gap: "100",
          children: t.map((a) => o.jsx(gL, {
            invite: a,
            compact: n,
            hour24Clock: r,
            dateFormatString: i,
            onNavigate: e,
            hideAvatar: false
          }, a.roomId))
        }) : o.jsx(tk, {
          children: o.jsx(Uc, {
            children: o.jsx(Vc, {
              icon: o.jsx(Q, {
                size: "600",
                src: q.Mail
              }),
              title: "No Invites",
              subTitle: "When someone you share a room with sends you an invite, it\u2019ll show up here."
            })
          })
        })
      ]
    });
  }
  function vft({ invites: t, handleNavigate: e, compact: n, hour24Clock: r, dateFormatString: i }) {
    const a = be(), [s, l] = Et(p.useCallback(async () => {
      const d = t.map((u) => u.roomId);
      await Hu(d, (u) => a.leave(u));
    }, [
      a,
      t
    ])), c = s.status === ve.Loading;
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      children: [
        o.jsxs(E, {
          gap: "200",
          justifyContent: "SpaceBetween",
          alignItems: "Center",
          children: [
            o.jsx(D, {
              size: "H4",
              children: "Public"
            }),
            o.jsx(E, {
              children: t.length > 0 && o.jsx(Qe, {
                variant: "SurfaceVariant",
                onClick: l,
                before: c && o.jsx(dt, {
                  size: "50",
                  variant: "Secondary",
                  fill: "Soft"
                }),
                disabled: c,
                radii: "Pill",
                children: o.jsx(D, {
                  size: "T200",
                  children: "Decline All"
                })
              })
            })
          ]
        }),
        t.length > 0 ? o.jsx(E, {
          direction: "Column",
          gap: "100",
          children: t.map((d) => o.jsx(gL, {
            invite: d,
            compact: n,
            hour24Clock: r,
            dateFormatString: i,
            onNavigate: e,
            hideAvatar: true
          }, d.roomId))
        }) : o.jsx(tk, {
          children: o.jsx(Uc, {
            children: o.jsx(Vc, {
              icon: o.jsx(Q, {
                size: "600",
                src: q.Info
              }),
              title: "No Invites",
              subTitle: "Invites from people outside your rooms will appear here."
            })
          })
        })
      ]
    });
  }
  function _ft({ invites: t, handleNavigate: e, compact: n, hour24Clock: r, dateFormatString: i }) {
    const a = be(), [s, l] = p.useState(false), c = fft(), [d, u] = Et(p.useCallback(async () => {
      const C = t.map((x) => x.roomId);
      await Hu(C, (x) => a.leave(x));
    }, [
      a,
      t
    ])), [h, f] = Et(p.useCallback(async () => {
      const C = t.map((x) => x.roomId);
      await Hu(C, (x) => a.reportRoom(x, "Spam Invite"));
    }, [
      a,
      t
    ])), g = kp(), m = Array.from(new Set(t.map((C) => C.senderId))).filter((C) => !g.includes(C)), [v, y] = Et(p.useCallback(() => a.setIgnoredUsers([
      ...g,
      ...m
    ]), [
      a,
      g,
      m
    ])), w = d.status === ve.Loading, b = h.status === ve.Loading, j = v.status === ve.Loading, k = j || b || w;
    return o.jsxs(E, {
      direction: "Column",
      gap: "200",
      children: [
        o.jsx(D, {
          size: "H4",
          children: "Spam"
        }),
        t.length > 0 ? o.jsxs(E, {
          direction: "Column",
          gap: "100",
          children: [
            o.jsx(Te, {
              variant: "SurfaceVariant",
              direction: "Column",
              gap: "300",
              style: {
                padding: `${ee.space.S400} ${ee.space.S400} 0`
              },
              children: o.jsx(Uc, {
                children: o.jsxs(Vc, {
                  icon: o.jsx(Q, {
                    size: "600",
                    src: q.Warning
                  }),
                  title: `${t.length} Spam Invites`,
                  subTitle: "Some of the following invites may contain harmful content or have been sent by banned users.",
                  children: [
                    o.jsxs(E, {
                      direction: "Row",
                      gap: "200",
                      justifyContent: "Center",
                      wrap: "Wrap",
                      children: [
                        o.jsx(xe, {
                          size: "300",
                          variant: "Critical",
                          fill: "Solid",
                          radii: "300",
                          onClick: u,
                          before: w && o.jsx(dt, {
                            size: "100",
                            variant: "Critical",
                            fill: "Solid"
                          }),
                          disabled: k,
                          children: o.jsx(D, {
                            size: "B300",
                            truncate: true,
                            children: "Decline All"
                          })
                        }),
                        c && h.status !== ve.Success && o.jsx(xe, {
                          size: "300",
                          variant: "Secondary",
                          fill: "Solid",
                          radii: "300",
                          onClick: f,
                          before: b && o.jsx(dt, {
                            size: "100",
                            variant: "Secondary",
                            fill: "Solid"
                          }),
                          disabled: k,
                          children: o.jsx(D, {
                            size: "B300",
                            truncate: true,
                            children: "Report All"
                          })
                        }),
                        m.length > 0 && o.jsx(xe, {
                          size: "300",
                          variant: "Secondary",
                          fill: "Solid",
                          radii: "300",
                          disabled: k,
                          onClick: y,
                          before: j && o.jsx(dt, {
                            size: "100",
                            variant: "Secondary",
                            fill: "Solid"
                          }),
                          children: o.jsx(D, {
                            size: "B300",
                            truncate: true,
                            children: "Block All"
                          })
                        })
                      ]
                    }),
                    o.jsx("span", {
                      "data-spacing-node": true
                    }),
                    o.jsx(xe, {
                      size: "300",
                      variant: "Secondary",
                      fill: "Soft",
                      radii: "Pill",
                      before: o.jsx(Q, {
                        size: "100",
                        src: s ? q.ChevronTop : q.ChevronBottom
                      }),
                      onClick: () => l(!s),
                      children: o.jsx(D, {
                        size: "B300",
                        children: s ? "Hide All" : "View All"
                      })
                    })
                  ]
                })
              })
            }),
            s && t.map((C) => o.jsx(gL, {
              invite: C,
              compact: n,
              hour24Clock: r,
              dateFormatString: i,
              onNavigate: e,
              hideAvatar: true
            }, C.roomId))
          ]
        }) : o.jsx(tk, {
          children: o.jsx(Uc, {
            children: o.jsx(Vc, {
              icon: o.jsx(Q, {
                size: "600",
                src: q.Warning
              }),
              title: "No Spam Invites",
              subTitle: "Invites detected as spam appear here."
            })
          })
        })
      ]
    });
  }
  function yft() {
    const t = be(), e = hn(), { navigateRoom: n, navigateSpace: r } = Wi(), i = Ze(zr), a = Ze(cv), s = Ze(qr), [l, c] = p.useState(0), d = a.map((k) => t.getRoom(k)).filter((k) => !!k).map((k) => mft(t, k, e, s)), [u, h, f] = p.useMemo(() => {
      const k = [], C = [], x = [];
      return d.forEach((S) => {
        if (gft(S) || q4e(t, i, S.senderId)) {
          x.push(S);
          return;
        }
        if (W4e(t, i, S.senderId).length === 0) {
          C.push(S);
          return;
        }
        k.push(S);
      }), [
        k,
        C,
        x
      ];
    }, [
      t,
      i,
      d
    ]), g = p.useRef(null), [m, v] = p.useState(document.body.clientWidth <= uQ);
    gp(p.useCallback(() => g.current, []), p.useCallback((k) => v(k <= uQ), []));
    const y = fr(), [w] = Fe(ge, "hour24Clock"), [b] = Fe(ge, "dateFormatString"), j = (k, C) => {
      if (C) {
        r(k);
        return;
      }
      n(k);
    };
    return o.jsxs(si, {
      children: [
        o.jsx(_i, {
          balance: true,
          children: o.jsxs(E, {
            grow: "Yes",
            gap: "200",
            children: [
              o.jsx(E, {
                grow: "Yes",
                basis: "No",
                children: y === sn.Mobile && o.jsx(ic, {
                  children: (k) => o.jsx(Oe, {
                    onClick: k,
                    children: o.jsx(Q, {
                      src: q.ArrowLeft
                    })
                  })
                })
              }),
              o.jsxs(E, {
                alignItems: "Center",
                gap: "200",
                children: [
                  y !== sn.Mobile && o.jsx(Q, {
                    size: "400",
                    src: q.Mail
                  }),
                  o.jsx(D, {
                    size: "H3",
                    truncate: true,
                    children: "Invites"
                  })
                ]
              }),
              o.jsx(E, {
                grow: "Yes",
                basis: "No"
              })
            ]
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsxs(E, {
                  ref: g,
                  direction: "Column",
                  gap: "600",
                  children: [
                    o.jsxs(E, {
                      direction: "Column",
                      gap: "100",
                      children: [
                        o.jsx("span", {
                          "data-spacing-node": true
                        }),
                        o.jsx(D, {
                          size: "L400",
                          children: "Filter"
                        }),
                        o.jsx(pft, {
                          filter: l,
                          onFilter: c,
                          knownInvites: u,
                          unknownInvites: h,
                          spamInvites: f
                        })
                      ]
                    }),
                    l === 0 && o.jsx(Fft, {
                      invites: u,
                      compact: m,
                      hour24Clock: w,
                      dateFormatString: b,
                      handleNavigate: j
                    }),
                    l === 1 && o.jsx(vft, {
                      invites: h,
                      compact: m,
                      hour24Clock: w,
                      dateFormatString: b,
                      handleNavigate: j
                    }),
                    l === 2 && o.jsx(_ft, {
                      invites: f,
                      compact: m,
                      hour24Clock: w,
                      dateFormatString: b,
                      handleNavigate: j
                    })
                  ]
                })
              })
            })
          })
        })
      ]
    });
  }
  function sy() {
    return o.jsx(si, {
      children: o.jsx(E, {
        grow: "Yes",
        style: {
          padding: ee.space.S400,
          paddingBottom: ee.space.S700
        },
        alignItems: "Center",
        justifyContent: "Center",
        children: o.jsx(Uc, {
          children: o.jsxs(Vc, {
            icon: o.jsx("img", {
              width: "70",
              height: "70",
              src: tp,
              alt: "Sable Logo"
            }),
            title: "Welcome to Sable",
            subTitle: o.jsxs("span", {
              children: [
                "An almost stable Matrix client.",
                " ",
                o.jsx("a", {
                  href: "https://github.com/SableClient/Sable",
                  target: "_blank",
                  rel: "noreferrer noopener",
                  children: "v1.17.0-dev"
                })
              ]
            }),
            children: [
              o.jsx(E, {
                justifyContent: "Center",
                children: o.jsxs(E, {
                  grow: "Yes",
                  style: {
                    maxWidth: He(300)
                  },
                  direction: "Column",
                  gap: "300",
                  children: [
                    o.jsx(xe, {
                      as: "a",
                      href: "https://github.com/SableClient/Sable",
                      target: "_blank",
                      rel: "noreferrer noopener",
                      before: o.jsx(Q, {
                        size: "200",
                        src: q.Code
                      }),
                      children: o.jsx(D, {
                        as: "span",
                        size: "B400",
                        truncate: true,
                        children: "Source Code"
                      })
                    }),
                    o.jsx(xe, {
                      as: "a",
                      href: "https://opencollective.com/sable",
                      target: "_blank",
                      rel: "noreferrer noopener",
                      fill: "Soft",
                      before: o.jsx(Q, {
                        size: "200",
                        src: q.Heart
                      }),
                      children: o.jsx(D, {
                        as: "span",
                        size: "B400",
                        truncate: true,
                        children: "Support"
                      })
                    })
                  ]
                })
              }),
              o.jsx(E, {
                direction: "Column",
                gap: "200",
                alignItems: "Center",
                children: o.jsx(xe, {
                  as: "a",
                  href: "https://github.com/SableClient/Sable/blob/dev/CHANGELOG.md",
                  target: "_blank",
                  rel: "noreferrer noopener",
                  before: o.jsx(Q, {
                    size: "200",
                    src: q.Code
                  }),
                  children: o.jsx(D, {
                    as: "span",
                    size: "B400",
                    truncate: true,
                    children: "Features"
                  })
                })
              })
            ]
          })
        })
      })
    });
  }
  const bft = p.forwardRef(({ requestClose: t }, e) => {
    const n = B3(), [r] = Fe(ge, "hideReads"), i = wh(n, qi), a = be(), s = () => {
      i && (n.forEach((l) => As(a, l, r)), t());
    };
    return o.jsx(tn, {
      ref: e,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: o.jsx(E, {
        direction: "Column",
        gap: "100",
        style: {
          padding: ee.space.S100
        },
        children: o.jsx(Ye, {
          onClick: s,
          size: "300",
          after: o.jsx(Q, {
            size: "100",
            src: q.CheckTwice
          }),
          radii: "300",
          "aria-disabled": !i,
          children: o.jsx(D, {
            style: {
              flexGrow: 1
            },
            as: "span",
            size: "T300",
            truncate: true,
            children: "Mark as Read"
          })
        })
      })
    });
  });
  function xft() {
    const t = br(), e = be(), n = fr(), r = Ze(fv()), i = Ze(gi), a = Ze(vi), s = mse(e, zr, i, a), l = wh(s, qi), c = xut(), [d, u] = p.useState(), h = () => {
      const g = r.get("home");
      if (g && n !== sn.Mobile) {
        t(r3(g));
        return;
      }
      t($c());
    }, f = (g) => {
      g.preventDefault();
      const m = g.currentTarget.getBoundingClientRect();
      u((v) => {
        if (!v) return m;
      });
    };
    return o.jsxs(rd, {
      active: c,
      children: [
        o.jsx(id, {
          tooltip: "Home",
          children: (g) => o.jsx(_l, {
            as: "button",
            ref: g,
            outlined: true,
            onClick: h,
            onContextMenu: f,
            children: o.jsx(Q, {
              src: q.Home,
              filled: c
            })
          })
        }),
        l && o.jsx(cm, {
          highlight: l.highlight > 0,
          count: l.highlight > 0 ? l.highlight : l.total
        }),
        d && o.jsx(ln, {
          anchor: d,
          position: "Right",
          align: "Start",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => u(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (g) => g.key === "ArrowDown",
              isKeyBackward: (g) => g.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(bft, {
              requestClose: () => u(void 0)
            })
          })
        })
      ]
    });
  }
  const wft = 3, Cge = () => {
    const t = be(), e = Ze(gi), n = u3(t, zr, e), r = Ze(qi), [i, a] = p.useState(false);
    return $F(t, p.useCallback((s, l) => {
      s === Nn.Syncing && l !== Nn.Syncing && a(true), (s === Nn.Syncing || s === Nn.Catchup) && a(true);
    }, [])), p.useMemo(() => i ? n.filter((c) => {
      const d = r.get(c);
      return d && (d.total > 0 || d.highlight > 0);
    }).toSorted(Ku(t)).slice(0, wft) : [], [
      n,
      t,
      r,
      i
    ]);
  }, Dft = p.forwardRef(({ requestClose: t }, e) => {
    const n = uv(), [r] = Fe(ge, "hideReads"), i = wh(n, qi), a = be(), s = () => {
      i && (n.forEach((l) => As(a, l, r)), t());
    };
    return o.jsx(tn, {
      ref: e,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: o.jsx(E, {
        direction: "Column",
        gap: "100",
        style: {
          padding: ee.space.S100
        },
        children: o.jsx(Ye, {
          onClick: s,
          size: "300",
          after: o.jsx(Q, {
            size: "100",
            src: q.CheckTwice
          }),
          radii: "300",
          "aria-disabled": !i,
          children: o.jsx(D, {
            style: {
              flexGrow: 1
            },
            as: "span",
            size: "T300",
            truncate: true,
            children: "Mark as Read"
          })
        })
      })
    });
  });
  function Cft() {
    const t = br(), e = be(), n = fr(), r = Ze(fv()), i = Ze(gi), a = u3(e, zr, i), s = Cge(), l = p.useMemo(() => {
      const m = new Set(s);
      return a.filter((v) => !m.has(v));
    }, [
      a,
      s
    ]), c = wh(l, qi), [d, u] = p.useState(), h = vht(), f = () => {
      const m = r.get("direct"), v = m == null ? void 0 : m.pathname, y = typeof v == "string" && v.startsWith("/direct/");
      if (m && y && n !== sn.Mobile) {
        t(r3(m));
        return;
      }
      t(eP());
    }, g = (m) => {
      m.preventDefault();
      const v = m.currentTarget.getBoundingClientRect();
      u((y) => {
        if (!y) return v;
      });
    };
    return o.jsxs(rd, {
      active: h,
      children: [
        o.jsx(id, {
          tooltip: "Direct Messages",
          children: (m) => o.jsx(_l, {
            as: "button",
            ref: m,
            outlined: true,
            onClick: f,
            onContextMenu: g,
            children: o.jsx(Q, {
              src: q.User,
              filled: h
            })
          })
        }),
        c && o.jsx(cm, {
          highlight: c.highlight > 0,
          count: c.highlight > 0 ? c.highlight : c.total,
          dm: true
        }),
        d && o.jsx(ln, {
          anchor: d,
          position: "Right",
          align: "Start",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => u(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (m) => m.key === "ArrowDown",
              isKeyBackward: (m) => m.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(Dft, {
              requestClose: () => u(void 0)
            })
          })
        })
      ]
    });
  }
  const hQ = (t) => {
    var _a6;
    return !!(((_a6 = t.split(":")[0]) == null ? void 0 : _a6.substring(1)) ?? "").toLowerCase().endsWith("bot");
  }, Eft = (t, e, n = 3) => {
    const [r, i] = p.useState([]);
    return p.useEffect(() => {
      (async () => {
        try {
          const s = t.getUserId();
          await e.loadMembersIfNeeded();
          const c = e.getMembers().filter((y) => y.membership === "join" && y.userId !== s && !hQ(y.userId)).map((y) => y.userId), u = e.getLiveTimeline().getEvents(), h = [];
          for (let y = u.length - 1; y >= 0; y -= 1) {
            const w = u[y];
            if (!w) continue;
            const b = w.getSender();
            b && b !== s && !hQ(b) && !h.includes(b) && h.push(b);
          }
          const m = c.toSorted((y, w) => {
            const b = h.indexOf(y), j = h.indexOf(w);
            return b !== -1 && j !== -1 ? b - j : b !== -1 ? -1 : j !== -1 ? 1 : 0;
          }).slice(0, n).map(async (y) => {
            try {
              const w = await t.getProfileInfo(y);
              return {
                userId: y,
                displayName: w.displayname || y,
                avatarUrl: w.avatar_url
              };
            } catch {
              return {
                userId: y,
                displayName: y,
                avatarUrl: void 0
              };
            }
          }), v = await Promise.all(m);
          i(v);
        } catch {
          i([]);
        }
      })();
    }, [
      t,
      e,
      n
    ]), r;
  };
  var kft = "DirectDMsList_GroupAvatarContainer__azlx2d0", Sft = "DirectDMsList_GroupAvatarRow__azlx2d1", jft = "DirectDMsList_GroupAvatar__azlx2d2";
  const Tft = 3;
  function Rft({ room: t, selected: e }) {
    const n = be(), r = hn(), i = br(), a = Ze(qi), s = () => {
      i(xp(wi(n, t.roomId)));
    }, l = t.getJoinedMemberCount() > 2, c = Eft(n, t, Tft), d = a.get(t.roomId), u = () => {
      const f = c[0];
      if (!(c.length !== 1 || !(f == null ? void 0 : f.avatarUrl))) return Cn(n, f.avatarUrl, r, 96, 96, "crop") ?? void 0;
    }, h = () => {
      if (!l) return o.jsx(xn, {
        size: "400",
        radii: "400",
        children: o.jsx(yi, {
          roomId: t.roomId,
          src: Sa(n, t, 96, r) || Jf(n, t, 96, r),
          alt: t.name,
          renderFallback: () => o.jsx(D, {
            as: "span",
            size: "H6",
            children: Vi(t.name)
          })
        })
      });
      if (c.length === 1) {
        const f = c[0];
        return f ? o.jsx(xn, {
          size: "400",
          radii: "400",
          children: o.jsx(Si, {
            userId: f.userId,
            src: u(),
            alt: f.displayName || f.userId,
            renderFallback: () => o.jsx(D, {
              as: "span",
              size: "H6",
              children: Vi(f.displayName || f.userId)
            })
          })
        }) : null;
      }
      return o.jsx(E, {
        className: kft,
        children: o.jsx(E, {
          className: Sft,
          children: c.map((f) => {
            const g = f.avatarUrl ? Cn(n, f.avatarUrl, r, 48, 48, "crop") ?? void 0 : void 0;
            return o.jsx(xn, {
              size: "200",
              radii: "300",
              className: jft,
              children: o.jsx(Si, {
                userId: f.userId,
                src: g,
                alt: f.displayName || f.userId,
                renderFallback: () => o.jsx(D, {
                  as: "span",
                  size: "T300",
                  children: Vi(f.displayName || f.userId)
                })
              })
            }, f.userId);
          })
        })
      });
    };
    return o.jsxs(rd, {
      active: e,
      children: [
        o.jsx(id, {
          tooltip: t.name,
          children: (f) => o.jsx(_l, {
            as: "button",
            ref: f,
            outlined: true,
            onClick: s,
            size: "400",
            children: h()
          })
        }),
        d && (d.total > 0 || d.highlight > 0) && o.jsx(cm, {
          highlight: d.highlight > 0,
          count: d.highlight > 0 ? d.highlight : d.total,
          dm: true
        })
      ]
    });
  }
  function Aft() {
    const t = be(), e = oc(), n = Cge(), r = p.useRef(performance.now()), i = p.useRef(false), a = p.useMemo(() => n.map((s) => t.getRoom(s)).filter((s) => s !== null), [
      n,
      t
    ]);
    return p.useEffect(() => {
      a.length > 0 && !i.current && (i.current = true, oa("sable.roomlist.time_to_ready_ms", performance.now() - r.current));
    }, [
      a
    ]), a.length === 0 ? null : o.jsx(o.Fragment, {
      children: a.map((s) => o.jsx(Rft, {
        room: s,
        selected: e === s.roomId
      }, s.roomId))
    });
  }
  function Ege(t, e) {
    var n = Object.keys(t), r = Object.keys(e);
    return n.length !== r.length ? false : n.every(function(i) {
      return Object.is(t[i], e[i]);
    });
  }
  function Ift() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ege, e = null;
    return function(n) {
      return e && t(e.value, n) || (e = {
        value: n
      }), e.value;
    };
  }
  var Bft = [
    "block"
  ];
  function fQ(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function mQ(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? fQ(Object(n), true).forEach(function(r) {
        $(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : fQ(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  var kge = /* @__PURE__ */ Symbol("tree-item-instruction");
  function Pft(t) {
    return {
      x: (t.right + t.left) / 2,
      y: (t.bottom + t.top) / 2
    };
  }
  function QT(t) {
    var e = t.client, n = t.borderBox, r = n.height / 4;
    return e.y <= n.top + r ? "reorder-above" : e.y >= n.bottom - r ? "reorder-below" : "make-child";
  }
  function Mft(t) {
    var e = t.element, n = t.input, r = t.currentLevel, i = t.indentPerLevel, a = t.mode, s = {
      x: n.clientX,
      y: n.clientY
    }, l = e.getBoundingClientRect();
    if (a === "standard") {
      var c = QT({
        borderBox: l,
        client: s
      });
      return {
        type: c,
        indentPerLevel: i,
        currentLevel: r
      };
    }
    var d = Pft(l);
    if (a === "expanded") {
      var u = QT({
        borderBox: l,
        client: s
      });
      return {
        type: u === "reorder-above" ? u : "make-child",
        indentPerLevel: i,
        currentLevel: r
      };
    }
    var h = i * r;
    if (s.x < l.left + h) {
      if (s.y < d.y) return {
        type: "reorder-above",
        indentPerLevel: i,
        currentLevel: r
      };
      var f = (s.x - l.left) / i, g = Math.max(Math.floor(f), 0);
      return {
        type: "reparent",
        desiredLevel: g,
        indentPerLevel: i,
        currentLevel: r
      };
    }
    return {
      type: QT({
        borderBox: l,
        client: s
      }),
      indentPerLevel: i,
      currentLevel: r
    };
  }
  function Sge(t, e) {
    return t.type !== e.type ? false : t.type === "instruction-blocked" && e.type === "instruction-blocked" ? Sge(t.desired, e.desired) : Ege(t, e);
  }
  var Oft = Ift(Sge);
  function Lft(t) {
    var e = t.desired, n = t.block;
    if (n != null && n.includes(e.type) && e.type !== "instruction-blocked") {
      var r = {
        type: "instruction-blocked",
        desired: e
      };
      return r;
    }
    return e;
  }
  function Nft(t, e) {
    var n = e.block, r = qte(e, Bft), i = Mft(r), a = Lft({
      desired: i,
      block: n
    }), s = Oft(a);
    return mQ(mQ({}, t), {}, $({}, kge, s));
  }
  function zft(t) {
    var e;
    return (e = t[kge]) !== null && e !== void 0 ? e : null;
  }
  function Uft({ roomId: t, children: e }) {
    const n = w3(t, qi);
    return e(n);
  }
  function Vft({ rooms: t, children: e }) {
    const n = wh(t, qi);
    return e(n);
  }
  const jge = p.createContext(null), Hft = jge.Provider, $ft = () => {
    const t = p.useContext(jge);
    if (!t) throw new Error("OpenedSidebarFolderAtom is not provided!");
    return t;
  }, Wft = p.forwardRef(({ room: t, requestClose: e, onUnpin: n }, r) => {
    const i = be(), [a] = Fe(ge, "hideReads"), s = Ze(vi), l = Mo(t), c = ri(t), u = Ki(c, l).action("invite", i.getSafeUserId()), h = lv(), [f, g] = p.useState(false), m = Zk(zr, t.roomId, fse(i, s)), v = wh(m, qi), y = () => {
      m.forEach((C) => As(i, C, a)), e();
    }, w = () => {
      n == null ? void 0 : n(t.roomId), e();
    }, b = () => {
      const C = wi(i, t.roomId), x = ml(C) ? void 0 : Xc(t);
      Jo(JE(C, x)), e();
    }, j = () => {
      g(true);
    }, k = () => {
      h(t.roomId), e();
    };
    return o.jsxs(tn, {
      ref: r,
      style: {
        maxWidth: He(160),
        width: "100vw"
      },
      children: [
        f && t && o.jsx(Pp, {
          room: t,
          requestClose: () => {
            g(false), e();
          }
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: y,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.CheckTwice
              }),
              radii: "300",
              disabled: !v,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Mark as Read"
              })
            }),
            n && o.jsx(Ye, {
              size: "300",
              radii: "300",
              onClick: w,
              after: o.jsx(Q, {
                size: "100",
                src: q.Pin
              }),
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Unpin"
              })
            })
          ]
        }),
        o.jsx(nr, {
          variant: "Surface",
          size: "300"
        }),
        o.jsxs(E, {
          direction: "Column",
          gap: "100",
          style: {
            padding: ee.space.S100
          },
          children: [
            o.jsx(Ye, {
              onClick: j,
              variant: "Primary",
              fill: "None",
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.UserPlus
              }),
              radii: "300",
              "aria-pressed": f,
              disabled: !u,
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Invite"
              })
            }),
            o.jsx(Ye, {
              onClick: b,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Link
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Copy Link"
              })
            }),
            o.jsx(Ye, {
              onClick: k,
              size: "300",
              after: o.jsx(Q, {
                size: "100",
                src: q.Setting
              }),
              radii: "300",
              children: o.jsx(D, {
                style: {
                  flexGrow: 1
                },
                as: "span",
                size: "T300",
                truncate: true,
                children: "Space Settings"
              })
            })
          ]
        })
      ]
    });
  }), qft = p.forwardRef(({ requestClose: t, onRename: e }, n) => o.jsx(tn, {
    ref: n,
    style: {
      maxWidth: He(160),
      width: "100vw"
    },
    children: o.jsx(E, {
      direction: "Column",
      gap: "100",
      style: {
        padding: ee.space.S100
      },
      children: o.jsx(Ye, {
        size: "300",
        radii: "300",
        onClick: () => {
          e(), t();
        },
        after: o.jsx(Q, {
          size: "100",
          src: q.Pencil
        }),
        children: o.jsx(D, {
          style: {
            flexGrow: 1
          },
          as: "span",
          size: "T300",
          truncate: true,
          children: "Rename"
        })
      })
    })
  })), Kft = 200, Q8 = (t, e) => {
    const n = e.content.map((r) => {
      var _a6;
      return ((_a6 = t.getRoom(r)) == null ? void 0 : _a6.name) ?? "";
    }).join(", ");
    return (e.name ?? n) || "Unnamed";
  };
  function Gft({ mx: t, folder: e, onClose: n, onSave: r }) {
    const [i, a] = p.useState(() => Q8(t, e));
    p.useEffect(() => {
      a(Q8(t, e));
    }, [
      t,
      e
    ]);
    const s = (l) => {
      l.preventDefault(), r(i);
    };
    return o.jsx(Hn, {
      open: true,
      backdrop: o.jsx($n, {}),
      children: o.jsx(Wn, {
        children: o.jsx(Ft, {
          focusTrapOptions: {
            initialFocus: false,
            clickOutsideDeactivates: true,
            onDeactivate: n,
            escapeDeactivates: kt
          },
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsxs(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: [
                  o.jsx(E, {
                    grow: "Yes",
                    children: o.jsx(D, {
                      size: "H4",
                      children: "Rename Folder"
                    })
                  }),
                  o.jsx(Oe, {
                    size: "300",
                    onClick: n,
                    radii: "300",
                    children: o.jsx(Q, {
                      src: q.Cross
                    })
                  })
                ]
              }),
              o.jsxs(E, {
                as: "form",
                onSubmit: s,
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsx(D, {
                    priority: "400",
                    size: "T300",
                    children: "Choose a short label for this folder. Leave empty to show space names again."
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "100",
                    children: [
                      o.jsx(D, {
                        size: "L400",
                        children: "Folder name"
                      }),
                      o.jsx(mn, {
                        name: "folderName",
                        variant: "Background",
                        value: i,
                        maxLength: Kft,
                        onChange: (l) => a(l.target.value),
                        autoFocus: true
                      })
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Row",
                    gap: "200",
                    justifyContent: "End",
                    children: [
                      o.jsx(xe, {
                        type: "button",
                        variant: "Secondary",
                        fill: "Soft",
                        onClick: n,
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Cancel"
                        })
                      }),
                      o.jsx(xe, {
                        type: "submit",
                        variant: "Primary",
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Save"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      })
    });
  }
  const Tge = (t, e, n, r) => {
    const [i, a] = p.useState(false);
    return p.useEffect(() => {
      const s = e.current;
      return s ? _me({
        element: s,
        dragHandle: void 0,
        getInitialData: () => ({
          item: t
        }),
        onDragStart: () => {
          a(true), n == null ? void 0 : n(t);
        },
        onDrop: () => {
          a(false), n == null ? void 0 : n(void 0);
        }
      }) : void 0;
    }, [
      e,
      r,
      t,
      n
    ]), i;
  }, Rge = (t, e) => {
    const [n, r] = p.useState();
    return p.useEffect(() => {
      const i = e.current;
      if (i) return rL({
        element: i,
        canDrop: ({ source: a }) => a.data.item !== t,
        getData: ({ input: a, element: s }) => {
          const l = [
            "reparent"
          ];
          typeof t == "object" && t.spaceId && l.push("make-child");
          const c = Nft({}, {
            input: a,
            element: s,
            currentLevel: 0,
            indentPerLevel: 0,
            mode: "standard",
            block: l
          }), d = zft(c);
          return r(d ?? void 0), {
            item: t,
            instructionType: d ? d.type : void 0
          };
        },
        onDragLeave: () => r(void 0),
        onDrop: () => r(void 0)
      });
    }, [
      t,
      e
    ]), n;
  };
  function gQ(t, e, n) {
    const [r, i] = p.useState();
    return p.useEffect(() => {
      const a = e.current;
      if (a) return rL({
        element: a,
        canDrop: ({ source: s }) => s.data.item !== t,
        getData: () => (i(n), {
          item: t,
          instructionType: n
        }),
        onDragLeave: () => i(void 0),
        onDrop: () => i(void 0)
      });
    }, [
      t,
      e,
      n
    ]), r;
  }
  const Yft = (t, e, n) => {
    p.useEffect(() => {
      const r = t.current;
      if (!r) throw new Error("Scroll element ref not configured");
      return sv(iL({
        onDrop: ({ source: i, location: a }) => {
          var _a6, _b3, _c3, _d4;
          e(void 0);
          const { dropTargets: s } = a.current;
          if (s.length === 0) return;
          const l = i.data.item, c = (_b3 = (_a6 = s[0]) == null ? void 0 : _a6.data) == null ? void 0 : _b3.item;
          if (!c) return;
          const d = (_d4 = (_c3 = s[0]) == null ? void 0 : _c3.data) == null ? void 0 : _d4.instructionType;
          d && n(l, c, d);
        }
      }), Eme({
        element: r
      }));
    }, [
      t,
      e,
      n
    ]);
  };
  function pQ({ space: t, selected: e, onClick: n, folder: r, onDragging: i, disabled: a, onUnpin: s }) {
    var _a6;
    const l = be(), c = hn(), d = p.useRef(null), u = p.useMemo(() => r ? {
      folder: r,
      spaceId: t.roomId
    } : t.roomId, [
      r,
      t
    ]);
    Tge(u, d, i);
    const f = (_a6 = Rge(u, d)) == null ? void 0 : _a6.type, [g, m] = p.useState(), v = (y) => {
      y.preventDefault();
      const w = y.currentTarget.getBoundingClientRect();
      m((b) => {
        if (!b) return w;
      });
    };
    return o.jsx(Uft, {
      roomId: t.roomId,
      children: (y) => o.jsxs(rd, {
        active: e,
        ref: d,
        "aria-disabled": a,
        "data-drop-child": f === "make-child",
        "data-drop-above": f === "reorder-above",
        "data-drop-below": f === "reorder-below",
        "data-inside-folder": !!r,
        children: [
          o.jsx(id, {
            tooltip: a ? void 0 : t.name,
            children: (w) => o.jsx(_l, {
              as: "button",
              "data-id": t.roomId,
              ref: w,
              size: r ? "300" : "400",
              onClick: n,
              onContextMenu: v,
              children: o.jsx(yi, {
                roomId: t.roomId,
                uniformIcons: true,
                src: Sa(l, t, 96, c) ?? void 0,
                alt: t.name,
                renderFallback: () => o.jsx(D, {
                  size: r ? "H6" : "H4",
                  children: Vi(t.name, 2)
                })
              })
            })
          }),
          y && o.jsx(cm, {
            highlight: y.highlight > 0,
            count: y.highlight > 0 ? y.highlight : y.total
          }),
          g && o.jsx(ln, {
            anchor: g,
            position: "Right",
            align: "Start",
            content: o.jsx(Ft, {
              focusTrapOptions: {
                initialFocus: false,
                returnFocusOnDeactivate: false,
                onDeactivate: () => m(void 0),
                clickOutsideDeactivates: true,
                isKeyForward: (w) => w.key === "ArrowDown",
                isKeyBackward: (w) => w.key === "ArrowUp",
                escapeDeactivates: kt
              },
              children: o.jsx(Wft, {
                room: t,
                requestClose: () => m(void 0),
                onUnpin: s
              })
            })
          })
        ]
      })
    });
  }
  function Zft({ folder: t, onClose: e, onFolderContextMenu: n, children: r }) {
    const i = p.useRef(null), a = p.useRef(null), s = p.useMemo(() => ({
      folder: t,
      open: true
    }), [
      t
    ]), l = gQ(s, i, "reorder-above"), c = gQ(s, a, "reorder-below");
    return o.jsxs(Fge, {
      state: "Open",
      "data-drop-above": l === "reorder-above",
      "data-drop-below": c === "reorder-below",
      children: [
        o.jsx(rQ, {
          ref: i,
          position: "Top"
        }),
        o.jsx(_l, {
          size: "300",
          onContextMenu: n,
          children: o.jsx(Oe, {
            "data-id": t.id,
            size: "300",
            variant: "Background",
            onClick: e,
            children: o.jsx(Q, {
              size: "400",
              src: q.ChevronTop,
              filled: true
            })
          })
        }),
        r,
        o.jsx(rQ, {
          ref: a,
          position: "Bottom"
        })
      ]
    });
  }
  function Jft({ folder: t, selected: e, onOpen: n, onDragging: r, disabled: i, onFolderContextMenu: a }) {
    var _a6;
    const s = be(), l = hn(), c = p.useRef(null), d = p.useMemo(() => ({
      folder: t
    }), [
      t
    ]);
    Tge(d, c, r);
    const h = (_a6 = Rge(d, c)) == null ? void 0 : _a6.type, f = Q8(s, t);
    return o.jsx(Vft, {
      rooms: t.content,
      children: (g) => o.jsxs(rd, {
        active: e,
        ref: c,
        "aria-disabled": i,
        "data-drop-child": h === "make-child",
        "data-drop-above": h === "reorder-above",
        "data-drop-below": h === "reorder-below",
        children: [
          o.jsx(id, {
            tooltip: i ? void 0 : f,
            children: (m) => o.jsx(Fge, {
              "data-id": t.id,
              as: "button",
              ref: m,
              onClick: n,
              onContextMenu: a,
              children: t.content.map((v) => {
                const y = s.getRoom(v);
                return y ? o.jsx(_l, {
                  size: "200",
                  radii: "300",
                  children: o.jsx(yi, {
                    roomId: y.roomId,
                    uniformIcons: true,
                    src: Sa(s, y, 96, l) ?? void 0,
                    alt: y.name,
                    renderFallback: () => o.jsx(D, {
                      size: "Inherit",
                      children: o.jsx("b", {
                        children: Vi(y.name, 2)
                      })
                    })
                  })
                }, v) : null;
              })
            })
          }),
          g && o.jsx(cm, {
            highlight: g.highlight > 0,
            count: g.highlight > 0 ? g.highlight : g.total
          })
        ]
      })
    });
  }
  function Xft({ scrollRef: t }) {
    const e = br(), n = be(), r = fr(), i = Ze(vi), a = Jk(n, zr, i), [s, l] = sme(a), c = Ze(fv()), [d, u] = Fr($ft()), [h, f] = p.useState(), [g, m] = p.useState(), [v, y] = p.useState(), w = p.useCallback((S) => (T) => {
      T.preventDefault(), m({
        folder: S,
        anchor: T.currentTarget.getBoundingClientRect()
      });
    }, []), b = p.useCallback((S, T) => {
      const A = lot(s, S, T), B = fC(n, A);
      l(k1(n, a, B)), n.setAccountData(Zr.CinnySpaces, B);
    }, [
      n,
      s,
      a,
      l
    ]);
    Yft(t, f, p.useCallback((S, T, A) => {
      const B = [], U = (M, I) => typeof M == "string" && typeof I == "string" ? M === I : typeof M == "object" && typeof I == "object" ? M.id === I.folder.id : false, z = (M) => typeof M == "string" ? [
        M
      ] : M.spaceId ? [
        M.spaceId
      ] : [
        ...M.folder.content
      ];
      s.forEach((M) => {
        const I = typeof S == "object" && typeof T == "object" && S.folder.id === T.folder.id;
        if (!I && U(M, S)) {
          if (typeof S == "object" && S.spaceId) {
            const N = S.folder.content.filter((L) => L !== S.spaceId);
            if (N.length === 0) {
              u({
                type: "DELETE",
                id: S.folder.id
              });
              return;
            }
            B.push({
              ...S.folder,
              content: N
            });
          }
          return;
        }
        if (U(M, T)) {
          if (A === "make-child") {
            const N = z(S);
            if (typeof T == "string") {
              const L = {
                id: nte(),
                content: [
                  T
                ].concat(N)
              };
              B.push(L);
              return;
            }
            B.push({
              ...T.folder,
              content: T.folder.content.concat(N)
            });
            return;
          }
          if (typeof T == "object" && T.spaceId) {
            const N = z(S), L = [];
            T.folder.content.filter((V) => !N.includes(V)).forEach((V) => {
              if (V === T.spaceId) {
                A === "reorder-below" && L.push(V, ...N), A === "reorder-above" && L.push(...N, V);
                return;
              }
              L.push(V);
            });
            const H = {
              ...T.folder,
              content: L
            };
            B.push(H);
            return;
          }
          if (typeof S == "string") A === "reorder-below" && B.push(M), B.push(S), A === "reorder-above" && B.push(M);
          else if (S.spaceId) {
            if (A === "reorder-above" && B.push(S.spaceId), I && typeof M == "object") {
              const N = {
                ...M,
                content: M.content.filter((L) => L !== S.spaceId)
              };
              N.content.length > 0 && B.push(N);
            } else B.push(M);
            A === "reorder-below" && B.push(S.spaceId);
          } else A === "reorder-below" && B.push(M), B.push(S.folder), A === "reorder-above" && B.push(M);
          return;
        }
        B.push(M);
      });
      const O = fC(n, B);
      l(k1(n, a, O)), n.setAccountData(Zr.CinnySpaces, O);
    }, [
      n,
      s,
      u,
      l,
      a
    ]));
    const j = $k(), k = (S) => {
      const A = S.currentTarget.getAttribute("data-id");
      if (!A) return;
      const B = Sk(wi(n, A));
      if (r === sn.Mobile) {
        e(B);
        return;
      }
      const U = c.get(A);
      if (U == null ? void 0 : U.pathname.startsWith(B)) {
        e(r3(U));
        return;
      }
      e(Qg(wi(n, A)));
    }, C = (S) => {
      const A = S.currentTarget.getAttribute("data-id");
      A && u({
        type: d.has(A) ? "DELETE" : "PUT",
        id: A
      });
    }, x = p.useCallback((S) => {
      if (a.includes(S)) return;
      const T = lme(s, S), A = fC(n, T);
      l(k1(n, a, A)), n.setAccountData(Zr.CinnySpaces, A);
    }, [
      n,
      s,
      a,
      l
    ]);
    return s.length === 0 ? null : o.jsxs(o.Fragment, {
      children: [
        g && o.jsx(ln, {
          anchor: g.anchor,
          position: "Right",
          align: "Start",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => m(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (S) => S.key === "ArrowDown",
              isKeyBackward: (S) => S.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(qft, {
              requestClose: () => m(void 0),
              onRename: () => y(g.folder)
            })
          })
        }),
        v && o.jsx(Gft, {
          mx: n,
          folder: v,
          onClose: () => y(void 0),
          onSave: (S) => {
            b(v.id, S), y(void 0);
          }
        }),
        o.jsx(vge, {}),
        o.jsx(FC, {
          children: s.map((S) => {
            if (typeof S == "object") return d.has(S.id) ? o.jsx(Zft, {
              folder: S,
              onClose: C,
              onFolderContextMenu: w(S),
              children: S.content.map((A) => {
                const B = n.getRoom(A);
                return B ? o.jsx(pQ, {
                  space: B,
                  selected: B.roomId === j,
                  onClick: k,
                  folder: S,
                  onDragging: f,
                  disabled: typeof h == "object" ? h.spaceId === B.roomId : false,
                  onUnpin: a.includes(B.roomId) ? void 0 : x
                }, B.roomId) : null;
              })
            }, S.id) : o.jsx(Jft, {
              folder: S,
              selected: !!j && S.content.includes(j),
              onOpen: C,
              onDragging: f,
              onFolderContextMenu: w(S),
              disabled: typeof h == "object" ? h.folder.id === S.id : false
            }, S.id);
            const T = n.getRoom(S);
            return T ? o.jsx(pQ, {
              space: T,
              selected: T.roomId === j,
              onClick: k,
              onDragging: f,
              disabled: typeof h == "string" ? h === T.roomId : false,
              onUnpin: a.includes(T.roomId) ? void 0 : x
            }, T.roomId) : null;
          })
        })
      ]
    });
  }
  function Qft() {
    const t = fr(), e = br(), n = Ze(fv()), r = mdt(), a = Ze(cv).length, s = () => {
      if (t === sn.Mobile) {
        e(nP());
        return;
      }
      const l = n.get("inbox");
      if (l) {
        e(r3(l));
        return;
      }
      const c = a > 0 ? i3() : Tk();
      e(c);
    };
    return o.jsxs(rd, {
      active: r,
      children: [
        o.jsx(id, {
          tooltip: "Inbox",
          children: (l) => o.jsx(_l, {
            as: "button",
            ref: l,
            outlined: true,
            onClick: s,
            children: o.jsx(Q, {
              src: q.Inbox,
              filled: r
            })
          })
        }),
        a > 0 && o.jsx(cm, {
          highlight: true,
          count: a
        })
      ]
    });
  }
  function emt() {
    const t = be(), e = fr(), n = la(), r = br(), i = Ze(fv()), a = Hht(), s = () => {
      var _a6;
      if (e === sn.Mobile) {
        r(nb());
        return;
      }
      const l = i.get("explore");
      if (l) {
        r(r3(l));
        return;
      }
      if ((_a6 = n.featuredCommunities) == null ? void 0 : _a6.openAsDefault) {
        r(jk());
        return;
      }
      const c = t.getUserId(), d = c ? bo(c) : void 0;
      if (d) {
        r(ep(d));
        return;
      }
      r(nb());
    };
    return o.jsx(rd, {
      active: a,
      children: o.jsx(id, {
        tooltip: "Explore Community",
        children: (l) => o.jsx(_l, {
          as: "button",
          ref: l,
          outlined: true,
          onClick: s,
          children: o.jsx(Q, {
            src: q.Explore,
            filled: a
          })
        })
      })
    });
  }
  var tmt = "UnverifiedTab_UnverifiedTab__f3krmi1", nmt = "UnverifiedTab_UnverifiedAvatar__f3krmi2", rmt = "UnverifiedTab_UnverifiedOtherAvatar__f3krmi3";
  function imt() {
    const t = be(), e = BP(), n = t.getCrypto(), [r] = Rie(), [i, a] = Iie(r), l = Ek(n, t.getSafeUserId(), i == null ? void 0 : i.device_id) === Wu.Unverified, c = Aie(a), d = Bie(n, t.getSafeUserId(), c), u = l || d !== void 0 && d > 0;
    return o.jsx(o.Fragment, {
      children: u && o.jsxs(rd, {
        className: tmt,
        children: [
          o.jsx(id, {
            tooltip: l ? "Unverified Device" : "Unverified Devices",
            children: (h) => o.jsx(_l, {
              className: l ? nmt : rmt,
              as: "button",
              ref: h,
              outlined: true,
              onClick: () => e("devices"),
              children: o.jsx(Q, {
                style: {
                  color: l ? ct.Critical.Main : ct.Warning.Main
                },
                src: q.ShieldUser
              })
            })
          }),
          !l && d && d > 0 && o.jsx(pge, {
            mode: "count",
            children: o.jsx(Rn, {
              variant: "Warning",
              size: "400",
              fill: "Solid",
              radii: "Pill",
              outlined: false,
              children: o.jsx(D, {
                as: "span",
                size: "L400",
                children: d
              })
            })
          })
        ]
      })
    });
  }
  function omt() {
    return WB() ? o.jsx(imt, {}) : null;
  }
  function amt() {
    const [t, e] = Fr(yse), n = () => e(true);
    return o.jsx(rd, {
      active: t,
      children: o.jsx(id, {
        tooltip: "Search",
        children: (r) => o.jsx(_l, {
          as: "button",
          ref: r,
          outlined: true,
          onClick: n,
          children: o.jsx(Q, {
            src: q.Search,
            filled: t
          })
        })
      })
    });
  }
  const smt = (t) => {
    const e = t.match(/^mxc:\/\/([^/]+)\/(.+)$/);
    if (!e) return;
    const n = e[1], r = e[2];
    if (!(!n || !r)) return {
      serverName: n,
      mediaId: r
    };
  }, lmt = async (t, e, n) => {
    const r = smt(n);
    if (!r) return;
    const { serverName: i, mediaId: a } = r, s = async (l) => {
      const c = await fetch(l, {
        headers: {
          Authorization: `Bearer ${e}`
        }
      });
      if (!c.ok) throw new Error(`${c.status}`);
      const d = await c.blob();
      return URL.createObjectURL(d);
    };
    try {
      return await s(`${t}/_matrix/client/v1/media/thumbnail/${i}/${a}?width=96&height=96&method=crop`);
    } catch {
      try {
        return await s(`${t}/_matrix/media/v3/thumbnail/${i}/${a}?width=96&height=96&method=crop`);
      } catch {
        return;
      }
    }
  }, cmt = (t) => {
    const [e, n] = p.useState({}), r = p.useRef([]), i = p.useRef(t);
    i.current = t;
    const a = t.map((s) => s.userId).join("\0");
    return p.useEffect(() => {
      let s = false;
      const l = [];
      return i.current.forEach(async (c) => {
        try {
          const d = `${c.baseUrl}/_matrix/client/v3/profile/${encodeURIComponent(c.userId)}`, u = await fetch(d, {
            headers: {
              Authorization: `Bearer ${c.accessToken}`
            }
          });
          if (!u.ok || s) return;
          const h = await u.json();
          if (s) return;
          let f;
          if (h.avatar_url && (f = await lmt(c.baseUrl, c.accessToken, h.avatar_url), f && l.push(f)), s) {
            f && URL.revokeObjectURL(f);
            return;
          }
          n((g) => ({
            ...g,
            [c.userId]: {
              displayName: h.displayname ?? void 0,
              avatarHttpUrl: f
            }
          }));
        } catch {
        }
      }), () => {
        s = true, r.current.forEach((c) => URL.revokeObjectURL(c)), r.current = l;
      };
    }, [
      a
    ]), e;
  }, pD = Po("AccountSwitcherTab"), dmt = fo("AccountSwitcherTab");
  function umt({ session: t, isActive: e, displayName: n, avatarUrl: r, isBusy: i, unread: a, onSwitch: s, onSignOut: l }) {
    const c = _n(t.userId) ?? t.userId, d = t.userId.split(":")[1] ?? t.baseUrl, u = n ?? c;
    return o.jsx(Ye, {
      size: "400",
      radii: "300",
      style: {
        opacity: i ? 0.6 : void 0,
        height: "auto"
      },
      before: o.jsx(_l, {
        size: "200",
        style: {
          width: He(28),
          height: He(28)
        },
        children: o.jsx(Si, {
          userId: t.userId,
          src: r,
          alt: u,
          renderFallback: () => o.jsx(D, {
            size: "H6",
            children: Vi(u)
          })
        })
      }),
      after: o.jsxs(E, {
        gap: "200",
        alignItems: "Center",
        shrink: "No",
        children: [
          !e && a && a.total > 0 && o.jsx(f3, {
            children: o.jsx(Sp, {
              highlight: a.highlight > 0,
              count: a.total
            })
          }),
          e && o.jsx(Q, {
            size: "200",
            src: q.Check,
            style: {
              color: "var(--mx-c-success)"
            }
          }),
          i ? o.jsx(dt, {
            size: "200",
            variant: "Secondary"
          }) : o.jsx(Qe, {
            variant: "Critical",
            fill: "None",
            size: "400",
            radii: "300",
            onClick: (h) => {
              h.stopPropagation(), l(t);
            },
            children: o.jsx(D, {
              size: "T200",
              children: "Sign out"
            })
          })
        ]
      }),
      onClick: () => !e && !i && s(t),
      children: o.jsxs(E, {
        direction: "Column",
        grow: "Yes",
        style: {
          paddingTop: ee.space.S100,
          paddingBottom: ee.space.S100,
          justifyContent: "Center"
        },
        children: [
          o.jsx(D, {
            size: "T300",
            truncate: true,
            children: u
          }),
          o.jsx(D, {
            size: "T200",
            priority: "300",
            truncate: true,
            children: e ? t.userId : d
          })
        ]
      })
    });
  }
  function hmt() {
    const t = be(), e = br(), n = Ze(th), [r, i] = Fr(Fh), a = Fn(th), s = hn(), l = Ze(TA), c = Fn(TA), d = BP(), u = Object.entries(l).filter(([L]) => {
      var _a6;
      return L !== (r ?? ((_a6 = n[0]) == null ? void 0 : _a6.userId));
    }).reduce((L, [, H]) => L + H.total, 0), h = Object.entries(l).filter(([L]) => {
      var _a6;
      return L !== (r ?? ((_a6 = n[0]) == null ? void 0 : _a6.userId));
    }).reduce((L, [, H]) => L + H.highlight, 0), f = h > 0, [g, m] = p.useState(), [v, y] = p.useState(/* @__PURE__ */ new Set()), [w, b] = p.useState(void 0), j = n.find((L) => L.userId === r) ?? n[0], k = t.getUserId() ?? "", C = Hc(k), x = C.avatarUrl ? Cn(t, C.avatarUrl, s, 96, 96, "crop") ?? void 0 : void 0, S = C.displayName, T = cmt(n), { disableAccountSwitcher: A } = la(), B = (L) => {
      if (A) {
        d();
        return;
      }
      const H = L.currentTarget.getBoundingClientRect();
      m((V) => V ? void 0 : H);
    }, U = p.useCallback((L) => {
      pD.log("switching to account", L.userId), m(void 0), e($c(), {
        replace: true
      }), i(L.userId), c((H) => {
        const V = {
          ...H
        };
        return delete V[L.userId], V;
      });
    }, [
      e,
      i,
      c
    ]), z = p.useCallback(async (L) => {
      var _a6, _b3;
      pD.log("signing out", L.userId), m(void 0), y((H) => new Set(H).add(L.userId));
      try {
        if (L.userId === t.getUserId()) await f4(t, L), a({
          type: "DELETE",
          session: L
        }), i(((_a6 = n.find((H) => H.userId !== L.userId)) == null ? void 0 : _a6.userId) ?? void 0), window.location.reload();
        else {
          try {
            const H = await Eie(L);
            await f4(H, L);
          } catch (H) {
            pD.error("failed to logout background session, IndexedDB may remain", H);
          }
          a({
            type: "DELETE",
            session: L
          }), r === L.userId && i(((_b3 = n.find((H) => H.userId !== L.userId)) == null ? void 0 : _b3.userId) ?? void 0);
        }
      } catch (H) {
        pD.error("Logout failed", H);
      } finally {
        y((H) => {
          const V = new Set(H);
          return V.delete(L.userId), V;
        });
      }
    }, [
      t,
      n,
      r,
      a,
      i
    ]), O = () => {
      const L = gl(Hd(), {
        addAccount: "1"
      });
      m(void 0), $u(t), setTimeout(() => window.location.assign(L), 100);
    }, M = () => {
      dmt.info("ui", "Settings button clicked", {
        userId: j == null ? void 0 : j.userId
      }), m(void 0), d();
    }, I = _n((j == null ? void 0 : j.userId) ?? "") ?? (j == null ? void 0 : j.userId) ?? "", N = S ?? I;
    return j ? o.jsxs(rd, {
      active: !!g,
      children: [
        o.jsx(id, {
          tooltip: N,
          children: (L) => o.jsx(_l, {
            as: "button",
            ref: L,
            onClick: B,
            outlined: n.length > 1,
            children: o.jsx(Si, {
              userId: j.userId,
              src: x,
              alt: N,
              renderFallback: () => o.jsx(D, {
                size: "H4",
                children: Vi(N)
              })
            })
          })
        }),
        (u > 0 || f) && o.jsx(cm, {
          highlight: f,
          count: f ? h : u
        }),
        o.jsx(ln, {
          anchor: g,
          position: "Right",
          align: "End",
          offset: 6,
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => m(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (L) => L.key === "ArrowDown",
              isKeyBackward: (L) => L.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              style: {
                minWidth: He(240)
              },
              children: o.jsxs(E, {
                direction: "Column",
                gap: "100",
                style: {
                  padding: ee.space.S100
                },
                children: [
                  o.jsx(D, {
                    size: "L400",
                    style: {
                      padding: `${ee.space.S100} ${ee.space.S200}`
                    },
                    children: "Accounts"
                  }),
                  n.map((L) => {
                    var _a6;
                    const H = L.userId === (r ?? ((_a6 = n[0]) == null ? void 0 : _a6.userId));
                    let V, Z;
                    if (H) V = S, Z = x;
                    else {
                      const Y = T[L.userId];
                      V = Y == null ? void 0 : Y.displayName, Z = Y == null ? void 0 : Y.avatarHttpUrl;
                    }
                    return o.jsx(umt, {
                      session: L,
                      isActive: H,
                      displayName: V,
                      avatarUrl: Z,
                      isBusy: v.has(L.userId),
                      unread: H ? void 0 : l[L.userId],
                      onSwitch: U,
                      onSignOut: (Y) => {
                        m(void 0), b(Y);
                      }
                    }, L.userId);
                  }),
                  o.jsx(Ye, {
                    size: "300",
                    radii: "300",
                    before: o.jsx(Q, {
                      size: "50",
                      src: q.Plus
                    }),
                    onClick: O,
                    children: o.jsx(D, {
                      size: "T300",
                      children: "Add Account"
                    })
                  }),
                  o.jsx(nr, {
                    variant: "Surface",
                    size: "300",
                    style: {
                      margin: `${ee.space.S100} 0`
                    }
                  }),
                  o.jsx(Ye, {
                    size: "300",
                    radii: "300",
                    before: o.jsx(Q, {
                      size: "200",
                      src: q.Setting
                    }),
                    onClick: M,
                    children: o.jsx(D, {
                      size: "T300",
                      children: "Settings"
                    })
                  })
                ]
              })
            })
          })
        }),
        w && o.jsx(yS, {
          requestClose: () => b(void 0),
          children: o.jsxs(lr, {
            variant: "Surface",
            children: [
              o.jsx(wn, {
                style: {
                  padding: `0 ${ee.space.S200} 0 ${ee.space.S400}`,
                  borderBottomWidth: ee.borderWidth.B300
                },
                variant: "Surface",
                size: "500",
                children: o.jsx(E, {
                  grow: "Yes",
                  children: o.jsx(D, {
                    size: "H4",
                    children: "Sign out"
                  })
                })
              }),
              o.jsxs(E, {
                style: {
                  padding: ee.space.S400
                },
                direction: "Column",
                gap: "400",
                children: [
                  o.jsxs(D, {
                    priority: "400",
                    children: [
                      "Are you sure you want to sign out of ",
                      o.jsx("b", {
                        children: w.userId
                      }),
                      "?"
                    ]
                  }),
                  o.jsxs(E, {
                    direction: "Column",
                    gap: "200",
                    children: [
                      o.jsx(xe, {
                        variant: "Critical",
                        onClick: () => {
                          z(w), b(void 0);
                        },
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Sign out"
                        })
                      }),
                      o.jsx(xe, {
                        variant: "Secondary",
                        onClick: () => b(void 0),
                        children: o.jsx(D, {
                          size: "B400",
                          children: "Cancel"
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          })
        })
      ]
    }) : null;
  }
  const fmt = () => !!Ko({
    path: Vie(),
    caseSensitive: true,
    end: false
  });
  function mmt() {
    const t = fmt(), e = br(), [n, r] = p.useState(), [i, a] = p.useState(false), s = (d) => {
      r(n ? void 0 : d.currentTarget.getBoundingClientRect());
    }, l = () => {
      e(Vie()), r(void 0);
    }, c = () => {
      a(true), r(void 0);
    };
    return o.jsx(rd, {
      active: t,
      children: o.jsx(id, {
        tooltip: "Add Space",
        children: (d) => o.jsxs(ln, {
          anchor: n,
          position: "Right",
          align: "Center",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              returnFocusOnDeactivate: false,
              initialFocus: false,
              onDeactivate: () => r(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (u) => u.key === "ArrowDown" || u.key === "ArrowRight",
              isKeyBackward: (u) => u.key === "ArrowUp" || u.key === "ArrowLeft",
              escapeDeactivates: kt
            },
            children: o.jsx(tn, {
              children: o.jsxs(E, {
                direction: "Column",
                children: [
                  o.jsx(Te, {
                    style: {
                      padding: ee.space.S300
                    },
                    variant: "Surface",
                    direction: "Column",
                    gap: "100",
                    radii: "0",
                    as: "button",
                    type: "button",
                    onClick: l,
                    children: o.jsxs(Ie, {
                      before: o.jsx(Q, {
                        size: "400",
                        src: q.Space
                      }),
                      children: [
                        o.jsx(D, {
                          size: "H6",
                          children: "Create Space"
                        }),
                        o.jsx(D, {
                          size: "T300",
                          priority: "300",
                          children: "Build a space for your community."
                        })
                      ]
                    })
                  }),
                  o.jsx(Te, {
                    style: {
                      padding: ee.space.S300
                    },
                    variant: "Surface",
                    direction: "Column",
                    gap: "100",
                    radii: "0",
                    as: "button",
                    type: "button",
                    onClick: c,
                    children: o.jsxs(Ie, {
                      before: o.jsx(Q, {
                        size: "400",
                        src: q.Link
                      }),
                      children: [
                        o.jsx(D, {
                          size: "H6",
                          children: "Join with Address"
                        }),
                        o.jsx(D, {
                          size: "T300",
                          priority: "300",
                          children: "Become a part of existing community."
                        })
                      ]
                    })
                  })
                ]
              })
            })
          }),
          children: [
            o.jsx(_l, {
              className: n ? ro({
                variant: "Surface"
              }) : void 0,
              as: "button",
              ref: d,
              outlined: true,
              onClick: s,
              children: o.jsx(Q, {
                src: q.Plus
              })
            }),
            i && o.jsx(bge, {
              onCancel: () => a(false),
              onOpen: (u, h) => {
                a(false);
                const f = Sk(u);
                e(h ? gl(f, {
                  viaServers: JB(h)
                }) : f);
              }
            })
          ]
        })
      })
    });
  }
  function gmt() {
    const t = p.useRef(null), [e, n] = p.useState(), [r, i] = Fe(ge, "uniformIcons"), [a, s] = Fe(ge, "showUnreadCounts"), [l, c] = Fe(ge, "badgeCountDMsOnly"), [d, u] = Fe(ge, "showPingCounts"), h = (f) => {
      if (f.target.closest('button, a, [role="button"]')) return;
      f.preventDefault();
      const m = new DOMRect(f.clientX, f.clientY, 0, 0);
      n((v) => v ? void 0 : m);
    };
    return o.jsxs(Iut, {
      onContextMenu: h,
      children: [
        e && o.jsx(ln, {
          anchor: e,
          position: "Right",
          align: "Start",
          content: o.jsx(Ft, {
            focusTrapOptions: {
              initialFocus: false,
              returnFocusOnDeactivate: false,
              onDeactivate: () => n(void 0),
              clickOutsideDeactivates: true,
              isKeyForward: (f) => f.key === "ArrowDown",
              isKeyBackward: (f) => f.key === "ArrowUp",
              escapeDeactivates: kt
            },
            children: o.jsxs(tn, {
              style: {
                maxWidth: He(208),
                width: "100vw"
              },
              children: [
                o.jsxs(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    padding: ee.space.S100
                  },
                  children: [
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      "aria-pressed": a,
                      onClick: () => s(!a),
                      after: o.jsx(Rd, {
                        size: "100",
                        checked: a,
                        readOnly: true,
                        tabIndex: -1
                      }),
                      children: o.jsx(D, {
                        style: {
                          flexGrow: 1
                        },
                        as: "span",
                        size: "T300",
                        truncate: true,
                        children: "Show Room Counts"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      "aria-pressed": l,
                      onClick: () => c(!l),
                      after: o.jsx(Rd, {
                        size: "100",
                        checked: l,
                        readOnly: true,
                        tabIndex: -1
                      }),
                      children: o.jsx(D, {
                        style: {
                          flexGrow: 1
                        },
                        as: "span",
                        size: "T300",
                        truncate: true,
                        children: "Show DM Counts"
                      })
                    }),
                    o.jsx(Ye, {
                      size: "300",
                      radii: "300",
                      "aria-pressed": d,
                      onClick: () => u(!d),
                      after: o.jsx(Rd, {
                        size: "100",
                        checked: d,
                        readOnly: true,
                        tabIndex: -1
                      }),
                      children: o.jsx(D, {
                        style: {
                          flexGrow: 1
                        },
                        as: "span",
                        size: "T300",
                        truncate: true,
                        children: "Show Mention Counts"
                      })
                    })
                  ]
                }),
                o.jsx(nr, {
                  variant: "Surface",
                  size: "300"
                }),
                o.jsx(E, {
                  direction: "Column",
                  gap: "100",
                  style: {
                    padding: ee.space.S100
                  },
                  children: o.jsx(Ye, {
                    size: "300",
                    radii: "300",
                    "aria-pressed": r,
                    onClick: () => i(!r),
                    after: o.jsx(Rd, {
                      size: "100",
                      checked: r,
                      readOnly: true,
                      tabIndex: -1
                    }),
                    children: o.jsx(D, {
                      style: {
                        flexGrow: 1
                      },
                      as: "span",
                      size: "T300",
                      truncate: true,
                      children: "Consistent Icon Style"
                    })
                  })
                })
              ]
            })
          })
        }),
        o.jsx(But, {
          scrollable: o.jsxs(dn, {
            ref: t,
            variant: "Background",
            size: "0",
            children: [
              o.jsxs(FC, {
                children: [
                  o.jsx(xft, {}),
                  o.jsx(Cft, {}),
                  o.jsx(Aft, {})
                ]
              }),
              o.jsx(Xft, {
                scrollRef: t
              }),
              o.jsx(vge, {}),
              o.jsxs(FC, {
                children: [
                  o.jsx(emt, {}),
                  o.jsx(mmt, {})
                ]
              })
            ]
          }),
          sticky: o.jsxs(FC, {
            children: [
              o.jsx(amt, {}),
              o.jsx(omt, {}),
              o.jsx(Qft, {}),
              o.jsx(hmt, {})
            ]
          })
        })
      ]
    });
  }
  function pmt({ children: t }) {
    const e = fr(), n = Ko({
      path: J2,
      caseSensitive: true,
      end: true
    }), r = Ko({
      path: X2,
      caseSensitive: true,
      end: true
    }), i = Ko({
      path: Q2,
      caseSensitive: true,
      end: true
    }), a = Ko({
      path: eb,
      caseSensitive: true,
      end: true
    }), s = Ko({
      path: tb,
      caseSensitive: true,
      end: true
    });
    return e === sn.Mobile && !(n || r || i || a || s) ? null : t;
  }
  function ly({ path: t, children: e }) {
    const n = fr(), r = Ko({
      path: t,
      caseSensitive: true,
      end: true
    });
    return n === sn.Mobile && !r ? null : e;
  }
  const Fmt = "openedSidebarFolder", vmt = (t) => {
    const e = `${Fmt}${t}`, n = ph(e, (i) => {
      if (Ol().closeFoldersByDefault) return /* @__PURE__ */ new Set();
      const s = Ps(i, []);
      return new Set(s);
    }, (i, a) => {
      const s = Array.from(a);
      Vd(i, s);
    });
    return vn((i) => i(n), (i, a, s) => {
      if (s.type === "DELETE") {
        a(n, uo(i(n), (l) => {
          l.delete(s.id);
        }));
        return;
      }
      s.type === "PUT" && a(n, uo(i(n), (l) => {
        l.add(s.id);
      }));
    });
  }, _mt = "callPreferences", ymt = {
    microphone: true,
    video: false,
    sound: true
  }, bmt = (t) => {
    const e = `${_mt}${t}`;
    return ph(e, (r) => Ps(r, ymt), (r, i) => {
      Vd(r, i);
    });
  };
  function xmt({ children: t }) {
    const n = be().getUserId(), r = p.useMemo(() => Lut(n), [
      n
    ]), i = p.useMemo(() => Kit(n), [
      n
    ]), a = p.useMemo(() => uEe(n), [
      n
    ]), s = p.useMemo(() => vmt(n), [
      n
    ]), l = p.useMemo(() => bmt(n), [
      n
    ]);
    return o.jsx(Uut, {
      value: r,
      children: o.jsx(aot, {
        value: i,
        children: o.jsx(zut, {
          value: a,
          children: o.jsx(Hft, {
            value: s,
            children: o.jsx(EKe, {
              value: l,
              children: t
            })
          })
        })
      })
    });
  }
  const FD = "sable-remote-theme-style", eR = "sable-remote-tweaks-style";
  async function FQ(t) {
    try {
      const r = await Qm(t);
      if (r) return r;
    } catch {
    }
    if (gy(t)) return;
    const e = await fetch(t, {
      mode: "cors"
    });
    if (!e.ok) return;
    const n = await e.text();
    try {
      await Fo(t, n);
    } catch {
    }
    return n;
  }
  function wmt() {
    const t = eie();
    return p.useEffect(() => {
      document.body.className = "", document.body.classList.add(j7, T7), t === Rr.Dark && document.body.classList.add(...Zb.classNames), t === Rr.Light && document.body.classList.add(...Hg.classNames);
    }, [
      t
    ]), o.jsx(Soe, {
      kind: t
    });
  }
  function Dmt({ children: t }) {
    const e = yk(), [n] = Fe(ge, "saturationLevel"), [r] = Fe(ge, "underlineLinks"), [i] = Fe(ge, "reducedMotion"), [a] = Fe(ge, "themeRemoteEnabledTweakFullUrls");
    return p.useEffect(() => {
      document.body.className = "", document.body.classList.add(j7, T7), document.body.classList.add(...e.classNames), r ? document.body.classList.add("force-underline-links") : document.body.classList.remove("force-underline-links"), i ? document.body.classList.add("reduced-motion") : document.body.classList.remove("reduced-motion"), n === 0 ? document.body.style.filter = "grayscale(1)" : n && n < 100 ? document.body.style.filter = `saturate(${n}%)` : document.body.style.filter = "";
    }, [
      e,
      n,
      r,
      i
    ]), p.useEffect(() => {
      var _a6, _b3;
      const s = (_a6 = e.remoteFullUrl) == null ? void 0 : _a6.trim();
      let l = false;
      return s ? (async () => {
        var _a7;
        const c = await FQ(s);
        if (l) return;
        if (!c) {
          (_a7 = document.getElementById(FD)) == null ? void 0 : _a7.remove();
          return;
        }
        let d = document.getElementById(FD);
        d || (d = document.createElement("style"), d.id = FD, document.head.appendChild(d)), d.textContent = c;
      })() : (_b3 = document.getElementById(FD)) == null ? void 0 : _b3.remove(), () => {
        l = true;
      };
    }, [
      e.remoteFullUrl
    ]), p.useEffect(() => {
      var _a6;
      const s = (a ?? []).filter((c) => c.trim().length > 0);
      let l = false;
      if (s.length === 0) {
        (_a6 = document.getElementById(eR)) == null ? void 0 : _a6.remove();
        return;
      }
      return (async () => {
        const c = await Promise.all(s.map((h) => FQ(h.trim())));
        if (l) return;
        const d = c.filter((h) => !!h);
        let u = document.getElementById(eR);
        u || (u = document.createElement("style"), u.id = eR, document.head.appendChild(u)), u.textContent = d.join(`

`);
      })(), () => {
        l = true;
      };
    }, [
      a
    ]), o.jsx(Soe, {
      kind: e.kind,
      children: o.jsx(C4e, {
        value: e,
        children: t
      })
    });
  }
  function Cmt({ children: t }) {
    const e = CAe();
    return o.jsx(DAe, {
      value: e,
      children: t
    });
  }
  function Emt() {
    const t = fr(), { navigateRoom: e } = Wi();
    return o.jsxs(si, {
      children: [
        t === sn.Mobile && o.jsx(_i, {
          balance: true,
          outlined: false,
          children: o.jsx(E, {
            grow: "Yes",
            alignItems: "Center",
            gap: "200",
            children: o.jsx(ic, {
              children: (n) => o.jsx(Oe, {
                onClick: n,
                children: o.jsx(Q, {
                  src: q.ArrowLeft
                })
              })
            })
          })
        }),
        o.jsx(E, {
          grow: "Yes",
          children: o.jsx(dn, {
            hideTrack: true,
            visibility: "Hover",
            children: o.jsx(Xr, {
              children: o.jsx(qd, {
                children: o.jsx(Uc, {
                  children: o.jsxs(E, {
                    direction: "Column",
                    gap: "700",
                    children: [
                      o.jsx(Vc, {
                        icon: o.jsx(Q, {
                          size: "600",
                          src: q.Hash
                        }),
                        title: "Create Room",
                        subTitle: "Build a Room for Real-Time Conversations."
                      }),
                      o.jsx(Yme, {
                        onCreate: e
                      })
                    ]
                  })
                })
              })
            })
          })
        })
      ]
    });
  }
  function kmt() {
    const { navigateSpace: t } = Wi();
    return o.jsx(si, {
      children: o.jsx(E, {
        grow: "Yes",
        children: o.jsx(dn, {
          hideTrack: true,
          visibility: "Hover",
          children: o.jsx(Xr, {
            children: o.jsx(qd, {
              children: o.jsx(Uc, {
                children: o.jsxs(E, {
                  direction: "Column",
                  gap: "700",
                  children: [
                    o.jsx(Vc, {
                      icon: o.jsx(Q, {
                        size: "600",
                        src: q.Space
                      }),
                      title: "Create Space",
                      subTitle: "Build a space for your community."
                    }),
                    o.jsx(Zme, {
                      onCreate: t
                    })
                  ]
                })
              })
            })
          })
        })
      })
    });
  }
  function Smt() {
    const { user_id: t, room_id: e, event_id: n } = Fl(), r = Fn(Fh), i = Fn(t3);
    return p.useEffect(() => {
      e && (t && r(t), i({
        roomId: e,
        eventId: n,
        targetSessionId: t
      }), window.history.replaceState({}, "", "/"));
    }, [
      t,
      e,
      n,
      r,
      i
    ]), null;
  }
  var jmt = "styles_LiveChipText__4ky13h0", Tmt = "styles_CallStatus__4ky13h1", Rmt = "styles_ControlDivider__4ky13h2", Amt = "styles_SpeakerAvatarOutline__4ky13h3";
  function Imt({ count: t, room: e, members: n }) {
    const r = be(), i = hn(), a = Ls(), [s, l] = p.useState(), c = (d) => {
      l(d.currentTarget.getBoundingClientRect());
    };
    return o.jsx(ln, {
      anchor: s,
      position: "Top",
      align: "Start",
      content: o.jsx(Ft, {
        focusTrapOptions: {
          initialFocus: false,
          onDeactivate: () => l(void 0),
          clickOutsideDeactivates: true,
          isKeyForward: (d) => d.key === "ArrowDown",
          isKeyBackward: (d) => d.key === "ArrowUp",
          escapeDeactivates: kt
        },
        children: o.jsx(tn, {
          style: {
            maxHeight: "75vh",
            maxWidth: He(300),
            display: "flex"
          },
          children: o.jsx(E, {
            grow: "Yes",
            children: o.jsx(dn, {
              size: "0",
              hideTrack: true,
              visibility: "Hover",
              children: o.jsx(E, {
                direction: "Column",
                style: {
                  padding: ee.space.S100
                },
                children: n.map((d) => {
                  const u = d.sender;
                  if (!u) return null;
                  const h = gr(e, u) ?? _n(u) ?? u, f = Jc(e, u), g = f ? Cn(r, f, i, 96, 96) ?? void 0 : void 0;
                  return o.jsx(Ye, {
                    size: "400",
                    variant: "Surface",
                    radii: "300",
                    style: {
                      paddingLeft: ee.space.S200
                    },
                    onClick: (m) => a(e.roomId, void 0, u, wp(m.nativeEvent), "Right"),
                    before: o.jsx(xn, {
                      size: "200",
                      radii: "400",
                      children: o.jsx(Si, {
                        userId: u,
                        src: g,
                        alt: h,
                        renderFallback: () => o.jsx(Q, {
                          size: "50",
                          src: q.User,
                          filled: true
                        })
                      })
                    }),
                    children: o.jsx(D, {
                      size: "T300",
                      truncate: true,
                      children: h
                    })
                  }, d.membershipID);
                })
              })
            })
          })
        })
      }),
      children: o.jsx(Qe, {
        variant: "Surface",
        fill: "Soft",
        before: o.jsx(Rn, {
          variant: "Critical",
          fill: "Solid",
          size: "200"
        }),
        after: o.jsx(Q, {
          size: "50",
          src: s ? q.ChevronBottom : q.ChevronTop
        }),
        radii: "Pill",
        onClick: c,
        children: o.jsxs(D, {
          className: jmt,
          as: "span",
          size: "L400",
          truncate: true,
          children: [
            t,
            " Live"
          ]
        })
      })
    });
  }
  function vQ({ room: t }) {
    var _a6;
    const e = be(), n = rc(t), r = Ze(vi), i = Jk(e, zr, r), s = Ze(gi).has(t.roomId), l = td(), c = ec(l), d = sa(r, t.roomId), u = d && i.filter((g) => d.has(g)), h = u && K2(e, t.roomId, u), { navigateRoom: f } = Wi();
    return o.jsx(Qe, {
      variant: "Background",
      radii: "Pill",
      before: o.jsx(Ya, {
        size: "200",
        joinRule: t.getJoinRule(),
        roomType: t.getType(),
        filled: true
      }),
      onClick: () => f(t.roomId),
      children: o.jsxs(D, {
        size: "L400",
        truncate: true,
        children: [
          n,
          !s && h && o.jsxs(D, {
            as: "span",
            size: "T200",
            priority: "300",
            children: [
              " \u2022",
              " ",
              o.jsx("b", {
                children: ((_a6 = c(h)) == null ? void 0 : _a6.name) ?? h
              })
            ]
          })
        ]
      })
    });
  }
  function LE() {
    return o.jsx(nr, {
      variant: "Background",
      size: "300",
      direction: "Vertical",
      className: Rmt
    });
  }
  function Bmt({ enabled: t, onToggle: e, disabled: n }) {
    return o.jsx(ar, {
      position: "Top",
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Turn Off Microphone" : "Turn On Microphone"
        })
      }),
      children: (r) => o.jsx(Oe, {
        ref: r,
        variant: t ? "Surface" : "Warning",
        fill: "Soft",
        radii: "300",
        size: "300",
        onClick: () => e(),
        outlined: true,
        disabled: n,
        children: o.jsx(Q, {
          size: "100",
          src: t ? q.Mic : q.MicMute,
          filled: !t
        })
      })
    });
  }
  function Pmt({ enabled: t, onToggle: e, disabled: n }) {
    return o.jsx(ar, {
      position: "Top",
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Turn Off Sound" : "Turn On Sound"
        })
      }),
      children: (r) => o.jsx(Oe, {
        ref: r,
        variant: t ? "Surface" : "Warning",
        fill: "Soft",
        radii: "300",
        size: "300",
        onClick: () => e(),
        outlined: true,
        disabled: n,
        children: o.jsx(Q, {
          size: "100",
          src: t ? q.Headphone : q.HeadphoneMute,
          filled: !t
        })
      })
    });
  }
  function Mmt({ enabled: t, onToggle: e, disabled: n }) {
    return o.jsx(ar, {
      position: "Top",
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Stop Camera" : "Start Camera"
        })
      }),
      children: (r) => o.jsx(Oe, {
        ref: r,
        variant: t ? "Success" : "Surface",
        fill: "Soft",
        radii: "300",
        size: "300",
        onClick: () => e(),
        outlined: true,
        disabled: n,
        children: o.jsx(Q, {
          size: "100",
          src: t ? q.VideoCamera : q.VideoCameraMute,
          filled: t
        })
      })
    });
  }
  function Omt({ enabled: t, onToggle: e, disabled: n }) {
    return o.jsx(ar, {
      position: "Top",
      tooltip: o.jsx(pr, {
        children: o.jsx(D, {
          size: "T200",
          children: t ? "Stop Screenshare" : "Start Screenshare"
        })
      }),
      children: (r) => o.jsx(Oe, {
        ref: r,
        variant: t ? "Success" : "Surface",
        fill: "Soft",
        radii: "300",
        size: "300",
        onClick: e,
        outlined: true,
        disabled: n,
        children: o.jsx(Q, {
          size: "100",
          src: q.ScreenShare,
          filled: t
        })
      })
    });
  }
  function Lmt({ callEmbed: t, compact: e, callJoined: n }) {
    const { microphone: r, video: i, sound: a, screenshare: s } = Rde(t.control), l = Fn(ev), [c, d] = Et(p.useCallback(() => t.hangup(), [
      t
    ])), u = c.status === ve.Loading || c.status === ve.Success, h = () => {
      if (!n) {
        l(void 0);
        return;
      }
      d();
    };
    return o.jsxs(E, {
      shrink: "No",
      alignItems: "Center",
      gap: "300",
      children: [
        o.jsxs(E, {
          alignItems: "Inherit",
          gap: "200",
          children: [
            o.jsx(Bmt, {
              enabled: r,
              onToggle: () => t.control.toggleMicrophone(),
              disabled: !n
            }),
            o.jsx(Pmt, {
              enabled: a,
              onToggle: () => t.control.toggleSound(),
              disabled: !n
            }),
            !e && o.jsx(LE, {}),
            o.jsx(Mmt, {
              enabled: i,
              onToggle: () => t.control.toggleVideo(),
              disabled: !n
            }),
            !e && o.jsx(Omt, {
              enabled: s,
              onToggle: () => t.control.toggleScreenshare(),
              disabled: !n
            })
          ]
        }),
        o.jsx(LE, {}),
        o.jsx(Qe, {
          variant: "Critical",
          radii: "Pill",
          fill: "Soft",
          before: u ? o.jsx(dt, {
            variant: "Critical",
            fill: "Soft",
            size: "50"
          }) : o.jsx(Q, {
            size: "50",
            src: q.PhoneDown,
            filled: true
          }),
          disabled: u,
          outlined: true,
          onClick: h,
          children: !e && o.jsx(D, {
            as: "span",
            size: "L400",
            children: "End"
          })
        })
      ]
    });
  }
  var Nmt = Jr({
    defaultClassName: "styles_StackedAvatar__nnylps0",
    variantClassNames: {
      size: {
        200: "styles_StackedAvatar_size_200__nnylps1",
        300: "styles_StackedAvatar_size_300__nnylps2",
        400: "styles_StackedAvatar_size_400__nnylps3",
        500: "styles_StackedAvatar_size_500__nnylps4"
      },
      variant: {
        Background: "styles_StackedAvatar_variant_Background__nnylps5",
        Surface: "styles_StackedAvatar_variant_Surface__nnylps6",
        SurfaceVariant: "styles_StackedAvatar_variant_SurfaceVariant__nnylps7",
        Primary: "styles_StackedAvatar_variant_Primary__nnylps8",
        Secondary: "styles_StackedAvatar_variant_Secondary__nnylps9",
        Success: "styles_StackedAvatar_variant_Success__nnylpsa",
        Warning: "styles_StackedAvatar_variant_Warning__nnylpsb",
        Critical: "styles_StackedAvatar_variant_Critical__nnylpsc"
      }
    },
    defaultVariants: {
      size: "400",
      variant: "Surface"
    },
    compoundVariants: []
  });
  const zmt = ft(({ size: t, variant: e, className: n, ...r }, i) => o.jsx(xn, {
    size: t,
    className: gt(Nmt({
      size: t,
      variant: e
    }), n),
    ...r,
    ref: i
  }));
  function Umt({ room: t, members: e, speakers: n, max: r = 6 }) {
    const i = be(), a = hn(), s = Ls(), l = e.slice(0, r), c = r && e.length > r ? e.length - r : 0;
    return o.jsxs(E, {
      alignItems: "Center",
      children: [
        l.map((d) => {
          const u = d.sender;
          if (!u) return null;
          const h = gr(t, u) ?? _n(u) ?? u, f = Jc(t, u), g = f ? Cn(i, f, a, 96, 96) ?? void 0 : void 0;
          return o.jsx(zmt, {
            className: n.has(d.sender) ? Amt : void 0,
            title: h,
            as: "button",
            variant: "Background",
            size: "200",
            radii: "Pill",
            onClick: (m) => s(t.roomId, void 0, u, wp(m.nativeEvent), "Top"),
            children: o.jsx(Si, {
              userId: u,
              src: g,
              alt: h,
              renderFallback: () => o.jsx(Q, {
                size: "50",
                src: q.User,
                filled: true
              })
            })
          }, d.membershipID);
        }),
        c > 0 && o.jsxs(D, {
          size: "L400",
          style: {
            paddingLeft: ee.space.S100
          },
          children: [
            "+",
            c
          ]
        })
      ]
    });
  }
  const Vmt = (t, e, n) => {
    const r = p.useMemo(() => new MutationObserver(t), [
      t
    ]);
    return p.useEffect(() => () => r == null ? void 0 : r.disconnect(), [
      r
    ]), p.useEffect(() => () => {
    }, [
      r,
      e,
      n
    ]), r;
  }, Hmt = (t) => {
    const [e, n] = p.useState(/* @__PURE__ */ new Set()), r = QF(t.room), i = x3(t.room, r), a = Ap(t), s = p.useMemo(() => {
      var _a6;
      if (i && a) return (_a6 = t.document) == null ? void 0 : _a6.querySelectorAll("[data-video-fit]");
    }, [
      t,
      i,
      a
    ]), l = Vmt(p.useCallback((c) => {
      const d = /* @__PURE__ */ new Set();
      c.forEach((u) => {
        var _a6, _b3;
        if (u.type !== "attributes") return;
        const h = u.target, f = (_a6 = t.iframe.contentWindow) == null ? void 0 : _a6.getComputedStyle(h, "::before");
        if (!f || !(f.getPropertyValue("background-image") !== "none")) return;
        const v = (_b3 = h.querySelector("[aria-label]")) == null ? void 0 : _b3.getAttribute("aria-label");
        v && co(v) && d.add(v);
      }), n(d);
    }, [
      t
    ]));
    return p.useEffect(() => (s == null ? void 0 : s.forEach((c) => {
      l.observe(c, {
        attributes: true,
        attributeFilter: [
          "class",
          "style"
        ]
      });
    }), () => {
      l.disconnect();
    }), [
      s,
      l
    ]), e;
  };
  function $mt({ room: t, speakers: e }) {
    const n = Array.from(e).map((r) => gr(t, r) ?? _n(r) ?? r);
    return o.jsxs(E, {
      alignItems: "Center",
      gap: "100",
      children: [
        o.jsx(Q, {
          size: "100",
          src: q.Mic,
          filled: true
        }),
        o.jsxs(D, {
          size: "T200",
          truncate: true,
          children: [
            n.length === 1 && o.jsxs(o.Fragment, {
              children: [
                o.jsx("b", {
                  children: n[0]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " is speaking..."
                })
              ]
            }),
            n.length === 2 && o.jsxs(o.Fragment, {
              children: [
                o.jsx("b", {
                  children: n[0]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " and "
                }),
                o.jsx("b", {
                  children: n[1]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " are speaking..."
                })
              ]
            }),
            n.length === 3 && o.jsxs(o.Fragment, {
              children: [
                o.jsx("b", {
                  children: n[0]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: ", "
                }),
                o.jsx("b", {
                  children: n[1]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " and "
                }),
                o.jsx("b", {
                  children: n[2]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " are speaking..."
                })
              ]
            }),
            n.length > 3 && o.jsxs(o.Fragment, {
              children: [
                o.jsx("b", {
                  children: n[0]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: ", "
                }),
                o.jsx("b", {
                  children: n[1]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: ", "
                }),
                o.jsx("b", {
                  children: n[2]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " and "
                }),
                o.jsxs("b", {
                  children: [
                    n.length - 3,
                    " others"
                  ]
                }),
                o.jsx(D, {
                  as: "span",
                  size: "Inherit",
                  priority: "300",
                  children: " are speaking..."
                })
              ]
            })
          ]
        })
      ]
    });
  }
  function Wmt({ callEmbed: t }) {
    const { room: e } = t, n = QF(e), r = x3(e, n), i = kte(), a = Ap(t), s = Hmt(t), l = i === sn.Mobile, c = a && r.length > 0;
    return o.jsxs(E, {
      className: gt(Tmt, ro({
        variant: "Background"
      })),
      shrink: "No",
      gap: "400",
      alignItems: l ? void 0 : "Center",
      direction: l ? "Column" : "Row",
      children: [
        o.jsxs(E, {
          grow: "Yes",
          alignItems: "Center",
          gap: "200",
          children: [
            c ? o.jsx(E, {
              shrink: "No",
              children: o.jsx(Imt, {
                count: r.length,
                room: e,
                members: r
              })
            }) : o.jsx(dt, {
              variant: "Secondary",
              size: "200"
            }),
            o.jsx(E, {
              grow: "Yes",
              alignItems: "Center",
              gap: "Inherit",
              children: !l && o.jsxs(o.Fragment, {
                children: [
                  o.jsx(vQ, {
                    room: e
                  }),
                  s.size > 0 && o.jsxs(o.Fragment, {
                    children: [
                      o.jsx(LE, {}),
                      o.jsx("span", {
                        "data-spacing-node": true
                      }),
                      o.jsx($mt, {
                        room: e,
                        speakers: s
                      })
                    ]
                  })
                ]
              })
            }),
            c && o.jsx(E, {
              shrink: "No",
              children: o.jsx(Umt, {
                room: e,
                members: r,
                speakers: s
              })
            })
          ]
        }),
        c && !l && o.jsx(LE, {}),
        o.jsxs(E, {
          shrink: "No",
          alignItems: "Center",
          gap: "Inherit",
          children: [
            l && o.jsx(E, {
              grow: "Yes",
              children: o.jsx(vQ, {
                room: e
              })
            }),
            o.jsx(Lmt, {
              callJoined: a,
              compact: l,
              callEmbed: t
            })
          ]
        })
      ]
    });
  }
  function qmt() {
    const t = sm(), e = oc(), n = fr();
    return !t || n === sn.Mobile && t.roomId === e ? null : o.jsx(Wmt, {
      callEmbed: t
    });
  }
  const _Q = () => Ps(e3, []).length > 0 ? true : !!Ck(), Kmt = () => {
    const t = Ps(e3, []);
    return t.length > 0 ? t[0] : Ck();
  }, Gmt = (t, e) => {
    const { hashRouter: n } = t, r = e === sn.Mobile, i = fR(o.jsxs(Nr, {
      children: [
        o.jsx(Nr, {
          index: true,
          loader: () => {
            if (_Q()) return xm($c());
            const a = MA(PA(), window.location.href);
            return a && YX(a), xm(Hd());
          }
        }),
        o.jsxs(Nr, {
          loader: ({ request: a }) => {
            const s = new URL(a.url);
            return s.searchParams.get("addAccount") === "1" || s.searchParams.has("loginToken") ? null : _Q() ? xm($c()) : null;
          },
          element: o.jsx(cR, {
            fallback: ({ error: a, eventId: s }) => o.jsx(MR, {
              error: a instanceof Error ? a : new Error(String(a)),
              eventId: s || void 0
            }),
            beforeCapture: (a) => a.setTag("section", "auth"),
            children: o.jsxs(o.Fragment, {
              children: [
                o.jsx(xct, {}),
                o.jsx(wmt, {})
              ]
            })
          }),
          children: [
            o.jsx(Nr, {
              path: $y,
              element: o.jsx(Act, {})
            }),
            o.jsx(Nr, {
              path: m4,
              element: o.jsx(Vct, {})
            }),
            o.jsx(Nr, {
              path: g4,
              element: o.jsx(Gct, {})
            })
          ]
        }),
        o.jsxs(Nr, {
          loader: () => {
            if (!Kmt()) {
              const s = MA(PA(n), window.location.href);
              return s && YX(s), xm(Hd());
            }
            return null;
          },
          element: o.jsx(cR, {
            fallback: ({ error: a, eventId: s }) => o.jsx(MR, {
              error: a instanceof Error ? a : new Error(String(a)),
              eventId: s || void 0
            }),
            beforeCapture: (a) => a.setTag("section", "client"),
            children: o.jsxs(Dmt, {
              children: [
                o.jsx(sut, {}),
                o.jsx(odt, {
                  children: o.jsx(xmt, {
                    children: o.jsx(Cmt, {
                      children: o.jsx(sdt, {
                        children: o.jsxs(gut, {
                          children: [
                            o.jsx(tct, {}),
                            o.jsxs(cct, {
                              children: [
                                o.jsx(ldt, {
                                  nav: o.jsx(pmt, {
                                    children: o.jsx(gmt, {})
                                  }),
                                  children: o.jsx(nKe, {})
                                }),
                                o.jsx(qmt, {})
                              ]
                            }),
                            o.jsx(PAe, {}),
                            o.jsx(Glt, {}),
                            o.jsx(Xlt, {}),
                            o.jsx(ect, {}),
                            o.jsx($be, {}),
                            o.jsx(rKe, {}),
                            o.jsx(alt, {}),
                            o.jsx(flt, {}),
                            o.jsx(rct, {}),
                            o.jsx("div", {
                              id: "sable-announcements",
                              role: "status",
                              "aria-live": "polite",
                              "aria-atomic": "true",
                              style: {
                                position: "absolute",
                                width: "1px",
                                height: "1px",
                                overflow: "hidden",
                                clip: "rect(0,0,0,0)",
                                whiteSpace: "nowrap"
                              }
                            }),
                            o.jsx(Y$e, {}),
                            o.jsx(kHe, {})
                          ]
                        })
                      })
                    })
                  })
                })
              ]
            })
          }),
          children: [
            o.jsxs(Nr, {
              path: J2,
              element: o.jsx(df, {
                nav: o.jsx(ly, {
                  path: J2,
                  children: o.jsx(Wut, {})
                }),
                children: o.jsx(I0, {})
              }),
              children: [
                r ? null : o.jsx(Nr, {
                  index: true,
                  element: o.jsx(sy, {})
                }),
                o.jsx(Nr, {
                  path: p4,
                  element: o.jsx(Emt, {})
                }),
                o.jsx(Nr, {
                  path: qEe,
                  element: o.jsx("p", {
                    children: "join"
                  })
                }),
                o.jsx(Nr, {
                  path: F4,
                  element: o.jsx(rht, {})
                }),
                o.jsx(Nr, {
                  path: p1,
                  element: o.jsx(Fht, {
                    children: o.jsx(MT, {})
                  })
                })
              ]
            }),
            o.jsxs(Nr, {
              path: X2,
              element: o.jsx(df, {
                nav: o.jsx(ly, {
                  path: X2,
                  children: o.jsx(wht, {})
                }),
                children: o.jsx(I0, {})
              }),
              children: [
                r ? null : o.jsx(Nr, {
                  index: true,
                  element: o.jsx(sy, {})
                }),
                o.jsx(Nr, {
                  path: p4,
                  element: o.jsx(Eht, {})
                }),
                o.jsx(Nr, {
                  path: p1,
                  element: o.jsx(Dht, {
                    children: o.jsx(MT, {})
                  })
                })
              ]
            }),
            o.jsxs(Nr, {
              path: Q2,
              element: o.jsx(kht, {
                children: o.jsx(df, {
                  nav: o.jsx(ly, {
                    path: Q2,
                    children: o.jsx(zht, {})
                  }),
                  children: o.jsx(I0, {})
                })
              }),
              children: [
                r ? null : o.jsx(Nr, {
                  index: true,
                  loader: ({ params: a }) => {
                    const s = a.spaceIdOrAlias, l = s && decodeURIComponent(s);
                    return l ? xm(Qg(l)) : null;
                  },
                  element: o.jsx(sy, {})
                }),
                o.jsx(Nr, {
                  path: Mie,
                  element: o.jsx(mst, {})
                }),
                o.jsx(Nr, {
                  path: F4,
                  element: o.jsx(Uht, {})
                }),
                o.jsx(Nr, {
                  path: p1,
                  element: o.jsx(Vht, {
                    children: o.jsx(MT, {})
                  })
                })
              ]
            }),
            o.jsxs(Nr, {
              path: eb,
              element: o.jsx(df, {
                nav: o.jsx(ly, {
                  path: eb,
                  children: o.jsx(Kht, {})
                }),
                children: o.jsx(I0, {})
              }),
              children: [
                r ? null : o.jsx(Nr, {
                  index: true,
                  loader: () => xm(jk()),
                  element: o.jsx(sy, {})
                }),
                o.jsx(Nr, {
                  path: Oie,
                  element: o.jsx(tft, {})
                }),
                o.jsx(Nr, {
                  path: Lie,
                  element: o.jsx(eft, {})
                })
              ]
            }),
            o.jsx(Nr, {
              path: Nie,
              element: o.jsx(kmt, {})
            }),
            o.jsx(Nr, {
              path: PF,
              element: o.jsx(kde, {})
            }),
            o.jsxs(Nr, {
              path: tb,
              element: o.jsx(df, {
                nav: o.jsx(ly, {
                  path: tb,
                  children: o.jsx(rft, {})
                }),
                children: o.jsx(I0, {})
              }),
              children: [
                r ? null : o.jsx(Nr, {
                  index: true,
                  loader: () => xm(Tk()),
                  element: o.jsx(sy, {})
                }),
                o.jsx(Nr, {
                  path: zie,
                  element: o.jsx(cft, {})
                }),
                o.jsx(Nr, {
                  path: Uie,
                  element: o.jsx(yft, {})
                })
              ]
            }),
            o.jsx(Nr, {
              path: rke,
              element: o.jsx(Smt, {})
            })
          ]
        }),
        o.jsx(Nr, {
          path: "/*",
          element: o.jsx("p", {
            children: "Page not found"
          })
        })
      ]
    }));
    return (n == null ? void 0 : n.enabled) ? Gve(i, {
      basename: n.basename
    }) : Kve(i, {
      basename: "/sable"
    });
  }, Ymt = "sable_react_query_devtools", Zmt = () => localStorage.getItem(Ymt) === "1", Jmt = new j2e(), Xmt = p.lazy(async () => {
    const { ReactQueryDevtools: t } = await L1(async () => {
      const { ReactQueryDevtools: e } = await import("./index-Ds5yF1gS.js");
      return {
        ReactQueryDevtools: e
      };
    }, []);
    return {
      default: t
    };
  });
  function Qmt({ clientConfig: t, screenSize: e }) {
    const n = p.useRef();
    n.current || (n.current = I7()), F4e(n.current, t.settingsDefaults);
    const r = Zmt();
    return o.jsx(H2e, {
      value: t,
      children: o.jsxs(T2e, {
        client: Jmt,
        children: [
          o.jsx(r2e, {
            store: n.current,
            children: o.jsx(n_e, {
              router: Gmt(t, e)
            })
          }),
          r && o.jsx(p.Suspense, {
            fallback: null,
            children: o.jsx(Xmt, {
              initialIsOpen: false
            })
          })
        ]
      })
    });
  }
  function egt() {
    const t = kte();
    ebe();
    const e = document.getElementById("portalContainer") ?? void 0;
    return o.jsx(cR, {
      fallback: ({ error: n, eventId: r }) => o.jsx(MR, {
        error: n instanceof Error ? n : new Error(String(n)),
        eventId: r || void 0
      }),
      children: o.jsx(bye, {
        value: e,
        children: o.jsx(iye, {
          value: e,
          children: o.jsx(eye, {
            value: e,
            children: o.jsx(Q2e, {
              value: t,
              children: o.jsx(Gbe, {
                children: o.jsx(V2e, {
                  fallback: () => o.jsx(Wbe, {}),
                  error: (n, r, i) => o.jsx(qbe, {
                    error: n,
                    retry: r,
                    ignore: i
                  }),
                  children: (n) => (q2e(n.matrixToBaseUrl), o.jsx(Qmt, {
                    clientConfig: n,
                    screenSize: t
                  }))
                })
              })
            })
          })
        })
      })
    });
  }
  const { slice: tgt, forEach: ngt } = [];
  function rgt(t) {
    return ngt.call(tgt.call(arguments, 1), (e) => {
      if (e) for (const n in e) t[n] === void 0 && (t[n] = e[n]);
    }), t;
  }
  function igt(t) {
    return typeof t != "string" ? false : [
      /<\s*script.*?>/i,
      /<\s*\/\s*script\s*>/i,
      /<\s*img.*?on\w+\s*=/i,
      /<\s*\w+\s*on\w+\s*=.*?>/i,
      /javascript\s*:/i,
      /vbscript\s*:/i,
      /expression\s*\(/i,
      /eval\s*\(/i,
      /alert\s*\(/i,
      /document\.cookie/i,
      /document\.write\s*\(/i,
      /window\.location/i,
      /innerHTML/i
    ].some((n) => n.test(t));
  }
  const yQ = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, ogt = function(t, e) {
    const r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
      path: "/"
    }, i = encodeURIComponent(e);
    let a = `${t}=${i}`;
    if (r.maxAge > 0) {
      const s = r.maxAge - 0;
      if (Number.isNaN(s)) throw new Error("maxAge should be a Number");
      a += `; Max-Age=${Math.floor(s)}`;
    }
    if (r.domain) {
      if (!yQ.test(r.domain)) throw new TypeError("option domain is invalid");
      a += `; Domain=${r.domain}`;
    }
    if (r.path) {
      if (!yQ.test(r.path)) throw new TypeError("option path is invalid");
      a += `; Path=${r.path}`;
    }
    if (r.expires) {
      if (typeof r.expires.toUTCString != "function") throw new TypeError("option expires is invalid");
      a += `; Expires=${r.expires.toUTCString()}`;
    }
    if (r.httpOnly && (a += "; HttpOnly"), r.secure && (a += "; Secure"), r.sameSite) switch (typeof r.sameSite == "string" ? r.sameSite.toLowerCase() : r.sameSite) {
      case true:
        a += "; SameSite=Strict";
        break;
      case "lax":
        a += "; SameSite=Lax";
        break;
      case "strict":
        a += "; SameSite=Strict";
        break;
      case "none":
        a += "; SameSite=None";
        break;
      default:
        throw new TypeError("option sameSite is invalid");
    }
    return r.partitioned && (a += "; Partitioned"), a;
  }, bQ = {
    create(t, e, n, r) {
      let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
        path: "/",
        sameSite: "strict"
      };
      n && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + n * 60 * 1e3)), r && (i.domain = r), document.cookie = ogt(t, e, i);
    },
    read(t) {
      const e = `${t}=`, n = document.cookie.split(";");
      for (let r = 0; r < n.length; r++) {
        let i = n[r];
        for (; i.charAt(0) === " "; ) i = i.substring(1, i.length);
        if (i.indexOf(e) === 0) return i.substring(e.length, i.length);
      }
      return null;
    },
    remove(t, e) {
      this.create(t, "", -1, e);
    }
  };
  var agt = {
    name: "cookie",
    lookup(t) {
      let { lookupCookie: e } = t;
      if (e && typeof document < "u") return bQ.read(e) || void 0;
    },
    cacheUserLanguage(t, e) {
      let { lookupCookie: n, cookieMinutes: r, cookieDomain: i, cookieOptions: a } = e;
      n && typeof document < "u" && bQ.create(n, t, r, i, a);
    }
  }, sgt = {
    name: "querystring",
    lookup(t) {
      var _a6;
      let { lookupQuerystring: e } = t, n;
      if (typeof window < "u") {
        let { search: r } = window.location;
        !window.location.search && ((_a6 = window.location.hash) == null ? void 0 : _a6.indexOf("?")) > -1 && (r = window.location.hash.substring(window.location.hash.indexOf("?")));
        const a = r.substring(1).split("&");
        for (let s = 0; s < a.length; s++) {
          const l = a[s].indexOf("=");
          l > 0 && a[s].substring(0, l) === e && (n = a[s].substring(l + 1));
        }
      }
      return n;
    }
  }, lgt = {
    name: "hash",
    lookup(t) {
      var _a6;
      let { lookupHash: e, lookupFromHashIndex: n } = t, r;
      if (typeof window < "u") {
        const { hash: i } = window.location;
        if (i && i.length > 2) {
          const a = i.substring(1);
          if (e) {
            const s = a.split("&");
            for (let l = 0; l < s.length; l++) {
              const c = s[l].indexOf("=");
              c > 0 && s[l].substring(0, c) === e && (r = s[l].substring(c + 1));
            }
          }
          if (r) return r;
          if (!r && n > -1) {
            const s = i.match(/\/([a-zA-Z-]*)/g);
            return Array.isArray(s) ? (_a6 = s[typeof n == "number" ? n : 0]) == null ? void 0 : _a6.replace("/", "") : void 0;
          }
        }
      }
      return r;
    }
  };
  let R0 = null;
  const xQ = () => {
    if (R0 !== null) return R0;
    try {
      if (R0 = typeof window < "u" && window.localStorage !== null, !R0) return false;
      const t = "i18next.translate.boo";
      window.localStorage.setItem(t, "foo"), window.localStorage.removeItem(t);
    } catch {
      R0 = false;
    }
    return R0;
  };
  var cgt = {
    name: "localStorage",
    lookup(t) {
      let { lookupLocalStorage: e } = t;
      if (e && xQ()) return window.localStorage.getItem(e) || void 0;
    },
    cacheUserLanguage(t, e) {
      let { lookupLocalStorage: n } = e;
      n && xQ() && window.localStorage.setItem(n, t);
    }
  };
  let A0 = null;
  const wQ = () => {
    if (A0 !== null) return A0;
    try {
      if (A0 = typeof window < "u" && window.sessionStorage !== null, !A0) return false;
      const t = "i18next.translate.boo";
      window.sessionStorage.setItem(t, "foo"), window.sessionStorage.removeItem(t);
    } catch {
      A0 = false;
    }
    return A0;
  };
  var dgt = {
    name: "sessionStorage",
    lookup(t) {
      let { lookupSessionStorage: e } = t;
      if (e && wQ()) return window.sessionStorage.getItem(e) || void 0;
    },
    cacheUserLanguage(t, e) {
      let { lookupSessionStorage: n } = e;
      n && wQ() && window.sessionStorage.setItem(n, t);
    }
  }, ugt = {
    name: "navigator",
    lookup(t) {
      const e = [];
      if (typeof navigator < "u") {
        const { languages: n, userLanguage: r, language: i } = navigator;
        if (n) for (let a = 0; a < n.length; a++) e.push(n[a]);
        r && e.push(r), i && e.push(i);
      }
      return e.length > 0 ? e : void 0;
    }
  }, hgt = {
    name: "htmlTag",
    lookup(t) {
      let { htmlTag: e } = t, n;
      const r = e || (typeof document < "u" ? document.documentElement : null);
      return r && typeof r.getAttribute == "function" && (n = r.getAttribute("lang")), n;
    }
  }, fgt = {
    name: "path",
    lookup(t) {
      var _a6;
      let { lookupFromPathIndex: e } = t;
      if (typeof window > "u") return;
      const n = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
      return Array.isArray(n) ? (_a6 = n[typeof e == "number" ? e : 0]) == null ? void 0 : _a6.replace("/", "") : void 0;
    }
  }, mgt = {
    name: "subdomain",
    lookup(t) {
      var _a6, _b3;
      let { lookupFromSubdomainIndex: e } = t;
      const n = typeof e == "number" ? e + 1 : 1, r = typeof window < "u" && ((_b3 = (_a6 = window.location) == null ? void 0 : _a6.hostname) == null ? void 0 : _b3.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));
      if (r) return r[n];
    }
  };
  let Age = false;
  try {
    document.cookie, Age = true;
  } catch {
  }
  const Ige = [
    "querystring",
    "cookie",
    "localStorage",
    "sessionStorage",
    "navigator",
    "htmlTag"
  ];
  Age || Ige.splice(1, 1);
  const ggt = () => ({
    order: Ige,
    lookupQuerystring: "lng",
    lookupCookie: "i18next",
    lookupLocalStorage: "i18nextLng",
    lookupSessionStorage: "i18nextLng",
    caches: [
      "localStorage"
    ],
    excludeCacheFor: [
      "cimode"
    ],
    convertDetectedLanguage: (t) => t
  });
  class Bge {
    constructor(e) {
      let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      this.type = "languageDetector", this.detectors = {}, this.init(e, n);
    }
    init() {
      let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
        languageUtils: {}
      }, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      this.services = e, this.options = rgt(n, this.options || {}, ggt()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (i) => i.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = r, this.addDetector(agt), this.addDetector(sgt), this.addDetector(cgt), this.addDetector(dgt), this.addDetector(ugt), this.addDetector(hgt), this.addDetector(fgt), this.addDetector(mgt), this.addDetector(lgt);
    }
    addDetector(e) {
      return this.detectors[e.name] = e, this;
    }
    detect() {
      let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, n = [];
      return e.forEach((r) => {
        if (this.detectors[r]) {
          let i = this.detectors[r].lookup(this.options);
          i && typeof i == "string" && (i = [
            i
          ]), i && (n = n.concat(i));
        }
      }), n = n.filter((r) => r != null && !igt(r)).map((r) => this.options.convertDetectedLanguage(r)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? n : n.length > 0 ? n[0] : null;
    }
    cacheUserLanguage(e) {
      let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
      n && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || n.forEach((r) => {
        this.detectors[r] && this.detectors[r].cacheUserLanguage(e, this.options);
      }));
    }
  }
  Bge.type = "languageDetector";
  function e7(t) {
    "@babel/helpers - typeof";
    return e7 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, e7(t);
  }
  function Pge() {
    return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : e7(XMLHttpRequest)) === "object";
  }
  function pgt(t) {
    return !!t && typeof t.then == "function";
  }
  function Fgt(t) {
    return pgt(t) ? t : Promise.resolve(t);
  }
  function vgt(t) {
    throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
  }
  var vD = {
    exports: {}
  }, _D = {
    exports: {}
  }, DQ;
  function _gt() {
    return DQ || (DQ = 1, (function(t, e) {
      var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof sl < "u" && sl, r = (function() {
        function a() {
          this.fetch = false, this.DOMException = n.DOMException;
        }
        return a.prototype = n, new a();
      })();
      (function(a) {
        (function(s) {
          var l = typeof a < "u" && a || typeof self < "u" && self || typeof l < "u" && l, c = {
            searchParams: "URLSearchParams" in l,
            iterable: "Symbol" in l && "iterator" in Symbol,
            blob: "FileReader" in l && "Blob" in l && (function() {
              try {
                return new Blob(), true;
              } catch {
                return false;
              }
            })(),
            formData: "FormData" in l,
            arrayBuffer: "ArrayBuffer" in l
          };
          function d(I) {
            return I && DataView.prototype.isPrototypeOf(I);
          }
          if (c.arrayBuffer) var u = [
            "[object Int8Array]",
            "[object Uint8Array]",
            "[object Uint8ClampedArray]",
            "[object Int16Array]",
            "[object Uint16Array]",
            "[object Int32Array]",
            "[object Uint32Array]",
            "[object Float32Array]",
            "[object Float64Array]"
          ], h = ArrayBuffer.isView || function(I) {
            return I && u.indexOf(Object.prototype.toString.call(I)) > -1;
          };
          function f(I) {
            if (typeof I != "string" && (I = String(I)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(I) || I === "") throw new TypeError('Invalid character in header field name: "' + I + '"');
            return I.toLowerCase();
          }
          function g(I) {
            return typeof I != "string" && (I = String(I)), I;
          }
          function m(I) {
            var N = {
              next: function() {
                var L = I.shift();
                return {
                  done: L === void 0,
                  value: L
                };
              }
            };
            return c.iterable && (N[Symbol.iterator] = function() {
              return N;
            }), N;
          }
          function v(I) {
            this.map = {}, I instanceof v ? I.forEach(function(N, L) {
              this.append(L, N);
            }, this) : Array.isArray(I) ? I.forEach(function(N) {
              this.append(N[0], N[1]);
            }, this) : I && Object.getOwnPropertyNames(I).forEach(function(N) {
              this.append(N, I[N]);
            }, this);
          }
          v.prototype.append = function(I, N) {
            I = f(I), N = g(N);
            var L = this.map[I];
            this.map[I] = L ? L + ", " + N : N;
          }, v.prototype.delete = function(I) {
            delete this.map[f(I)];
          }, v.prototype.get = function(I) {
            return I = f(I), this.has(I) ? this.map[I] : null;
          }, v.prototype.has = function(I) {
            return this.map.hasOwnProperty(f(I));
          }, v.prototype.set = function(I, N) {
            this.map[f(I)] = g(N);
          }, v.prototype.forEach = function(I, N) {
            for (var L in this.map) this.map.hasOwnProperty(L) && I.call(N, this.map[L], L, this);
          }, v.prototype.keys = function() {
            var I = [];
            return this.forEach(function(N, L) {
              I.push(L);
            }), m(I);
          }, v.prototype.values = function() {
            var I = [];
            return this.forEach(function(N) {
              I.push(N);
            }), m(I);
          }, v.prototype.entries = function() {
            var I = [];
            return this.forEach(function(N, L) {
              I.push([
                L,
                N
              ]);
            }), m(I);
          }, c.iterable && (v.prototype[Symbol.iterator] = v.prototype.entries);
          function y(I) {
            if (I.bodyUsed) return Promise.reject(new TypeError("Already read"));
            I.bodyUsed = true;
          }
          function w(I) {
            return new Promise(function(N, L) {
              I.onload = function() {
                N(I.result);
              }, I.onerror = function() {
                L(I.error);
              };
            });
          }
          function b(I) {
            var N = new FileReader(), L = w(N);
            return N.readAsArrayBuffer(I), L;
          }
          function j(I) {
            var N = new FileReader(), L = w(N);
            return N.readAsText(I), L;
          }
          function k(I) {
            for (var N = new Uint8Array(I), L = new Array(N.length), H = 0; H < N.length; H++) L[H] = String.fromCharCode(N[H]);
            return L.join("");
          }
          function C(I) {
            if (I.slice) return I.slice(0);
            var N = new Uint8Array(I.byteLength);
            return N.set(new Uint8Array(I)), N.buffer;
          }
          function x() {
            return this.bodyUsed = false, this._initBody = function(I) {
              this.bodyUsed = this.bodyUsed, this._bodyInit = I, I ? typeof I == "string" ? this._bodyText = I : c.blob && Blob.prototype.isPrototypeOf(I) ? this._bodyBlob = I : c.formData && FormData.prototype.isPrototypeOf(I) ? this._bodyFormData = I : c.searchParams && URLSearchParams.prototype.isPrototypeOf(I) ? this._bodyText = I.toString() : c.arrayBuffer && c.blob && d(I) ? (this._bodyArrayBuffer = C(I.buffer), this._bodyInit = new Blob([
                this._bodyArrayBuffer
              ])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(I) || h(I)) ? this._bodyArrayBuffer = C(I) : this._bodyText = I = Object.prototype.toString.call(I) : this._bodyText = "", this.headers.get("content-type") || (typeof I == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(I) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
            }, c.blob && (this.blob = function() {
              var I = y(this);
              if (I) return I;
              if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
              if (this._bodyArrayBuffer) return Promise.resolve(new Blob([
                this._bodyArrayBuffer
              ]));
              if (this._bodyFormData) throw new Error("could not read FormData body as blob");
              return Promise.resolve(new Blob([
                this._bodyText
              ]));
            }, this.arrayBuffer = function() {
              if (this._bodyArrayBuffer) {
                var I = y(this);
                return I || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)) : Promise.resolve(this._bodyArrayBuffer));
              } else return this.blob().then(b);
            }), this.text = function() {
              var I = y(this);
              if (I) return I;
              if (this._bodyBlob) return j(this._bodyBlob);
              if (this._bodyArrayBuffer) return Promise.resolve(k(this._bodyArrayBuffer));
              if (this._bodyFormData) throw new Error("could not read FormData body as text");
              return Promise.resolve(this._bodyText);
            }, c.formData && (this.formData = function() {
              return this.text().then(B);
            }), this.json = function() {
              return this.text().then(JSON.parse);
            }, this;
          }
          var S = [
            "DELETE",
            "GET",
            "HEAD",
            "OPTIONS",
            "POST",
            "PUT"
          ];
          function T(I) {
            var N = I.toUpperCase();
            return S.indexOf(N) > -1 ? N : I;
          }
          function A(I, N) {
            if (!(this instanceof A)) throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
            N = N || {};
            var L = N.body;
            if (I instanceof A) {
              if (I.bodyUsed) throw new TypeError("Already read");
              this.url = I.url, this.credentials = I.credentials, N.headers || (this.headers = new v(I.headers)), this.method = I.method, this.mode = I.mode, this.signal = I.signal, !L && I._bodyInit != null && (L = I._bodyInit, I.bodyUsed = true);
            } else this.url = String(I);
            if (this.credentials = N.credentials || this.credentials || "same-origin", (N.headers || !this.headers) && (this.headers = new v(N.headers)), this.method = T(N.method || this.method || "GET"), this.mode = N.mode || this.mode || null, this.signal = N.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && L) throw new TypeError("Body not allowed for GET or HEAD requests");
            if (this._initBody(L), (this.method === "GET" || this.method === "HEAD") && (N.cache === "no-store" || N.cache === "no-cache")) {
              var H = /([?&])_=[^&]*/;
              if (H.test(this.url)) this.url = this.url.replace(H, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
              else {
                var V = /\?/;
                this.url += (V.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
              }
            }
          }
          A.prototype.clone = function() {
            return new A(this, {
              body: this._bodyInit
            });
          };
          function B(I) {
            var N = new FormData();
            return I.trim().split("&").forEach(function(L) {
              if (L) {
                var H = L.split("="), V = H.shift().replace(/\+/g, " "), Z = H.join("=").replace(/\+/g, " ");
                N.append(decodeURIComponent(V), decodeURIComponent(Z));
              }
            }), N;
          }
          function U(I) {
            var N = new v(), L = I.replace(/\r?\n[\t ]+/g, " ");
            return L.split("\r").map(function(H) {
              return H.indexOf(`
`) === 0 ? H.substr(1, H.length) : H;
            }).forEach(function(H) {
              var V = H.split(":"), Z = V.shift().trim();
              if (Z) {
                var Y = V.join(":").trim();
                N.append(Z, Y);
              }
            }), N;
          }
          x.call(A.prototype);
          function z(I, N) {
            if (!(this instanceof z)) throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
            N || (N = {}), this.type = "default", this.status = N.status === void 0 ? 200 : N.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = N.statusText === void 0 ? "" : "" + N.statusText, this.headers = new v(N.headers), this.url = N.url || "", this._initBody(I);
          }
          x.call(z.prototype), z.prototype.clone = function() {
            return new z(this._bodyInit, {
              status: this.status,
              statusText: this.statusText,
              headers: new v(this.headers),
              url: this.url
            });
          }, z.error = function() {
            var I = new z(null, {
              status: 0,
              statusText: ""
            });
            return I.type = "error", I;
          };
          var O = [
            301,
            302,
            303,
            307,
            308
          ];
          z.redirect = function(I, N) {
            if (O.indexOf(N) === -1) throw new RangeError("Invalid status code");
            return new z(null, {
              status: N,
              headers: {
                location: I
              }
            });
          }, s.DOMException = l.DOMException;
          try {
            new s.DOMException();
          } catch {
            s.DOMException = function(N, L) {
              this.message = N, this.name = L;
              var H = Error(N);
              this.stack = H.stack;
            }, s.DOMException.prototype = Object.create(Error.prototype), s.DOMException.prototype.constructor = s.DOMException;
          }
          function M(I, N) {
            return new Promise(function(L, H) {
              var V = new A(I, N);
              if (V.signal && V.signal.aborted) return H(new s.DOMException("Aborted", "AbortError"));
              var Z = new XMLHttpRequest();
              function Y() {
                Z.abort();
              }
              Z.onload = function() {
                var ue = {
                  status: Z.status,
                  statusText: Z.statusText,
                  headers: U(Z.getAllResponseHeaders() || "")
                };
                ue.url = "responseURL" in Z ? Z.responseURL : ue.headers.get("X-Request-URL");
                var ie = "response" in Z ? Z.response : Z.responseText;
                setTimeout(function() {
                  L(new z(ie, ue));
                }, 0);
              }, Z.onerror = function() {
                setTimeout(function() {
                  H(new TypeError("Network request failed"));
                }, 0);
              }, Z.ontimeout = function() {
                setTimeout(function() {
                  H(new TypeError("Network request failed"));
                }, 0);
              }, Z.onabort = function() {
                setTimeout(function() {
                  H(new s.DOMException("Aborted", "AbortError"));
                }, 0);
              };
              function oe(ue) {
                try {
                  return ue === "" && l.location.href ? l.location.href : ue;
                } catch {
                  return ue;
                }
              }
              Z.open(V.method, oe(V.url), true), V.credentials === "include" ? Z.withCredentials = true : V.credentials === "omit" && (Z.withCredentials = false), "responseType" in Z && (c.blob ? Z.responseType = "blob" : c.arrayBuffer && V.headers.get("Content-Type") && V.headers.get("Content-Type").indexOf("application/octet-stream") !== -1 && (Z.responseType = "arraybuffer")), N && typeof N.headers == "object" && !(N.headers instanceof v) ? Object.getOwnPropertyNames(N.headers).forEach(function(ue) {
                Z.setRequestHeader(ue, g(N.headers[ue]));
              }) : V.headers.forEach(function(ue, ie) {
                Z.setRequestHeader(ie, ue);
              }), V.signal && (V.signal.addEventListener("abort", Y), Z.onreadystatechange = function() {
                Z.readyState === 4 && V.signal.removeEventListener("abort", Y);
              }), Z.send(typeof V._bodyInit > "u" ? null : V._bodyInit);
            });
          }
          return M.polyfill = true, l.fetch || (l.fetch = M, l.Headers = v, l.Request = A, l.Response = z), s.Headers = v, s.Request = A, s.Response = z, s.fetch = M, s;
        })({});
      })(r), r.fetch.ponyfill = true, delete r.fetch.polyfill;
      var i = n.fetch ? n : r;
      e = i.fetch, e.default = i.fetch, e.fetch = i.fetch, e.Headers = i.Headers, e.Request = i.Request, e.Response = i.Response, t.exports = e;
    })(_D, _D.exports)), _D.exports;
  }
  var CQ;
  function ygt() {
    return CQ || (CQ = 1, (function(t, e) {
      var n = typeof fetch == "function" ? fetch : void 0;
      if (typeof sl < "u" && sl.fetch ? n = sl.fetch : typeof window < "u" && window.fetch && (n = window.fetch), typeof vgt < "u" && typeof window > "u") {
        var r = n || _gt();
        r.default && (r = r.default), e.default = r, t.exports = e.default;
      }
    })(vD, vD.exports)), vD.exports;
  }
  var Mge = ygt();
  const Oge = da(Mge), EQ = n7({
    __proto__: null,
    default: Oge
  }, [
    Mge
  ]);
  function kQ(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function SQ(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? kQ(Object(n), true).forEach(function(r) {
        bgt(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : kQ(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function bgt(t, e, n) {
    return (e = xgt(e)) in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function xgt(t) {
    var e = wgt(t, "string");
    return hp(e) == "symbol" ? e : e + "";
  }
  function wgt(t, e) {
    if (hp(t) != "object" || !t) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (hp(r) != "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(t);
  }
  function hp(t) {
    "@babel/helpers - typeof";
    return hp = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, hp(t);
  }
  var $f = typeof fetch == "function" ? fetch : void 0;
  typeof global < "u" && global.fetch ? $f = global.fetch : typeof window < "u" && window.fetch && ($f = window.fetch);
  var Bb;
  Pge() && (typeof global < "u" && global.XMLHttpRequest ? Bb = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (Bb = window.XMLHttpRequest));
  var NE;
  typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? NE = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (NE = window.ActiveXObject));
  !$f && EQ && !Bb && !NE && ($f = Oge || EQ);
  typeof $f != "function" && ($f = void 0);
  var t7 = function(e, n) {
    if (n && hp(n) === "object") {
      var r = "";
      for (var i in n) r += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(n[i]);
      if (!r) return e;
      e = e + (e.indexOf("?") !== -1 ? "&" : "?") + r.slice(1);
    }
    return e;
  }, jQ = function(e, n, r, i) {
    var a = function(c) {
      if (!c.ok) return r(c.statusText || "Error", {
        status: c.status
      });
      c.text().then(function(d) {
        r(null, {
          status: c.status,
          data: d
        });
      }).catch(r);
    };
    if (i) {
      var s = i(e, n);
      if (s instanceof Promise) {
        s.then(a).catch(r);
        return;
      }
    }
    typeof fetch == "function" ? fetch(e, n).then(a).catch(r) : $f(e, n).then(a).catch(r);
  }, TQ = false, Dgt = function(e, n, r, i) {
    e.queryStringParams && (n = t7(n, e.queryStringParams));
    var a = SQ({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
    typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (a["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), r && (a["Content-Type"] = "application/json");
    var s = typeof e.requestOptions == "function" ? e.requestOptions(r) : e.requestOptions, l = SQ({
      method: r ? "POST" : "GET",
      body: r ? e.stringify(r) : void 0,
      headers: a
    }, TQ ? {} : s), c = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
    try {
      jQ(n, l, i, c);
    } catch (d) {
      if (!s || Object.keys(s).length === 0 || !d.message || d.message.indexOf("not implemented") < 0) return i(d);
      try {
        Object.keys(s).forEach(function(u) {
          delete l[u];
        }), jQ(n, l, i, c), TQ = true;
      } catch (u) {
        i(u);
      }
    }
  }, Cgt = function(e, n, r, i) {
    r && hp(r) === "object" && (r = t7("", r).slice(1)), e.queryStringParams && (n = t7(n, e.queryStringParams));
    try {
      var a;
      Bb ? a = new Bb() : a = new NE("MSXML2.XMLHTTP.3.0"), a.open(r ? "POST" : "GET", n, 1), e.crossDomain || a.setRequestHeader("X-Requested-With", "XMLHttpRequest"), a.withCredentials = !!e.withCredentials, r && a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), a.overrideMimeType && a.overrideMimeType("application/json");
      var s = e.customHeaders;
      if (s = typeof s == "function" ? s() : s, s) for (var l in s) a.setRequestHeader(l, s[l]);
      a.onreadystatechange = function() {
        a.readyState > 3 && i(a.status >= 400 ? a.statusText : null, {
          status: a.status,
          data: a.responseText
        });
      }, a.send(r);
    } catch (c) {
      console && console.log(c);
    }
  }, Egt = function(e, n, r, i) {
    if (typeof r == "function" && (i = r, r = void 0), i = i || function() {
    }, $f && n.indexOf("file:") !== 0) return Dgt(e, n, r, i);
    if (Pge() || typeof ActiveXObject == "function") return Cgt(e, n, r, i);
    i(new Error("No fetch and no xhr implementation found!"));
  };
  function yF(t) {
    "@babel/helpers - typeof";
    return yF = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, yF(t);
  }
  function RQ(t, e) {
    var n = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(t);
      e && (r = r.filter(function(i) {
        return Object.getOwnPropertyDescriptor(t, i).enumerable;
      })), n.push.apply(n, r);
    }
    return n;
  }
  function tR(t) {
    for (var e = 1; e < arguments.length; e++) {
      var n = arguments[e] != null ? arguments[e] : {};
      e % 2 ? RQ(Object(n), true).forEach(function(r) {
        Lge(t, r, n[r]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : RQ(Object(n)).forEach(function(r) {
        Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
      });
    }
    return t;
  }
  function kgt(t, e) {
    if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
  }
  function Sgt(t, e) {
    for (var n = 0; n < e.length; n++) {
      var r = e[n];
      r.enumerable = r.enumerable || false, r.configurable = true, "value" in r && (r.writable = true), Object.defineProperty(t, Nge(r.key), r);
    }
  }
  function jgt(t, e, n) {
    return e && Sgt(t.prototype, e), Object.defineProperty(t, "prototype", {
      writable: false
    }), t;
  }
  function Lge(t, e, n) {
    return (e = Nge(e)) in t ? Object.defineProperty(t, e, {
      value: n,
      enumerable: true,
      configurable: true,
      writable: true
    }) : t[e] = n, t;
  }
  function Nge(t) {
    var e = Tgt(t, "string");
    return yF(e) == "symbol" ? e : e + "";
  }
  function Tgt(t, e) {
    if (yF(t) != "object" || !t) return t;
    var n = t[Symbol.toPrimitive];
    if (n !== void 0) {
      var r = n.call(t, e);
      if (yF(r) != "object") return r;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t);
  }
  var Rgt = function() {
    return {
      loadPath: "/locales/{{lng}}/{{ns}}.json",
      addPath: "/locales/add/{{lng}}/{{ns}}",
      parse: function(n) {
        return JSON.parse(n);
      },
      stringify: JSON.stringify,
      parsePayload: function(n, r, i) {
        return Lge({}, r, i || "");
      },
      parseLoadPayload: function(n, r) {
      },
      request: Egt,
      reloadInterval: typeof window < "u" ? false : 3600 * 1e3,
      customHeaders: {},
      queryStringParams: {},
      crossDomain: false,
      withCredentials: false,
      overrideMimeType: false,
      requestOptions: {
        mode: "cors",
        credentials: "same-origin",
        cache: "default"
      }
    };
  }, zge = (function() {
    function t(e) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      kgt(this, t), this.services = e, this.options = n, this.allOptions = r, this.type = "backend", this.init(e, n, r);
    }
    return jgt(t, [
      {
        key: "init",
        value: function(n) {
          var r = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          if (this.services = n, this.options = tR(tR(tR({}, Rgt()), this.options || {}), i), this.allOptions = a, this.services && this.options.reloadInterval) {
            var s = setInterval(function() {
              return r.reload();
            }, this.options.reloadInterval);
            yF(s) === "object" && typeof s.unref == "function" && s.unref();
          }
        }
      },
      {
        key: "readMulti",
        value: function(n, r, i) {
          this._readAny(n, n, r, r, i);
        }
      },
      {
        key: "read",
        value: function(n, r, i) {
          this._readAny([
            n
          ], n, [
            r
          ], r, i);
        }
      },
      {
        key: "_readAny",
        value: function(n, r, i, a, s) {
          var l = this, c = this.options.loadPath;
          typeof this.options.loadPath == "function" && (c = this.options.loadPath(n, i)), c = Fgt(c), c.then(function(d) {
            if (!d) return s(null, {});
            var u = l.services.interpolator.interpolate(d, {
              lng: n.join("+"),
              ns: i.join("+")
            });
            l.loadUrl(u, s, r, a);
          });
        }
      },
      {
        key: "loadUrl",
        value: function(n, r, i, a) {
          var s = this, l = typeof i == "string" ? [
            i
          ] : i, c = typeof a == "string" ? [
            a
          ] : a, d = this.options.parseLoadPayload(l, c);
          this.options.request(this.options, n, d, function(u, h) {
            if (h && (h.status >= 500 && h.status < 600 || !h.status)) return r("failed loading " + n + "; status code: " + h.status, true);
            if (h && h.status >= 400 && h.status < 500) return r("failed loading " + n + "; status code: " + h.status, false);
            if (!h && u && u.message) {
              var f = u.message.toLowerCase(), g = [
                "failed",
                "fetch",
                "network",
                "load"
              ].find(function(y) {
                return f.indexOf(y) > -1;
              });
              if (g) return r("failed loading " + n + ": " + u.message, true);
            }
            if (u) return r(u, false);
            var m, v;
            try {
              typeof h.data == "string" ? m = s.options.parse(h.data, i, a) : m = h.data;
            } catch {
              v = "failed parsing " + n + " to json";
            }
            if (v) return r(v, false);
            r(null, m);
          });
        }
      },
      {
        key: "create",
        value: function(n, r, i, a, s) {
          var l = this;
          if (this.options.addPath) {
            typeof n == "string" && (n = [
              n
            ]);
            var c = this.options.parsePayload(r, i, a), d = 0, u = [], h = [];
            n.forEach(function(f) {
              var g = l.options.addPath;
              typeof l.options.addPath == "function" && (g = l.options.addPath(f, r));
              var m = l.services.interpolator.interpolate(g, {
                lng: f,
                ns: r
              });
              l.options.request(l.options, m, c, function(v, y) {
                d += 1, u.push(v), h.push(y), d === n.length && typeof s == "function" && s(u, h);
              });
            });
          }
        }
      },
      {
        key: "reload",
        value: function() {
          var n = this, r = this.services, i = r.backendConnector, a = r.languageUtils, s = r.logger, l = i.language;
          if (!(l && l.toLowerCase() === "cimode")) {
            var c = [], d = function(h) {
              var f = a.toResolveHierarchy(h);
              f.forEach(function(g) {
                c.indexOf(g) < 0 && c.push(g);
              });
            };
            d(l), this.allOptions.preload && this.allOptions.preload.forEach(function(u) {
              return d(u);
            }), c.forEach(function(u) {
              n.allOptions.ns.forEach(function(h) {
                i.read(u, h, "read", null, null, function(f, g) {
                  f && s.warn("loading namespace ".concat(h, " for language ").concat(u, " failed"), f), !f && g && s.log("loaded namespace ".concat(h, " for language ").concat(u), g), i.loaded("".concat(u, "|").concat(h), f, g);
                });
              });
            });
          }
        }
      }
    ]);
  })();
  zge.type = "backend";
  ms.use(zge).use(Bge).use(TTe).init({
    debug: false,
    fallbackLng: "en",
    interpolation: {
      escapeValue: false
    },
    load: "languageOnly",
    backend: {
      loadPath: `${ho("/sable")}/public/locales/{{lng}}.json`
    }
  });
  function Agt() {
    const t = window.outerWidth - window.innerWidth, e = window.outerHeight - window.innerHeight, n = 160;
    return t >= n || e >= n;
  }
  function Igt() {
    const t = "font-size:56px;font-weight:900;color:#ff0033;background:#1a0006;padding:16px 24px;border:6px solid #ff0033;line-height:1.1;", e = "font-size:22px;font-weight:700;color:#ffb3c1;background:#120008;padding:14px 20px;line-height:1.35;max-width:920px;", n = "font-size:18px;font-weight:600;color:#a8d4ff;background:#0a1520;padding:12px 20px;line-height:1.35;max-width:920px;", r = () => {
      const c = (d) => {
        console.warn("%cSTOP", t), console.warn("%cIf anyone told you to paste code or text here, you are being scammed. Close this window, do not paste anything, and report their account.", e), d + 1 < 15 ? window.setTimeout(() => {
          c(d + 1);
        }, 300) : window.setTimeout(() => {
          console.warn("%cIf you know what you're doing, check out our GitHub and contribute: https://github.com/SableClient/Sable", n);
        }, 300);
      };
      c(0);
    };
    let i = false;
    const a = () => {
      const s = Agt();
      s && !i && r(), i = s;
    };
    window.setInterval(a, 1500), window.addEventListener("resize", () => queueMicrotask(a)), queueMicrotask(a);
  }
  F_e();
  Igt();
  const zE = Po("index");
  document.body.classList.add(j7, T7);
  const Bgt = (t) => {
    localStorage.getItem("cinny_dont_show_sw_update_prompt") !== "true" && window.confirm("A new version of the app is available. Refresh to update?") && (t.waiting && t.waiting.postMessage({
      type: "SKIP_WAITING_AND_CLAIM"
    }), window.location.reload());
  };
  if ("serviceWorker" in navigator) {
    const t = `${ho("/sable")}/sw.js`, e = {};
    navigator.serviceWorker.register(t, e).then((r) => {
      r.addEventListener("updatefound", () => {
        const i = r.installing;
        i && i.addEventListener("statechange", () => {
          i.state === "installed" && navigator.serviceWorker.controller && Bgt(r);
        });
      });
    });
    const n = () => {
      const r = Ps(e3, []), i = Ps(xie, void 0), a = r.find((s) => s.userId === i) ?? r[0] ?? Ck();
      d4(a == null ? void 0 : a.baseUrl, a == null ? void 0 : a.accessToken, a == null ? void 0 : a.userId);
    };
    navigator.serviceWorker.register(t).then(n).catch((r) => {
      zE.warn("SW registration failed:", r);
    }), navigator.serviceWorker.ready.then(n).catch((r) => {
      zE.warn("SW ready failed:", r);
    }), navigator.serviceWorker.addEventListener("message", (r) => {
      var _a6;
      const { data: i } = r;
      if (!i || typeof i != "object") return;
      const { type: a } = i;
      if (a === "requestSession" && n(), i.type === "token" && i.id) {
        const s = localStorage.getItem("cinny_access_token") ?? void 0;
        (_a6 = r.source) == null ? void 0 : _a6.postMessage({
          replyTo: i.id,
          payload: s
        });
      } else i.type === "openRoom" && i.id;
    });
  }
  const Pgt = () => {
    [
      {
        name: "theme-color",
        content: "#0C0B0F"
      },
      {
        name: "apple-mobile-web-app-capable",
        content: "yes"
      },
      {
        name: "apple-mobile-web-app-status-bar-style",
        content: "black-translucent"
      }
    ].forEach((e) => {
      let n = document.querySelector(`meta[name="${e.name}"]`);
      n || (n = document.createElement("meta"), n.setAttribute("name", e.name), document.head.appendChild(n)), n.setAttribute("content", e.content);
    });
  };
  Pgt();
  const vC = "cinny_chunk_retry_count", AQ = 2;
  window.addEventListener("error", (t) => {
    var _a6, _b3, _c3;
    if (((_a6 = t.message) == null ? void 0 : _a6.includes("dynamically imported module")) || ((_b3 = t.message) == null ? void 0 : _b3.includes("Failed to fetch")) || ((_c3 = t.error) == null ? void 0 : _c3.name) === "ChunkLoadError") {
      const n = parseInt(sessionStorage.getItem(vC) ?? "0", 10);
      n < AQ ? (sessionStorage.setItem(vC, String(n + 1)), zE.warn(`Chunk load failed, reloading (attempt ${n + 1}/${AQ})`), window.location.reload(), t.preventDefault()) : (sessionStorage.removeItem(vC), zE.error("Chunk load failed after max retries, showing error"));
    }
  });
  window.addEventListener("load", () => {
    sessionStorage.removeItem(vC);
  });
  const Mgt = () => {
    const t = document.getElementById("root");
    if (t === null) throw new Error("Root container element not found!");
    d_e.createRoot(t).render(o.jsx(egt, {}));
  };
  Mgt();
})();
export {
  zgt as A,
  zu as B,
  oi as C,
  dxe as D,
  ce as E,
  rH as F,
  cxe as G,
  ll as H,
  aH as I,
  Wgt as J,
  Ht as K,
  Lgt as L,
  rt as M,
  qgt as N,
  Ur as O,
  q1 as P,
  pDe as Q,
  L1 as R,
  Zm as S,
  ji as T,
  Ugt as U,
  iH as V,
  $ as _,
  __tla,
  me as a,
  ok as b,
  zne as c,
  wg as d,
  rn as e,
  Bre as f,
  da as g,
  CCe as h,
  IF as i,
  hu as j,
  JCe as k,
  Ogt as l,
  Jn as m,
  GC as n,
  Un as o,
  zo as p,
  lxe as q,
  bDe as r,
  Ug as s,
  Py as t,
  rk as u,
  Vgt as v,
  $gt as w,
  kf as x,
  Ngt as y,
  or as z
};
