0?p(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=A[v])||d&&k.key==d.key&&k.type===d.type)A[v]=void 0;else for(h=0;h2&&(f.children=arguments.length>3?n.call(arguments,2):t),p(l.type,f,i||l.key,r||l.ref,null)},exports.createContext=function(n,l){var u={__c:l=\"__cC\"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(x)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u},exports.createElement=h,exports.createRef=function(){return{current:null}},exports.h=h,exports.hydrate=function n(l,u){N(l,u,n)},exports.isValidElement=t,exports.options=l,exports.render=N,exports.toChildArray=function n(l,u){return u=u||[],null==l||\"boolean\"==typeof l||(Array.isArray(l)?l.some(function(l){n(l,u)}):u.push(l)),u};\n//# sourceMappingURL=preact.js.map\n","\"use strict\";\n\nconst isDOMElement = require('./isDOMElement');\n/**\n * Find a DOM element.\n *\n * @param {Node|string} element\n * @returns {Node|null}\n */\n\n\nmodule.exports = function findDOMElement(element, context) {\n if (context === void 0) {\n context = document;\n }\n\n if (typeof element === 'string') {\n return context.querySelector(element);\n }\n\n if (isDOMElement(element)) {\n return element;\n }\n\n return null;\n};","\"use strict\";\n\n/**\n * Check if an object is a DOM element. Duck-typing based on `nodeType`.\n *\n * @param {*} obj\n */\nmodule.exports = function isDOMElement(obj) {\n return (obj == null ? void 0 : obj.nodeType) === Node.ELEMENT_NODE;\n};","\"use strict\";\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 */\nconst Translator = require('@uppy/utils/lib/Translator');\n\nmodule.exports = class BasePlugin {\n constructor(uppy, opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n this.uppy = uppy;\n this.opts = opts;\n }\n\n getPluginState() {\n const {\n plugins\n } = this.uppy.getState();\n return plugins[this.id] || {};\n }\n\n setPluginState(update) {\n const {\n plugins\n } = this.uppy.getState();\n this.uppy.setState({\n plugins: { ...plugins,\n [this.id]: { ...plugins[this.id],\n ...update\n }\n }\n });\n }\n\n setOptions(newOpts) {\n this.opts = { ...this.opts,\n ...newOpts\n };\n this.setPluginState(); // so that UI re-renders with new options\n\n this.i18nInit();\n }\n\n i18nInit() {\n const translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale]);\n this.i18n = translator.translate.bind(translator);\n this.i18nArray = translator.translateArray.bind(translator);\n this.setPluginState(); // 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 // eslint-disable-next-line class-methods-use-this\n\n\n addTarget() {\n throw new Error('Extend the addTarget method to add your plugin to another plugin\\'s target');\n } // eslint-disable-next-line class-methods-use-this\n\n\n install() {} // eslint-disable-next-line class-methods-use-this\n\n\n uninstall() {}\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\n\n render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n } // eslint-disable-next-line class-methods-use-this\n\n\n update() {} // Called after every state update, after everything's mounted. Debounced.\n // eslint-disable-next-line class-methods-use-this\n\n\n afterUpdate() {}\n\n};","\"use strict\";\n\nfunction _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\n\nvar id = 0;\n\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n\nconst {\n render\n} = require('preact');\n\nconst findDOMElement = require('@uppy/utils/lib/findDOMElement');\n\nconst BasePlugin = require('./BasePlugin');\n/**\n * Defer a frequent call to the microtask queue.\n *\n * @param {() => T} fn\n * @returns {Promise}\n */\n\n\nfunction debounce(fn) {\n let calling = null;\n let latestArgs = null;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n latestArgs = args;\n\n if (!calling) {\n calling = Promise.resolve().then(() => {\n calling = null; // 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\n return fn(...latestArgs);\n });\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 */\n\n\nvar _updateUI = /*#__PURE__*/_classPrivateFieldLooseKey(\"updateUI\");\n\nclass UIPlugin extends BasePlugin {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, _updateUI, {\n writable: true,\n value: void 0\n });\n }\n\n /**\n * Check if supplied `target` is a DOM element or an `object`.\n * If it’s an object — 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\n if (targetElement) {\n this.isTargetDOMEl = true; // When target is with a single element,\n // Preact thinks it’s 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\n const uppyRootElement = document.createDocumentFragment(); // API for plugins that require a synchronous rerender.\n\n _classPrivateFieldLooseBase(this, _updateUI)[_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.close\n // hence the check\n if (!this.uppy.getPlugin(this.id)) return;\n render(this.render(state), uppyRootElement);\n this.afterUpdate();\n });\n this.uppy.log(`Installing ${callerPluginName} to a DOM element '${target}'`);\n\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 — Preact just adds null into target, not replacing\n targetElement.innerHTML = '';\n }\n\n render(this.render(this.uppy.getState()), uppyRootElement);\n this.el = uppyRootElement.firstElementChild;\n targetElement.appendChild(uppyRootElement);\n this.onMount();\n return this.el;\n }\n\n let targetPlugin;\n\n if (typeof target === 'object' && target instanceof UIPlugin) {\n // Targeting a plugin *instance*\n targetPlugin = target;\n } else if (typeof target === 'function') {\n // Targeting a plugin type\n const Target = target; // Find the target plugin instance.\n\n this.uppy.iteratePlugins(p => {\n if (p instanceof Target) {\n targetPlugin = p;\n return false;\n }\n });\n }\n\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\n this.uppy.log(`Not installing ${callerPluginName}`);\n let message = `Invalid target option given to ${callerPluginName}.`;\n\n if (typeof target === 'function') {\n message += ' The given target is not a Plugin class. ' + 'Please check that you\\'re not specifying a React Component instead of a plugin. ' + 'If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: ' + 'run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.';\n } else {\n message += 'If you meant to target an HTML element, please make sure that the element exists. ' + 'Check that the