Bandcamp script (bandcamp.com only)

A discography player for bandcamp.com and manager for your played albums

// ==UserScript==
// @name            Bandcamp script (bandcamp.com only)
// @description     A discography player for bandcamp.com and manager for your played albums
// @namespace       https://openuserjs.org/users/cuzi
// @supportURL      https://github.com/cvzi/Bandcamp-script-deluxe-edition/issues
// @icon            https://raw.githubusercontent.com/cvzi/Bandcamp-script-deluxe-edition/master/images/icon.png
// @contributionURL https://github.com/cvzi/Bandcamp-script-deluxe-edition#donate
// @require         https://unpkg.com/[email protected]/dist/index.min.js
// @require         https://openuserjs.org/src/libs/cuzi/GeniusLyrics.js
// @require         https://unpkg.com/[email protected]/libs/lz-string.min.js
// @run-at          document-start
// @match           https://bandcamp.com/*
// @match           https://*.bandcamp.com/*
// @match           https://campexplorer.io/*
// @exclude         https://bandcamp.com/videoframe*
// @exclude         https://bandcamp.com/EmbeddedPlayer*
// @connect         bandcamp.com
// @connect         *.bandcamp.com
// @connect         bcbits.com
// @connect         *.bcbits.com
// @connect         genius.com
// @version         1.38.0
// @homepage        https://github.com/cvzi/Bandcamp-script-deluxe-edition
// @author          cuzi
// @license         MIT
// @grant           GM.xmlHttpRequest
// @grant           GM.setValue
// @grant           GM.getValue
// @grant           GM.notification
// @grant           GM_download
// @grant           GM.registerMenuCommand
// @grant           GM_registerMenuCommand
// @grant           GM_addStyle
// @grant           GM_setClipboard
// @grant           unsafeWindow
// ==/UserScript==


// ==OpenUserJS==
// @author      cuzi
// ==/OpenUserJS==

/*
MIT License

Copyright (c) 2020 cvzi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/* globals React, ReactDOM, LZString */
/* jshint esversion: 8 */
(function () {
  'use strict';

  /*
  Compatibility adaptions for Violentmonkey https://github.com/violentmonkey/violentmonkey
  */

  if (typeof GM.registerMenuCommand !== 'function') {
    if (typeof GM_registerMenuCommand === 'function') {
      GM.registerMenuCommand = GM_registerMenuCommand;
    } else {
      console.warn('Neither GM.registerMenuCommand nor GM_registerMenuCommand are available');
    }
  }

  const genresList = ['rock', 'metal', 'alternative', 'hip-hop/rap', 'experimental', 'punk', 'folk', 'pop', 'ambient', 'soundtrack', 'world', 'jazz', 'acoustic', 'funk', 'r&b/soul', 'devotional', 'classical', 'reggae', 'podcasts', 'country', 'spoken word', 'comedy', 'blues', 'kids', 'audiobooks', 'latin'];

  var react = {exports: {}};

  var react_production = {};

  /**
   * @license React
   * react.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */

  var hasRequiredReact_production;

  function requireReact_production () {
  	if (hasRequiredReact_production) return react_production;
  	hasRequiredReact_production = 1;
  	var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
  	  REACT_PORTAL_TYPE = Symbol.for("react.portal"),
  	  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
  	  REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
  	  REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
  	  REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
  	  REACT_CONTEXT_TYPE = Symbol.for("react.context"),
  	  REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
  	  REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
  	  REACT_MEMO_TYPE = Symbol.for("react.memo"),
  	  REACT_LAZY_TYPE = Symbol.for("react.lazy"),
  	  REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
  	  MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
  	function getIteratorFn(maybeIterable) {
  	  if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  	  maybeIterable =
  	    (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
  	    maybeIterable["@@iterator"];
  	  return "function" === typeof maybeIterable ? maybeIterable : null;
  	}
  	var ReactNoopUpdateQueue = {
  	    isMounted: function () {
  	      return false;
  	    },
  	    enqueueForceUpdate: function () {},
  	    enqueueReplaceState: function () {},
  	    enqueueSetState: function () {}
  	  },
  	  assign = Object.assign,
  	  emptyObject = {};
  	function Component(props, context, updater) {
  	  this.props = props;
  	  this.context = context;
  	  this.refs = emptyObject;
  	  this.updater = updater || ReactNoopUpdateQueue;
  	}
  	Component.prototype.isReactComponent = {};
  	Component.prototype.setState = function (partialState, callback) {
  	  if (
  	    "object" !== typeof partialState &&
  	    "function" !== typeof partialState &&
  	    null != partialState
  	  )
  	    throw Error(
  	      "takes an object of state variables to update or a function which returns an object of state variables."
  	    );
  	  this.updater.enqueueSetState(this, partialState, callback, "setState");
  	};
  	Component.prototype.forceUpdate = function (callback) {
  	  this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
  	};
  	function ComponentDummy() {}
  	ComponentDummy.prototype = Component.prototype;
  	function PureComponent(props, context, updater) {
  	  this.props = props;
  	  this.context = context;
  	  this.refs = emptyObject;
  	  this.updater = updater || ReactNoopUpdateQueue;
  	}
  	var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
  	pureComponentPrototype.constructor = PureComponent;
  	assign(pureComponentPrototype, Component.prototype);
  	pureComponentPrototype.isPureReactComponent = true;
  	var isArrayImpl = Array.isArray;
  	function noop() {}
  	var ReactSharedInternals = { H: null, A: null, T: null, S: null },
  	  hasOwnProperty = Object.prototype.hasOwnProperty;
  	function ReactElement(type, key, props) {
  	  var refProp = props.ref;
  	  return {
  	    $$typeof: REACT_ELEMENT_TYPE,
  	    type: type,
  	    key: key,
  	    ref: void 0 !== refProp ? refProp : null,
  	    props: props
  	  };
  	}
  	function cloneAndReplaceKey(oldElement, newKey) {
  	  return ReactElement(oldElement.type, newKey, oldElement.props);
  	}
  	function isValidElement(object) {
  	  return (
  	    "object" === typeof object &&
  	    null !== object &&
  	    object.$$typeof === REACT_ELEMENT_TYPE
  	  );
  	}
  	function escape(key) {
  	  var escaperLookup = { "=": "=0", ":": "=2" };
  	  return (
  	    "$" +
  	    key.replace(/[=:]/g, function (match) {
  	      return escaperLookup[match];
  	    })
  	  );
  	}
  	var userProvidedKeyEscapeRegex = /\/+/g;
  	function getElementKey(element, index) {
  	  return "object" === typeof element && null !== element && null != element.key
  	    ? escape("" + element.key)
  	    : index.toString(36);
  	}
  	function resolveThenable(thenable) {
  	  switch (thenable.status) {
  	    case "fulfilled":
  	      return thenable.value;
  	    case "rejected":
  	      throw thenable.reason;
  	    default:
  	      switch (
  	        ("string" === typeof thenable.status
  	          ? thenable.then(noop, noop)
  	          : ((thenable.status = "pending"),
  	            thenable.then(
  	              function (fulfilledValue) {
  	                "pending" === thenable.status &&
  	                  ((thenable.status = "fulfilled"),
  	                  (thenable.value = fulfilledValue));
  	              },
  	              function (error) {
  	                "pending" === thenable.status &&
  	                  ((thenable.status = "rejected"), (thenable.reason = error));
  	              }
  	            )),
  	        thenable.status)
  	      ) {
  	        case "fulfilled":
  	          return thenable.value;
  	        case "rejected":
  	          throw thenable.reason;
  	      }
  	  }
  	  throw thenable;
  	}
  	function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
  	  var type = typeof children;
  	  if ("undefined" === type || "boolean" === type) children = null;
  	  var invokeCallback = false;
  	  if (null === children) invokeCallback = true;
  	  else
  	    switch (type) {
  	      case "bigint":
  	      case "string":
  	      case "number":
  	        invokeCallback = true;
  	        break;
  	      case "object":
  	        switch (children.$$typeof) {
  	          case REACT_ELEMENT_TYPE:
  	          case REACT_PORTAL_TYPE:
  	            invokeCallback = true;
  	            break;
  	          case REACT_LAZY_TYPE:
  	            return (
  	              (invokeCallback = children._init),
  	              mapIntoArray(
  	                invokeCallback(children._payload),
  	                array,
  	                escapedPrefix,
  	                nameSoFar,
  	                callback
  	              )
  	            );
  	        }
  	    }
  	  if (invokeCallback)
  	    return (
  	      (callback = callback(children)),
  	      (invokeCallback =
  	        "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
  	      isArrayImpl(callback)
  	        ? ((escapedPrefix = ""),
  	          null != invokeCallback &&
  	            (escapedPrefix =
  	              invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
  	          mapIntoArray(callback, array, escapedPrefix, "", function (c) {
  	            return c;
  	          }))
  	        : null != callback &&
  	          (isValidElement(callback) &&
  	            (callback = cloneAndReplaceKey(
  	              callback,
  	              escapedPrefix +
  	                (null == callback.key ||
  	                (children && children.key === callback.key)
  	                  ? ""
  	                  : ("" + callback.key).replace(
  	                      userProvidedKeyEscapeRegex,
  	                      "$&/"
  	                    ) + "/") +
  	                invokeCallback
  	            )),
  	          array.push(callback)),
  	      1
  	    );
  	  invokeCallback = 0;
  	  var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
  	  if (isArrayImpl(children))
  	    for (var i = 0; i < children.length; i++)
  	      (nameSoFar = children[i]),
  	        (type = nextNamePrefix + getElementKey(nameSoFar, i)),
  	        (invokeCallback += mapIntoArray(
  	          nameSoFar,
  	          array,
  	          escapedPrefix,
  	          type,
  	          callback
  	        ));
  	  else if (((i = getIteratorFn(children)), "function" === typeof i))
  	    for (
  	      children = i.call(children), i = 0;
  	      !(nameSoFar = children.next()).done;

  	    )
  	      (nameSoFar = nameSoFar.value),
  	        (type = nextNamePrefix + getElementKey(nameSoFar, i++)),
  	        (invokeCallback += mapIntoArray(
  	          nameSoFar,
  	          array,
  	          escapedPrefix,
  	          type,
  	          callback
  	        ));
  	  else if ("object" === type) {
  	    if ("function" === typeof children.then)
  	      return mapIntoArray(
  	        resolveThenable(children),
  	        array,
  	        escapedPrefix,
  	        nameSoFar,
  	        callback
  	      );
  	    array = String(children);
  	    throw Error(
  	      "Objects are not valid as a React child (found: " +
  	        ("[object Object]" === array
  	          ? "object with keys {" + Object.keys(children).join(", ") + "}"
  	          : array) +
  	        "). If you meant to render a collection of children, use an array instead."
  	    );
  	  }
  	  return invokeCallback;
  	}
  	function mapChildren(children, func, context) {
  	  if (null == children) return children;
  	  var result = [],
  	    count = 0;
  	  mapIntoArray(children, result, "", "", function (child) {
  	    return func.call(context, child, count++);
  	  });
  	  return result;
  	}
  	function lazyInitializer(payload) {
  	  if (-1 === payload._status) {
  	    var ctor = payload._result;
  	    ctor = ctor();
  	    ctor.then(
  	      function (moduleObject) {
  	        if (0 === payload._status || -1 === payload._status)
  	          (payload._status = 1), (payload._result = moduleObject);
  	      },
  	      function (error) {
  	        if (0 === payload._status || -1 === payload._status)
  	          (payload._status = 2), (payload._result = error);
  	      }
  	    );
  	    -1 === payload._status && ((payload._status = 0), (payload._result = ctor));
  	  }
  	  if (1 === payload._status) return payload._result.default;
  	  throw payload._result;
  	}
  	var reportGlobalError =
  	    "function" === typeof reportError
  	      ? reportError
  	      : function (error) {
  	          if (
  	            "object" === typeof window &&
  	            "function" === typeof window.ErrorEvent
  	          ) {
  	            var event = new window.ErrorEvent("error", {
  	              bubbles: true,
  	              cancelable: true,
  	              message:
  	                "object" === typeof error &&
  	                null !== error &&
  	                "string" === typeof error.message
  	                  ? String(error.message)
  	                  : String(error),
  	              error: error
  	            });
  	            if (!window.dispatchEvent(event)) return;
  	          } else if (
  	            "object" === typeof process &&
  	            "function" === typeof process.emit
  	          ) {
  	            process.emit("uncaughtException", error);
  	            return;
  	          }
  	          console.error(error);
  	        },
  	  Children = {
  	    map: mapChildren,
  	    forEach: function (children, forEachFunc, forEachContext) {
  	      mapChildren(
  	        children,
  	        function () {
  	          forEachFunc.apply(this, arguments);
  	        },
  	        forEachContext
  	      );
  	    },
  	    count: function (children) {
  	      var n = 0;
  	      mapChildren(children, function () {
  	        n++;
  	      });
  	      return n;
  	    },
  	    toArray: function (children) {
  	      return (
  	        mapChildren(children, function (child) {
  	          return child;
  	        }) || []
  	      );
  	    },
  	    only: function (children) {
  	      if (!isValidElement(children))
  	        throw Error(
  	          "React.Children.only expected to receive a single React element child."
  	        );
  	      return children;
  	    }
  	  };
  	react_production.Activity = REACT_ACTIVITY_TYPE;
  	react_production.Children = Children;
  	react_production.Component = Component;
  	react_production.Fragment = REACT_FRAGMENT_TYPE;
  	react_production.Profiler = REACT_PROFILER_TYPE;
  	react_production.PureComponent = PureComponent;
  	react_production.StrictMode = REACT_STRICT_MODE_TYPE;
  	react_production.Suspense = REACT_SUSPENSE_TYPE;
  	react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
  	  ReactSharedInternals;
  	react_production.__COMPILER_RUNTIME = {
  	  __proto__: null,
  	  c: function (size) {
  	    return ReactSharedInternals.H.useMemoCache(size);
  	  }
  	};
  	react_production.cache = function (fn) {
  	  return function () {
  	    return fn.apply(null, arguments);
  	  };
  	};
  	react_production.cacheSignal = function () {
  	  return null;
  	};
  	react_production.cloneElement = function (element, config, children) {
  	  if (null === element || void 0 === element)
  	    throw Error(
  	      "The argument must be a React element, but you passed " + element + "."
  	    );
  	  var props = assign({}, element.props),
  	    key = element.key;
  	  if (null != config)
  	    for (propName in (void 0 !== config.key && (key = "" + config.key), config))
  	      !hasOwnProperty.call(config, propName) ||
  	        "key" === propName ||
  	        "__self" === propName ||
  	        "__source" === propName ||
  	        ("ref" === propName && void 0 === config.ref) ||
  	        (props[propName] = config[propName]);
  	  var propName = arguments.length - 2;
  	  if (1 === propName) props.children = children;
  	  else if (1 < propName) {
  	    for (var childArray = Array(propName), i = 0; i < propName; i++)
  	      childArray[i] = arguments[i + 2];
  	    props.children = childArray;
  	  }
  	  return ReactElement(element.type, key, props);
  	};
  	react_production.createContext = function (defaultValue) {
  	  defaultValue = {
  	    $$typeof: REACT_CONTEXT_TYPE,
  	    _currentValue: defaultValue,
  	    _currentValue2: defaultValue,
  	    _threadCount: 0,
  	    Provider: null,
  	    Consumer: null
  	  };
  	  defaultValue.Provider = defaultValue;
  	  defaultValue.Consumer = {
  	    $$typeof: REACT_CONSUMER_TYPE,
  	    _context: defaultValue
  	  };
  	  return defaultValue;
  	};
  	react_production.createElement = function (type, config, children) {
  	  var propName,
  	    props = {},
  	    key = null;
  	  if (null != config)
  	    for (propName in (void 0 !== config.key && (key = "" + config.key), config))
  	      hasOwnProperty.call(config, propName) &&
  	        "key" !== propName &&
  	        "__self" !== propName &&
  	        "__source" !== propName &&
  	        (props[propName] = config[propName]);
  	  var childrenLength = arguments.length - 2;
  	  if (1 === childrenLength) props.children = children;
  	  else if (1 < childrenLength) {
  	    for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
  	      childArray[i] = arguments[i + 2];
  	    props.children = childArray;
  	  }
  	  if (type && type.defaultProps)
  	    for (propName in ((childrenLength = type.defaultProps), childrenLength))
  	      void 0 === props[propName] &&
  	        (props[propName] = childrenLength[propName]);
  	  return ReactElement(type, key, props);
  	};
  	react_production.createRef = function () {
  	  return { current: null };
  	};
  	react_production.forwardRef = function (render) {
  	  return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
  	};
  	react_production.isValidElement = isValidElement;
  	react_production.lazy = function (ctor) {
  	  return {
  	    $$typeof: REACT_LAZY_TYPE,
  	    _payload: { _status: -1, _result: ctor },
  	    _init: lazyInitializer
  	  };
  	};
  	react_production.memo = function (type, compare) {
  	  return {
  	    $$typeof: REACT_MEMO_TYPE,
  	    type: type,
  	    compare: void 0 === compare ? null : compare
  	  };
  	};
  	react_production.startTransition = function (scope) {
  	  var prevTransition = ReactSharedInternals.T,
  	    currentTransition = {};
  	  ReactSharedInternals.T = currentTransition;
  	  try {
  	    var returnValue = scope(),
  	      onStartTransitionFinish = ReactSharedInternals.S;
  	    null !== onStartTransitionFinish &&
  	      onStartTransitionFinish(currentTransition, returnValue);
  	    "object" === typeof returnValue &&
  	      null !== returnValue &&
  	      "function" === typeof returnValue.then &&
  	      returnValue.then(noop, reportGlobalError);
  	  } catch (error) {
  	    reportGlobalError(error);
  	  } finally {
  	    null !== prevTransition &&
  	      null !== currentTransition.types &&
  	      (prevTransition.types = currentTransition.types),
  	      (ReactSharedInternals.T = prevTransition);
  	  }
  	};
  	react_production.unstable_useCacheRefresh = function () {
  	  return ReactSharedInternals.H.useCacheRefresh();
  	};
  	react_production.use = function (usable) {
  	  return ReactSharedInternals.H.use(usable);
  	};
  	react_production.useActionState = function (action, initialState, permalink) {
  	  return ReactSharedInternals.H.useActionState(action, initialState, permalink);
  	};
  	react_production.useCallback = function (callback, deps) {
  	  return ReactSharedInternals.H.useCallback(callback, deps);
  	};
  	react_production.useContext = function (Context) {
  	  return ReactSharedInternals.H.useContext(Context);
  	};
  	react_production.useDebugValue = function () {};
  	react_production.useDeferredValue = function (value, initialValue) {
  	  return ReactSharedInternals.H.useDeferredValue(value, initialValue);
  	};
  	react_production.useEffect = function (create, deps) {
  	  return ReactSharedInternals.H.useEffect(create, deps);
  	};
  	react_production.useEffectEvent = function (callback) {
  	  return ReactSharedInternals.H.useEffectEvent(callback);
  	};
  	react_production.useId = function () {
  	  return ReactSharedInternals.H.useId();
  	};
  	react_production.useImperativeHandle = function (ref, create, deps) {
  	  return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
  	};
  	react_production.useInsertionEffect = function (create, deps) {
  	  return ReactSharedInternals.H.useInsertionEffect(create, deps);
  	};
  	react_production.useLayoutEffect = function (create, deps) {
  	  return ReactSharedInternals.H.useLayoutEffect(create, deps);
  	};
  	react_production.useMemo = function (create, deps) {
  	  return ReactSharedInternals.H.useMemo(create, deps);
  	};
  	react_production.useOptimistic = function (passthrough, reducer) {
  	  return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
  	};
  	react_production.useReducer = function (reducer, initialArg, init) {
  	  return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
  	};
  	react_production.useRef = function (initialValue) {
  	  return ReactSharedInternals.H.useRef(initialValue);
  	};
  	react_production.useState = function (initialState) {
  	  return ReactSharedInternals.H.useState(initialState);
  	};
  	react_production.useSyncExternalStore = function (
  	  subscribe,
  	  getSnapshot,
  	  getServerSnapshot
  	) {
  	  return ReactSharedInternals.H.useSyncExternalStore(
  	    subscribe,
  	    getSnapshot,
  	    getServerSnapshot
  	  );
  	};
  	react_production.useTransition = function () {
  	  return ReactSharedInternals.H.useTransition();
  	};
  	react_production.version = "19.2.0";
  	return react_production;
  }

  var hasRequiredReact;

  function requireReact () {
  	if (hasRequiredReact) return react.exports;
  	hasRequiredReact = 1;

  	{
  	  react.exports = requireReact_production();
  	}
  	return react.exports;
  }

  var reactExports = requireReact();

  var client = {exports: {}};

  var reactDomClient_production = {};

  var scheduler = {exports: {}};

  var scheduler_production = {};

  /**
   * @license React
   * scheduler.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */

  var hasRequiredScheduler_production;

  function requireScheduler_production () {
  	if (hasRequiredScheduler_production) return scheduler_production;
  	hasRequiredScheduler_production = 1;
  	(function (exports) {
  		function push(heap, node) {
  		  var index = heap.length;
  		  heap.push(node);
  		  a: for (; 0 < index; ) {
  		    var parentIndex = (index - 1) >>> 1,
  		      parent = heap[parentIndex];
  		    if (0 < compare(parent, node))
  		      (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);
  		    else break a;
  		  }
  		}
  		function peek(heap) {
  		  return 0 === heap.length ? null : heap[0];
  		}
  		function pop(heap) {
  		  if (0 === heap.length) return null;
  		  var first = heap[0],
  		    last = heap.pop();
  		  if (last !== first) {
  		    heap[0] = last;
  		    a: for (
  		      var index = 0, length = heap.length, halfLength = length >>> 1;
  		      index < halfLength;

  		    ) {
  		      var leftIndex = 2 * (index + 1) - 1,
  		        left = heap[leftIndex],
  		        rightIndex = leftIndex + 1,
  		        right = heap[rightIndex];
  		      if (0 > compare(left, last))
  		        rightIndex < length && 0 > compare(right, left)
  		          ? ((heap[index] = right),
  		            (heap[rightIndex] = last),
  		            (index = rightIndex))
  		          : ((heap[index] = left),
  		            (heap[leftIndex] = last),
  		            (index = leftIndex));
  		      else if (rightIndex < length && 0 > compare(right, last))
  		        (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);
  		      else break a;
  		    }
  		  }
  		  return first;
  		}
  		function compare(a, b) {
  		  var diff = a.sortIndex - b.sortIndex;
  		  return 0 !== diff ? diff : a.id - b.id;
  		}
  		exports.unstable_now = void 0;
  		if ("object" === typeof performance && "function" === typeof performance.now) {
  		  var localPerformance = performance;
  		  exports.unstable_now = function () {
  		    return localPerformance.now();
  		  };
  		} else {
  		  var localDate = Date,
  		    initialTime = localDate.now();
  		  exports.unstable_now = function () {
  		    return localDate.now() - initialTime;
  		  };
  		}
  		var taskQueue = [],
  		  timerQueue = [],
  		  taskIdCounter = 1,
  		  currentTask = null,
  		  currentPriorityLevel = 3,
  		  isPerformingWork = false,
  		  isHostCallbackScheduled = false,
  		  isHostTimeoutScheduled = false,
  		  needsPaint = false,
  		  localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
  		  localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null,
  		  localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
  		function advanceTimers(currentTime) {
  		  for (var timer = peek(timerQueue); null !== timer; ) {
  		    if (null === timer.callback) pop(timerQueue);
  		    else if (timer.startTime <= currentTime)
  		      pop(timerQueue),
  		        (timer.sortIndex = timer.expirationTime),
  		        push(taskQueue, timer);
  		    else break;
  		    timer = peek(timerQueue);
  		  }
  		}
  		function handleTimeout(currentTime) {
  		  isHostTimeoutScheduled = false;
  		  advanceTimers(currentTime);
  		  if (!isHostCallbackScheduled)
  		    if (null !== peek(taskQueue))
  		      (isHostCallbackScheduled = true),
  		        isMessageLoopRunning ||
  		          ((isMessageLoopRunning = true), schedulePerformWorkUntilDeadline());
  		    else {
  		      var firstTimer = peek(timerQueue);
  		      null !== firstTimer &&
  		        requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
  		    }
  		}
  		var isMessageLoopRunning = false,
  		  taskTimeoutID = -1,
  		  frameInterval = 5,
  		  startTime = -1;
  		function shouldYieldToHost() {
  		  return needsPaint
  		    ? true
  		    : exports.unstable_now() - startTime < frameInterval
  		      ? false
  		      : true;
  		}
  		function performWorkUntilDeadline() {
  		  needsPaint = false;
  		  if (isMessageLoopRunning) {
  		    var currentTime = exports.unstable_now();
  		    startTime = currentTime;
  		    var hasMoreWork = true;
  		    try {
  		      a: {
  		        isHostCallbackScheduled = !1;
  		        isHostTimeoutScheduled &&
  		          ((isHostTimeoutScheduled = !1),
  		          localClearTimeout(taskTimeoutID),
  		          (taskTimeoutID = -1));
  		        isPerformingWork = !0;
  		        var previousPriorityLevel = currentPriorityLevel;
  		        try {
  		          b: {
  		            advanceTimers(currentTime);
  		            for (
  		              currentTask = peek(taskQueue);
  		              null !== currentTask &&
  		              !(
  		                currentTask.expirationTime > currentTime && shouldYieldToHost()
  		              );

  		            ) {
  		              var callback = currentTask.callback;
  		              if ("function" === typeof callback) {
  		                currentTask.callback = null;
  		                currentPriorityLevel = currentTask.priorityLevel;
  		                var continuationCallback = callback(
  		                  currentTask.expirationTime <= currentTime
  		                );
  		                currentTime = exports.unstable_now();
  		                if ("function" === typeof continuationCallback) {
  		                  currentTask.callback = continuationCallback;
  		                  advanceTimers(currentTime);
  		                  hasMoreWork = !0;
  		                  break b;
  		                }
  		                currentTask === peek(taskQueue) && pop(taskQueue);
  		                advanceTimers(currentTime);
  		              } else pop(taskQueue);
  		              currentTask = peek(taskQueue);
  		            }
  		            if (null !== currentTask) hasMoreWork = !0;
  		            else {
  		              var firstTimer = peek(timerQueue);
  		              null !== firstTimer &&
  		                requestHostTimeout(
  		                  handleTimeout,
  		                  firstTimer.startTime - currentTime
  		                );
  		              hasMoreWork = !1;
  		            }
  		          }
  		          break a;
  		        } finally {
  		          (currentTask = null),
  		            (currentPriorityLevel = previousPriorityLevel),
  		            (isPerformingWork = !1);
  		        }
  		        hasMoreWork = void 0;
  		      }
  		    } finally {
  		      hasMoreWork
  		        ? schedulePerformWorkUntilDeadline()
  		        : (isMessageLoopRunning = false);
  		    }
  		  }
  		}
  		var schedulePerformWorkUntilDeadline;
  		if ("function" === typeof localSetImmediate)
  		  schedulePerformWorkUntilDeadline = function () {
  		    localSetImmediate(performWorkUntilDeadline);
  		  };
  		else if ("undefined" !== typeof MessageChannel) {
  		  var channel = new MessageChannel(),
  		    port = channel.port2;
  		  channel.port1.onmessage = performWorkUntilDeadline;
  		  schedulePerformWorkUntilDeadline = function () {
  		    port.postMessage(null);
  		  };
  		} else
  		  schedulePerformWorkUntilDeadline = function () {
  		    localSetTimeout(performWorkUntilDeadline, 0);
  		  };
  		function requestHostTimeout(callback, ms) {
  		  taskTimeoutID = localSetTimeout(function () {
  		    callback(exports.unstable_now());
  		  }, ms);
  		}
  		exports.unstable_IdlePriority = 5;
  		exports.unstable_ImmediatePriority = 1;
  		exports.unstable_LowPriority = 4;
  		exports.unstable_NormalPriority = 3;
  		exports.unstable_Profiling = null;
  		exports.unstable_UserBlockingPriority = 2;
  		exports.unstable_cancelCallback = function (task) {
  		  task.callback = null;
  		};
  		exports.unstable_forceFrameRate = function (fps) {
  		  0 > fps || 125 < fps
  		    ? console.error(
  		        "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
  		      )
  		    : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);
  		};
  		exports.unstable_getCurrentPriorityLevel = function () {
  		  return currentPriorityLevel;
  		};
  		exports.unstable_next = function (eventHandler) {
  		  switch (currentPriorityLevel) {
  		    case 1:
  		    case 2:
  		    case 3:
  		      var priorityLevel = 3;
  		      break;
  		    default:
  		      priorityLevel = currentPriorityLevel;
  		  }
  		  var previousPriorityLevel = currentPriorityLevel;
  		  currentPriorityLevel = priorityLevel;
  		  try {
  		    return eventHandler();
  		  } finally {
  		    currentPriorityLevel = previousPriorityLevel;
  		  }
  		};
  		exports.unstable_requestPaint = function () {
  		  needsPaint = true;
  		};
  		exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {
  		  switch (priorityLevel) {
  		    case 1:
  		    case 2:
  		    case 3:
  		    case 4:
  		    case 5:
  		      break;
  		    default:
  		      priorityLevel = 3;
  		  }
  		  var previousPriorityLevel = currentPriorityLevel;
  		  currentPriorityLevel = priorityLevel;
  		  try {
  		    return eventHandler();
  		  } finally {
  		    currentPriorityLevel = previousPriorityLevel;
  		  }
  		};
  		exports.unstable_scheduleCallback = function (
  		  priorityLevel,
  		  callback,
  		  options
  		) {
  		  var currentTime = exports.unstable_now();
  		  "object" === typeof options && null !== options
  		    ? ((options = options.delay),
  		      (options =
  		        "number" === typeof options && 0 < options
  		          ? currentTime + options
  		          : currentTime))
  		    : (options = currentTime);
  		  switch (priorityLevel) {
  		    case 1:
  		      var timeout = -1;
  		      break;
  		    case 2:
  		      timeout = 250;
  		      break;
  		    case 5:
  		      timeout = 1073741823;
  		      break;
  		    case 4:
  		      timeout = 1e4;
  		      break;
  		    default:
  		      timeout = 5e3;
  		  }
  		  timeout = options + timeout;
  		  priorityLevel = {
  		    id: taskIdCounter++,
  		    callback: callback,
  		    priorityLevel: priorityLevel,
  		    startTime: options,
  		    expirationTime: timeout,
  		    sortIndex: -1
  		  };
  		  options > currentTime
  		    ? ((priorityLevel.sortIndex = options),
  		      push(timerQueue, priorityLevel),
  		      null === peek(taskQueue) &&
  		        priorityLevel === peek(timerQueue) &&
  		        (isHostTimeoutScheduled
  		          ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
  		          : (isHostTimeoutScheduled = true),
  		        requestHostTimeout(handleTimeout, options - currentTime)))
  		    : ((priorityLevel.sortIndex = timeout),
  		      push(taskQueue, priorityLevel),
  		      isHostCallbackScheduled ||
  		        isPerformingWork ||
  		        ((isHostCallbackScheduled = true),
  		        isMessageLoopRunning ||
  		          ((isMessageLoopRunning = true), schedulePerformWorkUntilDeadline())));
  		  return priorityLevel;
  		};
  		exports.unstable_shouldYield = shouldYieldToHost;
  		exports.unstable_wrapCallback = function (callback) {
  		  var parentPriorityLevel = currentPriorityLevel;
  		  return function () {
  		    var previousPriorityLevel = currentPriorityLevel;
  		    currentPriorityLevel = parentPriorityLevel;
  		    try {
  		      return callback.apply(this, arguments);
  		    } finally {
  		      currentPriorityLevel = previousPriorityLevel;
  		    }
  		  };
  		}; 
  	} (scheduler_production));
  	return scheduler_production;
  }

  var hasRequiredScheduler;

  function requireScheduler () {
  	if (hasRequiredScheduler) return scheduler.exports;
  	hasRequiredScheduler = 1;

  	{
  	  scheduler.exports = requireScheduler_production();
  	}
  	return scheduler.exports;
  }

  var reactDom = {exports: {}};

  var reactDom_production = {};

  /**
   * @license React
   * react-dom.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */

  var hasRequiredReactDom_production;

  function requireReactDom_production () {
  	if (hasRequiredReactDom_production) return reactDom_production;
  	hasRequiredReactDom_production = 1;
  	var React = requireReact();
  	function formatProdErrorMessage(code) {
  	  var url = "https://react.dev/errors/" + code;
  	  if (1 < arguments.length) {
  	    url += "?args[]=" + encodeURIComponent(arguments[1]);
  	    for (var i = 2; i < arguments.length; i++)
  	      url += "&args[]=" + encodeURIComponent(arguments[i]);
  	  }
  	  return (
  	    "Minified React error #" +
  	    code +
  	    "; visit " +
  	    url +
  	    " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
  	  );
  	}
  	function noop() {}
  	var Internals = {
  	    d: {
  	      f: noop,
  	      r: function () {
  	        throw Error(formatProdErrorMessage(522));
  	      },
  	      D: noop,
  	      C: noop,
  	      L: noop,
  	      m: noop,
  	      X: noop,
  	      S: noop,
  	      M: noop
  	    },
  	    p: 0,
  	    findDOMNode: null
  	  },
  	  REACT_PORTAL_TYPE = Symbol.for("react.portal");
  	function createPortal$1(children, containerInfo, implementation) {
  	  var key =
  	    3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  	  return {
  	    $$typeof: REACT_PORTAL_TYPE,
  	    key: null == key ? null : "" + key,
  	    children: children,
  	    containerInfo: containerInfo,
  	    implementation: implementation
  	  };
  	}
  	var ReactSharedInternals =
  	  React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
  	function getCrossOriginStringAs(as, input) {
  	  if ("font" === as) return "";
  	  if ("string" === typeof input)
  	    return "use-credentials" === input ? input : "";
  	}
  	reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
  	  Internals;
  	reactDom_production.createPortal = function (children, container) {
  	  var key =
  	    2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
  	  if (
  	    !container ||
  	    (1 !== container.nodeType &&
  	      9 !== container.nodeType &&
  	      11 !== container.nodeType)
  	  )
  	    throw Error(formatProdErrorMessage(299));
  	  return createPortal$1(children, container, null, key);
  	};
  	reactDom_production.flushSync = function (fn) {
  	  var previousTransition = ReactSharedInternals.T,
  	    previousUpdatePriority = Internals.p;
  	  try {
  	    if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();
  	  } finally {
  	    (ReactSharedInternals.T = previousTransition),
  	      (Internals.p = previousUpdatePriority),
  	      Internals.d.f();
  	  }
  	};
  	reactDom_production.preconnect = function (href, options) {
  	  "string" === typeof href &&
  	    (options
  	      ? ((options = options.crossOrigin),
  	        (options =
  	          "string" === typeof options
  	            ? "use-credentials" === options
  	              ? options
  	              : ""
  	            : void 0))
  	      : (options = null),
  	    Internals.d.C(href, options));
  	};
  	reactDom_production.prefetchDNS = function (href) {
  	  "string" === typeof href && Internals.d.D(href);
  	};
  	reactDom_production.preinit = function (href, options) {
  	  if ("string" === typeof href && options && "string" === typeof options.as) {
  	    var as = options.as,
  	      crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
  	      integrity =
  	        "string" === typeof options.integrity ? options.integrity : void 0,
  	      fetchPriority =
  	        "string" === typeof options.fetchPriority
  	          ? options.fetchPriority
  	          : void 0;
  	    "style" === as
  	      ? Internals.d.S(
  	          href,
  	          "string" === typeof options.precedence ? options.precedence : void 0,
  	          {
  	            crossOrigin: crossOrigin,
  	            integrity: integrity,
  	            fetchPriority: fetchPriority
  	          }
  	        )
  	      : "script" === as &&
  	        Internals.d.X(href, {
  	          crossOrigin: crossOrigin,
  	          integrity: integrity,
  	          fetchPriority: fetchPriority,
  	          nonce: "string" === typeof options.nonce ? options.nonce : void 0
  	        });
  	  }
  	};
  	reactDom_production.preinitModule = function (href, options) {
  	  if ("string" === typeof href)
  	    if ("object" === typeof options && null !== options) {
  	      if (null == options.as || "script" === options.as) {
  	        var crossOrigin = getCrossOriginStringAs(
  	          options.as,
  	          options.crossOrigin
  	        );
  	        Internals.d.M(href, {
  	          crossOrigin: crossOrigin,
  	          integrity:
  	            "string" === typeof options.integrity ? options.integrity : void 0,
  	          nonce: "string" === typeof options.nonce ? options.nonce : void 0
  	        });
  	      }
  	    } else null == options && Internals.d.M(href);
  	};
  	reactDom_production.preload = function (href, options) {
  	  if (
  	    "string" === typeof href &&
  	    "object" === typeof options &&
  	    null !== options &&
  	    "string" === typeof options.as
  	  ) {
  	    var as = options.as,
  	      crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
  	    Internals.d.L(href, as, {
  	      crossOrigin: crossOrigin,
  	      integrity:
  	        "string" === typeof options.integrity ? options.integrity : void 0,
  	      nonce: "string" === typeof options.nonce ? options.nonce : void 0,
  	      type: "string" === typeof options.type ? options.type : void 0,
  	      fetchPriority:
  	        "string" === typeof options.fetchPriority
  	          ? options.fetchPriority
  	          : void 0,
  	      referrerPolicy:
  	        "string" === typeof options.referrerPolicy
  	          ? options.referrerPolicy
  	          : void 0,
  	      imageSrcSet:
  	        "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
  	      imageSizes:
  	        "string" === typeof options.imageSizes ? options.imageSizes : void 0,
  	      media: "string" === typeof options.media ? options.media : void 0
  	    });
  	  }
  	};
  	reactDom_production.preloadModule = function (href, options) {
  	  if ("string" === typeof href)
  	    if (options) {
  	      var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
  	      Internals.d.m(href, {
  	        as:
  	          "string" === typeof options.as && "script" !== options.as
  	            ? options.as
  	            : void 0,
  	        crossOrigin: crossOrigin,
  	        integrity:
  	          "string" === typeof options.integrity ? options.integrity : void 0
  	      });
  	    } else Internals.d.m(href);
  	};
  	reactDom_production.requestFormReset = function (form) {
  	  Internals.d.r(form);
  	};
  	reactDom_production.unstable_batchedUpdates = function (fn, a) {
  	  return fn(a);
  	};
  	reactDom_production.useFormState = function (action, initialState, permalink) {
  	  return ReactSharedInternals.H.useFormState(action, initialState, permalink);
  	};
  	reactDom_production.useFormStatus = function () {
  	  return ReactSharedInternals.H.useHostTransitionStatus();
  	};
  	reactDom_production.version = "19.2.0";
  	return reactDom_production;
  }

  var hasRequiredReactDom;

  function requireReactDom () {
  	if (hasRequiredReactDom) return reactDom.exports;
  	hasRequiredReactDom = 1;

  	function checkDCE() {
  	  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  	  if (
  	    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
  	    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  	  ) {
  	    return;
  	  }
  	  try {
  	    // Verify that the code above has been dead code eliminated (DCE'd).
  	    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  	  } catch (err) {
  	    // DevTools shouldn't crash React, no matter what.
  	    // We should still report in case we break this code.
  	    console.error(err);
  	  }
  	}

  	{
  	  // DCE check should happen before ReactDOM bundle executes so that
  	  // DevTools can report bad minification during injection.
  	  checkDCE();
  	  reactDom.exports = requireReactDom_production();
  	}
  	return reactDom.exports;
  }

  /**
   * @license React
   * react-dom-client.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */

  var hasRequiredReactDomClient_production;

  function requireReactDomClient_production () {
  	if (hasRequiredReactDomClient_production) return reactDomClient_production;
  	hasRequiredReactDomClient_production = 1;
  	var Scheduler = requireScheduler(),
  	  React = requireReact(),
  	  ReactDOM = requireReactDom();
  	function formatProdErrorMessage(code) {
  	  var url = "https://react.dev/errors/" + code;
  	  if (1 < arguments.length) {
  	    url += "?args[]=" + encodeURIComponent(arguments[1]);
  	    for (var i = 2; i < arguments.length; i++)
  	      url += "&args[]=" + encodeURIComponent(arguments[i]);
  	  }
  	  return (
  	    "Minified React error #" +
  	    code +
  	    "; visit " +
  	    url +
  	    " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
  	  );
  	}
  	function isValidContainer(node) {
  	  return !(
  	    !node ||
  	    (1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType)
  	  );
  	}
  	function getNearestMountedFiber(fiber) {
  	  var node = fiber,
  	    nearestMounted = fiber;
  	  if (fiber.alternate) for (; node.return; ) node = node.return;
  	  else {
  	    fiber = node;
  	    do
  	      (node = fiber),
  	        0 !== (node.flags & 4098) && (nearestMounted = node.return),
  	        (fiber = node.return);
  	    while (fiber);
  	  }
  	  return 3 === node.tag ? nearestMounted : null;
  	}
  	function getSuspenseInstanceFromFiber(fiber) {
  	  if (13 === fiber.tag) {
  	    var suspenseState = fiber.memoizedState;
  	    null === suspenseState &&
  	      ((fiber = fiber.alternate),
  	      null !== fiber && (suspenseState = fiber.memoizedState));
  	    if (null !== suspenseState) return suspenseState.dehydrated;
  	  }
  	  return null;
  	}
  	function getActivityInstanceFromFiber(fiber) {
  	  if (31 === fiber.tag) {
  	    var activityState = fiber.memoizedState;
  	    null === activityState &&
  	      ((fiber = fiber.alternate),
  	      null !== fiber && (activityState = fiber.memoizedState));
  	    if (null !== activityState) return activityState.dehydrated;
  	  }
  	  return null;
  	}
  	function assertIsMounted(fiber) {
  	  if (getNearestMountedFiber(fiber) !== fiber)
  	    throw Error(formatProdErrorMessage(188));
  	}
  	function findCurrentFiberUsingSlowPath(fiber) {
  	  var alternate = fiber.alternate;
  	  if (!alternate) {
  	    alternate = getNearestMountedFiber(fiber);
  	    if (null === alternate) throw Error(formatProdErrorMessage(188));
  	    return alternate !== fiber ? null : fiber;
  	  }
  	  for (var a = fiber, b = alternate; ; ) {
  	    var parentA = a.return;
  	    if (null === parentA) break;
  	    var parentB = parentA.alternate;
  	    if (null === parentB) {
  	      b = parentA.return;
  	      if (null !== b) {
  	        a = b;
  	        continue;
  	      }
  	      break;
  	    }
  	    if (parentA.child === parentB.child) {
  	      for (parentB = parentA.child; parentB; ) {
  	        if (parentB === a) return assertIsMounted(parentA), fiber;
  	        if (parentB === b) return assertIsMounted(parentA), alternate;
  	        parentB = parentB.sibling;
  	      }
  	      throw Error(formatProdErrorMessage(188));
  	    }
  	    if (a.return !== b.return) (a = parentA), (b = parentB);
  	    else {
  	      for (var didFindChild = false, child$0 = parentA.child; child$0; ) {
  	        if (child$0 === a) {
  	          didFindChild = true;
  	          a = parentA;
  	          b = parentB;
  	          break;
  	        }
  	        if (child$0 === b) {
  	          didFindChild = true;
  	          b = parentA;
  	          a = parentB;
  	          break;
  	        }
  	        child$0 = child$0.sibling;
  	      }
  	      if (!didFindChild) {
  	        for (child$0 = parentB.child; child$0; ) {
  	          if (child$0 === a) {
  	            didFindChild = true;
  	            a = parentB;
  	            b = parentA;
  	            break;
  	          }
  	          if (child$0 === b) {
  	            didFindChild = true;
  	            b = parentB;
  	            a = parentA;
  	            break;
  	          }
  	          child$0 = child$0.sibling;
  	        }
  	        if (!didFindChild) throw Error(formatProdErrorMessage(189));
  	      }
  	    }
  	    if (a.alternate !== b) throw Error(formatProdErrorMessage(190));
  	  }
  	  if (3 !== a.tag) throw Error(formatProdErrorMessage(188));
  	  return a.stateNode.current === a ? fiber : alternate;
  	}
  	function findCurrentHostFiberImpl(node) {
  	  var tag = node.tag;
  	  if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
  	  for (node = node.child; null !== node; ) {
  	    tag = findCurrentHostFiberImpl(node);
  	    if (null !== tag) return tag;
  	    node = node.sibling;
  	  }
  	  return null;
  	}
  	var assign = Object.assign,
  	  REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
  	  REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
  	  REACT_PORTAL_TYPE = Symbol.for("react.portal"),
  	  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
  	  REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
  	  REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
  	  REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
  	  REACT_CONTEXT_TYPE = Symbol.for("react.context"),
  	  REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
  	  REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
  	  REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
  	  REACT_MEMO_TYPE = Symbol.for("react.memo"),
  	  REACT_LAZY_TYPE = Symbol.for("react.lazy");
  	var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
  	var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
  	var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
  	function getIteratorFn(maybeIterable) {
  	  if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  	  maybeIterable =
  	    (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
  	    maybeIterable["@@iterator"];
  	  return "function" === typeof maybeIterable ? maybeIterable : null;
  	}
  	var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
  	function getComponentNameFromType(type) {
  	  if (null == type) return null;
  	  if ("function" === typeof type)
  	    return type.$$typeof === REACT_CLIENT_REFERENCE
  	      ? null
  	      : type.displayName || type.name || null;
  	  if ("string" === typeof type) return type;
  	  switch (type) {
  	    case REACT_FRAGMENT_TYPE:
  	      return "Fragment";
  	    case REACT_PROFILER_TYPE:
  	      return "Profiler";
  	    case REACT_STRICT_MODE_TYPE:
  	      return "StrictMode";
  	    case REACT_SUSPENSE_TYPE:
  	      return "Suspense";
  	    case REACT_SUSPENSE_LIST_TYPE:
  	      return "SuspenseList";
  	    case REACT_ACTIVITY_TYPE:
  	      return "Activity";
  	  }
  	  if ("object" === typeof type)
  	    switch (type.$$typeof) {
  	      case REACT_PORTAL_TYPE:
  	        return "Portal";
  	      case REACT_CONTEXT_TYPE:
  	        return type.displayName || "Context";
  	      case REACT_CONSUMER_TYPE:
  	        return (type._context.displayName || "Context") + ".Consumer";
  	      case REACT_FORWARD_REF_TYPE:
  	        var innerType = type.render;
  	        type = type.displayName;
  	        type ||
  	          ((type = innerType.displayName || innerType.name || ""),
  	          (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
  	        return type;
  	      case REACT_MEMO_TYPE:
  	        return (
  	          (innerType = type.displayName || null),
  	          null !== innerType
  	            ? innerType
  	            : getComponentNameFromType(type.type) || "Memo"
  	        );
  	      case REACT_LAZY_TYPE:
  	        innerType = type._payload;
  	        type = type._init;
  	        try {
  	          return getComponentNameFromType(type(innerType));
  	        } catch (x) {}
  	    }
  	  return null;
  	}
  	var isArrayImpl = Array.isArray,
  	  ReactSharedInternals =
  	    React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
  	  ReactDOMSharedInternals =
  	    ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
  	  sharedNotPendingObject = {
  	    pending: false,
  	    data: null,
  	    method: null,
  	    action: null
  	  },
  	  valueStack = [],
  	  index = -1;
  	function createCursor(defaultValue) {
  	  return { current: defaultValue };
  	}
  	function pop(cursor) {
  	  0 > index ||
  	    ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
  	}
  	function push(cursor, value) {
  	  index++;
  	  valueStack[index] = cursor.current;
  	  cursor.current = value;
  	}
  	var contextStackCursor = createCursor(null),
  	  contextFiberStackCursor = createCursor(null),
  	  rootInstanceStackCursor = createCursor(null),
  	  hostTransitionProviderCursor = createCursor(null);
  	function pushHostContainer(fiber, nextRootInstance) {
  	  push(rootInstanceStackCursor, nextRootInstance);
  	  push(contextFiberStackCursor, fiber);
  	  push(contextStackCursor, null);
  	  switch (nextRootInstance.nodeType) {
  	    case 9:
  	    case 11:
  	      fiber = (fiber = nextRootInstance.documentElement)
  	        ? (fiber = fiber.namespaceURI)
  	          ? getOwnHostContext(fiber)
  	          : 0
  	        : 0;
  	      break;
  	    default:
  	      if (
  	        ((fiber = nextRootInstance.tagName),
  	        (nextRootInstance = nextRootInstance.namespaceURI))
  	      )
  	        (nextRootInstance = getOwnHostContext(nextRootInstance)),
  	          (fiber = getChildHostContextProd(nextRootInstance, fiber));
  	      else
  	        switch (fiber) {
  	          case "svg":
  	            fiber = 1;
  	            break;
  	          case "math":
  	            fiber = 2;
  	            break;
  	          default:
  	            fiber = 0;
  	        }
  	  }
  	  pop(contextStackCursor);
  	  push(contextStackCursor, fiber);
  	}
  	function popHostContainer() {
  	  pop(contextStackCursor);
  	  pop(contextFiberStackCursor);
  	  pop(rootInstanceStackCursor);
  	}
  	function pushHostContext(fiber) {
  	  null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber);
  	  var context = contextStackCursor.current;
  	  var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);
  	  context !== JSCompiler_inline_result &&
  	    (push(contextFiberStackCursor, fiber),
  	    push(contextStackCursor, JSCompiler_inline_result));
  	}
  	function popHostContext(fiber) {
  	  contextFiberStackCursor.current === fiber &&
  	    (pop(contextStackCursor), pop(contextFiberStackCursor));
  	  hostTransitionProviderCursor.current === fiber &&
  	    (pop(hostTransitionProviderCursor),
  	    (HostTransitionContext._currentValue = sharedNotPendingObject));
  	}
  	var prefix, suffix;
  	function describeBuiltInComponentFrame(name) {
  	  if (void 0 === prefix)
  	    try {
  	      throw Error();
  	    } catch (x) {
  	      var match = x.stack.trim().match(/\n( *(at )?)/);
  	      prefix = (match && match[1]) || "";
  	      suffix =
  	        -1 < x.stack.indexOf("\n    at")
  	          ? " (<anonymous>)"
  	          : -1 < x.stack.indexOf("@")
  	            ? "@unknown:0:0"
  	            : "";
  	    }
  	  return "\n" + prefix + name + suffix;
  	}
  	var reentry = false;
  	function describeNativeComponentFrame(fn, construct) {
  	  if (!fn || reentry) return "";
  	  reentry = true;
  	  var previousPrepareStackTrace = Error.prepareStackTrace;
  	  Error.prepareStackTrace = void 0;
  	  try {
  	    var RunInRootFrame = {
  	      DetermineComponentFrameRoot: function () {
  	        try {
  	          if (construct) {
  	            var Fake = function () {
  	              throw Error();
  	            };
  	            Object.defineProperty(Fake.prototype, "props", {
  	              set: function () {
  	                throw Error();
  	              }
  	            });
  	            if ("object" === typeof Reflect && Reflect.construct) {
  	              try {
  	                Reflect.construct(Fake, []);
  	              } catch (x) {
  	                var control = x;
  	              }
  	              Reflect.construct(fn, [], Fake);
  	            } else {
  	              try {
  	                Fake.call();
  	              } catch (x$1) {
  	                control = x$1;
  	              }
  	              fn.call(Fake.prototype);
  	            }
  	          } else {
  	            try {
  	              throw Error();
  	            } catch (x$2) {
  	              control = x$2;
  	            }
  	            (Fake = fn()) &&
  	              "function" === typeof Fake.catch &&
  	              Fake.catch(function () {});
  	          }
  	        } catch (sample) {
  	          if (sample && control && "string" === typeof sample.stack)
  	            return [sample.stack, control.stack];
  	        }
  	        return [null, null];
  	      }
  	    };
  	    RunInRootFrame.DetermineComponentFrameRoot.displayName =
  	      "DetermineComponentFrameRoot";
  	    var namePropDescriptor = Object.getOwnPropertyDescriptor(
  	      RunInRootFrame.DetermineComponentFrameRoot,
  	      "name"
  	    );
  	    namePropDescriptor &&
  	      namePropDescriptor.configurable &&
  	      Object.defineProperty(
  	        RunInRootFrame.DetermineComponentFrameRoot,
  	        "name",
  	        { value: "DetermineComponentFrameRoot" }
  	      );
  	    var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
  	      sampleStack = _RunInRootFrame$Deter[0],
  	      controlStack = _RunInRootFrame$Deter[1];
  	    if (sampleStack && controlStack) {
  	      var sampleLines = sampleStack.split("\n"),
  	        controlLines = controlStack.split("\n");
  	      for (
  	        namePropDescriptor = RunInRootFrame = 0;
  	        RunInRootFrame < sampleLines.length &&
  	        !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot");

  	      )
  	        RunInRootFrame++;
  	      for (
  	        ;
  	        namePropDescriptor < controlLines.length &&
  	        !controlLines[namePropDescriptor].includes(
  	          "DetermineComponentFrameRoot"
  	        );

  	      )
  	        namePropDescriptor++;
  	      if (
  	        RunInRootFrame === sampleLines.length ||
  	        namePropDescriptor === controlLines.length
  	      )
  	        for (
  	          RunInRootFrame = sampleLines.length - 1,
  	            namePropDescriptor = controlLines.length - 1;
  	          1 <= RunInRootFrame &&
  	          0 <= namePropDescriptor &&
  	          sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor];

  	        )
  	          namePropDescriptor--;
  	      for (
  	        ;
  	        1 <= RunInRootFrame && 0 <= namePropDescriptor;
  	        RunInRootFrame--, namePropDescriptor--
  	      )
  	        if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
  	          if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
  	            do
  	              if (
  	                (RunInRootFrame--,
  	                namePropDescriptor--,
  	                0 > namePropDescriptor ||
  	                  sampleLines[RunInRootFrame] !==
  	                    controlLines[namePropDescriptor])
  	              ) {
  	                var frame =
  	                  "\n" +
  	                  sampleLines[RunInRootFrame].replace(" at new ", " at ");
  	                fn.displayName &&
  	                  frame.includes("<anonymous>") &&
  	                  (frame = frame.replace("<anonymous>", fn.displayName));
  	                return frame;
  	              }
  	            while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
  	          }
  	          break;
  	        }
  	    }
  	  } finally {
  	    (reentry = false), (Error.prepareStackTrace = previousPrepareStackTrace);
  	  }
  	  return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "")
  	    ? describeBuiltInComponentFrame(previousPrepareStackTrace)
  	    : "";
  	}
  	function describeFiber(fiber, childFiber) {
  	  switch (fiber.tag) {
  	    case 26:
  	    case 27:
  	    case 5:
  	      return describeBuiltInComponentFrame(fiber.type);
  	    case 16:
  	      return describeBuiltInComponentFrame("Lazy");
  	    case 13:
  	      return fiber.child !== childFiber && null !== childFiber
  	        ? describeBuiltInComponentFrame("Suspense Fallback")
  	        : describeBuiltInComponentFrame("Suspense");
  	    case 19:
  	      return describeBuiltInComponentFrame("SuspenseList");
  	    case 0:
  	    case 15:
  	      return describeNativeComponentFrame(fiber.type, false);
  	    case 11:
  	      return describeNativeComponentFrame(fiber.type.render, false);
  	    case 1:
  	      return describeNativeComponentFrame(fiber.type, true);
  	    case 31:
  	      return describeBuiltInComponentFrame("Activity");
  	    default:
  	      return "";
  	  }
  	}
  	function getStackByFiberInDevAndProd(workInProgress) {
  	  try {
  	    var info = "",
  	      previous = null;
  	    do
  	      (info += describeFiber(workInProgress, previous)),
  	        (previous = workInProgress),
  	        (workInProgress = workInProgress.return);
  	    while (workInProgress);
  	    return info;
  	  } catch (x) {
  	    return "\nError generating stack: " + x.message + "\n" + x.stack;
  	  }
  	}
  	var hasOwnProperty = Object.prototype.hasOwnProperty,
  	  scheduleCallback$3 = Scheduler.unstable_scheduleCallback,
  	  cancelCallback$1 = Scheduler.unstable_cancelCallback,
  	  shouldYield = Scheduler.unstable_shouldYield,
  	  requestPaint = Scheduler.unstable_requestPaint,
  	  now = Scheduler.unstable_now,
  	  getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,
  	  ImmediatePriority = Scheduler.unstable_ImmediatePriority,
  	  UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
  	  NormalPriority$1 = Scheduler.unstable_NormalPriority,
  	  LowPriority = Scheduler.unstable_LowPriority,
  	  IdlePriority = Scheduler.unstable_IdlePriority,
  	  log$1 = Scheduler.log,
  	  unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue,
  	  rendererID = null,
  	  injectedHook = null;
  	function setIsStrictModeForDevtools(newIsStrictMode) {
  	  "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);
  	  if (injectedHook && "function" === typeof injectedHook.setStrictMode)
  	    try {
  	      injectedHook.setStrictMode(rendererID, newIsStrictMode);
  	    } catch (err) {}
  	}
  	var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,
  	  log = Math.log,
  	  LN2 = Math.LN2;
  	function clz32Fallback(x) {
  	  x >>>= 0;
  	  return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;
  	}
  	var nextTransitionUpdateLane = 256,
  	  nextTransitionDeferredLane = 262144,
  	  nextRetryLane = 4194304;
  	function getHighestPriorityLanes(lanes) {
  	  var pendingSyncLanes = lanes & 42;
  	  if (0 !== pendingSyncLanes) return pendingSyncLanes;
  	  switch (lanes & -lanes) {
  	    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:
  	      return 64;
  	    case 128:
  	      return 128;
  	    case 256:
  	    case 512:
  	    case 1024:
  	    case 2048:
  	    case 4096:
  	    case 8192:
  	    case 16384:
  	    case 32768:
  	    case 65536:
  	    case 131072:
  	      return lanes & 261888;
  	    case 262144:
  	    case 524288:
  	    case 1048576:
  	    case 2097152:
  	      return lanes & 3932160;
  	    case 4194304:
  	    case 8388608:
  	    case 16777216:
  	    case 33554432:
  	      return lanes & 62914560;
  	    case 67108864:
  	      return 67108864;
  	    case 134217728:
  	      return 134217728;
  	    case 268435456:
  	      return 268435456;
  	    case 536870912:
  	      return 536870912;
  	    case 1073741824:
  	      return 0;
  	    default:
  	      return lanes;
  	  }
  	}
  	function getNextLanes(root, wipLanes, rootHasPendingCommit) {
  	  var pendingLanes = root.pendingLanes;
  	  if (0 === pendingLanes) return 0;
  	  var nextLanes = 0,
  	    suspendedLanes = root.suspendedLanes,
  	    pingedLanes = root.pingedLanes;
  	  root = root.warmLanes;
  	  var nonIdlePendingLanes = pendingLanes & 134217727;
  	  0 !== nonIdlePendingLanes
  	    ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes),
  	      0 !== pendingLanes
  	        ? (nextLanes = getHighestPriorityLanes(pendingLanes))
  	        : ((pingedLanes &= nonIdlePendingLanes),
  	          0 !== pingedLanes
  	            ? (nextLanes = getHighestPriorityLanes(pingedLanes))
  	            : rootHasPendingCommit ||
  	              ((rootHasPendingCommit = nonIdlePendingLanes & ~root),
  	              0 !== rootHasPendingCommit &&
  	                (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))))
  	    : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes),
  	      0 !== nonIdlePendingLanes
  	        ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
  	        : 0 !== pingedLanes
  	          ? (nextLanes = getHighestPriorityLanes(pingedLanes))
  	          : rootHasPendingCommit ||
  	            ((rootHasPendingCommit = pendingLanes & ~root),
  	            0 !== rootHasPendingCommit &&
  	              (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
  	  return 0 === nextLanes
  	    ? 0
  	    : 0 !== wipLanes &&
  	        wipLanes !== nextLanes &&
  	        0 === (wipLanes & suspendedLanes) &&
  	        ((suspendedLanes = nextLanes & -nextLanes),
  	        (rootHasPendingCommit = wipLanes & -wipLanes),
  	        suspendedLanes >= rootHasPendingCommit ||
  	          (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)))
  	      ? wipLanes
  	      : nextLanes;
  	}
  	function checkIfRootIsPrerendering(root, renderLanes) {
  	  return (
  	    0 ===
  	    (root.pendingLanes &
  	      ~(root.suspendedLanes & ~root.pingedLanes) &
  	      renderLanes)
  	  );
  	}
  	function computeExpirationTime(lane, currentTime) {
  	  switch (lane) {
  	    case 1:
  	    case 2:
  	    case 4:
  	    case 8:
  	    case 64:
  	      return currentTime + 250;
  	    case 16:
  	    case 32:
  	    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 currentTime + 5e3;
  	    case 4194304:
  	    case 8388608:
  	    case 16777216:
  	    case 33554432:
  	      return -1;
  	    case 67108864:
  	    case 134217728:
  	    case 268435456:
  	    case 536870912:
  	    case 1073741824:
  	      return -1;
  	    default:
  	      return -1;
  	  }
  	}
  	function claimNextRetryLane() {
  	  var lane = nextRetryLane;
  	  nextRetryLane <<= 1;
  	  0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);
  	  return lane;
  	}
  	function createLaneMap(initial) {
  	  for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
  	  return laneMap;
  	}
  	function markRootUpdated$1(root, updateLane) {
  	  root.pendingLanes |= updateLane;
  	  268435456 !== updateLane &&
  	    ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0));
  	}
  	function markRootFinished(
  	  root,
  	  finishedLanes,
  	  remainingLanes,
  	  spawnedLane,
  	  updatedLanes,
  	  suspendedRetryLanes
  	) {
  	  var previouslyPendingLanes = root.pendingLanes;
  	  root.pendingLanes = remainingLanes;
  	  root.suspendedLanes = 0;
  	  root.pingedLanes = 0;
  	  root.warmLanes = 0;
  	  root.expiredLanes &= remainingLanes;
  	  root.entangledLanes &= remainingLanes;
  	  root.errorRecoveryDisabledLanes &= remainingLanes;
  	  root.shellSuspendCounter = 0;
  	  var entanglements = root.entanglements,
  	    expirationTimes = root.expirationTimes,
  	    hiddenUpdates = root.hiddenUpdates;
  	  for (
  	    remainingLanes = previouslyPendingLanes & ~remainingLanes;
  	    0 < remainingLanes;

  	  ) {
  	    var index$7 = 31 - clz32(remainingLanes),
  	      lane = 1 << index$7;
  	    entanglements[index$7] = 0;
  	    expirationTimes[index$7] = -1;
  	    var hiddenUpdatesForLane = hiddenUpdates[index$7];
  	    if (null !== hiddenUpdatesForLane)
  	      for (
  	        hiddenUpdates[index$7] = null, index$7 = 0;
  	        index$7 < hiddenUpdatesForLane.length;
  	        index$7++
  	      ) {
  	        var update = hiddenUpdatesForLane[index$7];
  	        null !== update && (update.lane &= -536870913);
  	      }
  	    remainingLanes &= ~lane;
  	  }
  	  0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
  	  0 !== suspendedRetryLanes &&
  	    0 === updatedLanes &&
  	    0 !== root.tag &&
  	    (root.suspendedLanes |=
  	      suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
  	}
  	function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) {
  	  root.pendingLanes |= spawnedLane;
  	  root.suspendedLanes &= ~spawnedLane;
  	  var spawnedLaneIndex = 31 - clz32(spawnedLane);
  	  root.entangledLanes |= spawnedLane;
  	  root.entanglements[spawnedLaneIndex] =
  	    root.entanglements[spawnedLaneIndex] |
  	    1073741824 |
  	    (entangledLanes & 261930);
  	}
  	function markRootEntangled(root, entangledLanes) {
  	  var rootEntangledLanes = (root.entangledLanes |= entangledLanes);
  	  for (root = root.entanglements; rootEntangledLanes; ) {
  	    var index$8 = 31 - clz32(rootEntangledLanes),
  	      lane = 1 << index$8;
  	    (lane & entangledLanes) | (root[index$8] & entangledLanes) &&
  	      (root[index$8] |= entangledLanes);
  	    rootEntangledLanes &= ~lane;
  	  }
  	}
  	function getBumpedLaneForHydration(root, renderLanes) {
  	  var renderLane = renderLanes & -renderLanes;
  	  renderLane =
  	    0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);
  	  return 0 !== (renderLane & (root.suspendedLanes | renderLanes))
  	    ? 0
  	    : renderLane;
  	}
  	function getBumpedLaneForHydrationByLane(lane) {
  	  switch (lane) {
  	    case 2:
  	      lane = 1;
  	      break;
  	    case 8:
  	      lane = 4;
  	      break;
  	    case 32:
  	      lane = 16;
  	      break;
  	    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:
  	      lane = 128;
  	      break;
  	    case 268435456:
  	      lane = 134217728;
  	      break;
  	    default:
  	      lane = 0;
  	  }
  	  return lane;
  	}
  	function lanesToEventPriority(lanes) {
  	  lanes &= -lanes;
  	  return 2 < lanes
  	    ? 8 < lanes
  	      ? 0 !== (lanes & 134217727)
  	        ? 32
  	        : 268435456
  	      : 8
  	    : 2;
  	}
  	function resolveUpdatePriority() {
  	  var updatePriority = ReactDOMSharedInternals.p;
  	  if (0 !== updatePriority) return updatePriority;
  	  updatePriority = window.event;
  	  return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);
  	}
  	function runWithPriority(priority, fn) {
  	  var previousPriority = ReactDOMSharedInternals.p;
  	  try {
  	    return (ReactDOMSharedInternals.p = priority), fn();
  	  } finally {
  	    ReactDOMSharedInternals.p = previousPriority;
  	  }
  	}
  	var randomKey = Math.random().toString(36).slice(2),
  	  internalInstanceKey = "__reactFiber$" + randomKey,
  	  internalPropsKey = "__reactProps$" + randomKey,
  	  internalContainerInstanceKey = "__reactContainer$" + randomKey,
  	  internalEventHandlersKey = "__reactEvents$" + randomKey,
  	  internalEventHandlerListenersKey = "__reactListeners$" + randomKey,
  	  internalEventHandlesSetKey = "__reactHandles$" + randomKey,
  	  internalRootNodeResourcesKey = "__reactResources$" + randomKey,
  	  internalHoistableMarker = "__reactMarker$" + randomKey;
  	function detachDeletedInstance(node) {
  	  delete node[internalInstanceKey];
  	  delete node[internalPropsKey];
  	  delete node[internalEventHandlersKey];
  	  delete node[internalEventHandlerListenersKey];
  	  delete node[internalEventHandlesSetKey];
  	}
  	function getClosestInstanceFromNode(targetNode) {
  	  var targetInst = targetNode[internalInstanceKey];
  	  if (targetInst) return targetInst;
  	  for (var parentNode = targetNode.parentNode; parentNode; ) {
  	    if (
  	      (targetInst =
  	        parentNode[internalContainerInstanceKey] ||
  	        parentNode[internalInstanceKey])
  	    ) {
  	      parentNode = targetInst.alternate;
  	      if (
  	        null !== targetInst.child ||
  	        (null !== parentNode && null !== parentNode.child)
  	      )
  	        for (
  	          targetNode = getParentHydrationBoundary(targetNode);
  	          null !== targetNode;

  	        ) {
  	          if ((parentNode = targetNode[internalInstanceKey])) return parentNode;
  	          targetNode = getParentHydrationBoundary(targetNode);
  	        }
  	      return targetInst;
  	    }
  	    targetNode = parentNode;
  	    parentNode = targetNode.parentNode;
  	  }
  	  return null;
  	}
  	function getInstanceFromNode(node) {
  	  if (
  	    (node = node[internalInstanceKey] || node[internalContainerInstanceKey])
  	  ) {
  	    var tag = node.tag;
  	    if (
  	      5 === tag ||
  	      6 === tag ||
  	      13 === tag ||
  	      31 === tag ||
  	      26 === tag ||
  	      27 === tag ||
  	      3 === tag
  	    )
  	      return node;
  	  }
  	  return null;
  	}
  	function getNodeFromInstance(inst) {
  	  var tag = inst.tag;
  	  if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;
  	  throw Error(formatProdErrorMessage(33));
  	}
  	function getResourcesFromRoot(root) {
  	  var resources = root[internalRootNodeResourcesKey];
  	  resources ||
  	    (resources = root[internalRootNodeResourcesKey] =
  	      { hoistableStyles: new Map(), hoistableScripts: new Map() });
  	  return resources;
  	}
  	function markNodeAsHoistable(node) {
  	  node[internalHoistableMarker] = true;
  	}
  	var allNativeEvents = new Set(),
  	  registrationNameDependencies = {};
  	function registerTwoPhaseEvent(registrationName, dependencies) {
  	  registerDirectEvent(registrationName, dependencies);
  	  registerDirectEvent(registrationName + "Capture", dependencies);
  	}
  	function registerDirectEvent(registrationName, dependencies) {
  	  registrationNameDependencies[registrationName] = dependencies;
  	  for (
  	    registrationName = 0;
  	    registrationName < dependencies.length;
  	    registrationName++
  	  )
  	    allNativeEvents.add(dependencies[registrationName]);
  	}
  	var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
  	    "^[: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]*$"
  	  ),
  	  illegalAttributeNameCache = {},
  	  validatedAttributeNameCache = {};
  	function isAttributeNameSafe(attributeName) {
  	  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
  	    return true;
  	  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false;
  	  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
  	    return (validatedAttributeNameCache[attributeName] = true);
  	  illegalAttributeNameCache[attributeName] = true;
  	  return false;
  	}
  	function setValueForAttribute(node, name, value) {
  	  if (isAttributeNameSafe(name))
  	    if (null === value) node.removeAttribute(name);
  	    else {
  	      switch (typeof value) {
  	        case "undefined":
  	        case "function":
  	        case "symbol":
  	          node.removeAttribute(name);
  	          return;
  	        case "boolean":
  	          var prefix$10 = name.toLowerCase().slice(0, 5);
  	          if ("data-" !== prefix$10 && "aria-" !== prefix$10) {
  	            node.removeAttribute(name);
  	            return;
  	          }
  	      }
  	      node.setAttribute(name, "" + value);
  	    }
  	}
  	function setValueForKnownAttribute(node, name, value) {
  	  if (null === value) node.removeAttribute(name);
  	  else {
  	    switch (typeof value) {
  	      case "undefined":
  	      case "function":
  	      case "symbol":
  	      case "boolean":
  	        node.removeAttribute(name);
  	        return;
  	    }
  	    node.setAttribute(name, "" + value);
  	  }
  	}
  	function setValueForNamespacedAttribute(node, namespace, name, value) {
  	  if (null === value) node.removeAttribute(name);
  	  else {
  	    switch (typeof value) {
  	      case "undefined":
  	      case "function":
  	      case "symbol":
  	      case "boolean":
  	        node.removeAttribute(name);
  	        return;
  	    }
  	    node.setAttributeNS(namespace, name, "" + value);
  	  }
  	}
  	function getToStringValue(value) {
  	  switch (typeof value) {
  	    case "bigint":
  	    case "boolean":
  	    case "number":
  	    case "string":
  	    case "undefined":
  	      return value;
  	    case "object":
  	      return value;
  	    default:
  	      return "";
  	  }
  	}
  	function isCheckable(elem) {
  	  var type = elem.type;
  	  return (
  	    (elem = elem.nodeName) &&
  	    "input" === elem.toLowerCase() &&
  	    ("checkbox" === type || "radio" === type)
  	  );
  	}
  	function trackValueOnNode(node, valueField, currentValue) {
  	  var descriptor = Object.getOwnPropertyDescriptor(
  	    node.constructor.prototype,
  	    valueField
  	  );
  	  if (
  	    !node.hasOwnProperty(valueField) &&
  	    "undefined" !== typeof descriptor &&
  	    "function" === typeof descriptor.get &&
  	    "function" === typeof descriptor.set
  	  ) {
  	    var get = descriptor.get,
  	      set = descriptor.set;
  	    Object.defineProperty(node, valueField, {
  	      configurable: true,
  	      get: function () {
  	        return get.call(this);
  	      },
  	      set: function (value) {
  	        currentValue = "" + value;
  	        set.call(this, value);
  	      }
  	    });
  	    Object.defineProperty(node, valueField, {
  	      enumerable: descriptor.enumerable
  	    });
  	    return {
  	      getValue: function () {
  	        return currentValue;
  	      },
  	      setValue: function (value) {
  	        currentValue = "" + value;
  	      },
  	      stopTracking: function () {
  	        node._valueTracker = null;
  	        delete node[valueField];
  	      }
  	    };
  	  }
  	}
  	function track(node) {
  	  if (!node._valueTracker) {
  	    var valueField = isCheckable(node) ? "checked" : "value";
  	    node._valueTracker = trackValueOnNode(
  	      node,
  	      valueField,
  	      "" + node[valueField]
  	    );
  	  }
  	}
  	function updateValueIfChanged(node) {
  	  if (!node) return false;
  	  var tracker = node._valueTracker;
  	  if (!tracker) return true;
  	  var lastValue = tracker.getValue();
  	  var value = "";
  	  node &&
  	    (value = isCheckable(node)
  	      ? node.checked
  	        ? "true"
  	        : "false"
  	      : node.value);
  	  node = value;
  	  return node !== lastValue ? (tracker.setValue(node), true) : false;
  	}
  	function getActiveElement(doc) {
  	  doc = doc || ("undefined" !== typeof document ? document : void 0);
  	  if ("undefined" === typeof doc) return null;
  	  try {
  	    return doc.activeElement || doc.body;
  	  } catch (e) {
  	    return doc.body;
  	  }
  	}
  	var escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g;
  	function escapeSelectorAttributeValueInsideDoubleQuotes(value) {
  	  return value.replace(
  	    escapeSelectorAttributeValueInsideDoubleQuotesRegex,
  	    function (ch) {
  	      return "\\" + ch.charCodeAt(0).toString(16) + " ";
  	    }
  	  );
  	}
  	function updateInput(
  	  element,
  	  value,
  	  defaultValue,
  	  lastDefaultValue,
  	  checked,
  	  defaultChecked,
  	  type,
  	  name
  	) {
  	  element.name = "";
  	  null != type &&
  	  "function" !== typeof type &&
  	  "symbol" !== typeof type &&
  	  "boolean" !== typeof type
  	    ? (element.type = type)
  	    : element.removeAttribute("type");
  	  if (null != value)
  	    if ("number" === type) {
  	      if ((0 === value && "" === element.value) || element.value != value)
  	        element.value = "" + getToStringValue(value);
  	    } else
  	      element.value !== "" + getToStringValue(value) &&
  	        (element.value = "" + getToStringValue(value));
  	  else
  	    ("submit" !== type && "reset" !== type) || element.removeAttribute("value");
  	  null != value
  	    ? setDefaultValue(element, type, getToStringValue(value))
  	    : null != defaultValue
  	      ? setDefaultValue(element, type, getToStringValue(defaultValue))
  	      : null != lastDefaultValue && element.removeAttribute("value");
  	  null == checked &&
  	    null != defaultChecked &&
  	    (element.defaultChecked = !!defaultChecked);
  	  null != checked &&
  	    (element.checked =
  	      checked && "function" !== typeof checked && "symbol" !== typeof checked);
  	  null != name &&
  	  "function" !== typeof name &&
  	  "symbol" !== typeof name &&
  	  "boolean" !== typeof name
  	    ? (element.name = "" + getToStringValue(name))
  	    : element.removeAttribute("name");
  	}
  	function initInput(
  	  element,
  	  value,
  	  defaultValue,
  	  checked,
  	  defaultChecked,
  	  type,
  	  name,
  	  isHydrating
  	) {
  	  null != type &&
  	    "function" !== typeof type &&
  	    "symbol" !== typeof type &&
  	    "boolean" !== typeof type &&
  	    (element.type = type);
  	  if (null != value || null != defaultValue) {
  	    if (
  	      !(
  	        ("submit" !== type && "reset" !== type) ||
  	        (void 0 !== value && null !== value)
  	      )
  	    ) {
  	      track(element);
  	      return;
  	    }
  	    defaultValue =
  	      null != defaultValue ? "" + getToStringValue(defaultValue) : "";
  	    value = null != value ? "" + getToStringValue(value) : defaultValue;
  	    isHydrating || value === element.value || (element.value = value);
  	    element.defaultValue = value;
  	  }
  	  checked = null != checked ? checked : defaultChecked;
  	  checked =
  	    "function" !== typeof checked && "symbol" !== typeof checked && !!checked;
  	  element.checked = isHydrating ? element.checked : !!checked;
  	  element.defaultChecked = !!checked;
  	  null != name &&
  	    "function" !== typeof name &&
  	    "symbol" !== typeof name &&
  	    "boolean" !== typeof name &&
  	    (element.name = name);
  	  track(element);
  	}
  	function setDefaultValue(node, type, value) {
  	  ("number" === type && getActiveElement(node.ownerDocument) === node) ||
  	    node.defaultValue === "" + value ||
  	    (node.defaultValue = "" + value);
  	}
  	function updateOptions(node, multiple, propValue, setDefaultSelected) {
  	  node = node.options;
  	  if (multiple) {
  	    multiple = {};
  	    for (var i = 0; i < propValue.length; i++)
  	      multiple["$" + propValue[i]] = true;
  	    for (propValue = 0; propValue < node.length; propValue++)
  	      (i = multiple.hasOwnProperty("$" + node[propValue].value)),
  	        node[propValue].selected !== i && (node[propValue].selected = i),
  	        i && setDefaultSelected && (node[propValue].defaultSelected = true);
  	  } else {
  	    propValue = "" + getToStringValue(propValue);
  	    multiple = null;
  	    for (i = 0; i < node.length; i++) {
  	      if (node[i].value === propValue) {
  	        node[i].selected = true;
  	        setDefaultSelected && (node[i].defaultSelected = true);
  	        return;
  	      }
  	      null !== multiple || node[i].disabled || (multiple = node[i]);
  	    }
  	    null !== multiple && (multiple.selected = true);
  	  }
  	}
  	function updateTextarea(element, value, defaultValue) {
  	  if (
  	    null != value &&
  	    ((value = "" + getToStringValue(value)),
  	    value !== element.value && (element.value = value),
  	    null == defaultValue)
  	  ) {
  	    element.defaultValue !== value && (element.defaultValue = value);
  	    return;
  	  }
  	  element.defaultValue =
  	    null != defaultValue ? "" + getToStringValue(defaultValue) : "";
  	}
  	function initTextarea(element, value, defaultValue, children) {
  	  if (null == value) {
  	    if (null != children) {
  	      if (null != defaultValue) throw Error(formatProdErrorMessage(92));
  	      if (isArrayImpl(children)) {
  	        if (1 < children.length) throw Error(formatProdErrorMessage(93));
  	        children = children[0];
  	      }
  	      defaultValue = children;
  	    }
  	    null == defaultValue && (defaultValue = "");
  	    value = defaultValue;
  	  }
  	  defaultValue = getToStringValue(value);
  	  element.defaultValue = defaultValue;
  	  children = element.textContent;
  	  children === defaultValue &&
  	    "" !== children &&
  	    null !== children &&
  	    (element.value = children);
  	  track(element);
  	}
  	function setTextContent(node, text) {
  	  if (text) {
  	    var firstChild = node.firstChild;
  	    if (
  	      firstChild &&
  	      firstChild === node.lastChild &&
  	      3 === firstChild.nodeType
  	    ) {
  	      firstChild.nodeValue = text;
  	      return;
  	    }
  	  }
  	  node.textContent = text;
  	}
  	var unitlessNumbers = new Set(
  	  "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
  	    " "
  	  )
  	);
  	function setValueForStyle(style, styleName, value) {
  	  var isCustomProperty = 0 === styleName.indexOf("--");
  	  null == value || "boolean" === typeof value || "" === value
  	    ? isCustomProperty
  	      ? style.setProperty(styleName, "")
  	      : "float" === styleName
  	        ? (style.cssFloat = "")
  	        : (style[styleName] = "")
  	    : isCustomProperty
  	      ? style.setProperty(styleName, value)
  	      : "number" !== typeof value ||
  	          0 === value ||
  	          unitlessNumbers.has(styleName)
  	        ? "float" === styleName
  	          ? (style.cssFloat = value)
  	          : (style[styleName] = ("" + value).trim())
  	        : (style[styleName] = value + "px");
  	}
  	function setValueForStyles(node, styles, prevStyles) {
  	  if (null != styles && "object" !== typeof styles)
  	    throw Error(formatProdErrorMessage(62));
  	  node = node.style;
  	  if (null != prevStyles) {
  	    for (var styleName in prevStyles)
  	      !prevStyles.hasOwnProperty(styleName) ||
  	        (null != styles && styles.hasOwnProperty(styleName)) ||
  	        (0 === styleName.indexOf("--")
  	          ? node.setProperty(styleName, "")
  	          : "float" === styleName
  	            ? (node.cssFloat = "")
  	            : (node[styleName] = ""));
  	    for (var styleName$16 in styles)
  	      (styleName = styles[styleName$16]),
  	        styles.hasOwnProperty(styleName$16) &&
  	          prevStyles[styleName$16] !== styleName &&
  	          setValueForStyle(node, styleName$16, styleName);
  	  } else
  	    for (var styleName$17 in styles)
  	      styles.hasOwnProperty(styleName$17) &&
  	        setValueForStyle(node, styleName$17, styles[styleName$17]);
  	}
  	function isCustomElement(tagName) {
  	  if (-1 === tagName.indexOf("-")) return false;
  	  switch (tagName) {
  	    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 aliases = new Map([
  	    ["acceptCharset", "accept-charset"],
  	    ["htmlFor", "for"],
  	    ["httpEquiv", "http-equiv"],
  	    ["crossOrigin", "crossorigin"],
  	    ["accentHeight", "accent-height"],
  	    ["alignmentBaseline", "alignment-baseline"],
  	    ["arabicForm", "arabic-form"],
  	    ["baselineShift", "baseline-shift"],
  	    ["capHeight", "cap-height"],
  	    ["clipPath", "clip-path"],
  	    ["clipRule", "clip-rule"],
  	    ["colorInterpolation", "color-interpolation"],
  	    ["colorInterpolationFilters", "color-interpolation-filters"],
  	    ["colorProfile", "color-profile"],
  	    ["colorRendering", "color-rendering"],
  	    ["dominantBaseline", "dominant-baseline"],
  	    ["enableBackground", "enable-background"],
  	    ["fillOpacity", "fill-opacity"],
  	    ["fillRule", "fill-rule"],
  	    ["floodColor", "flood-color"],
  	    ["floodOpacity", "flood-opacity"],
  	    ["fontFamily", "font-family"],
  	    ["fontSize", "font-size"],
  	    ["fontSizeAdjust", "font-size-adjust"],
  	    ["fontStretch", "font-stretch"],
  	    ["fontStyle", "font-style"],
  	    ["fontVariant", "font-variant"],
  	    ["fontWeight", "font-weight"],
  	    ["glyphName", "glyph-name"],
  	    ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
  	    ["glyphOrientationVertical", "glyph-orientation-vertical"],
  	    ["horizAdvX", "horiz-adv-x"],
  	    ["horizOriginX", "horiz-origin-x"],
  	    ["imageRendering", "image-rendering"],
  	    ["letterSpacing", "letter-spacing"],
  	    ["lightingColor", "lighting-color"],
  	    ["markerEnd", "marker-end"],
  	    ["markerMid", "marker-mid"],
  	    ["markerStart", "marker-start"],
  	    ["overlinePosition", "overline-position"],
  	    ["overlineThickness", "overline-thickness"],
  	    ["paintOrder", "paint-order"],
  	    ["panose-1", "panose-1"],
  	    ["pointerEvents", "pointer-events"],
  	    ["renderingIntent", "rendering-intent"],
  	    ["shapeRendering", "shape-rendering"],
  	    ["stopColor", "stop-color"],
  	    ["stopOpacity", "stop-opacity"],
  	    ["strikethroughPosition", "strikethrough-position"],
  	    ["strikethroughThickness", "strikethrough-thickness"],
  	    ["strokeDasharray", "stroke-dasharray"],
  	    ["strokeDashoffset", "stroke-dashoffset"],
  	    ["strokeLinecap", "stroke-linecap"],
  	    ["strokeLinejoin", "stroke-linejoin"],
  	    ["strokeMiterlimit", "stroke-miterlimit"],
  	    ["strokeOpacity", "stroke-opacity"],
  	    ["strokeWidth", "stroke-width"],
  	    ["textAnchor", "text-anchor"],
  	    ["textDecoration", "text-decoration"],
  	    ["textRendering", "text-rendering"],
  	    ["transformOrigin", "transform-origin"],
  	    ["underlinePosition", "underline-position"],
  	    ["underlineThickness", "underline-thickness"],
  	    ["unicodeBidi", "unicode-bidi"],
  	    ["unicodeRange", "unicode-range"],
  	    ["unitsPerEm", "units-per-em"],
  	    ["vAlphabetic", "v-alphabetic"],
  	    ["vHanging", "v-hanging"],
  	    ["vIdeographic", "v-ideographic"],
  	    ["vMathematical", "v-mathematical"],
  	    ["vectorEffect", "vector-effect"],
  	    ["vertAdvY", "vert-adv-y"],
  	    ["vertOriginX", "vert-origin-x"],
  	    ["vertOriginY", "vert-origin-y"],
  	    ["wordSpacing", "word-spacing"],
  	    ["writingMode", "writing-mode"],
  	    ["xmlnsXlink", "xmlns:xlink"],
  	    ["xHeight", "x-height"]
  	  ]),
  	  isJavaScriptProtocol =
  	    /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
  	function sanitizeURL(url) {
  	  return isJavaScriptProtocol.test("" + url)
  	    ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
  	    : url;
  	}
  	function noop$1() {}
  	var currentReplayingEvent = null;
  	function getEventTarget(nativeEvent) {
  	  nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
  	  nativeEvent.correspondingUseElement &&
  	    (nativeEvent = nativeEvent.correspondingUseElement);
  	  return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;
  	}
  	var restoreTarget = null,
  	  restoreQueue = null;
  	function restoreStateOfTarget(target) {
  	  var internalInstance = getInstanceFromNode(target);
  	  if (internalInstance && (target = internalInstance.stateNode)) {
  	    var props = target[internalPropsKey] || null;
  	    a: switch (((target = internalInstance.stateNode), internalInstance.type)) {
  	      case "input":
  	        updateInput(
  	          target,
  	          props.value,
  	          props.defaultValue,
  	          props.defaultValue,
  	          props.checked,
  	          props.defaultChecked,
  	          props.type,
  	          props.name
  	        );
  	        internalInstance = props.name;
  	        if ("radio" === props.type && null != internalInstance) {
  	          for (props = target; props.parentNode; ) props = props.parentNode;
  	          props = props.querySelectorAll(
  	            'input[name="' +
  	              escapeSelectorAttributeValueInsideDoubleQuotes(
  	                "" + internalInstance
  	              ) +
  	              '"][type="radio"]'
  	          );
  	          for (
  	            internalInstance = 0;
  	            internalInstance < props.length;
  	            internalInstance++
  	          ) {
  	            var otherNode = props[internalInstance];
  	            if (otherNode !== target && otherNode.form === target.form) {
  	              var otherProps = otherNode[internalPropsKey] || null;
  	              if (!otherProps) throw Error(formatProdErrorMessage(90));
  	              updateInput(
  	                otherNode,
  	                otherProps.value,
  	                otherProps.defaultValue,
  	                otherProps.defaultValue,
  	                otherProps.checked,
  	                otherProps.defaultChecked,
  	                otherProps.type,
  	                otherProps.name
  	              );
  	            }
  	          }
  	          for (
  	            internalInstance = 0;
  	            internalInstance < props.length;
  	            internalInstance++
  	          )
  	            (otherNode = props[internalInstance]),
  	              otherNode.form === target.form && updateValueIfChanged(otherNode);
  	        }
  	        break a;
  	      case "textarea":
  	        updateTextarea(target, props.value, props.defaultValue);
  	        break a;
  	      case "select":
  	        (internalInstance = props.value),
  	          null != internalInstance &&
  	            updateOptions(target, !!props.multiple, internalInstance, false);
  	    }
  	  }
  	}
  	var isInsideEventHandler = false;
  	function batchedUpdates$1(fn, a, b) {
  	  if (isInsideEventHandler) return fn(a, b);
  	  isInsideEventHandler = true;
  	  try {
  	    var JSCompiler_inline_result = fn(a);
  	    return JSCompiler_inline_result;
  	  } finally {
  	    if (
  	      ((isInsideEventHandler = false),
  	      null !== restoreTarget || null !== restoreQueue)
  	    )
  	      if (
  	        (flushSyncWork$1(),
  	        restoreTarget &&
  	          ((a = restoreTarget),
  	          (fn = restoreQueue),
  	          (restoreQueue = restoreTarget = null),
  	          restoreStateOfTarget(a),
  	          fn))
  	      )
  	        for (a = 0; a < fn.length; a++) restoreStateOfTarget(fn[a]);
  	  }
  	}
  	function getListener(inst, registrationName) {
  	  var stateNode = inst.stateNode;
  	  if (null === stateNode) return null;
  	  var props = stateNode[internalPropsKey] || null;
  	  if (null === props) return null;
  	  stateNode = props[registrationName];
  	  a: switch (registrationName) {
  	    case "onClick":
  	    case "onClickCapture":
  	    case "onDoubleClick":
  	    case "onDoubleClickCapture":
  	    case "onMouseDown":
  	    case "onMouseDownCapture":
  	    case "onMouseMove":
  	    case "onMouseMoveCapture":
  	    case "onMouseUp":
  	    case "onMouseUpCapture":
  	    case "onMouseEnter":
  	      (props = !props.disabled) ||
  	        ((inst = inst.type),
  	        (props = !(
  	          "button" === inst ||
  	          "input" === inst ||
  	          "select" === inst ||
  	          "textarea" === inst
  	        )));
  	      inst = !props;
  	      break a;
  	    default:
  	      inst = false;
  	  }
  	  if (inst) return null;
  	  if (stateNode && "function" !== typeof stateNode)
  	    throw Error(
  	      formatProdErrorMessage(231, registrationName, typeof stateNode)
  	    );
  	  return stateNode;
  	}
  	var canUseDOM = !(
  	    "undefined" === typeof window ||
  	    "undefined" === typeof window.document ||
  	    "undefined" === typeof window.document.createElement
  	  ),
  	  passiveBrowserEventsSupported = false;
  	if (canUseDOM)
  	  try {
  	    var options = {};
  	    Object.defineProperty(options, "passive", {
  	      get: function () {
  	        passiveBrowserEventsSupported = !0;
  	      }
  	    });
  	    window.addEventListener("test", options, options);
  	    window.removeEventListener("test", options, options);
  	  } catch (e) {
  	    passiveBrowserEventsSupported = false;
  	  }
  	var root = null,
  	  startText = null,
  	  fallbackText = null;
  	function getData() {
  	  if (fallbackText) return fallbackText;
  	  var start,
  	    startValue = startText,
  	    startLength = startValue.length,
  	    end,
  	    endValue = "value" in root ? root.value : root.textContent,
  	    endLength = endValue.length;
  	  for (
  	    start = 0;
  	    start < startLength && startValue[start] === endValue[start];
  	    start++
  	  );
  	  var minEnd = startLength - start;
  	  for (
  	    end = 1;
  	    end <= minEnd &&
  	    startValue[startLength - end] === endValue[endLength - end];
  	    end++
  	  );
  	  return (fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0));
  	}
  	function getEventCharCode(nativeEvent) {
  	  var keyCode = nativeEvent.keyCode;
  	  "charCode" in nativeEvent
  	    ? ((nativeEvent = nativeEvent.charCode),
  	      0 === nativeEvent && 13 === keyCode && (nativeEvent = 13))
  	    : (nativeEvent = keyCode);
  	  10 === nativeEvent && (nativeEvent = 13);
  	  return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;
  	}
  	function functionThatReturnsTrue() {
  	  return true;
  	}
  	function functionThatReturnsFalse() {
  	  return false;
  	}
  	function createSyntheticEvent(Interface) {
  	  function SyntheticBaseEvent(
  	    reactName,
  	    reactEventType,
  	    targetInst,
  	    nativeEvent,
  	    nativeEventTarget
  	  ) {
  	    this._reactName = reactName;
  	    this._targetInst = targetInst;
  	    this.type = reactEventType;
  	    this.nativeEvent = nativeEvent;
  	    this.target = nativeEventTarget;
  	    this.currentTarget = null;
  	    for (var propName in Interface)
  	      Interface.hasOwnProperty(propName) &&
  	        ((reactName = Interface[propName]),
  	        (this[propName] = reactName
  	          ? reactName(nativeEvent)
  	          : nativeEvent[propName]));
  	    this.isDefaultPrevented = (
  	      null != nativeEvent.defaultPrevented
  	        ? nativeEvent.defaultPrevented
  	        : false === nativeEvent.returnValue
  	    )
  	      ? functionThatReturnsTrue
  	      : functionThatReturnsFalse;
  	    this.isPropagationStopped = functionThatReturnsFalse;
  	    return this;
  	  }
  	  assign(SyntheticBaseEvent.prototype, {
  	    preventDefault: function () {
  	      this.defaultPrevented = true;
  	      var event = this.nativeEvent;
  	      event &&
  	        (event.preventDefault
  	          ? event.preventDefault()
  	          : "unknown" !== typeof event.returnValue && (event.returnValue = false),
  	        (this.isDefaultPrevented = functionThatReturnsTrue));
  	    },
  	    stopPropagation: function () {
  	      var event = this.nativeEvent;
  	      event &&
  	        (event.stopPropagation
  	          ? event.stopPropagation()
  	          : "unknown" !== typeof event.cancelBubble &&
  	            (event.cancelBubble = true),
  	        (this.isPropagationStopped = functionThatReturnsTrue));
  	    },
  	    persist: function () {},
  	    isPersistent: functionThatReturnsTrue
  	  });
  	  return SyntheticBaseEvent;
  	}
  	var EventInterface = {
  	    eventPhase: 0,
  	    bubbles: 0,
  	    cancelable: 0,
  	    timeStamp: function (event) {
  	      return event.timeStamp || Date.now();
  	    },
  	    defaultPrevented: 0,
  	    isTrusted: 0
  	  },
  	  SyntheticEvent = createSyntheticEvent(EventInterface),
  	  UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }),
  	  SyntheticUIEvent = createSyntheticEvent(UIEventInterface),
  	  lastMovementX,
  	  lastMovementY,
  	  lastMouseEvent,
  	  MouseEventInterface = assign({}, UIEventInterface, {
  	    screenX: 0,
  	    screenY: 0,
  	    clientX: 0,
  	    clientY: 0,
  	    pageX: 0,
  	    pageY: 0,
  	    ctrlKey: 0,
  	    shiftKey: 0,
  	    altKey: 0,
  	    metaKey: 0,
  	    getModifierState: getEventModifierState,
  	    button: 0,
  	    buttons: 0,
  	    relatedTarget: function (event) {
  	      return void 0 === event.relatedTarget
  	        ? event.fromElement === event.srcElement
  	          ? event.toElement
  	          : event.fromElement
  	        : event.relatedTarget;
  	    },
  	    movementX: function (event) {
  	      if ("movementX" in event) return event.movementX;
  	      event !== lastMouseEvent &&
  	        (lastMouseEvent && "mousemove" === event.type
  	          ? ((lastMovementX = event.screenX - lastMouseEvent.screenX),
  	            (lastMovementY = event.screenY - lastMouseEvent.screenY))
  	          : (lastMovementY = lastMovementX = 0),
  	        (lastMouseEvent = event));
  	      return lastMovementX;
  	    },
  	    movementY: function (event) {
  	      return "movementY" in event ? event.movementY : lastMovementY;
  	    }
  	  }),
  	  SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface),
  	  DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }),
  	  SyntheticDragEvent = createSyntheticEvent(DragEventInterface),
  	  FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }),
  	  SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface),
  	  AnimationEventInterface = assign({}, EventInterface, {
  	    animationName: 0,
  	    elapsedTime: 0,
  	    pseudoElement: 0
  	  }),
  	  SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface),
  	  ClipboardEventInterface = assign({}, EventInterface, {
  	    clipboardData: function (event) {
  	      return "clipboardData" in event
  	        ? event.clipboardData
  	        : window.clipboardData;
  	    }
  	  }),
  	  SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface),
  	  CompositionEventInterface = assign({}, EventInterface, { data: 0 }),
  	  SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface),
  	  normalizeKey = {
  	    Esc: "Escape",
  	    Spacebar: " ",
  	    Left: "ArrowLeft",
  	    Up: "ArrowUp",
  	    Right: "ArrowRight",
  	    Down: "ArrowDown",
  	    Del: "Delete",
  	    Win: "OS",
  	    Menu: "ContextMenu",
  	    Apps: "ContextMenu",
  	    Scroll: "ScrollLock",
  	    MozPrintableKey: "Unidentified"
  	  },
  	  translateToKey = {
  	    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"
  	  },
  	  modifierKeyToProp = {
  	    Alt: "altKey",
  	    Control: "ctrlKey",
  	    Meta: "metaKey",
  	    Shift: "shiftKey"
  	  };
  	function modifierStateGetter(keyArg) {
  	  var nativeEvent = this.nativeEvent;
  	  return nativeEvent.getModifierState
  	    ? nativeEvent.getModifierState(keyArg)
  	    : (keyArg = modifierKeyToProp[keyArg])
  	      ? !!nativeEvent[keyArg]
  	      : false;
  	}
  	function getEventModifierState() {
  	  return modifierStateGetter;
  	}
  	var KeyboardEventInterface = assign({}, UIEventInterface, {
  	    key: function (nativeEvent) {
  	      if (nativeEvent.key) {
  	        var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
  	        if ("Unidentified" !== key) return key;
  	      }
  	      return "keypress" === nativeEvent.type
  	        ? ((nativeEvent = getEventCharCode(nativeEvent)),
  	          13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent))
  	        : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type
  	          ? translateToKey[nativeEvent.keyCode] || "Unidentified"
  	          : "";
  	    },
  	    code: 0,
  	    location: 0,
  	    ctrlKey: 0,
  	    shiftKey: 0,
  	    altKey: 0,
  	    metaKey: 0,
  	    repeat: 0,
  	    locale: 0,
  	    getModifierState: getEventModifierState,
  	    charCode: function (event) {
  	      return "keypress" === event.type ? getEventCharCode(event) : 0;
  	    },
  	    keyCode: function (event) {
  	      return "keydown" === event.type || "keyup" === event.type
  	        ? event.keyCode
  	        : 0;
  	    },
  	    which: function (event) {
  	      return "keypress" === event.type
  	        ? getEventCharCode(event)
  	        : "keydown" === event.type || "keyup" === event.type
  	          ? event.keyCode
  	          : 0;
  	    }
  	  }),
  	  SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface),
  	  PointerEventInterface = assign({}, MouseEventInterface, {
  	    pointerId: 0,
  	    width: 0,
  	    height: 0,
  	    pressure: 0,
  	    tangentialPressure: 0,
  	    tiltX: 0,
  	    tiltY: 0,
  	    twist: 0,
  	    pointerType: 0,
  	    isPrimary: 0
  	  }),
  	  SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface),
  	  TouchEventInterface = assign({}, UIEventInterface, {
  	    touches: 0,
  	    targetTouches: 0,
  	    changedTouches: 0,
  	    altKey: 0,
  	    metaKey: 0,
  	    ctrlKey: 0,
  	    shiftKey: 0,
  	    getModifierState: getEventModifierState
  	  }),
  	  SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface),
  	  TransitionEventInterface = assign({}, EventInterface, {
  	    propertyName: 0,
  	    elapsedTime: 0,
  	    pseudoElement: 0
  	  }),
  	  SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface),
  	  WheelEventInterface = assign({}, MouseEventInterface, {
  	    deltaX: function (event) {
  	      return "deltaX" in event
  	        ? event.deltaX
  	        : "wheelDeltaX" in event
  	          ? -event.wheelDeltaX
  	          : 0;
  	    },
  	    deltaY: function (event) {
  	      return "deltaY" in event
  	        ? event.deltaY
  	        : "wheelDeltaY" in event
  	          ? -event.wheelDeltaY
  	          : "wheelDelta" in event
  	            ? -event.wheelDelta
  	            : 0;
  	    },
  	    deltaZ: 0,
  	    deltaMode: 0
  	  }),
  	  SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface),
  	  ToggleEventInterface = assign({}, EventInterface, {
  	    newState: 0,
  	    oldState: 0
  	  }),
  	  SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface),
  	  END_KEYCODES = [9, 13, 27, 32],
  	  canUseCompositionEvent = canUseDOM && "CompositionEvent" in window,
  	  documentMode = null;
  	canUseDOM &&
  	  "documentMode" in document &&
  	  (documentMode = document.documentMode);
  	var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode,
  	  useFallbackCompositionData =
  	    canUseDOM &&
  	    (!canUseCompositionEvent ||
  	      (documentMode && 8 < documentMode && 11 >= documentMode)),
  	  SPACEBAR_CHAR = String.fromCharCode(32),
  	  hasSpaceKeypress = false;
  	function isFallbackCompositionEnd(domEventName, nativeEvent) {
  	  switch (domEventName) {
  	    case "keyup":
  	      return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);
  	    case "keydown":
  	      return 229 !== nativeEvent.keyCode;
  	    case "keypress":
  	    case "mousedown":
  	    case "focusout":
  	      return true;
  	    default:
  	      return false;
  	  }
  	}
  	function getDataFromCustomEvent(nativeEvent) {
  	  nativeEvent = nativeEvent.detail;
  	  return "object" === typeof nativeEvent && "data" in nativeEvent
  	    ? nativeEvent.data
  	    : null;
  	}
  	var isComposing = false;
  	function getNativeBeforeInputChars(domEventName, nativeEvent) {
  	  switch (domEventName) {
  	    case "compositionend":
  	      return getDataFromCustomEvent(nativeEvent);
  	    case "keypress":
  	      if (32 !== nativeEvent.which) return null;
  	      hasSpaceKeypress = true;
  	      return SPACEBAR_CHAR;
  	    case "textInput":
  	      return (
  	        (domEventName = nativeEvent.data),
  	        domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName
  	      );
  	    default:
  	      return null;
  	  }
  	}
  	function getFallbackBeforeInputChars(domEventName, nativeEvent) {
  	  if (isComposing)
  	    return "compositionend" === domEventName ||
  	      (!canUseCompositionEvent &&
  	        isFallbackCompositionEnd(domEventName, nativeEvent))
  	      ? ((domEventName = getData()),
  	        (fallbackText = startText = root = null),
  	        (isComposing = false),
  	        domEventName)
  	      : null;
  	  switch (domEventName) {
  	    case "paste":
  	      return null;
  	    case "keypress":
  	      if (
  	        !(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) ||
  	        (nativeEvent.ctrlKey && nativeEvent.altKey)
  	      ) {
  	        if (nativeEvent.char && 1 < nativeEvent.char.length)
  	          return nativeEvent.char;
  	        if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);
  	      }
  	      return null;
  	    case "compositionend":
  	      return useFallbackCompositionData && "ko" !== nativeEvent.locale
  	        ? null
  	        : nativeEvent.data;
  	    default:
  	      return null;
  	  }
  	}
  	var supportedInputTypes = {
  	  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 isTextInputElement(elem) {
  	  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  	  return "input" === nodeName
  	    ? !!supportedInputTypes[elem.type]
  	    : "textarea" === nodeName
  	      ? true
  	      : false;
  	}
  	function createAndAccumulateChangeEvent(
  	  dispatchQueue,
  	  inst,
  	  nativeEvent,
  	  target
  	) {
  	  restoreTarget
  	    ? restoreQueue
  	      ? restoreQueue.push(target)
  	      : (restoreQueue = [target])
  	    : (restoreTarget = target);
  	  inst = accumulateTwoPhaseListeners(inst, "onChange");
  	  0 < inst.length &&
  	    ((nativeEvent = new SyntheticEvent(
  	      "onChange",
  	      "change",
  	      null,
  	      nativeEvent,
  	      target
  	    )),
  	    dispatchQueue.push({ event: nativeEvent, listeners: inst }));
  	}
  	var activeElement$1 = null,
  	  activeElementInst$1 = null;
  	function runEventInBatch(dispatchQueue) {
  	  processDispatchQueue(dispatchQueue, 0);
  	}
  	function getInstIfValueChanged(targetInst) {
  	  var targetNode = getNodeFromInstance(targetInst);
  	  if (updateValueIfChanged(targetNode)) return targetInst;
  	}
  	function getTargetInstForChangeEvent(domEventName, targetInst) {
  	  if ("change" === domEventName) return targetInst;
  	}
  	var isInputEventSupported = false;
  	if (canUseDOM) {
  	  var JSCompiler_inline_result$jscomp$286;
  	  if (canUseDOM) {
  	    var isSupported$jscomp$inline_427 = "oninput" in document;
  	    if (!isSupported$jscomp$inline_427) {
  	      var element$jscomp$inline_428 = document.createElement("div");
  	      element$jscomp$inline_428.setAttribute("oninput", "return;");
  	      isSupported$jscomp$inline_427 =
  	        "function" === typeof element$jscomp$inline_428.oninput;
  	    }
  	    JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_427;
  	  } else JSCompiler_inline_result$jscomp$286 = false;
  	  isInputEventSupported =
  	    JSCompiler_inline_result$jscomp$286 &&
  	    (!document.documentMode || 9 < document.documentMode);
  	}
  	function stopWatchingForValueChange() {
  	  activeElement$1 &&
  	    (activeElement$1.detachEvent("onpropertychange", handlePropertyChange),
  	    (activeElementInst$1 = activeElement$1 = null));
  	}
  	function handlePropertyChange(nativeEvent) {
  	  if (
  	    "value" === nativeEvent.propertyName &&
  	    getInstIfValueChanged(activeElementInst$1)
  	  ) {
  	    var dispatchQueue = [];
  	    createAndAccumulateChangeEvent(
  	      dispatchQueue,
  	      activeElementInst$1,
  	      nativeEvent,
  	      getEventTarget(nativeEvent)
  	    );
  	    batchedUpdates$1(runEventInBatch, dispatchQueue);
  	  }
  	}
  	function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
  	  "focusin" === domEventName
  	    ? (stopWatchingForValueChange(),
  	      (activeElement$1 = target),
  	      (activeElementInst$1 = targetInst),
  	      activeElement$1.attachEvent("onpropertychange", handlePropertyChange))
  	    : "focusout" === domEventName && stopWatchingForValueChange();
  	}
  	function getTargetInstForInputEventPolyfill(domEventName) {
  	  if (
  	    "selectionchange" === domEventName ||
  	    "keyup" === domEventName ||
  	    "keydown" === domEventName
  	  )
  	    return getInstIfValueChanged(activeElementInst$1);
  	}
  	function getTargetInstForClickEvent(domEventName, targetInst) {
  	  if ("click" === domEventName) return getInstIfValueChanged(targetInst);
  	}
  	function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
  	  if ("input" === domEventName || "change" === domEventName)
  	    return getInstIfValueChanged(targetInst);
  	}
  	function is(x, y) {
  	  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
  	}
  	var objectIs = "function" === typeof Object.is ? Object.is : is;
  	function shallowEqual(objA, objB) {
  	  if (objectIs(objA, objB)) return true;
  	  if (
  	    "object" !== typeof objA ||
  	    null === objA ||
  	    "object" !== typeof objB ||
  	    null === objB
  	  )
  	    return false;
  	  var keysA = Object.keys(objA),
  	    keysB = Object.keys(objB);
  	  if (keysA.length !== keysB.length) return false;
  	  for (keysB = 0; keysB < keysA.length; keysB++) {
  	    var currentKey = keysA[keysB];
  	    if (
  	      !hasOwnProperty.call(objB, currentKey) ||
  	      !objectIs(objA[currentKey], objB[currentKey])
  	    )
  	      return false;
  	  }
  	  return true;
  	}
  	function getLeafNode(node) {
  	  for (; node && node.firstChild; ) node = node.firstChild;
  	  return node;
  	}
  	function getNodeForCharacterOffset(root, offset) {
  	  var node = getLeafNode(root);
  	  root = 0;
  	  for (var nodeEnd; node; ) {
  	    if (3 === node.nodeType) {
  	      nodeEnd = root + node.textContent.length;
  	      if (root <= offset && nodeEnd >= offset)
  	        return { node: node, offset: offset - root };
  	      root = nodeEnd;
  	    }
  	    a: {
  	      for (; node; ) {
  	        if (node.nextSibling) {
  	          node = node.nextSibling;
  	          break a;
  	        }
  	        node = node.parentNode;
  	      }
  	      node = void 0;
  	    }
  	    node = getLeafNode(node);
  	  }
  	}
  	function containsNode(outerNode, innerNode) {
  	  return outerNode && innerNode
  	    ? outerNode === innerNode
  	      ? true
  	      : outerNode && 3 === outerNode.nodeType
  	        ? false
  	        : innerNode && 3 === innerNode.nodeType
  	          ? containsNode(outerNode, innerNode.parentNode)
  	          : "contains" in outerNode
  	            ? outerNode.contains(innerNode)
  	            : outerNode.compareDocumentPosition
  	              ? !!(outerNode.compareDocumentPosition(innerNode) & 16)
  	              : false
  	    : false;
  	}
  	function getActiveElementDeep(containerInfo) {
  	  containerInfo =
  	    null != containerInfo &&
  	    null != containerInfo.ownerDocument &&
  	    null != containerInfo.ownerDocument.defaultView
  	      ? containerInfo.ownerDocument.defaultView
  	      : window;
  	  for (
  	    var element = getActiveElement(containerInfo.document);
  	    element instanceof containerInfo.HTMLIFrameElement;

  	  ) {
  	    try {
  	      var JSCompiler_inline_result =
  	        "string" === typeof element.contentWindow.location.href;
  	    } catch (err) {
  	      JSCompiler_inline_result = false;
  	    }
  	    if (JSCompiler_inline_result) containerInfo = element.contentWindow;
  	    else break;
  	    element = getActiveElement(containerInfo.document);
  	  }
  	  return element;
  	}
  	function hasSelectionCapabilities(elem) {
  	  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  	  return (
  	    nodeName &&
  	    (("input" === nodeName &&
  	      ("text" === elem.type ||
  	        "search" === elem.type ||
  	        "tel" === elem.type ||
  	        "url" === elem.type ||
  	        "password" === elem.type)) ||
  	      "textarea" === nodeName ||
  	      "true" === elem.contentEditable)
  	  );
  	}
  	var skipSelectionChangeEvent =
  	    canUseDOM && "documentMode" in document && 11 >= document.documentMode,
  	  activeElement = null,
  	  activeElementInst = null,
  	  lastSelection = null,
  	  mouseDown = false;
  	function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
  	  var doc =
  	    nativeEventTarget.window === nativeEventTarget
  	      ? nativeEventTarget.document
  	      : 9 === nativeEventTarget.nodeType
  	        ? nativeEventTarget
  	        : nativeEventTarget.ownerDocument;
  	  mouseDown ||
  	    null == activeElement ||
  	    activeElement !== getActiveElement(doc) ||
  	    ((doc = activeElement),
  	    "selectionStart" in doc && hasSelectionCapabilities(doc)
  	      ? (doc = { start: doc.selectionStart, end: doc.selectionEnd })
  	      : ((doc = (
  	          (doc.ownerDocument && doc.ownerDocument.defaultView) ||
  	          window
  	        ).getSelection()),
  	        (doc = {
  	          anchorNode: doc.anchorNode,
  	          anchorOffset: doc.anchorOffset,
  	          focusNode: doc.focusNode,
  	          focusOffset: doc.focusOffset
  	        })),
  	    (lastSelection && shallowEqual(lastSelection, doc)) ||
  	      ((lastSelection = doc),
  	      (doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect")),
  	      0 < doc.length &&
  	        ((nativeEvent = new SyntheticEvent(
  	          "onSelect",
  	          "select",
  	          null,
  	          nativeEvent,
  	          nativeEventTarget
  	        )),
  	        dispatchQueue.push({ event: nativeEvent, listeners: doc }),
  	        (nativeEvent.target = activeElement))));
  	}
  	function makePrefixMap(styleProp, eventName) {
  	  var prefixes = {};
  	  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  	  prefixes["Webkit" + styleProp] = "webkit" + eventName;
  	  prefixes["Moz" + styleProp] = "moz" + eventName;
  	  return prefixes;
  	}
  	var vendorPrefixes = {
  	    animationend: makePrefixMap("Animation", "AnimationEnd"),
  	    animationiteration: makePrefixMap("Animation", "AnimationIteration"),
  	    animationstart: makePrefixMap("Animation", "AnimationStart"),
  	    transitionrun: makePrefixMap("Transition", "TransitionRun"),
  	    transitionstart: makePrefixMap("Transition", "TransitionStart"),
  	    transitioncancel: makePrefixMap("Transition", "TransitionCancel"),
  	    transitionend: makePrefixMap("Transition", "TransitionEnd")
  	  },
  	  prefixedEventNames = {},
  	  style = {};
  	canUseDOM &&
  	  ((style = document.createElement("div").style),
  	  "AnimationEvent" in window ||
  	    (delete vendorPrefixes.animationend.animation,
  	    delete vendorPrefixes.animationiteration.animation,
  	    delete vendorPrefixes.animationstart.animation),
  	  "TransitionEvent" in window ||
  	    delete vendorPrefixes.transitionend.transition);
  	function getVendorPrefixedEventName(eventName) {
  	  if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
  	  if (!vendorPrefixes[eventName]) return eventName;
  	  var prefixMap = vendorPrefixes[eventName],
  	    styleProp;
  	  for (styleProp in prefixMap)
  	    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style)
  	      return (prefixedEventNames[eventName] = prefixMap[styleProp]);
  	  return eventName;
  	}
  	var ANIMATION_END = getVendorPrefixedEventName("animationend"),
  	  ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"),
  	  ANIMATION_START = getVendorPrefixedEventName("animationstart"),
  	  TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"),
  	  TRANSITION_START = getVendorPrefixedEventName("transitionstart"),
  	  TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"),
  	  TRANSITION_END = getVendorPrefixedEventName("transitionend"),
  	  topLevelEventsToReactNames = new Map(),
  	  simpleEventPluginEvents =
  	    "abort auxClick beforeToggle 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(
  	      " "
  	    );
  	simpleEventPluginEvents.push("scrollEnd");
  	function registerSimpleEvent(domEventName, reactName) {
  	  topLevelEventsToReactNames.set(domEventName, reactName);
  	  registerTwoPhaseEvent(reactName, [domEventName]);
  	}
  	var reportGlobalError =
  	    "function" === typeof reportError
  	      ? reportError
  	      : function (error) {
  	          if (
  	            "object" === typeof window &&
  	            "function" === typeof window.ErrorEvent
  	          ) {
  	            var event = new window.ErrorEvent("error", {
  	              bubbles: true,
  	              cancelable: true,
  	              message:
  	                "object" === typeof error &&
  	                null !== error &&
  	                "string" === typeof error.message
  	                  ? String(error.message)
  	                  : String(error),
  	              error: error
  	            });
  	            if (!window.dispatchEvent(event)) return;
  	          } else if (
  	            "object" === typeof process &&
  	            "function" === typeof process.emit
  	          ) {
  	            process.emit("uncaughtException", error);
  	            return;
  	          }
  	          console.error(error);
  	        },
  	  concurrentQueues = [],
  	  concurrentQueuesIndex = 0,
  	  concurrentlyUpdatedLanes = 0;
  	function finishQueueingConcurrentUpdates() {
  	  for (
  	    var endIndex = concurrentQueuesIndex,
  	      i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0);
  	    i < endIndex;

  	  ) {
  	    var fiber = concurrentQueues[i];
  	    concurrentQueues[i++] = null;
  	    var queue = concurrentQueues[i];
  	    concurrentQueues[i++] = null;
  	    var update = concurrentQueues[i];
  	    concurrentQueues[i++] = null;
  	    var lane = concurrentQueues[i];
  	    concurrentQueues[i++] = null;
  	    if (null !== queue && null !== update) {
  	      var pending = queue.pending;
  	      null === pending
  	        ? (update.next = update)
  	        : ((update.next = pending.next), (pending.next = update));
  	      queue.pending = update;
  	    }
  	    0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane);
  	  }
  	}
  	function enqueueUpdate$1(fiber, queue, update, lane) {
  	  concurrentQueues[concurrentQueuesIndex++] = fiber;
  	  concurrentQueues[concurrentQueuesIndex++] = queue;
  	  concurrentQueues[concurrentQueuesIndex++] = update;
  	  concurrentQueues[concurrentQueuesIndex++] = lane;
  	  concurrentlyUpdatedLanes |= lane;
  	  fiber.lanes |= lane;
  	  fiber = fiber.alternate;
  	  null !== fiber && (fiber.lanes |= lane);
  	}
  	function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
  	  enqueueUpdate$1(fiber, queue, update, lane);
  	  return getRootForUpdatedFiber(fiber);
  	}
  	function enqueueConcurrentRenderForLane(fiber, lane) {
  	  enqueueUpdate$1(fiber, null, null, lane);
  	  return getRootForUpdatedFiber(fiber);
  	}
  	function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) {
  	  sourceFiber.lanes |= lane;
  	  var alternate = sourceFiber.alternate;
  	  null !== alternate && (alternate.lanes |= lane);
  	  for (var isHidden = false, parent = sourceFiber.return; null !== parent; )
  	    (parent.childLanes |= lane),
  	      (alternate = parent.alternate),
  	      null !== alternate && (alternate.childLanes |= lane),
  	      22 === parent.tag &&
  	        ((sourceFiber = parent.stateNode),
  	        null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = true)),
  	      (sourceFiber = parent),
  	      (parent = parent.return);
  	  return 3 === sourceFiber.tag
  	    ? ((parent = sourceFiber.stateNode),
  	      isHidden &&
  	        null !== update &&
  	        ((isHidden = 31 - clz32(lane)),
  	        (sourceFiber = parent.hiddenUpdates),
  	        (alternate = sourceFiber[isHidden]),
  	        null === alternate
  	          ? (sourceFiber[isHidden] = [update])
  	          : alternate.push(update),
  	        (update.lane = lane | 536870912)),
  	      parent)
  	    : null;
  	}
  	function getRootForUpdatedFiber(sourceFiber) {
  	  if (50 < nestedUpdateCount)
  	    throw (
  	      ((nestedUpdateCount = 0),
  	      (rootWithNestedUpdates = null),
  	      Error(formatProdErrorMessage(185)))
  	    );
  	  for (var parent = sourceFiber.return; null !== parent; )
  	    (sourceFiber = parent), (parent = sourceFiber.return);
  	  return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;
  	}
  	var emptyContextObject = {};
  	function FiberNode(tag, pendingProps, key, mode) {
  	  this.tag = tag;
  	  this.key = key;
  	  this.sibling =
  	    this.child =
  	    this.return =
  	    this.stateNode =
  	    this.type =
  	    this.elementType =
  	      null;
  	  this.index = 0;
  	  this.refCleanup = this.ref = null;
  	  this.pendingProps = pendingProps;
  	  this.dependencies =
  	    this.memoizedState =
  	    this.updateQueue =
  	    this.memoizedProps =
  	      null;
  	  this.mode = mode;
  	  this.subtreeFlags = this.flags = 0;
  	  this.deletions = null;
  	  this.childLanes = this.lanes = 0;
  	  this.alternate = null;
  	}
  	function createFiberImplClass(tag, pendingProps, key, mode) {
  	  return new FiberNode(tag, pendingProps, key, mode);
  	}
  	function shouldConstruct(Component) {
  	  Component = Component.prototype;
  	  return !(!Component || !Component.isReactComponent);
  	}
  	function createWorkInProgress(current, pendingProps) {
  	  var workInProgress = current.alternate;
  	  null === workInProgress
  	    ? ((workInProgress = createFiberImplClass(
  	        current.tag,
  	        pendingProps,
  	        current.key,
  	        current.mode
  	      )),
  	      (workInProgress.elementType = current.elementType),
  	      (workInProgress.type = current.type),
  	      (workInProgress.stateNode = current.stateNode),
  	      (workInProgress.alternate = current),
  	      (current.alternate = workInProgress))
  	    : ((workInProgress.pendingProps = pendingProps),
  	      (workInProgress.type = current.type),
  	      (workInProgress.flags = 0),
  	      (workInProgress.subtreeFlags = 0),
  	      (workInProgress.deletions = null));
  	  workInProgress.flags = current.flags & 65011712;
  	  workInProgress.childLanes = current.childLanes;
  	  workInProgress.lanes = current.lanes;
  	  workInProgress.child = current.child;
  	  workInProgress.memoizedProps = current.memoizedProps;
  	  workInProgress.memoizedState = current.memoizedState;
  	  workInProgress.updateQueue = current.updateQueue;
  	  pendingProps = current.dependencies;
  	  workInProgress.dependencies =
  	    null === pendingProps
  	      ? null
  	      : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };
  	  workInProgress.sibling = current.sibling;
  	  workInProgress.index = current.index;
  	  workInProgress.ref = current.ref;
  	  workInProgress.refCleanup = current.refCleanup;
  	  return workInProgress;
  	}
  	function resetWorkInProgress(workInProgress, renderLanes) {
  	  workInProgress.flags &= 65011714;
  	  var current = workInProgress.alternate;
  	  null === current
  	    ? ((workInProgress.childLanes = 0),
  	      (workInProgress.lanes = renderLanes),
  	      (workInProgress.child = null),
  	      (workInProgress.subtreeFlags = 0),
  	      (workInProgress.memoizedProps = null),
  	      (workInProgress.memoizedState = null),
  	      (workInProgress.updateQueue = null),
  	      (workInProgress.dependencies = null),
  	      (workInProgress.stateNode = null))
  	    : ((workInProgress.childLanes = current.childLanes),
  	      (workInProgress.lanes = current.lanes),
  	      (workInProgress.child = current.child),
  	      (workInProgress.subtreeFlags = 0),
  	      (workInProgress.deletions = null),
  	      (workInProgress.memoizedProps = current.memoizedProps),
  	      (workInProgress.memoizedState = current.memoizedState),
  	      (workInProgress.updateQueue = current.updateQueue),
  	      (workInProgress.type = current.type),
  	      (renderLanes = current.dependencies),
  	      (workInProgress.dependencies =
  	        null === renderLanes
  	          ? null
  	          : {
  	              lanes: renderLanes.lanes,
  	              firstContext: renderLanes.firstContext
  	            }));
  	  return workInProgress;
  	}
  	function createFiberFromTypeAndProps(
  	  type,
  	  key,
  	  pendingProps,
  	  owner,
  	  mode,
  	  lanes
  	) {
  	  var fiberTag = 0;
  	  owner = type;
  	  if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
  	  else if ("string" === typeof type)
  	    fiberTag = isHostHoistableType(
  	      type,
  	      pendingProps,
  	      contextStackCursor.current
  	    )
  	      ? 26
  	      : "html" === type || "head" === type || "body" === type
  	        ? 27
  	        : 5;
  	  else
  	    a: switch (type) {
  	      case REACT_ACTIVITY_TYPE:
  	        return (
  	          (type = createFiberImplClass(31, pendingProps, key, mode)),
  	          (type.elementType = REACT_ACTIVITY_TYPE),
  	          (type.lanes = lanes),
  	          type
  	        );
  	      case REACT_FRAGMENT_TYPE:
  	        return createFiberFromFragment(pendingProps.children, mode, lanes, key);
  	      case REACT_STRICT_MODE_TYPE:
  	        fiberTag = 8;
  	        mode |= 24;
  	        break;
  	      case REACT_PROFILER_TYPE:
  	        return (
  	          (type = createFiberImplClass(12, pendingProps, key, mode | 2)),
  	          (type.elementType = REACT_PROFILER_TYPE),
  	          (type.lanes = lanes),
  	          type
  	        );
  	      case REACT_SUSPENSE_TYPE:
  	        return (
  	          (type = createFiberImplClass(13, pendingProps, key, mode)),
  	          (type.elementType = REACT_SUSPENSE_TYPE),
  	          (type.lanes = lanes),
  	          type
  	        );
  	      case REACT_SUSPENSE_LIST_TYPE:
  	        return (
  	          (type = createFiberImplClass(19, pendingProps, key, mode)),
  	          (type.elementType = REACT_SUSPENSE_LIST_TYPE),
  	          (type.lanes = lanes),
  	          type
  	        );
  	      default:
  	        if ("object" === typeof type && null !== type)
  	          switch (type.$$typeof) {
  	            case REACT_CONTEXT_TYPE:
  	              fiberTag = 10;
  	              break a;
  	            case REACT_CONSUMER_TYPE:
  	              fiberTag = 9;
  	              break a;
  	            case REACT_FORWARD_REF_TYPE:
  	              fiberTag = 11;
  	              break a;
  	            case REACT_MEMO_TYPE:
  	              fiberTag = 14;
  	              break a;
  	            case REACT_LAZY_TYPE:
  	              fiberTag = 16;
  	              owner = null;
  	              break a;
  	          }
  	        fiberTag = 29;
  	        pendingProps = Error(
  	          formatProdErrorMessage(130, null === type ? "null" : typeof type, "")
  	        );
  	        owner = null;
  	    }
  	  key = createFiberImplClass(fiberTag, pendingProps, key, mode);
  	  key.elementType = type;
  	  key.type = owner;
  	  key.lanes = lanes;
  	  return key;
  	}
  	function createFiberFromFragment(elements, mode, lanes, key) {
  	  elements = createFiberImplClass(7, elements, key, mode);
  	  elements.lanes = lanes;
  	  return elements;
  	}
  	function createFiberFromText(content, mode, lanes) {
  	  content = createFiberImplClass(6, content, null, mode);
  	  content.lanes = lanes;
  	  return content;
  	}
  	function createFiberFromDehydratedFragment(dehydratedNode) {
  	  var fiber = createFiberImplClass(18, null, null, 0);
  	  fiber.stateNode = dehydratedNode;
  	  return fiber;
  	}
  	function createFiberFromPortal(portal, mode, lanes) {
  	  mode = createFiberImplClass(
  	    4,
  	    null !== portal.children ? portal.children : [],
  	    portal.key,
  	    mode
  	  );
  	  mode.lanes = lanes;
  	  mode.stateNode = {
  	    containerInfo: portal.containerInfo,
  	    pendingChildren: null,
  	    implementation: portal.implementation
  	  };
  	  return mode;
  	}
  	var CapturedStacks = new WeakMap();
  	function createCapturedValueAtFiber(value, source) {
  	  if ("object" === typeof value && null !== value) {
  	    var existing = CapturedStacks.get(value);
  	    if (void 0 !== existing) return existing;
  	    source = {
  	      value: value,
  	      source: source,
  	      stack: getStackByFiberInDevAndProd(source)
  	    };
  	    CapturedStacks.set(value, source);
  	    return source;
  	  }
  	  return {
  	    value: value,
  	    source: source,
  	    stack: getStackByFiberInDevAndProd(source)
  	  };
  	}
  	var forkStack = [],
  	  forkStackIndex = 0,
  	  treeForkProvider = null,
  	  treeForkCount = 0,
  	  idStack = [],
  	  idStackIndex = 0,
  	  treeContextProvider = null,
  	  treeContextId = 1,
  	  treeContextOverflow = "";
  	function pushTreeFork(workInProgress, totalChildren) {
  	  forkStack[forkStackIndex++] = treeForkCount;
  	  forkStack[forkStackIndex++] = treeForkProvider;
  	  treeForkProvider = workInProgress;
  	  treeForkCount = totalChildren;
  	}
  	function pushTreeId(workInProgress, totalChildren, index) {
  	  idStack[idStackIndex++] = treeContextId;
  	  idStack[idStackIndex++] = treeContextOverflow;
  	  idStack[idStackIndex++] = treeContextProvider;
  	  treeContextProvider = workInProgress;
  	  var baseIdWithLeadingBit = treeContextId;
  	  workInProgress = treeContextOverflow;
  	  var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
  	  baseIdWithLeadingBit &= ~(1 << baseLength);
  	  index += 1;
  	  var length = 32 - clz32(totalChildren) + baseLength;
  	  if (30 < length) {
  	    var numberOfOverflowBits = baseLength - (baseLength % 5);
  	    length = (
  	      baseIdWithLeadingBit &
  	      ((1 << numberOfOverflowBits) - 1)
  	    ).toString(32);
  	    baseIdWithLeadingBit >>= numberOfOverflowBits;
  	    baseLength -= numberOfOverflowBits;
  	    treeContextId =
  	      (1 << (32 - clz32(totalChildren) + baseLength)) |
  	      (index << baseLength) |
  	      baseIdWithLeadingBit;
  	    treeContextOverflow = length + workInProgress;
  	  } else
  	    (treeContextId =
  	      (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
  	      (treeContextOverflow = workInProgress);
  	}
  	function pushMaterializedTreeId(workInProgress) {
  	  null !== workInProgress.return &&
  	    (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
  	}
  	function popTreeContext(workInProgress) {
  	  for (; workInProgress === treeForkProvider; )
  	    (treeForkProvider = forkStack[--forkStackIndex]),
  	      (forkStack[forkStackIndex] = null),
  	      (treeForkCount = forkStack[--forkStackIndex]),
  	      (forkStack[forkStackIndex] = null);
  	  for (; workInProgress === treeContextProvider; )
  	    (treeContextProvider = idStack[--idStackIndex]),
  	      (idStack[idStackIndex] = null),
  	      (treeContextOverflow = idStack[--idStackIndex]),
  	      (idStack[idStackIndex] = null),
  	      (treeContextId = idStack[--idStackIndex]),
  	      (idStack[idStackIndex] = null);
  	}
  	function restoreSuspendedTreeContext(workInProgress, suspendedContext) {
  	  idStack[idStackIndex++] = treeContextId;
  	  idStack[idStackIndex++] = treeContextOverflow;
  	  idStack[idStackIndex++] = treeContextProvider;
  	  treeContextId = suspendedContext.id;
  	  treeContextOverflow = suspendedContext.overflow;
  	  treeContextProvider = workInProgress;
  	}
  	var hydrationParentFiber = null,
  	  nextHydratableInstance = null,
  	  isHydrating = false,
  	  hydrationErrors = null,
  	  rootOrSingletonContext = false,
  	  HydrationMismatchException = Error(formatProdErrorMessage(519));
  	function throwOnHydrationMismatch(fiber) {
  	  var error = Error(
  	    formatProdErrorMessage(
  	      418,
  	      1 < arguments.length && void 0 !== arguments[1] && arguments[1]
  	        ? "text"
  	        : "HTML",
  	      ""
  	    )
  	  );
  	  queueHydrationError(createCapturedValueAtFiber(error, fiber));
  	  throw HydrationMismatchException;
  	}
  	function prepareToHydrateHostInstance(fiber) {
  	  var instance = fiber.stateNode,
  	    type = fiber.type,
  	    props = fiber.memoizedProps;
  	  instance[internalInstanceKey] = fiber;
  	  instance[internalPropsKey] = props;
  	  switch (type) {
  	    case "dialog":
  	      listenToNonDelegatedEvent("cancel", instance);
  	      listenToNonDelegatedEvent("close", instance);
  	      break;
  	    case "iframe":
  	    case "object":
  	    case "embed":
  	      listenToNonDelegatedEvent("load", instance);
  	      break;
  	    case "video":
  	    case "audio":
  	      for (type = 0; type < mediaEventTypes.length; type++)
  	        listenToNonDelegatedEvent(mediaEventTypes[type], instance);
  	      break;
  	    case "source":
  	      listenToNonDelegatedEvent("error", instance);
  	      break;
  	    case "img":
  	    case "image":
  	    case "link":
  	      listenToNonDelegatedEvent("error", instance);
  	      listenToNonDelegatedEvent("load", instance);
  	      break;
  	    case "details":
  	      listenToNonDelegatedEvent("toggle", instance);
  	      break;
  	    case "input":
  	      listenToNonDelegatedEvent("invalid", instance);
  	      initInput(
  	        instance,
  	        props.value,
  	        props.defaultValue,
  	        props.checked,
  	        props.defaultChecked,
  	        props.type,
  	        props.name,
  	        true
  	      );
  	      break;
  	    case "select":
  	      listenToNonDelegatedEvent("invalid", instance);
  	      break;
  	    case "textarea":
  	      listenToNonDelegatedEvent("invalid", instance),
  	        initTextarea(instance, props.value, props.defaultValue, props.children);
  	  }
  	  type = props.children;
  	  ("string" !== typeof type &&
  	    "number" !== typeof type &&
  	    "bigint" !== typeof type) ||
  	  instance.textContent === "" + type ||
  	  true === props.suppressHydrationWarning ||
  	  checkForUnmatchedText(instance.textContent, type)
  	    ? (null != props.popover &&
  	        (listenToNonDelegatedEvent("beforetoggle", instance),
  	        listenToNonDelegatedEvent("toggle", instance)),
  	      null != props.onScroll && listenToNonDelegatedEvent("scroll", instance),
  	      null != props.onScrollEnd &&
  	        listenToNonDelegatedEvent("scrollend", instance),
  	      null != props.onClick && (instance.onclick = noop$1),
  	      (instance = true))
  	    : (instance = false);
  	  instance || throwOnHydrationMismatch(fiber, true);
  	}
  	function popToNextHostParent(fiber) {
  	  for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
  	    switch (hydrationParentFiber.tag) {
  	      case 5:
  	      case 31:
  	      case 13:
  	        rootOrSingletonContext = false;
  	        return;
  	      case 27:
  	      case 3:
  	        rootOrSingletonContext = true;
  	        return;
  	      default:
  	        hydrationParentFiber = hydrationParentFiber.return;
  	    }
  	}
  	function popHydrationState(fiber) {
  	  if (fiber !== hydrationParentFiber) return false;
  	  if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = true), false;
  	  var tag = fiber.tag,
  	    JSCompiler_temp;
  	  if ((JSCompiler_temp = 3 !== tag && 27 !== tag)) {
  	    if ((JSCompiler_temp = 5 === tag))
  	      (JSCompiler_temp = fiber.type),
  	        (JSCompiler_temp =
  	          !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
  	          shouldSetTextContent(fiber.type, fiber.memoizedProps));
  	    JSCompiler_temp = !JSCompiler_temp;
  	  }
  	  JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);
  	  popToNextHostParent(fiber);
  	  if (13 === tag) {
  	    fiber = fiber.memoizedState;
  	    fiber = null !== fiber ? fiber.dehydrated : null;
  	    if (!fiber) throw Error(formatProdErrorMessage(317));
  	    nextHydratableInstance =
  	      getNextHydratableInstanceAfterHydrationBoundary(fiber);
  	  } else if (31 === tag) {
  	    fiber = fiber.memoizedState;
  	    fiber = null !== fiber ? fiber.dehydrated : null;
  	    if (!fiber) throw Error(formatProdErrorMessage(317));
  	    nextHydratableInstance =
  	      getNextHydratableInstanceAfterHydrationBoundary(fiber);
  	  } else
  	    27 === tag
  	      ? ((tag = nextHydratableInstance),
  	        isSingletonScope(fiber.type)
  	          ? ((fiber = previousHydratableOnEnteringScopedSingleton),
  	            (previousHydratableOnEnteringScopedSingleton = null),
  	            (nextHydratableInstance = fiber))
  	          : (nextHydratableInstance = tag))
  	      : (nextHydratableInstance = hydrationParentFiber
  	          ? getNextHydratable(fiber.stateNode.nextSibling)
  	          : null);
  	  return true;
  	}
  	function resetHydrationState() {
  	  nextHydratableInstance = hydrationParentFiber = null;
  	  isHydrating = false;
  	}
  	function upgradeHydrationErrorsToRecoverable() {
  	  var queuedErrors = hydrationErrors;
  	  null !== queuedErrors &&
  	    (null === workInProgressRootRecoverableErrors
  	      ? (workInProgressRootRecoverableErrors = queuedErrors)
  	      : workInProgressRootRecoverableErrors.push.apply(
  	          workInProgressRootRecoverableErrors,
  	          queuedErrors
  	        ),
  	    (hydrationErrors = null));
  	  return queuedErrors;
  	}
  	function queueHydrationError(error) {
  	  null === hydrationErrors
  	    ? (hydrationErrors = [error])
  	    : hydrationErrors.push(error);
  	}
  	var valueCursor = createCursor(null),
  	  currentlyRenderingFiber$1 = null,
  	  lastContextDependency = null;
  	function pushProvider(providerFiber, context, nextValue) {
  	  push(valueCursor, context._currentValue);
  	  context._currentValue = nextValue;
  	}
  	function popProvider(context) {
  	  context._currentValue = valueCursor.current;
  	  pop(valueCursor);
  	}
  	function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {
  	  for (; null !== parent; ) {
  	    var alternate = parent.alternate;
  	    (parent.childLanes & renderLanes) !== renderLanes
  	      ? ((parent.childLanes |= renderLanes),
  	        null !== alternate && (alternate.childLanes |= renderLanes))
  	      : null !== alternate &&
  	        (alternate.childLanes & renderLanes) !== renderLanes &&
  	        (alternate.childLanes |= renderLanes);
  	    if (parent === propagationRoot) break;
  	    parent = parent.return;
  	  }
  	}
  	function propagateContextChanges(
  	  workInProgress,
  	  contexts,
  	  renderLanes,
  	  forcePropagateEntireTree
  	) {
  	  var fiber = workInProgress.child;
  	  null !== fiber && (fiber.return = workInProgress);
  	  for (; null !== fiber; ) {
  	    var list = fiber.dependencies;
  	    if (null !== list) {
  	      var nextFiber = fiber.child;
  	      list = list.firstContext;
  	      a: for (; null !== list; ) {
  	        var dependency = list;
  	        list = fiber;
  	        for (var i = 0; i < contexts.length; i++)
  	          if (dependency.context === contexts[i]) {
  	            list.lanes |= renderLanes;
  	            dependency = list.alternate;
  	            null !== dependency && (dependency.lanes |= renderLanes);
  	            scheduleContextWorkOnParentPath(
  	              list.return,
  	              renderLanes,
  	              workInProgress
  	            );
  	            forcePropagateEntireTree || (nextFiber = null);
  	            break a;
  	          }
  	        list = dependency.next;
  	      }
  	    } else if (18 === fiber.tag) {
  	      nextFiber = fiber.return;
  	      if (null === nextFiber) throw Error(formatProdErrorMessage(341));
  	      nextFiber.lanes |= renderLanes;
  	      list = nextFiber.alternate;
  	      null !== list && (list.lanes |= renderLanes);
  	      scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);
  	      nextFiber = null;
  	    } else nextFiber = fiber.child;
  	    if (null !== nextFiber) nextFiber.return = fiber;
  	    else
  	      for (nextFiber = fiber; null !== nextFiber; ) {
  	        if (nextFiber === workInProgress) {
  	          nextFiber = null;
  	          break;
  	        }
  	        fiber = nextFiber.sibling;
  	        if (null !== fiber) {
  	          fiber.return = nextFiber.return;
  	          nextFiber = fiber;
  	          break;
  	        }
  	        nextFiber = nextFiber.return;
  	      }
  	    fiber = nextFiber;
  	  }
  	}
  	function propagateParentContextChanges(
  	  current,
  	  workInProgress,
  	  renderLanes,
  	  forcePropagateEntireTree
  	) {
  	  current = null;
  	  for (
  	    var parent = workInProgress, isInsidePropagationBailout = false;
  	    null !== parent;

  	  ) {
  	    if (!isInsidePropagationBailout)
  	      if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true;
  	      else if (0 !== (parent.flags & 262144)) break;
  	    if (10 === parent.tag) {
  	      var currentParent = parent.alternate;
  	      if (null === currentParent) throw Error(formatProdErrorMessage(387));
  	      currentParent = currentParent.memoizedProps;
  	      if (null !== currentParent) {
  	        var context = parent.type;
  	        objectIs(parent.pendingProps.value, currentParent.value) ||
  	          (null !== current ? current.push(context) : (current = [context]));
  	      }
  	    } else if (parent === hostTransitionProviderCursor.current) {
  	      currentParent = parent.alternate;
  	      if (null === currentParent) throw Error(formatProdErrorMessage(387));
  	      currentParent.memoizedState.memoizedState !==
  	        parent.memoizedState.memoizedState &&
  	        (null !== current
  	          ? current.push(HostTransitionContext)
  	          : (current = [HostTransitionContext]));
  	    }
  	    parent = parent.return;
  	  }
  	  null !== current &&
  	    propagateContextChanges(
  	      workInProgress,
  	      current,
  	      renderLanes,
  	      forcePropagateEntireTree
  	    );
  	  workInProgress.flags |= 262144;
  	}
  	function checkIfContextChanged(currentDependencies) {
  	  for (
  	    currentDependencies = currentDependencies.firstContext;
  	    null !== currentDependencies;

  	  ) {
  	    if (
  	      !objectIs(
  	        currentDependencies.context._currentValue,
  	        currentDependencies.memoizedValue
  	      )
  	    )
  	      return true;
  	    currentDependencies = currentDependencies.next;
  	  }
  	  return false;
  	}
  	function prepareToReadContext(workInProgress) {
  	  currentlyRenderingFiber$1 = workInProgress;
  	  lastContextDependency = null;
  	  workInProgress = workInProgress.dependencies;
  	  null !== workInProgress && (workInProgress.firstContext = null);
  	}
  	function readContext(context) {
  	  return readContextForConsumer(currentlyRenderingFiber$1, context);
  	}
  	function readContextDuringReconciliation(consumer, context) {
  	  null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
  	  return readContextForConsumer(consumer, context);
  	}
  	function readContextForConsumer(consumer, context) {
  	  var value = context._currentValue;
  	  context = { context: context, memoizedValue: value, next: null };
  	  if (null === lastContextDependency) {
  	    if (null === consumer) throw Error(formatProdErrorMessage(308));
  	    lastContextDependency = context;
  	    consumer.dependencies = { lanes: 0, firstContext: context };
  	    consumer.flags |= 524288;
  	  } else lastContextDependency = lastContextDependency.next = context;
  	  return value;
  	}
  	var AbortControllerLocal =
  	    "undefined" !== typeof AbortController
  	      ? AbortController
  	      : function () {
  	          var listeners = [],
  	            signal = (this.signal = {
  	              aborted: false,
  	              addEventListener: function (type, listener) {
  	                listeners.push(listener);
  	              }
  	            });
  	          this.abort = function () {
  	            signal.aborted = true;
  	            listeners.forEach(function (listener) {
  	              return listener();
  	            });
  	          };
  	        },
  	  scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
  	  NormalPriority = Scheduler.unstable_NormalPriority,
  	  CacheContext = {
  	    $$typeof: REACT_CONTEXT_TYPE,
  	    Consumer: null,
  	    Provider: null,
  	    _currentValue: null,
  	    _currentValue2: null,
  	    _threadCount: 0
  	  };
  	function createCache() {
  	  return {
  	    controller: new AbortControllerLocal(),
  	    data: new Map(),
  	    refCount: 0
  	  };
  	}
  	function releaseCache(cache) {
  	  cache.refCount--;
  	  0 === cache.refCount &&
  	    scheduleCallback$2(NormalPriority, function () {
  	      cache.controller.abort();
  	    });
  	}
  	var currentEntangledListeners = null,
  	  currentEntangledPendingCount = 0,
  	  currentEntangledLane = 0,
  	  currentEntangledActionThenable = null;
  	function entangleAsyncAction(transition, thenable) {
  	  if (null === currentEntangledListeners) {
  	    var entangledListeners = (currentEntangledListeners = []);
  	    currentEntangledPendingCount = 0;
  	    currentEntangledLane = requestTransitionLane();
  	    currentEntangledActionThenable = {
  	      status: "pending",
  	      value: void 0,
  	      then: function (resolve) {
  	        entangledListeners.push(resolve);
  	      }
  	    };
  	  }
  	  currentEntangledPendingCount++;
  	  thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
  	  return thenable;
  	}
  	function pingEngtangledActionScope() {
  	  if (
  	    0 === --currentEntangledPendingCount &&
  	    null !== currentEntangledListeners
  	  ) {
  	    null !== currentEntangledActionThenable &&
  	      (currentEntangledActionThenable.status = "fulfilled");
  	    var listeners = currentEntangledListeners;
  	    currentEntangledListeners = null;
  	    currentEntangledLane = 0;
  	    currentEntangledActionThenable = null;
  	    for (var i = 0; i < listeners.length; i++) (0, listeners[i])();
  	  }
  	}
  	function chainThenableValue(thenable, result) {
  	  var listeners = [],
  	    thenableWithOverride = {
  	      status: "pending",
  	      value: null,
  	      reason: null,
  	      then: function (resolve) {
  	        listeners.push(resolve);
  	      }
  	    };
  	  thenable.then(
  	    function () {
  	      thenableWithOverride.status = "fulfilled";
  	      thenableWithOverride.value = result;
  	      for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result);
  	    },
  	    function (error) {
  	      thenableWithOverride.status = "rejected";
  	      thenableWithOverride.reason = error;
  	      for (error = 0; error < listeners.length; error++)
  	        (0, listeners[error])(void 0);
  	    }
  	  );
  	  return thenableWithOverride;
  	}
  	var prevOnStartTransitionFinish = ReactSharedInternals.S;
  	ReactSharedInternals.S = function (transition, returnValue) {
  	  globalMostRecentTransitionTime = now();
  	  "object" === typeof returnValue &&
  	    null !== returnValue &&
  	    "function" === typeof returnValue.then &&
  	    entangleAsyncAction(transition, returnValue);
  	  null !== prevOnStartTransitionFinish &&
  	    prevOnStartTransitionFinish(transition, returnValue);
  	};
  	var resumedCache = createCursor(null);
  	function peekCacheFromPool() {
  	  var cacheResumedFromPreviousRender = resumedCache.current;
  	  return null !== cacheResumedFromPreviousRender
  	    ? cacheResumedFromPreviousRender
  	    : workInProgressRoot.pooledCache;
  	}
  	function pushTransition(offscreenWorkInProgress, prevCachePool) {
  	  null === prevCachePool
  	    ? push(resumedCache, resumedCache.current)
  	    : push(resumedCache, prevCachePool.pool);
  	}
  	function getSuspendedCache() {
  	  var cacheFromPool = peekCacheFromPool();
  	  return null === cacheFromPool
  	    ? null
  	    : { parent: CacheContext._currentValue, pool: cacheFromPool };
  	}
  	var SuspenseException = Error(formatProdErrorMessage(460)),
  	  SuspenseyCommitException = Error(formatProdErrorMessage(474)),
  	  SuspenseActionException = Error(formatProdErrorMessage(542)),
  	  noopSuspenseyCommitThenable = { then: function () {} };
  	function isThenableResolved(thenable) {
  	  thenable = thenable.status;
  	  return "fulfilled" === thenable || "rejected" === thenable;
  	}
  	function trackUsedThenable(thenableState, thenable, index) {
  	  index = thenableState[index];
  	  void 0 === index
  	    ? thenableState.push(thenable)
  	    : index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index));
  	  switch (thenable.status) {
  	    case "fulfilled":
  	      return thenable.value;
  	    case "rejected":
  	      throw (
  	        ((thenableState = thenable.reason),
  	        checkIfUseWrappedInAsyncCatch(thenableState),
  	        thenableState)
  	      );
  	    default:
  	      if ("string" === typeof thenable.status) thenable.then(noop$1, noop$1);
  	      else {
  	        thenableState = workInProgressRoot;
  	        if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
  	          throw Error(formatProdErrorMessage(482));
  	        thenableState = thenable;
  	        thenableState.status = "pending";
  	        thenableState.then(
  	          function (fulfilledValue) {
  	            if ("pending" === thenable.status) {
  	              var fulfilledThenable = thenable;
  	              fulfilledThenable.status = "fulfilled";
  	              fulfilledThenable.value = fulfilledValue;
  	            }
  	          },
  	          function (error) {
  	            if ("pending" === thenable.status) {
  	              var rejectedThenable = thenable;
  	              rejectedThenable.status = "rejected";
  	              rejectedThenable.reason = error;
  	            }
  	          }
  	        );
  	      }
  	      switch (thenable.status) {
  	        case "fulfilled":
  	          return thenable.value;
  	        case "rejected":
  	          throw (
  	            ((thenableState = thenable.reason),
  	            checkIfUseWrappedInAsyncCatch(thenableState),
  	            thenableState)
  	          );
  	      }
  	      suspendedThenable = thenable;
  	      throw SuspenseException;
  	  }
  	}
  	function resolveLazy(lazyType) {
  	  try {
  	    var init = lazyType._init;
  	    return init(lazyType._payload);
  	  } catch (x) {
  	    if (null !== x && "object" === typeof x && "function" === typeof x.then)
  	      throw ((suspendedThenable = x), SuspenseException);
  	    throw x;
  	  }
  	}
  	var suspendedThenable = null;
  	function getSuspendedThenable() {
  	  if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
  	  var thenable = suspendedThenable;
  	  suspendedThenable = null;
  	  return thenable;
  	}
  	function checkIfUseWrappedInAsyncCatch(rejectedReason) {
  	  if (
  	    rejectedReason === SuspenseException ||
  	    rejectedReason === SuspenseActionException
  	  )
  	    throw Error(formatProdErrorMessage(483));
  	}
  	var thenableState$1 = null,
  	  thenableIndexCounter$1 = 0;
  	function unwrapThenable(thenable) {
  	  var index = thenableIndexCounter$1;
  	  thenableIndexCounter$1 += 1;
  	  null === thenableState$1 && (thenableState$1 = []);
  	  return trackUsedThenable(thenableState$1, thenable, index);
  	}
  	function coerceRef(workInProgress, element) {
  	  element = element.props.ref;
  	  workInProgress.ref = void 0 !== element ? element : null;
  	}
  	function throwOnInvalidObjectTypeImpl(returnFiber, newChild) {
  	  if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
  	    throw Error(formatProdErrorMessage(525));
  	  returnFiber = Object.prototype.toString.call(newChild);
  	  throw Error(
  	    formatProdErrorMessage(
  	      31,
  	      "[object Object]" === returnFiber
  	        ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
  	        : returnFiber
  	    )
  	  );
  	}
  	function createChildReconciler(shouldTrackSideEffects) {
  	  function deleteChild(returnFiber, childToDelete) {
  	    if (shouldTrackSideEffects) {
  	      var deletions = returnFiber.deletions;
  	      null === deletions
  	        ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))
  	        : deletions.push(childToDelete);
  	    }
  	  }
  	  function deleteRemainingChildren(returnFiber, currentFirstChild) {
  	    if (!shouldTrackSideEffects) return null;
  	    for (; null !== currentFirstChild; )
  	      deleteChild(returnFiber, currentFirstChild),
  	        (currentFirstChild = currentFirstChild.sibling);
  	    return null;
  	  }
  	  function mapRemainingChildren(currentFirstChild) {
  	    for (var existingChildren = new Map(); null !== currentFirstChild; )
  	      null !== currentFirstChild.key
  	        ? existingChildren.set(currentFirstChild.key, currentFirstChild)
  	        : existingChildren.set(currentFirstChild.index, currentFirstChild),
  	        (currentFirstChild = currentFirstChild.sibling);
  	    return existingChildren;
  	  }
  	  function useFiber(fiber, pendingProps) {
  	    fiber = createWorkInProgress(fiber, pendingProps);
  	    fiber.index = 0;
  	    fiber.sibling = null;
  	    return fiber;
  	  }
  	  function placeChild(newFiber, lastPlacedIndex, newIndex) {
  	    newFiber.index = newIndex;
  	    if (!shouldTrackSideEffects)
  	      return (newFiber.flags |= 1048576), lastPlacedIndex;
  	    newIndex = newFiber.alternate;
  	    if (null !== newIndex)
  	      return (
  	        (newIndex = newIndex.index),
  	        newIndex < lastPlacedIndex
  	          ? ((newFiber.flags |= 67108866), lastPlacedIndex)
  	          : newIndex
  	      );
  	    newFiber.flags |= 67108866;
  	    return lastPlacedIndex;
  	  }
  	  function placeSingleChild(newFiber) {
  	    shouldTrackSideEffects &&
  	      null === newFiber.alternate &&
  	      (newFiber.flags |= 67108866);
  	    return newFiber;
  	  }
  	  function updateTextNode(returnFiber, current, textContent, lanes) {
  	    if (null === current || 6 !== current.tag)
  	      return (
  	        (current = createFiberFromText(textContent, returnFiber.mode, lanes)),
  	        (current.return = returnFiber),
  	        current
  	      );
  	    current = useFiber(current, textContent);
  	    current.return = returnFiber;
  	    return current;
  	  }
  	  function updateElement(returnFiber, current, element, lanes) {
  	    var elementType = element.type;
  	    if (elementType === REACT_FRAGMENT_TYPE)
  	      return updateFragment(
  	        returnFiber,
  	        current,
  	        element.props.children,
  	        lanes,
  	        element.key
  	      );
  	    if (
  	      null !== current &&
  	      (current.elementType === elementType ||
  	        ("object" === typeof elementType &&
  	          null !== elementType &&
  	          elementType.$$typeof === REACT_LAZY_TYPE &&
  	          resolveLazy(elementType) === current.type))
  	    )
  	      return (
  	        (current = useFiber(current, element.props)),
  	        coerceRef(current, element),
  	        (current.return = returnFiber),
  	        current
  	      );
  	    current = createFiberFromTypeAndProps(
  	      element.type,
  	      element.key,
  	      element.props,
  	      null,
  	      returnFiber.mode,
  	      lanes
  	    );
  	    coerceRef(current, element);
  	    current.return = returnFiber;
  	    return current;
  	  }
  	  function updatePortal(returnFiber, current, portal, lanes) {
  	    if (
  	      null === current ||
  	      4 !== current.tag ||
  	      current.stateNode.containerInfo !== portal.containerInfo ||
  	      current.stateNode.implementation !== portal.implementation
  	    )
  	      return (
  	        (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
  	        (current.return = returnFiber),
  	        current
  	      );
  	    current = useFiber(current, portal.children || []);
  	    current.return = returnFiber;
  	    return current;
  	  }
  	  function updateFragment(returnFiber, current, fragment, lanes, key) {
  	    if (null === current || 7 !== current.tag)
  	      return (
  	        (current = createFiberFromFragment(
  	          fragment,
  	          returnFiber.mode,
  	          lanes,
  	          key
  	        )),
  	        (current.return = returnFiber),
  	        current
  	      );
  	    current = useFiber(current, fragment);
  	    current.return = returnFiber;
  	    return current;
  	  }
  	  function createChild(returnFiber, newChild, lanes) {
  	    if (
  	      ("string" === typeof newChild && "" !== newChild) ||
  	      "number" === typeof newChild ||
  	      "bigint" === typeof newChild
  	    )
  	      return (
  	        (newChild = createFiberFromText(
  	          "" + newChild,
  	          returnFiber.mode,
  	          lanes
  	        )),
  	        (newChild.return = returnFiber),
  	        newChild
  	      );
  	    if ("object" === typeof newChild && null !== newChild) {
  	      switch (newChild.$$typeof) {
  	        case REACT_ELEMENT_TYPE:
  	          return (
  	            (lanes = createFiberFromTypeAndProps(
  	              newChild.type,
  	              newChild.key,
  	              newChild.props,
  	              null,
  	              returnFiber.mode,
  	              lanes
  	            )),
  	            coerceRef(lanes, newChild),
  	            (lanes.return = returnFiber),
  	            lanes
  	          );
  	        case REACT_PORTAL_TYPE:
  	          return (
  	            (newChild = createFiberFromPortal(
  	              newChild,
  	              returnFiber.mode,
  	              lanes
  	            )),
  	            (newChild.return = returnFiber),
  	            newChild
  	          );
  	        case REACT_LAZY_TYPE:
  	          return (
  	            (newChild = resolveLazy(newChild)),
  	            createChild(returnFiber, newChild, lanes)
  	          );
  	      }
  	      if (isArrayImpl(newChild) || getIteratorFn(newChild))
  	        return (
  	          (newChild = createFiberFromFragment(
  	            newChild,
  	            returnFiber.mode,
  	            lanes,
  	            null
  	          )),
  	          (newChild.return = returnFiber),
  	          newChild
  	        );
  	      if ("function" === typeof newChild.then)
  	        return createChild(returnFiber, unwrapThenable(newChild), lanes);
  	      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
  	        return createChild(
  	          returnFiber,
  	          readContextDuringReconciliation(returnFiber, newChild),
  	          lanes
  	        );
  	      throwOnInvalidObjectTypeImpl(returnFiber, newChild);
  	    }
  	    return null;
  	  }
  	  function updateSlot(returnFiber, oldFiber, newChild, lanes) {
  	    var key = null !== oldFiber ? oldFiber.key : null;
  	    if (
  	      ("string" === typeof newChild && "" !== newChild) ||
  	      "number" === typeof newChild ||
  	      "bigint" === typeof newChild
  	    )
  	      return null !== key
  	        ? null
  	        : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
  	    if ("object" === typeof newChild && null !== newChild) {
  	      switch (newChild.$$typeof) {
  	        case REACT_ELEMENT_TYPE:
  	          return newChild.key === key
  	            ? updateElement(returnFiber, oldFiber, newChild, lanes)
  	            : null;
  	        case REACT_PORTAL_TYPE:
  	          return newChild.key === key
  	            ? updatePortal(returnFiber, oldFiber, newChild, lanes)
  	            : null;
  	        case REACT_LAZY_TYPE:
  	          return (
  	            (newChild = resolveLazy(newChild)),
  	            updateSlot(returnFiber, oldFiber, newChild, lanes)
  	          );
  	      }
  	      if (isArrayImpl(newChild) || getIteratorFn(newChild))
  	        return null !== key
  	          ? null
  	          : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
  	      if ("function" === typeof newChild.then)
  	        return updateSlot(
  	          returnFiber,
  	          oldFiber,
  	          unwrapThenable(newChild),
  	          lanes
  	        );
  	      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
  	        return updateSlot(
  	          returnFiber,
  	          oldFiber,
  	          readContextDuringReconciliation(returnFiber, newChild),
  	          lanes
  	        );
  	      throwOnInvalidObjectTypeImpl(returnFiber, newChild);
  	    }
  	    return null;
  	  }
  	  function updateFromMap(
  	    existingChildren,
  	    returnFiber,
  	    newIdx,
  	    newChild,
  	    lanes
  	  ) {
  	    if (
  	      ("string" === typeof newChild && "" !== newChild) ||
  	      "number" === typeof newChild ||
  	      "bigint" === typeof newChild
  	    )
  	      return (
  	        (existingChildren = existingChildren.get(newIdx) || null),
  	        updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
  	      );
  	    if ("object" === typeof newChild && null !== newChild) {
  	      switch (newChild.$$typeof) {
  	        case REACT_ELEMENT_TYPE:
  	          return (
  	            (existingChildren =
  	              existingChildren.get(
  	                null === newChild.key ? newIdx : newChild.key
  	              ) || null),
  	            updateElement(returnFiber, existingChildren, newChild, lanes)
  	          );
  	        case REACT_PORTAL_TYPE:
  	          return (
  	            (existingChildren =
  	              existingChildren.get(
  	                null === newChild.key ? newIdx : newChild.key
  	              ) || null),
  	            updatePortal(returnFiber, existingChildren, newChild, lanes)
  	          );
  	        case REACT_LAZY_TYPE:
  	          return (
  	            (newChild = resolveLazy(newChild)),
  	            updateFromMap(
  	              existingChildren,
  	              returnFiber,
  	              newIdx,
  	              newChild,
  	              lanes
  	            )
  	          );
  	      }
  	      if (isArrayImpl(newChild) || getIteratorFn(newChild))
  	        return (
  	          (existingChildren = existingChildren.get(newIdx) || null),
  	          updateFragment(returnFiber, existingChildren, newChild, lanes, null)
  	        );
  	      if ("function" === typeof newChild.then)
  	        return updateFromMap(
  	          existingChildren,
  	          returnFiber,
  	          newIdx,
  	          unwrapThenable(newChild),
  	          lanes
  	        );
  	      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
  	        return updateFromMap(
  	          existingChildren,
  	          returnFiber,
  	          newIdx,
  	          readContextDuringReconciliation(returnFiber, newChild),
  	          lanes
  	        );
  	      throwOnInvalidObjectTypeImpl(returnFiber, newChild);
  	    }
  	    return null;
  	  }
  	  function reconcileChildrenArray(
  	    returnFiber,
  	    currentFirstChild,
  	    newChildren,
  	    lanes
  	  ) {
  	    for (
  	      var resultingFirstChild = null,
  	        previousNewFiber = null,
  	        oldFiber = currentFirstChild,
  	        newIdx = (currentFirstChild = 0),
  	        nextOldFiber = null;
  	      null !== oldFiber && newIdx < newChildren.length;
  	      newIdx++
  	    ) {
  	      oldFiber.index > newIdx
  	        ? ((nextOldFiber = oldFiber), (oldFiber = null))
  	        : (nextOldFiber = oldFiber.sibling);
  	      var newFiber = updateSlot(
  	        returnFiber,
  	        oldFiber,
  	        newChildren[newIdx],
  	        lanes
  	      );
  	      if (null === newFiber) {
  	        null === oldFiber && (oldFiber = nextOldFiber);
  	        break;
  	      }
  	      shouldTrackSideEffects &&
  	        oldFiber &&
  	        null === newFiber.alternate &&
  	        deleteChild(returnFiber, oldFiber);
  	      currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
  	      null === previousNewFiber
  	        ? (resultingFirstChild = newFiber)
  	        : (previousNewFiber.sibling = newFiber);
  	      previousNewFiber = newFiber;
  	      oldFiber = nextOldFiber;
  	    }
  	    if (newIdx === newChildren.length)
  	      return (
  	        deleteRemainingChildren(returnFiber, oldFiber),
  	        isHydrating && pushTreeFork(returnFiber, newIdx),
  	        resultingFirstChild
  	      );
  	    if (null === oldFiber) {
  	      for (; newIdx < newChildren.length; newIdx++)
  	        (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
  	          null !== oldFiber &&
  	            ((currentFirstChild = placeChild(
  	              oldFiber,
  	              currentFirstChild,
  	              newIdx
  	            )),
  	            null === previousNewFiber
  	              ? (resultingFirstChild = oldFiber)
  	              : (previousNewFiber.sibling = oldFiber),
  	            (previousNewFiber = oldFiber));
  	      isHydrating && pushTreeFork(returnFiber, newIdx);
  	      return resultingFirstChild;
  	    }
  	    for (
  	      oldFiber = mapRemainingChildren(oldFiber);
  	      newIdx < newChildren.length;
  	      newIdx++
  	    )
  	      (nextOldFiber = updateFromMap(
  	        oldFiber,
  	        returnFiber,
  	        newIdx,
  	        newChildren[newIdx],
  	        lanes
  	      )),
  	        null !== nextOldFiber &&
  	          (shouldTrackSideEffects &&
  	            null !== nextOldFiber.alternate &&
  	            oldFiber.delete(
  	              null === nextOldFiber.key ? newIdx : nextOldFiber.key
  	            ),
  	          (currentFirstChild = placeChild(
  	            nextOldFiber,
  	            currentFirstChild,
  	            newIdx
  	          )),
  	          null === previousNewFiber
  	            ? (resultingFirstChild = nextOldFiber)
  	            : (previousNewFiber.sibling = nextOldFiber),
  	          (previousNewFiber = nextOldFiber));
  	    shouldTrackSideEffects &&
  	      oldFiber.forEach(function (child) {
  	        return deleteChild(returnFiber, child);
  	      });
  	    isHydrating && pushTreeFork(returnFiber, newIdx);
  	    return resultingFirstChild;
  	  }
  	  function reconcileChildrenIterator(
  	    returnFiber,
  	    currentFirstChild,
  	    newChildren,
  	    lanes
  	  ) {
  	    if (null == newChildren) throw Error(formatProdErrorMessage(151));
  	    for (
  	      var resultingFirstChild = null,
  	        previousNewFiber = null,
  	        oldFiber = currentFirstChild,
  	        newIdx = (currentFirstChild = 0),
  	        nextOldFiber = null,
  	        step = newChildren.next();
  	      null !== oldFiber && !step.done;
  	      newIdx++, step = newChildren.next()
  	    ) {
  	      oldFiber.index > newIdx
  	        ? ((nextOldFiber = oldFiber), (oldFiber = null))
  	        : (nextOldFiber = oldFiber.sibling);
  	      var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
  	      if (null === newFiber) {
  	        null === oldFiber && (oldFiber = nextOldFiber);
  	        break;
  	      }
  	      shouldTrackSideEffects &&
  	        oldFiber &&
  	        null === newFiber.alternate &&
  	        deleteChild(returnFiber, oldFiber);
  	      currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
  	      null === previousNewFiber
  	        ? (resultingFirstChild = newFiber)
  	        : (previousNewFiber.sibling = newFiber);
  	      previousNewFiber = newFiber;
  	      oldFiber = nextOldFiber;
  	    }
  	    if (step.done)
  	      return (
  	        deleteRemainingChildren(returnFiber, oldFiber),
  	        isHydrating && pushTreeFork(returnFiber, newIdx),
  	        resultingFirstChild
  	      );
  	    if (null === oldFiber) {
  	      for (; !step.done; newIdx++, step = newChildren.next())
  	        (step = createChild(returnFiber, step.value, lanes)),
  	          null !== step &&
  	            ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
  	            null === previousNewFiber
  	              ? (resultingFirstChild = step)
  	              : (previousNewFiber.sibling = step),
  	            (previousNewFiber = step));
  	      isHydrating && pushTreeFork(returnFiber, newIdx);
  	      return resultingFirstChild;
  	    }
  	    for (
  	      oldFiber = mapRemainingChildren(oldFiber);
  	      !step.done;
  	      newIdx++, step = newChildren.next()
  	    )
  	      (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),
  	        null !== step &&
  	          (shouldTrackSideEffects &&
  	            null !== step.alternate &&
  	            oldFiber.delete(null === step.key ? newIdx : step.key),
  	          (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
  	          null === previousNewFiber
  	            ? (resultingFirstChild = step)
  	            : (previousNewFiber.sibling = step),
  	          (previousNewFiber = step));
  	    shouldTrackSideEffects &&
  	      oldFiber.forEach(function (child) {
  	        return deleteChild(returnFiber, child);
  	      });
  	    isHydrating && pushTreeFork(returnFiber, newIdx);
  	    return resultingFirstChild;
  	  }
  	  function reconcileChildFibersImpl(
  	    returnFiber,
  	    currentFirstChild,
  	    newChild,
  	    lanes
  	  ) {
  	    "object" === typeof newChild &&
  	      null !== newChild &&
  	      newChild.type === REACT_FRAGMENT_TYPE &&
  	      null === newChild.key &&
  	      (newChild = newChild.props.children);
  	    if ("object" === typeof newChild && null !== newChild) {
  	      switch (newChild.$$typeof) {
  	        case REACT_ELEMENT_TYPE:
  	          a: {
  	            for (var key = newChild.key; null !== currentFirstChild; ) {
  	              if (currentFirstChild.key === key) {
  	                key = newChild.type;
  	                if (key === REACT_FRAGMENT_TYPE) {
  	                  if (7 === currentFirstChild.tag) {
  	                    deleteRemainingChildren(
  	                      returnFiber,
  	                      currentFirstChild.sibling
  	                    );
  	                    lanes = useFiber(
  	                      currentFirstChild,
  	                      newChild.props.children
  	                    );
  	                    lanes.return = returnFiber;
  	                    returnFiber = lanes;
  	                    break a;
  	                  }
  	                } else if (
  	                  currentFirstChild.elementType === key ||
  	                  ("object" === typeof key &&
  	                    null !== key &&
  	                    key.$$typeof === REACT_LAZY_TYPE &&
  	                    resolveLazy(key) === currentFirstChild.type)
  	                ) {
  	                  deleteRemainingChildren(
  	                    returnFiber,
  	                    currentFirstChild.sibling
  	                  );
  	                  lanes = useFiber(currentFirstChild, newChild.props);
  	                  coerceRef(lanes, newChild);
  	                  lanes.return = returnFiber;
  	                  returnFiber = lanes;
  	                  break a;
  	                }
  	                deleteRemainingChildren(returnFiber, currentFirstChild);
  	                break;
  	              } else deleteChild(returnFiber, currentFirstChild);
  	              currentFirstChild = currentFirstChild.sibling;
  	            }
  	            newChild.type === REACT_FRAGMENT_TYPE
  	              ? ((lanes = createFiberFromFragment(
  	                  newChild.props.children,
  	                  returnFiber.mode,
  	                  lanes,
  	                  newChild.key
  	                )),
  	                (lanes.return = returnFiber),
  	                (returnFiber = lanes))
  	              : ((lanes = createFiberFromTypeAndProps(
  	                  newChild.type,
  	                  newChild.key,
  	                  newChild.props,
  	                  null,
  	                  returnFiber.mode,
  	                  lanes
  	                )),
  	                coerceRef(lanes, newChild),
  	                (lanes.return = returnFiber),
  	                (returnFiber = lanes));
  	          }
  	          return placeSingleChild(returnFiber);
  	        case REACT_PORTAL_TYPE:
  	          a: {
  	            for (key = newChild.key; null !== currentFirstChild; ) {
  	              if (currentFirstChild.key === key)
  	                if (
  	                  4 === currentFirstChild.tag &&
  	                  currentFirstChild.stateNode.containerInfo ===
  	                    newChild.containerInfo &&
  	                  currentFirstChild.stateNode.implementation ===
  	                    newChild.implementation
  	                ) {
  	                  deleteRemainingChildren(
  	                    returnFiber,
  	                    currentFirstChild.sibling
  	                  );
  	                  lanes = useFiber(currentFirstChild, newChild.children || []);
  	                  lanes.return = returnFiber;
  	                  returnFiber = lanes;
  	                  break a;
  	                } else {
  	                  deleteRemainingChildren(returnFiber, currentFirstChild);
  	                  break;
  	                }
  	              else deleteChild(returnFiber, currentFirstChild);
  	              currentFirstChild = currentFirstChild.sibling;
  	            }
  	            lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
  	            lanes.return = returnFiber;
  	            returnFiber = lanes;
  	          }
  	          return placeSingleChild(returnFiber);
  	        case REACT_LAZY_TYPE:
  	          return (
  	            (newChild = resolveLazy(newChild)),
  	            reconcileChildFibersImpl(
  	              returnFiber,
  	              currentFirstChild,
  	              newChild,
  	              lanes
  	            )
  	          );
  	      }
  	      if (isArrayImpl(newChild))
  	        return reconcileChildrenArray(
  	          returnFiber,
  	          currentFirstChild,
  	          newChild,
  	          lanes
  	        );
  	      if (getIteratorFn(newChild)) {
  	        key = getIteratorFn(newChild);
  	        if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
  	        newChild = key.call(newChild);
  	        return reconcileChildrenIterator(
  	          returnFiber,
  	          currentFirstChild,
  	          newChild,
  	          lanes
  	        );
  	      }
  	      if ("function" === typeof newChild.then)
  	        return reconcileChildFibersImpl(
  	          returnFiber,
  	          currentFirstChild,
  	          unwrapThenable(newChild),
  	          lanes
  	        );
  	      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
  	        return reconcileChildFibersImpl(
  	          returnFiber,
  	          currentFirstChild,
  	          readContextDuringReconciliation(returnFiber, newChild),
  	          lanes
  	        );
  	      throwOnInvalidObjectTypeImpl(returnFiber, newChild);
  	    }
  	    return ("string" === typeof newChild && "" !== newChild) ||
  	      "number" === typeof newChild ||
  	      "bigint" === typeof newChild
  	      ? ((newChild = "" + newChild),
  	        null !== currentFirstChild && 6 === currentFirstChild.tag
  	          ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
  	            (lanes = useFiber(currentFirstChild, newChild)),
  	            (lanes.return = returnFiber),
  	            (returnFiber = lanes))
  	          : (deleteRemainingChildren(returnFiber, currentFirstChild),
  	            (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),
  	            (lanes.return = returnFiber),
  	            (returnFiber = lanes)),
  	        placeSingleChild(returnFiber))
  	      : deleteRemainingChildren(returnFiber, currentFirstChild);
  	  }
  	  return function (returnFiber, currentFirstChild, newChild, lanes) {
  	    try {
  	      thenableIndexCounter$1 = 0;
  	      var firstChildFiber = reconcileChildFibersImpl(
  	        returnFiber,
  	        currentFirstChild,
  	        newChild,
  	        lanes
  	      );
  	      thenableState$1 = null;
  	      return firstChildFiber;
  	    } catch (x) {
  	      if (x === SuspenseException || x === SuspenseActionException) throw x;
  	      var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
  	      fiber.lanes = lanes;
  	      fiber.return = returnFiber;
  	      return fiber;
  	    } finally {
  	    }
  	  };
  	}
  	var reconcileChildFibers = createChildReconciler(true),
  	  mountChildFibers = createChildReconciler(false),
  	  hasForceUpdate = false;
  	function initializeUpdateQueue(fiber) {
  	  fiber.updateQueue = {
  	    baseState: fiber.memoizedState,
  	    firstBaseUpdate: null,
  	    lastBaseUpdate: null,
  	    shared: { pending: null, lanes: 0, hiddenCallbacks: null },
  	    callbacks: null
  	  };
  	}
  	function cloneUpdateQueue(current, workInProgress) {
  	  current = current.updateQueue;
  	  workInProgress.updateQueue === current &&
  	    (workInProgress.updateQueue = {
  	      baseState: current.baseState,
  	      firstBaseUpdate: current.firstBaseUpdate,
  	      lastBaseUpdate: current.lastBaseUpdate,
  	      shared: current.shared,
  	      callbacks: null
  	    });
  	}
  	function createUpdate(lane) {
  	  return { lane: lane, tag: 0, payload: null, callback: null, next: null };
  	}
  	function enqueueUpdate(fiber, update, lane) {
  	  var updateQueue = fiber.updateQueue;
  	  if (null === updateQueue) return null;
  	  updateQueue = updateQueue.shared;
  	  if (0 !== (executionContext & 2)) {
  	    var pending = updateQueue.pending;
  	    null === pending
  	      ? (update.next = update)
  	      : ((update.next = pending.next), (pending.next = update));
  	    updateQueue.pending = update;
  	    update = getRootForUpdatedFiber(fiber);
  	    markUpdateLaneFromFiberToRoot(fiber, null, lane);
  	    return update;
  	  }
  	  enqueueUpdate$1(fiber, updateQueue, update, lane);
  	  return getRootForUpdatedFiber(fiber);
  	}
  	function entangleTransitions(root, fiber, lane) {
  	  fiber = fiber.updateQueue;
  	  if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) {
  	    var queueLanes = fiber.lanes;
  	    queueLanes &= root.pendingLanes;
  	    lane |= queueLanes;
  	    fiber.lanes = lane;
  	    markRootEntangled(root, lane);
  	  }
  	}
  	function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
  	  var queue = workInProgress.updateQueue,
  	    current = workInProgress.alternate;
  	  if (
  	    null !== current &&
  	    ((current = current.updateQueue), queue === current)
  	  ) {
  	    var newFirst = null,
  	      newLast = null;
  	    queue = queue.firstBaseUpdate;
  	    if (null !== queue) {
  	      do {
  	        var clone = {
  	          lane: queue.lane,
  	          tag: queue.tag,
  	          payload: queue.payload,
  	          callback: null,
  	          next: null
  	        };
  	        null === newLast
  	          ? (newFirst = newLast = clone)
  	          : (newLast = newLast.next = clone);
  	        queue = queue.next;
  	      } while (null !== queue);
  	      null === newLast
  	        ? (newFirst = newLast = capturedUpdate)
  	        : (newLast = newLast.next = capturedUpdate);
  	    } else newFirst = newLast = capturedUpdate;
  	    queue = {
  	      baseState: current.baseState,
  	      firstBaseUpdate: newFirst,
  	      lastBaseUpdate: newLast,
  	      shared: current.shared,
  	      callbacks: current.callbacks
  	    };
  	    workInProgress.updateQueue = queue;
  	    return;
  	  }
  	  workInProgress = queue.lastBaseUpdate;
  	  null === workInProgress
  	    ? (queue.firstBaseUpdate = capturedUpdate)
  	    : (workInProgress.next = capturedUpdate);
  	  queue.lastBaseUpdate = capturedUpdate;
  	}
  	var didReadFromEntangledAsyncAction = false;
  	function suspendIfUpdateReadFromEntangledAsyncAction() {
  	  if (didReadFromEntangledAsyncAction) {
  	    var entangledActionThenable = currentEntangledActionThenable;
  	    if (null !== entangledActionThenable) throw entangledActionThenable;
  	  }
  	}
  	function processUpdateQueue(
  	  workInProgress$jscomp$0,
  	  props,
  	  instance$jscomp$0,
  	  renderLanes
  	) {
  	  didReadFromEntangledAsyncAction = false;
  	  var queue = workInProgress$jscomp$0.updateQueue;
  	  hasForceUpdate = false;
  	  var firstBaseUpdate = queue.firstBaseUpdate,
  	    lastBaseUpdate = queue.lastBaseUpdate,
  	    pendingQueue = queue.shared.pending;
  	  if (null !== pendingQueue) {
  	    queue.shared.pending = null;
  	    var lastPendingUpdate = pendingQueue,
  	      firstPendingUpdate = lastPendingUpdate.next;
  	    lastPendingUpdate.next = null;
  	    null === lastBaseUpdate
  	      ? (firstBaseUpdate = firstPendingUpdate)
  	      : (lastBaseUpdate.next = firstPendingUpdate);
  	    lastBaseUpdate = lastPendingUpdate;
  	    var current = workInProgress$jscomp$0.alternate;
  	    null !== current &&
  	      ((current = current.updateQueue),
  	      (pendingQueue = current.lastBaseUpdate),
  	      pendingQueue !== lastBaseUpdate &&
  	        (null === pendingQueue
  	          ? (current.firstBaseUpdate = firstPendingUpdate)
  	          : (pendingQueue.next = firstPendingUpdate),
  	        (current.lastBaseUpdate = lastPendingUpdate)));
  	  }
  	  if (null !== firstBaseUpdate) {
  	    var newState = queue.baseState;
  	    lastBaseUpdate = 0;
  	    current = firstPendingUpdate = lastPendingUpdate = null;
  	    pendingQueue = firstBaseUpdate;
  	    do {
  	      var updateLane = pendingQueue.lane & -536870913,
  	        isHiddenUpdate = updateLane !== pendingQueue.lane;
  	      if (
  	        isHiddenUpdate
  	          ? (workInProgressRootRenderLanes & updateLane) === updateLane
  	          : (renderLanes & updateLane) === updateLane
  	      ) {
  	        0 !== updateLane &&
  	          updateLane === currentEntangledLane &&
  	          (didReadFromEntangledAsyncAction = true);
  	        null !== current &&
  	          (current = current.next =
  	            {
  	              lane: 0,
  	              tag: pendingQueue.tag,
  	              payload: pendingQueue.payload,
  	              callback: null,
  	              next: null
  	            });
  	        a: {
  	          var workInProgress = workInProgress$jscomp$0,
  	            update = pendingQueue;
  	          updateLane = props;
  	          var instance = instance$jscomp$0;
  	          switch (update.tag) {
  	            case 1:
  	              workInProgress = update.payload;
  	              if ("function" === typeof workInProgress) {
  	                newState = workInProgress.call(instance, newState, updateLane);
  	                break a;
  	              }
  	              newState = workInProgress;
  	              break a;
  	            case 3:
  	              workInProgress.flags = (workInProgress.flags & -65537) | 128;
  	            case 0:
  	              workInProgress = update.payload;
  	              updateLane =
  	                "function" === typeof workInProgress
  	                  ? workInProgress.call(instance, newState, updateLane)
  	                  : workInProgress;
  	              if (null === updateLane || void 0 === updateLane) break a;
  	              newState = assign({}, newState, updateLane);
  	              break a;
  	            case 2:
  	              hasForceUpdate = true;
  	          }
  	        }
  	        updateLane = pendingQueue.callback;
  	        null !== updateLane &&
  	          ((workInProgress$jscomp$0.flags |= 64),
  	          isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),
  	          (isHiddenUpdate = queue.callbacks),
  	          null === isHiddenUpdate
  	            ? (queue.callbacks = [updateLane])
  	            : isHiddenUpdate.push(updateLane));
  	      } else
  	        (isHiddenUpdate = {
  	          lane: updateLane,
  	          tag: pendingQueue.tag,
  	          payload: pendingQueue.payload,
  	          callback: pendingQueue.callback,
  	          next: null
  	        }),
  	          null === current
  	            ? ((firstPendingUpdate = current = isHiddenUpdate),
  	              (lastPendingUpdate = newState))
  	            : (current = current.next = isHiddenUpdate),
  	          (lastBaseUpdate |= updateLane);
  	      pendingQueue = pendingQueue.next;
  	      if (null === pendingQueue)
  	        if (((pendingQueue = queue.shared.pending), null === pendingQueue))
  	          break;
  	        else
  	          (isHiddenUpdate = pendingQueue),
  	            (pendingQueue = isHiddenUpdate.next),
  	            (isHiddenUpdate.next = null),
  	            (queue.lastBaseUpdate = isHiddenUpdate),
  	            (queue.shared.pending = null);
  	    } while (1);
  	    null === current && (lastPendingUpdate = newState);
  	    queue.baseState = lastPendingUpdate;
  	    queue.firstBaseUpdate = firstPendingUpdate;
  	    queue.lastBaseUpdate = current;
  	    null === firstBaseUpdate && (queue.shared.lanes = 0);
  	    workInProgressRootSkippedLanes |= lastBaseUpdate;
  	    workInProgress$jscomp$0.lanes = lastBaseUpdate;
  	    workInProgress$jscomp$0.memoizedState = newState;
  	  }
  	}
  	function callCallback(callback, context) {
  	  if ("function" !== typeof callback)
  	    throw Error(formatProdErrorMessage(191, callback));
  	  callback.call(context);
  	}
  	function commitCallbacks(updateQueue, context) {
  	  var callbacks = updateQueue.callbacks;
  	  if (null !== callbacks)
  	    for (
  	      updateQueue.callbacks = null, updateQueue = 0;
  	      updateQueue < callbacks.length;
  	      updateQueue++
  	    )
  	      callCallback(callbacks[updateQueue], context);
  	}
  	var currentTreeHiddenStackCursor = createCursor(null),
  	  prevEntangledRenderLanesCursor = createCursor(0);
  	function pushHiddenContext(fiber, context) {
  	  fiber = entangledRenderLanes;
  	  push(prevEntangledRenderLanesCursor, fiber);
  	  push(currentTreeHiddenStackCursor, context);
  	  entangledRenderLanes = fiber | context.baseLanes;
  	}
  	function reuseHiddenContextOnStack() {
  	  push(prevEntangledRenderLanesCursor, entangledRenderLanes);
  	  push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
  	}
  	function popHiddenContext() {
  	  entangledRenderLanes = prevEntangledRenderLanesCursor.current;
  	  pop(currentTreeHiddenStackCursor);
  	  pop(prevEntangledRenderLanesCursor);
  	}
  	var suspenseHandlerStackCursor = createCursor(null),
  	  shellBoundary = null;
  	function pushPrimaryTreeSuspenseHandler(handler) {
  	  var current = handler.alternate;
  	  push(suspenseStackCursor, suspenseStackCursor.current & 1);
  	  push(suspenseHandlerStackCursor, handler);
  	  null === shellBoundary &&
  	    (null === current || null !== currentTreeHiddenStackCursor.current
  	      ? (shellBoundary = handler)
  	      : null !== current.memoizedState && (shellBoundary = handler));
  	}
  	function pushDehydratedActivitySuspenseHandler(fiber) {
  	  push(suspenseStackCursor, suspenseStackCursor.current);
  	  push(suspenseHandlerStackCursor, fiber);
  	  null === shellBoundary && (shellBoundary = fiber);
  	}
  	function pushOffscreenSuspenseHandler(fiber) {
  	  22 === fiber.tag
  	    ? (push(suspenseStackCursor, suspenseStackCursor.current),
  	      push(suspenseHandlerStackCursor, fiber),
  	      null === shellBoundary && (shellBoundary = fiber))
  	    : reuseSuspenseHandlerOnStack();
  	}
  	function reuseSuspenseHandlerOnStack() {
  	  push(suspenseStackCursor, suspenseStackCursor.current);
  	  push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
  	}
  	function popSuspenseHandler(fiber) {
  	  pop(suspenseHandlerStackCursor);
  	  shellBoundary === fiber && (shellBoundary = null);
  	  pop(suspenseStackCursor);
  	}
  	var suspenseStackCursor = createCursor(0);
  	function findFirstSuspended(row) {
  	  for (var node = row; null !== node; ) {
  	    if (13 === node.tag) {
  	      var state = node.memoizedState;
  	      if (
  	        null !== state &&
  	        ((state = state.dehydrated),
  	        null === state ||
  	          isSuspenseInstancePending(state) ||
  	          isSuspenseInstanceFallback(state))
  	      )
  	        return node;
  	    } else if (
  	      19 === node.tag &&
  	      ("forwards" === node.memoizedProps.revealOrder ||
  	        "backwards" === node.memoizedProps.revealOrder ||
  	        "unstable_legacy-backwards" === node.memoizedProps.revealOrder ||
  	        "together" === node.memoizedProps.revealOrder)
  	    ) {
  	      if (0 !== (node.flags & 128)) return node;
  	    } else if (null !== node.child) {
  	      node.child.return = node;
  	      node = node.child;
  	      continue;
  	    }
  	    if (node === row) break;
  	    for (; null === node.sibling; ) {
  	      if (null === node.return || node.return === row) return null;
  	      node = node.return;
  	    }
  	    node.sibling.return = node.return;
  	    node = node.sibling;
  	  }
  	  return null;
  	}
  	var renderLanes = 0,
  	  currentlyRenderingFiber = null,
  	  currentHook = null,
  	  workInProgressHook = null,
  	  didScheduleRenderPhaseUpdate = false,
  	  didScheduleRenderPhaseUpdateDuringThisPass = false,
  	  shouldDoubleInvokeUserFnsInHooksDEV = false,
  	  localIdCounter = 0,
  	  thenableIndexCounter = 0,
  	  thenableState = null,
  	  globalClientIdCounter = 0;
  	function throwInvalidHookError() {
  	  throw Error(formatProdErrorMessage(321));
  	}
  	function areHookInputsEqual(nextDeps, prevDeps) {
  	  if (null === prevDeps) return false;
  	  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
  	    if (!objectIs(nextDeps[i], prevDeps[i])) return false;
  	  return true;
  	}
  	function renderWithHooks(
  	  current,
  	  workInProgress,
  	  Component,
  	  props,
  	  secondArg,
  	  nextRenderLanes
  	) {
  	  renderLanes = nextRenderLanes;
  	  currentlyRenderingFiber = workInProgress;
  	  workInProgress.memoizedState = null;
  	  workInProgress.updateQueue = null;
  	  workInProgress.lanes = 0;
  	  ReactSharedInternals.H =
  	    null === current || null === current.memoizedState
  	      ? HooksDispatcherOnMount
  	      : HooksDispatcherOnUpdate;
  	  shouldDoubleInvokeUserFnsInHooksDEV = false;
  	  nextRenderLanes = Component(props, secondArg);
  	  shouldDoubleInvokeUserFnsInHooksDEV = false;
  	  didScheduleRenderPhaseUpdateDuringThisPass &&
  	    (nextRenderLanes = renderWithHooksAgain(
  	      workInProgress,
  	      Component,
  	      props,
  	      secondArg
  	    ));
  	  finishRenderingHooks(current);
  	  return nextRenderLanes;
  	}
  	function finishRenderingHooks(current) {
  	  ReactSharedInternals.H = ContextOnlyDispatcher;
  	  var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
  	  renderLanes = 0;
  	  workInProgressHook = currentHook = currentlyRenderingFiber = null;
  	  didScheduleRenderPhaseUpdate = false;
  	  thenableIndexCounter = 0;
  	  thenableState = null;
  	  if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
  	  null === current ||
  	    didReceiveUpdate ||
  	    ((current = current.dependencies),
  	    null !== current &&
  	      checkIfContextChanged(current) &&
  	      (didReceiveUpdate = true));
  	}
  	function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
  	  currentlyRenderingFiber = workInProgress;
  	  var numberOfReRenders = 0;
  	  do {
  	    didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);
  	    thenableIndexCounter = 0;
  	    didScheduleRenderPhaseUpdateDuringThisPass = false;
  	    if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
  	    numberOfReRenders += 1;
  	    workInProgressHook = currentHook = null;
  	    if (null != workInProgress.updateQueue) {
  	      var children = workInProgress.updateQueue;
  	      children.lastEffect = null;
  	      children.events = null;
  	      children.stores = null;
  	      null != children.memoCache && (children.memoCache.index = 0);
  	    }
  	    ReactSharedInternals.H = HooksDispatcherOnRerender;
  	    children = Component(props, secondArg);
  	  } while (didScheduleRenderPhaseUpdateDuringThisPass);
  	  return children;
  	}
  	function TransitionAwareHostComponent() {
  	  var dispatcher = ReactSharedInternals.H,
  	    maybeThenable = dispatcher.useState()[0];
  	  maybeThenable =
  	    "function" === typeof maybeThenable.then
  	      ? useThenable(maybeThenable)
  	      : maybeThenable;
  	  dispatcher = dispatcher.useState()[0];
  	  (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
  	    (currentlyRenderingFiber.flags |= 1024);
  	  return maybeThenable;
  	}
  	function checkDidRenderIdHook() {
  	  var didRenderIdHook = 0 !== localIdCounter;
  	  localIdCounter = 0;
  	  return didRenderIdHook;
  	}
  	function bailoutHooks(current, workInProgress, lanes) {
  	  workInProgress.updateQueue = current.updateQueue;
  	  workInProgress.flags &= -2053;
  	  current.lanes &= ~lanes;
  	}
  	function resetHooksOnUnwind(workInProgress) {
  	  if (didScheduleRenderPhaseUpdate) {
  	    for (
  	      workInProgress = workInProgress.memoizedState;
  	      null !== workInProgress;

  	    ) {
  	      var queue = workInProgress.queue;
  	      null !== queue && (queue.pending = null);
  	      workInProgress = workInProgress.next;
  	    }
  	    didScheduleRenderPhaseUpdate = false;
  	  }
  	  renderLanes = 0;
  	  workInProgressHook = currentHook = currentlyRenderingFiber = null;
  	  didScheduleRenderPhaseUpdateDuringThisPass = false;
  	  thenableIndexCounter = localIdCounter = 0;
  	  thenableState = null;
  	}
  	function mountWorkInProgressHook() {
  	  var hook = {
  	    memoizedState: null,
  	    baseState: null,
  	    baseQueue: null,
  	    queue: null,
  	    next: null
  	  };
  	  null === workInProgressHook
  	    ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)
  	    : (workInProgressHook = workInProgressHook.next = hook);
  	  return workInProgressHook;
  	}
  	function updateWorkInProgressHook() {
  	  if (null === currentHook) {
  	    var nextCurrentHook = currentlyRenderingFiber.alternate;
  	    nextCurrentHook =
  	      null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
  	  } else nextCurrentHook = currentHook.next;
  	  var nextWorkInProgressHook =
  	    null === workInProgressHook
  	      ? currentlyRenderingFiber.memoizedState
  	      : workInProgressHook.next;
  	  if (null !== nextWorkInProgressHook)
  	    (workInProgressHook = nextWorkInProgressHook),
  	      (currentHook = nextCurrentHook);
  	  else {
  	    if (null === nextCurrentHook) {
  	      if (null === currentlyRenderingFiber.alternate)
  	        throw Error(formatProdErrorMessage(467));
  	      throw Error(formatProdErrorMessage(310));
  	    }
  	    currentHook = nextCurrentHook;
  	    nextCurrentHook = {
  	      memoizedState: currentHook.memoizedState,
  	      baseState: currentHook.baseState,
  	      baseQueue: currentHook.baseQueue,
  	      queue: currentHook.queue,
  	      next: null
  	    };
  	    null === workInProgressHook
  	      ? (currentlyRenderingFiber.memoizedState = workInProgressHook =
  	          nextCurrentHook)
  	      : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
  	  }
  	  return workInProgressHook;
  	}
  	function createFunctionComponentUpdateQueue() {
  	  return { lastEffect: null, events: null, stores: null, memoCache: null };
  	}
  	function useThenable(thenable) {
  	  var index = thenableIndexCounter;
  	  thenableIndexCounter += 1;
  	  null === thenableState && (thenableState = []);
  	  thenable = trackUsedThenable(thenableState, thenable, index);
  	  index = currentlyRenderingFiber;
  	  null ===
  	    (null === workInProgressHook
  	      ? index.memoizedState
  	      : workInProgressHook.next) &&
  	    ((index = index.alternate),
  	    (ReactSharedInternals.H =
  	      null === index || null === index.memoizedState
  	        ? HooksDispatcherOnMount
  	        : HooksDispatcherOnUpdate));
  	  return thenable;
  	}
  	function use(usable) {
  	  if (null !== usable && "object" === typeof usable) {
  	    if ("function" === typeof usable.then) return useThenable(usable);
  	    if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
  	  }
  	  throw Error(formatProdErrorMessage(438, String(usable)));
  	}
  	function useMemoCache(size) {
  	  var memoCache = null,
  	    updateQueue = currentlyRenderingFiber.updateQueue;
  	  null !== updateQueue && (memoCache = updateQueue.memoCache);
  	  if (null == memoCache) {
  	    var current = currentlyRenderingFiber.alternate;
  	    null !== current &&
  	      ((current = current.updateQueue),
  	      null !== current &&
  	        ((current = current.memoCache),
  	        null != current &&
  	          (memoCache = {
  	            data: current.data.map(function (array) {
  	              return array.slice();
  	            }),
  	            index: 0
  	          })));
  	  }
  	  null == memoCache && (memoCache = { data: [], index: 0 });
  	  null === updateQueue &&
  	    ((updateQueue = createFunctionComponentUpdateQueue()),
  	    (currentlyRenderingFiber.updateQueue = updateQueue));
  	  updateQueue.memoCache = memoCache;
  	  updateQueue = memoCache.data[memoCache.index];
  	  if (void 0 === updateQueue)
  	    for (
  	      updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
  	      current < size;
  	      current++
  	    )
  	      updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
  	  memoCache.index++;
  	  return updateQueue;
  	}
  	function basicStateReducer(state, action) {
  	  return "function" === typeof action ? action(state) : action;
  	}
  	function updateReducer(reducer) {
  	  var hook = updateWorkInProgressHook();
  	  return updateReducerImpl(hook, currentHook, reducer);
  	}
  	function updateReducerImpl(hook, current, reducer) {
  	  var queue = hook.queue;
  	  if (null === queue) throw Error(formatProdErrorMessage(311));
  	  queue.lastRenderedReducer = reducer;
  	  var baseQueue = hook.baseQueue,
  	    pendingQueue = queue.pending;
  	  if (null !== pendingQueue) {
  	    if (null !== baseQueue) {
  	      var baseFirst = baseQueue.next;
  	      baseQueue.next = pendingQueue.next;
  	      pendingQueue.next = baseFirst;
  	    }
  	    current.baseQueue = baseQueue = pendingQueue;
  	    queue.pending = null;
  	  }
  	  pendingQueue = hook.baseState;
  	  if (null === baseQueue) hook.memoizedState = pendingQueue;
  	  else {
  	    current = baseQueue.next;
  	    var newBaseQueueFirst = (baseFirst = null),
  	      newBaseQueueLast = null,
  	      update = current,
  	      didReadFromEntangledAsyncAction$60 = false;
  	    do {
  	      var updateLane = update.lane & -536870913;
  	      if (
  	        updateLane !== update.lane
  	          ? (workInProgressRootRenderLanes & updateLane) === updateLane
  	          : (renderLanes & updateLane) === updateLane
  	      ) {
  	        var revertLane = update.revertLane;
  	        if (0 === revertLane)
  	          null !== newBaseQueueLast &&
  	            (newBaseQueueLast = newBaseQueueLast.next =
  	              {
  	                lane: 0,
  	                revertLane: 0,
  	                gesture: null,
  	                action: update.action,
  	                hasEagerState: update.hasEagerState,
  	                eagerState: update.eagerState,
  	                next: null
  	              }),
  	            updateLane === currentEntangledLane &&
  	              (didReadFromEntangledAsyncAction$60 = true);
  	        else if ((renderLanes & revertLane) === revertLane) {
  	          update = update.next;
  	          revertLane === currentEntangledLane &&
  	            (didReadFromEntangledAsyncAction$60 = true);
  	          continue;
  	        } else
  	          (updateLane = {
  	            lane: 0,
  	            revertLane: update.revertLane,
  	            gesture: null,
  	            action: update.action,
  	            hasEagerState: update.hasEagerState,
  	            eagerState: update.eagerState,
  	            next: null
  	          }),
  	            null === newBaseQueueLast
  	              ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
  	                (baseFirst = pendingQueue))
  	              : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
  	            (currentlyRenderingFiber.lanes |= revertLane),
  	            (workInProgressRootSkippedLanes |= revertLane);
  	        updateLane = update.action;
  	        shouldDoubleInvokeUserFnsInHooksDEV &&
  	          reducer(pendingQueue, updateLane);
  	        pendingQueue = update.hasEagerState
  	          ? update.eagerState
  	          : reducer(pendingQueue, updateLane);
  	      } else
  	        (revertLane = {
  	          lane: updateLane,
  	          revertLane: update.revertLane,
  	          gesture: update.gesture,
  	          action: update.action,
  	          hasEagerState: update.hasEagerState,
  	          eagerState: update.eagerState,
  	          next: null
  	        }),
  	          null === newBaseQueueLast
  	            ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
  	              (baseFirst = pendingQueue))
  	            : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
  	          (currentlyRenderingFiber.lanes |= updateLane),
  	          (workInProgressRootSkippedLanes |= updateLane);
  	      update = update.next;
  	    } while (null !== update && update !== current);
  	    null === newBaseQueueLast
  	      ? (baseFirst = pendingQueue)
  	      : (newBaseQueueLast.next = newBaseQueueFirst);
  	    if (
  	      !objectIs(pendingQueue, hook.memoizedState) &&
  	      ((didReceiveUpdate = true),
  	      didReadFromEntangledAsyncAction$60 &&
  	        ((reducer = currentEntangledActionThenable), null !== reducer))
  	    )
  	      throw reducer;
  	    hook.memoizedState = pendingQueue;
  	    hook.baseState = baseFirst;
  	    hook.baseQueue = newBaseQueueLast;
  	    queue.lastRenderedState = pendingQueue;
  	  }
  	  null === baseQueue && (queue.lanes = 0);
  	  return [hook.memoizedState, queue.dispatch];
  	}
  	function rerenderReducer(reducer) {
  	  var hook = updateWorkInProgressHook(),
  	    queue = hook.queue;
  	  if (null === queue) throw Error(formatProdErrorMessage(311));
  	  queue.lastRenderedReducer = reducer;
  	  var dispatch = queue.dispatch,
  	    lastRenderPhaseUpdate = queue.pending,
  	    newState = hook.memoizedState;
  	  if (null !== lastRenderPhaseUpdate) {
  	    queue.pending = null;
  	    var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
  	    do (newState = reducer(newState, update.action)), (update = update.next);
  	    while (update !== lastRenderPhaseUpdate);
  	    objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true);
  	    hook.memoizedState = newState;
  	    null === hook.baseQueue && (hook.baseState = newState);
  	    queue.lastRenderedState = newState;
  	  }
  	  return [newState, dispatch];
  	}
  	function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
  	  var fiber = currentlyRenderingFiber,
  	    hook = updateWorkInProgressHook(),
  	    isHydrating$jscomp$0 = isHydrating;
  	  if (isHydrating$jscomp$0) {
  	    if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
  	    getServerSnapshot = getServerSnapshot();
  	  } else getServerSnapshot = getSnapshot();
  	  var snapshotChanged = !objectIs(
  	    (currentHook || hook).memoizedState,
  	    getServerSnapshot
  	  );
  	  snapshotChanged &&
  	    ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = true));
  	  hook = hook.queue;
  	  updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
  	    subscribe
  	  ]);
  	  if (
  	    hook.getSnapshot !== getSnapshot ||
  	    snapshotChanged ||
  	    (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1)
  	  ) {
  	    fiber.flags |= 2048;
  	    pushSimpleEffect(
  	      9,
  	      { destroy: void 0 },
  	      updateStoreInstance.bind(
  	        null,
  	        fiber,
  	        hook,
  	        getServerSnapshot,
  	        getSnapshot
  	      ),
  	      null
  	    );
  	    if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
  	    isHydrating$jscomp$0 ||
  	      0 !== (renderLanes & 127) ||
  	      pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
  	  }
  	  return getServerSnapshot;
  	}
  	function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
  	  fiber.flags |= 16384;
  	  fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
  	  getSnapshot = currentlyRenderingFiber.updateQueue;
  	  null === getSnapshot
  	    ? ((getSnapshot = createFunctionComponentUpdateQueue()),
  	      (currentlyRenderingFiber.updateQueue = getSnapshot),
  	      (getSnapshot.stores = [fiber]))
  	    : ((renderedSnapshot = getSnapshot.stores),
  	      null === renderedSnapshot
  	        ? (getSnapshot.stores = [fiber])
  	        : renderedSnapshot.push(fiber));
  	}
  	function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
  	  inst.value = nextSnapshot;
  	  inst.getSnapshot = getSnapshot;
  	  checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
  	}
  	function subscribeToStore(fiber, inst, subscribe) {
  	  return subscribe(function () {
  	    checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
  	  });
  	}
  	function checkIfSnapshotChanged(inst) {
  	  var latestGetSnapshot = inst.getSnapshot;
  	  inst = inst.value;
  	  try {
  	    var nextValue = latestGetSnapshot();
  	    return !objectIs(inst, nextValue);
  	  } catch (error) {
  	    return true;
  	  }
  	}
  	function forceStoreRerender(fiber) {
  	  var root = enqueueConcurrentRenderForLane(fiber, 2);
  	  null !== root && scheduleUpdateOnFiber(root, fiber, 2);
  	}
  	function mountStateImpl(initialState) {
  	  var hook = mountWorkInProgressHook();
  	  if ("function" === typeof initialState) {
  	    var initialStateInitializer = initialState;
  	    initialState = initialStateInitializer();
  	    if (shouldDoubleInvokeUserFnsInHooksDEV) {
  	      setIsStrictModeForDevtools(true);
  	      try {
  	        initialStateInitializer();
  	      } finally {
  	        setIsStrictModeForDevtools(false);
  	      }
  	    }
  	  }
  	  hook.memoizedState = hook.baseState = initialState;
  	  hook.queue = {
  	    pending: null,
  	    lanes: 0,
  	    dispatch: null,
  	    lastRenderedReducer: basicStateReducer,
  	    lastRenderedState: initialState
  	  };
  	  return hook;
  	}
  	function updateOptimisticImpl(hook, current, passthrough, reducer) {
  	  hook.baseState = passthrough;
  	  return updateReducerImpl(
  	    hook,
  	    currentHook,
  	    "function" === typeof reducer ? reducer : basicStateReducer
  	  );
  	}
  	function dispatchActionState(
  	  fiber,
  	  actionQueue,
  	  setPendingState,
  	  setState,
  	  payload
  	) {
  	  if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
  	  fiber = actionQueue.action;
  	  if (null !== fiber) {
  	    var actionNode = {
  	      payload: payload,
  	      action: fiber,
  	      next: null,
  	      isTransition: true,
  	      status: "pending",
  	      value: null,
  	      reason: null,
  	      listeners: [],
  	      then: function (listener) {
  	        actionNode.listeners.push(listener);
  	      }
  	    };
  	    null !== ReactSharedInternals.T
  	      ? setPendingState(true)
  	      : (actionNode.isTransition = false);
  	    setState(actionNode);
  	    setPendingState = actionQueue.pending;
  	    null === setPendingState
  	      ? ((actionNode.next = actionQueue.pending = actionNode),
  	        runActionStateAction(actionQueue, actionNode))
  	      : ((actionNode.next = setPendingState.next),
  	        (actionQueue.pending = setPendingState.next = actionNode));
  	  }
  	}
  	function runActionStateAction(actionQueue, node) {
  	  var action = node.action,
  	    payload = node.payload,
  	    prevState = actionQueue.state;
  	  if (node.isTransition) {
  	    var prevTransition = ReactSharedInternals.T,
  	      currentTransition = {};
  	    ReactSharedInternals.T = currentTransition;
  	    try {
  	      var returnValue = action(prevState, payload),
  	        onStartTransitionFinish = ReactSharedInternals.S;
  	      null !== onStartTransitionFinish &&
  	        onStartTransitionFinish(currentTransition, returnValue);
  	      handleActionReturnValue(actionQueue, node, returnValue);
  	    } catch (error) {
  	      onActionError(actionQueue, node, error);
  	    } finally {
  	      null !== prevTransition &&
  	        null !== currentTransition.types &&
  	        (prevTransition.types = currentTransition.types),
  	        (ReactSharedInternals.T = prevTransition);
  	    }
  	  } else
  	    try {
  	      (prevTransition = action(prevState, payload)),
  	        handleActionReturnValue(actionQueue, node, prevTransition);
  	    } catch (error$66) {
  	      onActionError(actionQueue, node, error$66);
  	    }
  	}
  	function handleActionReturnValue(actionQueue, node, returnValue) {
  	  null !== returnValue &&
  	  "object" === typeof returnValue &&
  	  "function" === typeof returnValue.then
  	    ? returnValue.then(
  	        function (nextState) {
  	          onActionSuccess(actionQueue, node, nextState);
  	        },
  	        function (error) {
  	          return onActionError(actionQueue, node, error);
  	        }
  	      )
  	    : onActionSuccess(actionQueue, node, returnValue);
  	}
  	function onActionSuccess(actionQueue, actionNode, nextState) {
  	  actionNode.status = "fulfilled";
  	  actionNode.value = nextState;
  	  notifyActionListeners(actionNode);
  	  actionQueue.state = nextState;
  	  actionNode = actionQueue.pending;
  	  null !== actionNode &&
  	    ((nextState = actionNode.next),
  	    nextState === actionNode
  	      ? (actionQueue.pending = null)
  	      : ((nextState = nextState.next),
  	        (actionNode.next = nextState),
  	        runActionStateAction(actionQueue, nextState)));
  	}
  	function onActionError(actionQueue, actionNode, error) {
  	  var last = actionQueue.pending;
  	  actionQueue.pending = null;
  	  if (null !== last) {
  	    last = last.next;
  	    do
  	      (actionNode.status = "rejected"),
  	        (actionNode.reason = error),
  	        notifyActionListeners(actionNode),
  	        (actionNode = actionNode.next);
  	    while (actionNode !== last);
  	  }
  	  actionQueue.action = null;
  	}
  	function notifyActionListeners(actionNode) {
  	  actionNode = actionNode.listeners;
  	  for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
  	}
  	function actionStateReducer(oldState, newState) {
  	  return newState;
  	}
  	function mountActionState(action, initialStateProp) {
  	  if (isHydrating) {
  	    var ssrFormState = workInProgressRoot.formState;
  	    if (null !== ssrFormState) {
  	      a: {
  	        var JSCompiler_inline_result = currentlyRenderingFiber;
  	        if (isHydrating) {
  	          if (nextHydratableInstance) {
  	            b: {
  	              var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
  	              for (
  	                var inRootOrSingleton = rootOrSingletonContext;
  	                8 !== JSCompiler_inline_result$jscomp$0.nodeType;

  	              ) {
  	                if (!inRootOrSingleton) {
  	                  JSCompiler_inline_result$jscomp$0 = null;
  	                  break b;
  	                }
  	                JSCompiler_inline_result$jscomp$0 = getNextHydratable(
  	                  JSCompiler_inline_result$jscomp$0.nextSibling
  	                );
  	                if (null === JSCompiler_inline_result$jscomp$0) {
  	                  JSCompiler_inline_result$jscomp$0 = null;
  	                  break b;
  	                }
  	              }
  	              inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
  	              JSCompiler_inline_result$jscomp$0 =
  	                "F!" === inRootOrSingleton || "F" === inRootOrSingleton
  	                  ? JSCompiler_inline_result$jscomp$0
  	                  : null;
  	            }
  	            if (JSCompiler_inline_result$jscomp$0) {
  	              nextHydratableInstance = getNextHydratable(
  	                JSCompiler_inline_result$jscomp$0.nextSibling
  	              );
  	              JSCompiler_inline_result =
  	                "F!" === JSCompiler_inline_result$jscomp$0.data;
  	              break a;
  	            }
  	          }
  	          throwOnHydrationMismatch(JSCompiler_inline_result);
  	        }
  	        JSCompiler_inline_result = false;
  	      }
  	      JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
  	    }
  	  }
  	  ssrFormState = mountWorkInProgressHook();
  	  ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
  	  JSCompiler_inline_result = {
  	    pending: null,
  	    lanes: 0,
  	    dispatch: null,
  	    lastRenderedReducer: actionStateReducer,
  	    lastRenderedState: initialStateProp
  	  };
  	  ssrFormState.queue = JSCompiler_inline_result;
  	  ssrFormState = dispatchSetState.bind(
  	    null,
  	    currentlyRenderingFiber,
  	    JSCompiler_inline_result
  	  );
  	  JSCompiler_inline_result.dispatch = ssrFormState;
  	  JSCompiler_inline_result = mountStateImpl(false);
  	  inRootOrSingleton = dispatchOptimisticSetState.bind(
  	    null,
  	    currentlyRenderingFiber,
  	    false,
  	    JSCompiler_inline_result.queue
  	  );
  	  JSCompiler_inline_result = mountWorkInProgressHook();
  	  JSCompiler_inline_result$jscomp$0 = {
  	    state: initialStateProp,
  	    dispatch: null,
  	    action: action,
  	    pending: null
  	  };
  	  JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
  	  ssrFormState = dispatchActionState.bind(
  	    null,
  	    currentlyRenderingFiber,
  	    JSCompiler_inline_result$jscomp$0,
  	    inRootOrSingleton,
  	    ssrFormState
  	  );
  	  JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
  	  JSCompiler_inline_result.memoizedState = action;
  	  return [initialStateProp, ssrFormState, false];
  	}
  	function updateActionState(action) {
  	  var stateHook = updateWorkInProgressHook();
  	  return updateActionStateImpl(stateHook, currentHook, action);
  	}
  	function updateActionStateImpl(stateHook, currentStateHook, action) {
  	  currentStateHook = updateReducerImpl(
  	    stateHook,
  	    currentStateHook,
  	    actionStateReducer
  	  )[0];
  	  stateHook = updateReducer(basicStateReducer)[0];
  	  if (
  	    "object" === typeof currentStateHook &&
  	    null !== currentStateHook &&
  	    "function" === typeof currentStateHook.then
  	  )
  	    try {
  	      var state = useThenable(currentStateHook);
  	    } catch (x) {
  	      if (x === SuspenseException) throw SuspenseActionException;
  	      throw x;
  	    }
  	  else state = currentStateHook;
  	  currentStateHook = updateWorkInProgressHook();
  	  var actionQueue = currentStateHook.queue,
  	    dispatch = actionQueue.dispatch;
  	  action !== currentStateHook.memoizedState &&
  	    ((currentlyRenderingFiber.flags |= 2048),
  	    pushSimpleEffect(
  	      9,
  	      { destroy: void 0 },
  	      actionStateActionEffect.bind(null, actionQueue, action),
  	      null
  	    ));
  	  return [state, dispatch, stateHook];
  	}
  	function actionStateActionEffect(actionQueue, action) {
  	  actionQueue.action = action;
  	}
  	function rerenderActionState(action) {
  	  var stateHook = updateWorkInProgressHook(),
  	    currentStateHook = currentHook;
  	  if (null !== currentStateHook)
  	    return updateActionStateImpl(stateHook, currentStateHook, action);
  	  updateWorkInProgressHook();
  	  stateHook = stateHook.memoizedState;
  	  currentStateHook = updateWorkInProgressHook();
  	  var dispatch = currentStateHook.queue.dispatch;
  	  currentStateHook.memoizedState = action;
  	  return [stateHook, dispatch, false];
  	}
  	function pushSimpleEffect(tag, inst, create, deps) {
  	  tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
  	  inst = currentlyRenderingFiber.updateQueue;
  	  null === inst &&
  	    ((inst = createFunctionComponentUpdateQueue()),
  	    (currentlyRenderingFiber.updateQueue = inst));
  	  create = inst.lastEffect;
  	  null === create
  	    ? (inst.lastEffect = tag.next = tag)
  	    : ((deps = create.next),
  	      (create.next = tag),
  	      (tag.next = deps),
  	      (inst.lastEffect = tag));
  	  return tag;
  	}
  	function updateRef() {
  	  return updateWorkInProgressHook().memoizedState;
  	}
  	function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
  	  var hook = mountWorkInProgressHook();
  	  currentlyRenderingFiber.flags |= fiberFlags;
  	  hook.memoizedState = pushSimpleEffect(
  	    1 | hookFlags,
  	    { destroy: void 0 },
  	    create,
  	    void 0 === deps ? null : deps
  	  );
  	}
  	function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
  	  var hook = updateWorkInProgressHook();
  	  deps = void 0 === deps ? null : deps;
  	  var inst = hook.memoizedState.inst;
  	  null !== currentHook &&
  	  null !== deps &&
  	  areHookInputsEqual(deps, currentHook.memoizedState.deps)
  	    ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
  	    : ((currentlyRenderingFiber.flags |= fiberFlags),
  	      (hook.memoizedState = pushSimpleEffect(
  	        1 | hookFlags,
  	        inst,
  	        create,
  	        deps
  	      )));
  	}
  	function mountEffect(create, deps) {
  	  mountEffectImpl(8390656, 8, create, deps);
  	}
  	function updateEffect(create, deps) {
  	  updateEffectImpl(2048, 8, create, deps);
  	}
  	function useEffectEventImpl(payload) {
  	  currentlyRenderingFiber.flags |= 4;
  	  var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
  	  if (null === componentUpdateQueue)
  	    (componentUpdateQueue = createFunctionComponentUpdateQueue()),
  	      (currentlyRenderingFiber.updateQueue = componentUpdateQueue),
  	      (componentUpdateQueue.events = [payload]);
  	  else {
  	    var events = componentUpdateQueue.events;
  	    null === events
  	      ? (componentUpdateQueue.events = [payload])
  	      : events.push(payload);
  	  }
  	}
  	function updateEvent(callback) {
  	  var ref = updateWorkInProgressHook().memoizedState;
  	  useEffectEventImpl({ ref: ref, nextImpl: callback });
  	  return function () {
  	    if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
  	    return ref.impl.apply(void 0, arguments);
  	  };
  	}
  	function updateInsertionEffect(create, deps) {
  	  return updateEffectImpl(4, 2, create, deps);
  	}
  	function updateLayoutEffect(create, deps) {
  	  return updateEffectImpl(4, 4, create, deps);
  	}
  	function imperativeHandleEffect(create, ref) {
  	  if ("function" === typeof ref) {
  	    create = create();
  	    var refCleanup = ref(create);
  	    return function () {
  	      "function" === typeof refCleanup ? refCleanup() : ref(null);
  	    };
  	  }
  	  if (null !== ref && void 0 !== ref)
  	    return (
  	      (create = create()),
  	      (ref.current = create),
  	      function () {
  	        ref.current = null;
  	      }
  	    );
  	}
  	function updateImperativeHandle(ref, create, deps) {
  	  deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  	  updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
  	}
  	function mountDebugValue() {}
  	function updateCallback(callback, deps) {
  	  var hook = updateWorkInProgressHook();
  	  deps = void 0 === deps ? null : deps;
  	  var prevState = hook.memoizedState;
  	  if (null !== deps && areHookInputsEqual(deps, prevState[1]))
  	    return prevState[0];
  	  hook.memoizedState = [callback, deps];
  	  return callback;
  	}
  	function updateMemo(nextCreate, deps) {
  	  var hook = updateWorkInProgressHook();
  	  deps = void 0 === deps ? null : deps;
  	  var prevState = hook.memoizedState;
  	  if (null !== deps && areHookInputsEqual(deps, prevState[1]))
  	    return prevState[0];
  	  prevState = nextCreate();
  	  if (shouldDoubleInvokeUserFnsInHooksDEV) {
  	    setIsStrictModeForDevtools(true);
  	    try {
  	      nextCreate();
  	    } finally {
  	      setIsStrictModeForDevtools(false);
  	    }
  	  }
  	  hook.memoizedState = [prevState, deps];
  	  return prevState;
  	}
  	function mountDeferredValueImpl(hook, value, initialValue) {
  	  if (
  	    void 0 === initialValue ||
  	    (0 !== (renderLanes & 1073741824) &&
  	      0 === (workInProgressRootRenderLanes & 261930))
  	  )
  	    return (hook.memoizedState = value);
  	  hook.memoizedState = initialValue;
  	  hook = requestDeferredLane();
  	  currentlyRenderingFiber.lanes |= hook;
  	  workInProgressRootSkippedLanes |= hook;
  	  return initialValue;
  	}
  	function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
  	  if (objectIs(value, prevValue)) return value;
  	  if (null !== currentTreeHiddenStackCursor.current)
  	    return (
  	      (hook = mountDeferredValueImpl(hook, value, initialValue)),
  	      objectIs(hook, prevValue) || (didReceiveUpdate = true),
  	      hook
  	    );
  	  if (
  	    0 === (renderLanes & 42) ||
  	    (0 !== (renderLanes & 1073741824) &&
  	      0 === (workInProgressRootRenderLanes & 261930))
  	  )
  	    return (didReceiveUpdate = true), (hook.memoizedState = value);
  	  hook = requestDeferredLane();
  	  currentlyRenderingFiber.lanes |= hook;
  	  workInProgressRootSkippedLanes |= hook;
  	  return prevValue;
  	}
  	function startTransition(fiber, queue, pendingState, finishedState, callback) {
  	  var previousPriority = ReactDOMSharedInternals.p;
  	  ReactDOMSharedInternals.p =
  	    0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
  	  var prevTransition = ReactSharedInternals.T,
  	    currentTransition = {};
  	  ReactSharedInternals.T = currentTransition;
  	  dispatchOptimisticSetState(fiber, false, queue, pendingState);
  	  try {
  	    var returnValue = callback(),
  	      onStartTransitionFinish = ReactSharedInternals.S;
  	    null !== onStartTransitionFinish &&
  	      onStartTransitionFinish(currentTransition, returnValue);
  	    if (
  	      null !== returnValue &&
  	      "object" === typeof returnValue &&
  	      "function" === typeof returnValue.then
  	    ) {
  	      var thenableForFinishedState = chainThenableValue(
  	        returnValue,
  	        finishedState
  	      );
  	      dispatchSetStateInternal(
  	        fiber,
  	        queue,
  	        thenableForFinishedState,
  	        requestUpdateLane(fiber)
  	      );
  	    } else
  	      dispatchSetStateInternal(
  	        fiber,
  	        queue,
  	        finishedState,
  	        requestUpdateLane(fiber)
  	      );
  	  } catch (error) {
  	    dispatchSetStateInternal(
  	      fiber,
  	      queue,
  	      { then: function () {}, status: "rejected", reason: error },
  	      requestUpdateLane()
  	    );
  	  } finally {
  	    (ReactDOMSharedInternals.p = previousPriority),
  	      null !== prevTransition &&
  	        null !== currentTransition.types &&
  	        (prevTransition.types = currentTransition.types),
  	      (ReactSharedInternals.T = prevTransition);
  	  }
  	}
  	function noop() {}
  	function startHostTransition(formFiber, pendingState, action, formData) {
  	  if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
  	  var queue = ensureFormComponentIsStateful(formFiber).queue;
  	  startTransition(
  	    formFiber,
  	    queue,
  	    pendingState,
  	    sharedNotPendingObject,
  	    null === action
  	      ? noop
  	      : function () {
  	          requestFormReset$1(formFiber);
  	          return action(formData);
  	        }
  	  );
  	}
  	function ensureFormComponentIsStateful(formFiber) {
  	  var existingStateHook = formFiber.memoizedState;
  	  if (null !== existingStateHook) return existingStateHook;
  	  existingStateHook = {
  	    memoizedState: sharedNotPendingObject,
  	    baseState: sharedNotPendingObject,
  	    baseQueue: null,
  	    queue: {
  	      pending: null,
  	      lanes: 0,
  	      dispatch: null,
  	      lastRenderedReducer: basicStateReducer,
  	      lastRenderedState: sharedNotPendingObject
  	    },
  	    next: null
  	  };
  	  var initialResetState = {};
  	  existingStateHook.next = {
  	    memoizedState: initialResetState,
  	    baseState: initialResetState,
  	    baseQueue: null,
  	    queue: {
  	      pending: null,
  	      lanes: 0,
  	      dispatch: null,
  	      lastRenderedReducer: basicStateReducer,
  	      lastRenderedState: initialResetState
  	    },
  	    next: null
  	  };
  	  formFiber.memoizedState = existingStateHook;
  	  formFiber = formFiber.alternate;
  	  null !== formFiber && (formFiber.memoizedState = existingStateHook);
  	  return existingStateHook;
  	}
  	function requestFormReset$1(formFiber) {
  	  var stateHook = ensureFormComponentIsStateful(formFiber);
  	  null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);
  	  dispatchSetStateInternal(
  	    formFiber,
  	    stateHook.next.queue,
  	    {},
  	    requestUpdateLane()
  	  );
  	}
  	function useHostTransitionStatus() {
  	  return readContext(HostTransitionContext);
  	}
  	function updateId() {
  	  return updateWorkInProgressHook().memoizedState;
  	}
  	function updateRefresh() {
  	  return updateWorkInProgressHook().memoizedState;
  	}
  	function refreshCache(fiber) {
  	  for (var provider = fiber.return; null !== provider; ) {
  	    switch (provider.tag) {
  	      case 24:
  	      case 3:
  	        var lane = requestUpdateLane();
  	        fiber = createUpdate(lane);
  	        var root$69 = enqueueUpdate(provider, fiber, lane);
  	        null !== root$69 &&
  	          (scheduleUpdateOnFiber(root$69, provider, lane),
  	          entangleTransitions(root$69, provider, lane));
  	        provider = { cache: createCache() };
  	        fiber.payload = provider;
  	        return;
  	    }
  	    provider = provider.return;
  	  }
  	}
  	function dispatchReducerAction(fiber, queue, action) {
  	  var lane = requestUpdateLane();
  	  action = {
  	    lane: lane,
  	    revertLane: 0,
  	    gesture: null,
  	    action: action,
  	    hasEagerState: false,
  	    eagerState: null,
  	    next: null
  	  };
  	  isRenderPhaseUpdate(fiber)
  	    ? enqueueRenderPhaseUpdate(queue, action)
  	    : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),
  	      null !== action &&
  	        (scheduleUpdateOnFiber(action, fiber, lane),
  	        entangleTransitionUpdate(action, queue, lane)));
  	}
  	function dispatchSetState(fiber, queue, action) {
  	  var lane = requestUpdateLane();
  	  dispatchSetStateInternal(fiber, queue, action, lane);
  	}
  	function dispatchSetStateInternal(fiber, queue, action, lane) {
  	  var update = {
  	    lane: lane,
  	    revertLane: 0,
  	    gesture: null,
  	    action: action,
  	    hasEagerState: false,
  	    eagerState: null,
  	    next: null
  	  };
  	  if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
  	  else {
  	    var alternate = fiber.alternate;
  	    if (
  	      0 === fiber.lanes &&
  	      (null === alternate || 0 === alternate.lanes) &&
  	      ((alternate = queue.lastRenderedReducer), null !== alternate)
  	    )
  	      try {
  	        var currentState = queue.lastRenderedState,
  	          eagerState = alternate(currentState, action);
  	        update.hasEagerState = !0;
  	        update.eagerState = eagerState;
  	        if (objectIs(eagerState, currentState))
  	          return (
  	            enqueueUpdate$1(fiber, queue, update, 0),
  	            null === workInProgressRoot && finishQueueingConcurrentUpdates(),
  	            !1
  	          );
  	      } catch (error) {
  	      } finally {
  	      }
  	    action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
  	    if (null !== action)
  	      return (
  	        scheduleUpdateOnFiber(action, fiber, lane),
  	        entangleTransitionUpdate(action, queue, lane),
  	        true
  	      );
  	  }
  	  return false;
  	}
  	function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
  	  action = {
  	    lane: 2,
  	    revertLane: requestTransitionLane(),
  	    gesture: null,
  	    action: action,
  	    hasEagerState: false,
  	    eagerState: null,
  	    next: null
  	  };
  	  if (isRenderPhaseUpdate(fiber)) {
  	    if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
  	  } else
  	    (throwIfDuringRender = enqueueConcurrentHookUpdate(
  	      fiber,
  	      queue,
  	      action,
  	      2
  	    )),
  	      null !== throwIfDuringRender &&
  	        scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
  	}
  	function isRenderPhaseUpdate(fiber) {
  	  var alternate = fiber.alternate;
  	  return (
  	    fiber === currentlyRenderingFiber ||
  	    (null !== alternate && alternate === currentlyRenderingFiber)
  	  );
  	}
  	function enqueueRenderPhaseUpdate(queue, update) {
  	  didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =
  	    true;
  	  var pending = queue.pending;
  	  null === pending
  	    ? (update.next = update)
  	    : ((update.next = pending.next), (pending.next = update));
  	  queue.pending = update;
  	}
  	function entangleTransitionUpdate(root, queue, lane) {
  	  if (0 !== (lane & 4194048)) {
  	    var queueLanes = queue.lanes;
  	    queueLanes &= root.pendingLanes;
  	    lane |= queueLanes;
  	    queue.lanes = lane;
  	    markRootEntangled(root, lane);
  	  }
  	}
  	var ContextOnlyDispatcher = {
  	  readContext: readContext,
  	  use: use,
  	  useCallback: throwInvalidHookError,
  	  useContext: throwInvalidHookError,
  	  useEffect: throwInvalidHookError,
  	  useImperativeHandle: throwInvalidHookError,
  	  useLayoutEffect: throwInvalidHookError,
  	  useInsertionEffect: throwInvalidHookError,
  	  useMemo: throwInvalidHookError,
  	  useReducer: throwInvalidHookError,
  	  useRef: throwInvalidHookError,
  	  useState: throwInvalidHookError,
  	  useDebugValue: throwInvalidHookError,
  	  useDeferredValue: throwInvalidHookError,
  	  useTransition: throwInvalidHookError,
  	  useSyncExternalStore: throwInvalidHookError,
  	  useId: throwInvalidHookError,
  	  useHostTransitionStatus: throwInvalidHookError,
  	  useFormState: throwInvalidHookError,
  	  useActionState: throwInvalidHookError,
  	  useOptimistic: throwInvalidHookError,
  	  useMemoCache: throwInvalidHookError,
  	  useCacheRefresh: throwInvalidHookError
  	};
  	ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
  	var HooksDispatcherOnMount = {
  	    readContext: readContext,
  	    use: use,
  	    useCallback: function (callback, deps) {
  	      mountWorkInProgressHook().memoizedState = [
  	        callback,
  	        void 0 === deps ? null : deps
  	      ];
  	      return callback;
  	    },
  	    useContext: readContext,
  	    useEffect: mountEffect,
  	    useImperativeHandle: function (ref, create, deps) {
  	      deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  	      mountEffectImpl(
  	        4194308,
  	        4,
  	        imperativeHandleEffect.bind(null, create, ref),
  	        deps
  	      );
  	    },
  	    useLayoutEffect: function (create, deps) {
  	      return mountEffectImpl(4194308, 4, create, deps);
  	    },
  	    useInsertionEffect: function (create, deps) {
  	      mountEffectImpl(4, 2, create, deps);
  	    },
  	    useMemo: function (nextCreate, deps) {
  	      var hook = mountWorkInProgressHook();
  	      deps = void 0 === deps ? null : deps;
  	      var nextValue = nextCreate();
  	      if (shouldDoubleInvokeUserFnsInHooksDEV) {
  	        setIsStrictModeForDevtools(true);
  	        try {
  	          nextCreate();
  	        } finally {
  	          setIsStrictModeForDevtools(false);
  	        }
  	      }
  	      hook.memoizedState = [nextValue, deps];
  	      return nextValue;
  	    },
  	    useReducer: function (reducer, initialArg, init) {
  	      var hook = mountWorkInProgressHook();
  	      if (void 0 !== init) {
  	        var initialState = init(initialArg);
  	        if (shouldDoubleInvokeUserFnsInHooksDEV) {
  	          setIsStrictModeForDevtools(true);
  	          try {
  	            init(initialArg);
  	          } finally {
  	            setIsStrictModeForDevtools(false);
  	          }
  	        }
  	      } else initialState = initialArg;
  	      hook.memoizedState = hook.baseState = initialState;
  	      reducer = {
  	        pending: null,
  	        lanes: 0,
  	        dispatch: null,
  	        lastRenderedReducer: reducer,
  	        lastRenderedState: initialState
  	      };
  	      hook.queue = reducer;
  	      reducer = reducer.dispatch = dispatchReducerAction.bind(
  	        null,
  	        currentlyRenderingFiber,
  	        reducer
  	      );
  	      return [hook.memoizedState, reducer];
  	    },
  	    useRef: function (initialValue) {
  	      var hook = mountWorkInProgressHook();
  	      initialValue = { current: initialValue };
  	      return (hook.memoizedState = initialValue);
  	    },
  	    useState: function (initialState) {
  	      initialState = mountStateImpl(initialState);
  	      var queue = initialState.queue,
  	        dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
  	      queue.dispatch = dispatch;
  	      return [initialState.memoizedState, dispatch];
  	    },
  	    useDebugValue: mountDebugValue,
  	    useDeferredValue: function (value, initialValue) {
  	      var hook = mountWorkInProgressHook();
  	      return mountDeferredValueImpl(hook, value, initialValue);
  	    },
  	    useTransition: function () {
  	      var stateHook = mountStateImpl(false);
  	      stateHook = startTransition.bind(
  	        null,
  	        currentlyRenderingFiber,
  	        stateHook.queue,
  	        true,
  	        false
  	      );
  	      mountWorkInProgressHook().memoizedState = stateHook;
  	      return [false, stateHook];
  	    },
  	    useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
  	      var fiber = currentlyRenderingFiber,
  	        hook = mountWorkInProgressHook();
  	      if (isHydrating) {
  	        if (void 0 === getServerSnapshot)
  	          throw Error(formatProdErrorMessage(407));
  	        getServerSnapshot = getServerSnapshot();
  	      } else {
  	        getServerSnapshot = getSnapshot();
  	        if (null === workInProgressRoot)
  	          throw Error(formatProdErrorMessage(349));
  	        0 !== (workInProgressRootRenderLanes & 127) ||
  	          pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
  	      }
  	      hook.memoizedState = getServerSnapshot;
  	      var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };
  	      hook.queue = inst;
  	      mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
  	        subscribe
  	      ]);
  	      fiber.flags |= 2048;
  	      pushSimpleEffect(
  	        9,
  	        { destroy: void 0 },
  	        updateStoreInstance.bind(
  	          null,
  	          fiber,
  	          inst,
  	          getServerSnapshot,
  	          getSnapshot
  	        ),
  	        null
  	      );
  	      return getServerSnapshot;
  	    },
  	    useId: function () {
  	      var hook = mountWorkInProgressHook(),
  	        identifierPrefix = workInProgressRoot.identifierPrefix;
  	      if (isHydrating) {
  	        var JSCompiler_inline_result = treeContextOverflow;
  	        var idWithLeadingBit = treeContextId;
  	        JSCompiler_inline_result =
  	          (
  	            idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
  	          ).toString(32) + JSCompiler_inline_result;
  	        identifierPrefix =
  	          "_" + identifierPrefix + "R_" + JSCompiler_inline_result;
  	        JSCompiler_inline_result = localIdCounter++;
  	        0 < JSCompiler_inline_result &&
  	          (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
  	        identifierPrefix += "_";
  	      } else
  	        (JSCompiler_inline_result = globalClientIdCounter++),
  	          (identifierPrefix =
  	            "_" +
  	            identifierPrefix +
  	            "r_" +
  	            JSCompiler_inline_result.toString(32) +
  	            "_");
  	      return (hook.memoizedState = identifierPrefix);
  	    },
  	    useHostTransitionStatus: useHostTransitionStatus,
  	    useFormState: mountActionState,
  	    useActionState: mountActionState,
  	    useOptimistic: function (passthrough) {
  	      var hook = mountWorkInProgressHook();
  	      hook.memoizedState = hook.baseState = passthrough;
  	      var queue = {
  	        pending: null,
  	        lanes: 0,
  	        dispatch: null,
  	        lastRenderedReducer: null,
  	        lastRenderedState: null
  	      };
  	      hook.queue = queue;
  	      hook = dispatchOptimisticSetState.bind(
  	        null,
  	        currentlyRenderingFiber,
  	        true,
  	        queue
  	      );
  	      queue.dispatch = hook;
  	      return [passthrough, hook];
  	    },
  	    useMemoCache: useMemoCache,
  	    useCacheRefresh: function () {
  	      return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
  	        null,
  	        currentlyRenderingFiber
  	      ));
  	    },
  	    useEffectEvent: function (callback) {
  	      var hook = mountWorkInProgressHook(),
  	        ref = { impl: callback };
  	      hook.memoizedState = ref;
  	      return function () {
  	        if (0 !== (executionContext & 2))
  	          throw Error(formatProdErrorMessage(440));
  	        return ref.impl.apply(void 0, arguments);
  	      };
  	    }
  	  },
  	  HooksDispatcherOnUpdate = {
  	    readContext: readContext,
  	    use: use,
  	    useCallback: updateCallback,
  	    useContext: readContext,
  	    useEffect: updateEffect,
  	    useImperativeHandle: updateImperativeHandle,
  	    useInsertionEffect: updateInsertionEffect,
  	    useLayoutEffect: updateLayoutEffect,
  	    useMemo: updateMemo,
  	    useReducer: updateReducer,
  	    useRef: updateRef,
  	    useState: function () {
  	      return updateReducer(basicStateReducer);
  	    },
  	    useDebugValue: mountDebugValue,
  	    useDeferredValue: function (value, initialValue) {
  	      var hook = updateWorkInProgressHook();
  	      return updateDeferredValueImpl(
  	        hook,
  	        currentHook.memoizedState,
  	        value,
  	        initialValue
  	      );
  	    },
  	    useTransition: function () {
  	      var booleanOrThenable = updateReducer(basicStateReducer)[0],
  	        start = updateWorkInProgressHook().memoizedState;
  	      return [
  	        "boolean" === typeof booleanOrThenable
  	          ? booleanOrThenable
  	          : useThenable(booleanOrThenable),
  	        start
  	      ];
  	    },
  	    useSyncExternalStore: updateSyncExternalStore,
  	    useId: updateId,
  	    useHostTransitionStatus: useHostTransitionStatus,
  	    useFormState: updateActionState,
  	    useActionState: updateActionState,
  	    useOptimistic: function (passthrough, reducer) {
  	      var hook = updateWorkInProgressHook();
  	      return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
  	    },
  	    useMemoCache: useMemoCache,
  	    useCacheRefresh: updateRefresh
  	  };
  	HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
  	var HooksDispatcherOnRerender = {
  	  readContext: readContext,
  	  use: use,
  	  useCallback: updateCallback,
  	  useContext: readContext,
  	  useEffect: updateEffect,
  	  useImperativeHandle: updateImperativeHandle,
  	  useInsertionEffect: updateInsertionEffect,
  	  useLayoutEffect: updateLayoutEffect,
  	  useMemo: updateMemo,
  	  useReducer: rerenderReducer,
  	  useRef: updateRef,
  	  useState: function () {
  	    return rerenderReducer(basicStateReducer);
  	  },
  	  useDebugValue: mountDebugValue,
  	  useDeferredValue: function (value, initialValue) {
  	    var hook = updateWorkInProgressHook();
  	    return null === currentHook
  	      ? mountDeferredValueImpl(hook, value, initialValue)
  	      : updateDeferredValueImpl(
  	          hook,
  	          currentHook.memoizedState,
  	          value,
  	          initialValue
  	        );
  	  },
  	  useTransition: function () {
  	    var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
  	      start = updateWorkInProgressHook().memoizedState;
  	    return [
  	      "boolean" === typeof booleanOrThenable
  	        ? booleanOrThenable
  	        : useThenable(booleanOrThenable),
  	      start
  	    ];
  	  },
  	  useSyncExternalStore: updateSyncExternalStore,
  	  useId: updateId,
  	  useHostTransitionStatus: useHostTransitionStatus,
  	  useFormState: rerenderActionState,
  	  useActionState: rerenderActionState,
  	  useOptimistic: function (passthrough, reducer) {
  	    var hook = updateWorkInProgressHook();
  	    if (null !== currentHook)
  	      return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
  	    hook.baseState = passthrough;
  	    return [passthrough, hook.queue.dispatch];
  	  },
  	  useMemoCache: useMemoCache,
  	  useCacheRefresh: updateRefresh
  	};
  	HooksDispatcherOnRerender.useEffectEvent = updateEvent;
  	function applyDerivedStateFromProps(
  	  workInProgress,
  	  ctor,
  	  getDerivedStateFromProps,
  	  nextProps
  	) {
  	  ctor = workInProgress.memoizedState;
  	  getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
  	  getDerivedStateFromProps =
  	    null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
  	      ? ctor
  	      : assign({}, ctor, getDerivedStateFromProps);
  	  workInProgress.memoizedState = getDerivedStateFromProps;
  	  0 === workInProgress.lanes &&
  	    (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
  	}
  	var classComponentUpdater = {
  	  enqueueSetState: function (inst, payload, callback) {
  	    inst = inst._reactInternals;
  	    var lane = requestUpdateLane(),
  	      update = createUpdate(lane);
  	    update.payload = payload;
  	    void 0 !== callback && null !== callback && (update.callback = callback);
  	    payload = enqueueUpdate(inst, update, lane);
  	    null !== payload &&
  	      (scheduleUpdateOnFiber(payload, inst, lane),
  	      entangleTransitions(payload, inst, lane));
  	  },
  	  enqueueReplaceState: function (inst, payload, callback) {
  	    inst = inst._reactInternals;
  	    var lane = requestUpdateLane(),
  	      update = createUpdate(lane);
  	    update.tag = 1;
  	    update.payload = payload;
  	    void 0 !== callback && null !== callback && (update.callback = callback);
  	    payload = enqueueUpdate(inst, update, lane);
  	    null !== payload &&
  	      (scheduleUpdateOnFiber(payload, inst, lane),
  	      entangleTransitions(payload, inst, lane));
  	  },
  	  enqueueForceUpdate: function (inst, callback) {
  	    inst = inst._reactInternals;
  	    var lane = requestUpdateLane(),
  	      update = createUpdate(lane);
  	    update.tag = 2;
  	    void 0 !== callback && null !== callback && (update.callback = callback);
  	    callback = enqueueUpdate(inst, update, lane);
  	    null !== callback &&
  	      (scheduleUpdateOnFiber(callback, inst, lane),
  	      entangleTransitions(callback, inst, lane));
  	  }
  	};
  	function checkShouldComponentUpdate(
  	  workInProgress,
  	  ctor,
  	  oldProps,
  	  newProps,
  	  oldState,
  	  newState,
  	  nextContext
  	) {
  	  workInProgress = workInProgress.stateNode;
  	  return "function" === typeof workInProgress.shouldComponentUpdate
  	    ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
  	    : ctor.prototype && ctor.prototype.isPureReactComponent
  	      ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
  	      : true;
  	}
  	function callComponentWillReceiveProps(
  	  workInProgress,
  	  instance,
  	  newProps,
  	  nextContext
  	) {
  	  workInProgress = instance.state;
  	  "function" === typeof instance.componentWillReceiveProps &&
  	    instance.componentWillReceiveProps(newProps, nextContext);
  	  "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
  	    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  	  instance.state !== workInProgress &&
  	    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  	}
  	function resolveClassComponentProps(Component, baseProps) {
  	  var newProps = baseProps;
  	  if ("ref" in baseProps) {
  	    newProps = {};
  	    for (var propName in baseProps)
  	      "ref" !== propName && (newProps[propName] = baseProps[propName]);
  	  }
  	  if ((Component = Component.defaultProps)) {
  	    newProps === baseProps && (newProps = assign({}, newProps));
  	    for (var propName$73 in Component)
  	      void 0 === newProps[propName$73] &&
  	        (newProps[propName$73] = Component[propName$73]);
  	  }
  	  return newProps;
  	}
  	function defaultOnUncaughtError(error) {
  	  reportGlobalError(error);
  	}
  	function defaultOnCaughtError(error) {
  	  console.error(error);
  	}
  	function defaultOnRecoverableError(error) {
  	  reportGlobalError(error);
  	}
  	function logUncaughtError(root, errorInfo) {
  	  try {
  	    var onUncaughtError = root.onUncaughtError;
  	    onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
  	  } catch (e$74) {
  	    setTimeout(function () {
  	      throw e$74;
  	    });
  	  }
  	}
  	function logCaughtError(root, boundary, errorInfo) {
  	  try {
  	    var onCaughtError = root.onCaughtError;
  	    onCaughtError(errorInfo.value, {
  	      componentStack: errorInfo.stack,
  	      errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
  	    });
  	  } catch (e$75) {
  	    setTimeout(function () {
  	      throw e$75;
  	    });
  	  }
  	}
  	function createRootErrorUpdate(root, errorInfo, lane) {
  	  lane = createUpdate(lane);
  	  lane.tag = 3;
  	  lane.payload = { element: null };
  	  lane.callback = function () {
  	    logUncaughtError(root, errorInfo);
  	  };
  	  return lane;
  	}
  	function createClassErrorUpdate(lane) {
  	  lane = createUpdate(lane);
  	  lane.tag = 3;
  	  return lane;
  	}
  	function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
  	  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  	  if ("function" === typeof getDerivedStateFromError) {
  	    var error = errorInfo.value;
  	    update.payload = function () {
  	      return getDerivedStateFromError(error);
  	    };
  	    update.callback = function () {
  	      logCaughtError(root, fiber, errorInfo);
  	    };
  	  }
  	  var inst = fiber.stateNode;
  	  null !== inst &&
  	    "function" === typeof inst.componentDidCatch &&
  	    (update.callback = function () {
  	      logCaughtError(root, fiber, errorInfo);
  	      "function" !== typeof getDerivedStateFromError &&
  	        (null === legacyErrorBoundariesThatAlreadyFailed
  	          ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
  	          : legacyErrorBoundariesThatAlreadyFailed.add(this));
  	      var stack = errorInfo.stack;
  	      this.componentDidCatch(errorInfo.value, {
  	        componentStack: null !== stack ? stack : ""
  	      });
  	    });
  	}
  	function throwException(
  	  root,
  	  returnFiber,
  	  sourceFiber,
  	  value,
  	  rootRenderLanes
  	) {
  	  sourceFiber.flags |= 32768;
  	  if (
  	    null !== value &&
  	    "object" === typeof value &&
  	    "function" === typeof value.then
  	  ) {
  	    returnFiber = sourceFiber.alternate;
  	    null !== returnFiber &&
  	      propagateParentContextChanges(
  	        returnFiber,
  	        sourceFiber,
  	        rootRenderLanes,
  	        true
  	      );
  	    sourceFiber = suspenseHandlerStackCursor.current;
  	    if (null !== sourceFiber) {
  	      switch (sourceFiber.tag) {
  	        case 31:
  	        case 13:
  	          return (
  	            null === shellBoundary
  	              ? renderDidSuspendDelayIfPossible()
  	              : null === sourceFiber.alternate &&
  	                0 === workInProgressRootExitStatus &&
  	                (workInProgressRootExitStatus = 3),
  	            (sourceFiber.flags &= -257),
  	            (sourceFiber.flags |= 65536),
  	            (sourceFiber.lanes = rootRenderLanes),
  	            value === noopSuspenseyCommitThenable
  	              ? (sourceFiber.flags |= 16384)
  	              : ((returnFiber = sourceFiber.updateQueue),
  	                null === returnFiber
  	                  ? (sourceFiber.updateQueue = new Set([value]))
  	                  : returnFiber.add(value),
  	                attachPingListener(root, value, rootRenderLanes)),
  	            false
  	          );
  	        case 22:
  	          return (
  	            (sourceFiber.flags |= 65536),
  	            value === noopSuspenseyCommitThenable
  	              ? (sourceFiber.flags |= 16384)
  	              : ((returnFiber = sourceFiber.updateQueue),
  	                null === returnFiber
  	                  ? ((returnFiber = {
  	                      transitions: null,
  	                      markerInstances: null,
  	                      retryQueue: new Set([value])
  	                    }),
  	                    (sourceFiber.updateQueue = returnFiber))
  	                  : ((sourceFiber = returnFiber.retryQueue),
  	                    null === sourceFiber
  	                      ? (returnFiber.retryQueue = new Set([value]))
  	                      : sourceFiber.add(value)),
  	                attachPingListener(root, value, rootRenderLanes)),
  	            false
  	          );
  	      }
  	      throw Error(formatProdErrorMessage(435, sourceFiber.tag));
  	    }
  	    attachPingListener(root, value, rootRenderLanes);
  	    renderDidSuspendDelayIfPossible();
  	    return false;
  	  }
  	  if (isHydrating)
  	    return (
  	      (returnFiber = suspenseHandlerStackCursor.current),
  	      null !== returnFiber
  	        ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256),
  	          (returnFiber.flags |= 65536),
  	          (returnFiber.lanes = rootRenderLanes),
  	          value !== HydrationMismatchException &&
  	            ((root = Error(formatProdErrorMessage(422), { cause: value })),
  	            queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))
  	        : (value !== HydrationMismatchException &&
  	            ((returnFiber = Error(formatProdErrorMessage(423), {
  	              cause: value
  	            })),
  	            queueHydrationError(
  	              createCapturedValueAtFiber(returnFiber, sourceFiber)
  	            )),
  	          (root = root.current.alternate),
  	          (root.flags |= 65536),
  	          (rootRenderLanes &= -rootRenderLanes),
  	          (root.lanes |= rootRenderLanes),
  	          (value = createCapturedValueAtFiber(value, sourceFiber)),
  	          (rootRenderLanes = createRootErrorUpdate(
  	            root.stateNode,
  	            value,
  	            rootRenderLanes
  	          )),
  	          enqueueCapturedUpdate(root, rootRenderLanes),
  	          4 !== workInProgressRootExitStatus &&
  	            (workInProgressRootExitStatus = 2)),
  	      false
  	    );
  	  var wrapperError = Error(formatProdErrorMessage(520), { cause: value });
  	  wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);
  	  null === workInProgressRootConcurrentErrors
  	    ? (workInProgressRootConcurrentErrors = [wrapperError])
  	    : workInProgressRootConcurrentErrors.push(wrapperError);
  	  4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
  	  if (null === returnFiber) return true;
  	  value = createCapturedValueAtFiber(value, sourceFiber);
  	  sourceFiber = returnFiber;
  	  do {
  	    switch (sourceFiber.tag) {
  	      case 3:
  	        return (
  	          (sourceFiber.flags |= 65536),
  	          (root = rootRenderLanes & -rootRenderLanes),
  	          (sourceFiber.lanes |= root),
  	          (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)),
  	          enqueueCapturedUpdate(sourceFiber, root),
  	          false
  	        );
  	      case 1:
  	        if (
  	          ((returnFiber = sourceFiber.type),
  	          (wrapperError = sourceFiber.stateNode),
  	          0 === (sourceFiber.flags & 128) &&
  	            ("function" === typeof returnFiber.getDerivedStateFromError ||
  	              (null !== wrapperError &&
  	                "function" === typeof wrapperError.componentDidCatch &&
  	                (null === legacyErrorBoundariesThatAlreadyFailed ||
  	                  !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError)))))
  	        )
  	          return (
  	            (sourceFiber.flags |= 65536),
  	            (rootRenderLanes &= -rootRenderLanes),
  	            (sourceFiber.lanes |= rootRenderLanes),
  	            (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
  	            initializeClassErrorUpdate(
  	              rootRenderLanes,
  	              root,
  	              sourceFiber,
  	              value
  	            ),
  	            enqueueCapturedUpdate(sourceFiber, rootRenderLanes),
  	            false
  	          );
  	    }
  	    sourceFiber = sourceFiber.return;
  	  } while (null !== sourceFiber);
  	  return false;
  	}
  	var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
  	  didReceiveUpdate = false;
  	function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
  	  workInProgress.child =
  	    null === current
  	      ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
  	      : reconcileChildFibers(
  	          workInProgress,
  	          current.child,
  	          nextChildren,
  	          renderLanes
  	        );
  	}
  	function updateForwardRef(
  	  current,
  	  workInProgress,
  	  Component,
  	  nextProps,
  	  renderLanes
  	) {
  	  Component = Component.render;
  	  var ref = workInProgress.ref;
  	  if ("ref" in nextProps) {
  	    var propsWithoutRef = {};
  	    for (var key in nextProps)
  	      "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
  	  } else propsWithoutRef = nextProps;
  	  prepareToReadContext(workInProgress);
  	  nextProps = renderWithHooks(
  	    current,
  	    workInProgress,
  	    Component,
  	    propsWithoutRef,
  	    ref,
  	    renderLanes
  	  );
  	  key = checkDidRenderIdHook();
  	  if (null !== current && !didReceiveUpdate)
  	    return (
  	      bailoutHooks(current, workInProgress, renderLanes),
  	      bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
  	    );
  	  isHydrating && key && pushMaterializedTreeId(workInProgress);
  	  workInProgress.flags |= 1;
  	  reconcileChildren(current, workInProgress, nextProps, renderLanes);
  	  return workInProgress.child;
  	}
  	function updateMemoComponent(
  	  current,
  	  workInProgress,
  	  Component,
  	  nextProps,
  	  renderLanes
  	) {
  	  if (null === current) {
  	    var type = Component.type;
  	    if (
  	      "function" === typeof type &&
  	      !shouldConstruct(type) &&
  	      void 0 === type.defaultProps &&
  	      null === Component.compare
  	    )
  	      return (
  	        (workInProgress.tag = 15),
  	        (workInProgress.type = type),
  	        updateSimpleMemoComponent(
  	          current,
  	          workInProgress,
  	          type,
  	          nextProps,
  	          renderLanes
  	        )
  	      );
  	    current = createFiberFromTypeAndProps(
  	      Component.type,
  	      null,
  	      nextProps,
  	      workInProgress,
  	      workInProgress.mode,
  	      renderLanes
  	    );
  	    current.ref = workInProgress.ref;
  	    current.return = workInProgress;
  	    return (workInProgress.child = current);
  	  }
  	  type = current.child;
  	  if (!checkScheduledUpdateOrContext(current, renderLanes)) {
  	    var prevProps = type.memoizedProps;
  	    Component = Component.compare;
  	    Component = null !== Component ? Component : shallowEqual;
  	    if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
  	      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  	  }
  	  workInProgress.flags |= 1;
  	  current = createWorkInProgress(type, nextProps);
  	  current.ref = workInProgress.ref;
  	  current.return = workInProgress;
  	  return (workInProgress.child = current);
  	}
  	function updateSimpleMemoComponent(
  	  current,
  	  workInProgress,
  	  Component,
  	  nextProps,
  	  renderLanes
  	) {
  	  if (null !== current) {
  	    var prevProps = current.memoizedProps;
  	    if (
  	      shallowEqual(prevProps, nextProps) &&
  	      current.ref === workInProgress.ref
  	    )
  	      if (
  	        ((didReceiveUpdate = false),
  	        (workInProgress.pendingProps = nextProps = prevProps),
  	        checkScheduledUpdateOrContext(current, renderLanes))
  	      )
  	        0 !== (current.flags & 131072) && (didReceiveUpdate = true);
  	      else
  	        return (
  	          (workInProgress.lanes = current.lanes),
  	          bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
  	        );
  	  }
  	  return updateFunctionComponent(
  	    current,
  	    workInProgress,
  	    Component,
  	    nextProps,
  	    renderLanes
  	  );
  	}
  	function updateOffscreenComponent(
  	  current,
  	  workInProgress,
  	  renderLanes,
  	  nextProps
  	) {
  	  var nextChildren = nextProps.children,
  	    prevState = null !== current ? current.memoizedState : null;
  	  null === current &&
  	    null === workInProgress.stateNode &&
  	    (workInProgress.stateNode = {
  	      _visibility: 1,
  	      _pendingMarkers: null,
  	      _retryCache: null,
  	      _transitions: null
  	    });
  	  if ("hidden" === nextProps.mode) {
  	    if (0 !== (workInProgress.flags & 128)) {
  	      prevState =
  	        null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;
  	      if (null !== current) {
  	        nextProps = workInProgress.child = current.child;
  	        for (nextChildren = 0; null !== nextProps; )
  	          (nextChildren =
  	            nextChildren | nextProps.lanes | nextProps.childLanes),
  	            (nextProps = nextProps.sibling);
  	        nextProps = nextChildren & ~prevState;
  	      } else (nextProps = 0), (workInProgress.child = null);
  	      return deferHiddenOffscreenComponent(
  	        current,
  	        workInProgress,
  	        prevState,
  	        renderLanes,
  	        nextProps
  	      );
  	    }
  	    if (0 !== (renderLanes & 536870912))
  	      (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
  	        null !== current &&
  	          pushTransition(
  	            workInProgress,
  	            null !== prevState ? prevState.cachePool : null
  	          ),
  	        null !== prevState
  	          ? pushHiddenContext(workInProgress, prevState)
  	          : reuseHiddenContextOnStack(),
  	        pushOffscreenSuspenseHandler(workInProgress);
  	    else
  	      return (
  	        (nextProps = workInProgress.lanes = 536870912),
  	        deferHiddenOffscreenComponent(
  	          current,
  	          workInProgress,
  	          null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
  	          renderLanes,
  	          nextProps
  	        )
  	      );
  	  } else
  	    null !== prevState
  	      ? (pushTransition(workInProgress, prevState.cachePool),
  	        pushHiddenContext(workInProgress, prevState),
  	        reuseSuspenseHandlerOnStack(),
  	        (workInProgress.memoizedState = null))
  	      : (null !== current && pushTransition(workInProgress, null),
  	        reuseHiddenContextOnStack(),
  	        reuseSuspenseHandlerOnStack());
  	  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  	  return workInProgress.child;
  	}
  	function bailoutOffscreenComponent(current, workInProgress) {
  	  (null !== current && 22 === current.tag) ||
  	    null !== workInProgress.stateNode ||
  	    (workInProgress.stateNode = {
  	      _visibility: 1,
  	      _pendingMarkers: null,
  	      _retryCache: null,
  	      _transitions: null
  	    });
  	  return workInProgress.sibling;
  	}
  	function deferHiddenOffscreenComponent(
  	  current,
  	  workInProgress,
  	  nextBaseLanes,
  	  renderLanes,
  	  remainingChildLanes
  	) {
  	  var JSCompiler_inline_result = peekCacheFromPool();
  	  JSCompiler_inline_result =
  	    null === JSCompiler_inline_result
  	      ? null
  	      : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
  	  workInProgress.memoizedState = {
  	    baseLanes: nextBaseLanes,
  	    cachePool: JSCompiler_inline_result
  	  };
  	  null !== current && pushTransition(workInProgress, null);
  	  reuseHiddenContextOnStack();
  	  pushOffscreenSuspenseHandler(workInProgress);
  	  null !== current &&
  	    propagateParentContextChanges(current, workInProgress, renderLanes, true);
  	  workInProgress.childLanes = remainingChildLanes;
  	  return null;
  	}
  	function mountActivityChildren(workInProgress, nextProps) {
  	  nextProps = mountWorkInProgressOffscreenFiber(
  	    { mode: nextProps.mode, children: nextProps.children },
  	    workInProgress.mode
  	  );
  	  nextProps.ref = workInProgress.ref;
  	  workInProgress.child = nextProps;
  	  nextProps.return = workInProgress;
  	  return nextProps;
  	}
  	function retryActivityComponentWithoutHydrating(
  	  current,
  	  workInProgress,
  	  renderLanes
  	) {
  	  reconcileChildFibers(workInProgress, current.child, null, renderLanes);
  	  current = mountActivityChildren(workInProgress, workInProgress.pendingProps);
  	  current.flags |= 2;
  	  popSuspenseHandler(workInProgress);
  	  workInProgress.memoizedState = null;
  	  return current;
  	}
  	function updateActivityComponent(current, workInProgress, renderLanes) {
  	  var nextProps = workInProgress.pendingProps,
  	    didSuspend = 0 !== (workInProgress.flags & 128);
  	  workInProgress.flags &= -129;
  	  if (null === current) {
  	    if (isHydrating) {
  	      if ("hidden" === nextProps.mode)
  	        return (
  	          (current = mountActivityChildren(workInProgress, nextProps)),
  	          (workInProgress.lanes = 536870912),
  	          bailoutOffscreenComponent(null, current)
  	        );
  	      pushDehydratedActivitySuspenseHandler(workInProgress);
  	      (current = nextHydratableInstance)
  	        ? ((current = canHydrateHydrationBoundary(
  	            current,
  	            rootOrSingletonContext
  	          )),
  	          (current = null !== current && "&" === current.data ? current : null),
  	          null !== current &&
  	            ((workInProgress.memoizedState = {
  	              dehydrated: current,
  	              treeContext:
  	                null !== treeContextProvider
  	                  ? { id: treeContextId, overflow: treeContextOverflow }
  	                  : null,
  	              retryLane: 536870912,
  	              hydrationErrors: null
  	            }),
  	            (renderLanes = createFiberFromDehydratedFragment(current)),
  	            (renderLanes.return = workInProgress),
  	            (workInProgress.child = renderLanes),
  	            (hydrationParentFiber = workInProgress),
  	            (nextHydratableInstance = null)))
  	        : (current = null);
  	      if (null === current) throw throwOnHydrationMismatch(workInProgress);
  	      workInProgress.lanes = 536870912;
  	      return null;
  	    }
  	    return mountActivityChildren(workInProgress, nextProps);
  	  }
  	  var prevState = current.memoizedState;
  	  if (null !== prevState) {
  	    var dehydrated = prevState.dehydrated;
  	    pushDehydratedActivitySuspenseHandler(workInProgress);
  	    if (didSuspend)
  	      if (workInProgress.flags & 256)
  	        (workInProgress.flags &= -257),
  	          (workInProgress = retryActivityComponentWithoutHydrating(
  	            current,
  	            workInProgress,
  	            renderLanes
  	          ));
  	      else if (null !== workInProgress.memoizedState)
  	        (workInProgress.child = current.child),
  	          (workInProgress.flags |= 128),
  	          (workInProgress = null);
  	      else throw Error(formatProdErrorMessage(558));
  	    else if (
  	      (didReceiveUpdate ||
  	        propagateParentContextChanges(current, workInProgress, renderLanes, false),
  	      (didSuspend = 0 !== (renderLanes & current.childLanes)),
  	      didReceiveUpdate || didSuspend)
  	    ) {
  	      nextProps = workInProgressRoot;
  	      if (
  	        null !== nextProps &&
  	        ((dehydrated = getBumpedLaneForHydration(nextProps, renderLanes)),
  	        0 !== dehydrated && dehydrated !== prevState.retryLane)
  	      )
  	        throw (
  	          ((prevState.retryLane = dehydrated),
  	          enqueueConcurrentRenderForLane(current, dehydrated),
  	          scheduleUpdateOnFiber(nextProps, current, dehydrated),
  	          SelectiveHydrationException)
  	        );
  	      renderDidSuspendDelayIfPossible();
  	      workInProgress = retryActivityComponentWithoutHydrating(
  	        current,
  	        workInProgress,
  	        renderLanes
  	      );
  	    } else
  	      (current = prevState.treeContext),
  	        (nextHydratableInstance = getNextHydratable(dehydrated.nextSibling)),
  	        (hydrationParentFiber = workInProgress),
  	        (isHydrating = true),
  	        (hydrationErrors = null),
  	        (rootOrSingletonContext = false),
  	        null !== current &&
  	          restoreSuspendedTreeContext(workInProgress, current),
  	        (workInProgress = mountActivityChildren(workInProgress, nextProps)),
  	        (workInProgress.flags |= 4096);
  	    return workInProgress;
  	  }
  	  current = createWorkInProgress(current.child, {
  	    mode: nextProps.mode,
  	    children: nextProps.children
  	  });
  	  current.ref = workInProgress.ref;
  	  workInProgress.child = current;
  	  current.return = workInProgress;
  	  return current;
  	}
  	function markRef(current, workInProgress) {
  	  var ref = workInProgress.ref;
  	  if (null === ref)
  	    null !== current &&
  	      null !== current.ref &&
  	      (workInProgress.flags |= 4194816);
  	  else {
  	    if ("function" !== typeof ref && "object" !== typeof ref)
  	      throw Error(formatProdErrorMessage(284));
  	    if (null === current || current.ref !== ref)
  	      workInProgress.flags |= 4194816;
  	  }
  	}
  	function updateFunctionComponent(
  	  current,
  	  workInProgress,
  	  Component,
  	  nextProps,
  	  renderLanes
  	) {
  	  prepareToReadContext(workInProgress);
  	  Component = renderWithHooks(
  	    current,
  	    workInProgress,
  	    Component,
  	    nextProps,
  	    void 0,
  	    renderLanes
  	  );
  	  nextProps = checkDidRenderIdHook();
  	  if (null !== current && !didReceiveUpdate)
  	    return (
  	      bailoutHooks(current, workInProgress, renderLanes),
  	      bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
  	    );
  	  isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
  	  workInProgress.flags |= 1;
  	  reconcileChildren(current, workInProgress, Component, renderLanes);
  	  return workInProgress.child;
  	}
  	function replayFunctionComponent(
  	  current,
  	  workInProgress,
  	  nextProps,
  	  Component,
  	  secondArg,
  	  renderLanes
  	) {
  	  prepareToReadContext(workInProgress);
  	  workInProgress.updateQueue = null;
  	  nextProps = renderWithHooksAgain(
  	    workInProgress,
  	    Component,
  	    nextProps,
  	    secondArg
  	  );
  	  finishRenderingHooks(current);
  	  Component = checkDidRenderIdHook();
  	  if (null !== current && !didReceiveUpdate)
  	    return (
  	      bailoutHooks(current, workInProgress, renderLanes),
  	      bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
  	    );
  	  isHydrating && Component && pushMaterializedTreeId(workInProgress);
  	  workInProgress.flags |= 1;
  	  reconcileChildren(current, workInProgress, nextProps, renderLanes);
  	  return workInProgress.child;
  	}
  	function updateClassComponent(
  	  current,
  	  workInProgress,
  	  Component,
  	  nextProps,
  	  renderLanes
  	) {
  	  prepareToReadContext(workInProgress);
  	  if (null === workInProgress.stateNode) {
  	    var context = emptyContextObject,
  	      contextType = Component.contextType;
  	    "object" === typeof contextType &&
  	      null !== contextType &&
  	      (context = readContext(contextType));
  	    context = new Component(nextProps, context);
  	    workInProgress.memoizedState =
  	      null !== context.state && void 0 !== context.state ? context.state : null;
  	    context.updater = classComponentUpdater;
  	    workInProgress.stateNode = context;
  	    context._reactInternals = workInProgress;
  	    context = workInProgress.stateNode;
  	    context.props = nextProps;
  	    context.state = workInProgress.memoizedState;
  	    context.refs = {};
  	    initializeUpdateQueue(workInProgress);
  	    contextType = Component.contextType;
  	    context.context =
  	      "object" === typeof contextType && null !== contextType
  	        ? readContext(contextType)
  	        : emptyContextObject;
  	    context.state = workInProgress.memoizedState;
  	    contextType = Component.getDerivedStateFromProps;
  	    "function" === typeof contextType &&
  	      (applyDerivedStateFromProps(
  	        workInProgress,
  	        Component,
  	        contextType,
  	        nextProps
  	      ),
  	      (context.state = workInProgress.memoizedState));
  	    "function" === typeof Component.getDerivedStateFromProps ||
  	      "function" === typeof context.getSnapshotBeforeUpdate ||
  	      ("function" !== typeof context.UNSAFE_componentWillMount &&
  	        "function" !== typeof context.componentWillMount) ||
  	      ((contextType = context.state),
  	      "function" === typeof context.componentWillMount &&
  	        context.componentWillMount(),
  	      "function" === typeof context.UNSAFE_componentWillMount &&
  	        context.UNSAFE_componentWillMount(),
  	      contextType !== context.state &&
  	        classComponentUpdater.enqueueReplaceState(context, context.state, null),
  	      processUpdateQueue(workInProgress, nextProps, context, renderLanes),
  	      suspendIfUpdateReadFromEntangledAsyncAction(),
  	      (context.state = workInProgress.memoizedState));
  	    "function" === typeof context.componentDidMount &&
  	      (workInProgress.flags |= 4194308);
  	    nextProps = true;
  	  } else if (null === current) {
  	    context = workInProgress.stateNode;
  	    var unresolvedOldProps = workInProgress.memoizedProps,
  	      oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
  	    context.props = oldProps;
  	    var oldContext = context.context,
  	      contextType$jscomp$0 = Component.contextType;
  	    contextType = emptyContextObject;
  	    "object" === typeof contextType$jscomp$0 &&
  	      null !== contextType$jscomp$0 &&
  	      (contextType = readContext(contextType$jscomp$0));
  	    var getDerivedStateFromProps = Component.getDerivedStateFromProps;
  	    contextType$jscomp$0 =
  	      "function" === typeof getDerivedStateFromProps ||
  	      "function" === typeof context.getSnapshotBeforeUpdate;
  	    unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
  	    contextType$jscomp$0 ||
  	      ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
  	        "function" !== typeof context.componentWillReceiveProps) ||
  	      ((unresolvedOldProps || oldContext !== contextType) &&
  	        callComponentWillReceiveProps(
  	          workInProgress,
  	          context,
  	          nextProps,
  	          contextType
  	        ));
  	    hasForceUpdate = false;
  	    var oldState = workInProgress.memoizedState;
  	    context.state = oldState;
  	    processUpdateQueue(workInProgress, nextProps, context, renderLanes);
  	    suspendIfUpdateReadFromEntangledAsyncAction();
  	    oldContext = workInProgress.memoizedState;
  	    unresolvedOldProps || oldState !== oldContext || hasForceUpdate
  	      ? ("function" === typeof getDerivedStateFromProps &&
  	          (applyDerivedStateFromProps(
  	            workInProgress,
  	            Component,
  	            getDerivedStateFromProps,
  	            nextProps
  	          ),
  	          (oldContext = workInProgress.memoizedState)),
  	        (oldProps =
  	          hasForceUpdate ||
  	          checkShouldComponentUpdate(
  	            workInProgress,
  	            Component,
  	            oldProps,
  	            nextProps,
  	            oldState,
  	            oldContext,
  	            contextType
  	          ))
  	          ? (contextType$jscomp$0 ||
  	              ("function" !== typeof context.UNSAFE_componentWillMount &&
  	                "function" !== typeof context.componentWillMount) ||
  	              ("function" === typeof context.componentWillMount &&
  	                context.componentWillMount(),
  	              "function" === typeof context.UNSAFE_componentWillMount &&
  	                context.UNSAFE_componentWillMount()),
  	            "function" === typeof context.componentDidMount &&
  	              (workInProgress.flags |= 4194308))
  	          : ("function" === typeof context.componentDidMount &&
  	              (workInProgress.flags |= 4194308),
  	            (workInProgress.memoizedProps = nextProps),
  	            (workInProgress.memoizedState = oldContext)),
  	        (context.props = nextProps),
  	        (context.state = oldContext),
  	        (context.context = contextType),
  	        (nextProps = oldProps))
  	      : ("function" === typeof context.componentDidMount &&
  	          (workInProgress.flags |= 4194308),
  	        (nextProps = false));
  	  } else {
  	    context = workInProgress.stateNode;
  	    cloneUpdateQueue(current, workInProgress);
  	    contextType = workInProgress.memoizedProps;
  	    contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
  	    context.props = contextType$jscomp$0;
  	    getDerivedStateFromProps = workInProgress.pendingProps;
  	    oldState = context.context;
  	    oldContext = Component.contextType;
  	    oldProps = emptyContextObject;
  	    "object" === typeof oldContext &&
  	      null !== oldContext &&
  	      (oldProps = readContext(oldContext));
  	    unresolvedOldProps = Component.getDerivedStateFromProps;
  	    (oldContext =
  	      "function" === typeof unresolvedOldProps ||
  	      "function" === typeof context.getSnapshotBeforeUpdate) ||
  	      ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
  	        "function" !== typeof context.componentWillReceiveProps) ||
  	      ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&
  	        callComponentWillReceiveProps(
  	          workInProgress,
  	          context,
  	          nextProps,
  	          oldProps
  	        ));
  	    hasForceUpdate = false;
  	    oldState = workInProgress.memoizedState;
  	    context.state = oldState;
  	    processUpdateQueue(workInProgress, nextProps, context, renderLanes);
  	    suspendIfUpdateReadFromEntangledAsyncAction();
  	    var newState = workInProgress.memoizedState;
  	    contextType !== getDerivedStateFromProps ||
  	    oldState !== newState ||
  	    hasForceUpdate ||
  	    (null !== current &&
  	      null !== current.dependencies &&
  	      checkIfContextChanged(current.dependencies))
  	      ? ("function" === typeof unresolvedOldProps &&
  	          (applyDerivedStateFromProps(
  	            workInProgress,
  	            Component,
  	            unresolvedOldProps,
  	            nextProps
  	          ),
  	          (newState = workInProgress.memoizedState)),
  	        (contextType$jscomp$0 =
  	          hasForceUpdate ||
  	          checkShouldComponentUpdate(
  	            workInProgress,
  	            Component,
  	            contextType$jscomp$0,
  	            nextProps,
  	            oldState,
  	            newState,
  	            oldProps
  	          ) ||
  	          (null !== current &&
  	            null !== current.dependencies &&
  	            checkIfContextChanged(current.dependencies)))
  	          ? (oldContext ||
  	              ("function" !== typeof context.UNSAFE_componentWillUpdate &&
  	                "function" !== typeof context.componentWillUpdate) ||
  	              ("function" === typeof context.componentWillUpdate &&
  	                context.componentWillUpdate(nextProps, newState, oldProps),
  	              "function" === typeof context.UNSAFE_componentWillUpdate &&
  	                context.UNSAFE_componentWillUpdate(
  	                  nextProps,
  	                  newState,
  	                  oldProps
  	                )),
  	            "function" === typeof context.componentDidUpdate &&
  	              (workInProgress.flags |= 4),
  	            "function" === typeof context.getSnapshotBeforeUpdate &&
  	              (workInProgress.flags |= 1024))
  	          : ("function" !== typeof context.componentDidUpdate ||
  	              (contextType === current.memoizedProps &&
  	                oldState === current.memoizedState) ||
  	              (workInProgress.flags |= 4),
  	            "function" !== typeof context.getSnapshotBeforeUpdate ||
  	              (contextType === current.memoizedProps &&
  	                oldState === current.memoizedState) ||
  	              (workInProgress.flags |= 1024),
  	            (workInProgress.memoizedProps = nextProps),
  	            (workInProgress.memoizedState = newState)),
  	        (context.props = nextProps),
  	        (context.state = newState),
  	        (context.context = oldProps),
  	        (nextProps = contextType$jscomp$0))
  	      : ("function" !== typeof context.componentDidUpdate ||
  	          (contextType === current.memoizedProps &&
  	            oldState === current.memoizedState) ||
  	          (workInProgress.flags |= 4),
  	        "function" !== typeof context.getSnapshotBeforeUpdate ||
  	          (contextType === current.memoizedProps &&
  	            oldState === current.memoizedState) ||
  	          (workInProgress.flags |= 1024),
  	        (nextProps = false));
  	  }
  	  context = nextProps;
  	  markRef(current, workInProgress);
  	  nextProps = 0 !== (workInProgress.flags & 128);
  	  context || nextProps
  	    ? ((context = workInProgress.stateNode),
  	      (Component =
  	        nextProps && "function" !== typeof Component.getDerivedStateFromError
  	          ? null
  	          : context.render()),
  	      (workInProgress.flags |= 1),
  	      null !== current && nextProps
  	        ? ((workInProgress.child = reconcileChildFibers(
  	            workInProgress,
  	            current.child,
  	            null,
  	            renderLanes
  	          )),
  	          (workInProgress.child = reconcileChildFibers(
  	            workInProgress,
  	            null,
  	            Component,
  	            renderLanes
  	          )))
  	        : reconcileChildren(current, workInProgress, Component, renderLanes),
  	      (workInProgress.memoizedState = context.state),
  	      (current = workInProgress.child))
  	    : (current = bailoutOnAlreadyFinishedWork(
  	        current,
  	        workInProgress,
  	        renderLanes
  	      ));
  	  return current;
  	}
  	function mountHostRootWithoutHydrating(
  	  current,
  	  workInProgress,
  	  nextChildren,
  	  renderLanes
  	) {
  	  resetHydrationState();
  	  workInProgress.flags |= 256;
  	  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  	  return workInProgress.child;
  	}
  	var SUSPENDED_MARKER = {
  	  dehydrated: null,
  	  treeContext: null,
  	  retryLane: 0,
  	  hydrationErrors: null
  	};
  	function mountSuspenseOffscreenState(renderLanes) {
  	  return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
  	}
  	function getRemainingWorkInPrimaryTree(
  	  current,
  	  primaryTreeDidDefer,
  	  renderLanes
  	) {
  	  current = null !== current ? current.childLanes & ~renderLanes : 0;
  	  primaryTreeDidDefer && (current |= workInProgressDeferredLane);
  	  return current;
  	}
  	function updateSuspenseComponent(current, workInProgress, renderLanes) {
  	  var nextProps = workInProgress.pendingProps,
  	    showFallback = false,
  	    didSuspend = 0 !== (workInProgress.flags & 128),
  	    JSCompiler_temp;
  	  (JSCompiler_temp = didSuspend) ||
  	    (JSCompiler_temp =
  	      null !== current && null === current.memoizedState
  	        ? false
  	        : 0 !== (suspenseStackCursor.current & 2));
  	  JSCompiler_temp && ((showFallback = true), (workInProgress.flags &= -129));
  	  JSCompiler_temp = 0 !== (workInProgress.flags & 32);
  	  workInProgress.flags &= -33;
  	  if (null === current) {
  	    if (isHydrating) {
  	      showFallback
  	        ? pushPrimaryTreeSuspenseHandler(workInProgress)
  	        : reuseSuspenseHandlerOnStack();
  	      (current = nextHydratableInstance)
  	        ? ((current = canHydrateHydrationBoundary(
  	            current,
  	            rootOrSingletonContext
  	          )),
  	          (current = null !== current && "&" !== current.data ? current : null),
  	          null !== current &&
  	            ((workInProgress.memoizedState = {
  	              dehydrated: current,
  	              treeContext:
  	                null !== treeContextProvider
  	                  ? { id: treeContextId, overflow: treeContextOverflow }
  	                  : null,
  	              retryLane: 536870912,
  	              hydrationErrors: null
  	            }),
  	            (renderLanes = createFiberFromDehydratedFragment(current)),
  	            (renderLanes.return = workInProgress),
  	            (workInProgress.child = renderLanes),
  	            (hydrationParentFiber = workInProgress),
  	            (nextHydratableInstance = null)))
  	        : (current = null);
  	      if (null === current) throw throwOnHydrationMismatch(workInProgress);
  	      isSuspenseInstanceFallback(current)
  	        ? (workInProgress.lanes = 32)
  	        : (workInProgress.lanes = 536870912);
  	      return null;
  	    }
  	    var nextPrimaryChildren = nextProps.children;
  	    nextProps = nextProps.fallback;
  	    if (showFallback)
  	      return (
  	        reuseSuspenseHandlerOnStack(),
  	        (showFallback = workInProgress.mode),
  	        (nextPrimaryChildren = mountWorkInProgressOffscreenFiber(
  	          { mode: "hidden", children: nextPrimaryChildren },
  	          showFallback
  	        )),
  	        (nextProps = createFiberFromFragment(
  	          nextProps,
  	          showFallback,
  	          renderLanes,
  	          null
  	        )),
  	        (nextPrimaryChildren.return = workInProgress),
  	        (nextProps.return = workInProgress),
  	        (nextPrimaryChildren.sibling = nextProps),
  	        (workInProgress.child = nextPrimaryChildren),
  	        (nextProps = workInProgress.child),
  	        (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)),
  	        (nextProps.childLanes = getRemainingWorkInPrimaryTree(
  	          current,
  	          JSCompiler_temp,
  	          renderLanes
  	        )),
  	        (workInProgress.memoizedState = SUSPENDED_MARKER),
  	        bailoutOffscreenComponent(null, nextProps)
  	      );
  	    pushPrimaryTreeSuspenseHandler(workInProgress);
  	    return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren);
  	  }
  	  var prevState = current.memoizedState;
  	  if (
  	    null !== prevState &&
  	    ((nextPrimaryChildren = prevState.dehydrated), null !== nextPrimaryChildren)
  	  ) {
  	    if (didSuspend)
  	      workInProgress.flags & 256
  	        ? (pushPrimaryTreeSuspenseHandler(workInProgress),
  	          (workInProgress.flags &= -257),
  	          (workInProgress = retrySuspenseComponentWithoutHydrating(
  	            current,
  	            workInProgress,
  	            renderLanes
  	          )))
  	        : null !== workInProgress.memoizedState
  	          ? (reuseSuspenseHandlerOnStack(),
  	            (workInProgress.child = current.child),
  	            (workInProgress.flags |= 128),
  	            (workInProgress = null))
  	          : (reuseSuspenseHandlerOnStack(),
  	            (nextPrimaryChildren = nextProps.fallback),
  	            (showFallback = workInProgress.mode),
  	            (nextProps = mountWorkInProgressOffscreenFiber(
  	              { mode: "visible", children: nextProps.children },
  	              showFallback
  	            )),
  	            (nextPrimaryChildren = createFiberFromFragment(
  	              nextPrimaryChildren,
  	              showFallback,
  	              renderLanes,
  	              null
  	            )),
  	            (nextPrimaryChildren.flags |= 2),
  	            (nextProps.return = workInProgress),
  	            (nextPrimaryChildren.return = workInProgress),
  	            (nextProps.sibling = nextPrimaryChildren),
  	            (workInProgress.child = nextProps),
  	            reconcileChildFibers(
  	              workInProgress,
  	              current.child,
  	              null,
  	              renderLanes
  	            ),
  	            (nextProps = workInProgress.child),
  	            (nextProps.memoizedState =
  	              mountSuspenseOffscreenState(renderLanes)),
  	            (nextProps.childLanes = getRemainingWorkInPrimaryTree(
  	              current,
  	              JSCompiler_temp,
  	              renderLanes
  	            )),
  	            (workInProgress.memoizedState = SUSPENDED_MARKER),
  	            (workInProgress = bailoutOffscreenComponent(null, nextProps)));
  	    else if (
  	      (pushPrimaryTreeSuspenseHandler(workInProgress),
  	      isSuspenseInstanceFallback(nextPrimaryChildren))
  	    ) {
  	      JSCompiler_temp =
  	        nextPrimaryChildren.nextSibling &&
  	        nextPrimaryChildren.nextSibling.dataset;
  	      if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
  	      JSCompiler_temp = digest;
  	      nextProps = Error(formatProdErrorMessage(419));
  	      nextProps.stack = "";
  	      nextProps.digest = JSCompiler_temp;
  	      queueHydrationError({ value: nextProps, source: null, stack: null });
  	      workInProgress = retrySuspenseComponentWithoutHydrating(
  	        current,
  	        workInProgress,
  	        renderLanes
  	      );
  	    } else if (
  	      (didReceiveUpdate ||
  	        propagateParentContextChanges(current, workInProgress, renderLanes, false),
  	      (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
  	      didReceiveUpdate || JSCompiler_temp)
  	    ) {
  	      JSCompiler_temp = workInProgressRoot;
  	      if (
  	        null !== JSCompiler_temp &&
  	        ((nextProps = getBumpedLaneForHydration(JSCompiler_temp, renderLanes)),
  	        0 !== nextProps && nextProps !== prevState.retryLane)
  	      )
  	        throw (
  	          ((prevState.retryLane = nextProps),
  	          enqueueConcurrentRenderForLane(current, nextProps),
  	          scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
  	          SelectiveHydrationException)
  	        );
  	      isSuspenseInstancePending(nextPrimaryChildren) ||
  	        renderDidSuspendDelayIfPossible();
  	      workInProgress = retrySuspenseComponentWithoutHydrating(
  	        current,
  	        workInProgress,
  	        renderLanes
  	      );
  	    } else
  	      isSuspenseInstancePending(nextPrimaryChildren)
  	        ? ((workInProgress.flags |= 192),
  	          (workInProgress.child = current.child),
  	          (workInProgress = null))
  	        : ((current = prevState.treeContext),
  	          (nextHydratableInstance = getNextHydratable(
  	            nextPrimaryChildren.nextSibling
  	          )),
  	          (hydrationParentFiber = workInProgress),
  	          (isHydrating = true),
  	          (hydrationErrors = null),
  	          (rootOrSingletonContext = false),
  	          null !== current &&
  	            restoreSuspendedTreeContext(workInProgress, current),
  	          (workInProgress = mountSuspensePrimaryChildren(
  	            workInProgress,
  	            nextProps.children
  	          )),
  	          (workInProgress.flags |= 4096));
  	    return workInProgress;
  	  }
  	  if (showFallback)
  	    return (
  	      reuseSuspenseHandlerOnStack(),
  	      (nextPrimaryChildren = nextProps.fallback),
  	      (showFallback = workInProgress.mode),
  	      (prevState = current.child),
  	      (digest = prevState.sibling),
  	      (nextProps = createWorkInProgress(prevState, {
  	        mode: "hidden",
  	        children: nextProps.children
  	      })),
  	      (nextProps.subtreeFlags = prevState.subtreeFlags & 65011712),
  	      null !== digest
  	        ? (nextPrimaryChildren = createWorkInProgress(
  	            digest,
  	            nextPrimaryChildren
  	          ))
  	        : ((nextPrimaryChildren = createFiberFromFragment(
  	            nextPrimaryChildren,
  	            showFallback,
  	            renderLanes,
  	            null
  	          )),
  	          (nextPrimaryChildren.flags |= 2)),
  	      (nextPrimaryChildren.return = workInProgress),
  	      (nextProps.return = workInProgress),
  	      (nextProps.sibling = nextPrimaryChildren),
  	      (workInProgress.child = nextProps),
  	      bailoutOffscreenComponent(null, nextProps),
  	      (nextProps = workInProgress.child),
  	      (nextPrimaryChildren = current.child.memoizedState),
  	      null === nextPrimaryChildren
  	        ? (nextPrimaryChildren = mountSuspenseOffscreenState(renderLanes))
  	        : ((showFallback = nextPrimaryChildren.cachePool),
  	          null !== showFallback
  	            ? ((prevState = CacheContext._currentValue),
  	              (showFallback =
  	                showFallback.parent !== prevState
  	                  ? { parent: prevState, pool: prevState }
  	                  : showFallback))
  	            : (showFallback = getSuspendedCache()),
  	          (nextPrimaryChildren = {
  	            baseLanes: nextPrimaryChildren.baseLanes | renderLanes,
  	            cachePool: showFallback
  	          })),
  	      (nextProps.memoizedState = nextPrimaryChildren),
  	      (nextProps.childLanes = getRemainingWorkInPrimaryTree(
  	        current,
  	        JSCompiler_temp,
  	        renderLanes
  	      )),
  	      (workInProgress.memoizedState = SUSPENDED_MARKER),
  	      bailoutOffscreenComponent(current.child, nextProps)
  	    );
  	  pushPrimaryTreeSuspenseHandler(workInProgress);
  	  renderLanes = current.child;
  	  current = renderLanes.sibling;
  	  renderLanes = createWorkInProgress(renderLanes, {
  	    mode: "visible",
  	    children: nextProps.children
  	  });
  	  renderLanes.return = workInProgress;
  	  renderLanes.sibling = null;
  	  null !== current &&
  	    ((JSCompiler_temp = workInProgress.deletions),
  	    null === JSCompiler_temp
  	      ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
  	      : JSCompiler_temp.push(current));
  	  workInProgress.child = renderLanes;
  	  workInProgress.memoizedState = null;
  	  return renderLanes;
  	}
  	function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
  	  primaryChildren = mountWorkInProgressOffscreenFiber(
  	    { mode: "visible", children: primaryChildren },
  	    workInProgress.mode
  	  );
  	  primaryChildren.return = workInProgress;
  	  return (workInProgress.child = primaryChildren);
  	}
  	function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
  	  offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);
  	  offscreenProps.lanes = 0;
  	  return offscreenProps;
  	}
  	function retrySuspenseComponentWithoutHydrating(
  	  current,
  	  workInProgress,
  	  renderLanes
  	) {
  	  reconcileChildFibers(workInProgress, current.child, null, renderLanes);
  	  current = mountSuspensePrimaryChildren(
  	    workInProgress,
  	    workInProgress.pendingProps.children
  	  );
  	  current.flags |= 2;
  	  workInProgress.memoizedState = null;
  	  return current;
  	}
  	function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
  	  fiber.lanes |= renderLanes;
  	  var alternate = fiber.alternate;
  	  null !== alternate && (alternate.lanes |= renderLanes);
  	  scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);
  	}
  	function initSuspenseListRenderState(
  	  workInProgress,
  	  isBackwards,
  	  tail,
  	  lastContentRow,
  	  tailMode,
  	  treeForkCount
  	) {
  	  var renderState = workInProgress.memoizedState;
  	  null === renderState
  	    ? (workInProgress.memoizedState = {
  	        isBackwards: isBackwards,
  	        rendering: null,
  	        renderingStartTime: 0,
  	        last: lastContentRow,
  	        tail: tail,
  	        tailMode: tailMode,
  	        treeForkCount: treeForkCount
  	      })
  	    : ((renderState.isBackwards = isBackwards),
  	      (renderState.rendering = null),
  	      (renderState.renderingStartTime = 0),
  	      (renderState.last = lastContentRow),
  	      (renderState.tail = tail),
  	      (renderState.tailMode = tailMode),
  	      (renderState.treeForkCount = treeForkCount));
  	}
  	function updateSuspenseListComponent(current, workInProgress, renderLanes) {
  	  var nextProps = workInProgress.pendingProps,
  	    revealOrder = nextProps.revealOrder,
  	    tailMode = nextProps.tail;
  	  nextProps = nextProps.children;
  	  var suspenseContext = suspenseStackCursor.current,
  	    shouldForceFallback = 0 !== (suspenseContext & 2);
  	  shouldForceFallback
  	    ? ((suspenseContext = (suspenseContext & 1) | 2),
  	      (workInProgress.flags |= 128))
  	    : (suspenseContext &= 1);
  	  push(suspenseStackCursor, suspenseContext);
  	  reconcileChildren(current, workInProgress, nextProps, renderLanes);
  	  nextProps = isHydrating ? treeForkCount : 0;
  	  if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128))
  	    a: for (current = workInProgress.child; null !== current; ) {
  	      if (13 === current.tag)
  	        null !== current.memoizedState &&
  	          scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
  	      else if (19 === current.tag)
  	        scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
  	      else if (null !== current.child) {
  	        current.child.return = current;
  	        current = current.child;
  	        continue;
  	      }
  	      if (current === workInProgress) break a;
  	      for (; null === current.sibling; ) {
  	        if (null === current.return || current.return === workInProgress)
  	          break a;
  	        current = current.return;
  	      }
  	      current.sibling.return = current.return;
  	      current = current.sibling;
  	    }
  	  switch (revealOrder) {
  	    case "forwards":
  	      renderLanes = workInProgress.child;
  	      for (revealOrder = null; null !== renderLanes; )
  	        (current = renderLanes.alternate),
  	          null !== current &&
  	            null === findFirstSuspended(current) &&
  	            (revealOrder = renderLanes),
  	          (renderLanes = renderLanes.sibling);
  	      renderLanes = revealOrder;
  	      null === renderLanes
  	        ? ((revealOrder = workInProgress.child), (workInProgress.child = null))
  	        : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null));
  	      initSuspenseListRenderState(
  	        workInProgress,
  	        false,
  	        revealOrder,
  	        renderLanes,
  	        tailMode,
  	        nextProps
  	      );
  	      break;
  	    case "backwards":
  	    case "unstable_legacy-backwards":
  	      renderLanes = null;
  	      revealOrder = workInProgress.child;
  	      for (workInProgress.child = null; null !== revealOrder; ) {
  	        current = revealOrder.alternate;
  	        if (null !== current && null === findFirstSuspended(current)) {
  	          workInProgress.child = revealOrder;
  	          break;
  	        }
  	        current = revealOrder.sibling;
  	        revealOrder.sibling = renderLanes;
  	        renderLanes = revealOrder;
  	        revealOrder = current;
  	      }
  	      initSuspenseListRenderState(
  	        workInProgress,
  	        true,
  	        renderLanes,
  	        null,
  	        tailMode,
  	        nextProps
  	      );
  	      break;
  	    case "together":
  	      initSuspenseListRenderState(
  	        workInProgress,
  	        false,
  	        null,
  	        null,
  	        void 0,
  	        nextProps
  	      );
  	      break;
  	    default:
  	      workInProgress.memoizedState = null;
  	  }
  	  return workInProgress.child;
  	}
  	function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
  	  null !== current && (workInProgress.dependencies = current.dependencies);
  	  workInProgressRootSkippedLanes |= workInProgress.lanes;
  	  if (0 === (renderLanes & workInProgress.childLanes))
  	    if (null !== current) {
  	      if (
  	        (propagateParentContextChanges(
  	          current,
  	          workInProgress,
  	          renderLanes,
  	          false
  	        ),
  	        0 === (renderLanes & workInProgress.childLanes))
  	      )
  	        return null;
  	    } else return null;
  	  if (null !== current && workInProgress.child !== current.child)
  	    throw Error(formatProdErrorMessage(153));
  	  if (null !== workInProgress.child) {
  	    current = workInProgress.child;
  	    renderLanes = createWorkInProgress(current, current.pendingProps);
  	    workInProgress.child = renderLanes;
  	    for (renderLanes.return = workInProgress; null !== current.sibling; )
  	      (current = current.sibling),
  	        (renderLanes = renderLanes.sibling =
  	          createWorkInProgress(current, current.pendingProps)),
  	        (renderLanes.return = workInProgress);
  	    renderLanes.sibling = null;
  	  }
  	  return workInProgress.child;
  	}
  	function checkScheduledUpdateOrContext(current, renderLanes) {
  	  if (0 !== (current.lanes & renderLanes)) return true;
  	  current = current.dependencies;
  	  return null !== current && checkIfContextChanged(current) ? true : false;
  	}
  	function attemptEarlyBailoutIfNoScheduledUpdate(
  	  current,
  	  workInProgress,
  	  renderLanes
  	) {
  	  switch (workInProgress.tag) {
  	    case 3:
  	      pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  	      pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
  	      resetHydrationState();
  	      break;
  	    case 27:
  	    case 5:
  	      pushHostContext(workInProgress);
  	      break;
  	    case 4:
  	      pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  	      break;
  	    case 10:
  	      pushProvider(
  	        workInProgress,
  	        workInProgress.type,
  	        workInProgress.memoizedProps.value
  	      );
  	      break;
  	    case 31:
  	      if (null !== workInProgress.memoizedState)
  	        return (
  	          (workInProgress.flags |= 128),
  	          pushDehydratedActivitySuspenseHandler(workInProgress),
  	          null
  	        );
  	      break;
  	    case 13:
  	      var state$102 = workInProgress.memoizedState;
  	      if (null !== state$102) {
  	        if (null !== state$102.dehydrated)
  	          return (
  	            pushPrimaryTreeSuspenseHandler(workInProgress),
  	            (workInProgress.flags |= 128),
  	            null
  	          );
  	        if (0 !== (renderLanes & workInProgress.child.childLanes))
  	          return updateSuspenseComponent(current, workInProgress, renderLanes);
  	        pushPrimaryTreeSuspenseHandler(workInProgress);
  	        current = bailoutOnAlreadyFinishedWork(
  	          current,
  	          workInProgress,
  	          renderLanes
  	        );
  	        return null !== current ? current.sibling : null;
  	      }
  	      pushPrimaryTreeSuspenseHandler(workInProgress);
  	      break;
  	    case 19:
  	      var didSuspendBefore = 0 !== (current.flags & 128);
  	      state$102 = 0 !== (renderLanes & workInProgress.childLanes);
  	      state$102 ||
  	        (propagateParentContextChanges(
  	          current,
  	          workInProgress,
  	          renderLanes,
  	          false
  	        ),
  	        (state$102 = 0 !== (renderLanes & workInProgress.childLanes)));
  	      if (didSuspendBefore) {
  	        if (state$102)
  	          return updateSuspenseListComponent(
  	            current,
  	            workInProgress,
  	            renderLanes
  	          );
  	        workInProgress.flags |= 128;
  	      }
  	      didSuspendBefore = workInProgress.memoizedState;
  	      null !== didSuspendBefore &&
  	        ((didSuspendBefore.rendering = null),
  	        (didSuspendBefore.tail = null),
  	        (didSuspendBefore.lastEffect = null));
  	      push(suspenseStackCursor, suspenseStackCursor.current);
  	      if (state$102) break;
  	      else return null;
  	    case 22:
  	      return (
  	        (workInProgress.lanes = 0),
  	        updateOffscreenComponent(
  	          current,
  	          workInProgress,
  	          renderLanes,
  	          workInProgress.pendingProps
  	        )
  	      );
  	    case 24:
  	      pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
  	  }
  	  return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  	}
  	function beginWork(current, workInProgress, renderLanes) {
  	  if (null !== current)
  	    if (current.memoizedProps !== workInProgress.pendingProps)
  	      didReceiveUpdate = true;
  	    else {
  	      if (
  	        !checkScheduledUpdateOrContext(current, renderLanes) &&
  	        0 === (workInProgress.flags & 128)
  	      )
  	        return (
  	          (didReceiveUpdate = false),
  	          attemptEarlyBailoutIfNoScheduledUpdate(
  	            current,
  	            workInProgress,
  	            renderLanes
  	          )
  	        );
  	      didReceiveUpdate = 0 !== (current.flags & 131072) ? true : false;
  	    }
  	  else
  	    (didReceiveUpdate = false),
  	      isHydrating &&
  	        0 !== (workInProgress.flags & 1048576) &&
  	        pushTreeId(workInProgress, treeForkCount, workInProgress.index);
  	  workInProgress.lanes = 0;
  	  switch (workInProgress.tag) {
  	    case 16:
  	      a: {
  	        var props = workInProgress.pendingProps;
  	        current = resolveLazy(workInProgress.elementType);
  	        workInProgress.type = current;
  	        if ("function" === typeof current)
  	          shouldConstruct(current)
  	            ? ((props = resolveClassComponentProps(current, props)),
  	              (workInProgress.tag = 1),
  	              (workInProgress = updateClassComponent(
  	                null,
  	                workInProgress,
  	                current,
  	                props,
  	                renderLanes
  	              )))
  	            : ((workInProgress.tag = 0),
  	              (workInProgress = updateFunctionComponent(
  	                null,
  	                workInProgress,
  	                current,
  	                props,
  	                renderLanes
  	              )));
  	        else {
  	          if (void 0 !== current && null !== current) {
  	            var $$typeof = current.$$typeof;
  	            if ($$typeof === REACT_FORWARD_REF_TYPE) {
  	              workInProgress.tag = 11;
  	              workInProgress = updateForwardRef(
  	                null,
  	                workInProgress,
  	                current,
  	                props,
  	                renderLanes
  	              );
  	              break a;
  	            } else if ($$typeof === REACT_MEMO_TYPE) {
  	              workInProgress.tag = 14;
  	              workInProgress = updateMemoComponent(
  	                null,
  	                workInProgress,
  	                current,
  	                props,
  	                renderLanes
  	              );
  	              break a;
  	            }
  	          }
  	          workInProgress = getComponentNameFromType(current) || current;
  	          throw Error(formatProdErrorMessage(306, workInProgress, ""));
  	        }
  	      }
  	      return workInProgress;
  	    case 0:
  	      return updateFunctionComponent(
  	        current,
  	        workInProgress,
  	        workInProgress.type,
  	        workInProgress.pendingProps,
  	        renderLanes
  	      );
  	    case 1:
  	      return (
  	        (props = workInProgress.type),
  	        ($$typeof = resolveClassComponentProps(
  	          props,
  	          workInProgress.pendingProps
  	        )),
  	        updateClassComponent(
  	          current,
  	          workInProgress,
  	          props,
  	          $$typeof,
  	          renderLanes
  	        )
  	      );
  	    case 3:
  	      a: {
  	        pushHostContainer(
  	          workInProgress,
  	          workInProgress.stateNode.containerInfo
  	        );
  	        if (null === current) throw Error(formatProdErrorMessage(387));
  	        props = workInProgress.pendingProps;
  	        var prevState = workInProgress.memoizedState;
  	        $$typeof = prevState.element;
  	        cloneUpdateQueue(current, workInProgress);
  	        processUpdateQueue(workInProgress, props, null, renderLanes);
  	        var nextState = workInProgress.memoizedState;
  	        props = nextState.cache;
  	        pushProvider(workInProgress, CacheContext, props);
  	        props !== prevState.cache &&
  	          propagateContextChanges(
  	            workInProgress,
  	            [CacheContext],
  	            renderLanes,
  	            true
  	          );
  	        suspendIfUpdateReadFromEntangledAsyncAction();
  	        props = nextState.element;
  	        if (prevState.isDehydrated)
  	          if (
  	            ((prevState = {
  	              element: props,
  	              isDehydrated: false,
  	              cache: nextState.cache
  	            }),
  	            (workInProgress.updateQueue.baseState = prevState),
  	            (workInProgress.memoizedState = prevState),
  	            workInProgress.flags & 256)
  	          ) {
  	            workInProgress = mountHostRootWithoutHydrating(
  	              current,
  	              workInProgress,
  	              props,
  	              renderLanes
  	            );
  	            break a;
  	          } else if (props !== $$typeof) {
  	            $$typeof = createCapturedValueAtFiber(
  	              Error(formatProdErrorMessage(424)),
  	              workInProgress
  	            );
  	            queueHydrationError($$typeof);
  	            workInProgress = mountHostRootWithoutHydrating(
  	              current,
  	              workInProgress,
  	              props,
  	              renderLanes
  	            );
  	            break a;
  	          } else {
  	            current = workInProgress.stateNode.containerInfo;
  	            switch (current.nodeType) {
  	              case 9:
  	                current = current.body;
  	                break;
  	              default:
  	                current =
  	                  "HTML" === current.nodeName
  	                    ? current.ownerDocument.body
  	                    : current;
  	            }
  	            nextHydratableInstance = getNextHydratable(current.firstChild);
  	            hydrationParentFiber = workInProgress;
  	            isHydrating = true;
  	            hydrationErrors = null;
  	            rootOrSingletonContext = true;
  	            renderLanes = mountChildFibers(
  	              workInProgress,
  	              null,
  	              props,
  	              renderLanes
  	            );
  	            for (workInProgress.child = renderLanes; renderLanes; )
  	              (renderLanes.flags = (renderLanes.flags & -3) | 4096),
  	                (renderLanes = renderLanes.sibling);
  	          }
  	        else {
  	          resetHydrationState();
  	          if (props === $$typeof) {
  	            workInProgress = bailoutOnAlreadyFinishedWork(
  	              current,
  	              workInProgress,
  	              renderLanes
  	            );
  	            break a;
  	          }
  	          reconcileChildren(current, workInProgress, props, renderLanes);
  	        }
  	        workInProgress = workInProgress.child;
  	      }
  	      return workInProgress;
  	    case 26:
  	      return (
  	        markRef(current, workInProgress),
  	        null === current
  	          ? (renderLanes = getResource(
  	              workInProgress.type,
  	              null,
  	              workInProgress.pendingProps,
  	              null
  	            ))
  	            ? (workInProgress.memoizedState = renderLanes)
  	            : isHydrating ||
  	              ((renderLanes = workInProgress.type),
  	              (current = workInProgress.pendingProps),
  	              (props = getOwnerDocumentFromRootContainer(
  	                rootInstanceStackCursor.current
  	              ).createElement(renderLanes)),
  	              (props[internalInstanceKey] = workInProgress),
  	              (props[internalPropsKey] = current),
  	              setInitialProperties(props, renderLanes, current),
  	              markNodeAsHoistable(props),
  	              (workInProgress.stateNode = props))
  	          : (workInProgress.memoizedState = getResource(
  	              workInProgress.type,
  	              current.memoizedProps,
  	              workInProgress.pendingProps,
  	              current.memoizedState
  	            )),
  	        null
  	      );
  	    case 27:
  	      return (
  	        pushHostContext(workInProgress),
  	        null === current &&
  	          isHydrating &&
  	          ((props = workInProgress.stateNode =
  	            resolveSingletonInstance(
  	              workInProgress.type,
  	              workInProgress.pendingProps,
  	              rootInstanceStackCursor.current
  	            )),
  	          (hydrationParentFiber = workInProgress),
  	          (rootOrSingletonContext = true),
  	          ($$typeof = nextHydratableInstance),
  	          isSingletonScope(workInProgress.type)
  	            ? ((previousHydratableOnEnteringScopedSingleton = $$typeof),
  	              (nextHydratableInstance = getNextHydratable(props.firstChild)))
  	            : (nextHydratableInstance = $$typeof)),
  	        reconcileChildren(
  	          current,
  	          workInProgress,
  	          workInProgress.pendingProps.children,
  	          renderLanes
  	        ),
  	        markRef(current, workInProgress),
  	        null === current && (workInProgress.flags |= 4194304),
  	        workInProgress.child
  	      );
  	    case 5:
  	      if (null === current && isHydrating) {
  	        if (($$typeof = props = nextHydratableInstance))
  	          (props = canHydrateInstance(
  	            props,
  	            workInProgress.type,
  	            workInProgress.pendingProps,
  	            rootOrSingletonContext
  	          )),
  	            null !== props
  	              ? ((workInProgress.stateNode = props),
  	                (hydrationParentFiber = workInProgress),
  	                (nextHydratableInstance = getNextHydratable(props.firstChild)),
  	                (rootOrSingletonContext = false),
  	                ($$typeof = true))
  	              : ($$typeof = false);
  	        $$typeof || throwOnHydrationMismatch(workInProgress);
  	      }
  	      pushHostContext(workInProgress);
  	      $$typeof = workInProgress.type;
  	      prevState = workInProgress.pendingProps;
  	      nextState = null !== current ? current.memoizedProps : null;
  	      props = prevState.children;
  	      shouldSetTextContent($$typeof, prevState)
  	        ? (props = null)
  	        : null !== nextState &&
  	          shouldSetTextContent($$typeof, nextState) &&
  	          (workInProgress.flags |= 32);
  	      null !== workInProgress.memoizedState &&
  	        (($$typeof = renderWithHooks(
  	          current,
  	          workInProgress,
  	          TransitionAwareHostComponent,
  	          null,
  	          null,
  	          renderLanes
  	        )),
  	        (HostTransitionContext._currentValue = $$typeof));
  	      markRef(current, workInProgress);
  	      reconcileChildren(current, workInProgress, props, renderLanes);
  	      return workInProgress.child;
  	    case 6:
  	      if (null === current && isHydrating) {
  	        if ((current = renderLanes = nextHydratableInstance))
  	          (renderLanes = canHydrateTextInstance(
  	            renderLanes,
  	            workInProgress.pendingProps,
  	            rootOrSingletonContext
  	          )),
  	            null !== renderLanes
  	              ? ((workInProgress.stateNode = renderLanes),
  	                (hydrationParentFiber = workInProgress),
  	                (nextHydratableInstance = null),
  	                (current = true))
  	              : (current = false);
  	        current || throwOnHydrationMismatch(workInProgress);
  	      }
  	      return null;
  	    case 13:
  	      return updateSuspenseComponent(current, workInProgress, renderLanes);
  	    case 4:
  	      return (
  	        pushHostContainer(
  	          workInProgress,
  	          workInProgress.stateNode.containerInfo
  	        ),
  	        (props = workInProgress.pendingProps),
  	        null === current
  	          ? (workInProgress.child = reconcileChildFibers(
  	              workInProgress,
  	              null,
  	              props,
  	              renderLanes
  	            ))
  	          : reconcileChildren(current, workInProgress, props, renderLanes),
  	        workInProgress.child
  	      );
  	    case 11:
  	      return updateForwardRef(
  	        current,
  	        workInProgress,
  	        workInProgress.type,
  	        workInProgress.pendingProps,
  	        renderLanes
  	      );
  	    case 7:
  	      return (
  	        reconcileChildren(
  	          current,
  	          workInProgress,
  	          workInProgress.pendingProps,
  	          renderLanes
  	        ),
  	        workInProgress.child
  	      );
  	    case 8:
  	      return (
  	        reconcileChildren(
  	          current,
  	          workInProgress,
  	          workInProgress.pendingProps.children,
  	          renderLanes
  	        ),
  	        workInProgress.child
  	      );
  	    case 12:
  	      return (
  	        reconcileChildren(
  	          current,
  	          workInProgress,
  	          workInProgress.pendingProps.children,
  	          renderLanes
  	        ),
  	        workInProgress.child
  	      );
  	    case 10:
  	      return (
  	        (props = workInProgress.pendingProps),
  	        pushProvider(workInProgress, workInProgress.type, props.value),
  	        reconcileChildren(current, workInProgress, props.children, renderLanes),
  	        workInProgress.child
  	      );
  	    case 9:
  	      return (
  	        ($$typeof = workInProgress.type._context),
  	        (props = workInProgress.pendingProps.children),
  	        prepareToReadContext(workInProgress),
  	        ($$typeof = readContext($$typeof)),
  	        (props = props($$typeof)),
  	        (workInProgress.flags |= 1),
  	        reconcileChildren(current, workInProgress, props, renderLanes),
  	        workInProgress.child
  	      );
  	    case 14:
  	      return updateMemoComponent(
  	        current,
  	        workInProgress,
  	        workInProgress.type,
  	        workInProgress.pendingProps,
  	        renderLanes
  	      );
  	    case 15:
  	      return updateSimpleMemoComponent(
  	        current,
  	        workInProgress,
  	        workInProgress.type,
  	        workInProgress.pendingProps,
  	        renderLanes
  	      );
  	    case 19:
  	      return updateSuspenseListComponent(current, workInProgress, renderLanes);
  	    case 31:
  	      return updateActivityComponent(current, workInProgress, renderLanes);
  	    case 22:
  	      return updateOffscreenComponent(
  	        current,
  	        workInProgress,
  	        renderLanes,
  	        workInProgress.pendingProps
  	      );
  	    case 24:
  	      return (
  	        prepareToReadContext(workInProgress),
  	        (props = readContext(CacheContext)),
  	        null === current
  	          ? (($$typeof = peekCacheFromPool()),
  	            null === $$typeof &&
  	              (($$typeof = workInProgressRoot),
  	              (prevState = createCache()),
  	              ($$typeof.pooledCache = prevState),
  	              prevState.refCount++,
  	              null !== prevState && ($$typeof.pooledCacheLanes |= renderLanes),
  	              ($$typeof = prevState)),
  	            (workInProgress.memoizedState = { parent: props, cache: $$typeof }),
  	            initializeUpdateQueue(workInProgress),
  	            pushProvider(workInProgress, CacheContext, $$typeof))
  	          : (0 !== (current.lanes & renderLanes) &&
  	              (cloneUpdateQueue(current, workInProgress),
  	              processUpdateQueue(workInProgress, null, null, renderLanes),
  	              suspendIfUpdateReadFromEntangledAsyncAction()),
  	            ($$typeof = current.memoizedState),
  	            (prevState = workInProgress.memoizedState),
  	            $$typeof.parent !== props
  	              ? (($$typeof = { parent: props, cache: props }),
  	                (workInProgress.memoizedState = $$typeof),
  	                0 === workInProgress.lanes &&
  	                  (workInProgress.memoizedState =
  	                    workInProgress.updateQueue.baseState =
  	                      $$typeof),
  	                pushProvider(workInProgress, CacheContext, props))
  	              : ((props = prevState.cache),
  	                pushProvider(workInProgress, CacheContext, props),
  	                props !== $$typeof.cache &&
  	                  propagateContextChanges(
  	                    workInProgress,
  	                    [CacheContext],
  	                    renderLanes,
  	                    true
  	                  ))),
  	        reconcileChildren(
  	          current,
  	          workInProgress,
  	          workInProgress.pendingProps.children,
  	          renderLanes
  	        ),
  	        workInProgress.child
  	      );
  	    case 29:
  	      throw workInProgress.pendingProps;
  	  }
  	  throw Error(formatProdErrorMessage(156, workInProgress.tag));
  	}
  	function markUpdate(workInProgress) {
  	  workInProgress.flags |= 4;
  	}
  	function preloadInstanceAndSuspendIfNeeded(
  	  workInProgress,
  	  type,
  	  oldProps,
  	  newProps,
  	  renderLanes
  	) {
  	  if ((type = 0 !== (workInProgress.mode & 32))) type = false;
  	  if (type) {
  	    if (
  	      ((workInProgress.flags |= 16777216),
  	      (renderLanes & 335544128) === renderLanes)
  	    )
  	      if (workInProgress.stateNode.complete) workInProgress.flags |= 8192;
  	      else if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192;
  	      else
  	        throw (
  	          ((suspendedThenable = noopSuspenseyCommitThenable),
  	          SuspenseyCommitException)
  	        );
  	  } else workInProgress.flags &= -16777217;
  	}
  	function preloadResourceAndSuspendIfNeeded(workInProgress, resource) {
  	  if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4))
  	    workInProgress.flags &= -16777217;
  	  else if (((workInProgress.flags |= 16777216), !preloadResource(resource)))
  	    if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192;
  	    else
  	      throw (
  	        ((suspendedThenable = noopSuspenseyCommitThenable),
  	        SuspenseyCommitException)
  	      );
  	}
  	function scheduleRetryEffect(workInProgress, retryQueue) {
  	  null !== retryQueue && (workInProgress.flags |= 4);
  	  workInProgress.flags & 16384 &&
  	    ((retryQueue =
  	      22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
  	    (workInProgress.lanes |= retryQueue),
  	    (workInProgressSuspendedRetryLanes |= retryQueue));
  	}
  	function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  	  if (!isHydrating)
  	    switch (renderState.tailMode) {
  	      case "hidden":
  	        hasRenderedATailFallback = renderState.tail;
  	        for (var lastTailNode = null; null !== hasRenderedATailFallback; )
  	          null !== hasRenderedATailFallback.alternate &&
  	            (lastTailNode = hasRenderedATailFallback),
  	            (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
  	        null === lastTailNode
  	          ? (renderState.tail = null)
  	          : (lastTailNode.sibling = null);
  	        break;
  	      case "collapsed":
  	        lastTailNode = renderState.tail;
  	        for (var lastTailNode$106 = null; null !== lastTailNode; )
  	          null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode),
  	            (lastTailNode = lastTailNode.sibling);
  	        null === lastTailNode$106
  	          ? hasRenderedATailFallback || null === renderState.tail
  	            ? (renderState.tail = null)
  	            : (renderState.tail.sibling = null)
  	          : (lastTailNode$106.sibling = null);
  	    }
  	}
  	function bubbleProperties(completedWork) {
  	  var didBailout =
  	      null !== completedWork.alternate &&
  	      completedWork.alternate.child === completedWork.child,
  	    newChildLanes = 0,
  	    subtreeFlags = 0;
  	  if (didBailout)
  	    for (var child$107 = completedWork.child; null !== child$107; )
  	      (newChildLanes |= child$107.lanes | child$107.childLanes),
  	        (subtreeFlags |= child$107.subtreeFlags & 65011712),
  	        (subtreeFlags |= child$107.flags & 65011712),
  	        (child$107.return = completedWork),
  	        (child$107 = child$107.sibling);
  	  else
  	    for (child$107 = completedWork.child; null !== child$107; )
  	      (newChildLanes |= child$107.lanes | child$107.childLanes),
  	        (subtreeFlags |= child$107.subtreeFlags),
  	        (subtreeFlags |= child$107.flags),
  	        (child$107.return = completedWork),
  	        (child$107 = child$107.sibling);
  	  completedWork.subtreeFlags |= subtreeFlags;
  	  completedWork.childLanes = newChildLanes;
  	  return didBailout;
  	}
  	function completeWork(current, workInProgress, renderLanes) {
  	  var newProps = workInProgress.pendingProps;
  	  popTreeContext(workInProgress);
  	  switch (workInProgress.tag) {
  	    case 16:
  	    case 15:
  	    case 0:
  	    case 11:
  	    case 7:
  	    case 8:
  	    case 12:
  	    case 9:
  	    case 14:
  	      return bubbleProperties(workInProgress), null;
  	    case 1:
  	      return bubbleProperties(workInProgress), null;
  	    case 3:
  	      renderLanes = workInProgress.stateNode;
  	      newProps = null;
  	      null !== current && (newProps = current.memoizedState.cache);
  	      workInProgress.memoizedState.cache !== newProps &&
  	        (workInProgress.flags |= 2048);
  	      popProvider(CacheContext);
  	      popHostContainer();
  	      renderLanes.pendingContext &&
  	        ((renderLanes.context = renderLanes.pendingContext),
  	        (renderLanes.pendingContext = null));
  	      if (null === current || null === current.child)
  	        popHydrationState(workInProgress)
  	          ? markUpdate(workInProgress)
  	          : null === current ||
  	            (current.memoizedState.isDehydrated &&
  	              0 === (workInProgress.flags & 256)) ||
  	            ((workInProgress.flags |= 1024),
  	            upgradeHydrationErrorsToRecoverable());
  	      bubbleProperties(workInProgress);
  	      return null;
  	    case 26:
  	      var type = workInProgress.type,
  	        nextResource = workInProgress.memoizedState;
  	      null === current
  	        ? (markUpdate(workInProgress),
  	          null !== nextResource
  	            ? (bubbleProperties(workInProgress),
  	              preloadResourceAndSuspendIfNeeded(workInProgress, nextResource))
  	            : (bubbleProperties(workInProgress),
  	              preloadInstanceAndSuspendIfNeeded(
  	                workInProgress,
  	                type,
  	                null,
  	                newProps,
  	                renderLanes
  	              )))
  	        : nextResource
  	          ? nextResource !== current.memoizedState
  	            ? (markUpdate(workInProgress),
  	              bubbleProperties(workInProgress),
  	              preloadResourceAndSuspendIfNeeded(workInProgress, nextResource))
  	            : (bubbleProperties(workInProgress),
  	              (workInProgress.flags &= -16777217))
  	          : ((current = current.memoizedProps),
  	            current !== newProps && markUpdate(workInProgress),
  	            bubbleProperties(workInProgress),
  	            preloadInstanceAndSuspendIfNeeded(
  	              workInProgress,
  	              type,
  	              current,
  	              newProps,
  	              renderLanes
  	            ));
  	      return null;
  	    case 27:
  	      popHostContext(workInProgress);
  	      renderLanes = rootInstanceStackCursor.current;
  	      type = workInProgress.type;
  	      if (null !== current && null != workInProgress.stateNode)
  	        current.memoizedProps !== newProps && markUpdate(workInProgress);
  	      else {
  	        if (!newProps) {
  	          if (null === workInProgress.stateNode)
  	            throw Error(formatProdErrorMessage(166));
  	          bubbleProperties(workInProgress);
  	          return null;
  	        }
  	        current = contextStackCursor.current;
  	        popHydrationState(workInProgress)
  	          ? prepareToHydrateHostInstance(workInProgress)
  	          : ((current = resolveSingletonInstance(type, newProps, renderLanes)),
  	            (workInProgress.stateNode = current),
  	            markUpdate(workInProgress));
  	      }
  	      bubbleProperties(workInProgress);
  	      return null;
  	    case 5:
  	      popHostContext(workInProgress);
  	      type = workInProgress.type;
  	      if (null !== current && null != workInProgress.stateNode)
  	        current.memoizedProps !== newProps && markUpdate(workInProgress);
  	      else {
  	        if (!newProps) {
  	          if (null === workInProgress.stateNode)
  	            throw Error(formatProdErrorMessage(166));
  	          bubbleProperties(workInProgress);
  	          return null;
  	        }
  	        nextResource = contextStackCursor.current;
  	        if (popHydrationState(workInProgress))
  	          prepareToHydrateHostInstance(workInProgress);
  	        else {
  	          var ownerDocument = getOwnerDocumentFromRootContainer(
  	            rootInstanceStackCursor.current
  	          );
  	          switch (nextResource) {
  	            case 1:
  	              nextResource = ownerDocument.createElementNS(
  	                "http://www.w3.org/2000/svg",
  	                type
  	              );
  	              break;
  	            case 2:
  	              nextResource = ownerDocument.createElementNS(
  	                "http://www.w3.org/1998/Math/MathML",
  	                type
  	              );
  	              break;
  	            default:
  	              switch (type) {
  	                case "svg":
  	                  nextResource = ownerDocument.createElementNS(
  	                    "http://www.w3.org/2000/svg",
  	                    type
  	                  );
  	                  break;
  	                case "math":
  	                  nextResource = ownerDocument.createElementNS(
  	                    "http://www.w3.org/1998/Math/MathML",
  	                    type
  	                  );
  	                  break;
  	                case "script":
  	                  nextResource = ownerDocument.createElement("div");
  	                  nextResource.innerHTML = "<script>\x3c/script>";
  	                  nextResource = nextResource.removeChild(
  	                    nextResource.firstChild
  	                  );
  	                  break;
  	                case "select":
  	                  nextResource =
  	                    "string" === typeof newProps.is
  	                      ? ownerDocument.createElement("select", {
  	                          is: newProps.is
  	                        })
  	                      : ownerDocument.createElement("select");
  	                  newProps.multiple
  	                    ? (nextResource.multiple = true)
  	                    : newProps.size && (nextResource.size = newProps.size);
  	                  break;
  	                default:
  	                  nextResource =
  	                    "string" === typeof newProps.is
  	                      ? ownerDocument.createElement(type, { is: newProps.is })
  	                      : ownerDocument.createElement(type);
  	              }
  	          }
  	          nextResource[internalInstanceKey] = workInProgress;
  	          nextResource[internalPropsKey] = newProps;
  	          a: for (
  	            ownerDocument = workInProgress.child;
  	            null !== ownerDocument;

  	          ) {
  	            if (5 === ownerDocument.tag || 6 === ownerDocument.tag)
  	              nextResource.appendChild(ownerDocument.stateNode);
  	            else if (
  	              4 !== ownerDocument.tag &&
  	              27 !== ownerDocument.tag &&
  	              null !== ownerDocument.child
  	            ) {
  	              ownerDocument.child.return = ownerDocument;
  	              ownerDocument = ownerDocument.child;
  	              continue;
  	            }
  	            if (ownerDocument === workInProgress) break a;
  	            for (; null === ownerDocument.sibling; ) {
  	              if (
  	                null === ownerDocument.return ||
  	                ownerDocument.return === workInProgress
  	              )
  	                break a;
  	              ownerDocument = ownerDocument.return;
  	            }
  	            ownerDocument.sibling.return = ownerDocument.return;
  	            ownerDocument = ownerDocument.sibling;
  	          }
  	          workInProgress.stateNode = nextResource;
  	          a: switch (
  	            (setInitialProperties(nextResource, type, newProps), type)
  	          ) {
  	            case "button":
  	            case "input":
  	            case "select":
  	            case "textarea":
  	              newProps = !!newProps.autoFocus;
  	              break a;
  	            case "img":
  	              newProps = true;
  	              break a;
  	            default:
  	              newProps = false;
  	          }
  	          newProps && markUpdate(workInProgress);
  	        }
  	      }
  	      bubbleProperties(workInProgress);
  	      preloadInstanceAndSuspendIfNeeded(
  	        workInProgress,
  	        workInProgress.type,
  	        null === current ? null : current.memoizedProps,
  	        workInProgress.pendingProps,
  	        renderLanes
  	      );
  	      return null;
  	    case 6:
  	      if (current && null != workInProgress.stateNode)
  	        current.memoizedProps !== newProps && markUpdate(workInProgress);
  	      else {
  	        if ("string" !== typeof newProps && null === workInProgress.stateNode)
  	          throw Error(formatProdErrorMessage(166));
  	        current = rootInstanceStackCursor.current;
  	        if (popHydrationState(workInProgress)) {
  	          current = workInProgress.stateNode;
  	          renderLanes = workInProgress.memoizedProps;
  	          newProps = null;
  	          type = hydrationParentFiber;
  	          if (null !== type)
  	            switch (type.tag) {
  	              case 27:
  	              case 5:
  	                newProps = type.memoizedProps;
  	            }
  	          current[internalInstanceKey] = workInProgress;
  	          current =
  	            current.nodeValue === renderLanes ||
  	            (null !== newProps && true === newProps.suppressHydrationWarning) ||
  	            checkForUnmatchedText(current.nodeValue, renderLanes)
  	              ? true
  	              : false;
  	          current || throwOnHydrationMismatch(workInProgress, true);
  	        } else
  	          (current =
  	            getOwnerDocumentFromRootContainer(current).createTextNode(
  	              newProps
  	            )),
  	            (current[internalInstanceKey] = workInProgress),
  	            (workInProgress.stateNode = current);
  	      }
  	      bubbleProperties(workInProgress);
  	      return null;
  	    case 31:
  	      renderLanes = workInProgress.memoizedState;
  	      if (null === current || null !== current.memoizedState) {
  	        newProps = popHydrationState(workInProgress);
  	        if (null !== renderLanes) {
  	          if (null === current) {
  	            if (!newProps) throw Error(formatProdErrorMessage(318));
  	            current = workInProgress.memoizedState;
  	            current = null !== current ? current.dehydrated : null;
  	            if (!current) throw Error(formatProdErrorMessage(557));
  	            current[internalInstanceKey] = workInProgress;
  	          } else
  	            resetHydrationState(),
  	              0 === (workInProgress.flags & 128) &&
  	                (workInProgress.memoizedState = null),
  	              (workInProgress.flags |= 4);
  	          bubbleProperties(workInProgress);
  	          current = false;
  	        } else
  	          (renderLanes = upgradeHydrationErrorsToRecoverable()),
  	            null !== current &&
  	              null !== current.memoizedState &&
  	              (current.memoizedState.hydrationErrors = renderLanes),
  	            (current = true);
  	        if (!current) {
  	          if (workInProgress.flags & 256)
  	            return popSuspenseHandler(workInProgress), workInProgress;
  	          popSuspenseHandler(workInProgress);
  	          return null;
  	        }
  	        if (0 !== (workInProgress.flags & 128))
  	          throw Error(formatProdErrorMessage(558));
  	      }
  	      bubbleProperties(workInProgress);
  	      return null;
  	    case 13:
  	      newProps = workInProgress.memoizedState;
  	      if (
  	        null === current ||
  	        (null !== current.memoizedState &&
  	          null !== current.memoizedState.dehydrated)
  	      ) {
  	        type = popHydrationState(workInProgress);
  	        if (null !== newProps && null !== newProps.dehydrated) {
  	          if (null === current) {
  	            if (!type) throw Error(formatProdErrorMessage(318));
  	            type = workInProgress.memoizedState;
  	            type = null !== type ? type.dehydrated : null;
  	            if (!type) throw Error(formatProdErrorMessage(317));
  	            type[internalInstanceKey] = workInProgress;
  	          } else
  	            resetHydrationState(),
  	              0 === (workInProgress.flags & 128) &&
  	                (workInProgress.memoizedState = null),
  	              (workInProgress.flags |= 4);
  	          bubbleProperties(workInProgress);
  	          type = false;
  	        } else
  	          (type = upgradeHydrationErrorsToRecoverable()),
  	            null !== current &&
  	              null !== current.memoizedState &&
  	              (current.memoizedState.hydrationErrors = type),
  	            (type = true);
  	        if (!type) {
  	          if (workInProgress.flags & 256)
  	            return popSuspenseHandler(workInProgress), workInProgress;
  	          popSuspenseHandler(workInProgress);
  	          return null;
  	        }
  	      }
  	      popSuspenseHandler(workInProgress);
  	      if (0 !== (workInProgress.flags & 128))
  	        return (workInProgress.lanes = renderLanes), workInProgress;
  	      renderLanes = null !== newProps;
  	      current = null !== current && null !== current.memoizedState;
  	      renderLanes &&
  	        ((newProps = workInProgress.child),
  	        (type = null),
  	        null !== newProps.alternate &&
  	          null !== newProps.alternate.memoizedState &&
  	          null !== newProps.alternate.memoizedState.cachePool &&
  	          (type = newProps.alternate.memoizedState.cachePool.pool),
  	        (nextResource = null),
  	        null !== newProps.memoizedState &&
  	          null !== newProps.memoizedState.cachePool &&
  	          (nextResource = newProps.memoizedState.cachePool.pool),
  	        nextResource !== type && (newProps.flags |= 2048));
  	      renderLanes !== current &&
  	        renderLanes &&
  	        (workInProgress.child.flags |= 8192);
  	      scheduleRetryEffect(workInProgress, workInProgress.updateQueue);
  	      bubbleProperties(workInProgress);
  	      return null;
  	    case 4:
  	      return (
  	        popHostContainer(),
  	        null === current &&
  	          listenToAllSupportedEvents(workInProgress.stateNode.containerInfo),
  	        bubbleProperties(workInProgress),
  	        null
  	      );
  	    case 10:
  	      return (
  	        popProvider(workInProgress.type), bubbleProperties(workInProgress), null
  	      );
  	    case 19:
  	      pop(suspenseStackCursor);
  	      newProps = workInProgress.memoizedState;
  	      if (null === newProps) return bubbleProperties(workInProgress), null;
  	      type = 0 !== (workInProgress.flags & 128);
  	      nextResource = newProps.rendering;
  	      if (null === nextResource)
  	        if (type) cutOffTailIfNeeded(newProps, false);
  	        else {
  	          if (
  	            0 !== workInProgressRootExitStatus ||
  	            (null !== current && 0 !== (current.flags & 128))
  	          )
  	            for (current = workInProgress.child; null !== current; ) {
  	              nextResource = findFirstSuspended(current);
  	              if (null !== nextResource) {
  	                workInProgress.flags |= 128;
  	                cutOffTailIfNeeded(newProps, false);
  	                current = nextResource.updateQueue;
  	                workInProgress.updateQueue = current;
  	                scheduleRetryEffect(workInProgress, current);
  	                workInProgress.subtreeFlags = 0;
  	                current = renderLanes;
  	                for (renderLanes = workInProgress.child; null !== renderLanes; )
  	                  resetWorkInProgress(renderLanes, current),
  	                    (renderLanes = renderLanes.sibling);
  	                push(
  	                  suspenseStackCursor,
  	                  (suspenseStackCursor.current & 1) | 2
  	                );
  	                isHydrating &&
  	                  pushTreeFork(workInProgress, newProps.treeForkCount);
  	                return workInProgress.child;
  	              }
  	              current = current.sibling;
  	            }
  	          null !== newProps.tail &&
  	            now() > workInProgressRootRenderTargetTime &&
  	            ((workInProgress.flags |= 128),
  	            (type = true),
  	            cutOffTailIfNeeded(newProps, false),
  	            (workInProgress.lanes = 4194304));
  	        }
  	      else {
  	        if (!type)
  	          if (
  	            ((current = findFirstSuspended(nextResource)), null !== current)
  	          ) {
  	            if (
  	              ((workInProgress.flags |= 128),
  	              (type = true),
  	              (current = current.updateQueue),
  	              (workInProgress.updateQueue = current),
  	              scheduleRetryEffect(workInProgress, current),
  	              cutOffTailIfNeeded(newProps, true),
  	              null === newProps.tail &&
  	                "hidden" === newProps.tailMode &&
  	                !nextResource.alternate &&
  	                !isHydrating)
  	            )
  	              return bubbleProperties(workInProgress), null;
  	          } else
  	            2 * now() - newProps.renderingStartTime >
  	              workInProgressRootRenderTargetTime &&
  	              536870912 !== renderLanes &&
  	              ((workInProgress.flags |= 128),
  	              (type = true),
  	              cutOffTailIfNeeded(newProps, false),
  	              (workInProgress.lanes = 4194304));
  	        newProps.isBackwards
  	          ? ((nextResource.sibling = workInProgress.child),
  	            (workInProgress.child = nextResource))
  	          : ((current = newProps.last),
  	            null !== current
  	              ? (current.sibling = nextResource)
  	              : (workInProgress.child = nextResource),
  	            (newProps.last = nextResource));
  	      }
  	      if (null !== newProps.tail)
  	        return (
  	          (current = newProps.tail),
  	          (newProps.rendering = current),
  	          (newProps.tail = current.sibling),
  	          (newProps.renderingStartTime = now()),
  	          (current.sibling = null),
  	          (renderLanes = suspenseStackCursor.current),
  	          push(
  	            suspenseStackCursor,
  	            type ? (renderLanes & 1) | 2 : renderLanes & 1
  	          ),
  	          isHydrating && pushTreeFork(workInProgress, newProps.treeForkCount),
  	          current
  	        );
  	      bubbleProperties(workInProgress);
  	      return null;
  	    case 22:
  	    case 23:
  	      return (
  	        popSuspenseHandler(workInProgress),
  	        popHiddenContext(),
  	        (newProps = null !== workInProgress.memoizedState),
  	        null !== current
  	          ? (null !== current.memoizedState) !== newProps &&
  	            (workInProgress.flags |= 8192)
  	          : newProps && (workInProgress.flags |= 8192),
  	        newProps
  	          ? 0 !== (renderLanes & 536870912) &&
  	            0 === (workInProgress.flags & 128) &&
  	            (bubbleProperties(workInProgress),
  	            workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192))
  	          : bubbleProperties(workInProgress),
  	        (renderLanes = workInProgress.updateQueue),
  	        null !== renderLanes &&
  	          scheduleRetryEffect(workInProgress, renderLanes.retryQueue),
  	        (renderLanes = null),
  	        null !== current &&
  	          null !== current.memoizedState &&
  	          null !== current.memoizedState.cachePool &&
  	          (renderLanes = current.memoizedState.cachePool.pool),
  	        (newProps = null),
  	        null !== workInProgress.memoizedState &&
  	          null !== workInProgress.memoizedState.cachePool &&
  	          (newProps = workInProgress.memoizedState.cachePool.pool),
  	        newProps !== renderLanes && (workInProgress.flags |= 2048),
  	        null !== current && pop(resumedCache),
  	        null
  	      );
  	    case 24:
  	      return (
  	        (renderLanes = null),
  	        null !== current && (renderLanes = current.memoizedState.cache),
  	        workInProgress.memoizedState.cache !== renderLanes &&
  	          (workInProgress.flags |= 2048),
  	        popProvider(CacheContext),
  	        bubbleProperties(workInProgress),
  	        null
  	      );
  	    case 25:
  	      return null;
  	    case 30:
  	      return null;
  	  }
  	  throw Error(formatProdErrorMessage(156, workInProgress.tag));
  	}
  	function unwindWork(current, workInProgress) {
  	  popTreeContext(workInProgress);
  	  switch (workInProgress.tag) {
  	    case 1:
  	      return (
  	        (current = workInProgress.flags),
  	        current & 65536
  	          ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
  	          : null
  	      );
  	    case 3:
  	      return (
  	        popProvider(CacheContext),
  	        popHostContainer(),
  	        (current = workInProgress.flags),
  	        0 !== (current & 65536) && 0 === (current & 128)
  	          ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
  	          : null
  	      );
  	    case 26:
  	    case 27:
  	    case 5:
  	      return popHostContext(workInProgress), null;
  	    case 31:
  	      if (null !== workInProgress.memoizedState) {
  	        popSuspenseHandler(workInProgress);
  	        if (null === workInProgress.alternate)
  	          throw Error(formatProdErrorMessage(340));
  	        resetHydrationState();
  	      }
  	      current = workInProgress.flags;
  	      return current & 65536
  	        ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
  	        : null;
  	    case 13:
  	      popSuspenseHandler(workInProgress);
  	      current = workInProgress.memoizedState;
  	      if (null !== current && null !== current.dehydrated) {
  	        if (null === workInProgress.alternate)
  	          throw Error(formatProdErrorMessage(340));
  	        resetHydrationState();
  	      }
  	      current = workInProgress.flags;
  	      return current & 65536
  	        ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
  	        : null;
  	    case 19:
  	      return pop(suspenseStackCursor), null;
  	    case 4:
  	      return popHostContainer(), null;
  	    case 10:
  	      return popProvider(workInProgress.type), null;
  	    case 22:
  	    case 23:
  	      return (
  	        popSuspenseHandler(workInProgress),
  	        popHiddenContext(),
  	        null !== current && pop(resumedCache),
  	        (current = workInProgress.flags),
  	        current & 65536
  	          ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
  	          : null
  	      );
  	    case 24:
  	      return popProvider(CacheContext), null;
  	    case 25:
  	      return null;
  	    default:
  	      return null;
  	  }
  	}
  	function unwindInterruptedWork(current, interruptedWork) {
  	  popTreeContext(interruptedWork);
  	  switch (interruptedWork.tag) {
  	    case 3:
  	      popProvider(CacheContext);
  	      popHostContainer();
  	      break;
  	    case 26:
  	    case 27:
  	    case 5:
  	      popHostContext(interruptedWork);
  	      break;
  	    case 4:
  	      popHostContainer();
  	      break;
  	    case 31:
  	      null !== interruptedWork.memoizedState &&
  	        popSuspenseHandler(interruptedWork);
  	      break;
  	    case 13:
  	      popSuspenseHandler(interruptedWork);
  	      break;
  	    case 19:
  	      pop(suspenseStackCursor);
  	      break;
  	    case 10:
  	      popProvider(interruptedWork.type);
  	      break;
  	    case 22:
  	    case 23:
  	      popSuspenseHandler(interruptedWork);
  	      popHiddenContext();
  	      null !== current && pop(resumedCache);
  	      break;
  	    case 24:
  	      popProvider(CacheContext);
  	  }
  	}
  	function commitHookEffectListMount(flags, finishedWork) {
  	  try {
  	    var updateQueue = finishedWork.updateQueue,
  	      lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
  	    if (null !== lastEffect) {
  	      var firstEffect = lastEffect.next;
  	      updateQueue = firstEffect;
  	      do {
  	        if ((updateQueue.tag & flags) === flags) {
  	          lastEffect = void 0;
  	          var create = updateQueue.create,
  	            inst = updateQueue.inst;
  	          lastEffect = create();
  	          inst.destroy = lastEffect;
  	        }
  	        updateQueue = updateQueue.next;
  	      } while (updateQueue !== firstEffect);
  	    }
  	  } catch (error) {
  	    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	  }
  	}
  	function commitHookEffectListUnmount(
  	  flags,
  	  finishedWork,
  	  nearestMountedAncestor$jscomp$0
  	) {
  	  try {
  	    var updateQueue = finishedWork.updateQueue,
  	      lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
  	    if (null !== lastEffect) {
  	      var firstEffect = lastEffect.next;
  	      updateQueue = firstEffect;
  	      do {
  	        if ((updateQueue.tag & flags) === flags) {
  	          var inst = updateQueue.inst,
  	            destroy = inst.destroy;
  	          if (void 0 !== destroy) {
  	            inst.destroy = void 0;
  	            lastEffect = finishedWork;
  	            var nearestMountedAncestor = nearestMountedAncestor$jscomp$0,
  	              destroy_ = destroy;
  	            try {
  	              destroy_();
  	            } catch (error) {
  	              captureCommitPhaseError(
  	                lastEffect,
  	                nearestMountedAncestor,
  	                error
  	              );
  	            }
  	          }
  	        }
  	        updateQueue = updateQueue.next;
  	      } while (updateQueue !== firstEffect);
  	    }
  	  } catch (error) {
  	    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	  }
  	}
  	function commitClassCallbacks(finishedWork) {
  	  var updateQueue = finishedWork.updateQueue;
  	  if (null !== updateQueue) {
  	    var instance = finishedWork.stateNode;
  	    try {
  	      commitCallbacks(updateQueue, instance);
  	    } catch (error) {
  	      captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	    }
  	  }
  	}
  	function safelyCallComponentWillUnmount(
  	  current,
  	  nearestMountedAncestor,
  	  instance
  	) {
  	  instance.props = resolveClassComponentProps(
  	    current.type,
  	    current.memoizedProps
  	  );
  	  instance.state = current.memoizedState;
  	  try {
  	    instance.componentWillUnmount();
  	  } catch (error) {
  	    captureCommitPhaseError(current, nearestMountedAncestor, error);
  	  }
  	}
  	function safelyAttachRef(current, nearestMountedAncestor) {
  	  try {
  	    var ref = current.ref;
  	    if (null !== ref) {
  	      switch (current.tag) {
  	        case 26:
  	        case 27:
  	        case 5:
  	          var instanceToUse = current.stateNode;
  	          break;
  	        case 30:
  	          instanceToUse = current.stateNode;
  	          break;
  	        default:
  	          instanceToUse = current.stateNode;
  	      }
  	      "function" === typeof ref
  	        ? (current.refCleanup = ref(instanceToUse))
  	        : (ref.current = instanceToUse);
  	    }
  	  } catch (error) {
  	    captureCommitPhaseError(current, nearestMountedAncestor, error);
  	  }
  	}
  	function safelyDetachRef(current, nearestMountedAncestor) {
  	  var ref = current.ref,
  	    refCleanup = current.refCleanup;
  	  if (null !== ref)
  	    if ("function" === typeof refCleanup)
  	      try {
  	        refCleanup();
  	      } catch (error) {
  	        captureCommitPhaseError(current, nearestMountedAncestor, error);
  	      } finally {
  	        (current.refCleanup = null),
  	          (current = current.alternate),
  	          null != current && (current.refCleanup = null);
  	      }
  	    else if ("function" === typeof ref)
  	      try {
  	        ref(null);
  	      } catch (error$140) {
  	        captureCommitPhaseError(current, nearestMountedAncestor, error$140);
  	      }
  	    else ref.current = null;
  	}
  	function commitHostMount(finishedWork) {
  	  var type = finishedWork.type,
  	    props = finishedWork.memoizedProps,
  	    instance = finishedWork.stateNode;
  	  try {
  	    a: switch (type) {
  	      case "button":
  	      case "input":
  	      case "select":
  	      case "textarea":
  	        props.autoFocus && instance.focus();
  	        break a;
  	      case "img":
  	        props.src
  	          ? (instance.src = props.src)
  	          : props.srcSet && (instance.srcset = props.srcSet);
  	    }
  	  } catch (error) {
  	    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	  }
  	}
  	function commitHostUpdate(finishedWork, newProps, oldProps) {
  	  try {
  	    var domElement = finishedWork.stateNode;
  	    updateProperties(domElement, finishedWork.type, oldProps, newProps);
  	    domElement[internalPropsKey] = newProps;
  	  } catch (error) {
  	    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	  }
  	}
  	function isHostParent(fiber) {
  	  return (
  	    5 === fiber.tag ||
  	    3 === fiber.tag ||
  	    26 === fiber.tag ||
  	    (27 === fiber.tag && isSingletonScope(fiber.type)) ||
  	    4 === fiber.tag
  	  );
  	}
  	function getHostSibling(fiber) {
  	  a: for (;;) {
  	    for (; null === fiber.sibling; ) {
  	      if (null === fiber.return || isHostParent(fiber.return)) return null;
  	      fiber = fiber.return;
  	    }
  	    fiber.sibling.return = fiber.return;
  	    for (
  	      fiber = fiber.sibling;
  	      5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag;

  	    ) {
  	      if (27 === fiber.tag && isSingletonScope(fiber.type)) continue a;
  	      if (fiber.flags & 2) continue a;
  	      if (null === fiber.child || 4 === fiber.tag) continue a;
  	      else (fiber.child.return = fiber), (fiber = fiber.child);
  	    }
  	    if (!(fiber.flags & 2)) return fiber.stateNode;
  	  }
  	}
  	function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
  	  var tag = node.tag;
  	  if (5 === tag || 6 === tag)
  	    (node = node.stateNode),
  	      before
  	        ? (9 === parent.nodeType
  	            ? parent.body
  	            : "HTML" === parent.nodeName
  	              ? parent.ownerDocument.body
  	              : parent
  	          ).insertBefore(node, before)
  	        : ((before =
  	            9 === parent.nodeType
  	              ? parent.body
  	              : "HTML" === parent.nodeName
  	                ? parent.ownerDocument.body
  	                : parent),
  	          before.appendChild(node),
  	          (parent = parent._reactRootContainer),
  	          (null !== parent && void 0 !== parent) ||
  	            null !== before.onclick ||
  	            (before.onclick = noop$1));
  	  else if (
  	    4 !== tag &&
  	    (27 === tag &&
  	      isSingletonScope(node.type) &&
  	      ((parent = node.stateNode), (before = null)),
  	    (node = node.child),
  	    null !== node)
  	  )
  	    for (
  	      insertOrAppendPlacementNodeIntoContainer(node, before, parent),
  	        node = node.sibling;
  	      null !== node;

  	    )
  	      insertOrAppendPlacementNodeIntoContainer(node, before, parent),
  	        (node = node.sibling);
  	}
  	function insertOrAppendPlacementNode(node, before, parent) {
  	  var tag = node.tag;
  	  if (5 === tag || 6 === tag)
  	    (node = node.stateNode),
  	      before ? parent.insertBefore(node, before) : parent.appendChild(node);
  	  else if (
  	    4 !== tag &&
  	    (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode),
  	    (node = node.child),
  	    null !== node)
  	  )
  	    for (
  	      insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
  	      null !== node;

  	    )
  	      insertOrAppendPlacementNode(node, before, parent), (node = node.sibling);
  	}
  	function commitHostSingletonAcquisition(finishedWork) {
  	  var singleton = finishedWork.stateNode,
  	    props = finishedWork.memoizedProps;
  	  try {
  	    for (
  	      var type = finishedWork.type, attributes = singleton.attributes;
  	      attributes.length;

  	    )
  	      singleton.removeAttributeNode(attributes[0]);
  	    setInitialProperties(singleton, type, props);
  	    singleton[internalInstanceKey] = finishedWork;
  	    singleton[internalPropsKey] = props;
  	  } catch (error) {
  	    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	  }
  	}
  	var offscreenSubtreeIsHidden = false,
  	  offscreenSubtreeWasHidden = false,
  	  needsFormReset = false,
  	  PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set,
  	  nextEffect = null;
  	function commitBeforeMutationEffects(root, firstChild) {
  	  root = root.containerInfo;
  	  eventsEnabled = _enabled;
  	  root = getActiveElementDeep(root);
  	  if (hasSelectionCapabilities(root)) {
  	    if ("selectionStart" in root)
  	      var JSCompiler_temp = {
  	        start: root.selectionStart,
  	        end: root.selectionEnd
  	      };
  	    else
  	      a: {
  	        JSCompiler_temp =
  	          ((JSCompiler_temp = root.ownerDocument) &&
  	            JSCompiler_temp.defaultView) ||
  	          window;
  	        var selection =
  	          JSCompiler_temp.getSelection && JSCompiler_temp.getSelection();
  	        if (selection && 0 !== selection.rangeCount) {
  	          JSCompiler_temp = selection.anchorNode;
  	          var anchorOffset = selection.anchorOffset,
  	            focusNode = selection.focusNode;
  	          selection = selection.focusOffset;
  	          try {
  	            JSCompiler_temp.nodeType, focusNode.nodeType;
  	          } catch (e$20) {
  	            JSCompiler_temp = null;
  	            break a;
  	          }
  	          var length = 0,
  	            start = -1,
  	            end = -1,
  	            indexWithinAnchor = 0,
  	            indexWithinFocus = 0,
  	            node = root,
  	            parentNode = null;
  	          b: for (;;) {
  	            for (var next; ; ) {
  	              node !== JSCompiler_temp ||
  	                (0 !== anchorOffset && 3 !== node.nodeType) ||
  	                (start = length + anchorOffset);
  	              node !== focusNode ||
  	                (0 !== selection && 3 !== node.nodeType) ||
  	                (end = length + selection);
  	              3 === node.nodeType && (length += node.nodeValue.length);
  	              if (null === (next = node.firstChild)) break;
  	              parentNode = node;
  	              node = next;
  	            }
  	            for (;;) {
  	              if (node === root) break b;
  	              parentNode === JSCompiler_temp &&
  	                ++indexWithinAnchor === anchorOffset &&
  	                (start = length);
  	              parentNode === focusNode &&
  	                ++indexWithinFocus === selection &&
  	                (end = length);
  	              if (null !== (next = node.nextSibling)) break;
  	              node = parentNode;
  	              parentNode = node.parentNode;
  	            }
  	            node = next;
  	          }
  	          JSCompiler_temp =
  	            -1 === start || -1 === end ? null : { start: start, end: end };
  	        } else JSCompiler_temp = null;
  	      }
  	    JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 };
  	  } else JSCompiler_temp = null;
  	  selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp };
  	  _enabled = false;
  	  for (nextEffect = firstChild; null !== nextEffect; )
  	    if (
  	      ((firstChild = nextEffect),
  	      (root = firstChild.child),
  	      0 !== (firstChild.subtreeFlags & 1028) && null !== root)
  	    )
  	      (root.return = firstChild), (nextEffect = root);
  	    else
  	      for (; null !== nextEffect; ) {
  	        firstChild = nextEffect;
  	        focusNode = firstChild.alternate;
  	        root = firstChild.flags;
  	        switch (firstChild.tag) {
  	          case 0:
  	            if (
  	              0 !== (root & 4) &&
  	              ((root = firstChild.updateQueue),
  	              (root = null !== root ? root.events : null),
  	              null !== root)
  	            )
  	              for (
  	                JSCompiler_temp = 0;
  	                JSCompiler_temp < root.length;
  	                JSCompiler_temp++
  	              )
  	                (anchorOffset = root[JSCompiler_temp]),
  	                  (anchorOffset.ref.impl = anchorOffset.nextImpl);
  	            break;
  	          case 11:
  	          case 15:
  	            break;
  	          case 1:
  	            if (0 !== (root & 1024) && null !== focusNode) {
  	              root = void 0;
  	              JSCompiler_temp = firstChild;
  	              anchorOffset = focusNode.memoizedProps;
  	              focusNode = focusNode.memoizedState;
  	              selection = JSCompiler_temp.stateNode;
  	              try {
  	                var resolvedPrevProps = resolveClassComponentProps(
  	                  JSCompiler_temp.type,
  	                  anchorOffset
  	                );
  	                root = selection.getSnapshotBeforeUpdate(
  	                  resolvedPrevProps,
  	                  focusNode
  	                );
  	                selection.__reactInternalSnapshotBeforeUpdate = root;
  	              } catch (error) {
  	                captureCommitPhaseError(
  	                  JSCompiler_temp,
  	                  JSCompiler_temp.return,
  	                  error
  	                );
  	              }
  	            }
  	            break;
  	          case 3:
  	            if (0 !== (root & 1024))
  	              if (
  	                ((root = firstChild.stateNode.containerInfo),
  	                (JSCompiler_temp = root.nodeType),
  	                9 === JSCompiler_temp)
  	              )
  	                clearContainerSparingly(root);
  	              else if (1 === JSCompiler_temp)
  	                switch (root.nodeName) {
  	                  case "HEAD":
  	                  case "HTML":
  	                  case "BODY":
  	                    clearContainerSparingly(root);
  	                    break;
  	                  default:
  	                    root.textContent = "";
  	                }
  	            break;
  	          case 5:
  	          case 26:
  	          case 27:
  	          case 6:
  	          case 4:
  	          case 17:
  	            break;
  	          default:
  	            if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163));
  	        }
  	        root = firstChild.sibling;
  	        if (null !== root) {
  	          root.return = firstChild.return;
  	          nextEffect = root;
  	          break;
  	        }
  	        nextEffect = firstChild.return;
  	      }
  	}
  	function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
  	  var flags = finishedWork.flags;
  	  switch (finishedWork.tag) {
  	    case 0:
  	    case 11:
  	    case 15:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      flags & 4 && commitHookEffectListMount(5, finishedWork);
  	      break;
  	    case 1:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      if (flags & 4)
  	        if (((finishedRoot = finishedWork.stateNode), null === current))
  	          try {
  	            finishedRoot.componentDidMount();
  	          } catch (error) {
  	            captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	          }
  	        else {
  	          var prevProps = resolveClassComponentProps(
  	            finishedWork.type,
  	            current.memoizedProps
  	          );
  	          current = current.memoizedState;
  	          try {
  	            finishedRoot.componentDidUpdate(
  	              prevProps,
  	              current,
  	              finishedRoot.__reactInternalSnapshotBeforeUpdate
  	            );
  	          } catch (error$139) {
  	            captureCommitPhaseError(
  	              finishedWork,
  	              finishedWork.return,
  	              error$139
  	            );
  	          }
  	        }
  	      flags & 64 && commitClassCallbacks(finishedWork);
  	      flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
  	      break;
  	    case 3:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      if (
  	        flags & 64 &&
  	        ((finishedRoot = finishedWork.updateQueue), null !== finishedRoot)
  	      ) {
  	        current = null;
  	        if (null !== finishedWork.child)
  	          switch (finishedWork.child.tag) {
  	            case 27:
  	            case 5:
  	              current = finishedWork.child.stateNode;
  	              break;
  	            case 1:
  	              current = finishedWork.child.stateNode;
  	          }
  	        try {
  	          commitCallbacks(finishedRoot, current);
  	        } catch (error) {
  	          captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	        }
  	      }
  	      break;
  	    case 27:
  	      null === current &&
  	        flags & 4 &&
  	        commitHostSingletonAcquisition(finishedWork);
  	    case 26:
  	    case 5:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      null === current && flags & 4 && commitHostMount(finishedWork);
  	      flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
  	      break;
  	    case 12:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      break;
  	    case 31:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
  	      break;
  	    case 13:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	      flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
  	      flags & 64 &&
  	        ((finishedRoot = finishedWork.memoizedState),
  	        null !== finishedRoot &&
  	          ((finishedRoot = finishedRoot.dehydrated),
  	          null !== finishedRoot &&
  	            ((finishedWork = retryDehydratedSuspenseBoundary.bind(
  	              null,
  	              finishedWork
  	            )),
  	            registerSuspenseInstanceRetry(finishedRoot, finishedWork))));
  	      break;
  	    case 22:
  	      flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden;
  	      if (!flags) {
  	        current =
  	          (null !== current && null !== current.memoizedState) ||
  	          offscreenSubtreeWasHidden;
  	        prevProps = offscreenSubtreeIsHidden;
  	        var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
  	        offscreenSubtreeIsHidden = flags;
  	        (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden
  	          ? recursivelyTraverseReappearLayoutEffects(
  	              finishedRoot,
  	              finishedWork,
  	              0 !== (finishedWork.subtreeFlags & 8772)
  	            )
  	          : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	        offscreenSubtreeIsHidden = prevProps;
  	        offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
  	      }
  	      break;
  	    case 30:
  	      break;
  	    default:
  	      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  	  }
  	}
  	function detachFiberAfterEffects(fiber) {
  	  var alternate = fiber.alternate;
  	  null !== alternate &&
  	    ((fiber.alternate = null), detachFiberAfterEffects(alternate));
  	  fiber.child = null;
  	  fiber.deletions = null;
  	  fiber.sibling = null;
  	  5 === fiber.tag &&
  	    ((alternate = fiber.stateNode),
  	    null !== alternate && detachDeletedInstance(alternate));
  	  fiber.stateNode = null;
  	  fiber.return = null;
  	  fiber.dependencies = null;
  	  fiber.memoizedProps = null;
  	  fiber.memoizedState = null;
  	  fiber.pendingProps = null;
  	  fiber.stateNode = null;
  	  fiber.updateQueue = null;
  	}
  	var hostParent = null,
  	  hostParentIsContainer = false;
  	function recursivelyTraverseDeletionEffects(
  	  finishedRoot,
  	  nearestMountedAncestor,
  	  parent
  	) {
  	  for (parent = parent.child; null !== parent; )
  	    commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent),
  	      (parent = parent.sibling);
  	}
  	function commitDeletionEffectsOnFiber(
  	  finishedRoot,
  	  nearestMountedAncestor,
  	  deletedFiber
  	) {
  	  if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
  	    try {
  	      injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
  	    } catch (err) {}
  	  switch (deletedFiber.tag) {
  	    case 26:
  	      offscreenSubtreeWasHidden ||
  	        safelyDetachRef(deletedFiber, nearestMountedAncestor);
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      deletedFiber.memoizedState
  	        ? deletedFiber.memoizedState.count--
  	        : deletedFiber.stateNode &&
  	          ((deletedFiber = deletedFiber.stateNode),
  	          deletedFiber.parentNode.removeChild(deletedFiber));
  	      break;
  	    case 27:
  	      offscreenSubtreeWasHidden ||
  	        safelyDetachRef(deletedFiber, nearestMountedAncestor);
  	      var prevHostParent = hostParent,
  	        prevHostParentIsContainer = hostParentIsContainer;
  	      isSingletonScope(deletedFiber.type) &&
  	        ((hostParent = deletedFiber.stateNode), (hostParentIsContainer = false));
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      releaseSingletonInstance(deletedFiber.stateNode);
  	      hostParent = prevHostParent;
  	      hostParentIsContainer = prevHostParentIsContainer;
  	      break;
  	    case 5:
  	      offscreenSubtreeWasHidden ||
  	        safelyDetachRef(deletedFiber, nearestMountedAncestor);
  	    case 6:
  	      prevHostParent = hostParent;
  	      prevHostParentIsContainer = hostParentIsContainer;
  	      hostParent = null;
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      hostParent = prevHostParent;
  	      hostParentIsContainer = prevHostParentIsContainer;
  	      if (null !== hostParent)
  	        if (hostParentIsContainer)
  	          try {
  	            (9 === hostParent.nodeType
  	              ? hostParent.body
  	              : "HTML" === hostParent.nodeName
  	                ? hostParent.ownerDocument.body
  	                : hostParent
  	            ).removeChild(deletedFiber.stateNode);
  	          } catch (error) {
  	            captureCommitPhaseError(
  	              deletedFiber,
  	              nearestMountedAncestor,
  	              error
  	            );
  	          }
  	        else
  	          try {
  	            hostParent.removeChild(deletedFiber.stateNode);
  	          } catch (error) {
  	            captureCommitPhaseError(
  	              deletedFiber,
  	              nearestMountedAncestor,
  	              error
  	            );
  	          }
  	      break;
  	    case 18:
  	      null !== hostParent &&
  	        (hostParentIsContainer
  	          ? ((finishedRoot = hostParent),
  	            clearHydrationBoundary(
  	              9 === finishedRoot.nodeType
  	                ? finishedRoot.body
  	                : "HTML" === finishedRoot.nodeName
  	                  ? finishedRoot.ownerDocument.body
  	                  : finishedRoot,
  	              deletedFiber.stateNode
  	            ),
  	            retryIfBlockedOn(finishedRoot))
  	          : clearHydrationBoundary(hostParent, deletedFiber.stateNode));
  	      break;
  	    case 4:
  	      prevHostParent = hostParent;
  	      prevHostParentIsContainer = hostParentIsContainer;
  	      hostParent = deletedFiber.stateNode.containerInfo;
  	      hostParentIsContainer = true;
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      hostParent = prevHostParent;
  	      hostParentIsContainer = prevHostParentIsContainer;
  	      break;
  	    case 0:
  	    case 11:
  	    case 14:
  	    case 15:
  	      commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor);
  	      offscreenSubtreeWasHidden ||
  	        commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor);
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      break;
  	    case 1:
  	      offscreenSubtreeWasHidden ||
  	        (safelyDetachRef(deletedFiber, nearestMountedAncestor),
  	        (prevHostParent = deletedFiber.stateNode),
  	        "function" === typeof prevHostParent.componentWillUnmount &&
  	          safelyCallComponentWillUnmount(
  	            deletedFiber,
  	            nearestMountedAncestor,
  	            prevHostParent
  	          ));
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      break;
  	    case 21:
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      break;
  	    case 22:
  	      offscreenSubtreeWasHidden =
  	        (prevHostParent = offscreenSubtreeWasHidden) ||
  	        null !== deletedFiber.memoizedState;
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	      offscreenSubtreeWasHidden = prevHostParent;
  	      break;
  	    default:
  	      recursivelyTraverseDeletionEffects(
  	        finishedRoot,
  	        nearestMountedAncestor,
  	        deletedFiber
  	      );
  	  }
  	}
  	function commitActivityHydrationCallbacks(finishedRoot, finishedWork) {
  	  if (
  	    null === finishedWork.memoizedState &&
  	    ((finishedRoot = finishedWork.alternate),
  	    null !== finishedRoot &&
  	      ((finishedRoot = finishedRoot.memoizedState), null !== finishedRoot))
  	  ) {
  	    finishedRoot = finishedRoot.dehydrated;
  	    try {
  	      retryIfBlockedOn(finishedRoot);
  	    } catch (error) {
  	      captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	    }
  	  }
  	}
  	function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
  	  if (
  	    null === finishedWork.memoizedState &&
  	    ((finishedRoot = finishedWork.alternate),
  	    null !== finishedRoot &&
  	      ((finishedRoot = finishedRoot.memoizedState),
  	      null !== finishedRoot &&
  	        ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot)))
  	  )
  	    try {
  	      retryIfBlockedOn(finishedRoot);
  	    } catch (error) {
  	      captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	    }
  	}
  	function getRetryCache(finishedWork) {
  	  switch (finishedWork.tag) {
  	    case 31:
  	    case 13:
  	    case 19:
  	      var retryCache = finishedWork.stateNode;
  	      null === retryCache &&
  	        (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
  	      return retryCache;
  	    case 22:
  	      return (
  	        (finishedWork = finishedWork.stateNode),
  	        (retryCache = finishedWork._retryCache),
  	        null === retryCache &&
  	          (retryCache = finishedWork._retryCache = new PossiblyWeakSet()),
  	        retryCache
  	      );
  	    default:
  	      throw Error(formatProdErrorMessage(435, finishedWork.tag));
  	  }
  	}
  	function attachSuspenseRetryListeners(finishedWork, wakeables) {
  	  var retryCache = getRetryCache(finishedWork);
  	  wakeables.forEach(function (wakeable) {
  	    if (!retryCache.has(wakeable)) {
  	      retryCache.add(wakeable);
  	      var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
  	      wakeable.then(retry, retry);
  	    }
  	  });
  	}
  	function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
  	  var deletions = parentFiber.deletions;
  	  if (null !== deletions)
  	    for (var i = 0; i < deletions.length; i++) {
  	      var childToDelete = deletions[i],
  	        root = root$jscomp$0,
  	        returnFiber = parentFiber,
  	        parent = returnFiber;
  	      a: for (; null !== parent; ) {
  	        switch (parent.tag) {
  	          case 27:
  	            if (isSingletonScope(parent.type)) {
  	              hostParent = parent.stateNode;
  	              hostParentIsContainer = false;
  	              break a;
  	            }
  	            break;
  	          case 5:
  	            hostParent = parent.stateNode;
  	            hostParentIsContainer = false;
  	            break a;
  	          case 3:
  	          case 4:
  	            hostParent = parent.stateNode.containerInfo;
  	            hostParentIsContainer = true;
  	            break a;
  	        }
  	        parent = parent.return;
  	      }
  	      if (null === hostParent) throw Error(formatProdErrorMessage(160));
  	      commitDeletionEffectsOnFiber(root, returnFiber, childToDelete);
  	      hostParent = null;
  	      hostParentIsContainer = false;
  	      root = childToDelete.alternate;
  	      null !== root && (root.return = null);
  	      childToDelete.return = null;
  	    }
  	  if (parentFiber.subtreeFlags & 13886)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; )
  	      commitMutationEffectsOnFiber(parentFiber, root$jscomp$0),
  	        (parentFiber = parentFiber.sibling);
  	}
  	var currentHoistableRoot = null;
  	function commitMutationEffectsOnFiber(finishedWork, root) {
  	  var current = finishedWork.alternate,
  	    flags = finishedWork.flags;
  	  switch (finishedWork.tag) {
  	    case 0:
  	    case 11:
  	    case 14:
  	    case 15:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 4 &&
  	        (commitHookEffectListUnmount(3, finishedWork, finishedWork.return),
  	        commitHookEffectListMount(3, finishedWork),
  	        commitHookEffectListUnmount(5, finishedWork, finishedWork.return));
  	      break;
  	    case 1:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 512 &&
  	        (offscreenSubtreeWasHidden ||
  	          null === current ||
  	          safelyDetachRef(current, current.return));
  	      flags & 64 &&
  	        offscreenSubtreeIsHidden &&
  	        ((finishedWork = finishedWork.updateQueue),
  	        null !== finishedWork &&
  	          ((flags = finishedWork.callbacks),
  	          null !== flags &&
  	            ((current = finishedWork.shared.hiddenCallbacks),
  	            (finishedWork.shared.hiddenCallbacks =
  	              null === current ? flags : current.concat(flags)))));
  	      break;
  	    case 26:
  	      var hoistableRoot = currentHoistableRoot;
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 512 &&
  	        (offscreenSubtreeWasHidden ||
  	          null === current ||
  	          safelyDetachRef(current, current.return));
  	      if (flags & 4) {
  	        var currentResource = null !== current ? current.memoizedState : null;
  	        flags = finishedWork.memoizedState;
  	        if (null === current)
  	          if (null === flags)
  	            if (null === finishedWork.stateNode) {
  	              a: {
  	                flags = finishedWork.type;
  	                current = finishedWork.memoizedProps;
  	                hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
  	                b: switch (flags) {
  	                  case "title":
  	                    currentResource =
  	                      hoistableRoot.getElementsByTagName("title")[0];
  	                    if (
  	                      !currentResource ||
  	                      currentResource[internalHoistableMarker] ||
  	                      currentResource[internalInstanceKey] ||
  	                      "http://www.w3.org/2000/svg" ===
  	                        currentResource.namespaceURI ||
  	                      currentResource.hasAttribute("itemprop")
  	                    )
  	                      (currentResource = hoistableRoot.createElement(flags)),
  	                        hoistableRoot.head.insertBefore(
  	                          currentResource,
  	                          hoistableRoot.querySelector("head > title")
  	                        );
  	                    setInitialProperties(currentResource, flags, current);
  	                    currentResource[internalInstanceKey] = finishedWork;
  	                    markNodeAsHoistable(currentResource);
  	                    flags = currentResource;
  	                    break a;
  	                  case "link":
  	                    var maybeNodes = getHydratableHoistableCache(
  	                      "link",
  	                      "href",
  	                      hoistableRoot
  	                    ).get(flags + (current.href || ""));
  	                    if (maybeNodes)
  	                      for (var i = 0; i < maybeNodes.length; i++)
  	                        if (
  	                          ((currentResource = maybeNodes[i]),
  	                          currentResource.getAttribute("href") ===
  	                            (null == current.href || "" === current.href
  	                              ? null
  	                              : current.href) &&
  	                            currentResource.getAttribute("rel") ===
  	                              (null == current.rel ? null : current.rel) &&
  	                            currentResource.getAttribute("title") ===
  	                              (null == current.title ? null : current.title) &&
  	                            currentResource.getAttribute("crossorigin") ===
  	                              (null == current.crossOrigin
  	                                ? null
  	                                : current.crossOrigin))
  	                        ) {
  	                          maybeNodes.splice(i, 1);
  	                          break b;
  	                        }
  	                    currentResource = hoistableRoot.createElement(flags);
  	                    setInitialProperties(currentResource, flags, current);
  	                    hoistableRoot.head.appendChild(currentResource);
  	                    break;
  	                  case "meta":
  	                    if (
  	                      (maybeNodes = getHydratableHoistableCache(
  	                        "meta",
  	                        "content",
  	                        hoistableRoot
  	                      ).get(flags + (current.content || "")))
  	                    )
  	                      for (i = 0; i < maybeNodes.length; i++)
  	                        if (
  	                          ((currentResource = maybeNodes[i]),
  	                          currentResource.getAttribute("content") ===
  	                            (null == current.content
  	                              ? null
  	                              : "" + current.content) &&
  	                            currentResource.getAttribute("name") ===
  	                              (null == current.name ? null : current.name) &&
  	                            currentResource.getAttribute("property") ===
  	                              (null == current.property
  	                                ? null
  	                                : current.property) &&
  	                            currentResource.getAttribute("http-equiv") ===
  	                              (null == current.httpEquiv
  	                                ? null
  	                                : current.httpEquiv) &&
  	                            currentResource.getAttribute("charset") ===
  	                              (null == current.charSet
  	                                ? null
  	                                : current.charSet))
  	                        ) {
  	                          maybeNodes.splice(i, 1);
  	                          break b;
  	                        }
  	                    currentResource = hoistableRoot.createElement(flags);
  	                    setInitialProperties(currentResource, flags, current);
  	                    hoistableRoot.head.appendChild(currentResource);
  	                    break;
  	                  default:
  	                    throw Error(formatProdErrorMessage(468, flags));
  	                }
  	                currentResource[internalInstanceKey] = finishedWork;
  	                markNodeAsHoistable(currentResource);
  	                flags = currentResource;
  	              }
  	              finishedWork.stateNode = flags;
  	            } else
  	              mountHoistable(
  	                hoistableRoot,
  	                finishedWork.type,
  	                finishedWork.stateNode
  	              );
  	          else
  	            finishedWork.stateNode = acquireResource(
  	              hoistableRoot,
  	              flags,
  	              finishedWork.memoizedProps
  	            );
  	        else
  	          currentResource !== flags
  	            ? (null === currentResource
  	                ? null !== current.stateNode &&
  	                  ((current = current.stateNode),
  	                  current.parentNode.removeChild(current))
  	                : currentResource.count--,
  	              null === flags
  	                ? mountHoistable(
  	                    hoistableRoot,
  	                    finishedWork.type,
  	                    finishedWork.stateNode
  	                  )
  	                : acquireResource(
  	                    hoistableRoot,
  	                    flags,
  	                    finishedWork.memoizedProps
  	                  ))
  	            : null === flags &&
  	              null !== finishedWork.stateNode &&
  	              commitHostUpdate(
  	                finishedWork,
  	                finishedWork.memoizedProps,
  	                current.memoizedProps
  	              );
  	      }
  	      break;
  	    case 27:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 512 &&
  	        (offscreenSubtreeWasHidden ||
  	          null === current ||
  	          safelyDetachRef(current, current.return));
  	      null !== current &&
  	        flags & 4 &&
  	        commitHostUpdate(
  	          finishedWork,
  	          finishedWork.memoizedProps,
  	          current.memoizedProps
  	        );
  	      break;
  	    case 5:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 512 &&
  	        (offscreenSubtreeWasHidden ||
  	          null === current ||
  	          safelyDetachRef(current, current.return));
  	      if (finishedWork.flags & 32) {
  	        hoistableRoot = finishedWork.stateNode;
  	        try {
  	          setTextContent(hoistableRoot, "");
  	        } catch (error) {
  	          captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	        }
  	      }
  	      flags & 4 &&
  	        null != finishedWork.stateNode &&
  	        ((hoistableRoot = finishedWork.memoizedProps),
  	        commitHostUpdate(
  	          finishedWork,
  	          hoistableRoot,
  	          null !== current ? current.memoizedProps : hoistableRoot
  	        ));
  	      flags & 1024 && (needsFormReset = true);
  	      break;
  	    case 6:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      if (flags & 4) {
  	        if (null === finishedWork.stateNode)
  	          throw Error(formatProdErrorMessage(162));
  	        flags = finishedWork.memoizedProps;
  	        current = finishedWork.stateNode;
  	        try {
  	          current.nodeValue = flags;
  	        } catch (error) {
  	          captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	        }
  	      }
  	      break;
  	    case 3:
  	      tagCaches = null;
  	      hoistableRoot = currentHoistableRoot;
  	      currentHoistableRoot = getHoistableRoot(root.containerInfo);
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      currentHoistableRoot = hoistableRoot;
  	      commitReconciliationEffects(finishedWork);
  	      if (flags & 4 && null !== current && current.memoizedState.isDehydrated)
  	        try {
  	          retryIfBlockedOn(root.containerInfo);
  	        } catch (error) {
  	          captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	        }
  	      needsFormReset &&
  	        ((needsFormReset = false), recursivelyResetForms(finishedWork));
  	      break;
  	    case 4:
  	      flags = currentHoistableRoot;
  	      currentHoistableRoot = getHoistableRoot(
  	        finishedWork.stateNode.containerInfo
  	      );
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      currentHoistableRoot = flags;
  	      break;
  	    case 12:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      break;
  	    case 31:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 4 &&
  	        ((flags = finishedWork.updateQueue),
  	        null !== flags &&
  	          ((finishedWork.updateQueue = null),
  	          attachSuspenseRetryListeners(finishedWork, flags)));
  	      break;
  	    case 13:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      finishedWork.child.flags & 8192 &&
  	        (null !== finishedWork.memoizedState) !==
  	          (null !== current && null !== current.memoizedState) &&
  	        (globalMostRecentFallbackTime = now());
  	      flags & 4 &&
  	        ((flags = finishedWork.updateQueue),
  	        null !== flags &&
  	          ((finishedWork.updateQueue = null),
  	          attachSuspenseRetryListeners(finishedWork, flags)));
  	      break;
  	    case 22:
  	      hoistableRoot = null !== finishedWork.memoizedState;
  	      var wasHidden = null !== current && null !== current.memoizedState,
  	        prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden,
  	        prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
  	      offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot;
  	      offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
  	      offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
  	      commitReconciliationEffects(finishedWork);
  	      if (flags & 8192)
  	        a: for (
  	          root = finishedWork.stateNode,
  	            root._visibility = hoistableRoot
  	              ? root._visibility & -2
  	              : root._visibility | 1,
  	            hoistableRoot &&
  	              (null === current ||
  	                wasHidden ||
  	                offscreenSubtreeIsHidden ||
  	                offscreenSubtreeWasHidden ||
  	                recursivelyTraverseDisappearLayoutEffects(finishedWork)),
  	            current = null,
  	            root = finishedWork;
  	          ;

  	        ) {
  	          if (5 === root.tag || 26 === root.tag) {
  	            if (null === current) {
  	              wasHidden = current = root;
  	              try {
  	                if (((currentResource = wasHidden.stateNode), hoistableRoot))
  	                  (maybeNodes = currentResource.style),
  	                    "function" === typeof maybeNodes.setProperty
  	                      ? maybeNodes.setProperty("display", "none", "important")
  	                      : (maybeNodes.display = "none");
  	                else {
  	                  i = wasHidden.stateNode;
  	                  var styleProp = wasHidden.memoizedProps.style,
  	                    display =
  	                      void 0 !== styleProp &&
  	                      null !== styleProp &&
  	                      styleProp.hasOwnProperty("display")
  	                        ? styleProp.display
  	                        : null;
  	                  i.style.display =
  	                    null == display || "boolean" === typeof display
  	                      ? ""
  	                      : ("" + display).trim();
  	                }
  	              } catch (error) {
  	                captureCommitPhaseError(wasHidden, wasHidden.return, error);
  	              }
  	            }
  	          } else if (6 === root.tag) {
  	            if (null === current) {
  	              wasHidden = root;
  	              try {
  	                wasHidden.stateNode.nodeValue = hoistableRoot
  	                  ? ""
  	                  : wasHidden.memoizedProps;
  	              } catch (error) {
  	                captureCommitPhaseError(wasHidden, wasHidden.return, error);
  	              }
  	            }
  	          } else if (18 === root.tag) {
  	            if (null === current) {
  	              wasHidden = root;
  	              try {
  	                var instance = wasHidden.stateNode;
  	                hoistableRoot
  	                  ? hideOrUnhideDehydratedBoundary(instance, !0)
  	                  : hideOrUnhideDehydratedBoundary(wasHidden.stateNode, !1);
  	              } catch (error) {
  	                captureCommitPhaseError(wasHidden, wasHidden.return, error);
  	              }
  	            }
  	          } else if (
  	            ((22 !== root.tag && 23 !== root.tag) ||
  	              null === root.memoizedState ||
  	              root === finishedWork) &&
  	            null !== root.child
  	          ) {
  	            root.child.return = root;
  	            root = root.child;
  	            continue;
  	          }
  	          if (root === finishedWork) break a;
  	          for (; null === root.sibling; ) {
  	            if (null === root.return || root.return === finishedWork) break a;
  	            current === root && (current = null);
  	            root = root.return;
  	          }
  	          current === root && (current = null);
  	          root.sibling.return = root.return;
  	          root = root.sibling;
  	        }
  	      flags & 4 &&
  	        ((flags = finishedWork.updateQueue),
  	        null !== flags &&
  	          ((current = flags.retryQueue),
  	          null !== current &&
  	            ((flags.retryQueue = null),
  	            attachSuspenseRetryListeners(finishedWork, current))));
  	      break;
  	    case 19:
  	      recursivelyTraverseMutationEffects(root, finishedWork);
  	      commitReconciliationEffects(finishedWork);
  	      flags & 4 &&
  	        ((flags = finishedWork.updateQueue),
  	        null !== flags &&
  	          ((finishedWork.updateQueue = null),
  	          attachSuspenseRetryListeners(finishedWork, flags)));
  	      break;
  	    case 30:
  	      break;
  	    case 21:
  	      break;
  	    default:
  	      recursivelyTraverseMutationEffects(root, finishedWork),
  	        commitReconciliationEffects(finishedWork);
  	  }
  	}
  	function commitReconciliationEffects(finishedWork) {
  	  var flags = finishedWork.flags;
  	  if (flags & 2) {
  	    try {
  	      for (
  	        var hostParentFiber, parentFiber = finishedWork.return;
  	        null !== parentFiber;

  	      ) {
  	        if (isHostParent(parentFiber)) {
  	          hostParentFiber = parentFiber;
  	          break;
  	        }
  	        parentFiber = parentFiber.return;
  	      }
  	      if (null == hostParentFiber) throw Error(formatProdErrorMessage(160));
  	      switch (hostParentFiber.tag) {
  	        case 27:
  	          var parent = hostParentFiber.stateNode,
  	            before = getHostSibling(finishedWork);
  	          insertOrAppendPlacementNode(finishedWork, before, parent);
  	          break;
  	        case 5:
  	          var parent$141 = hostParentFiber.stateNode;
  	          hostParentFiber.flags & 32 &&
  	            (setTextContent(parent$141, ""), (hostParentFiber.flags &= -33));
  	          var before$142 = getHostSibling(finishedWork);
  	          insertOrAppendPlacementNode(finishedWork, before$142, parent$141);
  	          break;
  	        case 3:
  	        case 4:
  	          var parent$143 = hostParentFiber.stateNode.containerInfo,
  	            before$144 = getHostSibling(finishedWork);
  	          insertOrAppendPlacementNodeIntoContainer(
  	            finishedWork,
  	            before$144,
  	            parent$143
  	          );
  	          break;
  	        default:
  	          throw Error(formatProdErrorMessage(161));
  	      }
  	    } catch (error) {
  	      captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	    }
  	    finishedWork.flags &= -3;
  	  }
  	  flags & 4096 && (finishedWork.flags &= -4097);
  	}
  	function recursivelyResetForms(parentFiber) {
  	  if (parentFiber.subtreeFlags & 1024)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
  	      var fiber = parentFiber;
  	      recursivelyResetForms(fiber);
  	      5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset();
  	      parentFiber = parentFiber.sibling;
  	    }
  	}
  	function recursivelyTraverseLayoutEffects(root, parentFiber) {
  	  if (parentFiber.subtreeFlags & 8772)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; )
  	      commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber),
  	        (parentFiber = parentFiber.sibling);
  	}
  	function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
  	  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
  	    var finishedWork = parentFiber;
  	    switch (finishedWork.tag) {
  	      case 0:
  	      case 11:
  	      case 14:
  	      case 15:
  	        commitHookEffectListUnmount(4, finishedWork, finishedWork.return);
  	        recursivelyTraverseDisappearLayoutEffects(finishedWork);
  	        break;
  	      case 1:
  	        safelyDetachRef(finishedWork, finishedWork.return);
  	        var instance = finishedWork.stateNode;
  	        "function" === typeof instance.componentWillUnmount &&
  	          safelyCallComponentWillUnmount(
  	            finishedWork,
  	            finishedWork.return,
  	            instance
  	          );
  	        recursivelyTraverseDisappearLayoutEffects(finishedWork);
  	        break;
  	      case 27:
  	        releaseSingletonInstance(finishedWork.stateNode);
  	      case 26:
  	      case 5:
  	        safelyDetachRef(finishedWork, finishedWork.return);
  	        recursivelyTraverseDisappearLayoutEffects(finishedWork);
  	        break;
  	      case 22:
  	        null === finishedWork.memoizedState &&
  	          recursivelyTraverseDisappearLayoutEffects(finishedWork);
  	        break;
  	      case 30:
  	        recursivelyTraverseDisappearLayoutEffects(finishedWork);
  	        break;
  	      default:
  	        recursivelyTraverseDisappearLayoutEffects(finishedWork);
  	    }
  	    parentFiber = parentFiber.sibling;
  	  }
  	}
  	function recursivelyTraverseReappearLayoutEffects(
  	  finishedRoot$jscomp$0,
  	  parentFiber,
  	  includeWorkInProgressEffects
  	) {
  	  includeWorkInProgressEffects =
  	    includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
  	  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
  	    var current = parentFiber.alternate,
  	      finishedRoot = finishedRoot$jscomp$0,
  	      finishedWork = parentFiber,
  	      flags = finishedWork.flags;
  	    switch (finishedWork.tag) {
  	      case 0:
  	      case 11:
  	      case 15:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	        commitHookEffectListMount(4, finishedWork);
  	        break;
  	      case 1:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	        current = finishedWork;
  	        finishedRoot = current.stateNode;
  	        if ("function" === typeof finishedRoot.componentDidMount)
  	          try {
  	            finishedRoot.componentDidMount();
  	          } catch (error) {
  	            captureCommitPhaseError(current, current.return, error);
  	          }
  	        current = finishedWork;
  	        finishedRoot = current.updateQueue;
  	        if (null !== finishedRoot) {
  	          var instance = current.stateNode;
  	          try {
  	            var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks;
  	            if (null !== hiddenCallbacks)
  	              for (
  	                finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0;
  	                finishedRoot < hiddenCallbacks.length;
  	                finishedRoot++
  	              )
  	                callCallback(hiddenCallbacks[finishedRoot], instance);
  	          } catch (error) {
  	            captureCommitPhaseError(current, current.return, error);
  	          }
  	        }
  	        includeWorkInProgressEffects &&
  	          flags & 64 &&
  	          commitClassCallbacks(finishedWork);
  	        safelyAttachRef(finishedWork, finishedWork.return);
  	        break;
  	      case 27:
  	        commitHostSingletonAcquisition(finishedWork);
  	      case 26:
  	      case 5:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	        includeWorkInProgressEffects &&
  	          null === current &&
  	          flags & 4 &&
  	          commitHostMount(finishedWork);
  	        safelyAttachRef(finishedWork, finishedWork.return);
  	        break;
  	      case 12:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	        break;
  	      case 31:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	        includeWorkInProgressEffects &&
  	          flags & 4 &&
  	          commitActivityHydrationCallbacks(finishedRoot, finishedWork);
  	        break;
  	      case 13:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	        includeWorkInProgressEffects &&
  	          flags & 4 &&
  	          commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
  	        break;
  	      case 22:
  	        null === finishedWork.memoizedState &&
  	          recursivelyTraverseReappearLayoutEffects(
  	            finishedRoot,
  	            finishedWork,
  	            includeWorkInProgressEffects
  	          );
  	        safelyAttachRef(finishedWork, finishedWork.return);
  	        break;
  	      case 30:
  	        break;
  	      default:
  	        recursivelyTraverseReappearLayoutEffects(
  	          finishedRoot,
  	          finishedWork,
  	          includeWorkInProgressEffects
  	        );
  	    }
  	    parentFiber = parentFiber.sibling;
  	  }
  	}
  	function commitOffscreenPassiveMountEffects(current, finishedWork) {
  	  var previousCache = null;
  	  null !== current &&
  	    null !== current.memoizedState &&
  	    null !== current.memoizedState.cachePool &&
  	    (previousCache = current.memoizedState.cachePool.pool);
  	  current = null;
  	  null !== finishedWork.memoizedState &&
  	    null !== finishedWork.memoizedState.cachePool &&
  	    (current = finishedWork.memoizedState.cachePool.pool);
  	  current !== previousCache &&
  	    (null != current && current.refCount++,
  	    null != previousCache && releaseCache(previousCache));
  	}
  	function commitCachePassiveMountEffect(current, finishedWork) {
  	  current = null;
  	  null !== finishedWork.alternate &&
  	    (current = finishedWork.alternate.memoizedState.cache);
  	  finishedWork = finishedWork.memoizedState.cache;
  	  finishedWork !== current &&
  	    (finishedWork.refCount++, null != current && releaseCache(current));
  	}
  	function recursivelyTraversePassiveMountEffects(
  	  root,
  	  parentFiber,
  	  committedLanes,
  	  committedTransitions
  	) {
  	  if (parentFiber.subtreeFlags & 10256)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; )
  	      commitPassiveMountOnFiber(
  	        root,
  	        parentFiber,
  	        committedLanes,
  	        committedTransitions
  	      ),
  	        (parentFiber = parentFiber.sibling);
  	}
  	function commitPassiveMountOnFiber(
  	  finishedRoot,
  	  finishedWork,
  	  committedLanes,
  	  committedTransitions
  	) {
  	  var flags = finishedWork.flags;
  	  switch (finishedWork.tag) {
  	    case 0:
  	    case 11:
  	    case 15:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	      flags & 2048 && commitHookEffectListMount(9, finishedWork);
  	      break;
  	    case 1:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	      break;
  	    case 3:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	      flags & 2048 &&
  	        ((finishedRoot = null),
  	        null !== finishedWork.alternate &&
  	          (finishedRoot = finishedWork.alternate.memoizedState.cache),
  	        (finishedWork = finishedWork.memoizedState.cache),
  	        finishedWork !== finishedRoot &&
  	          (finishedWork.refCount++,
  	          null != finishedRoot && releaseCache(finishedRoot)));
  	      break;
  	    case 12:
  	      if (flags & 2048) {
  	        recursivelyTraversePassiveMountEffects(
  	          finishedRoot,
  	          finishedWork,
  	          committedLanes,
  	          committedTransitions
  	        );
  	        finishedRoot = finishedWork.stateNode;
  	        try {
  	          var _finishedWork$memoize2 = finishedWork.memoizedProps,
  	            id = _finishedWork$memoize2.id,
  	            onPostCommit = _finishedWork$memoize2.onPostCommit;
  	          "function" === typeof onPostCommit &&
  	            onPostCommit(
  	              id,
  	              null === finishedWork.alternate ? "mount" : "update",
  	              finishedRoot.passiveEffectDuration,
  	              -0
  	            );
  	        } catch (error) {
  	          captureCommitPhaseError(finishedWork, finishedWork.return, error);
  	        }
  	      } else
  	        recursivelyTraversePassiveMountEffects(
  	          finishedRoot,
  	          finishedWork,
  	          committedLanes,
  	          committedTransitions
  	        );
  	      break;
  	    case 31:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	      break;
  	    case 13:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	      break;
  	    case 23:
  	      break;
  	    case 22:
  	      _finishedWork$memoize2 = finishedWork.stateNode;
  	      id = finishedWork.alternate;
  	      null !== finishedWork.memoizedState
  	        ? _finishedWork$memoize2._visibility & 2
  	          ? recursivelyTraversePassiveMountEffects(
  	              finishedRoot,
  	              finishedWork,
  	              committedLanes,
  	              committedTransitions
  	            )
  	          : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork)
  	        : _finishedWork$memoize2._visibility & 2
  	          ? recursivelyTraversePassiveMountEffects(
  	              finishedRoot,
  	              finishedWork,
  	              committedLanes,
  	              committedTransitions
  	            )
  	          : ((_finishedWork$memoize2._visibility |= 2),
  	            recursivelyTraverseReconnectPassiveEffects(
  	              finishedRoot,
  	              finishedWork,
  	              committedLanes,
  	              committedTransitions,
  	              0 !== (finishedWork.subtreeFlags & 10256) || false
  	            ));
  	      flags & 2048 && commitOffscreenPassiveMountEffects(id, finishedWork);
  	      break;
  	    case 24:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	      flags & 2048 &&
  	        commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
  	      break;
  	    default:
  	      recursivelyTraversePassiveMountEffects(
  	        finishedRoot,
  	        finishedWork,
  	        committedLanes,
  	        committedTransitions
  	      );
  	  }
  	}
  	function recursivelyTraverseReconnectPassiveEffects(
  	  finishedRoot$jscomp$0,
  	  parentFiber,
  	  committedLanes$jscomp$0,
  	  committedTransitions$jscomp$0,
  	  includeWorkInProgressEffects
  	) {
  	  includeWorkInProgressEffects =
  	    includeWorkInProgressEffects &&
  	    (0 !== (parentFiber.subtreeFlags & 10256) || false);
  	  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
  	    var finishedRoot = finishedRoot$jscomp$0,
  	      finishedWork = parentFiber,
  	      committedLanes = committedLanes$jscomp$0,
  	      committedTransitions = committedTransitions$jscomp$0,
  	      flags = finishedWork.flags;
  	    switch (finishedWork.tag) {
  	      case 0:
  	      case 11:
  	      case 15:
  	        recursivelyTraverseReconnectPassiveEffects(
  	          finishedRoot,
  	          finishedWork,
  	          committedLanes,
  	          committedTransitions,
  	          includeWorkInProgressEffects
  	        );
  	        commitHookEffectListMount(8, finishedWork);
  	        break;
  	      case 23:
  	        break;
  	      case 22:
  	        var instance = finishedWork.stateNode;
  	        null !== finishedWork.memoizedState
  	          ? instance._visibility & 2
  	            ? recursivelyTraverseReconnectPassiveEffects(
  	                finishedRoot,
  	                finishedWork,
  	                committedLanes,
  	                committedTransitions,
  	                includeWorkInProgressEffects
  	              )
  	            : recursivelyTraverseAtomicPassiveEffects(
  	                finishedRoot,
  	                finishedWork
  	              )
  	          : ((instance._visibility |= 2),
  	            recursivelyTraverseReconnectPassiveEffects(
  	              finishedRoot,
  	              finishedWork,
  	              committedLanes,
  	              committedTransitions,
  	              includeWorkInProgressEffects
  	            ));
  	        includeWorkInProgressEffects &&
  	          flags & 2048 &&
  	          commitOffscreenPassiveMountEffects(
  	            finishedWork.alternate,
  	            finishedWork
  	          );
  	        break;
  	      case 24:
  	        recursivelyTraverseReconnectPassiveEffects(
  	          finishedRoot,
  	          finishedWork,
  	          committedLanes,
  	          committedTransitions,
  	          includeWorkInProgressEffects
  	        );
  	        includeWorkInProgressEffects &&
  	          flags & 2048 &&
  	          commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
  	        break;
  	      default:
  	        recursivelyTraverseReconnectPassiveEffects(
  	          finishedRoot,
  	          finishedWork,
  	          committedLanes,
  	          committedTransitions,
  	          includeWorkInProgressEffects
  	        );
  	    }
  	    parentFiber = parentFiber.sibling;
  	  }
  	}
  	function recursivelyTraverseAtomicPassiveEffects(
  	  finishedRoot$jscomp$0,
  	  parentFiber
  	) {
  	  if (parentFiber.subtreeFlags & 10256)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
  	      var finishedRoot = finishedRoot$jscomp$0,
  	        finishedWork = parentFiber,
  	        flags = finishedWork.flags;
  	      switch (finishedWork.tag) {
  	        case 22:
  	          recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
  	          flags & 2048 &&
  	            commitOffscreenPassiveMountEffects(
  	              finishedWork.alternate,
  	              finishedWork
  	            );
  	          break;
  	        case 24:
  	          recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
  	          flags & 2048 &&
  	            commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
  	          break;
  	        default:
  	          recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
  	      }
  	      parentFiber = parentFiber.sibling;
  	    }
  	}
  	var suspenseyCommitFlag = 8192;
  	function recursivelyAccumulateSuspenseyCommit(
  	  parentFiber,
  	  committedLanes,
  	  suspendedState
  	) {
  	  if (parentFiber.subtreeFlags & suspenseyCommitFlag)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; )
  	      accumulateSuspenseyCommitOnFiber(
  	        parentFiber,
  	        committedLanes,
  	        suspendedState
  	      ),
  	        (parentFiber = parentFiber.sibling);
  	}
  	function accumulateSuspenseyCommitOnFiber(
  	  fiber,
  	  committedLanes,
  	  suspendedState
  	) {
  	  switch (fiber.tag) {
  	    case 26:
  	      recursivelyAccumulateSuspenseyCommit(
  	        fiber,
  	        committedLanes,
  	        suspendedState
  	      );
  	      fiber.flags & suspenseyCommitFlag &&
  	        null !== fiber.memoizedState &&
  	        suspendResource(
  	          suspendedState,
  	          currentHoistableRoot,
  	          fiber.memoizedState,
  	          fiber.memoizedProps
  	        );
  	      break;
  	    case 5:
  	      recursivelyAccumulateSuspenseyCommit(
  	        fiber,
  	        committedLanes,
  	        suspendedState
  	      );
  	      break;
  	    case 3:
  	    case 4:
  	      var previousHoistableRoot = currentHoistableRoot;
  	      currentHoistableRoot = getHoistableRoot(fiber.stateNode.containerInfo);
  	      recursivelyAccumulateSuspenseyCommit(
  	        fiber,
  	        committedLanes,
  	        suspendedState
  	      );
  	      currentHoistableRoot = previousHoistableRoot;
  	      break;
  	    case 22:
  	      null === fiber.memoizedState &&
  	        ((previousHoistableRoot = fiber.alternate),
  	        null !== previousHoistableRoot &&
  	        null !== previousHoistableRoot.memoizedState
  	          ? ((previousHoistableRoot = suspenseyCommitFlag),
  	            (suspenseyCommitFlag = 16777216),
  	            recursivelyAccumulateSuspenseyCommit(
  	              fiber,
  	              committedLanes,
  	              suspendedState
  	            ),
  	            (suspenseyCommitFlag = previousHoistableRoot))
  	          : recursivelyAccumulateSuspenseyCommit(
  	              fiber,
  	              committedLanes,
  	              suspendedState
  	            ));
  	      break;
  	    default:
  	      recursivelyAccumulateSuspenseyCommit(
  	        fiber,
  	        committedLanes,
  	        suspendedState
  	      );
  	  }
  	}
  	function detachAlternateSiblings(parentFiber) {
  	  var previousFiber = parentFiber.alternate;
  	  if (
  	    null !== previousFiber &&
  	    ((parentFiber = previousFiber.child), null !== parentFiber)
  	  ) {
  	    previousFiber.child = null;
  	    do
  	      (previousFiber = parentFiber.sibling),
  	        (parentFiber.sibling = null),
  	        (parentFiber = previousFiber);
  	    while (null !== parentFiber);
  	  }
  	}
  	function recursivelyTraversePassiveUnmountEffects(parentFiber) {
  	  var deletions = parentFiber.deletions;
  	  if (0 !== (parentFiber.flags & 16)) {
  	    if (null !== deletions)
  	      for (var i = 0; i < deletions.length; i++) {
  	        var childToDelete = deletions[i];
  	        nextEffect = childToDelete;
  	        commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
  	          childToDelete,
  	          parentFiber
  	        );
  	      }
  	    detachAlternateSiblings(parentFiber);
  	  }
  	  if (parentFiber.subtreeFlags & 10256)
  	    for (parentFiber = parentFiber.child; null !== parentFiber; )
  	      commitPassiveUnmountOnFiber(parentFiber),
  	        (parentFiber = parentFiber.sibling);
  	}
  	function commitPassiveUnmountOnFiber(finishedWork) {
  	  switch (finishedWork.tag) {
  	    case 0:
  	    case 11:
  	    case 15:
  	      recursivelyTraversePassiveUnmountEffects(finishedWork);
  	      finishedWork.flags & 2048 &&
  	        commitHookEffectListUnmount(9, finishedWork, finishedWork.return);
  	      break;
  	    case 3:
  	      recursivelyTraversePassiveUnmountEffects(finishedWork);
  	      break;
  	    case 12:
  	      recursivelyTraversePassiveUnmountEffects(finishedWork);
  	      break;
  	    case 22:
  	      var instance = finishedWork.stateNode;
  	      null !== finishedWork.memoizedState &&
  	      instance._visibility & 2 &&
  	      (null === finishedWork.return || 13 !== finishedWork.return.tag)
  	        ? ((instance._visibility &= -3),
  	          recursivelyTraverseDisconnectPassiveEffects(finishedWork))
  	        : recursivelyTraversePassiveUnmountEffects(finishedWork);
  	      break;
  	    default:
  	      recursivelyTraversePassiveUnmountEffects(finishedWork);
  	  }
  	}
  	function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
  	  var deletions = parentFiber.deletions;
  	  if (0 !== (parentFiber.flags & 16)) {
  	    if (null !== deletions)
  	      for (var i = 0; i < deletions.length; i++) {
  	        var childToDelete = deletions[i];
  	        nextEffect = childToDelete;
  	        commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
  	          childToDelete,
  	          parentFiber
  	        );
  	      }
  	    detachAlternateSiblings(parentFiber);
  	  }
  	  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
  	    deletions = parentFiber;
  	    switch (deletions.tag) {
  	      case 0:
  	      case 11:
  	      case 15:
  	        commitHookEffectListUnmount(8, deletions, deletions.return);
  	        recursivelyTraverseDisconnectPassiveEffects(deletions);
  	        break;
  	      case 22:
  	        i = deletions.stateNode;
  	        i._visibility & 2 &&
  	          ((i._visibility &= -3),
  	          recursivelyTraverseDisconnectPassiveEffects(deletions));
  	        break;
  	      default:
  	        recursivelyTraverseDisconnectPassiveEffects(deletions);
  	    }
  	    parentFiber = parentFiber.sibling;
  	  }
  	}
  	function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
  	  deletedSubtreeRoot,
  	  nearestMountedAncestor
  	) {
  	  for (; null !== nextEffect; ) {
  	    var fiber = nextEffect;
  	    switch (fiber.tag) {
  	      case 0:
  	      case 11:
  	      case 15:
  	        commitHookEffectListUnmount(8, fiber, nearestMountedAncestor);
  	        break;
  	      case 23:
  	      case 22:
  	        if (
  	          null !== fiber.memoizedState &&
  	          null !== fiber.memoizedState.cachePool
  	        ) {
  	          var cache = fiber.memoizedState.cachePool.pool;
  	          null != cache && cache.refCount++;
  	        }
  	        break;
  	      case 24:
  	        releaseCache(fiber.memoizedState.cache);
  	    }
  	    cache = fiber.child;
  	    if (null !== cache) (cache.return = fiber), (nextEffect = cache);
  	    else
  	      a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
  	        cache = nextEffect;
  	        var sibling = cache.sibling,
  	          returnFiber = cache.return;
  	        detachFiberAfterEffects(cache);
  	        if (cache === fiber) {
  	          nextEffect = null;
  	          break a;
  	        }
  	        if (null !== sibling) {
  	          sibling.return = returnFiber;
  	          nextEffect = sibling;
  	          break a;
  	        }
  	        nextEffect = returnFiber;
  	      }
  	  }
  	}
  	var DefaultAsyncDispatcher = {
  	    getCacheForType: function (resourceType) {
  	      var cache = readContext(CacheContext),
  	        cacheForType = cache.data.get(resourceType);
  	      void 0 === cacheForType &&
  	        ((cacheForType = resourceType()),
  	        cache.data.set(resourceType, cacheForType));
  	      return cacheForType;
  	    },
  	    cacheSignal: function () {
  	      return readContext(CacheContext).controller.signal;
  	    }
  	  },
  	  PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
  	  executionContext = 0,
  	  workInProgressRoot = null,
  	  workInProgress = null,
  	  workInProgressRootRenderLanes = 0,
  	  workInProgressSuspendedReason = 0,
  	  workInProgressThrownValue = null,
  	  workInProgressRootDidSkipSuspendedSiblings = false,
  	  workInProgressRootIsPrerendering = false,
  	  workInProgressRootDidAttachPingListener = false,
  	  entangledRenderLanes = 0,
  	  workInProgressRootExitStatus = 0,
  	  workInProgressRootSkippedLanes = 0,
  	  workInProgressRootInterleavedUpdatedLanes = 0,
  	  workInProgressRootPingedLanes = 0,
  	  workInProgressDeferredLane = 0,
  	  workInProgressSuspendedRetryLanes = 0,
  	  workInProgressRootConcurrentErrors = null,
  	  workInProgressRootRecoverableErrors = null,
  	  workInProgressRootDidIncludeRecursiveRenderUpdate = false,
  	  globalMostRecentFallbackTime = 0,
  	  globalMostRecentTransitionTime = 0,
  	  workInProgressRootRenderTargetTime = Infinity,
  	  workInProgressTransitions = null,
  	  legacyErrorBoundariesThatAlreadyFailed = null,
  	  pendingEffectsStatus = 0,
  	  pendingEffectsRoot = null,
  	  pendingFinishedWork = null,
  	  pendingEffectsLanes = 0,
  	  pendingEffectsRemainingLanes = 0,
  	  pendingPassiveTransitions = null,
  	  pendingRecoverableErrors = null,
  	  nestedUpdateCount = 0,
  	  rootWithNestedUpdates = null;
  	function requestUpdateLane() {
  	  return 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes
  	    ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes
  	    : null !== ReactSharedInternals.T
  	      ? requestTransitionLane()
  	      : resolveUpdatePriority();
  	}
  	function requestDeferredLane() {
  	  if (0 === workInProgressDeferredLane)
  	    if (0 === (workInProgressRootRenderLanes & 536870912) || isHydrating) {
  	      var lane = nextTransitionDeferredLane;
  	      nextTransitionDeferredLane <<= 1;
  	      0 === (nextTransitionDeferredLane & 3932160) &&
  	        (nextTransitionDeferredLane = 262144);
  	      workInProgressDeferredLane = lane;
  	    } else workInProgressDeferredLane = 536870912;
  	  lane = suspenseHandlerStackCursor.current;
  	  null !== lane && (lane.flags |= 32);
  	  return workInProgressDeferredLane;
  	}
  	function scheduleUpdateOnFiber(root, fiber, lane) {
  	  if (
  	    (root === workInProgressRoot &&
  	      (2 === workInProgressSuspendedReason ||
  	        9 === workInProgressSuspendedReason)) ||
  	    null !== root.cancelPendingCommit
  	  )
  	    prepareFreshStack(root, 0),
  	      markRootSuspended(
  	        root,
  	        workInProgressRootRenderLanes,
  	        workInProgressDeferredLane,
  	        false
  	      );
  	  markRootUpdated$1(root, lane);
  	  if (0 === (executionContext & 2) || root !== workInProgressRoot)
  	    root === workInProgressRoot &&
  	      (0 === (executionContext & 2) &&
  	        (workInProgressRootInterleavedUpdatedLanes |= lane),
  	      4 === workInProgressRootExitStatus &&
  	        markRootSuspended(
  	          root,
  	          workInProgressRootRenderLanes,
  	          workInProgressDeferredLane,
  	          false
  	        )),
  	      ensureRootIsScheduled(root);
  	}
  	function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
  	  if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
  	  var shouldTimeSlice =
  	      (!forceSync &&
  	        0 === (lanes & 127) &&
  	        0 === (lanes & root$jscomp$0.expiredLanes)) ||
  	      checkIfRootIsPrerendering(root$jscomp$0, lanes),
  	    exitStatus = shouldTimeSlice
  	      ? renderRootConcurrent(root$jscomp$0, lanes)
  	      : renderRootSync(root$jscomp$0, lanes, true),
  	    renderWasConcurrent = shouldTimeSlice;
  	  do {
  	    if (0 === exitStatus) {
  	      workInProgressRootIsPrerendering &&
  	        !shouldTimeSlice &&
  	        markRootSuspended(root$jscomp$0, lanes, 0, false);
  	      break;
  	    } else {
  	      forceSync = root$jscomp$0.current.alternate;
  	      if (
  	        renderWasConcurrent &&
  	        !isRenderConsistentWithExternalStores(forceSync)
  	      ) {
  	        exitStatus = renderRootSync(root$jscomp$0, lanes, false);
  	        renderWasConcurrent = false;
  	        continue;
  	      }
  	      if (2 === exitStatus) {
  	        renderWasConcurrent = lanes;
  	        if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent)
  	          var JSCompiler_inline_result = 0;
  	        else
  	          (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913),
  	            (JSCompiler_inline_result =
  	              0 !== JSCompiler_inline_result
  	                ? JSCompiler_inline_result
  	                : JSCompiler_inline_result & 536870912
  	                  ? 536870912
  	                  : 0);
  	        if (0 !== JSCompiler_inline_result) {
  	          lanes = JSCompiler_inline_result;
  	          a: {
  	            var root = root$jscomp$0;
  	            exitStatus = workInProgressRootConcurrentErrors;
  	            var wasRootDehydrated = root.current.memoizedState.isDehydrated;
  	            wasRootDehydrated &&
  	              (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256);
  	            JSCompiler_inline_result = renderRootSync(
  	              root,
  	              JSCompiler_inline_result,
  	              false
  	            );
  	            if (2 !== JSCompiler_inline_result) {
  	              if (
  	                workInProgressRootDidAttachPingListener &&
  	                !wasRootDehydrated
  	              ) {
  	                root.errorRecoveryDisabledLanes |= renderWasConcurrent;
  	                workInProgressRootInterleavedUpdatedLanes |=
  	                  renderWasConcurrent;
  	                exitStatus = 4;
  	                break a;
  	              }
  	              renderWasConcurrent = workInProgressRootRecoverableErrors;
  	              workInProgressRootRecoverableErrors = exitStatus;
  	              null !== renderWasConcurrent &&
  	                (null === workInProgressRootRecoverableErrors
  	                  ? (workInProgressRootRecoverableErrors = renderWasConcurrent)
  	                  : workInProgressRootRecoverableErrors.push.apply(
  	                      workInProgressRootRecoverableErrors,
  	                      renderWasConcurrent
  	                    ));
  	            }
  	            exitStatus = JSCompiler_inline_result;
  	          }
  	          renderWasConcurrent = false;
  	          if (2 !== exitStatus) continue;
  	        }
  	      }
  	      if (1 === exitStatus) {
  	        prepareFreshStack(root$jscomp$0, 0);
  	        markRootSuspended(root$jscomp$0, lanes, 0, true);
  	        break;
  	      }
  	      a: {
  	        shouldTimeSlice = root$jscomp$0;
  	        renderWasConcurrent = exitStatus;
  	        switch (renderWasConcurrent) {
  	          case 0:
  	          case 1:
  	            throw Error(formatProdErrorMessage(345));
  	          case 4:
  	            if ((lanes & 4194048) !== lanes) break;
  	          case 6:
  	            markRootSuspended(
  	              shouldTimeSlice,
  	              lanes,
  	              workInProgressDeferredLane,
  	              !workInProgressRootDidSkipSuspendedSiblings
  	            );
  	            break a;
  	          case 2:
  	            workInProgressRootRecoverableErrors = null;
  	            break;
  	          case 3:
  	          case 5:
  	            break;
  	          default:
  	            throw Error(formatProdErrorMessage(329));
  	        }
  	        if (
  	          (lanes & 62914560) === lanes &&
  	          ((exitStatus = globalMostRecentFallbackTime + 300 - now()),
  	          10 < exitStatus)
  	        ) {
  	          markRootSuspended(
  	            shouldTimeSlice,
  	            lanes,
  	            workInProgressDeferredLane,
  	            !workInProgressRootDidSkipSuspendedSiblings
  	          );
  	          if (0 !== getNextLanes(shouldTimeSlice, 0, true)) break a;
  	          pendingEffectsLanes = lanes;
  	          shouldTimeSlice.timeoutHandle = scheduleTimeout(
  	            commitRootWhenReady.bind(
  	              null,
  	              shouldTimeSlice,
  	              forceSync,
  	              workInProgressRootRecoverableErrors,
  	              workInProgressTransitions,
  	              workInProgressRootDidIncludeRecursiveRenderUpdate,
  	              lanes,
  	              workInProgressDeferredLane,
  	              workInProgressRootInterleavedUpdatedLanes,
  	              workInProgressSuspendedRetryLanes,
  	              workInProgressRootDidSkipSuspendedSiblings,
  	              renderWasConcurrent,
  	              "Throttled",
  	              -0,
  	              0
  	            ),
  	            exitStatus
  	          );
  	          break a;
  	        }
  	        commitRootWhenReady(
  	          shouldTimeSlice,
  	          forceSync,
  	          workInProgressRootRecoverableErrors,
  	          workInProgressTransitions,
  	          workInProgressRootDidIncludeRecursiveRenderUpdate,
  	          lanes,
  	          workInProgressDeferredLane,
  	          workInProgressRootInterleavedUpdatedLanes,
  	          workInProgressSuspendedRetryLanes,
  	          workInProgressRootDidSkipSuspendedSiblings,
  	          renderWasConcurrent,
  	          null,
  	          -0,
  	          0
  	        );
  	      }
  	    }
  	    break;
  	  } while (1);
  	  ensureRootIsScheduled(root$jscomp$0);
  	}
  	function commitRootWhenReady(
  	  root,
  	  finishedWork,
  	  recoverableErrors,
  	  transitions,
  	  didIncludeRenderPhaseUpdate,
  	  lanes,
  	  spawnedLane,
  	  updatedLanes,
  	  suspendedRetryLanes,
  	  didSkipSuspendedSiblings,
  	  exitStatus,
  	  suspendedCommitReason,
  	  completedRenderStartTime,
  	  completedRenderEndTime
  	) {
  	  root.timeoutHandle = -1;
  	  suspendedCommitReason = finishedWork.subtreeFlags;
  	  if (
  	    suspendedCommitReason & 8192 ||
  	    16785408 === (suspendedCommitReason & 16785408)
  	  ) {
  	    suspendedCommitReason = {
  	      stylesheets: null,
  	      count: 0,
  	      imgCount: 0,
  	      imgBytes: 0,
  	      suspenseyImages: [],
  	      waitingForImages: true,
  	      waitingForViewTransition: false,
  	      unsuspend: noop$1
  	    };
  	    accumulateSuspenseyCommitOnFiber(
  	      finishedWork,
  	      lanes,
  	      suspendedCommitReason
  	    );
  	    var timeoutOffset =
  	      (lanes & 62914560) === lanes
  	        ? globalMostRecentFallbackTime - now()
  	        : (lanes & 4194048) === lanes
  	          ? globalMostRecentTransitionTime - now()
  	          : 0;
  	    timeoutOffset = waitForCommitToBeReady(
  	      suspendedCommitReason,
  	      timeoutOffset
  	    );
  	    if (null !== timeoutOffset) {
  	      pendingEffectsLanes = lanes;
  	      root.cancelPendingCommit = timeoutOffset(
  	        commitRoot.bind(
  	          null,
  	          root,
  	          finishedWork,
  	          lanes,
  	          recoverableErrors,
  	          transitions,
  	          didIncludeRenderPhaseUpdate,
  	          spawnedLane,
  	          updatedLanes,
  	          suspendedRetryLanes,
  	          exitStatus,
  	          suspendedCommitReason,
  	          null,
  	          completedRenderStartTime,
  	          completedRenderEndTime
  	        )
  	      );
  	      markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings);
  	      return;
  	    }
  	  }
  	  commitRoot(
  	    root,
  	    finishedWork,
  	    lanes,
  	    recoverableErrors,
  	    transitions,
  	    didIncludeRenderPhaseUpdate,
  	    spawnedLane,
  	    updatedLanes,
  	    suspendedRetryLanes
  	  );
  	}
  	function isRenderConsistentWithExternalStores(finishedWork) {
  	  for (var node = finishedWork; ; ) {
  	    var tag = node.tag;
  	    if (
  	      (0 === tag || 11 === tag || 15 === tag) &&
  	      node.flags & 16384 &&
  	      ((tag = node.updateQueue),
  	      null !== tag && ((tag = tag.stores), null !== tag))
  	    )
  	      for (var i = 0; i < tag.length; i++) {
  	        var check = tag[i],
  	          getSnapshot = check.getSnapshot;
  	        check = check.value;
  	        try {
  	          if (!objectIs(getSnapshot(), check)) return !1;
  	        } catch (error) {
  	          return false;
  	        }
  	      }
  	    tag = node.child;
  	    if (node.subtreeFlags & 16384 && null !== tag)
  	      (tag.return = node), (node = tag);
  	    else {
  	      if (node === finishedWork) break;
  	      for (; null === node.sibling; ) {
  	        if (null === node.return || node.return === finishedWork) return true;
  	        node = node.return;
  	      }
  	      node.sibling.return = node.return;
  	      node = node.sibling;
  	    }
  	  }
  	  return true;
  	}
  	function markRootSuspended(
  	  root,
  	  suspendedLanes,
  	  spawnedLane,
  	  didAttemptEntireTree
  	) {
  	  suspendedLanes &= ~workInProgressRootPingedLanes;
  	  suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
  	  root.suspendedLanes |= suspendedLanes;
  	  root.pingedLanes &= ~suspendedLanes;
  	  didAttemptEntireTree && (root.warmLanes |= suspendedLanes);
  	  didAttemptEntireTree = root.expirationTimes;
  	  for (var lanes = suspendedLanes; 0 < lanes; ) {
  	    var index$6 = 31 - clz32(lanes),
  	      lane = 1 << index$6;
  	    didAttemptEntireTree[index$6] = -1;
  	    lanes &= ~lane;
  	  }
  	  0 !== spawnedLane &&
  	    markSpawnedDeferredLane(root, spawnedLane, suspendedLanes);
  	}
  	function flushSyncWork$1() {
  	  return 0 === (executionContext & 6)
  	    ? (flushSyncWorkAcrossRoots_impl(0), false)
  	    : true;
  	}
  	function resetWorkInProgressStack() {
  	  if (null !== workInProgress) {
  	    if (0 === workInProgressSuspendedReason)
  	      var interruptedWork = workInProgress.return;
  	    else
  	      (interruptedWork = workInProgress),
  	        (lastContextDependency = currentlyRenderingFiber$1 = null),
  	        resetHooksOnUnwind(interruptedWork),
  	        (thenableState$1 = null),
  	        (thenableIndexCounter$1 = 0),
  	        (interruptedWork = workInProgress);
  	    for (; null !== interruptedWork; )
  	      unwindInterruptedWork(interruptedWork.alternate, interruptedWork),
  	        (interruptedWork = interruptedWork.return);
  	    workInProgress = null;
  	  }
  	}
  	function prepareFreshStack(root, lanes) {
  	  var timeoutHandle = root.timeoutHandle;
  	  -1 !== timeoutHandle &&
  	    ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle));
  	  timeoutHandle = root.cancelPendingCommit;
  	  null !== timeoutHandle &&
  	    ((root.cancelPendingCommit = null), timeoutHandle());
  	  pendingEffectsLanes = 0;
  	  resetWorkInProgressStack();
  	  workInProgressRoot = root;
  	  workInProgress = timeoutHandle = createWorkInProgress(root.current, null);
  	  workInProgressRootRenderLanes = lanes;
  	  workInProgressSuspendedReason = 0;
  	  workInProgressThrownValue = null;
  	  workInProgressRootDidSkipSuspendedSiblings = false;
  	  workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes);
  	  workInProgressRootDidAttachPingListener = false;
  	  workInProgressSuspendedRetryLanes =
  	    workInProgressDeferredLane =
  	    workInProgressRootPingedLanes =
  	    workInProgressRootInterleavedUpdatedLanes =
  	    workInProgressRootSkippedLanes =
  	    workInProgressRootExitStatus =
  	      0;
  	  workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors =
  	    null;
  	  workInProgressRootDidIncludeRecursiveRenderUpdate = false;
  	  0 !== (lanes & 8) && (lanes |= lanes & 32);
  	  var allEntangledLanes = root.entangledLanes;
  	  if (0 !== allEntangledLanes)
  	    for (
  	      root = root.entanglements, allEntangledLanes &= lanes;
  	      0 < allEntangledLanes;

  	    ) {
  	      var index$4 = 31 - clz32(allEntangledLanes),
  	        lane = 1 << index$4;
  	      lanes |= root[index$4];
  	      allEntangledLanes &= ~lane;
  	    }
  	  entangledRenderLanes = lanes;
  	  finishQueueingConcurrentUpdates();
  	  return timeoutHandle;
  	}
  	function handleThrow(root, thrownValue) {
  	  currentlyRenderingFiber = null;
  	  ReactSharedInternals.H = ContextOnlyDispatcher;
  	  thrownValue === SuspenseException || thrownValue === SuspenseActionException
  	    ? ((thrownValue = getSuspendedThenable()),
  	      (workInProgressSuspendedReason = 3))
  	    : thrownValue === SuspenseyCommitException
  	      ? ((thrownValue = getSuspendedThenable()),
  	        (workInProgressSuspendedReason = 4))
  	      : (workInProgressSuspendedReason =
  	          thrownValue === SelectiveHydrationException
  	            ? 8
  	            : null !== thrownValue &&
  	                "object" === typeof thrownValue &&
  	                "function" === typeof thrownValue.then
  	              ? 6
  	              : 1);
  	  workInProgressThrownValue = thrownValue;
  	  null === workInProgress &&
  	    ((workInProgressRootExitStatus = 1),
  	    logUncaughtError(
  	      root,
  	      createCapturedValueAtFiber(thrownValue, root.current)
  	    ));
  	}
  	function shouldRemainOnPreviousScreen() {
  	  var handler = suspenseHandlerStackCursor.current;
  	  return null === handler
  	    ? true
  	    : (workInProgressRootRenderLanes & 4194048) ===
  	        workInProgressRootRenderLanes
  	      ? null === shellBoundary
  	        ? true
  	        : false
  	      : (workInProgressRootRenderLanes & 62914560) ===
  	            workInProgressRootRenderLanes ||
  	          0 !== (workInProgressRootRenderLanes & 536870912)
  	        ? handler === shellBoundary
  	        : false;
  	}
  	function pushDispatcher() {
  	  var prevDispatcher = ReactSharedInternals.H;
  	  ReactSharedInternals.H = ContextOnlyDispatcher;
  	  return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
  	}
  	function pushAsyncDispatcher() {
  	  var prevAsyncDispatcher = ReactSharedInternals.A;
  	  ReactSharedInternals.A = DefaultAsyncDispatcher;
  	  return prevAsyncDispatcher;
  	}
  	function renderDidSuspendDelayIfPossible() {
  	  workInProgressRootExitStatus = 4;
  	  workInProgressRootDidSkipSuspendedSiblings ||
  	    ((workInProgressRootRenderLanes & 4194048) !==
  	      workInProgressRootRenderLanes &&
  	      null !== suspenseHandlerStackCursor.current) ||
  	    (workInProgressRootIsPrerendering = true);
  	  (0 === (workInProgressRootSkippedLanes & 134217727) &&
  	    0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) ||
  	    null === workInProgressRoot ||
  	    markRootSuspended(
  	      workInProgressRoot,
  	      workInProgressRootRenderLanes,
  	      workInProgressDeferredLane,
  	      false
  	    );
  	}
  	function renderRootSync(root, lanes, shouldYieldForPrerendering) {
  	  var prevExecutionContext = executionContext;
  	  executionContext |= 2;
  	  var prevDispatcher = pushDispatcher(),
  	    prevAsyncDispatcher = pushAsyncDispatcher();
  	  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes)
  	    (workInProgressTransitions = null), prepareFreshStack(root, lanes);
  	  lanes = false;
  	  var exitStatus = workInProgressRootExitStatus;
  	  a: do
  	    try {
  	      if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
  	        var unitOfWork = workInProgress,
  	          thrownValue = workInProgressThrownValue;
  	        switch (workInProgressSuspendedReason) {
  	          case 8:
  	            resetWorkInProgressStack();
  	            exitStatus = 6;
  	            break a;
  	          case 3:
  	          case 2:
  	          case 9:
  	          case 6:
  	            null === suspenseHandlerStackCursor.current && (lanes = !0);
  	            var reason = workInProgressSuspendedReason;
  	            workInProgressSuspendedReason = 0;
  	            workInProgressThrownValue = null;
  	            throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason);
  	            if (
  	              shouldYieldForPrerendering &&
  	              workInProgressRootIsPrerendering
  	            ) {
  	              exitStatus = 0;
  	              break a;
  	            }
  	            break;
  	          default:
  	            (reason = workInProgressSuspendedReason),
  	              (workInProgressSuspendedReason = 0),
  	              (workInProgressThrownValue = null),
  	              throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason);
  	        }
  	      }
  	      workLoopSync();
  	      exitStatus = workInProgressRootExitStatus;
  	      break;
  	    } catch (thrownValue$165) {
  	      handleThrow(root, thrownValue$165);
  	    }
  	  while (1);
  	  lanes && root.shellSuspendCounter++;
  	  lastContextDependency = currentlyRenderingFiber$1 = null;
  	  executionContext = prevExecutionContext;
  	  ReactSharedInternals.H = prevDispatcher;
  	  ReactSharedInternals.A = prevAsyncDispatcher;
  	  null === workInProgress &&
  	    ((workInProgressRoot = null),
  	    (workInProgressRootRenderLanes = 0),
  	    finishQueueingConcurrentUpdates());
  	  return exitStatus;
  	}
  	function workLoopSync() {
  	  for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
  	}
  	function renderRootConcurrent(root, lanes) {
  	  var prevExecutionContext = executionContext;
  	  executionContext |= 2;
  	  var prevDispatcher = pushDispatcher(),
  	    prevAsyncDispatcher = pushAsyncDispatcher();
  	  workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes
  	    ? ((workInProgressTransitions = null),
  	      (workInProgressRootRenderTargetTime = now() + 500),
  	      prepareFreshStack(root, lanes))
  	    : (workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
  	        root,
  	        lanes
  	      ));
  	  a: do
  	    try {
  	      if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
  	        lanes = workInProgress;
  	        var thrownValue = workInProgressThrownValue;
  	        b: switch (workInProgressSuspendedReason) {
  	          case 1:
  	            workInProgressSuspendedReason = 0;
  	            workInProgressThrownValue = null;
  	            throwAndUnwindWorkLoop(root, lanes, thrownValue, 1);
  	            break;
  	          case 2:
  	          case 9:
  	            if (isThenableResolved(thrownValue)) {
  	              workInProgressSuspendedReason = 0;
  	              workInProgressThrownValue = null;
  	              replaySuspendedUnitOfWork(lanes);
  	              break;
  	            }
  	            lanes = function () {
  	              (2 !== workInProgressSuspendedReason &&
  	                9 !== workInProgressSuspendedReason) ||
  	                workInProgressRoot !== root ||
  	                (workInProgressSuspendedReason = 7);
  	              ensureRootIsScheduled(root);
  	            };
  	            thrownValue.then(lanes, lanes);
  	            break a;
  	          case 3:
  	            workInProgressSuspendedReason = 7;
  	            break a;
  	          case 4:
  	            workInProgressSuspendedReason = 5;
  	            break a;
  	          case 7:
  	            isThenableResolved(thrownValue)
  	              ? ((workInProgressSuspendedReason = 0),
  	                (workInProgressThrownValue = null),
  	                replaySuspendedUnitOfWork(lanes))
  	              : ((workInProgressSuspendedReason = 0),
  	                (workInProgressThrownValue = null),
  	                throwAndUnwindWorkLoop(root, lanes, thrownValue, 7));
  	            break;
  	          case 5:
  	            var resource = null;
  	            switch (workInProgress.tag) {
  	              case 26:
  	                resource = workInProgress.memoizedState;
  	              case 5:
  	              case 27:
  	                var hostFiber = workInProgress;
  	                if (
  	                  resource
  	                    ? preloadResource(resource)
  	                    : hostFiber.stateNode.complete
  	                ) {
  	                  workInProgressSuspendedReason = 0;
  	                  workInProgressThrownValue = null;
  	                  var sibling = hostFiber.sibling;
  	                  if (null !== sibling) workInProgress = sibling;
  	                  else {
  	                    var returnFiber = hostFiber.return;
  	                    null !== returnFiber
  	                      ? ((workInProgress = returnFiber),
  	                        completeUnitOfWork(returnFiber))
  	                      : (workInProgress = null);
  	                  }
  	                  break b;
  	                }
  	            }
  	            workInProgressSuspendedReason = 0;
  	            workInProgressThrownValue = null;
  	            throwAndUnwindWorkLoop(root, lanes, thrownValue, 5);
  	            break;
  	          case 6:
  	            workInProgressSuspendedReason = 0;
  	            workInProgressThrownValue = null;
  	            throwAndUnwindWorkLoop(root, lanes, thrownValue, 6);
  	            break;
  	          case 8:
  	            resetWorkInProgressStack();
  	            workInProgressRootExitStatus = 6;
  	            break a;
  	          default:
  	            throw Error(formatProdErrorMessage(462));
  	        }
  	      }
  	      workLoopConcurrentByScheduler();
  	      break;
  	    } catch (thrownValue$167) {
  	      handleThrow(root, thrownValue$167);
  	    }
  	  while (1);
  	  lastContextDependency = currentlyRenderingFiber$1 = null;
  	  ReactSharedInternals.H = prevDispatcher;
  	  ReactSharedInternals.A = prevAsyncDispatcher;
  	  executionContext = prevExecutionContext;
  	  if (null !== workInProgress) return 0;
  	  workInProgressRoot = null;
  	  workInProgressRootRenderLanes = 0;
  	  finishQueueingConcurrentUpdates();
  	  return workInProgressRootExitStatus;
  	}
  	function workLoopConcurrentByScheduler() {
  	  for (; null !== workInProgress && !shouldYield(); )
  	    performUnitOfWork(workInProgress);
  	}
  	function performUnitOfWork(unitOfWork) {
  	  var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
  	  unitOfWork.memoizedProps = unitOfWork.pendingProps;
  	  null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next);
  	}
  	function replaySuspendedUnitOfWork(unitOfWork) {
  	  var next = unitOfWork;
  	  var current = next.alternate;
  	  switch (next.tag) {
  	    case 15:
  	    case 0:
  	      next = replayFunctionComponent(
  	        current,
  	        next,
  	        next.pendingProps,
  	        next.type,
  	        void 0,
  	        workInProgressRootRenderLanes
  	      );
  	      break;
  	    case 11:
  	      next = replayFunctionComponent(
  	        current,
  	        next,
  	        next.pendingProps,
  	        next.type.render,
  	        next.ref,
  	        workInProgressRootRenderLanes
  	      );
  	      break;
  	    case 5:
  	      resetHooksOnUnwind(next);
  	    default:
  	      unwindInterruptedWork(current, next),
  	        (next = workInProgress =
  	          resetWorkInProgress(next, entangledRenderLanes)),
  	        (next = beginWork(current, next, entangledRenderLanes));
  	  }
  	  unitOfWork.memoizedProps = unitOfWork.pendingProps;
  	  null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next);
  	}
  	function throwAndUnwindWorkLoop(
  	  root,
  	  unitOfWork,
  	  thrownValue,
  	  suspendedReason
  	) {
  	  lastContextDependency = currentlyRenderingFiber$1 = null;
  	  resetHooksOnUnwind(unitOfWork);
  	  thenableState$1 = null;
  	  thenableIndexCounter$1 = 0;
  	  var returnFiber = unitOfWork.return;
  	  try {
  	    if (
  	      throwException(
  	        root,
  	        returnFiber,
  	        unitOfWork,
  	        thrownValue,
  	        workInProgressRootRenderLanes
  	      )
  	    ) {
  	      workInProgressRootExitStatus = 1;
  	      logUncaughtError(
  	        root,
  	        createCapturedValueAtFiber(thrownValue, root.current)
  	      );
  	      workInProgress = null;
  	      return;
  	    }
  	  } catch (error) {
  	    if (null !== returnFiber) throw ((workInProgress = returnFiber), error);
  	    workInProgressRootExitStatus = 1;
  	    logUncaughtError(
  	      root,
  	      createCapturedValueAtFiber(thrownValue, root.current)
  	    );
  	    workInProgress = null;
  	    return;
  	  }
  	  if (unitOfWork.flags & 32768) {
  	    if (isHydrating || 1 === suspendedReason) root = true;
  	    else if (
  	      workInProgressRootIsPrerendering ||
  	      0 !== (workInProgressRootRenderLanes & 536870912)
  	    )
  	      root = false;
  	    else if (
  	      ((workInProgressRootDidSkipSuspendedSiblings = root = true),
  	      2 === suspendedReason ||
  	        9 === suspendedReason ||
  	        3 === suspendedReason ||
  	        6 === suspendedReason)
  	    )
  	      (suspendedReason = suspenseHandlerStackCursor.current),
  	        null !== suspendedReason &&
  	          13 === suspendedReason.tag &&
  	          (suspendedReason.flags |= 16384);
  	    unwindUnitOfWork(unitOfWork, root);
  	  } else completeUnitOfWork(unitOfWork);
  	}
  	function completeUnitOfWork(unitOfWork) {
  	  var completedWork = unitOfWork;
  	  do {
  	    if (0 !== (completedWork.flags & 32768)) {
  	      unwindUnitOfWork(
  	        completedWork,
  	        workInProgressRootDidSkipSuspendedSiblings
  	      );
  	      return;
  	    }
  	    unitOfWork = completedWork.return;
  	    var next = completeWork(
  	      completedWork.alternate,
  	      completedWork,
  	      entangledRenderLanes
  	    );
  	    if (null !== next) {
  	      workInProgress = next;
  	      return;
  	    }
  	    completedWork = completedWork.sibling;
  	    if (null !== completedWork) {
  	      workInProgress = completedWork;
  	      return;
  	    }
  	    workInProgress = completedWork = unitOfWork;
  	  } while (null !== completedWork);
  	  0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
  	}
  	function unwindUnitOfWork(unitOfWork, skipSiblings) {
  	  do {
  	    var next = unwindWork(unitOfWork.alternate, unitOfWork);
  	    if (null !== next) {
  	      next.flags &= 32767;
  	      workInProgress = next;
  	      return;
  	    }
  	    next = unitOfWork.return;
  	    null !== next &&
  	      ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null));
  	    if (
  	      !skipSiblings &&
  	      ((unitOfWork = unitOfWork.sibling), null !== unitOfWork)
  	    ) {
  	      workInProgress = unitOfWork;
  	      return;
  	    }
  	    workInProgress = unitOfWork = next;
  	  } while (null !== unitOfWork);
  	  workInProgressRootExitStatus = 6;
  	  workInProgress = null;
  	}
  	function commitRoot(
  	  root,
  	  finishedWork,
  	  lanes,
  	  recoverableErrors,
  	  transitions,
  	  didIncludeRenderPhaseUpdate,
  	  spawnedLane,
  	  updatedLanes,
  	  suspendedRetryLanes
  	) {
  	  root.cancelPendingCommit = null;
  	  do flushPendingEffects();
  	  while (0 !== pendingEffectsStatus);
  	  if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
  	  if (null !== finishedWork) {
  	    if (finishedWork === root.current) throw Error(formatProdErrorMessage(177));
  	    didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
  	    didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
  	    markRootFinished(
  	      root,
  	      lanes,
  	      didIncludeRenderPhaseUpdate,
  	      spawnedLane,
  	      updatedLanes,
  	      suspendedRetryLanes
  	    );
  	    root === workInProgressRoot &&
  	      ((workInProgress = workInProgressRoot = null),
  	      (workInProgressRootRenderLanes = 0));
  	    pendingFinishedWork = finishedWork;
  	    pendingEffectsRoot = root;
  	    pendingEffectsLanes = lanes;
  	    pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
  	    pendingPassiveTransitions = transitions;
  	    pendingRecoverableErrors = recoverableErrors;
  	    0 !== (finishedWork.subtreeFlags & 10256) ||
  	    0 !== (finishedWork.flags & 10256)
  	      ? ((root.callbackNode = null),
  	        (root.callbackPriority = 0),
  	        scheduleCallback$1(NormalPriority$1, function () {
  	          flushPassiveEffects();
  	          return null;
  	        }))
  	      : ((root.callbackNode = null), (root.callbackPriority = 0));
  	    recoverableErrors = 0 !== (finishedWork.flags & 13878);
  	    if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
  	      recoverableErrors = ReactSharedInternals.T;
  	      ReactSharedInternals.T = null;
  	      transitions = ReactDOMSharedInternals.p;
  	      ReactDOMSharedInternals.p = 2;
  	      spawnedLane = executionContext;
  	      executionContext |= 4;
  	      try {
  	        commitBeforeMutationEffects(root, finishedWork, lanes);
  	      } finally {
  	        (executionContext = spawnedLane),
  	          (ReactDOMSharedInternals.p = transitions),
  	          (ReactSharedInternals.T = recoverableErrors);
  	      }
  	    }
  	    pendingEffectsStatus = 1;
  	    flushMutationEffects();
  	    flushLayoutEffects();
  	    flushSpawnedWork();
  	  }
  	}
  	function flushMutationEffects() {
  	  if (1 === pendingEffectsStatus) {
  	    pendingEffectsStatus = 0;
  	    var root = pendingEffectsRoot,
  	      finishedWork = pendingFinishedWork,
  	      rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
  	    if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
  	      rootMutationHasEffect = ReactSharedInternals.T;
  	      ReactSharedInternals.T = null;
  	      var previousPriority = ReactDOMSharedInternals.p;
  	      ReactDOMSharedInternals.p = 2;
  	      var prevExecutionContext = executionContext;
  	      executionContext |= 4;
  	      try {
  	        commitMutationEffectsOnFiber(finishedWork, root);
  	        var priorSelectionInformation = selectionInformation,
  	          curFocusedElem = getActiveElementDeep(root.containerInfo),
  	          priorFocusedElem = priorSelectionInformation.focusedElem,
  	          priorSelectionRange = priorSelectionInformation.selectionRange;
  	        if (
  	          curFocusedElem !== priorFocusedElem &&
  	          priorFocusedElem &&
  	          priorFocusedElem.ownerDocument &&
  	          containsNode(
  	            priorFocusedElem.ownerDocument.documentElement,
  	            priorFocusedElem
  	          )
  	        ) {
  	          if (
  	            null !== priorSelectionRange &&
  	            hasSelectionCapabilities(priorFocusedElem)
  	          ) {
  	            var start = priorSelectionRange.start,
  	              end = priorSelectionRange.end;
  	            void 0 === end && (end = start);
  	            if ("selectionStart" in priorFocusedElem)
  	              (priorFocusedElem.selectionStart = start),
  	                (priorFocusedElem.selectionEnd = Math.min(
  	                  end,
  	                  priorFocusedElem.value.length
  	                ));
  	            else {
  	              var doc = priorFocusedElem.ownerDocument || document,
  	                win = (doc && doc.defaultView) || window;
  	              if (win.getSelection) {
  	                var selection = win.getSelection(),
  	                  length = priorFocusedElem.textContent.length,
  	                  start$jscomp$0 = Math.min(priorSelectionRange.start, length),
  	                  end$jscomp$0 =
  	                    void 0 === priorSelectionRange.end
  	                      ? start$jscomp$0
  	                      : Math.min(priorSelectionRange.end, length);
  	                !selection.extend &&
  	                  start$jscomp$0 > end$jscomp$0 &&
  	                  ((curFocusedElem = end$jscomp$0),
  	                  (end$jscomp$0 = start$jscomp$0),
  	                  (start$jscomp$0 = curFocusedElem));
  	                var startMarker = getNodeForCharacterOffset(
  	                    priorFocusedElem,
  	                    start$jscomp$0
  	                  ),
  	                  endMarker = getNodeForCharacterOffset(
  	                    priorFocusedElem,
  	                    end$jscomp$0
  	                  );
  	                if (
  	                  startMarker &&
  	                  endMarker &&
  	                  (1 !== selection.rangeCount ||
  	                    selection.anchorNode !== startMarker.node ||
  	                    selection.anchorOffset !== startMarker.offset ||
  	                    selection.focusNode !== endMarker.node ||
  	                    selection.focusOffset !== endMarker.offset)
  	                ) {
  	                  var range = doc.createRange();
  	                  range.setStart(startMarker.node, startMarker.offset);
  	                  selection.removeAllRanges();
  	                  start$jscomp$0 > end$jscomp$0
  	                    ? (selection.addRange(range),
  	                      selection.extend(endMarker.node, endMarker.offset))
  	                    : (range.setEnd(endMarker.node, endMarker.offset),
  	                      selection.addRange(range));
  	                }
  	              }
  	            }
  	          }
  	          doc = [];
  	          for (
  	            selection = priorFocusedElem;
  	            (selection = selection.parentNode);

  	          )
  	            1 === selection.nodeType &&
  	              doc.push({
  	                element: selection,
  	                left: selection.scrollLeft,
  	                top: selection.scrollTop
  	              });
  	          "function" === typeof priorFocusedElem.focus &&
  	            priorFocusedElem.focus();
  	          for (
  	            priorFocusedElem = 0;
  	            priorFocusedElem < doc.length;
  	            priorFocusedElem++
  	          ) {
  	            var info = doc[priorFocusedElem];
  	            info.element.scrollLeft = info.left;
  	            info.element.scrollTop = info.top;
  	          }
  	        }
  	        _enabled = !!eventsEnabled;
  	        selectionInformation = eventsEnabled = null;
  	      } finally {
  	        (executionContext = prevExecutionContext),
  	          (ReactDOMSharedInternals.p = previousPriority),
  	          (ReactSharedInternals.T = rootMutationHasEffect);
  	      }
  	    }
  	    root.current = finishedWork;
  	    pendingEffectsStatus = 2;
  	  }
  	}
  	function flushLayoutEffects() {
  	  if (2 === pendingEffectsStatus) {
  	    pendingEffectsStatus = 0;
  	    var root = pendingEffectsRoot,
  	      finishedWork = pendingFinishedWork,
  	      rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
  	    if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
  	      rootHasLayoutEffect = ReactSharedInternals.T;
  	      ReactSharedInternals.T = null;
  	      var previousPriority = ReactDOMSharedInternals.p;
  	      ReactDOMSharedInternals.p = 2;
  	      var prevExecutionContext = executionContext;
  	      executionContext |= 4;
  	      try {
  	        commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork);
  	      } finally {
  	        (executionContext = prevExecutionContext),
  	          (ReactDOMSharedInternals.p = previousPriority),
  	          (ReactSharedInternals.T = rootHasLayoutEffect);
  	      }
  	    }
  	    pendingEffectsStatus = 3;
  	  }
  	}
  	function flushSpawnedWork() {
  	  if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) {
  	    pendingEffectsStatus = 0;
  	    requestPaint();
  	    var root = pendingEffectsRoot,
  	      finishedWork = pendingFinishedWork,
  	      lanes = pendingEffectsLanes,
  	      recoverableErrors = pendingRecoverableErrors;
  	    0 !== (finishedWork.subtreeFlags & 10256) ||
  	    0 !== (finishedWork.flags & 10256)
  	      ? (pendingEffectsStatus = 5)
  	      : ((pendingEffectsStatus = 0),
  	        (pendingFinishedWork = pendingEffectsRoot = null),
  	        releaseRootPooledCache(root, root.pendingLanes));
  	    var remainingLanes = root.pendingLanes;
  	    0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
  	    lanesToEventPriority(lanes);
  	    finishedWork = finishedWork.stateNode;
  	    if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
  	      try {
  	        injectedHook.onCommitFiberRoot(
  	          rendererID,
  	          finishedWork,
  	          void 0,
  	          128 === (finishedWork.current.flags & 128)
  	        );
  	      } catch (err) {}
  	    if (null !== recoverableErrors) {
  	      finishedWork = ReactSharedInternals.T;
  	      remainingLanes = ReactDOMSharedInternals.p;
  	      ReactDOMSharedInternals.p = 2;
  	      ReactSharedInternals.T = null;
  	      try {
  	        for (
  	          var onRecoverableError = root.onRecoverableError, i = 0;
  	          i < recoverableErrors.length;
  	          i++
  	        ) {
  	          var recoverableError = recoverableErrors[i];
  	          onRecoverableError(recoverableError.value, {
  	            componentStack: recoverableError.stack
  	          });
  	        }
  	      } finally {
  	        (ReactSharedInternals.T = finishedWork),
  	          (ReactDOMSharedInternals.p = remainingLanes);
  	      }
  	    }
  	    0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
  	    ensureRootIsScheduled(root);
  	    remainingLanes = root.pendingLanes;
  	    0 !== (lanes & 261930) && 0 !== (remainingLanes & 42)
  	      ? root === rootWithNestedUpdates
  	        ? nestedUpdateCount++
  	        : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))
  	      : (nestedUpdateCount = 0);
  	    flushSyncWorkAcrossRoots_impl(0);
  	  }
  	}
  	function releaseRootPooledCache(root, remainingLanes) {
  	  0 === (root.pooledCacheLanes &= remainingLanes) &&
  	    ((remainingLanes = root.pooledCache),
  	    null != remainingLanes &&
  	      ((root.pooledCache = null), releaseCache(remainingLanes)));
  	}
  	function flushPendingEffects() {
  	  flushMutationEffects();
  	  flushLayoutEffects();
  	  flushSpawnedWork();
  	  return flushPassiveEffects();
  	}
  	function flushPassiveEffects() {
  	  if (5 !== pendingEffectsStatus) return false;
  	  var root = pendingEffectsRoot,
  	    remainingLanes = pendingEffectsRemainingLanes;
  	  pendingEffectsRemainingLanes = 0;
  	  var renderPriority = lanesToEventPriority(pendingEffectsLanes),
  	    prevTransition = ReactSharedInternals.T,
  	    previousPriority = ReactDOMSharedInternals.p;
  	  try {
  	    ReactDOMSharedInternals.p = 32 > renderPriority ? 32 : renderPriority;
  	    ReactSharedInternals.T = null;
  	    renderPriority = pendingPassiveTransitions;
  	    pendingPassiveTransitions = null;
  	    var root$jscomp$0 = pendingEffectsRoot,
  	      lanes = pendingEffectsLanes;
  	    pendingEffectsStatus = 0;
  	    pendingFinishedWork = pendingEffectsRoot = null;
  	    pendingEffectsLanes = 0;
  	    if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331));
  	    var prevExecutionContext = executionContext;
  	    executionContext |= 4;
  	    commitPassiveUnmountOnFiber(root$jscomp$0.current);
  	    commitPassiveMountOnFiber(
  	      root$jscomp$0,
  	      root$jscomp$0.current,
  	      lanes,
  	      renderPriority
  	    );
  	    executionContext = prevExecutionContext;
  	    flushSyncWorkAcrossRoots_impl(0, !1);
  	    if (
  	      injectedHook &&
  	      "function" === typeof injectedHook.onPostCommitFiberRoot
  	    )
  	      try {
  	        injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0);
  	      } catch (err) {}
  	    return !0;
  	  } finally {
  	    (ReactDOMSharedInternals.p = previousPriority),
  	      (ReactSharedInternals.T = prevTransition),
  	      releaseRootPooledCache(root, remainingLanes);
  	  }
  	}
  	function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  	  sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
  	  sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2);
  	  rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2);
  	  null !== rootFiber &&
  	    (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber));
  	}
  	function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) {
  	  if (3 === sourceFiber.tag)
  	    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
  	  else
  	    for (; null !== nearestMountedAncestor; ) {
  	      if (3 === nearestMountedAncestor.tag) {
  	        captureCommitPhaseErrorOnRoot(
  	          nearestMountedAncestor,
  	          sourceFiber,
  	          error
  	        );
  	        break;
  	      } else if (1 === nearestMountedAncestor.tag) {
  	        var instance = nearestMountedAncestor.stateNode;
  	        if (
  	          "function" ===
  	            typeof nearestMountedAncestor.type.getDerivedStateFromError ||
  	          ("function" === typeof instance.componentDidCatch &&
  	            (null === legacyErrorBoundariesThatAlreadyFailed ||
  	              !legacyErrorBoundariesThatAlreadyFailed.has(instance)))
  	        ) {
  	          sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
  	          error = createClassErrorUpdate(2);
  	          instance = enqueueUpdate(nearestMountedAncestor, error, 2);
  	          null !== instance &&
  	            (initializeClassErrorUpdate(
  	              error,
  	              instance,
  	              nearestMountedAncestor,
  	              sourceFiber
  	            ),
  	            markRootUpdated$1(instance, 2),
  	            ensureRootIsScheduled(instance));
  	          break;
  	        }
  	      }
  	      nearestMountedAncestor = nearestMountedAncestor.return;
  	    }
  	}
  	function attachPingListener(root, wakeable, lanes) {
  	  var pingCache = root.pingCache;
  	  if (null === pingCache) {
  	    pingCache = root.pingCache = new PossiblyWeakMap();
  	    var threadIDs = new Set();
  	    pingCache.set(wakeable, threadIDs);
  	  } else
  	    (threadIDs = pingCache.get(wakeable)),
  	      void 0 === threadIDs &&
  	        ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs));
  	  threadIDs.has(lanes) ||
  	    ((workInProgressRootDidAttachPingListener = true),
  	    threadIDs.add(lanes),
  	    (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)),
  	    wakeable.then(root, root));
  	}
  	function pingSuspendedRoot(root, wakeable, pingedLanes) {
  	  var pingCache = root.pingCache;
  	  null !== pingCache && pingCache.delete(wakeable);
  	  root.pingedLanes |= root.suspendedLanes & pingedLanes;
  	  root.warmLanes &= ~pingedLanes;
  	  workInProgressRoot === root &&
  	    (workInProgressRootRenderLanes & pingedLanes) === pingedLanes &&
  	    (4 === workInProgressRootExitStatus ||
  	    (3 === workInProgressRootExitStatus &&
  	      (workInProgressRootRenderLanes & 62914560) ===
  	        workInProgressRootRenderLanes &&
  	      300 > now() - globalMostRecentFallbackTime)
  	      ? 0 === (executionContext & 2) && prepareFreshStack(root, 0)
  	      : (workInProgressRootPingedLanes |= pingedLanes),
  	    workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes &&
  	      (workInProgressSuspendedRetryLanes = 0));
  	  ensureRootIsScheduled(root);
  	}
  	function retryTimedOutBoundary(boundaryFiber, retryLane) {
  	  0 === retryLane && (retryLane = claimNextRetryLane());
  	  boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
  	  null !== boundaryFiber &&
  	    (markRootUpdated$1(boundaryFiber, retryLane),
  	    ensureRootIsScheduled(boundaryFiber));
  	}
  	function retryDehydratedSuspenseBoundary(boundaryFiber) {
  	  var suspenseState = boundaryFiber.memoizedState,
  	    retryLane = 0;
  	  null !== suspenseState && (retryLane = suspenseState.retryLane);
  	  retryTimedOutBoundary(boundaryFiber, retryLane);
  	}
  	function resolveRetryWakeable(boundaryFiber, wakeable) {
  	  var retryLane = 0;
  	  switch (boundaryFiber.tag) {
  	    case 31:
  	    case 13:
  	      var retryCache = boundaryFiber.stateNode;
  	      var suspenseState = boundaryFiber.memoizedState;
  	      null !== suspenseState && (retryLane = suspenseState.retryLane);
  	      break;
  	    case 19:
  	      retryCache = boundaryFiber.stateNode;
  	      break;
  	    case 22:
  	      retryCache = boundaryFiber.stateNode._retryCache;
  	      break;
  	    default:
  	      throw Error(formatProdErrorMessage(314));
  	  }
  	  null !== retryCache && retryCache.delete(wakeable);
  	  retryTimedOutBoundary(boundaryFiber, retryLane);
  	}
  	function scheduleCallback$1(priorityLevel, callback) {
  	  return scheduleCallback$3(priorityLevel, callback);
  	}
  	var firstScheduledRoot = null,
  	  lastScheduledRoot = null,
  	  didScheduleMicrotask = false,
  	  mightHavePendingSyncWork = false,
  	  isFlushingWork = false,
  	  currentEventTransitionLane = 0;
  	function ensureRootIsScheduled(root) {
  	  root !== lastScheduledRoot &&
  	    null === root.next &&
  	    (null === lastScheduledRoot
  	      ? (firstScheduledRoot = lastScheduledRoot = root)
  	      : (lastScheduledRoot = lastScheduledRoot.next = root));
  	  mightHavePendingSyncWork = true;
  	  didScheduleMicrotask ||
  	    ((didScheduleMicrotask = true), scheduleImmediateRootScheduleTask());
  	}
  	function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
  	  if (!isFlushingWork && mightHavePendingSyncWork) {
  	    isFlushingWork = true;
  	    do {
  	      var didPerformSomeWork = false;
  	      for (var root$170 = firstScheduledRoot; null !== root$170; ) {
  	        if (0 !== syncTransitionLanes) {
  	            var pendingLanes = root$170.pendingLanes;
  	            if (0 === pendingLanes) var JSCompiler_inline_result = 0;
  	            else {
  	              var suspendedLanes = root$170.suspendedLanes,
  	                pingedLanes = root$170.pingedLanes;
  	              JSCompiler_inline_result =
  	                (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1;
  	              JSCompiler_inline_result &=
  	                pendingLanes & ~(suspendedLanes & ~pingedLanes);
  	              JSCompiler_inline_result =
  	                JSCompiler_inline_result & 201326741
  	                  ? (JSCompiler_inline_result & 201326741) | 1
  	                  : JSCompiler_inline_result
  	                    ? JSCompiler_inline_result | 2
  	                    : 0;
  	            }
  	            0 !== JSCompiler_inline_result &&
  	              ((didPerformSomeWork = true),
  	              performSyncWorkOnRoot(root$170, JSCompiler_inline_result));
  	          } else
  	            (JSCompiler_inline_result = workInProgressRootRenderLanes),
  	              (JSCompiler_inline_result = getNextLanes(
  	                root$170,
  	                root$170 === workInProgressRoot ? JSCompiler_inline_result : 0,
  	                null !== root$170.cancelPendingCommit ||
  	                  -1 !== root$170.timeoutHandle
  	              )),
  	              0 === (JSCompiler_inline_result & 3) ||
  	                checkIfRootIsPrerendering(root$170, JSCompiler_inline_result) ||
  	                ((didPerformSomeWork = true),
  	                performSyncWorkOnRoot(root$170, JSCompiler_inline_result));
  	        root$170 = root$170.next;
  	      }
  	    } while (didPerformSomeWork);
  	    isFlushingWork = false;
  	  }
  	}
  	function processRootScheduleInImmediateTask() {
  	  processRootScheduleInMicrotask();
  	}
  	function processRootScheduleInMicrotask() {
  	  mightHavePendingSyncWork = didScheduleMicrotask = false;
  	  var syncTransitionLanes = 0;
  	  0 !== currentEventTransitionLane &&
  	    shouldAttemptEagerTransition() &&
  	    (syncTransitionLanes = currentEventTransitionLane);
  	  for (
  	    var currentTime = now(), prev = null, root = firstScheduledRoot;
  	    null !== root;

  	  ) {
  	    var next = root.next,
  	      nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime);
  	    if (0 === nextLanes)
  	      (root.next = null),
  	        null === prev ? (firstScheduledRoot = next) : (prev.next = next),
  	        null === next && (lastScheduledRoot = prev);
  	    else if (
  	      ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
  	    )
  	      mightHavePendingSyncWork = true;
  	    root = next;
  	  }
  	  (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) ||
  	    flushSyncWorkAcrossRoots_impl(syncTransitionLanes);
  	  0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
  	}
  	function scheduleTaskForRootDuringMicrotask(root, currentTime) {
  	  for (
  	    var suspendedLanes = root.suspendedLanes,
  	      pingedLanes = root.pingedLanes,
  	      expirationTimes = root.expirationTimes,
  	      lanes = root.pendingLanes & -62914561;
  	    0 < lanes;

  	  ) {
  	    var index$5 = 31 - clz32(lanes),
  	      lane = 1 << index$5,
  	      expirationTime = expirationTimes[index$5];
  	    if (-1 === expirationTime) {
  	      if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
  	        expirationTimes[index$5] = computeExpirationTime(lane, currentTime);
  	    } else expirationTime <= currentTime && (root.expiredLanes |= lane);
  	    lanes &= ~lane;
  	  }
  	  currentTime = workInProgressRoot;
  	  suspendedLanes = workInProgressRootRenderLanes;
  	  suspendedLanes = getNextLanes(
  	    root,
  	    root === currentTime ? suspendedLanes : 0,
  	    null !== root.cancelPendingCommit || -1 !== root.timeoutHandle
  	  );
  	  pingedLanes = root.callbackNode;
  	  if (
  	    0 === suspendedLanes ||
  	    (root === currentTime &&
  	      (2 === workInProgressSuspendedReason ||
  	        9 === workInProgressSuspendedReason)) ||
  	    null !== root.cancelPendingCommit
  	  )
  	    return (
  	      null !== pingedLanes &&
  	        null !== pingedLanes &&
  	        cancelCallback$1(pingedLanes),
  	      (root.callbackNode = null),
  	      (root.callbackPriority = 0)
  	    );
  	  if (
  	    0 === (suspendedLanes & 3) ||
  	    checkIfRootIsPrerendering(root, suspendedLanes)
  	  ) {
  	    currentTime = suspendedLanes & -suspendedLanes;
  	    if (currentTime === root.callbackPriority) return currentTime;
  	    null !== pingedLanes && cancelCallback$1(pingedLanes);
  	    switch (lanesToEventPriority(suspendedLanes)) {
  	      case 2:
  	      case 8:
  	        suspendedLanes = UserBlockingPriority;
  	        break;
  	      case 32:
  	        suspendedLanes = NormalPriority$1;
  	        break;
  	      case 268435456:
  	        suspendedLanes = IdlePriority;
  	        break;
  	      default:
  	        suspendedLanes = NormalPriority$1;
  	    }
  	    pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root);
  	    suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
  	    root.callbackPriority = currentTime;
  	    root.callbackNode = suspendedLanes;
  	    return currentTime;
  	  }
  	  null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes);
  	  root.callbackPriority = 2;
  	  root.callbackNode = null;
  	  return 2;
  	}
  	function performWorkOnRootViaSchedulerTask(root, didTimeout) {
  	  if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus)
  	    return (root.callbackNode = null), (root.callbackPriority = 0), null;
  	  var originalCallbackNode = root.callbackNode;
  	  if (flushPendingEffects() && root.callbackNode !== originalCallbackNode)
  	    return null;
  	  var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
  	  workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
  	    root,
  	    root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
  	    null !== root.cancelPendingCommit || -1 !== root.timeoutHandle
  	  );
  	  if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
  	  performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout);
  	  scheduleTaskForRootDuringMicrotask(root, now());
  	  return null != root.callbackNode && root.callbackNode === originalCallbackNode
  	    ? performWorkOnRootViaSchedulerTask.bind(null, root)
  	    : null;
  	}
  	function performSyncWorkOnRoot(root, lanes) {
  	  if (flushPendingEffects()) return null;
  	  performWorkOnRoot(root, lanes, true);
  	}
  	function scheduleImmediateRootScheduleTask() {
  	  scheduleMicrotask(function () {
  	    0 !== (executionContext & 6)
  	      ? scheduleCallback$3(
  	          ImmediatePriority,
  	          processRootScheduleInImmediateTask
  	        )
  	      : processRootScheduleInMicrotask();
  	  });
  	}
  	function requestTransitionLane() {
  	  if (0 === currentEventTransitionLane) {
  	    var actionScopeLane = currentEntangledLane;
  	    0 === actionScopeLane &&
  	      ((actionScopeLane = nextTransitionUpdateLane),
  	      (nextTransitionUpdateLane <<= 1),
  	      0 === (nextTransitionUpdateLane & 261888) &&
  	        (nextTransitionUpdateLane = 256));
  	    currentEventTransitionLane = actionScopeLane;
  	  }
  	  return currentEventTransitionLane;
  	}
  	function coerceFormActionProp(actionProp) {
  	  return null == actionProp ||
  	    "symbol" === typeof actionProp ||
  	    "boolean" === typeof actionProp
  	    ? null
  	    : "function" === typeof actionProp
  	      ? actionProp
  	      : sanitizeURL("" + actionProp);
  	}
  	function createFormDataWithSubmitter(form, submitter) {
  	  var temp = submitter.ownerDocument.createElement("input");
  	  temp.name = submitter.name;
  	  temp.value = submitter.value;
  	  form.id && temp.setAttribute("form", form.id);
  	  submitter.parentNode.insertBefore(temp, submitter);
  	  form = new FormData(form);
  	  temp.parentNode.removeChild(temp);
  	  return form;
  	}
  	function extractEvents$1(
  	  dispatchQueue,
  	  domEventName,
  	  maybeTargetInst,
  	  nativeEvent,
  	  nativeEventTarget
  	) {
  	  if (
  	    "submit" === domEventName &&
  	    maybeTargetInst &&
  	    maybeTargetInst.stateNode === nativeEventTarget
  	  ) {
  	    var action = coerceFormActionProp(
  	        (nativeEventTarget[internalPropsKey] || null).action
  	      ),
  	      submitter = nativeEvent.submitter;
  	    submitter &&
  	      ((domEventName = (domEventName = submitter[internalPropsKey] || null)
  	        ? coerceFormActionProp(domEventName.formAction)
  	        : submitter.getAttribute("formAction")),
  	      null !== domEventName && ((action = domEventName), (submitter = null)));
  	    var event = new SyntheticEvent(
  	      "action",
  	      "action",
  	      null,
  	      nativeEvent,
  	      nativeEventTarget
  	    );
  	    dispatchQueue.push({
  	      event: event,
  	      listeners: [
  	        {
  	          instance: null,
  	          listener: function () {
  	            if (nativeEvent.defaultPrevented) {
  	              if (0 !== currentEventTransitionLane) {
  	                var formData = submitter
  	                  ? createFormDataWithSubmitter(nativeEventTarget, submitter)
  	                  : new FormData(nativeEventTarget);
  	                startHostTransition(
  	                  maybeTargetInst,
  	                  {
  	                    pending: true,
  	                    data: formData,
  	                    method: nativeEventTarget.method,
  	                    action: action
  	                  },
  	                  null,
  	                  formData
  	                );
  	              }
  	            } else
  	              "function" === typeof action &&
  	                (event.preventDefault(),
  	                (formData = submitter
  	                  ? createFormDataWithSubmitter(nativeEventTarget, submitter)
  	                  : new FormData(nativeEventTarget)),
  	                startHostTransition(
  	                  maybeTargetInst,
  	                  {
  	                    pending: true,
  	                    data: formData,
  	                    method: nativeEventTarget.method,
  	                    action: action
  	                  },
  	                  action,
  	                  formData
  	                ));
  	          },
  	          currentTarget: nativeEventTarget
  	        }
  	      ]
  	    });
  	  }
  	}
  	for (
  	  var i$jscomp$inline_1577 = 0;
  	  i$jscomp$inline_1577 < simpleEventPluginEvents.length;
  	  i$jscomp$inline_1577++
  	) {
  	  var eventName$jscomp$inline_1578 =
  	      simpleEventPluginEvents[i$jscomp$inline_1577],
  	    domEventName$jscomp$inline_1579 =
  	      eventName$jscomp$inline_1578.toLowerCase(),
  	    capitalizedEvent$jscomp$inline_1580 =
  	      eventName$jscomp$inline_1578[0].toUpperCase() +
  	      eventName$jscomp$inline_1578.slice(1);
  	  registerSimpleEvent(
  	    domEventName$jscomp$inline_1579,
  	    "on" + capitalizedEvent$jscomp$inline_1580
  	  );
  	}
  	registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
  	registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
  	registerSimpleEvent(ANIMATION_START, "onAnimationStart");
  	registerSimpleEvent("dblclick", "onDoubleClick");
  	registerSimpleEvent("focusin", "onFocus");
  	registerSimpleEvent("focusout", "onBlur");
  	registerSimpleEvent(TRANSITION_RUN, "onTransitionRun");
  	registerSimpleEvent(TRANSITION_START, "onTransitionStart");
  	registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel");
  	registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
  	registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
  	registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
  	registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
  	registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
  	registerTwoPhaseEvent(
  	  "onChange",
  	  "change click focusin focusout input keydown keyup selectionchange".split(" ")
  	);
  	registerTwoPhaseEvent(
  	  "onSelect",
  	  "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
  	    " "
  	  )
  	);
  	registerTwoPhaseEvent("onBeforeInput", [
  	  "compositionend",
  	  "keypress",
  	  "textInput",
  	  "paste"
  	]);
  	registerTwoPhaseEvent(
  	  "onCompositionEnd",
  	  "compositionend focusout keydown keypress keyup mousedown".split(" ")
  	);
  	registerTwoPhaseEvent(
  	  "onCompositionStart",
  	  "compositionstart focusout keydown keypress keyup mousedown".split(" ")
  	);
  	registerTwoPhaseEvent(
  	  "onCompositionUpdate",
  	  "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
  	);
  	var mediaEventTypes =
  	    "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(
  	      " "
  	    ),
  	  nonDelegatedEvents = new Set(
  	    "beforetoggle cancel close invalid load scroll scrollend toggle"
  	      .split(" ")
  	      .concat(mediaEventTypes)
  	  );
  	function processDispatchQueue(dispatchQueue, eventSystemFlags) {
  	  eventSystemFlags = 0 !== (eventSystemFlags & 4);
  	  for (var i = 0; i < dispatchQueue.length; i++) {
  	    var _dispatchQueue$i = dispatchQueue[i],
  	      event = _dispatchQueue$i.event;
  	    _dispatchQueue$i = _dispatchQueue$i.listeners;
  	    a: {
  	      var previousInstance = void 0;
  	      if (eventSystemFlags)
  	        for (
  	          var i$jscomp$0 = _dispatchQueue$i.length - 1;
  	          0 <= i$jscomp$0;
  	          i$jscomp$0--
  	        ) {
  	          var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0],
  	            instance = _dispatchListeners$i.instance,
  	            currentTarget = _dispatchListeners$i.currentTarget;
  	          _dispatchListeners$i = _dispatchListeners$i.listener;
  	          if (instance !== previousInstance && event.isPropagationStopped())
  	            break a;
  	          previousInstance = _dispatchListeners$i;
  	          event.currentTarget = currentTarget;
  	          try {
  	            previousInstance(event);
  	          } catch (error) {
  	            reportGlobalError(error);
  	          }
  	          event.currentTarget = null;
  	          previousInstance = instance;
  	        }
  	      else
  	        for (
  	          i$jscomp$0 = 0;
  	          i$jscomp$0 < _dispatchQueue$i.length;
  	          i$jscomp$0++
  	        ) {
  	          _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0];
  	          instance = _dispatchListeners$i.instance;
  	          currentTarget = _dispatchListeners$i.currentTarget;
  	          _dispatchListeners$i = _dispatchListeners$i.listener;
  	          if (instance !== previousInstance && event.isPropagationStopped())
  	            break a;
  	          previousInstance = _dispatchListeners$i;
  	          event.currentTarget = currentTarget;
  	          try {
  	            previousInstance(event);
  	          } catch (error) {
  	            reportGlobalError(error);
  	          }
  	          event.currentTarget = null;
  	          previousInstance = instance;
  	        }
  	    }
  	  }
  	}
  	function listenToNonDelegatedEvent(domEventName, targetElement) {
  	  var JSCompiler_inline_result = targetElement[internalEventHandlersKey];
  	  void 0 === JSCompiler_inline_result &&
  	    (JSCompiler_inline_result = targetElement[internalEventHandlersKey] =
  	      new Set());
  	  var listenerSetKey = domEventName + "__bubble";
  	  JSCompiler_inline_result.has(listenerSetKey) ||
  	    (addTrappedEventListener(targetElement, domEventName, 2, false),
  	    JSCompiler_inline_result.add(listenerSetKey));
  	}
  	function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
  	  var eventSystemFlags = 0;
  	  isCapturePhaseListener && (eventSystemFlags |= 4);
  	  addTrappedEventListener(
  	    target,
  	    domEventName,
  	    eventSystemFlags,
  	    isCapturePhaseListener
  	  );
  	}
  	var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
  	function listenToAllSupportedEvents(rootContainerElement) {
  	  if (!rootContainerElement[listeningMarker]) {
  	    rootContainerElement[listeningMarker] = true;
  	    allNativeEvents.forEach(function (domEventName) {
  	      "selectionchange" !== domEventName &&
  	        (nonDelegatedEvents.has(domEventName) ||
  	          listenToNativeEvent(domEventName, false, rootContainerElement),
  	        listenToNativeEvent(domEventName, true, rootContainerElement));
  	    });
  	    var ownerDocument =
  	      9 === rootContainerElement.nodeType
  	        ? rootContainerElement
  	        : rootContainerElement.ownerDocument;
  	    null === ownerDocument ||
  	      ownerDocument[listeningMarker] ||
  	      ((ownerDocument[listeningMarker] = true),
  	      listenToNativeEvent("selectionchange", false, ownerDocument));
  	  }
  	}
  	function addTrappedEventListener(
  	  targetContainer,
  	  domEventName,
  	  eventSystemFlags,
  	  isCapturePhaseListener
  	) {
  	  switch (getEventPriority(domEventName)) {
  	    case 2:
  	      var listenerWrapper = dispatchDiscreteEvent;
  	      break;
  	    case 8:
  	      listenerWrapper = dispatchContinuousEvent;
  	      break;
  	    default:
  	      listenerWrapper = dispatchEvent;
  	  }
  	  eventSystemFlags = listenerWrapper.bind(
  	    null,
  	    domEventName,
  	    eventSystemFlags,
  	    targetContainer
  	  );
  	  listenerWrapper = void 0;
  	  !passiveBrowserEventsSupported ||
  	    ("touchstart" !== domEventName &&
  	      "touchmove" !== domEventName &&
  	      "wheel" !== domEventName) ||
  	    (listenerWrapper = true);
  	  isCapturePhaseListener
  	    ? void 0 !== listenerWrapper
  	      ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
  	          capture: true,
  	          passive: listenerWrapper
  	        })
  	      : targetContainer.addEventListener(domEventName, eventSystemFlags, true)
  	    : void 0 !== listenerWrapper
  	      ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
  	          passive: listenerWrapper
  	        })
  	      : targetContainer.addEventListener(domEventName, eventSystemFlags, false);
  	}
  	function dispatchEventForPluginEventSystem(
  	  domEventName,
  	  eventSystemFlags,
  	  nativeEvent,
  	  targetInst$jscomp$0,
  	  targetContainer
  	) {
  	  var ancestorInst = targetInst$jscomp$0;
  	  if (
  	    0 === (eventSystemFlags & 1) &&
  	    0 === (eventSystemFlags & 2) &&
  	    null !== targetInst$jscomp$0
  	  )
  	    a: for (;;) {
  	      if (null === targetInst$jscomp$0) return;
  	      var nodeTag = targetInst$jscomp$0.tag;
  	      if (3 === nodeTag || 4 === nodeTag) {
  	        var container = targetInst$jscomp$0.stateNode.containerInfo;
  	        if (container === targetContainer) break;
  	        if (4 === nodeTag)
  	          for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) {
  	            var grandTag = nodeTag.tag;
  	            if (
  	              (3 === grandTag || 4 === grandTag) &&
  	              nodeTag.stateNode.containerInfo === targetContainer
  	            )
  	              return;
  	            nodeTag = nodeTag.return;
  	          }
  	        for (; null !== container; ) {
  	          nodeTag = getClosestInstanceFromNode(container);
  	          if (null === nodeTag) return;
  	          grandTag = nodeTag.tag;
  	          if (
  	            5 === grandTag ||
  	            6 === grandTag ||
  	            26 === grandTag ||
  	            27 === grandTag
  	          ) {
  	            targetInst$jscomp$0 = ancestorInst = nodeTag;
  	            continue a;
  	          }
  	          container = container.parentNode;
  	        }
  	      }
  	      targetInst$jscomp$0 = targetInst$jscomp$0.return;
  	    }
  	  batchedUpdates$1(function () {
  	    var targetInst = ancestorInst,
  	      nativeEventTarget = getEventTarget(nativeEvent),
  	      dispatchQueue = [];
  	    a: {
  	      var reactName = topLevelEventsToReactNames.get(domEventName);
  	      if (void 0 !== reactName) {
  	        var SyntheticEventCtor = SyntheticEvent,
  	          reactEventType = domEventName;
  	        switch (domEventName) {
  	          case "keypress":
  	            if (0 === getEventCharCode(nativeEvent)) break a;
  	          case "keydown":
  	          case "keyup":
  	            SyntheticEventCtor = SyntheticKeyboardEvent;
  	            break;
  	          case "focusin":
  	            reactEventType = "focus";
  	            SyntheticEventCtor = SyntheticFocusEvent;
  	            break;
  	          case "focusout":
  	            reactEventType = "blur";
  	            SyntheticEventCtor = SyntheticFocusEvent;
  	            break;
  	          case "beforeblur":
  	          case "afterblur":
  	            SyntheticEventCtor = SyntheticFocusEvent;
  	            break;
  	          case "click":
  	            if (2 === nativeEvent.button) break a;
  	          case "auxclick":
  	          case "dblclick":
  	          case "mousedown":
  	          case "mousemove":
  	          case "mouseup":
  	          case "mouseout":
  	          case "mouseover":
  	          case "contextmenu":
  	            SyntheticEventCtor = SyntheticMouseEvent;
  	            break;
  	          case "drag":
  	          case "dragend":
  	          case "dragenter":
  	          case "dragexit":
  	          case "dragleave":
  	          case "dragover":
  	          case "dragstart":
  	          case "drop":
  	            SyntheticEventCtor = SyntheticDragEvent;
  	            break;
  	          case "touchcancel":
  	          case "touchend":
  	          case "touchmove":
  	          case "touchstart":
  	            SyntheticEventCtor = SyntheticTouchEvent;
  	            break;
  	          case ANIMATION_END:
  	          case ANIMATION_ITERATION:
  	          case ANIMATION_START:
  	            SyntheticEventCtor = SyntheticAnimationEvent;
  	            break;
  	          case TRANSITION_END:
  	            SyntheticEventCtor = SyntheticTransitionEvent;
  	            break;
  	          case "scroll":
  	          case "scrollend":
  	            SyntheticEventCtor = SyntheticUIEvent;
  	            break;
  	          case "wheel":
  	            SyntheticEventCtor = SyntheticWheelEvent;
  	            break;
  	          case "copy":
  	          case "cut":
  	          case "paste":
  	            SyntheticEventCtor = SyntheticClipboardEvent;
  	            break;
  	          case "gotpointercapture":
  	          case "lostpointercapture":
  	          case "pointercancel":
  	          case "pointerdown":
  	          case "pointermove":
  	          case "pointerout":
  	          case "pointerover":
  	          case "pointerup":
  	            SyntheticEventCtor = SyntheticPointerEvent;
  	            break;
  	          case "toggle":
  	          case "beforetoggle":
  	            SyntheticEventCtor = SyntheticToggleEvent;
  	        }
  	        var inCapturePhase = 0 !== (eventSystemFlags & 4),
  	          accumulateTargetOnly =
  	            !inCapturePhase &&
  	            ("scroll" === domEventName || "scrollend" === domEventName),
  	          reactEventName = inCapturePhase
  	            ? null !== reactName
  	              ? reactName + "Capture"
  	              : null
  	            : reactName;
  	        inCapturePhase = [];
  	        for (
  	          var instance = targetInst, lastHostComponent;
  	          null !== instance;

  	        ) {
  	          var _instance = instance;
  	          lastHostComponent = _instance.stateNode;
  	          _instance = _instance.tag;
  	          (5 !== _instance && 26 !== _instance && 27 !== _instance) ||
  	            null === lastHostComponent ||
  	            null === reactEventName ||
  	            ((_instance = getListener(instance, reactEventName)),
  	            null != _instance &&
  	              inCapturePhase.push(
  	                createDispatchListener(instance, _instance, lastHostComponent)
  	              ));
  	          if (accumulateTargetOnly) break;
  	          instance = instance.return;
  	        }
  	        0 < inCapturePhase.length &&
  	          ((reactName = new SyntheticEventCtor(
  	            reactName,
  	            reactEventType,
  	            null,
  	            nativeEvent,
  	            nativeEventTarget
  	          )),
  	          dispatchQueue.push({ event: reactName, listeners: inCapturePhase }));
  	      }
  	    }
  	    if (0 === (eventSystemFlags & 7)) {
  	      a: {
  	        reactName =
  	          "mouseover" === domEventName || "pointerover" === domEventName;
  	        SyntheticEventCtor =
  	          "mouseout" === domEventName || "pointerout" === domEventName;
  	        if (
  	          reactName &&
  	          nativeEvent !== currentReplayingEvent &&
  	          (reactEventType =
  	            nativeEvent.relatedTarget || nativeEvent.fromElement) &&
  	          (getClosestInstanceFromNode(reactEventType) ||
  	            reactEventType[internalContainerInstanceKey])
  	        )
  	          break a;
  	        if (SyntheticEventCtor || reactName) {
  	          reactName =
  	            nativeEventTarget.window === nativeEventTarget
  	              ? nativeEventTarget
  	              : (reactName = nativeEventTarget.ownerDocument)
  	                ? reactName.defaultView || reactName.parentWindow
  	                : window;
  	          if (SyntheticEventCtor) {
  	            if (
  	              ((reactEventType =
  	                nativeEvent.relatedTarget || nativeEvent.toElement),
  	              (SyntheticEventCtor = targetInst),
  	              (reactEventType = reactEventType
  	                ? getClosestInstanceFromNode(reactEventType)
  	                : null),
  	              null !== reactEventType &&
  	                ((accumulateTargetOnly =
  	                  getNearestMountedFiber(reactEventType)),
  	                (inCapturePhase = reactEventType.tag),
  	                reactEventType !== accumulateTargetOnly ||
  	                  (5 !== inCapturePhase &&
  	                    27 !== inCapturePhase &&
  	                    6 !== inCapturePhase)))
  	            )
  	              reactEventType = null;
  	          } else (SyntheticEventCtor = null), (reactEventType = targetInst);
  	          if (SyntheticEventCtor !== reactEventType) {
  	            inCapturePhase = SyntheticMouseEvent;
  	            _instance = "onMouseLeave";
  	            reactEventName = "onMouseEnter";
  	            instance = "mouse";
  	            if ("pointerout" === domEventName || "pointerover" === domEventName)
  	              (inCapturePhase = SyntheticPointerEvent),
  	                (_instance = "onPointerLeave"),
  	                (reactEventName = "onPointerEnter"),
  	                (instance = "pointer");
  	            accumulateTargetOnly =
  	              null == SyntheticEventCtor
  	                ? reactName
  	                : getNodeFromInstance(SyntheticEventCtor);
  	            lastHostComponent =
  	              null == reactEventType
  	                ? reactName
  	                : getNodeFromInstance(reactEventType);
  	            reactName = new inCapturePhase(
  	              _instance,
  	              instance + "leave",
  	              SyntheticEventCtor,
  	              nativeEvent,
  	              nativeEventTarget
  	            );
  	            reactName.target = accumulateTargetOnly;
  	            reactName.relatedTarget = lastHostComponent;
  	            _instance = null;
  	            getClosestInstanceFromNode(nativeEventTarget) === targetInst &&
  	              ((inCapturePhase = new inCapturePhase(
  	                reactEventName,
  	                instance + "enter",
  	                reactEventType,
  	                nativeEvent,
  	                nativeEventTarget
  	              )),
  	              (inCapturePhase.target = lastHostComponent),
  	              (inCapturePhase.relatedTarget = accumulateTargetOnly),
  	              (_instance = inCapturePhase));
  	            accumulateTargetOnly = _instance;
  	            if (SyntheticEventCtor && reactEventType)
  	              b: {
  	                inCapturePhase = getParent;
  	                reactEventName = SyntheticEventCtor;
  	                instance = reactEventType;
  	                lastHostComponent = 0;
  	                for (
  	                  _instance = reactEventName;
  	                  _instance;
  	                  _instance = inCapturePhase(_instance)
  	                )
  	                  lastHostComponent++;
  	                _instance = 0;
  	                for (var tempB = instance; tempB; tempB = inCapturePhase(tempB))
  	                  _instance++;
  	                for (; 0 < lastHostComponent - _instance; )
  	                  (reactEventName = inCapturePhase(reactEventName)),
  	                    lastHostComponent--;
  	                for (; 0 < _instance - lastHostComponent; )
  	                  (instance = inCapturePhase(instance)), _instance--;
  	                for (; lastHostComponent--; ) {
  	                  if (
  	                    reactEventName === instance ||
  	                    (null !== instance && reactEventName === instance.alternate)
  	                  ) {
  	                    inCapturePhase = reactEventName;
  	                    break b;
  	                  }
  	                  reactEventName = inCapturePhase(reactEventName);
  	                  instance = inCapturePhase(instance);
  	                }
  	                inCapturePhase = null;
  	              }
  	            else inCapturePhase = null;
  	            null !== SyntheticEventCtor &&
  	              accumulateEnterLeaveListenersForEvent(
  	                dispatchQueue,
  	                reactName,
  	                SyntheticEventCtor,
  	                inCapturePhase,
  	                !1
  	              );
  	            null !== reactEventType &&
  	              null !== accumulateTargetOnly &&
  	              accumulateEnterLeaveListenersForEvent(
  	                dispatchQueue,
  	                accumulateTargetOnly,
  	                reactEventType,
  	                inCapturePhase,
  	                !0
  	              );
  	          }
  	        }
  	      }
  	      a: {
  	        reactName = targetInst ? getNodeFromInstance(targetInst) : window;
  	        SyntheticEventCtor =
  	          reactName.nodeName && reactName.nodeName.toLowerCase();
  	        if (
  	          "select" === SyntheticEventCtor ||
  	          ("input" === SyntheticEventCtor && "file" === reactName.type)
  	        )
  	          var getTargetInstFunc = getTargetInstForChangeEvent;
  	        else if (isTextInputElement(reactName))
  	          if (isInputEventSupported)
  	            getTargetInstFunc = getTargetInstForInputOrChangeEvent;
  	          else {
  	            getTargetInstFunc = getTargetInstForInputEventPolyfill;
  	            var handleEventFunc = handleEventsForInputEventPolyfill;
  	          }
  	        else
  	          (SyntheticEventCtor = reactName.nodeName),
  	            !SyntheticEventCtor ||
  	            "input" !== SyntheticEventCtor.toLowerCase() ||
  	            ("checkbox" !== reactName.type && "radio" !== reactName.type)
  	              ? targetInst &&
  	                isCustomElement(targetInst.elementType) &&
  	                (getTargetInstFunc = getTargetInstForChangeEvent)
  	              : (getTargetInstFunc = getTargetInstForClickEvent);
  	        if (
  	          getTargetInstFunc &&
  	          (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))
  	        ) {
  	          createAndAccumulateChangeEvent(
  	            dispatchQueue,
  	            getTargetInstFunc,
  	            nativeEvent,
  	            nativeEventTarget
  	          );
  	          break a;
  	        }
  	        handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
  	        "focusout" === domEventName &&
  	          targetInst &&
  	          "number" === reactName.type &&
  	          null != targetInst.memoizedProps.value &&
  	          setDefaultValue(reactName, "number", reactName.value);
  	      }
  	      handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
  	      switch (domEventName) {
  	        case "focusin":
  	          if (
  	            isTextInputElement(handleEventFunc) ||
  	            "true" === handleEventFunc.contentEditable
  	          )
  	            (activeElement = handleEventFunc),
  	              (activeElementInst = targetInst),
  	              (lastSelection = null);
  	          break;
  	        case "focusout":
  	          lastSelection = activeElementInst = activeElement = null;
  	          break;
  	        case "mousedown":
  	          mouseDown = !0;
  	          break;
  	        case "contextmenu":
  	        case "mouseup":
  	        case "dragend":
  	          mouseDown = !1;
  	          constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
  	          break;
  	        case "selectionchange":
  	          if (skipSelectionChangeEvent) break;
  	        case "keydown":
  	        case "keyup":
  	          constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
  	      }
  	      var fallbackData;
  	      if (canUseCompositionEvent)
  	        b: {
  	          switch (domEventName) {
  	            case "compositionstart":
  	              var eventType = "onCompositionStart";
  	              break b;
  	            case "compositionend":
  	              eventType = "onCompositionEnd";
  	              break b;
  	            case "compositionupdate":
  	              eventType = "onCompositionUpdate";
  	              break b;
  	          }
  	          eventType = void 0;
  	        }
  	      else
  	        isComposing
  	          ? isFallbackCompositionEnd(domEventName, nativeEvent) &&
  	            (eventType = "onCompositionEnd")
  	          : "keydown" === domEventName &&
  	            229 === nativeEvent.keyCode &&
  	            (eventType = "onCompositionStart");
  	      eventType &&
  	        (useFallbackCompositionData &&
  	          "ko" !== nativeEvent.locale &&
  	          (isComposing || "onCompositionStart" !== eventType
  	            ? "onCompositionEnd" === eventType &&
  	              isComposing &&
  	              (fallbackData = getData())
  	            : ((root = nativeEventTarget),
  	              (startText = "value" in root ? root.value : root.textContent),
  	              (isComposing = !0))),
  	        (handleEventFunc = accumulateTwoPhaseListeners(targetInst, eventType)),
  	        0 < handleEventFunc.length &&
  	          ((eventType = new SyntheticCompositionEvent(
  	            eventType,
  	            domEventName,
  	            null,
  	            nativeEvent,
  	            nativeEventTarget
  	          )),
  	          dispatchQueue.push({ event: eventType, listeners: handleEventFunc }),
  	          fallbackData
  	            ? (eventType.data = fallbackData)
  	            : ((fallbackData = getDataFromCustomEvent(nativeEvent)),
  	              null !== fallbackData && (eventType.data = fallbackData))));
  	      if (
  	        (fallbackData = canUseTextInputEvent
  	          ? getNativeBeforeInputChars(domEventName, nativeEvent)
  	          : getFallbackBeforeInputChars(domEventName, nativeEvent))
  	      )
  	        (eventType = accumulateTwoPhaseListeners(targetInst, "onBeforeInput")),
  	          0 < eventType.length &&
  	            ((handleEventFunc = new SyntheticCompositionEvent(
  	              "onBeforeInput",
  	              "beforeinput",
  	              null,
  	              nativeEvent,
  	              nativeEventTarget
  	            )),
  	            dispatchQueue.push({
  	              event: handleEventFunc,
  	              listeners: eventType
  	            }),
  	            (handleEventFunc.data = fallbackData));
  	      extractEvents$1(
  	        dispatchQueue,
  	        domEventName,
  	        targetInst,
  	        nativeEvent,
  	        nativeEventTarget
  	      );
  	    }
  	    processDispatchQueue(dispatchQueue, eventSystemFlags);
  	  });
  	}
  	function createDispatchListener(instance, listener, currentTarget) {
  	  return {
  	    instance: instance,
  	    listener: listener,
  	    currentTarget: currentTarget
  	  };
  	}
  	function accumulateTwoPhaseListeners(targetFiber, reactName) {
  	  for (
  	    var captureName = reactName + "Capture", listeners = [];
  	    null !== targetFiber;

  	  ) {
  	    var _instance2 = targetFiber,
  	      stateNode = _instance2.stateNode;
  	    _instance2 = _instance2.tag;
  	    (5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2) ||
  	      null === stateNode ||
  	      ((_instance2 = getListener(targetFiber, captureName)),
  	      null != _instance2 &&
  	        listeners.unshift(
  	          createDispatchListener(targetFiber, _instance2, stateNode)
  	        ),
  	      (_instance2 = getListener(targetFiber, reactName)),
  	      null != _instance2 &&
  	        listeners.push(
  	          createDispatchListener(targetFiber, _instance2, stateNode)
  	        ));
  	    if (3 === targetFiber.tag) return listeners;
  	    targetFiber = targetFiber.return;
  	  }
  	  return [];
  	}
  	function getParent(inst) {
  	  if (null === inst) return null;
  	  do inst = inst.return;
  	  while (inst && 5 !== inst.tag && 27 !== inst.tag);
  	  return inst ? inst : null;
  	}
  	function accumulateEnterLeaveListenersForEvent(
  	  dispatchQueue,
  	  event,
  	  target,
  	  common,
  	  inCapturePhase
  	) {
  	  for (
  	    var registrationName = event._reactName, listeners = [];
  	    null !== target && target !== common;

  	  ) {
  	    var _instance3 = target,
  	      alternate = _instance3.alternate,
  	      stateNode = _instance3.stateNode;
  	    _instance3 = _instance3.tag;
  	    if (null !== alternate && alternate === common) break;
  	    (5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3) ||
  	      null === stateNode ||
  	      ((alternate = stateNode),
  	      inCapturePhase
  	        ? ((stateNode = getListener(target, registrationName)),
  	          null != stateNode &&
  	            listeners.unshift(
  	              createDispatchListener(target, stateNode, alternate)
  	            ))
  	        : inCapturePhase ||
  	          ((stateNode = getListener(target, registrationName)),
  	          null != stateNode &&
  	            listeners.push(
  	              createDispatchListener(target, stateNode, alternate)
  	            )));
  	    target = target.return;
  	  }
  	  0 !== listeners.length &&
  	    dispatchQueue.push({ event: event, listeners: listeners });
  	}
  	var NORMALIZE_NEWLINES_REGEX = /\r\n?/g,
  	  NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
  	function normalizeMarkupForTextOrAttribute(markup) {
  	  return ("string" === typeof markup ? markup : "" + markup)
  	    .replace(NORMALIZE_NEWLINES_REGEX, "\n")
  	    .replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
  	}
  	function checkForUnmatchedText(serverText, clientText) {
  	  clientText = normalizeMarkupForTextOrAttribute(clientText);
  	  return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
  	}
  	function setProp(domElement, tag, key, value, props, prevValue) {
  	  switch (key) {
  	    case "children":
  	      "string" === typeof value
  	        ? "body" === tag ||
  	          ("textarea" === tag && "" === value) ||
  	          setTextContent(domElement, value)
  	        : ("number" === typeof value || "bigint" === typeof value) &&
  	          "body" !== tag &&
  	          setTextContent(domElement, "" + value);
  	      break;
  	    case "className":
  	      setValueForKnownAttribute(domElement, "class", value);
  	      break;
  	    case "tabIndex":
  	      setValueForKnownAttribute(domElement, "tabindex", value);
  	      break;
  	    case "dir":
  	    case "role":
  	    case "viewBox":
  	    case "width":
  	    case "height":
  	      setValueForKnownAttribute(domElement, key, value);
  	      break;
  	    case "style":
  	      setValueForStyles(domElement, value, prevValue);
  	      break;
  	    case "data":
  	      if ("object" !== tag) {
  	        setValueForKnownAttribute(domElement, "data", value);
  	        break;
  	      }
  	    case "src":
  	    case "href":
  	      if ("" === value && ("a" !== tag || "href" !== key)) {
  	        domElement.removeAttribute(key);
  	        break;
  	      }
  	      if (
  	        null == value ||
  	        "function" === typeof value ||
  	        "symbol" === typeof value ||
  	        "boolean" === typeof value
  	      ) {
  	        domElement.removeAttribute(key);
  	        break;
  	      }
  	      value = sanitizeURL("" + value);
  	      domElement.setAttribute(key, value);
  	      break;
  	    case "action":
  	    case "formAction":
  	      if ("function" === typeof value) {
  	        domElement.setAttribute(
  	          key,
  	          "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
  	        );
  	        break;
  	      } else
  	        "function" === typeof prevValue &&
  	          ("formAction" === key
  	            ? ("input" !== tag &&
  	                setProp(domElement, tag, "name", props.name, props, null),
  	              setProp(
  	                domElement,
  	                tag,
  	                "formEncType",
  	                props.formEncType,
  	                props,
  	                null
  	              ),
  	              setProp(
  	                domElement,
  	                tag,
  	                "formMethod",
  	                props.formMethod,
  	                props,
  	                null
  	              ),
  	              setProp(
  	                domElement,
  	                tag,
  	                "formTarget",
  	                props.formTarget,
  	                props,
  	                null
  	              ))
  	            : (setProp(domElement, tag, "encType", props.encType, props, null),
  	              setProp(domElement, tag, "method", props.method, props, null),
  	              setProp(domElement, tag, "target", props.target, props, null)));
  	      if (
  	        null == value ||
  	        "symbol" === typeof value ||
  	        "boolean" === typeof value
  	      ) {
  	        domElement.removeAttribute(key);
  	        break;
  	      }
  	      value = sanitizeURL("" + value);
  	      domElement.setAttribute(key, value);
  	      break;
  	    case "onClick":
  	      null != value && (domElement.onclick = noop$1);
  	      break;
  	    case "onScroll":
  	      null != value && listenToNonDelegatedEvent("scroll", domElement);
  	      break;
  	    case "onScrollEnd":
  	      null != value && listenToNonDelegatedEvent("scrollend", domElement);
  	      break;
  	    case "dangerouslySetInnerHTML":
  	      if (null != value) {
  	        if ("object" !== typeof value || !("__html" in value))
  	          throw Error(formatProdErrorMessage(61));
  	        key = value.__html;
  	        if (null != key) {
  	          if (null != props.children) throw Error(formatProdErrorMessage(60));
  	          domElement.innerHTML = key;
  	        }
  	      }
  	      break;
  	    case "multiple":
  	      domElement.multiple =
  	        value && "function" !== typeof value && "symbol" !== typeof value;
  	      break;
  	    case "muted":
  	      domElement.muted =
  	        value && "function" !== typeof value && "symbol" !== typeof value;
  	      break;
  	    case "suppressContentEditableWarning":
  	    case "suppressHydrationWarning":
  	    case "defaultValue":
  	    case "defaultChecked":
  	    case "innerHTML":
  	    case "ref":
  	      break;
  	    case "autoFocus":
  	      break;
  	    case "xlinkHref":
  	      if (
  	        null == value ||
  	        "function" === typeof value ||
  	        "boolean" === typeof value ||
  	        "symbol" === typeof value
  	      ) {
  	        domElement.removeAttribute("xlink:href");
  	        break;
  	      }
  	      key = sanitizeURL("" + value);
  	      domElement.setAttributeNS(
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:href",
  	        key
  	      );
  	      break;
  	    case "contentEditable":
  	    case "spellCheck":
  	    case "draggable":
  	    case "value":
  	    case "autoReverse":
  	    case "externalResourcesRequired":
  	    case "focusable":
  	    case "preserveAlpha":
  	      null != value && "function" !== typeof value && "symbol" !== typeof value
  	        ? domElement.setAttribute(key, "" + value)
  	        : domElement.removeAttribute(key);
  	      break;
  	    case "inert":
  	    case "allowFullScreen":
  	    case "async":
  	    case "autoPlay":
  	    case "controls":
  	    case "default":
  	    case "defer":
  	    case "disabled":
  	    case "disablePictureInPicture":
  	    case "disableRemotePlayback":
  	    case "formNoValidate":
  	    case "hidden":
  	    case "loop":
  	    case "noModule":
  	    case "noValidate":
  	    case "open":
  	    case "playsInline":
  	    case "readOnly":
  	    case "required":
  	    case "reversed":
  	    case "scoped":
  	    case "seamless":
  	    case "itemScope":
  	      value && "function" !== typeof value && "symbol" !== typeof value
  	        ? domElement.setAttribute(key, "")
  	        : domElement.removeAttribute(key);
  	      break;
  	    case "capture":
  	    case "download":
  	      true === value
  	        ? domElement.setAttribute(key, "")
  	        : false !== value &&
  	            null != value &&
  	            "function" !== typeof value &&
  	            "symbol" !== typeof value
  	          ? domElement.setAttribute(key, value)
  	          : domElement.removeAttribute(key);
  	      break;
  	    case "cols":
  	    case "rows":
  	    case "size":
  	    case "span":
  	      null != value &&
  	      "function" !== typeof value &&
  	      "symbol" !== typeof value &&
  	      !isNaN(value) &&
  	      1 <= value
  	        ? domElement.setAttribute(key, value)
  	        : domElement.removeAttribute(key);
  	      break;
  	    case "rowSpan":
  	    case "start":
  	      null == value ||
  	      "function" === typeof value ||
  	      "symbol" === typeof value ||
  	      isNaN(value)
  	        ? domElement.removeAttribute(key)
  	        : domElement.setAttribute(key, value);
  	      break;
  	    case "popover":
  	      listenToNonDelegatedEvent("beforetoggle", domElement);
  	      listenToNonDelegatedEvent("toggle", domElement);
  	      setValueForAttribute(domElement, "popover", value);
  	      break;
  	    case "xlinkActuate":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:actuate",
  	        value
  	      );
  	      break;
  	    case "xlinkArcrole":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:arcrole",
  	        value
  	      );
  	      break;
  	    case "xlinkRole":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:role",
  	        value
  	      );
  	      break;
  	    case "xlinkShow":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:show",
  	        value
  	      );
  	      break;
  	    case "xlinkTitle":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:title",
  	        value
  	      );
  	      break;
  	    case "xlinkType":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/1999/xlink",
  	        "xlink:type",
  	        value
  	      );
  	      break;
  	    case "xmlBase":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/XML/1998/namespace",
  	        "xml:base",
  	        value
  	      );
  	      break;
  	    case "xmlLang":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/XML/1998/namespace",
  	        "xml:lang",
  	        value
  	      );
  	      break;
  	    case "xmlSpace":
  	      setValueForNamespacedAttribute(
  	        domElement,
  	        "http://www.w3.org/XML/1998/namespace",
  	        "xml:space",
  	        value
  	      );
  	      break;
  	    case "is":
  	      setValueForAttribute(domElement, "is", value);
  	      break;
  	    case "innerText":
  	    case "textContent":
  	      break;
  	    default:
  	      if (
  	        !(2 < key.length) ||
  	        ("o" !== key[0] && "O" !== key[0]) ||
  	        ("n" !== key[1] && "N" !== key[1])
  	      )
  	        (key = aliases.get(key) || key),
  	          setValueForAttribute(domElement, key, value);
  	  }
  	}
  	function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) {
  	  switch (key) {
  	    case "style":
  	      setValueForStyles(domElement, value, prevValue);
  	      break;
  	    case "dangerouslySetInnerHTML":
  	      if (null != value) {
  	        if ("object" !== typeof value || !("__html" in value))
  	          throw Error(formatProdErrorMessage(61));
  	        key = value.__html;
  	        if (null != key) {
  	          if (null != props.children) throw Error(formatProdErrorMessage(60));
  	          domElement.innerHTML = key;
  	        }
  	      }
  	      break;
  	    case "children":
  	      "string" === typeof value
  	        ? setTextContent(domElement, value)
  	        : ("number" === typeof value || "bigint" === typeof value) &&
  	          setTextContent(domElement, "" + value);
  	      break;
  	    case "onScroll":
  	      null != value && listenToNonDelegatedEvent("scroll", domElement);
  	      break;
  	    case "onScrollEnd":
  	      null != value && listenToNonDelegatedEvent("scrollend", domElement);
  	      break;
  	    case "onClick":
  	      null != value && (domElement.onclick = noop$1);
  	      break;
  	    case "suppressContentEditableWarning":
  	    case "suppressHydrationWarning":
  	    case "innerHTML":
  	    case "ref":
  	      break;
  	    case "innerText":
  	    case "textContent":
  	      break;
  	    default:
  	      if (!registrationNameDependencies.hasOwnProperty(key))
  	        a: {
  	          if (
  	            "o" === key[0] &&
  	            "n" === key[1] &&
  	            ((props = key.endsWith("Capture")),
  	            (tag = key.slice(2, props ? key.length - 7 : void 0)),
  	            (prevValue = domElement[internalPropsKey] || null),
  	            (prevValue = null != prevValue ? prevValue[key] : null),
  	            "function" === typeof prevValue &&
  	              domElement.removeEventListener(tag, prevValue, props),
  	            "function" === typeof value)
  	          ) {
  	            "function" !== typeof prevValue &&
  	              null !== prevValue &&
  	              (key in domElement
  	                ? (domElement[key] = null)
  	                : domElement.hasAttribute(key) &&
  	                  domElement.removeAttribute(key));
  	            domElement.addEventListener(tag, value, props);
  	            break a;
  	          }
  	          key in domElement
  	            ? (domElement[key] = value)
  	            : true === value
  	              ? domElement.setAttribute(key, "")
  	              : setValueForAttribute(domElement, key, value);
  	        }
  	  }
  	}
  	function setInitialProperties(domElement, tag, props) {
  	  switch (tag) {
  	    case "div":
  	    case "span":
  	    case "svg":
  	    case "path":
  	    case "a":
  	    case "g":
  	    case "p":
  	    case "li":
  	      break;
  	    case "img":
  	      listenToNonDelegatedEvent("error", domElement);
  	      listenToNonDelegatedEvent("load", domElement);
  	      var hasSrc = false,
  	        hasSrcSet = false,
  	        propKey;
  	      for (propKey in props)
  	        if (props.hasOwnProperty(propKey)) {
  	          var propValue = props[propKey];
  	          if (null != propValue)
  	            switch (propKey) {
  	              case "src":
  	                hasSrc = true;
  	                break;
  	              case "srcSet":
  	                hasSrcSet = true;
  	                break;
  	              case "children":
  	              case "dangerouslySetInnerHTML":
  	                throw Error(formatProdErrorMessage(137, tag));
  	              default:
  	                setProp(domElement, tag, propKey, propValue, props, null);
  	            }
  	        }
  	      hasSrcSet &&
  	        setProp(domElement, tag, "srcSet", props.srcSet, props, null);
  	      hasSrc && setProp(domElement, tag, "src", props.src, props, null);
  	      return;
  	    case "input":
  	      listenToNonDelegatedEvent("invalid", domElement);
  	      var defaultValue = (propKey = propValue = hasSrcSet = null),
  	        checked = null,
  	        defaultChecked = null;
  	      for (hasSrc in props)
  	        if (props.hasOwnProperty(hasSrc)) {
  	          var propValue$184 = props[hasSrc];
  	          if (null != propValue$184)
  	            switch (hasSrc) {
  	              case "name":
  	                hasSrcSet = propValue$184;
  	                break;
  	              case "type":
  	                propValue = propValue$184;
  	                break;
  	              case "checked":
  	                checked = propValue$184;
  	                break;
  	              case "defaultChecked":
  	                defaultChecked = propValue$184;
  	                break;
  	              case "value":
  	                propKey = propValue$184;
  	                break;
  	              case "defaultValue":
  	                defaultValue = propValue$184;
  	                break;
  	              case "children":
  	              case "dangerouslySetInnerHTML":
  	                if (null != propValue$184)
  	                  throw Error(formatProdErrorMessage(137, tag));
  	                break;
  	              default:
  	                setProp(domElement, tag, hasSrc, propValue$184, props, null);
  	            }
  	        }
  	      initInput(
  	        domElement,
  	        propKey,
  	        defaultValue,
  	        checked,
  	        defaultChecked,
  	        propValue,
  	        hasSrcSet,
  	        false
  	      );
  	      return;
  	    case "select":
  	      listenToNonDelegatedEvent("invalid", domElement);
  	      hasSrc = propValue = propKey = null;
  	      for (hasSrcSet in props)
  	        if (
  	          props.hasOwnProperty(hasSrcSet) &&
  	          ((defaultValue = props[hasSrcSet]), null != defaultValue)
  	        )
  	          switch (hasSrcSet) {
  	            case "value":
  	              propKey = defaultValue;
  	              break;
  	            case "defaultValue":
  	              propValue = defaultValue;
  	              break;
  	            case "multiple":
  	              hasSrc = defaultValue;
  	            default:
  	              setProp(domElement, tag, hasSrcSet, defaultValue, props, null);
  	          }
  	      tag = propKey;
  	      props = propValue;
  	      domElement.multiple = !!hasSrc;
  	      null != tag
  	        ? updateOptions(domElement, !!hasSrc, tag, false)
  	        : null != props && updateOptions(domElement, !!hasSrc, props, true);
  	      return;
  	    case "textarea":
  	      listenToNonDelegatedEvent("invalid", domElement);
  	      propKey = hasSrcSet = hasSrc = null;
  	      for (propValue in props)
  	        if (
  	          props.hasOwnProperty(propValue) &&
  	          ((defaultValue = props[propValue]), null != defaultValue)
  	        )
  	          switch (propValue) {
  	            case "value":
  	              hasSrc = defaultValue;
  	              break;
  	            case "defaultValue":
  	              hasSrcSet = defaultValue;
  	              break;
  	            case "children":
  	              propKey = defaultValue;
  	              break;
  	            case "dangerouslySetInnerHTML":
  	              if (null != defaultValue) throw Error(formatProdErrorMessage(91));
  	              break;
  	            default:
  	              setProp(domElement, tag, propValue, defaultValue, props, null);
  	          }
  	      initTextarea(domElement, hasSrc, hasSrcSet, propKey);
  	      return;
  	    case "option":
  	      for (checked in props)
  	        if (
  	          props.hasOwnProperty(checked) &&
  	          ((hasSrc = props[checked]), null != hasSrc)
  	        )
  	          switch (checked) {
  	            case "selected":
  	              domElement.selected =
  	                hasSrc &&
  	                "function" !== typeof hasSrc &&
  	                "symbol" !== typeof hasSrc;
  	              break;
  	            default:
  	              setProp(domElement, tag, checked, hasSrc, props, null);
  	          }
  	      return;
  	    case "dialog":
  	      listenToNonDelegatedEvent("beforetoggle", domElement);
  	      listenToNonDelegatedEvent("toggle", domElement);
  	      listenToNonDelegatedEvent("cancel", domElement);
  	      listenToNonDelegatedEvent("close", domElement);
  	      break;
  	    case "iframe":
  	    case "object":
  	      listenToNonDelegatedEvent("load", domElement);
  	      break;
  	    case "video":
  	    case "audio":
  	      for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++)
  	        listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement);
  	      break;
  	    case "image":
  	      listenToNonDelegatedEvent("error", domElement);
  	      listenToNonDelegatedEvent("load", domElement);
  	      break;
  	    case "details":
  	      listenToNonDelegatedEvent("toggle", domElement);
  	      break;
  	    case "embed":
  	    case "source":
  	    case "link":
  	      listenToNonDelegatedEvent("error", domElement),
  	        listenToNonDelegatedEvent("load", domElement);
  	    case "area":
  	    case "base":
  	    case "br":
  	    case "col":
  	    case "hr":
  	    case "keygen":
  	    case "meta":
  	    case "param":
  	    case "track":
  	    case "wbr":
  	    case "menuitem":
  	      for (defaultChecked in props)
  	        if (
  	          props.hasOwnProperty(defaultChecked) &&
  	          ((hasSrc = props[defaultChecked]), null != hasSrc)
  	        )
  	          switch (defaultChecked) {
  	            case "children":
  	            case "dangerouslySetInnerHTML":
  	              throw Error(formatProdErrorMessage(137, tag));
  	            default:
  	              setProp(domElement, tag, defaultChecked, hasSrc, props, null);
  	          }
  	      return;
  	    default:
  	      if (isCustomElement(tag)) {
  	        for (propValue$184 in props)
  	          props.hasOwnProperty(propValue$184) &&
  	            ((hasSrc = props[propValue$184]),
  	            void 0 !== hasSrc &&
  	              setPropOnCustomElement(
  	                domElement,
  	                tag,
  	                propValue$184,
  	                hasSrc,
  	                props,
  	                void 0
  	              ));
  	        return;
  	      }
  	  }
  	  for (defaultValue in props)
  	    props.hasOwnProperty(defaultValue) &&
  	      ((hasSrc = props[defaultValue]),
  	      null != hasSrc &&
  	        setProp(domElement, tag, defaultValue, hasSrc, props, null));
  	}
  	function updateProperties(domElement, tag, lastProps, nextProps) {
  	  switch (tag) {
  	    case "div":
  	    case "span":
  	    case "svg":
  	    case "path":
  	    case "a":
  	    case "g":
  	    case "p":
  	    case "li":
  	      break;
  	    case "input":
  	      var name = null,
  	        type = null,
  	        value = null,
  	        defaultValue = null,
  	        lastDefaultValue = null,
  	        checked = null,
  	        defaultChecked = null;
  	      for (propKey in lastProps) {
  	        var lastProp = lastProps[propKey];
  	        if (lastProps.hasOwnProperty(propKey) && null != lastProp)
  	          switch (propKey) {
  	            case "checked":
  	              break;
  	            case "value":
  	              break;
  	            case "defaultValue":
  	              lastDefaultValue = lastProp;
  	            default:
  	              nextProps.hasOwnProperty(propKey) ||
  	                setProp(domElement, tag, propKey, null, nextProps, lastProp);
  	          }
  	      }
  	      for (var propKey$201 in nextProps) {
  	        var propKey = nextProps[propKey$201];
  	        lastProp = lastProps[propKey$201];
  	        if (
  	          nextProps.hasOwnProperty(propKey$201) &&
  	          (null != propKey || null != lastProp)
  	        )
  	          switch (propKey$201) {
  	            case "type":
  	              type = propKey;
  	              break;
  	            case "name":
  	              name = propKey;
  	              break;
  	            case "checked":
  	              checked = propKey;
  	              break;
  	            case "defaultChecked":
  	              defaultChecked = propKey;
  	              break;
  	            case "value":
  	              value = propKey;
  	              break;
  	            case "defaultValue":
  	              defaultValue = propKey;
  	              break;
  	            case "children":
  	            case "dangerouslySetInnerHTML":
  	              if (null != propKey)
  	                throw Error(formatProdErrorMessage(137, tag));
  	              break;
  	            default:
  	              propKey !== lastProp &&
  	                setProp(
  	                  domElement,
  	                  tag,
  	                  propKey$201,
  	                  propKey,
  	                  nextProps,
  	                  lastProp
  	                );
  	          }
  	      }
  	      updateInput(
  	        domElement,
  	        value,
  	        defaultValue,
  	        lastDefaultValue,
  	        checked,
  	        defaultChecked,
  	        type,
  	        name
  	      );
  	      return;
  	    case "select":
  	      propKey = value = defaultValue = propKey$201 = null;
  	      for (type in lastProps)
  	        if (
  	          ((lastDefaultValue = lastProps[type]),
  	          lastProps.hasOwnProperty(type) && null != lastDefaultValue)
  	        )
  	          switch (type) {
  	            case "value":
  	              break;
  	            case "multiple":
  	              propKey = lastDefaultValue;
  	            default:
  	              nextProps.hasOwnProperty(type) ||
  	                setProp(
  	                  domElement,
  	                  tag,
  	                  type,
  	                  null,
  	                  nextProps,
  	                  lastDefaultValue
  	                );
  	          }
  	      for (name in nextProps)
  	        if (
  	          ((type = nextProps[name]),
  	          (lastDefaultValue = lastProps[name]),
  	          nextProps.hasOwnProperty(name) &&
  	            (null != type || null != lastDefaultValue))
  	        )
  	          switch (name) {
  	            case "value":
  	              propKey$201 = type;
  	              break;
  	            case "defaultValue":
  	              defaultValue = type;
  	              break;
  	            case "multiple":
  	              value = type;
  	            default:
  	              type !== lastDefaultValue &&
  	                setProp(
  	                  domElement,
  	                  tag,
  	                  name,
  	                  type,
  	                  nextProps,
  	                  lastDefaultValue
  	                );
  	          }
  	      tag = defaultValue;
  	      lastProps = value;
  	      nextProps = propKey;
  	      null != propKey$201
  	        ? updateOptions(domElement, !!lastProps, propKey$201, false)
  	        : !!nextProps !== !!lastProps &&
  	          (null != tag
  	            ? updateOptions(domElement, !!lastProps, tag, true)
  	            : updateOptions(domElement, !!lastProps, lastProps ? [] : "", false));
  	      return;
  	    case "textarea":
  	      propKey = propKey$201 = null;
  	      for (defaultValue in lastProps)
  	        if (
  	          ((name = lastProps[defaultValue]),
  	          lastProps.hasOwnProperty(defaultValue) &&
  	            null != name &&
  	            !nextProps.hasOwnProperty(defaultValue))
  	        )
  	          switch (defaultValue) {
  	            case "value":
  	              break;
  	            case "children":
  	              break;
  	            default:
  	              setProp(domElement, tag, defaultValue, null, nextProps, name);
  	          }
  	      for (value in nextProps)
  	        if (
  	          ((name = nextProps[value]),
  	          (type = lastProps[value]),
  	          nextProps.hasOwnProperty(value) && (null != name || null != type))
  	        )
  	          switch (value) {
  	            case "value":
  	              propKey$201 = name;
  	              break;
  	            case "defaultValue":
  	              propKey = name;
  	              break;
  	            case "children":
  	              break;
  	            case "dangerouslySetInnerHTML":
  	              if (null != name) throw Error(formatProdErrorMessage(91));
  	              break;
  	            default:
  	              name !== type &&
  	                setProp(domElement, tag, value, name, nextProps, type);
  	          }
  	      updateTextarea(domElement, propKey$201, propKey);
  	      return;
  	    case "option":
  	      for (var propKey$217 in lastProps)
  	        if (
  	          ((propKey$201 = lastProps[propKey$217]),
  	          lastProps.hasOwnProperty(propKey$217) &&
  	            null != propKey$201 &&
  	            !nextProps.hasOwnProperty(propKey$217))
  	        )
  	          switch (propKey$217) {
  	            case "selected":
  	              domElement.selected = false;
  	              break;
  	            default:
  	              setProp(
  	                domElement,
  	                tag,
  	                propKey$217,
  	                null,
  	                nextProps,
  	                propKey$201
  	              );
  	          }
  	      for (lastDefaultValue in nextProps)
  	        if (
  	          ((propKey$201 = nextProps[lastDefaultValue]),
  	          (propKey = lastProps[lastDefaultValue]),
  	          nextProps.hasOwnProperty(lastDefaultValue) &&
  	            propKey$201 !== propKey &&
  	            (null != propKey$201 || null != propKey))
  	        )
  	          switch (lastDefaultValue) {
  	            case "selected":
  	              domElement.selected =
  	                propKey$201 &&
  	                "function" !== typeof propKey$201 &&
  	                "symbol" !== typeof propKey$201;
  	              break;
  	            default:
  	              setProp(
  	                domElement,
  	                tag,
  	                lastDefaultValue,
  	                propKey$201,
  	                nextProps,
  	                propKey
  	              );
  	          }
  	      return;
  	    case "img":
  	    case "link":
  	    case "area":
  	    case "base":
  	    case "br":
  	    case "col":
  	    case "embed":
  	    case "hr":
  	    case "keygen":
  	    case "meta":
  	    case "param":
  	    case "source":
  	    case "track":
  	    case "wbr":
  	    case "menuitem":
  	      for (var propKey$222 in lastProps)
  	        (propKey$201 = lastProps[propKey$222]),
  	          lastProps.hasOwnProperty(propKey$222) &&
  	            null != propKey$201 &&
  	            !nextProps.hasOwnProperty(propKey$222) &&
  	            setProp(domElement, tag, propKey$222, null, nextProps, propKey$201);
  	      for (checked in nextProps)
  	        if (
  	          ((propKey$201 = nextProps[checked]),
  	          (propKey = lastProps[checked]),
  	          nextProps.hasOwnProperty(checked) &&
  	            propKey$201 !== propKey &&
  	            (null != propKey$201 || null != propKey))
  	        )
  	          switch (checked) {
  	            case "children":
  	            case "dangerouslySetInnerHTML":
  	              if (null != propKey$201)
  	                throw Error(formatProdErrorMessage(137, tag));
  	              break;
  	            default:
  	              setProp(
  	                domElement,
  	                tag,
  	                checked,
  	                propKey$201,
  	                nextProps,
  	                propKey
  	              );
  	          }
  	      return;
  	    default:
  	      if (isCustomElement(tag)) {
  	        for (var propKey$227 in lastProps)
  	          (propKey$201 = lastProps[propKey$227]),
  	            lastProps.hasOwnProperty(propKey$227) &&
  	              void 0 !== propKey$201 &&
  	              !nextProps.hasOwnProperty(propKey$227) &&
  	              setPropOnCustomElement(
  	                domElement,
  	                tag,
  	                propKey$227,
  	                void 0,
  	                nextProps,
  	                propKey$201
  	              );
  	        for (defaultChecked in nextProps)
  	          (propKey$201 = nextProps[defaultChecked]),
  	            (propKey = lastProps[defaultChecked]),
  	            !nextProps.hasOwnProperty(defaultChecked) ||
  	              propKey$201 === propKey ||
  	              (void 0 === propKey$201 && void 0 === propKey) ||
  	              setPropOnCustomElement(
  	                domElement,
  	                tag,
  	                defaultChecked,
  	                propKey$201,
  	                nextProps,
  	                propKey
  	              );
  	        return;
  	      }
  	  }
  	  for (var propKey$232 in lastProps)
  	    (propKey$201 = lastProps[propKey$232]),
  	      lastProps.hasOwnProperty(propKey$232) &&
  	        null != propKey$201 &&
  	        !nextProps.hasOwnProperty(propKey$232) &&
  	        setProp(domElement, tag, propKey$232, null, nextProps, propKey$201);
  	  for (lastProp in nextProps)
  	    (propKey$201 = nextProps[lastProp]),
  	      (propKey = lastProps[lastProp]),
  	      !nextProps.hasOwnProperty(lastProp) ||
  	        propKey$201 === propKey ||
  	        (null == propKey$201 && null == propKey) ||
  	        setProp(domElement, tag, lastProp, propKey$201, nextProps, propKey);
  	}
  	function isLikelyStaticResource(initiatorType) {
  	  switch (initiatorType) {
  	    case "css":
  	    case "script":
  	    case "font":
  	    case "img":
  	    case "image":
  	    case "input":
  	    case "link":
  	      return true;
  	    default:
  	      return false;
  	  }
  	}
  	function estimateBandwidth() {
  	  if ("function" === typeof performance.getEntriesByType) {
  	    for (
  	      var count = 0,
  	        bits = 0,
  	        resourceEntries = performance.getEntriesByType("resource"),
  	        i = 0;
  	      i < resourceEntries.length;
  	      i++
  	    ) {
  	      var entry = resourceEntries[i],
  	        transferSize = entry.transferSize,
  	        initiatorType = entry.initiatorType,
  	        duration = entry.duration;
  	      if (transferSize && duration && isLikelyStaticResource(initiatorType)) {
  	        initiatorType = 0;
  	        duration = entry.responseEnd;
  	        for (i += 1; i < resourceEntries.length; i++) {
  	          var overlapEntry = resourceEntries[i],
  	            overlapStartTime = overlapEntry.startTime;
  	          if (overlapStartTime > duration) break;
  	          var overlapTransferSize = overlapEntry.transferSize,
  	            overlapInitiatorType = overlapEntry.initiatorType;
  	          overlapTransferSize &&
  	            isLikelyStaticResource(overlapInitiatorType) &&
  	            ((overlapEntry = overlapEntry.responseEnd),
  	            (initiatorType +=
  	              overlapTransferSize *
  	              (overlapEntry < duration
  	                ? 1
  	                : (duration - overlapStartTime) /
  	                  (overlapEntry - overlapStartTime))));
  	        }
  	        --i;
  	        bits += (8 * (transferSize + initiatorType)) / (entry.duration / 1e3);
  	        count++;
  	        if (10 < count) break;
  	      }
  	    }
  	    if (0 < count) return bits / count / 1e6;
  	  }
  	  return navigator.connection &&
  	    ((count = navigator.connection.downlink), "number" === typeof count)
  	    ? count
  	    : 5;
  	}
  	var eventsEnabled = null,
  	  selectionInformation = null;
  	function getOwnerDocumentFromRootContainer(rootContainerElement) {
  	  return 9 === rootContainerElement.nodeType
  	    ? rootContainerElement
  	    : rootContainerElement.ownerDocument;
  	}
  	function getOwnHostContext(namespaceURI) {
  	  switch (namespaceURI) {
  	    case "http://www.w3.org/2000/svg":
  	      return 1;
  	    case "http://www.w3.org/1998/Math/MathML":
  	      return 2;
  	    default:
  	      return 0;
  	  }
  	}
  	function getChildHostContextProd(parentNamespace, type) {
  	  if (0 === parentNamespace)
  	    switch (type) {
  	      case "svg":
  	        return 1;
  	      case "math":
  	        return 2;
  	      default:
  	        return 0;
  	    }
  	  return 1 === parentNamespace && "foreignObject" === type
  	    ? 0
  	    : parentNamespace;
  	}
  	function shouldSetTextContent(type, props) {
  	  return (
  	    "textarea" === type ||
  	    "noscript" === type ||
  	    "string" === typeof props.children ||
  	    "number" === typeof props.children ||
  	    "bigint" === typeof props.children ||
  	    ("object" === typeof props.dangerouslySetInnerHTML &&
  	      null !== props.dangerouslySetInnerHTML &&
  	      null != props.dangerouslySetInnerHTML.__html)
  	  );
  	}
  	var currentPopstateTransitionEvent = null;
  	function shouldAttemptEagerTransition() {
  	  var event = window.event;
  	  if (event && "popstate" === event.type) {
  	    if (event === currentPopstateTransitionEvent) return false;
  	    currentPopstateTransitionEvent = event;
  	    return true;
  	  }
  	  currentPopstateTransitionEvent = null;
  	  return false;
  	}
  	var scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0,
  	  cancelTimeout = "function" === typeof clearTimeout ? clearTimeout : void 0,
  	  localPromise = "function" === typeof Promise ? Promise : void 0,
  	  scheduleMicrotask =
  	    "function" === typeof queueMicrotask
  	      ? queueMicrotask
  	      : "undefined" !== typeof localPromise
  	        ? function (callback) {
  	            return localPromise
  	              .resolve(null)
  	              .then(callback)
  	              .catch(handleErrorInNextTick);
  	          }
  	        : scheduleTimeout;
  	function handleErrorInNextTick(error) {
  	  setTimeout(function () {
  	    throw error;
  	  });
  	}
  	function isSingletonScope(type) {
  	  return "head" === type;
  	}
  	function clearHydrationBoundary(parentInstance, hydrationInstance) {
  	  var node = hydrationInstance,
  	    depth = 0;
  	  do {
  	    var nextNode = node.nextSibling;
  	    parentInstance.removeChild(node);
  	    if (nextNode && 8 === nextNode.nodeType)
  	      if (((node = nextNode.data), "/$" === node || "/&" === node)) {
  	        if (0 === depth) {
  	          parentInstance.removeChild(nextNode);
  	          retryIfBlockedOn(hydrationInstance);
  	          return;
  	        }
  	        depth--;
  	      } else if (
  	        "$" === node ||
  	        "$?" === node ||
  	        "$~" === node ||
  	        "$!" === node ||
  	        "&" === node
  	      )
  	        depth++;
  	      else if ("html" === node)
  	        releaseSingletonInstance(parentInstance.ownerDocument.documentElement);
  	      else if ("head" === node) {
  	        node = parentInstance.ownerDocument.head;
  	        releaseSingletonInstance(node);
  	        for (var node$jscomp$0 = node.firstChild; node$jscomp$0; ) {
  	          var nextNode$jscomp$0 = node$jscomp$0.nextSibling,
  	            nodeName = node$jscomp$0.nodeName;
  	          node$jscomp$0[internalHoistableMarker] ||
  	            "SCRIPT" === nodeName ||
  	            "STYLE" === nodeName ||
  	            ("LINK" === nodeName &&
  	              "stylesheet" === node$jscomp$0.rel.toLowerCase()) ||
  	            node.removeChild(node$jscomp$0);
  	          node$jscomp$0 = nextNode$jscomp$0;
  	        }
  	      } else
  	        "body" === node &&
  	          releaseSingletonInstance(parentInstance.ownerDocument.body);
  	    node = nextNode;
  	  } while (node);
  	  retryIfBlockedOn(hydrationInstance);
  	}
  	function hideOrUnhideDehydratedBoundary(suspenseInstance, isHidden) {
  	  var node = suspenseInstance;
  	  suspenseInstance = 0;
  	  do {
  	    var nextNode = node.nextSibling;
  	    1 === node.nodeType
  	      ? isHidden
  	        ? ((node._stashedDisplay = node.style.display),
  	          (node.style.display = "none"))
  	        : ((node.style.display = node._stashedDisplay || ""),
  	          "" === node.getAttribute("style") && node.removeAttribute("style"))
  	      : 3 === node.nodeType &&
  	        (isHidden
  	          ? ((node._stashedText = node.nodeValue), (node.nodeValue = ""))
  	          : (node.nodeValue = node._stashedText || ""));
  	    if (nextNode && 8 === nextNode.nodeType)
  	      if (((node = nextNode.data), "/$" === node))
  	        if (0 === suspenseInstance) break;
  	        else suspenseInstance--;
  	      else
  	        ("$" !== node && "$?" !== node && "$~" !== node && "$!" !== node) ||
  	          suspenseInstance++;
  	    node = nextNode;
  	  } while (node);
  	}
  	function clearContainerSparingly(container) {
  	  var nextNode = container.firstChild;
  	  nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling);
  	  for (; nextNode; ) {
  	    var node = nextNode;
  	    nextNode = nextNode.nextSibling;
  	    switch (node.nodeName) {
  	      case "HTML":
  	      case "HEAD":
  	      case "BODY":
  	        clearContainerSparingly(node);
  	        detachDeletedInstance(node);
  	        continue;
  	      case "SCRIPT":
  	      case "STYLE":
  	        continue;
  	      case "LINK":
  	        if ("stylesheet" === node.rel.toLowerCase()) continue;
  	    }
  	    container.removeChild(node);
  	  }
  	}
  	function canHydrateInstance(instance, type, props, inRootOrSingleton) {
  	  for (; 1 === instance.nodeType; ) {
  	    var anyProps = props;
  	    if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
  	      if (
  	        !inRootOrSingleton &&
  	        ("INPUT" !== instance.nodeName || "hidden" !== instance.type)
  	      )
  	        break;
  	    } else if (!inRootOrSingleton)
  	      if ("input" === type && "hidden" === instance.type) {
  	        var name = null == anyProps.name ? null : "" + anyProps.name;
  	        if (
  	          "hidden" === anyProps.type &&
  	          instance.getAttribute("name") === name
  	        )
  	          return instance;
  	      } else return instance;
  	    else if (!instance[internalHoistableMarker])
  	      switch (type) {
  	        case "meta":
  	          if (!instance.hasAttribute("itemprop")) break;
  	          return instance;
  	        case "link":
  	          name = instance.getAttribute("rel");
  	          if ("stylesheet" === name && instance.hasAttribute("data-precedence"))
  	            break;
  	          else if (
  	            name !== anyProps.rel ||
  	            instance.getAttribute("href") !==
  	              (null == anyProps.href || "" === anyProps.href
  	                ? null
  	                : anyProps.href) ||
  	            instance.getAttribute("crossorigin") !==
  	              (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) ||
  	            instance.getAttribute("title") !==
  	              (null == anyProps.title ? null : anyProps.title)
  	          )
  	            break;
  	          return instance;
  	        case "style":
  	          if (instance.hasAttribute("data-precedence")) break;
  	          return instance;
  	        case "script":
  	          name = instance.getAttribute("src");
  	          if (
  	            (name !== (null == anyProps.src ? null : anyProps.src) ||
  	              instance.getAttribute("type") !==
  	                (null == anyProps.type ? null : anyProps.type) ||
  	              instance.getAttribute("crossorigin") !==
  	                (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) &&
  	            name &&
  	            instance.hasAttribute("async") &&
  	            !instance.hasAttribute("itemprop")
  	          )
  	            break;
  	          return instance;
  	        default:
  	          return instance;
  	      }
  	    instance = getNextHydratable(instance.nextSibling);
  	    if (null === instance) break;
  	  }
  	  return null;
  	}
  	function canHydrateTextInstance(instance, text, inRootOrSingleton) {
  	  if ("" === text) return null;
  	  for (; 3 !== instance.nodeType; ) {
  	    if (
  	      (1 !== instance.nodeType ||
  	        "INPUT" !== instance.nodeName ||
  	        "hidden" !== instance.type) &&
  	      !inRootOrSingleton
  	    )
  	      return null;
  	    instance = getNextHydratable(instance.nextSibling);
  	    if (null === instance) return null;
  	  }
  	  return instance;
  	}
  	function canHydrateHydrationBoundary(instance, inRootOrSingleton) {
  	  for (; 8 !== instance.nodeType; ) {
  	    if (
  	      (1 !== instance.nodeType ||
  	        "INPUT" !== instance.nodeName ||
  	        "hidden" !== instance.type) &&
  	      !inRootOrSingleton
  	    )
  	      return null;
  	    instance = getNextHydratable(instance.nextSibling);
  	    if (null === instance) return null;
  	  }
  	  return instance;
  	}
  	function isSuspenseInstancePending(instance) {
  	  return "$?" === instance.data || "$~" === instance.data;
  	}
  	function isSuspenseInstanceFallback(instance) {
  	  return (
  	    "$!" === instance.data ||
  	    ("$?" === instance.data && "loading" !== instance.ownerDocument.readyState)
  	  );
  	}
  	function registerSuspenseInstanceRetry(instance, callback) {
  	  var ownerDocument = instance.ownerDocument;
  	  if ("$~" === instance.data) instance._reactRetry = callback;
  	  else if ("$?" !== instance.data || "loading" !== ownerDocument.readyState)
  	    callback();
  	  else {
  	    var listener = function () {
  	      callback();
  	      ownerDocument.removeEventListener("DOMContentLoaded", listener);
  	    };
  	    ownerDocument.addEventListener("DOMContentLoaded", listener);
  	    instance._reactRetry = listener;
  	  }
  	}
  	function getNextHydratable(node) {
  	  for (; null != node; node = node.nextSibling) {
  	    var nodeType = node.nodeType;
  	    if (1 === nodeType || 3 === nodeType) break;
  	    if (8 === nodeType) {
  	      nodeType = node.data;
  	      if (
  	        "$" === nodeType ||
  	        "$!" === nodeType ||
  	        "$?" === nodeType ||
  	        "$~" === nodeType ||
  	        "&" === nodeType ||
  	        "F!" === nodeType ||
  	        "F" === nodeType
  	      )
  	        break;
  	      if ("/$" === nodeType || "/&" === nodeType) return null;
  	    }
  	  }
  	  return node;
  	}
  	var previousHydratableOnEnteringScopedSingleton = null;
  	function getNextHydratableInstanceAfterHydrationBoundary(hydrationInstance) {
  	  hydrationInstance = hydrationInstance.nextSibling;
  	  for (var depth = 0; hydrationInstance; ) {
  	    if (8 === hydrationInstance.nodeType) {
  	      var data = hydrationInstance.data;
  	      if ("/$" === data || "/&" === data) {
  	        if (0 === depth)
  	          return getNextHydratable(hydrationInstance.nextSibling);
  	        depth--;
  	      } else
  	        ("$" !== data &&
  	          "$!" !== data &&
  	          "$?" !== data &&
  	          "$~" !== data &&
  	          "&" !== data) ||
  	          depth++;
  	    }
  	    hydrationInstance = hydrationInstance.nextSibling;
  	  }
  	  return null;
  	}
  	function getParentHydrationBoundary(targetInstance) {
  	  targetInstance = targetInstance.previousSibling;
  	  for (var depth = 0; targetInstance; ) {
  	    if (8 === targetInstance.nodeType) {
  	      var data = targetInstance.data;
  	      if (
  	        "$" === data ||
  	        "$!" === data ||
  	        "$?" === data ||
  	        "$~" === data ||
  	        "&" === data
  	      ) {
  	        if (0 === depth) return targetInstance;
  	        depth--;
  	      } else ("/$" !== data && "/&" !== data) || depth++;
  	    }
  	    targetInstance = targetInstance.previousSibling;
  	  }
  	  return null;
  	}
  	function resolveSingletonInstance(type, props, rootContainerInstance) {
  	  props = getOwnerDocumentFromRootContainer(rootContainerInstance);
  	  switch (type) {
  	    case "html":
  	      type = props.documentElement;
  	      if (!type) throw Error(formatProdErrorMessage(452));
  	      return type;
  	    case "head":
  	      type = props.head;
  	      if (!type) throw Error(formatProdErrorMessage(453));
  	      return type;
  	    case "body":
  	      type = props.body;
  	      if (!type) throw Error(formatProdErrorMessage(454));
  	      return type;
  	    default:
  	      throw Error(formatProdErrorMessage(451));
  	  }
  	}
  	function releaseSingletonInstance(instance) {
  	  for (var attributes = instance.attributes; attributes.length; )
  	    instance.removeAttributeNode(attributes[0]);
  	  detachDeletedInstance(instance);
  	}
  	var preloadPropsMap = new Map(),
  	  preconnectsSet = new Set();
  	function getHoistableRoot(container) {
  	  return "function" === typeof container.getRootNode
  	    ? container.getRootNode()
  	    : 9 === container.nodeType
  	      ? container
  	      : container.ownerDocument;
  	}
  	var previousDispatcher = ReactDOMSharedInternals.d;
  	ReactDOMSharedInternals.d = {
  	  f: flushSyncWork,
  	  r: requestFormReset,
  	  D: prefetchDNS,
  	  C: preconnect,
  	  L: preload,
  	  m: preloadModule,
  	  X: preinitScript,
  	  S: preinitStyle,
  	  M: preinitModuleScript
  	};
  	function flushSyncWork() {
  	  var previousWasRendering = previousDispatcher.f(),
  	    wasRendering = flushSyncWork$1();
  	  return previousWasRendering || wasRendering;
  	}
  	function requestFormReset(form) {
  	  var formInst = getInstanceFromNode(form);
  	  null !== formInst && 5 === formInst.tag && "form" === formInst.type
  	    ? requestFormReset$1(formInst)
  	    : previousDispatcher.r(form);
  	}
  	var globalDocument = "undefined" === typeof document ? null : document;
  	function preconnectAs(rel, href, crossOrigin) {
  	  var ownerDocument = globalDocument;
  	  if (ownerDocument && "string" === typeof href && href) {
  	    var limitedEscapedHref =
  	      escapeSelectorAttributeValueInsideDoubleQuotes(href);
  	    limitedEscapedHref =
  	      'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]';
  	    "string" === typeof crossOrigin &&
  	      (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]');
  	    preconnectsSet.has(limitedEscapedHref) ||
  	      (preconnectsSet.add(limitedEscapedHref),
  	      (rel = { rel: rel, crossOrigin: crossOrigin, href: href }),
  	      null === ownerDocument.querySelector(limitedEscapedHref) &&
  	        ((href = ownerDocument.createElement("link")),
  	        setInitialProperties(href, "link", rel),
  	        markNodeAsHoistable(href),
  	        ownerDocument.head.appendChild(href)));
  	  }
  	}
  	function prefetchDNS(href) {
  	  previousDispatcher.D(href);
  	  preconnectAs("dns-prefetch", href, null);
  	}
  	function preconnect(href, crossOrigin) {
  	  previousDispatcher.C(href, crossOrigin);
  	  preconnectAs("preconnect", href, crossOrigin);
  	}
  	function preload(href, as, options) {
  	  previousDispatcher.L(href, as, options);
  	  var ownerDocument = globalDocument;
  	  if (ownerDocument && href && as) {
  	    var preloadSelector =
  	      'link[rel="preload"][as="' +
  	      escapeSelectorAttributeValueInsideDoubleQuotes(as) +
  	      '"]';
  	    "image" === as
  	      ? options && options.imageSrcSet
  	        ? ((preloadSelector +=
  	            '[imagesrcset="' +
  	            escapeSelectorAttributeValueInsideDoubleQuotes(
  	              options.imageSrcSet
  	            ) +
  	            '"]'),
  	          "string" === typeof options.imageSizes &&
  	            (preloadSelector +=
  	              '[imagesizes="' +
  	              escapeSelectorAttributeValueInsideDoubleQuotes(
  	                options.imageSizes
  	              ) +
  	              '"]'))
  	        : (preloadSelector +=
  	            '[href="' +
  	            escapeSelectorAttributeValueInsideDoubleQuotes(href) +
  	            '"]')
  	      : (preloadSelector +=
  	          '[href="' +
  	          escapeSelectorAttributeValueInsideDoubleQuotes(href) +
  	          '"]');
  	    var key = preloadSelector;
  	    switch (as) {
  	      case "style":
  	        key = getStyleKey(href);
  	        break;
  	      case "script":
  	        key = getScriptKey(href);
  	    }
  	    preloadPropsMap.has(key) ||
  	      ((href = assign(
  	        {
  	          rel: "preload",
  	          href:
  	            "image" === as && options && options.imageSrcSet ? void 0 : href,
  	          as: as
  	        },
  	        options
  	      )),
  	      preloadPropsMap.set(key, href),
  	      null !== ownerDocument.querySelector(preloadSelector) ||
  	        ("style" === as &&
  	          ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) ||
  	        ("script" === as &&
  	          ownerDocument.querySelector(getScriptSelectorFromKey(key))) ||
  	        ((as = ownerDocument.createElement("link")),
  	        setInitialProperties(as, "link", href),
  	        markNodeAsHoistable(as),
  	        ownerDocument.head.appendChild(as)));
  	  }
  	}
  	function preloadModule(href, options) {
  	  previousDispatcher.m(href, options);
  	  var ownerDocument = globalDocument;
  	  if (ownerDocument && href) {
  	    var as = options && "string" === typeof options.as ? options.as : "script",
  	      preloadSelector =
  	        'link[rel="modulepreload"][as="' +
  	        escapeSelectorAttributeValueInsideDoubleQuotes(as) +
  	        '"][href="' +
  	        escapeSelectorAttributeValueInsideDoubleQuotes(href) +
  	        '"]',
  	      key = preloadSelector;
  	    switch (as) {
  	      case "audioworklet":
  	      case "paintworklet":
  	      case "serviceworker":
  	      case "sharedworker":
  	      case "worker":
  	      case "script":
  	        key = getScriptKey(href);
  	    }
  	    if (
  	      !preloadPropsMap.has(key) &&
  	      ((href = assign({ rel: "modulepreload", href: href }, options)),
  	      preloadPropsMap.set(key, href),
  	      null === ownerDocument.querySelector(preloadSelector))
  	    ) {
  	      switch (as) {
  	        case "audioworklet":
  	        case "paintworklet":
  	        case "serviceworker":
  	        case "sharedworker":
  	        case "worker":
  	        case "script":
  	          if (ownerDocument.querySelector(getScriptSelectorFromKey(key)))
  	            return;
  	      }
  	      as = ownerDocument.createElement("link");
  	      setInitialProperties(as, "link", href);
  	      markNodeAsHoistable(as);
  	      ownerDocument.head.appendChild(as);
  	    }
  	  }
  	}
  	function preinitStyle(href, precedence, options) {
  	  previousDispatcher.S(href, precedence, options);
  	  var ownerDocument = globalDocument;
  	  if (ownerDocument && href) {
  	    var styles = getResourcesFromRoot(ownerDocument).hoistableStyles,
  	      key = getStyleKey(href);
  	    precedence = precedence || "default";
  	    var resource = styles.get(key);
  	    if (!resource) {
  	      var state = { loading: 0, preload: null };
  	      if (
  	        (resource = ownerDocument.querySelector(
  	          getStylesheetSelectorFromKey(key)
  	        ))
  	      )
  	        state.loading = 5;
  	      else {
  	        href = assign(
  	          { rel: "stylesheet", href: href, "data-precedence": precedence },
  	          options
  	        );
  	        (options = preloadPropsMap.get(key)) &&
  	          adoptPreloadPropsForStylesheet(href, options);
  	        var link = (resource = ownerDocument.createElement("link"));
  	        markNodeAsHoistable(link);
  	        setInitialProperties(link, "link", href);
  	        link._p = new Promise(function (resolve, reject) {
  	          link.onload = resolve;
  	          link.onerror = reject;
  	        });
  	        link.addEventListener("load", function () {
  	          state.loading |= 1;
  	        });
  	        link.addEventListener("error", function () {
  	          state.loading |= 2;
  	        });
  	        state.loading |= 4;
  	        insertStylesheet(resource, precedence, ownerDocument);
  	      }
  	      resource = {
  	        type: "stylesheet",
  	        instance: resource,
  	        count: 1,
  	        state: state
  	      };
  	      styles.set(key, resource);
  	    }
  	  }
  	}
  	function preinitScript(src, options) {
  	  previousDispatcher.X(src, options);
  	  var ownerDocument = globalDocument;
  	  if (ownerDocument && src) {
  	    var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts,
  	      key = getScriptKey(src),
  	      resource = scripts.get(key);
  	    resource ||
  	      ((resource = ownerDocument.querySelector(getScriptSelectorFromKey(key))),
  	      resource ||
  	        ((src = assign({ src: src, async: true }, options)),
  	        (options = preloadPropsMap.get(key)) &&
  	          adoptPreloadPropsForScript(src, options),
  	        (resource = ownerDocument.createElement("script")),
  	        markNodeAsHoistable(resource),
  	        setInitialProperties(resource, "link", src),
  	        ownerDocument.head.appendChild(resource)),
  	      (resource = {
  	        type: "script",
  	        instance: resource,
  	        count: 1,
  	        state: null
  	      }),
  	      scripts.set(key, resource));
  	  }
  	}
  	function preinitModuleScript(src, options) {
  	  previousDispatcher.M(src, options);
  	  var ownerDocument = globalDocument;
  	  if (ownerDocument && src) {
  	    var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts,
  	      key = getScriptKey(src),
  	      resource = scripts.get(key);
  	    resource ||
  	      ((resource = ownerDocument.querySelector(getScriptSelectorFromKey(key))),
  	      resource ||
  	        ((src = assign({ src: src, async: true, type: "module" }, options)),
  	        (options = preloadPropsMap.get(key)) &&
  	          adoptPreloadPropsForScript(src, options),
  	        (resource = ownerDocument.createElement("script")),
  	        markNodeAsHoistable(resource),
  	        setInitialProperties(resource, "link", src),
  	        ownerDocument.head.appendChild(resource)),
  	      (resource = {
  	        type: "script",
  	        instance: resource,
  	        count: 1,
  	        state: null
  	      }),
  	      scripts.set(key, resource));
  	  }
  	}
  	function getResource(type, currentProps, pendingProps, currentResource) {
  	  var JSCompiler_inline_result = (JSCompiler_inline_result =
  	    rootInstanceStackCursor.current)
  	    ? getHoistableRoot(JSCompiler_inline_result)
  	    : null;
  	  if (!JSCompiler_inline_result) throw Error(formatProdErrorMessage(446));
  	  switch (type) {
  	    case "meta":
  	    case "title":
  	      return null;
  	    case "style":
  	      return "string" === typeof pendingProps.precedence &&
  	        "string" === typeof pendingProps.href
  	        ? ((currentProps = getStyleKey(pendingProps.href)),
  	          (pendingProps = getResourcesFromRoot(
  	            JSCompiler_inline_result
  	          ).hoistableStyles),
  	          (currentResource = pendingProps.get(currentProps)),
  	          currentResource ||
  	            ((currentResource = {
  	              type: "style",
  	              instance: null,
  	              count: 0,
  	              state: null
  	            }),
  	            pendingProps.set(currentProps, currentResource)),
  	          currentResource)
  	        : { type: "void", instance: null, count: 0, state: null };
  	    case "link":
  	      if (
  	        "stylesheet" === pendingProps.rel &&
  	        "string" === typeof pendingProps.href &&
  	        "string" === typeof pendingProps.precedence
  	      ) {
  	        type = getStyleKey(pendingProps.href);
  	        var styles$243 = getResourcesFromRoot(
  	            JSCompiler_inline_result
  	          ).hoistableStyles,
  	          resource$244 = styles$243.get(type);
  	        resource$244 ||
  	          ((JSCompiler_inline_result =
  	            JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result),
  	          (resource$244 = {
  	            type: "stylesheet",
  	            instance: null,
  	            count: 0,
  	            state: { loading: 0, preload: null }
  	          }),
  	          styles$243.set(type, resource$244),
  	          (styles$243 = JSCompiler_inline_result.querySelector(
  	            getStylesheetSelectorFromKey(type)
  	          )) &&
  	            !styles$243._p &&
  	            ((resource$244.instance = styles$243),
  	            (resource$244.state.loading = 5)),
  	          preloadPropsMap.has(type) ||
  	            ((pendingProps = {
  	              rel: "preload",
  	              as: "style",
  	              href: pendingProps.href,
  	              crossOrigin: pendingProps.crossOrigin,
  	              integrity: pendingProps.integrity,
  	              media: pendingProps.media,
  	              hrefLang: pendingProps.hrefLang,
  	              referrerPolicy: pendingProps.referrerPolicy
  	            }),
  	            preloadPropsMap.set(type, pendingProps),
  	            styles$243 ||
  	              preloadStylesheet(
  	                JSCompiler_inline_result,
  	                type,
  	                pendingProps,
  	                resource$244.state
  	              )));
  	        if (currentProps && null === currentResource)
  	          throw Error(formatProdErrorMessage(528, ""));
  	        return resource$244;
  	      }
  	      if (currentProps && null !== currentResource)
  	        throw Error(formatProdErrorMessage(529, ""));
  	      return null;
  	    case "script":
  	      return (
  	        (currentProps = pendingProps.async),
  	        (pendingProps = pendingProps.src),
  	        "string" === typeof pendingProps &&
  	        currentProps &&
  	        "function" !== typeof currentProps &&
  	        "symbol" !== typeof currentProps
  	          ? ((currentProps = getScriptKey(pendingProps)),
  	            (pendingProps = getResourcesFromRoot(
  	              JSCompiler_inline_result
  	            ).hoistableScripts),
  	            (currentResource = pendingProps.get(currentProps)),
  	            currentResource ||
  	              ((currentResource = {
  	                type: "script",
  	                instance: null,
  	                count: 0,
  	                state: null
  	              }),
  	              pendingProps.set(currentProps, currentResource)),
  	            currentResource)
  	          : { type: "void", instance: null, count: 0, state: null }
  	      );
  	    default:
  	      throw Error(formatProdErrorMessage(444, type));
  	  }
  	}
  	function getStyleKey(href) {
  	  return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"';
  	}
  	function getStylesheetSelectorFromKey(key) {
  	  return 'link[rel="stylesheet"][' + key + "]";
  	}
  	function stylesheetPropsFromRawProps(rawProps) {
  	  return assign({}, rawProps, {
  	    "data-precedence": rawProps.precedence,
  	    precedence: null
  	  });
  	}
  	function preloadStylesheet(ownerDocument, key, preloadProps, state) {
  	  ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]")
  	    ? (state.loading = 1)
  	    : ((key = ownerDocument.createElement("link")),
  	      (state.preload = key),
  	      key.addEventListener("load", function () {
  	        return (state.loading |= 1);
  	      }),
  	      key.addEventListener("error", function () {
  	        return (state.loading |= 2);
  	      }),
  	      setInitialProperties(key, "link", preloadProps),
  	      markNodeAsHoistable(key),
  	      ownerDocument.head.appendChild(key));
  	}
  	function getScriptKey(src) {
  	  return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
  	}
  	function getScriptSelectorFromKey(key) {
  	  return "script[async]" + key;
  	}
  	function acquireResource(hoistableRoot, resource, props) {
  	  resource.count++;
  	  if (null === resource.instance)
  	    switch (resource.type) {
  	      case "style":
  	        var instance = hoistableRoot.querySelector(
  	          'style[data-href~="' +
  	            escapeSelectorAttributeValueInsideDoubleQuotes(props.href) +
  	            '"]'
  	        );
  	        if (instance)
  	          return (
  	            (resource.instance = instance),
  	            markNodeAsHoistable(instance),
  	            instance
  	          );
  	        var styleProps = assign({}, props, {
  	          "data-href": props.href,
  	          "data-precedence": props.precedence,
  	          href: null,
  	          precedence: null
  	        });
  	        instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement(
  	          "style"
  	        );
  	        markNodeAsHoistable(instance);
  	        setInitialProperties(instance, "style", styleProps);
  	        insertStylesheet(instance, props.precedence, hoistableRoot);
  	        return (resource.instance = instance);
  	      case "stylesheet":
  	        styleProps = getStyleKey(props.href);
  	        var instance$249 = hoistableRoot.querySelector(
  	          getStylesheetSelectorFromKey(styleProps)
  	        );
  	        if (instance$249)
  	          return (
  	            (resource.state.loading |= 4),
  	            (resource.instance = instance$249),
  	            markNodeAsHoistable(instance$249),
  	            instance$249
  	          );
  	        instance = stylesheetPropsFromRawProps(props);
  	        (styleProps = preloadPropsMap.get(styleProps)) &&
  	          adoptPreloadPropsForStylesheet(instance, styleProps);
  	        instance$249 = (
  	          hoistableRoot.ownerDocument || hoistableRoot
  	        ).createElement("link");
  	        markNodeAsHoistable(instance$249);
  	        var linkInstance = instance$249;
  	        linkInstance._p = new Promise(function (resolve, reject) {
  	          linkInstance.onload = resolve;
  	          linkInstance.onerror = reject;
  	        });
  	        setInitialProperties(instance$249, "link", instance);
  	        resource.state.loading |= 4;
  	        insertStylesheet(instance$249, props.precedence, hoistableRoot);
  	        return (resource.instance = instance$249);
  	      case "script":
  	        instance$249 = getScriptKey(props.src);
  	        if (
  	          (styleProps = hoistableRoot.querySelector(
  	            getScriptSelectorFromKey(instance$249)
  	          ))
  	        )
  	          return (
  	            (resource.instance = styleProps),
  	            markNodeAsHoistable(styleProps),
  	            styleProps
  	          );
  	        instance = props;
  	        if ((styleProps = preloadPropsMap.get(instance$249)))
  	          (instance = assign({}, props)),
  	            adoptPreloadPropsForScript(instance, styleProps);
  	        hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
  	        styleProps = hoistableRoot.createElement("script");
  	        markNodeAsHoistable(styleProps);
  	        setInitialProperties(styleProps, "link", instance);
  	        hoistableRoot.head.appendChild(styleProps);
  	        return (resource.instance = styleProps);
  	      case "void":
  	        return null;
  	      default:
  	        throw Error(formatProdErrorMessage(443, resource.type));
  	    }
  	  else
  	    "stylesheet" === resource.type &&
  	      0 === (resource.state.loading & 4) &&
  	      ((instance = resource.instance),
  	      (resource.state.loading |= 4),
  	      insertStylesheet(instance, props.precedence, hoistableRoot));
  	  return resource.instance;
  	}
  	function insertStylesheet(instance, precedence, root) {
  	  for (
  	    var nodes = root.querySelectorAll(
  	        'link[rel="stylesheet"][data-precedence],style[data-precedence]'
  	      ),
  	      last = nodes.length ? nodes[nodes.length - 1] : null,
  	      prior = last,
  	      i = 0;
  	    i < nodes.length;
  	    i++
  	  ) {
  	    var node = nodes[i];
  	    if (node.dataset.precedence === precedence) prior = node;
  	    else if (prior !== last) break;
  	  }
  	  prior
  	    ? prior.parentNode.insertBefore(instance, prior.nextSibling)
  	    : ((precedence = 9 === root.nodeType ? root.head : root),
  	      precedence.insertBefore(instance, precedence.firstChild));
  	}
  	function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) {
  	  null == stylesheetProps.crossOrigin &&
  	    (stylesheetProps.crossOrigin = preloadProps.crossOrigin);
  	  null == stylesheetProps.referrerPolicy &&
  	    (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy);
  	  null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title);
  	}
  	function adoptPreloadPropsForScript(scriptProps, preloadProps) {
  	  null == scriptProps.crossOrigin &&
  	    (scriptProps.crossOrigin = preloadProps.crossOrigin);
  	  null == scriptProps.referrerPolicy &&
  	    (scriptProps.referrerPolicy = preloadProps.referrerPolicy);
  	  null == scriptProps.integrity &&
  	    (scriptProps.integrity = preloadProps.integrity);
  	}
  	var tagCaches = null;
  	function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
  	  if (null === tagCaches) {
  	    var cache = new Map();
  	    var caches = (tagCaches = new Map());
  	    caches.set(ownerDocument, cache);
  	  } else
  	    (caches = tagCaches),
  	      (cache = caches.get(ownerDocument)),
  	      cache || ((cache = new Map()), caches.set(ownerDocument, cache));
  	  if (cache.has(type)) return cache;
  	  cache.set(type, null);
  	  ownerDocument = ownerDocument.getElementsByTagName(type);
  	  for (caches = 0; caches < ownerDocument.length; caches++) {
  	    var node = ownerDocument[caches];
  	    if (
  	      !(
  	        node[internalHoistableMarker] ||
  	        node[internalInstanceKey] ||
  	        ("link" === type && "stylesheet" === node.getAttribute("rel"))
  	      ) &&
  	      "http://www.w3.org/2000/svg" !== node.namespaceURI
  	    ) {
  	      var nodeKey = node.getAttribute(keyAttribute) || "";
  	      nodeKey = type + nodeKey;
  	      var existing = cache.get(nodeKey);
  	      existing ? existing.push(node) : cache.set(nodeKey, [node]);
  	    }
  	  }
  	  return cache;
  	}
  	function mountHoistable(hoistableRoot, type, instance) {
  	  hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
  	  hoistableRoot.head.insertBefore(
  	    instance,
  	    "title" === type ? hoistableRoot.querySelector("head > title") : null
  	  );
  	}
  	function isHostHoistableType(type, props, hostContext) {
  	  if (1 === hostContext || null != props.itemProp) return false;
  	  switch (type) {
  	    case "meta":
  	    case "title":
  	      return true;
  	    case "style":
  	      if (
  	        "string" !== typeof props.precedence ||
  	        "string" !== typeof props.href ||
  	        "" === props.href
  	      )
  	        break;
  	      return true;
  	    case "link":
  	      if (
  	        "string" !== typeof props.rel ||
  	        "string" !== typeof props.href ||
  	        "" === props.href ||
  	        props.onLoad ||
  	        props.onError
  	      )
  	        break;
  	      switch (props.rel) {
  	        case "stylesheet":
  	          return (
  	            (type = props.disabled),
  	            "string" === typeof props.precedence && null == type
  	          );
  	        default:
  	          return true;
  	      }
  	    case "script":
  	      if (
  	        props.async &&
  	        "function" !== typeof props.async &&
  	        "symbol" !== typeof props.async &&
  	        !props.onLoad &&
  	        !props.onError &&
  	        props.src &&
  	        "string" === typeof props.src
  	      )
  	        return true;
  	  }
  	  return false;
  	}
  	function preloadResource(resource) {
  	  return "stylesheet" === resource.type && 0 === (resource.state.loading & 3)
  	    ? false
  	    : true;
  	}
  	function suspendResource(state, hoistableRoot, resource, props) {
  	  if (
  	    "stylesheet" === resource.type &&
  	    ("string" !== typeof props.media ||
  	      false !== matchMedia(props.media).matches) &&
  	    0 === (resource.state.loading & 4)
  	  ) {
  	    if (null === resource.instance) {
  	      var key = getStyleKey(props.href),
  	        instance = hoistableRoot.querySelector(
  	          getStylesheetSelectorFromKey(key)
  	        );
  	      if (instance) {
  	        hoistableRoot = instance._p;
  	        null !== hoistableRoot &&
  	          "object" === typeof hoistableRoot &&
  	          "function" === typeof hoistableRoot.then &&
  	          (state.count++,
  	          (state = onUnsuspend.bind(state)),
  	          hoistableRoot.then(state, state));
  	        resource.state.loading |= 4;
  	        resource.instance = instance;
  	        markNodeAsHoistable(instance);
  	        return;
  	      }
  	      instance = hoistableRoot.ownerDocument || hoistableRoot;
  	      props = stylesheetPropsFromRawProps(props);
  	      (key = preloadPropsMap.get(key)) &&
  	        adoptPreloadPropsForStylesheet(props, key);
  	      instance = instance.createElement("link");
  	      markNodeAsHoistable(instance);
  	      var linkInstance = instance;
  	      linkInstance._p = new Promise(function (resolve, reject) {
  	        linkInstance.onload = resolve;
  	        linkInstance.onerror = reject;
  	      });
  	      setInitialProperties(instance, "link", props);
  	      resource.instance = instance;
  	    }
  	    null === state.stylesheets && (state.stylesheets = new Map());
  	    state.stylesheets.set(resource, hoistableRoot);
  	    (hoistableRoot = resource.state.preload) &&
  	      0 === (resource.state.loading & 3) &&
  	      (state.count++,
  	      (resource = onUnsuspend.bind(state)),
  	      hoistableRoot.addEventListener("load", resource),
  	      hoistableRoot.addEventListener("error", resource));
  	  }
  	}
  	var estimatedBytesWithinLimit = 0;
  	function waitForCommitToBeReady(state, timeoutOffset) {
  	  state.stylesheets &&
  	    0 === state.count &&
  	    insertSuspendedStylesheets(state, state.stylesheets);
  	  return 0 < state.count || 0 < state.imgCount
  	    ? function (commit) {
  	        var stylesheetTimer = setTimeout(function () {
  	          state.stylesheets &&
  	            insertSuspendedStylesheets(state, state.stylesheets);
  	          if (state.unsuspend) {
  	            var unsuspend = state.unsuspend;
  	            state.unsuspend = null;
  	            unsuspend();
  	          }
  	        }, 6e4 + timeoutOffset);
  	        0 < state.imgBytes &&
  	          0 === estimatedBytesWithinLimit &&
  	          (estimatedBytesWithinLimit = 62500 * estimateBandwidth());
  	        var imgTimer = setTimeout(
  	          function () {
  	            state.waitingForImages = false;
  	            if (
  	              0 === state.count &&
  	              (state.stylesheets &&
  	                insertSuspendedStylesheets(state, state.stylesheets),
  	              state.unsuspend)
  	            ) {
  	              var unsuspend = state.unsuspend;
  	              state.unsuspend = null;
  	              unsuspend();
  	            }
  	          },
  	          (state.imgBytes > estimatedBytesWithinLimit ? 50 : 800) +
  	            timeoutOffset
  	        );
  	        state.unsuspend = commit;
  	        return function () {
  	          state.unsuspend = null;
  	          clearTimeout(stylesheetTimer);
  	          clearTimeout(imgTimer);
  	        };
  	      }
  	    : null;
  	}
  	function onUnsuspend() {
  	  this.count--;
  	  if (0 === this.count && (0 === this.imgCount || !this.waitingForImages))
  	    if (this.stylesheets) insertSuspendedStylesheets(this, this.stylesheets);
  	    else if (this.unsuspend) {
  	      var unsuspend = this.unsuspend;
  	      this.unsuspend = null;
  	      unsuspend();
  	    }
  	}
  	var precedencesByRoot = null;
  	function insertSuspendedStylesheets(state, resources) {
  	  state.stylesheets = null;
  	  null !== state.unsuspend &&
  	    (state.count++,
  	    (precedencesByRoot = new Map()),
  	    resources.forEach(insertStylesheetIntoRoot, state),
  	    (precedencesByRoot = null),
  	    onUnsuspend.call(state));
  	}
  	function insertStylesheetIntoRoot(root, resource) {
  	  if (!(resource.state.loading & 4)) {
  	    var precedences = precedencesByRoot.get(root);
  	    if (precedences) var last = precedences.get(null);
  	    else {
  	      precedences = new Map();
  	      precedencesByRoot.set(root, precedences);
  	      for (
  	        var nodes = root.querySelectorAll(
  	            "link[data-precedence],style[data-precedence]"
  	          ),
  	          i = 0;
  	        i < nodes.length;
  	        i++
  	      ) {
  	        var node = nodes[i];
  	        if (
  	          "LINK" === node.nodeName ||
  	          "not all" !== node.getAttribute("media")
  	        )
  	          precedences.set(node.dataset.precedence, node), (last = node);
  	      }
  	      last && precedences.set(null, last);
  	    }
  	    nodes = resource.instance;
  	    node = nodes.getAttribute("data-precedence");
  	    i = precedences.get(node) || last;
  	    i === last && precedences.set(null, nodes);
  	    precedences.set(node, nodes);
  	    this.count++;
  	    last = onUnsuspend.bind(this);
  	    nodes.addEventListener("load", last);
  	    nodes.addEventListener("error", last);
  	    i
  	      ? i.parentNode.insertBefore(nodes, i.nextSibling)
  	      : ((root = 9 === root.nodeType ? root.head : root),
  	        root.insertBefore(nodes, root.firstChild));
  	    resource.state.loading |= 4;
  	  }
  	}
  	var HostTransitionContext = {
  	  $$typeof: REACT_CONTEXT_TYPE,
  	  Provider: null,
  	  Consumer: null,
  	  _currentValue: sharedNotPendingObject,
  	  _currentValue2: sharedNotPendingObject,
  	  _threadCount: 0
  	};
  	function FiberRootNode(
  	  containerInfo,
  	  tag,
  	  hydrate,
  	  identifierPrefix,
  	  onUncaughtError,
  	  onCaughtError,
  	  onRecoverableError,
  	  onDefaultTransitionIndicator,
  	  formState
  	) {
  	  this.tag = 1;
  	  this.containerInfo = containerInfo;
  	  this.pingCache = this.current = this.pendingChildren = null;
  	  this.timeoutHandle = -1;
  	  this.callbackNode =
  	    this.next =
  	    this.pendingContext =
  	    this.context =
  	    this.cancelPendingCommit =
  	      null;
  	  this.callbackPriority = 0;
  	  this.expirationTimes = createLaneMap(-1);
  	  this.entangledLanes =
  	    this.shellSuspendCounter =
  	    this.errorRecoveryDisabledLanes =
  	    this.expiredLanes =
  	    this.warmLanes =
  	    this.pingedLanes =
  	    this.suspendedLanes =
  	    this.pendingLanes =
  	      0;
  	  this.entanglements = createLaneMap(0);
  	  this.hiddenUpdates = createLaneMap(null);
  	  this.identifierPrefix = identifierPrefix;
  	  this.onUncaughtError = onUncaughtError;
  	  this.onCaughtError = onCaughtError;
  	  this.onRecoverableError = onRecoverableError;
  	  this.pooledCache = null;
  	  this.pooledCacheLanes = 0;
  	  this.formState = formState;
  	  this.incompleteTransitions = new Map();
  	}
  	function createFiberRoot(
  	  containerInfo,
  	  tag,
  	  hydrate,
  	  initialChildren,
  	  hydrationCallbacks,
  	  isStrictMode,
  	  identifierPrefix,
  	  formState,
  	  onUncaughtError,
  	  onCaughtError,
  	  onRecoverableError,
  	  onDefaultTransitionIndicator
  	) {
  	  containerInfo = new FiberRootNode(
  	    containerInfo,
  	    tag,
  	    hydrate,
  	    identifierPrefix,
  	    onUncaughtError,
  	    onCaughtError,
  	    onRecoverableError,
  	    onDefaultTransitionIndicator,
  	    formState
  	  );
  	  tag = 1;
  	  true === isStrictMode && (tag |= 24);
  	  isStrictMode = createFiberImplClass(3, null, null, tag);
  	  containerInfo.current = isStrictMode;
  	  isStrictMode.stateNode = containerInfo;
  	  tag = createCache();
  	  tag.refCount++;
  	  containerInfo.pooledCache = tag;
  	  tag.refCount++;
  	  isStrictMode.memoizedState = {
  	    element: initialChildren,
  	    isDehydrated: hydrate,
  	    cache: tag
  	  };
  	  initializeUpdateQueue(isStrictMode);
  	  return containerInfo;
  	}
  	function getContextForSubtree(parentComponent) {
  	  if (!parentComponent) return emptyContextObject;
  	  parentComponent = emptyContextObject;
  	  return parentComponent;
  	}
  	function updateContainerImpl(
  	  rootFiber,
  	  lane,
  	  element,
  	  container,
  	  parentComponent,
  	  callback
  	) {
  	  parentComponent = getContextForSubtree(parentComponent);
  	  null === container.context
  	    ? (container.context = parentComponent)
  	    : (container.pendingContext = parentComponent);
  	  container = createUpdate(lane);
  	  container.payload = { element: element };
  	  callback = void 0 === callback ? null : callback;
  	  null !== callback && (container.callback = callback);
  	  element = enqueueUpdate(rootFiber, container, lane);
  	  null !== element &&
  	    (scheduleUpdateOnFiber(element, rootFiber, lane),
  	    entangleTransitions(element, rootFiber, lane));
  	}
  	function markRetryLaneImpl(fiber, retryLane) {
  	  fiber = fiber.memoizedState;
  	  if (null !== fiber && null !== fiber.dehydrated) {
  	    var a = fiber.retryLane;
  	    fiber.retryLane = 0 !== a && a < retryLane ? a : retryLane;
  	  }
  	}
  	function markRetryLaneIfNotHydrated(fiber, retryLane) {
  	  markRetryLaneImpl(fiber, retryLane);
  	  (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
  	}
  	function attemptContinuousHydration(fiber) {
  	  if (13 === fiber.tag || 31 === fiber.tag) {
  	    var root = enqueueConcurrentRenderForLane(fiber, 67108864);
  	    null !== root && scheduleUpdateOnFiber(root, fiber, 67108864);
  	    markRetryLaneIfNotHydrated(fiber, 67108864);
  	  }
  	}
  	function attemptHydrationAtCurrentPriority(fiber) {
  	  if (13 === fiber.tag || 31 === fiber.tag) {
  	    var lane = requestUpdateLane();
  	    lane = getBumpedLaneForHydrationByLane(lane);
  	    var root = enqueueConcurrentRenderForLane(fiber, lane);
  	    null !== root && scheduleUpdateOnFiber(root, fiber, lane);
  	    markRetryLaneIfNotHydrated(fiber, lane);
  	  }
  	}
  	var _enabled = true;
  	function dispatchDiscreteEvent(
  	  domEventName,
  	  eventSystemFlags,
  	  container,
  	  nativeEvent
  	) {
  	  var prevTransition = ReactSharedInternals.T;
  	  ReactSharedInternals.T = null;
  	  var previousPriority = ReactDOMSharedInternals.p;
  	  try {
  	    (ReactDOMSharedInternals.p = 2),
  	      dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
  	  } finally {
  	    (ReactDOMSharedInternals.p = previousPriority),
  	      (ReactSharedInternals.T = prevTransition);
  	  }
  	}
  	function dispatchContinuousEvent(
  	  domEventName,
  	  eventSystemFlags,
  	  container,
  	  nativeEvent
  	) {
  	  var prevTransition = ReactSharedInternals.T;
  	  ReactSharedInternals.T = null;
  	  var previousPriority = ReactDOMSharedInternals.p;
  	  try {
  	    (ReactDOMSharedInternals.p = 8),
  	      dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
  	  } finally {
  	    (ReactDOMSharedInternals.p = previousPriority),
  	      (ReactSharedInternals.T = prevTransition);
  	  }
  	}
  	function dispatchEvent(
  	  domEventName,
  	  eventSystemFlags,
  	  targetContainer,
  	  nativeEvent
  	) {
  	  if (_enabled) {
  	    var blockedOn = findInstanceBlockingEvent(nativeEvent);
  	    if (null === blockedOn)
  	      dispatchEventForPluginEventSystem(
  	        domEventName,
  	        eventSystemFlags,
  	        nativeEvent,
  	        return_targetInst,
  	        targetContainer
  	      ),
  	        clearIfContinuousEvent(domEventName, nativeEvent);
  	    else if (
  	      queueIfContinuousEvent(
  	        blockedOn,
  	        domEventName,
  	        eventSystemFlags,
  	        targetContainer,
  	        nativeEvent
  	      )
  	    )
  	      nativeEvent.stopPropagation();
  	    else if (
  	      (clearIfContinuousEvent(domEventName, nativeEvent),
  	      eventSystemFlags & 4 &&
  	        -1 < discreteReplayableEvents.indexOf(domEventName))
  	    ) {
  	      for (; null !== blockedOn; ) {
  	        var fiber = getInstanceFromNode(blockedOn);
  	        if (null !== fiber)
  	          switch (fiber.tag) {
  	            case 3:
  	              fiber = fiber.stateNode;
  	              if (fiber.current.memoizedState.isDehydrated) {
  	                var lanes = getHighestPriorityLanes(fiber.pendingLanes);
  	                if (0 !== lanes) {
  	                  var root = fiber;
  	                  root.pendingLanes |= 2;
  	                  for (root.entangledLanes |= 2; lanes; ) {
  	                    var lane = 1 << (31 - clz32(lanes));
  	                    root.entanglements[1] |= lane;
  	                    lanes &= ~lane;
  	                  }
  	                  ensureRootIsScheduled(fiber);
  	                  0 === (executionContext & 6) &&
  	                    ((workInProgressRootRenderTargetTime = now() + 500),
  	                    flushSyncWorkAcrossRoots_impl(0));
  	                }
  	              }
  	              break;
  	            case 31:
  	            case 13:
  	              (root = enqueueConcurrentRenderForLane(fiber, 2)),
  	                null !== root && scheduleUpdateOnFiber(root, fiber, 2),
  	                flushSyncWork$1(),
  	                markRetryLaneIfNotHydrated(fiber, 2);
  	          }
  	        fiber = findInstanceBlockingEvent(nativeEvent);
  	        null === fiber &&
  	          dispatchEventForPluginEventSystem(
  	            domEventName,
  	            eventSystemFlags,
  	            nativeEvent,
  	            return_targetInst,
  	            targetContainer
  	          );
  	        if (fiber === blockedOn) break;
  	        blockedOn = fiber;
  	      }
  	      null !== blockedOn && nativeEvent.stopPropagation();
  	    } else
  	      dispatchEventForPluginEventSystem(
  	        domEventName,
  	        eventSystemFlags,
  	        nativeEvent,
  	        null,
  	        targetContainer
  	      );
  	  }
  	}
  	function findInstanceBlockingEvent(nativeEvent) {
  	  nativeEvent = getEventTarget(nativeEvent);
  	  return findInstanceBlockingTarget(nativeEvent);
  	}
  	var return_targetInst = null;
  	function findInstanceBlockingTarget(targetNode) {
  	  return_targetInst = null;
  	  targetNode = getClosestInstanceFromNode(targetNode);
  	  if (null !== targetNode) {
  	    var nearestMounted = getNearestMountedFiber(targetNode);
  	    if (null === nearestMounted) targetNode = null;
  	    else {
  	      var tag = nearestMounted.tag;
  	      if (13 === tag) {
  	        targetNode = getSuspenseInstanceFromFiber(nearestMounted);
  	        if (null !== targetNode) return targetNode;
  	        targetNode = null;
  	      } else if (31 === tag) {
  	        targetNode = getActivityInstanceFromFiber(nearestMounted);
  	        if (null !== targetNode) return targetNode;
  	        targetNode = null;
  	      } else if (3 === tag) {
  	        if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
  	          return 3 === nearestMounted.tag
  	            ? nearestMounted.stateNode.containerInfo
  	            : null;
  	        targetNode = null;
  	      } else nearestMounted !== targetNode && (targetNode = null);
  	    }
  	  }
  	  return_targetInst = targetNode;
  	  return null;
  	}
  	function getEventPriority(domEventName) {
  	  switch (domEventName) {
  	    case "beforetoggle":
  	    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 "toggle":
  	    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 2;
  	    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 "touchmove":
  	    case "wheel":
  	    case "mouseenter":
  	    case "mouseleave":
  	    case "pointerenter":
  	    case "pointerleave":
  	      return 8;
  	    case "message":
  	      switch (getCurrentPriorityLevel()) {
  	        case ImmediatePriority:
  	          return 2;
  	        case UserBlockingPriority:
  	          return 8;
  	        case NormalPriority$1:
  	        case LowPriority:
  	          return 32;
  	        case IdlePriority:
  	          return 268435456;
  	        default:
  	          return 32;
  	      }
  	    default:
  	      return 32;
  	  }
  	}
  	var hasScheduledReplayAttempt = false,
  	  queuedFocus = null,
  	  queuedDrag = null,
  	  queuedMouse = null,
  	  queuedPointers = new Map(),
  	  queuedPointerCaptures = new Map(),
  	  queuedExplicitHydrationTargets = [],
  	  discreteReplayableEvents =
  	    "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".split(
  	      " "
  	    );
  	function clearIfContinuousEvent(domEventName, nativeEvent) {
  	  switch (domEventName) {
  	    case "focusin":
  	    case "focusout":
  	      queuedFocus = null;
  	      break;
  	    case "dragenter":
  	    case "dragleave":
  	      queuedDrag = null;
  	      break;
  	    case "mouseover":
  	    case "mouseout":
  	      queuedMouse = null;
  	      break;
  	    case "pointerover":
  	    case "pointerout":
  	      queuedPointers.delete(nativeEvent.pointerId);
  	      break;
  	    case "gotpointercapture":
  	    case "lostpointercapture":
  	      queuedPointerCaptures.delete(nativeEvent.pointerId);
  	  }
  	}
  	function accumulateOrCreateContinuousQueuedReplayableEvent(
  	  existingQueuedEvent,
  	  blockedOn,
  	  domEventName,
  	  eventSystemFlags,
  	  targetContainer,
  	  nativeEvent
  	) {
  	  if (
  	    null === existingQueuedEvent ||
  	    existingQueuedEvent.nativeEvent !== nativeEvent
  	  )
  	    return (
  	      (existingQueuedEvent = {
  	        blockedOn: blockedOn,
  	        domEventName: domEventName,
  	        eventSystemFlags: eventSystemFlags,
  	        nativeEvent: nativeEvent,
  	        targetContainers: [targetContainer]
  	      }),
  	      null !== blockedOn &&
  	        ((blockedOn = getInstanceFromNode(blockedOn)),
  	        null !== blockedOn && attemptContinuousHydration(blockedOn)),
  	      existingQueuedEvent
  	    );
  	  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  	  blockedOn = existingQueuedEvent.targetContainers;
  	  null !== targetContainer &&
  	    -1 === blockedOn.indexOf(targetContainer) &&
  	    blockedOn.push(targetContainer);
  	  return existingQueuedEvent;
  	}
  	function queueIfContinuousEvent(
  	  blockedOn,
  	  domEventName,
  	  eventSystemFlags,
  	  targetContainer,
  	  nativeEvent
  	) {
  	  switch (domEventName) {
  	    case "focusin":
  	      return (
  	        (queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
  	          queuedFocus,
  	          blockedOn,
  	          domEventName,
  	          eventSystemFlags,
  	          targetContainer,
  	          nativeEvent
  	        )),
  	        true
  	      );
  	    case "dragenter":
  	      return (
  	        (queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
  	          queuedDrag,
  	          blockedOn,
  	          domEventName,
  	          eventSystemFlags,
  	          targetContainer,
  	          nativeEvent
  	        )),
  	        true
  	      );
  	    case "mouseover":
  	      return (
  	        (queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
  	          queuedMouse,
  	          blockedOn,
  	          domEventName,
  	          eventSystemFlags,
  	          targetContainer,
  	          nativeEvent
  	        )),
  	        true
  	      );
  	    case "pointerover":
  	      var pointerId = nativeEvent.pointerId;
  	      queuedPointers.set(
  	        pointerId,
  	        accumulateOrCreateContinuousQueuedReplayableEvent(
  	          queuedPointers.get(pointerId) || null,
  	          blockedOn,
  	          domEventName,
  	          eventSystemFlags,
  	          targetContainer,
  	          nativeEvent
  	        )
  	      );
  	      return true;
  	    case "gotpointercapture":
  	      return (
  	        (pointerId = nativeEvent.pointerId),
  	        queuedPointerCaptures.set(
  	          pointerId,
  	          accumulateOrCreateContinuousQueuedReplayableEvent(
  	            queuedPointerCaptures.get(pointerId) || null,
  	            blockedOn,
  	            domEventName,
  	            eventSystemFlags,
  	            targetContainer,
  	            nativeEvent
  	          )
  	        ),
  	        true
  	      );
  	  }
  	  return false;
  	}
  	function attemptExplicitHydrationTarget(queuedTarget) {
  	  var targetInst = getClosestInstanceFromNode(queuedTarget.target);
  	  if (null !== targetInst) {
  	    var nearestMounted = getNearestMountedFiber(targetInst);
  	    if (null !== nearestMounted)
  	      if (((targetInst = nearestMounted.tag), 13 === targetInst)) {
  	        if (
  	          ((targetInst = getSuspenseInstanceFromFiber(nearestMounted)),
  	          null !== targetInst)
  	        ) {
  	          queuedTarget.blockedOn = targetInst;
  	          runWithPriority(queuedTarget.priority, function () {
  	            attemptHydrationAtCurrentPriority(nearestMounted);
  	          });
  	          return;
  	        }
  	      } else if (31 === targetInst) {
  	        if (
  	          ((targetInst = getActivityInstanceFromFiber(nearestMounted)),
  	          null !== targetInst)
  	        ) {
  	          queuedTarget.blockedOn = targetInst;
  	          runWithPriority(queuedTarget.priority, function () {
  	            attemptHydrationAtCurrentPriority(nearestMounted);
  	          });
  	          return;
  	        }
  	      } else if (
  	        3 === targetInst &&
  	        nearestMounted.stateNode.current.memoizedState.isDehydrated
  	      ) {
  	        queuedTarget.blockedOn =
  	          3 === nearestMounted.tag
  	            ? nearestMounted.stateNode.containerInfo
  	            : null;
  	        return;
  	      }
  	  }
  	  queuedTarget.blockedOn = null;
  	}
  	function attemptReplayContinuousQueuedEvent(queuedEvent) {
  	  if (null !== queuedEvent.blockedOn) return false;
  	  for (
  	    var targetContainers = queuedEvent.targetContainers;
  	    0 < targetContainers.length;

  	  ) {
  	    var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
  	    if (null === nextBlockedOn) {
  	      nextBlockedOn = queuedEvent.nativeEvent;
  	      var nativeEventClone = new nextBlockedOn.constructor(
  	        nextBlockedOn.type,
  	        nextBlockedOn
  	      );
  	      currentReplayingEvent = nativeEventClone;
  	      nextBlockedOn.target.dispatchEvent(nativeEventClone);
  	      currentReplayingEvent = null;
  	    } else
  	      return (
  	        (targetContainers = getInstanceFromNode(nextBlockedOn)),
  	        null !== targetContainers &&
  	          attemptContinuousHydration(targetContainers),
  	        (queuedEvent.blockedOn = nextBlockedOn),
  	        false
  	      );
  	    targetContainers.shift();
  	  }
  	  return true;
  	}
  	function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
  	  attemptReplayContinuousQueuedEvent(queuedEvent) && map.delete(key);
  	}
  	function replayUnblockedEvents() {
  	  hasScheduledReplayAttempt = false;
  	  null !== queuedFocus &&
  	    attemptReplayContinuousQueuedEvent(queuedFocus) &&
  	    (queuedFocus = null);
  	  null !== queuedDrag &&
  	    attemptReplayContinuousQueuedEvent(queuedDrag) &&
  	    (queuedDrag = null);
  	  null !== queuedMouse &&
  	    attemptReplayContinuousQueuedEvent(queuedMouse) &&
  	    (queuedMouse = null);
  	  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  	  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
  	}
  	function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
  	  queuedEvent.blockedOn === unblocked &&
  	    ((queuedEvent.blockedOn = null),
  	    hasScheduledReplayAttempt ||
  	      ((hasScheduledReplayAttempt = true),
  	      Scheduler.unstable_scheduleCallback(
  	        Scheduler.unstable_NormalPriority,
  	        replayUnblockedEvents
  	      )));
  	}
  	var lastScheduledReplayQueue = null;
  	function scheduleReplayQueueIfNeeded(formReplayingQueue) {
  	  lastScheduledReplayQueue !== formReplayingQueue &&
  	    ((lastScheduledReplayQueue = formReplayingQueue),
  	    Scheduler.unstable_scheduleCallback(
  	      Scheduler.unstable_NormalPriority,
  	      function () {
  	        lastScheduledReplayQueue === formReplayingQueue &&
  	          (lastScheduledReplayQueue = null);
  	        for (var i = 0; i < formReplayingQueue.length; i += 3) {
  	          var form = formReplayingQueue[i],
  	            submitterOrAction = formReplayingQueue[i + 1],
  	            formData = formReplayingQueue[i + 2];
  	          if ("function" !== typeof submitterOrAction)
  	            if (null === findInstanceBlockingTarget(submitterOrAction || form))
  	              continue;
  	            else break;
  	          var formInst = getInstanceFromNode(form);
  	          null !== formInst &&
  	            (formReplayingQueue.splice(i, 3),
  	            (i -= 3),
  	            startHostTransition(
  	              formInst,
  	              {
  	                pending: true,
  	                data: formData,
  	                method: form.method,
  	                action: submitterOrAction
  	              },
  	              submitterOrAction,
  	              formData
  	            ));
  	        }
  	      }
  	    ));
  	}
  	function retryIfBlockedOn(unblocked) {
  	  function unblock(queuedEvent) {
  	    return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  	  }
  	  null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  	  null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  	  null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  	  queuedPointers.forEach(unblock);
  	  queuedPointerCaptures.forEach(unblock);
  	  for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) {
  	    var queuedTarget = queuedExplicitHydrationTargets[i];
  	    queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
  	  }
  	  for (
  	    ;
  	    0 < queuedExplicitHydrationTargets.length &&
  	    ((i = queuedExplicitHydrationTargets[0]), null === i.blockedOn);

  	  )
  	    attemptExplicitHydrationTarget(i),
  	      null === i.blockedOn && queuedExplicitHydrationTargets.shift();
  	  i = (unblocked.ownerDocument || unblocked).$$reactFormReplay;
  	  if (null != i)
  	    for (queuedTarget = 0; queuedTarget < i.length; queuedTarget += 3) {
  	      var form = i[queuedTarget],
  	        submitterOrAction = i[queuedTarget + 1],
  	        formProps = form[internalPropsKey] || null;
  	      if ("function" === typeof submitterOrAction)
  	        formProps || scheduleReplayQueueIfNeeded(i);
  	      else if (formProps) {
  	        var action = null;
  	        if (submitterOrAction && submitterOrAction.hasAttribute("formAction"))
  	          if (
  	            ((form = submitterOrAction),
  	            (formProps = submitterOrAction[internalPropsKey] || null))
  	          )
  	            action = formProps.formAction;
  	          else {
  	            if (null !== findInstanceBlockingTarget(form)) continue;
  	          }
  	        else action = formProps.action;
  	        "function" === typeof action
  	          ? (i[queuedTarget + 1] = action)
  	          : (i.splice(queuedTarget, 3), (queuedTarget -= 3));
  	        scheduleReplayQueueIfNeeded(i);
  	      }
  	    }
  	}
  	function defaultOnDefaultTransitionIndicator() {
  	  function handleNavigate(event) {
  	    event.canIntercept &&
  	      "react-transition" === event.info &&
  	      event.intercept({
  	        handler: function () {
  	          return new Promise(function (resolve) {
  	            return (pendingResolve = resolve);
  	          });
  	        },
  	        focusReset: "manual",
  	        scroll: "manual"
  	      });
  	  }
  	  function handleNavigateComplete() {
  	    null !== pendingResolve && (pendingResolve(), (pendingResolve = null));
  	    isCancelled || setTimeout(startFakeNavigation, 20);
  	  }
  	  function startFakeNavigation() {
  	    if (!isCancelled && !navigation.transition) {
  	      var currentEntry = navigation.currentEntry;
  	      currentEntry &&
  	        null != currentEntry.url &&
  	        navigation.navigate(currentEntry.url, {
  	          state: currentEntry.getState(),
  	          info: "react-transition",
  	          history: "replace"
  	        });
  	    }
  	  }
  	  if ("object" === typeof navigation) {
  	    var isCancelled = false,
  	      pendingResolve = null;
  	    navigation.addEventListener("navigate", handleNavigate);
  	    navigation.addEventListener("navigatesuccess", handleNavigateComplete);
  	    navigation.addEventListener("navigateerror", handleNavigateComplete);
  	    setTimeout(startFakeNavigation, 100);
  	    return function () {
  	      isCancelled = true;
  	      navigation.removeEventListener("navigate", handleNavigate);
  	      navigation.removeEventListener("navigatesuccess", handleNavigateComplete);
  	      navigation.removeEventListener("navigateerror", handleNavigateComplete);
  	      null !== pendingResolve && (pendingResolve(), (pendingResolve = null));
  	    };
  	  }
  	}
  	function ReactDOMRoot(internalRoot) {
  	  this._internalRoot = internalRoot;
  	}
  	ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render =
  	  function (children) {
  	    var root = this._internalRoot;
  	    if (null === root) throw Error(formatProdErrorMessage(409));
  	    var current = root.current,
  	      lane = requestUpdateLane();
  	    updateContainerImpl(current, lane, children, root, null, null);
  	  };
  	ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount =
  	  function () {
  	    var root = this._internalRoot;
  	    if (null !== root) {
  	      this._internalRoot = null;
  	      var container = root.containerInfo;
  	      updateContainerImpl(root.current, 2, null, root, null, null);
  	      flushSyncWork$1();
  	      container[internalContainerInstanceKey] = null;
  	    }
  	  };
  	function ReactDOMHydrationRoot(internalRoot) {
  	  this._internalRoot = internalRoot;
  	}
  	ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
  	  if (target) {
  	    var updatePriority = resolveUpdatePriority();
  	    target = { blockedOn: null, target: target, priority: updatePriority };
  	    for (
  	      var i = 0;
  	      i < queuedExplicitHydrationTargets.length &&
  	      0 !== updatePriority &&
  	      updatePriority < queuedExplicitHydrationTargets[i].priority;
  	      i++
  	    );
  	    queuedExplicitHydrationTargets.splice(i, 0, target);
  	    0 === i && attemptExplicitHydrationTarget(target);
  	  }
  	};
  	var isomorphicReactPackageVersion$jscomp$inline_1840 = React.version;
  	if (
  	  "19.2.0" !==
  	  isomorphicReactPackageVersion$jscomp$inline_1840
  	)
  	  throw Error(
  	    formatProdErrorMessage(
  	      527,
  	      isomorphicReactPackageVersion$jscomp$inline_1840,
  	      "19.2.0"
  	    )
  	  );
  	ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
  	  var fiber = componentOrElement._reactInternals;
  	  if (void 0 === fiber) {
  	    if ("function" === typeof componentOrElement.render)
  	      throw Error(formatProdErrorMessage(188));
  	    componentOrElement = Object.keys(componentOrElement).join(",");
  	    throw Error(formatProdErrorMessage(268, componentOrElement));
  	  }
  	  componentOrElement = findCurrentFiberUsingSlowPath(fiber);
  	  componentOrElement =
  	    null !== componentOrElement
  	      ? findCurrentHostFiberImpl(componentOrElement)
  	      : null;
  	  componentOrElement =
  	    null === componentOrElement ? null : componentOrElement.stateNode;
  	  return componentOrElement;
  	};
  	var internals$jscomp$inline_2347 = {
  	  bundleType: 0,
  	  version: "19.2.0",
  	  rendererPackageName: "react-dom",
  	  currentDispatcherRef: ReactSharedInternals,
  	  reconcilerVersion: "19.2.0"
  	};
  	if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
  	  var hook$jscomp$inline_2348 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  	  if (
  	    !hook$jscomp$inline_2348.isDisabled &&
  	    hook$jscomp$inline_2348.supportsFiber
  	  )
  	    try {
  	      (rendererID = hook$jscomp$inline_2348.inject(
  	        internals$jscomp$inline_2347
  	      )),
  	        (injectedHook = hook$jscomp$inline_2348);
  	    } catch (err) {}
  	}
  	reactDomClient_production.createRoot = function (container, options) {
  	  if (!isValidContainer(container)) throw Error(formatProdErrorMessage(299));
  	  var isStrictMode = false,
  	    identifierPrefix = "",
  	    onUncaughtError = defaultOnUncaughtError,
  	    onCaughtError = defaultOnCaughtError,
  	    onRecoverableError = defaultOnRecoverableError;
  	  null !== options &&
  	    void 0 !== options &&
  	    (true === options.unstable_strictMode && (isStrictMode = true),
  	    void 0 !== options.identifierPrefix &&
  	      (identifierPrefix = options.identifierPrefix),
  	    void 0 !== options.onUncaughtError &&
  	      (onUncaughtError = options.onUncaughtError),
  	    void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError),
  	    void 0 !== options.onRecoverableError &&
  	      (onRecoverableError = options.onRecoverableError));
  	  options = createFiberRoot(
  	    container,
  	    1,
  	    false,
  	    null,
  	    null,
  	    isStrictMode,
  	    identifierPrefix,
  	    null,
  	    onUncaughtError,
  	    onCaughtError,
  	    onRecoverableError,
  	    defaultOnDefaultTransitionIndicator
  	  );
  	  container[internalContainerInstanceKey] = options.current;
  	  listenToAllSupportedEvents(container);
  	  return new ReactDOMRoot(options);
  	};
  	reactDomClient_production.hydrateRoot = function (container, initialChildren, options) {
  	  if (!isValidContainer(container)) throw Error(formatProdErrorMessage(299));
  	  var isStrictMode = false,
  	    identifierPrefix = "",
  	    onUncaughtError = defaultOnUncaughtError,
  	    onCaughtError = defaultOnCaughtError,
  	    onRecoverableError = defaultOnRecoverableError,
  	    formState = null;
  	  null !== options &&
  	    void 0 !== options &&
  	    (true === options.unstable_strictMode && (isStrictMode = true),
  	    void 0 !== options.identifierPrefix &&
  	      (identifierPrefix = options.identifierPrefix),
  	    void 0 !== options.onUncaughtError &&
  	      (onUncaughtError = options.onUncaughtError),
  	    void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError),
  	    void 0 !== options.onRecoverableError &&
  	      (onRecoverableError = options.onRecoverableError),
  	    void 0 !== options.formState && (formState = options.formState));
  	  initialChildren = createFiberRoot(
  	    container,
  	    1,
  	    true,
  	    initialChildren,
  	    null != options ? options : null,
  	    isStrictMode,
  	    identifierPrefix,
  	    formState,
  	    onUncaughtError,
  	    onCaughtError,
  	    onRecoverableError,
  	    defaultOnDefaultTransitionIndicator
  	  );
  	  initialChildren.context = getContextForSubtree(null);
  	  options = initialChildren.current;
  	  isStrictMode = requestUpdateLane();
  	  isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
  	  identifierPrefix = createUpdate(isStrictMode);
  	  identifierPrefix.callback = null;
  	  enqueueUpdate(options, identifierPrefix, isStrictMode);
  	  options = isStrictMode;
  	  initialChildren.current.lanes = options;
  	  markRootUpdated$1(initialChildren, options);
  	  ensureRootIsScheduled(initialChildren);
  	  container[internalContainerInstanceKey] = initialChildren.current;
  	  listenToAllSupportedEvents(container);
  	  return new ReactDOMHydrationRoot(initialChildren);
  	};
  	reactDomClient_production.version = "19.2.0";
  	return reactDomClient_production;
  }

  var hasRequiredClient;

  function requireClient () {
  	if (hasRequiredClient) return client.exports;
  	hasRequiredClient = 1;

  	function checkDCE() {
  	  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  	  if (
  	    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
  	    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  	  ) {
  	    return;
  	  }
  	  try {
  	    // Verify that the code above has been dead code eliminated (DCE'd).
  	    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  	  } catch (err) {
  	    // DevTools shouldn't crash React, no matter what.
  	    // We should still report in case we break this code.
  	    console.error(err);
  	  }
  	}

  	{
  	  // DCE check should happen before ReactDOM bundle executes so that
  	  // DevTools can report bad minification during injection.
  	  checkDCE();
  	  client.exports = requireReactDomClient_production();
  	}
  	return client.exports;
  }

  var clientExports = requireClient();

  var jsxRuntime = {exports: {}};

  var reactJsxRuntime_production = {};

  /**
   * @license React
   * react-jsx-runtime.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */

  var hasRequiredReactJsxRuntime_production;

  function requireReactJsxRuntime_production () {
  	if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
  	hasRequiredReactJsxRuntime_production = 1;
  	var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
  	  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
  	function jsxProd(type, config, maybeKey) {
  	  var key = null;
  	  void 0 !== maybeKey && (key = "" + maybeKey);
  	  void 0 !== config.key && (key = "" + config.key);
  	  if ("key" in config) {
  	    maybeKey = {};
  	    for (var propName in config)
  	      "key" !== propName && (maybeKey[propName] = config[propName]);
  	  } else maybeKey = config;
  	  config = maybeKey.ref;
  	  return {
  	    $$typeof: REACT_ELEMENT_TYPE,
  	    type: type,
  	    key: key,
  	    ref: void 0 !== config ? config : null,
  	    props: maybeKey
  	  };
  	}
  	reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
  	reactJsxRuntime_production.jsx = jsxProd;
  	reactJsxRuntime_production.jsxs = jsxProd;
  	return reactJsxRuntime_production;
  }

  var hasRequiredJsxRuntime;

  function requireJsxRuntime () {
  	if (hasRequiredJsxRuntime) return jsxRuntime.exports;
  	hasRequiredJsxRuntime = 1;

  	{
  	  jsxRuntime.exports = requireReactJsxRuntime_production();
  	}
  	return jsxRuntime.exports;
  }

  var jsxRuntimeExports = requireJsxRuntime();

  const q = typeof window < "u" ? reactExports.useLayoutEffect : reactExports.useEffect;
  function oe(e) {
    if (e !== void 0)
      switch (typeof e) {
        case "number":
          return e;
        case "string": {
          if (e.endsWith("px"))
            return parseFloat(e);
          break;
        }
      }
  }
  function be({
    box: e,
    defaultHeight: t,
    defaultWidth: s,
    disabled: r,
    element: n,
    mode: o,
    style: i
  }) {
    const { styleHeight: f, styleWidth: l } = reactExports.useMemo(
      () => ({
        styleHeight: oe(i?.height),
        styleWidth: oe(i?.width)
      }),
      [i?.height, i?.width]
    ), [c, d] = reactExports.useState({
      height: t,
      width: s
    }), a = r || f !== void 0 || o === "only-width" || f !== void 0 && l !== void 0;
    return q(() => {
      if (n === null || a)
        return;
      const u = new ResizeObserver((b) => {
        for (const w of b) {
          const { contentRect: I, target: x } = w;
          n === x && d((m) => m.height === I.height && m.width === I.width ? m : {
            height: I.height,
            width: I.width
          });
        }
      });
      return u.observe(n, { box: e }), () => {
        u?.unobserve(n);
      };
    }, [e, a, n, f, l]), reactExports.useMemo(
      () => ({
        height: f ?? c.height,
        width: l ?? c.width
      }),
      [c, f, l]
    );
  }
  function ae(e) {
    const t = reactExports.useRef(() => {
      throw new Error("Cannot call during render.");
    });
    return q(() => {
      t.current = e;
    }, [e]), reactExports.useCallback((s) => t.current?.(s), [t]);
  }
  function Z({
    containerElement: e,
    direction: t,
    isRtl: s,
    scrollOffset: r
  }) {
    return r;
  }
  function $(e, t = "Assertion error") {
    if (!e)
      throw console.error(t), Error(t);
  }
  function Y(e, t) {
    if (e === t)
      return true;
    if (!!e != !!t || ($(e !== void 0), $(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
      return false;
    for (const s in e)
      if (!Object.is(t[s], e[s]))
        return false;
    return true;
  }
  function fe({
    cachedBounds: e,
    itemCount: t,
    itemSize: s
  }) {
    if (t === 0)
      return 0;
    if (typeof s == "number")
      return t * s;
    {
      const r = e.get(
        e.size === 0 ? 0 : e.size - 1
      );
      $(r !== void 0, "Unexpected bounds cache miss");
      const n = (r.scrollOffset + r.size) / e.size;
      return t * n;
    }
  }
  function me({
    align: e,
    cachedBounds: t,
    index: s,
    itemCount: r,
    itemSize: n,
    containerScrollOffset: o,
    containerSize: i
  }) {
    const f = fe({
      cachedBounds: t,
      itemCount: r,
      itemSize: n
    }), l = t.get(s), c = Math.max(
      0,
      Math.min(f - i, l.scrollOffset)
    ), d = Math.max(
      0,
      l.scrollOffset - i + l.size
    );
    switch (e === "smart" && (o >= d && o <= c ? e = "auto" : e = "center"), e) {
      case "start":
        return c;
      case "end":
        return d;
      case "center":
        return l.scrollOffset <= i / 2 ? 0 : l.scrollOffset + l.size / 2 >= f - i / 2 ? f - i : l.scrollOffset + l.size / 2 - i / 2;
      case "auto":
      default:
        return o >= d && o <= c ? o : o < d ? d : c;
    }
  }
  function ie({
    cachedBounds: e,
    containerScrollOffset: t,
    containerSize: s,
    itemCount: r,
    overscanCount: n
  }) {
    const o = r - 1;
    let i = 0, f = -1, l = 0, c = -1, d = 0;
    for (; d < o; ) {
      const a = e.get(d);
      if (a.scrollOffset + a.size > t)
        break;
      d++;
    }
    for (i = d, l = Math.max(0, i - n); d < o; ) {
      const a = e.get(d);
      if (a.scrollOffset + a.size >= t + s)
        break;
      d++;
    }
    return f = Math.min(o, d), c = Math.min(r - 1, f + n), i < 0 && (i = 0, f = -1, l = 0, c = -1), {
      startIndexVisible: i,
      stopIndexVisible: f,
      startIndexOverscan: l,
      stopIndexOverscan: c
    };
  }
  function we({
    itemCount: e,
    itemProps: t,
    itemSize: s
  }) {
    const r = /* @__PURE__ */ new Map();
    return {
      get(n) {
        for ($(n < e, `Invalid index ${n}`); r.size - 1 < n; ) {
          const i = r.size;
          let f;
          switch (typeof s) {
            case "function": {
              f = s(i, t);
              break;
            }
            case "number": {
              f = s;
              break;
            }
          }
          if (i === 0)
            r.set(i, {
              size: f,
              scrollOffset: 0
            });
          else {
            const l = r.get(i - 1);
            $(
              l !== void 0,
              `Unexpected bounds cache miss for index ${n}`
            ), r.set(i, {
              scrollOffset: l.scrollOffset + l.size,
              size: f
            });
          }
        }
        const o = r.get(n);
        return $(
          o !== void 0,
          `Unexpected bounds cache miss for index ${n}`
        ), o;
      },
      set(n, o) {
        r.set(n, o);
      },
      get size() {
        return r.size;
      }
    };
  }
  function Oe({
    itemCount: e,
    itemProps: t,
    itemSize: s
  }) {
    return reactExports.useMemo(
      () => we({
        itemCount: e,
        itemProps: t,
        itemSize: s
      }),
      [e, t, s]
    );
  }
  function ye({
    containerSize: e,
    itemSize: t
  }) {
    let s;
    switch (typeof t) {
      case "string": {
        $(
          t.endsWith("%"),
          `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
        ), $(
          e !== void 0,
          "Container size must be defined if a percentage item size is specified"
        ), s = e * parseInt(t) / 100;
        break;
      }
      default: {
        s = t;
        break;
      }
    }
    return s;
  }
  function ee({
    containerElement: e,
    containerStyle: t,
    defaultContainerSize: s = 0,
    direction: r,
    isRtl: n = false,
    itemCount: o,
    itemProps: i,
    itemSize: f,
    onResize: l,
    overscanCount: c
  }) {
    const [d, a] = reactExports.useState({
      startIndexVisible: 0,
      startIndexOverscan: 0,
      stopIndexVisible: -1,
      stopIndexOverscan: -1
    }), {
      startIndexVisible: u,
      startIndexOverscan: b,
      stopIndexVisible: w,
      stopIndexOverscan: I
    } = {
      startIndexVisible: Math.min(o - 1, d.startIndexVisible),
      startIndexOverscan: Math.min(o - 1, d.startIndexOverscan),
      stopIndexVisible: Math.min(o - 1, d.stopIndexVisible),
      stopIndexOverscan: Math.min(o - 1, d.stopIndexOverscan)
    }, { height: x = s, width: m = s } = be({
      defaultHeight: s ,
      defaultWidth: void 0,
      element: e,
      mode: "only-height" ,
      style: t
    }), y = reactExports.useRef({
      height: 0,
      width: 0
    }), E = x , h = ye({ containerSize: E, itemSize: f });
    reactExports.useLayoutEffect(() => {
      if (typeof l == "function") {
        const p = y.current;
        (p.height !== x || p.width !== m) && (l({ height: x, width: m }, { ...p }), p.height = x, p.width = m);
      }
    }, [x, l, m]);
    const z = Oe({
      itemCount: o,
      itemProps: i,
      itemSize: h
    }), k = reactExports.useCallback(
      (p) => z.get(p),
      [z]
    ), S = reactExports.useCallback(
      () => fe({
        cachedBounds: z,
        itemCount: o,
        itemSize: h
      }),
      [z, o, h]
    ), W = reactExports.useCallback(
      (p) => {
        const T = Z({
          containerElement: e,
          direction: r,
          isRtl: n,
          scrollOffset: p
        });
        return ie({
          cachedBounds: z,
          containerScrollOffset: T,
          containerSize: E,
          itemCount: o,
          overscanCount: c
        });
      },
      [
        z,
        e,
        E,
        r,
        n,
        o,
        c
      ]
    );
    q(() => {
      const p = (e?.scrollTop ) ?? 0;
      a(W(p));
    }, [e, r, W]), q(() => {
      if (!e)
        return;
      const p = () => {
        a((T) => {
          const { scrollLeft: R, scrollTop: v } = e, g = Z({
            containerElement: e,
            direction: r,
            isRtl: n,
            scrollOffset: v 
          }), A = ie({
            cachedBounds: z,
            containerScrollOffset: g,
            containerSize: E,
            itemCount: o,
            overscanCount: c
          });
          return Y(A, T) ? T : A;
        });
      };
      return e.addEventListener("scroll", p), () => {
        e.removeEventListener("scroll", p);
      };
    }, [
      z,
      e,
      E,
      r,
      o,
      c
    ]);
    const O = ae(
      ({
        align: p = "auto",
        containerScrollOffset: T,
        index: R
      }) => {
        let v = me({
          align: p,
          cachedBounds: z,
          containerScrollOffset: T,
          containerSize: E,
          index: R,
          itemCount: o,
          itemSize: h
        });
        if (e) {
          if (v = Z({
            containerElement: e,
            direction: r,
            isRtl: n,
            scrollOffset: v
          }), typeof e.scrollTo != "function") {
            const g = W(v);
            Y(d, g) || a(g);
          }
          return v;
        }
      }
    );
    return {
      getCellBounds: k,
      getEstimatedSize: S,
      scrollToIndex: O,
      startIndexOverscan: b,
      startIndexVisible: u,
      stopIndexOverscan: I,
      stopIndexVisible: w
    };
  }
  function de(e) {
    return reactExports.useMemo(() => e, Object.values(e));
  }
  function ue(e, t) {
    const {
      ariaAttributes: s,
      style: r,
      ...n
    } = e, {
      ariaAttributes: o,
      style: i,
      ...f
    } = t;
    return Y(s, o) && Y(r, i) && Y(n, f);
  }
  function ze(e) {
    return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
  }
  const te = "data-react-window-index";
  function Ae({
    children: e,
    className: t,
    defaultHeight: s = 0,
    listRef: r,
    onResize: n,
    onRowsRendered: o,
    overscanCount: i = 3,
    rowComponent: f,
    rowCount: l,
    rowHeight: c,
    rowProps: d,
    tagName: a = "div",
    style: u,
    ...b
  }) {
    const w = de(d), I = reactExports.useMemo(
      () => reactExports.memo(f, ue),
      [f]
    ), [x, m] = reactExports.useState(null), y = ze(c), E = reactExports.useMemo(() => y ? (v) => c.getRowHeight(v) ?? c.getAverageRowHeight() : c, [y, c]), {
      getCellBounds: h,
      getEstimatedSize: z,
      scrollToIndex: k,
      startIndexOverscan: S,
      startIndexVisible: W,
      stopIndexOverscan: O,
      stopIndexVisible: p
    } = ee({
      containerElement: x,
      containerStyle: u,
      defaultContainerSize: s,
      direction: "vertical",
      itemCount: l,
      itemProps: w,
      itemSize: E,
      onResize: n,
      overscanCount: i
    });
    reactExports.useImperativeHandle(
      r,
      () => ({
        get element() {
          return x;
        },
        scrollToRow({
          align: v = "auto",
          behavior: g = "auto",
          index: A
        }) {
          const M = k({
            align: v,
            containerScrollOffset: x?.scrollTop ?? 0,
            index: A
          });
          typeof x?.scrollTo == "function" && x.scrollTo({
            behavior: g,
            top: M
          });
        }
      }),
      [x, k]
    ), q(() => {
      if (!x)
        return;
      const v = Array.from(x.children).filter((g, A) => {
        if (g.hasAttribute("aria-hidden"))
          return false;
        const M = `${S + A}`;
        return g.setAttribute(te, M), true;
      });
      if (y)
        return c.observeRowElements(v);
    }, [
      x,
      y,
      c,
      S,
      O
    ]), reactExports.useEffect(() => {
      S >= 0 && O >= 0 && o && o(
        {
          startIndex: W,
          stopIndex: p
        },
        {
          startIndex: S,
          stopIndex: O
        }
      );
    }, [
      o,
      S,
      W,
      O,
      p
    ]);
    const T = reactExports.useMemo(() => {
      const v = [];
      if (l > 0)
        for (let g = S; g <= O; g++) {
          const A = h(g);
          v.push(
            /* @__PURE__ */ reactExports.createElement(
              I,
              {
                ...w,
                ariaAttributes: {
                  "aria-posinset": g + 1,
                  "aria-setsize": l,
                  role: "listitem"
                },
                key: g,
                index: g,
                style: {
                  position: "absolute",
                  left: 0,
                  transform: `translateY(${A.scrollOffset}px)`,
                  // In case of dynamic row heights, don't specify a height style
                  // otherwise a default/estimated height would mask the actual height
                  height: y ? void 0 : A.size,
                  width: "100%"
                }
              }
            )
          );
        }
      return v;
    }, [
      I,
      h,
      y,
      l,
      w,
      S,
      O
    ]), R = /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        "aria-hidden": true,
        style: {
          height: z(),
          width: "100%",
          zIndex: -1
        }
      }
    );
    return reactExports.createElement(
      a,
      {
        role: "list",
        ...b,
        className: t,
        ref: m,
        style: {
          position: "relative",
          maxHeight: "100%",
          flexGrow: 1,
          overflowY: "auto",
          ...u
        }
      },
      T,
      e,
      R
    );
  }

  /* globals GM */
  function Explorer(root, hooks) {
    function runHooks(name, ...args) {
      if (!(name in hooks)) {
        return;
      }
      if (!Array.isArray(hooks[name])) {
        hooks[name] = [hooks[name]];
      }
      return Promise.all(hooks[name].map(f => f(...args)));
    }
    const AlbumListComponent = /*#__PURE__*/reactExports.memo(function AlbumListComponent({
      index,
      style,
      library
    }) {
      const tralbum = library[Object.keys(library)[index]];
      const handleAlbumClick = reactExports.useCallback(ev => {
        const targetStyle = ev.target.style;
        targetStyle.cursor = document.body.style.cursor = 'wait';
        const url = tralbum.url;
        window.setTimeout(() => {
          runHooks('playAlbumFromUrl', url).then(() => {
            targetStyle.cursor = document.body.style.cursor = '';
          });
        }, 1);
      }, [tralbum]);
      const handleContextMenu = reactExports.useCallback(ev => {
        ev.preventDefault();
        ev.target.classList.add('selected');
        const url = tralbum.url;
        if (!window.confirm(`Delete album "${tralbum.current.title}" by ${tralbum.artist}?`)) {
          ev.target.classList.remove('selected');
          return;
        }
        window.setTimeout(() => {
          runHooks('deletePermanentTralbum', url).then(() => {
            ev.target.classList.remove('selected');
            ev.target.style.visibility = 'hidden';
          });
        }, 1);
      }, [tralbum]);
      return /*#__PURE__*/reactExports.createElement("div", {
        className: `albumListItem ${index % 2 ? 'albumListItemOdd' : ''}`,
        onClick: handleAlbumClick,
        onContextMenu: handleContextMenu,
        title: "Click to play",
        style: style
      }, tralbum.artist, " - ", tralbum.current.title);
    });
    class AlbumList extends reactExports.Component {
      constructor(props) {
        super(props);
        this.state = {
          library: {},
          isLoading: false,
          error: null
        };
        if (!this.props.getKey) throw Error('<AlbumList> needs a getKey property');
      }
      componentDidMount() {
        this.setState({
          isLoading: true
        });
        GM.getValue(this.props.getKey, '{}').then(s => JSON.parse(s)).then(data => this.setState({
          library: data,
          isLoading: false
        })).catch(error => this.setState({
          error,
          isLoading: false
        }));
      }
      render() {
        const {
          library,
          isLoading,
          error
        } = this.state;
        if (error) return /*#__PURE__*/reactExports.createElement("p", null, error.message);
        if (isLoading) return /*#__PURE__*/reactExports.createElement("p", null, "Loading ...");
        const rowCount = Object.keys(library).length;
        return /*#__PURE__*/reactExports.createElement(Ae, {
          className: "List",
          height: 600,
          rowCount: rowCount,
          rowHeight: 35,
          rowComponent: AlbumListComponent,
          rowProps: {
            library
          } // passes to each row
        });
      }
    }
    this.render = function () {
      clientExports.createRoot(root).render(/*#__PURE__*/reactExports.createElement(AlbumList, {
        getKey: "tralbumlibrary"
      }));
    };
  }

  /* global Document, GM_addStyle, GM_addElement */

  /**
   * Waits until <head> exists (or DOM is ready) for the given document.
   */
  function ensureHead(doc = document) {
    if (doc.head) return Promise.resolve();
    if (doc.readyState === 'loading') {
      return new Promise(resolve => {
        doc.addEventListener('DOMContentLoaded', () => resolve(), {
          once: true
        });
      });
    }
    return new Promise(resolve => setTimeout(resolve)); // next tick
  }

  /**
   * Add CSS to the page or to a specific container (e.g., ShadowRoot).
   * - If `root` is provided, styles are injected there (ideal for shadow DOM).
   * - Otherwise, styles are added to <head> (or via GM_addStyle when available).
   *
   * @param {string|string[]} css                CSS string or array of CSS strings
   * @param {Object} [opts]
   * @param {Document} [opts.doc=document]       Target document (ignored if root is set)
   * @param {Element|ShadowRoot} [opts.root]     Container to receive <style> (e.g. shadowRoot or an element)
   * @param {boolean} [opts.useGM=true]          Use GM_addStyle / GM_addElement when available
   * @returns {Promise<void>}                    Resolves when injected
   */
  async function addStyle(css, opts = {}) {
    const {
      doc = document,
      root = null,
      useGM = true
    } = opts;

    // Normalize to an array of non-empty strings
    const chunks = Array.isArray(css) ? css.filter(Boolean).map(String) : css ? [String(css)] : [];
    if (chunks.length === 0) return;

    // If a root is explicitly provided (e.g., shadow DOM), inject there.
    if (root) {
      for (const chunk of chunks) {
        if (useGM && typeof GM_addElement === 'function') {
          // Works in shadow DOM too
          GM_addElement(root, 'style', {
            textContent: chunk
          });
        } else {
          const style = (root instanceof Document ? root : root.ownerDocument).createElement('style');
          style.type = 'text/css';
          style.textContent = chunk;
          root.appendChild(style);
        }
      }
      return;
    }

    // No root provided → inject into document head (or use GM_addStyle)
    if (useGM && typeof GM_addStyle === 'function' && doc === document) {
      for (const chunk of chunks) GM_addStyle(chunk);
      return;
    }
    await ensureHead(doc);
    for (const chunk of chunks) {
      const style = doc.createElement('style');
      style.type = 'text/css';
      style.textContent = chunk;
      (doc.head ?? doc.documentElement).appendChild(style);
    }
  }

  /* globals location */

  const MAX_ERRORS = 200;
  let prefix = '[ErrorReporter]';
  const _subscribers = [];
  function _notify(errors) {
    for (const fn of _subscribers) {
      try {
        fn(errors);
      } catch {}
    }
  }
  function _subscribe(fn) {
    _subscribers.push(fn);
    return () => {
      const i = _subscribers.indexOf(fn);
      if (i >= 0) _subscribers.splice(i, 1);
    };
  }

  /**
   * Initialize the ErrorReporter with a prefix for console messages.
   */
  function init(prefixString = '[ErrorReporter]') {
    prefix = prefixString;
  }

  /**
   * Store the errors array in GM storage
   */
  function persist(errors) {
    return GM.setValue('errorList', JSON.stringify(errors));
  }

  /**
   * Load the errors array from GM storage
   * @returns {Promise<Array>} The errors array
   */
  async function load() {
    const stored = await GM.getValue('errorList', '[]');
    return JSON.parse(stored);
  }

  /**
   * Clear all stored errors.
   */
  function clear() {
    return GM.setValue('errorList', '[]');
  }

  /**
   * Add an error entry to the log and persist it
   */
  function add(error, label = 'unknown') {
    console.error(`${prefix} ${label} failed:`, error);
    const entry = {
      time: new Date().toISOString(),
      label,
      message: error instanceof Error ? error.message : String(error),
      stack: error instanceof Error ? error.stack : null,
      url: location ? location.href : null
    };
    load().then(async errors => {
      errors.push(entry);
      if (errors.length > MAX_ERRORS) errors = errors.slice(-MAX_ERRORS);
      await persist(errors);
      _notify(errors);
    });
  }

  /**
   * Convert the stored error objects into a readable text log.
   * Example output:
   *
   * [2025-11-06T20:45:31.111Z] (fetchUserData) ReferenceError: user is not defined
   *   at fetchUserData (main.js:42)
   *   at <anonymous>:1:123
   *
   * [2025-11-06T20:45:32.550Z] (updateUI) TypeError: Cannot read property 'textContent' of null
   *   Page: https://bandcamp.com/album/whatever
   */
  function formatErrorsForLog(errors) {
    if (!Array.isArray(errors) || !errors.length) return 'No errors recorded.';
    return errors.slice().sort((a, b) => Date.parse(b.time || 0) - Date.parse(a.time || 0)) // newest first
    .map(e => {
      const ts = e.time || new Date().toISOString();
      const label = e.label || 'unknown';
      const message = e.message || '';
      const url = e.url ? `\n  Page: ${e.url}` : '';
      const stack = e.stack ? `\n  ${e.stack.split('\n').join('\n  ')}` : '';
      return `[${ts}] (${label}) ${message}${stack}${url}`;
    }).join('\n\n');
  }

  /**
   * Show recent errors in a modal dialog.
   */
  async function showRecentErrors() {
    addStyle(`
    .er-panel{position:fixed; z-index:999999; right:12px; bottom:12px;}
    .er-btn{cursor:pointer; padding:8px 12px; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,.15); background:#222; color:#fff; font:14px/1.2 system-ui; }
    .er-badge{display:none; margin-left:8px; background:#e11; color:#fff; border-radius:10px; padding:2px 6px; font-size:12px;}
    .er-modal{position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center;}
    .er-card{width:min(900px, 96vw); height:min(80vh, 720px); background:#fff; color:#111; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.25); display:flex; flex-direction:column;}
    .er-head{padding:12px 16px; border-bottom:1px solid #eee; display:flex; gap:8px; align-items:center; justify-content:space-between; font-weight:600;}
    .er-body{padding:10px; display:grid; grid-template-columns: 1fr 360px; gap:10px; overflow:hidden;}
    .er-list{margin:0; padding:0; list-style:none; overflow:auto; border:1px solid #eee; border-radius:8px; }
    .er-item{padding:10px 12px; border-bottom:1px solid #f1f1f1;}
    .er-item:last-child{border-bottom:0;}
    .er-topline{display:flex; gap:8px; align-items:baseline; flex-wrap:wrap;}
    .er-time{font:12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color:#666;}
    .er-label{font-weight:600;}
    .er-message{color:#c00;}
    .er-details{margin-top:6px;}
    .er-pre{margin:6px 0 0; padding:8px; background:#fafafa; border:1px solid #eee; border-radius:6px; max-height:160px; overflow:auto; font:12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;}
    .er-side{display:flex; flex-direction:column; gap:8px; overflow:hidden;}
    .er-side .er-jsonlabel{font-weight:600;}
    .er-body textarea{width:90%; height:100%; border: 2px solid #6363d3; resize:none; padding:12px; font:12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:#fafafa}
    .er-actions{padding:10px; border-top:1px solid #eee; display:flex; gap:8px; justify-content:flex-end;}
    .er-actions button{padding:8px 12px; border:1px solid #ddd; background:#f6f6f6; border-radius:8px; cursor:pointer;}
    @media (max-width: 900px){
      .er-body{grid-template-columns: 1fr;}
    }
  `);
    const errorsRaw = await load();
    // newest first
    const errors = (Array.isArray(errorsRaw) ? errorsRaw : []).slice().sort((a, b) => {
      const ta = Date.parse(a.time || a.at || 0);
      const tb = Date.parse(b.time || b.at || 0);
      return tb - ta;
    });
    const logText = formatErrorsForLog(errors);
    const modal = document.createElement('div');
    modal.className = 'er-modal';

    // Static shell
    modal.innerHTML = `
    <div class="er-card" role="dialog" aria-label="Error report">
      <div class="er-head">
        <span>Errors: ${errors.length}</span>
        <div></div>
      </div>
      <div class="er-body">
        <ul class="er-list" aria-label="Recent Errors"></ul>
        <div class="er-side">
        <div>Copy or review the error log below:</div>
        <textarea readonly>${logText}</textarea>
        </div>
      </div>
      <div class="er-actions">
        <button class="er-clear">Clear errors</button>
        <button class="er-close">Close</button>
      </div>
    </div>
  `;

    // Build human-readable list safely
    const listEl = modal.querySelector('.er-list');
    for (const e of errors) {
      const li = document.createElement('li');
      li.className = 'er-item';
      const top = document.createElement('div');
      top.className = 'er-topline';
      const time = document.createElement('span');
      time.className = 'er-time';
      time.textContent = e.time || e.at || '';
      const label = document.createElement('span');
      label.className = 'er-label';
      label.textContent = e.label || 'unknown';
      const message = document.createElement('span');
      message.className = 'er-message';
      message.textContent = e.message || '';
      top.appendChild(time);
      top.appendChild(label);
      top.appendChild(document.createTextNode(' — '));
      top.appendChild(message);
      const details = document.createElement('details');
      details.className = 'er-details';
      const summary = document.createElement('summary');
      summary.textContent = 'Details';
      details.appendChild(summary);

      // URL
      if (e.url) {
        const p = document.createElement('div');
        const a = document.createElement('a');
        a.href = e.url;
        a.target = '_blank';
        a.rel = 'noopener noreferrer';
        a.textContent = e.url;
        p.appendChild(document.createTextNode('Page: '));
        p.appendChild(a);
        details.appendChild(p);
      }

      // Stack
      if (e.stack) {
        const pre = document.createElement('pre');
        pre.className = 'er-pre';
        pre.textContent = e.stack;
        details.appendChild(pre);
      }
      li.appendChild(top);
      li.appendChild(details);
      listEl.appendChild(li);
    }

    // Wire close/clear
    const close = () => modal.remove();
    modal.addEventListener('click', ev => {
      if (ev.target === modal) close();
    });
    modal.querySelector('.er-close').addEventListener('click', close);
    modal.querySelector('.er-clear').addEventListener('click', async () => {
      await clear();
      close();
      showRecentErrors();
    });
    document.body.appendChild(modal);
  }
  function startLiveErrorPanel({
    pollMs = 1500
  } = {}) {
    addStyle(`
    .er-devpanel{position:fixed; left:0; top:50px; height:70vh; width:400px; z-index:999999;
      background:#111; color:#eee; box-shadow:2px 0 20px rgba(0,0,0,.35); border: 2px solid #861684; display:flex; flex-direction:column; font:12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;}
    .er-devheader{display:flex; align-items:center; gap:8px; padding:8px 10px; background:#181818; border-bottom:1px solid #262626;}
    .er-devtitle{font-weight:700; flex:1;}
    .er-devbtn{cursor:pointer; padding:4px 8px; border:1px solid #333; background:#1f1f1f; color:#eee; border-radius:6px;}
    .er-devbtn[aria-pressed="true"]{background:#2a2a2a;}
    .er-devlist{flex:1; overflow:auto; padding:8px; }
    .er-item{padding:8px; border-bottom:1px solid #222;}
    .er-item:last-child{border-bottom:0;}
    .er-top{display:flex; gap:6px; align-items:baseline; flex-wrap:wrap;}
    .er-time{color:#9aa; font-size:11px;}
    .er-label{font-weight:700; color:#fff;}
    .er-msg{color:#f88;}
    .er-stack{white-space:pre-wrap; color:#ccd; margin-top:6px;}
    .er-url{color:#9cf; margin-top:4px; word-break:break-all;}
    .er-collapsed{transform:translateX(-360px);}
  `);

    // Panel shell
    const panel = document.createElement('aside');
    panel.dataset.panelStartedCollapsed = 'true';
    panel.className = 'er-devpanel er-collapsed';
    panel.innerHTML = `
    <div class="er-devheader">
      <div class="er-devtitle">Error log:</div>
      <button class="er-devbtn er-copy" type="button" title="Copy log">Copy</button>
      <button class="er-devbtn er-pause" type="button" aria-pressed="false" title="Pause live">Pause</button>
      <button class="er-devbtn er-clear" type="button" title="Clear errors">Clear</button>
      <button class="er-devbtn er-collapse" type="button" title="Collapse">&#9654;</button>
    </div>
    <div class="er-devlist" aria-live="polite" aria-label="Live error list"></div>
  `;
    document.body.appendChild(panel);
    const listEl = panel.querySelector('.er-devlist');
    const btnPause = panel.querySelector('.er-pause');
    const btnClear = panel.querySelector('.er-clear');
    const btnCopy = panel.querySelector('.er-copy');
    const btnCollapse = panel.querySelector('.er-collapse');
    let paused = false;
    let lastRenderedCount = -1;
    btnPause.addEventListener('click', () => {
      paused = !paused;
      btnPause.setAttribute('aria-pressed', String(paused));
      btnPause.textContent = paused ? 'Resume' : 'Pause';
    });
    btnClear.addEventListener('click', async () => {
      await clear();
      render([]);
    });
    btnCopy.addEventListener('click', async () => {
      const errors = await load();
      const text = formatErrorsForLog(errors);
      if (GM.setClipboard) {
        await GM.setClipboard(text, {
          type: 'text',
          mimetype: 'text/plain'
        });
      } else {
        const ta = document.createElement('textarea');
        ta.value = text;
        document.body.appendChild(ta);
        ta.select();
        document.execCommand('copy');
        ta.remove();
      }
    });
    btnCollapse.addEventListener('click', () => {
      panel.classList.toggle('er-collapsed');
      btnCollapse.innerHTML = panel.classList.contains('er-collapsed') ? '&#9654;' : '&#9664;';
    });
    function render(errors) {
      if (paused) return;
      if ('panelStartedCollapsed' in panel.dataset && errors.length > 0) {
        // First render, auto-expand
        delete panel.dataset.panelStartedCollapsed;
        btnCollapse.click();
      }
      // Avoid extra work if same count and last item unchanged
      if (errors.length === lastRenderedCount && listEl.dataset.lastTime === (errors[0]?.time || '')) return;
      lastRenderedCount = errors.length;
      listEl.dataset.lastTime = errors[0]?.time || '';
      listEl.innerHTML = ''; // simple full re-render

      const sorted = errors.slice().sort((a, b) => Date.parse(b.time || 0) - Date.parse(a.time || 0));
      for (const e of sorted) {
        const item = document.createElement('div');
        item.className = 'er-item';
        const top = document.createElement('div');
        top.className = 'er-top';
        const t = document.createElement('span');
        t.className = 'er-time';
        t.textContent = e.time || '';
        const lab = document.createElement('span');
        lab.className = 'er-label';
        lab.textContent = e.label || 'unknown';
        const sep = document.createTextNode(' — ');
        const msg = document.createElement('span');
        msg.className = 'er-msg';
        msg.textContent = e.message || '';
        top.appendChild(t);
        top.appendChild(lab);
        top.appendChild(sep);
        top.appendChild(msg);
        item.appendChild(top);
        if (e.stack) {
          const pre = document.createElement('div');
          pre.className = 'er-stack';
          pre.textContent = e.stack;
          item.appendChild(pre);
        }
        if (e.url) {
          const url = document.createElement('div');
          url.className = 'er-url';
          url.textContent = e.url;
          item.appendChild(url);
        }
        listEl.appendChild(item);
      }
    }

    // Initial render + live updates
    load().then(render);
    const unsub = _subscribe(render);

    // Return a cleanup function if you ever need to remove the panel
    return () => {
      unsub();
      panel.remove();
    };
  }

  /**
   * Export as a singleton module
   */
  const ErrorReporter = {
    add,
    init,
    clear,
    showRecentErrors,
    startLiveErrorPanel
  };

  var discographyplayerCSS = ".cll{clear:left}.clb{clear:both}#discographyplayer{z-index:1010;position:fixed;bottom:0;height:83px;width:100%;padding-top:3px;background:#fff;color:#505958;border-top:1px solid rgba(0,0,0,.15);font:13px/1.231 \"Helvetica Neue\",Helvetica,Arial,sans-serif;transition:bottom .5s;box-sizing:initial}#discographyplayer *{box-sizing:initial}#discographyplayer a:link,#discographyplayer a:visited{color:#0687f5;text-decoration:none;cursor:pointer}#discographyplayer a:hover{color:#0687f5;text-decoration:underline;cursor:pointer}#discographyplayer .nowPlaying .cover,#discographyplayer .nowPlaying .info{display:inline-block;vertical-align:top}#discographyplayer .nowPlaying img{width:60px;height:60px;margin-top:4px;margin-left:4px;margin-bottom:4px}#discographyplayer .nowPlaying .info{line-height:18px;margin-left:8px;margin-top:8px;max-width:calc(100% - 76px);border:0 solid #000;padding:0;width:auto;max-height:auto;overflow-y:hidden}#discographyplayer .nowPlaying .info .album,#discographyplayer .nowPlaying .info .title{font-size:13px;font-weight:400;color:#0687f5;margin:0;padding:0}#discographyplayer .currentlyPlaying{display:inline-block;vertical-align:top;overflow:hidden;transition:margin-left 3s ease-in-out;width:99%}#discographyplayer .nextInRow{display:inline-block;vertical-align:top;width:0%;overflow:hidden;transition:width 6s ease-in-out}#discographyplayer .durationDisplay{margin-top:24px;float:left}#discographyplayer .downloadlink:link{display:block;float:right;margin-top:22px;font-size:15px;padding:0 3px;color:#0687f5;border:1px solid #0687f5;transition:color .3s ease-in-out,border-color .3s ease-in-out}#discographyplayer .downloadlink:hover{text-decoration:none;background-color:#0687f5;color:#fff;border:1px solid #fff}#discographyplayer .downloadlink.downloading{color:#f0f;border-color:#f0f;animation:downloadrotation 3s infinite linear;cursor:wait}@keyframes downloadrotation{from{transform:rotate(0)}to{transform:rotate(359deg)}}#discographyplayer .controls{margin-top:10px;width:auto;float:left}#discographyplayer .controls>*{display:inline-block;cursor:pointer;border:1px solid #d9d9d9;padding:11px;margin-right:4px;height:18px;width:17px;transition:background-color .1s}#discographyplayer .controls>:hover{background-color:#0687f52b}#discographyplayer .playpause .play{width:0;height:0;border-top:9px inset transparent;border-bottom:9px inset transparent;border-left:15px solid #222;cursor:pointer;margin-left:2px}#discographyplayer .playpause .pause{border:0;border-left:5px solid #2d2d2d;border-right:5px solid #2d2d2d;height:18px;width:4px;margin-right:2px;margin-left:1px}#discographyplayer .playpause .busy{background-image:url(https://bandcamp.com/img/playerbusy-noborder.gif);background-position:50% 50%;background-repeat:no-repeat;border:none;height:30px;margin:0 0 0 -3px;width:25px;overflow:hidden;background-size:contain}#discographyplayer .shuffleswitch .shufflebutton{background-size:cover;background-position-y:0px;filter:drop-shadow(#FFFF 0px 0px 0px);transition:filter .5s;border:0;height:13px;width:20px;margin-top:4px}#discographyplayer .shuffleswitch .shufflebutton.active{filter:drop-shadow(#0060F2 1px 1px 2px)}#discographyplayer .arrowbutton{border:0;height:13px;width:20px;margin-top:4px;background:url(https://bandcamp.com/img/nextprev.png) 0 0/40px 12px no-repeat transparent;background-position-x:0px;cursor:pointer}#discographyplayer .arrowbutton.next-icon{background-position:100% 0}#discographyplayer .arrowbutton.prevalbum-icon{border-right:3px solid #2d2d2d}#discographyplayer .arrowbutton.nextalbum-icon{background-position:100% 0;border-left:3px solid #2d2d2d}#timeline{width:100%;background:rgba(50,50,50,.4);margin-top:5px;border-left:1px solid #000;border-right:1px solid #000}#playhead{width:10px;height:10px;border-radius:50%;background:#323232;cursor:pointer}.bufferbaranimation{transition:width 1s}#bufferbar{position:absolute;width:0;height:10px;background:rgba(0,0,0,.1)}#discographyplayer .playlist{position:relative;width:100%;display:inline-block;max-height:80px;overflow:auto;list-style:none;margin:0;padding:0 5px 0 5px;scrollbar-color:rgba(50,50,50,0.4) white;background-color:#fff;transition:background-color .3s}#discographyplayer .playlist.dropbox{background-color:#86c786}#discographyplayer .playlist.dropbox.processing{background-color:#45d1b1}#discographyplayer_contextmenu{position:absolute;box-shadow:#000000b0 2px 2px 2px;background-color:#fff;border:#619aa9 2px solid;z-index:1011}#discographyplayer_contextmenu .contextmenu_submenu{cursor:pointer;padding:2px;border:1px solid #619aa9}#discographyplayer_contextmenu .contextmenu_submenu:hover{background-color:#619aa9;color:#fff;border:1px solid #fff}#discographyplayer .playlist .isselected{border:1px solid red}#discographyplayer .playlist .playlistentry{cursor:pointer;margin:1px 0}#discographyplayer .playlist .playlistentry .duration{float:right}#discographyplayer .playlist .playing{background:#619aa950}#discographyplayer .playlist .playlistheading{background:rgba(50,50,50,.4);margin:3px 0}#discographyplayer .playlist .playlistheading a:hover,#discographyplayer .playlist .playlistheading a:link,#discographyplayer .playlist .playlistheading a:visited{color:#eee;cursor:pointer}#discographyplayer .playlist .playlistheading a.notloaded{color:#ccc}#discographyplayer .playlist .playlistheading.notloaded{cursor:copy}#discographyplayer .vol{float:left;position:relative;width:100px;margin-left:1em;margin-top:1em}#discographyplayer .vol-icon-wrapper{font-size:20px;cursor:pointer;width:27px}#discographyplayer .vol-slider{width:60px;height:10px;position:relative;cursor:pointer}#discographyplayer .vol>*{display:inline-block;vertical-align:middle}#discographyplayer .vol-bg{background:rgba(50,50,50,.4);width:100%;margin-top:4px;height:3px;position:absolute}#discographyplayer .vol-amt{margin-top:4px;height:3px;position:absolute;background:#323232}#discographyplayer .vol-control-outer{height:100%;position:relative;margin-left:-3px;margin-right:5px}#discographyplayer .collect{float:left;margin-left:1em}#discographyplayer .{cursor:default;margin-top:.5em}#discographyplayer .collect-wishlist .wishlist-add{cursor:pointer}#discographyplayer .collect-listened{cursor:pointer;margin-top:.5em;margin-left:2px}#discographyplayer .collect .icon{height:13px;width:14px;display:inline-block;position:relative;top:2px}#discographyplayer .collect .add-item-icon{background-position:0 -73px}#discographyplayer .collect .collected-item-icon{background-position:-28px -73px}#discographyplayer .collect .own-item-icon{background-position:-42px -73px}#discographyplayer .collect .wishlist-add,#discographyplayer .collect .wishlist-collected,#discographyplayer .collect .wishlist-own,#discographyplayer .collect .wishlist-saving{display:none}#discographyplayer .collect .wishlist-add:hover .add-item-icon{background-position:-56px -73px}#discographyplayer .collect .wishlist-add .add-item-label:hover{text-decoration:underline}#discographyplayer .collect .listened,#discographyplayer .collect .listened-saving,#discographyplayer .collect .mark-listened{display:none}#discographyplayer .collect .listened .listened-symbol{color:#00dc32;text-shadow:1px 0 #ddd,-1px 0 #ddd,0 -1px #ddd,0 1px #ddd}#discographyplayer .collect .mark-listened .mark-listened-symbol{color:#fff;text-shadow:1px 0 #959595,-1px 0 #959595,0 -1px #959595,0 1px #959595}#discographyplayer .collect .mark-listened:hover .mark-listened-symbol{text-shadow:1px 0 #0af,-1px 0 #0af,0 -1px #0af,0 1px #0af}#discographyplayer .collect .mark-listened:hover .mark-listened-label{text-decoration:underline}#discographyplayer .closebutton,#discographyplayer .minimizebutton{position:absolute;top:1px;right:1px;border:1px solid #505958;color:#505958;font-size:10px;box-shadow:0 0 2px #505958;cursor:pointer;opacity:0;transition:opacity .3s;min-width:8px;min-height:13px;text-align:center}#discographyplayer .minimizebutton{right:13px}#discographyplayer .minimizebutton .minimized{display:none}#discographyplayer .minimizebutton.minimized .maximized{display:none}#discographyplayer .minimizebutton.minimized .minimized{display:inline}#discographyplayer:hover .closebutton,#discographyplayer:hover .minimizebutton{opacity:1}#discographyplayer .col{float:left;min-height:1px;position:relative}#discographyplayer .col25{width:25%}#discographyplayer .col35{width:35%}#discographyplayer .col30{width:30%}#discographyplayer .col15{width:14%}#discographyplayer .col20{width:20%}#discographyplayer .colcontrols{user-select:none}#discographyplayer .colvolumecontrols{margin-left:10px}.albumIsCurrentlyPlaying{border:2px solid #0f0}.albumIsCurrentlyPlaying+.art-play{display:none}.dig-deeper-item .albumIsCurrentlyPlaying,.music-grid-item .albumIsCurrentlyPlaying{border:none}.albumIsCurrentlyPlayingIndicator{display:none}.dig-deeper-item .albumIsCurrentlyPlayingIndicator,.music-grid-item .albumIsCurrentlyPlayingIndicator{position:absolute;display:block;width:74px;height:54px;left:50%;top:50%;margin-left:-36px;margin-top:-27px;opacity:.5;transition:opacity .2s}.albumIsCurrentlyPlayingIndicator .currentlyPlayingBg{position:absolute;width:100%;height:100%;left:0;top:0;background:#000;border-radius:4px}.albumIsCurrentlyPlayingIndicator .currentlyPlayingIcon{position:absolute;width:10px;height:20px;left:28px;top:17px;border-width:0 5px;border-color:#fff;border-style:solid}@media (max-width:1600px){#discographyplayer .controls>*{padding:4px 11px 5px 11px;height:18px}#discographyplayer .durationDisplay{margin-top:0}#discographyplayer .downloadlink:link{margin-top:0}}@media (max-width:1170px){#discographyplayer .colcontrols{width:39%}#discographyplayer .colvolumecontrols{display:none}}";

  var discographyplayerSidebarCSS = "@media (min-width:1600px){.grids .grid{margin:0 calc((100vw - 915px - 35px)/ 2) 0 auto}#menubar-wrapper:hover{z-index:1100}#menubar:hover{z-index:1100;position:relative}#discographyplayer{display:block;bottom:0;height:100vh;max-height:100vh;width:calc((100vw - 915px - 35px)/ 2);right:0;border-left:1px solid #0007;padding-left:1px}#discographyplayer .playlist{height:calc(100vh - 80px - 80px - 50px - 13px);max-height:calc(100vh - 80px - 80px - 50px - 13px)}#discographyplayer .playlist .playlistentry{overflow-x:hidden}#discographyplayer .col25{width:98%}#discographyplayer .col.nowPlaying{height:70px}#discographyplayer .col.col25.colcontrols{height:85px}#discographyplayer .col35{width:97%}#discographyplayer .col15{width:96%}#discographyplayer .colvolumecontrols{height:50px}#bufferbar,#playhead{height:25px;border-radius:0}#discographyplayer .audioplayer a.downloadlink{position:fixed;bottom:5px;right:5px;z-index:10}#discographyplayer .minimizebutton{display:none}#discographyplayer .currentlyPlaying{transition:margin-top 1s ease-in-out;width:99%;height:99%}#discographyplayer .nextInRow{height:0%;width:99%;transition:height 1s ease-in-out}}";

  var pastreleasesCSS = "#pastreleases{position:fixed;bottom:1%;left:10px;background:#d5dce4;color:#033162;font-size:10pt;border:1px solid #033162;z-index:200;opacity:0;transition:opacity .7s;overflow:auto}#pastreleases .tablediv{display:table;position:relative}#pastreleases .entry,#pastreleases .header{display:table-row}#pastreleases .entry>*,#pastreleases .header>*{display:table-cell;line-height:21pt}#pastreleases .upcoming{cursor:pointer;font-size:x-small}#pastreleases .controls{cursor:pointer;position:absolute;top:0;right:1px;line-height:11pt}#pastreleases .entry:link{position:relative;border-top:1px solid #033162;color:#033162;text-decoration:none}#pastreleases .entry:nth-child(odd){background:#c5ccd4}#pastreleases .entry:hover,#pastreleases .entry:visited{color:#033162;text-decoration:none}#pastreleases .entry.future{display:none;background:#9fc2ea}#pastreleases .entry.future:nth-child(odd){background:#8fc2e1}#pastreleases .entry .image{background-size:contain;width:21pt;height:21pt}#pastreleases .entry:hover .image{display:block;position:fixed;bottom:10px;top:50%;left:50%;margin-right:-50%;transform:translate(-50%,-50%);width:350px;height:350px;background:#000;border:5px solid #fff}#pastreleases .entry time{padding-right:2px}#pastreleases .entry .title{padding-left:2px;border-left:1px solid #47a2bd;font-size:1em}#pastreleases .remove{font-family:sans-serif;color:#97174e;font-size:small;padding-right:3px}";

  var darkmodeCSS = "#centerWrapper #pgBd #trackInfoInner{display:flex;flex-direction:column}#centerWrapper #pgBd #trackInfoInner>.tralbumCommands{order:1}#centerWrapper #pgBd #rightColumn{display:flex;flex-direction:column}#centerWrapper #pgBd #rightColumn>#showography{order:1}.ui-widget-overlay{display:none}.ui-dialog.ui-widget.ui-widget-content.ui-corner-all.nu-dialog.no-title{position:fixed!important;top:0!important;right:0!important;bottom:auto!important;left:auto!important}.inline_player .nextbutton,.inline_player .prevbutton,svg{filter:invert(90%)}a{color:#da5!important}.trackYear,button{color:#ac6!important}div#collection-container.collection-container,div.home{background:#000!important}div.area_text,div.sort_controls,div.text,span{color:#ccc!important}div#dlg0_h.hd,div#pgBd.yui-skin-sam,div.blogunit-details-section,div.collection-item-details-container{background:var(--pgBdColor)!important}div.collection-item-artist,h1{color:#ccc!important}DIV.track_number.secondaryText,div.collection-item-title,div.message,h2{color:#fff!important}h3{color:#ffed80!important}DIV.tralbumData.tralbum-credits{color:#ccc!important}DIV#license.info,DIV.tralbumData.tralbum-about,DIV.tralbumData.tralbum-feed,li{color:#806300!important}button.sc-button.sc-button-small.sc-button-responsive.sc-button-addtoset{color:#000!important}div#fan-suggestions.dotted-section.mine,div.bcweekly-bd,div.collection-item-gallery-container,div.collection-stats.dotted-section.mine{background:#222!important}p{color:#aaa!important}div.sound__soundActions{background:0 0!important}button.sc-button.sc-button-small.sc-button-responsive.sc-button-addtoset{color:#111!important}div.ft.fakeFt{background:#555!important}div.bd.footerless{background:#999!important}.walkthrough ol{background-color:#373737}.walkthrough .button{background:#262626;border:#262626}.fan-banner.empty.owner{background-color:#373737}#menubar,#pgFt,.menubar-outer{background-color:#26423b!important;border-bottom:dotted #000 1px!important}#menubar-wrapper{background-color:#000;border-bottom:dotted #000 1px!important}#menubar input#search-field{margin:0;height:21px;line-height:21px;width:222px;font-family:\"Helvetica Neue\",Arial,sans-serif;color:#fff;font-size:13px;padding:0 21px 0 3px;-webkit-user-select:text;text-align:center;background-color:#282828;border:1px solid #282828;outline:0;border-radius:3px}#menubar input#search-field.focused{background-color:#282828;border:1px solid #282828}#menubar.menubar-2018 .hoverable:hover{background:#11607582!important}.fan-bio .edit-profile a{border:1px solid #373737;border-radius:5px;outline:0;background:#373737;color:#aaa;font-weight:500;padding:5px 9px;font-size:11px;line-height:15px;text-transform:uppercase;display:inline-block}.grids{color:#fff;margin:0 0 100px}.recommendations-container{background-color:#373737;border-top:dotted #373737 1px}.fan-container .top.editing{border-bottom:1px solid #2a2a2a;background-color:#191919}.ui-dialog.nu-dialog .ui-dialog-titlebar{padding:15px 20px 12px;background-color:#26423b!important;border-bottom:1px solid #26423b!important}.ui-dialog-titlebar *{color:#fff!important}.ui-dialog-content{color:#ddd!important}.ui-widget-content{border:1px solid #373;background:#373737!important;color:#ddd!important}.external-follow-confirm .ui-dialog-buttonset button,.mailing-list-opt-in .ui-dialog-buttonset button{background:#26423b!important}.external-follow-confirm .ui-dialog-buttonset button:last-child,.mailing-list-opt-in.band .ui-dialog-buttonset button:last-child{background:#0002!important;border:2px solid #26423b!important}#follow-unfollow{background:0 0!important}#follow-unfollow.following{background:#26423b!important;border-color:#26423b!important}#follow-unfollow>div{color:#ac6!important}#follow-unfollow.following>div{background:#26423b!important}.app-promo-desktop,.bcdaily,.discover,.email-intake,.notable{background-color:#262626}.bcdaily .bcdaily-story{min-height:280px;background:#373737}.notable-item{background-color:#373737}.item-page{background:#373737;border:1px solid #373737}.follow-fan-btn{background-color:#373737;border:1px solid #373737}.spotlight-bio,.spotlight-button,.spotlight-link,.spotlight-location,.spotlight-name{color:#fff}.aotd-large{background:#373737}.factoid-title{color:#46c5d5}#autocomplete-results.autocompleted{background:#262626;border:1px solid #262626;color:#fff}.searchwidget.keyboard-focus input[type=text]:focus{background:#262626;box-shadow:0 0}.discover-detail-inner{background-color:#373737}body.wordpress{background:#262626}.wordpress .sidebar .textwidget{color:#fff}.wordpress h1 a{display:block;height:60px;background-size:242px 28px;background-position:24.6% 50%}p{color:#fff!important}.wordpress #content{color:#fff}#dash-container .follow-band,#dash-container .follow-discover,#dash-container .follow-fan{border:1px solid #373737;background:linear-gradient(to bottom,#373737 0,#373737 100%)}html{background:#1e1e1e!important}#stories-vm .story-innards{background-color:#373737}.pane{color:#c7c7c7}#settings-menubar{border-right:1px solid #383838}#settings-menubar li{border-left:1px solid #383838;border-bottom:1px solid #383838;border-top:1px solid #383838}.share_dialog.ui-dialog .ui-dialog-content{background-color:#262626}.share_dialog .section_head{color:#fff}.buy-dlg{color:#fff}.pg-ft{background-color:#000}#lang-picker-vm{border-radius:10px}#menubar>ul>li .logo{background:url('https://www.dropbox.com/s/8s7km8r329l7qy7/bandcamp-logo-gray.png?dl=1') 0 0 no-repeat;background-size:contain;height:20px;margin-top:15px;width:85px}.hd-logo{background:transparent url('https://www.dropbox.com/s/8s7km8r329l7qy7/bandcamp-logo-gray.png?dl=1') no-repeat;background-size:100%;margin-top:24px;height:25px;width:156px}.wordpress h1 a{display:block;text-indent:-999em;background:url('https://www.dropbox.com/s/mx80o2eenp43l0o/bandcamp-daily-retina-dark-theme.png?dl=1') no-repeat;height:60px;background-size:242px 28px;background-position:24.6% 50%}#pgBd{color:#fff}.download-bottom-area{border-top:none;background:0 0}.download .formats-container{border:1px solid #373737;background-color:#373737}.download .formats{list-style:none;color:#888;padding:0;background-color:#373737;width:170px;z-index:2;cursor:default}.download .formats li:hover{background-color:#262626}html{scrollbar-color:#222 #26423b}::-webkit-scrollbar{height:13px}::-webkit-scrollbar-thumb{background:#26423b;border:1px solid #4a4a4a}::-webkit-scrollbar-thumb:hover{background:#316d4b}::-webkit-scrollbar-thumb:active{background:#316d4b}::-webkit-scrollbar-track{background:#4a4a4a}::-webkit-scrollbar-track:hover{background:#4a4a4a}::-webkit-scrollbar-track:active{background:#4a4a4a}::-webkit-scrollbar-corner{background:#4a4a4a}body{background-color:#000!important;color:#fff!important}#propOpenWrapper{background-color:var(--propOpenWrapperBackgroundColor)!important;transition:background-color .5s}.bcdaily-thumb-img,img{filter:brightness(70%)}.bcdaily-thumb-img:hover,img:hover{filter:none}img.imageviewer_image{filter:none}.bclogo svg{filter:brightness(60%)}.inline_player .playbutton.busy::after{opacity:.3;background-image:url('https://bandcamp.com/img/loading-dark.gif')}.inline_player .nextsongcontrolbutton,.inline_player .playbutton,.inline_player .volumeButton,.track_list .play_status{background-color:#686868;border-color:#595959}.nextsongcontrolbutton .nextsongcontrolicon{filter:drop-shadow(#090909b3 1px 1px 2px)}.nextsongcontrolbutton.active .nextsongcontrolicon{filter:drop-shadow(#a3f204 1px 1px 2px)!important}.hidden .nextsongcontrolbutton{display:none}.inline_player .progbar .thumb{background-color:#000;border-color:#ccc}.inline_player .nextbutton,.inline_player .prevbutton{opacity:.7}.track_list tr.lyricsRow td[colspan] div{color:#f8f8f8}input[type=password],input[type=text],textarea{background-color:#121f12!important;color:#40b333!important}.carousel-player-inner{background-color:#26423b}.carousel-player-inner .progress-bar{background-color:#26423b}#carousel-player .queue.show{background-color:#26423b}#carousel-player .queue.show li.active{background-color:#528679}#autocomplete-results .see-all{background-color:#f3f3f345!important}.deluxemenu{color:#c9ebfb!important;background:#00042f!important}.deluxemenu button{background:#1c1494}.deluxeexportmenu table tr>td{color:#00a1c6!important}.deluxeexportmenu table tr>td:nth-child(3){color:#006bc6!important}.deluxemenu fieldset{border:1px solid #fffa!important;box-shadow:1px 1px 3px #fff5!important}.deluxemenu fieldset legend{color:#fffa!important}#discographyplayer{background-color:#26423b!important;color:#869593!important}#discographyplayer .playlist{background-color:#26423b!important}#discographyplayer .playlist.dropbox{background-color:#497e49!important}#discographyplayer .playlist.dropbox.processing{background-color:#1a957e!important}#discographyplayer .playlist .playing{background:#619aa9db!important}#timeline{background:rgba(34,57,42,.69)!important}#bufferbar{background:rgba(77,79,76,.59)!important}#playhead{background:#2a6c21!important}#discographyplayer .playlist{scrollbar-color:#222 #26423b!important}#discographyplayer_contextmenu{box-shadow:#ffffff50 2px 2px 2px;background-color:#162d27;border:#619aa9 2px solid;color:#c2aa4a}#discographyplayer_contextmenu .contextmenu_submenu{cursor:pointer;padding:2px;background-color:#162d27;color:#c2aa4a;border:1px solid transparent}#discographyplayer_contextmenu .contextmenu_submenu:hover{background-color:#619aa9;color:#fff;border:1px solid #fff}#band-navbar{background-color:#333!important}.hd.corp-home{background-color:#26423b}#hub .bd-section.top-section{opacity:.8}#s-daily{background:#262626!important}.franchise-description{color:#d7d072}.footer-gradient{background-image:linear-gradient(to bottom,#262626,#5e5e5e)}#s-daily dailyfooter{background-color:#5e5e5e}#s-daily dailyfooter h2{-webkit-text-stroke:2px #257110!important}#s-daily a.pagination-link{-webkit-text-stroke:2px #257110!important}#s-daily a.pagination-link .back-text{-webkit-text-stroke:2px #1c6c3f!important}article-title{color:#e3e3e3}.mpmerchformats{color:#909090}article-footer{color:#909090}article>article-end{filter:invert(75%)}article .icon{filter:invert(50%)}.salesfeed .item-inner:hover{background-color:#0e738c!important}.hd.header-rework-2018 .hd-sub-head .blue-gradient{background:-webkit-linear-gradient(left,#da5,#daf)!important}.factoid .dots{filter:brightness(300%)}.bdp_check_onlinkhover_container_shown{background-color:#26423ba8!important}.bdp_check_onlinkhover_container:hover{background-color:#2d7d39a8!important;box-shadow:#2db91f7a 0 0 5px}#pastreleases{background-color:#154a86!important}#pastreleases .entry:nth-child(odd){background-color:#3e6c9f!important}#pastreleases .entry.future{background-color:#4783c8!important}#pastreleases .entry.future:nth-child(odd){background-color:#11447d!important}#queueloadingindicator{background-color:#154a86!important}.sidebar .shortcuts{background:#0000;border-color:#0000}";

  var geniusCSS = "#myconfigwin39457845{z-index:2060!important;position:fixed!important}#myconfigwin39457845 h1{margin:5px}#myconfigwin39457845 .divAutoShow{display:none}#myconfigwin39457845 button{background-color:#cacaca!important;color:#000!important;border:2px outset!important;padding:1px!important;font-size:1.2em!important}#lyricsiframe{opacity:.1;transition:opacity 2s;margin:0;padding:0;position:relative}.lyricsnavbar{font-size:.7em;text-align:right;padding:0 10px 0 0!important}.lyricsnavbar a:link,.lyricsnavbar a:visited,.lyricsnavbar span{color:#606060;text-decoration:none;transition:color .4s}.lyricsnavbar a:hover,.lyricsnavbar span:hover{color:#9026e0;text-decoration:none}.loadingspinner{color:#000;font-size:12px;line-height:15px;width:15px!important;height:15px!important;padding:2px!important}.loadingspinnerholder{z-index:10;cursor:progress;position:relative;width:20px!important;height:20px!important}.searchresultlist{margin:0!important;padding:0!important;border:1px solid #000;border-radius:3px;width:450px!important}.searchresultlist ol{list-style:none;padding:0!important;margin:0}.searchresultlist ol li div{width:auto!important}";

  var noEmojiCSS = "@font-face{font-family:Symbola;src:local(\"Symbola Regular\"),local(\"Symbola\"),url(https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/font/Symbola.woff2) format(\"woff2\"),url(https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/font/Symbola.woff) format(\"woff\"),url(https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/font/Symbola.ttf) format(\"truetype\"),url(https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/font/Symbola.otf) format(\"opentype\"),url(https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/font/Symbola.svg#Symbola) format(\"svg\")}.bdp_check_onchecked_symbol,.bdp_check_onlinkhover_symbol,.downloaddisk,.downloadlink,.listened-symbol,.mark-listened-symbol,.minimizebutton,.sharepanelchecksymbol,.user-nav .menubar-symbol,.volumeSymbol{font-family:Symbola,Quivira,\"Segoe UI Symbol\",\"Segoe UI Emoji\",Arial,sans-serif}.downloaddisk,.downloadlink{font-weight:bolder}";

  var exportMenuHTML = "<h2>Export played albums</h2>\n  <h1 class=\"drophint\">Drop to restore from backup</h1>\n  Available fields per album:<br>\n  <table>\n    <tr>\n      <td>%artist%</td>\n      <td>Artist name</td>\n      <td>Jay-X</td>\n    </tr>\n    <tr>\n      <td>%title%</td>\n      <td>Song title</td>\n      <td>Classic song</td>\n    </tr>\n    <tr>\n      <td>%cover%</td>\n      <td>Cover image url</td>\n      <td>https://f4.bcbits.com/img/a2588527047_2.jpg</td>\n    </tr>\n    <tr>\n      <td>%url%</td>\n      <td>Album url</td>\n      <td>petrolgirls.bandcamp.com/album/cut-stitch</td>\n    </tr>\n    <tr>\n      <td>%releaseDate% / %releaseUnix% / %releaseTimestamp%</td>\n      <td>Release date</td>\n      <td>2019-02-07T14:01:59.100Z / 1549548119 / 1549548119100</td>\n    </tr>\n    <tr>\n      <td>%listenedDate% / %listenedUnix% / %listenedTimestamp%</td>\n      <td>Played/Listened date</td>\n      <td>2019-02-07T02:17:21.315Z / 1549505841 / 1549505841315</td>\n    </tr>\n    <tr>\n      <td>%releaseY% / %releaseYYYY%</td>\n      <td>Release: Year</td>\n      <td>19 / 2019</td>\n    </tr>\n    <tr>\n      <td>%releaseM% / %releaseMM% / %releaseMon% / %releaseMonth%</td>\n      <td>Release: Month</td>\n      <td>2 / 02 / Feb / February</td>\n    </tr>\n    <tr>\n      <td>%releaseD% / %releaseDD%</td>\n      <td>Release: Day of month</td>\n      <td>7 / 07</td>\n    </tr>\n    <tr>\n      <td>%releaseDay%</td>\n      <td>Release: Day of week</td>\n      <td>Friday</td>\n    </tr>\n    <tr>\n      <td>%listenedY% / %listenedYYYY%</td>\n      <td>Played: Year</td>\n      <td>19 / 2019</td>\n    </tr>\n    <tr>\n      <td>%listenedM% / %listenedMM% / %listenedMon% / %listenedMonth%</td>\n      <td>Played: Month</td>\n      <td>2 / 02 / Feb / February</td>\n    </tr>\n    <tr>\n      <td>%listenedD% / %listenedDD%</td>\n      <td>Played: Day of month</td>\n      <td>7 / 07</td>\n    </tr>\n    <tr>\n      <td>%listenedDay%</td>\n      <td>Played: Day of week</td>\n      <td>Friday</td>\n    </tr>\n\n  </table>\n";

  var speakerIconMuteSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAoAQMAAACCSesyAAAABlBMVEUAAAA1NTVzRZghAAAAAXRSTlMAQObYZgAAAK1JREFUGNMtzzEOwjAMBdAgJMKWlYlcpGqvxVC1zgl6A3qRSmXrNYo6dE3FQCRCzXeCl+cvefBXB1Iyx0fiMOukNyTcKpJcVCT5asngzHRkZqX0RKtHWtwL2M19gmIO7ivEIkawl43AtqmFrmqEaUwsfSlsmZAZbOKe6f90jTBOCX5mfC3sITHEQnD7RbWAz/iM3RvvaqZ1RjMm49EFBNCSicCSLgHaWaCxAczpB9BXgdGWyYXIAAAAAElFTkSuQmCC";

  var speakerIconLowSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAoCAMAAACPWYlDAAAAM1BMVEUAAABqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampPcCe2AAAAEHRSTlMAN4Xs4SoS0bxHeJEgpm5gLbFq2AAAALlJREFUOMvF1MsKwzAMRNGxKz+bx/z/1xYl0EJIQLPqXUSLcBAmOLivFCiNRmbEy/QqgtXOo4RYxSiBjZTASgksnRIoRg1MRsB8feMFpIR695UeSp1sS4mD4Y9WhQ1vf74FgEMUAaD7CgUMkk0B1WcVAI5DqBuScgYVrD6XOCg+DHHQfcw4yOeCMNhPFgfHi025D5vZhAJw38i/HsBzWQXYVYDURIC6igCYKsAwXi5O6J9sUMrWEv7VB3zHKzcAIgoLAAAAAElFTkSuQmCC";

  var speakerIconMiddleSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAoCAMAAACPWYlDAAAANlBMVEUAAABqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqamrDZ907AAAAEXRSTlMANoQS7CRH3nPQtpDAnFSpYGW9KtUAAAEQSURBVDjLxZTbloMwCEUhhNy8lf//2elAx+XKNJU8db9EXW6JBxTegwwz7FUkgJ8gTyKBE1pFQfCBWaaEIjIlbNILjARDuEkvFJGYeHR/ll5gDQx5GGcvJD3MdDFCPJFOQCSyixvR4LFXoYlU3l8nfC/obipZzg0cFRZ5soA1nulesKYw6lnxCNC0RLU9OQQNNf8NLzkE+l3J9uQSQNNSTdhdoZiAHiGZ4K9w6Op/BxRNabHFIay6I5u/w9EHy/81TDvdCg+xULMOoWP4gs1eswIOAUuOgYKcBTyNA4s08kVI4WT4TScYEP4JmukGQx6xEwBrXOADWC+CCzomBKPMCpDipAC86u8R/FDIFeFb/AD0fTaBQdge8wAAAABJRU5ErkJggg==";

  var speakerIconHighSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAoCAMAAACPWYlDAAAAOVBMVEUAAABqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampHCtmUAAAAEnRSTlMAhTXgE+5yutBAH0yQKqibV2MOLOh8AAABXElEQVQ4y8WUW5aEIAxEeb/UVrP/xc5Mimk9IGn96vrhiLmkCBB1rWVRTzQlIv0gfqZfeXeeKkK4i8Qyx1S2ZLdRvLHUATw1XccHog4oxB4x0WilFijZIQMl14WXSC0QiPw0YWbuim+pBRaY2etU578DsLYtsPriKP8WNYDJqnhEOiT/O39NA+VIlMpWPzBqCZhQGfiMKrE3CTAzKoPKFYBGAhQTS+avUDCIgIqcIp08rTIwsW0N9y9wIuDYPTw5DkwyoLhaDkcQkOhzhlCB/QaQT0C5kQH7zOb2HhasOWOIn6sUcVQeF9Xi4AUA9a+XaTMYBGDHFcTKqcYVAdDnuxf+L4hkKVir62+rAjgRwJuGMePf3TDrQ6M3HWCs77e6A/gtR6epJmi1+wZQOfmVNzBoliY1AKfxl30Mcq8LoPaBgUIHqIjOOlI+mlaVm9PaxPc92aon0jZl9S39AOlqRk93STxjAAAAAElFTkSuQmCC";

  /* globals GM, GM_download, GM_setClipboard, unsafeWindow, MouseEvent, JSON5, MediaMetadata, Response, geniusLyrics, Blob */

  // TODO Mark as played automatically when played
  // TODO custom CSS

  const BACKUP_REMINDER_DAYS = 35;
  const TRALBUM_CACHE_HOURS = 2;
  let NOTIFICATION_TIMEOUT = 3000;
  const CHROME = navigator.userAgent.indexOf('Chrome') !== -1;
  const CAMPEXPLORER = document.location.hostname === 'campexplorer.io';
  const BANDCAMPDOMAIN = document.location.hostname === 'bandcamp.com' || document.location.hostname.endsWith('.bandcamp.com');
  let BANDCAMP = BANDCAMPDOMAIN;
  const NOEMOJI = CHROME && navigator.userAgent.match(/Windows (NT)? [4-9]/i);
  const DEFAULTSKIPTIME = 10; /* Seek time to skip in seconds by default */
  const SCRIPT_NAME = 'Bandcamp script (Deluxe Edition)';
  const LYRICS_EMPTY_PATH = '/robots.txt';
  const PLAYER_URL = 'https://bandcamp.com/robots.txt?player';
  const ONEHOUR = 3600000;
  const MAIN_MENU_DOM_ID = 'bcsde_main_menu_added';
  let darkModeInjected = false;
  let storeTralbumDataPermanentlySwitch = true;
  const allFeatures = {
    discographyplayer: {
      name: 'Enable player on discography page',
      default: true
    },
    tagSearchPlayer: {
      name: 'Enable custom player on tag search page',
      default: true
    },
    userProfilePlayer: {
      name: 'Enable custom player on collections/wishlists on user profile',
      default: true
    },
    albumPageVolumeBar: {
      name: 'Enable volume slider/shuffle/repeat on album page',
      default: true
    },
    albumPageAutoRepeatAll: {
      name: 'Always "repeat all" on album page',
      default: false
    },
    albumPageLyrics: {
      name: 'Show lyrics from genius.com on album page',
      default: true
    },
    markasplayed: {
      name: 'Show "mark as played" link on discography player',
      default: true
    },
    markasplayedEverywhere: {
      name: 'Show "mark as played" link everywhere',
      default: true
    },
    /* markasplayedAuto: {
      name: '(NOT YET IMPLEMENTED) Automatically "mark as played" once a song was played for',
      default: false
    }, */
    thetimehascome: {
      name: 'Circumvent "The time has come to open thy wallet" limit',
      default: true
    },
    albumPageDownloadLinks: {
      name: 'Show download links on album page',
      default: true
    },
    discographyplayerDownloadLink: {
      name: 'Show download link on discography player',
      default: true
    },
    discographyplayerSidebar: {
      name: 'Show discography player as a sidebar on the right',
      default: false
    },
    discographyplayerFullHeightPlaylist: {
      name: 'Extend discography player playlist to full screen height on mouse over',
      default: true
    },
    discographyplayerPersist: {
      name: 'Recover discography player on next page',
      default: true
    },
    backupReminder: {
      name: 'Remind me to backup my played albums every month',
      default: true
    },
    nextSongNotifications: {
      name: 'Show a notification when a new song starts',
      default: false
    },
    releaseReminder: {
      name: 'Show new releases that I have saved',
      default: true
    },
    keepLibrary: {
      name: 'Store all visited or played albums',
      default: true
    },
    darkMode: {
      name: (CHROME ? '🅳🅐🆁🅺🅼🅞🅳🅴' : '🅳🅰🆁🅺🅼🅾🅳🅴') + ' - enable <a href="https://userstyles.org/styles/171538/bandcamp-in-dark">dark theme by Simonus</a>',
      default: false
    },
    showAlbumID: {
      name: 'Show album ID on album page',
      default: false
    },
    feedShowOnlyNewReleases: {
      name: 'Show only new releases in the feed',
      default: false
    },
    feedShowAudioControls: {
      name: 'Show play/pause/seek-bar in the feed',
      default: true
    },
    customReleaseDateFormat: {
      name: 'Format release date on album page',
      default: false
    },
    debugMode: {
      name: 'Debug mode for developers',
      default: false
    }
  };
  const moreSettings = {
    darkMode: {
      true: async function populateDarkModeSettings(container) {
        let darkModeValue = await GM.getValue('darkmode', '1');
        const onChange = async function () {
          const input = this;
          window.setTimeout(() => parentQuery(input, 'fieldset').classList.add('breathe'), 0);
          document.getElementById('bcsde_mode_auto_status').innerHTML = '';
          document.getElementById('bcsde_mode_const_time_from').classList.remove('errorblink');
          document.getElementById('bcsde_mode_const_time_to').classList.remove('errorblink');
          if (document.getElementById('bcsde_mode_always').checked) {
            darkModeValue = '1';
          } else if (document.getElementById('bcsde_mode_const_time').checked) {
            let from = document.getElementById('bcsde_mode_const_time_from').value;
            let to = document.getElementById('bcsde_mode_const_time_to').value;
            const mFrom = from.match(/([0-2]?\d:[0-5]\d)/);
            const mTo = to.match(/([0-2]?\d:[0-5]\d)/);
            if (mFrom && mTo) {
              from = mFrom[1];
              to = mTo[1];
              document.getElementById('bcsde_mode_const_time_from').value = from;
              document.getElementById('bcsde_mode_const_time_to').value = to;
              darkModeValue = `2#${from}->${to}`;
            } else {
              if (!mFrom) {
                document.getElementById('bcsde_mode_const_time_from').classList.add('errorblink');
              }
              if (!mTo) {
                document.getElementById('bcsde_mode_const_time_to').classList.add('errorblink');
              }
            }
          } else if (document.getElementById('bcsde_mode_auto').checked) {
            let myPosition = null;
            let sunData = null;
            try {
              myPosition = await getGPSLocation();
              sunData = suntimes(new Date(), myPosition.latitude, myPosition.longitude);
            } catch (e) {
              document.getElementById('bcsde_mode_auto_status').innerHTML = 'Error:\n' + e;
            }
            if (myPosition && sunData) {
              const data = Object.assign(myPosition, sunData);
              darkModeValue = '3#' + JSON.stringify(data);
              document.getElementById('bcsde_mode_auto_status').innerHTML = `Source:   ${data.source}
Location: ${data.latitude}, ${data.longitude}
Sunrise:  ${data.sunrise.toLocaleTimeString()}
Sunset:   ${data.sunset.toLocaleTimeString()}`;
            }
          }
          await GM.setValue('darkmode', darkModeValue);
          window.setTimeout(() => parentQuery(input, 'fieldset').classList.remove('breathe'), 50);
        };
        const radioAlways = container.appendChild(document.createElement('input'));
        radioAlways.setAttribute('type', 'radio');
        radioAlways.setAttribute('name', 'mode');
        radioAlways.setAttribute('value', 'always');
        radioAlways.setAttribute('id', 'bcsde_mode_always');
        radioAlways.checked = darkModeValue.startsWith('1');
        radioAlways.addEventListener('change', onChange);
        const labelAlways = container.appendChild(document.createElement('label'));
        labelAlways.setAttribute('for', 'bcsde_mode_always');
        labelAlways.appendChild(document.createTextNode('Always'));
        container.appendChild(document.createElement('br'));
        const radioConstTime = container.appendChild(document.createElement('input'));
        radioConstTime.setAttribute('type', 'radio');
        radioConstTime.setAttribute('name', 'mode');
        radioConstTime.setAttribute('value', 'const_time');
        radioConstTime.setAttribute('id', 'bcsde_mode_const_time');
        radioConstTime.checked = darkModeValue.startsWith('2');
        radioConstTime.addEventListener('change', onChange);
        let [from, to] = ['22:00', '06:00'];
        if (darkModeValue.startsWith('2')) {
          [from, to] = darkModeValue.substring(2).split('->');
        }
        const labelConstTime = container.appendChild(document.createElement('label'));
        labelConstTime.setAttribute('for', 'bcsde_mode_const_time');
        labelConstTime.appendChild(document.createTextNode('Time'));
        const labelConstTimeFrom = container.appendChild(document.createElement('label'));
        labelConstTimeFrom.setAttribute('for', 'bcsde_mode_const_time_from');
        labelConstTimeFrom.appendChild(document.createTextNode(' from '));
        const inputConstTimeFrom = container.appendChild(document.createElement('input'));
        inputConstTimeFrom.setAttribute('type', 'text');
        inputConstTimeFrom.setAttribute('value', from);
        inputConstTimeFrom.setAttribute('id', 'bcsde_mode_const_time_from');
        inputConstTimeFrom.addEventListener('change', onChange);
        const labelConstTimeTo = container.appendChild(document.createElement('label'));
        labelConstTimeTo.setAttribute('for', 'bcsde_mode_const_time_to');
        labelConstTimeTo.appendChild(document.createTextNode(' to '));
        const inputConstTimeTo = container.appendChild(document.createElement('input'));
        inputConstTimeTo.setAttribute('type', 'text');
        inputConstTimeTo.setAttribute('value', to);
        inputConstTimeTo.setAttribute('id', 'bcsde_mode_const_time_to');
        inputConstTimeTo.addEventListener('change', onChange);
        container.appendChild(document.createElement('br'));
        const radioAuto = container.appendChild(document.createElement('input'));
        radioAuto.setAttribute('type', 'radio');
        radioAuto.setAttribute('name', 'mode');
        radioAuto.setAttribute('value', 'auto');
        radioAuto.setAttribute('id', 'bcsde_mode_auto');
        radioAuto.checked = darkModeValue.startsWith('3');
        radioAuto.addEventListener('change', onChange);
        const labelAuto = container.appendChild(document.createElement('label'));
        labelAuto.setAttribute('for', 'bcsde_mode_auto');
        labelAuto.appendChild(document.createTextNode('Auto (sunset till sunrise)'));
        const preAutoStatus = container.appendChild(document.createElement('pre'));
        preAutoStatus.setAttribute('id', 'bcsde_mode_auto_status');
        preAutoStatus.setAttribute('style', 'font-family:monospace');
        return 'Dark theme details';
      }
    },
    discographyplayerSidebar: {
      true: function checkScreenSize(container) {
        if (!window.matchMedia('(min-width: 1600px)').matches) {
          const span = container.appendChild(document.createElement('span'));
          span.appendChild(document.createTextNode('Your screen/browser window is not wide enough for this option. Width of at least 1600px required'));
          container.style.opacity = 1;
        } else {
          container.style.opacity = 0;
        }
        return fullfill();
      },
      false: function removeContainerAboutScreenSize(container) {
        container.style.opacity = 0;
        return fullfill();
      }
    },
    nextSongNotifications: {
      true: async function populateNotificationSettings(container) {
        const onChange = async function () {
          const input = this;
          document.getElementById('bcsde_notification_timeout').classList.remove('errorblink');
          let seconds = -1;
          try {
            seconds = parseFloat(document.getElementById('bcsde_notification_timeout').value.trim());
          } catch (e) {
            seconds = -1;
          }
          if (seconds < 0) {
            document.getElementById('bcsde_notification_timeout').classList.add('errorblink');
          } else {
            NOTIFICATION_TIMEOUT = parseInt(1000.0 * seconds);
            await GM.setValue('notification_timeout', NOTIFICATION_TIMEOUT);
            input.style.boxShadow = '2px 2px 5px #0a0f';
            window.setTimeout(function resetBoxShadowTimeout() {
              input.style.boxShadow = '';
            }, 3000);
          }
        };
        const labelTimeout = container.appendChild(document.createElement('label'));
        labelTimeout.setAttribute('for', 'bcsde_notification_timeout');
        labelTimeout.appendChild(document.createTextNode('Show for '));
        const inputTimeout = container.appendChild(document.createElement('input'));
        inputTimeout.setAttribute('type', 'text');
        inputTimeout.setAttribute('size', '3');
        inputTimeout.setAttribute('value', (await GM.getValue('notification_timeout', NOTIFICATION_TIMEOUT)) / 1000.0);
        inputTimeout.setAttribute('id', 'bcsde_notification_timeout');
        inputTimeout.addEventListener('change', onChange);
        const labelPostTimeout = container.appendChild(document.createElement('label'));
        labelPostTimeout.setAttribute('for', 'bcsde_notification_timeout');
        labelPostTimeout.appendChild(document.createTextNode(' seconds (0 = show until manually closed or default value of browser)'));
      }
    },
    customReleaseDateFormat: {
      true: async function populateCustomReleaseDateFormatSettings(container) {
        const defaultFormat = '%YYYY%.%MM%.%DD%';
        const onChange = async function () {
          const input = this;
          document.getElementById('bcsde_custom_release_date_format_str').classList.remove('errorblink');
          const customFormat = document.getElementById('bcsde_custom_release_date_format_str').value;
          if (customFormat && customFormat.trim()) {
            await GM.setValue('custom_release_date_format_str', customFormat.trim());
            input.style.boxShadow = '2px 2px 5px #0a0f';
            window.setTimeout(function resetBoxShadowTimeout() {
              input.style.boxShadow = '';
            }, 3000);
          } else {
            document.getElementById('bcsde_custom_release_date_format_str').classList.add('errorblink');
          }
        };
        const onKeyUp = function () {
          const customFormat = document.getElementById('bcsde_custom_release_date_format_str').value;
          const preview = document.getElementById('bcsde_custom_release_date_preview');
          if (customFormat && customFormat.trim()) {
            preview.textContent = 'Preview: ' + customDateFormatter(customFormat.trim(), new Date(982882800000));
          } else {
            preview.textContent = 'Preview:';
          }
        };
        const labelFormat = container.appendChild(document.createElement('label'));
        labelFormat.setAttribute('for', 'bcsde_custom_release_date_format_str');
        labelFormat.appendChild(document.createTextNode('Custom format: '));
        const inputFormat = container.appendChild(document.createElement('input'));
        inputFormat.setAttribute('type', 'text');
        inputFormat.setAttribute('size', '40');
        inputFormat.setAttribute('value', await GM.getValue('custom_release_date_format_str', defaultFormat));
        inputFormat.setAttribute('id', 'bcsde_custom_release_date_format_str');
        inputFormat.addEventListener('change', onChange);
        inputFormat.addEventListener('change', onKeyUp);
        inputFormat.addEventListener('keyup', onKeyUp);
        container.appendChild(document.createElement('br'));
        const preview = container.appendChild(document.createElement('span'));
        preview.setAttribute('id', 'bcsde_custom_release_date_preview');
        preview.readOnly = true;
        container.appendChild(document.createElement('br'));
        const link = container.appendChild(document.createElement('a'));
        link.setAttribute('target', '_blank');
        link.setAttribute('href', 'https://github.com/cvzi/Bandcamp-script-deluxe-edition/issues/284#issuecomment-1563394077');
        link.appendChild(document.createTextNode('Format options: %DD%, %MM%, %YYYY%, ...'));
        await GM.setValue('custom_release_date_format_str', inputFormat.value);
        onKeyUp();
      }
    }
  };
  let player, audio, currentDuration, timeline, playhead, bufferbar;
  let onPlayHead = false;
  const spriteRepeatShuffle = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAABgCAMAAACt1UvuAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAA2UExURQAAAP////39/Tw8PP///////w4ODv////7+/v7+/k5OTktLS35+fiAgIJSUlAAAABAQECoqKpxAnVsAAAAPdFJOUwAxQ05UJGkKBRchgWiOOufd5UcAAAKrSURBVEjH7ZfrkqQgDIUbFLmphPd/2T2EgNqNzlTt7o+p3dR0d5V+JOGEYzkvZ63nsNY6517XCPIrjIDvXF7qL24ao5QynesIllDKE1MpJdom1UDBQIQlE+HmEipVIk+6cqVqQYivlq/loBJFDa6WnaitbbnMtFHnOF1niDJJX14pPa+cOm0l3Vohyuus8xpkj9ih1nPke6iaO6KV323XqwhRON4tQ3GedakNYYQqslaO+yv9xs64Lh2rX8sWeSISzVWTk8ROJmmU9MTl1PvEnHBmzXRSzvhhuqJAzjlJY9eJCVWljKwcESbL+fbTYK0NWx0IGodyvKCACqp6VqMNlguhktbxMqHdI5k7ps1SsiTxPO0YDgojkZPIysl+617cy8rUkIfPflMY4IaKLZfHhSoPn782iQJC5tIX2nfNQseGG4eoe3T1+kXh7j1j/H6W9TbC65ZxR2S0frKePUWYlhbY/hTkvL6aiKPApCRTeoxNTvUTI16r1DqPAqrGVR0UT/ojwGByJ6qO8S32HQ6wJ8r4TwFdyGnx7kzVM8l/nZpwRwkm1GAKC+5oKflMzY3aUm4rBpSsd17pVv2Bsn739ivqFWK2bhD2TE0wwTKM3Knu2puo1PJ8blqu7TEXVY1wgvGQwYN6HKJR0WGjYqxheN/lCpOzd/GlHX+gHyEe/SE/qpyV+sKPfqdEhzVv/OjwwC3zlefnnR+9YW+5Zz86fzjw3o+f1NCP9oMa+fGeOvnR2brH/378B/xI9A0/UjUjSfyOH2GzCDOuKavyUUM/eryMFjNOIMrHD/1o4di0GlCkp8IP/RjwglRSCKX9yI845VGXqwc18KOtWq3mSr35EQVnHbnzC3X144I3d7Wj6xuq+hH7gwz4PvY48GP9p8i2Vzus/dt+pB/nx18MUmsLM2EHrwAAAABJRU5ErkJggg==')";
  async function getGMValues(o) {
    // GM.getValues will be soon avaible in TM & VM due to MV3 (TM issue #2045), tally with chrome.storage
    const entries = Object.entries(o);
    const values = await Promise.all(entries.map(entry => GM.getValue(entry[0], entry[1])));
    return Object.fromEntries(values.map((val, idx) => [entries[idx][0], val]));
  }
  function setGMValues(o) {
    const entries = Object.entries(o);
    return Promise.all(entries.map(([key, value]) => GM.setValue(key, value)));
  }
  function stopPropagationDefault(ev) {
    ev.stopPropagation();
    ev.preventDefault();
  }
  function humanDuration(duration) {
    let hours = parseInt(duration / 3600);
    if (!hours) {
      hours = '';
    } else {
      hours += ':';
    }
    duration %= 3600;
    let minutes = parseInt(duration / 60);
    minutes = (minutes < 10 ? '0' : '') + minutes;
    duration %= 60;
    let seconds = parseInt(duration);
    if (duration - seconds >= 0.5) {
      seconds++;
    }
    seconds = (seconds < 10 ? '0' : '') + seconds;
    return `${hours}${minutes}:${seconds}`;
  }
  function humanBytes(bytes, precision) {
    bytes = parseInt(bytes, 10);
    if (bytes === 0) {
      return '0 Byte';
    }
    const k = 1024;
    const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
    const i = Math.floor(Math.log(bytes) / Math.log(k));
    return parseFloat((bytes / Math.pow(k, i)).toPrecision(2)) + ' ' + sizes[i];
  }
  function addLogVolume(mediaElement) {
    if (!Object.hasOwnProperty.call(mediaElement, 'logVolume')) {
      Object.defineProperty(mediaElement, 'logVolume', {
        get() {
          return Math.log((Math.E - 1) * this.volume + 1);
        },
        set(percentage) {
          this.volume = (Math.exp(percentage) - 1) / (Math.E - 1);
        }
      });
    }
  }
  function sleep(t) {
    return new Promise(resolve => setTimeout(resolve, t));
  }
  function randomIndex(max) {
    // Random int from interval [0,max)
    return Math.floor(Math.random() * Math.floor(max));
  }
  function shuffleIterable(arr) {
    return [...arr].map(x => [Math.random(), x]).sort(([x], [y]) => y - x).map(([x, y]) => y);
  }
  function padd(n, width, filler) {
    let s;
    for (s = n.toString(); s.length < width; s = filler + s);
    return s;
  }
  function metricPrefix(n, decimals, k) {
    // From http://stackoverflow.com/a/18650828
    if (n <= 0) {
      return String(n);
    }
    k = k || 1000;
    const dm = decimals;
    const sizes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
    const i = Math.floor(Math.log(n) / Math.log(k));
    return parseFloat((n / Math.pow(k, i)).toFixed(dm)) + sizes[i];
  }
  function fixFilename(s) {
    const forbidden = '*"/\\[]:|,<>?\n\t\0'.split('');
    forbidden.forEach(function (char) {
      s = s.replace(char, '');
    });
    return s;
  }
  function fullfill(x) {
    return new Promise(resolve => resolve(x));
  }
  function customDateFormatter(format, date) {
    const fields = {
      '%isoDate%': () => date.toISOString(),
      '%unix%': () => parseInt(date.getTime() / 1000),
      '%YY%': () => date.getFullYear().toString().substring(2),
      '%YYYY%': () => date.getFullYear(),
      '%M%': () => date.getMonth() + 1,
      '%MM%': () => padd(date.getMonth() + 1, 2, '0'),
      '%Mon%': () => date.toLocaleString(undefined, {
        month: 'short'
      }),
      '%Month%': () => date.toLocaleString(undefined, {
        month: 'long'
      }),
      '%D%': () => date.getDate(),
      '%DD%': () => padd(date.getDate(), 2, '0'),
      '%Da%': () => date.toLocaleString(undefined, {
        weekday: 'short'
      }),
      '%Day%': () => date.toLocaleString(undefined, {
        weekday: 'long'
      }),
      '%Dord%': () => date.getDate() + (date.getDate() % 10 === 1 && date.getDate() !== 11 ? 'st' : date.getDate() % 10 === 2 && date.getDate() !== 12 ? 'nd' : date.getDate() % 10 === 3 && date.getDate() !== 13 ? 'rd' : 'th'),
      '%json%': () => date.toJSON()
    };
    for (const field in fields) {
      if (format.includes(field)) {
        try {
          format = format.replace(field, fields[field]());
        } catch (e) {
          console.error('customDateFormatter: Could not format replace "' + field + '": ' + e);
        }
      }
    }
    return format;
  }
  function css2rgb(colorStr) {
    const div = document.body.appendChild(document.createElement('div'));
    div.style.color = colorStr;
    const m = window.getComputedStyle(div).color.match(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i);
    div.remove();
    if (m) {
      m.shift();
      return m;
    }
    return null;
  }
  function base64encode(s) {
    // from https://gist.github.com/stubbetje/229984
    const base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split('');
    const l = s.length;
    let o = '';
    for (let i = 0; i < l; i++) {
      const byte0 = s.charCodeAt(i++) & 0xff;
      const byte1 = s.charCodeAt(i++) & 0xff;
      const byte2 = s.charCodeAt(i) & 0xff;
      o += base64[byte0 >> 2];
      o += base64[(byte0 & 0x3) << 4 | byte1 >> 4];
      const t = i - l;
      if (t >= 0) {
        if (t === 0) {
          o += base64[(byte1 & 0x0f) << 2 | byte2 >> 6];
          o += base64[64];
        } else {
          o += base64[64];
          o += base64[64];
        }
      } else {
        o += base64[(byte1 & 0x0f) << 2 | byte2 >> 6];
        o += base64[byte2 & 0x3f];
      }
    }
    return o;
  }
  function decodeHTMLentities(input) {
    return new window.DOMParser().parseFromString(input, 'text/html').documentElement.textContent;
  }
  function timeSince(date) {
    // https://stackoverflow.com/a/72973090/
    const MINUTE = 60;
    const HOUR = MINUTE * 60;
    const DAY = HOUR * 24;
    const WEEK = DAY * 7;
    const MONTH = DAY * 30;
    const YEAR = DAY * 365;
    const secondsAgo = Math.round((Date.now() - Number(date)) / 1000);
    if (secondsAgo < MINUTE) {
      return secondsAgo + ` second${secondsAgo !== 1 ? 's' : ''} ago`;
    }
    let divisor;
    let unit = '';
    if (secondsAgo < HOUR) {
      [divisor, unit] = [MINUTE, 'minute'];
    } else if (secondsAgo < DAY) {
      [divisor, unit] = [HOUR, 'hour'];
    } else if (secondsAgo < WEEK) {
      [divisor, unit] = [DAY, 'day'];
    } else if (secondsAgo < MONTH) {
      [divisor, unit] = [WEEK, 'week'];
    } else if (secondsAgo < YEAR) {
      [divisor, unit] = [MONTH, 'month'];
    } else {
      [divisor, unit] = [YEAR, 'year'];
    }
    const count = Math.floor(secondsAgo / divisor);
    return `${count} ${unit}${count > 1 ? 's' : ''} ago`;
  }
  function nowInTimeRange(range) {
    // Format: range = 'hh:mm->hh:mm'
    const m = range.match(/(\d{1,2}):(\d{1,2})->(\d{1,2}):(\d{1,2})/);
    const [fromHours, fromMinutes, toHours, toMinutes] = [parseInt(m[1]), parseInt(m[2]), parseInt(m[3]), parseInt(m[4])];
    const now = new Date();
    const from = new Date();
    from.setHours(fromHours);
    from.setMinutes(fromMinutes);
    const to = new Date();
    to.setHours(toHours);
    to.setMinutes(toMinutes);
    if (to - from < 0) {
      to.setDate(to.getDate() + 1);
    }
    return now > from && now < to;
  }
  function nowInBetween(from, to) {
    const time = new Date();
    const start = from.getHours() * 60 + from.getMinutes();
    const end = to.getHours() * 60 + to.getMinutes();
    const now = time.getHours() * 60 + time.getMinutes();
    if (start >= end) {
      return start <= now && now >= end || start >= now && now <= end;
    } else {
      return start <= now && now <= end;
    }
  }
  function loadCrossSiteImage(url) {
    return new Promise(function downloadCrossSiteImage(resolve, reject) {
      const canvas = document.createElement('canvas');
      const ctx = canvas.getContext('2d');
      const img0 = document.createElement('img'); // Load the image in a <img> to get the dimensions
      img0.addEventListener('load', function onImgLoad() {
        if (img0.height === 0 || img0.width === 0) {
          reject(new Error('loadCrossSiteImage("$url") Error: Could not load image in <img>'));
          return;
        }
        canvas.height = img0.height;
        canvas.width = img0.width;
        // Download image data
        GM.xmlHttpRequest({
          method: 'GET',
          overrideMimeType: 'text/plain; charset=x-user-defined',
          url,
          onload: function (resp) {
            // Create a data url image
            const dataurl = 'data:image/jpeg;base64,' + base64encode(resp.responseText);
            const img1 = document.createElement('img');
            img1.addEventListener('load', function () {
              // Load data url image into canvas
              ctx.drawImage(img1, 0, 0);
              resolve(canvas);
            });
            img1.src = dataurl;
          },
          onerror: function (response) {
            console.error('loadCrossSiteImage("' + url + '") Error: ' + response.status + '\n' + ('error' in response ? response.error : ''));
            reject(new Error('error' in response ? response.error : 'loadCrossSiteImage failed'));
          }
        });
      });
      img0.src = url;
    });
  }
  function removeViaQuerySelector(parent, selector) {
    if (typeof selector === 'undefined') {
      selector = parent;
      parent = document;
    }
    for (let el = parent.querySelector(selector); el; el = parent.querySelector(selector)) {
      el.remove();
    }
  }
  function firstChildWithText(parent) {
    for (let i = 0; i < parent.childNodes.length; i++) {
      const node = parent.childNodes[i];
      if (node.nodeType === window.Node.TEXT_NODE && node.nodeValue.trim()) {
        return node;
      } else if (node.childNodes.length) {
        const r = firstChildWithText(node);
        if (r) {
          return r;
        }
      }
    }
    return false;
  }
  function parentQuery(node, q) {
    const parents = [node.parentElement];
    node = node.parentElement.parentElement;
    while (node) {
      const lst = node.querySelectorAll(q);
      for (let i = 0; i < lst.length; i++) {
        if (parents.indexOf(lst[i]) !== -1) {
          return lst[i];
        }
      }
      parents.push(node);
      node = node.parentElement;
    }
    return null;
  }
  function suntimes(date, lat, lng) {
    // According to "Predicting Sunrise and Sunset Times" by Donald A. Teets:
    // https://www.maa.org/sites/default/files/teets09010341463.pdf
    lat = lat * Math.PI / 180.0;
    const dayOfYear = Math.round((date - new Date(date).setMonth(0, 0)) / 86400000);
    const sunDist = 149598000.0;
    const radius = 6378.0;
    const epsilon = 0.409;
    const thetha = 2 * Math.PI / 365.25 * (dayOfYear - 80);
    const n = 720 - 10 * Math.sin(2 * thetha) + 8 * Math.sin(2 * Math.PI / 365.25 * dayOfYear);
    const z = sunDist * Math.sin(thetha) * Math.sin(epsilon);
    const rp = Math.sqrt(sunDist * sunDist - z * z);
    const t0 = 1440 / (2 * Math.PI) * Math.acos((radius - z * Math.sin(lat)) / (rp * Math.cos(lat)));
    const sunriseMin = n - t0 - 5 - 4.0 * lng % 15.0 - date.getTimezoneOffset();
    const sunsetMin = sunriseMin + 2 * t0;
    const sunrise = new Date(date);
    sunrise.setHours(sunriseMin / 60, Math.round(sunriseMin % 60));
    const sunset = new Date(date);
    sunset.setHours(sunsetMin / 60, Math.round(sunsetMin % 60));
    return {
      sunrise,
      sunset
    };
  }
  function fromISO6709(s) {
    // Format: s = '+-DDMM+-DDDMM'
    // Format: s = '+-DDMMSS+-DDDMMSS'
    function convert(iso, negative) {
      const mm = iso % 100;
      const dd = iso / 100;
      return (dd + mm / 60) * (negative ? -1 : 1);
    }
    const m = s.match(/([+-])(\d+)([+-])(\d+)/);
    const lat = convert(parseInt(m[2]), m[1] === '-');
    const lng = convert(parseInt(m[4]), m[3] === '-');
    return {
      latitude: lat,
      longitude: lng
    };
  }
  function getGPSLocation() {
    return new Promise(function downloadCrossSiteImage(resolve, reject) {
      navigator.geolocation.getCurrentPosition(function onSuccess(position) {
        resolve({
          source: `navigator.geolocation@${new Date(position.timestamp).toLocaleString()}`,
          latitude: position.coords.latitude,
          longitude: position.coords.longitude
        });
      }, function onError(err) {
        console.error('getGPSLocation Error:', err);
        const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
        console.debug('getGPSLocation: Timezone: ' + tz);
        GM.xmlHttpRequest({
          method: 'GET',
          url: 'https://raw.githubusercontent.com/iospirit/NSTimeZone-ISCLLocation/master/zone.tab',
          onload: function (response) {
            if (response.responseText.indexOf(tz) !== -1) {
              const line = response.responseText.split(tz)[0].split('\n').pop();
              const myPosition = fromISO6709(line);
              myPosition.source = 'Browser timezone ' + tz;
              resolve(myPosition);
            } else if (response.status !== 200) {
              reject(new Error('Could not download time zone locations: http status=' + response.status));
            } else {
              reject(new Error('Unkown time zone location: ' + tz));
            }
          },
          onerror: function (response) {
            reject(new Error('Could not download time zone locations: ' + response.error));
          }
        });
      });
    });
  }
  const _dateOptions = {
    year: 'numeric',
    month: 'short',
    day: 'numeric'
  };
  const _dateOptionsWithoutYear = {
    month: 'short',
    day: 'numeric'
  };
  const _dateOptionsNumericWithoutYear = {
    year: '2-digit',
    month: '2-digit',
    day: '2-digit'
  };
  function dateFormater(date) {
    if (date.getFullYear() === new Date().getFullYear()) {
      return date.toLocaleDateString(undefined, _dateOptionsWithoutYear);
    } else {
      return date.toLocaleDateString(undefined, _dateOptions);
    }
  }
  function dateFormaterRelease(date) {
    return date.toLocaleDateString(undefined, _dateOptionsWithoutYear) + ', ' + date.getFullYear();
  }
  function dateFormaterNumeric(date) {
    return date.toLocaleDateString(undefined, _dateOptionsNumericWithoutYear);
  }
  let enabledFeaturesLoaded = false;
  function getEnabledFeatures(enabledFeaturesValue) {
    for (const feature in allFeatures) {
      allFeatures[feature].enabled = allFeatures[feature].default;
    }
    if (enabledFeaturesValue !== false) {
      const enabledFeatures = JSON.parse(enabledFeaturesValue);
      if (enabledFeatures.constructor === Object) {
        for (const feature in enabledFeatures) {
          if (feature in allFeatures) {
            allFeatures[feature].enabled = enabledFeatures[feature].enabled;
          }
        }
      }
    }
    enabledFeaturesLoaded = true;
    return allFeatures;
  }
  function findUserProfileUrl() {
    if (document.querySelector('#collection-main a')) {
      return document.querySelector('#collection-main a').href;
    }
    return 'https://bandcamp.com/login';
  }
  let ivRestoreVolume;
  function getStoredVolume(callbackIfVolumeExists) {
    GM.getValue('volume', '0.7').then(str => {
      return parseFloat(str);
    }).then(function storedVolumeLoaded(volume) {
      if (!Number.isNaN(volume) && volume > 0.0) {
        callbackIfVolumeExists(volume);
      }
    });
  }
  function restoreVolume() {
    getStoredVolume(function getStoredVolumeCallback(volume) {
      const restoreVolumeInterval = function restoreInterval() {
        const audios = document.querySelectorAll('audio,video');
        if (audios.length > 0) {
          let paused = true;
          audios.forEach(function (media) {
            addLogVolume(media);
            paused = paused && media.paused;
            media.logVolume = volume;
          });
          if (!paused) {
            // Clear interval once audio is actually playing
            window.clearInterval(ivRestoreVolume);
          }
          // Update volume bar on tag player (by double clicking mute button)
          const muteWrapper = document.querySelector('.vol-icon-wrapper');
          if (muteWrapper) {
            const mouseDownEvent = new MouseEvent('mousedown', {
              view: unsafeWindow,
              bubbles: true,
              cancelable: true
            });
            muteWrapper.dispatchEvent(mouseDownEvent);
            muteWrapper.dispatchEvent(mouseDownEvent);
          }
        }
      };
      restoreVolumeInterval();
      ivRestoreVolume = window.setInterval(restoreVolumeInterval, 500);
    });
    window.setTimeout(function clearRestoreInterval() {
      window.clearInterval(ivRestoreVolume);
    }, 7000);
  }
  function findPreviousAlbumCover(currentUrl) {
    const currentKey = albumKey(currentUrl);
    const as = document.querySelectorAll('.music-grid .music-grid-item a[href*="/album/"],.music-grid .music-grid-item a[href*="/track/"]');
    let last = false;
    let found = false;
    for (let i = 0; i < as.length; i++) {
      if (last && albumKey(as[i].href) === currentKey) {
        found = last;
        break;
      }
      last = as[i];
    }
    if (found) {
      return playAlbumFromCover.apply(found, null);
    }
    return false;
  }
  function findNextAlbumCover(currentUrl) {
    const currentKey = albumKey(currentUrl);
    const as = document.querySelectorAll('.music-grid .music-grid-item a[href*="/album/"],.music-grid .music-grid-item a[href*="/track/"]');
    let isNext = false;
    for (let i = 0; i < as.length; i++) {
      if (isNext) {
        playAlbumFromCover.apply(as[i], null);
        return true;
      }
      if (albumKey(as[i].href) === currentKey) {
        isNext = true;
      }
    }
    return false;
  }
  const shufflePlayed = [];
  function musicPlayerNextSong(next) {
    const current = player.querySelector('.playlist .playing');
    if (!next) {
      if (document.getElementById('discover_shuffle_start') && document.getElementById('discover_shuffle_start').classList.contains('active')) {
        // TODO the next value should already be stored in the html

        console.error('musicPlayerNextSong: implement me');
        const nextAlbumrUrl = document.getElementById('discover_shuffle_next_song').dataset.nextAlbumUrl;
        const nextSong = document.getElementById('discover_shuffle_next_song').dataset.nextSong;
        const shuffleAfterOption = document.getElementById('discover_shuffle_shuffle_after').value;
        console.log('musicPlayerNextSong: shuffleAfterOption', shuffleAfterOption);
        console.log('musicPlayerNextSong: nextAlbumrUrl', nextAlbumrUrl);
        console.log('musicPlayerNextSong: nextSong', nextSong);
        if (shuffleAfterOption === 'album') {
          // TODO we can't know here if the album is already played, need to handle this in the music player
          // Check if the current album is finished. if yes, then load next album and return
          // TODO if this is active, we need to disable shuffle, so that the album plays in normal order, and we can detect the last song.
          // TODO return if handled, otherwise just let the function continue

          const nextSong = current.nextElementSibling;
          console.log(nextSong);
        }
        if (nextSong.startsWith('#')) {
          // play song at track position
          const trackPos = parseInt(nextSong.substring(1));
          playAlbumFromUrl(nextAlbumrUrl, trackPos);
          console.log('playAlbumFromUrl at track', nextAlbumrUrl, trackPos);
        } else {
          // Choose to play featured track
          const songId = parseInt(nextSong);
          playAlbumFromUrl(nextAlbumrUrl, null, songId);
          console.log('playAlbumFromUrl with track id', nextAlbumrUrl, null, songId);
        }
        if (shuffleAfterOption === 'song') {
          // Now that the next song is playing, load the next song
          updateShuffleNextTag(null, 'next');
        }
        return;
      }
      if (player.querySelector('.shufflebutton').classList.contains('active')) {
        // Shuffle mode
        const allLoadedSongs = document.querySelectorAll('.playlist .playlistentry');
        // Set a random song (that is not the current song and not in shufflePlayed)
        let index = null;
        for (let i = 0; i < 10; i++) {
          index = randomIndex(allLoadedSongs.length);
          const file = allLoadedSongs[index].dataset.file;
          if (file !== current.dataset.file && shufflePlayed.indexOf(file) !== -1) {
            break;
          }
        }
        next = allLoadedSongs[index];
        shufflePlayed.push(next.dataset.file);
      } else {
        // Normal mode
        next = current.nextElementSibling;
        while (next) {
          if ('file' in next.dataset) {
            break;
          }
          next = next.nextElementSibling;
        }
      }
    }
    if (next) {
      current.classList.remove('playing');
      next.classList.add('playing');
      musicPlayerPlaySong(next);
    } else {
      // End of playlist reached
      if (findNextAlbumCover(current.dataset.albumUrl) === false) {
        const notloaded = player.querySelector('.playlist .playlistheading a.notloaded');
        if (notloaded) {
          // Unloaded albums in playlist
          const url = notloaded.href;
          notloaded.remove();
          cachedTralbumData(url).then(function onCachedTralbumDataLoaded(TralbumData) {
            if (TralbumData) {
              addAlbumToPlaylist(TralbumData);
            } else {
              playAlbumFromUrl(url);
            }
          });
        } else {
          audio.pause();
          audio.currentTime -= 1;
          musicPlayerOnTimeUpdate();
          window.alert('End of playlist reached');
        }
      }
    }
  }
  let ivSlideInNextSong;
  function musicPlayerPlaySong(next, startTime) {
    currentDuration = next.dataset.duration;
    player.querySelector('.durationDisplay .current').innerHTML = '-';
    player.querySelector('.durationDisplay .total').innerHTML = humanDuration(currentDuration);
    audio.src = next.dataset.file;
    if (typeof startTime !== 'undefined' && startTime !== false) {
      audio.currentTime = startTime;
    }
    bufferbar.classList.remove('bufferbaranimation');
    window.setTimeout(function bufferbaranimationWidth() {
      bufferbar.style.width = '0px';
      window.setTimeout(function bufferbaranimationClass() {
        bufferbar.classList.add('bufferbaranimation');
      }, 10);
    }, 0);
    const key = albumKey(next.dataset.albumUrl);

    // Meta
    const currentlyPlaying = document.querySelector('.currentlyPlaying');
    const nextInRow = player.querySelector('.nextInRow');
    nextInRow.querySelector('.cover').href = next.dataset.albumUrl;
    nextInRow.querySelector('.cover img').src = next.dataset.albumCover;
    nextInRow.querySelector('.info .link').href = next.dataset.albumUrl;
    nextInRow.querySelector('.info .title').innerHTML = next.dataset.title;
    nextInRow.querySelector('.info .artist').innerHTML = next.dataset.artist;
    nextInRow.querySelector('.info .album').innerHTML = next.dataset.album;

    // Favicon
    musicPlayerFavicon(next.dataset.albumCover.replace(/_\d.jpg$/, '_3.jpg'));

    // Wishlist
    const collectWishlist = player.querySelector('.collect-wishlist');
    collectWishlist.dataset.albumUrl = next.dataset.albumUrl;
    player.querySelectorAll('.collect-wishlist>*').forEach(function (e) {
      e.style.display = 'none';
    });
    if (next.dataset.isPurchased === 'true') {
      player.querySelector('.collect-wishlist .wishlist-own').style.display = 'inline-block';
      collectWishlist.dataset.wishlist = 'own';
    } else if (next.dataset.inWishlist === 'true') {
      player.querySelector('.collect-wishlist .wishlist-collected').style.display = 'inline-block';
      collectWishlist.dataset.wishlist = 'collected';
    } else {
      // Always show whishlist button for whole album
      player.querySelector('.collect-wishlist .wishlist-add').style.display = 'inline-block';
      player.querySelector('.collect-wishlist .wishlist-add .album').style.display = 'inline';
      collectWishlist.dataset.wishlist = 'add';
      if (next.dataset.isDownloadable === 'true' && next.dataset.trackUrl) {
        // Only show wishlist button for single track if the track is downloadable and there is a track url
        collectWishlist.dataset.trackUrl = next.dataset.trackUrl;
        player.querySelector('.collect-wishlist .wishlist-add .track').style.display = 'inline';
        player.querySelector('.collect-wishlist .wishlist-add .slash').style.display = 'inline';
      } else {
        player.querySelector('.collect-wishlist .wishlist-add .track').style.display = 'none';
        player.querySelector('.collect-wishlist .wishlist-add .slash').style.display = 'none';
      }
    }

    // Played/Listened
    const collectListened = player.querySelector('.collect-listened');
    if (allFeatures.markasplayed.enabled && collectListened) {
      collectListened.dataset.albumUrl = next.dataset.albumUrl;
      player.querySelectorAll('.collect-listened>*').forEach(function (e) {
        e.style.display = 'none';
      });
      GM.getValue('myalbums', '{}').then(function myalbumsLoaded(str) {
        const myalbums = JSON.parse(str);
        if (key in myalbums && 'listened' in myalbums[key] && myalbums[key].listened) {
          player.querySelector('.collect-listened .listened').style.display = 'inline-block';
          const date = new Date(myalbums[key].listened);
          const since = timeSince(date);
          player.querySelector('.collect-listened .listened').title = since + ' ago\nClick to mark as NOT played';
          collectListened.dataset.listened = myalbums[key].listened;
        } else {
          player.querySelector('.collect-listened .mark-listened').style.display = 'inline-block';
          collectListened.dataset.listened = false;
        }
      });
    } else if (collectListened) {
      collectListened.remove();
    }

    // Notification
    if (allFeatures.nextSongNotifications.enabled && 'notification' in GM) {
      GM.notification({
        title: document.location.host,
        text: next.dataset.title + '\nby ' + next.dataset.artist + '\nfrom ' + next.dataset.album,
        image: next.dataset.albumCover,
        highlight: false,
        silent: true,
        timeout: NOTIFICATION_TIMEOUT,
        onclick: musicPlayerNext
      });
    }

    // Media hub
    if ('mediaSession' in navigator) {
      navigator.mediaSession.metadata = new MediaMetadata({
        title: next.dataset.title,
        artist: next.dataset.artist,
        album: next.dataset.album,
        artwork: [{
          src: next.dataset.albumCover,
          sizes: '350x350',
          type: 'image/jpeg'
        }]
      });
      navigator.mediaSession.setActionHandler('previoustrack', musicPlayerPrev);
      navigator.mediaSession.setActionHandler('nexttrack', musicPlayerNext);
      navigator.mediaSession.setActionHandler('play', _ => audio.play());
      navigator.mediaSession.setActionHandler('pause', _ => audio.pause());
      navigator.mediaSession.setActionHandler('seekbackward', function (event) {
        const skipTime = event.seekOffset || DEFAULTSKIPTIME;
        audio.currentTime = Math.max(audio.currentTime - skipTime, 0);
        musicPlayerUpdatePositionState();
      });
      navigator.mediaSession.setActionHandler('seekforward', function (event) {
        const skipTime = event.seekOffset || DEFAULTSKIPTIME;
        audio.currentTime = Math.min(audio.currentTime + skipTime, audio.duration || currentDuration);
        musicPlayerUpdatePositionState();
      });
      try {
        navigator.mediaSession.setActionHandler('stop', _ => musicPlayerClose());
      } catch (error) {
        console.warn('Warning! The "stop" media session action is not supported.');
      }
      try {
        navigator.mediaSession.setActionHandler('seekto', function (event) {
          if (event.fastSeek && 'fastSeek' in audio) {
            audio.fastSeek(event.seekTime);
            return;
          }
          audio.currentTime = event.seekTime;
          musicPlayerUpdatePositionState();
        });
      } catch (error) {
        console.warn('Warning! The "seekto" media session action is not supported.');
      }
    }

    // Download link
    const downloadLink = player.querySelector('.downloadlink');
    if (allFeatures.discographyplayerDownloadLink.enabled) {
      downloadLink.href = next.dataset.file;
      downloadLink.download = (next.dataset.trackNumber > 9 ? '' : '0') + next.dataset.trackNumber + '. ' + fixFilename(next.dataset.artist + ' - ' + next.dataset.title) + '.mp3';
      downloadLink.style.display = 'block';
    } else {
      downloadLink.style.display = 'none';
    }

    // Show "playing" indication on album covers
    let coverLinkPattern = albumPath(next.dataset.albumUrl);
    if (document.location.href.split('.')[0] !== next.dataset.albumUrl.split('.')[0]) {
      /*
      Subdomain is different from album subdomain -> multiple artists on this page, use full url to detect albums.
      Otherwise albums with the same name but a different artist name will be highlighted.
      This would happen quite often on search results.
      */
      coverLinkPattern = albumKey(next.dataset.albumUrl);
    }
    document.querySelectorAll('img.albumIsCurrentlyPlaying').forEach(img => img.classList.remove('albumIsCurrentlyPlaying'));
    document.querySelectorAll('.albumIsCurrentlyPlayingIndicator').forEach(div => div.remove());
    document.querySelectorAll('a[href*="' + coverLinkPattern + '"] img,.info>a[href*="' + coverLinkPattern + '"]').forEach(function (img) {
      let node = img;
      while (node) {
        if (node.id === 'discographyplayer') {
          return;
        }
        if (node === document.body) {
          break;
        }
        node = node.parentNode;
      }
      if (img.tagName === 'A') {
        img = img.parentNode.parentNode.querySelector('.art img');
      }
      img.classList.add('albumIsCurrentlyPlaying');
      if (!img.parentNode.querySelector('.albumIsCurrentlyPlayingIndicator')) {
        const indicator = img.parentNode.appendChild(document.createElement('div'));
        indicator.classList.add('albumIsCurrentlyPlayingIndicator');
        indicator.addEventListener('click', function (ev) {
          stopPropagationDefault(ev);
          if (!musicPlayerPlay()) {
            // Album is now paused -> Remove indicators
            document.querySelectorAll('img.albumIsCurrentlyPlaying').forEach(img => img.classList.remove('albumIsCurrentlyPlaying'));
            document.querySelectorAll('.albumIsCurrentlyPlayingIndicator').forEach(div => div.remove());
          }
        });
        indicator.appendChild(document.createElement('div')).classList.add('currentlyPlayingBg');
        indicator.appendChild(document.createElement('div')).classList.add('currentlyPlayingIcon');
      }
    });

    // Animate
    if (allFeatures.discographyplayerSidebar.enabled && window.matchMedia('(min-width: 1600px)').matches) {
      // Slide up
      currentlyPlaying.style.marginTop = -parseInt(currentlyPlaying.clientHeight + 1) + 'px';
      nextInRow.style.height = '99%';
      nextInRow.style.width = '99%';
      window.clearTimeout(ivSlideInNextSong);
      ivSlideInNextSong = window.setTimeout(function slideInSongInterval() {
        currentlyPlaying.remove();
        const clone = nextInRow.cloneNode(true);
        clone.style.height = '0%';
        clone.className = 'nextInRow';
        nextInRow.className = 'currentlyPlaying';
        nextInRow.parentNode.appendChild(clone);
      }, 600);
    } else {
      // Slide to the left
      currentlyPlaying.style.marginLeft = -parseInt(currentlyPlaying.clientWidth + 1) + 'px';
      nextInRow.style.height = '99%';
      nextInRow.style.width = '99%';
      window.clearTimeout(ivSlideInNextSong);
      ivSlideInNextSong = window.setTimeout(function slideInSongInterval() {
        currentlyPlaying.remove();
        const clone = nextInRow.cloneNode(true);
        clone.style.width = '0%';
        clone.className = 'nextInRow';
        nextInRow.className = 'currentlyPlaying';
        nextInRow.parentNode.appendChild(clone);
      }, 7 * 1000);
    }
    window.setTimeout(() => player.querySelector('.playlist .playing').scrollIntoView({
      block: 'nearest'
    }), 200);
  }
  function musicPlayerPlay() {
    if (audio.paused) {
      audio.play().then(_ => musicPlayerUpdatePositionState());
      musicPlayerCookieChannelSendStop();
      return true;
    } else {
      audio.pause();
      document.querySelectorAll('img.albumIsCurrentlyPlaying').forEach(img => img.classList.remove('albumIsCurrentlyPlaying'));
      document.querySelectorAll('.albumIsCurrentlyPlayingIndicator').forEach(div => div.remove());
      return false;
    }
  }
  function musicPlayerStop() {
    if (!audio.paused) {
      audio.pause();
    }
  }
  function musicPlayerPrev() {
    musicPlayerShowBusy();
    const current = player.querySelector('.playlist .playing');
    let prev = current.previousElementSibling;
    while (prev) {
      if ('file' in prev.dataset) {
        break;
      }
      prev = prev.previousElementSibling;
    }
    if (prev) {
      musicPlayerNextSong(prev);
    }
  }
  function musicPlayerNext() {
    musicPlayerShowBusy();
    musicPlayerNextSong();
  }
  function musicPlayerPrevAlbum() {
    audio.pause();
    window.setTimeout(function musicPlayerPrevAlbumTimeout() {
      musicPlayerShowBusy();
      const url = player.querySelector('.playlist .playing').dataset.albumUrl;
      if (!findPreviousAlbumCover(url)) {
        // Find previous album in playlist
        let prev = false;
        const as = player.querySelectorAll('.playlist .playlistheading a');
        for (let i = 0; i < as.length; i++) {
          if (albumKey(as[i].href) === albumKey(url)) {
            if (i > 0) {
              prev = as[i - 1];
            }
            break;
          }
        }
        if (prev) {
          prev.parentNode.click();
        } else {
          // Just play first song in playlist
          player.querySelector('.playlist .playlistentry').click();
        }
      }
    }, 10);
  }
  function musicPlayerNextAlbum() {
    audio.pause();
    window.setTimeout(function musicPlayerNextAlbumTimeout() {
      musicPlayerShowBusy();
      const r = findNextAlbumCover(player.querySelector('.playlist .playing').dataset.albumUrl);
      if (r === false) {
        // Find next album in playlist
        let reachedPlaying = false;
        let found = false;
        const lis = player.querySelectorAll('.playlist li');
        for (let i = 0; i < lis.length; i++) {
          if (reachedPlaying && lis[i].classList.contains('playlistheading')) {
            lis[i].click();
            found = true;
            break;
          } else if (lis[i].classList.contains('playing')) {
            reachedPlaying = true;
          }
        }
        if (!found) {
          audio.play().then(_ => musicPlayerUpdatePositionState());
          window.alert('End of playlist reached');
        }
      }
    }, 10);
  }
  function musicPlayerToggleShuffle() {
    player.querySelector('.shufflebutton').classList.toggle('active');
    if (player.querySelector('.shufflebutton').classList.contains('active')) {
      if (!window.confirm('Would you like to shuffle all albums on this page?\n\n(It may take several minutes to load all albums into the playlist)')) {
        return;
      }

      // Load all albums from page into the player
      addAllAlbumsAsHeadings();

      // Load unloaded items in playlist
      let delay = 0;
      // Disable permanent storage for speed
      storeTralbumDataPermanentlySwitch = false;
      let n = player.querySelectorAll('.playlist .playlistheading a.notloaded').length + 1;
      if (n > 0) {
        const queueLoadingIndicator = document.body.appendChild(document.createElement('div'));
        queueLoadingIndicator.setAttribute('id', 'queueloadingindicator');
        queueLoadingIndicator.style = 'position:fixed;top:1%;left:10px;background:#d5dce4;color:#033162;font-size:10pt;border:1px solid #033162;z-index:3000;';
      }
      const updateLoadingIndicator = function () {
        const div = document.getElementById('queueloadingindicator');
        if (div) {
          div.innerHTML = `Loading albums into playlist. ${--n} albums remaining...`;
          if (n <= 0) {
            div.remove();
            storeTralbumDataPermanentlySwitch = allFeatures.keepLibrary.enabled;
          }
        }
      };
      window.setTimeout(updateLoadingIndicator, 1);
      player.querySelectorAll('.playlist .playlistheading a.notloaded').forEach(async function (notloaded) {
        const url = notloaded.href;
        notloaded.remove();
        cachedTralbumData(url).then(function onCachedTralbumDataLoaded(TralbumData) {
          if (TralbumData) {
            addAlbumToPlaylist(TralbumData, null);
            window.setTimeout(updateLoadingIndicator, 10);
          } else {
            // Delay to avoid rate limit
            window.setTimeout(() => playAlbumFromUrl(url, null).then(updateLoadingIndicator), delay * 1000);
            delay += 4;
          }
        });
      });
    }
  }
  function musicPlayerOnTimelineClick(ev) {
    musicPlayerMovePlayHead(ev);
    const timelineWidth = timeline.offsetWidth - playhead.offsetWidth;
    const clickPercent = (ev.clientX - timeline.getBoundingClientRect().left) / timelineWidth;
    audio.currentTime = currentDuration * clickPercent;
  }
  function musicPlayerOnTimeUpdate() {
    const playpause = player.querySelector('.playpause');
    const timelineWidth = timeline.offsetWidth - playhead.offsetWidth;
    const playPercent = timelineWidth * (audio.currentTime / currentDuration);
    playhead.style.marginLeft = playPercent + 'px';
    if (audio.currentTime === currentDuration) {
      playpause.querySelector('.play').style.display = 'none';
      playpause.querySelector('.busy').style.display = '';
      playpause.querySelector('.pause').style.display = 'none';
      if ('mediaSession' in navigator) {
        navigator.mediaSession.playbackState = 'none';
      }
    } else if (audio.paused) {
      playpause.querySelector('.play').style.display = '';
      playpause.querySelector('.busy').style.display = 'none';
      playpause.querySelector('.pause').style.display = 'none';
      if (document.title.startsWith('\u25B6\uFE0E ')) {
        document.title = document.title.substring(3);
      }
      if ('mediaSession' in navigator) {
        navigator.mediaSession.playbackState = 'paused';
      }
    } else {
      playpause.querySelector('.play').style.display = 'none';
      playpause.querySelector('.busy').style.display = 'none';
      playpause.querySelector('.pause').style.display = '';
      if (!document.title.startsWith('\u25B6\uFE0E ')) {
        document.title = '\u25B6\uFE0E ' + document.title;
      }
      if ('mediaSession' in navigator) {
        navigator.mediaSession.playbackState = 'playing';
      }
    }
    player.querySelector('.durationDisplay .current').innerHTML = humanDuration(audio.currentTime);
  }
  function musicPlayerUpdateBufferBar() {
    if (currentDuration) {
      if (audio.buffered.length > 0) {
        bufferbar.style.width = Math.min(100, 1 + parseInt(100 * audio.buffered.end(0) / currentDuration)) + '%';
      } else {
        bufferbar.style.width = '100%';
      }
    } else {
      bufferbar.style.width = '0px';
    }
  }
  function musicPlayerShowBusy(ev) {
    const playpause = player.querySelector('.playpause');
    playpause.querySelector('.play').style.display = 'none';
    playpause.querySelector('.busy').style.display = '';
    playpause.querySelector('.pause').style.display = 'none';
  }
  function musicPlayerMovePlayHead(event) {
    const newMargLeft = event.clientX - timeline.getBoundingClientRect().left;
    const timelineWidth = timeline.offsetWidth - playhead.offsetWidth;
    if (newMargLeft >= 0 && newMargLeft <= timelineWidth) {
      playhead.style.marginLeft = newMargLeft + 'px';
    }
    if (newMargLeft < 0) {
      playhead.style.marginLeft = '0px';
    }
    if (newMargLeft > timelineWidth) {
      playhead.style.marginLeft = timelineWidth + 'px';
    }
  }
  function musicPlayerOnPlayheadMouseDown() {
    onPlayHead = true;
    window.addEventListener('mousemove', musicPlayerMovePlayHead, true);
    audio.removeEventListener('timeupdate', musicPlayerOnTimeUpdate, false);
  }
  function musicPlayerOnPlayheadMouseUp(event) {
    if (onPlayHead) {
      musicPlayerMovePlayHead(event);
      window.removeEventListener('mousemove', musicPlayerMovePlayHead, true);
      // change current time
      const timelineWidth = timeline.offsetWidth - playhead.offsetWidth;
      const clickPercent = (event.clientX - timeline.getBoundingClientRect().left) / timelineWidth;
      audio.currentTime = currentDuration * clickPercent;
      audio.addEventListener('timeupdate', musicPlayerOnTimeUpdate, false);
    }
    onPlayHead = false;
  }
  function musicPlayerOnVolumeClick(ev) {
    const volSlider = player.querySelector('.vol-slider');
    const sliderWidth = volSlider.offsetWidth;
    const percent = (ev.clientX - volSlider.getBoundingClientRect().left) / sliderWidth;
    audio.logVolume = percent > 0.9 ? 1.0 : percent;
    GM.setValue('volume', audio.logVolume);
  }
  function musicPlayerOnVolumeWheel(ev) {
    ev.preventDefault();
    const direction = Math.min(Math.max(-1, ev.deltaY), 1.0);
    audio.logVolume = Math.min(Math.max(0.0, audio.logVolume - 0.05 * direction), 1.0);
    GM.setValue('volume', audio.logVolume);
  }
  function musicPlayerOnMuteClick(ev) {
    if (audio.logVolume < 0.01) {
      if ('lastvolume' in audio.dataset && audio.dataset.lastvolume) {
        audio.logVolume = audio.dataset.lastvolume;
        GM.setValue('volume', audio.logVolume);
      } else {
        audio.logVolume = 1.0;
      }
    } else {
      audio.dataset.lastvolume = audio.logVolume;
      audio.logVolume = 0.0;
    }
  }
  function musicPlayerOnVolumeChanged(ev) {
    let icons;
    if (NOEMOJI) {
      const muteIcon = `<img style="width:20px" src="${speakerIconMuteSrc}" alt="\uD83D\uDD07">`;
      const lowIcon = `<img style="width:20px" src="${speakerIconLowSrc}" alt="\uD83D\uDD07">`;
      const middleIcon = `<img style="width:20px" src="${speakerIconMiddleSrc}" alt="\uD83D\uDD07">`;
      const highIcon = `<img style="width:20px" src="${speakerIconHighSrc}" alt="\uD83D\uDD07">`;
      icons = [muteIcon, lowIcon, middleIcon, highIcon];
    } else {
      icons = ['\uD83D\uDD07', '\uD83D\uDD08', '\uD83D\uDD09', '\uD83D\uDD0A'];
    }
    const percent = audio.logVolume;
    const volSlider = player.querySelector('.vol-slider');
    volSlider.querySelector('.vol-amt').style.width = parseInt(100 * percent) + '%';
    const volIconWrapper = player.querySelector('.vol-icon-wrapper');
    volIconWrapper.title = 'Mute (' + parseInt(percent * 100) + '%)';
    if (percent < 0.05) {
      volIconWrapper.innerHTML = icons[0];
    } else if (percent < 0.3) {
      volIconWrapper.innerHTML = icons[1];
    } else if (percent < 0.8) {
      volIconWrapper.innerHTML = icons[2];
    } else {
      volIconWrapper.innerHTML = icons[3];
    }
  }
  function musicPlayerOnEnded(ev) {
    musicPlayerNextSong();
    window.setTimeout(() => player.querySelector('.playlist .playing').scrollIntoView({
      block: 'nearest'
    }), 200);
  }
  function musicPlayerOnPlaylistClick(ev, contextMenuRoot) {
    const li = this;
    if (ev.ctrlKey && player.querySelector('.playlist .isselected')) {
      // Select multiple with ctrlKey
      ev.preventDefault();
      musicPlayerContextMenuCtrl.call(li, ev);
      return;
    }
    if (ev.shiftKey && musicPlayerContextMenuLastSelectedLi && musicPlayerContextMenuLastSelectedLi.classList.contains('isselected')) {
      // Select multiple with shift key
      ev.preventDefault();
      if (musicPlayerContextMenuShift.call(li, ev)) {
        return;
      }
    }
    musicPlayerNextSong(li);
    if (contextMenuRoot) {
      contextMenuRoot.remove();
    }
  }
  function removeSelectedFromPlaylist(ev, contextMenuRoot) {
    player.querySelectorAll('.playlist .isselected').forEach(function (li) {
      if (li.classList.contains('playlistentry')) {
        let walk = li.previousElementSibling;
        let remainingTrackN = 0;
        while (walk.classList.contains('playlistentry')) {
          remainingTrackN++;
          walk = walk.previousElementSibling;
        }
        walk = li.nextElementSibling;
        while (walk.classList.contains('playlistentry')) {
          remainingTrackN++;
          walk = walk.nextElementSibling;
        }
        if (remainingTrackN === 0) {
          // If this is last song of album, then remove also album
          walk = li.previousElementSibling;
          while (walk) {
            if (walk.classList.contains('playlistheading')) {
              walk.remove();
              break;
            }
            walk = walk.previousElementSibling;
          }
        }
        // Remove track
        li.remove();
      } else {
        // Remove album
        let next = li.nextElementSibling;
        while (next && next.classList.contains('playlistentry')) {
          next.remove();
          next = li.nextElementSibling;
        }
        li.remove();
      }
    });
    if (contextMenuRoot) {
      contextMenuRoot.remove();
    }
  }
  function musicPlayerOnPlaylistHeadingClick(ev, contextMenuRoot) {
    const li = this;
    const a = li.querySelector('a[href]');
    if (a && a.classList.contains('notloaded')) {
      const url = a.href;
      cachedTralbumData(url).then(function onCachedTralbumDataLoaded(TralbumData) {
        li.remove();
        if (TralbumData) {
          addAlbumToPlaylist(TralbumData);
        } else {
          playAlbumFromUrl(url);
        }
      });
    } else if (a && li.nextElementSibling) {
      li.nextElementSibling.click();
    }
    if (contextMenuRoot) {
      contextMenuRoot.remove();
    }
  }
  let musicPlayerContextMenuLastSelectedLi = null;
  function musicPlayerContextMenuCtrl(ev) {
    const li = this;
    li.classList.toggle('isselected');
    if (li.classList.contains('isselected')) {
      musicPlayerContextMenuLastSelectedLi = li;
    }
  }
  function musicPlayerContextMenuShift(ev) {
    const li = this;
    // Find the last selected element (i.e. in which direction we need to go)
    let dir = 0;
    let walk = li.previousElementSibling;
    while (walk && dir === 0) {
      if (walk === musicPlayerContextMenuLastSelectedLi) {
        dir = -1;
      }
      walk = walk.previousElementSibling;
    }
    walk = li.nextElementSibling;
    while (walk && dir === 0) {
      if (walk === musicPlayerContextMenuLastSelectedLi) {
        dir = 1;
        break;
      }
      walk = walk.nextElementSibling;
    }
    // Select every track in-between
    if (dir === -1) {
      walk = li.previousElementSibling;
      while (walk !== musicPlayerContextMenuLastSelectedLi) {
        if (walk.classList.contains('playlistentry')) {
          walk.classList.add('isselected');
        }
        walk = walk.previousElementSibling;
      }
      li.classList.add('isselected');
      return true;
    } else if (dir === 1) {
      walk = li.nextElementSibling;
      while (walk !== musicPlayerContextMenuLastSelectedLi) {
        if (walk.classList.contains('playlistentry')) {
          walk.classList.add('isselected');
        }
        walk = walk.nextElementSibling;
      }
      li.classList.add('isselected');
      return true;
    } else {
      return false;
    }
  }
  function musicPlayerContextMenu(ev) {
    const li = this;
    if (ev.ctrlKey && player.querySelector('.playlist .isselected')) {
      // Select multiple with ctrl key
      musicPlayerContextMenuCtrl.call(li, ev);
      return;
    }
    if (ev.shiftKey && musicPlayerContextMenuLastSelectedLi && musicPlayerContextMenuLastSelectedLi.classList.contains('isselected')) {
      // Select multiple with shift key
      if (musicPlayerContextMenuShift.call(li, ev)) {
        return;
      }
    }
    player.querySelectorAll('.playlist .isselected').forEach(e => e.classList.remove('isselected'));
    const oldMenu = document.getElementById('discographyplayer_contextmenu');
    if (oldMenu) {
      removeViaQuerySelector('#discographyplayer_contextmenu');
      if (li.dataset.id && li.dataset.id === oldMenu.dataset.id) {
        return;
      }
    }
    li.classList.add('isselected');
    musicPlayerContextMenuLastSelectedLi = li;
    const div = document.body.appendChild(document.createElement('div'));
    li.dataset.id = Math.random();
    div.dataset.id = li.dataset.id;
    div.setAttribute('id', 'discographyplayer_contextmenu');
    div.style.left = ev.pageX + 11 + 'px';
    div.style.top = ev.pageY + 'px';
    const menuEntries = [];
    if (li.classList.contains('playlistentry') || li.classList.contains('playlistheading')) {
      menuEntries.push(['Remove selected', 'Remove selected tracks or albums from playlist\nSelect more with CTRL + Right click', removeSelectedFromPlaylist]);
    }
    if (li.classList.contains('playlistentry')) {
      menuEntries.push(['Play track', 'Start playback', musicPlayerOnPlaylistClick]);
    }
    if (li.classList.contains('playlistheading')) {
      menuEntries.push(['Play album', 'Start playback', musicPlayerOnPlaylistHeadingClick]);
    }
    menuEntries.forEach(function (menuEntry) {
      const subMenu = div.appendChild(document.createElement('div'));
      subMenu.classList.add('contextmenu_submenu');
      subMenu.appendChild(document.createTextNode(menuEntry[0]));
      subMenu.setAttribute('title', menuEntry[1]);
      subMenu.addEventListener('click', function (clickEvent) {
        menuEntry[2].call(li, clickEvent, div);
      });
    });
  }
  function musicPlayerOnPlaylistContextMenu(ev) {
    ev.preventDefault();
    musicPlayerContextMenu.call(this, ev);
  }
  function musicPlayerOnPlaylistHeadingContextMenu(ev) {
    ev.preventDefault();
    musicPlayerContextMenu.call(this, ev);
  }
  function musicPlayerFavicon(url) {
    removeViaQuerySelector(document.head, 'link[rel*=icon]');
    const link = document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = url;
    document.head.appendChild(link);
  }
  function musicPlayerCollectWishlistClick(ev) {
    ev.preventDefault();
    if (player.querySelector('.collect-wishlist').dataset === 'own') {
      return;
    }
    let url = player.querySelector('.collect-wishlist').dataset.albumUrl;
    if (this.classList.contains('track') && player.querySelector('.collect-wishlist').dataset.trackUrl) {
      // Wishlist track
      url = player.querySelector('.collect-wishlist').dataset.trackUrl;
    }
    player.querySelectorAll('.collect-wishlist>*').forEach(function (e) {
      e.style.display = 'none';
    });
    window.open(url + '#collect-wishlist');
  }
  async function musicPlayerCollectListenedClick(ev) {
    ev.preventDefault();
    const collectListened = player.querySelector('.collect-listened');
    const url = collectListened.dataset.albumUrl;
    window.setTimeout(function musicPlayerCollectListenedResetTimeout() {
      player.querySelectorAll('.collect-listened>*').forEach(function (e) {
        e.style.display = 'none';
      });
      player.querySelector('.collect-listened .listened-saving').style.display = 'inline-block';
      player.querySelector('.collect-listened').style.cursor = 'wait';
    }, 0);
    let albumData = await myAlbumsGetAlbum(url);
    if (!albumData) {
      albumData = await myAlbumsNewFromUrl(url, {});
    }
    if (albumData.listened) {
      albumData.listened = false;
    } else {
      albumData.listened = new Date().toJSON();
    }
    collectListened.dataset.listened = albumData.listened;
    await myAlbumsUpdateAlbum(albumData);
    player.querySelectorAll('.collect-listened>*').forEach(function (e) {
      e.style.display = 'none';
    });
    if (albumData.listened) {
      player.querySelector('.collect-listened .listened').style.display = 'inline-block';
    } else {
      player.querySelector('.collect-listened .mark-listened').style.display = 'inline-block';
    }
    player.querySelector('.collect-listened').style.cursor = '';
    window.setTimeout(makeAlbumLinksGreat, 100);
  }
  function musicPlayerUpdatePositionState() {
    if ('mediaSession' in navigator && 'setPositionState' in navigator.mediaSession) {
      navigator.mediaSession.setPositionState({
        duration: audio.duration || currentDuration || 180,
        playbackRate: audio.playbackRate,
        position: audio.currentTime
      });
    }
  }
  function musicPlayerCookieChannel(onStopEventCb) {
    if (!BANDCAMPDOMAIN) {
      return;
    }
    window.addEventListener('message', function onMessage(event) {
      // Receive messages from the cookie channel event handler
      if (event.origin === document.location.protocol + '//' + document.location.hostname && event.data && typeof event.data === 'object' && 'discographyplayerCookiechannelPlaylist' in event.data && event.data.discographyplayerCookiechannelPlaylist === 'stop') {
        onStopEventCb(event.data.discographyplayerCookiechannelPlaylist);
      }
    });
    const script = document.createElement('script');
    script.innerHTML = `
  if(typeof Cookie !== 'undefined') {
    var channel = new Cookie.CommChannel('playback')
    channel.send('stop')
    channel.subscribe(function(a) {
      window.postMessage({'discographyplayerCookiechannelPlaylist': a}, document.location.href)
      })
    window.addEventListener('message', function onMessage (event) {
      // Receive messages from the user script
      if (event.origin === document.location.protocol + '//' + document.location.hostname
      && event.data && typeof(event.data) === 'object' && 'discographyplayerCookiechannelPlaylist' in event.data
      && event.data.discographyplayerCookiechannelPlaylist === 'sendstop') {
        channel.send('stop')
      }
    })
    window.addEventListener('unload', function(event) {
      channel.cleanup()
    })
  }
  `;
    document.head.appendChild(script);
  }
  function musicPlayerCookieChannelSendStop(onStopEventCb) {
    if (BANDCAMPDOMAIN) {
      window.postMessage({
        discographyplayerCookiechannelPlaylist: 'sendstop'
      }, document.location.href);
    }
  }
  function musicPlayerSaveState() {
    // Add remaining albums as headings
    addAllAlbumsAsHeadings();
    // Remove context menu and selection, we don't want to restore those
    player.querySelectorAll('.playlist .isselected').forEach(e => e.classList.remove('isselected'));
    removeViaQuerySelector('#discographyplayer_contextmenu');
    let startPlaybackIndex = false;
    const playlistEntries = player.querySelectorAll('.playlist .playlistentry');
    for (let i = 0; i < playlistEntries.length; i++) {
      if (playlistEntries[i].classList.contains('playing')) {
        startPlaybackIndex = i;
        break;
      }
    }
    const sessionID = player.dataset.sessionID || crypto.randomUUID();
    const sessionName = player.dataset.sessionName || '';
    const startPlaybackTime = audio.currentTime;
    const musicPlayerState = {
      sessionID,
      sessionName,
      time: new Date().getTime(),
      htmlPlaylist: player.querySelector('.playlist').innerHTML,
      startPlayback: !audio.paused,
      startPlaybackIndex,
      startPlaybackTime,
      shuffleActive: player.querySelector('.shufflebutton').classList.contains('active')
    };
    GM.setValue('musicPlayerState', JSON.stringify(musicPlayerState));

    // Also store data in the sessions
    const lastSong = player.querySelector('.currentlyPlaying .info').innerText.split('\n').join(' ');
    const lastCover = player.querySelector('.currentlyPlaying .cover img[src').src;
    const fiveArtists = shuffleIterable(new Set([...document.querySelectorAll('.playlist .playlistentry[data-artist]')].map(e => e.dataset.artist))).slice(0, 5);
    const initUrl = player.dataset.initUrl;
    const initTime = player.dataset.initTime;
    const sessionJSON = JSON.stringify({
      sessionName,
      lastSong,
      lastCover,
      fiveArtists,
      initUrl,
      initTime,
      lastTime: new Date().getTime()
    });
    getGMValues({
      musicPlayerSessionsMetas: '{}',
      musicPlayerSessionsStates: '{}'
    }).then(stringData => {
      const metas = JSON.parse(stringData.musicPlayerSessionsMetas);
      const states = JSON.parse(stringData.musicPlayerSessionsStates);
      metas[sessionID] = sessionJSON;
      states[sessionID] = musicPlayerState;
      setGMValues({
        musicPlayerSessionsMetas: JSON.stringify(metas),
        musicPlayerSessionsStates: JSON.stringify(states)
      });
    });
  }
  function musicPlayerRestoreState(state) {
    if (!allFeatures.discographyplayerPersist.enabled) {
      return;
    }
    if (state.time + 1000 * 30 < new Date().getTime()) {
      // Saved state expires after 30 seconds
      return;
    }

    // Re-create music player
    musicPlayerCreate();
    if ('sessionID' in state) {
      player.dataset.sessionID = state.sessionID;
    }
    if ('sessionName' in state) {
      player.dataset.sessionName = state.sessionName;
    }
    player.querySelector('.playlist').innerHTML = state.htmlPlaylist;
    const playlistEntries = player.querySelectorAll('.playlist .playlistentry');
    playlistEntries.forEach(function addPlaylistEntryOnClick(li) {
      li.addEventListener('click', musicPlayerOnPlaylistClick);
      li.addEventListener('contextmenu', musicPlayerOnPlaylistContextMenu);
    });
    player.querySelectorAll('.playlist .playlistheading').forEach(function addPlaylistHeadingEntryOnClick(li) {
      li.addEventListener('click', musicPlayerOnPlaylistHeadingClick);
      li.addEventListener('contextmenu', musicPlayerOnPlaylistHeadingContextMenu);
    });
    if (state.startPlaybackIndex !== false) {
      player.querySelectorAll('.playlist .playing').forEach(function (el) {
        el.classList.remove('playing');
      });
      playlistEntries[state.startPlaybackIndex].classList.add('playing');
      window.setTimeout(() => player.querySelector('.playlist .playing').scrollIntoView({
        block: 'nearest'
      }), 200);
    }
    // Start playback
    if (state.startPlayback && state.startPlaybackIndex !== false) {
      musicPlayerPlaySong(playlistEntries[state.startPlaybackIndex], state.startPlaybackTime);
    }
    if ('shuffleActive' in state && state.shuffleActive) {
      player.querySelector('.shufflebutton').classList.add('active');
    }
  }
  function musicPlayerPlaylistOnDragEnter(ev) {
    player.querySelector('.playlist').classList.add('dropbox');
    if (allFeatures.discographyplayerFullHeightPlaylist.enabled && !allFeatures.discographyplayerSidebar.enabled) {
      musicPlayerPlaylistFullHeight.apply(player.querySelector('.playlist'));
    }
  }
  function musicPlayerPlaylistOnDragLeave(ev) {
    if (ev && !ev.target.classList.contains('playlist')) {
      player.querySelector('.playlist').classList.remove('dropbox');
    }
  }
  function musicPlayerPlaylistOnDrop(ev) {
    stopPropagationDefault(ev);

    // Extract urls from dragged content and add each /album or /track url to the playlist

    const getStringAsPromise = dataTransferItem => new Promise(resolve => dataTransferItem.getAsString(resolve));
    const getItemsAsStrings = dataTransferItemList => {
      const promises = [];
      for (const item of dataTransferItemList) {
        promises.push(getStringAsPromise(item));
      }
      return Promise.all(promises);
    };
    if (ev.dataTransfer.items) {
      const urlMap = new Map(); // Remembers insertion order
      getItemsAsStrings(ev.dataTransfer.items).then(strings => {
        for (const s of strings) {
          for (const m of `\n${s}\n`.matchAll(/(https?:\/\/.+?)[\s"'<$]/gim)) {
            const url = m[1].replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
            if (url.indexOf('/album/') !== -1 || url.indexOf('/track/') !== -1) {
              urlMap.set(url, true);
            }
          }
        }
        const urls = [...urlMap.keys()];
        if (urls.length === 0) {
          player.querySelector('.playlist').classList.remove('dropbox', 'processing');
          return;
        }
        player.querySelector('.playlist').classList.add('processing');
        for (let i = 0; i < urls.length; i++) {
          window.setTimeout(async function () {
            await addAlbumFromUrlIfNotInPlaylist(urls[i]);
            player.querySelector('.playlist').classList.remove('dropbox', 'processing');
          }, i * 100);
        }
      });
    } else {
      player.querySelector('.playlist').classList.remove('dropbox', 'processing');
    }
  }
  function musicPlayerToggleMinimize(ev, hide) {
    if (hide || player.style.bottom !== '-57px') {
      player.style.bottom = '-57px';
      this.classList.add('minimized');
    } else {
      player.style.bottom = '0px';
      this.classList.remove('minimized');
    }
  }
  function musicPlayerPlaylistFullHeight() {
    // Extend the playlist to the full height of the window
    if ('mode' in this.dataset && this.dataset.mode === 'full_height') {
      // Already in full height mode
      return;
    }
    // Store width so it does not change on multiple mouse-overs
    this.dataset.mode = 'full_height';
    let width = this.clientWidth;
    if ('width' in this.dataset) {
      width = this.dataset.width;
    } else {
      this.dataset.width = width;
    }
    // Set CSS to full height
    this.style.position = 'fixed';
    this.style.maxHeight = '100%';
    this.style.height = '100%';
    this.style.maxWidth = `${width}px`;
    this.style.width = `${width}px`;
    this.style.top = '0px';
  }
  function musicPlayerPlaylistNormalHeight() {
    // Revert the playlist to the normal height of the discography player
    if ('mode' in this.dataset && this.dataset.mode !== 'full_height') {
      // Already in normal height mode
      return;
    }
    if (document.getElementById('discographyplayer_contextmenu')) {
      // Context menu is open, don't change the height
      return;
    }
    this.dataset.mode = 'normal';

    // Revert CSS
    this.style.position = '';
    this.style.maxHeight = '';
    this.style.maxWidth = '';
    this.style.top = '';
  }
  function musicPlayerClose() {
    if (player) {
      player.style.display = 'none';
    }
    if (audio) {
      audio.pause();
    }
    document.querySelectorAll('img.albumIsCurrentlyPlaying').forEach(img => img.classList.remove('albumIsCurrentlyPlaying'));
    document.querySelectorAll('.albumIsCurrentlyPlayingIndicator').forEach(div => div.remove());
  }
  function musicPlayerCreate() {
    if (player) {
      player.style.display = 'block';
      return;
    }
    musicPlayerCookieChannel(_ => musicPlayerStop());
    const img1px = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOsmLZvJgAFwQJn5VVZ5QAAAABJRU5ErkJggg==';
    const listenedListUrl = findUserProfileUrl() + '#listened-tab';
    const checkSymbol = NOEMOJI ? '✓' : '✔';
    player = document.createElement('div');
    document.body.appendChild(player);
    player.id = 'discographyplayer';
    player.dataset.sessionID = crypto.randomUUID();
    player.dataset.initUrl = document.location.href;
    player.dataset.initTime = new Date().getTime();
    player.innerHTML = `
<div class="col col25 nowPlaying">
  <div class="currentlyPlaying">
    <a class="cover" target="_blank" href="#">
      <img src="${img1px}">
    </a>
    <div class="info">
      <a class="link" target="_blank" href="#">
        <div class="title">◧◩◨▧■□▩</div>
        <div class="artist">by <span>◩▧◧□ ◩◨▧ ■◩▩</span></div>
        <div>from <span class="album">◨■■▩ ▧◨□</span></div>
      </a>
    </div>
  </div>
  <div class="nextInRow">
    <a class="cover" target="_blank" href="#">
      <img src="${img1px}">
    </a>
    <div class="info">
      <a class="link" target="_blank" href="#">
        <div class="title">◧◩◨▧■□▩</div>
        <div>by <span class="artist">◩▧◧□ ◩◨▧ ■◩▩</span></div>
        <div>from <span class="album">◨■■▩ ▧◨□</span></div>
      </a>
    </div>
  </div>
</div>
<div class="col col25 colcontrols">
  <audio autoplay="autoplay" preload="auto"></audio>
  <div class="audioplayer">
    <div id="timeline">
      <div id="bufferbar" class="bufferbaranimation"></div>
      <div id="playhead"></div>
    </div>
    <div class="controls">

      <div class="prevalbum" title="Previous album">
        <div class="arrowbutton prevalbum-icon"></div>
      </div>

      <div class="prev" title="Previous song">
        <div class="arrowbutton prev-icon"></div>
      </div>

      <div class="playpause" title="Play/Pause">
        <div class="play" style="display: none;"></div>
        <div class="busy" style="display: none;"></div>
        <div class="pause" style=""></div>
      </div>

      <div class="next" title="Next song">
        <div class="arrowbutton next-icon"></div>
      </div>

      <div class="nextalbum" title="Next album">
        <div class="arrowbutton nextalbum-icon"></div>
      </div>

      <div class="shuffleswitch" title="Shuffle">
        <div class="shufflebutton" style="background-image:${spriteRepeatShuffle}"></div>
      </div>

    </div>
    
    <div class="durationDisplay"><span class="current">-</span>/<span class="total">-</span></div>

    <a class="downloadlink" title="Download mp3">
      ⭳
    </a>
    <br class="clb">
  </div>
</div>
<div class="col col35">
  <ol class="playlist"></ol>
</div>
<div class="col col15 colcontrols colvolumecontrols">

  <div class="vol">
      <div class="vol-icon-wrapper" title="Mute">
          🔊
      </div>
      <div class="vol-slider">
          <div class="vol-amt" style="width: 100%;"></div>
          <div class="vol-bg"></div>
      </div>
  </div>

  <div class="collect">
    <div class="collect-wishlist">
      <a class="wishlist-default" href="https://bandcamp.com/wishlist">Wishlist</a>

      <span class="wishlist-add">
        <span class="bc-ui2 icon add-item-icon"></span>
        <span class="add-item-label track" title="Add this song to your wishlist">Add song</span>
        <span class="slash">/</span>
        <span class="add-item-label album" title="Add this album to your wishlist">Add album to wishlist</span>
      </span>
      <span class="wishlist-collected">
        <span class="bc-ui2 icon collected-item-icon"></span>
        <span>In Wishlist</span>
      </span>
      <span class="wishlist-own" title="You own this album">
        <span class="bc-ui2 icon own-item-icon"></span>
        <span>You own this</span>
      </span>
      <span class="wishlist-saving">
        Saving....
      </span>
    </div>
    <div class="collect-listened">
      <a class="listened-default" href="${listenedListUrl}">
        Played albums
        </a>
      <span class="listened" title="Mark album as NOT played">
        <span class="listened-symbol">${checkSymbol}</span>
        <span class="listened-label">Played</span>
      </span>
      <span class="mark-listened" title="Mark album as played">
        <span class="mark-listened-symbol">${checkSymbol}</span>
        <span class="mark-listened-label">Mark as played</span>
      </span>
      <span class="listened-saving">
        Saving...
      </span>
    </div>
  </div>

  <br class="cll">
  <div class="minimizebutton">
    <span class="minimized" title="Maximize player">&uarr;</span>
    <span class="maximized" title="Minimize player">&darr;</span>
  </div>
  <div class="closebutton" title="Close player">x</div>
</div>`;
    addStyle(discographyplayerCSS);
    if (allFeatures.discographyplayerSidebar.enabled) {
      // Sidebar discographyplayer
      addStyle(discographyplayerSidebarCSS);
    }
    audio = player.querySelector('audio');
    addLogVolume(audio);
    getStoredVolume(function setVolumeCallback(volume) {
      audio.logVolume = volume;
    });
    playhead = player.querySelector('#playhead');
    bufferbar = player.querySelector('#bufferbar');
    timeline = player.querySelector('#timeline');
    player.querySelector('.minimizebutton').addEventListener('click', musicPlayerToggleMinimize);
    player.querySelector('.closebutton').addEventListener('click', musicPlayerClose);
    audio.addEventListener('ended', musicPlayerOnEnded);
    audio.addEventListener('timeupdate', musicPlayerOnTimeUpdate);
    audio.addEventListener('volumechange', musicPlayerOnVolumeChanged);
    audio.addEventListener('canplaythrough', function onCanPlayThrough() {
      currentDuration = audio.duration;
      player.querySelector('.durationDisplay .total').innerHTML = humanDuration(currentDuration);
    });
    timeline.addEventListener('click', musicPlayerOnTimelineClick, false);
    playhead.addEventListener('mousedown', musicPlayerOnPlayheadMouseDown, false);
    window.addEventListener('mouseup', musicPlayerOnPlayheadMouseUp, false);
    player.querySelector('.prevalbum').addEventListener('click', musicPlayerPrevAlbum);
    player.querySelector('.prev').addEventListener('click', musicPlayerPrev);
    player.querySelector('.playpause').addEventListener('click', musicPlayerPlay);
    player.querySelector('.next').addEventListener('click', musicPlayerNext);
    player.querySelector('.nextalbum').addEventListener('click', musicPlayerNextAlbum);
    player.querySelector('.shuffleswitch').addEventListener('click', musicPlayerToggleShuffle);
    player.querySelector('.vol-slider').addEventListener('click', musicPlayerOnVolumeClick);
    player.querySelector('.vol').addEventListener('wheel', musicPlayerOnVolumeWheel, {
      passive: false
    });
    player.querySelector('.vol-icon-wrapper').addEventListener('click', musicPlayerOnMuteClick);
    player.querySelector('.collect-wishlist .track').addEventListener('click', musicPlayerCollectWishlistClick);
    player.querySelector('.collect-wishlist .album').addEventListener('click', musicPlayerCollectWishlistClick);
    player.querySelector('.collect-listened').addEventListener('click', musicPlayerCollectListenedClick);
    player.querySelector('.downloadlink').addEventListener('click', function onDownloadLinkClick(ev) {
      const addSpinner = el => el.classList.add('downloading');
      const removeSpinner = el => el.classList.remove('downloading');
      downloadMp3FromLink(ev, this, addSpinner, removeSpinner);
    });
    const playlist = player.querySelector('.playlist');
    if (allFeatures.discographyplayerFullHeightPlaylist.enabled && !allFeatures.discographyplayerSidebar.enabled) {
      playlist.addEventListener('mouseover', musicPlayerPlaylistFullHeight);
      playlist.addEventListener('mouseout', musicPlayerPlaylistNormalHeight);
    }

    // Drag'n'drop zone
    playlist.addEventListener('dragenter', musicPlayerPlaylistOnDragEnter);
    playlist.addEventListener('dragleave', musicPlayerPlaylistOnDragLeave);
    playlist.addEventListener('dragover', stopPropagationDefault);
    playlist.addEventListener('drop', musicPlayerPlaylistOnDrop);
    if (NOEMOJI) {
      player.querySelector('.downloadlink').innerHTML = '↓';
    }
    window.addEventListener('unload', function onPageUnLoad(ev) {
      if (allFeatures.discographyplayerPersist.enabled && player.style.display !== 'none' && !audio.paused) {
        musicPlayerSaveState();
      }
    });
    window.setInterval(musicPlayerUpdateBufferBar, 1200);
  }
  function addHeadingToPlaylist(title, url, albumLoaded) {
    musicPlayerCreate();
    let content = document.createTextNode('💽 ' + title);
    if (url) {
      const a = document.createElement('a');
      a.href = url;
      a.target = '_blank';
      a.appendChild(content);
      content = a;
      a.className = albumLoaded ? 'loaded' : 'notloaded';
      a.title = 'Open album page';
    }
    const li = document.createElement('li');
    li.appendChild(content);
    li.className = 'playlistheading';
    if (!albumLoaded) {
      li.className += ' notloaded';
      li.title = 'Load album into playlist';
    }
    li.addEventListener('click', musicPlayerOnPlaylistHeadingClick);
    li.addEventListener('contextmenu', musicPlayerOnPlaylistHeadingContextMenu);
    player.querySelector('.playlist').appendChild(li);
  }
  function addToPlaylist(startPlayback, data) {
    musicPlayerCreate();
    const li = document.createElement('li');
    if (data.trackNumber != null && data.trackNumber !== 'null') {
      li.appendChild(document.createTextNode((data.trackNumber > 9 ? '' : '0') + data.trackNumber + '. ' + data.artist + ' - ' + data.title));
    } else {
      li.appendChild(document.createTextNode(data.artist + ' - ' + data.title));
    }
    const span = document.createElement('span');
    span.className = 'duration';
    span.appendChild(document.createTextNode(humanDuration(data.duration)));
    li.appendChild(span);
    li.value = data.trackNumber;
    li.dataset.file = data.file;
    li.dataset.title = data.title;
    li.dataset.trackNumber = data.trackNumber;
    li.dataset.duration = data.duration;
    li.dataset.artist = data.artist;
    li.dataset.album = data.album;
    li.dataset.albumUrl = data.albumUrl;
    li.dataset.albumCover = data.albumCover;
    li.dataset.inWishlist = data.inWishlist;
    li.dataset.isPurchased = data.isPurchased;
    li.dataset.isDownloadable = data.isDownloadable;
    li.dataset.trackUrl = data.trackUrl;
    li.addEventListener('click', musicPlayerOnPlaylistClick);
    li.addEventListener('contextmenu', musicPlayerOnPlaylistContextMenu);
    li.className = 'playlistentry';
    player.querySelector('.playlist').appendChild(li);
    if (startPlayback) {
      player.querySelectorAll('.playlist .playing').forEach(function (el) {
        el.classList.remove('playing');
      });
      li.classList.add('playing');
      musicPlayerPlaySong(li);
      window.setTimeout(() => player.querySelector('.playlist .playing').scrollIntoView({
        block: 'nearest'
      }), 200);
    }
  }
  function addAlbumToPlaylist(TralbumData, startPlaybackIndex = 0, startPlaybackSongId = null) {
    console.log('TralbumData', TralbumData);
    let i = 0;
    const artist = TralbumData.artist;
    const album = TralbumData.current.title;
    const albumUrl = document.location.protocol + '//' + albumKey(TralbumData.url);
    const albumCover = `https://f4.bcbits.com/img/a${TralbumData.art_id}_2.jpg`;
    addHeadingToPlaylist(album, 'url' in TralbumData ? TralbumData.url : false, true);
    let streamable = 0;
    for (const key in TralbumData.trackinfo) {
      const track = TralbumData.trackinfo[key];
      if (!track.file) {
        continue;
      }
      const trackNumber = track.track_num;
      const file = track.file[Object.keys(track.file)[0]];
      const title = track.title;
      const duration = track.duration;
      const trackUrl = track.title_link;
      const inWishlist = 'tralbum_collect_info' in TralbumData && 'is_collected' in TralbumData.tralbum_collect_info && TralbumData.tralbum_collect_info.is_collected;
      const isDownloadable = track.is_downloadable === true;
      const isPurchased = 'tralbum_collect_info' in TralbumData && 'is_purchased' in TralbumData.tralbum_collect_info && TralbumData.tralbum_collect_info.is_purchased;
      const startPlayback = startPlaybackSongId !== null && startPlaybackSongId === track.id || startPlaybackIndex === i++;
      addToPlaylist(startPlayback, {
        file,
        title,
        trackNumber,
        trackUrl,
        duration,
        artist,
        album,
        albumUrl,
        albumCover,
        inWishlist,
        isDownloadable,
        isPurchased
      });
      streamable++;
    }
    if (streamable === 0) {
      const li = document.createElement('li');
      li.appendChild(document.createTextNode((NOEMOJI ? '\u27C1' : '\uD83D\uDE22') + ' Album is not streamable'));
      player.querySelector('.playlist').appendChild(li);
    }
    player.querySelectorAll('.playlist .playlistheading a.notloaded').forEach(function (el) {
      // Move unloaded items to the end
      el.parentNode.parentNode.appendChild(el.parentNode);
    });
  }
  function addAllAlbumsAsHeadings() {
    const as = Array.from(document.querySelectorAll('.music-grid .music-grid-item a[href*="/album/"],.music-grid .music-grid-item a[href*="/track/"]'));
    // "Discover"-page
    as.push(...document.querySelectorAll('.results-grid-item a[href*="/album/"],.results-grid-item a[href*="/track/"]'));
    // Profile "Feed"
    as.push(...document.querySelectorAll('.collect-item ul li.buy-now a[href*="/album/"], .collect-item ul li.buy-now a[href*="/track/"]'));
    const lis = player.querySelectorAll('.playlist .playlistentry');
    const unloadedAs = player.querySelectorAll('.playlist .playlistheading.notloaded a');
    const alreadyAddedAlbums = {};
    const isAlreadyInPlaylist = function (url) {
      if (url in alreadyAddedAlbums) {
        return true;
      }
      alreadyAddedAlbums[url] = true;
      for (let i = 0; i < lis.length; i++) {
        if (albumKey(lis[i].dataset.albumUrl) === albumKey(url)) {
          return true;
        }
      }
      for (let i = 0; i < unloadedAs.length; i++) {
        if (albumKey(unloadedAs[i].href) === albumKey(url)) {
          return true;
        }
      }
      return false;
    };
    for (let i = 0; i < as.length; i++) {
      let url = as[i].href;
      url = url.split('?')[0];
      // Check if already in playlist
      if (!isAlreadyInPlaylist(url)) {
        let title = url.replace('https://', '').replace('http://', '').replace(BANDCAMPDOMAIN, '').replace('bandcamp.com', '').replace('bandcamp.', '').replace('www.', '').replace(/\/$/, ''); // This is just a fallback title

        if ('textContent' in as[i].dataset) {
          title = as[i].dataset.textContent;
        } else if (as[i].querySelector('.title')) {
          title = as[i].querySelector('.title').textContent.trim();
        } else if (as[i].parentNode.parentNode.querySelector('.item-link')) {
          // User profile collection:
          const itemLink = as[i].parentNode.parentNode.querySelector('.item-link');
          if ('textContent' in itemLink.dataset) {
            title = itemLink.dataset.textContent;
          } else if (itemLink.querySelector('.title')) {
            title = as[i].querySelector('.title').textContent.trim();
          } else if (itemLink.querySelector('.collection-item-title')) {
            title = as[i].querySelector('.collection-item-title').textContent.trim();
          }
        }
        addHeadingToPlaylist(title, url, false);
      }
    }
  }
  let getTralbumDataDelay = 0;
  function getTralbumData(url, retry = true) {
    return new Promise(function getTralbumDataPromise(resolve, reject) {
      GM.xmlHttpRequest({
        method: 'GET',
        url,
        onload: function getTralbumDataOnLoad(response) {
          if (!response.responseText || response.responseText.indexOf('400 Bad Request') !== -1) {
            let msg = '';
            try {
              msg = response.responseText.split('<center>')[1].split('</center>')[0];
            } catch (e) {
              msg = response.responseText;
            }
            window.alert('An error occured. Please clear your cookies of bandcamp.com and try again.\n\nOriginal error:\n' + msg);
            reject(new Error('Too many cookies'));
            return;
          }
          if (!response.responseText || response.responseText.indexOf('429 Too Many Requests') !== -1) {
            if (retry) {
              retry = false;
              getTralbumDataDelay += 3;
              const delay = getTralbumDataDelay;
              console.warn(`getTralbumData(): 429 Too Many Requests. Trying again in ${delay} seconds`);
              window.setTimeout(() => getTralbumDataPromise(resolve, reject), delay * 1000);
              return;
            }
            let msg = '';
            try {
              msg = response.responseText.split('<center>')[1].split('</center>')[0];
            } catch (e) {
              msg = response.responseText;
            }
            window.alert('An error occured. You\'re probably being rate limited by bandcamp.\n\nOriginal error:\n' + msg);
            reject(new Error('429 Too Many Requests'));
            return;
          }
          let TralbumData = null;
          try {
            if (response.responseText.indexOf('var TralbumData =') !== -1) {
              TralbumData = JSON5.parse(response.responseText.split('var TralbumData =')[1].split('\n};\n')[0].replace(/"\s+\+\s+"/, '') + '\n}');
            } else if (response.responseText.indexOf('data-tralbum="') !== -1) {
              const str = decodeHTMLentities(response.responseText.split('data-tralbum="')[1].split('"')[0]);
              TralbumData = JSON.parse(str);
              if (retry && TralbumData && 'url' in TralbumData && Object.keys(TralbumData).length === 1) {
                retry = false;
                // Discography page -> try to get first album
                console.debug('getTralbumDataPromise(), Not a album page, try to find first album');
                const firstAlbumM = response.responseText.split('id="music-grid"')[1].match(/<a.*?href="(.*?(album|track)\/.+?)"/);
                if (firstAlbumM && firstAlbumM[1]) {
                  let firstAlbumUrl = firstAlbumM[1];
                  if (!firstAlbumUrl.startsWith('http')) {
                    const hostname = new window.URL(response.finalUrl).hostname;
                    if (firstAlbumUrl.startsWith('/')) {
                      firstAlbumUrl = `https://${hostname}${firstAlbumUrl}`;
                    } else {
                      firstAlbumUrl = `https://${hostname}/${firstAlbumUrl}`;
                    }
                  }
                  if (url !== firstAlbumUrl) {
                    url = firstAlbumUrl;
                    console.debug('getTralbumDataPromise(), Not a album page, new url=', url);
                    window.setTimeout(() => getTralbumDataPromise(resolve, reject), 500);
                    return;
                  }
                }
              }

              // Try to add tralbum_collect_info / TralbumCollectInfo
              if (TralbumData && response.responseText.indexOf('data-tralbum-collect-info="') !== -1) {
                const collectInfoStr = decodeHTMLentities(response.responseText.split('data-tralbum-collect-info="')[1].split('"')[0]);
                TralbumData.tralbum_collect_info = JSON.parse(collectInfoStr);
              }
            }
          } catch (e) {
            window.alert('An error occured when parsing TralbumData from url=' + url + '.\n\nOriginal error:\n' + e);
            reject(e);
            return;
          }
          if (TralbumData) {
            correctTralbumData(TralbumData, response.responseText);
            resolve(TralbumData);
          } else {
            const msg = 'Could not parse TralbumData from url=' + url;
            window.alert(msg);
            console.error(response.responseText);
            reject(new Error(msg));
          }
        },
        onerror: function getTralbumDataOnError(response) {
          console.error('getTralbumData(' + url + ') in onerror() Error: ' + response.status + '\nResponse:\n' + response.responseText + '\n' + ('error' in response ? response.error : ''));
          reject(new Error('error' in response ? response.error : 'getTralbumData failed with GM.xmlHttpRequest.onerror'));
        }
      });
    });
  }
  function correctTralbumData(TralbumDataObj, html) {
    const TralbumData = JSON.parse(JSON.stringify(TralbumDataObj));
    // Corrections for single tracks
    if (TralbumData.current.type === 'track' && TralbumData.current.title.toLowerCase().indexOf('single') === -1) {
      TralbumData.current.title += ' - Single';
    }
    for (let i = 0; i < TralbumData.trackinfo.length; i++) {
      if (TralbumData.trackinfo[i].track_num === null) {
        TralbumData.trackinfo[i].track_num = i + 1;
      }
    }
    // Add tags from html
    if (html && html.indexOf('tags-inline-label') !== -1) {
      const m = html.split('tags-inline-label')[1].split('</div>')[0].match(/\/tag\/[^"]+"/g);
      if (m && m.length > 0) {
        TralbumData.tags = [];
        m.forEach(function (t) {
          t = t.split('/').pop();
          t = t.substring(0, t.length - 1);
          TralbumData.tags.push(t);
        });
      }
    }
    // Remove stuff we don't use to save storage space
    delete TralbumData.current.require_email_0;
    delete TralbumData.current.audit;
    delete TralbumData.current.download_pref;
    delete TralbumData.current.set_price;
    delete TralbumData.current.killed;
    delete TralbumData.current.auto_repriced;
    delete TralbumData.current.minimum_price_nonzero;
    delete TralbumData.current.minimum_price;
    delete TralbumData.current.purchase_url;
    delete TralbumData.current.new_desc_format;
    delete TralbumData.current.private;
    delete TralbumData.current.is_set_price;
    delete TralbumData.current.require_email;
    delete TralbumData.current.upc;
    delete TralbumData.packages;
    delete TralbumData.last_subscription_item;
    delete TralbumData.last_subscription_item;
    delete TralbumData.has_discounts;
    delete TralbumData.is_bonus;
    delete TralbumData.play_cap_data;
    delete TralbumData.client_id_sig;
    delete TralbumData.is_purchased;
    delete TralbumData.items_purchased;
    delete TralbumData.is_private_stream;
    delete TralbumData.is_band_member;
    delete TralbumData.licensed_version_ids;
    delete TralbumData.package_associated_license_id;
    for (let i = 0; i < TralbumData.trackinfo.length; i++) {
      delete TralbumData.trackinfo[i].is_draft;
      delete TralbumData.trackinfo[i].album_preorder;
      delete TralbumData.trackinfo[i].unreleased_track;
      delete TralbumData.trackinfo[i].encoding_error;
      delete TralbumData.trackinfo[i].video_mobile_url;
      delete TralbumData.trackinfo[i].encoding_pending;
      delete TralbumData.trackinfo[i].video_poster_url;
      delete TralbumData.trackinfo[i].video_source_type;
      delete TralbumData.trackinfo[i].video_source_id;
      delete TralbumData.trackinfo[i].video_mobile_url;
      delete TralbumData.trackinfo[i].video_caption;
      delete TralbumData.trackinfo[i].video_featured;
      delete TralbumData.trackinfo[i].video_id;
      for (const attr in TralbumData.trackinfo[i]) {
        if (TralbumData.trackinfo[i][attr] === null) {
          delete TralbumData.trackinfo[i][attr];
        }
      }
    }
    for (const attr in TralbumData) {
      if (TralbumData[attr] === null) {
        delete TralbumData[attr];
      }
    }
    return TralbumData;
  }
  function albumKey(url) {
    if (url.startsWith('/')) {
      url = document.location.hostname + url;
    }
    if (url.indexOf('://') !== -1) {
      url = url.split('://')[1];
    }
    if (url.indexOf('#') !== -1) {
      url = url.split('#')[0];
    }
    if (url.indexOf('?') !== -1) {
      url = url.split('?')[0];
    }
    return url;
  }
  function albumPath(url) {
    if (url.startsWith('/')) {
      return albumKey(url);
    }
    const a = document.createElement('a');
    a.href = url;
    return a.pathname;
  }
  async function cacheSet(gmKey, expires, key, value) {
    const cache = JSON.parse(await GM.getValue(gmKey, '{}'));
    const now = new Date().getTime();
    for (const prop in cache) {
      // Delete cached values, that are older than `expires`
      if (now - new Date(cache[prop].time).getTime() > expires) {
        delete cache[prop];
      }
    }
    const data = {
      value,
      time: new Date().toJSON()
    };
    cache[key] = data;
    await GM.setValue(gmKey, JSON.stringify(cache));
  }
  async function cacheGet(gmKey, expires, key, defaultsTo = null) {
    const cache = JSON.parse(await GM.getValue(gmKey, '{}'));
    const now = new Date().getTime();
    for (const prop in cache) {
      // Delete cached values, that are older than `expires`
      if (now - new Date(cache[prop].time).getTime() > expires) {
        delete cache[prop];
        continue;
      }
      if (prop === key) {
        return cache[prop].value;
      }
    }
    return defaultsTo;
  }
  async function storeTralbumData(TralbumData) {
    const expires = TRALBUM_CACHE_HOURS * ONEHOUR;
    const cache = JSON.parse(await GM.getValue('tralbumdata', '{}'));
    for (const prop in cache) {
      // Delete cached values, that are older than 2 hours
      if (new Date().getTime() - new Date(cache[prop].time).getTime() > expires) {
        delete cache[prop];
      }
    }
    TralbumData.time = new Date().toJSON();
    cache[albumKey(TralbumData.url)] = TralbumData;
    await GM.setValue('tralbumdata', JSON.stringify(cache));
    storeTralbumDataPermanently(TralbumData);
  }
  async function cachedTralbumData(url) {
    const expires = TRALBUM_CACHE_HOURS * ONEHOUR;
    const key = albumKey(url);
    const cache = JSON.parse(await GM.getValue('tralbumdata', '{}'));
    for (const prop in cache) {
      // Delete cached values, that are older than 2 hours
      if (new Date().getTime() - new Date(cache[prop].time).getTime() > expires) {
        delete cache[prop];
        continue;
      }
      if (prop === key) {
        return cache[prop];
      }
    }
    return false;
  }
  async function storeTralbumDataPermanently(TralbumData) {
    if (!storeTralbumDataPermanentlySwitch) {
      return;
    }
    const library = JSON.parse(await GM.getValue('tralbumlibrary', '{}'));
    const key = albumKey(TralbumData.url);
    if (key in library) {
      library[key] = Object.assign(library[key], TralbumData);
    } else {
      library[key] = TralbumData;
    }
    await GM.setValue('tralbumlibrary', JSON.stringify(library));
  }
  async function deletePermanentTralbum(url) {
    const library = JSON.parse(await GM.getValue('tralbumlibrary', '{}'));
    const key = albumKey(url);
    if (key in library) {
      delete library[key];
      await GM.setValue('tralbumlibrary', JSON.stringify(library));
      return key;
    }
    return null;
  }
  function playAlbumFromCover(ev, url) {
    let parent = this;
    if (!url) {
      for (let j = 0; parent.tagName !== 'A' && j < 20; j++) {
        parent = parent.parentNode;
      }
      url = parent.href;
    }
    parent.classList.add('discographyplayer_currentalbum');

    // Check if already in playlist
    if (player) {
      musicPlayerCreate();
      const lis = player.querySelectorAll('.playlist .playlistentry');
      for (let i = 0; i < lis.length; i++) {
        if (albumKey(lis[i].dataset.albumUrl) === albumKey(url)) {
          lis[i].click();
          return;
        }
      }
    }

    // Load data
    cachedTralbumData(url).then(function onCachedTralbumDataLoaded(TralbumData) {
      if (TralbumData) {
        addAlbumToPlaylist(TralbumData);
      } else {
        playAlbumFromUrl(url);
      }
    });
  }
  function addAlbumFromUrlIfNotInPlaylist(url) {
    // Check if already in playlist
    if (player && player.querySelectorAll('.playlist .playlistentry')) {
      const lis = player.querySelectorAll('.playlist .playlistentry');
      for (let i = 0; i < lis.length; i++) {
        if (albumKey(lis[i].dataset.albumUrl) === albumKey(url)) {
          return;
        }
      }
    }
    return playAlbumFromUrl(url, null);
  }
  function playAlbumFromUrl(url, startPlaybackIndex = 0, startPlaybackSongId = null) {
    if (!url.startsWith('http')) {
      url = document.location.protocol + '//' + url;
    }
    return getTralbumData(url).then(function onGetTralbumDataLoaded(TralbumData) {
      storeTralbumData(TralbumData);
      return addAlbumToPlaylist(TralbumData, startPlaybackIndex, startPlaybackSongId);
    }).catch(function onGetTralbumDataError(e) {
      window.alert('Could not play and load album data from url:\n' + url + '\n' + ('error' in e ? e.error : e));
      console.error(e);
    });
  }
  async function myAlbumsGetAlbum(url) {
    const key = albumKey(url);
    const data = JSON.parse(await GM.getValue('myalbums', '{}'));
    if (key in data) {
      return data[key];
    } else {
      return false;
    }
  }
  async function myAlbumsUpdateAlbum(albumData) {
    const key = albumKey(albumData.url);
    const data = JSON.parse(await GM.getValue('myalbums', '{}'));
    if (key in data) {
      data[key] = Object.assign(data[key], albumData);
    } else {
      data[key] = albumData;
    }
    await GM.setValue('myalbums', JSON.stringify(data));
  }
  async function myAlbumsNewFromUrl(url, fallback) {
    // Get data from cache or load from url
    url = albumKey(url);
    const albumData = fallback || {};
    let TralbumData = await cachedTralbumData(url);
    if (!TralbumData) {
      try {
        TralbumData = await getTralbumData(document.location.protocol + '//' + url);
      } catch (e) {
        console.error('myAlbumsNewFromUrl() Could not load album data from url:\n' + url);
      }
      if (TralbumData) {
        storeTralbumData(TralbumData);
      }
    }
    if (TralbumData) {
      albumData.artist = TralbumData.artist;
      albumData.title = TralbumData.current.title;
      albumData.albumCover = `https://f4.bcbits.com/img/a${TralbumData.art_id}_2.jpg`;
      albumData.releaseDate = TralbumData.current.release_date;
    }
    albumData.url = url;
    albumData.listened = false;
    return albumData;
  }
  function makeAlbumCoversGreat() {
    if (!('makeAlbumCoversGreat' in document.head.dataset)) {
      document.head.dataset.makeAlbumCoversGreat = true;
      const campExplorerCSS = `
.music-grid-item {
  position: relative
}
.music-grid-item .art-play {
  margin-top: -50px;
}
`;
      addStyle(`
.music-grid-item .art-play {
  position: absolute;
  width: 74px;
  height: 54px;
  left: 50%;
  top: 50%;
  margin-left: -36px;
  margin-top: -27px;
  opacity: 0;
  transition: opacity 0.2s;
}
.music-grid-item .art-play-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background: #000;
  border-radius: 4px;
}
.music-grid-item .art-play-icon {
  position: absolute;
  width: 0;
  height: 0;
  left: 28px;
  top: 17px;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
  border-style: dashed dashed dashed solid;
}
.music-grid-item:hover .art-play {
  opacity: 0.6;
}

${CAMPEXPLORER ? campExplorerCSS : ''}
`);
    }
    const onclick = function onclick(ev) {
      ev.preventDefault();
      playAlbumFromCover.apply(this, ev);
    };
    const artPlay = document.createElement('div');
    artPlay.className = 'art-play';
    artPlay.innerHTML = '<div class="art-play-bg"></div><div class="art-play-icon"></div>';
    if (CAMPEXPLORER) {
      document.querySelectorAll('ul.albums').forEach(e => e.classList.add('music-grid'));
      document.querySelectorAll('ul.albums li.album').forEach(e => e.classList.add('music-grid-item'));
    }

    // Albums, single tracks, artists, label etc
    const imgs = document.querySelectorAll('.music-grid .music-grid-item a[href] img');
    for (let i = 0; i < imgs.length; i++) {
      if (imgs[i].parentNode.getElementsByClassName('art-play').length) {
        continue;
      }
      imgs[i].addEventListener('click', onclick);

      // Add play overlay
      const clone = artPlay.cloneNode(true);
      clone.addEventListener('click', onclick);
      imgs[i].parentNode.appendChild(clone);
    }
  }
  function makeUserProfileCollectionGreat() {
    // User profile collections pages are almost like discography page. To make them compatible, let's add the class names from the discography page
    document.querySelectorAll('.collection-grid').forEach(grid => grid.classList.add('music-grid'));
    document.querySelectorAll('.collection-grid .collection-item-container').forEach(cell => cell.classList.add('music-grid-item'));

    // Remove play art
    document.querySelectorAll('.collection-grid .collection-item-container .item_link_play').forEach(linkPlay => linkPlay.remove());

    // Add href to <a>
    document.querySelectorAll('.collection-grid .collection-item-container').forEach(container => {
      container.querySelector('a.track_play_auxiliary').href = container.querySelector('a.item-link[href]').href;
    });

    // Remove link to album art gallery
    document.querySelectorAll('.collection-grid .collection-item-container .package-details').forEach(packageDetails => packageDetails.remove());

    // Stop event listeners for bandcamp's own player
    document.querySelectorAll('.collection-grid .collection-item-container .collection-item-art-container').forEach(artContainer => {
      artContainer.addEventListener('click', stopPropagationDefault);
    });

    // Move art-icon a bit to the top (50%->30%)
    addStyle(`
      .collection-item-container.music-grid-item .art-play { top:30%; }
      .collection-item-container.music-grid-item .albumIsCurrentlyPlayingIndicator { top:30%; }
      `);

    // Make the page reload when clicking on the grid tabs (switching between wishlist and collection) to force the script to re-run
    const currentPathName = document.location.pathname;
    document.querySelectorAll('#grid-tabs').forEach(gridTab => {
      gridTab.addEventListener('click', () => {
        if (document.location.pathname !== currentPathName) {
          document.location.reload();
        }
      });
    });
  }
  function makeDiscoverSearchCoversGreatCss() {
    addStyle(`
  .results-grid-item {
    position: relative
  }
  .results-grid-item .art-play {
    margin-top: -50px;
  }
  .results-grid-item .art-play {
    position: absolute;
    width: 74px;
    height: 54px;
    left: 50%;
    top: 50%;
    margin-left: -36px;
    margin-top: -27px;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .results-grid-item .art-play-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: #000;
    border-radius: 4px;
  }
  .results-grid-item .art-play-icon {
    position: absolute;
    width: 0;
    height: 0;
    left: 28px;
    top: 17px;
    border-width: 10px 0 10px 17px;
    border-color: transparent transparent transparent #fff;
    border-style: dashed dashed dashed solid;
  }
  .results-grid-item:hover .art-play {
    opacity: 0.6;
    cursor:pointer;
  }
  `);
  }
  function discoverSearchCoverClick(ev) {
    // Block click events on the cover
    // but still allow clicking the small play button in the corner and the arrows for the slideshow
    let clickIsOnButton = false;
    let p;
    for (p = ev.target; !p.classList.contains('results-grid-item'); p = p.parentNode) {
      if (p.classList.contains('g-button')) {
        clickIsOnButton = true;
        break;
      }
    }
    if (!clickIsOnButton) {
      // Block click and use custom action
      ev.stopPropagation();
      const a = p.querySelector('.meta a[href]');
      playAlbumFromCover.call(this, ev, a.href);
    }
  }
  function makeDiscoverSearchCoversGreat() {
    let artPlay = false;
    document.querySelectorAll('.results-grid-item').forEach(function (div) {
      if ('makeDiscoverSearchCoversGreat' in div.dataset) {
        return;
      }
      div.dataset.makeDiscoverSearchCoversGreat = true;
      const imageCarousel = div.querySelector('.image-carousel');
      if (!imageCarousel) {
        return;
      }
      imageCarousel.addEventListener('click', discoverSearchCoverClick, true);

      // Add play overlay
      if (!artPlay) {
        artPlay = document.createElement('div');
        artPlay.className = 'art-play';
        artPlay.innerHTML = '<div class="art-play-bg"></div><div class="art-play-icon"></div>';
      }
      const clone = artPlay.cloneNode(true);
      clone.addEventListener('click', discoverSearchCoverClick);
      imageCarousel.appendChild(clone);
    });
  }
  async function makeAlbumLinksGreat(parentElement) {
    const doc = parentElement || document;
    const myalbums = JSON.parse(await GM.getValue('myalbums', '{}'));
    if (!('makeAlbumLinksGreat' in document.head.dataset)) {
      document.head.dataset.makeAlbumLinksGreat = true;
      addStyle(`
    .bdp_check_onlinkhover_container { z-index:1002; position:absolute; display:none }
    .bdp_check_onlinkhover_container_shown { display:block; background-color:rgba(255,255,255,0.9); padding:0px 2px 0px 0px; border-radius:5px  }
    .bdp_check_onlinkhover_container:hover { position:absolute; transition: all 300ms linear; background-color:rgba(255,255,255,0.9); padding:0px 10px 0px 7px; border-radius:5px }
    .bdp_check_onchecked_container { z-index:-1; position:absolute; opacity:0.0; margin-top:-2px}
    a:hover .bdp_check_onchecked_container { z-index:1002; position:absolute; transition: opacity 300ms linear; opacity:1.0}

    .bdp_check_onlinkhover_symbol {color:rgba(0,0,50,0.7)}
    .bdp_check_onlinkhover_text {color:rgba(0,0,50,0.7)}
    .bdp_check_onlinkhover_container:hover .bdp_check_onlinkhover_symbol { color:rgba(0,0,100,1.0) }
    .bdp_check_onlinkhover_container:hover .bdp_check_onlinkhover_text { color:rgba(0,100,0,1.0)}
    .bdp_check_onchecked_symbol { color:rgba(0,100,0,0.8) }
    .bdp_check_onchecked_text { color:rgba(150,200,150,0.8) }

    a:hover .bdp_check_onchecked_symbol { text-shadow: 1px 1px #fff; color:rgba(0,50,0,1.0); transition: all 300ms linear }
    a:hover .bdp_check_onchecked_text { text-shadow: 1px 1px #000; color:rgba(200,255,200,0.8); transition: all 300ms linear }

    `);
    }
    const excluded = [...document.querySelectorAll('#carousel-player .now-playing a')];
    excluded.push(...document.querySelectorAll('#discographyplayer a'));
    excluded.push(...document.querySelectorAll('#pastreleases a'));
    excluded.push(...document.querySelectorAll('a[href*="/download/album/"],a[href*="/download//track/"]'));

    /*
    <div class="bdp_check_container bdp_check_onlinkhover_container"><span class="bdp_check_onlinkhover_symbol">\u2610</span> <span class="bdp_check_onlinkhover_text">Check</span></div>
    <div class="bdp_check_container bdp_check_onlinkhover_container"><span class="bdp_check_onlinkhover_symbol">\u1f5f9</span> <span class="bdp_check_onlinkhover_text">Check</span></div>
    <span class="bdp_check_onchecked_symbol">\u2611</span> TITLE <div class="bdp_check_container bdp_check_onchecked_container"><span class="bdp_check_onchecked_text">Played</span></div>
    */

    const onClickSetListened = async function onClickSetListenedAsync(ev) {
      ev.preventDefault();
      let parentA = this;
      for (let j = 0; parentA.tagName !== 'A' && j < 20; j++) {
        parentA = parentA.parentNode;
      }
      window.setTimeout(function showSavingLabel() {
        parentA.style.cursor = 'wait';
        parentA.querySelector('.bdp_check_container').innerHTML = 'Saving...';
      }, 0);
      const url = parentA.href;
      let albumData = await myAlbumsGetAlbum(url);
      if (!albumData) {
        albumData = await myAlbumsNewFromUrl(url, {
          title: this.dataset.textContent
        });
      }
      albumData.listened = new Date().toJSON();
      await myAlbumsUpdateAlbum(albumData);
      window.setTimeout(function hideSavingLabel() {
        parentA.style.cursor = '';
        makeAlbumLinksGreat();
      }, 100);
    };
    const onClickRemoveListened = async function onClickRemoveListenedAsync(ev) {
      ev.preventDefault();
      let parentA = this;
      for (let j = 0; parentA.tagName !== 'A' && j < 20; j++) {
        parentA = parentA.parentNode;
      }
      window.setTimeout(function showSavingLabel() {
        parentA.style.cursor = 'wait';
        parentA.querySelector('.bdp_check_container').innerHTML = 'Saving...';
      }, 0);
      const url = parentA.href;
      const albumData = await myAlbumsGetAlbum(url);
      if (albumData) {
        albumData.listened = false;
        await myAlbumsUpdateAlbum(albumData);
      }
      window.setTimeout(function hideSavingLabel() {
        parentA.style.cursor = '';
        makeAlbumLinksGreat();
      }, 100);
    };
    const mouseOverLink = function onMouseOverLink(ev) {
      const bdpCheckOnlinkhoverContainer = this.querySelector('.bdp_check_onlinkhover_container');
      if (bdpCheckOnlinkhoverContainer) {
        bdpCheckOnlinkhoverContainer.classList.add('bdp_check_onlinkhover_container_shown');
      }
    };
    const mouseOutLink = function onMouseOutLink(ev) {
      const a = this;
      a.dataset.iv = window.setTimeout(function mouseOutLinkTimeout() {
        const div = a.querySelector('.bdp_check_onlinkhover_container');
        if (div) {
          div.classList.remove('bdp_check_onlinkhover_container_shown');
          div.dataset.iv = a.dataset.iv;
        }
      }, 2000);
    };
    const mouseMoveLink = function onMouseLoveLink(ev) {
      if ('iv' in this.dataset) {
        window.clearTimeout(this.dataset.iv);
      }
    };
    const mouseOverDivCheck = function onMouseOverDivCheck(ev) {
      const bdpCheckOnlinkhoverSymbol = this.querySelector('.bdp_check_onlinkhover_symbol');
      if (bdpCheckOnlinkhoverSymbol) {
        bdpCheckOnlinkhoverSymbol.innerText = NOEMOJI ? '\u2611' : '\uD83D\uDDF9';
      }
      if ('iv' in this.dataset) {
        window.clearTimeout(this.dataset.iv);
      }
    };
    const mouseOutDivCheck = function onMouseOutDivCheck(ev) {
      const bdpCheckOnlinkhoverSymbol = this.querySelector('.bdp_check_onlinkhover_symbol');
      if (bdpCheckOnlinkhoverSymbol) {
        bdpCheckOnlinkhoverSymbol.innerText = '\u2610';
      }
    };
    const divCheck = document.createElement('div');
    divCheck.setAttribute('class', 'bdp_check_container bdp_check_onlinkhover_container');
    divCheck.setAttribute('title', 'Mark as played');
    divCheck.innerHTML = '<span class="bdp_check_onlinkhover_symbol">\u2610</span> <span class="bdp_check_onlinkhover_text">Check</span>';
    const divChecked = document.createElement('div');
    divChecked.setAttribute('class', 'bdp_check_container bdp_check_onchecked_container');
    divChecked.innerHTML = '<span class="bdp_check_onchecked_text">Played</span>';
    const spanChecked = document.createElement('span');
    spanChecked.appendChild(document.createTextNode('\u2611 '));
    spanChecked.setAttribute('class', 'bdp_check_onchecked_symbol');
    const a = doc.querySelectorAll('a[href*="/album/"],.music-grid .music-grid-item a[href*="/track/"]');
    let lastKey = '';
    for (let i = 0; i < a.length; i++) {
      if (excluded.indexOf(a[i]) !== -1) {
        continue;
      }
      const key = albumKey(a[i].href);
      if (key === lastKey) {
        // Skip multiple consequent links to same album
        continue;
      }
      const textContent = a[i].textContent.trim();
      if (!textContent) {
        // Skip album covers only
        continue;
      }
      let div;
      if (a[i].dataset.textContent) {
        removeViaQuerySelector(a[i], '.bdp_check_onlinkhover_container');
        removeViaQuerySelector(a[i], '.bdp_check_onchecked_container');
        removeViaQuerySelector(a[i], '.bdp_check_onchecked_symbol');
      } else {
        a[i].dataset.textContent = textContent;
        a[i].addEventListener('mouseover', mouseOverLink);
        a[i].addEventListener('mousemove', mouseMoveLink);
        a[i].addEventListener('mouseout', mouseOutLink);
      }
      if (key in myalbums && 'listened' in myalbums[key] && myalbums[key].listened) {
        div = divChecked.cloneNode(true);
        div.addEventListener('click', onClickRemoveListened);
        const date = new Date(myalbums[key].listened);
        const since = timeSince(date);
        const dateStr = dateFormater(date);
        div.title = since + ' ago\nClick to mark as NOT played';
        div.querySelector('.bdp_check_onchecked_text').appendChild(document.createTextNode(' ' + dateStr));
        const span = spanChecked.cloneNode(true);
        span.title = since + ' ago\nClick to mark as NOT played';
        span.addEventListener('click', onClickRemoveListened);
        const firstText = firstChildWithText(a[i]) || a[i].firstChild;
        firstText.parentNode.insertBefore(span, firstText);
      } else {
        div = divCheck.cloneNode(true);
        div.addEventListener('mouseover', mouseOverDivCheck);
        div.addEventListener('mouseout', mouseOutDivCheck);
        div.addEventListener('click', onClickSetListened);
      }
      a[i].appendChild(div);
      lastKey = key;
    }
  }
  function addShuffleTagsButton() {
    console.debug('addShuffleTagsButton');
    const createButton = () => {
      // Return a new button element, try to clone an existing one to copy the styling
      const b = document.querySelector('.tag-search-desktop-container button');
      if (b) {
        return b.cloneNode(false);
      } else {
        return document.createElement('button');
      }
    };
    const parent = document.querySelector('.tag-search-desktop-container');
    const inputContainer = parent.appendChild(document.createElement('div'));
    const inputGenres = inputContainer.appendChild(document.createElement('input'));
    inputGenres.setAttribute('id', 'discover_shuffle_genres');
    inputGenres.setAttribute('type', 'text');
    inputGenres.setAttribute('title', 'Genres to shuffle, separated by + ');
    inputGenres.setAttribute('style', 'display: block;width: 350px;font-size: 12px;background: #313b44b2;color:white; border: 1px solid silver;border-bottom: none;');
    const inputSubTag = inputContainer.appendChild(document.createElement('input'));
    inputSubTag.setAttribute('id', 'discover_shuffle_subtag');
    inputSubTag.setAttribute('type', 'text');
    inputSubTag.setAttribute('title', 'Current sub-tag');
    inputSubTag.setAttribute('style', 'display: block;width: 350px;font-size: 12px;background: #313b44b2;color:white; border: 1px solid silver;border-bottom: none;');
    const inputNextSong = inputContainer.appendChild(document.createElement('input'));
    inputNextSong.setAttribute('id', 'discover_shuffle_next_song');
    inputNextSong.setAttribute('type', 'text');
    inputNextSong.setAttribute('title', 'Next song to play');
    inputNextSong.setAttribute('readonly', 'readonly');
    inputNextSong.setAttribute('style', 'display: block;width: 350px;font-size: 12px;background: #313b44b2;color:white; border: 1px solid silver;');
    const button = parent.appendChild(createButton());
    button.setAttribute('id', 'discover_shuffle_start');
    button.innerHTML = 'Shuffle tags'; // TODO "Shuffle subtags of {Electronic}"
    // Shuffle related tags of Genre & Sub tag
    button.addEventListener('click', startShuffleTags);

    // dropdown option to shuffle after each song, or after each album
    const label = parent.appendChild(document.createElement('label'));
    label.innerHTML = 'Shuffle after:';
    label.for = 'discover_shuffle_shuffle_after';
    const select = parent.appendChild(document.createElement('select'));
    select.setAttribute('id', 'discover_shuffle_shuffle_after');
    select.innerHTML = '<option value="song">each song</option><option value="album">each album</option>';
    select.addEventListener('change', updateShuffleNextTag);

    // dropdown option for next sub-tag: Random OR avoid same subgenre
    const label2 = parent.appendChild(document.createElement('label'));
    label2.appendChild(document.createTextNode('Next genre: '));
    const spanNextGenre = label2.appendChild(document.createElement('span'));
    spanNextGenre.setAttribute('id', 'discover_shuffle_next_value');
    label2.for = 'discover_shuffle_next_subtag';
    const select2 = parent.appendChild(document.createElement('select'));
    select2.setAttribute('id', 'discover_shuffle_next_subtag');
    select2.innerHTML = '<option value="random_sub_tag">Random sub-tag</option><option value="current_sub_tag">dive deeper into sub tag</option><option value="avoid_current_sub_tag">Avoid same subgenre</option><option value="random_genre">Random genre</option>';
    select.addEventListener('change', updateShuffleNextTag);

    // button to skip to next song/album
    // TODO always show the next album/tag on the button
    const button2 = parent.appendChild(createButton());
    button2.innerHTML = 'Next';
    button2.addEventListener('click', function (ev) {
      updateShuffleNextTag(ev, 'next');
    });

    // button to choose a random tag for the next (in case the next is not good)
    // TODO this should change the next album/tag on the above button
    const button3 = parent.appendChild(createButton());
    button3.innerHTML = 'Shuffle';
    button3.addEventListener('click', function (ev) {
      updateShuffleNextTag(ev, 'shuffle');
    });

    // window.setTimeout(startShuffleTags, 500)
  }
  async function updateShuffleNextTag(ev, action) {
    console.log('updateShuffleNextTag', action);
    let currentGenres = '';
    const genresElement = document.getElementById('discover_shuffle_genres');
    if (genresElement && genresElement.value) {
      currentGenres = genresElement.value.split(/\+|%20/);
    } else if (document.location.pathname.substring(10)) {
      if (genresElement) {
        genresElement.value = document.location.pathname.substring(10);
      }
      currentGenres = document.location.pathname.substring(10).split(/\+|%20/);
    } else {
      window.alert('No genres specified'); // TODO handle this
      return;
    }
    console.log('Current genres', currentGenres);
    const currentSubTag = document.getElementById('discover_shuffle_subtag').value;
    const shuffleAfterOption = document.getElementById('discover_shuffle_shuffle_after').value;
    const nextSubTagOption = document.getElementById('discover_shuffle_next_subtag').value;
    console.log('currentSubTag', currentSubTag);
    console.log('shuffleAfterOption', shuffleAfterOption);
    console.log('nextSubTagOption', nextSubTagOption);
    const tags = [...currentGenres];
    let nextGenres = [...currentGenres];
    let nextSubTags = [];
    console.log('nextSubTagOption:', nextSubTagOption);
    if (nextSubTagOption === 'random_sub_tag' || nextSubTagOption === 'avoid_current_sub_tag') {
      const result = await getRelatedTags(tags);
      console.log('related tags result:', result);
      const relatedTags = result.single_results[0].related_tags;
      // select random tag from related tags
      let randomTag = relatedTags[Math.floor(Math.random() * relatedTags.length)];
      console.log((randomTag));
      if (nextSubTagOption === 'avoid_current_sub_tag') {
        while (randomTag.norm_name === currentSubTag) {
          randomTag = relatedTags[Math.floor(Math.random() * relatedTags.length)];
        }
      }
      nextSubTags = [randomTag.norm_name];
    } else if (nextSubTagOption === 'random_genre') {
      // Get a random major genre
      nextGenres = genresList[Math.floor(Math.random() * genresList.length)];
      // TODO what about the subtag?
    } else if (nextSubTagOption === 'current_sub_tag') {
      // TODO what if no currentSubTag is defined? -> choose random subtag
      nextSubTags = [currentSubTag];
    } else {
      window.alert('invalid next option'); // TODO handle this
      return;
    }
    console.log('nextSubTags', nextSubTags);
    document.getElementById('discover_shuffle_next_value').textContent = nextSubTags.join(' + ');

    // Load the next tag and display it on the button

    // TODO Load the next song/album and display it in #discover_shuffle_next_song
    const randomAlbums = await getRandomAlbumsFromTags(...nextGenres, ...nextSubTags);

    // Select randomAlbum from randomAlbums
    const randomAlbum = randomAlbums[Math.floor(Math.random() * randomAlbums.length)];
    console.log('next album:\n' + randomAlbum.title + ' by ' + randomAlbum.band_name + '\n' + randomAlbum.item_url);
    let nextSongTitle = null;
    const discoverShuffleNextSongNode = document.getElementById('discover_shuffle_next_song');
    discoverShuffleNextSongNode.dataset.nextAlbumUrl = document.location.protocol + '//' + albumKey(randomAlbum.item_url);
    if (shuffleAfterOption === 'song' && 'featured_track' in randomAlbum && randomAlbum.featured_track && 'stream_url' in randomAlbum.featured_track && randomAlbum.featured_track.stream_url) {
      discoverShuffleNextSongNode.dataset.nextSong = randomAlbum.featured_track.id;
      nextSongTitle = `${randomAlbum.featured_track.title} by ${randomAlbum.featured_track.band_name} (from ${randomAlbum.title})`;
    } else {
      discoverShuffleNextSongNode.dataset.nextSong = '#1';
      nextSongTitle = `${randomAlbum.title} by ${randomAlbum.album_artist || randomAlbum.band_name}`;
    }
    discoverShuffleNextSongNode.value = nextSongTitle;
  }
  function getRelatedTags(tags) {
    /* TODO Scrape these results for the major genres, so that we get a list of subtags per genre */

    return new Promise((resolve, reject) => {
      GM.xmlHttpRequest({
        url: 'https://bandcamp.com/api/tag_search/2/related_tags',
        method: 'POST',
        data: JSON.stringify({
          tag_names: tags,
          size: 1000,
          /* 1000 seems to be the limit, higher throws an error */
          combo: true
        }),
        onerror: function (response) {
          reject(response);
        },
        onload: async function (response) {
          const data = JSON.parse(response.responseText);
          console.log('Related tags result:');
          console.log(data);
          resolve(data);
        }
      });
    });
  }
  function getRandomAlbumsFromTags(tags) {
    return new Promise((resolve, reject) => {
      GM.xmlHttpRequest({
        url: 'https://bandcamp.com/api/discover/1/discover_web',
        method: 'POST',
        data: JSON.stringify({
          category_id: 0,
          tag_norm_names: tags,
          geoname_id: 0,
          slice: 'rand',
          time_facet_id: null,
          cursor: '*',
          size: 60,
          include_result_types: ['a', 's']
        }),
        onerror: function (response) {
          reject(response);
        },
        onload: async function (response) {
          const data = JSON.parse(response.responseText);
          resolve(data.results);
        }
      });
    });
  }
  async function startShuffleTags() {
    console.debug('shartShuffleTags()');
    let currentGenres = '';
    const genresElement = document.getElementById('discover_shuffle_genres');
    if (genresElement && genresElement.value) {
      currentGenres = genresElement.value.split(/\+|%20/);
    } else if (document.location.pathname.substring(10)) {
      if (genresElement) {
        genresElement.value = document.location.pathname.substring(10);
      }
      currentGenres = document.location.pathname.substring(10).split(/\+|%20/);
    } else {
      window.alert('No genres specified'); // TODO handle this
      return;
    }
    const randomAlbums = await getRandomAlbumsFromTags(currentGenres);
    if (!randomAlbums) {
      window.alert('error 845'); // TODO handle error, pick different genre
      console.error('Response from /api/discover/1/discover_web for genres=' + currentGenres + ' is empty:');
      return;
    }

    // Pick a random album
    const album = randomAlbums[Math.floor(Math.random() * randomAlbums.length)];
    console.debug('random album:', album);
    {
      if ('featured_track' in album && album.featured_track && 'id' in album.featured_track) {
        // Choose to play featured track
        playAlbumFromUrl(album.item_url, null, album.featured_track.id);
        console.log('playAlbumFromUrl featured track', album.item_url, null, album.featured_track.id);
      } else {
        // choose a random track
        const randomPosition = Math.floor(Math.random() * album.track_count);
        playAlbumFromUrl(album.item_url, randomPosition);
        console.log('playAlbumFromUrl random track', album.item_url, randomPosition);
      }
    }
    document.querySelector('#discover_shuffle_start').classList.add('active');
    updateShuffleNextTag();

    // In Discography player:
    // - add a switch that enables tag shuffling from currently playing album, or maybe better just redirect to /discover and autostart with a new player
    // - dropdown option to shuffle after each song, or after each album (remember this selection)
    // - dropdown option for next sub-tag: Random OR avoid same subgenre (remember this selection)
    // - button to skip to next tag (show the next tag on the button) and button to choose a random tag for the next (in case the next is not good)
    // - add an option to blacklist a sub-tag for shuffling
    // - manage blacklist GUI
    // - keep a list of played albums in the current session to avoid playing the same track twice
  }
  function removeTheTimeHasComeToOpenThyHeartWallet() {
    if ('theTimeHasComeToOpenThyHeartWallet' in document.head.dataset) {
      return;
    }
    document.head.dataset.theTimeHasComeToOpenThyHeartWallet = true;
    document.head.appendChild(document.createElement('script')).innerHTML = `
    Log.debug("theTimeHasComeToOpenThyHeartWallet: start...")
    function removeViaQuerySelector (parent, selector) {
      if (typeof selector === 'undefined') {
        selector = parent
        parent = document
      }
      for (let el = parent.querySelector(selector); el; el = parent.querySelector(selector)) {
        el.remove()
      }
    }
    if (typeof TralbumData !== 'undefined') {
      if (TralbumData.play_cap_data) {
        TralbumData.play_cap_data.streaming_limit = 100
        TralbumData.play_cap_data.streaming_limits_enabled = false
      }
      for(let i = 0; i < TralbumData.trackinfo.length; i++) {
        TralbumData.trackinfo[i].is_capped = false
        TralbumData.trackinfo[i].play_count = 1
      }

      /* // Alternative would be create new player
      TralbumLimits.onPlayerInit = () => true
      TralbumLimits.updatePlayCounts = () => true
      Player.init(TralbumData, AlbumPage.onPlayerInit);
      */

      // Update player with modified TralbumData
      Player.update(TralbumData)
      Log.debug("theTimeHasComeToOpenThyHeartWallet: player updated")
    }

    // Restore lyrics onClick
    function parentByClassName(node, className) {
      while(!node.parentNode.classList.contains(className)) {
        node = node.parentNode
        if (node.parentNode === document.documentElement) {
          return null
        }
      }
      return node.parentNode
    }
    /*
    // seems this is no longer necessary
    function onLyricsClick (ev) {
      ev.preventDefault()
      const tr = parentByClassName(this, 'track_row_view')
      if (tr.classList.contains('current_track')) {
        parentByClassName(tr, 'track_list').classList.toggle('auto_lyrics')
      } else {
        tr.classList.toggle('showlyrics')
      }
    }
    document.querySelectorAll('#track_table .track_row_view .info_link a').forEach(function (a) {
      a.addEventListener('click', onLyricsClick)
    })
    */

    // Hide popup (not really needed, but won't hurt)
    window.setInterval(function() {
      if(document.getElementById('play-limits-dialog-cancel-btn')) {
        document.getElementById('play-limits-dialog-cancel-btn').click()
        window.setTimeout(function() {
          removeViaQuerySelector(document, '.ui-dialog.ui-widget')
          removeViaQuerySelector(document, '.ui-widget-overlay')
        }, 100)
      }
    }, 3000)
    Log.debug("theTimeHasComeToOpenThyHeartWallet: done!")
  `;
  }
  function makeCarouselPlayerGreatAgain() {
    if (player) {
      // Hide/minimize discography player
      const closePlayerOnCarouselIv = window.setInterval(function closePlayerOnCarouselInterval() {
        if (!document.getElementById('carousel-player') || document.getElementById('carousel-player').getClientRects()[0].bottom - window.innerHeight > 0) {
          return;
        }
        if (player.style.display === 'none') {
          // Put carousel player back down in normal position, because discography player is hidden forever
          document.getElementById('carousel-player').style.bottom = '0px';
          window.clearInterval(closePlayerOnCarouselIv);
        } else if (!player.style.bottom) {
          // Minimize discography player and push carousel player up above the minimized player
          musicPlayerToggleMinimize.call(player.querySelector('.minimizebutton'), null, true);
          document.getElementById('carousel-player').style.bottom = player.clientHeight - 57 + 'px';
        }
      }, 5000);
    }
    let addListenedButtonToCarouselPlayerLast = null;
    const addListenedButtonToCarouselPlayer = function listenedButtonOnCarouselPlayer() {
      const url = document.querySelector('#carousel-player a[href]') ? albumKey(document.querySelector('#carousel-player a[href]').href) : null;
      if (url && addListenedButtonToCarouselPlayerLast === url) {
        return;
      }
      if (!url) {
        console.error('No url found in carousel player: `#carousel-player a[href]`');
        return;
      }
      addListenedButtonToCarouselPlayerLast = url;
      removeViaQuerySelector('#carousel-player .carousellistenedstatus');
      const a = document.createElement('a');
      a.className = 'carousellistenedstatus';
      a.addEventListener('click', ev => ev.preventDefault());
      document.querySelector('#carousel-player .controls-extra').insertBefore(a, document.querySelector('#carousel-player .controls-extra').firstChild);
      a.innerHTML = '<span class="listenedstatus">Loading...</span>';
      a.href = 'https://' + url;
      makeAlbumLinksGreat(a.parentNode).then(function () {
        removeViaQuerySelector(a, '.listenedstatus');
        const span = document.createElement('span');
        span.addEventListener('click', function () {
          const span = this;
          span.parentNode.querySelector('.bdp_check_container').click();
          window.setTimeout(function () {
            if (span.parentNode.querySelector('.bdp_check_container').textContent.indexOf('Played') !== -1) {
              span.parentNode.innerHTML = 'Listened';
            } else {
              span.parentNode.innerHTML = 'Unplayed';
            }
          }, 3000);
        });
        if (a.querySelector('.bdp_check_onchecked_text')) {
          span.className = 'listenedstatus listened';
          span.innerHTML = '<span class="listened-symbol">✓</span> <span class="listened-label">Played</span>';
        } else {
          span.className = 'listenedstatus mark-listened';
          span.innerHTML = '<span class="mark-listened-symbol">✓</span> <span class="mark-listened-label">Mark as played</span>';
        }
        a.insertBefore(span, a.firstChild);
        a.dataset.textContent = document.querySelector('#carousel-player .now-playing .info a .artist span').textContent + ' - ' + document.querySelector('#carousel-player .now-playing .info a .title').textContent;
      });
    };
    let lastMediaHubMeta = [null, null];
    const onNotificationClick = function () {
      if (!document.querySelector('#carousel-player .transport .next-icon').classList.contains('disabled')) {
        document.querySelector('#carousel-player .transport .next-icon').click();
      }
    };
    const updateChromePositionState = function () {
      const audio = document.querySelector('body>audio');
      if (audio && 'mediaSession' in navigator && 'setPositionState' in navigator.mediaSession) {
        navigator.mediaSession.setPositionState({
          duration: audio.duration || 180,
          playbackRate: audio.playbackRate,
          position: audio.currentTime
        });
      }
    };
    const addChromeMediaHubToCarouselPlayer = function chromeMediaHubToCarouselPlayer() {
      const title = document.querySelector('#carousel-player .info-progress span[data-bind*="trackTitle"]').textContent.trim();
      const artwork = document.querySelector('#carousel-player .now-playing img').src;
      if (lastMediaHubMeta[0] === title && lastMediaHubMeta[1] === artwork) {
        return;
      }
      lastMediaHubMeta = [title, artwork];
      const artist = document.querySelector('#carousel-player .now-playing .artist span').textContent.trim();
      const album = document.querySelector('#carousel-player .now-playing .title').textContent.trim();

      // Notification
      if (allFeatures.nextSongNotifications.enabled && 'notification' in GM) {
        GM.notification({
          title: document.location.host,
          text: title + '\nby ' + artist + '\nfrom ' + album,
          image: artwork,
          highlight: false,
          silent: true,
          timeout: NOTIFICATION_TIMEOUT,
          onclick: onNotificationClick
        });
      }

      // Media hub
      if ('mediaSession' in navigator) {
        const audio = document.querySelector('body>audio');
        if (audio) {
          navigator.mediaSession.playbackState = !audio.paused ? 'playing' : 'paused';
          updateChromePositionState();
        }
        navigator.mediaSession.metadata = new MediaMetadata({
          title,
          artist,
          album,
          artwork: [{
            src: artwork,
            sizes: '350x350',
            type: 'image/jpeg'
          }]
        });
        if (!document.querySelector('#carousel-player .transport .prev-icon').classList.contains('disabled')) {
          navigator.mediaSession.setActionHandler('previoustrack', () => document.querySelector('#carousel-player .transport .prev-icon').click());
        } else {
          navigator.mediaSession.setActionHandler('previoustrack', null);
        }
        if (!document.querySelector('#carousel-player .transport .next-icon').classList.contains('disabled')) {
          navigator.mediaSession.setActionHandler('nexttrack', () => document.querySelector('#carousel-player .transport .next-icon').click());
        } else {
          navigator.mediaSession.setActionHandler('nexttrack', null);
        }
        const playButton = document.querySelector('#carousel-player .playpause .play');
        if (playButton && playButton.style.display === 'none') {
          navigator.mediaSession.setActionHandler('play', null);
          navigator.mediaSession.setActionHandler('pause', function () {
            document.querySelector('#carousel-player .playpause').click();
            navigator.mediaSession.playbackState = 'paused';
          });
        } else {
          navigator.mediaSession.setActionHandler('play', function () {
            document.querySelector('#carousel-player .playpause').click();
            navigator.mediaSession.playbackState = 'playing';
          });
          navigator.mediaSession.setActionHandler('pause', null);
        }
        if (audio) {
          navigator.mediaSession.setActionHandler('seekbackward', function (event) {
            const skipTime = event.seekOffset || DEFAULTSKIPTIME;
            audio.currentTime = Math.max(audio.currentTime - skipTime, 0);
            updateChromePositionState();
          });
          navigator.mediaSession.setActionHandler('seekforward', function (event) {
            const skipTime = event.seekOffset || DEFAULTSKIPTIME;
            audio.currentTime = Math.min(audio.currentTime + skipTime, audio.duration);
            updateChromePositionState();
          });
          try {
            navigator.mediaSession.setActionHandler('stop', function () {
              audio.pause();
              audio.currentTime = 0;
              navigator.mediaSession.playbackState = 'paused';
            });
          } catch (error) {
            console.warn('Warning! The "stop" media session action is not supported.');
          }
          try {
            navigator.mediaSession.setActionHandler('seekto', function (event) {
              if (event.fastSeek && 'fastSeek' in audio) {
                audio.fastSeek(event.seekTime);
                return;
              }
              audio.currentTime = event.seekTime;
              updateChromePositionState();
            });
          } catch (error) {
            console.warn('Warning! The "seekto" media session action is not supported.');
          }
        }
      }
    };
    window.setInterval(function addListenedButtonToCarouselPlayerInterval() {
      if (!document.getElementById('carousel-player') || document.getElementById('carousel-player').getClientRects()[0].bottom - window.innerHeight > 0) {
        return;
      }
      addListenedButtonToCarouselPlayer();
      addChromeMediaHubToCarouselPlayer();
    }, 2000);
    addStyle(`
  #carousel-player a.carousellistenedstatus:link,#carousel-player a.carousellistenedstatus:visited,#carousel-player a.carousellistenedstatus:hover{
    text-decoration:none;
    cursor:default
  }
  #carousel-player .listened .listened-symbol{
    color:rgb(0,220,50);
    text-shadow:1px 0px #DDD,-1px 0px #DDD,0px -1px #DDD,0px 1px #DDD
  }
  #carousel-player .mark-listened .mark-listened-symbol{
    color:#FFF;
    text-shadow:1px 0px #959595,-1px 0px #959595,0px -1px #959595,0px 1px #959595
  }
  #carousel-player .mark-listened:hover .mark-listened-symbol{
    text-shadow:1px 0px #0AF,-1px 0px #0AF,0px -1px #0AF,0px 1px #0AF
  }
  `);
  }
  async function addListenedButtonToCollectControls() {
    const lastLi = document.querySelector('.share-panel-wrapper-desktop ul li');
    if (!lastLi) {
      window.setTimeout(addListenedButtonToCollectControls, 300);
      return;
    }
    const checkSymbol = NOEMOJI ? '✓' : '✔';
    const myalbums = JSON.parse(await GM.getValue('myalbums', '{}'));
    const key = albumKey(document.location.href);
    const listened = key in myalbums && 'listened' in myalbums[key] && myalbums[key].listened;
    const onClickSetListened = async function onClickSetListenedAsync(ev) {
      ev.preventDefault();
      let parent = this;
      for (let j = 0; parent.tagName !== 'LI' && j < 20; j++) {
        parent = parent.parentNode;
      }
      window.setTimeout(function showSavingLabel() {
        parent.style.cursor = 'wait';
        parent.innerHTML = 'Saving...';
      }, 0);
      const url = document.location.href;
      let albumData = await myAlbumsGetAlbum(url);
      if (!albumData) {
        albumData = await myAlbumsNewFromUrl(url, {
          title: this.dataset.textContent
        });
      }
      albumData.listened = new Date().toJSON();
      await myAlbumsUpdateAlbum(albumData);
      window.setTimeout(addListenedButtonToCollectControls, 100);
    };
    const onClickRemoveListened = async function onClickRemoveListenedAsync(ev) {
      ev.preventDefault();
      let parent = this;
      for (let j = 0; parent.tagName !== 'LI' && j < 20; j++) {
        parent = parent.parentNode;
      }
      window.setTimeout(function showSavingLabel() {
        parent.style.cursor = 'wait';
        parent.innerHTML = 'Saving...';
      }, 0);
      const url = document.location.href;
      const albumData = await myAlbumsGetAlbum(url);
      if (albumData) {
        albumData.listened = false;
        await myAlbumsUpdateAlbum(albumData);
      }
      window.setTimeout(addListenedButtonToCollectControls, 100);
    };
    removeViaQuerySelector('#discographyplayer_sharepanel');
    const li = lastLi.parentNode.appendChild(document.createElement('li'));
    const button = li.appendChild(document.createElement('span'));
    const icon = button.appendChild(document.createElement('span'));
    const a = button.appendChild(document.createElement('a'));
    li.setAttribute('id', 'discographyplayer_sharepanel');
    a.addEventListener('click', ev => ev.preventDefault());
    icon.className = 'sharepanelchecksymbol';
    if (listened) {
      const date = new Date(listened);
      const since = timeSince(date);
      button.title = since + '\nClick to mark as NOT played';
      button.addEventListener('click', onClickRemoveListened);
      icon.style.color = 'rgb(0,220,50)';
      icon.style.textShadow = '1px 0px #DDD,-1px 0px #DDD,0px -1px #DDD,0px 1px #DDD';
      icon.style.paddingRight = '5px';
      icon.appendChild(document.createTextNode(checkSymbol));
      a.appendChild(document.createTextNode('Played'));
      li.appendChild(document.createTextNode(' - '));
      const link = li.appendChild(document.createElement('span'));
      const viewLink = link.appendChild(document.createElement('a'));
      viewLink.href = findUserProfileUrl() + '#listened-tab';
      viewLink.title = 'View list of played albums';
      viewLink.appendChild(document.createTextNode('view'));
    } else {
      button.title = 'Click to mark as played';
      button.addEventListener('click', onClickSetListened);
      try {
        icon.style.color = window.getComputedStyle(document.getElementById('pgBd')).backgroundColor;
        icon.style.textShadow = '1px 0px #959595,-1px 0px #959595,0px -1px #959595,0px 1px #959595';
        icon.style.paddingRight = '5px';
      } catch (e) {
        icon.style.color = '#959595';
        icon.style.fontWeight = 700;
      }
      icon.appendChild(document.createTextNode(checkSymbol));
      a.appendChild(document.createTextNode('Unplayed'));
    }
  }
  function makeListenedListTabLink() {
    const grid = document.getElementById('grids').appendChild(document.createElement('div'));
    grid.className = 'grid';
    grid.id = 'listened-grid';
    const inner = grid.appendChild(document.createElement('div'));
    inner.className = 'inner';
    inner.innerHTML = 'Loading...';
    const li = document.querySelector('ol#grid-tabs').appendChild(document.createElement('li'));
    li.id = 'listenedlisttablink';
    li.dataset.tab = 'listened';
    li.setAttribute('data-grid-id', 'listened-grid');
    const span = li.appendChild(document.createElement('span'));
    span.className = 'tab-title';
    span.appendChild(document.createTextNode('played'));
    const count = span.appendChild(document.createElement('span'));
    count.className = 'count';
    GM.getValue('myalbums', '{}').then(function myalbumsLoaded(str) {
      let n = 0;
      const myalbums = JSON.parse(str);
      for (const key in myalbums) {
        if (myalbums[key].listened) {
          n++;
        }
      }
      count.appendChild(document.createTextNode(n));
    });
    li.addEventListener('click', showListenedListTab);
    return li;
  }
  async function showListenedListTab() {
    if (document.getElementById('owner-controls')) document.getElementById('owner-controls').style.display = 'none';
    if (document.getElementById('wishlist-controls')) document.getElementById('wishlist-controls').style.display = 'none';
    const grid = document.getElementById('listened-grid');
    const gridActive = document.querySelector('#grids .grid.active');
    if (gridActive && gridActive !== grid) {
      gridActive.classList.remove('active');
    }
    grid.classList.add('active');
    const tabLink = document.getElementById('listenedlisttablink');
    const tabLinkActive = document.querySelector('#grid-tab li.active');
    if (tabLinkActive && tabLinkActive !== tabLink) {
      tabLinkActive.classList.remove('active');
    }
    tabLink.classList.add('active');
    if (grid.querySelector('.collection-items')) {
      return;
    }
    grid.innerHTML = '';
    const collectionItems = grid.appendChild(document.createElement('div'));
    collectionItems.className = 'collection-items';
    const collectionGrid = collectionItems.appendChild(document.createElement('ol'));
    collectionGrid.className = 'collection-grid';
    const myalbums = JSON.parse(await GM.getValue('myalbums', '{}'));
    for (const key in myalbums) {
      const albumData = myalbums[key];
      if (!albumData.listened) {
        continue;
      }
      const artist = albumData.artist || 'Unkown artist';
      const title = albumData.title || 'Unkown title';
      const albumCover = albumData.albumCover || 'https://bandcamp.com/img/0.gif';
      const url = key;
      const date = new Date(albumData.listened);
      const since = timeSince(date);
      const dateStr = dateFormater(date);
      let releaseDate;
      if ('releaseDate' in albumData) {
        releaseDate = dateFormaterRelease(new Date(albumData.releaseDate));
      } else {
        releaseDate = 'Unknown';
      }
      const li = collectionGrid.appendChild(document.createElement('li'));
      li.className = 'collection-item-container';
      li.innerHTML = `
      <div class="collection-item-gallery-container">
        <span class="bc-ui2 collect-item-icon-alt"></span>
        <div class="collection-item-art-container">
          <img class="collection-item-art" alt="" src="${albumCover}">
        </div>
        <div class="collection-title-details">
          <a target="_blank" href="https://${url}" class="item-link">
            <div class="collection-item-title">${title}</div>
            <div class="collection-item-artist">by ${artist}</div>
          </a>
        </div>
        <div class="collection-item-fav-track">
          <span title="${since} ago" class="favoriteTrackLabel">played</span>
          <div title="${since} ago">
            <span class="fav-track-link">${dateStr}</span>
          </div>
          <span class="favoriteTrackLabel">released</span>
          <div>
            <span class="fav-track-link">${releaseDate}</span>
          </div>
        </div>
      </div>
    `;
    }
  }
  function addVolumeBarToAlbumPage() {
    // Do not add if one of these scripts already added a volume bar
    // https://openuserjs.org/scripts/cuzi/Bandcamp_Volume_Bar
    // https://openuserjs.org/scripts/Mranth0ny62/Bandcamp_Volume_Bar
    // https://openuserjs.org/scripts/ArtificialInput/Bandcamp_Volume_Bar
    // https://greasyfork.org/en/scripts/11047-bandcamp-volume-bar/
    // https://greasyfork.org/en/scripts/38012-bandcamp-volume-bar/
    if (document.querySelector('.volumeControl')) {
      return false;
    }
    if (!document.querySelector('#trackInfoInner .playbutton')) {
      return;
    }
    addStyle(`
    /* Hide if inline_player is hidden */
    .hidden .volumeButton,.hidden .volumeControl,.hidden .volumeLabel{
      display:none
    }

    .volumeButton {
      display: inline-block;
      user-select:none;
      background: #fff;
      border: 1px solid #d9d9d9;
      border-radius: 2px;
      cursor: pointer;
      min-height: 50px;
      min-width: 54px;
      text-align:center;
      margin-top:5px;
    }

    .volumeSymbol {
      margin-top: 16px;
      font-size: 30px;
      color:#222;
      font-weight:bolder;
      transform: rotate(-90deg);
      text-shadow: rgb(255, 255, 255) 0px 0px 0px;
      transition: text-shadow linear 300ms;
    }
    .volumeControl {
      display:inline-block;
      user-select:none;
      top:5px;
    }
    .volumeLabel {
      display:inline-block;
    }

    .nextsongcontrolbutton {
      background:#fff;
      border:1px solid #d9d9d9;
      border-radius:2px;
      cursor:pointer;
      height:24px;
      width:35px;
      margin-top:2px;
      margin-left:80px;
      float:left;
      text-align:center
    }

    .nextsongcontrolicon {
      background-size:cover;
      background-image:${spriteRepeatShuffle};
      width:31px;
      height:20px;
      filter:drop-shadow(#FFF 1px 1px 2px);
      display:inline-block;
      margin-top:1px;
      transition: filter 500ms;
    }
    .nextsongcontrolbutton.active .nextsongcontrolicon {
      filter:drop-shadow(#0060F2 1px 1px 2px);
    }

  `);
    const playbutton = document.querySelector('#trackInfoInner .playbutton');
    const volumeButton = playbutton.cloneNode(true);
    document.querySelector('#trackInfoInner .inline_player').appendChild(volumeButton);
    volumeButton.classList.replace('playbutton', 'volumeButton');
    volumeButton.style.width = playbutton.clientWidth + 'px';
    const volumeSymbol = volumeButton.appendChild(document.createElement('div'));
    volumeSymbol.className = 'volumeSymbol';
    volumeSymbol.appendChild(document.createTextNode(CHROME ? '\uD83D\uDD5B' : '\u23F2'));
    const progbar = document.querySelector('#trackInfoInner .progbar_cell .progbar');
    const volumeBar = progbar.cloneNode(true);
    document.querySelector('#trackInfoInner .inline_player').appendChild(volumeBar);
    volumeBar.classList.add('volumeControl');
    volumeBar.style.width = Math.max(200, progbar.clientWidth) + 'px';
    const thumb = volumeBar.querySelector('.thumb');
    thumb.setAttribute('id', 'deluxe_thumb');
    const progbarFill = volumeBar.querySelector('.progbar_fill');
    const volumeLabel = document.createElement('div');
    document.querySelector('#trackInfoInner .inline_player').appendChild(volumeLabel);
    volumeLabel.classList.add('volumeLabel');
    let dragging = false;
    let dragPos;
    const width100 = volumeBar.clientWidth - (thumb.clientWidth + 2); // 2px border
    const rot0 = CHROME ? -180 : -90;
    const rot100 = CHROME ? 350 : 265 - rot0;
    const blue0 = 180;
    const blue100 = 75;
    const green0 = 90;
    const green100 = 100;
    const audioAlbumPage = document.querySelector('body>audio');
    addLogVolume(audioAlbumPage);
    const volumeBarPos = volumeBar.getBoundingClientRect().left;
    const displayVolume = function updateDisplayVolume() {
      const level = audioAlbumPage.logVolume;
      volumeLabel.innerHTML = parseInt(level * 100.0) + '%';
      thumb.style.left = width100 * level + 'px';
      progbarFill.style.width = parseInt(level * 100.0) + '%';
      volumeSymbol.style.transform = 'rotate(' + (level * rot100 + rot0) + 'deg)';
      if (level > 0.005) {
        volumeSymbol.style.textShadow = 'rgb(0, ' + (level * green100 + green0) + ', ' + (level * blue100 + blue0) + ') 0px 0px 4px';
        volumeSymbol.style.color = '#03a';
      } else {
        volumeSymbol.style.textShadow = 'rgb(255, 255, 255) 0px 0px 0px';
        volumeSymbol.style.color = '#222';
      }
    };
    thumb.addEventListener('mousedown', function thumbMouseDown(ev) {
      if (ev.button === 0) {
        dragging = true;
        dragPos = ev.offsetX;
      }
    });
    volumeBar.addEventListener('mouseup', function thumbMouseUp(ev) {
      if (ev.button !== 0) {
        return;
      }
      stopPropagationDefault(ev);
      if (!dragging) {
        // Click on volume bar without dragging:
        audioAlbumPage.muted = false;
        audioAlbumPage.logVolume = Math.max(0.0, Math.min(1.0, (ev.pageX - volumeBarPos) / width100));
        displayVolume();
      }
      dragging = false;
      GM.setValue('volume', audioAlbumPage.logVolume);
    });
    document.addEventListener('mouseup', function documentMouseUp(ev) {
      if (ev.button === 0 && dragging) {
        dragging = false;
        stopPropagationDefault(ev);
        GM.setValue('volume', audioAlbumPage.logVolume);
      }
    });
    document.addEventListener('mousemove', function documentMouseMove(ev) {
      if (ev.button === 0 && dragging) {
        stopPropagationDefault(ev);
        audioAlbumPage.muted = false;
        audioAlbumPage.logVolume = Math.max(0.0, Math.min(1.0, (ev.pageX - volumeBarPos - dragPos) / width100));
        displayVolume();
      }
    });
    const onWheel = function onMouseWheel(ev) {
      ev.preventDefault();
      const direction = Math.min(Math.max(-1, ev.deltaY), 1.0);
      audioAlbumPage.logVolume = Math.min(Math.max(0.0, audioAlbumPage.logVolume - 0.05 * direction), 1.0);
      displayVolume();
      GM.setValue('volume', audioAlbumPage.logVolume);
    };
    volumeButton.addEventListener('wheel', onWheel, {
      passive: false
    });
    volumeBar.addEventListener('wheel', onWheel, {
      passive: false
    });
    volumeButton.addEventListener('click', function onVolumeButtonClick(ev) {
      if (audioAlbumPage.logVolume < 0.01) {
        if ('lastvolume' in audioAlbumPage.dataset && audioAlbumPage.dataset.lastvolume) {
          audioAlbumPage.logVolume = audioAlbumPage.dataset.lastvolume;
          GM.setValue('volume', audioAlbumPage.logVolume);
        } else {
          audioAlbumPage.logVolume = 1.0;
        }
      } else {
        audioAlbumPage.dataset.lastvolume = audioAlbumPage.logVolume;
        audioAlbumPage.logVolume = 0.0;
      }
      displayVolume();
    });
    displayVolume();
    window.clearInterval(ivRestoreVolume);

    // Repeat/shuffle buttons
    const playnextcontrols = document.querySelector('#trackInfoInner .inline_player').appendChild(document.createElement('div'));

    // Show repeat button
    const repeatButton = playnextcontrols.appendChild(document.createElement('div'));
    repeatButton.classList.add('nextsongcontrolbutton', 'repeat');
    repeatButton.setAttribute('title', 'Repeat');
    const repeatButtonIcon = repeatButton.appendChild(document.createElement('div'));
    repeatButtonIcon.classList.add('nextsongcontrolicon');
    repeatButton.dataset.repeat = 'none';
    repeatButtonIcon.style.backgroundPositionY = '-20px';
    repeatButton.addEventListener('click', function () {
      const posY = this.getElementsByClassName('nextsongcontrolicon')[0].style.backgroundPositionY;
      if (posY === '-20px') {
        this.getElementsByClassName('nextsongcontrolicon')[0].style.backgroundPositionY = '-40px';
        this.classList.toggle('active');
        this.dataset.repeat = 'one';
      } else if (posY === '-40px') {
        this.getElementsByClassName('nextsongcontrolicon')[0].style.backgroundPositionY = '-60px';
        this.dataset.repeat = 'all';
      } else {
        this.getElementsByClassName('nextsongcontrolicon')[0].style.backgroundPositionY = '-20px';
        this.classList.toggle('active');
        this.dataset.repeat = 'none';
      }
    });
    if (allFeatures.albumPageAutoRepeatAll.enabled) {
      repeatButton.click();
      repeatButton.click();
    }

    // Show shuffle button
    const shuffleButton = playnextcontrols.appendChild(document.createElement('div'));
    if (document.querySelectorAll('#track_table a div').length > 2) {
      shuffleButton.classList.add('nextsongcontrolbutton', 'shuffle');
      shuffleButton.setAttribute('title', 'Shuffle');
      const shuffleButtonIcon = shuffleButton.appendChild(document.createElement('div'));
      shuffleButtonIcon.classList.add('nextsongcontrolicon');
      shuffleButtonIcon.style.backgroundPositionY = '0px';
      shuffleButton.addEventListener('click', function () {
        this.classList.toggle('active');
      });
    }
    const findLastSongIndex = function () {
      const allDiv = document.querySelectorAll('#track_table a div');
      const nextDiv = document.querySelector('#track_table a div.playing');
      if (!nextDiv) {
        return allDiv.length - 1;
      }
      for (let i = 1; i < allDiv.length; i++) {
        if (allDiv[i] === nextDiv) {
          return i - 1;
        }
      }
      return -1;
    };
    const albumPageAudioOnEnded = function (ev) {
      const allDiv = document.querySelectorAll('#track_table a div');
      if (repeatButton.dataset.repeat === 'one') {
        // Click on last song again
        if (allDiv.length > 0) {
          allDiv[findLastSongIndex()].click();
        } else {
          // No tracklist, click on play button
          document.querySelector('#trackInfoInner .inline_player .playbutton').click();
        }
      } else if (shuffleButton.classList.contains('active') && allDiv.length > 1) {
        // Find last song
        const lastSongIndex = findLastSongIndex();
        // Set a random song (that is not the last song)
        let index = lastSongIndex;
        while (index === lastSongIndex) {
          index = randomIndex(allDiv.length);
        }
        if (index !== lastSongIndex + 1) {
          allDiv[index].click();
        }
      } else if (repeatButton.dataset.repeat === 'all') {
        if (findLastSongIndex() === allDiv.length - 1) {
          if (allDiv[0]) {
            allDiv[0].click(); // Click on first song's play button
          } else {
            // No tracklist, click on play button
            document.querySelector('#trackInfoInner .inline_player .playbutton').click();
          }
        }
      }
    };
    let lastMediaHubTitle = null;
    const onNotificationClick = function () {
      if (!document.querySelector('#trackInfoInner .inline_player .nextbutton').classList.contains('hiddenelem')) {
        document.querySelector('#trackInfoInner .inline_player .nextbutton').click();
      }
    };
    const updateChromePositionState = function () {
      if (audioAlbumPage && 'mediaSession' in navigator && 'setPositionState' in navigator.mediaSession) {
        navigator.mediaSession.setPositionState({
          duration: audioAlbumPage.duration || 180,
          playbackRate: audioAlbumPage.playbackRate,
          position: audioAlbumPage.currentTime
        });
      }
    };
    const albumPageUpdateMediaHubListener = function albumPageUpdateMediaHub() {
      const TralbumData = unsafeWindow.TralbumData;
      const title = document.querySelector('#trackInfoInner .inline_player .title').textContent.trim();
      if (lastMediaHubTitle === title) {
        return;
      }
      lastMediaHubTitle = title;

      // Notification
      if (allFeatures.nextSongNotifications.enabled && 'notification' in GM) {
        GM.notification({
          title: document.location.host,
          text: title + '\nby ' + TralbumData.artist + '\nfrom ' + TralbumData.current.title,
          image: `https://f4.bcbits.com/img/a${TralbumData.current.art_id}_2.jpg`,
          highlight: false,
          silent: true,
          timeout: NOTIFICATION_TIMEOUT,
          onclick: onNotificationClick
        });
      }

      // Media hub
      if ('mediaSession' in navigator) {
        if (audioAlbumPage) {
          navigator.mediaSession.playbackState = !audioAlbumPage.paused ? 'playing' : 'paused';
          updateChromePositionState();
        }

        // Pre load image to get dimension
        const cover = document.createElement('img');
        cover.onload = function onCoverLoaded() {
          navigator.mediaSession.metadata = new MediaMetadata({
            title,
            artist: TralbumData.artist,
            album: TralbumData.current.title,
            artwork: [{
              src: cover.src,
              sizes: `${cover.width}x${cover.height}`,
              type: 'image/jpeg'
            }]
          });
        };
        cover.src = `https://f4.bcbits.com/img/a${TralbumData.current.art_id}_2.jpg`;
        if (!document.querySelector('#trackInfoInner .inline_player .prevbutton').classList.contains('hiddenelem')) {
          navigator.mediaSession.setActionHandler('previoustrack', () => document.querySelector('#trackInfoInner .inline_player .prevbutton').click());
        } else {
          navigator.mediaSession.setActionHandler('previoustrack', null);
        }
        if (!document.querySelector('#trackInfoInner .inline_player .nextbutton').classList.contains('hiddenelem')) {
          navigator.mediaSession.setActionHandler('nexttrack', () => document.querySelector('#trackInfoInner .inline_player .nextbutton').click());
        } else {
          navigator.mediaSession.setActionHandler('nexttrack', null);
        }
        if (audioAlbumPage) {
          navigator.mediaSession.setActionHandler('play', function () {
            audioAlbumPage.play();
            navigator.mediaSession.playbackState = 'playing';
          });
          navigator.mediaSession.setActionHandler('pause', function () {
            audioAlbumPage.pause();
            navigator.mediaSession.playbackState = 'paused';
          });
          navigator.mediaSession.setActionHandler('seekbackward', function (event) {
            const skipTime = event.seekOffset || DEFAULTSKIPTIME;
            audioAlbumPage.currentTime = Math.max(audioAlbumPage.currentTime - skipTime, 0);
            updateChromePositionState();
          });
          navigator.mediaSession.setActionHandler('seekforward', function (event) {
            const skipTime = event.seekOffset || DEFAULTSKIPTIME;
            audioAlbumPage.currentTime = Math.min(audioAlbumPage.currentTime + skipTime, audioAlbumPage.duration);
            updateChromePositionState();
          });
          try {
            navigator.mediaSession.setActionHandler('stop', function () {
              audioAlbumPage.pause();
              audioAlbumPage.currentTime = 0;
              navigator.mediaSession.playbackState = 'paused';
            });
          } catch (error) {
            console.warn('Warning! The "stop" media session action is not supported.');
          }
          try {
            navigator.mediaSession.setActionHandler('seekto', function (event) {
              if (event.fastSeek && 'fastSeek' in audioAlbumPage) {
                audioAlbumPage.fastSeek(event.seekTime);
                return;
              }
              audioAlbumPage.currentTime = event.seekTime;
              updateChromePositionState();
            });
          } catch (error) {
            console.warn('Warning! The "seekto" media session action is not supported.');
          }
        }
      }
    };
    audioAlbumPage.addEventListener('ended', albumPageAudioOnEnded);
    audioAlbumPage.addEventListener('play', albumPageUpdateMediaHubListener);
    audioAlbumPage.addEventListener('ended', albumPageUpdateMediaHubListener);
  }
  function clickAddToWishlist() {
    const wishButton = document.querySelector('#collect-item>*');
    if (!wishButton) {
      window.setTimeout(clickAddToWishlist, 300);
      return;
    }
    wishButton.click();
    if (document.querySelector('#collection-main a')) {
      // if logged in, the click should be successful, so try to close the window
      window.setTimeout(window.close, 1000);
    }
  }
  async function addReleaseDateButton() {
    await sleep(1000); // Wait a second for share-collect-controls to load (it is slow sometimes)
    const TralbumData = unsafeWindow.TralbumData;
    const now = new Date();
    const releaseDate = new Date(TralbumData.current.release_date);
    const days = parseInt(Math.ceil((releaseDate - now) / (1000 * 60 * 60 * 24)));
    if (releaseDate < now) {
      return; // Release date is in the past
    }
    const key = albumKey(TralbumData.url);
    addStyle(`
  .releaseReminderButton {
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    transition: border 500ms, padding 500ms
  }
  .releaseReminderButton.active {
    border-radius:5px;
    padding:0px 5px;
    border:#3fb32f66 solid 2px
  }
  .releaseReminderButton:hover .releaseLabel {
    text-decoration:underline
  }
  `);
    let parent = document.querySelector('.share-collect-controls');
    if (!parent) {
      parent = document.querySelector('.middleColumn');
    }
    if (!parent) {
      // Try again in a second
      return window.setTimeout(addReleaseDateButton, 1000);
    }
    const div = parent.appendChild(document.createElement('div'));
    div.style = 'margin-top:4px';
    const span = div.appendChild(document.createElement('span'));
    span.className = 'custom-link-color releaseReminderButton';
    span.title = 'Releases ' + dateFormaterRelease(releaseDate);
    const daysStr = days === 1 ? 'tomorrow' : `in ${days} days`;
    span.innerHTML = `<span>\u23F0</span> <span class="releaseLabel">Notify <time datetime="${releaseDate.toISOString()}">${daysStr}</time></span>`;
    span.addEventListener('click', ev => toggleReleaseReminder(ev, span));
    GM.getValue('releasereminder', '{}').then(function (str) {
      const releaseReminderData = JSON.parse(str);
      if (key in releaseReminderData) {
        span.classList.add('active');
        span.innerHTML = `<span>\u23F0</span> <span class="releaseLabel">Reminder set (<time datetime="${releaseDate.toISOString()}">${daysStr}</time>)</span>`;
      }
    });
  }
  async function toggleReleaseReminder(ev, span) {
    const TralbumData = unsafeWindow.TralbumData;
    const key = albumKey(TralbumData.url);
    const releaseReminderData = JSON.parse(await GM.getValue('releasereminder', '{}'));
    if (key in releaseReminderData) {
      delete releaseReminderData[key];
    } else {
      releaseReminderData[key] = {
        albumCover: `https://f4.bcbits.com/img/a${TralbumData.art_id}_2.jpg`,
        releaseDate: TralbumData.current.release_date,
        artist: TralbumData.artist,
        title: TralbumData.current.title
      };
    }
    await GM.setValue('releasereminder', JSON.stringify(releaseReminderData));
    if (span) {
      const releaseDate = new Date(TralbumData.current.release_date);
      const now = new Date();
      const days = parseInt(Math.ceil((releaseDate - now) / (1000 * 60 * 60 * 24)));
      const daysStr = days === 1 ? 'tomorrow' : `in ${days} days`;
      if (key in releaseReminderData) {
        span.classList.add('active');
        span.innerHTML = `<span>\u23F0</span> <span class="releaseLabel">Reminder set (<time datetime="${releaseDate.toISOString()}">${daysStr}</time>)</span>`;
      } else {
        span.classList.remove('active');
        span.innerHTML = `<span>\u23F0</span> <span class="releaseLabel">Notify <time datetime="${releaseDate.toISOString()}">${daysStr}</time></span>`;
      }
    }
  }
  async function removeReleaseReminder(ev) {
    ev.preventDefault();
    const key = this.parentNode.dataset.key;
    const releaseReminderData = JSON.parse(await GM.getValue('releasereminder', '{}'));
    if (key in releaseReminderData) {
      delete releaseReminderData[key];
      await GM.setValue('releasereminder', JSON.stringify(releaseReminderData));
    }
    this.parentNode.remove();
  }
  function maximizePastReleases() {
    document.getElementById('pastreleases').style.opacity = 0.0;
    window.setTimeout(() => showPastReleases(null, true), 500);
    document.getElementById('pastreleases').removeEventListener('click', maximizePastReleases);
  }
  async function showPastReleases(ev, forceShow) {
    let hideDate = await GM.getValue('pastreleaseshidden', false);
    const releaseReminderData = JSON.parse(await GM.getValue('releasereminder', '{}'));
    const releases = [];
    let pastReleasesCounter = 0;
    const now = new Date();
    now.setHours(23);
    now.setMinutes(59);
    for (const key in releaseReminderData) {
      releaseReminderData[key].key = key;
      releaseReminderData[key].date = new Date(releaseReminderData[key].releaseDate);
      releaseReminderData[key].past = now >= releaseReminderData[key].date;
      if (releaseReminderData[key].past) {
        pastReleasesCounter++;
      }
      releases.push(releaseReminderData[key]);
    }
    releases.sort((a, b) => b.date - a.date);
    if (releases.length === 0 || pastReleasesCounter === 0) {
      return;
    }
    if (!document.getElementById('pastreleases')) {
      addStyle(pastreleasesCSS);
    }
    const div = document.body.appendChild(document.getElementById('pastreleases') || document.createElement('div'));
    div.setAttribute('id', 'pastreleases');
    div.style.maxHeight = document.documentElement.clientHeight - 50 + 'px';
    div.style.maxWidth = document.documentElement.clientWidth - 100 + 'px';
    if (document.getElementById('discographyplayer') && !allFeatures.discographyplayerSidebar.enabled) {
      div.style.bottom = document.getElementById('discographyplayer').clientHeight + 10 + 'px';
    }
    window.setTimeout(function () {
      div.style.opacity = 1.0;
    }, 200);
    div.innerHTML = '';
    const table = div.appendChild(document.createElement('div'));
    table.classList.add('tablediv');
    const firstRow = table.appendChild(document.createElement('div'));
    firstRow.classList.add('header');
    firstRow.appendChild(document.createTextNode('\u23F0'));
    firstRow.appendChild(document.createElement('span'));
    if (!forceShow && hideDate && !isNaN(hideDate = new Date(hideDate)) && new Date() - hideDate < 1000 * 60 * 60) {
      firstRow.appendChild(document.createTextNode(`${pastReleasesCounter} release` + (pastReleasesCounter === 1 ? '' : 's')));
      table.addEventListener('click', maximizePastReleases);
      return;
    } else {
      GM.setValue('pastreleaseshidden', '');
    }
    const upcoming = firstRow.appendChild(document.createElement('span'));
    if (releases.length !== pastReleasesCounter) {
      upcoming.appendChild(document.createTextNode(' Show upcoming'));
      upcoming.classList.add('upcoming');
      upcoming.addEventListener('click', function () {
        document.querySelectorAll('#pastreleases .future').forEach(function (el) {
          el.style.display = 'table-row';
        });
        this.remove();
      });
    }
    const controls = firstRow.appendChild(document.createElement('span'));
    controls.classList.add('controls');
    const refresh = controls.appendChild(document.createElement('span'));
    refresh.setAttribute('title', 'Update');
    refresh.addEventListener('click', function () {
      document.getElementById('pastreleases').style.opacity = 0.0;
      window.setTimeout(() => showPastReleases(null, true), 1200);
    });
    refresh.appendChild(document.createTextNode(NOEMOJI ? 'Refresh' : '⟳'));
    const close = controls.appendChild(document.createElement('span'));
    close.setAttribute('title', 'Hide');
    close.addEventListener('click', function () {
      GM.setValue('pastreleaseshidden', new Date().toJSON());
      document.getElementById('pastreleases').style.opacity = 0.0;
      window.setTimeout(function () {
        document.getElementById('pastreleases').remove();
      }, 700);
    });
    close.appendChild(document.createTextNode('X'));
    releases.forEach(function (release) {
      const days = parseInt(Math.ceil((release.date - now) / (1000 * 60 * 60 * 24)));
      const daysStr = days === 1 ? 'tomorrow' : `in ${days} days`;
      let title = `${release.artist} - ${release.title}`;
      const entry = table.appendChild(document.createElement('a'));
      entry.setAttribute('title', title);
      entry.dataset.key = release.key;
      entry.classList.add('entry');
      entry.classList.add(release.past ? 'past' : 'future');
      entry.setAttribute('href', document.location.protocol + '//' + release.key);
      entry.setAttribute('target', '_blank');
      const removeButton = entry.appendChild(document.createElement('span'));
      removeButton.setAttribute('title', 'Remove album');
      removeButton.classList.add('remove');
      removeButton.appendChild(document.createTextNode(NOEMOJI ? 'X' : '╳'));
      removeButton.addEventListener('click', removeReleaseReminder);
      const time = entry.appendChild(document.createElement('time'));
      time.setAttribute('datetime', release.date.toISOString());
      time.setAttribute('title', 'Releases ' + dateFormaterRelease(release.date));
      if (release.past) {
        time.appendChild(document.createTextNode(dateFormaterNumeric(release.date)));
      } else {
        time.appendChild(document.createTextNode(daysStr));
      }
      const span = entry.appendChild(document.createElement('span'));
      span.classList.add('title');
      title = title.length < 60 ? title : title.substr(0, 57) + '…';
      span.appendChild(document.createTextNode(' ' + title));
      const image = entry.appendChild(document.createElement('div'));
      image.classList.add('image');
      image.style.backgroundRepeat = 'no-repeat';
      image.style.backgroundSize = 'contain';
      image.style.backgroundImage = `url(${release.albumCover})`;
    });
  }
  let tagSearchRootContainer = null;
  function showTagSearchForm() {
    const menuA = this; // document.querySelector('#bcsde_tagsearchbutton')
    menuA.style.display = 'none';
    if (!document.getElementById('bcsde_tagsearchform')) {
      const cssStr = `
    #bcsde_tagsearchform {
      margin:0px 7px;
    }
    #bcsde_tagsearchform_tags {
      display: inline-block;
      list-style: none;
      padding: 0;
    }
    #bcsde_tagsearchform_tags li {
      display:inline;
      background:#f2eaea8a;
      border: 1px solid rgb(225, 45, 5);
      border-radius: 15px;
      padding: 2px 10px 2px 2px;
      font-size: 13px;
      font-weight: 500;
    }
    #bcsde_tagsearchform_tags li svg {
      filter: invert(100%);
      fill:rgb(225, 45, 5);
      vertical-align: middle;
    }
    #bcsde_tagsearchform_tags li .checkmark-icon {
      display:inline-block;
    }
    #bcsde_tagsearchform_tags li .close-icon {
      display:none;
    }
    #bcsde_tagsearchform_tags li:hover .checkmark-icon {
      display:none;
    }
    #bcsde_tagsearchform_tags li:hover .close-icon {
      display:inline-block;
    }
    #bcsde_tagsearchform button {
      margin: 3px;
      color: black !important;
      border: 1px solid black;
      border-radius: 5px;
      text-decoration: none;
      background: rgba(255, 255,255, 0.7);
      padding: 5px;
    }
    #bcsde_tagsearchform_input {
      background-color: #DFDFDF;
      padding: 10px 30px 10px 10px;
      font-size: 14px;
      border: none;
      width: 150px;
      color: #333;
      margin: 6px 0;
      border-radius: 3px;
      box-sizing: border-box;
      input-select:auto;
      -webkit-user-select:auto;
    }
    #bcsde_tagsearchform_suggestions {
      list-style: none;
      margin: 0;
      position: absolute;
      z-index: 10;
      background: #FFF;
      color: black;
      visibility: hidden;
      border: 1px solid #000;
      font-weight: normal;
      padding: 8px 0;
      opacity:0;
      transition:visibility 200ms linear,opacity 200ms linear;
      ${darkModeModeCurrent === true ? 'filter: invert(85%);' : ''}
    }
    #bcsde_tagsearchform_suggestions.visible {
      visibility:visible;
      opacity:1;
    }
    #bcsde_tagsearchform_suggestions li {
      color:black;
      padding: 8px 10px;
      cursor: pointer;
      list-style: none;
      margin: 0;
      display: list-item;
      text-align: left;
    }
    #bcsde_tagsearchform_suggestions li:hover,#bcsde_tagsearchform_suggestions li:focus {
      background: #F3F3F3;
    }
    `;
      addStyle(cssStr, {
        root: menuA.parentNode?.getRootNode()
      });
      const div = document.createElement('div');
      div.setAttribute('id', 'bcsde_tagsearchform');
      menuA.parentNode.appendChild(div);
      tagSearchRootContainer = menuA.parentNode;
      const tagsHolder = div.appendChild(document.createElement('ul'));
      tagsHolder.setAttribute('id', 'bcsde_tagsearchform_tags');
      const m = document.location.href.match(/\/tag\/([A-Za-z0-9-]+)(\?tab=all_releases&t=(.+))?/); // https://bandcamp.com/tag/metal?tab=all_releases&t=post-punk%2Cdark
      const tags = [];
      if (m) {
        tags.push(m[1]);
        if (m[3]) {
          tags.push(...m[3].split('&')[0].split('#')[0].split('%2C'));
        }
      }
      tags.forEach(tag => {
        tagsHolder.appendChild(tagSearchLabel(tag, tag.replace('-', ' ')));
      });
      const button = div.appendChild(document.createElement('button'));
      button.appendChild(document.createTextNode('Go'));
      button.addEventListener('click', openTagSearch);
      const input = div.appendChild(document.createElement('input'));
      input.setAttribute('type', 'text');
      input.setAttribute('id', 'bcsde_tagsearchform_input');
      input.setAttribute('placeholder', 'tag search');
      input.addEventListener('keyup', tagSearchInputChange);
      const suggestions = div.appendChild(document.createElement('ol'));
      suggestions.setAttribute('id', 'bcsde_tagsearchform_suggestions');
      if (document.querySelector('#corphome-autocomplete-form ul.hd-nav.corp-nav .log-in-link')) {
        // Homepage and not logged in -> make some room by removing the other list items from the nav
        document.querySelectorAll('#corphome-autocomplete-form ul.hd-nav.corp-nav>li:not([class~="menubar-item-tag-search"])').forEach(listItem => listItem.remove());
      }
    } else {
      document.querySelector('#bcsde_tagsearchform').style.display = '';
    }
  }
  function tagSearchLabel(tagNormName, tagName) {
    const li = document.createElement('li');
    li.dataset.tagNormName = tagNormName;
    li.dataset.name = tagName;
    const remove = li.appendChild(document.createElement('span'));
    remove.addEventListener('click', function () {
      this.parentNode.remove();
    });
    remove.innerHTML = `
  <svg class="checkmark-icon" width="16" height="16" viewBox="0 0 24 24">
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#material-done"></use>
  </svg>
  <svg class="close-icon" width="16" height="16" viewBox="0 0 24 24">
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#material-close"></use>
  </svg>
  `;
    li.appendChild(document.createTextNode(tagName));
    return li;
  }
  let ivTagSearchInput = null;
  function tagSearchInputChange(ev) {
    clearInterval(ivTagSearchInput);
    if (ev.key === 'Enter') {
      const input = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_input');
      if (input.value) {
        useTagSuggestion(null, input.value);
        return;
      }
    }
    ivTagSearchInput = window.setTimeout(showTagSuggestions, 300);
  }
  function showTagSuggestions() {
    const input = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_input');
    const suggestions = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_suggestions');
    if (!input.value.trim()) {
      suggestions.classList.remove('visible');
      return;
    }
    getTagSuggestions(input.value).then(data => {
      let found = false;
      if (data.ok && 'matching_tags' in data) {
        suggestions.innerHTML = '';
        suggestions.classList.add('visible');
        suggestions.style.left = input.offsetLeft + 'px';
        data.matching_tags.forEach(result => {
          found = true;
          const li = suggestions.appendChild(document.createElement('li'));
          li.dataset.tagNormName = result.tag_norm_name;
          li.dataset.name = result.tag_name;
          li.addEventListener('click', useTagSuggestion);
          li.appendChild(document.createTextNode(result.tag_name));
        });
      }
      if (!found) {
        if (input.value.trim()) {
          const li = suggestions.appendChild(document.createElement('li'));
          li.dataset.tagNormName = input.value.replace(/\s+/, '-');
          li.dataset.name = input.value;
          li.addEventListener('click', useTagSuggestion);
          li.appendChild(document.createTextNode(input.value));
        } else {
          suggestions.classList.remove('visible');
        }
      }
    });
  }
  function useTagSuggestion(ev, str = null) {
    const suggestions = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_suggestions');
    const tagsHolder = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_tags');
    const input = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_input');
    let tagNormName;
    let name;
    if (str) {
      // Use str
      tagNormName = str.replace(/\s+/, '-');
      name = str;
    } else {
      // Use tag that was clicked
      tagNormName = this.dataset.tagNormName;
      name = this.dataset.name;
    }
    tagsHolder.appendChild(tagSearchLabel(tagNormName, name));
    suggestions.classList.remove('visible');
    input.value = '';
    input.focus();
  }
  function getTagSuggestions(query) {
    const url = 'https://bandcamp.com/api/fansignup/1/search_tag';
    return new Promise(function getTagSuggestionsPromise(resolve, reject) {
      GM.xmlHttpRequest({
        method: 'POST',
        data: JSON.stringify({
          count: 20,
          search_term: query
        }),
        url,
        onload: function getTagSuggestionsOnLoad(response) {
          if (!response.responseText || response.responseText.indexOf('400 Bad Request') !== -1) {
            reject(new Error('Tag suggestions error: Too many cookies'));
            return;
          }
          if (!response.responseText || response.responseText.indexOf('429 Too Many Requests') !== -1) {
            reject(new Error('Tag suggestions error: 429 Too Many Requests'));
            return;
          }
          let result = null;
          try {
            result = JSON.parse(response.responseText);
          } catch (e) {
            console.debug(response.responseText);
            reject(e);
            return;
          }
          resolve(result);
        },
        onerror: function getTagSuggestionsOnError(response) {
          reject(new Error('error' in response ? response.error : 'getTagSuggestions failed with GM.xmlHttpRequest.onerror'));
        }
      });
    });
  }
  function openTagSearch() {
    // https://bandcamp.com/tag/metal?tab=all_releases&t=post-punk%2Cdark

    const tagsHolder = (tagSearchRootContainer || document).querySelector('#bcsde_tagsearchform_tags');
    const tags = [...new Set(Array.from(tagsHolder.querySelectorAll('li')).map(li => li.dataset.tagNormName))];
    if (tags.length === 0) {
      return;
    }
    const url = `https://bandcamp.com/tag/${tags.shift()}?tab=all_releases&t=${tags.join('%2C')}`;
    document.location.href = url;
    this.innerHTML = 'Loading...';
  }
  function mainMenu(startBackup) {
    addStyle(`
    .deluxemenu {
      position:fixed;
      height:auto;
      overflow:auto;
      top:20px;
      left:20px;
      z-index:1102;
      padding:5px;
      transition: left 1s;
      border:2px solid black;
      border-radius:10px;
      color:black;
      background:white;
    }
    .deluxemenu input{
      box-shadow: 2px 2px 5px #5555;
      transition: box-shadow 500ms;
    }
    .deluxemenu fieldset{
      border: 1px solid #000a;
      border-radius: 4px;
      box-shadow: 1px 1px 3px #0005;
    }
    .deluxemenu fieldset legend{
      margin-left: 10px;
      color: #000a
    }
    .deluxemenu button {
      border: 1px #ffffff solid;
      border-radius: 5px;
      text-decoration: none;
      background: #413fbf38;
      margin: 5px;
      padding: 2px;
      font-size:large;
    }
    .deluxemenu button:hover {
      border: 1px #3d42d9 solid;
      background: #5c7dd99c;
    }

    .breathe {
      animation: breathe 1.5s linear infinite
    }
    @keyframes breathe {
      50% { opacity: 0.3 }
    }
    .errorblink {
      animation: errorblink 1.5s linear infinite;
      border: 2px solid red;
    }
    @keyframes errorblink {
      50% { border-color:#6a0c41 }
    }
    .deluxemenu ul {
      margin: 0px;
      padding: 0px 0px 0px 10px;
      list-style:disc;
    }
    .deluxemenu ul li{
      margin: 0px;
      padding: 0px;
    }
  `);
    if (startBackup === true) {
      exportMenu();
      return;
    }
    if (document.querySelector('.deluxemenu')) {
      return;
    }

    // Blur background
    if (document.getElementById('centerWrapper')) {
      document.getElementById('centerWrapper').style.filter = 'blur(4px)';
    }
    const main = document.body.appendChild(document.createElement('div'));
    main.className = 'deluxemenu';
    main.innerHTML = `<h2>${SCRIPT_NAME}</h2>
  Source code license: <a target="_blank" href="https://github.com/cvzi/Bandcamp-script-deluxe-edition/blob/master/LICENSE">MIT</a><br>
  Support: <a target="_blank" href="https://github.com/cvzi/Bandcamp-script-deluxe-edition">github.com/cvzi/Bandcamp-script-deluxe-edition</a><br>
  Dark theme based on: <a target="_blank" href="https://userstyles.org/styles/171538/bandcamp-in-dark">"Bandcamp In Dark"</a> by <a target="_blank" href="https://userstyles.org/users/563391">Simonus</a><br>
  Dev &amp; build tools used: <a target="_blank" href="https://github.com/cvzi/Bandcamp-script-deluxe-edition/blob/master/package.json#L43-L71">package.json</a><br>
  Emoji: <a target="_blank" href="https://github.com/hfg-gmuend/openmoji">OpenMoji</a><br>
  Javascript libraries used:<br><ul>
  <li><a target="_blank" href="https://json5.org/">JSON5 - JSON for Humans</a> (MIT license)</li>
  <li><a target="_blank" href="https://github.com/facebook/react">React</a> (MIT license)</li>
  <li><a target="_blank" href="https://github.com/cvzi/genius-lyrics-userscript/">GeniusLyrics.js</a> (GPLv3)</li>
   </ul>
   <h3>Options</h3>
  `;
    window.setTimeout(function moveMenuIntoView() {
      main.style.maxHeight = document.documentElement.clientHeight - 150 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      main.style.left = Math.max(20, 0.5 * (document.body.clientWidth - main.clientWidth)) + 'px';
    }, 0);
    Promise.all([GM.getValue('volume', '0.7'), GM.getValue('myalbums', '{}'), GM.getValue('tralbumdata', '{}'), GM.getValue('enabledFeatures', false), GM.getValue('markasplayedThreshold', '10s')]).then(function allPromisesLoaded(values) {
      // let volume = parseFloat(values[0])
      // volume = Number.isNaN(volume) ? 0.7 : volume
      const myalbums = JSON.parse(values[1]);
      const tralbumdata = JSON.parse(values[2]);
      getEnabledFeatures(values[3]);
      const markasplayedThreshold = values[4];
      const checkboxOnChange = async function onCheckboxChange() {
        const input = this;
        getEnabledFeatures(await GM.getValue('enabledFeatures', false));
        allFeatures[input.name].enabled = input.checked;
        await GM.setValue('enabledFeatures', JSON.stringify(allFeatures));
        input.style.boxShadow = '2px 2px 5px #0a0f';
        window.setTimeout(function resetBoxShadowTimeout() {
          input.style.boxShadow = '';
        }, 3000);
        updateMoreVisibility();
      };
      const thresholdOnChange = async function onThresholdChange() {
        const input = this;
        let value = input.value.trim();
        const m = value.match(/^(\d+)(s|%)$/);
        if (m && parseInt(m[1]) >= 0 && (m[2] === 's' || parseInt(m[1]) <= 100)) {
          value = m[1] + m[2];
        } else if (value.match(/^\d+$/) && parseInt(value.split('\n')[0]) >= 0) {
          value = value.split('\n')[0] + 's';
        } else {
          window.alert('Format does not match!\nChoose either a time in seconds e.g. 10s or a percentage e.g. 50%');
          return;
        }
        await GM.setValue('markasplayedThreshold', value);
        input.value = value;
        input.style.boxShadow = '2px 2px 5px #0a0f';
        window.setTimeout(function resetBoxShadowTimeout() {
          input.style.boxShadow = '';
        }, 3000);
      };
      const updateMoreVisibility = function () {
        for (const feature in allFeatures) {
          if (document.getElementById('feature_' + feature + '_more_on')) {
            document.getElementById('feature_' + feature + '_more_on').style.display = allFeatures[feature].enabled ? 'block' : 'none';
          }
          if (document.getElementById('feature_' + feature + '_more_off')) {
            document.getElementById('feature_' + feature + '_more_off').style.display = allFeatures[feature].enabled ? 'none' : 'block';
          }
        }
      };
      for (const feature in allFeatures) {
        const div = main.appendChild(document.createElement('div'));
        const checkbox = div.appendChild(document.createElement('input'));
        checkbox.type = 'checkbox';
        checkbox.id = 'feature_' + feature;
        checkbox.name = feature;
        checkbox.checked = allFeatures[feature].enabled;
        const label = div.appendChild(document.createElement('label'));
        label.setAttribute('for', 'feature_' + feature);
        label.innerHTML = allFeatures[feature].name;
        checkbox.addEventListener('change', checkboxOnChange);
        if (feature === 'markasplayedAuto') {
          main.appendChild(document.createTextNode(' '));
          const inputThreshold = div.appendChild(document.createElement('input'));
          inputThreshold.type = 'text';
          inputThreshold.value = markasplayedThreshold;
          inputThreshold.size = 3;
          inputThreshold.title = 'For example: 10s or 50%';
          inputThreshold.id = 'feature_' + feature + '_threshold';
          div.appendChild(document.createTextNode(' '));
          const label = div.appendChild(document.createElement('label'));
          label.setAttribute('for', 'feature_' + feature + '_threshold');
          label.innerHTML = 'seconds or percentage.';
          inputThreshold.addEventListener('change', thresholdOnChange);
        }
        if (feature in moreSettings) {
          if (typeof moreSettings[feature] === 'function') {
            const moreSettinsContainer = main.appendChild(document.createElement('fieldset'));
            moreSettings[feature](moreSettinsContainer).then(function (v) {
              if (v) {
                moreSettinsContainer.appendChild(document.createElement('legend')).appendChild(document.createTextNode(v));
              }
            });
          } else {
            if ('true' in moreSettings[feature]) {
              const moreSettinsContainerOn = main.appendChild(document.createElement('fieldset'));
              moreSettinsContainerOn.setAttribute('id', 'feature_' + feature + '_more_on');
              moreSettinsContainerOn.style.display = allFeatures[feature].enabled ? 'block' : 'none';
              moreSettings[feature].true(moreSettinsContainerOn).then(function (v) {
                if (v) {
                  moreSettinsContainerOn.appendChild(document.createElement('legend')).appendChild(document.createTextNode(v));
                }
              });
            }
            if ('false' in moreSettings[feature]) {
              const moreSettinsContainerOff = main.appendChild(document.createElement('fieldset'));
              moreSettinsContainerOff.setAttribute('id', 'feature_' + feature + '_more_off');
              moreSettinsContainerOff.style.display = allFeatures[feature].enabled ? 'none' : 'block';
              moreSettings[feature].false(moreSettinsContainerOff).then(function (v) {
                if (v) {
                  moreSettinsContainerOff.appendChild(document.createElement('legend')).appendChild(document.createTextNode(v));
                }
              });
            }
          }
        }
      }

      // Hint
      main.appendChild(document.createElement('br'));
      const p = main.appendChild(document.createElement('p'));
      p.appendChild(document.createTextNode('Changes may require a page reload (F5)'));

      // Bottom buttons
      main.appendChild(document.createElement('br'));
      const buttons = main.appendChild(document.createElement('div'));
      const closeButton = buttons.appendChild(document.createElement('button'));
      closeButton.appendChild(document.createTextNode('Close'));
      closeButton.style.color = 'black';
      closeButton.addEventListener('click', function onCloseButtonClick() {
        document.querySelector('.deluxemenu').remove();
        // Un-blur background
        if (document.getElementById('centerWrapper')) {
          document.getElementById('centerWrapper').style.filter = '';
        }
      });
      const clearCacheButton = buttons.appendChild(document.createElement('button'));
      clearCacheButton.appendChild(document.createTextNode('Clear cache'));
      clearCacheButton.style.color = 'black';
      clearCacheButton.addEventListener('click', function onClearCacheButtonClick() {
        Promise.all([GM.setValue('genius_selectioncache', '{}'), GM.setValue('genius_requestcache', '{}'), GM.setValue('tralbumdata', '{}')]).then(function showClearedLabel() {
          clearCacheButton.innerHTML = 'Cleared';
        });
      });
      Promise.all([GM.getValue('genius_selectioncache', '{}'), GM.getValue('genius_requestcache', '{}')]).then(function (values) {
        JSON.stringify(tralbumdata);
        const bytesN = values[0].length - 2 + values[1].length - 2 + JSON.stringify(tralbumdata).length - 2;
        const bytes = metricPrefix(bytesN, 1, 1024) + 'Bytes';
        clearCacheButton.replaceChild(document.createTextNode('Clear cache (' + bytes + ')'), clearCacheButton.firstChild);
      });
      let myalbumsLength = 0;
      for (const key in myalbums) {
        if (myalbums[key].listened) {
          myalbumsLength++;
        }
      }
      const exportButton = buttons.appendChild(document.createElement('button'));
      exportButton.appendChild(document.createTextNode('Export played albums (' + myalbumsLength + ')'));
      exportButton.style.color = 'black';
      exportButton.addEventListener('click', function onExportButtonClick() {
        document.querySelector('.deluxemenu').remove();
        exportMenu();
      });
      main.appendChild(document.createElement('br'));
      main.appendChild(document.createElement('br'));
      const donateLink = main.appendChild(document.createElement('a'));
      const donateButton = donateLink.appendChild(document.createElement('button'));
      donateButton.appendChild(document.createTextNode('\u2764\uFE0F Donate & Support'));
      donateButton.style.color = '#e81224';
      donateLink.setAttribute('href', 'https://cvzi.github.io/.github/');
      donateLink.setAttribute('target', '_blank');
      main.appendChild(document.createElement('br'));
      main.appendChild(document.createElement('br'));
      const developerButton = main.appendChild(document.createElement('button'));
      developerButton.appendChild(document.createTextNode('Developer options'));
      developerButton.style.color = 'black';
      developerButton.addEventListener('click', function onDeveloperButtonClick() {
        document.querySelector('.deluxemenu').remove();
        developerMenu();
      });
    });
    window.setTimeout(function moveMenuIntoView() {
      let moveLeft = 0;
      main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      if (document.querySelector('#discographyplayer')) {
        if (document.querySelector('#discographyplayer').clientHeight < 100) {
          main.style.maxHeight = document.documentElement.clientHeight - 150 + 'px';
          main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
        } else if (document.querySelector('#discographyplayer').clientHeight > 300) {
          main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
          main.style.maxWidth = document.documentElement.clientWidth - 40 - document.querySelector('#discographyplayer').clientWidth + 'px';
          moveLeft = document.querySelector('#discographyplayer').clientWidth + 20;
        }
      }
      window.setTimeout(function () {
        main.style.left = Math.max(20, 0.5 * (document.body.clientWidth - main.clientWidth) - moveLeft) + 'px';
      }, 10);
    }, 10);
  }
  function developerMenu() {
    // Blur background
    if (document.getElementById('centerWrapper')) {
      document.getElementById('centerWrapper').style.filter = 'blur(4px)';
    }
    const main = document.body.appendChild(document.createElement('div'));
    main.className = 'deluxedeveloper deluxemenu';
    window.setTimeout(function moveMenuIntoView() {
      main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      main.style.left = Math.max(20, 0.5 * (document.body.clientWidth - main.clientWidth)) + 'px';
    }, 0);
    const h2 = main.appendChild(document.createElement('h2'));
    h2.appendChild(document.createTextNode('Developer options'));
    const table = main.appendChild(document.createElement('table'));

    // Bottom buttons
    main.appendChild(document.createElement('br'));
    main.appendChild(document.createElement('br'));
    const buttons = main.appendChild(document.createElement('div'));
    const closeButton = buttons.appendChild(document.createElement('button'));
    closeButton.appendChild(document.createTextNode('Close'));
    closeButton.style.color = 'black';
    closeButton.addEventListener('click', function onCloseButtonClick() {
      document.querySelector('.deluxedeveloper').remove();
      // Un-blur background
      if (document.getElementById('centerWrapper')) {
        document.getElementById('centerWrapper').style.filter = '';
      }
    });
    let tr;
    let td;
    let input;
    GM.getValue('myalbums', '{}').then(function myalbumsLoaded(myalbumsStr) {
      const myalbums = JSON.parse(myalbumsStr);
      const listenedAlbums = [];
      for (const key in myalbums) {
        if (myalbums[key].listened) {
          listenedAlbums.push(myalbums[key]);
        }
      }
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"myalbums" listened records'));
      td = tr.appendChild(document.createElement('td'));
      input = td.appendChild(document.createElement('input'));
      input.type = 'text';
      input.value = listenedAlbums.length.toString();
      input.readOnly = true;
      input.style.width = '200px';
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"myalbums" string length'));
      td = tr.appendChild(document.createElement('td'));
      input = td.appendChild(document.createElement('input'));
      input.type = 'text';
      input.value = myalbumsStr.length.toString();
      input.readOnly = true;
      input.style.width = '200px';
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"myalbums" size'));
      td = tr.appendChild(document.createElement('td'));
      input = td.appendChild(document.createElement('input'));
      input.type = 'text';
      input.value = humanBytes(new Blob([myalbumsStr]).size);
      input.readOnly = true;
      input.style.width = '200px';
    });
    GM.getValue('tralbumdata', '{}').then(function tralbumdataLoaded(tralbumdataStr) {
      const tralbumdata = JSON.parse(tralbumdataStr);
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"tralbumdataStr" entries'));
      td = tr.appendChild(document.createElement('td'));
      input = td.appendChild(document.createElement('input'));
      input.type = 'text';
      input.value = Object.keys(tralbumdata).length.toString();
      input.readOnly = true;
      input.style.width = '200px';
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"tralbumdataStr" string length'));
      td = tr.appendChild(document.createElement('td'));
      input = td.appendChild(document.createElement('input'));
      input.type = 'text';
      input.value = tralbumdataStr.length.toString();
      input.readOnly = true;
      input.style.width = '200px';
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"tralbumdataStr" size'));
      td = tr.appendChild(document.createElement('td'));
      input = td.appendChild(document.createElement('input'));
      input.type = 'text';
      input.value = humanBytes(new Blob([tralbumdataStr]).size);
      input.readOnly = true;
      input.style.width = '200px';
    });
    try {
      GM.getValue('tralbumlibrary', '{}').then(function tralbumlibraryLoaded(tralbumlibraryStr) {
        const tralbumlibrary = JSON.parse(tralbumlibraryStr);
        tr = table.appendChild(document.createElement('tr'));
        td = tr.appendChild(document.createElement('td'));
        td.appendChild(document.createTextNode('"tralbumlibraryStr" entries'));
        td = tr.appendChild(document.createElement('td'));
        input = td.appendChild(document.createElement('input'));
        input.type = 'text';
        input.value = Object.keys(tralbumlibrary).length.toString();
        input.readOnly = true;
        input.style.width = '200px';
        tr = table.appendChild(document.createElement('tr'));
        td = tr.appendChild(document.createElement('td'));
        td.appendChild(document.createTextNode('"tralbumlibraryStr" string length'));
        td = tr.appendChild(document.createElement('td'));
        input = td.appendChild(document.createElement('input'));
        input.type = 'text';
        input.value = tralbumlibraryStr.length.toString();
        input.readOnly = true;
        input.style.width = '200px';
        tr = table.appendChild(document.createElement('tr'));
        td = tr.appendChild(document.createElement('td'));
        td.appendChild(document.createTextNode('"tralbumlibraryStr" size'));
        td = tr.appendChild(document.createElement('td'));
        input = td.appendChild(document.createElement('input'));
        input.type = 'text';
        input.value = humanBytes(new Blob([tralbumlibraryStr]).size);
        input.readOnly = true;
        input.style.width = '200px';
      });
    } catch (e) {
      tr = table.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('"tralbumlibraryStr"'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('Error: ' + e.toString()));
    }
    window.setTimeout(function moveMenuIntoView() {
      main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      main.style.left = Math.max(20, 0.5 * (document.body.clientWidth - main.clientWidth)) + 'px';
    }, 500);
  }
  function exportMenu(showClearButton) {
    addStyle(`
    .deluxeexportmenu table {
    }

    .deluxeexportmenu table tr>td {
      color:black
    }
    .deluxeexportmenu table tr>td:nth-child(3) {
      color:silver
    }
    .deluxeexportmenu textarea.animated{
      box-shadow: 2px 2px 5px #5555;
      transition: box-shadow 500ms;
    }
    .deluxeexportmenu .drophint {
      position:absolute;
      top:10%;
      left:30%;
      color:#0097ff;
      font-size:3em;
      display:none;
    }
  `);

    // Blur background
    if (document.getElementById('centerWrapper')) {
      document.getElementById('centerWrapper').style.filter = 'blur(4px)';
    }
    const main = document.body.appendChild(document.createElement('div'));
    main.className = 'deluxeexportmenu deluxemenu';
    main.innerHTML = exportMenuHTML;
    const drophint = main.querySelector('.drophint');
    window.setTimeout(function moveMenuIntoView() {
      main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      main.style.left = Math.max(20, 0.5 * (document.body.clientWidth - main.clientWidth)) + 'px';
    }, 0);
    GM.getValue('myalbums', '{}').then(function myalbumsLoaded(myalbumsStr) {
      const myalbums = JSON.parse(myalbumsStr);
      const listenedAlbums = [];
      for (const key in myalbums) {
        if (myalbums[key].listened) {
          listenedAlbums.push(myalbums[key]);
        }
      }
      main.querySelector('h2').appendChild(document.createTextNode(' (' + listenedAlbums.length + ' records)'));
      let format = '%artist% - %title%';
      const formatAlbum = function formatAlbumStr(format, myAlbum) {
        const releaseDate = new Date(myAlbum.releaseDate);
        const listenedDate = new Date(myAlbum.listened);
        const fields = {
          '%artist%': () => myAlbum.artist,
          '%title%': () => myAlbum.title,
          '%cover%': () => myAlbum.albumCover,
          '%url%': () => myAlbum.url,
          '%releaseDate%': () => releaseDate.toISOString(),
          '%listenedDate%': () => listenedDate.toISOString(),
          '%releaseUnix%': () => parseInt(releaseDate.getTime() / 1000),
          '%listenedUnix%': () => parseInt(listenedDate.getTime() / 1000),
          '%releaseTimestamp%': () => releaseDate.getTime(),
          '%listenedTimestamp%': () => listenedDate.getTime(),
          '%releaseY%': () => releaseDate.getFullYear().toString().substring(2),
          '%releaseYYYY%': () => releaseDate.getFullYear(),
          '%releaseM%': () => releaseDate.getMonth() + 1,
          '%releaseMM%': () => padd(releaseDate.getMonth() + 1, 2, '0'),
          '%releaseMon%': () => releaseDate.toLocaleString(undefined, {
            month: 'short'
          }),
          '%releaseMonth%': () => releaseDate.toLocaleString(undefined, {
            month: 'long'
          }),
          '%releaseD%': () => releaseDate.getDate(),
          '%releaseDD%': () => padd(releaseDate.getDate(), 2, '0'),
          '%releaseDay%': () => releaseDate.toLocaleString(undefined, {
            weekday: 'long'
          }),
          '%listenedY%': () => listenedDate.getFullYear().toString().substring(2),
          '%listenedYYYY%': () => listenedDate.getFullYear(),
          '%listenedM%': () => listenedDate.getMonth() + 1,
          '%listenedMM%': () => padd(listenedDate.getMonth() + 1, 2, '0'),
          '%listenedMon%': () => listenedDate.toLocaleString(undefined, {
            month: 'short'
          }),
          '%listenedMonth%': () => listenedDate.toLocaleString(undefined, {
            month: 'long'
          }),
          '%listenedD%': () => listenedDate.getDate(),
          '%listenedDD%': () => padd(listenedDate.getDate(), 2, '0'),
          '%listenedDay%': () => listenedDate.toLocaleString(undefined, {
            weekday: 'long'
          }),
          '%json%': () => JSON.stringify(myAlbum),
          '%json5%': () => JSON5.stringify(myAlbum)
        };
        for (const field in fields) {
          if (format.includes(field)) {
            try {
              format = format.replace(field, fields[field]());
            } catch (e) {
              console.error('Could not format replace "' + field + '": ' + e);
            }
          }
        }
        return format;
      };
      const sortBy = function sortByCmp(sortKey) {
        const cmps = {
          playedAsc: function playedAsc(a, b) {
            return -cmps.playedDesc(a, b);
          },
          playedDesc: function playedDesc(a, b) {
            try {
              return new Date(b.listened) - new Date(a.listened);
            } catch (e) {
              return 0;
            }
          },
          releasedAsc: function releasedAsc(a, b) {
            return -cmps.releasedDesc(a, b);
          },
          releasedDesc: function releasedDesc(a, b) {
            try {
              return new Date(b.releaseDate) - new Date(a.releaseDate);
            } catch (e) {
              return 0;
            }
          },
          artist: function artist(a, b, fallbackToTitle) {
            const d = a.artist.localeCompare(b.artist);
            if (d === 0 && fallbackToTitle) {
              return cmps.title(a, b, false);
            } else {
              return d;
            }
          },
          title: function title(a, b, fallbackToArtist) {
            const d = a.title.localeCompare(b.title);
            if (d === 0 && fallbackToArtist) {
              return cmps.artist(a, b, false);
            } else {
              return d;
            }
          }
        };
        listenedAlbums.sort(cmps[sortKey]);
      };
      const generate = function generateStr() {
        const textarea = document.getElementById('export_output');
        window.setTimeout(function generateStrAnimation() {
          textarea.classList.remove('animated');
          textarea.style.boxShadow = '2px 2px 5px #00af';
        }, 0);
        let str;
        if (format === '%backup%') {
          str = myalbumsStr;
        } else {
          const sortSelect = document.getElementById('sort_select');
          sortBy(sortSelect.options[sortSelect.selectedIndex].value);
          str = [];
          for (let i = 0; i < listenedAlbums.length; i++) {
            str.push(formatAlbum(format, listenedAlbums[i]));
          }
          str = str.join(navigator.platform.startsWith('Win') ? '\r\n' : '\n');
        }
        window.setTimeout(function generateStrAnimationSuccess() {
          textarea.value = str;
          textarea.classList.add('animated');
          textarea.style.boxShadow = '2px 2px 5px #0a0f';
        }, 50);
        window.setTimeout(function generateStrResetAnimation() {
          textarea.style.boxShadow = '';
        }, 3000);
        return str;
      };
      const inputFormatOnChange = async function onInputFormatChange() {
        const input = this;
        const formatExample = document.getElementById('format_example');
        format = input.value;
        formatExample.value = listenedAlbums.length > 0 ? formatAlbum(format, listenedAlbums[0]) : '';
        formatExample.style.boxShadow = '2px 2px 5px #0a0f';
        window.setTimeout(function resetBoxShadow() {
          formatExample.style.boxShadow = '';
        }, 3000);
      };
      const importData = function importDate(data) {
        GM.getValue('myalbums', '{}').then(function myalbumsLoaded(myalbumsStr) {
          let myalbums = JSON.parse(myalbumsStr);
          myalbums = Object.assign(myalbums, data);
          return GM.setValue('myalbums', JSON.stringify(myalbums));
        }).then(function myalbumsSaved() {
          document.getElementById('exportmenu_close').click();
          window.setTimeout(() => exportMenu(true), 50);
        });
      };
      const handleFiles = async function handleFilesAsync(fileList) {
        if (fileList.length === 0) {
          console.debug('fileList is empty');
          return;
        }
        let data;
        try {
          data = await new Response(fileList[0]).json();
        } catch (e) {
          window.alert('Could not load file:\n' + e);
          return;
        }
        const n = Object.keys(data).length;
        if (window.confirm('Found ' + n + ' albums. Continue import and overwrite existing albums?')) {
          importData(data);
        }
      };
      const inputTable = main.appendChild(document.createElement('table'));
      let tr;
      let td;
      tr = inputTable.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      const label = td.appendChild(document.createElement('label'));
      label.setAttribute('for', 'export_format');
      label.appendChild(document.createTextNode('Format:'));
      td = tr.appendChild(document.createElement('td'));
      const inputFormat = td.appendChild(document.createElement('input'));
      inputFormat.type = 'text';
      inputFormat.value = format;
      inputFormat.id = 'export_format';
      inputFormat.style.width = '600px';
      inputFormat.addEventListener('change', inputFormatOnChange);
      inputFormat.addEventListener('keyup', inputFormatOnChange);
      tr = inputTable.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('Example:'));
      td = tr.appendChild(document.createElement('td'));
      const inputExample = td.appendChild(document.createElement('input'));
      inputExample.type = 'text';
      inputExample.value = listenedAlbums.length > 0 ? formatAlbum(format, listenedAlbums[0]) : '';
      inputExample.readOnly = true;
      inputExample.id = 'format_example';
      inputExample.style.width = '600px';
      td = tr.appendChild(document.createElement('td'));
      td.appendChild(document.createTextNode('Sort by:'));
      td = tr.appendChild(document.createElement('td'));
      const sortSelect = td.appendChild(document.createElement('select'));
      sortSelect.id = 'sort_select';
      sortSelect.innerHTML = `
      <option value="playedDesc">Recent play first</option>
      <option value="playedAsc">Recent play last</option>
      <option value="releasedDesc">Recent release first</option>
      <option value="releasedAsc">Recent release last</option>
      <option value="artist">Artist A-Z</option>
      <option value="title">Title A-Z</option>
    `;
      tr = inputTable.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.setAttribute('colspan', '2');
      const generateButton = td.appendChild(document.createElement('button'));
      generateButton.appendChild(document.createTextNode('Generate'));
      generateButton.addEventListener('click', ev => generate());
      const exportButton = td.appendChild(document.createElement('button'));
      exportButton.appendChild(document.createTextNode('Export to file'));
      exportButton.title = 'Download as a text file';
      exportButton.addEventListener('click', function onExportFileButtonClick() {
        const dateSuffix = new Date().toISOString().split('T')[0];
        document.getElementById('export_download_link').download = 'bandcampPlayedAlbums_' + dateSuffix + '.txt';
        document.getElementById('export_download_link').href = 'data:text/plain,' + encodeURIComponent(generate());
        window.setTimeout(() => document.getElementById('export_download_link').click(), 50);
      });
      const backupButton = td.appendChild(document.createElement('button'));
      backupButton.title = 'Backup to JSON file. Can be restored on another browser';
      backupButton.appendChild(document.createTextNode('Backup'));
      backupButton.addEventListener('click', function onBackupButtonClick() {
        format = '%backup%';
        document.getElementById('export_format').value = format;
        document.getElementById('format_example').value = 'JSON dictionary';
        const dateSuffix = new Date().toISOString().split('T')[0];
        document.getElementById('export_download_link').download = 'bandcampPlayedAlbums_' + dateSuffix + '.json';
        document.getElementById('export_download_link').href = 'data:application/json,' + encodeURIComponent(generate());
        document.getElementById('export_clear_button').style.display = '';
        GM.setValue('myalbums_lastbackup', Object.keys(myalbums).length + '#####' + new Date().toJSON());
        window.setTimeout(() => document.getElementById('export_download_link').click(), 50);
      });
      const restoreButton = td.appendChild(document.createElement('button'));
      restoreButton.title = 'Restore from JSON file backup';
      restoreButton.appendChild(document.createTextNode('Restore'));
      restoreButton.addEventListener('click', function onBackupButtonClick() {
        inputFile.click();
      });
      const clearButton = td.appendChild(document.createElement('button'));
      clearButton.appendChild(document.createTextNode('Clear played albums'));
      clearButton.id = 'export_clear_button';
      if (showClearButton !== true) {
        clearButton.style.display = 'none';
      }
      clearButton.addEventListener('click', function onClearButtonClick() {
        if (window.confirm('Remove all played albums?\n\nThis cannot be undone.')) {
          if (window.confirm('Are you sure? Delete all played albums?')) {
            GM.setValue('myalbums', '{}').then(function myalbumsSaved() {
              document.getElementById('exportmenu_close').click();
              window.setTimeout(exportMenu, 50);
            });
          }
        }
      });
      const downloadA = td.appendChild(document.createElement('a'));
      downloadA.id = 'export_download_link';
      downloadA.href = '#';
      downloadA.download = 'bandcamp_played_albums.txt';
      downloadA.target = '_blank';
      const inputFile = td.appendChild(document.createElement('input'));
      inputFile.type = 'file';
      inputFile.id = 'input_file';
      inputFile.accept = '.txt,plain/text,.json,application/json';
      inputFile.style.display = 'none';
      inputFile.addEventListener('change', function onFileChanged(ev) {
        handleFiles(this.files);
      }, false);
      main.addEventListener('dragenter', function dragenter(ev) {
        stopPropagationDefault(ev);
        main.style.backgroundColor = '#c6daf9';
        drophint.style.left = main.clientWidth / 2 - drophint.clientWidth / 2 + 'px';
        drophint.style.display = 'block';
      }, false);
      main.addEventListener('dragleave', function dragleave(ev) {
        main.style.backgroundColor = 'white';
        drophint.style.display = 'none';
      }, false);
      main.addEventListener('dragover', function dragover(ev) {
        stopPropagationDefault(ev);
        main.style.backgroundColor = '#c6daf9';
        drophint.style.display = 'block';
      }, false);
      main.addEventListener('drop', function drop(ev) {
        stopPropagationDefault(ev);
        main.style.backgroundColor = 'white';
        drophint.style.display = 'none';
        handleFiles(ev.dataTransfer.files);
      }, false);
      tr = inputTable.appendChild(document.createElement('tr'));
      td = tr.appendChild(document.createElement('td'));
      td.setAttribute('colspan', '3');
      const textarea = td.appendChild(document.createElement('textarea'));
      textarea.id = 'export_output';
      textarea.style.width = Math.max(500, main.clientWidth - 50) + 'px';

      // Bottom buttons
      main.appendChild(document.createElement('br'));
      main.appendChild(document.createElement('br'));
      const buttons = main.appendChild(document.createElement('div'));
      const closeButton = buttons.appendChild(document.createElement('button'));
      closeButton.appendChild(document.createTextNode('Close'));
      closeButton.id = 'exportmenu_close';
      closeButton.style.color = 'black';
      closeButton.addEventListener('click', function onCloseButtonClick() {
        document.querySelector('.deluxeexportmenu').remove();
        // Un-blur background
        if (document.getElementById('centerWrapper')) {
          document.getElementById('centerWrapper').style.filter = '';
        }
      });
    });
    window.setTimeout(function moveMenuIntoView() {
      main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      main.style.left = Math.max(20, 0.5 * (document.body.clientWidth - main.clientWidth)) + 'px';
    }, 0);
  }
  function checkBackupStatus() {
    GM.getValue('myalbums_lastbackup', '').then(function myalbumsLastBackupLoaded(value) {
      if (!value || !value.includes('#####')) {
        // Set current date (install date) as initial value
        GM.setValue('myalbums_lastbackup', '0#####' + new Date().toJSON());
        return;
      }
      const parts = value.split('#####');
      const n0 = parseInt(parts[0]);
      const lastBackup = new Date(parts[1]);
      if (new Date() - lastBackup > BACKUP_REMINDER_DAYS * 86400000) {
        GM.getValue('myalbums', '{}').then(function myalbumsLoaded(str) {
          const n1 = Object.keys(JSON.parse(str)).length;
          if (Math.abs(n0 - n1) > 10) {
            showBackupHint(lastBackup, Math.abs(n0 - n1));
          }
        });
      }
    });
  }
  function showBackupHint(lastBackup, changedRecords) {
    const since = timeSince(lastBackup);
    addStyle(`
    .backupreminder {
      position:fixed;
      height:auto;
      overflow:auto;
      top:110%;
      left:40%;
      z-index:200;
      padding:5px;
      transition: top 1s;
      border:2px solid black;
      border-radius:10px;
      color:black;
      background:white;
    }
  `);

    // Blur background
    if (document.getElementById('centerWrapper')) {
      document.getElementById('centerWrapper').style.filter = 'blur(4px)';
    }
    const main = document.body.appendChild(document.createElement('div'));
    main.className = 'backupreminder';
    main.innerHTML = `<h2>${SCRIPT_NAME}</h2>
  <h1>Backup reminder</h1>
  <p>
    Your last backup was ${since} ago. Since then, you played ${changedRecords} albums.
  </p>
  `;
    main.appendChild(document.createElement('br'));
    const buttons = main.appendChild(document.createElement('div'));
    const closeButton = buttons.appendChild(document.createElement('button'));
    closeButton.appendChild(document.createTextNode('Close'));
    closeButton.id = 'backupreminder_close';
    closeButton.style.color = 'black';
    closeButton.addEventListener('click', function onCloseButtonClick() {
      document.querySelector('.backupreminder').remove();
      // Un-blur background
      if (document.getElementById('centerWrapper')) {
        document.getElementById('centerWrapper').style.filter = '';
      }
    });
    buttons.appendChild(document.createTextNode(' '));
    const backupButton = buttons.appendChild(document.createElement('button'));
    backupButton.appendChild(document.createTextNode('Start backup'));
    backupButton.style.color = '#0687f5';
    backupButton.addEventListener('click', function backupButtonClick() {
      document.getElementById('backupreminder_close').click();
      mainMenu(true);
    });
    buttons.appendChild(document.createTextNode(' '));
    const ignoreButton = buttons.appendChild(document.createElement('button'));
    ignoreButton.appendChild(document.createTextNode('Disable reminder'));
    ignoreButton.style.color = 'black';
    ignoreButton.addEventListener('click', async function ignoreButtonClick() {
      getEnabledFeatures(await GM.getValue('enabledFeatures', false));
      if (allFeatures.backupReminder.enabled) {
        allFeatures.backupReminder.enabled = false;
      }
      await GM.setValue('enabledFeatures', JSON.stringify(allFeatures));
      document.getElementById('backupreminder_close').click();
    });
    window.setTimeout(function moveMenuIntoView() {
      main.style.maxHeight = document.documentElement.clientHeight - 40 + 'px';
      main.style.maxWidth = document.documentElement.clientWidth - 40 + 'px';
      main.style.left = Math.max(20, 0.5 * (document.documentElement.clientWidth - main.clientWidth)) + 'px';
      main.style.top = Math.max(20, 0.3 * document.documentElement.clientHeight) + 'px';
    }, 0);
  }
  function downloadMp3FromLink(ev, a, addSpinner, removeSpinner, noGM) {
    const url = a.href;
    if (GM_download && !noGM) {
      // Use Tampermonkey GM_download function
      console.debug('Using GM_download function');
      ev.preventDefault();
      addSpinner(a);
      let GMdownloadStatus = 0;
      GM_download({
        url,
        name: a.download || 'default.mp3',
        onerror: function downloadMp3FromLinkOnError(e) {
          console.debug('GM_download onerror:', e);
          window.setTimeout(function () {
            if (GMdownloadStatus !== 1) {
              if (url.startsWith('data')) {
                console.debug('GM_download failed with data url');
                document.location.href = url;
              } else {
                console.debug('Trying again with GM_download disabled');
                downloadMp3FromLink(ev, a, addSpinner, removeSpinner, true);
              }
            }
          }, 1000);
        },
        ontimeout: function downloadMp3FromLinkOnTimeout() {
          window.alert('Could not download via GM_download. Time out.');
          document.location.href = url;
        },
        onload: function downloadMp3FromLinkOnLoad() {
          console.debug('Successfully downloaded via GM_download');
          GMdownloadStatus = 1;
          window.setTimeout(() => removeSpinner(a), 500);
        }
      });
      return;
    }
    if (!url.startsWith('http') || navigator.userAgent.indexOf('Chrome') !== -1) {
      // Just open the link normally (no prevent default)
      addSpinner(a);
      window.setTimeout(() => removeSpinner(a), 1000);
      return;
    }

    // Use GM.xmlHttpRequest to download and offer data uri
    ev.preventDefault();
    console.debug('Using GM.xmlHttpRequest to download and then offer data uri');
    addSpinner(a);
    GM.xmlHttpRequest({
      method: 'GET',
      overrideMimeType: 'text/plain; charset=x-user-defined',
      url,
      onload: function onMp3Load(response) {
        console.debug('Successfully received data via GM.xmlHttpRequest, starting download');
        a.href = 'data:audio/mpeg;base64,' + base64encode(response.responseText);
        window.setTimeout(() => a.click(), 10);
      },
      onerror: function onMp3LoadError(response) {
        window.alert('Could not download via GM.xmlHttpRequest');
        document.location.href = url;
      }
    });
  }
  function addDownloadLinksToAlbumPage() {
    addStyle(`
  .download-col .downloaddisk:hover {
    text-decoration:none
  }
  /* From http://www.designcouch.com/home/why/2013/05/23/dead-simple-pure-css-loading-spinner/ */
  .downspinner {
    height:16px;
    width:16px;
    margin:0px auto;
    position:relative;
    display:inline-block;
    animation: spinnerrotation 3s infinite linear;
    cursor:wait;
  }
  @keyframes spinnerrotation {
    from {transform: rotate(0deg)}
    to {transform: rotate(359deg)}
  }`);
    const addSpiner = function downloadLinksOnAlbumPageAddSpinner(el) {
      el.style = '';
      el.classList.add('downspinner');
    };
    const removeSpinner = function downloadLinksOnAlbumPageRemoveSpinner(el) {
      el.classList.remove('downspinner');
      el.style = 'background:#1cea1c; border-radius:5px; padding:1px; opacity:0.5';
    };
    const TralbumData = unsafeWindow.TralbumData;
    if (TralbumData && TralbumData.hasAudio && !TralbumData.freeDownloadPage && TralbumData.trackinfo) {
      const hoverdiv = document.querySelectorAll('.download-col div');
      if (hoverdiv.length > 0) {
        // Album page
        for (let i = 0; i < TralbumData.trackinfo.length; i++) {
          if (!NOEMOJI && hoverdiv[i].querySelector('a[href*="?action=download"]')) {
            // Replace buy link with shopping cart emoji
            hoverdiv[i].querySelector('a[href*="?action=download"]').innerHTML = '&#x1f6d2;';
            hoverdiv[i].querySelector('a[href*="?action=download"]').title = 'buy track';
          }
          // Add download link
          const t = TralbumData.trackinfo[i];
          if (!t.file) {
            continue;
          }
          const prop = Object.keys(t.file)[0]; // Just use the first file entry
          const mp3 = t.file[prop].replace(/^\/\//, 'http://');
          const a = document.createElement('a');
          a.className = 'downloaddisk';
          a.href = mp3;
          a.download = (t.track_num == null ? '' : (t.track_num > 9 ? '' : '0') + t.track_num + '. ') + fixFilename(TralbumData.artist + ' - ' + t.title) + '.mp3';
          a.title = 'Download ' + prop;
          a.appendChild(document.createTextNode(NOEMOJI ? '\u2193' : '\uD83D\uDCBE'));
          a.addEventListener('click', function onDownloadLinkClick(ev) {
            downloadMp3FromLink(ev, this, addSpiner, removeSpinner);
          });
          hoverdiv[i].appendChild(a);
        }
      } else if (document.querySelector('#trackInfo .download-link')) {
        // Single track page
        const t = TralbumData.trackinfo[0];
        if (!t.file) {
          return;
        }
        const prop = Object.keys(t.file)[0];
        const mp3 = t.file[prop].replace(/^\/\//, 'http://');
        const a = document.createElement('a');
        a.className = 'downloaddisk';
        a.href = mp3;
        a.download = (t.track_num == null ? '' : (t.track_num > 9 ? '' : '0') + t.track_num + '. ') + fixFilename(TralbumData.artist + ' - ' + t.title) + '.mp3';
        a.title = 'Download ' + prop;
        a.appendChild(document.createTextNode(NOEMOJI ? '\u2193' : '\uD83D\uDCBE'));
        a.addEventListener('click', function onDownloadLinkClick(ev) {
          downloadMp3FromLink(ev, this, addSpiner, removeSpinner);
        });
        document.querySelector('#trackInfo .download-link').parentNode.appendChild(a);
      }
    }
  }
  function addOpenDiscographyPlayerFromAlbumPage() {
    // Open discrography player by clicking on top right corner of album art
    // Shows the usual play button on hover
    const xRatio = 0.7;
    const yRatio = 0.3;
    let rect = null;
    const isInRatio = function isInRatio(ev) {
      rect = rect || ev.target.getBoundingClientRect();
      const x = ev.clientX - rect.left;
      const y = ev.clientY - rect.top;
      return x > rect.width * xRatio && y < rect.height * yRatio;
    };
    const a = document.querySelector('#tralbumArt a.popupImage');
    if (!a) {
      return;
    }
    const div = a.appendChild(document.createElement('div'));
    div.classList.add('art-play');
    div.innerHTML = '<div class="art-play-bg"></div><div class="art-play-icon"></div>';
    a.classList.add('playFromAlbumPage');
    addStyle(`
  .playFromAlbumPage .art-play {
    position: absolute;
    width: 74px;
    height: 54px;
    right: 7%;
    top: 15%;
    margin-left: -36px;
    margin-top: -27px;
    opacity: 0.0;
    transition: opacity 0.2s;
  }
  .playFromAlbumPage .art-play-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: #000;
    border-radius: 4px;
  }
  .playFromAlbumPage .art-play-icon {
    position: absolute;
    width: 0;
    height: 0;
    left: 28px;
    top: 17px;
    border-width: 10px 0 10px 17px;
    border-color: transparent transparent transparent #fff;
    border-style: dashed dashed dashed solid;
  }
  `);
    a.addEventListener('click', function onAlbumArtClick(ev) {
      if (isInRatio(ev)) {
        // Open player
        stopPropagationDefault(ev);
        if (unsafeWindow.TralbumData) {
          addAlbumToPlaylist(unsafeWindow.TralbumData);
        } else {
          playAlbumFromUrl(document.location.href);
        }
      }
    }, true);
    a.addEventListener('mouseover', function onAlbumArtOver(ev) {
      if (isInRatio(ev)) {
        a.querySelector('.art-play').style.opacity = 0.7;
      } else {
        a.querySelector('.art-play').style.opacity = 0.0;
      }
    });
    a.addEventListener('mousemove', function onAlbumArtOver(ev) {
      if (isInRatio(ev)) {
        a.querySelector('.art-play').style.opacity = 0.7;
      } else {
        a.querySelector('.art-play').style.opacity = 0.0;
      }
    });
    a.addEventListener('mouseleave', function onAlbumArtOver(ev) {
      rect = null;
      a.querySelector('.art-play').style.opacity = 0.0;
    });
  }
  function addLyricsToAlbumPage() {
    // Load lyrics from html into TralbumData
    const TralbumData = unsafeWindow.TralbumData;
    function findInTralbumData(url) {
      for (let i = 0; i < TralbumData.trackinfo.length; i++) {
        const t = TralbumData.trackinfo[i];
        if (url.endsWith(t.title_link)) {
          return t;
        }
      }
      return null;
    }
    const tracks = Array.from(document.querySelectorAll('#track_table .track_row_view .title a')).map(a => findInTralbumData(a.href));
    document.querySelectorAll('#track_table .track_row_view .title a').forEach(function (a) {
      const tr = parentQuery(a, 'tr[rel]');
      const trackNum = tr.getAttribute('rel').split('tracknum=')[1];
      const lyricsRow = document.querySelector('#track_table tr#lyrics_row_' + trackNum);
      const lyricsLink = tr.querySelector('.geniuslink');
      if (tr.querySelector('.info_link').innerHTML.indexOf('lyrics') === -1) {
        // Hide info link if there are no lyrics
        tr.querySelector('.info_link a[href*="/track/"]').innerHTML = '';
      }
      if (lyricsRow) {
        const trackNum = parseInt(lyricsRow.id.split('lyrics_row_')[1]);
        for (let i = 0; i < tracks.length; i++) {
          if (trackNum === tracks[i].track_num) {
            tracks[i].lyrics = lyricsRow.querySelector('div').textContent;
          }
        }
      } else if (!lyricsLink) {
        // Add genius link
        const lyricsLink = tr.querySelector('.info_link').appendChild(document.createElement('a'));
        lyricsLink.dataset.trackNum = trackNum;
        lyricsLink.title = 'load lyrics from genius.com';
        lyricsLink.href = '#geniuslyrics-' + trackNum;
        lyricsLink.classList.add('geniuslink');
        lyricsLink.appendChild(document.createTextNode('G'));
        lyricsLink.style = 'color: black;background: rgb(255, 255, 100);border-radius: 50%;padding: 0px 3px;border: 1px solid black';
        lyricsLink.addEventListener('click', function () {
          loadGeniusLyrics(parseInt(this.dataset.trackNum));
        });
      }
    });
  }
  let genius = null;
  let geniusContainerTr = null;
  let geniusTrackNum = -1;
  let geniusArtistsArr = [];
  let geniusTitle = '';
  function geniusGetCleanLyricsContainer() {
    geniusContainerTr.innerHTML = `
                    <td colspan="5">
                      <div></div>
                    </td>
`;
    return geniusContainerTr.querySelector('div');
  }
  function geniusAddLyrics(force, beLessSpecific) {
    genius.f.loadLyrics(force, beLessSpecific, geniusTitle, geniusArtistsArr, true);
  }
  function geniusHideLyrics() {
    document.querySelectorAll('.loadingspinner').forEach(spinner => spinner.remove());
    document.querySelectorAll('#track_table tr.showlyrics').forEach(e => e.classList.remove('showlyrics'));
  }
  function geniusSetFrameDimensions(container, iframe) {
    const width = iframe.style.width = '500px';
    const height = iframe.style.height = '650px';
    if (genius.option.themeKey === 'spotify') {
      iframe.style.backgroundColor = 'black';
    } else {
      iframe.style.backgroundColor = '';
    }
    return [width, height];
  }
  function geniusAddCss() {
    addStyle(geniusCSS);
    addStyle(`
  #myconfigwin39457845 {
    background-color:${darkModeModeCurrent === true ? '#a2a2a2' : 'white'} !important;
    color:${darkModeModeCurrent === true ? 'white' : 'black'} !important;
  }
  #myconfigwin39457845 div {
    background-color:${darkModeModeCurrent === true ? '#3E3E3E' : '#EFEFEF'} !important
  }
  .lyricsnavbar {
    background:${darkModeModeCurrent === true ? '#7d7c7c' : '#fafafa'} !important;
  }
  `);
  }
  function geniusCreateSpinner(spinnerHolder) {
    geniusContainerTr.querySelector('div').insertBefore(spinnerHolder, geniusContainerTr.querySelector('div').firstChild);
    const spinner = spinnerHolder.appendChild(document.createElement('div'));
    spinner.classList.add('loadingspinner');
    return spinner;
  }
  function geniusShowSearchField(query) {
    const b = geniusGetCleanLyricsContainer();
    b.style.border = '1px solid black';
    b.style.borderRadius = '3px';
    b.style.padding = '5px';
    b.appendChild(document.createTextNode('Search genius.com: '));
    b.style.paddingRight = '15px';
    const input = b.appendChild(document.createElement('input'));
    input.className = 'SearchInputBox__input';
    input.placeholder = 'Search genius.com...';
    input.style = 'width: 300px;background-color: #F3F3F3;padding: 10px 30px 10px 10px;font-size: 14px; border: none;color: #333;margin: 6px 0;height: 17px;border-radius: 3px;';
    const span = b.appendChild(document.createElement('span'));
    span.style = 'cursor:pointer; margin-left: -25px;';
    span.appendChild(document.createTextNode(' \uD83D\uDD0D'));
    if (query) {
      input.value = query;
    } else if (genius.current.artists) {
      input.value = genius.current.artists;
    }
    input.addEventListener('change', function onSearchLyricsButtonClick() {
      if (input.value) {
        genius.f.searchByQuery(input.value, b);
      }
    });
    input.addEventListener('keyup', function onSearchLyricsKeyUp(ev) {
      if (ev.keyCode === 13) {
        ev.preventDefault();
        if (input.value) {
          genius.f.searchByQuery(input.value, b);
        }
      }
    });
    span.addEventListener('click', function onSearchLyricsKeyUp(ev) {
      if (input.value) {
        genius.f.searchByQuery(input.value, b);
      }
    });
    input.focus();
  }
  function geniusListSongs(hits, container, query) {
    if (!container) {
      container = geniusGetCleanLyricsContainer();
    }

    // Back to search button
    const backToSearchButton = document.createElement('a');
    backToSearchButton.href = '#';
    backToSearchButton.appendChild(document.createTextNode('Back to search'));
    backToSearchButton.addEventListener('click', function backToSearchButtonClick(ev) {
      ev.preventDefault();
      if (query) {
        geniusShowSearchField(query);
      } else if (genius.current.artists) {
        geniusShowSearchField(genius.current.artists + ' ' + genius.current.title);
      } else {
        geniusShowSearchField();
      }
    });
    const separator = document.createElement('span');
    separator.setAttribute('class', 'second-line-separator');
    separator.setAttribute('style', 'padding:0px 3px');
    separator.appendChild(document.createTextNode('•'));

    // Hide button
    const hideButton = document.createElement('a');
    hideButton.href = '#';
    hideButton.appendChild(document.createTextNode('Hide'));
    hideButton.addEventListener('click', function hideButtonClick(ev) {
      ev.preventDefault();
      geniusHideLyrics();
    });

    // List search results
    const trackhtml = '<div style="float:left;"><div class="onhover" style="margin-top:-0.25em;display:none"><span style="color:black;font-size:2.0em">🅖</span></div><div class="onout"><span style="font-size:1.5em">📄</span></div></div>' + '<div style="float:left; margin-left:5px">$artist • $title <br><span style="font-size:0.7em">👁 $stats.pageviews $lyrics_state</span></div><div style="clear:left;"></div>';
    container.innerHTML = '<ol class="tracklist" style="font-size:1.15em"></ol>';
    container.classList.add('searchresultlist');
    if (darkModeModeCurrent === true) {
      container.style.backgroundColor = '#262626';
      container.style.position = 'relative';
    }
    container.insertBefore(hideButton, container.firstChild);
    container.insertBefore(separator, container.firstChild);
    container.insertBefore(backToSearchButton, container.firstChild);
    const ol = container.querySelector('ol');
    const searchresultsLengths = hits.length;
    const title = genius.current.title;
    const artists = genius.current.artists;
    const onclick = function onclick() {
      genius.f.rememberLyricsSelection(title, artists, this.dataset.hit);
      genius.f.showLyrics(JSON.parse(this.dataset.hit), searchresultsLengths);
    };
    const mouseover = function onmouseover() {
      this.querySelector('.onhover').style.display = 'block';
      this.querySelector('.onout').style.display = 'none';
      this.style.backgroundColor = darkModeModeCurrent === true ? 'rgb(70, 70, 70)' : 'rgb(200, 200, 200)';
    };
    const mouseout = function onmouseout() {
      this.querySelector('.onhover').style.display = 'none';
      this.querySelector('.onout').style.display = 'block';
      this.style.backgroundColor = darkModeModeCurrent === true ? '#262626' : 'rgb(255, 255, 255)';
    };
    hits.forEach(function forEachHit(hit) {
      const li = document.createElement('li');
      if (darkModeModeCurrent === true) {
        li.style.backgroundColor = '#262626';
      }
      li.style.cursor = 'pointer';
      li.style.transition = 'background-color 0.2s';
      li.style.padding = '3px';
      li.style.margin = '2px';
      li.style.borderRadius = '3px';
      li.innerHTML = trackhtml.replace(/\$title/g, hit.result.title_with_featured).replace(/\$artist/g, hit.result.primary_artist.name).replace(/\$lyrics_state/g, hit.result.lyrics_state).replace(/\$stats\.pageviews/g, genius.f.metricPrefix(hit.result.stats.pageviews, 1));
      li.dataset.hit = JSON.stringify(hit);
      li.addEventListener('click', onclick);
      li.addEventListener('mouseover', mouseover);
      li.addEventListener('mouseout', mouseout);
      ol.appendChild(li);
    });
  }
  function geniusOnLyricsReady(song, container) {
    container.parentNode.parentNode.dataset.loaded = 'loaded';
  }
  function geniusOnNoResults(songTitle, songArtistsArr) {
    geniusContainerTr.dataset.loaded = 'loaded';
    document.querySelectorAll('#track_table tr.showlyrics').forEach(e => e.classList.remove('showlyrics'));
    document.querySelector(`#track_table tr[rel="tracknum=${geniusTrackNum}"]`).classList.add('showlyrics');
    geniusShowSearchField(songArtistsArr.join(' ') + ' ' + songTitle);
  }
  let geniusAudio = null;
  let geniusLastPos = null;
  function geniusAudioTimeUpdate() {
    if (!geniusAudio) {
      geniusAudio = document.querySelector('body>audio[src]');
    }
    if (!geniusAudio) {
      return;
    }
    const pos = geniusAudio.currentTime / geniusAudio.duration;
    if (pos >= 0 && `${geniusLastPos}` !== `${pos}`) {
      geniusLastPos = pos;
      genius.f.scrollLyrics(pos);
    }
  }
  function initGenius() {
    if (!genius) {
      genius = geniusLyrics({
        GM: {
          xmlHttpRequest: GM.xmlHttpRequest,
          getValue: (name, defaultValue) => GM.getValue('genius_' + name, defaultValue),
          setValue: (name, value) => GM.setValue('genius_' + name, value)
        },
        scriptName: SCRIPT_NAME,
        scriptIssuesURL: 'https://github.com/cvzi/Bandcamp-script-deluxe-edition/issues',
        scriptIssuesTitle: 'Report problem: github.com/cvzi/Bandcamp-script-deluxe-edition/issues',
        domain: document.location.origin + '/',
        emptyURL: document.location.origin + LYRICS_EMPTY_PATH,
        addCss: geniusAddCss,
        listSongs: geniusListSongs,
        showSearchField: geniusShowSearchField,
        addLyrics: geniusAddLyrics,
        hideLyrics: geniusHideLyrics,
        getCleanLyricsContainer: geniusGetCleanLyricsContainer,
        setFrameDimensions: geniusSetFrameDimensions,
        createSpinner: geniusCreateSpinner,
        onLyricsReady: geniusOnLyricsReady,
        onNoResults: geniusOnNoResults
      });
      document.addEventListener('timeupdate', geniusAudioTimeUpdate, true);
    }
  }
  function loadGeniusLyrics(trackNum) {
    // Toggle lyrics
    geniusContainerTr = document.getElementById('lyrics_row_' + trackNum);
    let tr;
    if (geniusContainerTr) {
      tr = document.querySelector(`#track_table tr[rel="tracknum=${trackNum}"]`);
      if ('loaded' in geniusContainerTr.dataset && geniusContainerTr.dataset.loaded === 'loaded') {
        if (tr.classList.contains('showlyrics')) {
          // Hide lyrics if already loaded
          document.querySelectorAll('#track_table tr.showlyrics').forEach(e => e.classList.remove('showlyrics'));
        } else {
          // Show lyrics again
          document.querySelectorAll('#track_table tr.showlyrics').forEach(e => e.classList.remove('showlyrics'));
          tr.classList.add('showlyrics');
        }
        return;
      } else if (geniusTrackNum === trackNum) {
        // Lyrics currently loading
        console.debug('loadGeniusLyrics already loading trackNum=' + trackNum);
        return;
      }
    }
    geniusTrackNum = trackNum;
    if (!geniusContainerTr) {
      geniusContainerTr = document.createElement('tr');
      geniusContainerTr.className = 'lyricsRow';
      geniusContainerTr.setAttribute('id', 'lyrics_row_' + trackNum);
      tr = document.querySelector(`#track_table tr[rel="tracknum=${trackNum}"]`);
      if (tr.nextElementSibling) {
        tr.parentNode.insertBefore(geniusContainerTr, tr.nextElementSibling);
      } else {
        tr.parentNode.appendChild(geniusContainerTr);
      }
      document.querySelectorAll('#track_table tr.showlyrics').forEach(e => e.classList.remove('showlyrics'));
      tr.classList.add('showlyrics');
      const spinnerHolder = geniusContainerTr.appendChild(document.createElement('div'));
      spinnerHolder.classList.add('loadingspinnerholder');
      const spinner = spinnerHolder.appendChild(document.createElement('div'));
      spinner.classList.add('loadingspinner');
    }
    initGenius();
    const track = unsafeWindow.TralbumData.trackinfo.find(t => t.track_num === trackNum);
    geniusTitle = track.title;
    geniusArtistsArr = unsafeWindow.TralbumData.artist.split(/&|,|ft\.?|feat\.?/).map(s => s.trim());
    geniusAddLyrics();
  }
  let explorer = null;
  async function showExplorer() {
    if (explorer) {
      explorer.style.display = 'block';
      return explorer;
    }
    document.title = 'Explorer';
    document.body.innerHTML = '';
    explorer = document.body.appendChild(document.createElement('div'));
    explorer.setAttribute('id', 'expRoot');
    addStyle(`
#expRoot {
  background:white;
  color:black
}
#expRoot .albumListItem{
  cursor:pointer;
  background:#ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}
#expRoot .albumListItemOdd{
  background:#eee
}
#expRoot .albumListItem:hover{
  background:greenyellow
}

#expRoot .albumListItem.selected{
  background:#aaa;
}

  `);
    new Explorer(document.getElementById('expRoot'), {
      playAlbumFromUrl,
      deletePermanentTralbum
    }).render();
  }
  function addMainMenuButtons() {
    if (document.querySelector('.menu-bar-wrapper menu-bar') && document.querySelector('.menu-bar-wrapper menu-bar').shadowRoot && document.querySelector('.menu-bar-wrapper menu-bar').shadowRoot.querySelector('.menu-items .search')) {
      const shadowRoot = document.querySelector('.menu-bar-wrapper menu-bar').shadowRoot;
      const searchLi = shadowRoot.querySelector('.menu-items .search');
      const insertBefore = searchLi.nextElementSibling ? searchLi.nextElementSibling : searchLi;
      appendMainMenuButtonTo(insertBefore.parentNode, insertBefore, shadowRoot);
    } else if (document.querySelector('.menu-bar-wrapper menu-bar') && document.querySelector('.menu-bar-wrapper menu-bar').shadowRoot && document.querySelector('.menu-bar-wrapper menu-bar').shadowRoot.querySelector('li.signup')) {
      const shadowRoot = document.querySelector('.menu-bar-wrapper menu-bar').shadowRoot;
      const searchLi = shadowRoot.querySelector('li.signup');
      const insertBefore = searchLi;
      appendMainMenuButtonTo(insertBefore.parentNode, insertBefore, shadowRoot);
    } else if (document.querySelector('.menu-items .search')) {
      // Discover
      window.setTimeout(() => {
        const searchLi = document.querySelector('.menu-items .search');
        const insertBefore = searchLi.nextElementSibling ? searchLi.nextElementSibling : searchLi;
        appendMainMenuButtonTo(insertBefore.parentNode, insertBefore);
      }, 1000);
    } else if (document.querySelector('.user-nav')) {
      appendMainMenuButtonTo(document.querySelector('.user-nav'));
    } else if (document.querySelector('#user-nav')) {
      appendMainMenuButtonTo(document.querySelector('#user-nav'));
    } else if (document.getElementById('customHeaderWrapper')) {
      appendMainMenuButtonLeftTo(document.getElementById('customHeaderWrapper'));
    } else if (document.querySelector('#corphome-autocomplete-form ul.hd-nav.corp-nav')) {
      // Homepage and not logged in
      appendMainMenuButtonTo(document.querySelector('#corphome-autocomplete-form ul.hd-nav.corp-nav'));
    }
  }
  function appendMainMenuButtonTo(ul, before, shadowRoot) {
    if (MAIN_MENU_DOM_ID in document.body.dataset) {
      return;
    }
    before = before || ul.firstChild;
    const cssStr = `
    .menubar-item {
      display: flex;
      align-items: center;
      height: var(--bc-menubar-height);
    }
    .menubar-item .menubar-symbol {
      display:flex;
      font-size:24px !important;
      transition:transform 1s ease-out;
      padding:0 8px;
    }
    .menubar-item .menubar-symbol:link {
      text-decoration:none
    }
    .menubar-item .menubar-symbol:hover {
      text-decoration:none;
    }
    .menubar-item:hover {
      background:rgba(20, 20, 20, 0.08);
    }
    .menubar-item:hover .menubar-symbol-settings {
      transform:rotate(1turn)
    }
    .menubar-item:hover .menubar-symbol-library {
      transform:scale(-1, 1)
    }
    .menubar-item:hover .menubar-symbol-tag-search {
      transform:scale(1.3)
    }
  `;
    if (shadowRoot) {
      addStyle(cssStr, {
        root: shadowRoot
      });
    } else {
      addStyle(cssStr);
    }
    const liSettings = ul.insertBefore(document.createElement('li'), before);
    liSettings.id = MAIN_MENU_DOM_ID;
    document.body.dataset[MAIN_MENU_DOM_ID] = 1;
    liSettings.className = 'menubar-item hoverable';
    liSettings.title = 'userscript settings - ' + SCRIPT_NAME;
    const aSettings = liSettings.appendChild(document.createElement('a'));
    aSettings.className = 'menubar-symbol menubar-symbol-settings';
    aSettings.href = '#';
    if (NOEMOJI) {
      const img = aSettings.appendChild(document.createElement('img'));
      img.style = 'display:inline; width:34px; vertical-align:middle;';
      img.src = 'https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/color/72x72/2699.png';
    } else {
      aSettings.appendChild(document.createTextNode('\u2699\uFE0F'));
    }
    liSettings.addEventListener('click', () => mainMenu());
    if (allFeatures.keepLibrary.enabled) {
      const liExplorer = ul.insertBefore(document.createElement('li'), before);
      liExplorer.className = 'menubar-item hoverable';
      liExplorer.title = 'library - ' + SCRIPT_NAME;
      const aExplorer = liExplorer.appendChild(document.createElement('a'));
      aExplorer.className = 'menubar-symbol menubar-symbol-library';
      aExplorer.href = PLAYER_URL;
      if (NOEMOJI) {
        const img = aExplorer.appendChild(document.createElement('img'));
        img.style = 'display:inline; width:34px; vertical-align:middle;';
        img.src = 'https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/color/72x72/1F5C3.png';
      } else {
        aExplorer.appendChild(document.createTextNode('\uD83D\uDDC3\uFE0F'));
      }
      aExplorer.target = '_blank';
      // TODO open library in frame
      // liExplorer.addEventListener('click', function (ev) {
      // ev.preventDefault()
      //   openExplorer()
      // })
    }
    const liSearch = ul.insertBefore(document.createElement('li'), before);
    liSearch.className = 'menubar-item hoverable menubar-item-tag-search';
    liSearch.title = 'tag search - ' + SCRIPT_NAME;
    const aSearch = liSearch.appendChild(document.createElement('a'));
    aSearch.className = 'menubar-symbol menubar-symbol-tag-search';
    aSearch.href = '#';
    if (NOEMOJI) {
      aSearch.innerHTML = `
    <svg width="22" height="22" viewBox="0 0 15 16" class="svg-icon" style="border: 2px solid #000000c4;border-radius: 30%;padding: 3px;">
        <use xlink:href="#menubar-search-input-icon">
    </svg>`;
    } else {
      aSearch.appendChild(document.createTextNode('\uD83D\uDD0D'));
    }
    aSearch.setAttribute('id', 'bcsde_tagsearchbutton');
    aSearch.addEventListener('click', showTagSearchForm);
  }
  function appendMainMenuButtonLeftTo(leftOf) {
    // Wait for the design to load images
    window.setTimeout(() => {
      const rect = leftOf.getBoundingClientRect();
      const ul = document.createElement('ul');
      ul.className = 'bcsde_settingsbar';
      appendMainMenuButtonTo(document.body.appendChild(ul));
      addStyle(`
    .bcsde_settingsbar {position:absolute; top:-15px; left:${rect.right}px; list-style-type: none; padding:0; margin:0; opacity:0.6; transition:top 300ms}
    .bcsde_settingsbar:hover {top:${Math.max(rect.top, 0)}px}
    .bcsde_settingsbar a:hover {text-decoration:none}
    .bcsde_settingsbar li {float:left; padding:0; margin:0}`);
      window.addEventListener('resize', function () {
        ul.style.left = leftOf.getBoundingClientRect().right + 'px';
      });
    }, 500);
  }
  function humour() {
    if (document.getElementById('salesfeed')) {
      const salesfeedHumour = {};
      salesfeedHumour.all = [`${SCRIPT_NAME} by cuzi, Dark theme by Simonus`, `Provide feedback for ${SCRIPT_NAME} on openuser.js or github.com`, `${SCRIPT_NAME} - “nobody pays for software anymore” 🙌🏽`];
      salesfeedHumour.chosen = salesfeedHumour.all[0];
      unsafeWindow.$('#pagedata').data('blob').salesfeed_humour = salesfeedHumour;
    }
  }
  function showAlbumID() {
    if (unsafeWindow.TralbumData && 'id' in unsafeWindow.TralbumData && document.querySelector('#name-section h3')) {
      document.querySelectorAll('#name-section h3').forEach(function (h3) {
        const id = unsafeWindow.TralbumData.id;
        const h4 = h3.parentNode.appendChild(document.createElement('h4'));
        h4.style.fontSize = '13px';
        h4.style.fontWeight = 'normal';
        h4.style.opacity = 0.6;
        h4.style.marginTop = '4px';
        h4.innerHTML = `Album ID: <span style="user-select: all;">${id}</span>`;
        h4.addEventListener('click', function () {
          GM_setClipboard(id.toString());
          const span = h4.appendChild(document.createElement('span'));
          span.innerHTML = ' copied!';
          span.style.marginLeft = '5px';
          span.style.transition = 'opacity 2s';
          span.style.opacity = 1;
          window.setInterval(() => span.style.opacity = 0, 0);
          window.setInterval(() => span.remove(), 1000);
        });
      });
    }
  }
  function formatReleaseDateOnAlbumPage() {
    const textContainers = document.querySelectorAll('.tralbumData');
    if (textContainers.length === 0) {
      return;
    }
    GM.getValue('custom_release_date_format_str').then(function customFormatReleaseDate(format) {
      if (!format || !format.trim()) {
        console.warn('formatReleaseDateOnAlbumPage: No custom release date format string set.');
        return;
      }
      textContainers.forEach(function (textContainer) {
        for (const match of textContainer.innerHTML.matchAll(/(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2}),\s+(\d{4})/gim)) {
          const epochMs = Date.parse(match[0]);
          if (Number.isNaN(epochMs)) {
            console.warn(`formatReleaseDateOnAlbumPage: Could not parse date string "${match[0].trim()}"`);
            continue;
          }
          const date = new Date(epochMs);
          textContainer.innerHTML = textContainer.innerHTML.replace(match[0], `${customDateFormatter(format, date)}`);
        }
      });
    });
  }
  function showDownloadLinkOnAlbumPage() {
    if (!document.querySelector('a[href*="purchases?from=menubar"]')) {
      return;
    }
    const purchasesUrl = document.querySelector('a[href*="purchases?from=menubar"]').href;
    const itemUrl = document.location.href.split('#')[0];
    const showDownloadLinkForUrl = function (downloadUrl) {
      const purchasedMsgA = document.querySelector('#purchased-msg a');
      purchasedMsgA.href = downloadUrl;
      purchasedMsgA.textContent = 'Download';
    };
    GM.xmlHttpRequest({
      method: 'GET',
      url: purchasesUrl,
      onload: function loadPurchases(response) {
        const doc = new window.DOMParser().parseFromString(response.responseText, 'text/html').documentElement;
        for (const purchasesItem of Array.from(doc.querySelectorAll('.purchases-item'))) {
          if (!purchasesItem.querySelector('.purchases-item-title[href]')) {
            continue;
          }
          const url = purchasesItem.querySelector('.purchases-item-title[href]').href;
          if (url !== itemUrl) {
            continue;
          }
          const downloadLink = purchasesItem.querySelector('.purchases-item-download a[href]');
          if (!downloadLink && !downloadLink.href) {
            continue;
          }
          return showDownloadLinkForUrl(downloadLink.href);
        }
        if (doc.querySelector('#js-crumbs-data') && doc.querySelector('#pagedata')) {
          try {
            const crumb = JSON.parse(doc.querySelector('#js-crumbs-data').dataset.crumbs)['api/orderhistory/1/get_items'];
            const orderhistory = JSON.parse(doc.querySelector('#pagedata').dataset.blob).orderhistory;
            nextOrderHistoryPage(itemUrl, {
              username: orderhistory.username,
              last_token: orderhistory.last_token,
              platform: orderhistory.platform,
              crumb
            }, showDownloadLinkForUrl);
          } catch (e) {
            console.error('Error in showDownloadLinkOnAlbumPage, failed to launch nextOrderHistoryPage:', e);
          }
        }
      },
      onerror: function loadPurchasesError(response) {
        console.error('showDownloadLinkOnAlbumPage() in onerror() Error: ' + response.status + '\nResponse:\n' + response.responseText + '\n' + ('error' in response ? response.error : ''));
      }
    });
  }
  async function nextOrderHistoryPage(itemUrl, data, cbFoundDownloadLink) {
    // Load download links from api (same as clicking on "more" at the bototm of purchases page)
    const handleResponse = function (result) {
      for (const item of result.items) {
        if (item.item_url === itemUrl) {
          return cbFoundDownloadLink(item.download_url);
        }
      }
      if ('last_token' in result && result.last_token) {
        data.last_token = result.last_token;
        return nextOrderHistoryPage(itemUrl, data, cbFoundDownloadLink);
      }
    };
    const cacheKey = data.last_token;
    const cached = await cacheGet('orderhistory', ONEHOUR, cacheKey, null);
    if (cached) {
      return handleResponse(JSON.parse(cached));
    }
    GM.xmlHttpRequest({
      method: 'POST',
      url: 'https://bandcamp.com/api/orderhistory/1/get_items',
      headers: {
        ' Content-Type': 'application/json'
      },
      data: JSON.stringify(data),
      onload: function loadPurchases(response) {
        try {
          const result = JSON.parse(response.responseText);
          cacheSet('orderhistory', ONEHOUR, cacheKey, response.responseText);
          handleResponse(result);
        } catch (e) {
          console.error('Error in nextOrderHistoryPage:', e);
        }
      },
      onerror: function loadPurchasesError(response) {
        console.error('nextOrderHistoryPage () in onerror() Error: ' + response.status + '\nResponse:\n' + response.responseText + '\n' + ('error' in response ? response.error : ''));
      }
    });
  }
  function feedShowOnlyNewReleases() {
    const stories = document.querySelectorAll('#stories li.story');
    if (stories.length < 0) {
      window.setTimeout(feedShowOnlyNewReleases, 10000);
      return;
    }
    if (Array.from(stories).reduce((accumulator, story) => {
      // Remove stories that are not 'nr' => new releases
      if (!story.classList.contains('nr')) {
        story.remove();
        accumulator++;
      }
      return accumulator;
    }, 0)) {
      // If any were removed, trigger a reload of the feed
      window.scrollBy(0, 1);
      window.scrollBy(0, -1);
      window.setTimeout(feedShowOnlyNewReleases, 500);
    } else {
      window.setTimeout(feedShowOnlyNewReleases, 1500);
    }
  }
  function feedAddAudioControls() {
    const colors = {
      chrome: {
        light: {
          button_bg: 'white',
          audio_bg: '',
          audio_opacity: 1.0,
          div_bg: '#f1f3f4',
          div_border: '1px solid black'
        },
        dark: {
          button_bg: '#797a7a',
          audio_bg: 'black',
          audio_opacity: 0.5,
          div_bg: 'black',
          div_border: 'none'
        }
      },
      firefox: {
        light: {
          button_bg: 'white',
          audio_bg: '#FFFF',
          audio_opacity: 1.0,
          div_bg: '#474747',
          div_border: '3px solid white'
        },
        dark: {
          button_bg: '#797a7a',
          audio_bg: 'black',
          audio_opacity: 1.0,
          div_bg: '#151515',
          div_border: 'none'
        }
      }
    };
    const play = function (ev) {
      ev.preventDefault();
      playAlbumFromUrl(document.querySelector('.story-list .collection-item-container.playing a.item-link').href);
    };
    const goTo = function (ev) {
      ev.preventDefault();
      document.querySelector('.story-list .collection-item-container.playing').scrollIntoView();
    };
    const open = function (ev) {
      ev.preventDefault();
      document.querySelector('.story-list .collection-item-container.playing a.item-link').click();
    };
    const next = function (ev) {
      ev.preventDefault();
      feedPlayNextItem();
    };
    const wishList = function (ev) {
      ev.preventDefault();
      window.open(document.querySelector('.story-list .collection-item-container.playing a.item-link').href + '#collect-wishlist');
    };
    const makeAudioVisible = function () {
      const currentStyle = (CHROME ? colors.chrome : colors.firefox)[darkModeModeCurrent === true ? 'dark' : 'light'];
      const audio = this;
      audio.removeEventListener('timeupdate', makeAudioVisible);
      audio.controls = true;
      audio.loop = false;
      const aStyle = `display:inline-block; background:${currentStyle.button_bg}; margin: 1px 1em; padding: 2px; border-radius: 4px;`;
      const div = audio.parentNode.appendChild(document.createElement('div'));
      const div2 = div.appendChild(document.createElement('div'));
      const aPlay = div2.appendChild(document.createElement('a'));
      aPlay.href = '#';
      aPlay.addEventListener('click', play);
      aPlay.style = aStyle;
      const img = aPlay.appendChild(document.createElement('img'));
      img.src = 'https://raw.githubusercontent.com/cvzi/Bandcamp-script-deluxe-edition/master/images/icon.png';
      img.style = 'width: 14px; vertical-align: sub;padding:0px 3px 0px 0px;';
      img.alt = 'Play in discography player';
      aPlay.appendChild(document.createTextNode('play album'));
      const aGoto = div2.appendChild(document.createElement('a'));
      aGoto.style = aStyle;
      aGoto.href = '#';
      aGoto.addEventListener('click', goTo);
      aGoto.appendChild(document.createTextNode('🔝 scroll to album'));
      const aOpen = div2.appendChild(document.createElement('a'));
      aOpen.style = aStyle;
      aOpen.href = '#';
      aOpen.addEventListener('click', open);
      aOpen.appendChild(document.createTextNode('📂 open album'));
      const aNext = div2.appendChild(document.createElement('a'));
      aNext.style = aStyle;
      aNext.href = '#';
      aNext.addEventListener('click', next);
      aNext.appendChild(document.createTextNode('⏭️ next'));
      const aWish = div2.appendChild(document.createElement('a'));
      aWish.style = aStyle;
      aWish.href = '#';
      aWish.addEventListener('click', wishList);
      aWish.appendChild(document.createTextNode('🤍 wishlist'));
      div.appendChild(audio);
      audio.style = `
      width: 100%;
      height: 40px;
      display: block;
      opacity: ${currentStyle.audio_opacity};
      background-color:${currentStyle.audio_bg}`;
      div.style = `
      width: 20%;
      min-width: 200px;
      height: 75px;
      position: fixed;
      right: 0px;
      bottom: 0px;
      display: block;
      border:${currentStyle.div_border};
      border-radius: 5px;
      background-color:${currentStyle.div_bg}`;
      div2.style = `
      text-align: center;`;
    };
    const audio = document.querySelector('body>audio');
    if (audio) {
      audio.addEventListener('timeupdate', makeAudioVisible);
    }
  }
  let feedCurrentItem = null;
  function feedEnablePlayNextItem() {
    // Play next item in feed when current item ends
    const onItemStart = function () {
      // Save item that is currently playing (play button is showing Pause-symbol)
      sleep(2000).then(() => {
        feedCurrentItem = feedCurrentItem || document.querySelector('.story-list .collection-item-container.playing');
      });
    };
    const onItemEnded = function () {
      feedPlayNextItem();
    };
    const audio = document.querySelector('body>audio');
    if (audio) {
      audio.addEventListener('play', onItemStart);
      audio.addEventListener('ended', onItemEnded);
    }
  }
  function feedPlayNextItem() {
    if (feedCurrentItem) {
      // Find next item and click play button
      let isNext = false;
      for (const item of document.querySelectorAll('.story-list .collection-item-container')) {
        if (isNext && item.querySelector('.play-button')) {
          item.querySelector('.play-button').click();
          feedCurrentItem = null;
          return true;
        } else if (item === feedCurrentItem) {
          isNext = true;
        }
      }
    }
    return false;
  }
  function feedAddDiscographyPlayerButtons() {
    const play = function (ev) {
      ev.preventDefault();
      playAlbumFromUrl(this.dataset.url);
    };
    document.querySelectorAll('.collect-item ul').forEach(ul => {
      if (ul.querySelector('li.discographyplayerbutton') || !ul.querySelector('li.buy-now')) {
        return;
      }
      const li = ul.appendChild(ul.querySelector('li.buy-now').cloneNode(true));
      li.classList.remove('buy-now');
      li.classList.add('discographyplayerbutton');
      const a = li.querySelector('a');
      a.dataset.url = a.href;
      a.href = '#';
      a.textContent = 'play album';
      a.addEventListener('click', play);
      const img = li.insertBefore(document.createElement('img'), li.querySelector('a'));
      img.src = 'https://raw.githubusercontent.com/cvzi/Bandcamp-script-deluxe-edition/master/images/icon.png';
      img.style = 'width: 14px; vertical-align: sub;padding:0px 3px 0px 0px;';
      img.alt = 'Play in discography player';
    });
    window.setTimeout(feedAddDiscographyPlayerButtons, 10000);
  }
  function profileAddDiscographyPlayerButtons() {
    const play = function (ev) {
      ev.preventDefault();
      playAlbumFromUrl(this.dataset.url);
    };
    document.querySelectorAll('.collection-item-container').forEach(li => {
      if (li.querySelector('div.discographyplayerbutton') || !li.querySelector('.collection-title-details a[href]')) {
        return;
      }
      const div = document.createElement('div');
      div.classList.add('discographyplayerbutton');
      const collectionItemActions = li.querySelector('.collection-item-details-container .collection-item-actions');
      if (collectionItemActions && collectionItemActions.nextElementSibling) {
        collectionItemActions.parentNode.insertBefore(div, collectionItemActions.nextElementSibling);
      } else if (collectionItemActions) {
        collectionItemActions.parentNode.insertBefore(div, collectionItemActions);
      } else {
        li.appendChild(div);
      }
      const a = div.appendChild(document.createElement('a'));
      a.dataset.url = li.querySelector('.collection-title-details a[href]').href;
      a.href = '#';
      a.addEventListener('click', play);
      const img = a.appendChild(document.createElement('img'));
      img.src = 'https://raw.githubusercontent.com/cvzi/Bandcamp-script-deluxe-edition/master/images/icon.png';
      img.style = 'width: 14px; vertical-align: sub;padding:0px 3px 0px 0px;';
      img.alt = 'Play in discography player';
      a.appendChild(document.createTextNode(' play album'));
    });
    window.setTimeout(profileAddDiscographyPlayerButtons, 10000);
  }
  function darkMode() {
    // CSS taken from https://userstyles.org/styles/171538/bandcamp-in-dark by Simonus (Version from January 24, 2020)
    // https://userstyles.org/api/v1/styles/css/171538

    let propOpenWrapperBackgroundColor = '#2626268f';
    try {
      const brightnessStr = window.localStorage.getItem('bcsde_bgimage_brightness');
      if (brightnessStr !== null && brightnessStr !== 'null') {
        const brightness = parseFloat(brightnessStr);
        const alpha = (brightness - 50) / 255;
        propOpenWrapperBackgroundColor = `rgba(0, 0, 0, ${alpha})`;
      }
    } catch (e) {
      console.error('Could not access window.localStorage: ' + e);
    }
    addStyle(`
:root {
  --pgBdColor: #262626;
  --propOpenWrapperBackgroundColor: ${propOpenWrapperBackgroundColor}
}`);
    addStyle(darkmodeCSS);
    window.setTimeout(humour, 3000);
    darkModeInjected = true;
  }
  async function darkModeOnLoad() {
    const yes = await darkModeMode();
    if (!yes) {
      return;
    }

    // Load body's background image and detect if it is light or dark and adapt it's transparency
    const backgroudImageCSS = window.getComputedStyle(document.body).backgroundImage;
    let imageURL = backgroudImageCSS.match(/["'](.*)["']/);
    let shouldUpdate = false;
    let hasBackgroundImage = false;
    if (imageURL && imageURL[1]) {
      imageURL = imageURL[1];
      shouldUpdate = true;
      hasBackgroundImage = true;
      try {
        const editTime = parseInt(window.localStorage.getItem('bcsde_bgimage_brightness_time'));
        if (Date.now() - editTime < 604800000) {
          shouldUpdate = false;
        }
      } catch (e) {
        console.error('Could not read from window.localStorage: ' + e);
      }
    }
    if (shouldUpdate) {
      console.debug('Updateing background image brightness for:', imageURL);
      const canvas = await loadCrossSiteImage(imageURL);
      const ctx = canvas.getContext('2d');
      const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
      let sum = 0.0;
      let div = 0;
      const stepSize = canvas.width * canvas.height / 1000;
      const len = data.length - 4;
      const inc = 4 * Math.max(1, Math.ceil(stepSize * Math.random()));
      for (let i = 0; i < len; i += inc) {
        const v = Math.max(Math.max(data[i], data[i + 1]), data[i + 2]);
        sum += v;
        div++;
      }
      const brightness = sum / div;
      const alpha = (brightness - 50) / 255;
      document.querySelector('#propOpenWrapper').style.backgroundColor = `rgba(0, 0, 0, ${alpha})`;
      try {
        window.localStorage.setItem('bcsde_bgimage_brightness', brightness);
        window.localStorage.setItem('bcsde_bgimage_brightness_time', Date.now());
        console.debug('New brightness:', brightness);
      } catch (e) {
        console.error('Could not write to window.localStorage: ' + e);
      }
    }
    if (!hasBackgroundImage) {
      // No background image, check background color
      const color = window.getComputedStyle(document.body).backgroundColor;
      if (color) {
        const m = color.match(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
        if (m) {
          const [, r, g, b] = m;
          if (r < 70 && g < 70 && b < 70) {
            addStyle(`
            :root {
              --propOpenWrapperBackgroundColor: rgb(${r}, ${g}, ${b})
            }
          `);
          }
        }
      }
    }
    // pgBd background color
    if (document.getElementById('custom-design-rules-style')) {
      const customCss = document.getElementById('custom-design-rules-style').textContent;
      if (customCss.indexOf('#pgBd') !== -1) {
        const pgBdStyle = customCss.split('#pgBd')[1].split('}')[0];
        const m = pgBdStyle.match(/background(-color)?\s*:\s*(.+?)[;\s]/m);
        if (m && m.length > 2 && m[2]) {
          const color = css2rgb(m[2]);
          if (color) {
            const [r, g, b] = color;
            if (r < 70 && g < 70 && b < 70) {
              addStyle(`
              :root {
                --pgBdColor: rgb(${r}, ${g}, ${b});
              }
            `);
            }
          }
        }
      }
    }
  }
  async function updateSuntimes() {
    const value = await GM.getValue('darkmode', '1');
    if (value.startsWith('3#')) {
      const data = JSON.parse(value.substring(2));
      const sunData = suntimes(new Date(), data.latitude, data.longitude);
      const newValue = '3#' + JSON.stringify(Object.assign(data, sunData));
      if (newValue !== value) {
        await GM.setValue('darkmode', newValue);
      }
    }
  }
  function confirmDomain() {
    return new Promise(function confirmDomainPromise(resolve) {
      GM.getValue('domains', '{}').then(function (v) {
        const domains = JSON.parse(v);
        if (document.location.hostname in domains) {
          const isBandcamp = domains[document.location.hostname];
          return resolve(isBandcamp);
        } else {
          window.setTimeout(function () {
            const isBandcamp = window.confirm(`${SCRIPT_NAME}

This page looks like a bandcamp page, but the URL ${document.location.hostname} is not a bandcamp URL.

Do you want to run the userscript on this page?

If this is a malicious website, running the userscript may leak personal data (e.g. played albums) to the website`);
            domains[document.location.hostname] = isBandcamp;
            GM.setValue('domains', JSON.stringify(domains)).then(() => resolve(isBandcamp));
          }, 3000);
        }
      });
    });
  }
  function guard(label, fn) {
    try {
      const ret = fn();
      if (ret && typeof ret.then === 'function') {
        return ret.catch(err => ErrorReporter.add(err, label));
      }
      return ret;
    } catch (err) {
      ErrorReporter.add(err, label);
    }
  }
  function guardPromise(promise, label = 'async op') {
    return Promise.resolve(promise).catch(err => {
      ErrorReporter.add(err, label);
    });
  }
  function setTimeoutSafe(cb, delay, label = 'timeout callback', ...args) {
    // eslint-disable-next-line n/no-callback-literal
    return window.setTimeout(() => guard(label, () => cb(...args)), delay);
  }
  function setIntervalSafe(cb, delay, label = 'interval callback', ...args) {
    // eslint-disable-next-line n/no-callback-literal
    return window.setInterval(() => guard(label, () => cb(...args)), delay);
  }
  async function setDomain(enabled) {
    const domains = JSON.parse(await GM.getValue('domains', '{}'));
    domains[document.location.hostname] = enabled;
    await GM.setValue('domains', JSON.stringify(domains));
  }
  let darkModeModeCurrent = null;
  async function darkModeMode() {
    if (darkModeModeCurrent != null) {
      return darkModeModeCurrent;
    }
    const value = await GM.getValue('darkmode', '1');
    darkModeModeCurrent = false;
    if (value.startsWith('1')) {
      darkModeModeCurrent = true;
    } else if (value.startsWith('2#')) {
      darkModeModeCurrent = nowInTimeRange(value.substring(2));
    } else if (value.startsWith('3#')) {
      const data = JSON.parse(value.substring(2));
      window.setTimeout(updateSuntimes, Math.random() * 10000);
      darkModeModeCurrent = nowInBetween(new Date(data.sunset), new Date(data.sunrise));
    }
    return darkModeModeCurrent;
  }
  function start() {
    // Load settings and enable darkmode
    return new Promise(function startFct(resolve) {
      ErrorReporter.init(`[${SCRIPT_NAME}]`);
      GM.getValue('enabledFeatures', false).then(value => getEnabledFeatures(value)).then(function () {
        if (BANDCAMP && allFeatures.darkMode.enabled) {
          darkModeMode().then(function (yes) {
            if (yes) {
              darkMode();
            }
            resolve();
          });
        } else {
          resolve();
        }
      });
    });
  }
  async function onLoaded() {
    if (!enabledFeaturesLoaded) {
      getEnabledFeatures(await GM.getValue('enabledFeatures', false));
    }
    if (!BANDCAMP && document.querySelector('#legal.horizNav li.view-switcher.desktop a,head>meta[name=generator][content=Bandcamp]')) {
      // Page is a bandcamp page but does not have a bandcamp domain
      BANDCAMP = await confirmDomain();
      if (BANDCAMP) {
        GM.registerMenuCommand(SCRIPT_NAME + ' - disable on this page', () => setDomain(false).then(() => document.location.reload()));
      } else {
        GM.registerMenuCommand(SCRIPT_NAME + ' - enable on this page', () => setDomain(true).then(() => document.location.reload()));
        return; // abort here
      }
    } else if (!BANDCAMP && !CAMPEXPLORER) {
      // Not a bandcamp page -> quit
      return;
    }
    const IS_PLAYER_URL = document.location.href.startsWith(PLAYER_URL);
    const IS_PLAYER_FRAME = IS_PLAYER_URL && document.location.search.indexOf('iframe') !== -1;
    if (allFeatures.darkMode.enabled) {
      guard('darkMode init', async () => {
        if (!darkModeInjected) {
          const yes = await darkModeMode();
          if (yes) darkMode();
        }
        setTimeoutSafe(darkModeOnLoad, 0, 'darkModeOnLoad');
      });
    }
    storeTralbumDataPermanentlySwitch = allFeatures.keepLibrary.enabled;
    const maintenanceContent = document.querySelector('.content');
    if (maintenanceContent && maintenanceContent.textContent.indexOf('are offline') !== -1) {
      console.log('Maintenance detected');
      return;
    }
    guard('add emoji fonts', () => {
      if (NOEMOJI) {
        addStyle(noEmojiCSS);
      }
    });
    NOTIFICATION_TIMEOUT = parseInt(await GM.getValue('notification_timeout', NOTIFICATION_TIMEOUT));
    guard('showPastReleases', () => {
      if (allFeatures.releaseReminder.enabled && !IS_PLAYER_FRAME) {
        showPastReleases();
      }
    });
    guard('index page tweaks', () => {
      if (document.querySelector('#indexpage .indexpage_list_cell a[href*="/album/"] img')) {
        // Index pages are almost like discography page. To make them compatible, let's add the class names from the discography page
        document.querySelector('#indexpage').classList.add('music-grid');
        document.querySelectorAll('#indexpage .indexpage_list_cell').forEach(cell => cell.classList.add('music-grid-item'));
        addStyle('#indexpage .ipCellImage { position:relative }');
      }
    });
    guard('search result tweaks', () => {
      if (document.querySelector('.search .result-items .searchresult img')) {
        // Search result pages. To make them compatible, let's add the class names from the discography page
        document.querySelector('.search .result-items').classList.add('music-grid');
        // Add class name to albums, tracks, labels and artists
        document.querySelectorAll(`
        .search .result-items .searchresult[data-search*='"type":"a"'],
        .search .result-items .searchresult[data-search*='"type":"t"'],
        .search .result-items .searchresult[data-search*='"type":"b"']
      `).forEach(cell => cell.classList.add('music-grid-item'));
      }
    });
    guard('user profile collection', () => {
      if (allFeatures.userProfilePlayer.enabled && document.querySelector('.collection-grid .collection-item-container')) {
        makeUserProfileCollectionGreat();
        if (!allFeatures.discographyplayer.enabled) {
          makeAlbumCoversGreat();
        }
      }
    });
    guard('discography featured grid tweaks', () => {
      if (allFeatures.discographyplayer.enabled && document.querySelector('.featured-grid.featured-items .featured-item')) {
        // Discography page (featured albums)
        // To make them compatible, let's add the class names from the regular music-grid
        document.querySelectorAll('.featured-grid.featured-items').forEach(e => e.classList.add('music-grid'));
        document.querySelectorAll('.featured-grid.featured-items .featured-item').forEach(e => e.classList.add('music-grid-item'));
      }
    });
    guard('discography page covers', () => {
      if (allFeatures.discographyplayer.enabled && document.querySelector('.music-grid .music-grid-item a[href*="/album/"] img,.music-grid .music-grid-item a[href*="/track/"] img')) {
        // Discography page
        makeAlbumCoversGreat();
      }
    });
    guard('album page features', () => {
      if (document.querySelector('.inline_player')) {
        // Album page with player
        if (allFeatures.thetimehascome.enabled) {
          removeTheTimeHasComeToOpenThyHeartWallet();
        }
        if (allFeatures.albumPageVolumeBar.enabled) {
          window.setTimeout(addVolumeBarToAlbumPage, 3000);
        }
        if (allFeatures.albumPageDownloadLinks.enabled) {
          window.setTimeout(addDownloadLinksToAlbumPage, 500);
        }
        if (allFeatures.albumPageLyrics.enabled) {
          window.setTimeout(addLyricsToAlbumPage, 500);
        }
        if (allFeatures.discographyplayer.enabled) {
          addOpenDiscographyPlayerFromAlbumPage();
        }
      }
    });
    guard('discover page', () => {
      if (document.location.pathname.startsWith('/discover')) {
        // Discover search page
        makeDiscoverSearchCoversGreatCss();
        if (allFeatures.tagSearchPlayer.enabled) {
          setIntervalSafe(makeDiscoverSearchCoversGreat, 1000, 'makeDiscoverSearchCoversGreat');
        }
        addShuffleTagsButton();
      }
    });
    guard('share panel / wishlist hooks', () => {
      if (document.querySelector('.share-panel-wrapper-desktop')) {
        // Album page with Share,Embed,Wishlist links

        if (allFeatures.markasplayedEverywhere.enabled) {
          addListenedButtonToCollectControls();
        }
        if (document.location.hash === '#collect-wishlist') {
          clickAddToWishlist();
        }
        if (unsafeWindow.TralbumData && unsafeWindow.TralbumData.current && unsafeWindow.TralbumData.current.release_date) {
          addReleaseDateButton();
        }
      }
    });
    guard('show download link if purchased', () => {
      if (unsafeWindow.TralbumData && unsafeWindow.TralbumData.tralbum_collect_info && unsafeWindow.TralbumData.tralbum_collect_info.is_purchased) {
        showDownloadLinkOnAlbumPage();
      }
    });
    GM.registerMenuCommand(SCRIPT_NAME + ' - Settings', mainMenu);
    guard('main menu buttons', () => {
      addMainMenuButtons();
      setTimeoutSafe(() => {
        if (!document.getElementById(MAIN_MENU_DOM_ID)) {
          addMainMenuButtons();
        }
      }, 3000, 'main menu buttons (retry)');
    });
    guard('hide hiring banners', () => {
      if (document.querySelector('.hd-banner-2018')) {
        // Move the "we are hiring" banner (not loggin in)
        document.querySelector('.hd-banner-2018').style.left = '-500px';
      }
      if (document.querySelector('.li-banner-2018')) {
        // Remove the "we are hiring" banner (logged in)
        document.querySelector('.li-banner-2018').remove();
      }
    });
    guard('carousel player', () => {
      if (document.getElementById('carousel-player') || document.querySelector('.play-carousel')) {
        setTimeoutSafe(makeCarouselPlayerGreatAgain, 5000, 'makeCarouselPlayerGreatAgain');
      }
    });
    guard('grid tabs + listened tab', () => {
      if (document.querySelector('ol#grid-tabs li') && document.querySelector('.fan-bio-pic-upload-container')) {
        const listenedTabLink = makeListenedListTabLink();
        if (document.location.hash === '#listened-tab') {
          setTimeoutSafe(() => {
            document.querySelector('#grid-tabs .active').classList.remove('active');
            document.querySelector('#grids .grid.active').classList.remove('active');
            listenedTabLink.classList.add('active');
            listenedTabLink.click();
          }, 500, 'resetGridTabs');
        }
        if (allFeatures.markasplayedEverywhere.enabled) {
          // If you click the more button on the wishlist/user profile, bandcamp continues to load more albums. Need to update the listened links then as well:
          document.querySelectorAll('.show-button .show-more').forEach(button => {
            button.addEventListener('click', () => {
              setIntervalSafe(makeAlbumLinksGreat, 2000, 'wishlist/user profile pagination');
            });
          });
        }
      }
    });
    guard('restore volume', () => {
      if (allFeatures.albumPageVolumeBar.enabled) {
        restoreVolume();
      }
    });
    guard('make album links great', () => {
      if (allFeatures.markasplayedEverywhere.enabled) {
        makeAlbumLinksGreat();
      }
    });
    guard('backup reminder', () => {
      if (allFeatures.backupReminder.enabled && !IS_PLAYER_FRAME) {
        checkBackupStatus();
      }
    });
    guard('custom release date format', () => {
      if (allFeatures.customReleaseDateFormat.enabled) {
        formatReleaseDateOnAlbumPage();
      }
    });
    guard('show album ID', () => {
      if (allFeatures.showAlbumID.enabled) {
        showAlbumID();
      }
    });
    guard('feed tweaks', () => {
      if (document.querySelector('#stories li.story')) {
        if (allFeatures.feedShowOnlyNewReleases.enabled) {
          feedShowOnlyNewReleases();
        }
        if (allFeatures.feedShowAudioControls.enabled) {
          feedAddAudioControls();
        }
      }
      feedEnablePlayNextItem();
      feedAddDiscographyPlayerButtons();
    });
    guard('profile discography player buttons', () => {
      profileAddDiscographyPlayerButtons();
    });
    guard('campexplorer', () => {
      if (CAMPEXPLORER) {
        let lastTagsText = document.querySelector('.tags') ? document.querySelector('.tags').textContent : '';
        setIntervalSafe(() => {
          const tagsText = document.querySelector('.tags') ? document.querySelector('.tags').textContent : '';
          if (lastTagsText !== tagsText) {
            lastTagsText = tagsText;
            if (allFeatures.discographyplayer.enabled) {
              makeAlbumCoversGreat();
            }
            if (allFeatures.markasplayedEverywhere.enabled) {
              makeAlbumLinksGreat();
            }
          }
        }, 3000, 'tags change poll');

        // Add a little space at the bottom of the page to accommodate the discographyplayer at the bottom
        document.body.style.paddingBottom = '200px';
        // Move the sidebar to the left
        document.querySelectorAll('.sidebar').forEach(div => {
          div.style.alignSelf = 'flex-start';
          div.querySelectorAll('.shortcuts').forEach(shortcuts => {
            shortcuts.style.borderRadius = '0 1em 1em 0';
          });
        });
      }
    });
    guard('explorer / lyrics init', () => {
      if (IS_PLAYER_URL) {
        showExplorer();
      } else if (document.location.pathname === LYRICS_EMPTY_PATH) {
        initGenius();
      }
    });
    await guardPromise(GM.getValue('musicPlayerState', '{}').then(s => {
      if (s !== '{}') {
        GM.setValue('musicPlayerState', '{}');
        musicPlayerRestoreState(JSON.parse(s));
      }
    }), 'restore music player state');
    guard('store corrected TralbumData', () => {
      if (document.querySelector('.inline_player') && unsafeWindow.TralbumData && unsafeWindow.TralbumData.current && unsafeWindow.TralbumData.trackinfo) {
        const TralbumData = correctTralbumData(JSON.parse(JSON.stringify(unsafeWindow.TralbumData)), document.body.innerHTML);
        storeTralbumDataPermanently(TralbumData);
      }
    });
    guard('startLiveErrorPanel', () => {
      if (allFeatures.debugMode.enabled) {
        ErrorReporter.startLiveErrorPanel();
      }
    });
  }
  GM.registerMenuCommand(SCRIPT_NAME + ' - show recent script errors', () => ErrorReporter.showRecentErrors());
  start().then(function () {
    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', onLoaded);
    } else {
      onLoaded();
    }
  });

})();