{
  "version": 3,
  "sources": ["../../../../../shared/node_modules/@transloadit/prettier-bytes/src/prettierBytes.ts", "../../../../../shared/node_modules/wildcard/index.js", "../../../../../shared/node_modules/mime-match/index.js", "../../../../../shared/node_modules/lodash/isObject.js", "../../../../../shared/node_modules/lodash/_freeGlobal.js", "../../../../../shared/node_modules/lodash/_root.js", "../../../../../shared/node_modules/lodash/now.js", "../../../../../shared/node_modules/lodash/_trimmedEndIndex.js", "../../../../../shared/node_modules/lodash/_baseTrim.js", "../../../../../shared/node_modules/lodash/_Symbol.js", "../../../../../shared/node_modules/lodash/_getRawTag.js", "../../../../../shared/node_modules/lodash/_objectToString.js", "../../../../../shared/node_modules/lodash/_baseGetTag.js", "../../../../../shared/node_modules/lodash/isObjectLike.js", "../../../../../shared/node_modules/lodash/isSymbol.js", "../../../../../shared/node_modules/lodash/toNumber.js", "../../../../../shared/node_modules/lodash/debounce.js", "../../../../../shared/node_modules/lodash/throttle.js", "../../../../../shared/node_modules/namespace-emitter/index.js", "../../../../../shared/node_modules/classnames/index.js", "../../../../../shared/node_modules/@uppy/utils/lib/emaFilter.js", "../../../../../shared/node_modules/@uppy/utils/lib/NetworkError.js", "../../../../../shared/node_modules/@uppy/utils/lib/ProgressTimeout.js", "../../../../../shared/node_modules/@uppy/utils/lib/fetcher.js", "../../../../../shared/node_modules/@uppy/utils/lib/fileFilters.js", "../../../../../shared/node_modules/@uppy/utils/lib/isDOMElement.js", "../../../../../shared/node_modules/@uppy/utils/lib/findDOMElement.js", "../../../../../shared/node_modules/@uppy/utils/lib/getFileNameAndExtension.js", "../../../../../shared/node_modules/@uppy/utils/lib/mimeTypes.js", "../../../../../shared/node_modules/@uppy/utils/lib/getFileType.js", "../../../../../shared/node_modules/@uppy/utils/lib/generateFileID.js", "../../../../../shared/node_modules/@uppy/utils/lib/getAllowedMetaFields.js", "../../../../../shared/node_modules/@uppy/utils/lib/getTextDirection.js", "../../../../../shared/node_modules/@uppy/utils/lib/getTimeStamp.js", "../../../../../shared/node_modules/@uppy/utils/lib/isNetworkError.js", "../../../../../shared/node_modules/@uppy/utils/lib/secondsToTime.js", "../../../../../shared/node_modules/@uppy/utils/lib/prettyETA.js", "../../../../../shared/node_modules/@uppy/utils/lib/TaskQueue.js", "../../../../../shared/node_modules/@uppy/utils/lib/Translator.js", "../../../../../shared/node_modules/preact/src/constants.js", "../../../../../shared/node_modules/preact/src/util.js", "../../../../../shared/node_modules/preact/src/options.js", "../../../../../shared/node_modules/preact/src/create-element.js", "../../../../../shared/node_modules/preact/src/component.js", "../../../../../shared/node_modules/preact/src/diff/props.js", "../../../../../shared/node_modules/preact/src/create-context.js", "../../../../../shared/node_modules/preact/src/diff/children.js", "../../../../../shared/node_modules/preact/src/diff/index.js", "../../../../../shared/node_modules/preact/src/render.js", "../../../../../shared/node_modules/preact/src/clone-element.js", "../../../../../shared/node_modules/preact/src/diff/catch-error.js", "../../../../../shared/node_modules/preact/jsx-runtime/src/utils.js", "../../../../../shared/node_modules/preact/src/constants.js", "../../../../../shared/node_modules/preact/jsx-runtime/src/index.js", "../../../../../shared/node_modules/@uppy/core/lib/BasePlugin.js", "../../../../../shared/node_modules/@uppy/core/lib/EventManager.js", "../../../../../shared/node_modules/@uppy/core/lib/loggers.js", "../../../../../shared/node_modules/@uppy/core/lib/Restricter.js", "../../../../../shared/node_modules/@uppy/core/lib/UIPlugin.js", "../../../../../shared/node_modules/@uppy/store-default/package.json", "../../../../../shared/node_modules/@uppy/store-default/lib/index.js", "../../../../../shared/node_modules/@uppy/core/lib/Uppy.js", "../../../../../shared/node_modules/@uppy/core/node_modules/nanoid/non-secure/index.js", "../../../../../shared/node_modules/@uppy/core/package.json", "../../../../../shared/node_modules/@uppy/core/lib/getFileName.js", "../../../../../shared/node_modules/@uppy/core/lib/locale.js", "../../../../../shared/node_modules/@uppy/core/lib/supportsUploadProgress.js", "../../../../../shared/node_modules/@uppy/xhr-upload/package.json", "../../../../../shared/node_modules/@uppy/xhr-upload/lib/locale.js", "../../../../../shared/node_modules/@uppy/xhr-upload/lib/index.js", "../../../../../shared/node_modules/@uppy/status-bar/package.json", "../../../../../shared/node_modules/@uppy/status-bar/lib/locale.js", "../../../../../shared/node_modules/@uppy/status-bar/lib/StatusBarStates.js", "../../../../../shared/node_modules/@uppy/status-bar/lib/StatusBarUI.js", "../../../../../shared/node_modules/@uppy/status-bar/lib/Components.js", "../../../../../shared/node_modules/@uppy/status-bar/lib/calculateProcessingProgress.js", "../../../../../shared/node_modules/@uppy/status-bar/lib/StatusBar.js", "../../javascript/manage.js"],
  "sourcesContent": ["// Adapted from https://github.com/Flet/prettier-bytes/\n// Changing 1000 bytes to 1024, so we can keep uppercase KB vs kB\n// ISC License (c) Dan Flettre https://github.com/Flet/prettier-bytes/blob/master/LICENSE\nexport = function prettierBytes(input: number): string {\n  if (typeof input !== 'number' || Number.isNaN(input)) {\n    throw new TypeError(`Expected a number, got ${typeof input}`)\n  }\n\n  const neg = input < 0\n  let num = Math.abs(input)\n\n  if (neg) {\n    num = -num\n  }\n\n  if (num === 0) {\n    return '0 B'\n  }\n\n  const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n  const exponent = Math.min(Math.floor(Math.log(num) / Math.log(1024)), units.length - 1)\n  const value = Number(num / 1024 ** exponent)\n  const unit = units[exponent]\n\n  return `${value >= 10 || value % 1 === 0 ? Math.round(value) : value.toFixed(1)} ${unit}`\n}\n", "/* jshint node: true */\n'use strict';\n\n/**\n  # wildcard\n\n  Very simple wildcard matching, which is designed to provide the same\n  functionality that is found in the\n  [eve](https://github.com/adobe-webplatform/eve) eventing library.\n\n  ## Usage\n\n  It works with strings:\n\n  <<< examples/strings.js\n\n  Arrays:\n\n  <<< examples/arrays.js\n\n  Objects (matching against keys):\n\n  <<< examples/objects.js\n\n  While the library works in Node, if you are are looking for file-based\n  wildcard matching then you should have a look at:\n\n  <https://github.com/isaacs/node-glob>\n**/\n\nfunction WildcardMatcher(text, separator) {\n  this.text = text = text || '';\n  this.hasWild = ~text.indexOf('*');\n  this.separator = separator;\n  this.parts = text.split(separator);\n}\n\nWildcardMatcher.prototype.match = function(input) {\n  var matches = true;\n  var parts = this.parts;\n  var ii;\n  var partsCount = parts.length;\n  var testParts;\n\n  if (typeof input == 'string' || input instanceof String) {\n    if (!this.hasWild && this.text != input) {\n      matches = false;\n    } else {\n      testParts = (input || '').split(this.separator);\n      for (ii = 0; matches && ii < partsCount; ii++) {\n        if (parts[ii] === '*')  {\n          continue;\n        } else if (ii < testParts.length) {\n          matches = parts[ii] === testParts[ii];\n        } else {\n          matches = false;\n        }\n      }\n\n      // If matches, then return the component parts\n      matches = matches && testParts;\n    }\n  }\n  else if (typeof input.splice == 'function') {\n    matches = [];\n\n    for (ii = input.length; ii--; ) {\n      if (this.match(input[ii])) {\n        matches[matches.length] = input[ii];\n      }\n    }\n  }\n  else if (typeof input == 'object') {\n    matches = {};\n\n    for (var key in input) {\n      if (this.match(key)) {\n        matches[key] = input[key];\n      }\n    }\n  }\n\n  return matches;\n};\n\nmodule.exports = function(text, test, separator) {\n  var matcher = new WildcardMatcher(text, separator || /[\\/\\.]/);\n  if (typeof test != 'undefined') {\n    return matcher.match(test);\n  }\n\n  return matcher;\n};\n", "var wildcard = require('wildcard');\nvar reMimePartSplit = /[\\/\\+\\.]/;\n\n/**\n  # mime-match\n\n  A simple function to checker whether a target mime type matches a mime-type\n  pattern (e.g. image/jpeg matches image/jpeg OR image/*).\n\n  ## Example Usage\n\n  <<< example.js\n\n**/\nmodule.exports = function(target, pattern) {\n  function test(pattern) {\n    var result = wildcard(pattern, target, reMimePartSplit);\n\n    // ensure that we have a valid mime type (should have two parts)\n    return result && result.length >= 2;\n  }\n\n  return pattern ? test(pattern.split(';')[0]) : test;\n};\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n *   console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n  return root.Date.now();\n};\n\nmodule.exports = now;\n", "/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n  var index = string.length;\n\n  while (index-- && reWhitespace.test(string.charAt(index))) {}\n  return index;\n}\n\nmodule.exports = trimmedEndIndex;\n", "var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n  return string\n    ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n    : string;\n}\n\nmodule.exports = baseTrim;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n    getRawTag = require('./_getRawTag'),\n    objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n    undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n", "var baseTrim = require('./_baseTrim'),\n    isObject = require('./isObject'),\n    isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = baseTrim(value);\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n", "var isObject = require('./isObject'),\n    now = require('./now'),\n    toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n *  Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n *  The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n  var lastArgs,\n      lastThis,\n      maxWait,\n      result,\n      timerId,\n      lastCallTime,\n      lastInvokeTime = 0,\n      leading = false,\n      maxing = false,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  wait = toNumber(wait) || 0;\n  if (isObject(options)) {\n    leading = !!options.leading;\n    maxing = 'maxWait' in options;\n    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n\n  function invokeFunc(time) {\n    var args = lastArgs,\n        thisArg = lastThis;\n\n    lastArgs = lastThis = undefined;\n    lastInvokeTime = time;\n    result = func.apply(thisArg, args);\n    return result;\n  }\n\n  function leadingEdge(time) {\n    // Reset any `maxWait` timer.\n    lastInvokeTime = time;\n    // Start the timer for the trailing edge.\n    timerId = setTimeout(timerExpired, wait);\n    // Invoke the leading edge.\n    return leading ? invokeFunc(time) : result;\n  }\n\n  function remainingWait(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime,\n        timeWaiting = wait - timeSinceLastCall;\n\n    return maxing\n      ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n      : timeWaiting;\n  }\n\n  function shouldInvoke(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime;\n\n    // Either this is the first call, activity has stopped and we're at the\n    // trailing edge, the system time has gone backwards and we're treating\n    // it as the trailing edge, or we've hit the `maxWait` limit.\n    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n  }\n\n  function timerExpired() {\n    var time = now();\n    if (shouldInvoke(time)) {\n      return trailingEdge(time);\n    }\n    // Restart the timer.\n    timerId = setTimeout(timerExpired, remainingWait(time));\n  }\n\n  function trailingEdge(time) {\n    timerId = undefined;\n\n    // Only invoke if we have `lastArgs` which means `func` has been\n    // debounced at least once.\n    if (trailing && lastArgs) {\n      return invokeFunc(time);\n    }\n    lastArgs = lastThis = undefined;\n    return result;\n  }\n\n  function cancel() {\n    if (timerId !== undefined) {\n      clearTimeout(timerId);\n    }\n    lastInvokeTime = 0;\n    lastArgs = lastCallTime = lastThis = timerId = undefined;\n  }\n\n  function flush() {\n    return timerId === undefined ? result : trailingEdge(now());\n  }\n\n  function debounced() {\n    var time = now(),\n        isInvoking = shouldInvoke(time);\n\n    lastArgs = arguments;\n    lastThis = this;\n    lastCallTime = time;\n\n    if (isInvoking) {\n      if (timerId === undefined) {\n        return leadingEdge(lastCallTime);\n      }\n      if (maxing) {\n        // Handle invocations in a tight loop.\n        clearTimeout(timerId);\n        timerId = setTimeout(timerExpired, wait);\n        return invokeFunc(lastCallTime);\n      }\n    }\n    if (timerId === undefined) {\n      timerId = setTimeout(timerExpired, wait);\n    }\n    return result;\n  }\n  debounced.cancel = cancel;\n  debounced.flush = flush;\n  return debounced;\n}\n\nmodule.exports = debounce;\n", "var debounce = require('./debounce'),\n    isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n *  Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n  var leading = true,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  if (isObject(options)) {\n    leading = 'leading' in options ? !!options.leading : leading;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n  return debounce(func, wait, {\n    'leading': leading,\n    'maxWait': wait,\n    'trailing': trailing\n  });\n}\n\nmodule.exports = throttle;\n", "/**\n* Create an event emitter with namespaces\n* @name createNamespaceEmitter\n* @example\n* var emitter = require('./index')()\n*\n* emitter.on('*', function () {\n*   console.log('all events emitted', this.event)\n* })\n*\n* emitter.on('example', function () {\n*   console.log('example event emitted')\n* })\n*/\nmodule.exports = function createNamespaceEmitter () {\n  var emitter = {}\n  var _fns = emitter._fns = {}\n\n  /**\n  * Emit an event. Optionally namespace the event. Handlers are fired in the order in which they were added with exact matches taking precedence. Separate the namespace and event with a `:`\n  * @name emit\n  * @param {String} event \u2013 the name of the event, with optional namespace\n  * @param {...*} data \u2013 up to 6 arguments that are passed to the event listener\n  * @example\n  * emitter.emit('example')\n  * emitter.emit('demo:test')\n  * emitter.emit('data', { example: true}, 'a string', 1)\n  */\n  emitter.emit = function emit (event, arg1, arg2, arg3, arg4, arg5, arg6) {\n    var toEmit = getListeners(event)\n\n    if (toEmit.length) {\n      emitAll(event, toEmit, [arg1, arg2, arg3, arg4, arg5, arg6])\n    }\n  }\n\n  /**\n  * Create en event listener.\n  * @name on\n  * @param {String} event\n  * @param {Function} fn\n  * @example\n  * emitter.on('example', function () {})\n  * emitter.on('demo', function () {})\n  */\n  emitter.on = function on (event, fn) {\n    if (!_fns[event]) {\n      _fns[event] = []\n    }\n\n    _fns[event].push(fn)\n  }\n\n  /**\n  * Create en event listener that fires once.\n  * @name once\n  * @param {String} event\n  * @param {Function} fn\n  * @example\n  * emitter.once('example', function () {})\n  * emitter.once('demo', function () {})\n  */\n  emitter.once = function once (event, fn) {\n    function one () {\n      fn.apply(this, arguments)\n      emitter.off(event, one)\n    }\n    this.on(event, one)\n  }\n\n  /**\n  * Stop listening to an event. Stop all listeners on an event by only passing the event name. Stop a single listener by passing that event handler as a callback.\n  * You must be explicit about what will be unsubscribed: `emitter.off('demo')` will unsubscribe an `emitter.on('demo')` listener,\n  * `emitter.off('demo:example')` will unsubscribe an `emitter.on('demo:example')` listener\n  * @name off\n  * @param {String} event\n  * @param {Function} [fn] \u2013 the specific handler\n  * @example\n  * emitter.off('example')\n  * emitter.off('demo', function () {})\n  */\n  emitter.off = function off (event, fn) {\n    var keep = []\n\n    if (event && fn) {\n      var fns = this._fns[event]\n      var i = 0\n      var l = fns ? fns.length : 0\n\n      for (i; i < l; i++) {\n        if (fns[i] !== fn) {\n          keep.push(fns[i])\n        }\n      }\n    }\n\n    keep.length ? this._fns[event] = keep : delete this._fns[event]\n  }\n\n  function getListeners (e) {\n    var out = _fns[e] ? _fns[e] : []\n    var idx = e.indexOf(':')\n    var args = (idx === -1) ? [e] : [e.substring(0, idx), e.substring(idx + 1)]\n\n    var keys = Object.keys(_fns)\n    var i = 0\n    var l = keys.length\n\n    for (i; i < l; i++) {\n      var key = keys[i]\n      if (key === '*') {\n        out = out.concat(_fns[key])\n      }\n\n      if (args.length === 2 && args[0] === key) {\n        out = out.concat(_fns[key])\n        break\n      }\n    }\n\n    return out\n  }\n\n  function emitAll (e, fns, args) {\n    var i = 0\n    var l = fns.length\n\n    for (i; i < l; i++) {\n      if (!fns[i]) break\n      fns[i].event = e\n      fns[i].apply(fns[i], args)\n    }\n  }\n\n  return emitter\n}\n", "/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n", "/**\n * Low-pass filter using Exponential Moving Averages (aka exponential smoothing)\n * Filters a sequence of values by updating the mixing the previous output value\n * with the new input using the exponential window function\n *\n * @param newValue the n-th value of the sequence\n * @param previousSmoothedValue the exponential average of the first n-1 values\n * @param halfLife value of `dt` to move the smoothed value halfway between `previousFilteredValue` and `newValue`\n * @param dt time elapsed between adding the (n-1)th and the n-th values\n * @returns the exponential average of the first n values\n */\nexport default function emaFilter(newValue, previousSmoothedValue, halfLife, dt) {\n    if (halfLife === 0 || newValue === previousSmoothedValue)\n        return newValue;\n    if (dt === 0)\n        return previousSmoothedValue;\n    return newValue + (previousSmoothedValue - newValue) * 2 ** (-dt / halfLife);\n}\n", "class NetworkError extends Error {\n    cause;\n    isNetworkError;\n    request;\n    constructor(error, xhr = null) {\n        super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`);\n        this.cause = error;\n        this.isNetworkError = true;\n        this.request = xhr;\n    }\n}\nexport default NetworkError;\n", "/**\n * Helper to abort upload requests if there has not been any progress for `timeout` ms.\n * Create an instance using `timer = new ProgressTimeout(10000, onTimeout)`\n * Call `timer.progress()` to signal that there has been progress of any kind.\n * Call `timer.done()` when the upload has completed.\n */\nclass ProgressTimeout {\n    #aliveTimer;\n    #isDone = false;\n    #onTimedOut;\n    #timeout;\n    constructor(timeout, timeoutHandler) {\n        this.#timeout = timeout;\n        this.#onTimedOut = () => timeoutHandler(timeout);\n    }\n    progress() {\n        // Some browsers fire another progress event when the upload is\n        // cancelled, so we have to ignore progress after the timer was\n        // told to stop.\n        if (this.#isDone)\n            return;\n        if (this.#timeout > 0) {\n            clearTimeout(this.#aliveTimer);\n            this.#aliveTimer = setTimeout(this.#onTimedOut, this.#timeout);\n        }\n    }\n    done() {\n        if (!this.#isDone) {\n            clearTimeout(this.#aliveTimer);\n            this.#aliveTimer = undefined;\n            this.#isDone = true;\n        }\n    }\n}\nexport default ProgressTimeout;\n", "import NetworkError from './NetworkError.js';\nimport ProgressTimeout from './ProgressTimeout.js';\nconst noop = () => { };\n/**\n * Fetches data from a specified URL using XMLHttpRequest, with optional retry functionality and progress tracking.\n *\n * @param url The URL to send the request to.\n * @param options Optional settings for the fetch operation.\n */\nexport function fetcher(url, options = {}) {\n    const { body = null, headers = {}, method = 'GET', onBeforeRequest = noop, onUploadProgress = noop, shouldRetry = () => true, onAfterResponse = noop, onTimeout = noop, responseType, retries = 3, signal = null, timeout = 30_000, withCredentials = false, } = options;\n    // 300 ms, 600 ms, 1200 ms, 2400 ms, 4800 ms\n    const delay = (attempt) => 0.3 * 2 ** (attempt - 1) * 1000;\n    const timer = new ProgressTimeout(timeout, onTimeout);\n    function requestWithRetry(retryCount = 0) {\n        // biome-ignore lint/suspicious/noAsyncPromiseExecutor: it's fine\n        return new Promise(async (resolve, reject) => {\n            const xhr = new XMLHttpRequest();\n            const onError = (error) => {\n                if (shouldRetry(xhr) && retryCount < retries) {\n                    setTimeout(() => {\n                        requestWithRetry(retryCount + 1).then(resolve, reject);\n                    }, delay(retryCount));\n                }\n                else {\n                    timer.done();\n                    reject(error);\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.withCredentials = withCredentials;\n            if (responseType) {\n                xhr.responseType = responseType;\n            }\n            xhr.onload = async () => {\n                try {\n                    await onAfterResponse(xhr, retryCount);\n                }\n                catch (err) {\n                    // This is important as we need to emit the xhr\n                    // over the upload-error event.\n                    err.request = xhr;\n                    onError(err);\n                    return;\n                }\n                if (xhr.status >= 200 && xhr.status < 300) {\n                    timer.done();\n                    resolve(xhr);\n                }\n                else if (shouldRetry(xhr) && retryCount < retries) {\n                    setTimeout(() => {\n                        requestWithRetry(retryCount + 1).then(resolve, reject);\n                    }, delay(retryCount));\n                }\n                else {\n                    timer.done();\n                    reject(new NetworkError(xhr.statusText, xhr));\n                }\n            };\n            xhr.onerror = () => onError(new NetworkError(xhr.statusText, xhr));\n            xhr.upload.onprogress = (event) => {\n                timer.progress();\n                onUploadProgress(event);\n            };\n            if (headers) {\n                Object.keys(headers).forEach((key) => {\n                    xhr.setRequestHeader(key, headers[key]);\n                });\n            }\n            function abort() {\n                xhr.abort();\n                // Using DOMException for abort errors aligns with\n                // the convention established by the Fetch API.\n                reject(new DOMException('Aborted', 'AbortError'));\n            }\n            signal?.addEventListener('abort', abort);\n            if (signal?.aborted) {\n                // in case the signal was already aborted\n                abort();\n                return;\n            }\n            await onBeforeRequest(xhr, retryCount);\n            xhr.send(body);\n        });\n    }\n    return requestWithRetry();\n}\n", "const hasError = (file) => 'error' in file && !!file.error;\n// We don't need to re-upload already successfully uploaded files\n// so let's exclude them here:\n// https://github.com/transloadit/uppy/issues/5930\n// This happens for example when restoring a partially finished session (e.g. using golden retriever).\nconst isCompleted = (file) => file.progress.uploadComplete;\nexport function filterFilesToUpload(files) {\n    return files.filter((file) => !hasError(file) && !isCompleted(file));\n}\n// Don't double-emit upload-started for Golden Retriever-restored files that were already started\nexport function filterFilesToEmitUploadStarted(files) {\n    return files.filter((file) => !file.progress?.uploadStarted || !file.isRestored);\n}\n", "/**\n * Check if an object is a DOM element. Duck-typing based on `nodeType`.\n */\nexport default function isDOMElement(obj) {\n    if (typeof obj !== 'object' || obj === null)\n        return false;\n    if (!('nodeType' in obj))\n        return false;\n    return obj.nodeType === Node.ELEMENT_NODE;\n}\n", "import isDOMElement from './isDOMElement.js';\nfunction findDOMElement(element, context = document) {\n    if (typeof element === 'string') {\n        return context.querySelector(element);\n    }\n    if (isDOMElement(element)) {\n        return element;\n    }\n    return null;\n}\nexport default findDOMElement;\n", "/**\n * Takes a full filename string and returns an object {name, extension}\n */\nexport default function getFileNameAndExtension(fullFileName) {\n    const lastDot = fullFileName.lastIndexOf('.');\n    // these count as no extension: \"no-dot\", \"trailing-dot.\"\n    if (lastDot === -1 || lastDot === fullFileName.length - 1) {\n        return {\n            name: fullFileName,\n            extension: undefined,\n        };\n    }\n    return {\n        name: fullFileName.slice(0, lastDot),\n        extension: fullFileName.slice(lastDot + 1),\n    };\n}\n", "// ___Why not add the mime-types package?\n//    It's 19.7kB gzipped, and we only need mime types for well-known extensions (for file previews).\n// ___Where to take new extensions from?\n//    https://github.com/jshttp/mime-db/blob/master/db.json\nexport default {\n    __proto__: null,\n    md: 'text/markdown',\n    markdown: 'text/markdown',\n    mp4: 'video/mp4',\n    mp3: 'audio/mp3',\n    svg: 'image/svg+xml',\n    jpg: 'image/jpeg',\n    png: 'image/png',\n    webp: 'image/webp',\n    gif: 'image/gif',\n    heic: 'image/heic',\n    heif: 'image/heif',\n    yaml: 'text/yaml',\n    yml: 'text/yaml',\n    csv: 'text/csv',\n    tsv: 'text/tab-separated-values',\n    tab: 'text/tab-separated-values',\n    avi: 'video/x-msvideo',\n    mks: 'video/x-matroska',\n    mkv: 'video/x-matroska',\n    mov: 'video/quicktime',\n    dicom: 'application/dicom',\n    doc: 'application/msword',\n    msg: 'application/vnd.ms-outlook',\n    docm: 'application/vnd.ms-word.document.macroenabled.12',\n    docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n    dot: 'application/msword',\n    dotm: 'application/vnd.ms-word.template.macroenabled.12',\n    dotx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n    xla: 'application/vnd.ms-excel',\n    xlam: 'application/vnd.ms-excel.addin.macroenabled.12',\n    xlc: 'application/vnd.ms-excel',\n    xlf: 'application/x-xliff+xml',\n    xlm: 'application/vnd.ms-excel',\n    xls: 'application/vnd.ms-excel',\n    xlsb: 'application/vnd.ms-excel.sheet.binary.macroenabled.12',\n    xlsm: 'application/vnd.ms-excel.sheet.macroenabled.12',\n    xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n    xlt: 'application/vnd.ms-excel',\n    xltm: 'application/vnd.ms-excel.template.macroenabled.12',\n    xltx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n    xlw: 'application/vnd.ms-excel',\n    txt: 'text/plain',\n    text: 'text/plain',\n    conf: 'text/plain',\n    log: 'text/plain',\n    pdf: 'application/pdf',\n    zip: 'application/zip',\n    '7z': 'application/x-7z-compressed',\n    rar: 'application/x-rar-compressed',\n    tar: 'application/x-tar',\n    gz: 'application/gzip',\n    dmg: 'application/x-apple-diskimage',\n};\n", "import getFileNameAndExtension from './getFileNameAndExtension.js';\nimport mimeTypes from './mimeTypes.js';\nexport default function getFileType(file) {\n    if (file.type)\n        return file.type;\n    const fileExtension = file.name\n        ? getFileNameAndExtension(file.name).extension?.toLowerCase()\n        : null;\n    if (fileExtension && fileExtension in mimeTypes) {\n        // else, see if we can map extension to a mime type\n        return mimeTypes[fileExtension];\n    }\n    // if all fails, fall back to a generic byte stream type\n    return 'application/octet-stream';\n}\n", "import getFileType from './getFileType.js';\nfunction encodeCharacter(character) {\n    return character.charCodeAt(0).toString(32);\n}\nfunction encodeFilename(name) {\n    let suffix = '';\n    return (name.replace(/[^A-Z0-9]/gi, (character) => {\n        suffix += `-${encodeCharacter(character)}`;\n        return '/';\n    }) + suffix);\n}\n/**\n * Takes a file object and turns it into fileID, by converting file.name to lowercase,\n * removing extra characters and adding type, size and lastModified\n */\nexport default function generateFileID(file, instanceId) {\n    // It's tempting to do `[items].filter(Boolean).join('-')` here, but that\n    // is slower! simple string concatenation is fast\n    let id = instanceId || 'uppy';\n    if (typeof file.name === 'string') {\n        id += `-${encodeFilename(file.name.toLowerCase())}`;\n    }\n    if (file.type !== undefined) {\n        id += `-${file.type}`;\n    }\n    if (file.meta && typeof file.meta.relativePath === 'string') {\n        id += `-${encodeFilename(file.meta.relativePath.toLowerCase())}`;\n    }\n    if (file.data?.size !== undefined) {\n        id += `-${file.data.size}`;\n    }\n    if (file.data.lastModified !== undefined) {\n        id += `-${file.data.lastModified}`;\n    }\n    return id;\n}\n// If the provider has a stable, unique ID, then we can use that to identify the file.\n// Then we don't have to generate our own ID, and we can add the same file many times if needed (different path)\nfunction hasFileStableId(file) {\n    if (!file.isRemote || !file.remote)\n        return false;\n    // These are the providers that it seems like have stable IDs for their files. The other's I haven't checked yet.\n    const stableIdProviders = new Set([\n        'box',\n        'dropbox',\n        'drive',\n        'facebook',\n        'unsplash',\n    ]);\n    return stableIdProviders.has(file.remote.provider);\n}\nexport function getSafeFileId(file, instanceId) {\n    if (hasFileStableId(file))\n        return file.id;\n    const fileType = getFileType(file);\n    return generateFileID({\n        ...file,\n        type: fileType,\n    }, instanceId);\n}\n", "export default function getAllowedMetaFields(fields, meta) {\n    if (fields === true) {\n        return Object.keys(meta);\n    }\n    if (Array.isArray(fields)) {\n        return fields;\n    }\n    return [];\n}\n", "/**\n * Get the declared text direction for an element.\n */\nfunction getTextDirection(element) {\n    // There is another way to determine text direction using getComputedStyle(), as done here:\n    // https://github.com/pencil-js/text-direction/blob/2a235ce95089b3185acec3b51313cbba921b3811/text-direction.js\n    //\n    // We do not use that approach because we are interested specifically in the _declared_ text direction.\n    // If no text direction is declared, we have to provide our own explicit text direction so our\n    // bidirectional CSS style sheets work.\n    while (element && !element.dir) {\n        element = element.parentNode;\n    }\n    return element?.dir;\n}\nexport default getTextDirection;\n", "/**\n * Adds zero to strings shorter than two characters.\n */\nfunction pad(number) {\n    return number < 10 ? `0${number}` : number.toString();\n}\n/**\n * Returns a timestamp in the format of `hours:minutes:seconds`\n */\nexport default function getTimeStamp() {\n    const date = new Date();\n    const hours = pad(date.getHours());\n    const minutes = pad(date.getMinutes());\n    const seconds = pad(date.getSeconds());\n    return `${hours}:${minutes}:${seconds}`;\n}\n", "function isNetworkError(xhr) {\n    if (!xhr)\n        return false;\n    // finished but status is 0 \u2014 usually indicates a network/CORS/file error\n    return xhr.readyState === 4 && xhr.status === 0;\n}\nexport default isNetworkError;\n", "export default function secondsToTime(rawSeconds) {\n    const hours = Math.floor(rawSeconds / 3600) % 24;\n    const minutes = Math.floor(rawSeconds / 60) % 60;\n    const seconds = Math.floor(rawSeconds % 60);\n    return { hours, minutes, seconds };\n}\n", "import secondsToTime from './secondsToTime.js';\nexport default function prettyETA(seconds) {\n    const time = secondsToTime(seconds);\n    // Only display hours and minutes if they are greater than 0 but always\n    // display minutes if hours is being displayed\n    // Display a leading zero if the there is a preceding unit: 1m 05s, but 5s\n    const hoursStr = time.hours === 0 ? '' : `${time.hours}h`;\n    const minutesStr = time.minutes === 0\n        ? ''\n        : `${time.hours === 0\n            ? time.minutes\n            : ` ${time.minutes.toString(10).padStart(2, '0')}`}m`;\n    const secondsStr = time.hours !== 0\n        ? ''\n        : `${time.minutes === 0\n            ? time.seconds\n            : ` ${time.seconds.toString(10).padStart(2, '0')}`}s`;\n    return `${hoursStr}${minutesStr}${secondsStr}`;\n}\n", "/**\n * A concurrent task queue with FIFO ordering.\n *\n * Tasks are functions that receive an AbortSignal and return a Promise.\n * The queue manages concurrency and processes tasks in insertion order.\n *\n * @example\n * ```ts\n * const queue = new TaskQueue({ concurrency: 3 })\n *\n * const promise = queue.add(async (signal) => {\n *   const response = await fetch(url, { signal })\n *   return response.json()\n * })\n *\n * // To abort:\n * promise.abort()\n * ```\n */\nexport class TaskQueue {\n    #queue = [];\n    #running = 0;\n    #concurrency;\n    #paused = false;\n    constructor(options) {\n        const limit = options?.concurrency;\n        this.#concurrency =\n            typeof limit !== 'number' || limit === 0 ? Infinity : limit;\n    }\n    /**\n     * Add a task to the queue.\n     *\n     * @param task - Function receiving AbortSignal, returns Promise\n     * @returns AbortablePromise that resolves with task result\n     */\n    add(task) {\n        const controller = new AbortController();\n        let resolve;\n        let reject;\n        const promise = new Promise((res, rej) => {\n            resolve = res;\n            reject = rej;\n        });\n        const queuedTask = {\n            run: () => task(controller.signal),\n            resolve,\n            reject,\n            controller,\n        };\n        // Handle abort while queued\n        controller.signal.addEventListener('abort', () => {\n            const index = this.#queue.indexOf(queuedTask);\n            if (index !== -1) {\n                this.#queue.splice(index, 1);\n                reject(controller.signal.reason ??\n                    new DOMException('Aborted', 'AbortError'));\n            }\n        }, { once: true });\n        promise.abort = (reason) => {\n            controller.abort(reason ?? new DOMException('Aborted', 'AbortError'));\n        };\n        // Legacy compatibility: abortOn method\n        promise.abortOn = (signal) => {\n            if (signal) {\n                const onAbort = () => promise.abort(signal.reason);\n                signal.addEventListener('abort', onAbort, { once: true });\n                promise.then(() => signal.removeEventListener('abort', onAbort), () => signal.removeEventListener('abort', onAbort));\n            }\n            return promise;\n        };\n        // Run immediately or queue\n        if (!this.#paused && this.#running < this.#concurrency) {\n            this.#execute(queuedTask);\n        }\n        else {\n            this.#queue.push(queuedTask);\n        }\n        return promise;\n    }\n    #execute(task) {\n        this.#running++;\n        // Check if already aborted before starting\n        if (task.controller.signal.aborted) {\n            this.#running--;\n            task.reject(task.controller.signal.reason ??\n                new DOMException('Aborted', 'AbortError'));\n            this.#advance();\n            return;\n        }\n        let runPromise;\n        try {\n            runPromise = task.run();\n        }\n        catch (error) {\n            runPromise = Promise.reject(error);\n        }\n        runPromise\n            .then((result) => {\n            if (task.controller.signal.aborted) {\n                task.reject(task.controller.signal.reason ??\n                    new DOMException('Aborted', 'AbortError'));\n            }\n            else {\n                task.resolve(result);\n            }\n        }, (error) => {\n            task.reject(error);\n        })\n            .finally(() => {\n            this.#running--;\n            this.#advance();\n        });\n    }\n    #advance() {\n        // Use microtask to allow batch aborts without starting new tasks\n        queueMicrotask(() => {\n            if (this.#paused || this.#running >= this.#concurrency)\n                return;\n            while (this.#queue.length > 0) {\n                const next = this.#queue.shift();\n                if (next.controller.signal.aborted)\n                    continue;\n                this.#execute(next);\n                return;\n            }\n        });\n    }\n    /**\n     * Pause the queue. Running tasks continue, but no new tasks start.\n     */\n    pause() {\n        this.#paused = true;\n    }\n    /**\n     * Resume the queue and start processing pending tasks.\n     */\n    resume() {\n        this.#paused = false;\n        // Kick off tasks up to concurrency limit\n        const available = this.#concurrency - this.#running;\n        for (let i = 0; i < available; i++) {\n            this.#advance();\n        }\n    }\n    /**\n     * Clear all pending tasks from the queue.\n     * Running tasks are not affected.\n     *\n     * @param reason - Optional reason for rejection (defaults to AbortError)\n     */\n    clear(reason) {\n        const tasks = this.#queue.splice(0);\n        const error = reason ?? new DOMException('Cleared', 'AbortError');\n        for (const task of tasks) {\n            task.controller.abort(error);\n            task.reject(error);\n        }\n    }\n    get concurrency() {\n        return this.#concurrency;\n    }\n    set concurrency(value) {\n        this.#concurrency =\n            typeof value !== 'number' || value === 0 ? Infinity : value;\n        // If concurrency increased, try to start more tasks\n        if (!this.#paused) {\n            const available = this.#concurrency - this.#running;\n            for (let i = 0; i < available; i++) {\n                this.#advance();\n            }\n        }\n    }\n    get pending() {\n        return this.#queue.length;\n    }\n    get running() {\n        return this.#running;\n    }\n    get isPaused() {\n        return this.#paused;\n    }\n    /**\n     * @deprecated Legacy compatibility wrapper for RateLimitedQueue API.\n     * Wraps a function so that when called, it's queued and returns an AbortablePromise.\n     * Note: for legacy compatibility with RateLimitedQueue, the wrapped function\n     * does not receive this queue's AbortSignal. Aborting the returned promise\n     * will reject it, but it will not automatically cancel work inside the wrapped\n     * function unless that function is wired to an external AbortSignal.\n     */\n    wrapPromiseFunction(fn) {\n        return (...args) => {\n            return this.add((signal) => {\n                // The wrapped function doesn't receive signal directly,\n                // caller is responsible for using signal if needed\n                void signal;\n                return fn(...args);\n            });\n        };\n    }\n}\n", "function insertReplacement(source, rx, replacement) {\n    const newParts = [];\n    source.forEach((chunk) => {\n        // When the source contains multiple placeholders for interpolation,\n        // we should ignore chunks that are not strings, because those\n        // can be JSX objects and will be otherwise incorrectly turned into strings.\n        // Without this condition we\u2019d get this: [object Object] hello [object Object] my <button>\n        if (typeof chunk !== 'string') {\n            return newParts.push(chunk);\n        }\n        return rx[Symbol.split](chunk).forEach((raw, i, list) => {\n            if (raw !== '') {\n                newParts.push(raw);\n            }\n            // Interlace with the `replacement` value\n            if (i < list.length - 1) {\n                newParts.push(replacement);\n            }\n        });\n    });\n    return newParts;\n}\n/**\n * Takes a string with placeholder variables like `%{smart_count} file selected`\n * and replaces it with values from options `{smart_count: 5}`\n *\n * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE\n * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299\n *\n * @param phrase that needs interpolation, with placeholders\n * @param options with values that will be used to replace placeholders\n */\nfunction interpolate(phrase, options) {\n    const dollarRegex = /\\$/g;\n    const dollarBillsYall = '$$$$';\n    let interpolated = [phrase];\n    if (options == null)\n        return interpolated;\n    for (const arg of Object.keys(options)) {\n        if (arg !== '_') {\n            // Ensure replacement value is escaped to prevent special $-prefixed\n            // regex replace tokens. the \"$$$$\" is needed because each \"$\" needs to\n            // be escaped with \"$\" itself, and we need two in the resulting output.\n            let replacement = options[arg];\n            if (typeof replacement === 'string') {\n                replacement = dollarRegex[Symbol.replace](replacement, dollarBillsYall);\n            }\n            // We create a new `RegExp` each time instead of using a more-efficient\n            // string replace so that the same argument can be replaced multiple times\n            // in the same phrase.\n            interpolated = insertReplacement(interpolated, new RegExp(`%\\\\{${arg}\\\\}`, 'g'), replacement);\n        }\n    }\n    return interpolated;\n}\nconst defaultOnMissingKey = (key) => {\n    throw new Error(`missing string: ${key}`);\n};\n/**\n * Translates strings with interpolation & pluralization support.\n * Extensible with custom dictionaries and pluralization functions.\n *\n * Borrows heavily from and inspired by Polyglot https://github.com/airbnb/polyglot.js,\n * basically a stripped-down version of it. Differences: pluralization functions are not hardcoded\n * and can be easily added among with dictionaries, nested objects are used for pluralization\n * as opposed to `||||` delimeter\n *\n * Usage example: `translator.translate('files_chosen', {smart_count: 3})`\n */\nexport default class Translator {\n    locale;\n    constructor(locales, { onMissingKey = defaultOnMissingKey } = {}) {\n        this.locale = {\n            strings: {},\n            pluralize(n) {\n                if (n === 1) {\n                    return 0;\n                }\n                return 1;\n            },\n        };\n        if (Array.isArray(locales)) {\n            locales.forEach(this.#apply, this);\n        }\n        else {\n            this.#apply(locales);\n        }\n        this.#onMissingKey = onMissingKey;\n    }\n    #onMissingKey;\n    #apply(locale) {\n        if (!locale?.strings) {\n            return;\n        }\n        const prevLocale = this.locale;\n        Object.assign(this.locale, {\n            strings: { ...prevLocale.strings, ...locale.strings },\n            pluralize: locale.pluralize || prevLocale.pluralize,\n        });\n    }\n    /**\n     * Public translate method\n     *\n     * @param key\n     * @param options with values that will be used later to replace placeholders in string\n     * @returns string translated (and interpolated)\n     */\n    translate(key, options) {\n        return this.translateArray(key, options).join('');\n    }\n    /**\n     * Get a translation and return the translated and interpolated parts as an array.\n     *\n     * @returns The translated and interpolated parts, in order.\n     */\n    translateArray(key, options) {\n        let string = this.locale.strings[key];\n        if (string == null) {\n            this.#onMissingKey(key);\n            string = key;\n        }\n        const hasPluralForms = typeof string === 'object';\n        if (hasPluralForms) {\n            if (options && typeof options.smart_count !== 'undefined') {\n                const plural = this.locale.pluralize(options.smart_count);\n                return interpolate(string[plural], options);\n            }\n            throw new Error('Attempted to use a string with plural forms, but no value was given for %{smart_count}');\n        }\n        if (typeof string !== 'string') {\n            throw new Error(`string was not a string`);\n        }\n        return interpolate(string, options);\n    }\n}\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n", "import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n", "import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n", "import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n", "import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\n// Per-instance unique key for event clock stamps. Each Preact copy on the page\n// gets its own random suffix so that `_dispatched` / `_attached` properties on\n// shared event objects and handler functions cannot collide across instances.\n// ~1 in 60M collision odds - if you have that many praect versions on the page,\n// you deserve some weird bugs.\n// In 11 we can replace this with a\n// Symbol\nlet _id = Math.random().toString(8),\n\tEVENT_DISPATCHED = '__d' + _id,\n\tEVENT_ATTACHED = '__a' + _id;\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue[EVENT_ATTACHED] = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue[EVENT_ATTACHED] = oldValue[EVENT_ATTACHED];\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e[EVENT_DISPATCHED] == NULL) {\n\t\t\t\te[EVENT_DISPATCHED] = eventClock++;\n\n\t\t\t\t// When `e[EVENT_DISPATCHED]` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e[EVENT_DISPATCHED] < eventHandler[EVENT_ATTACHED]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n", "import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n", "import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\toldVNode =\n\t\t\t(childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\n\t\t\t// When a matched VNode is physically moved via INSERT_VNODE, its old\n\t\t\t// _dom pointer becomes a stale positional reference. Clear it so that\n\t\t\t// getDomSibling (called from nested diffs) won't return this stale\n\t\t\t// reference and mis-place subsequent DOM nodes. See #5065.\n\t\t\tif (shouldPlace && oldVNode._dom) {\n\t\t\t\toldVNode._dom = NULL;\n\t\t\t}\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t//   const reuse = <div />\n\t\t\t//   <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren   newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t//     we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t//     this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n", "import {\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\tlet oldCommitQueueLength = commitQueue.length;\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent = newType.prototype && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet renderResult =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? cloneNode(tmp.props.children)\n\t\t\t\t\t: tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// We remove any componentDidMount, ...\n\t\t\t// that have been invalidated by us\n\t\t\t// intercepting the error.\n\t\t\tcommitQueue.length = oldCommitQueueLength;\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\t}\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else if (excessDomChildren != NULL) {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t}\n\n\t\t\tif (newVNode._children == NULL) {\n\t\t\t\tnewVNode._children = oldVNode._children || [];\n\t\t\t}\n\n\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._force = true;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (typeof node != 'object' || node == NULL || node._depth > 0) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\tif (node.constructor !== UNDEFINED) return null;\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren =\n\t\t\tnodeType == 'textarea' && newProps.defaultValue != NULL\n\t\t\t\t? NULL\n\t\t\t\t: excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating || nodeType == 'textarea') {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = r._globalContext = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n", "import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n\n\t// The live children are tracked on _children after diffing.\n\tvnode.props.children = NULL;\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n", "import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps != UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n", "import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n", "const ENCODED_ENTITIES = /[\"&<]/;\n\n/** @param {string} str */\nexport function encodeEntities(str) {\n\t// Skip all work for strings with no entities needing encoding:\n\tif (str.length === 0 || ENCODED_ENTITIES.test(str) === false) return str;\n\n\tlet last = 0,\n\t\ti = 0,\n\t\tout = '',\n\t\tch = '';\n\n\t// Seek forward in str until the next entity char:\n\tfor (; i < str.length; i++) {\n\t\tswitch (str.charCodeAt(i)) {\n\t\t\tcase 34:\n\t\t\t\tch = '&quot;';\n\t\t\t\tbreak;\n\t\t\tcase 38:\n\t\t\t\tch = '&amp;';\n\t\t\t\tbreak;\n\t\t\tcase 60:\n\t\t\t\tch = '&lt;';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t// Append skipped/buffered characters and the encoded entity:\n\t\tif (i !== last) out += str.slice(last, i);\n\t\tout += ch;\n\t\t// Start the next seek/buffer after the entity's offset:\n\t\tlast = i + 1;\n\t}\n\tif (i !== last) out += str.slice(last, i);\n\treturn out;\n}\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { options, Fragment } from 'preact';\nimport { encodeEntities } from './utils';\nimport { IS_NON_DIMENSIONAL } from '../../src/constants';\n\nlet vnodeId = 0;\n\nconst isArray = Array.isArray;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\tif (!props) props = {};\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = props,\n\t\tref,\n\t\ti;\n\n\tif ('ref' in normalizedProps) {\n\t\tnormalizedProps = {};\n\t\tfor (i in props) {\n\t\t\tif (i == 'ref') {\n\t\t\t\tref = props[i];\n\t\t\t} else {\n\t\t\t\tnormalizedProps[i] = props[i];\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {VNode & { __source: any; __self: any }} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\n/**\n * Create a template vnode. This function is not expected to be\n * used directly, but rather through a precompile JSX transform\n * @param {string[]} templates\n * @param  {Array<string | null | VNode>} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array<string | null | VNode>}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n", "/**\n * Core plugin logic that all plugins share.\n *\n * BasePlugin does not contain DOM rendering so it can be used for plugins\n * without a user interface.\n *\n * See `Plugin` for the extended version with Preact rendering for interfaces.\n */\nimport { Translator } from '@uppy/utils';\nexport default class BasePlugin {\n    uppy;\n    opts;\n    id;\n    defaultLocale;\n    i18n;\n    i18nArray;\n    type;\n    VERSION;\n    constructor(uppy, opts) {\n        this.uppy = uppy;\n        this.opts = opts ?? {};\n    }\n    getPluginState() {\n        const { plugins } = this.uppy.getState();\n        return (plugins?.[this.id] || {});\n    }\n    setPluginState(update) {\n        const { plugins } = this.uppy.getState();\n        this.uppy.setState({\n            plugins: {\n                ...plugins,\n                [this.id]: {\n                    ...plugins[this.id],\n                    ...update,\n                },\n            },\n        });\n    }\n    setOptions(newOpts) {\n        this.opts = { ...this.opts, ...newOpts };\n        this.setPluginState(undefined); // so that UI re-renders with new options\n        this.i18nInit();\n    }\n    i18nInit() {\n        const translator = new Translator([\n            this.defaultLocale,\n            this.uppy.locale,\n            this.opts.locale,\n        ]);\n        this.i18n = translator.translate.bind(translator);\n        this.i18nArray = translator.translateArray.bind(translator);\n        this.setPluginState(undefined); // so that UI re-renders and we see the updated locale\n    }\n    /**\n     * Extendable methods\n     * ==================\n     * These methods are here to serve as an overview of the extendable methods as well as\n     * making them not conditional in use, such as `if (this.afterUpdate)`.\n     */\n    addTarget(plugin) {\n        throw new Error(\"Extend the addTarget method to add your plugin to another plugin's target\");\n    }\n    install() { }\n    uninstall() { }\n    update(state) { }\n    // Called after every state update, after everything's mounted. Debounced.\n    afterUpdate() { }\n}\n", "/**\n * Create a wrapper around an event emitter with a `remove` method to remove\n * all events that were added using the wrapped emitter.\n */\nexport default class EventManager {\n    #uppy;\n    #events = [];\n    constructor(uppy) {\n        this.#uppy = uppy;\n    }\n    on(event, fn) {\n        this.#events.push([event, fn]);\n        return this.#uppy.on(event, fn);\n    }\n    remove() {\n        for (const [event, fn] of this.#events.splice(0)) {\n            this.#uppy.off(event, fn);\n        }\n    }\n    onFilePause(fileID, cb) {\n        this.on('upload-pause', (file, isPaused) => {\n            if (fileID === file?.id) {\n                cb(isPaused);\n            }\n        });\n    }\n    onFileRemove(fileID, cb) {\n        this.on('file-removed', (file) => {\n            if (fileID === file.id)\n                cb(file.id);\n        });\n    }\n    onPause(fileID, cb) {\n        this.on('upload-pause', (file, isPaused) => {\n            if (fileID === file?.id) {\n                // const isPaused = this.#uppy.pauseResume(fileID)\n                cb(isPaused);\n            }\n        });\n    }\n    onRetry(fileID, cb) {\n        this.on('upload-retry', (file) => {\n            if (fileID === file?.id) {\n                cb();\n            }\n        });\n    }\n    onRetryAll(fileID, cb) {\n        this.on('retry-all', () => {\n            if (!this.#uppy.getFile(fileID))\n                return;\n            cb();\n        });\n    }\n    onPauseAll(fileID, cb) {\n        this.on('pause-all', () => {\n            if (!this.#uppy.getFile(fileID))\n                return;\n            cb();\n        });\n    }\n    onCancelAll(fileID, eventHandler) {\n        this.on('cancel-all', (...args) => {\n            if (!this.#uppy.getFile(fileID))\n                return;\n            eventHandler(...args);\n        });\n    }\n    onResumeAll(fileID, cb) {\n        this.on('resume-all', () => {\n            if (!this.#uppy.getFile(fileID))\n                return;\n            cb();\n        });\n    }\n}\n", "import { getTimeStamp } from '@uppy/utils';\n// Swallow all logs, except errors.\n// default if logger is not set or debug: false\nconst justErrorsLogger = {\n    debug: () => { },\n    warn: () => { },\n    error: (...args) => console.error(`[Uppy] [${getTimeStamp()}]`, ...args),\n};\n// Print logs to console with namespace + timestamp,\n// set by logger: Uppy.debugLogger or debug: true\nconst debugLogger = {\n    debug: (...args) => console.debug(`[Uppy] [${getTimeStamp()}]`, ...args),\n    warn: (...args) => console.warn(`[Uppy] [${getTimeStamp()}]`, ...args),\n    error: (...args) => console.error(`[Uppy] [${getTimeStamp()}]`, ...args),\n};\nexport { justErrorsLogger, debugLogger };\n", "import prettierBytes from '@transloadit/prettier-bytes';\n// @ts-ignore untyped\nimport match from 'mime-match';\nconst defaultOptions = {\n    maxFileSize: null,\n    minFileSize: null,\n    maxTotalFileSize: null,\n    maxNumberOfFiles: null,\n    minNumberOfFiles: null,\n    allowedFileTypes: null,\n    requiredMetaFields: [],\n};\nclass RestrictionError extends Error {\n    isUserFacing;\n    file;\n    constructor(message, opts) {\n        super(message);\n        this.isUserFacing = opts?.isUserFacing ?? true;\n        if (opts?.file) {\n            this.file = opts.file; // only some restriction errors are related to a particular file\n        }\n    }\n    isRestriction = true;\n}\nclass Restricter {\n    getI18n;\n    getOpts;\n    constructor(getOpts, getI18n) {\n        this.getI18n = getI18n;\n        this.getOpts = () => {\n            const opts = getOpts();\n            if (opts.restrictions?.allowedFileTypes != null &&\n                !Array.isArray(opts.restrictions.allowedFileTypes)) {\n                throw new TypeError('`restrictions.allowedFileTypes` must be an array');\n            }\n            return opts;\n        };\n    }\n    // Because these operations are slow, we cannot run them for every file (if we are adding multiple files)\n    validateAggregateRestrictions(existingFiles, addingFiles) {\n        const { maxTotalFileSize, maxNumberOfFiles } = this.getOpts().restrictions;\n        if (maxNumberOfFiles) {\n            const nonGhostFiles = existingFiles.filter((f) => !f.isGhost);\n            if (nonGhostFiles.length + addingFiles.length > maxNumberOfFiles) {\n                throw new RestrictionError(`${this.getI18n()('youCanOnlyUploadX', {\n                    smart_count: maxNumberOfFiles,\n                })}`);\n            }\n        }\n        if (maxTotalFileSize) {\n            const totalFilesSize = [...existingFiles, ...addingFiles].reduce((total, f) => total + (f.size ?? 0), 0);\n            if (totalFilesSize > maxTotalFileSize) {\n                throw new RestrictionError(this.getI18n()('aggregateExceedsSize', {\n                    sizeAllowed: prettierBytes(maxTotalFileSize),\n                    size: prettierBytes(totalFilesSize),\n                }));\n            }\n        }\n    }\n    validateSingleFile(file) {\n        const { maxFileSize, minFileSize, allowedFileTypes } = this.getOpts().restrictions;\n        if (allowedFileTypes) {\n            const isCorrectFileType = allowedFileTypes.some((type) => {\n                // check if this is a mime-type\n                if (type.includes('/')) {\n                    if (!file.type)\n                        return false;\n                    return match(file.type.replace(/;.*?$/, ''), type);\n                }\n                // otherwise this is likely an extension\n                if (type[0] === '.' && file.extension) {\n                    return file.extension.toLowerCase() === type.slice(1).toLowerCase();\n                }\n                return false;\n            });\n            if (!isCorrectFileType) {\n                const allowedFileTypesString = allowedFileTypes.join(', ');\n                throw new RestrictionError(this.getI18n()('youCanOnlyUploadFileTypes', {\n                    types: allowedFileTypesString,\n                }), { file });\n            }\n        }\n        // We can't check maxFileSize if the size is unknown.\n        if (maxFileSize && file.size != null && file.size > maxFileSize) {\n            throw new RestrictionError(this.getI18n()('exceedsSize', {\n                size: prettierBytes(maxFileSize),\n                file: file.name ?? this.getI18n()('unnamed'),\n            }), { file });\n        }\n        // We can't check minFileSize if the size is unknown.\n        if (minFileSize && file.size != null && file.size < minFileSize) {\n            throw new RestrictionError(this.getI18n()('inferiorSize', {\n                size: prettierBytes(minFileSize),\n            }), { file });\n        }\n    }\n    validate(existingFiles, addingFiles) {\n        addingFiles.forEach((addingFile) => {\n            this.validateSingleFile(addingFile);\n        });\n        this.validateAggregateRestrictions(existingFiles, addingFiles);\n    }\n    validateMinNumberOfFiles(files) {\n        const { minNumberOfFiles } = this.getOpts().restrictions;\n        if (minNumberOfFiles && Object.keys(files).length < minNumberOfFiles) {\n            throw new RestrictionError(this.getI18n()('youHaveToAtLeastSelectX', {\n                smart_count: minNumberOfFiles,\n            }));\n        }\n    }\n    getMissingRequiredMetaFields(file) {\n        const error = new RestrictionError(this.getI18n()('missingRequiredMetaFieldOnFile', {\n            fileName: file.name ?? this.getI18n()('unnamed'),\n        }));\n        const { requiredMetaFields } = this.getOpts().restrictions;\n        const missingFields = [];\n        for (const field of requiredMetaFields) {\n            if (!Object.hasOwn(file.meta, field) || file.meta[field] === '') {\n                missingFields.push(field);\n            }\n        }\n        return { missingFields, error };\n    }\n}\nexport { Restricter, defaultOptions, RestrictionError };\n", "import { findDOMElement, getTextDirection } from '@uppy/utils';\nimport { render } from 'preact';\nimport BasePlugin from './BasePlugin.js';\n/**\n * Defer a frequent call to the microtask queue.\n */\nfunction debounce(fn) {\n    let calling = null;\n    let latestArgs;\n    return (...args) => {\n        latestArgs = args;\n        if (!calling) {\n            calling = Promise.resolve().then(() => {\n                calling = null;\n                // At this point `args` may be different from the most\n                // recent state, if multiple calls happened since this task\n                // was queued. So we use the `latestArgs`, which definitely\n                // is the most recent call.\n                return fn(...latestArgs);\n            });\n        }\n        return calling;\n    };\n}\n/**\n * UIPlugin is the extended version of BasePlugin to incorporate rendering with Preact.\n * Use this for plugins that need a user interface.\n *\n * For plugins without an user interface, see BasePlugin.\n */\nclass UIPlugin extends BasePlugin {\n    #updateUI;\n    isTargetDOMEl;\n    el;\n    parent;\n    title;\n    getTargetPlugin(target) {\n        let targetPlugin;\n        if (typeof target?.addTarget === 'function') {\n            // Targeting a plugin *instance*\n            targetPlugin = target;\n            if (!(targetPlugin instanceof UIPlugin)) {\n                console.warn(new Error('The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.', { cause: { targetPlugin, UIPlugin } }));\n            }\n        }\n        else if (typeof target === 'function') {\n            // Targeting a plugin type\n            const Target = target;\n            // Find the target plugin instance.\n            this.uppy.iteratePlugins((p) => {\n                if (p instanceof Target) {\n                    targetPlugin = p;\n                }\n            });\n        }\n        return targetPlugin;\n    }\n    /**\n     * Check if supplied `target` is a DOM element or an `object`.\n     * If it\u2019s an object \u2014 target is a plugin, and we search `plugins`\n     * for a plugin with same name and return its target.\n     */\n    mount(target, plugin) {\n        const callerPluginName = plugin.id;\n        const targetElement = findDOMElement(target);\n        if (targetElement) {\n            this.isTargetDOMEl = true;\n            // When target is <body> with a single <div> element,\n            // Preact thinks it\u2019s the Uppy root element in there when doing a diff,\n            // and destroys it. So we are creating a fragment (could be empty div)\n            const uppyRootElement = document.createElement('div');\n            uppyRootElement.classList.add('uppy-Root');\n            // API for plugins that require a synchronous rerender.\n            this.#updateUI = debounce((state) => {\n                // plugin could be removed, but this.rerender is debounced below,\n                // so it could still be called even after uppy.removePlugin or uppy.destroy\n                // hence the check\n                if (!this.uppy.getPlugin(this.id))\n                    return;\n                render(this.render(state, uppyRootElement), uppyRootElement);\n                this.afterUpdate();\n            });\n            this.uppy.log(`Installing ${callerPluginName} to a DOM element '${target}'`);\n            if (this.opts.replaceTargetContent) {\n                // Doing render(h(null), targetElement), which should have been\n                // a better way, since because the component might need to do additional cleanup when it is removed,\n                // stopped working \u2014 Preact just adds null into target, not replacing\n                targetElement.innerHTML = '';\n            }\n            render(this.render(this.uppy.getState(), uppyRootElement), uppyRootElement);\n            this.el = uppyRootElement;\n            targetElement.appendChild(uppyRootElement);\n            // Set the text direction if the page has not defined one.\n            uppyRootElement.dir =\n                this.opts.direction || getTextDirection(uppyRootElement) || 'ltr';\n            this.onMount();\n            return this.el;\n        }\n        const targetPlugin = this.getTargetPlugin(target);\n        if (targetPlugin) {\n            this.uppy.log(`Installing ${callerPluginName} to ${targetPlugin.id}`);\n            this.parent = targetPlugin;\n            this.el = targetPlugin.addTarget(plugin);\n            this.onMount();\n            return this.el;\n        }\n        this.uppy.log(`Not installing ${callerPluginName}`);\n        let message = `Invalid target option given to ${callerPluginName}.`;\n        if (typeof target === 'function') {\n            message +=\n                ' The given target is not a Plugin class. ' +\n                    \"Please check that you're not specifying a React Component instead of a plugin. \" +\n                    'If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: ' +\n                    'run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.';\n        }\n        else {\n            message +=\n                'If you meant to target an HTML element, please make sure that the element exists. ' +\n                    'Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. ' +\n                    '(see https://github.com/transloadit/uppy/issues/1042)\\n\\n' +\n                    'If you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.';\n        }\n        throw new Error(message);\n    }\n    /**\n     * Called when plugin is mounted, whether in DOM or into another plugin.\n     * Needed because sometimes plugins are mounted separately/after `install`,\n     * so this.el and this.parent might not be available in `install`.\n     * This is the case with @uppy/react plugins, for example.\n     */\n    render(state, container) {\n        throw new Error('Extend the render method to add your plugin to a DOM element');\n    }\n    update(state) {\n        if (this.el != null) {\n            this.#updateUI?.(state);\n        }\n    }\n    unmount() {\n        if (this.isTargetDOMEl) {\n            this.el?.remove();\n        }\n        this.onUnmount();\n    }\n    onMount() { }\n    onUnmount() { }\n}\nexport default UIPlugin;\n", "{\n  \"name\": \"@uppy/store-default\",\n  \"description\": \"The default simple object-based store for Uppy.\",\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"lib/index.js\",\n  \"type\": \"module\",\n  \"sideEffects\": false,\n  \"scripts\": {\n    \"build\": \"tsc --build tsconfig.build.json\",\n    \"typecheck\": \"tsc --build\",\n    \"test\": \"vitest run --environment=jsdom --silent='passed-only'\"\n  },\n  \"keywords\": [\n    \"file uploader\",\n    \"uppy\",\n    \"uppy-store\"\n  ],\n  \"homepage\": \"https://uppy.io\",\n  \"bugs\": {\n    \"url\": \"https://github.com/transloadit/uppy/issues\"\n  },\n  \"devDependencies\": {\n    \"jsdom\": \"^26.1.0\",\n    \"typescript\": \"^5.8.3\",\n    \"vitest\": \"^3.2.4\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/transloadit/uppy.git\"\n  },\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./package.json\": \"./package.json\"\n  },\n  \"files\": [\n    \"src\",\n    \"lib\",\n    \"dist\",\n    \"CHANGELOG.md\"\n  ]\n}", "import packageJson from '../package.json' with { type: 'json' };\n/**\n * Default store that keeps state in a simple object.\n */\nclass DefaultStore {\n    static VERSION = packageJson.version;\n    state = {};\n    #callbacks = new Set();\n    getState() {\n        return this.state;\n    }\n    setState(patch) {\n        const prevState = { ...this.state };\n        const nextState = { ...this.state, ...patch };\n        this.state = nextState;\n        this.#publish(prevState, nextState, patch);\n    }\n    subscribe(listener) {\n        this.#callbacks.add(listener);\n        return () => {\n            this.#callbacks.delete(listener);\n        };\n    }\n    #publish(...args) {\n        this.#callbacks.forEach((listener) => {\n            listener(...args);\n        });\n    }\n}\nexport default DefaultStore;\n", "/* global AggregateError */\nimport DefaultStore, {} from '@uppy/store-default';\nimport { getFileNameAndExtension, getFileType, getSafeFileId, Translator, } from '@uppy/utils';\nimport throttle from 'lodash/throttle.js';\n// @ts-ignore untyped\nimport ee from 'namespace-emitter';\nimport { nanoid } from 'nanoid/non-secure';\nimport packageJson from '../package.json' with { type: 'json' };\nimport getFileName from './getFileName.js';\nimport locale from './locale.js';\nimport { debugLogger, justErrorsLogger } from './loggers.js';\nimport { defaultOptions as defaultRestrictionOptions, Restricter, RestrictionError, } from './Restricter.js';\nimport supportsUploadProgress from './supportsUploadProgress.js';\nconst defaultUploadState = {\n    totalProgress: 0,\n    allowNewUpload: true,\n    error: null,\n    recoveredState: null,\n};\n/**\n * Uppy Core module.\n * Manages plugins, state updates, acts as an event bus,\n * adds/removes files and metadata.\n */\nexport class Uppy {\n    static VERSION = packageJson.version;\n    #plugins = Object.create(null);\n    #restricter;\n    #storeUnsubscribe;\n    #emitter = ee();\n    #preProcessors = new Set();\n    #uploaders = new Set();\n    #postProcessors = new Set();\n    defaultLocale;\n    locale;\n    // The user optionally passes in options, but we set defaults for missing options.\n    // We consider all options present after the contructor has run.\n    opts;\n    store;\n    // Warning: do not use this from a plugin, as it will cause the plugins' translations to be missing\n    i18n;\n    i18nArray;\n    scheduledAutoProceed = null;\n    wasOffline = false;\n    /**\n     * Instantiate Uppy\n     */\n    constructor(opts) {\n        this.defaultLocale = locale;\n        const defaultOptions = {\n            id: 'uppy',\n            autoProceed: false,\n            allowMultipleUploadBatches: true,\n            debug: false,\n            restrictions: defaultRestrictionOptions,\n            meta: {},\n            onBeforeFileAdded: (file, files) => !Object.hasOwn(files, file.id),\n            onBeforeUpload: (files) => files,\n            store: new DefaultStore(),\n            logger: justErrorsLogger,\n            infoTimeout: 5000,\n        };\n        const merged = { ...defaultOptions, ...opts };\n        // Merge default options with the ones set by user,\n        // making sure to merge restrictions too\n        this.opts = {\n            ...merged,\n            restrictions: {\n                ...defaultOptions.restrictions,\n                ...opts?.restrictions,\n            },\n        };\n        // Support debug: true for backwards-compatability, unless logger is set in opts\n        // opts instead of this.opts to avoid comparing objects \u2014 we set logger: justErrorsLogger in defaultOptions\n        if (opts?.logger && opts.debug) {\n            this.log('You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.', 'warning');\n        }\n        else if (opts?.debug) {\n            this.opts.logger = debugLogger;\n        }\n        this.log(`Using Core v${Uppy.VERSION}`);\n        this.i18nInit();\n        this.store = this.opts.store;\n        this.setState({\n            ...defaultUploadState,\n            plugins: {},\n            files: {},\n            currentUploads: {},\n            capabilities: {\n                uploadProgress: supportsUploadProgress(),\n                individualCancellation: true,\n                resumableUploads: false,\n            },\n            meta: { ...this.opts.meta },\n            info: [],\n        });\n        this.#restricter = new Restricter(() => this.opts, () => this.i18n);\n        this.#storeUnsubscribe = this.store.subscribe((prevState, nextState, patch) => {\n            this.emit('state-update', prevState, nextState, patch);\n            this.updateAll(nextState);\n        });\n        // Exposing uppy object on window for debugging and testing\n        if (this.opts.debug && typeof window !== 'undefined') {\n            // @ts-ignore Mutating the global object for debug purposes\n            window[this.opts.id] = this;\n        }\n        this.#addListeners();\n    }\n    emit(event, ...args) {\n        this.#emitter.emit(event, ...args);\n    }\n    on(event, callback) {\n        this.#emitter.on(event, callback);\n        return this;\n    }\n    once(event, callback) {\n        this.#emitter.once(event, callback);\n        return this;\n    }\n    off(event, callback) {\n        this.#emitter.off(event, callback);\n        return this;\n    }\n    /**\n     * Iterate on all plugins and run `update` on them.\n     * Called each time state changes.\n     *\n     */\n    updateAll(state) {\n        this.iteratePlugins((plugin) => {\n            plugin.update(state);\n        });\n    }\n    /**\n     * Updates state with a patch\n     */\n    setState(patch) {\n        this.store.setState(patch);\n    }\n    /**\n     * Returns current state.\n     */\n    getState() {\n        return this.store.getState();\n    }\n    patchFilesState(filesWithNewState) {\n        const existingFilesState = this.getState().files;\n        this.setState({\n            files: {\n                ...existingFilesState,\n                ...Object.fromEntries(Object.entries(filesWithNewState).map(([fileID, newFileState]) => [\n                    fileID,\n                    {\n                        ...existingFilesState[fileID],\n                        ...newFileState,\n                    },\n                ])),\n            },\n        });\n    }\n    /**\n     * Shorthand to set state for a specific file.\n     */\n    setFileState(fileID, state) {\n        if (!this.getState().files[fileID]) {\n            throw new Error(`Can\u2019t set state for ${fileID} (the file could have been removed)`);\n        }\n        this.patchFilesState({ [fileID]: state });\n    }\n    i18nInit() {\n        const onMissingKey = (key) => this.log(`Missing i18n string: ${key}`, 'error');\n        const translator = new Translator([this.defaultLocale, this.opts.locale], {\n            onMissingKey,\n        });\n        this.i18n = translator.translate.bind(translator);\n        this.i18nArray = translator.translateArray.bind(translator);\n        this.locale = translator.locale;\n    }\n    setOptions(newOpts) {\n        this.opts = {\n            ...this.opts,\n            ...newOpts,\n            restrictions: {\n                ...this.opts.restrictions,\n                ...newOpts?.restrictions,\n            },\n        };\n        if (newOpts.meta) {\n            this.setMeta(newOpts.meta);\n        }\n        this.i18nInit();\n        if (newOpts.locale) {\n            this.iteratePlugins((plugin) => {\n                plugin.setOptions(newOpts);\n            });\n        }\n        // Note: this is not the preact `setState`, it's an internal function that has the same name.\n        this.setState(undefined); // so that UI re-renders with new options\n    }\n    resetProgress() {\n        const defaultProgress = {\n            percentage: 0,\n            bytesUploaded: false,\n            uploadComplete: false,\n            uploadStarted: null,\n        };\n        const files = { ...this.getState().files };\n        const updatedFiles = Object.create(null);\n        Object.keys(files).forEach((fileID) => {\n            updatedFiles[fileID] = {\n                ...files[fileID],\n                progress: {\n                    ...files[fileID].progress,\n                    ...defaultProgress,\n                },\n                // @ts-expect-error these typed are inserted\n                // into the namespace in their respective packages\n                // but core isn't ware of those\n                tus: undefined,\n                transloadit: undefined,\n            };\n        });\n        this.setState({ files: updatedFiles, ...defaultUploadState });\n    }\n    clear() {\n        const { capabilities, currentUploads } = this.getState();\n        if (Object.keys(currentUploads).length > 0 &&\n            !capabilities.individualCancellation) {\n            throw new Error('The installed uploader plugin does not allow removing files during an upload.');\n        }\n        this.setState({ ...defaultUploadState, files: {} });\n    }\n    addPreProcessor(fn) {\n        this.#preProcessors.add(fn);\n    }\n    removePreProcessor(fn) {\n        return this.#preProcessors.delete(fn);\n    }\n    addPostProcessor(fn) {\n        this.#postProcessors.add(fn);\n    }\n    removePostProcessor(fn) {\n        return this.#postProcessors.delete(fn);\n    }\n    addUploader(fn) {\n        this.#uploaders.add(fn);\n    }\n    removeUploader(fn) {\n        return this.#uploaders.delete(fn);\n    }\n    setMeta(data) {\n        const updatedMeta = { ...this.getState().meta, ...data };\n        const updatedFiles = { ...this.getState().files };\n        Object.keys(updatedFiles).forEach((fileID) => {\n            updatedFiles[fileID] = {\n                ...updatedFiles[fileID],\n                meta: { ...updatedFiles[fileID].meta, ...data },\n            };\n        });\n        this.log('Adding metadata:');\n        this.log(data);\n        this.setState({\n            meta: updatedMeta,\n            files: updatedFiles,\n        });\n    }\n    setFileMeta(fileID, data) {\n        const updatedFiles = { ...this.getState().files };\n        if (!updatedFiles[fileID]) {\n            this.log(`Was trying to set metadata for a file that has been removed: ${fileID}`);\n            return;\n        }\n        const newMeta = { ...updatedFiles[fileID].meta, ...data };\n        updatedFiles[fileID] = { ...updatedFiles[fileID], meta: newMeta };\n        this.setState({ files: updatedFiles });\n    }\n    /**\n     * Get a file object.\n     */\n    getFile(fileID) {\n        return this.getState().files[fileID];\n    }\n    /**\n     * Get all files in an array.\n     */\n    getFiles() {\n        const { files } = this.getState();\n        return Object.values(files);\n    }\n    getFilesByIds(ids) {\n        return ids.map((id) => this.getFile(id));\n    }\n    getObjectOfFilesPerState() {\n        const { files: filesObject, totalProgress, error } = this.getState();\n        const files = Object.values(filesObject);\n        const inProgressFiles = [];\n        const newFiles = [];\n        const startedFiles = [];\n        const uploadStartedFiles = [];\n        const pausedFiles = [];\n        const completeFiles = [];\n        const erroredFiles = [];\n        const inProgressNotPausedFiles = [];\n        const processingFiles = [];\n        for (const file of files) {\n            const { progress } = file;\n            if (!progress.uploadComplete && progress.uploadStarted) {\n                inProgressFiles.push(file);\n                if (!file.isPaused) {\n                    inProgressNotPausedFiles.push(file);\n                }\n            }\n            if (!progress.uploadStarted) {\n                newFiles.push(file);\n            }\n            if (progress.uploadStarted ||\n                progress.preprocess ||\n                progress.postprocess) {\n                startedFiles.push(file);\n            }\n            if (progress.uploadStarted) {\n                uploadStartedFiles.push(file);\n            }\n            if (file.isPaused) {\n                pausedFiles.push(file);\n            }\n            if (progress.uploadComplete) {\n                completeFiles.push(file);\n            }\n            if (file.error) {\n                erroredFiles.push(file);\n            }\n            if (progress.preprocess || progress.postprocess) {\n                processingFiles.push(file);\n            }\n        }\n        return {\n            newFiles,\n            startedFiles,\n            uploadStartedFiles,\n            pausedFiles,\n            completeFiles,\n            erroredFiles,\n            inProgressFiles,\n            inProgressNotPausedFiles,\n            processingFiles,\n            isUploadStarted: uploadStartedFiles.length > 0,\n            isAllComplete: totalProgress === 100 &&\n                completeFiles.length === files.length &&\n                processingFiles.length === 0,\n            isAllErrored: !!error && erroredFiles.length === files.length,\n            isAllPaused: inProgressFiles.length !== 0 &&\n                pausedFiles.length === inProgressFiles.length,\n            isUploadInProgress: inProgressFiles.length > 0,\n            isSomeGhost: files.some((file) => file.isGhost),\n        };\n    }\n    #informAndEmit(errors) {\n        for (const error of errors) {\n            if (error.isRestriction) {\n                this.emit('restriction-failed', error.file, error);\n            }\n            else {\n                this.emit('error', error, error.file);\n            }\n            this.log(error, 'warning');\n        }\n        const userFacingErrors = errors.filter((error) => error.isUserFacing);\n        // don't flood the user: only show the first 4 toasts\n        const maxNumToShow = 4;\n        const firstErrors = userFacingErrors.slice(0, maxNumToShow);\n        const additionalErrors = userFacingErrors.slice(maxNumToShow);\n        firstErrors.forEach(({ message, details = '' }) => {\n            this.info({ message, details }, 'error', this.opts.infoTimeout);\n        });\n        if (additionalErrors.length > 0) {\n            this.info({\n                message: this.i18n('additionalRestrictionsFailed', {\n                    count: additionalErrors.length,\n                }),\n            });\n        }\n    }\n    validateRestrictions(file, files = this.getFiles()) {\n        try {\n            this.#restricter.validate(files, [file]);\n        }\n        catch (err) {\n            return err;\n        }\n        return null;\n    }\n    validateSingleFile(file) {\n        try {\n            this.#restricter.validateSingleFile(file);\n        }\n        catch (err) {\n            return err.message;\n        }\n        return null;\n    }\n    validateAggregateRestrictions(files) {\n        const existingFiles = this.getFiles();\n        try {\n            this.#restricter.validateAggregateRestrictions(existingFiles, files);\n        }\n        catch (err) {\n            return err.message;\n        }\n        return null;\n    }\n    #checkRequiredMetaFieldsOnFile(file) {\n        const { missingFields, error } = this.#restricter.getMissingRequiredMetaFields(file);\n        if (missingFields.length > 0) {\n            this.setFileState(file.id, {\n                missingRequiredMetaFields: missingFields,\n                error: error.message,\n            });\n            this.log(error.message);\n            this.emit('restriction-failed', file, error);\n            return false;\n        }\n        if (missingFields.length === 0 && file.missingRequiredMetaFields) {\n            this.setFileState(file.id, {\n                missingRequiredMetaFields: [],\n            });\n        }\n        return true;\n    }\n    #checkRequiredMetaFields(files) {\n        let success = true;\n        for (const file of Object.values(files)) {\n            if (!this.#checkRequiredMetaFieldsOnFile(file)) {\n                success = false;\n            }\n        }\n        return success;\n    }\n    #assertNewUploadAllowed(file) {\n        const { allowNewUpload } = this.getState();\n        if (allowNewUpload === false) {\n            const error = new RestrictionError(this.i18n('noMoreFilesAllowed'), {\n                file,\n            });\n            this.#informAndEmit([error]);\n            throw error;\n        }\n    }\n    checkIfFileAlreadyExists(fileID) {\n        const { files } = this.getState();\n        if (files[fileID] && !files[fileID].isGhost) {\n            return true;\n        }\n        return false;\n    }\n    /**\n     * Create a file state object based on user-provided `addFile()` options.\n     */\n    #transformFile(fileDescriptorOrFile) {\n        // Uppy expects files in { name, type, size, data } format.\n        // If the actual File object is passed from input[type=file] or drag-drop,\n        // we normalize it to match Uppy file object\n        const file = fileDescriptorOrFile instanceof File\n            ? {\n                name: fileDescriptorOrFile.name,\n                type: fileDescriptorOrFile.type,\n                size: fileDescriptorOrFile.size,\n                data: fileDescriptorOrFile,\n                meta: {},\n                isRemote: false,\n                source: undefined,\n                preview: undefined,\n            }\n            : fileDescriptorOrFile;\n        const fileType = getFileType(file);\n        const fileName = getFileName(fileType, file);\n        const fileExtension = getFileNameAndExtension(fileName).extension;\n        const id = getSafeFileId(file, this.getID());\n        const meta = {\n            ...file.meta,\n            name: fileName,\n            type: fileType,\n        };\n        // `null` means the size is unknown.\n        const size = Number.isFinite(file.data.size) ? file.data.size : null;\n        return {\n            source: file.source || '',\n            id,\n            name: fileName,\n            extension: fileExtension || '',\n            meta: {\n                ...this.getState().meta,\n                ...meta,\n            },\n            type: fileType,\n            progress: {\n                percentage: 0,\n                bytesUploaded: false,\n                bytesTotal: size,\n                uploadComplete: false,\n                uploadStarted: null,\n            },\n            size,\n            isGhost: false,\n            ...(file.isRemote\n                ? {\n                    isRemote: true,\n                    remote: file.remote,\n                    data: file.data,\n                }\n                : {\n                    isRemote: false,\n                    data: file.data,\n                }),\n            preview: file.preview,\n        };\n    }\n    // Schedule an upload if `autoProceed` is enabled.\n    #startIfAutoProceed() {\n        if (this.opts.autoProceed && !this.scheduledAutoProceed) {\n            this.scheduledAutoProceed = setTimeout(() => {\n                this.scheduledAutoProceed = null;\n                this.upload().catch((err) => {\n                    if (!err.isRestriction) {\n                        this.log(err.stack || err.message || err);\n                    }\n                });\n            }, 4);\n        }\n    }\n    #checkAndUpdateFileState(filesToAdd) {\n        let { files: existingFiles } = this.getState();\n        // create a copy of the files object only once\n        let nextFilesState = { ...existingFiles };\n        const validFilesToAdd = [];\n        const errors = [];\n        for (const fileToAdd of filesToAdd) {\n            try {\n                let newFile = this.#transformFile(fileToAdd);\n                this.#assertNewUploadAllowed(newFile);\n                // If a file has been recovered (Golden Retriever), but we were unable to recover its data (probably too large),\n                // users are asked to re-select these half-recovered files and then this method will be called again.\n                // In order to keep the progress, meta and everything else, we keep the existing file,\n                // but we replace `data`, and we remove `isGhost`, because the file is no longer a ghost now\n                const existingFile = existingFiles[newFile.id];\n                const isGhost = existingFile?.isGhost;\n                if (isGhost && !newFile.isRemote) {\n                    if (newFile.data == null)\n                        throw new Error('File data is missing');\n                    newFile = {\n                        ...existingFile,\n                        isGhost: false,\n                        data: newFile.data,\n                    };\n                    this.log(`Replaced the blob in the restored ghost file: ${newFile.name}, ${newFile.id}`);\n                }\n                const onBeforeFileAddedResult = this.opts.onBeforeFileAdded(newFile, nextFilesState);\n                // update state after onBeforeFileAdded\n                existingFiles = this.getState().files;\n                nextFilesState = { ...existingFiles, ...nextFilesState };\n                if (!onBeforeFileAddedResult &&\n                    this.checkIfFileAlreadyExists(newFile.id)) {\n                    throw new RestrictionError(this.i18n('noDuplicates', {\n                        fileName: newFile.name ?? this.i18n('unnamed'),\n                    }), { file: newFile });\n                }\n                // Pass through reselected files from Golden Retriever\n                if (onBeforeFileAddedResult === false && !isGhost) {\n                    // Don\u2019t show UI info for this error, as it should be done by the developer\n                    throw new RestrictionError('Cannot add the file because onBeforeFileAdded returned false.', { isUserFacing: false, file: newFile });\n                }\n                else if (typeof onBeforeFileAddedResult === 'object' &&\n                    onBeforeFileAddedResult !== null) {\n                    newFile = onBeforeFileAddedResult;\n                }\n                this.#restricter.validateSingleFile(newFile);\n                // need to add it to the new local state immediately, so we can use the state to validate the next files too\n                nextFilesState[newFile.id] = newFile;\n                validFilesToAdd.push(newFile);\n            }\n            catch (err) {\n                errors.push(err);\n            }\n        }\n        try {\n            // need to run this separately because it's much more slow, so if we run it inside the for-loop it will be very slow\n            // when many files are added\n            this.#restricter.validateAggregateRestrictions(Object.values(existingFiles), validFilesToAdd);\n        }\n        catch (err) {\n            errors.push(err);\n            // If we have any aggregate error, don't allow adding this batch\n            return {\n                nextFilesState: existingFiles,\n                validFilesToAdd: [],\n                errors,\n            };\n        }\n        return {\n            nextFilesState,\n            validFilesToAdd,\n            errors,\n        };\n    }\n    /**\n     * Add a new file to `state.files`. This will run `onBeforeFileAdded`,\n     * try to guess file type in a clever way, check file against restrictions,\n     * and start an upload if `autoProceed === true`.\n     */\n    addFile(file) {\n        const { nextFilesState, validFilesToAdd, errors } = this.#checkAndUpdateFileState([file]);\n        const restrictionErrors = errors.filter((error) => error.isRestriction);\n        this.#informAndEmit(restrictionErrors);\n        if (errors.length > 0)\n            throw errors[0];\n        this.setState({ files: nextFilesState });\n        const [firstValidFileToAdd] = validFilesToAdd;\n        this.emit('file-added', firstValidFileToAdd);\n        this.emit('files-added', validFilesToAdd);\n        this.log(`Added file: ${firstValidFileToAdd.name}, ${firstValidFileToAdd.id}, mime type: ${firstValidFileToAdd.type}`);\n        this.#startIfAutoProceed();\n        return firstValidFileToAdd.id;\n    }\n    /**\n     * Add multiple files to `state.files`. See the `addFile()` documentation.\n     *\n     * If an error occurs while adding a file, it is logged and the user is notified.\n     * This is good for UI plugins, but not for programmatic use.\n     * Programmatic users should usually still use `addFile()` on individual files.\n     */\n    addFiles(fileDescriptors) {\n        const { nextFilesState, validFilesToAdd, errors } = this.#checkAndUpdateFileState(fileDescriptors);\n        const restrictionErrors = errors.filter((error) => error.isRestriction);\n        this.#informAndEmit(restrictionErrors);\n        const nonRestrictionErrors = errors.filter((error) => !error.isRestriction);\n        if (nonRestrictionErrors.length > 0) {\n            let message = 'Multiple errors occurred while adding files:\\n';\n            nonRestrictionErrors.forEach((subError) => {\n                message += `\\n * ${subError.message}`;\n            });\n            this.info({\n                message: this.i18n('addBulkFilesFailed', {\n                    smart_count: nonRestrictionErrors.length,\n                }),\n                details: message,\n            }, 'error', this.opts.infoTimeout);\n            if (typeof AggregateError === 'function') {\n                throw new AggregateError(nonRestrictionErrors, message);\n            }\n            else {\n                const err = new Error(message);\n                // @ts-expect-error fallback when AggregateError is not available\n                err.errors = nonRestrictionErrors;\n                throw err;\n            }\n        }\n        // OK, we haven't thrown an error, we can start updating state and emitting events now:\n        this.setState({ files: nextFilesState });\n        validFilesToAdd.forEach((file) => {\n            this.emit('file-added', file);\n        });\n        this.emit('files-added', validFilesToAdd);\n        if (validFilesToAdd.length > 5) {\n            this.log(`Added batch of ${validFilesToAdd.length} files`);\n        }\n        else {\n            Object.values(validFilesToAdd).forEach((file) => {\n                this.log(`Added file: ${file.name}\\n id: ${file.id}\\n type: ${file.type}`);\n            });\n        }\n        if (validFilesToAdd.length > 0) {\n            this.#startIfAutoProceed();\n        }\n    }\n    removeFiles(fileIDs) {\n        const { files, currentUploads } = this.getState();\n        const updatedFiles = { ...files };\n        const updatedUploads = { ...currentUploads };\n        const removedFiles = Object.create(null);\n        fileIDs.forEach((fileID) => {\n            if (files[fileID]) {\n                removedFiles[fileID] = files[fileID];\n                delete updatedFiles[fileID];\n            }\n        });\n        // Remove files from the `fileIDs` list in each upload.\n        function fileIsNotRemoved(uploadFileID) {\n            return removedFiles[uploadFileID] === undefined;\n        }\n        Object.keys(updatedUploads).forEach((uploadID) => {\n            const newFileIDs = currentUploads[uploadID].fileIDs.filter(fileIsNotRemoved);\n            // Remove the upload if no files are associated with it anymore.\n            if (newFileIDs.length === 0) {\n                delete updatedUploads[uploadID];\n                return;\n            }\n            const { capabilities } = this.getState();\n            if (newFileIDs.length !== currentUploads[uploadID].fileIDs.length &&\n                !capabilities.individualCancellation) {\n                throw new Error('The installed uploader plugin does not allow removing files during an upload.');\n            }\n            updatedUploads[uploadID] = {\n                ...currentUploads[uploadID],\n                fileIDs: newFileIDs,\n            };\n        });\n        const stateUpdate = {\n            currentUploads: updatedUploads,\n            files: updatedFiles,\n        };\n        // If all files were removed - allow new uploads,\n        // and clear recoveredState\n        if (Object.keys(updatedFiles).length === 0) {\n            stateUpdate.allowNewUpload = true;\n            stateUpdate.error = null;\n            stateUpdate.recoveredState = null;\n        }\n        this.setState(stateUpdate);\n        this.#updateTotalProgressThrottled();\n        const removedFileIDs = Object.keys(removedFiles);\n        removedFileIDs.forEach((fileID) => {\n            this.emit('file-removed', removedFiles[fileID]);\n        });\n        if (removedFileIDs.length > 5) {\n            this.log(`Removed ${removedFileIDs.length} files`);\n        }\n        else {\n            this.log(`Removed files: ${removedFileIDs.join(', ')}`);\n        }\n    }\n    removeFile(fileID) {\n        this.removeFiles([fileID]);\n    }\n    pauseResume(fileID) {\n        if (!this.getState().capabilities.resumableUploads ||\n            this.getFile(fileID).progress.uploadComplete) {\n            return undefined;\n        }\n        const file = this.getFile(fileID);\n        const wasPaused = file.isPaused || false;\n        const isPaused = !wasPaused;\n        this.setFileState(fileID, {\n            isPaused,\n        });\n        this.emit('upload-pause', file, isPaused);\n        return isPaused;\n    }\n    pauseAll() {\n        const updatedFiles = { ...this.getState().files };\n        const inProgressUpdatedFiles = Object.keys(updatedFiles).filter((file) => {\n            return (!updatedFiles[file].progress.uploadComplete &&\n                updatedFiles[file].progress.uploadStarted);\n        });\n        inProgressUpdatedFiles.forEach((file) => {\n            const updatedFile = { ...updatedFiles[file], isPaused: true };\n            updatedFiles[file] = updatedFile;\n        });\n        this.setState({ files: updatedFiles });\n        this.emit('pause-all');\n    }\n    resumeAll() {\n        const updatedFiles = { ...this.getState().files };\n        const inProgressUpdatedFiles = Object.keys(updatedFiles).filter((file) => {\n            return (!updatedFiles[file].progress.uploadComplete &&\n                updatedFiles[file].progress.uploadStarted);\n        });\n        inProgressUpdatedFiles.forEach((file) => {\n            const updatedFile = {\n                ...updatedFiles[file],\n                isPaused: false,\n                error: null,\n            };\n            updatedFiles[file] = updatedFile;\n        });\n        this.setState({ files: updatedFiles });\n        this.emit('resume-all');\n    }\n    #getFilesToRetry() {\n        const { files } = this.getState();\n        return Object.keys(files).filter((fileId) => {\n            const file = files[fileId];\n            // Only retry files that have errors AND don't have missing required metadata\n            return (file.error &&\n                (!file.missingRequiredMetaFields ||\n                    file.missingRequiredMetaFields.length === 0));\n        });\n    }\n    async #doRetryAll() {\n        const filesToRetry = this.#getFilesToRetry();\n        const updatedFiles = { ...this.getState().files };\n        filesToRetry.forEach((fileID) => {\n            updatedFiles[fileID] = {\n                ...updatedFiles[fileID],\n                isPaused: false,\n                error: null,\n            };\n        });\n        this.setState({\n            files: updatedFiles,\n            error: null,\n        });\n        this.emit('retry-all', this.getFilesByIds(filesToRetry));\n        if (filesToRetry.length === 0) {\n            return {\n                successful: [],\n                failed: [],\n            };\n        }\n        const uploadID = this.#createUpload(filesToRetry, {\n            forceAllowNewUpload: true, // create new upload even if allowNewUpload: false\n        });\n        return this.#runUpload(uploadID);\n    }\n    async retryAll() {\n        const result = await this.#doRetryAll();\n        this.emit('complete', result);\n        return result;\n    }\n    cancelAll() {\n        this.emit('cancel-all');\n        const { files } = this.getState();\n        const fileIDs = Object.keys(files);\n        if (fileIDs.length) {\n            this.removeFiles(fileIDs);\n        }\n        this.setState(defaultUploadState);\n    }\n    /**\n     * Retry a specific file that has errored.\n     */\n    retryUpload(fileID) {\n        this.setFileState(fileID, {\n            error: null,\n            isPaused: false,\n        });\n        this.emit('upload-retry', this.getFile(fileID));\n        const uploadID = this.#createUpload([fileID], {\n            forceAllowNewUpload: true, // create new upload even if allowNewUpload: false\n        });\n        return this.#runUpload(uploadID);\n    }\n    logout() {\n        this.iteratePlugins((plugin) => {\n            ;\n            plugin.provider?.logout?.();\n        });\n    }\n    #handleUploadProgress = (file, progress) => {\n        const fileInState = file ? this.getFile(file.id) : undefined;\n        if (file == null || !fileInState) {\n            this.log(`Not setting progress for a file that has been removed: ${file?.id}`);\n            return;\n        }\n        if (fileInState.progress.percentage === 100) {\n            this.log(`Not setting progress for a file that has been already uploaded: ${file.id}`);\n            return;\n        }\n        const newProgress = {\n            bytesTotal: progress.bytesTotal,\n            // bytesTotal may be null or zero; in that case we can't divide by it\n            percentage: progress.bytesTotal != null &&\n                Number.isFinite(progress.bytesTotal) &&\n                progress.bytesTotal > 0\n                ? Math.round((progress.bytesUploaded / progress.bytesTotal) * 100)\n                : undefined,\n        };\n        if (fileInState.progress.uploadStarted != null) {\n            this.setFileState(file.id, {\n                progress: {\n                    ...fileInState.progress,\n                    ...newProgress,\n                    bytesUploaded: progress.bytesUploaded,\n                },\n            });\n        }\n        else {\n            this.setFileState(file.id, {\n                progress: {\n                    ...fileInState.progress,\n                    ...newProgress,\n                },\n            });\n        }\n        this.#updateTotalProgressThrottled();\n    };\n    #updateTotalProgress() {\n        const totalProgress = this.#calculateTotalProgress();\n        let totalProgressPercent = null;\n        if (totalProgress != null) {\n            totalProgressPercent = Math.round(totalProgress * 100);\n            if (totalProgressPercent > 100)\n                totalProgressPercent = 100;\n            else if (totalProgressPercent < 0)\n                totalProgressPercent = 0;\n        }\n        this.emit('progress', totalProgressPercent ?? 0);\n        this.setState({\n            totalProgress: totalProgressPercent ?? 0,\n        });\n    }\n    // ___Why throttle at 500ms?\n    //    - We must throttle at >250ms for superfocus in Dashboard to work well\n    //    (because animation takes 0.25s, and we want to wait for all animations to be over before refocusing).\n    //    [Practical Check]: if thottle is at 100ms, then if you are uploading a file,\n    //    and click 'ADD MORE FILES', - focus won't activate in Firefox.\n    //    - We must throttle at around >500ms to avoid performance lags.\n    //    [Practical Check] Firefox, try to upload a big file for a prolonged period of time. Laptop will start to heat up.\n    #updateTotalProgressThrottled = throttle(() => this.#updateTotalProgress(), 500, { leading: true, trailing: true });\n    [Symbol.for('uppy test: updateTotalProgress')]() {\n        return this.#updateTotalProgress();\n    }\n    #calculateTotalProgress() {\n        // calculate total progress, using the number of files currently uploading,\n        // between 0 and 1 and sum of individual progress of each file\n        const files = this.getFiles();\n        // note: also includes files that have completed uploading:\n        const filesInProgress = files.filter((file) => {\n            return (file.progress.uploadStarted ||\n                file.progress.preprocess ||\n                file.progress.postprocess);\n        });\n        if (filesInProgress.length === 0) {\n            return 0;\n        }\n        if (filesInProgress.every((file) => file.progress.uploadComplete)) {\n            // If every uploading file is complete, and we're still getting progress, it probably means\n            // there's a bug somewhere in some progress reporting code (maybe not even our code)\n            // and we're still getting progress, so let's just assume it means a 100% progress\n            return 1;\n        }\n        const isSizedFile = (file) => file.progress.bytesTotal != null && file.progress.bytesTotal !== 0;\n        const sizedFilesInProgress = filesInProgress.filter(isSizedFile);\n        const unsizedFilesInProgress = filesInProgress.filter((file) => !isSizedFile(file));\n        if (sizedFilesInProgress.every((file) => file.progress.uploadComplete) &&\n            unsizedFilesInProgress.length > 0 &&\n            !unsizedFilesInProgress.every((file) => file.progress.uploadComplete)) {\n            // we are done with uploading all files of known size, however\n            // there is at least one file with unknown size still uploading,\n            // and we cannot say anything about their progress\n            // In any case, return null because it doesn't make any sense to show a progress\n            return null;\n        }\n        const totalFilesSize = sizedFilesInProgress.reduce((acc, file) => acc + (file.progress.bytesTotal ?? 0), 0);\n        const totalUploadedSize = sizedFilesInProgress.reduce((acc, file) => acc + (file.progress.bytesUploaded || 0), 0);\n        return totalFilesSize === 0 ? 0 : totalUploadedSize / totalFilesSize;\n    }\n    /**\n     * Registers listeners for all global actions, like:\n     * `error`, `file-removed`, `upload-progress`\n     */\n    #addListeners() {\n        // Type inference only works for inline functions so we have to type it again\n        const errorHandler = (error, file, response) => {\n            let errorMsg = error.message || 'Unknown error';\n            if (error.details) {\n                errorMsg += ` ${error.details}`;\n            }\n            this.setState({ error: errorMsg });\n            if (file != null && file.id in this.getState().files) {\n                this.setFileState(file.id, {\n                    error: errorMsg,\n                    response,\n                });\n            }\n        };\n        this.on('error', errorHandler);\n        this.on('upload-error', (file, error, response) => {\n            errorHandler(error, file, response);\n            if (typeof error === 'object' && error.message) {\n                this.log(error.message, 'error');\n                const newError = new Error(this.i18n('failedToUpload', { file: file?.name ?? '' })); // we may want a new custom error here\n                newError.isUserFacing = true; // todo maybe don't do this with all errors?\n                newError.details = error.message;\n                if (error.details) {\n                    newError.details += ` ${error.details}`;\n                }\n                this.#informAndEmit([newError]);\n            }\n            else {\n                this.#informAndEmit([error]);\n            }\n        });\n        let uploadStalledWarningRecentlyEmitted = null;\n        this.on('upload-stalled', (error, files) => {\n            const { message } = error;\n            const details = files.map((file) => file.meta.name).join(', ');\n            if (!uploadStalledWarningRecentlyEmitted) {\n                this.info({ message, details }, 'warning', this.opts.infoTimeout);\n                uploadStalledWarningRecentlyEmitted = setTimeout(() => {\n                    uploadStalledWarningRecentlyEmitted = null;\n                }, this.opts.infoTimeout);\n            }\n            this.log(`${message} ${details}`.trim(), 'warning');\n        });\n        this.on('upload', () => {\n            this.setState({ error: null });\n        });\n        const onUploadStarted = (files) => {\n            const filesFiltered = files.filter((file) => {\n                const exists = file != null && this.getFile(file.id);\n                if (!exists)\n                    this.log(`Not setting progress for a file that has been removed: ${file?.id}`);\n                return exists;\n            });\n            const filesState = Object.fromEntries(filesFiltered.map((file) => [\n                file.id,\n                {\n                    progress: {\n                        uploadStarted: Date.now(),\n                        uploadComplete: false,\n                        bytesUploaded: 0,\n                        bytesTotal: file.size,\n                    },\n                },\n            ]));\n            this.patchFilesState(filesState);\n        };\n        this.on('upload-start', onUploadStarted);\n        this.on('upload-progress', this.#handleUploadProgress);\n        this.on('upload-success', (file, uploadResp) => {\n            if (file == null || !this.getFile(file.id)) {\n                this.log(`Not setting progress for a file that has been removed: ${file?.id}`);\n                return;\n            }\n            const currentProgress = this.getFile(file.id).progress;\n            const needsPostProcessing = this.#postProcessors.size > 0;\n            this.setFileState(file.id, {\n                progress: {\n                    ...currentProgress,\n                    postprocess: needsPostProcessing\n                        ? {\n                            mode: 'indeterminate',\n                        }\n                        : undefined,\n                    uploadComplete: true,\n                    ...(!needsPostProcessing && { complete: true }),\n                    percentage: 100,\n                    bytesUploaded: currentProgress.bytesTotal,\n                },\n                response: uploadResp,\n                uploadURL: uploadResp.uploadURL,\n                isPaused: false,\n            });\n            // Remote providers sometimes don't tell us the file size,\n            // but we can know how many bytes we uploaded once the upload is complete.\n            if (file.size == null) {\n                this.setFileState(file.id, {\n                    size: uploadResp.bytesUploaded || currentProgress.bytesTotal,\n                });\n            }\n            this.#updateTotalProgressThrottled();\n        });\n        this.on('preprocess-progress', (file, progress) => {\n            if (file == null || !this.getFile(file.id)) {\n                this.log(`Not setting progress for a file that has been removed: ${file?.id}`);\n                return;\n            }\n            this.setFileState(file.id, {\n                progress: { ...this.getFile(file.id).progress, preprocess: progress },\n            });\n        });\n        this.on('preprocess-complete', (file) => {\n            if (file == null || !this.getFile(file.id)) {\n                this.log(`Not setting progress for a file that has been removed: ${file?.id}`);\n                return;\n            }\n            const files = { ...this.getState().files };\n            files[file.id] = {\n                ...files[file.id],\n                progress: { ...files[file.id].progress },\n            };\n            delete files[file.id].progress.preprocess;\n            this.setState({ files });\n        });\n        this.on('postprocess-progress', (file, progress) => {\n            if (file == null || !this.getFile(file.id)) {\n                this.log(`Not setting progress for a file that has been removed: ${file?.id}`);\n                return;\n            }\n            this.setFileState(file.id, {\n                progress: {\n                    ...this.getState().files[file.id].progress,\n                    postprocess: progress,\n                },\n            });\n        });\n        this.on('postprocess-complete', (fileIn) => {\n            const file = fileIn && this.getFile(fileIn.id);\n            if (file == null) {\n                this.log(`Not setting progress for a file that has been removed: ${fileIn?.id}`);\n                return;\n            }\n            const { postprocess: _deleted, ...newProgress } = file.progress;\n            this.patchFilesState({\n                [file.id]: {\n                    progress: {\n                        ...newProgress,\n                        complete: true,\n                    },\n                },\n            });\n        });\n        this.on('restored', () => {\n            // Files may have changed--ensure progress is still accurate.\n            this.#updateTotalProgressThrottled();\n        });\n        // @ts-expect-error should fix itself when dashboard it typed (also this doesn't belong here)\n        this.on('dashboard:file-edit-complete', (file) => {\n            if (file) {\n                this.#checkRequiredMetaFieldsOnFile(file);\n            }\n        });\n        // show informer if offline\n        if (typeof window !== 'undefined' && window.addEventListener) {\n            window.addEventListener('online', this.#updateOnlineStatus);\n            window.addEventListener('offline', this.#updateOnlineStatus);\n            setTimeout(this.#updateOnlineStatus, 3000);\n        }\n    }\n    updateOnlineStatus() {\n        const online = window.navigator.onLine ?? true;\n        if (!online) {\n            this.emit('is-offline');\n            this.info(this.i18n('noInternetConnection'), 'error', 0);\n            this.wasOffline = true;\n        }\n        else {\n            this.emit('is-online');\n            if (this.wasOffline) {\n                this.emit('back-online');\n                this.info(this.i18n('connectedToInternet'), 'success', 3000);\n                this.wasOffline = false;\n            }\n        }\n    }\n    #updateOnlineStatus = this.updateOnlineStatus.bind(this);\n    getID() {\n        return this.opts.id;\n    }\n    /**\n     * Registers a plugin with Core.\n     */\n    use(Plugin, \n    // We want to let the plugin decide whether `opts` is optional or not\n    // so we spread the argument rather than defining `opts:` ourselves.\n    ...args) {\n        if (typeof Plugin !== 'function') {\n            const msg = `Expected a plugin class, but got ${Plugin === null ? 'null' : typeof Plugin}.` +\n                ' Please verify that the plugin was imported and spelled correctly.';\n            throw new TypeError(msg);\n        }\n        // Instantiate\n        const plugin = new Plugin(this, ...args);\n        const pluginId = plugin.id;\n        if (!pluginId) {\n            throw new Error('Your plugin must have an id');\n        }\n        if (!plugin.type) {\n            throw new Error('Your plugin must have a type');\n        }\n        const existsPluginAlready = this.getPlugin(pluginId);\n        if (existsPluginAlready) {\n            const msg = `Already found a plugin named '${existsPluginAlready.id}'. ` +\n                `Tried to use: '${pluginId}'.\\n` +\n                'Uppy plugins must have unique `id` options.';\n            throw new Error(msg);\n        }\n        // @ts-expect-error does exist\n        if (Plugin.VERSION) {\n            // @ts-expect-error does exist\n            this.log(`Using ${pluginId} v${Plugin.VERSION}`);\n        }\n        if (plugin.type in this.#plugins) {\n            this.#plugins[plugin.type].push(plugin);\n        }\n        else {\n            this.#plugins[plugin.type] = [plugin];\n        }\n        plugin.install();\n        this.emit('plugin-added', plugin);\n        return this;\n    }\n    getPlugin(id) {\n        for (const plugins of Object.values(this.#plugins)) {\n            const foundPlugin = plugins.find((plugin) => plugin.id === id);\n            if (foundPlugin != null) {\n                return foundPlugin;\n            }\n        }\n        return undefined;\n    }\n    [Symbol.for('uppy test: getPlugins')](type) {\n        return this.#plugins[type];\n    }\n    /**\n     * Iterate through all `use`d plugins.\n     *\n     */\n    iteratePlugins(method) {\n        Object.values(this.#plugins).flat(1).forEach(method);\n    }\n    /**\n     * Uninstall and remove a plugin.\n     *\n     * @param {object} instance The plugin instance to remove.\n     */\n    removePlugin(instance) {\n        this.log(`Removing plugin ${instance.id}`);\n        this.emit('plugin-remove', instance);\n        if (instance.uninstall) {\n            instance.uninstall();\n        }\n        const list = this.#plugins[instance.type];\n        // list.indexOf failed here, because Vue3 converted the plugin instance\n        // to a Proxy object, which failed the strict comparison test:\n        // obj !== objProxy\n        const index = list.findIndex((item) => item.id === instance.id);\n        if (index !== -1) {\n            list.splice(index, 1);\n        }\n        const state = this.getState();\n        const updatedState = {\n            plugins: {\n                ...state.plugins,\n                [instance.id]: undefined,\n            },\n        };\n        this.setState(updatedState);\n    }\n    /**\n     * Uninstall all plugins and close down this Uppy instance.\n     */\n    destroy() {\n        this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`);\n        this.cancelAll();\n        this.#storeUnsubscribe();\n        this.iteratePlugins((plugin) => {\n            this.removePlugin(plugin);\n        });\n        if (typeof window !== 'undefined' && window.removeEventListener) {\n            window.removeEventListener('online', this.#updateOnlineStatus);\n            window.removeEventListener('offline', this.#updateOnlineStatus);\n        }\n    }\n    hideInfo() {\n        const { info } = this.getState();\n        this.setState({ info: info.slice(1) });\n        this.emit('info-hidden');\n    }\n    /**\n     * Set info message in `state.info`, so that UI plugins like `Informer`\n     * can display the message.\n     */\n    info(message, type = 'info', duration = 3000) {\n        const isComplexMessage = typeof message === 'object';\n        this.setState({\n            info: [\n                ...this.getState().info,\n                {\n                    type,\n                    message: isComplexMessage ? message.message : message,\n                    details: isComplexMessage ? message.details : null,\n                },\n            ],\n        });\n        setTimeout(() => this.hideInfo(), duration);\n        this.emit('info-visible');\n    }\n    /**\n     * Passes messages to a function, provided in `opts.logger`.\n     * If `opts.logger: Uppy.debugLogger` or `opts.debug: true`, logs to the browser console.\n     */\n    log(message, type) {\n        const { logger } = this.opts;\n        switch (type) {\n            case 'error':\n                logger.error(message);\n                break;\n            case 'warning':\n                logger.warn(message);\n                break;\n            default:\n                logger.debug(message);\n                break;\n        }\n    }\n    // We need to store request clients by a unique ID, so we can share RequestClient instances across files\n    // this allows us to do rate limiting and synchronous operations like refreshing provider tokens\n    // example: refreshing tokens: if each file has their own requestclient,\n    // we don't have any way to synchronize all requests in order to\n    // - block all requests\n    // - refresh the token\n    // - unblock all requests and allow them to run with a the new access token\n    // back when we had a requestclient per file, once an access token expired,\n    // all 6 files would go ahead and refresh the token at the same time\n    // (calling /refresh-token up to 6 times), which will probably fail for some providers\n    #requestClientById = new Map();\n    registerRequestClient(id, client) {\n        this.#requestClientById.set(id, client);\n    }\n    /** @protected */\n    getRequestClientForFile(file) {\n        if (!('remote' in file && file.remote))\n            throw new Error(`Tried to get RequestClient for a non-remote file ${file.id}`);\n        const requestClient = this.#requestClientById.get(file.remote.requestClientId);\n        if (requestClient == null)\n            throw new Error(`requestClientId \"${file.remote.requestClientId}\" not registered for file \"${file.id}\"`);\n        return requestClient;\n    }\n    /**\n     * Restore an upload by its ID.\n     */\n    async restore(uploadID) {\n        this.log(`Core: Running restored upload \"${uploadID}\"`);\n        const result = await this.#runUpload(uploadID);\n        this.emit('complete', result);\n        return result;\n    }\n    /**\n     * Create an upload for a bunch of files.\n     *\n     */\n    #createUpload(fileIDs, opts = {}) {\n        // uppy.retryAll sets this to true \u2014 when retrying we want to ignore `allowNewUpload: false`\n        const { forceAllowNewUpload = false } = opts;\n        const { allowNewUpload, currentUploads } = this.getState();\n        if (!allowNewUpload && !forceAllowNewUpload) {\n            throw new Error('Cannot create a new upload: already uploading.');\n        }\n        const uploadID = nanoid();\n        this.emit('upload', uploadID, this.getFilesByIds(fileIDs));\n        this.setState({\n            allowNewUpload: this.opts.allowMultipleUploadBatches !== false &&\n                this.opts.allowMultipleUploads !== false,\n            currentUploads: {\n                ...currentUploads,\n                [uploadID]: {\n                    fileIDs,\n                    step: 0,\n                    result: {},\n                },\n            },\n        });\n        return uploadID;\n    }\n    [Symbol.for('uppy test: createUpload')](...args) {\n        // @ts-expect-error https://github.com/microsoft/TypeScript/issues/47595\n        return this.#createUpload(...args);\n    }\n    #getUpload(uploadID) {\n        const { currentUploads } = this.getState();\n        return currentUploads[uploadID];\n    }\n    /**\n     * Add data to an upload's result object.\n     */\n    addResultData(uploadID, data) {\n        if (!this.#getUpload(uploadID)) {\n            this.log(`Not setting result for an upload that has been removed: ${uploadID}`);\n            return;\n        }\n        const { currentUploads } = this.getState();\n        const currentUpload = {\n            ...currentUploads[uploadID],\n            result: { ...currentUploads[uploadID].result, ...data },\n        };\n        this.setState({\n            currentUploads: { ...currentUploads, [uploadID]: currentUpload },\n        });\n    }\n    /**\n     * Remove an upload, eg. if it has been canceled or completed.\n     *\n     */\n    #removeUpload(uploadID) {\n        const { [uploadID]: _deleted, ...currentUploads } = this.getState().currentUploads;\n        this.setState({\n            currentUploads,\n        });\n    }\n    /**\n     * Run an upload. This picks up where it left off in case the upload is being restored.\n     */\n    async #runUpload(uploadID) {\n        const getCurrentUpload = () => {\n            const { currentUploads } = this.getState();\n            return currentUploads[uploadID];\n        };\n        let currentUpload = getCurrentUpload();\n        if (!currentUpload) {\n            throw new Error('Nonexistent upload');\n        }\n        const steps = [\n            ...this.#preProcessors,\n            ...this.#uploaders,\n            ...this.#postProcessors,\n        ];\n        try {\n            for (let step = currentUpload.step || 0; step < steps.length; step++) {\n                const fn = steps[step];\n                this.setState({\n                    currentUploads: {\n                        ...this.getState().currentUploads,\n                        [uploadID]: {\n                            ...currentUpload,\n                            step,\n                        },\n                    },\n                });\n                const { fileIDs } = currentUpload;\n                // TODO give this the `updatedUpload` object as its only parameter maybe?\n                // Otherwise when more metadata may be added to the upload this would keep getting more parameters\n                await fn(fileIDs, uploadID);\n                // Update currentUpload value in case it was modified asynchronously.\n                currentUpload = getCurrentUpload();\n                if (!currentUpload) {\n                    break;\n                }\n            }\n        }\n        catch (err) {\n            this.#removeUpload(uploadID);\n            throw err;\n        }\n        // Set result data.\n        if (currentUpload) {\n            // Mark postprocessing step as complete if necessary; this addresses a case where we might get\n            // stuck in the postprocessing UI while the upload is fully complete.\n            // If the postprocessing steps do not do any work, they may not emit postprocessing events at\n            // all, and never mark the postprocessing as complete. This is fine on its own but we\n            // introduced code in the @uppy/core upload-success handler to prepare postprocessing progress\n            // state if any postprocessors are registered. That is to avoid a \"flash of completed state\"\n            // before the postprocessing plugins can emit events.\n            //\n            // So, just in case an upload with postprocessing plugins *has* completed *without* emitting\n            // postprocessing completion, we do it instead.\n            currentUpload.fileIDs.forEach((fileID) => {\n                const file = this.getFile(fileID);\n                if (file?.progress.postprocess) {\n                    this.emit('postprocess-complete', file);\n                }\n            });\n            const files = currentUpload.fileIDs.map((fileID) => this.getFile(fileID));\n            const successful = files.filter((file) => !file.error);\n            const failed = files.filter((file) => file.error);\n            this.addResultData(uploadID, { successful, failed, uploadID });\n            // Update currentUpload value in case it was modified asynchronously.\n            currentUpload = getCurrentUpload();\n        }\n        // Emit completion events.\n        // This is in a separate function so that the `currentUploads` variable\n        // always refers to the latest state. In the handler right above it refers\n        // to an outdated object without the `.result` property.\n        let result;\n        if (currentUpload) {\n            result = currentUpload.result;\n            this.#removeUpload(uploadID);\n        }\n        if (result == null) {\n            this.log(`Not setting result for an upload that has been removed: ${uploadID}`);\n            result = {\n                successful: [],\n                failed: [],\n                uploadID,\n            };\n        }\n        return result;\n    }\n    /**\n     * Start an upload for all the files that are not currently being uploaded.\n     */\n    async upload() {\n        if (!this.#plugins.uploader?.length) {\n            this.log('No uploader type plugins are used', 'warning');\n        }\n        let { files } = this.getState();\n        // retry any failed files from a previous upload() call\n        const filesToRetry = this.#getFilesToRetry();\n        if (filesToRetry.length > 0) {\n            const retryResult = await this.#doRetryAll(); // we don't want the complete event to fire\n            const hasNewFiles = this.getFiles().filter((file) => file.progress.uploadStarted == null)\n                .length > 0;\n            // if no new files, make it idempotent and return\n            if (!hasNewFiles) {\n                this.emit('complete', retryResult);\n                return retryResult;\n            }\n            // reload files which might have  changed after retry\n            ;\n            ({ files } = this.getState());\n        }\n        // If no files to retry, proceed with original upload() behavior for new files\n        const onBeforeUploadResult = this.opts.onBeforeUpload(files);\n        if (onBeforeUploadResult === false) {\n            throw new Error('Not starting the upload because onBeforeUpload returned false');\n        }\n        if (onBeforeUploadResult && typeof onBeforeUploadResult === 'object') {\n            files = onBeforeUploadResult;\n            // Updating files in state, because uploader plugins receive file IDs,\n            // and then fetch the actual file object from state\n            this.setState({\n                files,\n            });\n        }\n        try {\n            this.#restricter.validateMinNumberOfFiles(files);\n            if (!this.#checkRequiredMetaFields(files)) {\n                throw new RestrictionError(this.i18n('missingRequiredMetaField'));\n            }\n            const { currentUploads } = this.getState();\n            // get a list of files that are currently assigned to uploads\n            const currentlyUploadingFiles = Object.values(currentUploads).flatMap((curr) => curr.fileIDs);\n            const waitingFileIDs = Object.keys(files).filter((fileID) => {\n                const file = this.getFile(fileID);\n                // if the file hasn't started uploading and hasn't already been assigned to an upload..\n                return (file &&\n                    !file.progress.uploadStarted &&\n                    !currentlyUploadingFiles.includes(fileID));\n            });\n            const uploadID = this.#createUpload(waitingFileIDs);\n            const result = await this.#runUpload(uploadID);\n            this.emit('complete', result);\n            return result;\n        }\n        catch (err) {\n            this.#informAndEmit([err]);\n            throw err;\n        }\n    }\n}\nexport default Uppy;\n", "\nlet urlAlphabet =\n  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n\nexport let customAlphabet = (alphabet, defaultSize = 21) => {\n  return (size = defaultSize) => {\n    let id = ''\n    let i = size | 0\n    while (i-- > 0) {\n      id += alphabet[(Math.random() * alphabet.length) | 0]\n    }\n    return id\n  }\n}\n\nexport let nanoid = (size = 21) => {\n  let id = ''\n  let i = size | 0\n  while (i-- > 0) {\n    id += urlAlphabet[(Math.random() * 64) | 0]\n  }\n  return id\n}\n", "{\n  \"name\": \"@uppy/core\",\n  \"description\": \"Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:\",\n  \"version\": \"5.2.0\",\n  \"license\": \"MIT\",\n  \"style\": \"dist/style.min.css\",\n  \"type\": \"module\",\n  \"sideEffects\": [\n    \"*.css\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsc --build tsconfig.build.json\",\n    \"build:css\": \"sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css\",\n    \"typecheck\": \"tsc --build\",\n    \"test\": \"vitest run --environment=jsdom --silent='passed-only'\"\n  },\n  \"keywords\": [\n    \"file uploader\",\n    \"uppy\",\n    \"uppy-plugin\"\n  ],\n  \"homepage\": \"https://uppy.io\",\n  \"bugs\": {\n    \"url\": \"https://github.com/transloadit/uppy/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/transloadit/uppy.git\"\n  },\n  \"files\": [\n    \"src\",\n    \"lib\",\n    \"dist\",\n    \"CHANGELOG.md\"\n  ],\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./css/style.min.css\": \"./dist/style.min.css\",\n    \"./css/style.css\": \"./dist/style.css\",\n    \"./css/style.scss\": \"./src/style.scss\",\n    \"./package.json\": \"./package.json\"\n  },\n  \"dependencies\": {\n    \"@transloadit/prettier-bytes\": \"^0.3.4\",\n    \"@uppy/store-default\": \"^5.0.0\",\n    \"@uppy/utils\": \"^7.1.4\",\n    \"lodash\": \"^4.17.21\",\n    \"mime-match\": \"^1.0.2\",\n    \"namespace-emitter\": \"^2.0.1\",\n    \"nanoid\": \"^5.0.9\",\n    \"preact\": \"^10.5.13\"\n  },\n  \"devDependencies\": {\n    \"@types/deep-freeze\": \"^0\",\n    \"cssnano\": \"^7.0.7\",\n    \"deep-freeze\": \"^0.0.1\",\n    \"jsdom\": \"^26.1.0\",\n    \"postcss\": \"^8.5.6\",\n    \"postcss-cli\": \"^11.0.1\",\n    \"sass\": \"^1.89.2\",\n    \"typescript\": \"^5.8.3\",\n    \"vitest\": \"^3.2.4\"\n  }\n}", "export default function getFileName(fileType, fileDescriptor) {\n    if (fileDescriptor.name) {\n        return fileDescriptor.name;\n    }\n    if (fileType.split('/')[0] === 'image') {\n        return `${fileType.split('/')[0]}.${fileType.split('/')[1]}`;\n    }\n    return 'noname';\n}\n", "export default {\n    strings: {\n        addBulkFilesFailed: {\n            0: 'Failed to add %{smart_count} file due to an internal error',\n            1: 'Failed to add %{smart_count} files due to internal errors',\n        },\n        youCanOnlyUploadX: {\n            0: 'You can only upload %{smart_count} file',\n            1: 'You can only upload %{smart_count} files',\n        },\n        youHaveToAtLeastSelectX: {\n            0: 'You have to select at least %{smart_count} file',\n            1: 'You have to select at least %{smart_count} files',\n        },\n        aggregateExceedsSize: 'You selected %{size} of files, but maximum allowed size is %{sizeAllowed}',\n        exceedsSize: '%{file} exceeds maximum allowed size of %{size}',\n        missingRequiredMetaField: 'Missing required meta fields',\n        missingRequiredMetaFieldOnFile: 'Missing required meta fields in %{fileName}',\n        inferiorSize: 'This file is smaller than the allowed size of %{size}',\n        youCanOnlyUploadFileTypes: 'You can only upload: %{types}',\n        noMoreFilesAllowed: 'Cannot add more files',\n        noDuplicates: \"Cannot add the duplicate file '%{fileName}', it already exists\",\n        companionError: 'Connection with Companion failed',\n        authAborted: 'Authentication aborted',\n        companionUnauthorizeHint: 'To unauthorize to your %{provider} account, please go to %{url}',\n        failedToUpload: 'Failed to upload %{file}',\n        noInternetConnection: 'No Internet connection',\n        connectedToInternet: 'Connected to the Internet',\n        // Strings for remote providers\n        noFilesFound: 'You have no files or folders here',\n        noSearchResults: 'Unfortunately, there are no results for this search',\n        selectX: {\n            0: 'Select %{smart_count}',\n            1: 'Select %{smart_count}',\n        },\n        allFilesFromFolderNamed: 'All files from folder %{name}',\n        openFolderNamed: 'Open folder %{name}',\n        cancel: 'Cancel',\n        logOut: 'Log out',\n        logIn: 'Log in',\n        pickFiles: 'Pick files',\n        pickPhotos: 'Pick photos',\n        filter: 'Filter',\n        resetFilter: 'Reset filter',\n        loading: 'Loading...',\n        loadedXFiles: 'Loaded %{numFiles} files',\n        authenticateWithTitle: 'Please authenticate with %{pluginName} to select files',\n        authenticateWith: 'Connect to %{pluginName}',\n        signInWithGoogle: 'Sign in with Google',\n        searchImages: 'Search for images',\n        enterTextToSearch: 'Enter text to search for images',\n        search: 'Search',\n        resetSearch: 'Reset search',\n        emptyFolderAdded: 'No files were added from empty folder',\n        addedNumFiles: 'Added %{numFiles} file(s)',\n        folderAlreadyAdded: 'The folder \"%{folder}\" was already added',\n        folderAdded: {\n            0: 'Added %{smart_count} file from %{folder}',\n            1: 'Added %{smart_count} files from %{folder}',\n        },\n        additionalRestrictionsFailed: '%{count} additional restrictions were not fulfilled',\n        unnamed: 'Unnamed',\n        pleaseWait: 'Please wait',\n    },\n};\n", "// Edge 15.x does not fire 'progress' events on uploads.\n// See https://github.com/transloadit/uppy/issues/945\n// And https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12224510/\nexport default function supportsUploadProgress(userAgent) {\n    // Allow passing in userAgent for tests\n    if (userAgent == null && typeof navigator !== 'undefined') {\n        userAgent = navigator.userAgent;\n    }\n    // Assume it works because basically everything supports progress events.\n    if (!userAgent)\n        return true;\n    const m = /Edge\\/(\\d+\\.\\d+)/.exec(userAgent);\n    if (!m)\n        return true;\n    const edgeVersion = m[1];\n    const version = edgeVersion.split('.', 2);\n    const major = parseInt(version[0], 10);\n    const minor = parseInt(version[1], 10);\n    // Worked before:\n    // Edge 40.15063.0.0\n    // Microsoft EdgeHTML 15.15063\n    if (major < 15 || (major === 15 && minor < 15063)) {\n        return true;\n    }\n    // Fixed in:\n    // Microsoft EdgeHTML 18.18218\n    if (major > 18 || (major === 18 && minor >= 18218)) {\n        return true;\n    }\n    // other versions don't work.\n    return false;\n}\n", "{\n  \"name\": \"@uppy/xhr-upload\",\n  \"description\": \"Plain and simple classic HTML multipart form uploads with Uppy, as well as uploads using the HTTP PUT method.\",\n  \"version\": \"5.2.0\",\n  \"license\": \"MIT\",\n  \"type\": \"module\",\n  \"sideEffects\": false,\n  \"scripts\": {\n    \"build\": \"tsc --build tsconfig.build.json\",\n    \"typecheck\": \"tsc --build\",\n    \"test\": \"vitest run --silent='passed-only'\",\n    \"test:e2e\": \"vitest run --project browser\"\n  },\n  \"keywords\": [\n    \"file uploader\",\n    \"xhr\",\n    \"xhr upload\",\n    \"XMLHttpRequest\",\n    \"ajax\",\n    \"fetch\",\n    \"uppy\",\n    \"uppy-plugin\"\n  ],\n  \"homepage\": \"https://uppy.io\",\n  \"bugs\": {\n    \"url\": \"https://github.com/transloadit/uppy/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/transloadit/uppy.git\"\n  },\n  \"files\": [\n    \"src\",\n    \"lib\",\n    \"dist\",\n    \"CHANGELOG.md\"\n  ],\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./package.json\": \"./package.json\"\n  },\n  \"dependencies\": {\n    \"@uppy/companion-client\": \"^5.1.1\",\n    \"@uppy/utils\": \"^7.2.0\"\n  },\n  \"devDependencies\": {\n    \"@uppy/core\": \"^5.2.0\",\n    \"@uppy/dashboard\": \"^5.1.1\",\n    \"@vitest/browser\": \"^3.2.4\",\n    \"jsdom\": \"^26.1.0\",\n    \"msw\": \"^2.10.4\",\n    \"nock\": \"^13.1.0\",\n    \"playwright\": \"1.57.0\",\n    \"typescript\": \"^5.8.3\",\n    \"vitest\": \"^3.2.4\"\n  },\n  \"peerDependencies\": {\n    \"@uppy/core\": \"^5.2.0\"\n  }\n}", "export default {\n    strings: {\n        // Shown in the Informer if an upload is being canceled because it stalled for too long.\n        uploadStalled: 'Upload has not made any progress for %{seconds} seconds. You may want to retry it.',\n    },\n};\n", "import { BasePlugin, EventManager } from '@uppy/core';\nimport { fetcher, filterFilesToEmitUploadStarted, filterFilesToUpload, getAllowedMetaFields, isNetworkError, NetworkError, TaskQueue, } from '@uppy/utils';\nimport packageJson from '../package.json' with { type: 'json' };\nimport locale from './locale.js';\nfunction buildResponseError(xhr, err) {\n    let error = err;\n    // No error message\n    if (!error)\n        error = new Error('Upload error');\n    // Got an error message string\n    if (typeof error === 'string')\n        error = new Error(error);\n    // Got something else\n    if (!(error instanceof Error)) {\n        error = Object.assign(new Error('Upload error'), { data: error });\n    }\n    if (isNetworkError(xhr)) {\n        error = new NetworkError(error, xhr);\n        return error;\n    }\n    // @ts-expect-error request can only be set on NetworkError\n    // but we use NetworkError to distinguish between errors.\n    error.request = xhr;\n    return error;\n}\n/**\n * Set `data.type` in the blob to `file.meta.type`,\n * because we might have detected a more accurate file type in Uppy\n * https://stackoverflow.com/a/50875615\n */\nfunction setTypeInBlob(file) {\n    const dataWithUpdatedType = file.data.slice(0, file.data.size, file.meta.type);\n    return dataWithUpdatedType;\n}\nconst defaultOptions = {\n    formData: true,\n    fieldName: 'file',\n    method: 'post',\n    allowedMetaFields: true,\n    bundle: false,\n    headers: {},\n    timeout: 30 * 1000,\n    limit: 5,\n    withCredentials: false,\n    responseType: '',\n};\nexport default class XHRUpload extends BasePlugin {\n    static VERSION = packageJson.version;\n    #getFetcher;\n    #queue;\n    uploaderEvents;\n    constructor(uppy, opts) {\n        super(uppy, {\n            ...defaultOptions,\n            fieldName: opts.bundle ? 'files[]' : 'file',\n            ...opts,\n        });\n        this.type = 'uploader';\n        this.id = this.opts.id || 'XHRUpload';\n        this.defaultLocale = locale;\n        this.i18nInit();\n        this.#queue = new TaskQueue({ concurrency: this.opts.limit });\n        if (this.opts.bundle && !this.opts.formData) {\n            throw new Error('`opts.formData` must be true when `opts.bundle` is enabled.');\n        }\n        if (this.opts.bundle && typeof this.opts.headers === 'function') {\n            throw new Error('`opts.headers` can not be a function when the `bundle: true` option is set.');\n        }\n        if (opts?.allowedMetaFields === undefined && 'metaFields' in this.opts) {\n            throw new Error('The `metaFields` option has been renamed to `allowedMetaFields`.');\n        }\n        this.uploaderEvents = Object.create(null);\n        /**\n         * xhr-upload wrapper for `fetcher` to handle user options\n         * `validateStatus`, `getResponseError`, `getResponseData`\n         * and to emit `upload-progress`, `upload-error`, and `upload-success` events.\n         */\n        this.#getFetcher = (files) => {\n            return async (url, options) => {\n                try {\n                    const res = await fetcher(url, {\n                        ...options,\n                        onBeforeRequest: (xhr, retryCount) => this.opts.onBeforeRequest?.(xhr, retryCount, files),\n                        shouldRetry: this.opts.shouldRetry,\n                        onAfterResponse: this.opts.onAfterResponse,\n                        onTimeout: (timeout) => {\n                            const seconds = Math.ceil(timeout / 1000);\n                            const error = new Error(this.i18n('uploadStalled', { seconds }));\n                            this.uppy.emit('upload-stalled', error, files);\n                        },\n                        onUploadProgress: (event) => {\n                            if (event.lengthComputable) {\n                                for (const { id } of files) {\n                                    const file = this.uppy.getFile(id);\n                                    if (file != null) {\n                                        this.uppy.emit('upload-progress', file, {\n                                            uploadStarted: file.progress.uploadStarted ?? 0,\n                                            bytesUploaded: (event.loaded / event.total) * file.size,\n                                            bytesTotal: file.size,\n                                        });\n                                    }\n                                }\n                            }\n                        },\n                    });\n                    let body = await this.opts.getResponseData?.(res);\n                    if (res.responseType === 'json') {\n                        body ??= res.response;\n                    }\n                    else {\n                        try {\n                            body ??= JSON.parse(res.responseText);\n                        }\n                        catch (cause) {\n                            throw new Error('@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.', { cause });\n                        }\n                    }\n                    const uploadURL = typeof body?.url === 'string' ? body.url : undefined;\n                    for (const { id } of files) {\n                        this.uppy.emit('upload-success', this.uppy.getFile(id), {\n                            status: res.status,\n                            body,\n                            uploadURL,\n                        });\n                    }\n                    return res;\n                }\n                catch (error) {\n                    if (error.name === 'AbortError') {\n                        return undefined;\n                    }\n                    const request = error.request;\n                    for (const file of files) {\n                        this.uppy.emit('upload-error', this.uppy.getFile(file.id), buildResponseError(request, error), request);\n                    }\n                    throw error;\n                }\n            };\n        };\n    }\n    getOptions(file) {\n        const overrides = this.uppy.getState().xhrUpload;\n        const { headers } = this.opts;\n        const opts = {\n            ...this.opts,\n            ...(overrides || {}),\n            ...(file.xhrUpload || {}),\n            headers: {},\n        };\n        // Support for `headers` as a function, only in the XHRUpload settings.\n        // Options set by other plugins in Uppy state or on the files themselves are still merged in afterward.\n        //\n        // ```js\n        // headers: (file) => ({ expires: file.meta.expires })\n        // ```\n        if (typeof headers === 'function') {\n            opts.headers = headers(file);\n        }\n        else {\n            Object.assign(opts.headers, this.opts.headers);\n        }\n        if (overrides) {\n            Object.assign(opts.headers, overrides.headers);\n        }\n        if (file.xhrUpload) {\n            Object.assign(opts.headers, file.xhrUpload.headers);\n        }\n        return opts;\n    }\n    addMetadata(formData, meta, opts) {\n        const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, meta);\n        allowedMetaFields.forEach((item) => {\n            const value = meta[item];\n            if (Array.isArray(value)) {\n                // In this case we don't transform `item` to add brackets, it's up to\n                // the user to add the brackets so it won't be overridden.\n                value.forEach((subItem) => formData.append(item, subItem));\n            }\n            else {\n                formData.append(item, value);\n            }\n        });\n    }\n    createFormDataUpload(file, opts) {\n        const formPost = new FormData();\n        this.addMetadata(formPost, file.meta, opts);\n        const dataWithUpdatedType = setTypeInBlob(file);\n        if (file.name) {\n            formPost.append(opts.fieldName, dataWithUpdatedType, file.meta.name);\n        }\n        else {\n            formPost.append(opts.fieldName, dataWithUpdatedType);\n        }\n        return formPost;\n    }\n    createBundledUpload(files, opts) {\n        const formPost = new FormData();\n        const { meta } = this.uppy.getState();\n        this.addMetadata(formPost, meta, opts);\n        files.forEach((file) => {\n            const options = this.getOptions(file);\n            const dataWithUpdatedType = setTypeInBlob(file);\n            if (file.name) {\n                formPost.append(options.fieldName, dataWithUpdatedType, file.name);\n            }\n            else {\n                formPost.append(options.fieldName, dataWithUpdatedType);\n            }\n        });\n        return formPost;\n    }\n    async #uploadLocalFile(file) {\n        const events = new EventManager(this.uppy);\n        const controller = new AbortController();\n        events.onFileRemove(file.id, () => controller.abort());\n        events.onCancelAll(file.id, () => controller.abort());\n        try {\n            await this.#queue.add(async (signal) => {\n                const opts = this.getOptions(file);\n                const fetch = this.#getFetcher([file]);\n                const body = opts.formData\n                    ? this.createFormDataUpload(file, opts)\n                    : file.data;\n                const endpoint = typeof opts.endpoint === 'string'\n                    ? opts.endpoint\n                    : await opts.endpoint(file);\n                return fetch(endpoint, {\n                    ...opts,\n                    body,\n                    signal: AbortSignal.any([signal, controller.signal]),\n                });\n            });\n        }\n        catch (error) {\n            if (error.name === 'AbortError') {\n                return;\n            }\n            throw error;\n        }\n        finally {\n            events.remove();\n        }\n    }\n    async #uploadBundle(files) {\n        const controller = new AbortController();\n        function abort() {\n            controller.abort();\n        }\n        // We only need to abort on cancel all because\n        // individual cancellations are not possible with bundle: true\n        this.uppy.once('cancel-all', abort);\n        try {\n            await this.#queue.add(async (signal) => {\n                const optsFromState = this.uppy.getState().xhrUpload ?? {};\n                const fetch = this.#getFetcher(files);\n                const body = this.createBundledUpload(files, {\n                    ...this.opts,\n                    ...optsFromState,\n                });\n                const endpoint = typeof this.opts.endpoint === 'string'\n                    ? this.opts.endpoint\n                    : await this.opts.endpoint(files);\n                return fetch(endpoint, {\n                    // headers can't be a function with bundle: true\n                    ...this.opts,\n                    body,\n                    signal: AbortSignal.any([signal, controller.signal]),\n                });\n            });\n        }\n        catch (error) {\n            if (error.name === 'AbortError') {\n                return;\n            }\n            throw error;\n        }\n        finally {\n            this.uppy.off('cancel-all', abort);\n        }\n    }\n    #getCompanionClientArgs(file) {\n        const opts = this.getOptions(file);\n        const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, file.meta);\n        return {\n            ...file.remote?.body,\n            protocol: 'multipart',\n            endpoint: opts.endpoint,\n            size: file.data.size,\n            fieldname: opts.fieldName,\n            metadata: Object.fromEntries(allowedMetaFields.map((name) => [name, file.meta[name]])),\n            httpMethod: opts.method,\n            useFormData: opts.formData,\n            headers: opts.headers,\n        };\n    }\n    async #uploadFiles(files) {\n        await Promise.allSettled(files.map((file) => {\n            if (file.isRemote) {\n                const getQueue = () => this.#queue;\n                const controller = new AbortController();\n                const removedHandler = (removedFile) => {\n                    if (removedFile.id === file.id)\n                        controller.abort();\n                };\n                this.uppy.on('file-removed', removedHandler);\n                return this.uppy\n                    .getRequestClientForFile(file)\n                    .uploadRemoteFile(file, this.#getCompanionClientArgs(file), {\n                    signal: controller.signal,\n                    getQueue,\n                })\n                    .finally(() => {\n                    this.uppy.off('file-removed', removedHandler);\n                });\n            }\n            return this.#uploadLocalFile(file);\n        }));\n    }\n    #handleUpload = async (fileIDs) => {\n        if (fileIDs.length === 0) {\n            this.uppy.log('[XHRUpload] No files to upload!');\n            return;\n        }\n        // No limit configured by the user\n        if (this.opts.limit === 0) {\n            this.uppy.log('[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0', 'warning');\n        }\n        this.uppy.log('[XHRUpload] Uploading...');\n        const files = this.uppy.getFilesByIds(fileIDs);\n        const filesFiltered = filterFilesToUpload(files);\n        const filesToEmit = filterFilesToEmitUploadStarted(filesFiltered);\n        this.uppy.emit('upload-start', filesToEmit);\n        if (this.opts.bundle) {\n            // if bundle: true, we don\u2019t support remote uploads\n            const isSomeFileRemote = filesFiltered.some((file) => file.isRemote);\n            if (isSomeFileRemote) {\n                throw new Error('Can\u2019t upload remote files when the `bundle: true` option is set');\n            }\n            if (typeof this.opts.headers === 'function') {\n                throw new TypeError('`headers` may not be a function when the `bundle: true` option is set');\n            }\n            await this.#uploadBundle(filesFiltered);\n        }\n        else {\n            await this.#uploadFiles(filesFiltered);\n        }\n    };\n    install() {\n        if (this.opts.bundle) {\n            const { capabilities } = this.uppy.getState();\n            this.uppy.setState({\n                capabilities: {\n                    ...capabilities,\n                    individualCancellation: false,\n                },\n            });\n        }\n        this.uppy.addUploader(this.#handleUpload);\n    }\n    uninstall() {\n        if (this.opts.bundle) {\n            const { capabilities } = this.uppy.getState();\n            this.uppy.setState({\n                capabilities: {\n                    ...capabilities,\n                    individualCancellation: true,\n                },\n            });\n        }\n        this.uppy.removeUploader(this.#handleUpload);\n    }\n}\n", "{\n  \"name\": \"@uppy/status-bar\",\n  \"description\": \"A progress bar for Uppy, with many bells and whistles.\",\n  \"version\": \"5.1.0\",\n  \"license\": \"MIT\",\n  \"style\": \"dist/style.min.css\",\n  \"type\": \"module\",\n  \"sideEffects\": [\n    \"*.css\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsc --build tsconfig.build.json\",\n    \"build:css\": \"sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css\",\n    \"typecheck\": \"tsc --build\"\n  },\n  \"keywords\": [\n    \"file uploader\",\n    \"uppy\",\n    \"uppy-plugin\",\n    \"progress bar\",\n    \"status bar\",\n    \"progress\",\n    \"upload\",\n    \"eta\",\n    \"speed\"\n  ],\n  \"homepage\": \"https://uppy.io\",\n  \"bugs\": {\n    \"url\": \"https://github.com/transloadit/uppy/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/transloadit/uppy.git\"\n  },\n  \"files\": [\n    \"src\",\n    \"lib\",\n    \"dist\",\n    \"CHANGELOG.md\"\n  ],\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./css/style.css\": \"./dist/style.css\",\n    \"./css/style.min.css\": \"./dist/style.min.css\",\n    \"./css/style.scss\": \"./src/style.scss\",\n    \"./package.json\": \"./package.json\"\n  },\n  \"dependencies\": {\n    \"@transloadit/prettier-bytes\": \"^0.3.4\",\n    \"@uppy/utils\": \"^7.1.4\",\n    \"classnames\": \"^2.2.6\",\n    \"preact\": \"^10.5.13\"\n  },\n  \"peerDependencies\": {\n    \"@uppy/core\": \"^5.2.0\"\n  },\n  \"devDependencies\": {\n    \"cssnano\": \"^7.0.7\",\n    \"postcss\": \"^8.5.6\",\n    \"postcss-cli\": \"^11.0.1\",\n    \"sass\": \"^1.89.2\",\n    \"typescript\": \"^5.8.3\"\n  }\n}", "export default {\n    strings: {\n        // Shown in the status bar while files are being uploaded.\n        uploading: 'Uploading',\n        // Shown in the status bar once all files have been uploaded.\n        complete: 'Complete',\n        // Shown in the status bar if an upload failed.\n        uploadFailed: 'Upload failed',\n        // Shown in the status bar while the upload is paused.\n        paused: 'Paused',\n        // Used as the label for the button that retries an upload.\n        retry: 'Retry',\n        // Used as the label for the button that cancels an upload.\n        cancel: 'Cancel',\n        // Used as the label for the button that pauses an upload.\n        pause: 'Pause',\n        // Used as the label for the button that resumes an upload.\n        resume: 'Resume',\n        // Used as the label for the button that resets the upload state after an upload\n        done: 'Done',\n        // When `showProgressDetails` is set, shows the number of files that have been fully uploaded so far.\n        filesUploadedOfTotal: {\n            0: '%{complete} of %{smart_count} file uploaded',\n            1: '%{complete} of %{smart_count} files uploaded',\n        },\n        // When `showProgressDetails` is set, shows the amount of bytes that have been uploaded so far.\n        dataUploadedOfTotal: '%{complete} of %{total}',\n        dataUploadedOfUnknown: '%{complete} of unknown',\n        // When `showProgressDetails` is set, shows an estimation of how long the upload will take to complete.\n        xTimeLeft: '%{time} left',\n        // Used as the label for the button that starts an upload.\n        uploadXFiles: {\n            0: 'Upload %{smart_count} file',\n            1: 'Upload %{smart_count} files',\n        },\n        // Used as the label for the button that starts an upload, if another upload has been started in the past\n        // and new files were added later.\n        uploadXNewFiles: {\n            0: 'Upload +%{smart_count} file',\n            1: 'Upload +%{smart_count} files',\n        },\n        upload: 'Upload',\n        retryUpload: 'Retry upload',\n        xMoreFilesAdded: {\n            0: '%{smart_count} more file added',\n            1: '%{smart_count} more files added',\n        },\n        showErrorDetails: 'Show error details',\n        failedToAddFiles: 'Failed to add files',\n    },\n};\n", "export default {\n    STATE_ERROR: 'error',\n    STATE_WAITING: 'waiting',\n    STATE_PREPROCESSING: 'preprocessing',\n    STATE_UPLOADING: 'uploading',\n    STATE_POSTPROCESSING: 'postprocessing',\n    STATE_COMPLETE: 'complete',\n};\n", "import { jsx as _jsx, jsxs as _jsxs } from \"preact/jsx-runtime\";\nimport classNames from 'classnames';\nimport { CancelBtn, DoneBtn, PauseResumeButton, ProgressBarComplete, ProgressBarError, ProgressBarProcessing, ProgressBarUploading, RetryBtn, UploadBtn, } from './Components.js';\nimport calculateProcessingProgress from './calculateProcessingProgress.js';\nimport statusBarStates from './StatusBarStates.js';\nconst { STATE_ERROR, STATE_WAITING, STATE_PREPROCESSING, STATE_UPLOADING, STATE_POSTPROCESSING, STATE_COMPLETE, } = statusBarStates;\nexport default function StatusBarUI({ newFiles, allowNewUpload, isUploadInProgress, isAllPaused, resumableUploads, error, hideUploadButton = undefined, hidePauseResumeButton = false, hideCancelButton = false, hideRetryButton = false, recoveredState, uploadState, totalProgress, files, supportsUploadProgress, hideAfterFinish = false, isSomeGhost, doneButtonHandler = undefined, isUploadStarted, i18n, startUpload, uppy, isAllComplete, showProgressDetails = undefined, numUploads, complete, totalSize, totalETA, totalUploadedSize, }) {\n    function getProgressValue() {\n        switch (uploadState) {\n            case STATE_POSTPROCESSING:\n            case STATE_PREPROCESSING: {\n                const progress = calculateProcessingProgress(files);\n                if (progress.mode === 'determinate') {\n                    return progress.value * 100;\n                }\n                return totalProgress;\n            }\n            case STATE_ERROR: {\n                return null;\n            }\n            case STATE_UPLOADING: {\n                if (!supportsUploadProgress) {\n                    return null;\n                }\n                return totalProgress;\n            }\n            default:\n                return totalProgress;\n        }\n    }\n    function getIsIndeterminate() {\n        switch (uploadState) {\n            case STATE_POSTPROCESSING:\n            case STATE_PREPROCESSING: {\n                const { mode } = calculateProcessingProgress(files);\n                return mode === 'indeterminate';\n            }\n            case STATE_UPLOADING: {\n                if (!supportsUploadProgress) {\n                    return true;\n                }\n                return false;\n            }\n            default:\n                return false;\n        }\n    }\n    const progressValue = getProgressValue();\n    const width = progressValue ?? 100;\n    const showUploadBtn = !error &&\n        newFiles &&\n        ((!isUploadInProgress && !isAllPaused) || recoveredState) &&\n        allowNewUpload &&\n        !hideUploadButton;\n    const showCancelBtn = !hideCancelButton &&\n        uploadState !== STATE_WAITING &&\n        uploadState !== STATE_COMPLETE;\n    const showPauseResumeBtn = resumableUploads &&\n        !hidePauseResumeButton &&\n        uploadState === STATE_UPLOADING;\n    const showRetryBtn = error && !isAllComplete && !hideRetryButton;\n    const showDoneBtn = doneButtonHandler && uploadState === STATE_COMPLETE;\n    const progressClassNames = classNames('uppy-StatusBar-progress', {\n        'is-indeterminate': getIsIndeterminate(),\n    });\n    const statusBarClassNames = classNames('uppy-StatusBar', `is-${uploadState}`, { 'has-ghosts': isSomeGhost });\n    const progressBarStateEl = (() => {\n        switch (uploadState) {\n            case STATE_PREPROCESSING:\n            case STATE_POSTPROCESSING:\n                return (_jsx(ProgressBarProcessing, { progress: calculateProcessingProgress(files) }));\n            case STATE_COMPLETE:\n                return _jsx(ProgressBarComplete, { i18n: i18n });\n            case STATE_ERROR:\n                return (_jsx(ProgressBarError, { error: error, i18n: i18n, numUploads: numUploads, complete: complete }));\n            case STATE_UPLOADING:\n                return (_jsx(ProgressBarUploading, { i18n: i18n, supportsUploadProgress: supportsUploadProgress, totalProgress: totalProgress, showProgressDetails: showProgressDetails, isUploadStarted: isUploadStarted, isAllComplete: isAllComplete, isAllPaused: isAllPaused, newFiles: newFiles, numUploads: numUploads, complete: complete, totalUploadedSize: totalUploadedSize, totalSize: totalSize, totalETA: totalETA, startUpload: startUpload }));\n            default:\n                return null;\n        }\n    })();\n    const atLeastOneAction = showUploadBtn ||\n        showRetryBtn ||\n        showPauseResumeBtn ||\n        showCancelBtn ||\n        showDoneBtn;\n    const thereIsNothingInside = !atLeastOneAction && !progressBarStateEl;\n    const isHidden = thereIsNothingInside || (uploadState === STATE_COMPLETE && hideAfterFinish);\n    if (isHidden) {\n        return null;\n    }\n    return (_jsxs(\"div\", { className: statusBarClassNames, children: [_jsx(\"div\", { className: progressClassNames, style: { width: `${width}%` }, role: \"progressbar\", \"aria-label\": `${width}%`, \"aria-valuetext\": `${width}%`, \"aria-valuemin\": 0, \"aria-valuemax\": 100, \"aria-valuenow\": progressValue }), progressBarStateEl, _jsxs(\"div\", { className: \"uppy-StatusBar-actions\", children: [showUploadBtn ? (_jsx(UploadBtn, { newFiles: newFiles, isUploadStarted: isUploadStarted, recoveredState: recoveredState, i18n: i18n, isSomeGhost: isSomeGhost, startUpload: startUpload, uploadState: uploadState })) : null, showRetryBtn ? _jsx(RetryBtn, { i18n: i18n, uppy: uppy }) : null, showPauseResumeBtn ? (_jsx(PauseResumeButton, { isAllPaused: isAllPaused, i18n: i18n, isAllComplete: isAllComplete, resumableUploads: resumableUploads, uppy: uppy })) : null, showCancelBtn ? _jsx(CancelBtn, { i18n: i18n, uppy: uppy }) : null, showDoneBtn ? (_jsx(DoneBtn, { i18n: i18n, doneButtonHandler: doneButtonHandler })) : null] })] }));\n}\n", "import { jsx as _jsx, jsxs as _jsxs } from \"preact/jsx-runtime\";\nimport prettierBytes from '@transloadit/prettier-bytes';\nimport { prettyETA } from '@uppy/utils';\nimport classNames from 'classnames';\nimport statusBarStates from './StatusBarStates.js';\nconst DOT = `\\u00B7`;\nconst renderDot = () => ` ${DOT} `;\nfunction UploadBtn(props) {\n    const { newFiles, isUploadStarted, recoveredState, i18n, uploadState, isSomeGhost, startUpload, } = props;\n    const uploadBtnClassNames = classNames('uppy-u-reset', 'uppy-c-btn', 'uppy-StatusBar-actionBtn', 'uppy-StatusBar-actionBtn--upload', {\n        'uppy-c-btn-primary': uploadState === statusBarStates.STATE_WAITING,\n    }, { 'uppy-StatusBar-actionBtn--disabled': isSomeGhost });\n    const uploadBtnText = newFiles && isUploadStarted && !recoveredState\n        ? i18n('uploadXNewFiles', { smart_count: newFiles })\n        : i18n('uploadXFiles', { smart_count: newFiles });\n    return (_jsx(\"button\", { type: \"button\", className: uploadBtnClassNames, \"aria-label\": i18n('uploadXFiles', { smart_count: newFiles }), onClick: startUpload, disabled: isSomeGhost, \"data-uppy-super-focusable\": true, children: uploadBtnText }));\n}\nfunction RetryBtn(props) {\n    const { i18n, uppy } = props;\n    return (_jsxs(\"button\", { type: \"button\", className: \"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry\", \"aria-label\": i18n('retryUpload'), onClick: () => uppy.retryAll().catch(() => {\n            /* Error reported and handled via an event */\n        }), \"data-uppy-super-focusable\": true, \"data-cy\": \"retry\", children: [_jsx(\"svg\", { \"aria-hidden\": \"true\", focusable: \"false\", className: \"uppy-c-icon\", width: \"8\", height: \"10\", viewBox: \"0 0 8 10\", children: _jsx(\"path\", { d: \"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z\" }) }), i18n('retry')] }));\n}\nfunction CancelBtn(props) {\n    const { i18n, uppy } = props;\n    return (_jsx(\"button\", { type: \"button\", className: \"uppy-u-reset uppy-StatusBar-actionCircleBtn\", title: i18n('cancel'), \"aria-label\": i18n('cancel'), onClick: () => uppy.cancelAll(), \"data-cy\": \"cancel\", \"data-uppy-super-focusable\": true, children: _jsx(\"svg\", { \"aria-hidden\": \"true\", focusable: \"false\", className: \"uppy-c-icon\", width: \"16\", height: \"16\", viewBox: \"0 0 16 16\", children: _jsxs(\"g\", { fill: \"none\", fillRule: \"evenodd\", children: [_jsx(\"circle\", { fill: \"#888\", cx: \"8\", cy: \"8\", r: \"8\" }), _jsx(\"path\", { fill: \"#FFF\", d: \"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z\" })] }) }) }));\n}\nfunction PauseResumeButton(props) {\n    const { isAllPaused, i18n, isAllComplete, resumableUploads, uppy } = props;\n    const title = isAllPaused ? i18n('resume') : i18n('pause');\n    function togglePauseResume() {\n        if (isAllComplete)\n            return;\n        if (!resumableUploads) {\n            uppy.cancelAll();\n            return;\n        }\n        if (isAllPaused) {\n            uppy.resumeAll();\n            return;\n        }\n        uppy.pauseAll();\n    }\n    return (_jsx(\"button\", { title: title, \"aria-label\": title, className: \"uppy-u-reset uppy-StatusBar-actionCircleBtn\", type: \"button\", onClick: togglePauseResume, \"data-cy\": \"togglePauseResume\", \"data-uppy-super-focusable\": true, children: _jsx(\"svg\", { \"aria-hidden\": \"true\", focusable: \"false\", className: \"uppy-c-icon\", width: \"16\", height: \"16\", viewBox: \"0 0 16 16\", children: _jsxs(\"g\", { fill: \"none\", fillRule: \"evenodd\", children: [_jsx(\"circle\", { fill: \"#888\", cx: \"8\", cy: \"8\", r: \"8\" }), _jsx(\"path\", { fill: \"#FFF\", d: isAllPaused\n                            ? 'M6 4.25L11.5 8 6 11.75z'\n                            : 'M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z' })] }) }) }));\n}\nfunction DoneBtn(props) {\n    const { i18n, doneButtonHandler } = props;\n    return (_jsx(\"button\", { type: \"button\", className: \"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done\", onClick: doneButtonHandler, \"data-uppy-super-focusable\": true, children: i18n('done') }));\n}\nfunction LoadingSpinner() {\n    return (_jsx(\"svg\", { className: \"uppy-StatusBar-spinner\", \"aria-hidden\": \"true\", focusable: \"false\", width: \"14\", height: \"14\", children: _jsx(\"path\", { d: \"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0\", fillRule: \"evenodd\" }) }));\n}\nfunction ProgressBarProcessing(props) {\n    const { progress } = props;\n    const { value, mode, message } = progress;\n    const dot = `\\u00B7`;\n    return (_jsxs(\"div\", { className: \"uppy-StatusBar-content\", children: [_jsx(LoadingSpinner, {}), mode === 'determinate' ? `${Math.round(value * 100)}% ${dot} ` : '', message] }));\n}\nfunction ProgressDetails(props) {\n    const { numUploads, complete, totalUploadedSize, totalSize, totalETA, i18n } = props;\n    const ifShowFilesUploadedOfTotal = numUploads > 1;\n    const totalUploadedSizeStr = prettierBytes(totalUploadedSize);\n    return (_jsxs(\"div\", { className: \"uppy-StatusBar-statusSecondary\", children: [ifShowFilesUploadedOfTotal &&\n                i18n('filesUploadedOfTotal', {\n                    complete,\n                    smart_count: numUploads,\n                }), _jsxs(\"span\", { className: \"uppy-StatusBar-additionalInfo\", children: [ifShowFilesUploadedOfTotal && renderDot(), totalSize != null\n                        ? i18n('dataUploadedOfTotal', {\n                            complete: totalUploadedSizeStr,\n                            total: prettierBytes(totalSize),\n                        })\n                        : i18n('dataUploadedOfUnknown', { complete: totalUploadedSizeStr }), renderDot(), totalETA != null &&\n                        i18n('xTimeLeft', {\n                            time: prettyETA(totalETA),\n                        })] })] }));\n}\nfunction FileUploadCount(props) {\n    const { i18n, complete, numUploads } = props;\n    return (_jsx(\"div\", { className: \"uppy-StatusBar-statusSecondary\", children: i18n('filesUploadedOfTotal', { complete, smart_count: numUploads }) }));\n}\nfunction UploadNewlyAddedFiles(props) {\n    const { i18n, newFiles, startUpload } = props;\n    const uploadBtnClassNames = classNames('uppy-u-reset', 'uppy-c-btn', 'uppy-StatusBar-actionBtn', 'uppy-StatusBar-actionBtn--uploadNewlyAdded');\n    return (_jsxs(\"div\", { className: \"uppy-StatusBar-statusSecondary\", children: [_jsx(\"div\", { className: \"uppy-StatusBar-statusSecondaryHint\", children: i18n('xMoreFilesAdded', { smart_count: newFiles }) }), _jsx(\"button\", { type: \"button\", className: uploadBtnClassNames, \"aria-label\": i18n('uploadXFiles', { smart_count: newFiles }), onClick: startUpload, children: i18n('upload') })] }));\n}\nfunction ProgressBarUploading(props) {\n    const { i18n, supportsUploadProgress, totalProgress, showProgressDetails, isUploadStarted, isAllComplete, isAllPaused, newFiles, numUploads, complete, totalUploadedSize, totalSize, totalETA, startUpload, } = props;\n    const showUploadNewlyAddedFiles = newFiles && isUploadStarted;\n    if (!isUploadStarted || isAllComplete) {\n        return null;\n    }\n    const title = isAllPaused ? i18n('paused') : i18n('uploading');\n    function renderProgressDetails() {\n        if (!isAllPaused && !showUploadNewlyAddedFiles && showProgressDetails) {\n            if (supportsUploadProgress) {\n                return (_jsx(ProgressDetails, { numUploads: numUploads, complete: complete, totalUploadedSize: totalUploadedSize, totalSize: totalSize, totalETA: totalETA, i18n: i18n }));\n            }\n            return (_jsx(FileUploadCount, { i18n: i18n, complete: complete, numUploads: numUploads }));\n        }\n        return null;\n    }\n    return (_jsxs(\"div\", { className: \"uppy-StatusBar-content\", title: title, children: [!isAllPaused ? _jsx(LoadingSpinner, {}) : null, _jsxs(\"div\", { className: \"uppy-StatusBar-status\", children: [_jsx(\"div\", { className: \"uppy-StatusBar-statusPrimary\", children: supportsUploadProgress && totalProgress !== 0\n                            ? `${title}: ${totalProgress}%`\n                            : title }), renderProgressDetails(), showUploadNewlyAddedFiles ? (_jsx(UploadNewlyAddedFiles, { i18n: i18n, newFiles: newFiles, startUpload: startUpload })) : null] })] }));\n}\nfunction ProgressBarComplete(props) {\n    const { i18n } = props;\n    return (_jsx(\"div\", { className: \"uppy-StatusBar-content\", \n        // biome-ignore lint/a11y/useSemanticElements: ...\n        role: \"status\", title: i18n('complete'), children: _jsx(\"div\", { className: \"uppy-StatusBar-status\", children: _jsxs(\"div\", { className: \"uppy-StatusBar-statusPrimary\", children: [_jsx(\"svg\", { \"aria-hidden\": \"true\", focusable: \"false\", className: \"uppy-StatusBar-statusIndicator uppy-c-icon\", width: \"15\", height: \"11\", viewBox: \"0 0 15 11\", children: _jsx(\"path\", { d: \"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z\" }) }), i18n('complete')] }) }) }));\n}\nfunction ProgressBarError(props) {\n    const { error, i18n, complete, numUploads } = props;\n    function displayErrorAlert() {\n        const errorMessage = `${i18n('uploadFailed')} \\n\\n ${error}`;\n        alert(errorMessage); // TODO: move to custom alert implementation\n    }\n    return (_jsxs(\"div\", { className: \"uppy-StatusBar-content\", title: i18n('uploadFailed'), children: [_jsx(\"svg\", { \"aria-hidden\": \"true\", focusable: \"false\", className: \"uppy-StatusBar-statusIndicator uppy-c-icon\", width: \"11\", height: \"11\", viewBox: \"0 0 11 11\", children: _jsx(\"path\", { d: \"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z\" }) }), _jsxs(\"div\", { className: \"uppy-StatusBar-status\", children: [_jsxs(\"div\", { className: \"uppy-StatusBar-statusPrimary\", children: [i18n('uploadFailed'), _jsx(\"button\", { className: \"uppy-u-reset uppy-StatusBar-details\", \"aria-label\": i18n('showErrorDetails'), \"data-microtip-position\": \"top-right\", \"data-microtip-size\": \"medium\", onClick: displayErrorAlert, type: \"button\", children: \"?\" })] }), _jsx(FileUploadCount, { i18n: i18n, complete: complete, numUploads: numUploads })] })] }));\n}\nexport { UploadBtn, RetryBtn, CancelBtn, PauseResumeButton, DoneBtn, LoadingSpinner, ProgressDetails, ProgressBarProcessing, ProgressBarError, ProgressBarUploading, ProgressBarComplete, };\n", "export default function calculateProcessingProgress(files) {\n    const values = [];\n    let mode = 'indeterminate';\n    let message;\n    for (const { progress } of Object.values(files)) {\n        const { preprocess, postprocess } = progress;\n        // In the future we should probably do this differently. For now we'll take the\n        // mode and message from the first file\u2026\n        if (message == null && (preprocess || postprocess)) {\n            ;\n            ({ mode, message } = preprocess || postprocess);\n        }\n        if (preprocess?.mode === 'determinate')\n            values.push(preprocess.value);\n        if (postprocess?.mode === 'determinate')\n            values.push(postprocess.value);\n    }\n    const value = values.reduce((total, progressValue) => {\n        return total + progressValue / values.length;\n    }, 0);\n    return {\n        mode,\n        message,\n        value,\n    };\n}\n", "import { UIPlugin } from '@uppy/core';\nimport { emaFilter, getTextDirection } from '@uppy/utils';\nimport packageJson from '../package.json' with { type: 'json' };\nimport locale from './locale.js';\nimport statusBarStates from './StatusBarStates.js';\nimport StatusBarUI, {} from './StatusBarUI.js';\nconst speedFilterHalfLife = 2000;\nconst ETAFilterHalfLife = 2000;\nfunction getUploadingState(error, isAllComplete, recoveredState, files) {\n    if (error) {\n        return statusBarStates.STATE_ERROR;\n    }\n    if (isAllComplete) {\n        return statusBarStates.STATE_COMPLETE;\n    }\n    if (recoveredState) {\n        return statusBarStates.STATE_WAITING;\n    }\n    let state = statusBarStates.STATE_WAITING;\n    const fileIDs = Object.keys(files);\n    for (let i = 0; i < fileIDs.length; i++) {\n        const { progress } = files[fileIDs[i]];\n        // If ANY files are being uploaded right now, show the uploading state.\n        if (progress.uploadStarted && !progress.uploadComplete) {\n            return statusBarStates.STATE_UPLOADING;\n        }\n        // If files are being preprocessed AND postprocessed at this time, we show the\n        // preprocess state. If any files are being uploaded we show uploading.\n        if (progress.preprocess) {\n            state = statusBarStates.STATE_PREPROCESSING;\n        }\n        // If NO files are being preprocessed or uploaded right now, but some files are\n        // being postprocessed, show the postprocess state.\n        if (progress.postprocess && state !== statusBarStates.STATE_PREPROCESSING) {\n            state = statusBarStates.STATE_POSTPROCESSING;\n        }\n    }\n    return state;\n}\nconst defaultOptions = {\n    hideUploadButton: false,\n    hideRetryButton: false,\n    hidePauseResumeButton: false,\n    hideCancelButton: false,\n    showProgressDetails: false,\n    hideAfterFinish: true,\n    doneButtonHandler: null,\n};\n/**\n * StatusBar: renders a status bar with upload/pause/resume/cancel/retry buttons,\n * progress percentage and time remaining.\n */\nexport default class StatusBar extends UIPlugin {\n    static VERSION = packageJson.version;\n    #lastUpdateTime;\n    #previousUploadedBytes;\n    #previousSpeed;\n    #previousETA;\n    constructor(uppy, opts) {\n        super(uppy, { ...defaultOptions, ...opts });\n        this.id = this.opts.id || 'StatusBar';\n        this.title = 'StatusBar';\n        this.type = 'progressindicator';\n        this.defaultLocale = locale;\n        this.i18nInit();\n        this.render = this.render.bind(this);\n        this.install = this.install.bind(this);\n    }\n    #computeSmoothETA(totalBytes) {\n        if (totalBytes.total == null || totalBytes.total === 0) {\n            return null;\n        }\n        const remaining = totalBytes.total - totalBytes.uploaded;\n        if (remaining <= 0) {\n            return null;\n        }\n        // When state is restored, lastUpdateTime is still nullish at this point.\n        this.#lastUpdateTime ??= performance.now();\n        const dt = performance.now() - this.#lastUpdateTime;\n        if (dt === 0) {\n            return Math.round((this.#previousETA ?? 0) / 100) / 10;\n        }\n        const uploadedBytesSinceLastTick = totalBytes.uploaded - this.#previousUploadedBytes;\n        this.#previousUploadedBytes = totalBytes.uploaded;\n        // uploadedBytesSinceLastTick can be negative in some cases (packet loss?)\n        // in which case, we wait for next tick to update ETA.\n        if (uploadedBytesSinceLastTick <= 0) {\n            return Math.round((this.#previousETA ?? 0) / 100) / 10;\n        }\n        const currentSpeed = uploadedBytesSinceLastTick / dt;\n        const filteredSpeed = this.#previousSpeed == null\n            ? currentSpeed\n            : emaFilter(currentSpeed, this.#previousSpeed, speedFilterHalfLife, dt);\n        this.#previousSpeed = filteredSpeed;\n        const instantETA = remaining / filteredSpeed;\n        const updatedPreviousETA = Math.max(this.#previousETA - dt, 0);\n        const filteredETA = this.#previousETA == null\n            ? instantETA\n            : emaFilter(instantETA, updatedPreviousETA, ETAFilterHalfLife, dt);\n        this.#previousETA = filteredETA;\n        this.#lastUpdateTime = performance.now();\n        return Math.round(filteredETA / 100) / 10;\n    }\n    startUpload = () => {\n        return this.uppy.upload().catch((() => {\n            // Error logged in Core\n        }));\n    };\n    render(state) {\n        const { capabilities, files, allowNewUpload, totalProgress, error, recoveredState, } = state;\n        const { newFiles, startedFiles, completeFiles, isUploadStarted, isAllComplete, isAllPaused, isUploadInProgress, isSomeGhost, } = this.uppy.getObjectOfFilesPerState();\n        // If some state was recovered, we want to show Upload button/counter\n        // for all the files, because in this case it\u2019s not an Upload button,\n        // but \u201CConfirm Restore Button\u201D\n        const newFilesOrRecovered = recoveredState ? Object.values(files) : newFiles;\n        const resumableUploads = !!capabilities.resumableUploads;\n        const supportsUploadProgress = capabilities.uploadProgress !== false;\n        let totalSize = null;\n        let totalUploadedSize = 0;\n        // Only if all files have a known size, does it make sense to display a total size\n        if (startedFiles.every((f) => f.progress.bytesTotal != null && f.progress.bytesTotal !== 0)) {\n            totalSize = 0;\n            startedFiles.forEach((file) => {\n                totalSize += file.progress.bytesTotal || 0;\n                totalUploadedSize += file.progress.bytesUploaded || 0;\n            });\n        }\n        else {\n            // however uploaded size we will always have\n            startedFiles.forEach((file) => {\n                totalUploadedSize += file.progress.bytesUploaded || 0;\n            });\n        }\n        const totalETA = this.#computeSmoothETA({\n            uploaded: totalUploadedSize,\n            total: totalSize,\n        });\n        return StatusBarUI({\n            error,\n            uploadState: getUploadingState(error, isAllComplete, recoveredState, state.files || {}),\n            allowNewUpload,\n            totalProgress,\n            totalSize,\n            totalUploadedSize,\n            isAllComplete: false,\n            isAllPaused,\n            isUploadStarted,\n            isUploadInProgress,\n            isSomeGhost,\n            recoveredState,\n            complete: completeFiles.length,\n            newFiles: newFilesOrRecovered.length,\n            numUploads: startedFiles.length,\n            totalETA,\n            files,\n            i18n: this.i18n,\n            uppy: this.uppy,\n            startUpload: this.startUpload,\n            doneButtonHandler: this.opts.doneButtonHandler,\n            resumableUploads,\n            supportsUploadProgress,\n            showProgressDetails: this.opts.showProgressDetails,\n            hideUploadButton: this.opts.hideUploadButton,\n            hideRetryButton: this.opts.hideRetryButton,\n            hidePauseResumeButton: this.opts.hidePauseResumeButton,\n            hideCancelButton: this.opts.hideCancelButton,\n            hideAfterFinish: this.opts.hideAfterFinish,\n        });\n    }\n    onMount() {\n        // Set the text direction if the page has not defined one.\n        const element = this.el;\n        const direction = getTextDirection(element);\n        if (!direction) {\n            element.dir = 'ltr';\n        }\n    }\n    #onUploadStart = () => {\n        const { recoveredState } = this.uppy.getState();\n        this.#previousSpeed = null;\n        this.#previousETA = null;\n        if (recoveredState) {\n            this.#previousUploadedBytes = Object.values(recoveredState.files).reduce((pv, { progress }) => pv + progress.bytesUploaded, 0);\n            // We don't set `#lastUpdateTime` at this point because the upload won't\n            // actually resume until the user asks for it.\n            this.uppy.emit('restore-confirmed');\n            return;\n        }\n        this.#lastUpdateTime = performance.now();\n        this.#previousUploadedBytes = 0;\n    };\n    install() {\n        const { target } = this.opts;\n        if (target) {\n            this.mount(target, this);\n        }\n        this.uppy.on('upload', this.#onUploadStart);\n        // To cover the use case where the status bar is installed while the upload\n        // has started, we set `lastUpdateTime` right away.\n        this.#lastUpdateTime = performance.now();\n        this.#previousUploadedBytes = this.uppy\n            .getFiles()\n            .reduce((pv, file) => pv + file.progress.bytesUploaded, 0);\n    }\n    uninstall() {\n        this.unmount();\n        this.uppy.off('upload', this.#onUploadStart);\n    }\n}\n", "// Entry point to initialize bigger libraries that are essential to managing functionalities only\n// the idea is that most users will simply consume the app and don't need to load this\n\n// Uppy\nimport Uppy from '@uppy/core'\n// import FileInput from '@uppy/file-input'\nimport XHRUpload from '@uppy/xhr-upload'\n// import Form from '@uppy/form'\nimport StatusBar from '@uppy/status-bar'\n\nimport '@uppy/core/css/style.css'\nimport '@uppy/status-bar/css/style.css'\n\nwindow.Uppy = Uppy\n// window.UppyFileInput = FileInput\nwindow.UppyXHRUpload = XHRUpload\n// window.UppyForm = Form\nwindow.UppyStatusBar = StatusBar\n"],
  "mappings": "+lBAGAA,GAAA,QAAS,SAAuBC,EAAa,CAC3C,GAAI,OAAOA,GAAU,UAAY,OAAO,MAAMA,CAAK,EACjD,MAAM,IAAI,UAAU,0BAA0B,OAAOA,CAAK,EAAE,EAG9D,IAAMC,EAAMD,EAAQ,EAChBE,EAAM,KAAK,IAAIF,CAAK,EAMxB,GAJIC,IACFC,EAAM,CAACA,GAGLA,IAAQ,EACV,MAAO,MAGT,IAAMC,EAAQ,CAAC,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,IAAI,EAC5DC,EAAW,KAAK,IAAI,KAAK,MAAM,KA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card", "__commonJSMin", "exports", "module", "WildcardMatcher", "text", "separator", "input", "matches", "parts", "ii", "partsCount", "testParts", "key", "test", "matcher", "require_mime_match", "__commonJSMin", "exports", "module", "wildcard", "reMimePartSplit", "target", "pattern", "test", "result", "require_isObject", "__commonJSMin", "exports", "module", "isObject", "value", "type", "require_freeGlobal", "__commonJSMin", "exports", "module", "freeGlobal", "require_root", "__commonJSMin", "exports", "module", "freeGlobal", "freeSelf", "root", "require_now", "__commonJSMin", "exports", "module", "root", "now", "require_trimmedEndIndex", "__commonJSMin", "exports", "module", "reWhitespace", "trimmedEndIndex", "string", "index", "require_baseTrim", "__commonJSMin", "exports", "module", "trimmedEndIndex", "reTrimStart", "baseTrim", "string", "require_Symbol", "__commonJSMin", "exports", "module", "root", "Symbol", "require_getRawTag", "__commonJSMin", "exports", "module", "Symbol", "objectProto", "hasOwnProperty", "nativeObjectToString", "symToStringTag", "getRawTag", "value", "isOwn", "tag", "unmasked", "result", "require_objectToString", "__commonJSMin", "exports", "module", "objectProto", "nativeObjectToString", "objectToString", "value", "require_baseGetTag", "__commonJSMin", "exports", "module", "Symbol", "getRawTag", "objectToString", "nullTag", "undefinedTag", "symToStringTag", "baseGetTag", "value", "require_isObjectLike", "__commonJSMin", "exports", "module", "isObjectLike", "value", "require_isSymbol", "__commonJSMin", "exports", "module", "baseGetTag", "isObjectLike", "symbolTag", "isSymbol", "value", "require_toNumber", "__commonJSMin", "exports", "module", "baseTrim", "isObject", "isSymbol", "NAN", "reIsBadHex", "reIsBinary", "reIsOctal", "freeParseInt", "toNumber", "value", "other", "isBinary", "require_debounce", "__commonJSMin", "exports", "module", "isObject", "now", "toNumber", "FUNC_ERROR_TEXT", "nativeMax", "nativeMin", "debounce", "func", "wait", "options", "lastArgs", "lastThis", "maxWait", "result", "timerId", "lastCallTime", "lastInvokeTime", "leading", "maxing", "trailing", "invokeFunc", "time", "args", "thisArg", "leadingEdge", "timerExpired", "remainingWait", "timeSinceLastCall", "timeSinceLastInvoke", "timeWaiting", "shouldInvoke", "trailingEdge", "cancel", "flush", "debounced", "isInvoking", "require_throttle", "__commonJSMin", "exports", "module", "debounce", "isObject", "FUNC_ERROR_TEXT", "throttle", "func", "wait", "options", "leading", "trailing", "require_namespace_emitter", "__commonJSMin", "exports", "module", "emitter", "_fns", "event", "arg1", "arg2", "arg3", "arg4", "arg5", "arg6", "toEmit", "getListeners", "emitAll", "fn", "one", "keep", "fns", "i", "l", "e", "out", "idx", "args", "keys", "key", "require_classnames", "__commonJSMin", "exports", "module", "hasOwn", "classNames", "classes", "arg", "appendClass", "parseValue", "key", "value", "newClass", "emaFilter", "newValue", "previousSmoothedValue", "halfLife", "dt", "NetworkError", "error", "xhr", "NetworkError_default", "ProgressTimeout", "#aliveTimer", "#isDone", "#onTimedOut", "#timeout", "timeout", "timeoutHandler", "ProgressTimeout_default", "noop", "fetcher", "url", "options", "body", "headers", "method", "onBeforeRequest", "onUploadProgress", "shouldRetry", "onAfterResponse", "onTimeout", "responseType", "retries", "signal", "timeout", "withCredentials", "delay", "attempt", "timer", "ProgressTimeout_default", "requestWithRetry", "retryCount", "resolve", "reject", "xhr", "onError", "error", "err", "NetworkError_default", "event", "key", "abort", "hasError", "file", "isCompleted", "filterFilesToUpload", "files", "filterFilesToEmitUploadStarted", "isDOMElement", "obj", "findDOMElement", "element", "context", "isDOMElement", "findDOMElement_default", "getFileNameAndExtension", "fullFileName", "lastDot", "mimeTypes_default", "getFileType", "file", "fileExtension", "getFileNameAndExtension", "mimeTypes_default", "encodeCharacter", "character", "encodeFilename", "name", "suffix", "generateFileID", "file", "instanceId", "id", "hasFileStableId", "getSafeFileId", "fileType", "getFileType", "getAllowedMetaFields", "fields", "meta", "getTextDirection", "element", "getTextDirection_default", "pad", "number", "getTimeStamp", "date", "hours", "minutes", "seconds", "isNetworkError", "xhr", "isNetworkError_default", "secondsToTime", "rawSeconds", "hours", "minutes", "seconds", "prettyETA", "seconds", "time", "secondsToTime", "hoursStr", "minutesStr", "secondsStr", "TaskQueue", "#queue", "#running", "#concurrency", "#paused", "options", "limit", "task", "controller", "resolve", "reject", "promise", "res", "rej", "queuedTask", "index", "reason", "signal", "onAbort", "#execute", "#advance", "runPromise", "error", "result", "next", "available", "i", "tasks", "value", "fn", "args", "insertReplacement", "source", "rx", "replacement", "newParts", "chunk", "raw", "i", "list", "interpolate", "phrase", "options", "dollarRegex", "dollarBillsYall", "interpolated", "arg", "defaultOnMissingKey", "key", "Translator", "locales", "onMissingKey", "n", "#apply", "#onMissingKey", "locale", "prevLocale", "string", "plural", "slice", "options", "vnodeId", "isValidElement", "rerenderQueue", "prevDebounce", "defer", "depthSort", "_id", "EVENT_DISPATCHED", "EVENT_ATTACHED", "CAPTURE_REGEX", "eventClock", "eventProxy", "eventProxyCapture", "i", "EMPTY_OBJ", "EMPTY_ARR", "IS_NON_DIMENSIONAL", "isArray", "Array", "assign", "obj", "props", "removeNode", "node", "parentNode", "removeChild", "createElement", "type", "children", "key", "ref", "normalizedProps", "arguments", "length", "call", "defaultProps", "createVNode", "original", "vnode", "__k", "__", "__b", "__e", "__c", "constructor", "__v", "__i", "__u", "Fragment", "props", "children", "BaseComponent", "context", "this", "getDomSibling", "vnode", "childIndex", "__", "__i", "sibling", "__k", "length", "__e", "type", "renderComponent", "component", "__P", "__d", "oldVNode", "__v", "oldDom", "commitQueue", "refQueue", "newVNode", "assign", "options", "diff", "__n", "namespaceURI", "__u", "commitRoot", "updateParentDomPointers", "__c", "base", "some", "child", "enqueueRender", "c", "rerenderQueue", "push", "process", "__r", "prevDebounce", "debounceRendering", "defer", "l", "sort", "depthSort", "shift", "diffChildren", "parentDom", "renderResult", "newParentVNode", "oldParentVNode", "globalContext", "namespace", "excessDomChildren", "isHydrating", "i", "childVNode", "newDom", "firstChildDom", "result", "shouldPlace", "oldChildren", "EMPTY_ARR", "newChildrenLength", "constructNewChildrenArray", "EMPTY_OBJ", "ref", "applyRef", "insert", "nextSibling", "skewedIndex", "matchingIndex", "oldChildrenLength", "remainingOldChildren", "skew", "Array", "constructor", "String", "createVNode", "isArray", "__b", "key", "findMatchingIndex", "unmount", "parentVNode", "parentNode", "insertBefore", "nodeType", "findMatchingIndex", "childVNode", "oldChildren", "skewedIndex", "remainingOldChildren", "x", "y", "childIndex", "key", "type", "oldVNode", "matched", "__u", "length", "setStyle", "style", "value", "setProperty", "IS_NON_DIMENSIONAL", "test", "dom", "name", "oldValue", "namespace", "useCapture", "lowerCaseName", "o", "cssText", "replace", "CAPTURE_REGEX", "toLowerCase", "slice", "l", "EVENT_ATTACHED", "eventClock", "addEventListener", "eventProxyCapture", "eventProxy", "removeEventListener", "e", "removeAttribute", "setAttribute", "createEventProxy", "this", "eventHandler", "EVENT_DISPATCHED", "options", "event", "diff", "parentDom", "newVNode", "globalContext", "excessDomChildren", "commitQueue", "oldDom", "isHydrating", "refQueue", "tmp", "oldCommitQueueLength", "c", "isNew", "oldProps", "oldState", "snapshot", "clearProcessingException", "newProps", "isClassComponent", "provider", "componentContext", "renderHook", "count", "renderResult", "i", "newType", "constructor", "__e", "__b", "outer", "props", "prototype", "render", "contextType", "__c", "__", "__E", "BaseComponent", "doRender", "sub", "state", "__n", "__d", "__h", "_sb", "__s", "getDerivedStateFromProps", "assign", "__v", "componentWillMount", "componentDidMount", "push", "componentWillReceiveProps", "shouldComponentUpdate", "__k", "some", "vnode", "EMPTY_ARR", "apply", "componentWillUpdate", "componentDidUpdate", "context", "__P", "__r", "getChildContext", "getSnapshotBeforeUpdate", "Fragment", "cloneNode", "children", "diffChildren", "isArray", "base", "then", "MODE_HYDRATE", "nodeType", "nextSibling", "indexOf", "removeNode", "markAsForce", "diffElementNodes", "diffed", "commitRoot", "root", "applyRef", "cb", "call", "node", "map", "newHtml", "oldHtml", "newChildren", "inputValue", "checked", "EMPTY_OBJ", "localName", "document", "createTextNode", "createElementNS", "is", "__m", "data", "defaultValue", "childNodes", "attributes", "__html", "innerHTML", "content", "getDomSibling", "undefined", "ref", "hasRefUnmount", "current", "unmount", "parentVNode", "skipRemove", "r", "componentWillUnmount", "replaceNode", "documentElement", "createElement", "namespaceURI", "firstChild", "slice", "EMPTY_ARR", "options", "__e", "error", "vnode", "oldVNode", "errorInfo", "component", "ctor", "handled", "__", "__c", "constructor", "getDerivedStateFromError", "setState", "__d", "componentDidCatch", "__E", "e", "vnodeId", "isValidElement", "BaseComponent", "prototype", "update", "callback", "s", "this", "__s", "state", "assign", "props", "__v", "_sb", "push", "enqueueRender", "forceUpdate", "__h", "render", "Fragment", "rerenderQueue", "defer", "Promise", "then", "bind", "resolve", "setTimeout", "depthSort", "a", "b", "__b", "process", "__r", "_id", "Math", "random", "toString", "EVENT_DISPATCHED", "EVENT_ATTACHED", "CAPTURE_REGEX", "eventClock", "eventProxy", "createEventProxy", "eventProxyCapture", "i", "vnodeId", "createVNode", "type", "props", "key", "isStaticChildren", "__source", "__self", "ref", "i", "normalizedProps", "vnode", "__k", "__", "__b", "__e", "__c", "constructor", "__v", "vnodeId", "__i", "__u", "defaultProps", "options", "BasePlugin", "uppy", "opts", "plugins", "update", "newOpts", "translator", "Translator", "plugin", "state", "EventManager", "#uppy", "#events", "uppy", "event", "fn", "fileID", "cb", "file", "isPaused", "eventHandler", "args", "justErrorsLogger", "args", "getTimeStamp", "debugLogger", "import_prettier_bytes", "import_mime_match", "defaultOptions", "RestrictionError", "message", "opts", "Restricter", "getOpts", "getI18n", "existingFiles", "addingFiles", "maxTotalFileSize", "maxNumberOfFiles", "f", "totalFilesSize", "total", "prettierBytes", "file", "maxFileSize", "minFileSize", "allowedFileTypes", "type", "match", "allowedFileTypesString", "addingFile", "files", "minNumberOfFiles", "error", "requiredMetaFields", "missingFields", "field", "debounce", "fn", "calling", "latestArgs", "args", "UIPlugin", "_UIPlugin", "BasePlugin", "#updateUI", "target", "targetPlugin", "Target", "p", "plugin", "callerPluginName", "targetElement", "findDOMElement_default", "uppyRootElement", "state", "R", "getTextDirection_default", "message", "container", "UIPlugin_default", "package_default", "DefaultStore", "package_default", "#callbacks", "patch", "prevState", "nextState", "#publish", "listener", "args", "lib_default", "import_throttle", "import_namespace_emitter", "urlAlphabet", "nanoid", "size", "id", "i", "urlAlphabet", "package_default", "getFileName", "fileType", "fileDescriptor", "locale_default", "supportsUploadProgress", "userAgent", "m", "version", "major", "minor", "defaultUploadState", "Uppy", "_Uppy", "package_default", "#plugins", "#restricter", "#storeUnsubscribe", "#emitter", "ee", "#preProcessors", "#uploaders", "#postProcessors", "opts", "locale_default", "defaultOptions", "file", "files", "lib_default", "justErrorsLogger", "merged", "debugLogger", "supportsUploadProgress", "Restricter", "prevState", "nextState", "patch", "#addListeners", "event", "args", "callback", "state", "plugin", "filesWithNewState", "existingFilesState", "fileID", "newFileState", "onMissingKey", "key", "translator", "Translator", "newOpts", "defaultProgress", "updatedFiles", "capabilities", "currentUploads", "fn", "data", "updatedMeta", "newMeta", "ids", "id", "filesObject", "totalProgress", "error", "inProgressFiles", "newFiles", "startedFiles", "uploadStartedFiles", "pausedFiles", "completeFiles", "erroredFiles", "inProgressNotPausedFiles", "processingFiles", "progress", "#informAndEmit", "errors", "userFacingErrors", "maxNumToShow", "firstErrors", "additionalErrors", "message", "details", "err", "existingFiles", "#checkRequiredMetaFieldsOnFile", "missingFields", "#checkRequiredMetaFields", "success", "#assertNewUploadAllowed", "allowNewUpload", "RestrictionError", "#transformFile", "fileDescriptorOrFile", "fileType", "getFileType", "fileName", "getFileName", "fileExtension", "getFileNameAndExtension", "getSafeFileId", "meta", "size", "#startIfAutoProceed", "#checkAndUpdateFileState", "filesToAdd", "nextFilesState", "validFilesToAdd", "fileToAdd", "newFile", "existingFile", "isGhost", "onBeforeFileAddedResult", "restrictionErrors", "firstValidFileToAdd", "fileDescriptors", "nonRestrictionErrors", "subError", "fileIDs", "updatedUploads", "removedFiles", "fileIsNotRemoved", "uploadFileID", "uploadID", "newFileIDs", "stateUpdate", "#updateTotalProgressThrottled", "removedFileIDs", "isPaused", "updatedFile", "#getFilesToRetry", "fileId", "#doRetryAll", "filesToRetry", "#createUpload", "#runUpload", "result", "#handleUploadProgress", "fileInState", "newProgress", "#updateTotalProgress", "#calculateTotalProgress", "totalProgressPercent", "throttle", "filesInProgress", "isSizedFile", "sizedFilesInProgress", "unsizedFilesInProgress", "totalFilesSize", "acc", "totalUploadedSize", "errorHandler", "response", "errorMsg", "newError", "uploadStalledWarningRecentlyEmitted", "onUploadStarted", "filesFiltered", "exists", "filesState", "uploadResp", "currentProgress", "needsPostProcessing", "fileIn", "_deleted", "#updateOnlineStatus", "Plugin", "msg", "pluginId", "existsPluginAlready", "plugins", "foundPlugin", "type", "method", "instance", "list", "index", "item", "updatedState", "info", "duration", "isComplexMessage", "logger", "#requestClientById", "client", "requestClient", "forceAllowNewUpload", "nanoid", "#getUpload", "currentUpload", "#removeUpload", "getCurrentUpload", "steps", "step", "successful", "failed", "retryResult", "onBeforeUploadResult", "currentlyUploadingFiles", "curr", "waitingFileIDs", "Uppy_default", "package_default", "locale_default", "buildResponseError", "xhr", "err", "error", "isNetworkError_default", "NetworkError_default", "setTypeInBlob", "file", "defaultOptions", "XHRUpload", "BasePlugin", "package_default", "#getFetcher", "#queue", "uppy", "opts", "locale_default", "TaskQueue", "files", "url", "options", "res", "fetcher", "retryCount", "timeout", "seconds", "event", "id", "body", "cause", "uploadURL", "request", "overrides", "headers", "formData", "meta", "getAllowedMetaFields", "item", "value", "subItem", "formPost", "dataWithUpdatedType", "#uploadLocalFile", "events", "EventManager", "controller", "signal", "fetch", "endpoint", "#uploadBundle", "abort", "optsFromState", "#getCompanionClientArgs", "allowedMetaFields", "name", "#uploadFiles", "getQueue", "removedHandler", "removedFile", "#handleUpload", "fileIDs", "filesFiltered", "filterFilesToUpload", "filesToEmit", "filterFilesToEmitUploadStarted", "capabilities", "package_default", "locale_default", "StatusBarStates_default", "import_classnames", "import_prettier_bytes", "import_classnames", "DOT", "renderDot", "UploadBtn", "props", "newFiles", "isUploadStarted", "recoveredState", "i18n", "uploadState", "isSomeGhost", "startUpload", "uploadBtnClassNames", "classNames", "StatusBarStates_default", "uploadBtnText", "u", "RetryBtn", "uppy", "CancelBtn", "PauseResumeButton", "isAllPaused", "isAllComplete", "resumableUploads", "title", "togglePauseResume", "DoneBtn", "doneButtonHandler", "LoadingSpinner", "ProgressBarProcessing", "progress", "value", "mode", "message", "ProgressDetails", "numUploads", "complete", "totalUploadedSize", "totalSize", "totalETA", "ifShowFilesUploadedOfTotal", "totalUploadedSizeStr", "prettierBytes", "prettyETA", "FileUploadCount", "UploadNewlyAddedFiles", "ProgressBarUploading", "supportsUploadProgress", "totalProgress", "showProgressDetails", "showUploadNewlyAddedFiles", "renderProgressDetails", "ProgressBarComplete", "ProgressBarError", "error", "displayErrorAlert", "errorMessage", "calculateProcessingProgress", "files", "values", "mode", "message", "progress", "preprocess", "postprocess", "value", "total", "progressValue", "STATE_ERROR", "STATE_WAITING", "STATE_PREPROCESSING", "STATE_UPLOADING", "STATE_POSTPROCESSING", "STATE_COMPLETE", "StatusBarStates_default", "StatusBarUI", "newFiles", "allowNewUpload", "isUploadInProgress", "isAllPaused", "resumableUploads", "error", "hideUploadButton", "hidePauseResumeButton", "hideCancelButton", "hideRetryButton", "recoveredState", "uploadState", "totalProgress", "files", "supportsUploadProgress", "hideAfterFinish", "isSomeGhost", "doneButtonHandler", "isUploadStarted", "i18n", "startUpload", "uppy", "isAllComplete", "showProgressDetails", "numUploads", "complete", "totalSize", "totalETA", "totalUploadedSize", "getProgressValue", "progress", "calculateProcessingProgress", "getIsIndeterminate", "mode", "progressValue", "width", "showUploadBtn", "showCancelBtn", "showPauseResumeBtn", "showRetryBtn", "showDoneBtn", "progressClassNames", "classNames", "statusBarClassNames", "progressBarStateEl", "u", "ProgressBarProcessing", "ProgressBarComplete", "ProgressBarError", "ProgressBarUploading", "UploadBtn", "RetryBtn", "PauseResumeButton", "CancelBtn", "DoneBtn", "speedFilterHalfLife", "ETAFilterHalfLife", "getUploadingState", "error", "isAllComplete", "recoveredState", "files", "StatusBarStates_default", "state", "fileIDs", "i", "progress", "defaultOptions", "StatusBar", "UIPlugin_default", "package_default", "#lastUpdateTime", "#previousUploadedBytes", "#previousSpeed", "#previousETA", "uppy", "opts", "locale_default", "#computeSmoothETA", "totalBytes", "remaining", "dt", "uploadedBytesSinceLastTick", "currentSpeed", "filteredSpeed", "emaFilter", "instantETA", "updatedPreviousETA", "filteredETA", "capabilities", "allowNewUpload", "totalProgress", "newFiles", "startedFiles", "completeFiles", "isUploadStarted", "isAllPaused", "isUploadInProgress", "isSomeGhost", "newFilesOrRecovered", "resumableUploads", "supportsUploadProgress", "totalSize", "totalUploadedSize", "f", "file", "totalETA", "StatusBarUI", "element", "getTextDirection_default", "#onUploadStart", "pv", "target", "Uppy_default", "XHRUpload", "StatusBar"]
}
